draw.io is a JavaScript, client-side editor for general diagramming.
29.6.5 release
David Bensondd760c6f2648
diff --git a/ChangeLog b/ChangeLogindex 3747411cd..844d2935c 100644--- a/ChangeLog+++ b/ChangeLog@@ -1,3 +1,23 @@+23-MAR-2026: 29.6.5++- Corrects dashboard path+- Avoid InlineToolbar overlapping edge segments+- Remove embedded XML from images copied to clipboard+- Add showLinkIcons and showTooltipIcons support to GraphViewer+- Fix word wrapping mismatch in autosizeText in-place editor+- Fix MathJax path in embed dev mode+- Fix fill patterns to scale correctly with diagram zoom level+- Fix touch input on Android tablets using Chrome desktop site mode+- Fixes wrong SVG scaling in desktop PNG export [drawio-desktop#1954]+- Adds intersectionSelect configuration switch [drawio#5508]+- Fixes undo for initial fill style change (eg. from auto to hatch)+- Fixes Cmd+, for Chrome settings on macOS+- Fixes fill pattern offset shifting on zoom and window resize+- Add exportProtocol and diffSync options to JSON embed protocol+- Adds configurable shape picker via Editor.configure() [jgraph/drawio#1812,jgraph/drawio#1197,jgraph/drawio#4130,jgraph/drawio#3783]+- Marks imported files with updates page links as dirty [DID-17660]+- Opens draw.io/VSDX files in same window when dropped on blank file+18-MAR-2026: 29.6.4- Tidies changelogdiff --git a/VERSION b/VERSIONindex 62237f85b..36bd843fe 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-29.6.4\ No newline at end of file+29.6.5\ No newline at end of filediff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.jsindex 44624dbdb..3f8743023 100644--- a/src/main/webapp/js/app.min.js+++ b/src/main/webapp/js/app.min.js@@ -69,7 +69,7 @@ b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io"))}})();"1"==urlPa"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:"29.6.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/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"29.6.5",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||@@ -209,7 +209,7 @@ a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;f[],e=0,f=0;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)||null==g.pointerId||d.push(g)}),mxUtils.bind(this,function(g){if(!mxEvent.isMouseEvent(g)&&2==d.length){for(var k=0;k<d.length;k++)if(g.pointerId==d[k].pointerId){d[k]=g;break}g=Math.abs(d[0].clientX-d[1].clientX);k=Math.abs(d[0].clientY-d[1].clientY);var l=Math.abs(g-e),m=Math.abs(k-f);if(l>mxEvent.PINCH_THRESHOLD||m>mxEvent.PINCH_THRESHOLD)a(d[0],l>m?g>e:k>f,!0,d[0].clientX+(d[1].clientX-d[0].clientX)/2,d[0].clientY+(d[1].clientY-d[0].clientY)/2),e=g,f=k}}),mxUtils.bind(this,function(g){d=[];f=e=0}))}mxEvent.addListener(b,"wheel",function(g){null==g&&(g=window.event);g.ctrlKey&&g.preventDefault();(.5<Math.abs(g.deltaX)||.5<Math.abs(g.deltaY))&&a(g,0==g.deltaY?0<-g.deltaX:0<-g.deltaY)})}},disableContextMenu:function(a){mxEvent.addListener(a,"contextmenu",function(b){b.preventDefault&&b.preventDefault();return!1})},getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.type&&0==a.type.indexOf("touch")},isPenEvent:function(a){return null!=a.pointerType?"pen"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_PEN:null!=a.type&&0==a.type.indexOf("pen")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&null!=a.touches&&1<a.touches.length},isMouseEvent:function(a){return!mxClient.IS_ANDROID&&-mxClient.IS_LINUX&&mxClient.IS_GC?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||+mxClient.IS_LINUX&&mxClient.IS_GC&&1>=navigator.maxTouchPoints?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){"touchstart"!=a.type&&"touchmove"!=a.type||null==a.touches||null==a.touches[0]?"touchend"==a.type&&null!=a.changedTouches&&null!=a.changedTouches[0]&&(a=a.changedTouches[0]):a=a.touches[0];return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},preventDefault:function(a){mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(b){b.preventDefault()}))},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CONNECT_HANDLE:-3,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1E5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",DOCK:"dock",UNDOCK:"undock",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",@@ -384,8 +384,8 @@ mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var r=this.createElement("text");r.setAttribute("x",this.format(a));r.setAttribute("y",this.format(b));r.setAttribute("w",this.format(c));r.setAttribute("h",this.format(d));r.setAttribute("str",e);null!=f&&r.setAttribute("align",f);null!=g&&r.setAttribute("valign",g);r.setAttribute("wrap",k?"1":"0");null==l&&(l="");r.setAttribute("format",l);null!=m&&r.setAttribute("overflow",m);null!=n&&r.setAttribute("clip",n?"1":"0");null!=p&&r.setAttribute("rotation",p);null!=q&&r.setAttribute("dir",q);this.root.appendChild(r)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};-function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):b.appendChild(this.defs)),-this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);+function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=this.viewTranslate=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):+b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.cacheOffsetSize=!0;mxSvgCanvas2D.prototype.allowConvertHtmlToSvg=!1;mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&a.setAttribute("style",b)};mxSvgCanvas2D.prototype.getLightDarkColor=function(a){return mxUtils.getLightDarkColor(a,null,null,"simple"==this.adaptiveColors)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};@@ -400,25 +400,25 @@ mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkCok.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement(e==mxConstants.DIRECTION_RADIAL?"radialGradient":"linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%");e=this.createElement("stop");e.setAttribute("offset","0%");e.setAttribute("stop-color",a.light);e.style.stopColor=a.cssText;e.setAttribute("stop-opacity",c);e.style.stopOpacity=c;f.appendChild(e);e=this.createElement("stop");e.setAttribute("offset","100%");e.setAttribute("stop-color",b.light);e.style.stopColor=b.cssText;e.setAttribute("stop-opacity",d);e.style.stopOpacity=d;f.appendChild(e);return f};-mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c){return("mx-pattern-"+a+"-"+b+"-"+c).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};-mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=-this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}return f.getAttribute("id")};-mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;-e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a=.5*a*c;c=this.format(1.5*(10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format((10+a)*c);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};+mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c,d){return("mx-pattern-"+a+"-"+b+"-"+c+"-"+Math.round(100*d)).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};+mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText,d),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=+this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}c=this.viewTranslate;b=null!=c?this.format(c.x*d):0;c=null!=c?this.format(c.y*d):0;f.setAttribute("patternTransform","translate("+b+","+c+")"+("dots"!==a?" rotate(45)":"")+" scale("+d+")");return f.getAttribute("id")};+mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");+d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a*=.5;c=this.format(1.5*(10+a));var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);+e.setAttribute("fill","none");d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format(10+a);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};mxSvgCanvas2D.prototype.addTitle=function(a){if(null!=a&&null!=this.title){var b=this.createElement("title");mxUtils.write(b,this.title);a.appendChild(b)}return a};mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,this.getCurrentStrokeWidth(),c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill",-"url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",+"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -498,7 +498,7 @@ mxShape.prototype.getShadowStyle=function(){var a={dx:mxConstants.SHADOW_OFFSET_a.color),a.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OPACITY,a.opacity));return a};mxShape.prototype.createDropShadow=function(a,b){var c=mxUtils.getLightDarkColor(a.color,a.opacity/100);return"drop-shadow("+Math.round(a.dx*b*100)/100+"px "+Math.round(a.dy*b*100)/100+"px "+Math.round(a.blur*b*100)/100+"px "+c.cssText+")"};mxShape.prototype.updateSvgFilters=function(a){this.node.style.filter=this.isShadowEnabled()?this.createDropShadow(this.getShadowStyle(),a):""};mxShape.prototype.isShadowEnabled=function(){return this.isShadow};mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.beforePaint(a),this.paint(a),this.afterPaint(a),this.destroyCanvas(a))};mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement&&(a=this.createSvgCanvas());null!=a&&this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){},a.image=function(){},a.text=function(){});return a};-mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};+mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;a.viewTranslate=this.viewTranslate;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity="+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var c=this.fill,d=this.gradient,e="0",f={east:0,south:1,west:2,north:3},g=null!=this.direction?f[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+f[this.gradientDirection]-1,4));1==g?(e="1",f=c,c=d,d=f):2==g?(f=c,c=d,d=f):3==g&&(e="1");b+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+c+"', endColorStr='"+d+"', gradientType='"+e+"')"}a.style.filter=b};@@ -520,10 +520,10 @@ mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=nu1,b.length)];l<b.length-2&&0==Math.round(m.x-g.x)&&0==Math.round(m.y-g.y);)m=b[mxUtils.mod(l+2,b.length)],l++;n=m.x-g.x;m=m.y-g.y;p=Math.max(1,Math.sqrt(n*n+m*m));n=g.x+n*Math.min(d,p/2)/p;m=g.y+m*Math.min(d,p/2)/p;a.quadTo(g.x,g.y,n,m);g=new mxPoint(n,m)}else a.lineTo(g.x,g.y);m=g;l++}e?a.close():a.lineTo(k.x,k.y)}};mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,-this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,this.fillStyle);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,-mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,-mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=-1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};+this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,null);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,+this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,+0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=1==mxUtils.getValue(this.style,+mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return!1};mxShape.prototype.getSvgBoundingBox=function(){var a=null;if(null!=this.node&&null!=this.node.ownerSVGElement)try{var b=this.node.getBBox();0<b.width&&0<b.height&&(a=new mxRectangle(b.x,b.y,b.width,b.height),null!=this.stroke&&a.grow(this.strokewidth*this.scale/2))}catch(c){}return a};mxShape.prototype.getShapeBoundingBox=function(){var a=null;if(null!=this.bounds&&(a=this.createBoundingBox(),null!=a)){this.augmentBoundingBox(a);var b=this.getShapeRotation();0!=b&&(a=mxUtils.getBoundingBox(a,b))}return a};mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a};mxShape.prototype.augmentBoundingBox=function(a){if(this.isShadow){var b=this.getShadowStyle();0>b.dx&&(a.x+=b.dx,a.width-=b.dx);0>b.dy&&(a.y+=b.dy,a.height-=b.dy);a.grow(Math.max(b.blur,0)*this.scale*2);a.width+=Math.ceil(Math.max(b.dx,0)*this.scale);a.height+=Math.ceil(Math.max(b.dy,0)*this.scale)}null!=this.stroke&&a.grow(this.strokewidth*this.scale/2)};@@ -1073,7 +1073,7 @@ mxCellRenderer.prototype.rotateLabelBounds=function(a,b,c,d,e){var f=null!=d?d:cvar g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(f==mxConstants.ALIGN_CENTER&&null==k?c.spacingLeft*d+c.spacingRight*d:0));b.height=Math.max(0,b.height-(g==mxConstants.ALIGN_MIDDLE?c.spacingTop*d+c.spacingBottom*d:0))}e=e?0:c.getTextRotation();0!=e&&null!=a&&a.view.graph.model.isVertex(a.cell)&&(c=a.getCenterX(),a=a.getCenterY(),b.x!=c||b.y!=a)&&(e*=Math.PI/180,a=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(e),Math.sin(e),new mxPoint(c,a)),b.x=a.x,b.y=a.y)};mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(g,k){g=k.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var l=g.getCenterX(),m=g.getCenterY();m=mxUtils.getRotatedPoint(new mxPoint(l,m),e,f,new mxPoint(a.getCenterX(),a.getCenterY()));l=m.x;m=m.y;g.x=Math.round(l--g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.redraw()})}};+g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.viewTranslate=a.view.translate,k.redraw()})}};mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+b*d,f=a.y+c*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var k=(a.width-a.height)/2;e+=k;f-=k}0!=g&&(k=mxUtils.toRadians(g),g=Math.cos(k),k=Math.sin(k),f=mxUtils.getRotatedPoint(new mxPoint(e,f),g,k,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};@@ -1082,8 +1082,8 @@ a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSiblinmxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))};mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a),this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a),-null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};-mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};+null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,a.shape.viewTranslate=a.view.translate,(null==c||c)&&this.doRedrawShape(a),e=!0);+return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));@@ -2058,8 +2058,8 @@ var ErrorDialog=function(a,b,e,f,g,d,h,l,t,k,v){t=null!=t?t:!0;var u=document.cr"nowrap";y.style.textOverflow="ellipsis";y.style.overflow="hidden";y.style.flexShrink="0";mxUtils.write(y,b);y.setAttribute("title",b);u.appendChild(y)}b=document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.style.flexGrow="1";b.style.overflowY="auto";"string"===typeof e&&(e=e.replace(/\n/g,"<br/>"));b.innerHTML=Graph.sanitizeHtml(e);u.appendChild(b);e=document.createElement("div");e.style.marginTop="12px";e.style.textAlign="center";null!=d&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();d()}),b.className="geBtn",e.appendChild(b),e.style.textAlign="center");null!=k&&(k=mxUtils.button(k,function(){null!=v&&v()}),k.className="geBtn",e.appendChild(k));var z=mxUtils.button(f,function(){t&&a.hideDialog();null!=g&&g()});z.className="geBtn";e.appendChild(z);null!=h&&(f=mxUtils.button(h,function(){t&&a.hideDialog();null!=l&&l()}),f.className="geBtn gePrimaryBtn",e.appendChild(f));this.init=function(){z.focus()};u.appendChild(e);this.container=u},PrintDialog=function(a,b,e,f){this.create(a,b,e,f)};-PrintDialog.prototype.create=function(a){function b(z){var F=h.checked||k.checked,D=parseInt(u.value)/100;isNaN(D)&&(D=1,u.value="100%");mxClient.IS_SF&&(D*=.75);var G=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,H=1/e.pageScale;if(F){var M=h.checked?1:parseInt(v.value);isNaN(M)||(H=mxUtils.getScaleForPageCount(M,e,G))}var N=M=0;G=mxRectangle.fromRectangle(G);G.width=Math.ceil(G.width*D);G.height=Math.ceil(G.height*D);H*=D;!F&&e.pageVisible?(D=e.getPageLayout(),M-=D.x*G.width,N-=D.y*G.height):-F=!0;F=PrintDialog.createPrintPreview(e,H,G,0,M,N,F);F.open();z&&PrintDialog.printPreview(F)}var e=a.editor.graph,f=document.createElement("table");f.style.width="100%";f.style.height="100%";var g=document.createElement("tbody");var d=document.createElement("tr");var h=document.createElement("input");h.setAttribute("type","checkbox");var l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";l.appendChild(h);var t=document.createElement("span");mxUtils.write(t," "+mxResources.get("fitPage"));+PrintDialog.prototype.create=function(a){function b(z){var E=h.checked||k.checked,D=parseInt(u.value)/100;isNaN(D)&&(D=1,u.value="100%");mxClient.IS_SF&&(D*=.75);var G=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,H=1/e.pageScale;if(E){var M=h.checked?1:parseInt(v.value);isNaN(M)||(H=mxUtils.getScaleForPageCount(M,e,G))}var N=M=0;G=mxRectangle.fromRectangle(G);G.width=Math.ceil(G.width*D);G.height=Math.ceil(G.height*D);H*=D;!E&&e.pageVisible?(D=e.getPageLayout(),M-=D.x*G.width,N-=D.y*G.height):+E=!0;E=PrintDialog.createPrintPreview(e,H,G,0,M,N,E);E.open();z&&PrintDialog.printPreview(E)}var e=a.editor.graph,f=document.createElement("table");f.style.width="100%";f.style.height="100%";var g=document.createElement("tbody");var d=document.createElement("tr");var h=document.createElement("input");h.setAttribute("type","checkbox");var l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";l.appendChild(h);var t=document.createElement("span");mxUtils.write(t," "+mxResources.get("fitPage"));l.appendChild(t);mxEvent.addListener(t,"click",function(z){h.checked=!h.checked;k.checked=!h.checked;mxEvent.consume(z)});mxEvent.addListener(h,"change",function(){k.checked=!h.checked});d.appendChild(l);g.appendChild(d);d=d.cloneNode(!1);var k=document.createElement("input");k.setAttribute("type","checkbox");l=document.createElement("td");l.style.fontSize="10pt";l.appendChild(k);t=document.createElement("span");mxUtils.write(t," "+mxResources.get("posterPrint")+":");l.appendChild(t);mxEvent.addListener(t,"click",function(z){k.checked=!k.checked;h.checked=!k.checked;mxEvent.consume(z)});d.appendChild(l);var v=document.createElement("input");v.setAttribute("value","1");v.setAttribute("type","number");v.setAttribute("min","1");v.setAttribute("size","4");v.setAttribute("disabled","disabled");v.style.width="50px";l=document.createElement("td");l.style.fontSize="10pt";l.appendChild(v);mxUtils.write(l," "+mxResources.get("pages")+" (max)");d.appendChild(l);g.appendChild(d);mxEvent.addListener(k,"change",function(){k.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");h.checked=!k.checked});d=d.cloneNode(!1);l=document.createElement("td");mxUtils.write(l,mxResources.get("pageScale")+":");d.appendChild(l);l=document.createElement("td");var u=document.createElement("input");u.setAttribute("value","100 %");u.setAttribute("size","5");u.style.width="50px";l.appendChild(u);d.appendChild(l);g.appendChild(d);d=document.createElement("tr");l=document.createElement("td");l.colSpan=2;@@ -2071,14 +2071,14 @@ var PageSetupDialog=function(a){function b(){var D=u;null!=D&&null!=D.originalSrvar d=document.createElement("tr");var h=document.createElement("td");h.style.verticalAlign="top";h.style.fontSize="10pt";mxUtils.write(h,mxResources.get("paperSize")+":");d.appendChild(h);h=document.createElement("td");h.style.verticalAlign="top";h.style.fontSize="10pt";var l=PageSetupDialog.addPageFormatPanel(h,"pagesetupdialog",e.pageFormat);d.appendChild(h);g.appendChild(d);d=document.createElement("tr");h=document.createElement("td");mxUtils.write(h,mxResources.get("gridSize")+":");d.appendChild(h);h=document.createElement("td");h.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=e.getGridSize();h.appendChild(t);mxEvent.addListener(t,"change",function(){var D=parseInt(t.value);t.value=Math.max(1,isNaN(D)?e.getGridSize():D)});d.appendChild(h);g.appendChild(d);d=document.createElement("tr");h=document.createElement("td");mxUtils.write(h,mxResources.get("background")+":");d.appendChild(h);h=document.createElement("td");var k=document.createElement("button");k.className="geBtn";k.style.margin="0px";mxUtils.write(k,mxResources.get("change")+"...");var v=document.createElement("div");v.style.display="inline-block";v.style.verticalAlign="middle";v.style.backgroundPosition="center center";v.style.backgroundRepeat="no-repeat";v.style.backgroundSize="contain";v.style.border="1px solid lightGray";v.style.borderRadius="4px";v.style.marginRight="14px";v.style.height="32px";-v.style.width="64px";v.style.cursor="pointer";v.style.padding="4px";var u=e.backgroundImage,y=e.background,z=e.shadowVisible,F=function(D){a.showBackgroundImageDialog(function(G,H,M,N){H||(null!=G&&null!=G.src&&Graph.isPageLink(G.src)&&(G={originalSrc:G.src}),u=G,z=N);y=M;b()},u,y,!0);mxEvent.consume(D)};mxEvent.addListener(k,"click",F);mxEvent.addListener(v,"click",F);b();h.appendChild(v);h.appendChild(k);d.appendChild(h);g.appendChild(d);d=document.createElement("tr");h=document.createElement("td");-h.colSpan=2;h.style.paddingTop="16px";h.setAttribute("align","right");k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&h.appendChild(k);F=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var D=parseInt(t.value);isNaN(D)||e.gridSize===D||e.setGridSize(D);D=new ChangePageSetup(a,y,u,l.get());D.ignoreColor=e.background==y;D.ignoreImage=(null!=e.backgroundImage?e.backgroundImage.src:null)===(null!=u?u.src:null);null!=z&&-(D.shadowVisible=z);e.pageFormat.width==D.previousFormat.width&&e.pageFormat.height==D.previousFormat.height&&D.ignoreColor&&D.ignoreImage&&D.shadowVisible==e.shadowVisible||e.model.execute(D)});F.className="geBtn gePrimaryBtn";h.appendChild(F);a.editor.cancelFirst||h.appendChild(k);d.appendChild(h);g.appendChild(d);f.appendChild(g);this.container=f};+v.style.width="64px";v.style.cursor="pointer";v.style.padding="4px";var u=e.backgroundImage,y=e.background,z=e.shadowVisible,E=function(D){a.showBackgroundImageDialog(function(G,H,M,N){H||(null!=G&&null!=G.src&&Graph.isPageLink(G.src)&&(G={originalSrc:G.src}),u=G,z=N);y=M;b()},u,y,!0);mxEvent.consume(D)};mxEvent.addListener(k,"click",E);mxEvent.addListener(v,"click",E);b();h.appendChild(v);h.appendChild(k);d.appendChild(h);g.appendChild(d);d=document.createElement("tr");h=document.createElement("td");+h.colSpan=2;h.style.paddingTop="16px";h.setAttribute("align","right");k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&h.appendChild(k);E=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var D=parseInt(t.value);isNaN(D)||e.gridSize===D||e.setGridSize(D);D=new ChangePageSetup(a,y,u,l.get());D.ignoreColor=e.background==y;D.ignoreImage=(null!=e.backgroundImage?e.backgroundImage.src:null)===(null!=u?u.src:null);null!=z&&+(D.shadowVisible=z);e.pageFormat.width==D.previousFormat.width&&e.pageFormat.height==D.previousFormat.height&&D.ignoreColor&&D.ignoreImage&&D.shadowVisible==e.shadowVisible||e.model.execute(D)});E.className="geBtn gePrimaryBtn";h.appendChild(E);a.editor.cancelFirst||h.appendChild(k);d.appendChild(h);g.appendChild(d);f.appendChild(g);this.container=f};PageSetupDialog.addPageFormatPanel=function(a,b,e,f){b="format-"+b;var g=document.createElement("input");g.setAttribute("name",b);g.setAttribute("type","radio");g.setAttribute("value","portrait");var d=document.createElement("input");d.setAttribute("name",b);d.setAttribute("type","radio");d.setAttribute("value","landscape");var h=document.createElement("select");h.style.position="relative";h.style.marginBottom="4px";h.style.borderRadius="4px";h.style.borderWidth="1px";h.style.borderStyle="solid";h.style.boxSizing="border-box";h.style.padding="2px";h.style.width="210px";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.marginLeft="4px";l.style.width="210px";l.style.height="24px";g.style.marginRight="6px";l.appendChild(g);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));l.appendChild(b);d.style.marginLeft="10px";d.style.marginRight="6px";l.appendChild(d);var t=document.createElement("span");t.style.width="100px";mxUtils.write(t,mxResources.get("landscape"));l.appendChild(t);var k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.fontSize="12px";k.style.width="210px";k.style.height="24px";var v=document.createElement("input");v.setAttribute("size","6");v.setAttribute("title",mxResources.get("width"));v.style.textAlign="right";k.appendChild(v);mxUtils.write(k," x ");var u=document.createElement("input");u.setAttribute("size","6");u.setAttribute("title",mxResources.get("height"));u.style.textAlign="right";k.appendChild(u);-var y=document.createElement("select");y.style.marginLeft="4px";y.style.boxSizing="border-box";for(var z=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],F=0;F<z.length;F++){var D=document.createElement("option");D.setAttribute("value",z[F].unit);mxUtils.write(D,z[F].label);y.appendChild(D)}y.value=Editor.pageSizeUnit;k.appendChild(y);l.style.display="none";k.style.display=-"none";var G={},H=PageSetupDialog.getFormats();for(F=0;F<H.length;F++)z=H[F],G[z.key]=z,D=document.createElement("option"),D.setAttribute("value",z.key),mxUtils.write(D,z.title),h.appendChild(D);var M=function(){h.value="custom";for(var L=0;L<H.length;L++){var U=H[L];null!=U.format&&("a4"==U.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==U.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&+var y=document.createElement("select");y.style.marginLeft="4px";y.style.boxSizing="border-box";for(var z=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],E=0;E<z.length;E++){var D=document.createElement("option");D.setAttribute("value",z[E].unit);mxUtils.write(D,z[E].label);y.appendChild(D)}y.value=Editor.pageSizeUnit;k.appendChild(y);l.style.display="none";k.style.display=+"none";var G={},H=PageSetupDialog.getFormats();for(E=0;E<H.length;E++)z=H[E],G[z.key]=z,D=document.createElement("option"),D.setAttribute("value",z.key),mxUtils.write(D,z.title),h.appendChild(D);var M=function(){h.value="custom";for(var L=0;L<H.length;L++){var U=H[L];null!=U.format&&("a4"==U.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==U.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==U.format.width&&e.height==U.format.height?(h.value=U.key,g.setAttribute("checked","checked"),g.defaultChecked=!0,g.checked=!0,d.removeAttribute("checked"),d.defaultChecked=!1,d.checked=!1,detected=!0):e.width==U.format.height&&e.height==U.format.width&&(h.value=U.key,g.removeAttribute("checked"),g.defaultChecked=!1,g.checked=!1,d.setAttribute("checked","checked"),d.defaultChecked=!0,detected=d.checked=!0))}"custom"==h.value?(v.value=Editor.toUnit(e.width,y.value),u.value=Editor.toUnit(e.height,y.value),g.setAttribute("checked","checked"),h.value="custom",l.style.display="none",k.style.display=""):(l.style.display="",k.style.display="none")};M();a.appendChild(h);mxUtils.br(a);a.appendChild(l);a.appendChild(k);var N=function(L,U){L=G[h.value];null!=L.format?(v.value=Editor.toUnit(d.checked?L.format.height:L.format.width,y.value),u.value=Editor.toUnit(d.checked?L.format.width:L.format.height,y.value),k.style.display="none",l.style.display=""):(l.style.display="none",k.style.display="");L=parseFloat(v.value);if(isNaN(L)||0>=L)v.value=Editor.toUnit(e.width,y.value);L=parseFloat(u.value);if(isNaN(L)||0>=L)u.value=Editor.toUnit(e.height,y.value);L=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(v.value),y.value)),Math.floor(Editor.fromUnit(parseFloat(u.value),y.value)));U||L.width==e.width&&L.height==e.height||(e=L,null!=f&&f(e))};mxEvent.addListener(b,"click",function(L){g.checked=!0;N(L);mxEvent.consume(L)});mxEvent.addListener(t,"click",function(L){d.checked=@@ -2087,8 +2087,8 @@ Editor.pageSizeUnit=y.value;N(L,!0);mxEvent.consume(L)});N(null,!0);return{set:fPageSetupDialog.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(a,b,e,f,g,d,h,l,t,k,v){t=null!=t?t:!0;var u=document.createElement("div"),y=document.createElement("div");y.style.width="100%";y.style.display="grid";y.style.gap="5px 8px";y.style.gridAutoColumns="auto 1fr";y.style.boxSizing="border-box";y.style.padding="3px";var z=document.createElement("div");z.style.display="inline-flex";z.style.alignItems="center";z.style.justifyContent="flex-end";z.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",g||mxResources.get("filename"));mxUtils.write(F,(g||mxResources.get("filename"))+":");z.appendChild(F);y.appendChild(z);var D=document.createElement("input");D.setAttribute("value",b||"");D.style.flexGrow="1";var G=mxUtils.button(e,function(){if(null==d||d(D.value))t&&a.hideDialog(),f(D.value)});G.className="geBtn gePrimaryBtn";this.init=function(){if(null!=+var FilenameDialog=function(a,b,e,f,g,d,h,l,t,k,v){t=null!=t?t:!0;var u=document.createElement("div"),y=document.createElement("div");y.style.width="100%";y.style.display="grid";y.style.gap="5px 8px";y.style.gridAutoColumns="auto 1fr";y.style.boxSizing="border-box";y.style.padding="3px";var z=document.createElement("div");z.style.display="inline-flex";z.style.alignItems="center";z.style.justifyContent="flex-end";z.style.minWidth="0";var E=document.createElement("div");E.style.display="inline-block";+E.style.textOverflow="ellipsis";E.style.whiteSpace="nowrap";E.style.overflow="hidden";E.style.fontSize="10pt";E.style.padding="2px 0";E.setAttribute("title",g||mxResources.get("filename"));mxUtils.write(E,(g||mxResources.get("filename"))+":");z.appendChild(E);y.appendChild(z);var D=document.createElement("input");D.setAttribute("value",b||"");D.style.flexGrow="1";var G=mxUtils.button(e,function(){if(null==d||d(D.value))t&&a.hideDialog(),f(D.value)});G.className="geBtn gePrimaryBtn";this.init=function(){if(null!=g||null==h)if(null!=v?Editor.selectFilename(D):(D.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?D.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var H=y.parentNode;if(null!=H){var M=null;mxEvent.addListener(H,"dragleave",function(N){null!=M&&(M.style.backgroundColor="",M=null);N.stopPropagation();N.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(N){null==M&&(!mxClient.IS_IE||10<document.documentMode)&&(M=D,M.style.backgroundColor="#ebf2f9");N.stopPropagation();N.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(N){null!=M&&(M.style.backgroundColor="",M=null);0<=mxUtils.indexOf(N.dataTransfer.types,"text/uri-list")&&(D.value=decodeURIComponent(N.dataTransfer.getData("text/uri-list")),G.click());N.stopPropagation();N.preventDefault()}))}}};z=document.createElement("div");z.style.display="inline-flex";z.style.alignItems="center";z.style.gap="4px";z.style.whiteSpace="nowrap";z.appendChild(D);y.appendChild(z);null==g&&null!=h||null==v||null==a.editor.diagramFileTypes||(z=document.createElement("div"),z.style.display="inline-flex",z.style.alignItems="center",z.style.textOverflow="ellipsis",z.style.justifyContent="flex-end",z.style.fontSize="10pt",mxUtils.write(z,mxResources.get("type")+":"),y.appendChild(z),z=document.createElement("div"),z.style.display="inline-flex",z.style.alignItems="center",z.style.whiteSpace="nowrap",y.appendChild(z),b=FilenameDialog.createFileTypes(a,D,a.editor.diagramFileTypes),@@ -2100,15 +2100,15 @@ var WrapperWindow=function(a,b,e,f,g,d,h,l){l=null!=l?l:document.createElement("(function(){mxGraphView.prototype.validateBackgroundPage=function(){var h=this.graph;if(null!=h.container&&!h.transparentBackground){if(h.pageVisible){var l=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var t=h.container.firstChild;null!=t&&t.nodeType!=mxConstants.NODETYPE_ELEMENT;)t=t.nextSibling;null!=t&&(this.backgroundPageShape=this.createBackgroundPageShape(l),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(h.container),t.style.position="absolute",h.container.insertBefore(this.backgroundPageShape.node,t),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(k){h.dblClick(k)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(k){h.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(k))}),mxUtils.bind(this,function(k){null!=h.tooltipHandler&&h.tooltipHandler.isHideOnHover()&&h.tooltipHandler.hide();h.isMouseDown&&!mxEvent.isConsumed(k)&&h.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(k))}),mxUtils.bind(this,function(k){h.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(k))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=l,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};-mxGraphView.prototype.validateBackgroundStyles=function(h,l,t){var k=this.graph;h=null!=h?h:1;var v=mxUtils.getLightDarkColor(null==k.background||k.background==mxConstants.NONE?k.defaultPageBackgroundColor:k.background).cssText,u=mxUtils.getLightDarkColor(k.defaultPageBorderColor).cssText,y=null!=v&&this.gridColor!=v.toLowerCase()?this.gridColor:"#ffffff",z="none",F="";"simple"==k.getAdaptiveColors()&&k.background!=mxConstants.NONE&&null!=k.background&&(v=k.background);if(k.isGridEnabled()||k.gridVisible){F=-10;mxClient.IS_SVG?(z=unescape(encodeURIComponent(this.createSvgGrid(y,h))),z=window.btoa?btoa(z):Base64.encode(z,!0),z="url(data:image/svg+xml;base64,"+z+")",F=k.gridSize*this.scale*this.gridSteps*h):z="url("+this.gridImage+")";var D=y=0;l=null!=l?l-this.translate.x*this.scale:0;t=null!=t?t-this.translate.y*this.scale:0;var G=k.gridSize*this.scale*this.gridSteps,H=l%G;G=t%G;null!=k.view.backgroundPageShape&&(D=this.getBackgroundPageBounds(),y=1+D.x,D=1+D.y);F=-Math.round(F-mxUtils.mod(this.translate.x*-this.scale-y+l,F)+H*h)+"px "+-Math.round(F-mxUtils.mod(this.translate.y*this.scale-D+t,F)+G*h)+"px"}h=k.view.canvas;null!=h.ownerSVGElement&&(h=h.ownerSVGElement);y=!Editor.isDarkMode()&&k.enableDiagramBackground;null!=k.view.backgroundPageShape?(k.view.backgroundPageShape.node.style.backgroundPosition=F,k.view.backgroundPageShape.node.style.backgroundImage=z,k.view.backgroundPageShape.node.style.backgroundColor=v,k.view.backgroundPageShape.node.style.borderColor=u,k.view.backgroundPageShape.node.style.colorScheme=-"none"==k.getAdaptiveColors()?"light":"",h.style.backgroundImage="none",h.style.backgroundColor="",k.container.style.backgroundColor=y?k.diagramBackgroundColor:""):(h.style.backgroundPosition=F,h.style.backgroundImage=z,"1"==urlParams.transparent?k.container.style.background="transparent":!y||null!=k.background&&k.background!=mxConstants.NONE?h.style.backgroundColor=v:(h.style.backgroundColor=k.diagramBackgroundColor,k.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(h,+mxGraphView.prototype.validateBackgroundStyles=function(h,l,t){var k=this.graph;h=null!=h?h:1;var v=mxUtils.getLightDarkColor(null==k.background||k.background==mxConstants.NONE?k.defaultPageBackgroundColor:k.background).cssText,u=mxUtils.getLightDarkColor(k.defaultPageBorderColor).cssText,y=null!=v&&this.gridColor!=v.toLowerCase()?this.gridColor:"#ffffff",z="none",E="";"simple"==k.getAdaptiveColors()&&k.background!=mxConstants.NONE&&null!=k.background&&(v=k.background);if(k.isGridEnabled()||k.gridVisible){E=+10;mxClient.IS_SVG?(z=unescape(encodeURIComponent(this.createSvgGrid(y,h))),z=window.btoa?btoa(z):Base64.encode(z,!0),z="url(data:image/svg+xml;base64,"+z+")",E=k.gridSize*this.scale*this.gridSteps*h):z="url("+this.gridImage+")";var D=y=0;l=null!=l?l-this.translate.x*this.scale:0;t=null!=t?t-this.translate.y*this.scale:0;var G=k.gridSize*this.scale*this.gridSteps,H=l%G;G=t%G;null!=k.view.backgroundPageShape&&(D=this.getBackgroundPageBounds(),y=1+D.x,D=1+D.y);E=-Math.round(E-mxUtils.mod(this.translate.x*+this.scale-y+l,E)+H*h)+"px "+-Math.round(E-mxUtils.mod(this.translate.y*this.scale-D+t,E)+G*h)+"px"}h=k.view.canvas;null!=h.ownerSVGElement&&(h=h.ownerSVGElement);y=!Editor.isDarkMode()&&k.enableDiagramBackground;null!=k.view.backgroundPageShape?(k.view.backgroundPageShape.node.style.backgroundPosition=E,k.view.backgroundPageShape.node.style.backgroundImage=z,k.view.backgroundPageShape.node.style.backgroundColor=v,k.view.backgroundPageShape.node.style.borderColor=u,k.view.backgroundPageShape.node.style.colorScheme=+"none"==k.getAdaptiveColors()?"light":"",h.style.backgroundImage="none",h.style.backgroundColor="",k.container.style.backgroundColor=y?k.diagramBackgroundColor:""):(h.style.backgroundPosition=E,h.style.backgroundImage=z,"1"==urlParams.transparent?k.container.style.background="transparent":!y||null!=k.background&&k.background!=mxConstants.NONE?h.style.backgroundColor=v:(h.style.backgroundColor=k.diagramBackgroundColor,k.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(h,l){for(var t=this.graph.gridSize*this.scale*(null!=l?l:1);t<this.minGridSize;)t*=2;l=this.gridSteps*t;for(var k=[],v=1;v<this.gridSteps;v++){var u=v*t;k.push("M 0 "+u+" L "+l+" "+u+" M "+u+" 0 L "+u+" "+l)}h=mxUtils.getLightDarkColor(h);t="color-scheme: light dark;";mxClient.IS_SF&&(t="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+t+'" width="'+l+'" height="'+l+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+l+'" height="'+l+'" patternUnits="userSpaceOnUse"><path d="'+k.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(h.cssText)+';" stroke="'+h.light+'" opacity="0.2" stroke-width="1"/><path d="M '+l+" 0 L 0 0 0 "+l+'" fill="none" style="stroke:'+mxUtils.htmlEntities(h.cssText)+';" stroke="'+h.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(h,l){a.apply(this,arguments);if(null!=this.shiftPreview1){var t=this.view.canvas;null!=t.ownerSVGElement&&(t=t.ownerSVGElement);var k=this.gridSize*this.view.scale*this.view.gridSteps;k=-Math.round(k-mxUtils.mod(this.view.translate.x*this.view.scale+h,k))+"px "+-Math.round(k-mxUtils.mod(this.view.translate.y*this.view.scale+l,k))+"px";t.style.backgroundPosition=k}};mxGraph.prototype.updatePageBreaks=function(h,l,t){var k=this.view.scale,v=this.view.translate,u=this.pageFormat,y=k*this.pageScale,z=this.view.getBackgroundPageBounds();-l=z.width;t=z.height;var F=new mxRectangle(k*v.x,k*v.y,u.width*y,u.height*y),D=(h=h&&Math.min(F.width,F.height)>this.minPageBreakDist)?Math.ceil(t/F.height)-1:0,G=h?Math.ceil(l/F.width)-1:0,H=z.x+l,M=z.y+t;null==this.horizontalPageBreaks&&0<D&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<G&&(this.verticalPageBreaks=[]);h=mxUtils.bind(this,function(N){if(null!=N){for(var L=N==this.horizontalPageBreaks?D:G,U=0;U<=L;U++){var X=N==this.horizontalPageBreaks?[new mxPoint(Math.round(z.x),-Math.round(z.y+(U+1)*F.height)),new mxPoint(Math.round(H),Math.round(z.y+(U+1)*F.height))]:[new mxPoint(Math.round(z.x+(U+1)*F.width),Math.round(z.y)),new mxPoint(Math.round(z.x+(U+1)*F.width),Math.round(M))];null!=N[U]?(N[U].points=X,N[U].redraw()):(X=new mxPolyline(X,this.pageBreakColor),X.dialect=this.dialect,X.isDashed=this.pageBreakDashed,X.pointerEvents=!1,X.init(this.view.backgroundPane),X.redraw(),N[U]=X)}for(U=L;U<N.length;U++)null!=N[U]&&N[U].destroy();N.splice(L,N.length-L)}});h(this.horizontalPageBreaks);+l=z.width;t=z.height;var E=new mxRectangle(k*v.x,k*v.y,u.width*y,u.height*y),D=(h=h&&Math.min(E.width,E.height)>this.minPageBreakDist)?Math.ceil(t/E.height)-1:0,G=h?Math.ceil(l/E.width)-1:0,H=z.x+l,M=z.y+t;null==this.horizontalPageBreaks&&0<D&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<G&&(this.verticalPageBreaks=[]);h=mxUtils.bind(this,function(N){if(null!=N){for(var L=N==this.horizontalPageBreaks?D:G,U=0;U<=L;U++){var X=N==this.horizontalPageBreaks?[new mxPoint(Math.round(z.x),+Math.round(z.y+(U+1)*E.height)),new mxPoint(Math.round(H),Math.round(z.y+(U+1)*E.height))]:[new mxPoint(Math.round(z.x+(U+1)*E.width),Math.round(z.y)),new mxPoint(Math.round(z.x+(U+1)*E.width),Math.round(M))];null!=N[U]?(N[U].points=X,N[U].redraw()):(X=new mxPolyline(X,this.pageBreakColor),X.dialect=this.dialect,X.isDashed=this.pageBreakDashed,X.pointerEvents=!1,X.init(this.view.backgroundPane),X.redraw(),N[U]=X)}for(U=L;U<N.length;U++)null!=N[U]&&N[U].destroy();N.splice(L,N.length-L)}});h(this.horizontalPageBreaks);h(this.verticalPageBreaks)};var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(h,l,t){for(var k=0;k<l.length;k++){if(this.graph.isTableCell(l[k])||this.graph.isTableRow(l[k]))return!1;if(this.graph.getModel().isVertex(l[k])){var v=this.graph.getCellGeometry(l[k]);if(null!=v&&v.relative)return!1}}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var h=e.apply(this,arguments);h.intersects=mxUtils.bind(this,function(l,t){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(h,arguments)});return h};mxGraphView.prototype.createBackgroundPageShape=function(h){return new mxRectangleShape(h,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var h=this.getGraphBounds(),l=0<h.width?h.x/this.scale-this.translate.x:0,t=0<h.height?h.y/this.scale-this.translate.y:0,k=this.graph.pageFormat,v=this.graph.pageScale,u=k.width*v;k=k.height*v;v=Math.floor(Math.min(0,l)/u);var y=Math.floor(Math.min(0,t)/k);return new mxRectangle(this.scale*(this.translate.x+v*u),this.scale*(this.translate.y+y*k),this.scale*(Math.ceil(Math.max(1,l+h.width/this.scale)/u)-v)*u,this.scale*(Math.ceil(Math.max(1,t+h.height/this.scale)/k)-y)*k)};var f=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(h,l){f.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||@@ -2127,7 +2127,7 @@ if(null!=g.graphHandler){var v=g.graphHandler.start;g.graphHandler.start=functiomxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var u=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(W,ba){return f.isSpaceDown()||u.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(W){if(Editor.passiveScroll){var ba=mxEvent.getSource(W);if(ba!=g.container&&!g.container.contains(ba)&&!g.isEditing())return}16==W.which?this.shiftDown=!0:32!=W.which||g.isEditing()?mxEvent.isConsumed(W)||27!=W.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),g.container.style.cursor="move",g.isEditing()||mxEvent.getSource(W)!=g.container||mxEvent.consume(W))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(W){g.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var y=g.panningHandler.isForcePanningEvent;g.panningHandler.isForcePanningEvent=function(W){return null!=g.freehand&&g.freehand.isActive()?!1:y.apply(this,arguments)||f.isSpaceDown()||mxEvent.isMouseEvent(W.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(W.getEvent()))&&(!mxEvent.isControlDown(W.getEvent())&&mxEvent.isRightMouseButton(W.getEvent())||mxEvent.isMiddleMouseButton(W.getEvent()))};var z=g.cellEditor.isStopEditingEvent;g.cellEditor.isStopEditingEvent=function(W){return z.apply(this,arguments)||13==W.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(W)||mxClient.IS_MAC&&mxEvent.isMetaDown(W)||mxClient.IS_SF&&mxEvent.isShiftDown(W))};-var F=g.isZoomWheelEvent;g.isZoomWheelEvent=function(){return f.isSpaceDown()||F.apply(this,arguments)};var D=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var W=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ba=this.toolbar.container.firstChild;null!=ba;){var K=ba.getAttribute("data-min-width");null!=K&&parseInt(K)>W?ba.style.display="none":ba.style.display="";ba=ba.nextSibling}}),G=!1,H=null,M=null,N=null,L=mxUtils.bind(this,function(){if(null!=this.toolbar&&+var E=g.isZoomWheelEvent;g.isZoomWheelEvent=function(){return f.isSpaceDown()||E.apply(this,arguments)};var D=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var W=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ba=this.toolbar.container.firstChild;null!=ba;){var K=ba.getAttribute("data-min-width");null!=K&&parseInt(K)>W?ba.style.display="none":ba.style.display="";ba=ba.nextSibling}}),G=!1,H=null,M=null,N=null,L=mxUtils.bind(this,function(){if(null!=this.toolbar&&G!=g.cellEditor.isContentEditing()){for(var W=this.toolbar.container.firstChild,ba=[];null!=W;){var K=W.nextSibling;W.parentNode.removeChild(W);ba.push(W);W=K}W=this.toolbar.fontMenu;K=this.toolbar.sizeMenu;if(null==N)this.toolbar.createTextToolbar();else{for(var T=0;T<N.length;T++)this.toolbar.container.appendChild(N[T]);this.toolbar.fontMenu=H;this.toolbar.sizeMenu=M}G=g.cellEditor.isContentEditing();H=W;M=K;N=ba;D()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();L()}));this.addListener("currentThemeChanged",D);mxEvent.addListener(window,"resize",D);D();g.isTouchPopupMenuEnabled=function(){return null==f.dialog};var U=g.cellEditor.startEditing;g.cellEditor.startEditing=function(){U.apply(this,arguments);L();if(g.cellEditor.isContentEditing()){var W=!1,ba=function(){W||(W=!0,window.setTimeout(function(){var K=g.getSelectedEditingElement();null!=K&&(K=mxUtils.getCurrentStyle(K),null!=K&&null!=f.toolbar&&(f.toolbar.setFontName(mxUtils.getCssFontFamily(K.fontFamily)),f.toolbar.setFontSize(parseInt(K.fontSize))));W=!1},0))};mxEvent.addListener(g.cellEditor.textarea,"input",ba);mxEvent.addListener(g.cellEditor.textarea,"touchend",ba);mxEvent.addListener(g.cellEditor.textarea,"mouseup",ba);mxEvent.addListener(g.cellEditor.textarea,"keyup",ba);ba()}};var X=g.cellEditor.stopEditing;g.cellEditor.stopEditing=function(W,ba){try{X.apply(this,arguments),L()}catch(K){f.handleError(K)}};g.container.setAttribute("tabindex","0");g.container.style.cursor="default";if(window.self===@@ -2150,15 +2150,15 @@ mxUtils.bind(e,e.showLinkDialog);a.editLink=e.actions.get("editLink").funct;thisEditorUi.prototype.createSelectionState=function(){for(var a=this.editor.graph,b=a.getSelectionCells(),e=this.initSelectionState(),f=!0,g=0;g<b.length;g++){var d=a.getCurrentCellStyle(b[g]);"0"!=mxUtils.getValue(d,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(e,b[g],b,f),f=!1)}this.updateSelectionStateForTableCells(e);if(Editor.enableCustomProperties){e.customProperties={};a=e.vertices;b=e.edges;for(g=0;g<a.length;g++)this.findCommonProperties(a[g],e.customProperties,0==g,e);for(g=0;g<b.length;g++)this.findCommonProperties(b[g],e.customProperties,0==a.length&&0==g,e)}return e};EditorUi.prototype.findCommonProperties=function(a,b,e,f){f=mxUtils.bind(this,function(k){if(null!=k)if(e)for(var v=0;v<k.length;v++)b[k[v].name]=k[v];else for(var u in b)if(null!=u){var y=!1;for(v=0;v<k.length;v++)if(k[v].name==u&&k[v].type==b[u].type){y=!0;break}y||delete b[u]}});var g=this.editor.graph,d=g.view.getState(a);if(null!=d&&null!=d.shape){if(!d.shape.commonCustomPropAdded){d.shape.commonCustomPropAdded=!0;d.shape.customProperties=d.shape.customProperties||[];if(null!=d.shape&&null!=-d.shape.stencil&&null!=d.shape.stencil.desc){var h=d.shape.stencil,l=[],t=mxUtils.bind(this,function(k){k=h.desc.getElementsByTagName(k);for(var v=[],u=0;u<k.length;u++){var y=k[u].getAttribute("color");if(!mxUtils.isValidColor(y)&&!l[y]&&"fill"!=y&&"stroke"!=y&&"font"!=y){l[y]=!0;var z=k[u].getAttribute("name");z=null!=z?z:Editor.getLabelForStylename(y);var F=k[u].getAttribute("default"),D=h.getDefaultColorValue(k[u],g),G=F;F==mxConstants.NONE&&(F="default");v.push({name:y,type:"color",primary:"false"!=-k[u].getAttribute("primary"),defVal:F,defaultColor:D,undefinedColor:G,dispName:z})}}return v});Array.prototype.push.apply(d.shape.customProperties,t("fillcolor"));Array.prototype.push.apply(d.shape.customProperties,t("strokecolor"));Array.prototype.push.apply(d.shape.customProperties,t("fontcolor"))}d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)}f(d.shape.customProperties)}a=+d.shape.stencil&&null!=d.shape.stencil.desc){var h=d.shape.stencil,l=[],t=mxUtils.bind(this,function(k){k=h.desc.getElementsByTagName(k);for(var v=[],u=0;u<k.length;u++){var y=k[u].getAttribute("color");if(!mxUtils.isValidColor(y)&&!l[y]&&"fill"!=y&&"stroke"!=y&&"font"!=y){l[y]=!0;var z=k[u].getAttribute("name");z=null!=z?z:Editor.getLabelForStylename(y);var E=k[u].getAttribute("default"),D=h.getDefaultColorValue(k[u],g),G=E;E==mxConstants.NONE&&(E="default");v.push({name:y,type:"color",primary:"false"!=+k[u].getAttribute("primary"),defVal:E,defaultColor:D,undefinedColor:G,dispName:z})}}return v});Array.prototype.push.apply(d.shape.customProperties,t("fillcolor"));Array.prototype.push.apply(d.shape.customProperties,t("strokecolor"));Array.prototype.push.apply(d.shape.customProperties,t("fontcolor"))}d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)}f(d.shape.customProperties)}a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(k){}};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(a){if(1<a.cells.length&&a.cell){var b=mxUtils.sortCells(a.cells),e=this.editor.graph.model,f=e.getParent(b[0]),g=e.getParent(f);if(null!=f&&null!=g){for(var d=f.getIndex(b[0]),h=g.getIndex(f),l=null,t=1,k=1,v=0,u=h<g.getChildCount()-1?e.getChildAt(e.getChildAt(g,h+1),d):null;v<b.length-1;){var y=b[++v];null==u||u!=y||null!=l&&t!=l||(l=t,t=0,k++,f=e.getParent(u),u=h+k<g.getChildCount()?e.getChildAt(e.getChildAt(g,h+k),d):null);var z=this.editor.graph.view.getState(y);if(y==e.getChildAt(f,d+t)&&null!=z&&1==mxUtils.getValue(z.style,"colspan",1)&&1==mxUtils.getValue(z.style,"rowspan",1))t++;else break}v==k*t-1&&(a.mergeCell=b[0],a.colspan=t,a.rowspan=k)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};EditorUi.prototype.createTimeout=function(a,b,e){var f=!0,g=null,d=mxUtils.bind(this,function(l){g.clear()&&(f=!1,l=null!=l?l:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(a,b,e)})},null!=e?e(l):this.handleError(l))}),h=window.setTimeout(d,null!=a?a:this.timeout);g={clear:function(){window.clearTimeout(h);return f},isAlive:function(){return f}};null!=b&&this.tryAndHandle(mxUtils.bind(this,function(){b(g)}),d);return g};EditorUi.prototype.tryAndHandle=function(a,b){try{a()}catch(e){null!=b?b(e):this.handleError(e)}};EditorUi.prototype.removeUserDefinedDarkColors=function(a,b,e){var f=this.editor.graph;a=null!=a?a:f.getSelectionCells();var g=Graph.colorStyles,d=document.createElement("div");f.model.beginUpdate();try{for(var h=0;h<a.length;h++)if(f.model.isEdge(a[h])||f.model.isVertex(a[h])){var l=f.getCellStyle(a[h],!1);if(null!=l)for(var t=0;t<g.length;t++)try{var k=l[g[t]];if(mxUtils.isLightDarkColor(k)){var v=mxUtils.getLightDarkColor(k);f.setCellStyles(g[t],v.light,[a[h]])}}catch(y){}b&&f.isHtmlLabel(a[h])&&-"0"!=mxUtils.getValue(l,"html","0")&&(d.innerHTML=Graph.sanitizeHtml(f.getLabel(a[h])),Graph.addLightDarkColors(d,null,null,function(y,z,F){return mxUtils.isLightDarkColor(F)?(F=mxUtils.getLightDarkColor(F),y.style.setProperty(z,F.light),!0):!1})&&f.cellLabelChanged(a[h],d.innerHTML))}if(e&&mxUtils.isLightDarkColor(f.background)){v=mxUtils.getLightDarkColor(f.background);var u=new ChangePageSetup(this,v.light);u.ignoreImage=!0;f.model.execute(u)}}finally{f.model.endUpdate()}return a};+"0"!=mxUtils.getValue(l,"html","0")&&(d.innerHTML=Graph.sanitizeHtml(f.getLabel(a[h])),Graph.addLightDarkColors(d,null,null,function(y,z,E){return mxUtils.isLightDarkColor(E)?(E=mxUtils.getLightDarkColor(E),y.style.setProperty(z,E.light),!0):!1})&&f.cellLabelChanged(a[h],d.innerHTML))}if(e&&mxUtils.isLightDarkColor(f.background)){v=mxUtils.getLightDarkColor(f.background);var u=new ChangePageSetup(this,v.light);u.ignoreImage=!0;f.model.execute(u)}}finally{f.model.endUpdate()}return a};EditorUi.prototype.updateSelectionStateForCell=function(a,b,e,f){e=this.editor.graph;a.cells.push(b);if(e.getModel().isVertex(b)){a.connections=0<e.model.getEdgeCount(b);a.unlocked=a.unlocked&&!e.isCellLocked(b);a.resizable=a.resizable&&e.isCellResizable(b);a.rotatable=a.rotatable&&e.isCellRotatable(b);a.movable=a.movable&&e.isCellMovable(b)&&!e.isTableRow(b)&&!e.isTableCell(b);a.swimlane=a.swimlane||e.isSwimlane(b);a.table=a.table||e.isTable(b);a.cell=a.cell||e.isTableCell(b);a.row=a.row||e.isTableRow(b);a.vertices.push(b);var g=e.getCellGeometry(b);if(null!=g&&(0<g.width?null==a.width?a.width=g.width:a.width!=g.width&&(a.width=""):a.containsLabel=!0,0<g.height?null==a.height?a.height=g.height:a.height!=g.height&&(a.height=""):a.containsLabel=!0,!g.relative||null!=g.offset)){var d=g.relative?g.offset.x:g.x;g=g.relative?g.offset.y:g.y;null==a.x?a.x=d:a.x!=d&&(a.x="");null==a.y?a.y=g:a.y!=g&&(a.y="")}}else e.getModel().isEdge(b)&&(a.edges.push(b),a.connections=!0,a.resizable=!1,a.rotatable=!1,a.movable=!1);d=e.view.getState(b);null!=d&&(a.html=a.html&&e.isHtmlLabel(b),a.autoSize=a.autoSize||e.isAutoSizeState(d),a.glass=a.glass&&e.isGlassState(d),a.rounded=a.rounded&&e.isRoundedState(d),a.lineJumps=a.lineJumps&&e.isLineJumpState(d),a.image=a.image||e.isImageState(d),a.shadow=a.shadow&&e.isShadowState(d),a.fill=a.fill&&e.isFillState(d),a.gradient=a.fill&&e.isGradientState(d),a.stroke=a.stroke&&e.isStrokeState(d),b=mxUtils.getValue(d.style,mxConstants.STYLE_SHAPE,null),a.containsImage=a.containsImage||@@ -2166,31 +2166,33 @@ a.vertices.push(b);var g=e.getCellGeometry(b);if(null!=g&&(0<g.width?null==a.widEditorUi.prototype.installShapePicker=function(){var a=this.editor.graph,b=this;a.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,v){"mouseDown"==v.getProperty("eventName")&&b.hideShapePicker()}));var e=mxUtils.bind(this,function(){b.hideShapePicker(!0)});a.addListener("wheel",e);a.addListener(mxEvent.ESCAPE,e);a.view.addListener(mxEvent.SCALE,e);a.view.addListener(mxEvent.SCALE_AND_TRANSLATE,e);a.getSelectionModel().addListener(mxEvent.CHANGE,e);var f=a.popupMenuHandler.isMenuShowing;a.popupMenuHandler.isMenuShowing=function(){return f.apply(this,arguments)||null!=b.shapePicker||null!=b.currentMenu};var g=a.dblClick;a.dblClick=function(k,v){if(this.isEnabled())if(null!=v||null==b.sidebar||mxEvent.isShiftDown(k)||a.isCellLocked(a.getDefaultParent()))g.apply(this,arguments);else{var u=mxUtils.convertPoint(this.container,mxEvent.getClientX(k),mxEvent.getClientY(k));mxEvent.consume(k);window.setTimeout(mxUtils.bind(this,function(){b.showShapePicker(u.x,u.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,b.hideShapePicker(!0))}));var d=this.hoverIcons.drag;this.hoverIcons.drag=function(){b.hideShapePicker();d.apply(this,arguments)};var h=this.hoverIcons.execute;this.hoverIcons.execute=function(k,v,u){var y=u.getEvent();this.graph.isCloneEvent(y)||mxEvent.isShiftDown(y)?h.apply(this,arguments):this.graph.connectVertex(k.cell,v,this.graph.defaultEdgeLength,y,null,null,mxUtils.bind(this,-function(z,F,D){var G=a.getCompositeParent(k.cell);z=a.getCellGeometry(G);for(u.consume();null!=G&&a.model.isVertex(G)&&null!=z&&z.relative;)cell=G,G=a.model.getParent(cell),z=a.getCellGeometry(G);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=b.showShapePicker(u.getGraphX(),u.getGraphY(),G,mxUtils.bind(this,function(H){D(H);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(H))}),v)}),30)}),mxUtils.bind(this,function(z){this.graph.selectCellsForConnectVertex(z,y,this)}))};-var l=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(k,v){null!=l&&window.clearTimeout(l);l=window.setTimeout(mxUtils.bind(this,function(){var u=v.getProperty("arrow"),y=v.getProperty("direction"),z=v.getProperty("event");u=u.getBoundingClientRect();var F=mxUtils.getOffset(a.container),D=a.container.scrollLeft+u.x-F.x;F=a.container.scrollTop+u.y-F.y;var G=a.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),H=b.showShapePicker(D,F,G,-mxUtils.bind(this,function(M){null!=M&&a.connectVertex(G,y,a.defaultEdgeLength,z,!0,!1,function(N,L,U){U(M);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(M))},function(N){a.selectCellsForConnectVertex(N)},z,this.hoverIcons)}),y,!0);null!=H&&(this.centerShapePicker(H,u,D,F,y),this.hoverIcons.shapePickerHoverDiv=H,mxUtils.setOpacity(H,30),mxEvent.addListener(H,"mouseenter",function(){mxUtils.setOpacity(H,100)}),mxEvent.addListener(H,"mouseleave",function(){b.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));+function(z,E,D){var G=a.getCompositeParent(k.cell);z=a.getCellGeometry(G);for(u.consume();null!=G&&a.model.isVertex(G)&&null!=z&&z.relative;)cell=G,G=a.model.getParent(cell),z=a.getCellGeometry(G);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=b.showShapePicker(u.getGraphX(),u.getGraphY(),G,mxUtils.bind(this,function(H){D(H);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(H))}),v)}),30)}),mxUtils.bind(this,function(z){this.graph.selectCellsForConnectVertex(z,y,this)}))};+var l=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(k,v){null!=l&&window.clearTimeout(l);l=window.setTimeout(mxUtils.bind(this,function(){var u=v.getProperty("arrow"),y=v.getProperty("direction"),z=v.getProperty("event");u=u.getBoundingClientRect();var E=mxUtils.getOffset(a.container),D=a.container.scrollLeft+u.x-E.x;E=a.container.scrollTop+u.y-E.y;var G=a.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),H=b.showShapePicker(D,E,G,+mxUtils.bind(this,function(M){null!=M&&a.connectVertex(G,y,a.defaultEdgeLength,z,!0,!1,function(N,L,U){U(M);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(M))},function(N){a.selectCellsForConnectVertex(N)},z,this.hoverIcons)}),y,!0);null!=H&&(this.centerShapePicker(H,u,D,E,y),this.hoverIcons.shapePickerHoverDiv=H,mxUtils.setOpacity(H,30),mxEvent.addListener(H,"mouseenter",function(){mxUtils.setOpacity(H,100)}),mxEvent.addListener(H,"mouseleave",function(){b.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(k,v){null!=l&&window.clearTimeout(l)}))}var t=!1;a.addMouseListener({mouseDown:mxUtils.bind(this,function(k,v){t=!1}),mouseMove:mxUtils.bind(this,function(k,v){null!=a.connectHandleClickState&&null!=a.connectionHandler&&null!=a.connectionHandler.shape&&(t=!0)}),mouseUp:mxUtils.bind(this,function(k,v){k=a.connectHandleClickState;a.connectHandleClickState=null;if(null!=k&&!t){var u=v.getEvent();if(!a.isCloneEvent(u)&&!mxEvent.isShiftDown(u)){for(var y=-mxConstants.DIRECTION_EAST,z=a.getCompositeParent(k.cell),F=a.getCellGeometry(z);null!=z&&a.model.isVertex(z)&&null!=F&&F.relative;)z=a.model.getParent(z),F=a.getCellGeometry(z);a.connectVertex(k.cell,y,a.defaultEdgeLength,u,null,!0,mxUtils.bind(this,function(D,G,H){v.consume();window.setTimeout(mxUtils.bind(this,function(){b.showShapePicker(v.getGraphX(),v.getGraphY(),z,mxUtils.bind(this,function(M){H(M);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(M))}),y)}),30)}),mxUtils.bind(this,function(D){a.selectCellsForConnectVertex(D,+mxConstants.DIRECTION_EAST,z=a.getCompositeParent(k.cell),E=a.getCellGeometry(z);null!=z&&a.model.isVertex(z)&&null!=E&&E.relative;)z=a.model.getParent(z),E=a.getCellGeometry(z);a.connectVertex(k.cell,y,a.defaultEdgeLength,u,null,!0,mxUtils.bind(this,function(D,G,H){v.consume();window.setTimeout(mxUtils.bind(this,function(){b.showShapePicker(v.getGraphX(),v.getGraphY(),z,mxUtils.bind(this,function(M){H(M);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(M))}),y)}),30)}),mxUtils.bind(this,function(D){a.selectCellsForConnectVertex(D,u)}))}}t=!1})})};EditorUi.prototype.centerShapePicker=function(a,b,e,f,g){if(g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST)a.style.width="40px";var d=a.getBoundingClientRect();g==mxConstants.DIRECTION_NORTH?(e-=d.width/2-10,f-=d.height+6):g==mxConstants.DIRECTION_SOUTH?(e-=d.width/2-10,f+=b.height+6):g==mxConstants.DIRECTION_WEST?(e-=d.width+6,f-=d.height/2-10):g==mxConstants.DIRECTION_EAST&&(e+=b.width+6,f-=d.height/2-10);a.style.left=e+"px";a.style.top=f+"px"};EditorUi.prototype.showShapePicker=function(a,b,e,f,g,d,h,l,t){var k=null;this.editor.graph.freehand.isDrawing()||(l=l||null==e,k=this.createShapePicker(a,b,e,f,g,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(e,d,l),d,h,l,t),null!=k&&(null==this.hoverIcons||d||this.hoverIcons.reset(),a=this.editor.graph,a.popupMenuHandler.hideMenu(),a.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=f,this.shapePicker=k));return k};EditorUi.prototype.createShapePicker=function(a,b,e,f,g,d,h,l,t,k,v){v=null!=v?v:!0;var u=this.editor.graph,y=null;t=null!=t?t:function(D){D=D[0];var G=0,H=0,M=D.geometry;null!=M&&(u.model.isEdge(D)&&(D=M.getTerminalPoint(!1),M=new mxRectangle(0,0,D.x,D.y)),G=M.width/2,H=M.height/2);return new mxPoint(u.snap(Math.round(a/u.view.scale)-u.view.translate.x-G),u.snap(Math.round(b/u.view.scale)-u.view.translate.y-H))};if(null!=h&&0<h.length){var z=this;u=this.editor.graph;y=document.createElement("div");-g=u.view.getState(e);var F=null==e||null!=g&&u.isTransparentState(g)?null:u.copyStyle(e);y.className="geShapePicker";y.setAttribute("title",mxResources.get("sidebarTooltip"));y.style.left=Math.round(a)+"px";y.style.top=Math.round(b)+"px";mxClient.IS_POINTER&&(y.style.touchAction="none");l||mxUtils.setPrefixedStyle(y.style,"transform","translate(-22px,-22px)");u.container.appendChild(y);g=mxUtils.bind(this,function(D){var G=document.createElement("a");y.appendChild(G);null!=F&&"1"!=urlParams.sketch?-this.sidebar.graph.pasteStyle(F,[D]):this.sidebar.graph.pasteCellStyles([D],u.currentVertexStyle,u.currentEdgeStyle);var H=D.geometry;u.model.isEdge(D)&&(H=H.getTerminalPoint(!1),H=new mxRectangle(0,0,H.x,H.y));null!=H&&(H=this.sidebar.createVertexTemplateFromCells([D],H.width,H.height,"",!0,!1,null,!1,mxUtils.bind(this,function(M){if(!mxEvent.isAltDown(M)||1!=u.getSelectionCount()){if(!mxEvent.isShiftDown(M)||null==e&&u.isSelectionEmpty()){var N=u.cloneCell(D);if(null!=f)f(N);else{var L=t([N]);u.model.isEdge(N)?-N.geometry.translate(L.x,L.y):(N.geometry.x=L.x,N.geometry.y=L.y);u.model.beginUpdate();try{u.addCell(N),u.model.isVertex(N)&&u.isAutoSizeCell(N)&&u.updateCellSize(N)}finally{u.model.endUpdate()}u.setSelectionCell(N);u.scrollCellToVisible(N);v&&u.startEditing(N);null!=z.hoverIcons&&z.hoverIcons.update(u.view.getState(N))}}else N=u.getEditableCells(null!=e?[e]:u.getSelectionCells()),u.updateShapes(D,N);null!=d&&d(M);mxEvent.consume(M)}}),25,25,null,null,e),H.style.display="flex",H.style.alignItems=-"center",H.style.justifyContent="center",G.appendChild(H))});for(k=0;k<(l?Math.min(h.length,4):h.length);k++)g(h[k]);h=y.offsetTop+y.clientHeight-(u.container.scrollTop+u.container.offsetHeight);0<h&&(y.style.top=Math.max(u.container.scrollTop+22,b-h)+"px");h=y.offsetLeft+y.clientWidth-(u.container.scrollLeft+u.container.offsetWidth);0<h&&(y.style.left=Math.max(u.container.scrollLeft+22,a-h)+"px")}return y};-EditorUi.prototype.getCellsForShapePicker=function(a,b,e){var f=this.editor.graph,g=mxUtils.bind(this,function(d,h,l,t){return f.createVertex(null,null,t||"",0,0,h||120,l||60,d,!1)});b=mxUtils.bind(this,function(d,h,l){d=new mxCell(l||"",new mxGeometry(0,0,f.defaultEdgeLength+20,0),d);d.geometry.setTerminalPoint(new mxPoint(0,0),!0);d.geometry.setTerminalPoint(new mxPoint(d.geometry.width,null!=h?h:0),!1);d.geometry.points=null!=h?[new mxPoint(d.geometry.width/2,h)]:[];d.geometry.relative=!0;d.edge=-!0;return d});if(null!=a)try{a=f.cloneCell(a),f.model.isVertex(a)&&null!=a.geometry&&(a.geometry.x=0,a.geometry.y=0)}catch(d){a=null}null==a&&(a=g(f.appendFontSize(Editor.defaultTextStyle,f.vertexFontSize),60,30,"Text"));a=[a,g("whiteSpace=wrap;html=1;"),g("ellipse;whiteSpace=wrap;html=1;",80,80),g("rhombus;whiteSpace=wrap;html=1;",80,80),g("rounded=1;whiteSpace=wrap;html=1;"),g("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),g("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",-120,60),g("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),g("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),g("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),g("triangle;whiteSpace=wrap;html=1;",60,80),g("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),g("shape=tape;whiteSpace=wrap;html=1;",120,100),g("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),g("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",-80,60),g("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];e&&(a=a.concat([b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),b("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",-this.editor.graph.defaultEdgeLength/2)]));return a};EditorUi.prototype.isShapePickerVisible=function(a){return null!=this.shapePicker};EditorUi.prototype.hideShapePicker=function(a){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),a||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};-EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};+g=u.view.getState(e);var E=null==e||null!=g&&u.isTransparentState(g)?null:u.copyStyle(e);y.className="geShapePicker";y.setAttribute("title",mxResources.get("sidebarTooltip"));y.style.left=Math.round(a)+"px";y.style.top=Math.round(b)+"px";mxClient.IS_POINTER&&(y.style.touchAction="none");l||mxUtils.setPrefixedStyle(y.style,"transform","translate(-22px,-22px)");u.container.appendChild(y);g=mxUtils.bind(this,function(D){var G=document.createElement("a");y.appendChild(G);var H=D.shapePickerKeepStyle;+delete D.shapePickerKeepStyle;H||(null!=E&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(E,[D]):this.sidebar.graph.pasteCellStyles([D],u.currentVertexStyle,u.currentEdgeStyle));H=D.geometry;u.model.isEdge(D)&&(H=H.getTerminalPoint(!1),H=new mxRectangle(0,0,H.x,H.y));null!=H&&(H=this.sidebar.createVertexTemplateFromCells([D],H.width,H.height,"",!0,!1,null,!0,mxUtils.bind(this,function(M){if(!mxEvent.isAltDown(M)||1!=u.getSelectionCount()){if(!mxEvent.isShiftDown(M)||null==e&&u.isSelectionEmpty()){var N=+u.cloneCell(D);if(null!=f)f(N);else{var L=t([N]);u.model.isEdge(N)?N.geometry.translate(L.x,L.y):(N.geometry.x=L.x,N.geometry.y=L.y);u.model.beginUpdate();try{u.addCell(N),u.model.isVertex(N)&&u.isAutoSizeCell(N)&&u.updateCellSize(N)}finally{u.model.endUpdate()}u.setSelectionCell(N);u.scrollCellToVisible(N);v&&u.startEditing(N);null!=z.hoverIcons&&z.hoverIcons.update(u.view.getState(N))}}else N=u.getEditableCells(null!=e?[e]:u.getSelectionCells()),u.updateShapes(D,N);null!=d&&d(M);mxEvent.consume(M)}}),+25,25,null,null,e),H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="center",G.appendChild(H))});for(k=0;k<(l?Math.min(h.length,4):h.length);k++)g(h[k]);h=y.offsetTop+y.clientHeight-(u.container.scrollTop+u.container.offsetHeight);0<h&&(y.style.top=Math.max(u.container.scrollTop+22,b-h)+"px");h=y.offsetLeft+y.clientWidth-(u.container.scrollLeft+u.container.offsetWidth);0<h&&(y.style.left=Math.max(u.container.scrollLeft+22,a-h)+"px")}return y};+EditorUi.prototype.defaultShapePickerEntries=null;+EditorUi.prototype.getCellsForShapePicker=function(a,b,e){var f=this.editor.graph,g=mxUtils.bind(this,function(u,y,z,E){return f.createVertex(null,null,E||"",0,0,y||120,z||60,u,!1)});b=mxUtils.bind(this,function(u,y,z){u=new mxCell(z||"",new mxGeometry(0,0,f.defaultEdgeLength+20,0),u);u.geometry.setTerminalPoint(new mxPoint(0,0),!0);u.geometry.setTerminalPoint(new mxPoint(u.geometry.width,null!=y?y:0),!1);u.geometry.points=null!=y?[new mxPoint(u.geometry.width/2,y)]:[];u.geometry.relative=!0;u.edge=+!0;return u});if(null!=a)try{a=f.cloneCell(a),f.model.isVertex(a)&&null!=a.geometry&&(a.geometry.x=0,a.geometry.y=0)}catch(u){a=null}if(null!=this.defaultShapePickerEntries){for(var d=[],h=[],l=function(u){if(null!=u&&"object"===typeof u){var y=mxUtils.createXmlDocument().createElement("UserObject"),z;for(z in u)u.hasOwnProperty(z)&&y.setAttribute(z,u[z]);null==y.getAttribute("label")&&y.setAttribute("label","");return y}return u},t=0;t<this.defaultShapePickerEntries.length;t++){var k=this.defaultShapePickerEntries[t];+if(null!=k.style){var v=l(k.value);k.edge?h.push(b(k.style,k.y,v)):(v=g(k.style,k.width,k.height,v),k.keepStyle&&(v.shapePickerKeepStyle=!0),d.push(v))}}null!=a&&(d[0]=a);a=d;e&&(a=a.concat(h));return a}null==a&&(a=g(f.appendFontSize(Editor.defaultTextStyle,f.vertexFontSize),60,30,"Text"));a=[a,g("whiteSpace=wrap;html=1;"),g("ellipse;whiteSpace=wrap;html=1;",80,80),g("rhombus;whiteSpace=wrap;html=1;",80,80),g("rounded=1;whiteSpace=wrap;html=1;"),g("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),+g("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),g("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),g("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),g("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),g("triangle;whiteSpace=wrap;html=1;",60,80),g("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),g("shape=tape;whiteSpace=wrap;html=1;",120,100),g("ellipse;shape=cloud;whiteSpace=wrap;html=1;",+120,80),g("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),g("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];e&&(a=a.concat([b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),+b("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return a};EditorUi.prototype.isShapePickerVisible=function(a){return null!=this.shapePicker};+EditorUi.prototype.hideShapePicker=function(a){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),a||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};EditorUi.prototype.onKeyDown=function(a){var b=this.editor.graph;if(9==a.which&&b.isEnabled()&&!mxEvent.isControlDown(a)){if(b.isEditing())if(mxEvent.isAltDown(a))b.stopEditing(!1);else try{var e=b.cellEditor.isContentEditing()&&b.cellEditor.isTextSelected();if(window.getSelection&&b.cellEditor.isContentEditing()&&!e&&!mxClient.IS_IE&&!mxClient.IS_IE11){var f=window.getSelection(),g=0<f.rangeCount?f.getRangeAt(0).commonAncestorContainer:null;e=null!=g&&("LI"==g.nodeName||null!=g.parentNode&&"LI"==g.parentNode.nodeName)}e?document.execCommand(mxEvent.isShiftDown(a)?"outdent":"indent",!1,null):mxEvent.isShiftDown(a)?b.stopEditing(!1):b.cellEditor.insertTab(b.cellEditor.isContentEditing()?null:4)}catch(d){}else mxEvent.isAltDown(a)?b.selectParentCell():b.selectCell(!mxEvent.isShiftDown(a));mxEvent.consume(a)}};EditorUi.prototype.onKeyPress=function(a){var b=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(a)===this.typingShim||!this.isImmediateEditingEvent(a)||b.isEditing()||b.isSelectionEmpty()||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(null==a.key||1!==a.key.length)&&229!==a.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(a)||(b.escape(),b.cellEditor.editByTyping=!0,b.startEditing())};-EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";this.typingShim=b;var e=!1,f=mxUtils.bind(this,-function(){if(!e&&0<b.value.length){var d=b.value;b.value="";this.hideTypingShim();a.escape();a.cellEditor.editByTyping=!0;a.startEditing(null,d)}});mxEvent.addListener(b,"compositionstart",function(){e=!0});mxEvent.addListener(b,"compositionend",function(){e=!1;f()});mxEvent.addListener(b,"input",function(){f()});mxEvent.addListener(b,"keydown",mxUtils.bind(this,function(d){229!==d.keyCode&&(mxEvent.isControlDown(d)||mxEvent.isMetaDown(d)||(null==d.key||1!==d.key.length||mxEvent.isAltDown(d)?d.preventDefault():-null!=this.keyHandler&&null!=this.keyHandler.getFunction(d)&&d.preventDefault()))}));a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));a.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));a.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));-if(null==a.container.tabIndex||0>a.container.tabIndex)a.container.tabIndex=-1;mxEvent.addListener(a.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var g=a.cellEditor.focusContainer;a.cellEditor.focusContainer=mxUtils.bind(this,function(){a.isSelectionEmpty()||a.isEditing()?g.apply(a.cellEditor):this.updateTypingShim()})};+EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&b.setAttribute("inputmode","none");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";+this.typingShim=b;var e=!1,f=mxUtils.bind(this,function(){if(!e&&0<b.value.length){var d=b.value;b.value="";this.hideTypingShim();a.escape();a.cellEditor.editByTyping=!0;a.startEditing(null,d)}});mxEvent.addListener(b,"compositionstart",function(){e=!0});mxEvent.addListener(b,"compositionend",function(){e=!1;f()});mxEvent.addListener(b,"input",function(){f()});mxEvent.addListener(b,"keydown",mxUtils.bind(this,function(d){229!==d.keyCode&&(mxEvent.isControlDown(d)||mxEvent.isMetaDown(d)||(null==d.key||+1!==d.key.length||mxEvent.isAltDown(d)?d.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(d)&&d.preventDefault()))}));a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));a.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));a.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,+function(){this.updateTypingShim()}),0)}));if(null==a.container.tabIndex||0>a.container.tabIndex)a.container.tabIndex=-1;mxEvent.addListener(a.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var g=a.cellEditor.focusContainer;a.cellEditor.focusContainer=mxUtils.bind(this,function(){a.isSelectionEmpty()||a.isEditing()?g.apply(a.cellEditor):this.updateTypingShim()})};EditorUi.prototype.updateTypingShim=function(){var a=this.editor.graph;a.isEditing()||a.isSelectionEmpty()||!a.isEnabled()||a.isCellLocked(a.getSelectionCell())?this.hideTypingShim():this.showTypingShim()};EditorUi.prototype.showTypingShim=function(){var a=this.editor.graph,b=this.typingShim;if(null!=b&&!a.isEditing()){var e=a.getSelectionCell();e=a.getView().getState(e);null!=e&&(b.style.left=Math.round(e.x)+"px",b.style.top=Math.round(e.y)+"px",b.parentNode!==a.container&&a.container.appendChild(b),b.value="",e=document.activeElement,(null==e||e===document.body||e===a.container||a.container.contains(e))&&b.focus({preventScroll:!0}))}};EditorUi.prototype.hideTypingShim=function(){var a=this.typingShim;null!=a&&null!=a.parentNode&&a.parentNode.removeChild(a)};EditorUi.prototype.isImmediateEditingEvent=function(a){return!0};EditorUi.prototype.updateCssForMarker=function(a,b,e,f,g){e=this.getImageForMarker(f,g,e);a.innerHTML="";null==e?a.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(f=document.createElement("img"),f.setAttribute("src",e),"end"==b&&mxUtils.setPrefixedStyle(f.style,"transform","scaleX(-1)"),a.appendChild(f))};@@ -2203,7 +2205,7 @@ EditorUi.prototype.getImageForEdgeStyle=function(a){var b=Format.orthogonalImagenull)?Format.verticalElbowImage.src:Format.horizontalElbowImage.src:"isometricEdgeStyle"==e&&(b="vertical"==mxUtils.getValue(a,mxConstants.STYLE_ELBOW,null)?Format.verticalIsometricImage.src:Format.horizontalIsometricImage.src);return b};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b=this.actions.get("paste"),e=this.actions.get("pasteHere");b.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(null!=navigator.clipboard||!mxClipboard.isEmpty())&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));e.setEnabled(b.isEnabled())};EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(d){d.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};mxClipboard.copy=function(d){var h=null;if(d.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{h=h||d.getSelectionCells();h=d.getExportableCells(d.model.getTopmostCells(h));for(var l={},t=d.createCellLookup(h),k=d.cloneCells(h,null,l),v=new mxGraphModel,u=v.getChildAt(v.getRoot(),-0),y=0;y<k.length;y++){v.add(u,k[y]);var z=d.view.getState(h[y]);if(null!=z){var F=d.getCellGeometry(k[y]);null!=F&&F.relative&&!v.isEdge(h[y])&&null==t[mxObjectIdentity.get(v.getParent(h[y]))]&&(F.offset=null,F.relative=!1,F.x=z.x/z.view.scale-z.view.translate.x,F.y=z.y/z.view.scale-z.view.translate.y)}}d.updateCustomLinks(d.createCellMapping(l,t),k);mxClipboard.insertCount=1;mxClipboard.setCells(k)}a.updatePasteActionStates();return h};var e=mxClipboard.paste;mxClipboard.paste=function(d){var h=+0),y=0;y<k.length;y++){v.add(u,k[y]);var z=d.view.getState(h[y]);if(null!=z){var E=d.getCellGeometry(k[y]);null!=E&&E.relative&&!v.isEdge(h[y])&&null==t[mxObjectIdentity.get(v.getParent(h[y]))]&&(E.offset=null,E.relative=!1,E.x=z.x/z.view.scale-z.view.translate.x,E.y=z.y/z.view.scale-z.view.translate.y)}}d.updateCustomLinks(d.createCellMapping(l,t),k);mxClipboard.insertCount=1;mxClipboard.setCells(k)}a.updatePasteActionStates();return h};var e=mxClipboard.paste;mxClipboard.paste=function(d){var h=null;d.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):h=e.apply(this,arguments);a.updatePasteActionStates();return h};var f=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){f.apply(this,arguments);a.updatePasteActionStates()};var g=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(d,h){g.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var da=this.graph.getPageLayout(),ia=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+da.x*ia.width),this.scale*(this.translate.y+da.y*ia.height),this.scale*da.width*@@ -2219,8 +2221,8 @@ mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appe": "+this.currentPage.getName());t.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(da-1,this.pages.length)].getName());v.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(da+1,this.pages.length)].getName())}});t.style.paddingLeft="0px";t.style.paddingRight="4px";v.style.paddingLeft="4px";v.style.paddingRight="0px";var y=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(v.style.display="",t.style.display="",k.style.display="inline-block"):(v.style.display="none",t.style.display="none",k.style.display="none");u()});if(null!=this.menus){var z=this.menus.get("pages");null!=z&&mxEvent.addListener(k,"click",mxUtils.bind(this,function(da){var ia=new mxPopupMenu(z.funct);ia.smartSeparators=!0;ia.showDisabled=!0;ia.autoExpand=!0;ia.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(ia,arguments);ia.destroy()});var fa=mxUtils.getOffset(k);ia.popup(fa.x,fa.y+k.offsetHeight,null,da);mxEvent.addListener(ia.div,"mouseleave",mxUtils.bind(this,function(){ia.hideMenu()}))}))}this.editor.addListener("resetGraphView",y);this.editor.addListener("pageSelected",u)}d(mxUtils.bind(this,function(da){this.actions.get("zoomOut").funct();mxEvent.consume(da)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");d(mxUtils.bind(this,function(da){this.actions.get("zoomIn").funct();mxEvent.consume(da)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");d(mxUtils.bind(this,-function(da){this.actions.get("smartFit").funct();mxEvent.consume(da)}),Editor.zoomFitImage,mxResources.get("fit"));var F=null,D=null,G=mxUtils.bind(this,function(da){null!=F&&(window.clearTimeout(F),F=null);null!=D&&(window.clearTimeout(D),D=null);F=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);F=null;D=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";D=null}),600)}),da||200)}),H=mxUtils.bind(this,function(da){null!=-F&&(window.clearTimeout(F),F=null);null!=D&&(window.clearTimeout(D),D=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,da||30)});if("1"==urlParams.layers){this.layersDialog=null;var M=d(mxUtils.bind(this,function(da){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&this.chromelessResize()}),!0);mxEvent.addListener(this.layersDialog,+function(da){this.actions.get("smartFit").funct();mxEvent.consume(da)}),Editor.zoomFitImage,mxResources.get("fit"));var E=null,D=null,G=mxUtils.bind(this,function(da){null!=E&&(window.clearTimeout(E),E=null);null!=D&&(window.clearTimeout(D),D=null);E=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);E=null;D=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";D=null}),600)}),da||200)}),H=mxUtils.bind(this,function(da){null!=+E&&(window.clearTimeout(E),E=null);null!=D&&(window.clearTimeout(D),D=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,da||30)});if("1"==urlParams.layers){this.layersDialog=null;var M=d(mxUtils.bind(this,function(da){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.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 ia=M.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=ia.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));ia=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=ia.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(da)}),Editor.layersImage,mxResources.get("layers")),N=a.getModel();N.addListener(mxEvent.CHANGE,function(){M.style.display=1<N.getChildCount(N.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(d);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||d(mxUtils.bind(this,function(da){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"==this.editor.editButtonLink){var ia=null!=this.currentPage?this.currentPage.getId():@@ -2320,19 +2322,19 @@ EditorUi.prototype.showDataDialog=function(a){null!=a&&"undefined"!==typeof windEditorUi.prototype.showBackgroundImageDialog=function(a,b){a=null!=a?a:mxUtils.bind(this,function(f){f=new ChangePageSetup(this,null,f);f.ignoreColor=!0;this.editor.graph.model.execute(f)});var e=mxUtils.prompt(mxResources.get("backgroundImage"),null!=b?b.src:"");null!=e&&0<e.length?(b=new Image,b.onload=function(){a(new mxImage(e,b.width,b.height),!1)},b.onerror=function(){a(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},b.src=e):a(null)};EditorUi.prototype.setBackgroundImage=function(a){this.editor.graph.setBackgroundImage(a);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(a,b,e){mxUtils.confirm(a)?null!=b&&b():null!=e&&e()};EditorUi.prototype.createOutline=function(a){var b=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){b.update(!1)});return b};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",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};-EditorUi.prototype.createKeyHandler=function(a){function b(u,y,z){if(!f.isSelectionEmpty()&&f.isEnabled()){y=null!=y?y:1;var F=f.getCompositeParents(f.getSelectionCells()),D=0<F.length?F[0]:null;if(null!=D)if(z){f.getModel().beginUpdate();try{for(D=0;D<F.length;D++)if(f.getModel().isVertex(F[D])&&f.isCellResizable(F[D])){var G=f.getCellGeometry(F[D]);null!=G&&(G=G.clone(),37==u?G.width=Math.max(0,G.width-y):38==u?G.height=Math.max(0,G.height-y):39==u?G.width+=y:40==u&&(G.height+=y),f.getModel().setGeometry(F[D],-G))}}finally{f.getModel().endUpdate()}}else{G=f.model.getParent(D);var H=f.getView().scale;z=null;1==f.getSelectionCount()&&f.model.isVertex(D)&&null!=f.layoutManager&&!f.isCellLocked(D)&&(z=f.layoutManager.getLayout(G));if(null!=z&&z.constructor==mxStackLayout)y=G.getIndex(D),37==u||38==u?f.model.add(G,D,Math.max(0,y-1)):(39==u||40==u)&&f.model.add(G,D,Math.min(f.model.getChildCount(G),y+1));else{var M=f.graphHandler;null!=M&&(null==M.first&&M.start(D,0,0,f.getMovableCells(F)),null!=M.first&&(D=-F=0,37==u?F=-y:38==u?D=-y:39==u?F=y:40==u&&(D=y),M.currentDx+=F*H,M.currentDy+=D*H,M.checkPreview(),M.updatePreview()),null!=h&&window.clearTimeout(h),h=window.setTimeout(function(){if(null!=M.first){var N=M.roundLength(M.currentDx/H),L=M.roundLength(M.currentDy/H);M.moveCells(M.cells,N,L);M.reset()}},400))}}}}var e=this,f=this.editor.graph,g=new mxKeyHandler(f),d=g.isEventIgnored;g.isEventIgnored=function(u){return!(mxEvent.isShiftDown(u)&&9==u.keyCode)&&(!this.isControlDown(u)||mxEvent.isShiftDown(u)||-90!=u.keyCode&&89!=u.keyCode&&188!=u.keyCode&&190!=u.keyCode&&85!=u.keyCode&&83!=u.keyCode)&&(66!=u.keyCode&&73!=u.keyCode||!this.isControlDown(u)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=u.keyCode&&107!=u.keyCode||!this.isControlDown(u)&&!mxEvent.isShiftDown(u)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&d.apply(this,arguments)};g.isEnabledForEvent=function(u){return!mxEvent.isConsumed(u)&&this.isGraphEvent(u)&&this.isEnabled()&&-(null==e.dialogs||0==e.dialogs.length)};g.isControlDown=function(u){return mxEvent.isControlDown(u)||mxClient.IS_MAC&&u.metaKey};var h=null,l={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},t=g.getFunction;mxKeyHandler.prototype.getFunction=function(u){if(f.isEnabled()){var y=null;mxEvent.isShiftDown(u)&&this.isControlDown(u)&&mxEvent.isAltDown(u)?y=e.actions.get(e.ctrlAltShiftActions[u.keyCode]):mxEvent.isShiftDown(u)&&mxEvent.isAltDown(u)?-y=e.actions.get(e.altShiftActions[u.keyCode]):this.isControlDown(u)&&mxEvent.isAltDown(u)&&(y=e.actions.get(e.ctrlAltActions[u.keyCode]));if(null!=y)return y.funct;if("/"==u.key&&!this.isControlDown(u)&&!mxEvent.isAltDown(u))return function(){var z=document.getElementById("geOmniSearch");null!=z&&30<z.clientWidth&&z.focus()};if(null!=l[u.keyCode]&&!f.isSelectionEmpty())if(!this.isControlDown(u)&&mxEvent.isShiftDown(u)&&mxEvent.isAltDown(u)){if(f.model.isVertex(f.getSelectionCell()))return function(){var z=-f.connectVertex(f.getSelectionCell(),l[u.keyCode],f.defaultEdgeLength,u,!0);null!=z&&0<z.length&&(1==z.length&&f.model.isEdge(z[0])?f.setSelectionCell(f.model.getTerminal(z[0],!1)):f.setSelectionCell(z[z.length-1]),f.scrollCellToVisible(f.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(f.view.getState(f.getSelectionCell())))}}else return this.isControlDown(u)?function(){b(u.keyCode,mxEvent.isShiftDown(u)?f.gridSize:null,!0)}:function(){b(u.keyCode,mxEvent.isShiftDown(u)?f.gridSize:null)}}return t.apply(this,-arguments)};g.bindAction=mxUtils.bind(this,function(u,y,z,F){var D=this.actions.get(z);null!=D&&(z=function(){D.isEnabled()&&D.funct.apply(this,arguments)},y?F?g.bindControlShiftKey(u,z):g.bindControlKey(u,z):F?g.bindShiftKey(u,z):g.bindKey(u,z))});var k=this,v=g.escape;g.escape=function(u){v.apply(this,arguments)};g.enter=function(){};g.bindControlShiftKey(36,function(){f.exitGroup()});g.bindControlShiftKey(35,function(){f.enterGroup()});g.bindShiftKey(36,function(){f.home()});g.bindKey(35,function(){f.refresh()});-g.bindAction(80,!0,"print");g.bindAction(107,!0,"zoomIn");g.bindAction(109,!0,"zoomOut");g.bindAction(61,!0,"zoomIn");g.bindAction(187,!0,"zoomIn");g.bindAction(222,!0,"zoomIn");g.bindAction(173,!0,"zoomOut");g.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)g.bindAction(79,!0,"outline",!0),g.bindControlKey(36,function(){f.isEnabled()&&f.foldCells(!0)}),g.bindControlKey(35,function(){f.isEnabled()&&f.foldCells(!1)}),g.bindControlKey(13,function(){k.ctrlEnter()}),g.bindAction(8,-!1,"delete"),g.bindAction(8,!0,"deleteAll"),g.bindAction(8,!1,"deleteLabels",!0),g.bindAction(46,!1,"delete"),g.bindAction(46,!0,"deleteAll"),g.bindAction(46,!1,"deleteLabels",!0),g.bindAction(36,!1,"resetView"),g.bindAction(72,!0,"fitWindow",!0),g.bindAction(74,!0,"fitPage"),g.bindAction(74,!0,"fitTwoPages",!0),g.bindAction(48,!0,"customZoom"),g.bindAction(82,!0,"turn"),g.bindAction(82,!0,"clearDefaultStyle",!0),g.bindAction(83,!0,"save"),g.bindAction(83,!0,"saveAs",!0),g.bindAction(65,!0,"selectAll"),-g.bindAction(65,!0,"selectNone",!0),"1"!=urlParams.dev&&g.bindAction(73,!0,"selectVertices",!0),g.bindAction(69,!0,"selectEdges",!0),g.bindAction(69,!0,"editStyle"),g.bindAction(66,!0,"bold"),g.bindAction(66,!0,"toBack",!0),g.bindAction(70,!0,"toFront",!0),g.bindAction(68,!0,"duplicate"),g.bindAction(68,!0,"setAsDefaultStyle",!0),g.bindAction(90,!0,"undo"),g.bindAction(90,!0,"redo",!0),g.bindAction(89,!0,"redo"),g.bindAction(89,!0,"autosize",!0),g.bindAction(88,!0,"cut"),g.bindAction(67,!0,"copy"),-g.bindAction(86,!0,"paste"),g.bindAction(71,!0,"group"),g.bindAction(77,!0,"editData"),g.bindAction(71,!0,"grid",!0),g.bindAction(73,!0,"italic"),g.bindAction(76,!0,"lockUnlock"),g.bindAction(76,!0,"layers",!0),g.bindAction(80,!0,"format",!0),g.bindAction(85,!0,"underline"),g.bindAction(85,!0,"ungroup",!0),g.bindAction(109,!0,"decreaseFontSize",!0),g.bindAction(107,!0,"increaseFontSize",!0),g.bindAction(219,!0,"decreaseFontSize",!0),g.bindAction(221,!0,"increaseFontSize",!0),g.bindAction(190,!0,"superscript"),-g.bindAction(188,!0,"subscript"),g.bindAction(13,!1,"keyPressEnter"),g.bindKey(113,function(){f.isEnabled()&&f.startEditingAtCell()});return g};EditorUi.prototype.createMenuElement=function(a,b,e){var f=document.createElement("a");this.addMenuHandler(f,b,e);mxUtils.write(f,a);f.className="geItem";return f};+EditorUi.prototype.createKeyHandler=function(a){function b(u,y,z){if(!f.isSelectionEmpty()&&f.isEnabled()){y=null!=y?y:1;var E=f.getCompositeParents(f.getSelectionCells()),D=0<E.length?E[0]:null;if(null!=D)if(z){f.getModel().beginUpdate();try{for(D=0;D<E.length;D++)if(f.getModel().isVertex(E[D])&&f.isCellResizable(E[D])){var G=f.getCellGeometry(E[D]);null!=G&&(G=G.clone(),37==u?G.width=Math.max(0,G.width-y):38==u?G.height=Math.max(0,G.height-y):39==u?G.width+=y:40==u&&(G.height+=y),f.getModel().setGeometry(E[D],+G))}}finally{f.getModel().endUpdate()}}else{G=f.model.getParent(D);var H=f.getView().scale;z=null;1==f.getSelectionCount()&&f.model.isVertex(D)&&null!=f.layoutManager&&!f.isCellLocked(D)&&(z=f.layoutManager.getLayout(G));if(null!=z&&z.constructor==mxStackLayout)y=G.getIndex(D),37==u||38==u?f.model.add(G,D,Math.max(0,y-1)):(39==u||40==u)&&f.model.add(G,D,Math.min(f.model.getChildCount(G),y+1));else{var M=f.graphHandler;null!=M&&(null==M.first&&M.start(D,0,0,f.getMovableCells(E)),null!=M.first&&(D=+E=0,37==u?E=-y:38==u?D=-y:39==u?E=y:40==u&&(D=y),M.currentDx+=E*H,M.currentDy+=D*H,M.checkPreview(),M.updatePreview()),null!=h&&window.clearTimeout(h),h=window.setTimeout(function(){if(null!=M.first){var N=M.roundLength(M.currentDx/H),L=M.roundLength(M.currentDy/H);M.moveCells(M.cells,N,L);M.reset()}},400))}}}}var e=this,f=this.editor.graph,g=new mxKeyHandler(f),d=g.isEventIgnored;g.isEventIgnored=function(u){return 188==u.keyCode&&this.isControlDown(u)&&!this.graph.cellEditor.isContentEditing()?+!0:!(mxEvent.isShiftDown(u)&&9==u.keyCode)&&(!this.isControlDown(u)||mxEvent.isShiftDown(u)||90!=u.keyCode&&89!=u.keyCode&&188!=u.keyCode&&190!=u.keyCode&&85!=u.keyCode&&83!=u.keyCode)&&(66!=u.keyCode&&73!=u.keyCode||!this.isControlDown(u)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=u.keyCode&&107!=u.keyCode||!this.isControlDown(u)&&!mxEvent.isShiftDown(u)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&d.apply(this,arguments)};+g.isEnabledForEvent=function(u){return!mxEvent.isConsumed(u)&&this.isGraphEvent(u)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};g.isControlDown=function(u){return mxEvent.isControlDown(u)||mxClient.IS_MAC&&u.metaKey};var h=null,l={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},t=g.getFunction;mxKeyHandler.prototype.getFunction=function(u){if(f.isEnabled()){var y=null;mxEvent.isShiftDown(u)&&this.isControlDown(u)&&+mxEvent.isAltDown(u)?y=e.actions.get(e.ctrlAltShiftActions[u.keyCode]):mxEvent.isShiftDown(u)&&mxEvent.isAltDown(u)?y=e.actions.get(e.altShiftActions[u.keyCode]):this.isControlDown(u)&&mxEvent.isAltDown(u)&&(y=e.actions.get(e.ctrlAltActions[u.keyCode]));if(null!=y)return y.funct;if("/"==u.key&&!this.isControlDown(u)&&!mxEvent.isAltDown(u))return function(){var z=document.getElementById("geOmniSearch");null!=z&&30<z.clientWidth&&z.focus()};if(null!=l[u.keyCode]&&!f.isSelectionEmpty())if(!this.isControlDown(u)&&+mxEvent.isShiftDown(u)&&mxEvent.isAltDown(u)){if(f.model.isVertex(f.getSelectionCell()))return function(){var z=f.connectVertex(f.getSelectionCell(),l[u.keyCode],f.defaultEdgeLength,u,!0);null!=z&&0<z.length&&(1==z.length&&f.model.isEdge(z[0])?f.setSelectionCell(f.model.getTerminal(z[0],!1)):f.setSelectionCell(z[z.length-1]),f.scrollCellToVisible(f.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(f.view.getState(f.getSelectionCell())))}}else return this.isControlDown(u)?function(){b(u.keyCode,+mxEvent.isShiftDown(u)?f.gridSize:null,!0)}:function(){b(u.keyCode,mxEvent.isShiftDown(u)?f.gridSize:null)}}return t.apply(this,arguments)};g.bindAction=mxUtils.bind(this,function(u,y,z,E){var D=this.actions.get(z);null!=D&&(z=function(){D.isEnabled()&&D.funct.apply(this,arguments)},y?E?g.bindControlShiftKey(u,z):g.bindControlKey(u,z):E?g.bindShiftKey(u,z):g.bindKey(u,z))});var k=this,v=g.escape;g.escape=function(u){v.apply(this,arguments)};g.enter=function(){};g.bindControlShiftKey(36,function(){f.exitGroup()});+g.bindControlShiftKey(35,function(){f.enterGroup()});g.bindShiftKey(36,function(){f.home()});g.bindKey(35,function(){f.refresh()});g.bindAction(80,!0,"print");g.bindAction(107,!0,"zoomIn");g.bindAction(109,!0,"zoomOut");g.bindAction(61,!0,"zoomIn");g.bindAction(187,!0,"zoomIn");g.bindAction(222,!0,"zoomIn");g.bindAction(173,!0,"zoomOut");g.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)g.bindAction(79,!0,"outline",!0),g.bindControlKey(36,function(){f.isEnabled()&&f.foldCells(!0)}),+g.bindControlKey(35,function(){f.isEnabled()&&f.foldCells(!1)}),g.bindControlKey(13,function(){k.ctrlEnter()}),g.bindAction(8,!1,"delete"),g.bindAction(8,!0,"deleteAll"),g.bindAction(8,!1,"deleteLabels",!0),g.bindAction(46,!1,"delete"),g.bindAction(46,!0,"deleteAll"),g.bindAction(46,!1,"deleteLabels",!0),g.bindAction(36,!1,"resetView"),g.bindAction(72,!0,"fitWindow",!0),g.bindAction(74,!0,"fitPage"),g.bindAction(74,!0,"fitTwoPages",!0),g.bindAction(48,!0,"customZoom"),g.bindAction(82,!0,"turn"),g.bindAction(82,+!0,"clearDefaultStyle",!0),g.bindAction(83,!0,"save"),g.bindAction(83,!0,"saveAs",!0),g.bindAction(65,!0,"selectAll"),g.bindAction(65,!0,"selectNone",!0),"1"!=urlParams.dev&&g.bindAction(73,!0,"selectVertices",!0),g.bindAction(69,!0,"selectEdges",!0),g.bindAction(69,!0,"editStyle"),g.bindAction(66,!0,"bold"),g.bindAction(66,!0,"toBack",!0),g.bindAction(70,!0,"toFront",!0),g.bindAction(68,!0,"duplicate"),g.bindAction(68,!0,"setAsDefaultStyle",!0),g.bindAction(90,!0,"undo"),g.bindAction(90,!0,"redo",+!0),g.bindAction(89,!0,"redo"),g.bindAction(89,!0,"autosize",!0),g.bindAction(88,!0,"cut"),g.bindAction(67,!0,"copy"),g.bindAction(86,!0,"paste"),g.bindAction(71,!0,"group"),g.bindAction(77,!0,"editData"),g.bindAction(71,!0,"grid",!0),g.bindAction(73,!0,"italic"),g.bindAction(76,!0,"lockUnlock"),g.bindAction(76,!0,"layers",!0),g.bindAction(80,!0,"format",!0),g.bindAction(85,!0,"underline"),g.bindAction(85,!0,"ungroup",!0),g.bindAction(109,!0,"decreaseFontSize",!0),g.bindAction(107,!0,"increaseFontSize",+!0),g.bindAction(219,!0,"decreaseFontSize",!0),g.bindAction(221,!0,"increaseFontSize",!0),g.bindAction(190,!0,"superscript"),g.bindAction(188,!0,"subscript"),g.bindAction(13,!1,"keyPressEnter"),g.bindKey(113,function(){f.isEnabled()&&f.startEditingAtCell()});return g};EditorUi.prototype.createMenuElement=function(a,b,e){var f=document.createElement("a");this.addMenuHandler(f,b,e);mxUtils.write(f,a);f.className="geItem";return f};EditorUi.prototype.addMenuHandler=function(a,b,e,f){if(null!=b){var g=null,d=!0,h=mxUtils.bind(this,function(l){null!=e&&e(l);if(!mxEvent.isConsumed(l)&&d&&(null==a.enabled||a.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var t=new mxPopupMenu(b);t.smartSeparators=!0;t.showDisabled=!0;t.autoExpand=!0;t.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(t,arguments);this.resetCurrentMenu();g=null;t.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();var k=mxUtils.getOffset(a);t.popup(k.x,k.y+a.offsetHeight,null,l);this.setCurrentMenu(t,a);g=t}f||mxEvent.consume(l)});mxEvent.addListener(a,"mousemove",mxUtils.bind(this,function(l){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=a&&null!=this.currentMenuElt){var t=this.currentMenuElt;this.hideCurrentMenu();t.parentNode==a.parentNode&&"INPUT"!=a.nodeName&&h(l)}}));mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(l){!this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=a&&mxEvent.isMouseEvent(l)&&this.hideCurrentMenu();d=null==this.currentMenu;"INPUT"!=mxEvent.getSource(l).nodeName?l.preventDefault():l.stopPropagation()}));mxEvent.addListener(a,"click",mxUtils.bind(this,function(l){h(l);d=!0}));f&&(mxEvent.addListener(a,"focus",mxUtils.bind(this,function(l){h(l);d=!0})),mxEvent.addListener(a,"blur",mxUtils.bind(this,function(l){this.currentMenu==g&&this.hideCurrentMenu()})),mxEvent.addListener(a,"keyup",mxUtils.bind(this,@@ -2388,10 +2390,10 @@ Sidebar.prototype.cloneCell=function(a,b){a=a.clone();null!=b&&(a.value=b);returSidebar.prototype.addSearchPalette=function(a){function b(R,Z){D=Z;R=R.firstChild.nextSibling.nextSibling;Z=document.createElement("span");Z.style.color="gray";Z.innerHTML="Enter";R.appendChild(Z)}function e(){k.setAttribute("src",Editor.magnifyImage);k.setAttribute("title",mxResources.get("search"));G.style.display="none";M=t.value="";V()}var f=this.editorUi,g=f.editor.graph,d=document.createElement("div");d.style.visibility="hidden";this.appendChild(d);var h=document.createElement("div");h.className="geSidebar geSearchSidebar";a||(h.style.display="none");var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";var t=document.createElement("input");t.setAttribute("id","geOmniSearch");t.setAttribute("placeholder",mxResources.get("typeSlashToSearch"));t.setAttribute("type","text");l.appendChild(t);var k=document.createElement("img");k.setAttribute("src",Editor.magnifyImage);k.setAttribute("title",mxResources.get("search"));k.className="geAdaptiveAsset";l.appendChild(k);h.appendChild(l);var v=!1;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(R){v=!1;mxClient.IS_TOUCH||mxEvent.getSource(R)!=t||document.activeElement==t||(t.focus(),mxClient.IS_GC||mxClient.IS_FF?t.select():document.execCommand("selectAll",!1,null),v=!0)}),mxUtils.bind(this,function(R){mxEvent.getSource(R)==t&&v&&mxEvent.consume(R)}),mxUtils.bind(this,function(R){v&&(mxEvent.consume(R),v=!1)}));var u=[],y=mxUtils.bind(this,function(R,Z){f.hideCurrentMenu();-mxUtils.remove(R,u);u.unshift(R);5<u.length&&u.pop();R.funct.apply(this,Z);t.value=null}),z="about deleteAll showBoundingBox createSidebarEntry downloadDesktop toggleGoogleFonts".split(" "),F=mxUtils.bind(this,function(R){var Z=null,W;for(W in f.actions.actions){var ba=0>z.indexOf(W)&&"test"!=W.substring(0,4)?f.actions.get(W):null;if(null!=ba&&ba.isEnabled()&&ba.visible){if(W.toLowerCase()==R)return ba;for(var K=R.toLowerCase().split(" "),T=0,aa=0;aa<K.length;aa++)0==K[aa].length?T++:(0<=W.toLowerCase().indexOf(K[aa])||+mxUtils.remove(R,u);u.unshift(R);5<u.length&&u.pop();R.funct.apply(this,Z);t.value=null}),z="about deleteAll showBoundingBox createSidebarEntry downloadDesktop toggleGoogleFonts".split(" "),E=mxUtils.bind(this,function(R){var Z=null,W;for(W in f.actions.actions){var ba=0>z.indexOf(W)&&"test"!=W.substring(0,4)?f.actions.get(W):null;if(null!=ba&&ba.isEnabled()&&ba.visible){if(W.toLowerCase()==R)return ba;for(var K=R.toLowerCase().split(" "),T=0,aa=0;aa<K.length;aa++)0==K[aa].length?T++:(0<=W.toLowerCase().indexOf(K[aa])||0<=ba.getTitle().toLowerCase().indexOf(K[aa]))&&T++;T==K.length&&(0>u.indexOf(Z)||null!=Z&&!Z.isEnabled())&&(Z=ba)}}return Z}),D=null;f.addMenuHandler(t,mxUtils.bind(this,function(R,Z){function W(oa){if(null!=oa&&oa.visible){var pa=R.addItem(oa.getTitle(),null,function(){y(oa,arguments)},Z,null,oa.isEnabled());oa.toggleAction&&oa.isSelected()&&R.addCheckmark(pa,Editor.checkmarkImage);null!=D||!oa.isEnabled()||0!=t.value.length&&T!=oa||b(pa,function(){y(oa,arguments);g.container.focus()})}}var ba=t.value.toLowerCase();D=null;var K=R.addItem(mxResources.get("searchShapes"),null,mxUtils.bind(this,function(){ha()}),Z);b(K,function(){ha()});R.addItem(mxResources.get("findInDiagram"),null,mxUtils.bind(this,function(){f.hideCurrentMenu();f.showSearchWindow(!0,t.value);t.value=""}),Z);Editor.enableAi&&!f.isOffline()&&f.isOwnGDriveDomain()&&f.isExternalDataComms()&&"draw.io"==f.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&R.addItem(mxResources.get("generate"),-null,mxUtils.bind(this,function(){f.openGenerateDialog(t.value);t.value=""}),Z);!f.isOffline()&&f.isOwnGDriveDomain()&&f.isExternalDataComms()&&R.addItem(mxResources.get("help"),null,mxUtils.bind(this,function(){f.searchHelp(t.value);t.value=""}),Z);R.addSeparator();var T=0<t.value.length?F(ba):null;W(T);for(K=0;K<u.length;K++)u[K]!=T&&W(u[K]);if(0<ba.length&&null!=f.pages)for(R.addSeparator(),K=0;K<f.pages.length&&!function(oa){if(null!=oa.getName()&&0<=oa.getName().toLowerCase().indexOf(ba)){var pa=+null,mxUtils.bind(this,function(){f.openGenerateDialog(t.value);t.value=""}),Z);!f.isOffline()&&f.isOwnGDriveDomain()&&f.isExternalDataComms()&&R.addItem(mxResources.get("help"),null,mxUtils.bind(this,function(){f.searchHelp(t.value);t.value=""}),Z);R.addSeparator();var T=0<t.value.length?E(ba):null;W(T);for(K=0;K<u.length;K++)u[K]!=T&&W(u[K]);if(0<ba.length&&null!=f.pages)for(R.addSeparator(),K=0;K<f.pages.length&&!function(oa){if(null!=oa.getName()&&0<=oa.getName().toLowerCase().indexOf(ba)){var pa=function(){f.selectPage(oa);g.container.focus();t.value=""},da=R.addItem(oa.getName()+" ("+mxResources.get("page")+")",null,pa,Z);null==D&&b(da,pa);return!0}return!1}(f.pages[K]);K++);if(0<ba.length&&null!=f.sidebar&&null!=f.sidebar.entries)for(R.addSeparator(),K=0;K<f.sidebar.entries.length;K++)for(var aa=f.sidebar.entries[K].entries,ka=0;ka<aa.length;ka++)(function(oa){var pa=f.sidebar.getConfigurationById(oa.id),da=oa.title.toLowerCase().split(" ");null!=pa&&0<=mxUtils.indexOf(da,ba)&&(da=function(){var ia=f.sidebar.showPalettes(pa.prefix||"",pa.libs||[pa.id],!0);t.value="";null!=ia&&1<ia.length&&(null==ia[1].firstChild||null!=ia[1].firstChild.firstChild&&"none"!=ia[1].firstChild.style.display||ia[0].click(),ia[0].scrollIntoView({behavior:"smooth"}))},oa=R.addItem(oa.title+" ("+mxResources.get("openLibrary")+")",null,da,Z),null==D&&b(oa,da));return!0})(aa[ka])}),null,!0);var G=document.createElement("div");G.style.display="none";G.style.paddingTop="8px";G.style.alignItems="center";G.style.justifyContent="center";var H=mxUtils.button(mxResources.get("moreResults"),function(){ha()});H.setAttribute("title",mxResources.get("moreResults"));H.className="geBtn gePrimaryBtn";H.style.borderRadius="16px";H.style.padding="8px 12px";G.appendChild(H);h.appendChild(G);var M="",N=!1,L=!1,U=0,X={},S=12,V=mxUtils.bind(this,function(){N=!1;this.currentSearch=null;for(var R=h.firstChild;null!=R;){var Z=R.nextSibling;R!=l&&R!=G&&R.parentNode.removeChild(R);R=Z}});mxEvent.addListener(k,"click",function(){k.getAttribute("src")!=@@ -2513,17 +2515,17 @@ a.width,(e-2*this.thumbBorder)/a.height))/100,this.graph.view.scaleAndTranslate(null!=u?"visible":"hidden";k.style.left=(null!=v?v:this.thumbBorder-1)+"px";k.style.top=k.style.left;k.style.width=b+"px";k.style.height=e+"px";k.style.visibility="";k.style.minWidth="";k.style.minHeight="";this.disablePointerEvents(k);f.appendChild(k);this.sidebarTitles&&null!=g&&0!=h&&(f.style.height=this.thumbHeight+0+this.sidebarTitleSize+8+"px",b=document.createElement("div"),b.style.color=Editor.isDarkMode()?"#A0A0A0":"#303030",b.style.fontSize=this.sidebarTitleSize+"px",b.style.textAlign="center",b.style.whiteSpace="nowrap",b.style.overflow="hidden",b.style.textOverflow="ellipsis",mxClient.IS_IE&&(b.style.height=this.sidebarTitleSize+12+"px"),b.style.paddingTop="4px",mxUtils.write(b,g),f.appendChild(b));return a};Sidebar.prototype.createSection=function(a){return mxUtils.bind(this,function(){var b=document.createElement("div");b.setAttribute("title",a);b.style.textOverflow="ellipsis";b.style.whiteSpace="nowrap";b.style.textAlign="center";b.style.overflow="hidden";b.style.width="100%";b.style.padding="14px 0";mxUtils.write(b,a);return b})};-Sidebar.prototype.createItem=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z,F){l=null!=l?l:!0;k=null!=k?k:this.thumbWidth;v=null!=v?v:this.thumbHeight;var D=F;if(null==D){D=document.createElement("a");var G=2*this.thumbBorder;D.style.width=k+G+"px";D.style.height=v+G+"px"}mxEvent.addListener(D,"click",function(M){mxEvent.consume(M)});var H=new mxRectangle(0,0,g,d);null!=a&&0<a.length?(G=a,a=this.graph.cloneCells(a),this.graph.pasteCellStyles(this.graph.includeDescendants(G),this.initialDefaultVertexStyle,this.initialDefaultEdgeStyle),-null!=u?(D.className="geButton",D.style.backgroundImage="url("+u+")",D.style.backgroundRepeat="no-repeat",D.style.backgroundPosition="center",D.style.backgroundSize="24px 24px"):null==F&&(D.className="geItem",this.createThumb(G,k,v,D,b,e,f,g,d)),1<a.length||a[0].vertex?(f=this.createDragSource(D,this.createDropHandler(a,!0,h,H,y,z),this.createDragPreview(g,d),a,H,y),this.addClickHandler(D,f,a,t,y),f.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):-null!=a[0]&&a[0].edge&&(f=this.createDragSource(D,this.createDropHandler(a,!1,h,H,y,z),this.createDragPreview(g,d),a,H,y),this.addClickHandler(D,f,a,t)),!mxClient.IS_IOS&&l&&mxEvent.addGestureListeners(D,null,mxUtils.bind(this,function(M){mxEvent.isMouseEvent(M)&&this.showTooltip(D,a,H.width,H.height,b,e)}))):null==F&&(D.style.backgroundImage="url("+Editor.svgBrokenImage.src+")",D.setAttribute("title",b));return D};+Sidebar.prototype.createItem=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z,E){l=null!=l?l:!0;k=null!=k?k:this.thumbWidth;v=null!=v?v:this.thumbHeight;var D=E;if(null==D){D=document.createElement("a");var G=2*this.thumbBorder;D.style.width=k+G+"px";D.style.height=v+G+"px"}mxEvent.addListener(D,"click",function(M){mxEvent.consume(M)});var H=new mxRectangle(0,0,g,d);null!=a&&0<a.length?(G=a,a=this.graph.cloneCells(a),this.graph.pasteCellStyles(this.graph.includeDescendants(G),this.initialDefaultVertexStyle,this.initialDefaultEdgeStyle),+null!=u?(D.className="geButton",D.style.backgroundImage="url("+u+")",D.style.backgroundRepeat="no-repeat",D.style.backgroundPosition="center",D.style.backgroundSize="24px 24px"):null==E&&(D.className="geItem",this.createThumb(G,k,v,D,b,e,f,g,d)),1<a.length||a[0].vertex?(f=this.createDragSource(D,this.createDropHandler(a,!0,h,H,y,z),this.createDragPreview(g,d),a,H,y),this.addClickHandler(D,f,a,t,y),f.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):+null!=a[0]&&a[0].edge&&(f=this.createDragSource(D,this.createDropHandler(a,!1,h,H,y,z),this.createDragPreview(g,d),a,H,y),this.addClickHandler(D,f,a,t)),!mxClient.IS_IOS&&l&&mxEvent.addGestureListeners(D,null,mxUtils.bind(this,function(M){mxEvent.isMouseEvent(M)&&this.showTooltip(D,a,H.width,H.height,b,e)}))):null==E&&(D.style.backgroundImage="url("+Editor.svgBrokenImage.src+")",D.setAttribute("title",b));return D};Sidebar.prototype.prepareCellsForInsert=function(a){if(null!=a&&0<a.length)for(var b=this.graph.getModel(),e=0;e<a.length;e++)if(this.prepareCellsForInsert(b.getChildren(a[e])),b.isVertex(a[e])){var f=b.getEdges(a[e]),g=this.graph.getCellStyle(a[e]);null!=f&&0!=f.length||null==g||1!=mxUtils.getValue(g,mxConstants.STYLE_FLIPV,0)&&1!=mxUtils.getValue(g,mxConstants.STYLE_FLIPH,0)&&1!=mxUtils.getValue(g,"stencilFlipH",0)&&1!=mxUtils.getValue(g,"stencilFlipV",0)||this.graph.setCellStyles("legacyAnchorPoints","0",[a[e]])}};Sidebar.prototype.createDropHandler=function(a,b,e,f,g,d){e=null!=e?e:!0;this.prepareCellsForInsert.call(this,a);return mxUtils.bind(this,function(h,l,t,k,v,u){for(u=u?null:mxEvent.isTouchEvent(l)||mxEvent.isPenEvent(l)?document.elementFromPoint(mxEvent.getClientX(l),mxEvent.getClientY(l)):mxEvent.getSource(l);null!=u&&u!=this.container;)u=u.parentNode;if(null==u&&h.isEnabled()){a=h.getImportableCells(a);if(0<a.length){h.stopEditing();u=null==t||mxEvent.isAltDown(l)?!1:h.isValidDropTarget(t,a,l);-var y=null;null==t||u||(t=null);if(!h.isCellLocked(t||h.getDefaultParent())){h.model.beginUpdate();try{k=Math.round(k);v=Math.round(v);if(b&&h.isSplitTarget(t,a,l)){var z=h.view.scale,F=h.view.translate,D=(k+F.x)*z,G=(v+F.y)*z,H=h.cloneCells(a);h.splitEdge(t,H,null,k-f.width/2,v-f.height/2,D,G);y=H}else if(0<a.length&&(y=h.importCells(a,k,v,t),h.model.isVertex(d)&&1==y.length&&h.model.isVertex(y[0]))){var M=h.insertEdge(h.model.getParent(d),null,"",d,y[0],h.createCurrentEdgeStyle());h.applyNewEdgeStyle(d,-[M]);y.push(M);h.connectionHandler.insertBeforeSource&&h.insertEdgeBeforeCell(M,d)}if(null!=h.layoutManager){var N=h.layoutManager.getLayout(t);if(null!=N){z=h.view.scale;F=h.view.translate;D=(k+F.x)*z;G=(v+F.y)*z;for(var L=0;L<y.length;L++)N.moveCell(y[L],D,G)}}!e||null!=l&&mxEvent.isShiftDown(l)||h.fireEvent(new mxEventObject("cellsInserted","cells",y));for(L=0;L<y.length;L++)h.model.isVertex(y[L])&&h.isAutoSizeCell(y[L])&&h.updateCellSize(y[L])}catch(U){this.editorUi.handleError(U)}finally{h.model.endUpdate()}null!=+var y=null;null==t||u||(t=null);if(!h.isCellLocked(t||h.getDefaultParent())){h.model.beginUpdate();try{k=Math.round(k);v=Math.round(v);if(b&&h.isSplitTarget(t,a,l)){var z=h.view.scale,E=h.view.translate,D=(k+E.x)*z,G=(v+E.y)*z,H=h.cloneCells(a);h.splitEdge(t,H,null,k-f.width/2,v-f.height/2,D,G);y=H}else if(0<a.length&&(y=h.importCells(a,k,v,t),h.model.isVertex(d)&&1==y.length&&h.model.isVertex(y[0]))){var M=h.insertEdge(h.model.getParent(d),null,"",d,y[0],h.createCurrentEdgeStyle());h.applyNewEdgeStyle(d,+[M]);y.push(M);h.connectionHandler.insertBeforeSource&&h.insertEdgeBeforeCell(M,d)}if(null!=h.layoutManager){var N=h.layoutManager.getLayout(t);if(null!=N){z=h.view.scale;E=h.view.translate;D=(k+E.x)*z;G=(v+E.y)*z;for(var L=0;L<y.length;L++)N.moveCell(y[L],D,G)}}!e||null!=l&&mxEvent.isShiftDown(l)||h.fireEvent(new mxEventObject("cellsInserted","cells",y));for(L=0;L<y.length;L++)h.model.isVertex(y[L])&&h.isAutoSizeCell(y[L])&&h.updateCellSize(y[L])}catch(U){this.editorUi.handleError(U)}finally{h.model.endUpdate()}null!=y&&0<y.length&&(h.scrollCellToVisible(y[0]),h.setSelectionCells(y));(g||h.editAfterInsert&&null!=l&&mxEvent.isMouseEvent(l)&&null!=y&&1==y.length)&&window.setTimeout(function(){h.startEditing(y[0])},0)}}mxEvent.consume(l)}})};Sidebar.prototype.createDragPreview=function(a,b){var e=document.createElement("div");e.className="geDragPreview";e.style.width=a+"px";e.style.height=b+"px";return e};-Sidebar.prototype.dropAndConnect=function(a,b,e,f,g,d,h){var l=this.editorUi.editor.graph,t=l.model.isEdge(a)||null!=d?d:h;t=this.getDropAndConnectGeometry(a,b[t],e,b);var k=[];if(null!=t){var v=null;l.model.beginUpdate();try{var u=l.getCellGeometry(a),y=l.getCellGeometry(b[f]),z=l.model.getParent(a),F=!0;if(null!=l.layoutManager){var D=l.layoutManager.getLayout(z);null!=D&&D.constructor==mxStackLayout&&(F=!1)}k=l.model.isEdge(a)?null:l.view.getState(z);var G=D=0;if(null!=k){var H=k.origin;D=H.x;-G=H.y}var M=!l.isTableRow(a)&&!l.isTableCell(a)&&(l.model.isEdge(a)||null!=u&&!u.relative&&F),N=l.getCellAt((t.x+D+l.view.translate.x)*l.view.scale,(t.y+G+l.view.translate.y)*l.view.scale,null,null,null,function(ha,R,Z){return!l.isContainer(ha.cell)});if(null!=N&&N!=z)k=l.view.getState(N),null!=k&&(H=k.origin,z=N,M=!0,l.model.isEdge(a)||(t.x-=H.x-D,t.y-=H.y-G));else if(!F||l.isTableRow(a)||l.isTableCell(a))t.x+=D,t.y+=G;D=y.x;G=y.y;l.model.isEdge(b[f])&&(G=D=0);k=b=l.importCells(b,t.x-(M?D:0),t.y-+Sidebar.prototype.dropAndConnect=function(a,b,e,f,g,d,h){var l=this.editorUi.editor.graph,t=l.model.isEdge(a)||null!=d?d:h;t=this.getDropAndConnectGeometry(a,b[t],e,b);var k=[];if(null!=t){var v=null;l.model.beginUpdate();try{var u=l.getCellGeometry(a),y=l.getCellGeometry(b[f]),z=l.model.getParent(a),E=!0;if(null!=l.layoutManager){var D=l.layoutManager.getLayout(z);null!=D&&D.constructor==mxStackLayout&&(E=!1)}k=l.model.isEdge(a)?null:l.view.getState(z);var G=D=0;if(null!=k){var H=k.origin;D=H.x;+G=H.y}var M=!l.isTableRow(a)&&!l.isTableCell(a)&&(l.model.isEdge(a)||null!=u&&!u.relative&&E),N=l.getCellAt((t.x+D+l.view.translate.x)*l.view.scale,(t.y+G+l.view.translate.y)*l.view.scale,null,null,null,function(ha,R,Z){return!l.isContainer(ha.cell)});if(null!=N&&N!=z)k=l.view.getState(N),null!=k&&(H=k.origin,z=N,M=!0,l.model.isEdge(a)||(t.x-=H.x-D,t.y-=H.y-G));else if(!E||l.isTableRow(a)||l.isTableCell(a))t.x+=D,t.y+=G;D=y.x;G=y.y;l.model.isEdge(b[f])&&(G=D=0);k=b=l.importCells(b,t.x-(M?D:0),t.y-(M?G:0),M?z:null);if(l.model.isEdge(a))l.model.setTerminal(a,b[f],e==mxConstants.DIRECTION_NORTH),null!=h&&null!=d&&(l.model.remove(b[h]),l.updateShapes(b[h],[a]));else if(l.model.isEdge(b[f])&&null==d){l.model.setTerminal(b[f],a,!0);var L=l.getCellGeometry(b[f]),U=null!=L?L.getTerminalPoint(!0):null;L.points=null;if(null!=U)for(e=0;e<b.length;e++)if(l.model.isEdge(b[e])&&e!=f){var X=l.getCellGeometry(b[e]),S=null!=X?X.getTerminalPoint(!0):null;null!=S&&S.x==U.x&&S.y==U.y&&l.model.setTerminal(b[e],a,!0)}if(null!=L.getTerminalPoint(!1))L.setTerminalPoint(t.getTerminalPoint(!1),!1);else if(M&&l.model.isVertex(z)){var V=l.view.getState(z);H=V.cell!=l.view.currentRoot?V.origin:new mxPoint(0,0);l.cellsMoved(b,H.x,H.y,null,null,!0)}}else null!=d&&(y=l.getCellGeometry(b[d]),D=t.x-Math.round(y.x),G=t.y-Math.round(y.y),t.x=Math.round(y.x),t.y=Math.round(y.y),l.model.setGeometry(b[f],t),l.cellsMoved(b,D,G,null,null,!0),k=b.slice(),v=1==k.length?k[0]:null,null!=h?l.model.setTerminal(b[h],a,!0):b.push(l.insertEdge(null,null,"",a,b[f],l.createCurrentEdgeStyle())));null!=g&&mxEvent.isShiftDown(g)||l.fireEvent(new mxEventObject("cellsInserted","cells",b))}catch(ha){this.editorUi.handleError(ha)}finally{l.model.endUpdate()}l.editAfterInsert&&null!=g&&mxEvent.isMouseEvent(g)&&null!=v&&window.setTimeout(function(){l.startEditing(v)},0)}null!=h&&1<k.length&&k.splice(h,1);return k};@@ -2534,7 +2536,7 @@ f.width/2+d:e==mxConstants.DIRECTION_SOUTH?f.y=f.y+t.height/2+f.height/2+d:e==mx2):e==mxConstants.DIRECTION_WEST&&(f.x-=t.getCenterX()+t.width/2,f.y-=t.getCenterY()))))));return f};Sidebar.prototype.isDropStyleEnabled=function(a,b){var e=!0;null!=b&&1==a.length&&(a=this.graph.getCellStyle(a[b]),null!=a&&(e=mxUtils.getValue(a,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(a,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE));return e};Sidebar.prototype.isDropStyleTargetIgnored=function(a){return this.graph.isSwimlane(a.cell)||this.graph.isTableCell(a.cell)||this.graph.isTableRow(a.cell)||this.graph.isTable(a.cell)};Sidebar.prototype.disablePointerEvents=function(a){mxUtils.visitNodes(a,mxUtils.bind(this,function(b){b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style&&(b.style.pointerEvents="none",b.removeAttribute("pointer-events"))}))};Sidebar.prototype.createDragSource=function(a,b,e,f,g,d){function h(ja,ua){var ya=mxUtils.createImage(ja.src);ya.style.width=ja.width+"px";ya.style.height=ja.height+"px";null!=ua&&ya.setAttribute("title",ua);mxUtils.setOpacity(ya,ja==this.refreshTarget?30:20);ya.style.position="absolute";ya.style.cursor="crosshair";return ya}function l(ja,ua,ya,Ma){null!=Ma.parentNode&&(mxUtils.contains(ya,ja,ua)?(mxUtils.setOpacity(Ma,100),T=Ma):mxUtils.setOpacity(Ma,Ma==R?30:20));return ya}var t=this.editorUi,k=-t.editor.graph,v=null,u=null,y=this;d=0;for(var z=this.livePreview,F=0;F<f.length&&z;F++)d+=k.model.getDescendants(f[F]).length,z=d<k.graphHandler.maxLivePreview;for(F=0;F<f.length&&(null==u&&k.model.isVertex(f[F])?u=F:null==v&&k.model.isEdge(f[F])&&null==k.model.getTerminal(f[F],!0)&&(v=F),null==u||null==v);F++);var D=this.isDropStyleEnabled(f,u),G=mxUtils.makeDraggable(a,k,mxUtils.bind(this,function(ja,ua,ya,Ma,Oa){null!=this.updateThread&&window.clearTimeout(this.updateThread);if(null!=f&&null!=+t.editor.graph,v=null,u=null,y=this;d=0;for(var z=this.livePreview,E=0;E<f.length&&z;E++)d+=k.model.getDescendants(f[E]).length,z=d<k.graphHandler.maxLivePreview;for(E=0;E<f.length&&(null==u&&k.model.isVertex(f[E])?u=E:null==v&&k.model.isEdge(f[E])&&null==k.model.getTerminal(f[E],!0)&&(v=E),null==u||null==v);E++);var D=this.isDropStyleEnabled(f,u),G=mxUtils.makeDraggable(a,k,mxUtils.bind(this,function(ja,ua,ya,Ma,Oa){null!=this.updateThread&&window.clearTimeout(this.updateThread);if(null!=f&&null!=L&&T==R){var Ka=ja.isCellSelected(L.cell)?ja.getSelectionCells():[L.cell];ja.updateShapes(ja.model.isEdge(L.cell)?f[0]:f[u],Ka,!0);ja.setSelectionCells(Ka)}else null!=f&&null!=T&&null!=M&&T!=R?(Ka=ja.model.isEdge(M.cell)||null==v?u:v,ja.setSelectionCells(this.dropAndConnect(M.cell,f,K,Ka,ua,u,v))):b.apply(this,arguments);null!=this.editorUi.hoverIcons&&this.editorUi.hoverIcons.update(ja.view.getState(ja.getSelectionCell()))}),e,0,0,k.autoscroll,!0,!0);z&&(G.createDragElement=mxUtils.bind(this,function(){return G.createPreviewElement(this.graph)}),G.createPreviewElement=mxUtils.bind(this,function(ja){var ua=document.createElement("a");ua.className="geItem";ua.style.overflow="visible";ja=ja.view.scale;ua.style.width=ja*Math.max(1,g.width)+"px";ua.style.height=ja*Math.max(1,g.height)+"px";mxUtils.setOpacity(ua,50);var ya=k.cloneCells(f);this.graph.pasteCellStyles(k.includeDescendants(ya),k.currentVertexStyle,k.currentEdgeStyle,null,k.pasteEdgeStyle);y.createThumb(ya,ja*Math.max(1,g.width),ja*Math.max(1,g.height),ua,null,null,null,null,null,k.shapeBackgroundColor,0,ja);return ua}));var H=G.mouseDown;G.mouseDown=function(ja){mxEvent.isPopupTrigger(ja)||mxEvent.isMultiTouchEvent(ja)||k.isCellLocked(k.getDefaultParent())||(k.stopEditing(),H.apply(this,arguments))};var M=null,N=null,L=null,U=!1,X=h(this.triangleUp,mxResources.get("connect")),S=h(this.triangleRight,mxResources.get("connect")),V=h(this.triangleDown,mxResources.get("connect")),ha=h(this.triangleLeft,mxResources.get("connect")),R=h(this.refreshTarget,mxResources.get("replace")),Z=null,W=h(this.roundDrop),@@ -2560,7 +2562,7 @@ arguments)};var qa=G.stopDrag;G.stopDrag=function(){qa.apply(this,arguments);forSidebar.prototype.itemClicked=function(a,b,e,f){f=this.editorUi.editor.graph;f.container.focus();if(mxEvent.isAltDown(e)&&1==f.getSelectionCount()){for(var g=b=null,d=0;d<a.length&&(null==g&&f.model.isVertex(a[d])?g=d:null==b&&f.model.isEdge(a[d])&&null==f.model.getTerminal(a[d],!0)&&(b=d),null==g||null==b);d++);d=null==b?g:b;f.setSelectionCells(this.dropAndConnect(f.getSelectionCell(),a,mxEvent.isMetaDown(e)||mxEvent.isControlDown(e)?mxEvent.isShiftDown(e)?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH:mxEvent.isShiftDown(e)?mxConstants.DIRECTION_EAST:mxConstants.DIRECTION_SOUTH,d,e,g,b));f.scrollCellToVisible(f.getSelectionCell())}else mxEvent.isShiftDown(e)&&!f.isSelectionEmpty()?(e=f.getEditableCells(f.getSelectionCells()),f.updateShapes(a[0],e,!0),f.scrollCellToVisible(e)):(a=mxEvent.isAltDown(e)?f.getFreeInsertPoint():f.getCenterInsertPoint(f.getBoundingBoxFromGeometry(a,!0)),b.drop(f,e,null,a.x,a.y,!0))};Sidebar.prototype.addClickHandler=function(a,b,e,f){var g=b.getGraphForEvent,d=b.mouseDown,h=b.mouseMove,l=b.mouseUp,t=this.editorUi.editor.graph.tolerance,k=!1,v=null,u=this,y=null;b.getGraphForEvent=function(z){return k?g.apply(this,arguments):null};b.mouseDown=function(z){d.apply(this,arguments);v=new mxPoint(mxEvent.getClientX(z),mxEvent.getClientY(z));y=a.style.opacity;k=!1;""==y&&(y="1");null!=this.dragElement&&(this.dragElement.style.display="none")};b.mouseMove=function(z){(k=null!=v&&(Math.abs(v.x--mxEvent.getClientX(z))>t||Math.abs(v.y-mxEvent.getClientY(z))>t))&&null!=this.dragElement&&"none"==this.dragElement.style.display&&(this.dragElement.style.display="");h.apply(this,arguments)};b.mouseUp=function(z){try{mxEvent.isPopupTrigger(z)||null!=this.currentGraph||null==this.dragElement||"none"!=this.dragElement.style.display||(null!=f&&f(z),mxEvent.isConsumed(z)||u.itemClicked(e,b,z,a)),l.apply(b,arguments),v=null,u.currentElt=a}catch(F){b.reset(),u.editorUi.handleError(F)}}};+mxEvent.getClientX(z))>t||Math.abs(v.y-mxEvent.getClientY(z))>t))&&null!=this.dragElement&&"none"==this.dragElement.style.display&&(this.dragElement.style.display="");h.apply(this,arguments)};b.mouseUp=function(z){try{mxEvent.isPopupTrigger(z)||null!=this.currentGraph||null==this.dragElement||"none"!=this.dragElement.style.display||(null!=f&&f(z),mxEvent.isConsumed(z)||u.itemClicked(e,b,z,a)),l.apply(b,arguments),v=null,u.currentElt=a}catch(E){b.reset(),u.editorUi.handleError(E)}}};Sidebar.prototype.createVertexTemplateEntry=function(a,b,e,f,g,d,h,l){null!=l&&null!=g&&(l+=" "+g);l=null!=l&&0<l.length?l:null!=g?g.toLowerCase():"";return this.addEntry(l,mxUtils.bind(this,function(){return this.createVertexTemplate(a,b,e,f,g,d,h)}))};Sidebar.prototype.createVertexTemplate=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z){a=[new mxCell(null!=f?f:"",new mxGeometry(0,0,b,e),a)];a[0].vertex=!0;return this.createVertexTemplateFromCells(a,b,e,g,d,h,l,t,k,v,u,y,z)};Sidebar.prototype.createVertexTemplateFromData=function(a,b,e,f,g,d,h,l){var t=null;try{var k=mxUtils.parseXml(Graph.decompress(a)),v=new mxCodec(k),u=new mxGraphModel;v.decode(k.documentElement,u);t=this.graph.cloneCells(u.root.getChildAt(0).children)}catch(y){f=mxResources.get("error")+": "+y.message}return this.createVertexTemplateFromCells(t,b,e,f,g,d,h,l)};Sidebar.prototype.createVertexTemplateFromCells=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z){return this.createItem(a,f,g,d,b,e,h,l,t,k,v,u,y,z)};Sidebar.prototype.createEdgeTemplateEntry=function(a,b,e,f,g,d,h,l,t){h=null!=h&&0<h.length?h:g.toLowerCase();return this.addEntry(h,mxUtils.bind(this,function(){return this.createEdgeTemplate(a,b,e,f,g,d,l,t)}))};@@ -2573,8 +2575,8 @@ Sidebar.prototype.setContentVisible=function(a,b){var e=Editor.transitionDelay;m(mxUtils.setPrefixedStyle(a.style,"transform","scaleY(0)"),window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(a.style,"transform",null);mxUtils.setPrefixedStyle(a.style,"transition",null);a.style.display="none"}),1E3*e))};Sidebar.prototype.removePalette=function(a){var b=this.palettes[a];if(null!=b){this.palettes[a]=null;for(a=0;a<b.length;a++)this.container.removeChild(b[a]);return!0}return!1};Sidebar.prototype.addImagePalette=function(a,b,e,f,g,d,h){for(var l=[],t=0;t<g.length;t++)mxUtils.bind(this,function(k,v,u){if(null==u&&(null==e||"img/lib/clip_art/"!=e.substring(0,17))){u=k.lastIndexOf("/");var y=k.lastIndexOf(".");u=k.substring(0<=u?u+1:0,0<=y?y:k.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;image="+e+k+f,this.defaultImageWidth,this.defaultImageHeight,"",v,null!=v,null,this.filterTags(u)))})(g[t],null!=d?d[t]:null,null!=h?h[g[t]]:null);this.addPaletteFunctions(a,b,!1,l)};Sidebar.prototype.getTagsForStencil=function(a,b,e){a=a.split(".");for(var f=1;f<a.length;f++)a[f]=a[f].replace(/_/g," ");a.push(b.replace(/_/g," "));null!=e&&a.push(e);return a.slice(1,a.length)};-Sidebar.prototype.addStencilPalette=function(a,b,e,f,g,d,h,l,t,k){h=null!=h?h:1;if(this.addStencilsToIndex){var v=[];if(null!=t)for(k=0;k<t.length;k++)v.push(t[k]);mxStencilRegistry.loadStencilSet(e,mxUtils.bind(this,function(u,y,z,F,D){if(null==g||0>mxUtils.indexOf(g,y)){z=this.getTagsForStencil(u,y);var G=null!=l?l[y]:null;null!=G&&z.push(G);v.push(this.createVertexTemplateEntry("shape="+u+y.toLowerCase()+f,Math.round(F*h),Math.round(D*h),"",y.replace(/_/g," "),null,null,this.filterTags(z.join(" "))))}}),-!0,!0);this.addPaletteFunctions(a,b,!1,v)}else this.addPalette(a,b,!1,mxUtils.bind(this,function(u){null==f&&(f="");null!=d&&d.call(this,u);if(null!=t)for(var y=0;y<t.length;y++)t[y](u);mxStencilRegistry.loadStencilSet(e,mxUtils.bind(this,function(z,F,D,G,H){(null==g||0>mxUtils.indexOf(g,F))&&u.appendChild(this.createVertexTemplate("shape="+z+F.toLowerCase()+f,Math.round(G*h),Math.round(H*h),"",F.replace(/_/g," "),!0))}),!0)}))};+Sidebar.prototype.addStencilPalette=function(a,b,e,f,g,d,h,l,t,k){h=null!=h?h:1;if(this.addStencilsToIndex){var v=[];if(null!=t)for(k=0;k<t.length;k++)v.push(t[k]);mxStencilRegistry.loadStencilSet(e,mxUtils.bind(this,function(u,y,z,E,D){if(null==g||0>mxUtils.indexOf(g,y)){z=this.getTagsForStencil(u,y);var G=null!=l?l[y]:null;null!=G&&z.push(G);v.push(this.createVertexTemplateEntry("shape="+u+y.toLowerCase()+f,Math.round(E*h),Math.round(D*h),"",y.replace(/_/g," "),null,null,this.filterTags(z.join(" "))))}}),+!0,!0);this.addPaletteFunctions(a,b,!1,v)}else this.addPalette(a,b,!1,mxUtils.bind(this,function(u){null==f&&(f="");null!=d&&d.call(this,u);if(null!=t)for(var y=0;y<t.length;y++)t[y](u);mxStencilRegistry.loadStencilSet(e,mxUtils.bind(this,function(z,E,D,G,H){(null==g||0>mxUtils.indexOf(g,E))&&u.appendChild(this.createVertexTemplate("shape="+z+E.toLowerCase()+f,Math.round(G*h),Math.round(H*h),"",E.replace(/_/g," "),!0))}),!0)}))};Sidebar.prototype.destroy=function(){null!=this.graph&&(null!=this.graph.container&&null!=this.graph.container.parentNode&&this.graph.container.parentNode.removeChild(this.graph.container),this.graph.destroy(),this.graph=null);null!=this.escapeListener&&(this.editorUi.editor.graph.removeListener(this.escapeListener),this.escapeListener=null);null!=this.refreshListener&&(this.editorUi.removeListener(this.refreshListener),this.refreshListener=null);null!=this.pointerUpHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerUpHandler=null);null!=this.pointerDownHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerDownHandler=null);null!=this.pointerMoveHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerMoveHandler=null);null!=this.pointerOutHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),this.pointerOutHandler=null)};(function(){var a=[["nbsp","160"],["shy","173"]],b=mxUtils.parseXml;mxUtils.parseXml=function(f){for(var g=0;g<a.length;g++)f=f.replace(new RegExp("&"+a[g][0]+";","g"),"&#"+a[g][1]+";");return b(f)};var e=mxUtils.getSizeForString;mxUtils.getSizeForString=function(f,g,d,h){return e(Graph.sanitizeHtml(f),g,d,h)}})();@@ -2605,22 +2607,23 @@ new mxRectangle(aa.x+aa.width-2,aa.y,4,aa.height)))oa="col-resize";for(T=aa;nullT&&(K.lastLabelValue=T,K.lastSanitizedLabelValue=Graph.sanitizeHtml(T),y.innerHTML=K.lastSanitizedLabelValue,Graph.addLightDarkColors(y,null,"simple"==K.view.graph.getAdaptiveColors())&&(K.lastSanitizedLabelValue=y.innerHTML)),T=K.lastSanitizedLabelValue));return T};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(K,T){return!1};this.alternateEdgeStyle="vertical";null==f&&this.loadStylesheet();var z=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var K=z.apply(this,arguments);if(this.graph.pageVisible){var T=[],aa=this.graph.pageFormat,ka=this.graph.pageScale,oa=aa.width*ka;aa=aa.height*ka;ka=this.graph.view.translate;for(var pa=this.graph.view.scale,da=this.graph.getPageLayout(),ia=0;ia<da.width;ia++)T.push(new mxRectangle(((da.x+ia)*oa+ka.x)*pa,(da.y*aa+ka.y)*pa,oa*pa,aa*pa));for(ia=1;ia<da.height;ia++)T.push(new mxRectangle((da.x*oa+ka.x)*pa,((da.y+ia)*aa+ka.y)*pa,oa*pa,aa*pa));K=T.concat(K)}return K};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(K,T){return null==K.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=-function(K){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(K){for(var T=F.apply(this,arguments),aa=new mxDictionary,ka=[],oa=0;oa<T.length;oa++){var pa=this.graph.isTableCell(K)&&this.graph.isTableCell(T[oa])&&this.graph.isCellSelected(T[oa])?this.graph.model.getParent(T[oa]):this.graph.isTableRow(K)&&this.graph.isTableRow(T[oa])&&+function(K){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var E=this.graphHandler.getCells;this.graphHandler.getCells=function(K){for(var T=E.apply(this,arguments),aa=new mxDictionary,ka=[],oa=0;oa<T.length;oa++){var pa=this.graph.isTableCell(K)&&this.graph.isTableCell(T[oa])&&this.graph.isCellSelected(T[oa])?this.graph.model.getParent(T[oa]):this.graph.isTableRow(K)&&this.graph.isTableRow(T[oa])&&this.graph.isCellSelected(T[oa])?T[oa]:this.graph.getCompositeParent(T[oa]);null==pa||aa.get(pa)||(aa.put(pa,!0),ka.push(pa))}return ka};var D=this.graphHandler.start;this.graphHandler.start=function(K,T,aa,ka){var oa=!1;this.graph.isTableCell(K)&&(this.graph.isCellSelected(K)?oa=!0:K=this.graph.model.getParent(K));oa||this.graph.isTableRow(K)&&this.graph.isCellSelected(K)||(K=this.graph.getCompositeParent(K));D.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(K,T){T=this.graph.getCompositeParent(T);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(K,T,aa,ka,oa,pa){var da=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=ka&&this.graph.applyNewEdgeStyle(ka,[da]);return da};var G=new mxRubberband(this);this.getRubberband=function(){return G};var H=(new Date).getTime(),M=0,N=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var K=this.currentState;N.apply(this,arguments);K!=this.currentState?(H=(new Date).getTime(),M=0):M=(new Date).getTime()-H};var L=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(K){return mxEvent.isShiftDown(K.getEvent())&&mxEvent.isAltDown(K.getEvent())?!1:null!=this.currentState&&K.getState()==this.currentState&&2E3<M||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&L.apply(this,arguments)};var U=this.isToggleEvent;this.isToggleEvent=function(K){return U.apply(this,arguments)||mxEvent.isShiftDown(K)};var X=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(X=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=X)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(K){return mxEvent.isMouseEvent(K.getEvent())};var S=this.click;this.click=function(K){var T=null==K.state&&null!=K.sourceState&&this.isCellLocked(this.getLayerForCell(K.sourceState.cell));if(this.isEnabled()&&!T||K.isConsumed())return S.apply(this,arguments);var aa=T?K.sourceState.cell:K.getCell();if(null!=aa){var ka=this.getClickableLinkForCell(aa);null!=ka?this.isCustomLink(ka)?this.customLinkClicked(ka,aa):this.openLink(ka):T&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(K){return K.sourceState};var V=this.tooltipHandler.show;this.tooltipHandler.show=function(){V.apply(this,arguments);if(null!=this.div)for(var K=this.div.getElementsByTagName("a"),T=0;T<K.length;T++)null!=K[T].getAttribute("href")&&null==K[T].getAttribute("target")&&K[T].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(K){return K.sourceState};this.getCursorForMouseEvent=function(K){var T=null==K.state&&null!=K.sourceState&&this.isCellLocked(K.sourceState.cell);return this.getCursorForCell(T?K.sourceState.cell:K.getCell())};var ha=this.getCursorForCell;-this.getCursorForCell=function(K){if(!this.isEnabled()||this.isCellLocked(K)){if(null!=this.getClickableLinkForCell(K))return"pointer";if(this.isCellLocked(K))return"default"}return ha.apply(this,arguments)};this.selectRegion=function(K,T){var aa=mxEvent.isAltDown(T)?K:null;K=this.getCells(K.x,K.y,K.width,K.height,null,null,aa,null,!0);if(this.isToggleEvent(T))for(aa=0;aa<K.length;aa++)this.selectCellForEvent(K[aa],T);else this.selectCellsForEvent(K,T);return K};var R=this.graphHandler.shouldRemoveCellsFromParent;+this.getCursorForCell=function(K){if(!this.isEnabled()||this.isCellLocked(K)){if(null!=this.getClickableLinkForCell(K))return"pointer";if(this.isCellLocked(K))return"default"}return ha.apply(this,arguments)};this.selectRegion=function(K,T){var aa=Graph.intersectionSelect||mxEvent.isAltDown(T)?K:null;K=this.getCells(K.x,K.y,K.width,K.height,null,null,aa,null,!0);if(this.isToggleEvent(T))for(aa=0;aa<K.length;aa++)this.selectCellForEvent(K[aa],T);else this.selectCellsForEvent(K,T);return K};var R=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(K,T,aa){return this.graph.isCellSelected(K)?!1:R.apply(this,arguments)};var Z=this.updateMouseEvent;this.updateMouseEvent=function(K){K=Z.apply(this,arguments);null!=K.state&&this.isCellLocked(this.getLayerForCell(K.getCell()))&&(null==this.getLinkForCell(K.getCell())?K.state=this.view.getState(this.getCellAt(K.getGraphX(),K.getGraphY(),null,null,null,mxUtils.bind(this,function(T,aa,ka){return K.state==T||this.isCellLocked(this.getLayerForCell(T.cell))&&null==this.getLinkForCell(T.cell)}))):K.state=null);return K};var W=this.isCellSelectable;this.isCellSelectable=function(K){return W.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(K))};this.isCellLocked=function(K){for(;null!=K;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(K),"locked","0"))return!0;K=this.model.getParent(K)}return!1};var ba=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(K,T){"mouseDown"==T.getProperty("eventName")&&(K=T.getProperty("event").getState(),ba=null==K||this.isSelectionEmpty()||this.isCellSelected(K.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(K,T){if(!mxEvent.isMultiTouchEvent(T)){K=T.getProperty("event");var aa=T.getProperty("cell");null==aa?(K=mxUtils.convertPoint(this.container,mxEvent.getClientX(K),mxEvent.getClientY(K)),G.start(K.x,K.y)):null!=ba?this.addSelectionCells(ba):1<this.getSelectionCount()&&this.isCellSelected(aa)&&this.removeSelectionCell(aa);ba=null;T.consume()}}));this.connectionHandler.selectCells=function(K,T){this.graph.setSelectionCell(T||K)};this.connectionHandler.constraintHandler.isStateIgnored=function(K,T){var aa=K.view.graph;return T&&(aa.isCellSelected(K.cell)||aa.isTableRow(K.cell)&&aa.selectionCellsHandler.isHandled(aa.model.getParent(K.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var K=this.connectionHandler.constraintHandler;null!=K.currentFocus&&K.isStateIgnored(K.currentFocus,!0)&&(K.currentFocus=null,K.constraints=null,K.destroyIcons());K.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";Graph.colorStyles=[mxConstants.STYLE_FONTCOLOR,mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_IMAGE_BORDER,mxConstants.STYLE_IMAGE_BACKGROUND,mxConstants.STYLE_LABEL_BORDERCOLOR,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];Graph.textStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity labelBorderColor labelBackgroundColor autosize resizable horizontal textDirection autosizeText".split(" ");-Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin".split(" ");Graph.cellStyleGroups=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing","targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"]];+Graph.diagramLanguage=null!=urlParams["diagram-language"]?urlParams["diagram-language"]:mxClient.language;Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;Graph.zoomWheel=!1;Graph.selectParentLayer=!1;Graph.intersectionSelect=!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";Graph.colorStyles=[mxConstants.STYLE_FONTCOLOR,mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_IMAGE_BORDER,mxConstants.STYLE_IMAGE_BACKGROUND,mxConstants.STYLE_LABEL_BORDERCOLOR,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];+Graph.textStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity labelBorderColor labelBackgroundColor autosize resizable horizontal textDirection autosizeText".split(" ");Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin".split(" ");+Graph.cellStyleGroups=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing","targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"]];Graph.cellStyles=mxUtils.addItems(mxUtils.addItems(mxUtils.addItems("rounded shadow glass dashed dashPattern comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification sketchStyle pointerEvents opacity strokeColor strokeWidth align verticalAlign spacingLeft spacingRight spacingTop spacingBottom spacing arcSize absoluteArcSize comicStyle swimlaneFillColor shadowOffsetX shadowOffsetY shadowBlur shadowColor shadowOpacity".split(" "),Graph.textStyles),Graph.edgeStyles),Graph.cellStyleGroups);Graph.layoutNames="mxHierarchicalLayout mxCircleLayout mxCompactTreeLayout mxEdgeLabelLayout mxFastOrganicLayout mxParallelEdgeLayout mxPartitionLayout mxRadialTreeLayout mxStackLayout".split(" ");Graph.backupStyleAttribute="data-mx-given-colors";Graph.newColorPlaceholder="rgba(0, 0, 0, 0)";Graph.newBackgroundPlaceholder="rgb(0, 0, 0)";Graph.defaultAdaptiveColors=window.mxIsElectron||"0"==urlParams.contrast?"simple":"auto";Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveColors?"automatic":Graph.defaultAdaptiveColors};@@ -2631,7 +2634,7 @@ Graph.createSvgNode=function(a,b,e,f,g){var d=mxUtils.createXmlDocument(),h=nulle+"px");h.setAttribute("height",f+"px");h.setAttribute("viewBox",a+" "+b+" "+e+" "+f);d.appendChild(h);return h};Graph.htmlToPng=function(a,b,e,f,g,d){g=null!=g?g:"";d=null!=d?d:Editor.htmlRasterScale;var h=document.createElement("canvas");h.width=b*d;h.height=e*d;var l=document.createElement("img");l.onload=mxUtils.bind(this,function(){try{var k=h.getContext("2d");k.scale(d,d);k.drawImage(l,0,0);f(h.toDataURL())}catch(v){f(null)}});var t=mxUtils.createXmlDocument();t=null!=t.createElementNS?t.createElementNS(mxConstants.NS_SVG,"svg"):t.createElement("svg");a=(new mxSvgCanvas2D(t)).convertHtml(a);l.onerror=function(k){f(null)};l.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+b+'" height="'+e+'">'+(""!=g?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+g+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+a+"</div></foreignObject></svg>")};-Graph.addLightDarkColors=function(a,b,e,f){function g(y,z,F){return null!=f?f(y,z,F):mxUtils.isValidColor(F)?(null==h&&null!=b&&(h={}),null!=h&&(h[z]=y.style.getPropertyValue(z)),F=mxUtils.getLightDarkColor(F,null,null,e),y.style.setProperty(z,F.cssText),!0):!1}for(var d=a.getElementsByTagName("*"),h=null,l=!1,t=0;t<d.length;t++)if(d[t]!=a&&null!=d[t].style){h=null;for(var k=0;k<d[t].style.length;k++){var v=d[t].style.item(k),u=d[t].style.getPropertyValue(v);l=g(d[t],v,u)||l}"FONT"==d[t].nodeName&&+Graph.addLightDarkColors=function(a,b,e,f){function g(y,z,E){return null!=f?f(y,z,E):mxUtils.isValidColor(E)?(null==h&&null!=b&&(h={}),null!=h&&(h[z]=y.style.getPropertyValue(z)),E=mxUtils.getLightDarkColor(E,null,null,e),y.style.setProperty(z,E.cssText),!0):!1}for(var d=a.getElementsByTagName("*"),h=null,l=!1,t=0;t<d.length;t++)if(d[t]!=a&&null!=d[t].style){h=null;for(var k=0;k<d[t].style.length;k++){var v=d[t].style.item(k),u=d[t].style.getPropertyValue(v);l=g(d[t],v,u)||l}"FONT"==d[t].nodeName&&""==d[t].style.getPropertyValue("color")&&(u=d[t].getAttribute("color"),l=g(d[t],"color",u)||l);null!=b&&null!=h&&d[t].setAttribute(b,JSON.stringify(h))}return l};Graph.removeLightDarkColors=function(a,b){a=a.getElementsByTagName("*");for(var e=!1,f=0;f<a.length;f++)try{var g=a[f].getAttribute(b);if(null!=g){a[f].removeAttribute(b);var d=JSON.parse(g),h;for(h in d){var l=d[h];""==l?(a[f].style[h]=null,""==a[f].getAttribute("style")&&a[f].removeAttribute("style")):a[f].style[h]=l;e=!0}}}catch(t){}return e};Graph.getGivenColor=function(a,b){var e=null;if(a.nodeType==mxConstants.NODETYPE_ELEMENT){try{var f=a.getAttribute(Graph.backupStyleAttribute);if(null!=f){var g=JSON.parse(f);null!=g&&null!=g[b]&&("color"==b&&"FONT"==a.nodeName&&""==g[b]&&null!=a.getAttribute("color")?e=a.getAttribute("color"):""!=g[b]&&(e=g[b]))}}catch(d){}null==e&&""!=a.style[b]&&(e=a.style[b])}return e};Graph.setTextColor=function(a,b,e){for(var f=e?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,g=e?"color":"background-color",d=a.getElementsByTagName("*"),h=[],l=0;l<d.length;l++)h.push({node:d[l],value:d[l].style[g]});document.execCommand(e?"forecolor":"backcolor",!1,f);a=a.getElementsByTagName("*");for(l=0;l<a.length;l++){if(l<h.length&&h[l].node==a[l]&&h[l].value!=a[l].style[g]&&""==a[l].style[g])try{if(d=a[l].getAttribute(Graph.backupStyleAttribute),null!=d){var t=JSON.parse(d);t[g]=@@ -2642,16 +2645,16 @@ Graph.arrayBufferToString=function(a){var b="";a=new Uint8Array(a);for(var e=a.bGraph.arrayBufferIndexOfString=function(a,b,e){var f=b.charCodeAt(0),g=1,d=-1;for(e=e||0;e<a.byteLength;e++)if(a[e]==f){d=e;break}for(e=d+1;-1<d&&e<a.byteLength&&e<d+b.length-1;e++){if(a[e]!=b.charCodeAt(g))return Graph.arrayBufferIndexOfString(a,b,d+1);g++}return g==b.length-1?d:-1};Graph.compress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=b?pako.deflate(encodeURIComponent(a)):pako.deflateRaw(encodeURIComponent(a));return btoa(Graph.arrayBufferToString(new Uint8Array(a)))};Graph.decompress=function(a,b,e){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=Graph.stringToArrayBuffer(atob(a));b=decodeURIComponent(b?pako.inflate(a,{to:"string"}):pako.inflateRaw(a,{to:"string"}));return e?b:Graph.zapGremlins(b)};Graph.fadeNodes=function(a,b,e,f,g){g=null!=g?g:1E3;Graph.setTransitionForNodes(a,null);Graph.setOpacityForNodes(a,b);window.setTimeout(function(){Graph.setTransitionForNodes(a,"all "+g+"ms ease-in-out");Graph.setOpacityForNodes(a,e);window.setTimeout(function(){Graph.setTransitionForNodes(a,null);null!=f&&f()},g)},0)};-Graph.exploreFromCell=function(a,b,e){pageSize=null!=e&&null!=e.pageSize?e.pageSize:8;minSize=null!=e&&null!=e.minSize?e.minSize:180;(function(f,g){function d(u){u.view.states.visit(function(y,z){null!=z.shape&&u.model.isEdge(u.model.getParent(z.cell))?z.shape.node.parentNode.appendChild(z.shape.node):null!=z.text&&u.model.isEdge(z.cell)&&z.text.node.parentNode.appendChild(z.text.node)})}function h(u,y){if(u.getModel().isVertex(y)){var z=u.container.offsetWidth/2,F=u.container.offsetHeight/2;u.rootCell=+Graph.exploreFromCell=function(a,b,e){pageSize=null!=e&&null!=e.pageSize?e.pageSize:8;minSize=null!=e&&null!=e.minSize?e.minSize:180;(function(f,g){function d(u){u.view.states.visit(function(y,z){null!=z.shape&&u.model.isEdge(u.model.getParent(z.cell))?z.shape.node.parentNode.appendChild(z.shape.node):null!=z.text&&u.model.isEdge(z.cell)&&z.text.node.parentNode.appendChild(z.text.node)})}function h(u,y){if(u.getModel().isVertex(y)){var z=u.container.offsetWidth/2,E=u.container.offsetHeight/2;u.rootCell=y.referenceCell||y;u.getModel().beginUpdate();try{pageSize=null!=e&&null!=e.pageSize?e.pageSize:8+Math.max(0,Math.floor(Math.min(u.container.offsetWidth-800/120,u.container.offsetHeight-600)/30));for(var D=y.referenceCell||y,G=f.model.getCell(D.sourceCellId),H=f.getEdges(G,null,!0,!0,!1,!0),M=[],N=0;N<H.length;N++)null!=H[N].getTerminal(!0)&&null!=H[N].getTerminal(!1)&&f.isCellVisible(H[N])&&!f.isEdgeIgnored(H[N])&&f.isCellVisible(H[N].getTerminal(!0))&&f.isCellVisible(H[N].getTerminal(!1))&&f.isCellVisible(f.getLayerForCell(H[N]))&&M.push(H[N]);M=H=M;if(null!=y.startIndex||0<pageSize&&H.length>pageSize){var L=y.startIndex||0;M=H.slice(Math.max(0,L),Math.min(H.length,L+pageSize))}M=f.getOpposites(M,G).concat(M);var U=u.cloneCells(M);for(N=0;N<M.length;N++)if(U[N].sourceCellId=M[N].id,u.model.isEdge(U[N]))for(U[N].geometry.x=0,U[N].geometry.y=0,U[N].geometry.points=null,U[N].setStyle(U[N].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),U[N].setTerminal(D,null==U[N].getTerminal(!0)),G=0;G<U[N].getChildCount();G++){var X=U[N].getChildAt(G);null!=X.geometry&&X.geometry.relative&&(X.setStyle(X.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),X.geometry.offset=new mxPoint(0,0),X.geometry.y=0,X.geometry.x=.5>X.geometry.x?-.8:.5<X.geometry.x?.8:0)}if(0<y.startIndex){var S=u.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((y.startIndex||0)/pageSize)+"/"+Math.ceil(H.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");S.referenceCell=D;S.startIndex=Math.max(0,(y.startIndex||0)-pageSize);U.splice(0,0,S)}if(H.length>(y.startIndex||0)+pageSize){var V=u.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((y.startIndex||0)/pageSize)+2)+"/"+Math.ceil(H.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");V.referenceCell=D;V.startIndex=(y.startIndex||0)+pageSize;U.splice(0,0,V)}for(var ha in u.getModel().cells){var R=u.getModel().getCell(ha);R!=u.rootCell&&!u.getModel().isAncestor(u.rootCell,-R)&&u.getModel().isVertex(R)&&u.removeCells([R])}u.addCells(U);var Z=u.getModel().getGeometry(u.rootCell);null!=Z&&(Z=Z.clone(),Z.x=z-Z.width/2,Z.y=F-Z.height/3,u.getModel().setGeometry(u.rootCell,Z));y=[];for(ha in u.getModel().cells)R=u.getModel().getCell(ha),R!=u.rootCell&&u.getModel().isVertex(R)&&u.getModel().getParent(R)==u.getDefaultParent()&&(y.push(R),Z=u.getModel().getGeometry(R),null!=Z&&(Z.x=z-Z.width/2,Z.y=F-Z.height/2));var W=y.length,ba=2*Math.PI/W,K=Math.max(minSize,Math.min(u.container.offsetWidth/+R)&&u.getModel().isVertex(R)&&u.removeCells([R])}u.addCells(U);var Z=u.getModel().getGeometry(u.rootCell);null!=Z&&(Z=Z.clone(),Z.x=z-Z.width/2,Z.y=E-Z.height/3,u.getModel().setGeometry(u.rootCell,Z));y=[];for(ha in u.getModel().cells)R=u.getModel().getCell(ha),R!=u.rootCell&&u.getModel().isVertex(R)&&u.getModel().getParent(R)==u.getDefaultParent()&&(y.push(R),Z=u.getModel().getGeometry(R),null!=Z&&(Z.x=z-Z.width/2,Z.y=E-Z.height/2));var W=y.length,ba=2*Math.PI/W,K=Math.max(minSize,Math.min(u.container.offsetWidth/2-40,u.container.offsetHeight/2-80));for(z=0;z<W;z++)Z=u.getModel().getGeometry(y[z]),null!=Z&&(Z=Z.clone(),Z.x+=K*Math.sin(z*ba),Z.y+=K*Math.cos(z*ba),u.getModel().setGeometry(y[z],Z))}finally{u.getModel().endUpdate()}}}var l=document.createElement("div");l.style.position="absolute";l.style.display="block";l.style.overflow="auto";l.style.width="100%";l.style.height="100%";l.style.left="0px";l.style.top="0px";l.style.zIndex=2;l.style.background=f.background==mxConstants.NONE||null==f.background?"light-dark(#ffffff,"+Editor.darkColor+")":f.background;var t=document.createElement("img");t.setAttribute("src",Editor.closeBlackImage);t.style.position="absolute";t.style.cursor="pointer";t.style.right="10px";t.style.top="10px";l.appendChild(t);var k=document.createElement("div");k.style.position="absolute";k.style.cursor="pointer";k.style.right="38px";k.style.top="14px";k.style.textAlign="right";k.style.verticalAlign="top";mxUtils.write(k,mxResources.get("close"));l.appendChild(k);document.body.appendChild(l);var v=function(u){27==u.keyCode&&t.click()};mxEvent.addListener(document,"keydown",v);(function(u){var y=new Graph(u);y.keepEdgesInBackground=!0;y.isCellResizable=function(){return!1};y.isCellRotatable=function(){return!1};y.getCursorForCell=function(M){return this.model.isVertex(M)?"pointer":null};y.getFoldingImage=function(){return null};var z=function(){mxEvent.removeListener(document,"keydown",v);u.parentNode.removeChild(u);f.scrollCellToVisible(g)};mxEvent.addListener(t,"click",z);mxEvent.addListener(k,-"click",z);y.setEnabled(!1);var F=y.click;y.click=function(M){var N=M.getCell(),L=null!=N?null!=N.referenceCell?N.referenceCell:N:null;null!=N&&0<y.getEdges(L).length?h(y,N):F.apply(this,arguments)};z=y.container.offsetWidth/2;var D=y.container.offsetHeight/3;y.model.beginUpdate();var G=y.importCells([g])[0];G.sourceCellId=g.id;G.geometry.x=z-G.geometry.width/2;G.geometry.y=D-G.geometry.height/2;y.model.endUpdate();var H=!1;y.getModel().addListener(mxEvent.CHANGE,function(M,N){H||(M=N.getProperty("edit").changes,+"click",z);y.setEnabled(!1);var E=y.click;y.click=function(M){var N=M.getCell(),L=null!=N?null!=N.referenceCell?N.referenceCell:N:null;null!=N&&0<y.getEdges(L).length?h(y,N):E.apply(this,arguments)};z=y.container.offsetWidth/2;var D=y.container.offsetHeight/3;y.model.beginUpdate();var G=y.importCells([g])[0];G.sourceCellId=g.id;G.geometry.x=z-G.geometry.width/2;G.geometry.y=D-G.geometry.height/2;y.model.endUpdate();var H=!1;y.getModel().addListener(mxEvent.CHANGE,function(M,N){H||(M=N.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,y.labelsVisible=!1,H=!0,mxEffects.animateChanges(y,M,function(){var L=new mxParallelEdgeLayout(y);L.spacing=60;var U=L.layout;L.layout=function(X){L.spacing=Math.min(60,Math.max(30,60-5*X.length));U.apply(this,arguments)};L.execute(y.getDefaultParent());mxText.prototype.enableBoundingBox=!0;y.labelsVisible=!0;y.tooltipHandler.hide();y.refresh();d(y);H=!1}))});h(y,G)})(l)})(a,b)};Graph.removeKeys=function(a,b){for(var e in a)b(e)&&delete a[e]};Graph.setTransitionForNodes=function(a,b){for(var e=0;e<a.length;e++)mxUtils.setPrefixedStyle(a[e].style,"transition",b)};Graph.setOpacityForNodes=function(a,b){for(var e=0;e<a.length;e++)a[e].style.opacity=b};Graph.removePasteFormatting=function(a,b){for(;null!=a;){null!=a.firstChild&&Graph.removePasteFormatting(a.firstChild,!0);var e=a.nextSibling;if(a.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=a.style){"#000000"==a.style.color&&(a.style.color="");if("SPAN"==a.nodeName&&"Apple-tab-span"==a.className){var f=Graph.createTabNode(4);a.parentNode.replaceChild(f,a);a=f}if("P"==a.nodeName&&"p1"==a.className){for(;null!=a.firstChild;)a.parentNode.insertBefore(a.firstChild,a);null!=e&&"P"==e.nodeName&&"p1"==@@ -2681,13 +2684,13 @@ mxUtils.getValue(h.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCelGraph.prototype.applyNewEdgeStyle=function(h,l,t){h=this.getCellStyle(h).newEdgeStyle;if(null!=h){this.model.beginUpdate();try{var k=JSON.parse(h),v;for(v in k)this.setCellStyles(v,k[v],l),"edgeStyle"==v&&"elbowEdgeStyle"==k[v]&&null!=t&&this.setCellStyles("elbow",t==mxConstants.DIRECTION_SOUTH||t==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",l)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(h){for(var l={},t=0;t<h.length;t++){var k=this.view.getState(h[t]);null!=k&&this.mergeStyle(k.style,l,0==t)}return l};Graph.prototype.mergeStyle=function(h,l,t){if(null!=h){var k={},v;for(v in h){var u=h[v];null!=u&&(k[v]=!0,null==l[v]&&t?l[v]=u:l[v]!=u&&delete l[v])}for(v in l)k[v]||delete l[v]}};Graph.prototype.getStartEditingCell=function(h,l){l=this.getCellStyle(h);l=parseInt(mxUtils.getValue(l,mxConstants.STYLE_STARTSIZE,0));this.isTable(h)&&(!this.isSwimlane(h)||0==l)&&""==this.getLabel(h)&&0<this.model.getChildCount(h)&&(h=this.model.getChildAt(h,0),l=this.getCellStyle(h),l=parseInt(mxUtils.getValue(l,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(h)&&(!this.isSwimlane(h)||0==l)&&""==this.getLabel(h)&&0<this.model.getChildCount(h))for(l=0;l<this.model.getChildCount(h);l++){var t=this.model.getChildAt(h,l);if(this.isCellEditable(t)){h=t;break}}return h};Graph.prototype.copyStyle=function(h){return this.getCellStyle(h,!1)};Graph.prototype.pasteStyle=function(h,l,t,k){null!=h&&(k||(t=null!=t?t:Graph.cellStyles,Graph.removeKeys(h,function(v){return 0>mxUtils.indexOf(t,-v)})),this.updateCellStyles(h,l))};Graph.prototype.copyCellStyles=function(h,l,t,k,v,u,y){var z=!1,F=!1;if(0<h.length)for(var D=0;D<h.length&&(z=this.getModel().isVertex(h[D])||z,!(F=this.getModel().isEdge(h[D])||F)||!z);D++);else F=z=!0;z=z&&!u;F=F&&!y;for(D=0;D<l.length;D++)if(h=0<=mxUtils.indexOf(Graph.textStyles,l[D]),"strokeColor"!=l[D]||null!=t[D]&&"none"!=t[D])if(0<=mxUtils.indexOf(Graph.cellStyles,l[D])||"shape"==l[D])if("shape"!=l[D]&&(z||h)&&(null==t[D]?delete k[l[D]]:k[l[D]]=t[D]),F||h)null==-t[D]?delete v[l[D]]:v[l[D]]=t[D]};Graph.prototype.includeDescendants=function(h){for(var l=[],t=0;t<h.length;t++)l=l.concat(this.model.getDescendants(h[t]));return l};Graph.prototype.pasteCellStyles=function(h,l,t,k,v){l=null!=l?l:this.currentVertexStyle;t=null!=t?t:this.currentEdgeStyle;v=null!=v?v:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var u=0;u<h.length;u++){var y=h[u],z=this.model.getStyle(y),F=!1;null!=y.style&&(pairs=y.style.split(";"),F=F||0<=mxUtils.indexOf(pairs,"text"));if(F)var D=-Graph.textStyles;else if(D=Graph.cellStyles.slice(),!k)for(var G=null!=z?z.split(";"):[],H=0;H<G.length;H++){var M=G[H],N=M.indexOf("=");if(0<=N){var L=M.substring(0,N),U=mxUtils.indexOf(D,L);0<=U&&D.splice(U,1);for(F=0;F<Graph.cellStyleGroups.length;F++){var X=Graph.cellStyleGroups[F];if(0<=mxUtils.indexOf(X,L))for(var S=0;S<X.length;S++){var V=mxUtils.indexOf(D,X[S]);0<=V&&D.splice(V,1)}}}}var ha=this.model.isEdge(y);F=ha?t:l;for(H=0;H<D.length;H++){L=D[H];var R=F[L];null!=R&&("edgeStyle"!=L||v)&&-(ha||!ha&&0>mxUtils.indexOf(Graph.edgeStyles,L))&&(z=mxUtils.setStyle(z,L,R),"fontFamily"==L&&null==F.fontSource&&(z=mxUtils.setStyle(z,"fontSource",null)),ha&&"rounded"==L&&"1"==R&&null==F.curved&&(z=mxUtils.setStyle(z,"curved",null)))}Editor.simpleLabels&&(z=mxUtils.setStyle(mxUtils.setStyle(z,"html",null),"whiteSpace",null));this.model.setStyle(y,z)}}finally{this.model.endUpdate()}return h};Graph.prototype.updateCellStyles=function(h,l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)if(this.model.isVertex(l[t])||+v)})),this.updateCellStyles(h,l))};Graph.prototype.copyCellStyles=function(h,l,t,k,v,u,y){var z=!1,E=!1;if(0<h.length)for(var D=0;D<h.length&&(z=this.getModel().isVertex(h[D])||z,!(E=this.getModel().isEdge(h[D])||E)||!z);D++);else E=z=!0;z=z&&!u;E=E&&!y;for(D=0;D<l.length;D++)if(h=0<=mxUtils.indexOf(Graph.textStyles,l[D]),"strokeColor"!=l[D]||null!=t[D]&&"none"!=t[D])if(0<=mxUtils.indexOf(Graph.cellStyles,l[D])||"shape"==l[D])if("shape"!=l[D]&&(z||h)&&(null==t[D]?delete k[l[D]]:k[l[D]]=t[D]),E||h)null==+t[D]?delete v[l[D]]:v[l[D]]=t[D]};Graph.prototype.includeDescendants=function(h){for(var l=[],t=0;t<h.length;t++)l=l.concat(this.model.getDescendants(h[t]));return l};Graph.prototype.pasteCellStyles=function(h,l,t,k,v){l=null!=l?l:this.currentVertexStyle;t=null!=t?t:this.currentEdgeStyle;v=null!=v?v:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var u=0;u<h.length;u++){var y=h[u],z=this.model.getStyle(y),E=!1;null!=y.style&&(pairs=y.style.split(";"),E=E||0<=mxUtils.indexOf(pairs,"text"));if(E)var D=+Graph.textStyles;else if(D=Graph.cellStyles.slice(),!k)for(var G=null!=z?z.split(";"):[],H=0;H<G.length;H++){var M=G[H],N=M.indexOf("=");if(0<=N){var L=M.substring(0,N),U=mxUtils.indexOf(D,L);0<=U&&D.splice(U,1);for(E=0;E<Graph.cellStyleGroups.length;E++){var X=Graph.cellStyleGroups[E];if(0<=mxUtils.indexOf(X,L))for(var S=0;S<X.length;S++){var V=mxUtils.indexOf(D,X[S]);0<=V&&D.splice(V,1)}}}}var ha=this.model.isEdge(y);E=ha?t:l;for(H=0;H<D.length;H++){L=D[H];var R=E[L];null!=R&&("edgeStyle"!=L||v)&&+(ha||!ha&&0>mxUtils.indexOf(Graph.edgeStyles,L))&&(z=mxUtils.setStyle(z,L,R),"fontFamily"==L&&null==E.fontSource&&(z=mxUtils.setStyle(z,"fontSource",null)),ha&&"rounded"==L&&"1"==R&&null==E.curved&&(z=mxUtils.setStyle(z,"curved",null)))}Editor.simpleLabels&&(z=mxUtils.setStyle(mxUtils.setStyle(z,"html",null),"whiteSpace",null));this.model.setStyle(y,z)}}finally{this.model.endUpdate()}return h};Graph.prototype.updateCellStyles=function(h,l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)if(this.model.isVertex(l[t])||this.model.isEdge(l[t])){var k=this.getCellStyle(l[t],!1),v=k[mxConstants.STYLE_PERIMETER],u=!1;for(z in h){var y=h[z];if(k[z]!=y){if(z==mxConstants.STYLE_SHAPE&&"umlLifeline"==k[z]&&"umlLifeline"!=y){u=!0;var z="participant"}this.setCellStyles(z,y,[l[t]])}}u&&this.setCellStyles(mxConstants.STYLE_PERIMETER,v,[l[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(h,l,t,k,v,u){this.useCssTransforms&&(h=h/this.currentScale-this.currentTranslate.x,l=l/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(h,l,t,k,v,u){k=null!=k?k:!0;v=null!=v?v:!0;null==t&&(t=this.getCurrentRoot(),-null==t&&(t=this.getModel().getRoot()));if(null!=t)for(var y=this.model.getChildCount(t)-1;0<=y;y--){var z=this.model.getChildAt(t,y),F=this.getScaledCellAt(h,l,z,k,v,u);if(null!=F)return F;if(this.isCellVisible(z)&&(v&&this.model.isEdge(z)||k&&this.model.isVertex(z))&&(F=this.view.getState(z),null!=F&&(null==u||!u(F,h,l))&&this.intersects(F,h,l)))return z}return null};Graph.prototype.isRecursiveVertexResize=function(h){return!this.isSwimlane(h.cell)&&0<this.model.getChildCount(h.cell)&&!this.isCellCollapsed(h.cell)&&+null==t&&(t=this.getModel().getRoot()));if(null!=t)for(var y=this.model.getChildCount(t)-1;0<=y;y--){var z=this.model.getChildAt(t,y),E=this.getScaledCellAt(h,l,z,k,v,u);if(null!=E)return E;if(this.isCellVisible(z)&&(v&&this.model.isEdge(z)||k&&this.model.isVertex(z))&&(E=this.view.getState(z),null!=E&&(null==u||!u(E,h,l))&&this.intersects(E,h,l)))return z}return null};Graph.prototype.isRecursiveVertexResize=function(h){return!this.isSwimlane(h.cell)&&0<this.model.getChildCount(h.cell)&&!this.isCellCollapsed(h.cell)&&"1"==mxUtils.getValue(h.style,"recursiveResize","1")&&null==mxUtils.getValue(h.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(h){for(var l=this.getCellGeometry(h);null!=l&&l.relative;)h=this.getModel().getParent(h),l=this.getCellGeometry(h);return h};Graph.prototype.isPart=function(h){return"1"==mxUtils.getValue(this.getCurrentCellStyle(h),"part","0")||this.isTableCell(h)||this.isTableRow(h)};Graph.prototype.getCompositeParents=function(h){for(var l=new mxDictionary,t=[],k=0;k<h.length;k++){var v=this.getCompositeParent(h[k]);this.isTableCell(v)&&(v=this.graph.model.getParent(v));this.isTableRow(v)&&(v=this.graph.model.getParent(v));null==v||l.get(v)||(l.put(v,!0),t.push(v))}return t};Graph.prototype.getReferenceTerminal=function(h){if(null!=h){var l=this.getCellGeometry(h);null!=l&&l.relative&&(h=this.model.getParent(h))}null!=h&&this.model.isEdge(h)&&(h=this.model.getParent(h));null!=h&&(h=this.getCompositeParent(h));return h};Graph.prototype.getCompositeParent=function(h){for(;this.isPart(h);){var l=this.model.getParent(h);if(!this.model.isVertex(l))break;h=l}return h};Graph.prototype.filterSelectionCells=function(h){var l=this.getSelectionCells();if(null!=h){for(var t=[],k=0;k<l.length;k++)h(l[k])||t.push(l[k]);l=t}return l};var a=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(h){if(this.useCssTransforms){var l=this.currentScale,t=this.currentTranslate;h=new mxRectangle((h.x+2*t.x)*l-t.x,(h.y+2*t.y)*l-t.y,h.width*l,h.height*l)}a.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=@@ -2726,8 +2729,8 @@ Graph.prototype.isLabelMovable=function(a){var b=this.getCurrentCellStyle(a);retGraph.prototype.getClickableLinkForCell=function(a){do{var b=this.getLinkForCell(a);if(null!=b)return b;a=this.model.getParent(a)}while(null!=a);return null};Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b};Graph.prototype.formatDate=function(a,b,e){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var f=this.dateFormatCache,g=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g,h=function(H,M){H=String(H);for(M=M||2;H.length<M;)H="0"+H;return H};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||-/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(f.masks[b]||b||f.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var l=e?"getUTC":"get",t=a[l+"Date"](),k=a[l+"Day"](),v=a[l+"Month"](),u=a[l+"FullYear"](),y=a[l+"Hours"](),z=a[l+"Minutes"](),F=a[l+"Seconds"]();l=a[l+"Milliseconds"]();var D=e?0:a.getTimezoneOffset(),G={d:t,dd:h(t),ddd:f.i18n.dayNames[k],dddd:f.i18n.dayNames[k+7],m:v+1,mm:h(v+1),mmm:f.i18n.monthNames[v],mmmm:f.i18n.monthNames[v+-12],yy:String(u).slice(2),yyyy:u,h:y%12||12,hh:h(y%12||12),H:y,HH:h(y),M:z,MM:h(z),s:F,ss:h(F),l:h(l,3),L:h(99<l?Math.round(l/10):l),t:12>y?"a":"p",tt:12>y?"am":"pm",T:12>y?"A":"P",TT:12>y?"AM":"PM",Z:e?"UTC":(String(a).match(g)||[""]).pop().replace(d,""),o:(0<D?"-":"+")+h(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][3<t%10?0:(10!=t%100-t%10)*t%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(H){return H in G?G[H]:H.slice(1,+/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(f.masks[b]||b||f.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var l=e?"getUTC":"get",t=a[l+"Date"](),k=a[l+"Day"](),v=a[l+"Month"](),u=a[l+"FullYear"](),y=a[l+"Hours"](),z=a[l+"Minutes"](),E=a[l+"Seconds"]();l=a[l+"Milliseconds"]();var D=e?0:a.getTimezoneOffset(),G={d:t,dd:h(t),ddd:f.i18n.dayNames[k],dddd:f.i18n.dayNames[k+7],m:v+1,mm:h(v+1),mmm:f.i18n.monthNames[v],mmmm:f.i18n.monthNames[v++12],yy:String(u).slice(2),yyyy:u,h:y%12||12,hh:h(y%12||12),H:y,HH:h(y),M:z,MM:h(z),s:E,ss:h(E),l:h(l,3),L:h(99<l?Math.round(l/10):l),t:12>y?"a":"p",tt:12>y?"am":"pm",T:12>y?"A":"P",TT:12>y?"AM":"PM",Z:e?"UTC":(String(a).match(g)||[""]).pop().replace(d,""),o:(0<D?"-":"+")+h(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][3<t%10?0:(10!=t%100-t%10)*t%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(H){return H in G?G[H]:H.slice(1,H.length-1)})};Graph.prototype.getLayerForCell=function(a){for(;null!=a&&!this.model.isLayer(a);)a=this.model.getParent(a);return a};Graph.prototype.getLayerForCells=function(a){var b=null;if(0<a.length){b=this.getLayerForCell(a[0]);for(var e=1;e<a.length;e++)if(!this.model.isAncestor(b,a[e])){b=null;break}}return b};Graph.prototype.createLayersDialog=function(a,b){var e=document.createElement("div");e.style.position="absolute";for(var f=this.getModel(),g=f.getChildCount(f.root),d=0;d<g;d++)mxUtils.bind(this,function(h){function l(){f.isVisible(h)?(v.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(k,75)):(v.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(k,25))}var t=this.convertValueToString(h)||mxResources.get("background")||"Background",k=document.createElement("div");k.style.overflow="hidden";k.style.textOverflow="ellipsis";k.style.padding="2px";k.style.whiteSpace="nowrap";k.style.cursor="pointer";k.setAttribute("title",mxResources.get(f.isVisible(h)?"hideIt":"show",[t]));var v=document.createElement("img");v.setAttribute("draggable","false");v.setAttribute("align","absmiddle");v.setAttribute("border","0");v.style.position="relative";v.style.width="16px";v.style.padding="0px 6px 0 4px";b&&(v.style.filter="invert(100%)",v.style.top="-2px");k.appendChild(v);mxUtils.write(k,t);e.appendChild(k);@@ -2747,11 +2750,11 @@ Graph.prototype.selectCellsForConnectVertex=function(a,b,e){2==a.length&&this.moGraph.prototype.insertEdgeBeforeCell=function(a,b){for(var e=b;null!=e.parent&&null!=e.geometry&&e.geometry.relative&&e.parent!=a.parent;)e=this.model.getParent(e);null!=e&&null!=e.parent&&e.parent==a.parent&&(b=e.parent.getIndex(e),this.model.add(e.parent,a,b))};Graph.prototype.connectVertex=function(a,b,e,f,g,d,h,l){d=d?d:!1;if(a.geometry.relative&&this.model.isEdge(a.parent))return[];for(;a.geometry.relative&&this.model.isVertex(a.parent);)a=a.parent;var t=this.isCloneConnectSource(a),k=t?a:this.getCompositeParent(a),v=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(k.geometry.x,k.geometry.y);b==mxConstants.DIRECTION_NORTH?(v.x+=k.geometry.width/2,v.y-=e):b==mxConstants.DIRECTION_SOUTH?(v.x+=k.geometry.width/2,v.y+=k.geometry.height+e):(v.x=b==mxConstants.DIRECTION_WEST?v.x-e:v.x+(k.geometry.width+e),v.y+=k.geometry.height/2);var u=this.view.getState(this.model.getParent(a));e=this.view.scale;var y=this.view.translate;k=y.x*e;y=y.y*e;null!=u&&this.model.isVertex(u.cell)&&(k=u.x,y=u.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(v.x+=a.parent.geometry.x,v.y+=a.parent.geometry.y);d=d?null:(new mxRectangle(k+v.x*e,y+v.y*e)).grow(40*e);d=null!=d?-this.getCells(0,0,0,0,null,null,d,null,!0):null;u=this.view.getState(a);var z=null,F=null;if(null!=d){d=d.reverse();for(var D=0;D<d.length;D++)if(!this.isCellLocked(d[D])&&!this.model.isEdge(d[D])&&d[D]!=a)if(!this.model.isAncestor(a,d[D])&&this.isContainer(d[D])&&(null==z||d[D]==this.model.getParent(a)))z=d[D];else if(null==F&&this.isCellConnectable(d[D])&&!this.model.isAncestor(d[D],a)&&!this.isSwimlane(d[D])){var G=this.view.getState(d[D]);null==u||null==G||mxUtils.intersects(u,G)||(F=d[D])}}var H=-!mxEvent.isShiftDown(f)||mxEvent.isControlDown(f)||g;H&&("1"!=urlParams.sketch||g)&&(b==mxConstants.DIRECTION_NORTH?v.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?v.y+=a.geometry.height/2:v.x=b==mxConstants.DIRECTION_WEST?v.x-a.geometry.width/2:v.x+a.geometry.width/2);var M=[],N=F;F=z;g=mxUtils.bind(this,function(L){if(null==h||null!=L||null==F&&t){this.model.beginUpdate();try{if(null==N&&H){var U=this.getAbsoluteParent(null!=L?L:a);U=t?a:this.getCompositeParent(U);N=null!=L?L:this.duplicateCells([U],-!1)[0];null!=L&&this.addCells([N],this.model.getParent(a),null,null,null,!0);var X=this.getCellGeometry(N);null!=X&&(null!=L&&"1"==urlParams.sketch&&(b==mxConstants.DIRECTION_NORTH?v.y-=X.height/2:b==mxConstants.DIRECTION_SOUTH?v.y+=X.height/2:v.x=b==mxConstants.DIRECTION_WEST?v.x-X.width/2:v.x+X.width/2),X.x=v.x-X.width/2,X.y=v.y-X.height/2);null!=z?(this.addCells([N],z,null,null,null,!0),F=null):H&&!t&&this.addCells([N],this.getDefaultParent(),null,null,null,!0)}var S=mxEvent.isControlDown(f)&&-mxEvent.isShiftDown(f)&&H||null==F&&t?null:this.insertEdge(this.model.getParent(a),null,"",a,N,this.createCurrentEdgeStyle());null!=S&&(M.push(S),this.applyNewEdgeStyle(a,[S],b),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(S,a));if(null==F&&null!=N&&null!=a.parent&&t&&b==mxConstants.DIRECTION_WEST){var V=a.parent.getIndex(a);this.model.add(a.parent,N,V)}null==F&&null!=N&&M.push(N);null==N&&null!=S&&S.geometry.setTerminalPoint(v,!1);null!=S&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[S]))}finally{this.model.endUpdate()}}if(null!=l)l(M);else return M});if(null==h||null!=N||!H||null==F&&t)return g(N);h(k+v.x*e,y+v.y*e,g)};+this.getCells(0,0,0,0,null,null,d,null,!0):null;u=this.view.getState(a);var z=null,E=null;if(null!=d){d=d.reverse();for(var D=0;D<d.length;D++)if(!this.isCellLocked(d[D])&&!this.model.isEdge(d[D])&&d[D]!=a)if(!this.model.isAncestor(a,d[D])&&this.isContainer(d[D])&&(null==z||d[D]==this.model.getParent(a)))z=d[D];else if(null==E&&this.isCellConnectable(d[D])&&!this.model.isAncestor(d[D],a)&&!this.isSwimlane(d[D])){var G=this.view.getState(d[D]);null==u||null==G||mxUtils.intersects(u,G)||(E=d[D])}}var H=+!mxEvent.isShiftDown(f)||mxEvent.isControlDown(f)||g;H&&("1"!=urlParams.sketch||g)&&(b==mxConstants.DIRECTION_NORTH?v.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?v.y+=a.geometry.height/2:v.x=b==mxConstants.DIRECTION_WEST?v.x-a.geometry.width/2:v.x+a.geometry.width/2);var M=[],N=E;E=z;g=mxUtils.bind(this,function(L){if(null==h||null!=L||null==E&&t){this.model.beginUpdate();try{if(null==N&&H){var U=this.getAbsoluteParent(null!=L?L:a);U=t?a:this.getCompositeParent(U);N=null!=L?L:this.duplicateCells([U],+!1)[0];null!=L&&this.addCells([N],this.model.getParent(a),null,null,null,!0);var X=this.getCellGeometry(N);null!=X&&(null!=L&&"1"==urlParams.sketch&&(b==mxConstants.DIRECTION_NORTH?v.y-=X.height/2:b==mxConstants.DIRECTION_SOUTH?v.y+=X.height/2:v.x=b==mxConstants.DIRECTION_WEST?v.x-X.width/2:v.x+X.width/2),X.x=v.x-X.width/2,X.y=v.y-X.height/2);null!=z?(this.addCells([N],z,null,null,null,!0),E=null):H&&!t&&this.addCells([N],this.getDefaultParent(),null,null,null,!0)}var S=mxEvent.isControlDown(f)&&+mxEvent.isShiftDown(f)&&H||null==E&&t?null:this.insertEdge(this.model.getParent(a),null,"",a,N,this.createCurrentEdgeStyle());null!=S&&(M.push(S),this.applyNewEdgeStyle(a,[S],b),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(S,a));if(null==E&&null!=N&&null!=a.parent&&t&&b==mxConstants.DIRECTION_WEST){var V=a.parent.getIndex(a);this.model.add(a.parent,N,V)}null==E&&null!=N&&M.push(N);null==N&&null!=S&&S.geometry.setTerminalPoint(v,!1);null!=S&&this.fireEvent(new mxEventObject("cellsInserted",+"cells",[S]))}finally{this.model.endUpdate()}}if(null!=l)l(M);else return M});if(null==h||null!=N||!H||null==E&&t)return g(N);h(k+v.x*e,y+v.y*e,g)};Graph.prototype.getIndexableText=function(a){a=null!=a?a:this.model.getDescendants(this.model.root);for(var b=document.createElement("div"),e=[],f,g=0;g<a.length;g++)if(f=a[g],this.model.isVertex(f)||this.model.isEdge(f))this.isHtmlLabel(f)?(b.innerHTML=Graph.sanitizeHtml(this.getLabel(f)),f=mxUtils.extractTextWithWhitespace([b])):f=this.getLabel(f),f=mxUtils.trim(f.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<f.length&&e.push(f);return e.join(" ")};Graph.prototype.convertValueToString=function(a){var b=this.model.getValue(a);if(null!=b&&"object"==typeof b){var e=null;if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){b=a.getAttribute("placeholder");for(var f=a;null==e&&null!=f;)null!=f.value&&"object"==typeof f.value&&(e=f.hasAttribute(b)?null!=f.getAttribute(b)?f.getAttribute(b):"":null),f=this.model.getParent(f)}else e=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(e=b.getAttribute("label_"+Graph.diagramLanguage)),null==e&&(e=b.getAttribute("label")||"");return e||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a,b){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),b||(a=mxUtils.removeJavascriptProtocol(a)),a):null};@@ -2828,8 +2831,10 @@ InlineToolbar.prototype.getEdgeMidpoint=function(a){a=a.absolutePoints;if(null==2,(f.y+a.y)/2):null};InlineToolbar.prototype.show=function(){this.updateIcons();this.toolbar.style.display="block";this.repaint()};InlineToolbar.prototype.hide=function(){this.toolbar.style.display="none"};InlineToolbar.prototype.supportsCurvedBend=function(a){a=mxUtils.getValue(a,mxConstants.STYLE_SHAPE,null);return null==a||"connector"==a||"filledEdge"==a||"wire"==a||"pipe"==a};InlineToolbar.prototype.updateIcons=function(){if(null!=this.currentState){var a=this.graph.getCurrentCellStyle(this.currentState.cell),b=this.editorUi.getImageForEdgeStyle(a);"arrow"==a[mxConstants.STYLE_SHAPE]&&(b=Format.straightImage.src);this.icon.style.backgroundImage="url("+b+")";b=this.graph.view.getState(this.currentState.cell);b=this.supportsCurvedBend(a)||null!=b&&this.graph.isRoundedState(b);this.bendSep.style.display=b?"inline-block":"none";this.bendIcon.style.display=b?"inline-block":"none";b&&("1"==mxUtils.getValue(a,mxConstants.STYLE_CURVED,null)?this.bendIcon.style.backgroundImage="url("+Format.curvedBendImage.src+")":"1"==mxUtils.getValue(a,mxConstants.STYLE_ROUNDED,null)?this.bendIcon.style.backgroundImage="url("+Format.roundedBendImage.src+")":this.bendIcon.style.backgroundImage="url("+Format.sharpBendImage.src+")")}};-InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var a=this.graph.view.getState(this.currentState.cell);if(null!=a){this.currentState=a;this.updateIcons();var b=this.getEdgeMidpoint(a);if(null!=b){var e="none"!=this.bendIcon.style.display?2*this.iconSize+1:this.iconSize,f=this.iconSize,g=b.x-e/2,d=b.y-f-this.offset;a=this.graph.selectionCellsHandler.getHandler(a.cell);if(null!=a){var h=(a.bends||[]).concat(a.virtualBends||[]);a=mxUtils.bind(this,-function(t,k){t=new mxRectangle(Math.round(t)-8,Math.round(k)-8,e+16,f+16);for(k=0;k<h.length;k++)if(null!=h[k]&&null!=h[k].bounds&&"hidden"!==h[k].node.style.visibility&&mxUtils.intersects(t,h[k].bounds))return!0;return!1});if(a(g,d)){var l=b.y+this.offset;if(a(g,l))for(l=this.offset+8;100>l;l+=8)if(!a(g,b.y-f-l)){d=b.y-f-l;break}else{if(!a(g,b.y+l)){d=b.y+l;break}}else d=l}}this.toolbar.style.left=Math.round(g)+"px";this.toolbar.style.top=Math.round(d)+"px"}}}};+InlineToolbar.prototype.segmentIntersectsRect=function(a,b,e,f,g,d,h,l){e-=a;f-=b;f=[-e,e,-f,f];a=[a-g,g+h-a,b-d,d+l-b];b=0;g=1;for(d=0;4>d;d++)if(0==f[d]){if(0>a[d])return!1}else if(h=a[d]/f[d],0>f[d]?b=Math.max(b,h):g=Math.min(g,h),b>g)return!1;return!0};+InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var a=this.graph.view.getState(this.currentState.cell);if(null!=a){this.currentState=a;this.updateIcons();var b=this.getEdgeMidpoint(a);if(null!=b){var e="none"!=this.bendIcon.style.display?2*this.iconSize+1:this.iconSize,f=this.iconSize,g=b.x-e/2,d=b.y-f-this.offset,h=this.graph.selectionCellsHandler.getHandler(a.cell);if(null!=h){var l=(h.bends||[]).concat(h.virtualBends||[]);h=mxUtils.bind(this,+function(y,z){y=new mxRectangle(Math.round(y)-8,Math.round(z)-8,e+16,f+16);for(z=0;z<l.length;z++)if(null!=l[z]&&null!=l[z].bounds&&"hidden"!==l[z].node.style.visibility&&mxUtils.intersects(y,l[z].bounds))return!0;var E=a.absolutePoints;if(null!=E)for(z=1;z<E.length;z++)if(null!=E[z]&&null!=E[z-1]&&this.segmentIntersectsRect(E[z-1].x,E[z-1].y,E[z].x,E[z].y,y.x,y.y,y.width,y.height))return!0;return!1});if(h(g,d)){var t=b.y+this.offset,k=!1;h(g,t)||(d=t,k=!0);if(!k){t=b.y-f/2;var v=b.x-e-this.offset,+u=b.x+this.offset;h(v,t)?h(u,t)||(g=u,d=t,k=!0):(g=v,d=t,k=!0)}if(!k)for(t=b.y-f/2,k=this.offset+8;100>k;k+=8)if(!h(g,b.y-f-k)){d=b.y-f-k;break}else if(!h(g,b.y+k)){d=b.y+k;break}else if(!h(b.x-e-k,t)){g=b.x-e-k;d=t;break}else if(!h(b.x+k,t)){g=b.x+k;d=t;break}}}this.toolbar.style.left=Math.round(g)+"px";this.toolbar.style.top=Math.round(d)+"px"}}}};InlineToolbar.prototype.showMenu=function(a){var b=this.editorUi;b.hideCurrentMenu();b.showPopupMenu(mxUtils.bind(this,function(e,f){b.menus.addMenu("line",e,f)}),mxEvent.getClientX(a),mxEvent.getClientY(a),a)};InlineToolbar.prototype.showBendMenu=function(a){var b=this.editorUi;b.hideCurrentMenu();b.showPopupMenu(mxUtils.bind(this,function(e,f){var g=b.menus,d=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED];Format.processMenuIcon(g.edgeStyleChange(e,"",d,["0","0"],null,f,!1,Format.sharpBendImage.src)).setAttribute("title",mxResources.get("sharp"));Format.processMenuIcon(g.edgeStyleChange(e,"",d,["1","0"],null,f,!1,Format.roundedBendImage.src)).setAttribute("title",mxResources.get("rounded"));if(null!=this.currentState){var h=this.graph.getCurrentCellStyle(this.currentState.cell);this.supportsCurvedBend(h)&&Format.processMenuIcon(g.edgeStyleChange(e,"",d,["0","1"],null,f,!1,Format.curvedBendImage.src)).setAttribute("title",mxResources.get("curved"))}}),mxEvent.getClientX(a),mxEvent.getClientY(a),a)};@@ -2855,27 +2860,27 @@ TableLayout.prototype.getRowLayout=function(a,b){var e=this.graph.model.getChildTableLayout.prototype.layoutRow=function(a,b,e,f){var g=this.graph.getModel(),d=g.getChildCells(a,!0);a=this.graph.getActualStartSize(a,!0);var h=a.x,l=0;null!=b&&(b=b.slice(),b.splice(0,0,a.x));for(var t=0;t<d.length;t++){var k=this.graph.getCellGeometry(d[t]);null!=k&&(k=k.clone(),k.y=a.y,k.height=e-a.y-a.height,null!=b?(k.x=b[t],k.width=b[t+1]-k.x,t==d.length-1&&t<b.length-2&&(k.width=f-k.x-a.x-a.width)):(k.x=h,h+=k.width,t==d.length-1?k.width=f-a.x-a.width-l:l+=k.width),k.alternateBounds=new mxRectangle(0,0,k.width,k.height),g.setGeometry(d[t],k))}return l};TableLayout.prototype.execute=function(a){if(null!=a){var b=this.graph.getActualStartSize(a,!0),e=this.graph.getCellGeometry(a),f=this.graph.getCellStyle(a),g="1"==mxUtils.getValue(f,"resizeLastRow","0"),d="1"==mxUtils.getValue(f,"resizeLast","0");f="1"==mxUtils.getValue(f,"fixedRows","0");var h=this.graph.getModel(),l=0;h.beginUpdate();try{for(var t=e.height-b.y-b.height,k=e.width-b.x-b.width,v=h.getChildCells(a,!0),u=0;u<v.length;u++)h.setVisible(v[u],!0);var y=this.getSize(v,!1);if(0<t&&0<k&&0<-v.length&&0<y){if(g){var z=this.graph.getCellGeometry(v[v.length-1]);null!=z&&(z=z.clone(),z.height=t-y+z.height,h.setGeometry(v[v.length-1],z))}var F=d?null:this.getRowLayout(v[0],k),D=[],G=b.y;for(u=0;u<v.length;u++)z=this.graph.getCellGeometry(v[u]),null!=z&&(z=z.clone(),z.x=b.x,z.width=k,z.y=Math.round(G),G=g||f?G+z.height:G+z.height/y*t,z.height=Math.round(G)-z.y,h.setGeometry(v[u],z)),l=Math.max(l,this.layoutRow(v[u],F,z.height,k,D));f&&t<y&&(e=e.clone(),e.height=G+b.height,h.setGeometry(a,+v.length&&0<y){if(g){var z=this.graph.getCellGeometry(v[v.length-1]);null!=z&&(z=z.clone(),z.height=t-y+z.height,h.setGeometry(v[v.length-1],z))}var E=d?null:this.getRowLayout(v[0],k),D=[],G=b.y;for(u=0;u<v.length;u++)z=this.graph.getCellGeometry(v[u]),null!=z&&(z=z.clone(),z.x=b.x,z.width=k,z.y=Math.round(G),G=g||f?G+z.height:G+z.height/y*t,z.height=Math.round(G)-z.y,h.setGeometry(v[u],z)),l=Math.max(l,this.layoutRow(v[u],E,z.height,k,D));f&&t<y&&(e=e.clone(),e.height=G+b.height,h.setGeometry(a,e));d&&k<l+Graph.minTableColumnWidth&&(e=e.clone(),e.width=l+b.width+b.x+Graph.minTableColumnWidth,h.setGeometry(a,e));this.graph.visitTableCells(a,mxUtils.bind(this,function(H){h.setVisible(H.cell,H.actual.cell==H.cell);if(H.actual.cell!=H.cell){if(H.actual.row==H.row){var M=null!=H.geo.alternateBounds?H.geo.alternateBounds:H.geo;H.actual.geo.width+=M.width}H.actual.col==H.col&&(M=null!=H.geo.alternateBounds?H.geo.alternateBounds:H.geo,H.actual.geo.height+=M.height)}}))}else for(u=0;u<v.length;u++)h.setVisible(v[u],!1)}finally{h.endUpdate()}}};(function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(u,y){y=null!=y?y:!0;var z=this.getState(u);null!=z&&y&&this.graph.model.isEdge(z.cell)&&null!=z.style&&1!=z.style[mxConstants.STYLE_CURVED]&&!z.invalid&&this.updateLineJumps(z)&&this.graph.cellRenderer.redraw(z,!1,this.isRendering());if(null!=z&&z.invalid){if(this.graph.showLinkIcons){z=-this.graph.getLinkForCell(u);var F=null!=z&&0<z.length,D=!1;if(null!=u.overlays)for(z=0;z<u.overlays.length;z++)if(u.overlays[z].isLinkOverlay){D=!0;break}if(F&&!D)z=this.graph.createLinkOverlay(u),null!=z&&(null==u.overlays&&(u.overlays=[]),u.overlays.push(z));else if(!F&&D){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isLinkOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}else if(null!=u.overlays){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isLinkOverlay&&u.overlays.splice(z,-1);0==u.overlays.length&&(u.overlays=null)}if(this.graph.showTooltipIcons){z=this.graph.convertValueToTooltip(u);F=null!=z&&0<z.length;D=!1;if(null!=u.overlays)for(z=0;z<u.overlays.length;z++)if(u.overlays[z].isTooltipOverlay){D=!0;break}if(F&&!D)z=this.graph.createTooltipOverlay(u),null!=z&&(null==u.overlays&&(u.overlays=[]),u.overlays.push(z));else if(!F&&D){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isTooltipOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}else if(null!=+this.graph.getLinkForCell(u);var E=null!=z&&0<z.length,D=!1;if(null!=u.overlays)for(z=0;z<u.overlays.length;z++)if(u.overlays[z].isLinkOverlay){D=!0;break}if(E&&!D)z=this.graph.createLinkOverlay(u),null!=z&&(null==u.overlays&&(u.overlays=[]),u.overlays.push(z));else if(!E&&D){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isLinkOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}else if(null!=u.overlays){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isLinkOverlay&&u.overlays.splice(z,+1);0==u.overlays.length&&(u.overlays=null)}if(this.graph.showTooltipIcons){z=this.graph.convertValueToTooltip(u);E=null!=z&&0<z.length;D=!1;if(null!=u.overlays)for(z=0;z<u.overlays.length;z++)if(u.overlays[z].isTooltipOverlay){D=!0;break}if(E&&!D)z=this.graph.createTooltipOverlay(u),null!=z&&(null==u.overlays&&(u.overlays=[]),u.overlays.push(z));else if(!E&&D){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isTooltipOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}else if(null!=u.overlays){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isTooltipOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}z=b.apply(this,arguments);null!=z&&y&&this.graph.model.isEdge(z.cell)&&null!=z.style&&1!=z.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(z);return z};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(u){var y=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=y)for(var z=null,F=0;F<y.length;F++)if("hidden"!=y[F].getAttribute("visibility")){if(!(null!=z&&z!=y[F].getAttribute("d")||null!=u&&0!=--u))return y[F]}else null==z&&(z=y[F].getAttribute("d"));return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,+"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(u){var y=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=y)for(var z=null,E=0;E<y.length;E++)if("hidden"!=y[E].getAttribute("visibility")){if(!(null!=z&&z!=y[E].getAttribute("d")||null!=u&&0!=--u))return y[E]}else null==z&&(z=y[E].getAttribute("d"));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 e=mxShape.prototype.paint;mxShape.prototype.paint=function(u){e.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var f=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(u){u=f.apply(this,arguments);null!=this.state&&(u.adaptiveColors=this.state.view.graph.getAdaptiveColors());return u};var g=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=-function(u,y){return g.apply(this,arguments)||null!=u.routedPoints&&null!=y.routedPoints&&!mxUtils.equalPoints(y.routedPoints,u.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(u){d.apply(this,arguments);this.graph.model.isEdge(u.cell)&&1!=u.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(u)};mxGraphView.prototype.updateLineJumps=function(u){var y=u.absolutePoints;if(Graph.lineJumpsEnabled){var z=null!=u.routedPoints,F=null;if(null!=y&&-null!=this.validEdges&&"none"!==mxUtils.getValue(u.style,"jumpStyle","none")){var D=function(ba,K,T){var aa=new mxPoint(K,T);aa.type=ba;F.push(aa);aa=null!=u.routedPoints?u.routedPoints[F.length-1]:null;return null==aa||aa.type!=ba||aa.x!=K||aa.y!=T},G=.5*this.scale;z=!1;F=[];for(var H=0;H<y.length-1;H++){for(var M=y[H+1],N=y[H],L=[],U=y[H+2];H<y.length-2&&mxUtils.ptSegDistSq(N.x,N.y,U.x,U.y,M.x,M.y)<1*this.scale*this.scale;)M=U,H++,U=y[H+2];z=D(0,N.x,N.y)||z;for(var X=0;X<this.validEdges.length;X++){var S=+function(u,y){return g.apply(this,arguments)||null!=u.routedPoints&&null!=y.routedPoints&&!mxUtils.equalPoints(y.routedPoints,u.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(u){d.apply(this,arguments);this.graph.model.isEdge(u.cell)&&1!=u.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(u)};mxGraphView.prototype.updateLineJumps=function(u){var y=u.absolutePoints;if(Graph.lineJumpsEnabled){var z=null!=u.routedPoints,E=null;if(null!=y&&+null!=this.validEdges&&"none"!==mxUtils.getValue(u.style,"jumpStyle","none")){var D=function(ba,K,T){var aa=new mxPoint(K,T);aa.type=ba;E.push(aa);aa=null!=u.routedPoints?u.routedPoints[E.length-1]:null;return null==aa||aa.type!=ba||aa.x!=K||aa.y!=T},G=.5*this.scale;z=!1;E=[];for(var H=0;H<y.length-1;H++){for(var M=y[H+1],N=y[H],L=[],U=y[H+2];H<y.length-2&&mxUtils.ptSegDistSq(N.x,N.y,U.x,U.y,M.x,M.y)<1*this.scale*this.scale;)M=U,H++,U=y[H+2];z=D(0,N.x,N.y)||z;for(var X=0;X<this.validEdges.length;X++){var S=this.validEdges[X],V=S.absolutePoints;if(null!=V&&mxUtils.intersects(u,S)&&"1"!=S.style.noJump){var ha=null;for(S=0;S<V.length-1;S++){var R=V[S+1],Z=V[S];for(U=V[S+2];S<V.length-2&&mxUtils.ptSegDistSq(Z.x,Z.y,U.x,U.y,R.x,R.y)<1*this.scale*this.scale;)R=U,S++,U=V[S+2];var W=mxUtils.intersection(N.x,N.y,M.x,M.y,Z.x,Z.y,R.x,R.y);if(null!=W&&(Math.abs(W.x-N.x)>G||Math.abs(W.y-N.y)>G)&&(Math.abs(W.x-M.x)>G||Math.abs(W.y-M.y)>G)&&(null==ha||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,ha.x,ha.y)>G||mxUtils.ptLineDist(N.x,-N.y,M.x,M.y,Z.x,Z.y)>G)&&(null==U||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,U.x,U.y)>G||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,R.x,R.y)>G)){U=W.x-N.x;ha=W.y-N.y;W={distSq:U*U+ha*ha,x:W.x,y:W.y};for(U=0;U<L.length;U++)if(L[U].distSq>W.distSq){L.splice(U,0,W);W=null;break}null==W||0!=L.length&&L[L.length-1].x===W.x&&L[L.length-1].y===W.y||L.push(W)}ha=Z}}}for(S=0;S<L.length;S++)z=D(1,L[S].x,L[S].y)||z}W=y[y.length-1];z=D(0,W.x,W.y)||z}u.routedPoints=F;return z}return!1};var h=mxConnector.prototype.paintLine;-mxConnector.prototype.paintLine=function(u,y,z){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)h.apply(this,arguments);else{var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,D=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,G=mxUtils.getValue(this.style,"jumpStyle","none"),H=!0,M=+N.y,M.x,M.y,Z.x,Z.y)>G)&&(null==U||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,U.x,U.y)>G||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,R.x,R.y)>G)){U=W.x-N.x;ha=W.y-N.y;W={distSq:U*U+ha*ha,x:W.x,y:W.y};for(U=0;U<L.length;U++)if(L[U].distSq>W.distSq){L.splice(U,0,W);W=null;break}null==W||0!=L.length&&L[L.length-1].x===W.x&&L[L.length-1].y===W.y||L.push(W)}ha=Z}}}for(S=0;S<L.length;S++)z=D(1,L[S].x,L[S].y)||z}W=y[y.length-1];z=D(0,W.x,W.y)||z}u.routedPoints=E;return z}return!1};var h=mxConnector.prototype.paintLine;+mxConnector.prototype.paintLine=function(u,y,z){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)h.apply(this,arguments);else{var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,D=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,G=mxUtils.getValue(this.style,"jumpStyle","none"),H=!0,M=null,N=null,L=[],U=null;u.begin();for(var X=0;X<this.state.routedPoints.length;X++){var S=this.state.routedPoints[X],V=new mxPoint(S.x/this.scale,S.y/this.scale);0==X?V=y[0]:X==this.state.routedPoints.length-1&&(V=y[y.length-1]);var ha=!1;if(null!=M&&1==S.type){var R=this.state.routedPoints[X+1];S=R.x/this.scale-V.x;R=R.y/this.scale-V.y;S=S*S+R*R;null==U&&(U=new mxPoint(V.x-M.x,V.y-M.y),N=Math.sqrt(U.x*U.x+U.y*U.y),0<N?(U.x=U.x*D/N,U.y=U.y*D/N):U=null);S>D*D&&0<N&&(S=M.x-V.x,R=M.y-V.y,S=S*S+R*R,S>-D*D&&(ha=new mxPoint(V.x-U.x,V.y-U.y),S=new mxPoint(V.x+U.x,V.y+U.y),L.push(ha),this.addPoints(u,L,z,F,!1,null,H),L=0>Math.round(U.x)||0==Math.round(U.x)&&0>=Math.round(U.y)?1:-1,H=!1,"sharp"==G?(u.lineTo(ha.x-U.y*L,ha.y+U.x*L),u.lineTo(S.x-U.y*L,S.y+U.x*L),u.lineTo(S.x,S.y)):"line"==G?(u.moveTo(ha.x+U.y*L,ha.y-U.x*L),u.lineTo(ha.x-U.y*L,ha.y+U.x*L),u.moveTo(S.x-U.y*L,S.y+U.x*L),u.lineTo(S.x+U.y*L,S.y-U.x*L),u.moveTo(S.x,S.y)):"arc"==G?(L*=1.3,u.curveTo(ha.x-U.y*L,ha.y+U.x*L,S.x-U.y*L,S.y+U.x*L,S.x,-S.y)):(u.moveTo(S.x,S.y),H=!0),L=[S],ha=!0))}else U=null;ha||(L.push(V),M=V)}this.addPoints(u,L,z,F,!1,null,H);u.stroke()}};var l=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(u,y,z,F){return null!=y&&"centerPerimeter"==y.style[mxConstants.STYLE_PERIMETER]?new mxPoint(y.getCenterX(),y.getCenterY()):l.apply(this,arguments)};var t=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(u,y,z,F){if(null==-y||null==u||"1"!=y.style.snapToPoint&&"1"!=u.style.snapToPoint)t.apply(this,arguments);else{y=this.getTerminalPort(u,y,F);var D=this.getNextPoint(u,z,F),G=this.graph.isOrthogonal(u),H=mxUtils.toRadians(Number(y.style[mxConstants.STYLE_ROTATION]||"0")),M=new mxPoint(y.getCenterX(),y.getCenterY());if(0!=H){var N=Math.cos(-H),L=Math.sin(-H);D=mxUtils.getRotatedPoint(D,N,L,M)}N=parseFloat(u.style[mxConstants.STYLE_PERIMETER_SPACING]||0);N+=parseFloat(u.style[F?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:-mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);D=this.getPerimeterPoint(y,D,0==H&&G,N);0!=H&&(N=Math.cos(H),L=Math.sin(H),D=mxUtils.getRotatedPoint(D,N,L,M));u.setAbsoluteTerminalPoint(this.snapToAnchorPoint(u,y,z,F,D),F)}};mxGraphView.prototype.snapToAnchorPoint=function(u,y,z,F,D){if(null!=y&&null!=u){u=this.graph.getAllConnectionConstraints(y);F=z=null;if(null!=u)for(var G=0;G<u.length;G++){var H=this.graph.getConnectionPoint(y,u[G]);if(null!=H){var M=(H.x-D.x)*(H.x-D.x)+(H.y-D.y)*(H.y-D.y);if(null==-F||M<F)z=H,F=M}}null!=z&&(D=z)}return D};var k=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(u,y,z){var F=k.apply(this,arguments);"1"==u.getAttribute("placeholders")&&null!=z.state&&(F=z.state.view.graph.replacePlaceholders(z.state.cell,F));return F};var v=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(u){if(null!=u.style&&"undefined"!==typeof pako){var y=mxUtils.getValue(u.style,mxConstants.STYLE_SHAPE,null);if(null!=-y&&"string"===typeof y&&"stencil("==y.substring(0,8))try{var z=y.substring(8,y.length-1),F=mxUtils.parseXml(Graph.decompress(z));return new mxShape(new mxStencil(F.documentElement))}catch(D){null!=window.console&&console.log("Error in shape: "+D)}}return v.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};+D*D&&(ha=new mxPoint(V.x-U.x,V.y-U.y),S=new mxPoint(V.x+U.x,V.y+U.y),L.push(ha),this.addPoints(u,L,z,E,!1,null,H),L=0>Math.round(U.x)||0==Math.round(U.x)&&0>=Math.round(U.y)?1:-1,H=!1,"sharp"==G?(u.lineTo(ha.x-U.y*L,ha.y+U.x*L),u.lineTo(S.x-U.y*L,S.y+U.x*L),u.lineTo(S.x,S.y)):"line"==G?(u.moveTo(ha.x+U.y*L,ha.y-U.x*L),u.lineTo(ha.x-U.y*L,ha.y+U.x*L),u.moveTo(S.x-U.y*L,S.y+U.x*L),u.lineTo(S.x+U.y*L,S.y-U.x*L),u.moveTo(S.x,S.y)):"arc"==G?(L*=1.3,u.curveTo(ha.x-U.y*L,ha.y+U.x*L,S.x-U.y*L,S.y+U.x*L,S.x,+S.y)):(u.moveTo(S.x,S.y),H=!0),L=[S],ha=!0))}else U=null;ha||(L.push(V),M=V)}this.addPoints(u,L,z,E,!1,null,H);u.stroke()}};var l=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(u,y,z,E){return null!=y&&"centerPerimeter"==y.style[mxConstants.STYLE_PERIMETER]?new mxPoint(y.getCenterX(),y.getCenterY()):l.apply(this,arguments)};var t=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(u,y,z,E){if(null==+y||null==u||"1"!=y.style.snapToPoint&&"1"!=u.style.snapToPoint)t.apply(this,arguments);else{y=this.getTerminalPort(u,y,E);var D=this.getNextPoint(u,z,E),G=this.graph.isOrthogonal(u),H=mxUtils.toRadians(Number(y.style[mxConstants.STYLE_ROTATION]||"0")),M=new mxPoint(y.getCenterX(),y.getCenterY());if(0!=H){var N=Math.cos(-H),L=Math.sin(-H);D=mxUtils.getRotatedPoint(D,N,L,M)}N=parseFloat(u.style[mxConstants.STYLE_PERIMETER_SPACING]||0);N+=parseFloat(u.style[E?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:+mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);D=this.getPerimeterPoint(y,D,0==H&&G,N);0!=H&&(N=Math.cos(H),L=Math.sin(H),D=mxUtils.getRotatedPoint(D,N,L,M));u.setAbsoluteTerminalPoint(this.snapToAnchorPoint(u,y,z,E,D),E)}};mxGraphView.prototype.snapToAnchorPoint=function(u,y,z,E,D){if(null!=y&&null!=u){u=this.graph.getAllConnectionConstraints(y);E=z=null;if(null!=u)for(var G=0;G<u.length;G++){var H=this.graph.getConnectionPoint(y,u[G]);if(null!=H){var M=(H.x-D.x)*(H.x-D.x)+(H.y-D.y)*(H.y-D.y);if(null==+E||M<E)z=H,E=M}}null!=z&&(D=z)}return D};var k=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(u,y,z){var E=k.apply(this,arguments);"1"==u.getAttribute("placeholders")&&null!=z.state&&(E=z.state.view.graph.replacePlaceholders(z.state.cell,E));return E};var v=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(u){if(null!=u.style&&"undefined"!==typeof pako){var y=mxUtils.getValue(u.style,mxConstants.STYLE_SHAPE,null);if(null!=+y&&"string"===typeof y&&"stencil("==y.substring(0,8))try{var z=y.substring(8,y.length-1),E=mxUtils.parseXml(Graph.decompress(z));return new mxShape(new mxStencil(E.documentElement))}catch(D){null!=window.console&&console.log("Error in shape: "+D)}}return v.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(a){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[a]};mxStencilRegistry.setFileLoaded=function(a){mxStencilRegistry.filesLoaded[a]=!0};mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var f=0;f<b.length;f++){var g=b[f];if(!mxStencilRegistry.isFileLoaded(g))if(mxStencilRegistry.setFileLoaded(g),".xml"==g.toLowerCase().substring(g.length-4,g.length))mxStencilRegistry.loadStencilSet(g,null);else if(".js"==g.toLowerCase().substring(g.length-3,g.length))try{if(mxStencilRegistry.allowEval){var d=mxUtils.load(g);null!=d&&200<=d.getStatus()&&299>=d.getStatus()&&eval.call(window,d.getText())}}catch(h){null!=window.console&&console.log("error in getStencil:",a,e,b,g,h)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);b=mxStencilRegistry.stencils[a]}}return b};@@ -2889,168 +2894,168 @@ mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#005;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#707070" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'<path d="Z" stroke="#C0C0C0" stroke-width="1" fill="none"/>').src;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(q){return!mxEvent.isAltDown(q)||mxEvent.isShiftDown(q)};var e=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(q){return e.apply(this,arguments)||this.graph.isTableRow(q)||this.graph.isTableCell(q)};var f=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(q){return f.apply(this,arguments)||this.graph.isEdgeIgnored(q)};var g=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(q){return this.graph.isCloneEvent(q)!=g.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var q=new mxEllipse(null,this.highlightColor,this.highlightColor,0);q.opacity=mxConstants.HIGHLIGHT_OPACITY;return q};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor=-"crosshair";mxConnectionHandler.prototype.createEdgeState=function(q){q=this.graph.createCurrentEdgeStyle();q=this.graph.createEdge(null,null,null,null,null,q);q=new mxCellState(this.graph.view,q,this.graph.getCellStyle(q));for(var B in this.graph.currentEdgeStyle)q.style[B]=this.graph.currentEdgeStyle[B];if(null!=this.previous){var C=this.previous.style.newEdgeStyle;if(null!=C)try{var E=JSON.parse(C);for(B in E)q.style[B]=E[B]}catch(J){}}q.style=this.graph.postProcessCellStyle(q.cell,q.style);return q};-var d=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var q=d.apply(this,arguments);q.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return q};mxConnectionHandler.prototype.updatePreview=function(q){};var h=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var q=h.apply(this,arguments),B=q.getCell;q.getCell=mxUtils.bind(this,function(C){var E=B.apply(this,arguments);this.error=null;return E});+"crosshair";mxConnectionHandler.prototype.createEdgeState=function(q){q=this.graph.createCurrentEdgeStyle();q=this.graph.createEdge(null,null,null,null,null,q);q=new mxCellState(this.graph.view,q,this.graph.getCellStyle(q));for(var B in this.graph.currentEdgeStyle)q.style[B]=this.graph.currentEdgeStyle[B];if(null!=this.previous){var C=this.previous.style.newEdgeStyle;if(null!=C)try{var F=JSON.parse(C);for(B in F)q.style[B]=F[B]}catch(J){}}q.style=this.graph.postProcessCellStyle(q.cell,q.style);return q};+var d=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var q=d.apply(this,arguments);q.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return q};mxConnectionHandler.prototype.updatePreview=function(q){};var h=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var q=h.apply(this,arguments),B=q.getCell;q.getCell=mxUtils.bind(this,function(C){var F=B.apply(this,arguments);this.error=null;return F});return q};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var q="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",B="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),C=0;C<B.length;C++)null!=this.currentEdgeStyle[B[C]]&&(q+=B[C]+"="+this.currentEdgeStyle[B[C]]+";");null!=this.currentEdgeStyle.orthogonalLoop?q+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(q+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?q+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(q+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(q+="elbow="+this.currentEdgeStyle.elbow+";");return q=null!=this.currentEdgeStyle.html?q+("html="+this.currentEdgeStyle.html+";"):q+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var q=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=-q&&(new mxCodec(q.ownerDocument)).decode(q,this.getStylesheet())};Graph.prototype.createCellLookup=function(q,B){B=null!=B?B:{};for(var C=0;C<q.length;C++){var E=q[C];B[mxObjectIdentity.get(E)]=E.getId();for(var J=this.model.getChildCount(E),P=0;P<J;P++)this.createCellLookup([this.model.getChildAt(E,P)],B)}return B};Graph.prototype.createCellMapping=function(q,B,C){C=null!=C?C:{};for(var E in q){var J=B[E];null==C[J]&&(C[J]=q[E].getId()||"")}return C};Graph.prototype.importGraphModel=function(q,B,-C,E){B=null!=B?B:0;C=null!=C?C:0;var J=new mxCodec(q.ownerDocument),P=new mxGraphModel;J.decode(q,P);q=[];J={};var Y={},ma=P.getChildren(this.cloneCell(P.root,this.isCloneInvalidEdges(),J));if(null!=ma){var ca=this.createCellLookup([P.root]);ma=ma.slice();this.model.beginUpdate();try{if(1!=ma.length||this.isCellLocked(this.getDefaultParent()))for(P=0;P<ma.length;P++)na=this.model.getChildren(this.moveCells([ma[P]],B,C,!1,this.model.getRoot())[0]),null!=na&&(q=q.concat(na));else{var na=P.getChildren(ma[0]);-null!=na&&(q=this.moveCells(na,B,C,!1,this.getDefaultParent()),Y[P.getChildAt(P.root,0).getId()]=this.getDefaultParent().getId())}if(null!=q&&(this.createCellMapping(J,ca,Y),this.updateCustomLinks(Y,q),E)){this.isGridEnabled()&&(B=this.snap(B),C=this.snap(C));var ta=this.getBoundingBoxFromGeometry(q,!0);null!=ta&&this.moveCells(q,B-ta.x,C-ta.y)}}finally{this.model.endUpdate()}}return q};Graph.prototype.encodeCells=function(q){for(var B={},C=this.cloneCells(q,null,B),E=new mxDictionary,J=0;J<q.length;J++)E.put(q[J],-!0);var P=new mxCodec,Y=new mxGraphModel,ma=Y.getChildAt(Y.getRoot(),0);for(J=0;J<C.length;J++){Y.add(ma,C[J]);var ca=this.view.getState(q[J]);if(null!=ca){var na=this.getCellGeometry(C[J]);null!=na&&na.relative&&!this.model.isEdge(q[J])&&null==E.get(this.model.getParent(q[J]))&&(na.offset=null,na.relative=!1,na.x=ca.x/ca.view.scale-ca.view.translate.x,na.y=ca.y/ca.view.scale-ca.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(B,this.createCellLookup(q)),C);return P.encode(Y)};Graph.prototype.isSwimlane=+q&&(new mxCodec(q.ownerDocument)).decode(q,this.getStylesheet())};Graph.prototype.createCellLookup=function(q,B){B=null!=B?B:{};for(var C=0;C<q.length;C++){var F=q[C];B[mxObjectIdentity.get(F)]=F.getId();for(var J=this.model.getChildCount(F),P=0;P<J;P++)this.createCellLookup([this.model.getChildAt(F,P)],B)}return B};Graph.prototype.createCellMapping=function(q,B,C){C=null!=C?C:{};for(var F in q){var J=B[F];null==C[J]&&(C[J]=q[F].getId()||"")}return C};Graph.prototype.importGraphModel=function(q,B,+C,F){B=null!=B?B:0;C=null!=C?C:0;var J=new mxCodec(q.ownerDocument),P=new mxGraphModel;J.decode(q,P);q=[];J={};var Y={},ma=P.getChildren(this.cloneCell(P.root,this.isCloneInvalidEdges(),J));if(null!=ma){var ca=this.createCellLookup([P.root]);ma=ma.slice();this.model.beginUpdate();try{if(1!=ma.length||this.isCellLocked(this.getDefaultParent()))for(P=0;P<ma.length;P++)na=this.model.getChildren(this.moveCells([ma[P]],B,C,!1,this.model.getRoot())[0]),null!=na&&(q=q.concat(na));else{var na=P.getChildren(ma[0]);+null!=na&&(q=this.moveCells(na,B,C,!1,this.getDefaultParent()),Y[P.getChildAt(P.root,0).getId()]=this.getDefaultParent().getId())}if(null!=q&&(this.createCellMapping(J,ca,Y),this.updateCustomLinks(Y,q),F)){this.isGridEnabled()&&(B=this.snap(B),C=this.snap(C));var ta=this.getBoundingBoxFromGeometry(q,!0);null!=ta&&this.moveCells(q,B-ta.x,C-ta.y)}}finally{this.model.endUpdate()}}return q};Graph.prototype.encodeCells=function(q){for(var B={},C=this.cloneCells(q,null,B),F=new mxDictionary,J=0;J<q.length;J++)F.put(q[J],+!0);var P=new mxCodec,Y=new mxGraphModel,ma=Y.getChildAt(Y.getRoot(),0);for(J=0;J<C.length;J++){Y.add(ma,C[J]);var ca=this.view.getState(q[J]);if(null!=ca){var na=this.getCellGeometry(C[J]);null!=na&&na.relative&&!this.model.isEdge(q[J])&&null==F.get(this.model.getParent(q[J]))&&(na.offset=null,na.relative=!1,na.x=ca.x/ca.view.scale-ca.view.translate.x,na.y=ca.y/ca.view.scale-ca.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(B,this.createCellLookup(q)),C);return P.encode(Y)};Graph.prototype.isSwimlane=function(q,B){var C=null;null==q||this.model.isEdge(q)||this.model.getParent(q)==this.model.getRoot()||(C=this.getCurrentCellStyle(q,B)[mxConstants.STYLE_SHAPE]);return C==mxConstants.SHAPE_SWIMLANE||"table"==C||"tableRow"==C};var l=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(q){return null!=q&&l.apply(this,arguments)?this.isTableCell(q)||this.isTableRow(q)?this.isCellEditable(this.model.getParent(q)):!0:!1};var t=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=-function(q){return null!=q&&t.apply(this,arguments)?this.isTableCell(q)||this.isTableRow(q)?this.isCellMovable(this.model.getParent(q)):!0:!1};var k=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(q){var B=this.model.getParent(q);if(null!=B){var C=this.getCurrentCellStyle(B);if(null!=C.expand)return"0"!=C.expand}return k.apply(this,arguments)&&(null==B||!this.isTable(B))};var v=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(q,B,C,E,J,P,Y,ma){null==ma&&(ma=this.model.getParent(q),-this.isTable(ma)||this.isTableRow(ma))&&(ma=this.getCellAt(P,Y,null,!0,!1));C=null;this.model.beginUpdate();try{var ca=this.getCellGeometry(q);if(null!=ca&&null!=ca.points&&0<ca.points.length&&1==B.length&&this.model.isVertex(B[0])){var na=this.getCellGeometry(B[0]);if(null!=na&&!na.relative){var ta=new mxRectangle(na.x+E,na.y+J,na.width,na.height),Fa=ca.points;na=[];for(var Da=0;Da<Fa.length;Da++)ta.intersectsPoint(Fa[Da].x,Fa[Da].y)||na.push(Fa[Da]);na.length<Fa.length&&(ca=ca.clone(),ca.points=-na,this.model.setGeometry(q,ca))}}C=v.apply(this,[q,B,C,E,J,P,Y,ma]);this.model.setValue(C,"");var Na=this.getChildCells(C,!0);for(Da=0;Da<Na.length;Da++)ca=this.getCellGeometry(Na[Da]),null!=ca&&ca.relative&&0<ca.x&&this.model.remove(Na[Da]);var Ra=this.getChildCells(q,!0);for(Da=0;Da<Ra.length;Da++)ca=this.getCellGeometry(Ra[Da]),null!=ca&&ca.relative&&0>=ca.x&&this.model.remove(Ra[Da]);var Sa=this.model.getTerminal(C,!1);if(null!=Sa){var Aa=this.getCurrentCellStyle(Sa);null!=Aa&&"1"==Aa.snapToPoint&&-(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[q]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[q]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[C]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[C]))}}finally{this.model.endUpdate()}return C};var u=Graph.prototype.selectCell;Graph.prototype.selectCell=function(q,B,C){if(B||C)u.apply(this,arguments);else{var E=this.getSelectionCell(),J=null,P=[],Y=mxUtils.bind(this,function(ma){if(null!=this.view.getState(ma)&&(this.model.isVertex(ma)||-this.model.isEdge(ma)))if(P.push(ma),ma==E)J=P.length-1;else if(q&&null==E&&0<P.length||null!=J&&q&&P.length>J||!q&&0<J)return;for(var ca=0;ca<this.model.getChildCount(ma);ca++)Y(this.model.getChildAt(ma,ca))});Y(this.model.root);0<P.length&&(J=null!=J?mxUtils.mod(J+(q?1:-1),P.length):0,this.setSelectionCell(P[J]))}};Graph.prototype.swapShapes=function(q,B){if(this.model.isVertex(q)&&this.model.isVertex(B)&&2==this.getMovableCells([q,B]).length){var C=this.getCellGeometry(q),E=this.getCellGeometry(B);-if(null!=C&&null!=E){var J=C.clone(),P=E.clone();this.model.beginUpdate();try{J.x=E.getCenterX()-C.width/2,J.y=E.getCenterY()-C.height/2,P.x=C.getCenterX()-E.width/2,P.y=C.getCenterY()-E.height/2,this.model.setGeometry(q,J),this.model.setGeometry(B,P)}finally{this.model.endUpdate()}}}};var y=Graph.prototype.moveCells;Graph.prototype.moveCells=function(q,B,C,E,J,P,Y){Y=null!=Y?Y:{};if(this.isTable(J)){for(var ma=[],ca=0;ca<q.length;ca++)this.isTable(q[ca])?ma=ma.concat(this.model.getChildCells(q[ca],-!0).reverse()):ma.push(q[ca]);q=ma}this.model.beginUpdate();try{ma=[];for(ca=0;ca<q.length;ca++)if(null!=J&&this.isTableRow(q[ca])){var na=this.model.getParent(q[ca]),ta=this.getCellGeometry(q[ca]);this.isTable(na)&&ma.push(na);if(null!=na&&null!=ta&&this.isTable(na)&&this.isTable(J)&&(E||na!=J)){if(!E){var Fa=this.getCellGeometry(na);null!=Fa&&(Fa=Fa.clone(),Fa.height-=ta.height,this.model.setGeometry(na,Fa))}Fa=this.getCellGeometry(J);null!=Fa&&(Fa=Fa.clone(),Fa.height+=ta.height,this.model.setGeometry(J,-Fa));var Da=this.model.getChildCells(J,!0);if(0<Da.length){q[ca]=E?this.cloneCell(q[ca]):q[ca];var Na=this.model.getChildCells(q[ca],!0),Ra=this.model.getChildCells(Da[0],!0),Sa=Ra.length-Na.length;if(0<Sa)for(var Aa=0;Aa<Sa;Aa++){var cb=this.cloneCell(Na[Na.length-1]);null!=cb&&(cb.value="",this.model.add(q[ca],cb))}else if(0>Sa)for(Aa=0;Aa>Sa;Aa--)this.model.remove(Na[Na.length+Aa-1]);Na=this.model.getChildCells(q[ca],!0);for(Aa=0;Aa<Ra.length;Aa++){var Wa=this.getCellGeometry(Ra[Aa]),Qa=this.getCellGeometry(Na[Aa]);-null!=Wa&&null!=Qa&&(Qa=Qa.clone(),Qa.width=Wa.width,this.model.setGeometry(Na[Aa],Qa))}}}}var Ya=y.apply(this,arguments);for(ca=0;ca<ma.length;ca++)!E&&this.model.contains(ma[ca])&&0==this.model.getChildCount(ma[ca])&&this.model.remove(ma[ca]);E&&this.updateCustomLinks(this.createCellMapping(Y,this.createCellLookup(q)),Ya)}finally{this.model.endUpdate()}return Ya};var z=Graph.prototype.removeCells;Graph.prototype.removeCells=function(q,B){var C=[];this.model.beginUpdate();try{for(var E=0;E<q.length;E++)if(this.isTableCell(q[E])){var J=-this.model.getParent(q[E]),P=this.model.getParent(J);1==this.model.getChildCount(J)&&1==this.model.getChildCount(P)?0>mxUtils.indexOf(q,P)&&0>mxUtils.indexOf(C,P)&&C.push(P):this.labelChanged(q[E],"")}else{if(this.isTableRow(q[E])&&(P=this.model.getParent(q[E]),0>mxUtils.indexOf(q,P)&&0>mxUtils.indexOf(C,P))){for(var Y=this.model.getChildCells(P,!0),ma=0,ca=0;ca<Y.length;ca++)0<=mxUtils.indexOf(q,Y[ca])&&ma++;ma==Y.length&&C.push(P)}C.push(q[E])}C=z.apply(this,[C,B])}finally{this.model.endUpdate()}return C};-Graph.prototype.updateCustomLinks=function(q,B,C){C=null!=C?C:new Graph;for(var E=0;E<B.length;E++)null!=B[E]&&C.updateCustomLinksForCell(q,B[E],C)};Graph.prototype.updateCustomLinksForCell=function(q,B){this.doUpdateCustomLinksForCell(q,B);for(var C=this.model.getChildCount(B),E=0;E<C;E++)this.updateCustomLinksForCell(q,this.model.getChildAt(B,E))};Graph.prototype.doUpdateCustomLinksForCell=function(q,B){};Graph.prototype.getAllConnectionConstraints=function(q,B){if(null!=q){B=mxUtils.getValue(q.style,-"points",null);if(null!=B){q=[];try{var C=JSON.parse(B);for(B=0;B<C.length;B++){var E=C[B];q.push(new mxConnectionConstraint(new mxPoint(E[0],E[1]),2<E.length?"0"!=E[2]:!0,null,3<E.length?E[3]:0,4<E.length?E[4]:0))}}catch(P){}return q}if(null!=q.shape&&null!=q.shape.bounds){E=q.shape.direction;B=q.shape.bounds;var J=q.shape.scale;C=B.width/J;B=B.height/J;if(E==mxConstants.DIRECTION_NORTH||E==mxConstants.DIRECTION_SOUTH)E=C,C=B,B=E;B=q.shape.getConstraints(q.style,C,B);if(null!=B)return B;if(null!=+function(q){return null!=q&&t.apply(this,arguments)?this.isTableCell(q)||this.isTableRow(q)?this.isCellMovable(this.model.getParent(q)):!0:!1};var k=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(q){var B=this.model.getParent(q);if(null!=B){var C=this.getCurrentCellStyle(B);if(null!=C.expand)return"0"!=C.expand}return k.apply(this,arguments)&&(null==B||!this.isTable(B))};var v=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(q,B,C,F,J,P,Y,ma){null==ma&&(ma=this.model.getParent(q),+this.isTable(ma)||this.isTableRow(ma))&&(ma=this.getCellAt(P,Y,null,!0,!1));C=null;this.model.beginUpdate();try{var ca=this.getCellGeometry(q);if(null!=ca&&null!=ca.points&&0<ca.points.length&&1==B.length&&this.model.isVertex(B[0])){var na=this.getCellGeometry(B[0]);if(null!=na&&!na.relative){var ta=new mxRectangle(na.x+F,na.y+J,na.width,na.height),Fa=ca.points;na=[];for(var Da=0;Da<Fa.length;Da++)ta.intersectsPoint(Fa[Da].x,Fa[Da].y)||na.push(Fa[Da]);na.length<Fa.length&&(ca=ca.clone(),ca.points=+na,this.model.setGeometry(q,ca))}}C=v.apply(this,[q,B,C,F,J,P,Y,ma]);this.model.setValue(C,"");var Na=this.getChildCells(C,!0);for(Da=0;Da<Na.length;Da++)ca=this.getCellGeometry(Na[Da]),null!=ca&&ca.relative&&0<ca.x&&this.model.remove(Na[Da]);var Ra=this.getChildCells(q,!0);for(Da=0;Da<Ra.length;Da++)ca=this.getCellGeometry(Ra[Da]),null!=ca&&ca.relative&&0>=ca.x&&this.model.remove(Ra[Da]);var Sa=this.model.getTerminal(C,!1);if(null!=Sa){var Aa=this.getCurrentCellStyle(Sa);null!=Aa&&"1"==Aa.snapToPoint&&+(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[q]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[q]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[C]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[C]))}}finally{this.model.endUpdate()}return C};var u=Graph.prototype.selectCell;Graph.prototype.selectCell=function(q,B,C){if(B||C)u.apply(this,arguments);else{var F=this.getSelectionCell(),J=null,P=[],Y=mxUtils.bind(this,function(ma){if(null!=this.view.getState(ma)&&(this.model.isVertex(ma)||+this.model.isEdge(ma)))if(P.push(ma),ma==F)J=P.length-1;else if(q&&null==F&&0<P.length||null!=J&&q&&P.length>J||!q&&0<J)return;for(var ca=0;ca<this.model.getChildCount(ma);ca++)Y(this.model.getChildAt(ma,ca))});Y(this.model.root);0<P.length&&(J=null!=J?mxUtils.mod(J+(q?1:-1),P.length):0,this.setSelectionCell(P[J]))}};Graph.prototype.swapShapes=function(q,B){if(this.model.isVertex(q)&&this.model.isVertex(B)&&2==this.getMovableCells([q,B]).length){var C=this.getCellGeometry(q),F=this.getCellGeometry(B);+if(null!=C&&null!=F){var J=C.clone(),P=F.clone();this.model.beginUpdate();try{J.x=F.getCenterX()-C.width/2,J.y=F.getCenterY()-C.height/2,P.x=C.getCenterX()-F.width/2,P.y=C.getCenterY()-F.height/2,this.model.setGeometry(q,J),this.model.setGeometry(B,P)}finally{this.model.endUpdate()}}}};var y=Graph.prototype.moveCells;Graph.prototype.moveCells=function(q,B,C,F,J,P,Y){Y=null!=Y?Y:{};if(this.isTable(J)){for(var ma=[],ca=0;ca<q.length;ca++)this.isTable(q[ca])?ma=ma.concat(this.model.getChildCells(q[ca],+!0).reverse()):ma.push(q[ca]);q=ma}this.model.beginUpdate();try{ma=[];for(ca=0;ca<q.length;ca++)if(null!=J&&this.isTableRow(q[ca])){var na=this.model.getParent(q[ca]),ta=this.getCellGeometry(q[ca]);this.isTable(na)&&ma.push(na);if(null!=na&&null!=ta&&this.isTable(na)&&this.isTable(J)&&(F||na!=J)){if(!F){var Fa=this.getCellGeometry(na);null!=Fa&&(Fa=Fa.clone(),Fa.height-=ta.height,this.model.setGeometry(na,Fa))}Fa=this.getCellGeometry(J);null!=Fa&&(Fa=Fa.clone(),Fa.height+=ta.height,this.model.setGeometry(J,+Fa));var Da=this.model.getChildCells(J,!0);if(0<Da.length){q[ca]=F?this.cloneCell(q[ca]):q[ca];var Na=this.model.getChildCells(q[ca],!0),Ra=this.model.getChildCells(Da[0],!0),Sa=Ra.length-Na.length;if(0<Sa)for(var Aa=0;Aa<Sa;Aa++){var cb=this.cloneCell(Na[Na.length-1]);null!=cb&&(cb.value="",this.model.add(q[ca],cb))}else if(0>Sa)for(Aa=0;Aa>Sa;Aa--)this.model.remove(Na[Na.length+Aa-1]);Na=this.model.getChildCells(q[ca],!0);for(Aa=0;Aa<Ra.length;Aa++){var Wa=this.getCellGeometry(Ra[Aa]),Qa=this.getCellGeometry(Na[Aa]);+null!=Wa&&null!=Qa&&(Qa=Qa.clone(),Qa.width=Wa.width,this.model.setGeometry(Na[Aa],Qa))}}}}var Ya=y.apply(this,arguments);for(ca=0;ca<ma.length;ca++)!F&&this.model.contains(ma[ca])&&0==this.model.getChildCount(ma[ca])&&this.model.remove(ma[ca]);F&&this.updateCustomLinks(this.createCellMapping(Y,this.createCellLookup(q)),Ya)}finally{this.model.endUpdate()}return Ya};var z=Graph.prototype.removeCells;Graph.prototype.removeCells=function(q,B){var C=[];this.model.beginUpdate();try{for(var F=0;F<q.length;F++)if(this.isTableCell(q[F])){var J=+this.model.getParent(q[F]),P=this.model.getParent(J);1==this.model.getChildCount(J)&&1==this.model.getChildCount(P)?0>mxUtils.indexOf(q,P)&&0>mxUtils.indexOf(C,P)&&C.push(P):this.labelChanged(q[F],"")}else{if(this.isTableRow(q[F])&&(P=this.model.getParent(q[F]),0>mxUtils.indexOf(q,P)&&0>mxUtils.indexOf(C,P))){for(var Y=this.model.getChildCells(P,!0),ma=0,ca=0;ca<Y.length;ca++)0<=mxUtils.indexOf(q,Y[ca])&&ma++;ma==Y.length&&C.push(P)}C.push(q[F])}C=z.apply(this,[C,B])}finally{this.model.endUpdate()}return C};+Graph.prototype.updateCustomLinks=function(q,B,C){C=null!=C?C:new Graph;for(var F=0;F<B.length;F++)null!=B[F]&&C.updateCustomLinksForCell(q,B[F],C)};Graph.prototype.updateCustomLinksForCell=function(q,B){this.doUpdateCustomLinksForCell(q,B);for(var C=this.model.getChildCount(B),F=0;F<C;F++)this.updateCustomLinksForCell(q,this.model.getChildAt(B,F))};Graph.prototype.doUpdateCustomLinksForCell=function(q,B){};Graph.prototype.getAllConnectionConstraints=function(q,B){if(null!=q){B=mxUtils.getValue(q.style,+"points",null);if(null!=B){q=[];try{var C=JSON.parse(B);for(B=0;B<C.length;B++){var F=C[B];q.push(new mxConnectionConstraint(new mxPoint(F[0],F[1]),2<F.length?"0"!=F[2]:!0,null,3<F.length?F[3]:0,4<F.length?F[4]:0))}}catch(P){}return q}if(null!=q.shape&&null!=q.shape.bounds){F=q.shape.direction;B=q.shape.bounds;var J=q.shape.scale;C=B.width/J;B=B.height/J;if(F==mxConstants.DIRECTION_NORTH||F==mxConstants.DIRECTION_SOUTH)F=C,C=B,B=F;B=q.shape.getConstraints(q.style,C,B);if(null!=B)return B;if(null!=q.shape.stencil&&null!=q.shape.stencil.constraints)return q.shape.stencil.constraints;if(null!=q.shape.constraints)return q.shape.constraints}}return null};Graph.prototype.flipEdge=function(q){if(null!=q){var B=this.getCurrentCellStyle(q);B=mxUtils.getValue(B,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,B,[q])}};Graph.prototype.isValidRoot=function(q){for(var B=-this.model.getChildCount(q),C=0,E=0;E<B;E++){var J=this.model.getChildAt(q,E);this.model.isVertex(J)&&(J=this.getCellGeometry(J),null==J||J.relative||C++)}return 0<C||this.isContainer(q)};Graph.prototype.isValidDropTarget=function(q,B,C){for(var E=this.getCurrentCellStyle(q),J=!0,P=!0,Y=0;Y<B.length&&P;Y++)J=J&&this.isTable(B[Y]),P=P&&this.isTableRow(B[Y]);return!this.isCellLocked(q)&&(this.isTargetShape(q,B,C)||("1"!=mxUtils.getValue(E,"part","0")||this.isContainer(q))&&"0"!=mxUtils.getValue(E,"dropTarget",+this.model.getChildCount(q),C=0,F=0;F<B;F++){var J=this.model.getChildAt(q,F);this.model.isVertex(J)&&(J=this.getCellGeometry(J),null==J||J.relative||C++)}return 0<C||this.isContainer(q)};Graph.prototype.isValidDropTarget=function(q,B,C){for(var F=this.getCurrentCellStyle(q),J=!0,P=!0,Y=0;Y<B.length&&P;Y++)J=J&&this.isTable(B[Y]),P=P&&this.isTableRow(B[Y]);return!this.isCellLocked(q)&&(this.isTargetShape(q,B,C)||("1"!=mxUtils.getValue(F,"part","0")||this.isContainer(q))&&"0"!=mxUtils.getValue(F,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(q))&&!this.isTableRow(q)&&(!this.isTable(q)||P||J))};Graph.prototype.createGroupCell=function(){var q=mxGraph.prototype.createGroupCell.apply(this,arguments);q.setStyle("group");return q};Graph.prototype.isExtendParentsOnAdd=function(q){var B=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(B&&null!=q&&null!=this.layoutManager){var C=this.model.getParent(q);null!=C&&(C=this.layoutManager.getLayout(C),-null!=C&&C.constructor==mxStackLayout&&(B=!1))}return B};Graph.prototype.getPreferredSizeForCell=function(q,B,C){C=null!=C?C:this.gridEnabled;var E=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=E&&(E.width+=10,E.height+=4,C&&(E.width=this.snap(E.width),E.height=this.snap(E.height)));return E};Graph.prototype.getAutosizeTextAvailableSpace=function(q,B,C,E){var J=0,P=0;(null!=E&&null!=this.getImage(E)||null!=q[mxConstants.STYLE_IMAGE])&&q[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&+null!=C&&C.constructor==mxStackLayout&&(B=!1))}return B};Graph.prototype.getPreferredSizeForCell=function(q,B,C){C=null!=C?C:this.gridEnabled;var F=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=F&&(F.width+=10,F.height+=4,C&&(F.width=this.snap(F.width),F.height=this.snap(F.height)));return F};Graph.prototype.getAutosizeTextAvailableSpace=function(q,B,C,F){var J=0,P=0;(null!=F&&null!=this.getImage(F)||null!=q[mxConstants.STYLE_IMAGE])&&q[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(q[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(J+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),q[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));J+=2*parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING,2));J+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_LEFT,2));J+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_RIGHT,-2));P+=2*parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING,2));P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_TOP,2));P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_BOTTOM,2));null!=E&&(E=this.getFoldingImage(E),null!=E&&(J+=E.width+8));q=mxUtils.getValue(q,mxConstants.STYLE_HORIZONTAL,!0);J=(q?B:C)-J;B=(q?C:B)-P;return 0>=J||0>=B?null:{availW:J,availH:B}};Graph.prototype.computeAutosizeTextFontSize=function(q,B,C,E,J,P){var Y=1,ma=84,ca=P?B:null,na=null;if(P){for(var ta=-q.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Fa=[],Da=0;Da<ta.length;Da++)0<ta[Da].length&&Fa.push(mxUtils.htmlEntities(ta[Da],!1));0<Fa.length&&(na=Fa.join("<br>"))}for(;Y<ma;)ta=Math.ceil((Y+ma)/2),Fa=mxUtils.getSizeForString(q,ta,E,ca,J),(Fa=P?Fa.height<=C:Fa.width<=B&&Fa.height<=C)&&P&&null!=na&&mxUtils.getSizeForString(na,ta,E,null,J).width>B&&(Fa=!1),Fa?Y=ta:ma=ta-1;return Math.max(6,Y)};Graph.prototype.updateAutosizeTextFontSize=function(q,B){var C=this.view.getState(q);-null==C&&(C=this.view.createState(q));B=B||C.style;var E=this.getCellGeometry(q);if(null!=E&&!this.model.isEdge(q)){var J=this.cellRenderer.getLabelValue(C);null!=J&&0!=J.length&&(C=this.getAutosizeTextAvailableSpace(B,E.width,E.height,C),null!=C&&(this.isHtmlLabel(q)||(J=mxUtils.htmlEntities(J,!1)),J=J.replace(/\n/g,"<br>"),B=this.computeAutosizeTextFontSize(J,C.availW,C.availH,B[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,B[mxConstants.STYLE_FONTSTYLE],"wrap"==B[mxConstants.STYLE_WHITE_SPACE]),-this.setCellStyles(mxConstants.STYLE_FONTSIZE,B,[q])))}};Graph.prototype.cellsResized=function(q,B,C){var E=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=q)for(var J=0;J<q.length;J++)this.model.isVertex(q[J])&&this.isAutosizeTextCell(q[J])&&this.updateAutosizeTextFontSize(q[J]);return E};Graph.prototype.turnShapes=function(q,B){var C=this.getModel(),E=[];C.beginUpdate();try{for(var J=0;J<q.length;J++){var P=q[J];if(C.isEdge(P)){var Y=C.getTerminal(P,!0),ma=C.getTerminal(P,!1);C.setTerminal(P,+2));P+=2*parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING,2));P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_TOP,2));P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_BOTTOM,2));null!=F&&(F=this.getFoldingImage(F),null!=F&&(J+=F.width+8));q=mxUtils.getValue(q,mxConstants.STYLE_HORIZONTAL,!0);J=(q?B:C)-J;B=(q?C:B)-P;return 0>=J||0>=B?null:{availW:J,availH:B}};Graph.prototype.computeAutosizeTextFontSize=function(q,B,C,F,J,P){var Y=1,ma=84,ca=P?B:null,na=null;if(P){for(var ta=+q.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Fa=[],Da=0;Da<ta.length;Da++)0<ta[Da].length&&Fa.push(mxUtils.htmlEntities(ta[Da],!1));0<Fa.length&&(na=Fa.join("<br>"))}for(;Y<ma;)ta=Math.ceil((Y+ma)/2),Fa=mxUtils.getSizeForString(q,ta,F,ca,J),(Fa=P?Fa.height<=C:Fa.width<=B&&Fa.height<=C)&&P&&null!=na&&mxUtils.getSizeForString(na,ta,F,null,J).width>B&&(Fa=!1),Fa?Y=ta:ma=ta-1;return Math.max(6,Y)};Graph.prototype.updateAutosizeTextFontSize=function(q,B){var C=this.view.getState(q);+null==C&&(C=this.view.createState(q));B=B||C.style;var F=this.getCellGeometry(q);if(null!=F&&!this.model.isEdge(q)){var J=this.cellRenderer.getLabelValue(C);null!=J&&0!=J.length&&(C=this.getAutosizeTextAvailableSpace(B,F.width,F.height,C),null!=C&&(this.isHtmlLabel(q)||(J=mxUtils.htmlEntities(J,!1)),J=J.replace(/\n/g,"<br>"),B=this.computeAutosizeTextFontSize(J,C.availW,C.availH,B[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,B[mxConstants.STYLE_FONTSTYLE],"wrap"==B[mxConstants.STYLE_WHITE_SPACE]),+this.setCellStyles(mxConstants.STYLE_FONTSIZE,B,[q])))}};Graph.prototype.cellsResized=function(q,B,C){var F=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=q)for(var J=0;J<q.length;J++)this.model.isVertex(q[J])&&this.isAutosizeTextCell(q[J])&&this.updateAutosizeTextFontSize(q[J]);return F};Graph.prototype.turnShapes=function(q,B){var C=this.getModel(),F=[];C.beginUpdate();try{for(var J=0;J<q.length;J++){var P=q[J];if(C.isEdge(P)){var Y=C.getTerminal(P,!0),ma=C.getTerminal(P,!1);C.setTerminal(P,ma,!0);C.setTerminal(P,Y,!1);var ca=C.getGeometry(P);if(null!=ca){ca=ca.clone();null!=ca.points&&ca.points.reverse();var na=ca.getTerminalPoint(!0),ta=ca.getTerminalPoint(!1);ca.setTerminalPoint(na,!1);ca.setTerminalPoint(ta,!0);C.setGeometry(P,ca);var Fa=this.view.getState(P),Da=this.view.getState(Y),Na=this.view.getState(ma);if(null!=Fa){var Ra=null!=Da?this.getConnectionConstraint(Fa,Da,!0):null,Sa=null!=Na?this.getConnectionConstraint(Fa,Na,!1):null;this.setConnectionConstraint(P,Y,!0,Sa);this.setConnectionConstraint(P,-ma,!1,Ra);var Aa=mxUtils.getValue(Fa.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Fa.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[P]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Aa,[P])}E.push(P)}}else if(C.isVertex(P)&&(ca=this.getCellGeometry(P),null!=ca)){if(!(this.isTable(P)||this.isTableRow(P)||this.isTableCell(P)||this.isSwimlane(P))){ca=ca.clone();ca.x+=ca.width/2-ca.height/2;ca.y+=ca.height/-2-ca.width/2;var cb=ca.width;ca.width=ca.height;ca.height=cb;C.setGeometry(P,ca)}var Wa=this.view.getState(P);if(null!=Wa){var Qa=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],Ya=mxUtils.getValue(Wa.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,Qa[mxUtils.mod(mxUtils.indexOf(Qa,Ya)+(B?-1:1),Qa.length)],[P])}E.push(P)}}}finally{C.endUpdate()}return E};Graph.prototype.stencilHasPlaceholders=-function(q){if(null!=q&&null!=q.fgNode)for(q=q.fgNode.firstChild;null!=q;){if("text"==q.nodeName&&"1"==q.getAttribute("placeholders"))return!0;q=q.nextSibling}return!1};var F=Graph.prototype.processChange;Graph.prototype.processChange=function(q){if(q instanceof mxGeometryChange&&(this.isTableCell(q.cell)||this.isTableRow(q.cell))&&(null==q.previous&&null!=q.geometry||null!=q.previous&&!q.previous.equals(q.geometry))){var B=q.cell;this.isTableCell(B)&&(B=this.model.getParent(B));this.isTableRow(B)&&-(B=this.model.getParent(B));var C=this.view.getState(B);null!=C&&null!=C.shape&&(this.view.invalidate(B),C.shape.bounds=null)}F.apply(this,arguments);q instanceof mxValueChange&&null!=q.cell&&null!=q.cell.value&&"object"==typeof q.cell.value&&this.invalidateDescendantsWithPlaceholders(q.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(q){q=this.model.getDescendants(q);if(0<q.length)for(var B=0;B<q.length;B++){var C=this.view.getState(q[B]);null!=C&&null!=C.shape&&null!=C.shape.stencil&&+ma,!1,Ra);var Aa=mxUtils.getValue(Fa.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Fa.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[P]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Aa,[P])}F.push(P)}}else if(C.isVertex(P)&&(ca=this.getCellGeometry(P),null!=ca)){if(!(this.isTable(P)||this.isTableRow(P)||this.isTableCell(P)||this.isSwimlane(P))){ca=ca.clone();ca.x+=ca.width/2-ca.height/2;ca.y+=ca.height/+2-ca.width/2;var cb=ca.width;ca.width=ca.height;ca.height=cb;C.setGeometry(P,ca)}var Wa=this.view.getState(P);if(null!=Wa){var Qa=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],Ya=mxUtils.getValue(Wa.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,Qa[mxUtils.mod(mxUtils.indexOf(Qa,Ya)+(B?-1:1),Qa.length)],[P])}F.push(P)}}}finally{C.endUpdate()}return F};Graph.prototype.stencilHasPlaceholders=+function(q){if(null!=q&&null!=q.fgNode)for(q=q.fgNode.firstChild;null!=q;){if("text"==q.nodeName&&"1"==q.getAttribute("placeholders"))return!0;q=q.nextSibling}return!1};var E=Graph.prototype.processChange;Graph.prototype.processChange=function(q){if(q instanceof mxGeometryChange&&(this.isTableCell(q.cell)||this.isTableRow(q.cell))&&(null==q.previous&&null!=q.geometry||null!=q.previous&&!q.previous.equals(q.geometry))){var B=q.cell;this.isTableCell(B)&&(B=this.model.getParent(B));this.isTableRow(B)&&+(B=this.model.getParent(B));var C=this.view.getState(B);null!=C&&null!=C.shape&&(this.view.invalidate(B),C.shape.bounds=null)}E.apply(this,arguments);q instanceof mxValueChange&&null!=q.cell&&null!=q.cell.value&&"object"==typeof q.cell.value&&this.invalidateDescendantsWithPlaceholders(q.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(q){q=this.model.getDescendants(q);if(0<q.length)for(var B=0;B<q.length;B++){var C=this.view.getState(q[B]);null!=C&&null!=C.shape&&null!=C.shape.stencil&&this.stencilHasPlaceholders(C.shape.stencil)?this.removeStateForCell(q[B]):this.isReplacePlaceholders(q[B])&&this.view.invalidate(q[B],!1,!1)}};Graph.prototype.replaceElement=function(q,B){B=q.ownerDocument.createElement(null!=B?B:"span");for(var C=Array.prototype.slice.call(q.attributes);attr=C.pop();)B.setAttribute(attr.nodeName,attr.nodeValue);B.innerHTML=q.innerHTML;q.parentNode.replaceChild(B,q)};Graph.prototype.processElements=function(q,B){if(null!=q){q=q.getElementsByTagName("*");for(var C=-0;C<q.length;C++)null!=q[C]&&B(q[C])}};Graph.prototype.updateLabelElements=function(q,B,C){q=null!=q?q:this.getSelectionCells();for(var E=document.createElement("div"),J=0;J<q.length;J++){var P=this.getCurrentCellStyle(q[J]);if(null!=P&&"1"==P.html&&(P=this.convertValueToString(q[J]),null!=P&&0<P.length)){E.innerHTML=Graph.sanitizeHtml(P);for(var Y=E.getElementsByTagName(null!=C?C:"*"),ma=0;ma<Y.length;ma++)B(Y[ma]);E.innerHTML!=P&&this.cellLabelChanged(q[J],E.innerHTML)}}};Graph.prototype.cellLabelChanged=-function(q,B,C){B=Graph.zapGremlins(B);this.model.beginUpdate();try{if(null!=q.value&&"object"==typeof q.value){if(this.isReplacePlaceholders(q)&&null!=q.getAttribute("placeholder"))for(var E=q.getAttribute("placeholder"),J=q;null!=J;){if(J==this.model.getRoot()||null!=J.value&&"object"==typeof J.value&&J.hasAttribute(E)){this.setAttributeForCell(J,E,B);break}J=this.model.getParent(J)}var P=q.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&P.hasAttribute("label_"+Graph.diagramLanguage)?-P.setAttribute("label_"+Graph.diagramLanguage,B):P.setAttribute("label",B);B=P}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(q)&&this.updateAutosizeTextFontSize(q)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(q){if(null!=q){for(var B=new mxDictionary,C=0;C<q.length;C++)B.put(q[C],!0);var E=[];for(C=0;C<q.length;C++){var J=this.model.getParent(q[C]);null==J||B.get(J)||(B.put(J,!0),E.push(J))}for(C=0;C<E.length;C++)if(J=this.view.getState(E[C]),+0;C<q.length;C++)null!=q[C]&&B(q[C])}};Graph.prototype.updateLabelElements=function(q,B,C){q=null!=q?q:this.getSelectionCells();for(var F=document.createElement("div"),J=0;J<q.length;J++){var P=this.getCurrentCellStyle(q[J]);if(null!=P&&"1"==P.html&&(P=this.convertValueToString(q[J]),null!=P&&0<P.length)){F.innerHTML=Graph.sanitizeHtml(P);for(var Y=F.getElementsByTagName(null!=C?C:"*"),ma=0;ma<Y.length;ma++)B(Y[ma]);F.innerHTML!=P&&this.cellLabelChanged(q[J],F.innerHTML)}}};Graph.prototype.cellLabelChanged=+function(q,B,C){B=Graph.zapGremlins(B);this.model.beginUpdate();try{if(null!=q.value&&"object"==typeof q.value){if(this.isReplacePlaceholders(q)&&null!=q.getAttribute("placeholder"))for(var F=q.getAttribute("placeholder"),J=q;null!=J;){if(J==this.model.getRoot()||null!=J.value&&"object"==typeof J.value&&J.hasAttribute(F)){this.setAttributeForCell(J,F,B);break}J=this.model.getParent(J)}var P=q.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&P.hasAttribute("label_"+Graph.diagramLanguage)?+P.setAttribute("label_"+Graph.diagramLanguage,B):P.setAttribute("label",B);B=P}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(q)&&this.updateAutosizeTextFontSize(q)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(q){if(null!=q){for(var B=new mxDictionary,C=0;C<q.length;C++)B.put(q[C],!0);var F=[];for(C=0;C<q.length;C++){var J=this.model.getParent(q[C]);null==J||B.get(J)||(B.put(J,!0),F.push(J))}for(C=0;C<F.length;C++)if(J=this.view.getState(F[C]),null!=J&&(this.model.isEdge(J.cell)||this.model.isVertex(J.cell))&&this.isCellDeletable(J.cell)&&this.isTransparentState(J)){for(var P=!0,Y=0;Y<this.model.getChildCount(J.cell)&&P;Y++)B.get(this.model.getChildAt(J.cell,Y))||(P=!1);P&&q.push(J.cell)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(q){for(var B=[],C=0;C<q.length;C++)this.isCellDeletable(q[C])&&this.isTransparentState(this.view.getState(q[C]))&&B.push(q[C]);q=B;mxGraph.prototype.removeCellsAfterUngroup.apply(this,-arguments)};Graph.prototype.setLinkForCell=function(q,B){this.setAttributeForCell(q,"link",B)};Graph.prototype.createLinkOverlay=function(q){q=this.getLinkForCell(q);if(null!=q&&0<q.length){q=this.getLinkOverlayTooltip(q);q=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),q,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));q.isLinkOverlay=!0;var B=this;q.addListener(mxEvent.CLICK,function(C,E){B.setSelectionCell(E.getProperty("cell"))});return q}return null};Graph.prototype.getLinkOverlayTooltip=-function(q){return q};Graph.prototype.createTooltipOverlay=function(q){q=this.convertValueToTooltip(q);if(null!=q&&0<q.length){q=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),q,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));q.isTooltipOverlay=!0;var B=this;q.addListener(mxEvent.CLICK,function(C,E){C=E.getProperty("cell");B.isEnabled()&&B.isCellEditable(C)?(B.setSelectionCell(C),B.editTooltip(C)):(E=E.getProperty("event"),C=B.getTooltipForCell(C),null!=C&&0<C.length&&-B.tooltipHandler.show(C,E.clientX,E.clientY))});return q}return null};Graph.prototype.editTooltip=function(q){};Graph.prototype.setTooltipForCell=function(q,B){var C="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(q.value)&&q.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(C="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(q,C,B)};Graph.prototype.getAttributeForCell=function(q,B,C){q=null!=q.value&&"object"===typeof q.value?q.value.getAttribute(B):null;-return null!=q?q:C};Graph.prototype.setAttributeForCell=function(q,B,C){if(null!=q.value&&"object"==typeof q.value)var E=q.value.cloneNode(!0);else E=mxUtils.createXmlDocument().createElement("UserObject"),E.setAttribute("label",q.value||"");null!=C?E.setAttribute(B,C):E.removeAttribute(B);this.model.setValue(q,E)};Graph.prototype.isTargetShape=function(q,B,C){q=mxUtils.getValue(this.getCurrentCellStyle(q),mxConstants.STYLE_SHAPE,"");for(C=0;C<B.length;C++){var E=mxUtils.getValue(this.getCurrentCellStyle(B[C]),-"targetShapes","").split(",");if(0<=mxUtils.indexOf(E,q))return!0}return!1};var D=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(q,B,C,E){if(mxEvent.isAltDown(B))return null;for(var J=0;J<q.length;J++){var P=this.model.getParent(q[J]);if(this.model.isEdge(P)&&0>mxUtils.indexOf(q,P))return null}P=D.apply(this,arguments);var Y=!0;for(J=0;J<q.length&&Y;J++)Y=Y&&this.isTableRow(q[J]);Y&&(this.isTableCell(P)&&(P=this.model.getParent(P)),this.isTableRow(P)&&(P=this.model.getParent(P)),-this.isTable(P)||(P=null));return P};Graph.prototype.click=function(q){mxGraph.prototype.click.call(this,q);this.firstClickState=q.getState();this.firstClickSource=q.getSource()};Graph.prototype.dblClick=function(q,B){this.isEnabled()&&(B=this.insertTextForEvent(q,B),mxGraph.prototype.dblClick.call(this,q,B))};Graph.prototype.insertTextForEvent=function(q,B){var C=mxUtils.convertPoint(this.container,mxEvent.getClientX(q),mxEvent.getClientY(q));if(null!=q&&!this.model.isVertex(B)){var E=this.model.isEdge(B)?-this.view.getState(B):null,J=mxEvent.getSource(q);this.firstClickState!=E||this.firstClickSource!=J||null!=E&&null!=E.text&&null!=E.text.node&&null!=E.text.boundingBox&&(mxUtils.contains(E.text.boundingBox,C.x,C.y)||mxUtils.isAncestorNode(E.text.node,mxEvent.getSource(q)))||(null!=E||this.isCellLocked(this.getDefaultParent()))&&(null==E||this.isCellLocked(E.cell))||!(null!=E||mxClient.IS_SVG&&J==this.view.getCanvas().ownerSVGElement)||(null==E&&(E=this.view.getState(this.getCellAt(C.x,C.y))),B=this.addText(C.x,-C.y,E))}return B};Graph.prototype.getInsertPoint=function(q){q=this.getGridSize();var B=this.container.scrollLeft/this.view.scale-this.view.translate.x,C=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var E=this.getPageLayout(),J=this.getPageSize();B=Math.max(B,E.x*J.width);C=Math.max(C,E.y*J.height)}return new mxPoint(this.snap(B+q),this.snap(C+q))};Graph.prototype.getFreeInsertPoint=function(q){var B=this.view,C=this.getGraphBounds(),E=this.getInsertPoint(q);-q=this.snap(Math.round(Math.max(E.x,C.x/B.scale-B.translate.x+(0==C.width?2*this.gridSize:0))));B=this.snap(Math.round(Math.max(E.y,(C.y+C.height)/B.scale-B.translate.y+2*this.gridSize)));return new mxPoint(q,B)};Graph.prototype.getCenterInsertPoint=function(q){q=null!=q?q:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-q.width/2)),this.snap(Math.round((this.container.scrollTop++arguments)};Graph.prototype.setLinkForCell=function(q,B){this.setAttributeForCell(q,"link",B)};Graph.prototype.createLinkOverlay=function(q){q=this.getLinkForCell(q);if(null!=q&&0<q.length){q=this.getLinkOverlayTooltip(q);q=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),q,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));q.isLinkOverlay=!0;var B=this;q.addListener(mxEvent.CLICK,function(C,F){B.setSelectionCell(F.getProperty("cell"))});return q}return null};Graph.prototype.getLinkOverlayTooltip=+function(q){return q};Graph.prototype.createTooltipOverlay=function(q){q=this.convertValueToTooltip(q);if(null!=q&&0<q.length){q=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),q,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));q.isTooltipOverlay=!0;var B=this;q.addListener(mxEvent.CLICK,function(C,F){C=F.getProperty("cell");B.isEnabled()&&B.isCellEditable(C)?(B.setSelectionCell(C),B.editTooltip(C)):(F=F.getProperty("event"),C=B.getTooltipForCell(C),null!=C&&0<C.length&&+B.tooltipHandler.show(C,F.clientX,F.clientY))});return q}return null};Graph.prototype.editTooltip=function(q){};Graph.prototype.setTooltipForCell=function(q,B){var C="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(q.value)&&q.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(C="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(q,C,B)};Graph.prototype.getAttributeForCell=function(q,B,C){q=null!=q.value&&"object"===typeof q.value?q.value.getAttribute(B):null;+return null!=q?q:C};Graph.prototype.setAttributeForCell=function(q,B,C){if(null!=q.value&&"object"==typeof q.value)var F=q.value.cloneNode(!0);else F=mxUtils.createXmlDocument().createElement("UserObject"),F.setAttribute("label",q.value||"");null!=C?F.setAttribute(B,C):F.removeAttribute(B);this.model.setValue(q,F)};Graph.prototype.isTargetShape=function(q,B,C){q=mxUtils.getValue(this.getCurrentCellStyle(q),mxConstants.STYLE_SHAPE,"");for(C=0;C<B.length;C++){var F=mxUtils.getValue(this.getCurrentCellStyle(B[C]),+"targetShapes","").split(",");if(0<=mxUtils.indexOf(F,q))return!0}return!1};var D=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(q,B,C,F){if(mxEvent.isAltDown(B))return null;for(var J=0;J<q.length;J++){var P=this.model.getParent(q[J]);if(this.model.isEdge(P)&&0>mxUtils.indexOf(q,P))return null}P=D.apply(this,arguments);var Y=!0;for(J=0;J<q.length&&Y;J++)Y=Y&&this.isTableRow(q[J]);Y&&(this.isTableCell(P)&&(P=this.model.getParent(P)),this.isTableRow(P)&&(P=this.model.getParent(P)),+this.isTable(P)||(P=null));return P};Graph.prototype.click=function(q){mxGraph.prototype.click.call(this,q);this.firstClickState=q.getState();this.firstClickSource=q.getSource()};Graph.prototype.dblClick=function(q,B){this.isEnabled()&&(B=this.insertTextForEvent(q,B),mxGraph.prototype.dblClick.call(this,q,B))};Graph.prototype.insertTextForEvent=function(q,B){var C=mxUtils.convertPoint(this.container,mxEvent.getClientX(q),mxEvent.getClientY(q));if(null!=q&&!this.model.isVertex(B)){var F=this.model.isEdge(B)?+this.view.getState(B):null,J=mxEvent.getSource(q);this.firstClickState!=F||this.firstClickSource!=J||null!=F&&null!=F.text&&null!=F.text.node&&null!=F.text.boundingBox&&(mxUtils.contains(F.text.boundingBox,C.x,C.y)||mxUtils.isAncestorNode(F.text.node,mxEvent.getSource(q)))||(null!=F||this.isCellLocked(this.getDefaultParent()))&&(null==F||this.isCellLocked(F.cell))||!(null!=F||mxClient.IS_SVG&&J==this.view.getCanvas().ownerSVGElement)||(null==F&&(F=this.view.getState(this.getCellAt(C.x,C.y))),B=this.addText(C.x,+C.y,F))}return B};Graph.prototype.getInsertPoint=function(q){q=this.getGridSize();var B=this.container.scrollLeft/this.view.scale-this.view.translate.x,C=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var F=this.getPageLayout(),J=this.getPageSize();B=Math.max(B,F.x*J.width);C=Math.max(C,F.y*J.height)}return new mxPoint(this.snap(B+q),this.snap(C+q))};Graph.prototype.getFreeInsertPoint=function(q){var B=this.view,C=this.getGraphBounds(),F=this.getInsertPoint(q);+q=this.snap(Math.round(Math.max(F.x,C.x/B.scale-B.translate.x+(0==C.width?2*this.gridSize:0))));B=this.snap(Math.round(Math.max(F.y,(C.y+C.height)/B.scale-B.translate.y+2*this.gridSize)));return new mxPoint(q,B)};Graph.prototype.getCenterInsertPoint=function(q){q=null!=q?q:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-q.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale-this.view.translate.y-q.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/2/this.view.scale-this.view.translate.x-q.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-q.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(q,B){q=null!=q?q:"";null!=B&&(0<q.length&&";"!=q.charAt(q.length-1)&&(q+=";"),q+="fontSize="+B+";");return q};-Graph.prototype.addText=function(q,B,C){var E=new mxCell;E.value="Text";E.geometry=new mxGeometry(0,0,0,0);E.vertex=!0;if(null!=C&&this.model.isEdge(C.cell)){E.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);E.geometry.relative=!0;E.connectable=!1;var J=this.view.getRelativePoint(C,q,B);E.geometry.x=Math.round(1E4*J.x)/1E4;E.geometry.y=Math.round(J.y);E.geometry.offset=new mxPoint(0,0);J=this.view.getPoint(C,E.geometry);var P=-this.view.scale;E.geometry.offset=new mxPoint(Math.round((q-J.x)/P),Math.round((B-J.y)/P))}else J=this.view.translate,E.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),E.geometry.width=40,E.geometry.height=20,E.geometry.x=Math.round(q/this.view.scale)-J.x-(null!=C?C.origin.x:0),E.geometry.y=Math.round(B/this.view.scale)-J.y-(null!=C?C.origin.y:0),E.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([E],null!=-C?C.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[E])),this.autoSizeCell(E)}finally{this.getModel().endUpdate()}return E};Graph.prototype.addClickHandler=function(q,B,C){var E=mxUtils.bind(this,function(){var ca=this.container.getElementsByTagName("a");if(null!=ca)for(var na=0;na<ca.length;na++){var ta=this.getAbsoluteUrl(ca[na].getAttribute("href"));null!=ta&&(ca[na].setAttribute("rel",this.linkRelation),ca[na].setAttribute("href",ta),null!=B&&mxEvent.addGestureListeners(ca[na],-null,null,B))}});this.model.addListener(mxEvent.CHANGE,E);E();var J=this.container.style.cursor,P=this.getTolerance(),Y=this,ma={currentState:null,currentLink:null,currentTarget:null,highlight:null!=q&&""!=q&&q!=mxConstants.NONE?new mxCellHighlight(Y,q,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ca){var na=ca.sourceState;if(null==na||null==Y.getLinkForCell(na.cell))ca=Y.getCellAt(ca.getGraphX(),ca.getGraphY(),null,null,null,function(ta,Fa,Da){return null==Y.getLinkForCell(ta.cell)}),+Graph.prototype.addText=function(q,B,C){var F=new mxCell;F.value="Text";F.geometry=new mxGeometry(0,0,0,0);F.vertex=!0;if(null!=C&&this.model.isEdge(C.cell)){F.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);F.geometry.relative=!0;F.connectable=!1;var J=this.view.getRelativePoint(C,q,B);F.geometry.x=Math.round(1E4*J.x)/1E4;F.geometry.y=Math.round(J.y);F.geometry.offset=new mxPoint(0,0);J=this.view.getPoint(C,F.geometry);var P=+this.view.scale;F.geometry.offset=new mxPoint(Math.round((q-J.x)/P),Math.round((B-J.y)/P))}else J=this.view.translate,F.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),F.geometry.width=40,F.geometry.height=20,F.geometry.x=Math.round(q/this.view.scale)-J.x-(null!=C?C.origin.x:0),F.geometry.y=Math.round(B/this.view.scale)-J.y-(null!=C?C.origin.y:0),F.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([F],null!=+C?C.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[F])),this.autoSizeCell(F)}finally{this.getModel().endUpdate()}return F};Graph.prototype.addClickHandler=function(q,B,C){var F=mxUtils.bind(this,function(){var ca=this.container.getElementsByTagName("a");if(null!=ca)for(var na=0;na<ca.length;na++){var ta=this.getAbsoluteUrl(ca[na].getAttribute("href"));null!=ta&&(ca[na].setAttribute("rel",this.linkRelation),ca[na].setAttribute("href",ta),null!=B&&mxEvent.addGestureListeners(ca[na],+null,null,B))}});this.model.addListener(mxEvent.CHANGE,F);F();var J=this.container.style.cursor,P=this.getTolerance(),Y=this,ma={currentState:null,currentLink:null,currentTarget:null,highlight:null!=q&&""!=q&&q!=mxConstants.NONE?new mxCellHighlight(Y,q,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ca){var na=ca.sourceState;if(null==na||null==Y.getLinkForCell(na.cell))ca=Y.getCellAt(ca.getGraphX(),ca.getGraphY(),null,null,null,function(ta,Fa,Da){return null==Y.getLinkForCell(ta.cell)}),na=null==na||Y.model.isAncestor(ca,na.cell)?Y.view.getState(ca):null;na!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=na,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(ca,na){this.startX=na.getGraphX();this.startY=na.getGraphY();this.scrollLeft=Y.container.scrollLeft;this.scrollTop=Y.container.scrollTop;null==this.currentLink&&"auto"==Y.container.style.overflow&&(Y.container.style.cursor="move");this.updateCurrentState(na)},mouseMove:function(ca,na){if(Y.isMouseDown)null!=this.currentLink&&(ca=Math.abs(this.startX-na.getGraphX()),na=Math.abs(this.startY-na.getGraphY()),(ca>P||na>P)&&this.clear());else{for(ca=na.getSource();null!=ca&&"a"!=ca.nodeName.toLowerCase();)ca=ca.parentNode;null!=ca?this.clear():(null!=Y.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&Y.tooltipHandler.reset(na,!0,this.currentState),(null==this.currentState||na.getState()!=this.currentState&&null!=na.sourceState||!Y.intersects(this.currentState,na.getGraphX(),na.getGraphY()))&&this.updateCurrentState(na))}},mouseUp:function(ca,na){var ta=na.getSource();for(ca=na.getEvent();null!=ta&&"a"!=ta.nodeName.toLowerCase();)ta=ta.parentNode;null==ta&&Math.abs(this.scrollLeft-Y.container.scrollLeft)<P&&Math.abs(this.scrollTop-Y.container.scrollTop)<P&&(null==na.sourceState||!na.isSource(na.sourceState.control))&&((mxEvent.isLeftMouseButton(ca)||mxEvent.isMiddleMouseButton(ca))&&!mxEvent.isPopupTrigger(ca)||mxEvent.isTouchEvent(ca))&&(null!=this.currentLink?(ta=Y.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&ta||null==B||B(ca,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(ca)||(ca=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(ca)?"_blank":ta?Y.linkTarget:"_top",Y.openLink(this.currentLink,ca),na.consume())):null!=C&&!na.isConsumed()&&Math.abs(this.scrollLeft-Y.container.scrollLeft)<P&&Math.abs(this.scrollTop-Y.container.scrollTop)<P&&Math.abs(this.startX-na.getGraphX())<P&&Math.abs(this.startY-na.getGraphY())<P&&C(na.getEvent()));this.clear()},activate:function(ca){this.currentLink=Y.getAbsoluteUrl(Y.getLinkForCell(ca.cell));null!=this.currentLink&&(this.currentTarget=Y.getLinkTargetForCell(ca.cell),Y.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(ca))},clear:function(){null!=Y.container&&(Y.container.style.cursor=J);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=Y.tooltipHandler&&Y.tooltipHandler.hide()}};-Y.click=function(ca){};Y.addMouseListener(ma);mxEvent.addListener(document,"mouseleave",function(ca){ma.clear()})};Graph.prototype.duplicateCells=function(q,B){q=null!=q?q:this.getSelectionCells();B=null!=B?B:!0;for(var C=0;C<q.length;C++)this.isTableCell(q[C])&&(q[C]=this.model.getParent(q[C]));q=this.model.getTopmostCells(q);var E=this.getModel(),J=this.gridSize,P=[];E.beginUpdate();try{var Y={},ma=this.createCellLookup(q),ca=this.cloneCells(q,!1,Y,!0);for(C=0;C<q.length;C++){var na=E.getParent(q[C]);-if(null!=na){var ta=this.moveCells([ca[C]],J,J,!1)[0];P.push(ta);if(B)E.add(na,ca[C]);else{var Fa=na.getIndex(q[C]);E.add(na,ca[C],Fa+1)}if(this.isTable(na)){var Da=this.getCellGeometry(ca[C]),Na=this.getCellGeometry(na);null!=Da&&null!=Na&&(Na=Na.clone(),Na.height+=Da.height,E.setGeometry(na,Na))}}else P.push(ca[C])}this.updateCustomLinks(this.createCellMapping(Y,ma),ca,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ca))}finally{E.endUpdate()}return P};Graph.prototype.insertImage=-function(q,B,C){if(null!=q&&null!=this.cellEditor.textarea){for(var E=this.cellEditor.textarea.getElementsByTagName("img"),J=[],P=0;P<E.length;P++)J.push(E[P]);document.execCommand("insertimage",!1,q);q=this.cellEditor.textarea.getElementsByTagName("img");if(q.length==J.length+1)for(P=q.length-1;0<=P;P--)if(0==P||q[P]!=J[P-1]){q[P].setAttribute("width",B);q[P].setAttribute("height",C);break}}};Graph.prototype.insertLink=function(q){if(null!=this.cellEditor.textarea)if(0==q.length)document.execCommand("unlink",-!1);else if(mxClient.IS_FF){for(var B=this.cellEditor.textarea.getElementsByTagName("a"),C=[],E=0;E<B.length;E++)C.push(B[E]);document.execCommand("createlink",!1,mxUtils.trim(q));B=this.cellEditor.textarea.getElementsByTagName("a");if(B.length==C.length+1)for(E=B.length-1;0<=E;E--)if(B[E]!=C[E-1]){for(B=B[E].getElementsByTagName("a");0<B.length;){for(C=B[0].parentNode;null!=B[0].firstChild;)C.insertBefore(B[0].firstChild,B[0]);C.removeChild(B[0])}break}}else document.execCommand("createlink",!1,-mxUtils.trim(q))};Graph.prototype.isCellResizable=function(q){var B=mxGraph.prototype.isCellResizable.apply(this,arguments),C=this.getCurrentCellStyle(q);return!this.isTableCell(q)&&!this.isTableRow(q)&&(B||"0"!=mxUtils.getValue(C,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==C[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(q,B,C){null==B&&(B=this.getSelectionCells());if(null!=B&&1<B.length){for(var E=[],J=null,P=null,Y=0,ma=0;ma<B.length;ma++)if(this.getModel().isVertex(B[ma])){var ca=-this.view.getState(B[ma]);if(null!=ca){var na=q?ca.getCenterX():ca.getCenterY();J=null!=J?Math.max(J,na):na;P=null!=P?Math.min(P,na):na;C&&(Y+=q?ca.width:ca.height);E.push(ca)}}if(2<E.length){E.sort(function(Ra,Sa){return q?Ra.x-Sa.x:Ra.y-Sa.y});C&&(Y-=q?E[0].width/2+E[E.length-1].width/2:E[0].height/2+E[E.length-1].height/2);ca=this.view.translate;na=this.view.scale;P=P/na-(q?ca.x:ca.y);J=J/na-(q?ca.x:ca.y);this.getModel().beginUpdate();try{var ta=(J-P-Y)/(E.length-1),Fa=P+(C?q?E[0].width/2:E[0].height/-2:0);for(ma=1;ma<E.length-1;ma++){var Da=this.view.getState(this.model.getParent(E[ma].cell)),Na=this.getCellGeometry(E[ma].cell);Fa+=ta;null!=Na&&null!=Da&&(Na=Na.clone(),q?Na.x=Math.round(Fa-(C?0:Na.width/2))-Da.origin.x:Na.y=Math.round(Fa-(C?0:Na.height/2))-Da.origin.y,this.getModel().setGeometry(E[ma].cell,Na));C&&(Fa+=q?E[ma].width:E[ma].height)}}finally{this.getModel().endUpdate()}}}return B};Graph.prototype.isCloneEvent=function(q){return mxClient.IS_MAC&&mxEvent.isMetaDown(q)||mxEvent.isControlDown(q)};-Graph.prototype.createSvgImageExport=function(q){q=new mxImageExport;q.addCellData=function(C,E,J){E.setAttribute("data-cell-id",C.id);if(J)if(mxUtils.isNode(C.value))for(J=0;J<C.value.attributes.length;J++){var P=C.value.attributes[J];E.setAttribute("data-cell-"+P.name,P.value)}else if("object"===typeof C.value)for(P in C.value)E.setAttribute("data-cell-"+P,C.value[P]);else null!=C.value&&E.setAttribute("data-cell-value",C.value);return E};var B=q.visitStatesRecursive;q.visitStatesRecursive=function(C,-E,J){if(null!=C){var P=E.root,Y=E.root.ownerDocument;E.root=this.addCellData(C.cell,null!=Y.createElementNS?Y.createElementNS(mxConstants.NS_SVG,"g"):Y.createElement("g"),Editor.addSvgMetadata);P.appendChild(E.root);B.apply(this,arguments);E.root=P}};q.getLinkForCellState=mxUtils.bind(this,function(C,E){return this.getLinkForCell(C.cell)});q.getTitleForCellState=mxUtils.bind(this,function(C,E){return Editor.convertHtmlToText(this.convertValueToTooltip(C.cell))});return q};Graph.prototype.parseBackgroundImage=-function(q){var B=null;null!=q&&0<q.length&&(q=JSON.parse(q),B=new mxImage(q.src,q.width,q.height));return B};Graph.prototype.getBackgroundImageObject=function(q){return q};Graph.prototype.getSvg=function(q,B,C,E,J,P,Y,ma,ca,na,ta,Fa,Da,Na,Ra,Sa){var Aa=null;if(null!=Na)for(Aa=new mxDictionary,J=0;J<Na.length;J++)Aa.put(Na[J],!0);Na=this.useCssTransforms;var cb=this.enableFlowAnimation;this.enableFlowAnimation=!1;Na&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{B=null!=-B?B:1;C=null!=C?C:0;P=null!=P?P:!0;Y=null!=Y?Y:!0;na=null!=na?na:!1;ca=null!=ca?ca:this.defaultExportLinkTarget;var Wa="page"==Da?this.view.getBackgroundPageBounds():P&&null==Aa||E||"diagram"==Da?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),Qa=this.backgroundImage,Ya=this.view.translate,bb=this.view.scale;"diagram"==Da&&null!=Qa&&null!=Qa.width&&null!=Qa.height&&(Wa=mxRectangle.fromRectangle(Wa),Wa.add(new mxRectangle((Ya.x+Qa.x)*bb,(Ya.y+Qa.y)*bb,Qa.width*bb,Qa.height*bb)));-if(null==Wa)throw Error(mxResources.get("drawingEmpty"));E=B/bb;var nb=Math.max(1,Math.ceil(Wa.width*E)+2*C)+(na&&0==C?5:0),sb=Math.max(1,Math.ceil(Wa.height*E)+2*C)+(na&&0==C?5:0),ob=mxUtils.getLightDarkColor(q),lb=Graph.createSvgNode(0,0,nb,sb,ob),qb=lb.ownerDocument;if(null!=q){var pb=mxUtils.createElementNs(qb,mxConstants.NS_SVG,"rect");pb.setAttribute("fill",ob.light);pb.style.fill=ob.cssText;pb.setAttribute("width","100%");pb.setAttribute("height","100%");pb.setAttribute("x","0");pb.setAttribute("y",+Y.click=function(ca){};Y.addMouseListener(ma);mxEvent.addListener(document,"mouseleave",function(ca){ma.clear()})};Graph.prototype.duplicateCells=function(q,B){q=null!=q?q:this.getSelectionCells();B=null!=B?B:!0;for(var C=0;C<q.length;C++)this.isTableCell(q[C])&&(q[C]=this.model.getParent(q[C]));q=this.model.getTopmostCells(q);var F=this.getModel(),J=this.gridSize,P=[];F.beginUpdate();try{var Y={},ma=this.createCellLookup(q),ca=this.cloneCells(q,!1,Y,!0);for(C=0;C<q.length;C++){var na=F.getParent(q[C]);+if(null!=na){var ta=this.moveCells([ca[C]],J,J,!1)[0];P.push(ta);if(B)F.add(na,ca[C]);else{var Fa=na.getIndex(q[C]);F.add(na,ca[C],Fa+1)}if(this.isTable(na)){var Da=this.getCellGeometry(ca[C]),Na=this.getCellGeometry(na);null!=Da&&null!=Na&&(Na=Na.clone(),Na.height+=Da.height,F.setGeometry(na,Na))}}else P.push(ca[C])}this.updateCustomLinks(this.createCellMapping(Y,ma),ca,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ca))}finally{F.endUpdate()}return P};Graph.prototype.insertImage=+function(q,B,C){if(null!=q&&null!=this.cellEditor.textarea){for(var F=this.cellEditor.textarea.getElementsByTagName("img"),J=[],P=0;P<F.length;P++)J.push(F[P]);document.execCommand("insertimage",!1,q);q=this.cellEditor.textarea.getElementsByTagName("img");if(q.length==J.length+1)for(P=q.length-1;0<=P;P--)if(0==P||q[P]!=J[P-1]){q[P].setAttribute("width",B);q[P].setAttribute("height",C);break}}};Graph.prototype.insertLink=function(q){if(null!=this.cellEditor.textarea)if(0==q.length)document.execCommand("unlink",+!1);else if(mxClient.IS_FF){for(var B=this.cellEditor.textarea.getElementsByTagName("a"),C=[],F=0;F<B.length;F++)C.push(B[F]);document.execCommand("createlink",!1,mxUtils.trim(q));B=this.cellEditor.textarea.getElementsByTagName("a");if(B.length==C.length+1)for(F=B.length-1;0<=F;F--)if(B[F]!=C[F-1]){for(B=B[F].getElementsByTagName("a");0<B.length;){for(C=B[0].parentNode;null!=B[0].firstChild;)C.insertBefore(B[0].firstChild,B[0]);C.removeChild(B[0])}break}}else document.execCommand("createlink",!1,+mxUtils.trim(q))};Graph.prototype.isCellResizable=function(q){var B=mxGraph.prototype.isCellResizable.apply(this,arguments),C=this.getCurrentCellStyle(q);return!this.isTableCell(q)&&!this.isTableRow(q)&&(B||"0"!=mxUtils.getValue(C,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==C[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(q,B,C){null==B&&(B=this.getSelectionCells());if(null!=B&&1<B.length){for(var F=[],J=null,P=null,Y=0,ma=0;ma<B.length;ma++)if(this.getModel().isVertex(B[ma])){var ca=+this.view.getState(B[ma]);if(null!=ca){var na=q?ca.getCenterX():ca.getCenterY();J=null!=J?Math.max(J,na):na;P=null!=P?Math.min(P,na):na;C&&(Y+=q?ca.width:ca.height);F.push(ca)}}if(2<F.length){F.sort(function(Ra,Sa){return q?Ra.x-Sa.x:Ra.y-Sa.y});C&&(Y-=q?F[0].width/2+F[F.length-1].width/2:F[0].height/2+F[F.length-1].height/2);ca=this.view.translate;na=this.view.scale;P=P/na-(q?ca.x:ca.y);J=J/na-(q?ca.x:ca.y);this.getModel().beginUpdate();try{var ta=(J-P-Y)/(F.length-1),Fa=P+(C?q?F[0].width/2:F[0].height/+2:0);for(ma=1;ma<F.length-1;ma++){var Da=this.view.getState(this.model.getParent(F[ma].cell)),Na=this.getCellGeometry(F[ma].cell);Fa+=ta;null!=Na&&null!=Da&&(Na=Na.clone(),q?Na.x=Math.round(Fa-(C?0:Na.width/2))-Da.origin.x:Na.y=Math.round(Fa-(C?0:Na.height/2))-Da.origin.y,this.getModel().setGeometry(F[ma].cell,Na));C&&(Fa+=q?F[ma].width:F[ma].height)}}finally{this.getModel().endUpdate()}}}return B};Graph.prototype.isCloneEvent=function(q){return mxClient.IS_MAC&&mxEvent.isMetaDown(q)||mxEvent.isControlDown(q)};+Graph.prototype.createSvgImageExport=function(q){q=new mxImageExport;q.addCellData=function(C,F,J){F.setAttribute("data-cell-id",C.id);if(J)if(mxUtils.isNode(C.value))for(J=0;J<C.value.attributes.length;J++){var P=C.value.attributes[J];F.setAttribute("data-cell-"+P.name,P.value)}else if("object"===typeof C.value)for(P in C.value)F.setAttribute("data-cell-"+P,C.value[P]);else null!=C.value&&F.setAttribute("data-cell-value",C.value);return F};var B=q.visitStatesRecursive;q.visitStatesRecursive=function(C,+F,J){if(null!=C){var P=F.root,Y=F.root.ownerDocument;F.root=this.addCellData(C.cell,null!=Y.createElementNS?Y.createElementNS(mxConstants.NS_SVG,"g"):Y.createElement("g"),Editor.addSvgMetadata);P.appendChild(F.root);B.apply(this,arguments);F.root=P}};q.getLinkForCellState=mxUtils.bind(this,function(C,F){return this.getLinkForCell(C.cell)});q.getTitleForCellState=mxUtils.bind(this,function(C,F){return Editor.convertHtmlToText(this.convertValueToTooltip(C.cell))});return q};Graph.prototype.parseBackgroundImage=+function(q){var B=null;null!=q&&0<q.length&&(q=JSON.parse(q),B=new mxImage(q.src,q.width,q.height));return B};Graph.prototype.getBackgroundImageObject=function(q){return q};Graph.prototype.getSvg=function(q,B,C,F,J,P,Y,ma,ca,na,ta,Fa,Da,Na,Ra,Sa){var Aa=null;if(null!=Na)for(Aa=new mxDictionary,J=0;J<Na.length;J++)Aa.put(Na[J],!0);Na=this.useCssTransforms;var cb=this.enableFlowAnimation;this.enableFlowAnimation=!1;Na&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{B=null!=+B?B:1;C=null!=C?C:0;P=null!=P?P:!0;Y=null!=Y?Y:!0;na=null!=na?na:!1;ca=null!=ca?ca:this.defaultExportLinkTarget;var Wa="page"==Da?this.view.getBackgroundPageBounds():P&&null==Aa||F||"diagram"==Da?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),Qa=this.backgroundImage,Ya=this.view.translate,bb=this.view.scale;"diagram"==Da&&null!=Qa&&null!=Qa.width&&null!=Qa.height&&(Wa=mxRectangle.fromRectangle(Wa),Wa.add(new mxRectangle((Ya.x+Qa.x)*bb,(Ya.y+Qa.y)*bb,Qa.width*bb,Qa.height*bb)));+if(null==Wa)throw Error(mxResources.get("drawingEmpty"));F=B/bb;var nb=Math.max(1,Math.ceil(Wa.width*F)+2*C)+(na&&0==C?5:0),sb=Math.max(1,Math.ceil(Wa.height*F)+2*C)+(na&&0==C?5:0),ob=mxUtils.getLightDarkColor(q),lb=Graph.createSvgNode(0,0,nb,sb,ob),qb=lb.ownerDocument;if(null!=q){var pb=mxUtils.createElementNs(qb,mxConstants.NS_SVG,"rect");pb.setAttribute("fill",ob.light);pb.style.fill=ob.cssText;pb.setAttribute("width","100%");pb.setAttribute("height","100%");pb.setAttribute("x","0");pb.setAttribute("y","0");lb.appendChild(pb)}var vb=mxUtils.createElementNs(qb,mxConstants.NS_SVG,"g");lb.appendChild(vb);var fb=this.createSvgCanvas(vb);fb.translate(Math.floor(C/B-Wa.x/bb),Math.floor(C/B-Wa.y/bb));fb.idPrefix="drawio-svg-"+Editor.guid();var Ab=document.createElement("div"),tb=fb.getAlternateText;fb.getAlternateText=function(Za,ub,gb,c,m,p,n,r,w,x,I,A,ea){if(null!=p&&0<this.state.fontSize)try{mxUtils.isNode(p)?p=p.innerText:(Ab.innerHTML=p,p=mxUtils.extractTextWithWhitespace(Ab.childNodes));for(var Q=Math.ceil(2*c/this.state.fontSize),Ca=[],Ua=0,Pa=0;(0==Q||Ua<Q)&&Pa<p.length;){var ra=p.charCodeAt(Pa);if(10==ra||13==ra){if(0<Ua)break}else Ca.push(p.charAt(Pa)),255>ra&&Ua++;Pa++}Ca.length<p.length&&1<p.length-Ca.length&&(p=mxUtils.trim(Ca.join(""))+"...");return p}catch(xa){return tb.apply(this,arguments)}else return tb.apply(this,arguments)};if(null!=Qa&&null!=Qa.width&&null!=Qa.height){q=bb/B;var mb=new mxRectangle((Qa.x+Ya.x)*q,(Qa.y+Ya.y)*q,Qa.width*q,Qa.height*q);mxUtils.intersects(Wa,mb)&&-fb.image(Qa.x+Ya.x,Qa.y+Ya.y,Qa.width,Qa.height,Qa.src,!0)}fb.scale(E);fb.textEnabled=Y;ma=null!=ma?ma:this.createSvgImageExport();var Xa=ma.getLinkForCellState;ma.getLinkForCellState=function(Za,ub){var gb=Za.view.graph.getAbsoluteUrl(Xa.apply(this,arguments));return null==gb||Za.view.graph.isCustomLink(gb)?null:gb};ma.getLinkTargetForCellState=function(Za,ub){return Za.view.graph.getLinkTargetForCell(Za.cell)};var wb=ma.drawCellState,xb=null,yb=mxUtils.bind(this,function(){if(null==xb){xb="ge-flow-animation-"++fb.image(Qa.x+Ya.x,Qa.y+Ya.y,Qa.width,Qa.height,Qa.src,!0)}fb.scale(F);fb.textEnabled=Y;ma=null!=ma?ma:this.createSvgImageExport();var Xa=ma.getLinkForCellState;ma.getLinkForCellState=function(Za,ub){var gb=Za.view.graph.getAbsoluteUrl(Xa.apply(this,arguments));return null==gb||Za.view.graph.isCustomLink(gb)?null:gb};ma.getLinkTargetForCellState=function(Za,ub){return Za.view.graph.getLinkTargetForCell(Za.cell)};var wb=ma.drawCellState,xb=null,yb=mxUtils.bind(this,function(){if(null==xb){xb="ge-flow-animation-"+Editor.guid();var Za=null!=qb.createElementNS?qb.createElementNS(mxConstants.NS_SVG,"style"):qb.createElement("style");Za.innerHTML=this.createFlowAnimationCss(xb);qb.getElementsByTagName("defs")[0].appendChild(Za)}return xb});ma.drawCellState=function(Za,ub){for(var gb=Za.view.graph,c=null!=Aa?Aa.get(Za.cell):gb.isCellSelected(Za.cell),m=gb.model.getParent(Za.cell);!(P&&null==Aa||c)&&null!=m;)c=null!=Aa?Aa.get(m):gb.isCellSelected(m),m=gb.model.getParent(m);if(null!=Za.shape)try{var p=Za.shape.isFlowAnimationEnabled,n=Za.shape.addFlowAnimationToShape;Za.shape.isFlowAnimationEnabled=function(){return cb&&gb.model.isEdge(Za.cell)&&"1"==mxUtils.getValue(Za.style,"flowAnimation","0")};Za.shape.addFlowAnimationToShape=function(){gb.addFlowAnimationToNode(this.getFlowAnimationPath(),Za.style,B,yb())};if(P&&null==Aa||c)gb.view.redrawEnumerationState(Za),wb.apply(this,arguments),this.doDrawShape(Za.secondLabel,ub)}finally{Za.shape.isFlowAnimationEnabled=p,Za.shape.addFlowAnimationToShape=n}};var zb=null!=this.view.currentRoot?-this.view.currentRoot:this.model.root;ma.drawState(this.getView().getState(zb),fb);this.addForeignObjectWarning(fb,lb);Sa?this.disableSvgLinks(lb):this.updateSvgLinks(lb,ca,!0);return lb}finally{this.enableFlowAnimation=cb,Na&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(q,B){if("0"!=urlParams["svg-warning"]&&0<B.getElementsByTagName("foreignObject").length){var C=q.createElement("switch"),E=q.createElement("g");E.setAttribute("requiredFeatures",+this.view.currentRoot:this.model.root;ma.drawState(this.getView().getState(zb),fb);this.addForeignObjectWarning(fb,lb);Sa?this.disableSvgLinks(lb):this.updateSvgLinks(lb,ca,!0);return lb}finally{this.enableFlowAnimation=cb,Na&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(q,B){if("0"!=urlParams["svg-warning"]&&0<B.getElementsByTagName("foreignObject").length){var C=q.createElement("switch"),F=q.createElement("g");F.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var J=q.createElement("a");J.setAttribute("transform","translate(0,-5)");null==J.setAttributeNS||B.ownerDocument!=document&&null==document.documentMode?(J.setAttribute("xlink:href",Graph.foreignObjectWarningLink),J.setAttribute("target","_blank")):(J.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),J.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));q=q.createElement("text");q.setAttribute("text-anchor","middle");-q.setAttribute("font-size","10px");q.setAttribute("x","50%");q.setAttribute("y","100%");mxUtils.write(q,Graph.foreignObjectWarningText);C.appendChild(E);J.appendChild(q);C.appendChild(J);B.appendChild(C)}};Graph.prototype.disableSvgLinks=function(q,B){q=q.getElementsByTagName("a");for(var C=0;C<q.length;C++){var E=q[C].getAttribute("href");null==E&&(E=q[C].getAttribute("xlink:href"));null!=E&&(q[C].style.pointerEvents="none",q[C].setAttribute("href",""));B&&B(q[C])}};Graph.prototype.updateSvgLinks=-function(q,B,C){q=q.getElementsByTagName("a");for(var E=0;E<q.length;E++)if(null==q[E].getAttribute("target")){var J=q[E].getAttribute("href");null==J&&(J=q[E].getAttribute("xlink:href"));null!=J&&(null!=B&&/^https?:\/\//.test(J)?q[E].setAttribute("target",B):C&&this.isCustomLink(J)&&q[E].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(q){q=new mxSvgCanvas2D(q);q.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;q.adaptiveColors=this.getAdaptiveColors();q.pointerEvents=+q.setAttribute("font-size","10px");q.setAttribute("x","50%");q.setAttribute("y","100%");mxUtils.write(q,Graph.foreignObjectWarningText);C.appendChild(F);J.appendChild(q);C.appendChild(J);B.appendChild(C)}};Graph.prototype.disableSvgLinks=function(q,B){q=q.getElementsByTagName("a");for(var C=0;C<q.length;C++){var F=q[C].getAttribute("href");null==F&&(F=q[C].getAttribute("xlink:href"));null!=F&&(q[C].style.pointerEvents="none",q[C].setAttribute("href",""));B&&B(q[C])}};Graph.prototype.updateSvgLinks=+function(q,B,C){q=q.getElementsByTagName("a");for(var F=0;F<q.length;F++)if(null==q[F].getAttribute("target")){var J=q[F].getAttribute("href");null==J&&(J=q[F].getAttribute("xlink:href"));null!=J&&(null!=B&&/^https?:\/\//.test(J)?q[F].setAttribute("target",B):C&&this.isCustomLink(J)&&q[F].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(q){q=new mxSvgCanvas2D(q);q.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;q.adaptiveColors=this.getAdaptiveColors();q.pointerEvents=!0;return q};Graph.prototype.getSelectedElement=function(){var q=null;if(window.getSelection){var B=window.getSelection();B.getRangeAt&&B.rangeCount&&(q=B.getRangeAt(0).commonAncestorContainer)}else document.selection&&(q=document.selection.createRange().parentElement());return q};Graph.prototype.getSelectedEditingElement=function(){var q=null;if(null!=this.cellEditor.textarea)for(q=this.getSelectedElement();null!=q&&q.nodeType!=mxConstants.NODETYPE_ELEMENT;)q=q.parentNode;return q};Graph.prototype.getParentByName=function(q,B,C){for(;null!=q&&q.nodeName!=B;){if(q==C)return null;q=q.parentNode}return q};Graph.prototype.getParentByNames=function(q,B,C){for(;null!=q&&!(0<=mxUtils.indexOf(B,q.nodeName));){if(q==C)return null;q=q.parentNode}return q};Graph.prototype.selectNode=function(q){var B=null;if(window.getSelection){if(B=window.getSelection(),B.getRangeAt&&B.rangeCount){var C=document.createRange();C.selectNode(q);B.removeAllRanges();B.addRange(C)}}else(B=document.selection)&&"Control"!=B.type&&(q=B.createRange(),-q.collapse(!0),C=B.createRange(),C.setEndPoint("StartToStart",q),C.select())};Graph.prototype.flipEdgePoints=function(q,B,C){var E=this.getCellGeometry(q);if(null!=E){E=E.clone();if(null!=E.points)for(var J=0;J<E.points.length;J++)B?E.points[J].x=C+(C-E.points[J].x):E.points[J].y=C+(C-E.points[J].y);J=function(P){null!=P&&(B?P.x=C+(C-P.x):P.y=C+(C-P.y))};J(E.getTerminalPoint(!0));J(E.getTerminalPoint(!1));this.model.setGeometry(q,E)}};Graph.prototype.flipChildren=function(q,B,C){this.model.beginUpdate();-try{for(var E=this.model.getChildCount(q),J=0;J<E;J++){var P=this.model.getChildAt(q,J);if(this.model.isEdge(P))this.flipEdgePoints(P,B,C);else{var Y=this.getCellGeometry(P);null!=Y&&(Y=Y.clone(),B?Y.x=C+(C-Y.x-Y.width):Y.y=C+(C-Y.y-Y.height),this.model.setGeometry(P,Y))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(q,B,C){return null!=q&&1==mxUtils.getValue(q.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(q,B,C):mxGraph.prototype.getConnectionPoint.apply(this,-arguments)};Graph.prototype.getLegacyConnectionPoint=function(q,B,C){C=null!=C?C:!0;var E=null;if(null!=q&&null!=B.point){var J=this.view.getPerimeterBounds(q),P=new mxPoint(J.getCenterX(),J.getCenterY()),Y=q.style[mxConstants.STYLE_DIRECTION],ma=0;null!=Y&&1==mxUtils.getValue(q.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(Y==mxConstants.DIRECTION_NORTH?ma+=270:Y==mxConstants.DIRECTION_WEST?ma+=180:Y==mxConstants.DIRECTION_SOUTH&&(ma+=90),Y!=mxConstants.DIRECTION_NORTH&&Y!=mxConstants.DIRECTION_SOUTH||-J.rotate90());E=this.view.scale;E=new mxPoint(J.x+B.point.x*J.width+B.dx*E,J.y+B.point.y*J.height+B.dy*E);var ca=q.style[mxConstants.STYLE_ROTATION]||0;if(B.perimeter)0!=ma&&(Y=J=0,90==ma?Y=1:180==ma?J=-1:270==ma&&(Y=-1),E=mxUtils.getRotatedPoint(E,J,Y,P)),E=this.view.getPerimeterPoint(q,E,!1);else if(ca+=ma,this.getModel().isVertex(q.cell)){ma=1==q.style[mxConstants.STYLE_FLIPH];B=1==q.style[mxConstants.STYLE_FLIPV];null!=q.shape&&null!=q.shape.stencil&&(ma=1==mxUtils.getValue(q.style,"stencilFlipH",-0)||ma,B=1==mxUtils.getValue(q.style,"stencilFlipV",0)||B);if(Y==mxConstants.DIRECTION_NORTH||Y==mxConstants.DIRECTION_SOUTH)q=ma,ma=B,B=q;ma&&(E.x=2*J.getCenterX()-E.x);B&&(E.y=2*J.getCenterY()-E.y)}0!=ca&&null!=E&&(q=mxUtils.toRadians(ca),J=Math.cos(q),Y=Math.sin(q),E=mxUtils.getRotatedPoint(E,J,Y,P))}C&&null!=E&&(E.x=Math.round(E.x),E.y=Math.round(E.y));return E};Graph.prototype.flipCells=function(q,B){this.model.beginUpdate();try{q=this.model.getTopmostCells(q);for(var C=[],E=0;E<q.length;E++)if(this.model.isEdge(q[E])){var J=-this.view.getState(q[E]);null!=J&&this.flipEdgePoints(q[E],B,(B?J.getCenterX():J.getCenterY())/this.view.scale-(B?J.origin.x:J.origin.y)-(B?this.view.translate.x:this.view.translate.y))}else{var P=this.getCellGeometry(q[E]);null!=P&&this.flipChildren(q[E],B,B?P.getCenterX()-P.x:P.getCenterY()-P.y);C.push(q[E])}this.toggleCellStyles(B?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,C);this.setCellStyles("legacyAnchorPoints","0",C)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(q,-B){var C=null;if(null!=q&&0<q.length){this.model.beginUpdate();try{for(var E=0;E<q.length;E++){var J=this.model.getParent(q[E]);if(this.isTable(J)){var P=this.getCellGeometry(q[E]),Y=this.getCellGeometry(J);null!=P&&null!=Y&&(Y=Y.clone(),Y.height-=P.height,this.model.setGeometry(J,Y))}}var ma=this.selectParentAfterDelete?this.model.getParents(q):null;this.removeCells(q,B)}finally{this.model.endUpdate()}if(null!=ma)for(C=[],E=0;E<ma.length;E++)this.model.contains(ma[E])&&(this.model.isVertex(ma[E])||-this.model.isEdge(ma[E]))&&C.push(ma[E])}return C};Graph.prototype.insertTableColumn=function(q,B){var C=this.getModel();C.beginUpdate();try{var E=q,J=0;if(this.isTableCell(q)){var P=C.getParent(q);E=C.getParent(P);J=mxUtils.indexOf(C.getChildCells(P,!0),q)}else this.isTableRow(q)?E=C.getParent(q):q=C.getChildCells(E,!0)[0],B||(J=C.getChildCells(q,!0).length-1);var Y=C.getChildCells(E,!0),ma=Graph.minTableColumnWidth;for(q=0;q<Y.length;q++){var ca=C.getChildCells(Y[q],!0)[J],na=C.cloneCell(ca,!1);-null==na&&(na=this.createVertex());var ta=this.getCellGeometry(na);na.value=null;na.style=mxUtils.setStyle(mxUtils.setStyle(na.style,"rowspan",null),"colspan",null);if(null!=ta){null!=ta.alternateBounds&&(ta.width=ta.alternateBounds.width,ta.height=ta.alternateBounds.height,ta.alternateBounds=null);ma=ta.width;var Fa=this.getCellGeometry(Y[q]);null!=Fa&&(ta.height=Fa.height)}C.add(Y[q],na,J+(B?0:1))}var Da=this.getCellGeometry(E);null!=Da&&(Da=Da.clone(),Da.width+=ma,C.setGeometry(E,Da))}finally{C.endUpdate()}};-Graph.prototype.deleteLane=function(q){var B=this.getModel();B.beginUpdate();try{var C=null;C="stackLayout"==this.getCurrentCellStyle(q).childLayout?q:B.getParent(q);var E=B.getChildCells(C,!0);0==E.length?B.remove(C):(C==q&&(q=E[E.length-1]),B.remove(q))}finally{B.endUpdate()}};Graph.prototype.insertLane=function(q,B){var C=this.getModel();C.beginUpdate();try{var E=null;if("stackLayout"==this.getCurrentCellStyle(q).childLayout){E=q;var J=C.getChildCells(E,!0);q=J[B?0:J.length-1]}else E=C.getParent(q);-var P=E.getIndex(q);q=C.cloneCell(q,!1);q.value=null;C.add(E,q,P+(B?0:1))}finally{C.endUpdate()}};Graph.prototype.insertTableRow=function(q,B){var C=this.getModel();C.beginUpdate();try{var E=q,J=q;if(this.isTableCell(q))J=C.getParent(q),E=C.getParent(J);else if(this.isTableRow(q))E=C.getParent(q);else{var P=C.getChildCells(E,!0);J=P[B?0:P.length-1]}var Y=C.getChildCells(J,!0),ma=E.getIndex(J);J=C.cloneCell(J,!1);J.value=null;var ca=this.getCellGeometry(J);if(null!=ca){for(P=0;P<Y.length;P++){q=C.cloneCell(Y[P],-!1);q.value=null;q.style=mxUtils.setStyle(mxUtils.setStyle(q.style,"rowspan",null),"colspan",null);var na=this.getCellGeometry(q);null!=na&&(null!=na.alternateBounds&&(na.width=na.alternateBounds.width,na.height=na.alternateBounds.height,na.alternateBounds=null),na.height=ca.height);J.insert(q)}C.add(E,J,ma+(B?0:1));var ta=this.getCellGeometry(E);null!=ta&&(ta=ta.clone(),ta.height+=ca.height,C.setGeometry(E,ta))}}finally{C.endUpdate()}};Graph.prototype.deleteTableColumn=function(q){var B=this.getModel();-B.beginUpdate();try{var C=q,E=q;this.isTableCell(q)&&(E=B.getParent(q));this.isTableRow(E)&&(C=B.getParent(E));var J=B.getChildCells(C,!0);if(0==J.length)B.remove(C);else{this.isTableRow(E)||(E=J[0]);var P=B.getChildCells(E,!0);if(1>=P.length)B.remove(C);else{var Y=P.length-1;this.isTableCell(q)&&(Y=mxUtils.indexOf(P,q));for(E=q=0;E<J.length;E++){var ma=B.getChildCells(J[E],!0)[Y];B.remove(ma);var ca=this.getCellGeometry(ma);null!=ca&&(q=Math.max(q,ca.width))}var na=this.getCellGeometry(C);null!=-na&&(na=na.clone(),na.width-=q,B.setGeometry(C,na))}}}finally{B.endUpdate()}};Graph.prototype.deleteTableRow=function(q){var B=this.getModel();B.beginUpdate();try{var C=q,E=q;this.isTableCell(q)&&(q=E=B.getParent(q));this.isTableRow(q)&&(C=B.getParent(E));var J=B.getChildCells(C,!0);if(1>=J.length)B.remove(C);else{this.isTableRow(E)||(E=J[J.length-1]);B.remove(E);q=0;var P=this.getCellGeometry(E);null!=P&&(q=P.height);var Y=this.getCellGeometry(C);null!=Y&&(Y=Y.clone(),Y.height-=q,B.setGeometry(C,-Y))}}finally{B.endUpdate()}};Graph.prototype.insertRow=function(q,B){for(var C=q.tBodies[0],E=C.rows[0].cells,J=q=0;J<E.length;J++){var P=E[J].getAttribute("colspan");q+=null!=P?parseInt(P):1}B=C.insertRow(B);for(J=0;J<q;J++)mxUtils.br(B.insertCell(-1));return B.cells[0]};Graph.prototype.deleteRow=function(q,B){q.tBodies[0].deleteRow(B)};Graph.prototype.insertColumn=function(q,B){var C=q.tHead;if(null!=C)for(var E=0;E<C.rows.length;E++){var J=document.createElement("th");C.rows[E].appendChild(J);-mxUtils.br(J)}q=q.tBodies[0];for(C=0;C<q.rows.length;C++)E=q.rows[C].insertCell(B),mxUtils.br(E);return q.rows[0].cells[0<=B?B:q.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(q,B){if(0<=B){q=q.tBodies[0].rows;for(var C=0;C<q.length;C++)q[C].cells.length>B&&q[C].deleteCell(B)}};Graph.prototype.pasteHtmlAtCaret=function(q){if(window.getSelection){var B=window.getSelection();if(B.getRangeAt&&B.rangeCount){B=B.getRangeAt(0);B.deleteContents();var C=document.createElement("div");C.innerHTML=-q;q=document.createDocumentFragment();for(var E;E=C.firstChild;)lastNode=q.appendChild(E);B.insertNode(q)}}else(B=document.selection)&&"Control"!=B.type&&B.createRange().pasteHTML(q)};Graph.prototype.createLinkForHint=function(q,B,C){function E(P,Y){P.length>Y&&(P=P.substring(0,Math.round(Y/2))+"..."+P.substring(P.length-Math.round(Y/4)));return P}q=null!=q?q:"javascript:void(0);";if(null==B||0==B.length)B=this.isCustomLink(q)?this.getLinkTitle(q):q;var J=document.createElement("a");J.setAttribute("rel",-this.linkRelation);J.setAttribute("href",this.getAbsoluteUrl(q));J.setAttribute("title",E(this.isCustomLink(q)?this.getLinkTitle(q):q,80));null!=this.linkTarget&&J.setAttribute("target",this.linkTarget);mxUtils.write(J,E(B,40));this.isCustomLink(q)&&mxEvent.addListener(J,"click",mxUtils.bind(this,function(P){this.customLinkClicked(q,C);mxEvent.consume(P)}));return J};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};+q.collapse(!0),C=B.createRange(),C.setEndPoint("StartToStart",q),C.select())};Graph.prototype.flipEdgePoints=function(q,B,C){var F=this.getCellGeometry(q);if(null!=F){F=F.clone();if(null!=F.points)for(var J=0;J<F.points.length;J++)B?F.points[J].x=C+(C-F.points[J].x):F.points[J].y=C+(C-F.points[J].y);J=function(P){null!=P&&(B?P.x=C+(C-P.x):P.y=C+(C-P.y))};J(F.getTerminalPoint(!0));J(F.getTerminalPoint(!1));this.model.setGeometry(q,F)}};Graph.prototype.flipChildren=function(q,B,C){this.model.beginUpdate();+try{for(var F=this.model.getChildCount(q),J=0;J<F;J++){var P=this.model.getChildAt(q,J);if(this.model.isEdge(P))this.flipEdgePoints(P,B,C);else{var Y=this.getCellGeometry(P);null!=Y&&(Y=Y.clone(),B?Y.x=C+(C-Y.x-Y.width):Y.y=C+(C-Y.y-Y.height),this.model.setGeometry(P,Y))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(q,B,C){return null!=q&&1==mxUtils.getValue(q.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(q,B,C):mxGraph.prototype.getConnectionPoint.apply(this,+arguments)};Graph.prototype.getLegacyConnectionPoint=function(q,B,C){C=null!=C?C:!0;var F=null;if(null!=q&&null!=B.point){var J=this.view.getPerimeterBounds(q),P=new mxPoint(J.getCenterX(),J.getCenterY()),Y=q.style[mxConstants.STYLE_DIRECTION],ma=0;null!=Y&&1==mxUtils.getValue(q.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(Y==mxConstants.DIRECTION_NORTH?ma+=270:Y==mxConstants.DIRECTION_WEST?ma+=180:Y==mxConstants.DIRECTION_SOUTH&&(ma+=90),Y!=mxConstants.DIRECTION_NORTH&&Y!=mxConstants.DIRECTION_SOUTH||+J.rotate90());F=this.view.scale;F=new mxPoint(J.x+B.point.x*J.width+B.dx*F,J.y+B.point.y*J.height+B.dy*F);var ca=q.style[mxConstants.STYLE_ROTATION]||0;if(B.perimeter)0!=ma&&(Y=J=0,90==ma?Y=1:180==ma?J=-1:270==ma&&(Y=-1),F=mxUtils.getRotatedPoint(F,J,Y,P)),F=this.view.getPerimeterPoint(q,F,!1);else if(ca+=ma,this.getModel().isVertex(q.cell)){ma=1==q.style[mxConstants.STYLE_FLIPH];B=1==q.style[mxConstants.STYLE_FLIPV];null!=q.shape&&null!=q.shape.stencil&&(ma=1==mxUtils.getValue(q.style,"stencilFlipH",+0)||ma,B=1==mxUtils.getValue(q.style,"stencilFlipV",0)||B);if(Y==mxConstants.DIRECTION_NORTH||Y==mxConstants.DIRECTION_SOUTH)q=ma,ma=B,B=q;ma&&(F.x=2*J.getCenterX()-F.x);B&&(F.y=2*J.getCenterY()-F.y)}0!=ca&&null!=F&&(q=mxUtils.toRadians(ca),J=Math.cos(q),Y=Math.sin(q),F=mxUtils.getRotatedPoint(F,J,Y,P))}C&&null!=F&&(F.x=Math.round(F.x),F.y=Math.round(F.y));return F};Graph.prototype.flipCells=function(q,B){this.model.beginUpdate();try{q=this.model.getTopmostCells(q);for(var C=[],F=0;F<q.length;F++)if(this.model.isEdge(q[F])){var J=+this.view.getState(q[F]);null!=J&&this.flipEdgePoints(q[F],B,(B?J.getCenterX():J.getCenterY())/this.view.scale-(B?J.origin.x:J.origin.y)-(B?this.view.translate.x:this.view.translate.y))}else{var P=this.getCellGeometry(q[F]);null!=P&&this.flipChildren(q[F],B,B?P.getCenterX()-P.x:P.getCenterY()-P.y);C.push(q[F])}this.toggleCellStyles(B?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,C);this.setCellStyles("legacyAnchorPoints","0",C)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(q,+B){var C=null;if(null!=q&&0<q.length){this.model.beginUpdate();try{for(var F=0;F<q.length;F++){var J=this.model.getParent(q[F]);if(this.isTable(J)){var P=this.getCellGeometry(q[F]),Y=this.getCellGeometry(J);null!=P&&null!=Y&&(Y=Y.clone(),Y.height-=P.height,this.model.setGeometry(J,Y))}}var ma=this.selectParentAfterDelete?this.model.getParents(q):null;this.removeCells(q,B)}finally{this.model.endUpdate()}if(null!=ma)for(C=[],F=0;F<ma.length;F++)this.model.contains(ma[F])&&(this.model.isVertex(ma[F])||+this.model.isEdge(ma[F]))&&C.push(ma[F])}return C};Graph.prototype.insertTableColumn=function(q,B){var C=this.getModel();C.beginUpdate();try{var F=q,J=0;if(this.isTableCell(q)){var P=C.getParent(q);F=C.getParent(P);J=mxUtils.indexOf(C.getChildCells(P,!0),q)}else this.isTableRow(q)?F=C.getParent(q):q=C.getChildCells(F,!0)[0],B||(J=C.getChildCells(q,!0).length-1);var Y=C.getChildCells(F,!0),ma=Graph.minTableColumnWidth;for(q=0;q<Y.length;q++){var ca=C.getChildCells(Y[q],!0)[J],na=C.cloneCell(ca,!1);+null==na&&(na=this.createVertex());var ta=this.getCellGeometry(na);na.value=null;na.style=mxUtils.setStyle(mxUtils.setStyle(na.style,"rowspan",null),"colspan",null);if(null!=ta){null!=ta.alternateBounds&&(ta.width=ta.alternateBounds.width,ta.height=ta.alternateBounds.height,ta.alternateBounds=null);ma=ta.width;var Fa=this.getCellGeometry(Y[q]);null!=Fa&&(ta.height=Fa.height)}C.add(Y[q],na,J+(B?0:1))}var Da=this.getCellGeometry(F);null!=Da&&(Da=Da.clone(),Da.width+=ma,C.setGeometry(F,Da))}finally{C.endUpdate()}};+Graph.prototype.deleteLane=function(q){var B=this.getModel();B.beginUpdate();try{var C=null;C="stackLayout"==this.getCurrentCellStyle(q).childLayout?q:B.getParent(q);var F=B.getChildCells(C,!0);0==F.length?B.remove(C):(C==q&&(q=F[F.length-1]),B.remove(q))}finally{B.endUpdate()}};Graph.prototype.insertLane=function(q,B){var C=this.getModel();C.beginUpdate();try{var F=null;if("stackLayout"==this.getCurrentCellStyle(q).childLayout){F=q;var J=C.getChildCells(F,!0);q=J[B?0:J.length-1]}else F=C.getParent(q);+var P=F.getIndex(q);q=C.cloneCell(q,!1);q.value=null;C.add(F,q,P+(B?0:1))}finally{C.endUpdate()}};Graph.prototype.insertTableRow=function(q,B){var C=this.getModel();C.beginUpdate();try{var F=q,J=q;if(this.isTableCell(q))J=C.getParent(q),F=C.getParent(J);else if(this.isTableRow(q))F=C.getParent(q);else{var P=C.getChildCells(F,!0);J=P[B?0:P.length-1]}var Y=C.getChildCells(J,!0),ma=F.getIndex(J);J=C.cloneCell(J,!1);J.value=null;var ca=this.getCellGeometry(J);if(null!=ca){for(P=0;P<Y.length;P++){q=C.cloneCell(Y[P],+!1);q.value=null;q.style=mxUtils.setStyle(mxUtils.setStyle(q.style,"rowspan",null),"colspan",null);var na=this.getCellGeometry(q);null!=na&&(null!=na.alternateBounds&&(na.width=na.alternateBounds.width,na.height=na.alternateBounds.height,na.alternateBounds=null),na.height=ca.height);J.insert(q)}C.add(F,J,ma+(B?0:1));var ta=this.getCellGeometry(F);null!=ta&&(ta=ta.clone(),ta.height+=ca.height,C.setGeometry(F,ta))}}finally{C.endUpdate()}};Graph.prototype.deleteTableColumn=function(q){var B=this.getModel();+B.beginUpdate();try{var C=q,F=q;this.isTableCell(q)&&(F=B.getParent(q));this.isTableRow(F)&&(C=B.getParent(F));var J=B.getChildCells(C,!0);if(0==J.length)B.remove(C);else{this.isTableRow(F)||(F=J[0]);var P=B.getChildCells(F,!0);if(1>=P.length)B.remove(C);else{var Y=P.length-1;this.isTableCell(q)&&(Y=mxUtils.indexOf(P,q));for(F=q=0;F<J.length;F++){var ma=B.getChildCells(J[F],!0)[Y];B.remove(ma);var ca=this.getCellGeometry(ma);null!=ca&&(q=Math.max(q,ca.width))}var na=this.getCellGeometry(C);null!=+na&&(na=na.clone(),na.width-=q,B.setGeometry(C,na))}}}finally{B.endUpdate()}};Graph.prototype.deleteTableRow=function(q){var B=this.getModel();B.beginUpdate();try{var C=q,F=q;this.isTableCell(q)&&(q=F=B.getParent(q));this.isTableRow(q)&&(C=B.getParent(F));var J=B.getChildCells(C,!0);if(1>=J.length)B.remove(C);else{this.isTableRow(F)||(F=J[J.length-1]);B.remove(F);q=0;var P=this.getCellGeometry(F);null!=P&&(q=P.height);var Y=this.getCellGeometry(C);null!=Y&&(Y=Y.clone(),Y.height-=q,B.setGeometry(C,+Y))}}finally{B.endUpdate()}};Graph.prototype.insertRow=function(q,B){for(var C=q.tBodies[0],F=C.rows[0].cells,J=q=0;J<F.length;J++){var P=F[J].getAttribute("colspan");q+=null!=P?parseInt(P):1}B=C.insertRow(B);for(J=0;J<q;J++)mxUtils.br(B.insertCell(-1));return B.cells[0]};Graph.prototype.deleteRow=function(q,B){q.tBodies[0].deleteRow(B)};Graph.prototype.insertColumn=function(q,B){var C=q.tHead;if(null!=C)for(var F=0;F<C.rows.length;F++){var J=document.createElement("th");C.rows[F].appendChild(J);+mxUtils.br(J)}q=q.tBodies[0];for(C=0;C<q.rows.length;C++)F=q.rows[C].insertCell(B),mxUtils.br(F);return q.rows[0].cells[0<=B?B:q.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(q,B){if(0<=B){q=q.tBodies[0].rows;for(var C=0;C<q.length;C++)q[C].cells.length>B&&q[C].deleteCell(B)}};Graph.prototype.pasteHtmlAtCaret=function(q){if(window.getSelection){var B=window.getSelection();if(B.getRangeAt&&B.rangeCount){B=B.getRangeAt(0);B.deleteContents();var C=document.createElement("div");C.innerHTML=+q;q=document.createDocumentFragment();for(var F;F=C.firstChild;)lastNode=q.appendChild(F);B.insertNode(q)}}else(B=document.selection)&&"Control"!=B.type&&B.createRange().pasteHTML(q)};Graph.prototype.createLinkForHint=function(q,B,C){function F(P,Y){P.length>Y&&(P=P.substring(0,Math.round(Y/2))+"..."+P.substring(P.length-Math.round(Y/4)));return P}q=null!=q?q:"javascript:void(0);";if(null==B||0==B.length)B=this.isCustomLink(q)?this.getLinkTitle(q):q;var J=document.createElement("a");J.setAttribute("rel",+this.linkRelation);J.setAttribute("href",this.getAbsoluteUrl(q));J.setAttribute("title",F(this.isCustomLink(q)?this.getLinkTitle(q):q,80));null!=this.linkTarget&&J.setAttribute("target",this.linkTarget);mxUtils.write(J,F(B,40));this.isCustomLink(q)&&mxEvent.addListener(J,"click",mxUtils.bind(this,function(P){this.customLinkClicked(q,C);mxEvent.consume(P)}));return J};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(P,Y){this.popupMenuHandler.hideMenu()});var q=this.updateMouseEvent;this.updateMouseEvent=function(P){P=q.apply(this,arguments);if(mxEvent.isTouchEvent(P.getEvent())&&null==P.getState()){var Y=this.getCellAt(P.graphX,P.graphY);null!=Y&&this.isSwimlane(Y)&&this.hitsSwimlaneContent(Y,P.graphX,P.graphY)||(P.state=this.view.getState(Y),null!=P.state&&null!=P.state.shape&&(this.container.style.cursor=P.state.shape.node.style.cursor))}null==P.getState()&&-this.isEnabled()&&(this.container.style.cursor="default");return P};var B=!1,C=!1,E=!1,J=this.fireMouseEvent;this.fireMouseEvent=function(P,Y,ma){P==mxEvent.MOUSE_DOWN&&(Y=this.updateMouseEvent(Y),B=this.isCellSelected(Y.getCell()),C=this.isSelectionEmpty(),E=this.popupMenuHandler.isMenuShowing());J.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(P,Y){if(null!=this.freehand&&!this.freehand.isDrawing()){var ma=mxEvent.isMouseEvent(Y.getEvent());this.popupMenuHandler.popupTrigger=-!this.isEditing()&&this.isEnabled()&&(null==Y.getState()||!Y.isSource(Y.getState().control))&&(this.popupMenuHandler.popupTrigger||!E&&!ma&&(C&&null==Y.getCell()&&this.isSelectionEmpty()||B&&this.isCellSelected(Y.getCell())));ma=!B||ma?null:mxUtils.bind(this,function(ca){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var na=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(Y.getX()+na.x+1,Y.getY()+na.y+1,ca,Y.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,+this.isEnabled()&&(this.container.style.cursor="default");return P};var B=!1,C=!1,F=!1,J=this.fireMouseEvent;this.fireMouseEvent=function(P,Y,ma){P==mxEvent.MOUSE_DOWN&&(Y=this.updateMouseEvent(Y),B=this.isCellSelected(Y.getCell()),C=this.isSelectionEmpty(),F=this.popupMenuHandler.isMenuShowing());J.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(P,Y){if(null!=this.freehand&&!this.freehand.isDrawing()){var ma=mxEvent.isMouseEvent(Y.getEvent());this.popupMenuHandler.popupTrigger=+!this.isEditing()&&this.isEnabled()&&(null==Y.getState()||!Y.isSource(Y.getState().control))&&(this.popupMenuHandler.popupTrigger||!F&&!ma&&(C&&null==Y.getCell()&&this.isSelectionEmpty()||B&&this.isCellSelected(Y.getCell())));ma=!B||ma?null:mxUtils.bind(this,function(ca){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var na=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(Y.getX()+na.x+1,Y.getY()+na.y+1,ca,Y.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[P,Y,ma])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var q=this.graph.view.getState(this.editingCell);return null!=q&&1==q.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var q="";window.getSelection?q=window.getSelection():document.getSelection?q=document.getSelection():document.selection&&(q=document.selection.createRange().text);return""!=q};mxCellEditor.prototype.insertTab=function(q){var B=this.textarea.ownerDocument.defaultView.getSelection(),C=B.getRangeAt(0);q=Graph.createTabNode(q);C.insertNode(q);C.setStartAfter(q);C.setEndAfter(q);B.removeAllRanges();B.addRange(C)};mxCellEditor.prototype.alignText=function(q,B){var C=this.graph.getView().getState(this.editingCell);if(null!=C){C=mxUtils.getValue(C.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);-var E=null!=C&&"vertical-"==C.substring(0,9),J=null!=B&&mxEvent.isShiftDown(B);if(J||null!=window.getSelection&&null!=window.getSelection().containsNode){var P=!0;this.graph.processElements(this.textarea,function(Y){J||E||window.getSelection().containsNode(Y,!0)?(Y.removeAttribute("align"),Y.style.textAlign=null):P=!1});(P||E)&&this.graph.cellEditor.setAlign(q)}E||document.execCommand("justify"+q.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var q=-window.getSelection();if(q.getRangeAt&&q.rangeCount){for(var B=[],C=0,E=q.rangeCount;C<E;++C)B.push(q.getRangeAt(C));return B}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(q){try{if(q)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var B=0,C=q.length;B<C;++B)sel.addRange(q[B])}else document.selection&&q.select&&q.select()}catch(E){}};var G=mxCellRenderer.prototype.initializeLabel;+var F=null!=C&&"vertical-"==C.substring(0,9),J=null!=B&&mxEvent.isShiftDown(B);if(J||null!=window.getSelection&&null!=window.getSelection().containsNode){var P=!0;this.graph.processElements(this.textarea,function(Y){J||F||window.getSelection().containsNode(Y,!0)?(Y.removeAttribute("align"),Y.style.textAlign=null):P=!1});(P||F)&&this.graph.cellEditor.setAlign(q)}F||document.execCommand("justify"+q.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var q=+window.getSelection();if(q.getRangeAt&&q.rangeCount){for(var B=[],C=0,F=q.rangeCount;C<F;++C)B.push(q.getRangeAt(C));return B}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(q){try{if(q)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var B=0,C=q.length;B<C;++B)sel.addRange(q[B])}else document.selection&&q.select&&q.select()}catch(F){}};var G=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(q){null!=q.text&&(q.text.replaceLinefeeds="0"!=mxUtils.getValue(q.style,"nl2Br","1"));G.apply(this,arguments)};var H=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(q,B){this.isKeepFocusEvent(q)||!mxEvent.isAltDown(q.getEvent())?H.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(q){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var M=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(q,B){q=this.graph.getStartEditingCell(q,B);M.apply(this,arguments);var C=this.graph.view.getState(q);this.textarea.className=null!=C&&1==C.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(q);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=C&&this.graph.isAutosizeTextState(C)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var q=this.graph.view.getState(this.editingCell);if(null!=q){var B=null!=q&&"0"!=mxUtils.getValue(q.style,"nl2Br","1"),C=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);ma=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<ma.length&&"\n"==ma.charAt(ma.length-1)&&(ma=ma.substring(0,-ma.length-1));ma=Graph.sanitizeHtml(B?ma.replace(/\n/g,"<br/>"):ma,!0);this.textarea.className="mxCellEditor geContentEditable";ca=mxUtils.getValue(q.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);B=mxUtils.getValue(q.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var E=mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),J=(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,P=(mxUtils.getValue(q.style,+ma.length-1));ma=Graph.sanitizeHtml(B?ma.replace(/\n/g,"<br/>"):ma,!0);this.textarea.className="mxCellEditor geContentEditable";ca=mxUtils.getValue(q.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);B=mxUtils.getValue(q.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var F=mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),J=(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,P=(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,Y=[];(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&Y.push("underline");(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&Y.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ca*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=-Math.round(ca)+"px";this.textarea.style.textDecoration=Y.join(" ");this.textarea.style.fontWeight=J?"bold":"normal";this.textarea.style.fontStyle=P?"italic":"";this.textarea.style.fontFamily=B;this.textarea.style.textAlign=E;this.textarea.style.padding="0px";this.textarea.innerHTML!=ma&&(this.textarea.innerHTML=ma,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,+Math.round(ca)+"px";this.textarea.style.textDecoration=Y.join(" ");this.textarea.style.fontWeight=J?"bold":"normal";this.textarea.style.fontStyle=P?"italic":"";this.textarea.style.fontFamily=B;this.textarea.style.textAlign=F;this.textarea.style.padding="0px";this.textarea.innerHTML!=ma&&(this.textarea.innerHTML=ma,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 ma=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(ma=mxUtils.replaceTrailingNewlines(ma,"<div><br></div>"));ma=Graph.sanitizeHtml(B?ma.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):ma,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ca=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ca*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ca)+"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!=ma&&(this.textarea.innerHTML=ma);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=C;this.resize()}};var N=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(q,B){if(null!=this.textarea)if(q=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=q){var C=q.view.scale;this.bounds=mxRectangle.fromRectangle(q);if(0==this.bounds.width&&-0==this.bounds.height){this.bounds.width=160*C;this.bounds.height=60*C;var E=null!=q.text?q.text.margin:null;null==E&&(E=mxUtils.getAlignmentAsPoint(mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(q.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=E.x*this.bounds.width;this.bounds.y+=E.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/C)+"px";this.textarea.style.height=Math.round((this.bounds.height-+0==this.bounds.height){this.bounds.width=160*C;this.bounds.height=60*C;var F=null!=q.text?q.text.margin:null;null==F&&(F=mxUtils.getAlignmentAsPoint(mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(q.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=F.x*this.bounds.width;this.bounds.y+=F.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/C)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/C)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/C)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*C);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/C)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*-C);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("+C+","+C+")")}else if(null!=q&&this.graph.isAutosizeTextState(q)){C=q.view.scale;E=q.style;var J=this.graph.getCellGeometry(this.editingCell);if(null!=J){this.bounds=mxRectangle.fromRectangle(q);this.textarea.style.left=Math.round(q.x)+"px";this.textarea.style.top=Math.round(q.y)+"px";var P=this.rotateText&&null!=this.textShape?-this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=P?"rotate("+P+"deg) ":"")+"scale("+C+","+C+")");this.textarea.style.borderWidth="0";this.textarea.style.width=Math.round(J.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(J.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==E[mxConstants.STYLE_WHITE_SPACE]&&-(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var Y=parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING,2));C=Y+parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING_TOP,0));P=Y+parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING_BOTTOM,0));var ma=Y+parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING_LEFT,0));Y+=parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(ma)+"px";this.textarea.style.paddingRight=-Math.round(Y)+"px";this.textarea.style.paddingTop=Math.round(C)+"px";this.textarea.style.paddingBottom=Math.round(P)+"px";this.textarea.style.display="flex";this.textarea.style.flexDirection="column";C=mxUtils.getValue(E,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.justifyContent=C==mxConstants.ALIGN_MIDDLE?"center":C==mxConstants.ALIGN_BOTTOM?"flex-end":"flex-start";C=this.textarea.innerText;null!=C&&0<C.length&&(J=this.graph.getAutosizeTextAvailableSpace(E,J.width,-J.height,q),null!=J&&(C=mxUtils.htmlEntities(C,!1).replace(/\n/g,"<br>"),E=this.graph.computeAutosizeTextFontSize(C,J.availW,J.availH,E[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,E[mxConstants.STYLE_FONTSTYLE],"wrap"==E[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=E+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?E*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow=-"",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",N.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(q,B){if("0"==mxUtils.getValue(q.style,"html",-"0"))return mxCellEditorGetInitialValue.apply(this,arguments);var C=this.graph.getEditingValue(q.cell,B);"1"==mxUtils.getValue(q.style,"nl2Br","1")&&(C=C.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(C,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(q,B){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(q.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};-mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(q){if("0"==mxUtils.getValue(q.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var B=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(q.style,"nl2Br","1")?(B=B.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<B.length&&("<br/>"==B.substring(B.length-5)||"<br>"==B.substring(B.length--4))&&(B=B.substring(0,B.lastIndexOf("<br"))+"<div><br/></div>")):B=B.replace(/\r\n/g,"").replace(/\n/g,"");return B};var L=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(q){this.codeViewMode&&this.toggleViewMode();L.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(q){}};var U=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(q,B){this.graph.getModel().beginUpdate();-try{U.apply(this,arguments),""==B&&this.graph.isCellDeletable(q.cell)&&0==this.graph.model.getChildCount(q.cell)&&this.graph.isTransparentState(q)&&this.graph.removeCells([q.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getBorderColor=function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BORDERCOLOR,-null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getMinimumSize=function(q){var B=this.graph.getView().scale;return new mxRectangle(0,0,null==q.text?30:q.text.size*B+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(q,B){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(B.getEvent)};mxGraphView.prototype.formatUnitText=function(q){return q?b(q,this.unit):q};mxGraphHandler.prototype.updateHint=-function(q){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var B=this.graph.view.translate,C=this.graph.view.scale;q=this.roundLength((this.bounds.x+this.currentDx)/C-B.x);B=this.roundLength((this.bounds.y+this.currentDy)/C-B.y);C=this.graph.view.unit;this.hint.innerHTML=b(q,C)+", "+b(B,C);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 X=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(q,B){X.apply(this,arguments);var C=this.graph.getCellStyle(q);if(null==C.childLayout){var E=this.graph.model.getParent(q),J=null!=E?this.graph.getCellGeometry(E):null;-if(null!=J&&(C=this.graph.getCellStyle(E),"stackLayout"==C.childLayout)){var P=parseFloat(mxUtils.getValue(C,"stackBorder",mxStackLayout.prototype.border));C="1"==mxUtils.getValue(C,"horizontalStack","1");var Y=this.graph.getActualStartSize(E);J=J.clone();C?J.height=B.height+Y.y+Y.height+2*P:J.width=B.width+Y.x+Y.width+2*P;this.graph.model.setGeometry(E,J)}}};var S=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function q(ma){C.get(ma)||-(C.put(ma,!0),J.push(ma))}for(var B=S.apply(this,arguments),C=new mxDictionary,E=this.graph.model,J=[],P=0;P<B.length;P++){var Y=B[P];this.graph.isTableCell(Y)?q(E.getParent(E.getParent(Y))):this.graph.isTableRow(Y)&&q(E.getParent(Y));q(Y)}return J};var V=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(q){return V.apply(this,arguments)&&!mxEvent.isControlDown(q.getEvent())&&!mxEvent.isShiftDown(q.getEvent())};var ha=mxVertexHandler.prototype.isGhostPreview;-mxVertexHandler.prototype.isGhostPreview=function(){return ha.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 R=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(q){var B=R.apply(this,arguments);B.stroke="#C0C0C0";B.strokewidth=1;return B};var Z=mxEdgeHandler.prototype.createParentHighlightShape;+C);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("+C+","+C+")")}else if(null!=q&&this.graph.isAutosizeTextState(q)){C=q.view.scale;F=q.style;var J=this.graph.getCellGeometry(this.editingCell);if(null!=J){this.bounds=mxRectangle.fromRectangle(q);this.textarea.style.left=Math.round(q.x)+"px";this.textarea.style.top=Math.round(q.y)+"px";var P=this.rotateText&&null!=this.textShape?+this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=P?"rotate("+P+"deg) ":"")+"scale("+C+","+C+")");this.textarea.style.borderWidth="0";this.textarea.style.width=Math.round(J.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(J.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==F[mxConstants.STYLE_WHITE_SPACE]&&+(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var Y=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING,2));C=Y+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_TOP,0));P=Y+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_BOTTOM,0));var ma=Y+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_LEFT,0));Y+=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(ma)+"px";this.textarea.style.paddingRight=+Math.round(Y)+"px";this.textarea.style.paddingTop=Math.round(C)+"px";this.textarea.style.paddingBottom=Math.round(P)+"px";this.textarea.style.display="table-cell";this.textarea.style.flexDirection="";this.textarea.style.justifyContent="";C=mxUtils.getValue(F,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.verticalAlign=C==mxConstants.ALIGN_MIDDLE?"middle":C==mxConstants.ALIGN_BOTTOM?"bottom":"top";C=this.textarea.innerText;null!=C&&0<C.length&&(J=this.graph.getAutosizeTextAvailableSpace(F,+J.width,J.height,q),null!=J&&(C=mxUtils.htmlEntities(C,!1).replace(/\n/g,"<br>"),F=this.graph.computeAutosizeTextFontSize(C,J.availW,J.availH,F[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,F[mxConstants.STYLE_FONTSTYLE],"wrap"==F[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=F+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?F*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",+this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",N.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=+function(q,B){if("0"==mxUtils.getValue(q.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var C=this.graph.getEditingValue(q.cell,B);"1"==mxUtils.getValue(q.style,"nl2Br","1")&&(C=C.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(C,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(q,B){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(q.style,"html","0")&&Graph.addLightDarkColors(this.textarea,+Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(q){if("0"==mxUtils.getValue(q.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var B=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(q.style,"nl2Br","1")?(B=B.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),+0<B.length&&("<br/>"==B.substring(B.length-5)||"<br>"==B.substring(B.length-4))&&(B=B.substring(0,B.lastIndexOf("<br"))+"<div><br/></div>")):B=B.replace(/\r\n/g,"").replace(/\n/g,"");return B};var L=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(q){this.codeViewMode&&this.toggleViewMode();L.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(q){}};var U=mxCellEditor.prototype.applyValue;+mxCellEditor.prototype.applyValue=function(q,B){this.graph.getModel().beginUpdate();try{U.apply(this,arguments),""==B&&this.graph.isCellDeletable(q.cell)&&0==this.graph.model.getChildCount(q.cell)&&this.graph.isTransparentState(q)&&this.graph.removeCells([q.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getBorderColor=+function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getMinimumSize=function(q){var B=this.graph.getView().scale;return new mxRectangle(0,0,null==q.text?30:q.text.size*B+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(q,B){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(B.getEvent)};mxGraphView.prototype.formatUnitText=+function(q){return q?b(q,this.unit):q};mxGraphHandler.prototype.updateHint=function(q){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var B=this.graph.view.translate,C=this.graph.view.scale;q=this.roundLength((this.bounds.x+this.currentDx)/C-B.x);B=this.roundLength((this.bounds.y+this.currentDy)/C-B.y);C=this.graph.view.unit;this.hint.innerHTML=b(q,C)+", "+b(B,C);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 X=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(q,B){X.apply(this,arguments);var C=this.graph.getCellStyle(q);if(null==C.childLayout){var F=this.graph.model.getParent(q),+J=null!=F?this.graph.getCellGeometry(F):null;if(null!=J&&(C=this.graph.getCellStyle(F),"stackLayout"==C.childLayout)){var P=parseFloat(mxUtils.getValue(C,"stackBorder",mxStackLayout.prototype.border));C="1"==mxUtils.getValue(C,"horizontalStack","1");var Y=this.graph.getActualStartSize(F);J=J.clone();C?J.height=B.height+Y.y+Y.height+2*P:J.width=B.width+Y.x+Y.width+2*P;this.graph.model.setGeometry(F,J)}}};var S=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=+function(){function q(ma){C.get(ma)||(C.put(ma,!0),J.push(ma))}for(var B=S.apply(this,arguments),C=new mxDictionary,F=this.graph.model,J=[],P=0;P<B.length;P++){var Y=B[P];this.graph.isTableCell(Y)?q(F.getParent(F.getParent(Y))):this.graph.isTableRow(Y)&&q(F.getParent(Y));q(Y)}return J};var V=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(q){return V.apply(this,arguments)&&!mxEvent.isControlDown(q.getEvent())&&!mxEvent.isShiftDown(q.getEvent())};var ha=+mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return ha.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 R=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(q){var B=R.apply(this,arguments);B.stroke="#C0C0C0";B.strokewidth=1;return B};var Z=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(q){var B=Z.apply(this,arguments);B.stroke="#C0C0C0";B.strokewidth=1;return B};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var q=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+q.x/2,this.bounds.y+this.rotationHandleVSpacing-q.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(q,B){return this.graph.isRecursiveVertexResize(q)&&!mxEvent.isAltDown(B.getEvent())};mxVertexHandler.prototype.isCenteredEvent=function(q,B){return mxEvent.isControlDown(B.getEvent())||mxEvent.isMetaDown(B.getEvent())};var W=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return W.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.isConnectHandleVisible=function(){return Editor.showConnectHandle&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var q=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+q.x/2,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+q.y/2)};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 ba=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return ba.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var K=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(q){return q.tableHandle||K.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var q=0;this.graph.isTableRow(this.state.cell)?q=1:this.graph.isTableCell(this.state.cell)&&(q=2);return q};var T=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return T.apply(this,arguments).grow(-this.getSelectionBorderInset())};-var aa=null,ka=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==aa&&(aa=mxCellRenderer.defaultShapes.tableLine);var q=ka.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var B=function(Ra,Sa,Aa){for(var cb=[],Wa=0;Wa<Ra.length;Wa++){var Qa=Ra[Wa];cb.push(null==Qa?null:new mxPoint((ca+Qa.x+Sa)*P,(na+Qa.y+Aa)*P))}return cb},C=this,E=this.graph,J=E.model,P=E.view.scale,Y=this.state,ma=-this.selectionBorder,ca=this.state.origin.x+E.view.translate.x,na=this.state.origin.y+E.view.translate.y;null==q&&(q=[]);var ta=E.view.getCellStates(J.getChildCells(this.state.cell,!0));if(0<ta.length){var Fa=J.getChildCells(ta[0].cell,!0),Da=E.getTableLines(this.state.cell,!1,!0),Na=E.getTableLines(this.state.cell,!0,!1);for(J=0;J<ta.length;J++)mxUtils.bind(this,function(Ra){var Sa=ta[Ra],Aa=null;if(E.isCellMovable(Sa.cell)){Aa=Ra<ta.length-1?ta[Ra+1]:null;Aa=null!=Aa?E.getCellGeometry(Aa.cell):+var aa=null,ka=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==aa&&(aa=mxCellRenderer.defaultShapes.tableLine);var q=ka.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var B=function(Ra,Sa,Aa){for(var cb=[],Wa=0;Wa<Ra.length;Wa++){var Qa=Ra[Wa];cb.push(null==Qa?null:new mxPoint((ca+Qa.x+Sa)*P,(na+Qa.y+Aa)*P))}return cb},C=this,F=this.graph,J=F.model,P=F.view.scale,Y=this.state,ma=+this.selectionBorder,ca=this.state.origin.x+F.view.translate.x,na=this.state.origin.y+F.view.translate.y;null==q&&(q=[]);var ta=F.view.getCellStates(J.getChildCells(this.state.cell,!0));if(0<ta.length){var Fa=J.getChildCells(ta[0].cell,!0),Da=F.getTableLines(this.state.cell,!1,!0),Na=F.getTableLines(this.state.cell,!0,!1);for(J=0;J<ta.length;J++)mxUtils.bind(this,function(Ra){var Sa=ta[Ra],Aa=null;if(F.isCellMovable(Sa.cell)){Aa=Ra<ta.length-1?ta[Ra+1]:null;Aa=null!=Aa?F.getCellGeometry(Aa.cell):null;var cb=null!=Aa&&null!=Aa.alternateBounds?Aa.alternateBounds:Aa;Aa=null!=Na[Ra]?new aa(Na[Ra],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Aa.isDashed=ma.isDashed;Aa.svgStrokeTolerance++;Aa=new mxHandle(Sa,"row-resize",null,Aa);Aa.tableHandle=!0;var Wa=0;Aa.shape.node.parentNode.insertBefore(Aa.shape.node,Aa.shape.node.parentNode.firstChild);Aa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Wa?mxConstants.NONE:ma.stroke;if(this.shape.constructor==aa)this.shape.line=-B(Na[Ra],0,Wa),this.shape.updateBoundsFromLine();else{var Ya=E.getActualStartSize(Y.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+Wa*P;this.shape.bounds.x=Y.x+(Ra==ta.length-1?0:Ya.x*P);this.shape.bounds.width=Y.width-(Ra==ta.length-1?0:Ya.width+Ya.x+P)}this.shape.redraw()}};var Qa=!1;Aa.setPosition=function(Ya,bb,nb){Wa=Math.max(Graph.minTableRowHeight-Ya.height,bb.y-Ya.y-Ya.height);Qa=mxEvent.isShiftDown(nb.getEvent());null!=cb&&Qa&&(Wa=Math.min(Wa,cb.height--Graph.minTableRowHeight))};Aa.execute=function(Ya){if(0!=Wa)E.setTableRowHeight(this.state.cell,Wa,!Qa);else if(!C.blockDelayedSelection){var bb=E.getCellAt(Ya.getGraphX(),Ya.getGraphY())||Y.cell;E.graphHandler.selectCellForEvent(bb,Ya)}Wa=0};Aa.reset=function(){Wa=0}}q.push(Aa)})(J);for(J=0;J<Fa.length;J++)mxUtils.bind(this,function(Ra){var Sa=E.view.getState(Fa[Ra]),Aa=E.getCellGeometry(Fa[Ra]),cb=null!=Aa.alternateBounds?Aa.alternateBounds:Aa;null==Sa&&(Sa=new mxCellState(E.view,Fa[Ra],E.getCellStyle(Fa[Ra])),-Sa.x=Y.x+Aa.x*P,Sa.y=Y.y+Aa.y*P,Sa.width=cb.width*P,Sa.height=cb.height*P,Sa.updateCachedBounds());Aa=Ra<Fa.length-1?Fa[Ra+1]:null;Aa=null!=Aa?E.getCellGeometry(Aa):null;var Wa=null!=Aa&&null!=Aa.alternateBounds?Aa.alternateBounds:Aa;Aa=null!=Da[Ra]?new aa(Da[Ra],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Aa.isDashed=ma.isDashed;Aa.svgStrokeTolerance++;Sa=new mxHandle(Sa,"col-resize",null,Aa);Sa.tableHandle=!0;var Qa=0;Sa.shape.node.parentNode.insertBefore(Sa.shape.node,-Sa.shape.node.parentNode.firstChild);Sa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Qa?mxConstants.NONE:ma.stroke;if(this.shape.constructor==aa)this.shape.line=B(Da[Ra],Qa,0),this.shape.updateBoundsFromLine();else{var bb=E.getActualStartSize(Y.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(cb.width+Qa)*P;this.shape.bounds.y=Y.y+(Ra==Fa.length-1?0:bb.y*P);this.shape.bounds.height=Y.height-(Ra==Fa.length-1?0:(bb.height+bb.y)*P)}this.shape.redraw()}};var Ya=!1;Sa.setPosition=-function(bb,nb,sb){Qa=Math.max(Graph.minTableColumnWidth-cb.width,nb.x-bb.x-cb.width);Ya=mxEvent.isShiftDown(sb.getEvent());null==Wa||Ya||(Qa=Math.min(Qa,Wa.width-Graph.minTableColumnWidth))};Sa.execute=function(bb){if(0!=Qa)E.setTableColumnWidth(this.state.cell,Qa,Ya);else if(!C.blockDelayedSelection){var nb=E.getCellAt(bb.getGraphX(),bb.getGraphY())||Y.cell;E.graphHandler.selectCellForEvent(nb,bb)}Qa=0};Sa.positionChanged=function(){};Sa.reset=function(){Qa=0};q.push(Sa)})(J)}}return null!=q?q.reverse():+B(Na[Ra],0,Wa),this.shape.updateBoundsFromLine();else{var Ya=F.getActualStartSize(Y.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+Wa*P;this.shape.bounds.x=Y.x+(Ra==ta.length-1?0:Ya.x*P);this.shape.bounds.width=Y.width-(Ra==ta.length-1?0:Ya.width+Ya.x+P)}this.shape.redraw()}};var Qa=!1;Aa.setPosition=function(Ya,bb,nb){Wa=Math.max(Graph.minTableRowHeight-Ya.height,bb.y-Ya.y-Ya.height);Qa=mxEvent.isShiftDown(nb.getEvent());null!=cb&&Qa&&(Wa=Math.min(Wa,cb.height-+Graph.minTableRowHeight))};Aa.execute=function(Ya){if(0!=Wa)F.setTableRowHeight(this.state.cell,Wa,!Qa);else if(!C.blockDelayedSelection){var bb=F.getCellAt(Ya.getGraphX(),Ya.getGraphY())||Y.cell;F.graphHandler.selectCellForEvent(bb,Ya)}Wa=0};Aa.reset=function(){Wa=0}}q.push(Aa)})(J);for(J=0;J<Fa.length;J++)mxUtils.bind(this,function(Ra){var Sa=F.view.getState(Fa[Ra]),Aa=F.getCellGeometry(Fa[Ra]),cb=null!=Aa.alternateBounds?Aa.alternateBounds:Aa;null==Sa&&(Sa=new mxCellState(F.view,Fa[Ra],F.getCellStyle(Fa[Ra])),+Sa.x=Y.x+Aa.x*P,Sa.y=Y.y+Aa.y*P,Sa.width=cb.width*P,Sa.height=cb.height*P,Sa.updateCachedBounds());Aa=Ra<Fa.length-1?Fa[Ra+1]:null;Aa=null!=Aa?F.getCellGeometry(Aa):null;var Wa=null!=Aa&&null!=Aa.alternateBounds?Aa.alternateBounds:Aa;Aa=null!=Da[Ra]?new aa(Da[Ra],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Aa.isDashed=ma.isDashed;Aa.svgStrokeTolerance++;Sa=new mxHandle(Sa,"col-resize",null,Aa);Sa.tableHandle=!0;var Qa=0;Sa.shape.node.parentNode.insertBefore(Sa.shape.node,+Sa.shape.node.parentNode.firstChild);Sa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Qa?mxConstants.NONE:ma.stroke;if(this.shape.constructor==aa)this.shape.line=B(Da[Ra],Qa,0),this.shape.updateBoundsFromLine();else{var bb=F.getActualStartSize(Y.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(cb.width+Qa)*P;this.shape.bounds.y=Y.y+(Ra==Fa.length-1?0:bb.y*P);this.shape.bounds.height=Y.height-(Ra==Fa.length-1?0:(bb.height+bb.y)*P)}this.shape.redraw()}};var Ya=!1;Sa.setPosition=+function(bb,nb,sb){Qa=Math.max(Graph.minTableColumnWidth-cb.width,nb.x-bb.x-cb.width);Ya=mxEvent.isShiftDown(sb.getEvent());null==Wa||Ya||(Qa=Math.min(Qa,Wa.width-Graph.minTableColumnWidth))};Sa.execute=function(bb){if(0!=Qa)F.setTableColumnWidth(this.state.cell,Qa,Ya);else if(!C.blockDelayedSelection){var nb=F.getCellAt(bb.getGraphX(),bb.getGraphY())||Y.cell;F.graphHandler.selectCellForEvent(nb,bb)}Qa=0};Sa.positionChanged=function(){};Sa.reset=function(){Qa=0};q.push(Sa)})(J)}}return null!=q?q.reverse():null};var oa=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(q){oa.apply(this,arguments);if(null!=this.moveHandles)for(var B=0;B<this.moveHandles.length;B++)null!=this.moveHandles[B]&&(this.moveHandles[B].node.style.visibility=q?"":"hidden");if(null!=this.cornerHandles)for(B=0;B<this.cornerHandles.length;B++)this.cornerHandles[B].node.style.visibility=q?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var q=this.isMoveHandlesVisible();q&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():q||null==this.moveHandles||this.destroyMoveHandles();if(q&&null==this.moveHandles){for(q=0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&this.moveHandles[q].parentNode.removeChild(this.moveHandles[q]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var q=-this.graph,B=q.model,C=[],E=0;E<B.getChildCount(this.state.cell);E++)mxUtils.bind(this,function(J){if(null!=J&&B.isVertex(J.cell)&&q.isCellMovable(J.cell)){var P=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);P=new mxImageShape(P,this.rowHandleImage.src);P.rowState=J;P.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;P.init(this.graph.getView().getOverlayPane());P.node.style.cursor="move";mxEvent.addGestureListeners(P.node,+this.graph,B=q.model,C=[],F=0;F<B.getChildCount(this.state.cell);F++)mxUtils.bind(this,function(J){if(null!=J&&B.isVertex(J.cell)&&q.isCellMovable(J.cell)){var P=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);P=new mxImageShape(P,this.rowHandleImage.src);P.rowState=J;P.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;P.init(this.graph.getView().getOverlayPane());P.node.style.cursor="move";mxEvent.addGestureListeners(P.node,mxUtils.bind(this,function(Y){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(Y)&&this.graph.isCellSelected(J.cell)||this.graph.selectCellForEvent(J.cell,Y);mxEvent.isPopupTrigger(Y)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(Y),mxEvent.getClientY(Y),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(Y),this.graph.isMouseDown=!0);mxEvent.consume(Y)}),null,mxUtils.bind(this,-function(Y){mxEvent.isPopupTrigger(Y)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(Y),mxEvent.getClientY(Y),J.cell,Y),mxEvent.consume(Y))}));C.push(P)}else C.push(null)})(this.graph.view.getState(B.getChildAt(this.state.cell,E)));return C};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var q=0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&this.moveHandles[q].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=+function(Y){mxEvent.isPopupTrigger(Y)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(Y),mxEvent.getClientY(Y),J.cell,Y),mxEvent.consume(Y))}));C.push(P)}else C.push(null)})(this.graph.view.getState(B.getChildAt(this.state.cell,F)));return C};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var q=0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&this.moveHandles[q].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var q=0;q<this.cornerHandles.length;q++)null!=this.cornerHandles[q]&&null!=this.cornerHandles[q].node&&null!=this.cornerHandles[q].node.parentNode&&this.cornerHandles[q].node.parentNode.removeChild(this.cornerHandles[q].node);this.cornerHandles=null}};var pa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){pa.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 q=0;4>q;q++){var B=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);B.dialect=mxConstants.DIALECT_SVG;B.init(this.graph.view.getOverlayPane());this.cornerHandles.push(B)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();q=this.graph.getLinkForCell(this.state.cell);B=this.graph.getLinksForState(this.state);this.updateLinkHint(q,B)};var da=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var q=new mxPoint(0,0),B=this.tolerance,C=this.state.style.shape;null==mxCellRenderer.defaultShapes[C]&&mxStencilRegistry.getStencil(C);C=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==-this.state.cell;if(!C&&null!=this.customHandles)for(var E=0;E<this.customHandles.length;E++)if(null!=this.customHandles[E]&&null!=this.customHandles[E].shape&&null!=this.customHandles[E].shape.bounds){var J=this.customHandles[E].shape.bounds,P=J.getCenterX(),Y=J.getCenterY();if(Math.abs(this.state.x-P)<J.width/2||Math.abs(this.state.y-Y)<J.height/2||Math.abs(this.state.x+this.state.width-P)<J.width/2||Math.abs(this.state.y+this.state.height-Y)<J.height/2){C=!0;break}}C&&null!=this.sizers&&0<this.sizers.length&&+this.state.cell;if(!C&&null!=this.customHandles)for(var F=0;F<this.customHandles.length;F++)if(null!=this.customHandles[F]&&null!=this.customHandles[F].shape&&null!=this.customHandles[F].shape.bounds){var J=this.customHandles[F].shape.bounds,P=J.getCenterX(),Y=J.getCenterY();if(Math.abs(this.state.x-P)<J.width/2||Math.abs(this.state.y-Y)<J.height/2||Math.abs(this.state.x+this.state.width-P)<J.width/2||Math.abs(this.state.y+this.state.height-Y)<J.height/2){C=!0;break}}C&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(B/=2,this.graph.isTable(this.state.cell)&&(B+=7),q.x=this.sizers[0].bounds.width+B,q.y=this.sizers[0].bounds.height+B):q=da.apply(this,arguments);return q};mxVertexHandler.prototype.updateHint=function(q){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{q=this.state.view.scale;var B=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/q),B)+" x "+b(this.roundLength(this.bounds.height/q),B)}q=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==q&&(q=this.bounds);this.hint.style.left=q.x+Math.round((q.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=q.y+q.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 ia=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){ia.apply(this,arguments);var q=this.graph.getLinkForCell(this.state.cell),B=this.graph.getLinksForState(this.state);this.updateLinkHint(q,B)};var fa=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(q,B){fa.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 O=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(q,B){O.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(q,B,C){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var E=this.graph.view.translate,J=this.graph.view.scale,P=this.roundLength(B.x/J-E.x);E=this.roundLength(B.y/-J-E.y);var Y=this.graph.view.unit;this.hint.innerHTML=b(P,Y)+", "+b(E,Y);this.hint.style.visibility="visible";null!=C&&(C.view.updateEdgeBounds(C),this.hint.innerHTML+=" ("+(Y==mxConstants.POINTS?Math.round(C.length/J):b(C.length/J,Y))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(C=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*C.x)+"%, "+Math.round(100*+(this.linkHint.style.display="none")};var O=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(q,B){O.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(q,B,C){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var F=this.graph.view.translate,J=this.graph.view.scale,P=this.roundLength(B.x/J-F.x);F=this.roundLength(B.y/+J-F.y);var Y=this.graph.view.unit;this.hint.innerHTML=b(P,Y)+", "+b(F,Y);this.hint.style.visibility="visible";null!=C&&(C.view.updateEdgeBounds(C),this.hint.innerHTML+=" ("+(Y==mxConstants.POINTS?Math.round(C.length/J):b(C.length/J,Y))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(C=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*C.x)+"%, "+Math.round(100*C.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(q.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(q.getGraphY(),B.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=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');@@ -3064,33 +3069,33 @@ mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSiz!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(q){return!mxEvent.isShiftDown(q.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(q){return!mxEvent.isShiftDown(q.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(q){return mxEvent.isMouseEvent(q.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(q){var B=q.getEvent();return null==q.getState()&&!mxEvent.isMouseEvent(B)||mxEvent.isPopupTrigger(B)&&(null==q.getState()||mxEvent.isControlDown(B)||mxEvent.isShiftDown(B))}}else mxPanningHandler.prototype.isPanningTrigger=function(q){var B=q.getEvent();return mxEvent.isLeftMouseButton(B)&&(this.useLeftButtonForPanning&&null==q.getState()||mxEvent.isControlDown(B)&&!mxEvent.isShiftDown(B))||this.usePopupTrigger&&mxEvent.isPopupTrigger(B)};mxRubberband.prototype.isSpaceEvent=function(q){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(q.getEvent())||-mxEvent.isMetaDown(q.getEvent()))&&mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(q,B){if(this.cancelled)this.cancelled=!1,B.consume();else{var C=null!=this.div&&"none"!=this.div.style.display,E=null,J=null,P=q=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(E=this.first.x,J=this.first.y,q=(this.currentX--E)/this.graph.view.scale,P=(this.currentY-J)/this.graph.view.scale,mxEvent.isAltDown(B.getEvent())||(q=this.graph.snap(q),P=this.graph.snap(P),this.graph.isGridEnabled()||(Math.abs(q)<this.graph.tolerance&&(q=0),Math.abs(P)<this.graph.tolerance&&(P=0))));this.reset();if(C){if(this.isSpaceEvent(B)){this.graph.model.beginUpdate();try{var Y=this.graph.getCellsBeyond(E,J,this.graph.getDefaultParent(),!0,!0);for(C=0;C<Y.length;C++)if(this.graph.isCellMovable(Y[C])){var ma=this.graph.view.getState(Y[C]),+mxEvent.isMetaDown(q.getEvent()))&&mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(q,B){if(this.cancelled)this.cancelled=!1,B.consume();else{var C=null!=this.div&&"none"!=this.div.style.display,F=null,J=null,P=q=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(F=this.first.x,J=this.first.y,q=(this.currentX-+F)/this.graph.view.scale,P=(this.currentY-J)/this.graph.view.scale,mxEvent.isAltDown(B.getEvent())||(q=this.graph.snap(q),P=this.graph.snap(P),this.graph.isGridEnabled()||(Math.abs(q)<this.graph.tolerance&&(q=0),Math.abs(P)<this.graph.tolerance&&(P=0))));this.reset();if(C){if(this.isSpaceEvent(B)){this.graph.model.beginUpdate();try{var Y=this.graph.getCellsBeyond(F,J,this.graph.getDefaultParent(),!0,!0);for(C=0;C<Y.length;C++)if(this.graph.isCellMovable(Y[C])){var ma=this.graph.view.getState(Y[C]),ca=this.graph.getCellGeometry(Y[C]);null!=ma&&null!=ca&&(ca=ca.clone(),ca.translate(q,P),this.graph.model.setGeometry(Y[C],ca))}}finally{this.graph.model.endUpdate()}}else Y=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(Y,B.getEvent());B.consume()}}};mxRubberband.prototype.mouseMove=function(q,B){if(!B.isConsumed()&&null!=this.first){var C=mxUtils.getScrollOrigin(this.graph.container);q=mxUtils.getOffset(this.graph.container);C.x-=q.x;C.y-=q.y;q=B.getX()+C.x;C=B.getY()+-C.y;var E=this.first.x-q,J=this.first.y-C,P=this.graph.tolerance;if(null!=this.div||Math.abs(E)>P||Math.abs(J)>P)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(q,C),this.isSpaceEvent(B)?(q=this.x+this.width,C=this.y+this.height,E=this.graph.view.scale,mxEvent.isAltDown(B.getEvent())||(this.width=this.graph.snap(this.width/E)*E,this.height=this.graph.snap(this.height/E)*E,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&+C.y;var F=this.first.x-q,J=this.first.y-C,P=this.graph.tolerance;if(null!=this.div||Math.abs(F)>P||Math.abs(J)>P)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(q,C),this.isSpaceEvent(B)?(q=this.x+this.width,C=this.y+this.height,F=this.graph.view.scale,mxEvent.isAltDown(B.getEvent())||(this.width=this.graph.snap(this.width/F)*F,this.height=this.graph.snap(this.height/F)*F,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=q-this.width),this.y<this.first.y&&(this.y=C-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),B.consume()}};var qa=mxRubberband.prototype.reset;-mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);qa.apply(this,arguments)};var ja=(new Date).getTime(),ua=0,ya=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(q,B,C,E){ya.apply(this,arguments);C!=this.currentTerminalState?(ja=(new Date).getTime(),ua=0):ua=(new Date).getTime()-ja;this.currentTerminalState=C};var Ma=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=-function(q){return mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())?!1:null!=this.currentTerminalState&&q.getState()==this.currentTerminalState&&2E3<ua||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&Ma.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(q,B,C){B=null!=q&&0==q;var E=this.state.getVisibleTerminalState(B);q=null!=q&&null!=this.state.absolutePoints&&(0==q||q>=this.state.absolutePoints.length--1||this.constructor==mxElbowEdgeHandler&&2==q)?this.graph.getConnectionConstraint(this.state,E,B):null;C=null!=(null!=q?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(B),q):null)?C?this.endFixedHandleImage:this.fixedHandleImage:null!=q&&null!=E?C?this.endTerminalHandleImage:this.terminalHandleImage:C?this.endHandleImage:this.handleImage;if(null!=C)return C=new mxImageShape(new mxRectangle(0,0,C.width,C.height),C.src),C.preserveImageAspect=!1,C;C=mxConstants.HANDLE_SIZE;this.preferHtml&&---C;return new mxRectangleShape(new mxRectangle(0,0,C,C),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var Oa=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(q,B,C,E){E=B==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:B==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle:B==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:E;return Oa.apply(this,arguments)};var Ka=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=+mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);qa.apply(this,arguments)};var ja=(new Date).getTime(),ua=0,ya=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(q,B,C,F){ya.apply(this,arguments);C!=this.currentTerminalState?(ja=(new Date).getTime(),ua=0):ua=(new Date).getTime()-ja;this.currentTerminalState=C};var Ma=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=+function(q){return mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())?!1:null!=this.currentTerminalState&&q.getState()==this.currentTerminalState&&2E3<ua||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&Ma.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(q,B,C){B=null!=q&&0==q;var F=this.state.getVisibleTerminalState(B);q=null!=q&&null!=this.state.absolutePoints&&(0==q||q>=this.state.absolutePoints.length-+1||this.constructor==mxElbowEdgeHandler&&2==q)?this.graph.getConnectionConstraint(this.state,F,B):null;C=null!=(null!=q?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(B),q):null)?C?this.endFixedHandleImage:this.fixedHandleImage:null!=q&&null!=F?C?this.endTerminalHandleImage:this.terminalHandleImage:C?this.endHandleImage:this.handleImage;if(null!=C)return C=new mxImageShape(new mxRectangle(0,0,C.width,C.height),C.src),C.preserveImageAspect=!1,C;C=mxConstants.HANDLE_SIZE;this.preferHtml&&+--C;return new mxRectangleShape(new mxRectangle(0,0,C,C),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var Oa=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(q,B,C,F){F=B==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:B==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle:B==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:F;return Oa.apply(this,arguments)};var Ka=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=function(){var q=Ka.apply(this,arguments);null==this.connectShape&&this.isConnectHandleVisible()&&(this.connectShape=this.createSizer("copy",mxEvent.CONNECT_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),q.push(this.connectShape));return q};var La=mxVertexHandler.prototype.destroySizers;mxVertexHandler.prototype.destroySizers=function(){La.apply(this,arguments);this.connectShape=null};var wa=mxVertexHandler.prototype.getHandleForEvent;mxVertexHandler.prototype.getHandleForEvent=function(q){if(null!=this.connectShape&&null!=this.connectShape.node&&"hidden"!=this.connectShape.node.style.visibility){var B=mxEvent.isMouseEvent(q.getEvent())?1:this.tolerance;B=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<B)?new mxRectangle(q.getGraphX()-B,q.getGraphY()-B,2*B,2*B):null;if(q.isSource(this.connectShape)||null!=B&&this.connectShape.intersectsRectangle(B))return mxEvent.CONNECT_HANDLE}return wa.apply(this,arguments)};var Ia=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(q,-B){if(!B.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(B)==mxEvent.CONNECT_HANDLE){var C=B.getGraphX(),E=B.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,C,E);this.graph.isMouseTrigger=mxEvent.isMouseEvent(B.getEvent());this.graph.isMouseDown=!0;C=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=C&&C.setHandlesVisible(!1);-B.consume()}else Ia.apply(this,arguments)};var $a=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(q){if(null!=q&&1==q.length){var B=this.graph.getModel(),C=B.getParent(q[0]),E=this.graph.getCellGeometry(q[0]);if(B.isEdge(C)&&null!=E&&E.relative&&(B=this.graph.view.getState(q[0]),null!=B&&2>B.width&&2>B.height&&null!=B.text&&null!=B.text.boundingBox))return mxRectangle.fromRectangle(B.text.boundingBox)}return $a.apply(this,arguments)};var ab=mxGraphHandler.prototype.getGuideStates;-mxGraphHandler.prototype.getGuideStates=function(){for(var q=ab.apply(this,arguments),B=[],C=0;C<q.length;C++)"1"!=mxUtils.getValue(q[C].style,"part","0")&&B.push(q[C]);return B};var eb=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(q){var B=this.graph.getModel(),C=B.getParent(q.cell),E=this.graph.getCellGeometry(q.cell);return B.isEdge(C)&&null!=E&&E.relative&&2>q.width&&2>q.height&&null!=q.text&&null!=q.text.boundingBox?(B=q.text.unrotatedBoundingBox||-q.text.boundingBox,new mxRectangle(Math.round(B.x),Math.round(B.y),Math.round(B.width),Math.round(B.height))):eb.apply(this,arguments)};var ib=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(q,B){var C=this.graph.getModel(),E=C.getParent(this.state.cell),J=this.graph.getCellGeometry(this.state.cell),P=this.getHandleForEvent(B);(P==mxEvent.ROTATION_HANDLE||P==mxEvent.CONNECT_HANDLE||!C.isEdge(E)||null==J||!J.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&+B){if(!B.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(B)==mxEvent.CONNECT_HANDLE){var C=B.getGraphX(),F=B.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,C,F);this.graph.isMouseTrigger=mxEvent.isMouseEvent(B.getEvent());this.graph.isMouseDown=!0;C=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=C&&C.setHandlesVisible(!1);+B.consume()}else Ia.apply(this,arguments)};var $a=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(q){if(null!=q&&1==q.length){var B=this.graph.getModel(),C=B.getParent(q[0]),F=this.graph.getCellGeometry(q[0]);if(B.isEdge(C)&&null!=F&&F.relative&&(B=this.graph.view.getState(q[0]),null!=B&&2>B.width&&2>B.height&&null!=B.text&&null!=B.text.boundingBox))return mxRectangle.fromRectangle(B.text.boundingBox)}return $a.apply(this,arguments)};var ab=mxGraphHandler.prototype.getGuideStates;+mxGraphHandler.prototype.getGuideStates=function(){for(var q=ab.apply(this,arguments),B=[],C=0;C<q.length;C++)"1"!=mxUtils.getValue(q[C].style,"part","0")&&B.push(q[C]);return B};var eb=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(q){var B=this.graph.getModel(),C=B.getParent(q.cell),F=this.graph.getCellGeometry(q.cell);return B.isEdge(C)&&null!=F&&F.relative&&2>q.width&&2>q.height&&null!=q.text&&null!=q.text.boundingBox?(B=q.text.unrotatedBoundingBox||+q.text.boundingBox,new mxRectangle(Math.round(B.x),Math.round(B.y),Math.round(B.width),Math.round(B.height))):eb.apply(this,arguments)};var ib=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(q,B){var C=this.graph.getModel(),F=C.getParent(this.state.cell),J=this.graph.getCellGeometry(this.state.cell),P=this.getHandleForEvent(B);(P==mxEvent.ROTATION_HANDLE||P==mxEvent.CONNECT_HANDLE||!C.isEdge(F)||null==J||!J.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&ib.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var q=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),B=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&q==mxConstants.NONE&&B==mxConstants.NONE?(q=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,q,[this.state.cell])):-this.state.view.graph.turnShapes([this.state.cell])};var rb=mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(q){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var B=this.graph.view.scale,C=this.state.style,E=this.roundLength(this.bounds.width/B),J=this.roundLength(this.bounds.height/B);B=this.graph.cellRenderer.getLabelValue(this.state);if(null!=B&&0<B.length&&(E=this.graph.getAutosizeTextAvailableSpace(C,E,J,this.state),null!=E)){this.graph.isHtmlLabel(this.state.cell)||-(B=mxUtils.htmlEntities(B,!1));B=B.replace(/\n/g,"<br>");E=this.graph.computeAutosizeTextFontSize(B,E.availW,E.availH,C[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,C[mxConstants.STYLE_FONTSTYLE],"wrap"==C[mxConstants.STYLE_WHITE_SPACE]);B=C[mxConstants.STYLE_FONTSIZE];C[mxConstants.STYLE_FONTSIZE]=E;rb.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]=B;return}}rb.apply(this,arguments)};var jb=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=+this.state.view.graph.turnShapes([this.state.cell])};var rb=mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(q){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var B=this.graph.view.scale,C=this.state.style,F=this.roundLength(this.bounds.width/B),J=this.roundLength(this.bounds.height/B);B=this.graph.cellRenderer.getLabelValue(this.state);if(null!=B&&0<B.length&&(F=this.graph.getAutosizeTextAvailableSpace(C,F,J,this.state),null!=F)){this.graph.isHtmlLabel(this.state.cell)||+(B=mxUtils.htmlEntities(B,!1));B=B.replace(/\n/g,"<br>");F=this.graph.computeAutosizeTextFontSize(B,F.availW,F.availH,C[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,C[mxConstants.STYLE_FONTSTYLE],"wrap"==C[mxConstants.STYLE_WHITE_SPACE]);B=C[mxConstants.STYLE_FONTSIZE];C[mxConstants.STYLE_FONTSIZE]=F;rb.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]=B;return}}rb.apply(this,arguments)};var jb=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(q,B){jb.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var db=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(q,B){db.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(q,B){try{if(null==q&&(null==B||0==B.length))null!=-this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=q||null!=B&&0<B.length){var C=document.createElement("img");C.className="geAdaptiveAsset";C.setAttribute("src",Editor.editImage);C.setAttribute("title",mxResources.get("editLink"));C.setAttribute("width","14");C.setAttribute("height","14");C.style.paddingLeft="8px";C.style.marginLeft="auto";C.style.marginBottom="-1px";C.style.cursor="pointer";var E=C.cloneNode(!0);E.setAttribute("src",Editor.trashImage);-E.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));E.style.paddingLeft="4px";E.style.marginLeft="0";null==this.linkHint&&(this.linkHint=a(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));+this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=q||null!=B&&0<B.length){var C=document.createElement("img");C.className="geAdaptiveAsset";C.setAttribute("src",Editor.editImage);C.setAttribute("title",mxResources.get("editLink"));C.setAttribute("width","14");C.setAttribute("height","14");C.style.paddingLeft="8px";C.style.marginLeft="auto";C.style.marginBottom="-1px";C.style.cursor="pointer";var F=C.cloneNode(!0);F.setAttribute("src",Editor.trashImage);+F.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));F.style.paddingLeft="4px";F.style.marginLeft="0";null==this.linkHint&&(this.linkHint=a(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=q){var J=document.createElement("div");J.style.display="flex";J.style.alignItems="center";J.appendChild(this.graph.createLinkForHint(q,null,this.state.cell));this.linkHint.appendChild(J);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var P=C.cloneNode(!0);J.appendChild(P);mxEvent.addListener(P,"click",mxUtils.bind(this,function(ma){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();-mxEvent.consume(ma)}));var Y=E.cloneNode(!0);J.appendChild(Y);mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ma){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(ma)}))}}if(null!=B)for(J=0;J<B.length;J++)mxUtils.bind(this,function(ma,ca){var na=document.createElement("div");na.style.display="flex";na.style.alignItems="center";na.style.marginTop=null!=q||0<ca?"6px":"0px";na.appendChild(this.graph.createLinkForHint(ma.getAttribute("href"),mxUtils.getTextContent(ma),this.state.cell));+mxEvent.consume(ma)}));var Y=F.cloneNode(!0);J.appendChild(Y);mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ma){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(ma)}))}}if(null!=B)for(J=0;J<B.length;J++)mxUtils.bind(this,function(ma,ca){var na=document.createElement("div");na.style.display="flex";na.style.alignItems="center";na.style.marginTop=null!=q||0<ca?"6px":"0px";na.appendChild(this.graph.createLinkForHint(ma.getAttribute("href"),mxUtils.getTextContent(ma),this.state.cell));var ta=C.cloneNode(!0);na.appendChild(ta);var Fa=mxUtils.bind(this,function(Da){var Na=document.createElement("div");Na.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var Ra=Na.getElementsByTagName("a")[ca];if(null!=Ra){if(null==Da||""==Da){for(Da=Ra.cloneNode(!0).firstChild;null!=Da;)Ra.parentNode.insertBefore(Da.cloneNode(!0),Ra),Da=Da.nextSibling;Ra.parentNode.removeChild(Ra)}else Ra.setAttribute("href",Da);this.graph.labelChanged(this.state.cell,Na.innerHTML)}});mxEvent.addListener(ta,-"click",mxUtils.bind(this,function(Da){this.graph.showLinkDialog(ma.getAttribute("href")||"",mxResources.get("ok"),Fa);mxEvent.consume(Da)}));ta=E.cloneNode(!0);na.appendChild(ta);mxEvent.addListener(ta,"click",mxUtils.bind(this,function(Da){Fa();mxEvent.consume(Da)}));this.linkHint.appendChild(na)})(B[J],J)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(ma){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var kb=mxEdgeHandler.prototype.createConstraintHandler;+"click",mxUtils.bind(this,function(Da){this.graph.showLinkDialog(ma.getAttribute("href")||"",mxResources.get("ok"),Fa);mxEvent.consume(Da)}));ta=F.cloneNode(!0);na.appendChild(ta);mxEvent.addListener(ta,"click",mxUtils.bind(this,function(Da){Fa();mxEvent.consume(Da)}));this.linkHint.appendChild(na)})(B[J],J)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(ma){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var kb=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var q=kb.apply(this,arguments);q.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return q};var hb=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){hb.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var la=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var q=0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&(this.moveHandles[q].bounds.x=Math.round(this.moveHandles[q].rowState.x+this.moveHandles[q].rowState.width-this.moveHandles[q].bounds.width/2),this.moveHandles[q].bounds.y=Math.round(this.moveHandles[q].rowState.y+(this.moveHandles[q].rowState.height-this.moveHandles[q].bounds.height)/2),this.moveHandles[q].redraw());if(null!=this.cornerHandles){q=this.getSelectionBorderInset();var B=this.cornerHandles,C=B[0].bounds.height/2;B[0].bounds.x=this.state.x-B[0].bounds.width/2+q;B[0].bounds.y=this.state.y-C+q;B[0].redraw();B[1].bounds.x=B[0].bounds.x+this.state.width-2*q;B[1].bounds.y=B[0].bounds.y;B[1].redraw();B[2].bounds.x=B[0].bounds.x;B[2].bounds.y=this.state.y+this.state.height-2*q;B[2].redraw();B[3].bounds.x=B[1].bounds.x;B[3].bounds.y=B[2].bounds.y;B[3].redraw();for(q=0;q<this.cornerHandles.length;q++)this.cornerHandles[q].node.style.display=1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&@@ -3133,36 +3138,36 @@ Format.prototype.curved=!1;Format.prototype.init=function(){var a=this.editorUi,b=a.editor,e=b.graph;this.update=mxUtils.bind(this,function(f,g){this.refresh()});e.getSelectionModel().addListener(mxEvent.CHANGE,this.update);e.getModel().addListener(mxEvent.CHANGE,this.update);e.addListener(mxEvent.EDITING_STARTED,this.update);e.addListener(mxEvent.EDITING_STOPPED,this.update);e.getView().addListener("unitChanged",this.update);b.addListener("autosaveChanged",this.update);e.addListener(mxEvent.ROOT,this.update);a.addListener("styleChanged",this.update);a.addListener("lockedChanged",this.update);a.addListener("languageChanged",this.update);a.addListener("formatWidthChanged",this.update);this.refresh()};Format.prototype.clear=function(){this.container.innerText="";if(null!=this.panels)for(var a=0;a<this.panels.length;a++)this.panels[a].destroy();this.panels=[]};Format.prototype.refresh=function(){null!=this.pendingRefresh&&(window.clearTimeout(this.pendingRefresh),this.pendingRefresh=null);this.pendingRefresh=window.setTimeout(mxUtils.bind(this,function(){this.immediateRefresh()}))};-Format.prototype.immediateRefresh=function(){if(0!=this.container.offsetWidth){this.clear();var a=this.editorUi,b=a.editor.graph,e=document.createElement("div");e.className="geFormatContent";var f=document.createElement("div");f.className="geFormatTitle";this.container.appendChild(e);var g=a.getSelectionState(),d=g.containsLabel,h=null,l=null,t=mxUtils.bind(this,function(F,D,G,H){var M=mxUtils.bind(this,function(L,U){h!=F&&(U||(d?this.labelIndex=G:b.isSelectionEmpty()?this.diagramIndex=G:this.currentIndex=-G),null!=h&&h.classList.remove("geActiveFormatTitle"),h=F,h.classList.add("geActiveFormatTitle"),l!=D&&(null!=l&&(l.style.display="none"),l=D,l.style.display=""))});mxEvent.addListener(F,"click",M);var N=d?this.labelIndex:b.isSelectionEmpty()?this.diagramIndex:this.currentIndex;(H&&null==h||G==N)&&M(null,H&&null==h)}),k=0;if(b.isSelectionEmpty()){var v=document.createElement("div");mxUtils.write(v,mxResources.get("diagram"));f.appendChild(v);f.setAttribute("title",mxResources.get("diagram"));e.appendChild(f);+Format.prototype.immediateRefresh=function(){if(0!=this.container.offsetWidth){this.clear();var a=this.editorUi,b=a.editor.graph,e=document.createElement("div");e.className="geFormatContent";var f=document.createElement("div");f.className="geFormatTitle";this.container.appendChild(e);var g=a.getSelectionState(),d=g.containsLabel,h=null,l=null,t=mxUtils.bind(this,function(E,D,G,H){var M=mxUtils.bind(this,function(L,U){h!=E&&(U||(d?this.labelIndex=G:b.isSelectionEmpty()?this.diagramIndex=G:this.currentIndex=+G),null!=h&&h.classList.remove("geActiveFormatTitle"),h=E,h.classList.add("geActiveFormatTitle"),l!=D&&(null!=l&&(l.style.display="none"),l=D,l.style.display=""))});mxEvent.addListener(E,"click",M);var N=d?this.labelIndex:b.isSelectionEmpty()?this.diagramIndex:this.currentIndex;(H&&null==h||G==N)&&M(null,H&&null==h)}),k=0;if(b.isSelectionEmpty()){var v=document.createElement("div");mxUtils.write(v,mxResources.get("diagram"));f.appendChild(v);f.setAttribute("title",mxResources.get("diagram"));e.appendChild(f);g=e.cloneNode(!1);this.panels.push(new DiagramFormatPanel(this,a,g));this.container.appendChild(g);g.style.display="none";var u=f.cloneNode(!1);t(f,g,k++);var y=e.cloneNode(!1);y.style.display="none";v=document.createElement("div");mxUtils.write(v,mxResources.get("style"));u.appendChild(v);u.setAttribute("title",mxResources.get("style"));e.appendChild(u);this.panels.push(new DiagramStylePanel(this,a,y));this.container.appendChild(y);t(u,y,k++,!0)}else if(b.isEditing())v=document.createElement("div"),mxUtils.write(v,mxResources.get("text")),f.appendChild(v),f.setAttribute("title",mxResources.get("text")),e.appendChild(f),y=e.cloneNode(!1),y.style.display="none",this.panels.push(new TextFormatPanel(this,a,y)),this.container.appendChild(y),t(f,y,k++,!0);else{u=f.cloneNode(!1);var z=u.cloneNode(!1);0<g.cells.length&&(v=document.createElement("div"),mxUtils.write(v,mxResources.get("style")),f.appendChild(v),f.setAttribute("title",mxResources.get("style")),e.appendChild(f),y=e.cloneNode(!1),y.style.display="none",this.panels.push(new StyleFormatPanel(this,a,y)),this.container.appendChild(y),t(f,y,k++));v=document.createElement("div");mxUtils.write(v,mxResources.get("text"));u.appendChild(v);u.setAttribute("title",mxResources.get("text"));e.appendChild(u);y=e.cloneNode(!1);y.style.display="none";this.panels.push(new TextFormatPanel(this,a,y));this.container.appendChild(y);v=document.createElement("div");mxUtils.write(v,mxResources.get("arrange"));z.appendChild(v);z.setAttribute("title",mxResources.get("arrange"));e.appendChild(z);f=e.cloneNode(!1);f.style.display="none";this.panels.push(new ArrangePanel(this,a,f));this.container.appendChild(f);0<g.cells.length?t(u,y,k++):u.style.display="none";t(z,f,k++,!0)}e.className="geFormatTitleContainer"}};BaseFormatPanel=function(a,b,e){this.format=a;this.editorUi=b;this.container=e;this.listeners=[]};BaseFormatPanel.prototype.buttonBackgroundColor="transparent";-BaseFormatPanel.prototype.installInputHandler=function(a,b,e,f,g,d,h,l,t){d=null!=d?d:"";l=null!=l?l:!1;var k=this.editorUi,v=k.editor.graph;f=null!=f?f:1;g=null!=g?g:999;var u=null,y=!1,z=null,F=mxUtils.bind(this,function(D){var G=l?parseFloat(a.value):parseInt(a.value);t&&(G=this.fromUnit(G));if(G!=z){z=G;isNaN(G)||b!=mxConstants.STYLE_ROTATION||(G=mxUtils.mod(Math.round(100*G),36E3)/100);G=Math.min(g,Math.max(f,isNaN(G)?e:G));if(v.cellEditor.isContentEditing()&&h)y||(y=!0,null!=u&&(v.cellEditor.restoreSelection(u),+BaseFormatPanel.prototype.installInputHandler=function(a,b,e,f,g,d,h,l,t){d=null!=d?d:"";l=null!=l?l:!1;var k=this.editorUi,v=k.editor.graph;f=null!=f?f:1;g=null!=g?g:999;var u=null,y=!1,z=null,E=mxUtils.bind(this,function(D){var G=l?parseFloat(a.value):parseInt(a.value);t&&(G=this.fromUnit(G));if(G!=z){z=G;isNaN(G)||b!=mxConstants.STYLE_ROTATION||(G=mxUtils.mod(Math.round(100*G),36E3)/100);G=Math.min(g,Math.max(f,isNaN(G)?e:G));if(v.cellEditor.isContentEditing()&&h)y||(y=!0,null!=u&&(v.cellEditor.restoreSelection(u),u=null),h(G),a.value=(t?this.inUnit(G):G)+d,y=!1);else if(G!=mxUtils.getValue(k.getSelectionState().style,b,e)){v.isEditing()&&v.stopEditing(!0);v.getModel().beginUpdate();try{var H=k.getSelectionState().cells;v.setCellStyles(b,G,H);b==mxConstants.STYLE_FONTSIZE&&v.updateLabelElements(H,function(N){N.removeAttribute("size");N.style.fontSize="";""==N.getAttribute("style")&&N.removeAttribute("style")});for(var M=0;M<H.length;M++)0==v.model.getChildCount(H[M])&&v.autoSizeCell(H[M],!1),b!=mxConstants.STYLE_FONTSIZE&&-v.isAutosizeTextCell(H[M])&&v.model.isVertex(H[M])&&v.updateAutosizeTextFontSize(H[M],v.getCurrentCellStyle(H[M],!0));k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",H))}finally{v.getModel().endUpdate()}}a.value=(t?this.inUnit(G):G)+d}mxEvent.consume(D)});h&&v.cellEditor.isContentEditing()&&mxEvent.addGestureListeners(a,mxUtils.bind(this,function(D){document.activeElement==v.cellEditor.textarea&&(u=v.cellEditor.saveSelection())}));mxEvent.addListener(a,"change",F);mxEvent.addListener(a,-"blur",F);return F};BaseFormatPanel.prototype.createPanel=function(){var a=document.createElement("div");a.className="geFormatSection";return a};BaseFormatPanel.prototype.createTitle=function(a){var b=document.createElement("div");b.className="geFormatSectionTitle";b.setAttribute("title",a);mxUtils.write(b,a);return b};+v.isAutosizeTextCell(H[M])&&v.model.isVertex(H[M])&&v.updateAutosizeTextFontSize(H[M],v.getCurrentCellStyle(H[M],!0));k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",H))}finally{v.getModel().endUpdate()}}a.value=(t?this.inUnit(G):G)+d}mxEvent.consume(D)});h&&v.cellEditor.isContentEditing()&&mxEvent.addGestureListeners(a,mxUtils.bind(this,function(D){document.activeElement==v.cellEditor.textarea&&(u=v.cellEditor.saveSelection())}));mxEvent.addListener(a,"change",E);mxEvent.addListener(a,+"blur",E);return E};BaseFormatPanel.prototype.createPanel=function(){var a=document.createElement("div");a.className="geFormatSection";return a};BaseFormatPanel.prototype.createTitle=function(a){var b=document.createElement("div");b.className="geFormatSectionTitle";b.setAttribute("title",a);mxUtils.write(b,a);return b};BaseFormatPanel.prototype.addAction=function(a,b){var e=this.editorUi.actions.get(b);b=null;if(null!=e&&e.isEnabled()){b=mxUtils.button(e.getTitle(),mxUtils.bind(this,function(g){try{e.funct(g,g)}catch(d){this.editorUi.handleError(d)}}));var f=null!=e.shortcut?" ("+e.shortcut+")":"";b.setAttribute("title",e.getTitle()+f);b.style.marginBottom="2px";b.className="geFullWidthElement";a.appendChild(b)}return b};BaseFormatPanel.prototype.addActions=function(a,b){for(var e=null,f=null,g=0,d=0;d<b.length;d++){var h=this.addAction(a,b[d]);null!=h&&(g++,0==mxUtils.mod(g,2)&&(f.style.marginRight="4px",f.style.width="104px",h.style.width="104px",e.parentNode.removeChild(e)),e=mxUtils.br(a),f=h)}return g};-BaseFormatPanel.prototype.createStepper=function(a,b,e,f,g,d,h){function l(y,z,F){""==a.value&&(a.value=null!=d?d:z);z=h?parseFloat(a.value):parseInt(a.value);isNaN(z)||(a.value=z+y,null!=b&&b(F))}e=null!=e?e:1;var t=10*e;f=document.createElement("div");f.className="geBtnStepper";f.style.position="absolute";f.style.left="200px";var k=document.createElement("div");k.style.height="9px";k.style.backgroundImage="url("+Editor.arrowUpImage+")";k.style.width="10px";f.appendChild(k);var v=k.cloneNode(!1);+BaseFormatPanel.prototype.createStepper=function(a,b,e,f,g,d,h){function l(y,z,E){""==a.value&&(a.value=null!=d?d:z);z=h?parseFloat(a.value):parseInt(a.value);isNaN(z)||(a.value=z+y,null!=b&&b(E))}e=null!=e?e:1;var t=10*e;f=document.createElement("div");f.className="geBtnStepper";f.style.position="absolute";f.style.left="200px";var k=document.createElement("div");k.style.height="9px";k.style.backgroundImage="url("+Editor.arrowUpImage+")";k.style.width="10px";f.appendChild(k);var v=k.cloneNode(!1);v.style.backgroundImage="url("+Editor.arrowDownImage+")";f.appendChild(v);mxEvent.addGestureListeners(k,function(y){mxEvent.consume(y)},null,function(y){l(mxEvent.isShiftDown(y)?t:e,"0",y);mxEvent.consume(y)});mxEvent.addGestureListeners(v,function(y){mxEvent.consume(y)},null,function(y){l(-(mxEvent.isShiftDown(y)?t:e),"2",y);mxEvent.consume(y)});if(g){var u=null;mxEvent.addGestureListeners(f,function(y){mxEvent.consume(y)},null,function(y){if(null!=u){try{u.select()}catch(z){}u=null;mxEvent.consume(y)}})}else mxEvent.addListener(f,"click",function(y){mxEvent.consume(y)});return f};BaseFormatPanel.prototype.createOption=function(a,b,e,f,g){var d=document.createElement("div");d.className="geFormatEntry";var h=document.createElement("input");h.setAttribute("type","checkbox");h.setAttribute("title",a);d.appendChild(h);var l=document.createElement("span");l.className="geStyleLabel";l.setAttribute("title",a);mxUtils.write(l,a);d.appendChild(l);var t=!1,k=b(),v=function(u,y){t||(t=!0,u?(h.setAttribute("checked","checked"),h.defaultChecked=!0,h.checked=!0):(h.removeAttribute("checked"),h.defaultChecked=!1,h.checked=!1),k!=u&&(k=u,b()!=k&&e(k,y)),t=!1)};mxEvent.addListener(d,"click",function(u){if("disabled"!=h.getAttribute("disabled")){var y=mxEvent.getSource(u);if(y==d||y==l)h.checked=!h.checked;v(h.checked,u)}});v(k);null!=f&&(f.install(v),this.listeners.push(f));null!=g&&g(d);return d};BaseFormatPanel.prototype.createCellOption=function(a,b,e,f,g,d,h,l,t){var k=this.editorUi,v=k.editor.graph;f=null!=f?"null"==f?null:f:1;g=null!=g?"null"==g?null:g:0;var u=null!=t?v.getCommonStyle(t):k.getSelectionState().style;return this.createOption(a,function(){return mxUtils.getValue(u,b,e)!=g},function(y){l&&v.stopEditing();if(null!=h)h.funct();else{v.getModel().beginUpdate();try{var z=null!=t?t:k.getSelectionState().cells;y=y?f:g;v.setCellStyles(b,y,z);null!=d&&d(z,y);k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[y],"cells",z))}finally{v.getModel().endUpdate()}}},{install:function(y){this.listener=function(){y(mxUtils.getValue(u,b,e)!=g)};v.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){v.getModel().removeListener(this.listener)}})};-BaseFormatPanel.prototype.createColorOption=function(a,b,e,f,g,d,h,l,t,k){function v(S,V){"default"!=S||V||(S=l);"default"!=S&&t&&(S=mxUtils.getLightDarkColor(S),S=k()?S.dark:S.light);return S}var u=null!=k;k=null!=k?k:Editor.isDarkMode;var y=this.editorUi.editor.graph,z=document.createElement("div");z.className="geFormatEntry";var F=document.createElement("input");F.setAttribute("type","checkbox");F.setAttribute("title",a);h||z.appendChild(F);var D=document.createElement("span");mxUtils.write(D,+BaseFormatPanel.prototype.createColorOption=function(a,b,e,f,g,d,h,l,t,k){function v(S,V){"default"!=S||V||(S=l);"default"!=S&&t&&(S=mxUtils.getLightDarkColor(S),S=k()?S.dark:S.light);return S}var u=null!=k;k=null!=k?k:Editor.isDarkMode;var y=this.editorUi.editor.graph,z=document.createElement("div");z.className="geFormatEntry";var E=document.createElement("input");E.setAttribute("type","checkbox");E.setAttribute("title",a);h||z.appendChild(E);var D=document.createElement("span");mxUtils.write(D,a);D.setAttribute("title",a);z.appendChild(D);var G=b(),H=!1,M=null,N=null,L=document.createElement("input");L.setAttribute("type","color");L.style.position="relative";L.style.visibility="hidden";L.style.top="10px";L.style.width="0px";L.style.height="0px";L.style.border="none";mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_TOUCH||(M=document.createElement("img"),M.src=Editor.colorDropperImage,M.className="geColorDropper geAdaptiveAsset",mxEvent.addListener(M,"click",function(S){L.value=v(G);L.click();mxEvent.consume(S)}));var U=null,X=function(S,V){H||(H=!0,null!=d&&d(S),V||(null!=U&&(y.cellEditor.restoreSelection(U),U=null),e(S)),G=b(),S=mxUtils.getLightDarkColor("default"!=G?G:l),V=document.createElement("div"),V.style.width="21px",V.style.height="12px",V.style.margin="2px 18px 2px 3px",V.style.borderWidth="1px",V.style.borderStyle="solid",V.style.backgroundColor=S.cssText,N.innerText="",N.appendChild(V),!t&&mxUtils.isLightDarkColor(G)&&S.light!=S.dark?V.style.background="linear-gradient(to right bottom, "+S.cssText+" 50%, "+mxUtils.invertLightDarkColor(S).cssText+" 50.3%)":t&&u&&(V.style.backgroundColor=k()?S.dark:S.light),null!=M?(V.style.width="21px",V.style.margin="2px 18px 2px 3px",V.appendChild(M)):(V.style.width="36px",V.style.margin="3px"),null!=G&&G!=mxConstants.NONE&&1<G.length&&"string"===typeof G&&(S="#"==G.charAt(0)?G.substring(1).toUpperCase():G,S=ColorDialog.prototype.colorNames[S],null!=S?N.setAttribute("title",S):"default"==G?N.setAttribute("title",mxResources.get("useBlackAndWhite")):-N.setAttribute("title",G)),y.isSpecialColor(G)?F.style.display="none":(F.style.display="",null!=G&&G!=mxConstants.NONE?(F.setAttribute("checked","checked"),F.defaultChecked=!0,F.checked=!0):(F.removeAttribute("checked"),F.defaultChecked=!1,F.checked=!1)),N.style.display=F.checked||h?"":"none",H=!1)};z.appendChild(L);mxEvent.addListener(L,"change",function(){var S=L.value;if(!t){var V=mxUtils.getLightDarkColor(G);k()?V.dark=S:V.light=S;S="light-dark("+V.light+", "+V.dark+")"}X(S)});N=mxUtils.button("",-mxUtils.bind(this,function(S){var V=l;t&&k()&&mxUtils.isLightDarkColor(V)&&(V=mxUtils.getLightDarkColor(l).dark);this.editorUi.pickColor(v(G,!0),function(ha){X(ha)},"default"==f?"default":null,V,t);mxEvent.consume(S)}));N.className="geColorBtn";N.style.display=F.checked||h?"":"none";z.appendChild(N);a=null!=G&&"string"===typeof G&&"#"==G.charAt(0)?G.substring(1).toUpperCase():G;a=ColorDialog.prototype.colorNames[a];null!=a&&N.setAttribute("title",a);h||(mxEvent.addListener(z,"click",function(S){S=-mxEvent.getSource(S);if(S==F||"INPUT"!=S.nodeName)S!=F&&(F.checked=!F.checked),F.checked||null==G||G==mxConstants.NONE||f==mxConstants.NONE||(f=v(G)),X(F.checked?f:mxConstants.NONE)}),mxEvent.addGestureListeners(F,mxUtils.bind(this,function(S){document.activeElement==y.cellEditor.textarea&&(U=y.cellEditor.saveSelection())})),mxEvent.addGestureListeners(z,mxUtils.bind(this,function(S){document.activeElement==y.cellEditor.textarea&&(U=y.cellEditor.saveSelection())})));X(G,!0);null!=g&&g.install(function(){X(G,+N.setAttribute("title",G)),y.isSpecialColor(G)?E.style.display="none":(E.style.display="",null!=G&&G!=mxConstants.NONE?(E.setAttribute("checked","checked"),E.defaultChecked=!0,E.checked=!0):(E.removeAttribute("checked"),E.defaultChecked=!1,E.checked=!1)),N.style.display=E.checked||h?"":"none",H=!1)};z.appendChild(L);mxEvent.addListener(L,"change",function(){var S=L.value;if(!t){var V=mxUtils.getLightDarkColor(G);k()?V.dark=S:V.light=S;S="light-dark("+V.light+", "+V.dark+")"}X(S)});N=mxUtils.button("",+mxUtils.bind(this,function(S){var V=l;t&&k()&&mxUtils.isLightDarkColor(V)&&(V=mxUtils.getLightDarkColor(l).dark);this.editorUi.pickColor(v(G,!0),function(ha){X(ha)},"default"==f?"default":null,V,t);mxEvent.consume(S)}));N.className="geColorBtn";N.style.display=E.checked||h?"":"none";z.appendChild(N);a=null!=G&&"string"===typeof G&&"#"==G.charAt(0)?G.substring(1).toUpperCase():G;a=ColorDialog.prototype.colorNames[a];null!=a&&N.setAttribute("title",a);h||(mxEvent.addListener(z,"click",function(S){S=+mxEvent.getSource(S);if(S==E||"INPUT"!=S.nodeName)S!=E&&(E.checked=!E.checked),E.checked||null==G||G==mxConstants.NONE||f==mxConstants.NONE||(f=v(G)),X(E.checked?f:mxConstants.NONE)}),mxEvent.addGestureListeners(E,mxUtils.bind(this,function(S){document.activeElement==y.cellEditor.textarea&&(U=y.cellEditor.saveSelection())})),mxEvent.addGestureListeners(z,mxUtils.bind(this,function(S){document.activeElement==y.cellEditor.textarea&&(U=y.cellEditor.saveSelection())})));X(G,!0);null!=g&&g.install(function(){X(G,!0)},this.listeners.push(g));return z};-BaseFormatPanel.prototype.createArrayCellColorOption=function(a,b,e,f,g,d,h){var l=this.editorUi,t=l.editor.graph,k=t.getCellStyle(t.getSelectionCell(),!1);k=null!=k?null!=k[b]?k[b]:h:null;for(var v=null!=k?mxUtils.parseColorList(k):[],u=document.createElement("div"),y=0;y<v.length;y++)mxUtils.bind(this,function(z){u.appendChild(this.createColorOption(a+" ("+(z+1)+")",function(){return v[y]},function(F){t.getModel().beginUpdate();try{var D=l.getSelectionState().cells;v[z]=F;var G=v.join(",");t.setCellStyles(b,-G,D);null!=g&&g(F);l.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",D))}finally{t.getModel().endUpdate()}},e||mxConstants.NONE,{install:function(F){this.listener=function(){var D=t.getCellStyle(t.getSelectionCell(),!1);null!=D&&(D=null!=D?null!=D[b]?D[b]:h:null,v=null!=D?mxUtils.parseColorList(D):[],F(v[y],!0))};t.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){t.getModel().removeListener(this.listener)}},f,null,d))})(y);return u};-BaseFormatPanel.prototype.createCellColorOption=function(a,b,e,f,g,d,h,l){function t(){var y=v.getCellStyle(v.getSelectionCell(),!1),z=null!=y?y[b]:null;if("inherit"==z){var F=v.getModel().getParent(v.getSelectionCell());F=v.getCellStyle(F,!1);null!=F&&null!=F[b]&&(z=F[b])}return null!=y?null!=z?z:h:null}var k=this.editorUi,v=k.editor.graph,u=t();return null!=u&&l&&1<mxUtils.parseColorList(u).length?this.createArrayCellColorOption(a,b,e,f,g,d,h):this.createColorOption(a,t,function(y){v.getModel().beginUpdate();+BaseFormatPanel.prototype.createArrayCellColorOption=function(a,b,e,f,g,d,h){var l=this.editorUi,t=l.editor.graph,k=t.getCellStyle(t.getSelectionCell(),!1);k=null!=k?null!=k[b]?k[b]:h:null;for(var v=null!=k?mxUtils.parseColorList(k):[],u=document.createElement("div"),y=0;y<v.length;y++)mxUtils.bind(this,function(z){u.appendChild(this.createColorOption(a+" ("+(z+1)+")",function(){return v[y]},function(E){t.getModel().beginUpdate();try{var D=l.getSelectionState().cells;v[z]=E;var G=v.join(",");t.setCellStyles(b,+G,D);null!=g&&g(E);l.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",D))}finally{t.getModel().endUpdate()}},e||mxConstants.NONE,{install:function(E){this.listener=function(){var D=t.getCellStyle(t.getSelectionCell(),!1);null!=D&&(D=null!=D?null!=D[b]?D[b]:h:null,v=null!=D?mxUtils.parseColorList(D):[],E(v[y],!0))};t.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){t.getModel().removeListener(this.listener)}},f,null,d))})(y);return u};+BaseFormatPanel.prototype.createCellColorOption=function(a,b,e,f,g,d,h,l){function t(){var y=v.getCellStyle(v.getSelectionCell(),!1),z=null!=y?y[b]:null;if("inherit"==z){var E=v.getModel().getParent(v.getSelectionCell());E=v.getCellStyle(E,!1);null!=E&&null!=E[b]&&(z=E[b])}return null!=y?null!=z?z:h:null}var k=this.editorUi,v=k.editor.graph,u=t();return null!=u&&l&&1<mxUtils.parseColorList(u).length?this.createArrayCellColorOption(a,b,e,f,g,d,h):this.createColorOption(a,t,function(y){v.getModel().beginUpdate();try{var z=k.getSelectionState().cells;v.setCellStyles(b,y,z);null!=g&&g(y);k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[y],"cells",z))}finally{v.getModel().endUpdate()}},e||mxConstants.NONE,{install:function(y){this.listener=function(){var z=v.getCellStyle(v.getSelectionCell(),!1);null!=z&&y(null!=z[b]?z[b]:h,!0)};v.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){v.getModel().removeListener(this.listener)}},f,null,d)};BaseFormatPanel.prototype.addArrow=function(a){var b=document.createElement("div");b.className="geAdaptiveAsset geArrow";b.style.backgroundImage="url("+Editor.thinExpandImage+")";a.className="geStyleBtn";a.appendChild(b);return b};BaseFormatPanel.prototype.addUnitInput=function(a,b,e,f,g,d,h,l,t){b=document.createElement("input");b.style.position="absolute";b.style.left=216-e-f+"px";b.style.width=f+"px";a.appendChild(b);f=this.createStepper(b,g,d,l,null,t);f.style.left=216-e+"px";a.appendChild(f);return b};@@ -3199,9 +3204,9 @@ BaseFormatPanel.prototype.getUnit=function(a){var b="";switch(this.editorUi.editBaseFormatPanel.prototype.fromUnit=function(a){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return a;case mxConstants.INCHES:return a*mxConstants.PIXELS_PER_INCH;case mxConstants.MILLIMETERS:return a*mxConstants.PIXELS_PER_MM;case mxConstants.METERS:return a*mxConstants.PIXELS_PER_MM*1E3}};BaseFormatPanel.prototype.isFloatUnit=function(){return this.editorUi.editor.graph.view.unit!=mxConstants.POINTS};BaseFormatPanel.prototype.getUnitStep=function(){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return 1;case mxConstants.INCHES:return.1;case mxConstants.MILLIMETERS:return.5;case mxConstants.METERS:return.001}};ArrangePanel.prototype.addGeometry=function(a){var b=this,e=this.editorUi,f=e.editor.graph,g=f.getModel(),d=e.getSelectionState(),h=this.createPanel();h.style.height="60px";var l=document.createElement("div");l.className="geStyleLabel";l.style.position="absolute";l.style.fontWeight="bold";l.style.marginTop="4px";l.style.maxWidth="50px";mxUtils.write(l,mxResources.get("size"));l.setAttribute("title",mxResources.get("size"));h.appendChild(l);var t=this.addUnitInput(h,this.getUnit(),87,52,function(){z.apply(this,-arguments)},this.getUnitStep(),null,null,this.isFloatUnit());t.setAttribute("title",mxResources.get("width"));var k=this.addUnitInput(h,this.getUnit(),16,52,function(){F.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());k.setAttribute("title",mxResources.get("height"));l=document.createElement("div");l.style.backgroundImage="url("+Editor.autosizeImage+")";l.className="geButton";l.style.margin="0";l.style.width="21px";l.style.height="21px";l.style.left="52px";mxUtils.setOpacity(l,+arguments)},this.getUnitStep(),null,null,this.isFloatUnit());t.setAttribute("title",mxResources.get("width"));var k=this.addUnitInput(h,this.getUnit(),16,52,function(){E.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());k.setAttribute("title",mxResources.get("height"));l=document.createElement("div");l.style.backgroundImage="url("+Editor.autosizeImage+")";l.className="geButton";l.style.margin="0";l.style.width="21px";l.style.height="21px";l.style.left="52px";mxUtils.setOpacity(l,50);l.setAttribute("title",mxResources.get("autosize"));mxEvent.addListener(l,"click",function(){e.actions.get("autosize").funct()});h.appendChild(l);d.row?(t.style.visibility="hidden",t.nextSibling.style.visibility="hidden"):this.addLabel(h,mxResources.get("width"),87,64).style.marginTop="0px";this.addLabel(h,mxResources.get("height"),16,64).style.marginTop="0px";mxUtils.br(h);var v=document.createElement("div");v.className="geFormatEntry";v.style.marginTop="14px";var u=this.createCellOption(mxResources.get("constrainProportions"),-mxConstants.STYLE_ASPECT,null,"fixed","null");u.className="geFullWidthElement";v.appendChild(u);d.cell||d.row?l.style.visibility="hidden":h.appendChild(v);var y=u.getElementsByTagName("input")[0];this.addKeyHandler(t,X);this.addKeyHandler(k,X);var z=this.addGeometryHandler(t,function(R,Z,W){Z=Math.max(1,b.fromUnit(Z));if(f.isTableCell(W))return f.setTableColumnWidth(W,Z-R.width,!0),!0;0<R.width&&(y.checked&&(R.height=Math.round(R.height*Z*100/R.width)/100),R.width=Z)});var F=this.addGeometryHandler(k,+mxConstants.STYLE_ASPECT,null,"fixed","null");u.className="geFullWidthElement";v.appendChild(u);d.cell||d.row?l.style.visibility="hidden":h.appendChild(v);var y=u.getElementsByTagName("input")[0];this.addKeyHandler(t,X);this.addKeyHandler(k,X);var z=this.addGeometryHandler(t,function(R,Z,W){Z=Math.max(1,b.fromUnit(Z));if(f.isTableCell(W))return f.setTableColumnWidth(W,Z-R.width,!0),!0;0<R.width&&(y.checked&&(R.height=Math.round(R.height*Z*100/R.width)/100),R.width=Z)});var E=this.addGeometryHandler(k,function(R,Z,W){Z=Math.max(1,b.fromUnit(Z));f.isTableCell(W)&&(W=g.getParent(W));if(f.isTableRow(W))return f.setTableRowHeight(W,Z-R.height),!0;0<R.height&&(y.checked&&(R.width=Math.round(R.width*Z*100/R.height)/100),R.height=Z)});(d.resizable||d.row||d.cell)&&a.appendChild(h);var D=this.createPanel();D.style.paddingBottom="30px";l=document.createElement("div");l.style.position="absolute";l.style.width="70px";l.style.marginTop="0px";l.style.fontWeight="bold";mxUtils.write(l,mxResources.get("position"));l.setAttribute("title",mxResources.get("position"));D.appendChild(l);var G=this.addUnitInput(D,this.getUnit(),87,52,function(){S.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit()),H=this.addUnitInput(D,this.getUnit(),16,52,function(){V.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());mxUtils.br(D);v=!0;var M=null,N=null;if(d.movable){if(0==d.edges.length&&1==d.vertices.length){var L=f.getCellGeometry(d.vertices[0]);if(null!=L&&L.relative){mxUtils.br(D);l=document.createElement("div");l.style.position="absolute";l.style.width="70px";l.style.marginTop="0px";mxUtils.write(l,mxResources.get("relative"));l.setAttribute("title",mxResources.get("relative"));D.appendChild(l);M=this.addGenericInput(D," %",87,52,function(){return Math.round(1E3*L.x)/10},function(R){R=parseFloat(R);if(!isNaN(R)){g.beginUpdate();try{L=L.clone(),L.x=parseFloat(R)/100,g.setGeometry(d.vertices[0],L)}finally{g.endUpdate()}}});M.setAttribute("title",mxResources.get("relative"));@@ -3220,26 +3225,26 @@ ArrangePanel.prototype.addEdgeGeometry=function(a){var b=this,e=this.editorUi,f=mxUtils.br(d);this.addKeyHandler(l,D);var t=mxUtils.bind(this,function(L){var U=parseInt(l.value);U=Math.min(999,Math.max(1,isNaN(U)?1:U));if(U!=mxUtils.getValue(g.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth)){var X=e.getSelectionState().cells;f.setCellStyles("width",U,X);e.fireEvent(new mxEventObject("styleChanged","keys",["width"],"values",[U],"cells",X))}l.value=U+" pt";mxEvent.consume(L)});mxEvent.addListener(l,"blur",t);mxEvent.addListener(l,"change",t);a.appendChild(d);var k=this.createPanel();k.style.paddingBottom="30px";h=document.createElement("div");h.style.position="absolute";h.style.width="70px";h.style.marginTop="4px";mxUtils.write(h,mxResources.get("linestart"));h.setAttribute("title",mxResources.get("linestart"));k.appendChild(h);var v=this.addUnitInput(k,this.getUnit(),87,52,function(){G.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());v.setAttribute("title",mxResources.get("left"));var u=this.addUnitInput(k,this.getUnit(),16,52,function(){H.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());u.setAttribute("title",mxResources.get("top"));mxUtils.br(k);this.addLabel(k,mxResources.get("left"),87,64);this.addLabel(k,mxResources.get("top"),16,64);a.appendChild(k);this.addKeyHandler(v,D);this.addKeyHandler(u,D);var y=this.createPanel();y.style.paddingBottom="30px";h=document.createElement("div");h.style.position="absolute";h.style.width="70px";h.style.marginTop="4px";mxUtils.write(h,mxResources.get("lineend"));-h.setAttribute("title",mxResources.get("lineend"));y.appendChild(h);var z=this.addUnitInput(y,this.getUnit(),87,52,function(){M.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());z.setAttribute("title",mxResources.get("left"));var F=this.addUnitInput(y,this.getUnit(),16,52,function(){N.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());F.setAttribute("title",mxResources.get("top"));mxUtils.br(y);this.addLabel(y,mxResources.get("left"),87,64);this.addLabel(y,-mxResources.get("top"),16,64);a.appendChild(y);this.addKeyHandler(z,D);this.addKeyHandler(F,D);var D=mxUtils.bind(this,function(L,U,X){g=e.getSelectionState();L=g.cells[0];if("link"==g.style.shape||"flexArrow"==g.style.shape){if(d.style.display="",X||document.activeElement!=l)X=mxUtils.getValue(g.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth),l.value=X+" pt"}else d.style.display="none";1==g.cells.length&&f.model.isEdge(L)?(X=f.model.getGeometry(L),null!=X&&null!=X.sourcePoint&&-null==f.model.getTerminal(L,!0)?(v.value=this.inUnit(X.sourcePoint.x)+" "+this.getUnit(),u.value=this.inUnit(X.sourcePoint.y)+" "+this.getUnit()):k.style.display="none",null!=X&&null!=X.targetPoint&&null==f.model.getTerminal(L,!1)?(z.value=this.inUnit(X.targetPoint.x)+" "+this.getUnit(),F.value=this.inUnit(X.targetPoint.y)+" "+this.getUnit()):y.style.display="none"):(k.style.display="none",y.style.display="none")});var G=this.addEdgeGeometryHandler(v,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.x=-b.fromUnit(U))});var H=this.addEdgeGeometryHandler(u,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.y=b.fromUnit(U))});var M=this.addEdgeGeometryHandler(z,function(L,U){null!=L.targetPoint&&(L.targetPoint.x=b.fromUnit(U))});var N=this.addEdgeGeometryHandler(F,function(L,U){null!=L.targetPoint&&(L.targetPoint.y=b.fromUnit(U))});f.getModel().addListener(mxEvent.CHANGE,D);this.listeners.push({destroy:function(){f.getModel().removeListener(D)}});D()};+h.setAttribute("title",mxResources.get("lineend"));y.appendChild(h);var z=this.addUnitInput(y,this.getUnit(),87,52,function(){M.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());z.setAttribute("title",mxResources.get("left"));var E=this.addUnitInput(y,this.getUnit(),16,52,function(){N.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());E.setAttribute("title",mxResources.get("top"));mxUtils.br(y);this.addLabel(y,mxResources.get("left"),87,64);this.addLabel(y,+mxResources.get("top"),16,64);a.appendChild(y);this.addKeyHandler(z,D);this.addKeyHandler(E,D);var D=mxUtils.bind(this,function(L,U,X){g=e.getSelectionState();L=g.cells[0];if("link"==g.style.shape||"flexArrow"==g.style.shape){if(d.style.display="",X||document.activeElement!=l)X=mxUtils.getValue(g.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth),l.value=X+" pt"}else d.style.display="none";1==g.cells.length&&f.model.isEdge(L)?(X=f.model.getGeometry(L),null!=X&&null!=X.sourcePoint&&+null==f.model.getTerminal(L,!0)?(v.value=this.inUnit(X.sourcePoint.x)+" "+this.getUnit(),u.value=this.inUnit(X.sourcePoint.y)+" "+this.getUnit()):k.style.display="none",null!=X&&null!=X.targetPoint&&null==f.model.getTerminal(L,!1)?(z.value=this.inUnit(X.targetPoint.x)+" "+this.getUnit(),E.value=this.inUnit(X.targetPoint.y)+" "+this.getUnit()):y.style.display="none"):(k.style.display="none",y.style.display="none")});var G=this.addEdgeGeometryHandler(v,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.x=+b.fromUnit(U))});var H=this.addEdgeGeometryHandler(u,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.y=b.fromUnit(U))});var M=this.addEdgeGeometryHandler(z,function(L,U){null!=L.targetPoint&&(L.targetPoint.x=b.fromUnit(U))});var N=this.addEdgeGeometryHandler(E,function(L,U){null!=L.targetPoint&&(L.targetPoint.y=b.fromUnit(U))});f.getModel().addListener(mxEvent.CHANGE,D);this.listeners.push({destroy:function(){f.getModel().removeListener(D)}});D()};TextFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(TextFormatPanel,BaseFormatPanel);TextFormatPanel.prototype.init=function(){this.container.appendChild(this.addFont(this.createPanel()));this.container.appendChild(this.addFontOps(this.createPanel()))};TextFormatPanel.prototype.addFontOps=function(a){0==this.addActions(a,["removeFormat"])&&(a.style.display="none");return a};TextFormatPanel.prototype.addFont=function(a){function b(la){la=null!=la?la.fontSize:null;return null!=la&&"px"==la.substring(la.length-2)?parseFloat(la):mxConstants.DEFAULT_FONTSIZE}function e(la,Ea){if(null!=la&&""!=la.textContent){la.style.lineHeight="";var za=mxUtils.getCurrentStyle(la);parseFloat(za.fontSize)*Ea/100!=parseFloat(za.lineHeight)?la.style.lineHeight=Ea+"%":""==la.getAttribute("style")&&la.removeAttribute("style")}}function f(la,Ea){Ea?la.classList.add("geActiveItem"):la.classList.remove("geActiveItem")}var g=this.editorUi,d=g.editor.graph,h=g.getSelectionState(),l=this.createTitle(mxResources.get("font"));a.appendChild(l);l=this.createPanel();l.className="geFormatEntry";if(d.cellEditor.isContentEditing()){var t=l.cloneNode(),k=g.toolbar.addMenu(g.menus.get("formatBlock"),mxResources.get("style"),null,t);this.addArrow(k);k.style.margin="0px";k.style.position="relative";k.classList.add("geFullWidthElement");a.appendChild(t)}k=l.cloneNode(!1);a.appendChild(k);t=this.createPanel();var v=g.toolbar.addMenu(g.menus.get("fontFamily"),"Helvetica",null,k);this.addArrow(v);v.setAttribute("title",mxResources.get("fontFamily"));v.style.margin="0px";v.style.position="relative";v.classList.add("geFullWidthElement");"inherit"==h.style[mxConstants.STYLE_FONTFAMILY]&&(k.style.display="none");k=l.cloneNode(!1);var u=g.toolbar.addItems(["bold","italic","underline"],k,!0,[Editor.boldImage,Editor.italicImage,Editor.underlineImage]);u[0].setAttribute("title",mxResources.get("bold")+" ("+g.actions.get("bold").shortcut+")");u[1].setAttribute("title",-mxResources.get("italic")+" ("+g.actions.get("italic").shortcut+")");u[2].setAttribute("title",mxResources.get("underline")+" ("+g.actions.get("underline").shortcut+")");var y=g.toolbar.addItems(["vertical"],k,!0,[Editor.verticalTextImage])[0];a.appendChild(k);var z=l.cloneNode(!1),F=function(la){return function(){return la()}},D=g.addButton(Editor.alignLeftImage,mxResources.get("left"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_LEFT,la);g.fireEvent(new mxEventObject("styleChanged",-"keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_LEFT],"cells",h.cells))}:F(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT])),z),G=g.addButton(Editor.alignCenterImage,mxResources.get("center"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_CENTER,la);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_CENTER],"cells",h.cells))}:F(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],-[mxConstants.ALIGN_CENTER])),z),H=g.addButton(Editor.alignRightImage,mxResources.get("right"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_RIGHT,la);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_RIGHT],"cells",h.cells))}:F(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT])),z);d.cellEditor.isContentEditing()&&(U=g.addButton(Editor.strikethroughImage,mxResources.get("strikethrough"),-function(){document.execCommand("strikeThrough",!1,null)},k));var M=g.addButton(Editor.alignTopImage,mxResources.get("top"),F(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP])),z),N=g.addButton(Editor.alignMiddleImage,mxResources.get("middle"),F(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE])),z),L=g.addButton(Editor.alignBottomImage,mxResources.get("bottom"),F(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],+mxResources.get("italic")+" ("+g.actions.get("italic").shortcut+")");u[2].setAttribute("title",mxResources.get("underline")+" ("+g.actions.get("underline").shortcut+")");var y=g.toolbar.addItems(["vertical"],k,!0,[Editor.verticalTextImage])[0];a.appendChild(k);var z=l.cloneNode(!1),E=function(la){return function(){return la()}},D=g.addButton(Editor.alignLeftImage,mxResources.get("left"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_LEFT,la);g.fireEvent(new mxEventObject("styleChanged",+"keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_LEFT],"cells",h.cells))}:E(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT])),z),G=g.addButton(Editor.alignCenterImage,mxResources.get("center"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_CENTER,la);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_CENTER],"cells",h.cells))}:E(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],+[mxConstants.ALIGN_CENTER])),z),H=g.addButton(Editor.alignRightImage,mxResources.get("right"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_RIGHT,la);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_RIGHT],"cells",h.cells))}:E(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT])),z);d.cellEditor.isContentEditing()&&(U=g.addButton(Editor.strikethroughImage,mxResources.get("strikethrough"),+function(){document.execCommand("strikeThrough",!1,null)},k));var M=g.addButton(Editor.alignTopImage,mxResources.get("top"),E(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP])),z),N=g.addButton(Editor.alignMiddleImage,mxResources.get("middle"),E(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE])),z),L=g.addButton(Editor.alignBottomImage,mxResources.get("bottom"),E(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM])),z);a.appendChild(z);var U,X,S,V;if(d.cellEditor.isContentEditing()){M.style.display="none";N.style.display="none";L.style.display="none";y.style.display="none";var ha=g.addButton(Editor.alignJustifyImage,mxResources.get("block"),function(){document.execCommand("justifyfull",!1,null)},z);ha.style.marginRight="9px";var R=g.addButton(Editor.subscriptImage,mxResources.get("subscript")+" ("+Editor.ctrlKey+"+,)",function(){document.execCommand("subscript",!1,null)},z);R.style.marginLeft=-"10px";var Z=g.addButton(Editor.superscriptImage,mxResources.get("superscript")+" ("+Editor.ctrlKey+"+.)",function(){document.execCommand("superscript",!1,null)},z);R.style.marginLeft="10px";F=z.cloneNode(!1);F.style.paddingTop="4px";z=[g.addButton(Editor.orderedListImage,mxResources.get("numberedList"),function(){document.execCommand("insertorderedlist",!1,null)},F),g.addButton(Editor.unorderedListImage,mxResources.get("bulletedList"),function(){document.execCommand("insertunorderedlist",!1,null)},-F),g.addButton(Editor.indentImage,mxResources.get("increaseIndent"),function(){document.execCommand("indent",!1,null)},F),g.addButton(Editor.outdentImage,mxResources.get("decreaseIndent"),function(){document.execCommand("outdent",!1,null)},F),g.addButton(Editor.removeFormatImage,mxResources.get("removeFormat"),function(){document.execCommand("removeformat",!1,null)},F),g.addButton(Editor.codeImage,mxResources.get("html"),function(){d.cellEditor.toggleViewMode()},F)];z[z.length-2].style.marginLeft=-"10px";a.appendChild(F)}else u[2].style.marginRight="12px",H.style.marginRight="12px";z=l.cloneNode(!1);mxUtils.write(z,mxResources.get("position"));z.setAttribute("title",mxResources.get("position"));var W=document.createElement("select");W.setAttribute("title",mxResources.get("position"));W.style.left="114px";W.style.width="98px";var ba="topLeft top topRight left center right bottomLeft bottom bottomRight".split(" "),K={topLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_RIGHT,+"10px";var Z=g.addButton(Editor.superscriptImage,mxResources.get("superscript")+" ("+Editor.ctrlKey+"+.)",function(){document.execCommand("superscript",!1,null)},z);R.style.marginLeft="10px";E=z.cloneNode(!1);E.style.paddingTop="4px";z=[g.addButton(Editor.orderedListImage,mxResources.get("numberedList"),function(){document.execCommand("insertorderedlist",!1,null)},E),g.addButton(Editor.unorderedListImage,mxResources.get("bulletedList"),function(){document.execCommand("insertunorderedlist",!1,null)},+E),g.addButton(Editor.indentImage,mxResources.get("increaseIndent"),function(){document.execCommand("indent",!1,null)},E),g.addButton(Editor.outdentImage,mxResources.get("decreaseIndent"),function(){document.execCommand("outdent",!1,null)},E),g.addButton(Editor.removeFormatImage,mxResources.get("removeFormat"),function(){document.execCommand("removeformat",!1,null)},E),g.addButton(Editor.codeImage,mxResources.get("html"),function(){d.cellEditor.toggleViewMode()},E)];z[z.length-2].style.marginLeft=+"10px";a.appendChild(E)}else u[2].style.marginRight="12px",H.style.marginRight="12px";z=l.cloneNode(!1);mxUtils.write(z,mxResources.get("position"));z.setAttribute("title",mxResources.get("position"));var W=document.createElement("select");W.setAttribute("title",mxResources.get("position"));W.style.left="114px";W.style.width="98px";var ba="topLeft top topRight left center right bottomLeft bottom bottomRight".split(" "),K={topLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM],top:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM],topRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM],left:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE],center:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE],right:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE,-mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE],bottomLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP],bottom:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP],bottomRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP]};for(F=0;F<ba.length;F++){var T=document.createElement("option");T.setAttribute("value",ba[F]);mxUtils.write(T,mxResources.get(ba[F]));+mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE],bottomLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP],bottom:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP],bottomRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP]};for(E=0;E<ba.length;E++){var T=document.createElement("option");T.setAttribute("value",ba[E]);mxUtils.write(T,mxResources.get(ba[E]));W.appendChild(T)}z.appendChild(W);ba=z.cloneNode(!1);mxUtils.write(ba,mxResources.get("writingDirection"));ba.setAttribute("title",mxResources.get("writingDirection"));var aa=W.cloneNode(!1);aa.setAttribute("title",mxResources.get("writingDirection"));T=["automatic","leftToRight","rightToLeft"];h.html&&(T.push("vertical-leftToRight"),T.push("vertical-rightToLeft"));var ka={automatic:null,leftToRight:mxConstants.TEXT_DIRECTION_LTR,rightToLeft:mxConstants.TEXT_DIRECTION_RTL,"vertical-leftToRight":mxConstants.TEXT_DIRECTION_VERTICAL_LR,-"vertical-rightToLeft":mxConstants.TEXT_DIRECTION_VERTICAL_RL};for(F=0;F<T.length;F++){var oa=document.createElement("option");oa.setAttribute("value",T[F]);"vertical-"==T[F].substring(0,9)?mxUtils.write(oa,mxResources.get("vertical")+" ("+mxResources.get(T[F].substring(9))+")"):mxUtils.write(oa,mxResources.get(T[F]));aa.appendChild(oa)}ba.appendChild(aa);d.isEditing()||(a.appendChild(z),mxEvent.addListener(W,"change",function(la){d.getModel().beginUpdate();try{var Ea=K[W.value];null!=Ea&&(d.setCellStyles(mxConstants.STYLE_LABEL_POSITION,+"vertical-rightToLeft":mxConstants.TEXT_DIRECTION_VERTICAL_RL};for(E=0;E<T.length;E++){var oa=document.createElement("option");oa.setAttribute("value",T[E]);"vertical-"==T[E].substring(0,9)?mxUtils.write(oa,mxResources.get("vertical")+" ("+mxResources.get(T[E].substring(9))+")"):mxUtils.write(oa,mxResources.get(T[E]));aa.appendChild(oa)}ba.appendChild(aa);d.isEditing()||(a.appendChild(z),mxEvent.addListener(W,"change",function(la){d.getModel().beginUpdate();try{var Ea=K[W.value];null!=Ea&&(d.setCellStyles(mxConstants.STYLE_LABEL_POSITION,Ea[0],h.cells),d.setCellStyles(mxConstants.STYLE_VERTICAL_LABEL_POSITION,Ea[1],h.cells),d.setCellStyles(mxConstants.STYLE_ALIGN,Ea[2],h.cells),d.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,Ea[3],h.cells))}finally{d.getModel().endUpdate()}mxEvent.consume(la)}),a.appendChild(ba),mxEvent.addListener(aa,"change",function(la){d.setCellStyles(mxConstants.STYLE_TEXT_DIRECTION,ka[aa.value],h.cells);mxEvent.consume(la)}));var pa=document.createElement("input");pa.style.position="absolute";pa.style.left="146px";pa.style.width="52px";pa.setAttribute("title",mxResources.get("fontSize"));k.appendChild(pa);z=this.installInputHandler(pa,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize,1,999," "+Editor.fontSizeUnit,function(la){if(null!=d.getSelectedEditingElement()){pa.value=la+" "+Editor.fontSizeUnit;document.execCommand("fontSize",!1,"1");for(var Ea=d.cellEditor.textarea.getElementsByTagName("font"),za=0;za<Ea.length;za++)if("1"==Ea[za].getAttribute("size")){Ea[za].removeAttribute("size");Ea[za].style.fontSize="";var Va=mxUtils.getCurrentStyle(Ea[za]);la!=b(Va)?Ea[za].style.fontSize=la+"px":""==Ea[za].getAttribute("style")&&Ea[za].removeAttribute("style")}}},!0);z=this.createStepper(pa,z,1,!0,Menus.prototype.defaultFontSize);z.style.display=pa.style.display;z.style.left="198px";"inherit"==h.style[mxConstants.STYLE_FONTSIZE]&&(pa.style.display="none",z.style.display="none");k.appendChild(z);var da=null,ia=d.shapeBackgroundColor,fa=null,O=d.shapeForegroundColor;k=mxUtils.getLightDarkColor(d.shapeBackgroundColor);@@ -3249,7 +3254,7 @@ ua.style.fontWeight="bold";k=1<=h.vertices.length?d.stylesheet.getDefaultVertexSla},destroy:function(){fa=null}},null,!0,null!=k[mxConstants.STYLE_FONTCOLOR]&&"default"!=k[mxConstants.STYLE_FONTCOLOR]?k[mxConstants.STYLE_FONTCOLOR]:d.shapeForegroundColor):this.createCellColorOption(mxResources.get("fontColor"),mxConstants.STYLE_FONTCOLOR,"default",function(la){ja.style.display=la==mxConstants.NONE?"none":"";ua.style.display=ja.style.display},function(la){la==mxConstants.NONE?d.setCellStyles(mxConstants.STYLE_NOLABEL,"1",h.cells):d.setCellStyles(mxConstants.STYLE_NOLABEL,null,h.cells);d.setCellStyles(mxConstants.STYLE_FONTCOLOR,la,h.cells);d.updateLabelElements(h.cells,function(Ea){Ea.removeAttribute("color");Ea.style.color=null})},d.shapeForegroundColor);"inherit"==h.style[mxConstants.STYLE_FONTCOLOR]&&(k.style.display="none");k.style.fontWeight="bold";t.appendChild(k);t.appendChild(ja);k=this.createCellOption(mxResources.get("shadow"),mxConstants.STYLE_TEXT_SHADOW,0);k.style.width="100%";k.style.fontWeight="bold";Editor.enableShadowOption||(k.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(k,60));d.cellEditor.isContentEditing()||(t.appendChild(ua),t.appendChild(k));a.appendChild(t);t=this.createPanel();t.style.paddingTop="2px";t.style.paddingBottom="4px";z=d.filterSelectionCells(mxUtils.bind(this,function(la){var Ea=d.view.getState(la);return null==Ea||d.getModel().isEdge(la)||d.isAutoSizeState(Ea)}));k=this.createCellOption(mxResources.get("wordWrap"),mxConstants.STYLE_WHITE_SPACE,null,"wrap","null",null,null,!0,z);k.style.fontWeight="bold";0<z.length&&-t.appendChild(k);z=this.createCellOption(mxResources.get("formattedText"),"html",0,null,null,null,g.actions.get("formattedText"));z.style.fontWeight="bold";t.appendChild(z);F=d.view.getState(d.getSelectionCell());(z="1"==mxUtils.getValue(h.style,"html",0))&&(1<d.getSelectionCount()&&"1"==h.style.convertToSvg||1==d.getSelectionCount()&&null!=F&&null!=F.text&&null!=F.text.node&&0==F.text.node.getElementsByTagName("foreignObject").length)&&(k.style.opacity="0.5",k.getElementsByTagName("input")[0].setAttribute("disabled",+t.appendChild(k);z=this.createCellOption(mxResources.get("formattedText"),"html",0,null,null,null,g.actions.get("formattedText"));z.style.fontWeight="bold";t.appendChild(z);E=d.view.getState(d.getSelectionCell());(z="1"==mxUtils.getValue(h.style,"html",0))&&(1<d.getSelectionCount()&&"1"==h.style.convertToSvg||1==d.getSelectionCount()&&null!=E&&null!=E.text&&null!=E.text.node&&0==E.text.node.getElementsByTagName("foreignObject").length)&&(k.style.opacity="0.5",k.getElementsByTagName("input")[0].setAttribute("disabled","disabled"));k=this.createCellOption(mxResources.get("lblToSvg"),"convertToSvg","0");k.style.fontWeight="bold";t.appendChild(k);z||(k.style.opacity="0.5",k.getElementsByTagName("input")[0].setAttribute("disabled","disabled"));z=this.createCellOption(mxResources.get("autosizeText"),"autosizeText","0",null,null,mxUtils.bind(this,function(la,Ea){if(Ea)for(Ea=0;Ea<la.length;Ea++)d.model.isVertex(la[Ea])&&d.updateAutosizeTextFontSize(la[Ea])}));z.style.fontWeight="bold";0<h.vertices.length&&t.appendChild(z);if(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)k.getElementsByTagName("span")[0].style.maxWidth="172px",k.appendChild(g.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/5165"));k=this.createPanel();k.style.height="86px";z=document.createElement("div");z.style.position="absolute";z.style.width="70px";z.style.marginTop="0px";z.style.fontWeight="bold";mxUtils.write(z,mxResources.get("spacing"));z.setAttribute("title",mxResources.get("spacing"));k.appendChild(z);var ya=this.addUnitInput(k,this.getUnit(),87,52,function(){ib.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());ya.setAttribute("title",mxResources.get("top"));var Ma=this.addUnitInput(k,this.getUnit(),16,52,function(){eb.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Ma.setAttribute("title",mxResources.get("global"));mxUtils.br(k);this.addLabel(k,mxResources.get("top"),87,64);this.addLabel(k,mxResources.get("global"),16,64);mxUtils.br(k);mxUtils.br(k);var Oa=@@ -3264,7 +3269,7 @@ t.appendChild(k);l=l.cloneNode(!1);z=[g.addButton(Editor.strokeColorImage,mxResonull});null==za||za==mxConstants.NONE?(Va.removeAttribute("border"),Va.style.border="",Va.style.borderCollapse=""):(Va.setAttribute("border","1"),Va.style.border="1px solid "+za,Va.style.borderCollapse="collapse")})}}),l),g.addButton(Editor.fillColorImage,mxResources.get("backgroundColor"),mxUtils.bind(this,function(la){if(null!=X){var Ea=X.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(za,Va,Ta,q){return"#"+("0"+Number(Va).toString(16)).substr(-2)+("0"+Number(Ta).toString(16)).substr(-2)+("0"+Number(q).toString(16)).substr(-2)});g.pickColor(Ea,function(za){var Va=null==S||null!=la&&mxEvent.isShiftDown(la)?X:S;d.processElements(Va,function(Ta){Ta.style.backgroundColor=null});Va.style.backgroundColor=null==za||za==mxConstants.NONE?"":za})}}),l),g.addButton(Editor.spacingImage,mxResources.get("spacing"),function(){if(null!=X){var la=X.getAttribute("cellPadding")||0;la=new FilenameDialog(g,la,mxResources.get("apply"),mxUtils.bind(this,function(Ea){null!=Ea&&0<Ea.length?X.setAttribute("cellPadding",Ea):X.removeAttribute("cellPadding")}),mxResources.get("spacing"));g.showDialog(la.container,300,80,!0,!0);la.init()}},l),g.addButton(Editor.alignLeftImage,mxResources.get("left"),function(){null!=X&&X.setAttribute("align","left")},l),g.addButton(Editor.alignCenterImage,mxResources.get("center"),function(){null!=X&&X.setAttribute("align","center")},l),g.addButton(Editor.alignRightImage,mxResources.get("right"),function(){null!=X&&X.setAttribute("align",-"right")},l)];z[2].style.marginRight="10px";t.appendChild(l);a.appendChild(t);var $a=t}else a.appendChild(t),a.appendChild(this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_TEXT_OPACITY)),a.appendChild(k);for(F=0;3>F;F++)(function(la){mxEvent.addListener(u[la],"click",function(){f(u[la],""==u[la].style.backgroundImage)})})(F);var ab=mxUtils.bind(this,function(la,Ea,za){h=g.getSelectionState();la=mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0);f(u[0],(la&mxConstants.FONT_BOLD)==+"right")},l)];z[2].style.marginRight="10px";t.appendChild(l);a.appendChild(t);var $a=t}else a.appendChild(t),a.appendChild(this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_TEXT_OPACITY)),a.appendChild(k);for(E=0;3>E;E++)(function(la){mxEvent.addListener(u[la],"click",function(){f(u[la],""==u[la].style.backgroundImage)})})(E);var ab=mxUtils.bind(this,function(la,Ea,za){h=g.getSelectionState();la=mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0);f(u[0],(la&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD);f(u[1],(la&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC);f(u[2],(la&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE);g.toolbar.setMenuText(v,mxUtils.getValue(h.style,mxConstants.STYLE_FONTFAMILY,Menus.prototype.defaultFont));f(y,"0"==mxUtils.getValue(h.style,mxConstants.STYLE_HORIZONTAL,"1"));if(za||document.activeElement!=pa)la=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize)),pa.value=isNaN(la)?"":la+" "+Editor.fontSizeUnit;la=mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);f(D,la==mxConstants.ALIGN_LEFT);f(G,la==mxConstants.ALIGN_CENTER);f(H,la==mxConstants.ALIGN_RIGHT);la=mxUtils.getValue(h.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);f(M,la==mxConstants.ALIGN_TOP);f(N,la==mxConstants.ALIGN_MIDDLE);f(L,la==mxConstants.ALIGN_BOTTOM);la=mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);Ea=mxUtils.getValue(h.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);W.value=la==mxConstants.ALIGN_LEFT&&Ea==mxConstants.ALIGN_TOP?"topLeft":la==mxConstants.ALIGN_CENTER&&Ea==mxConstants.ALIGN_TOP?"top":la==mxConstants.ALIGN_RIGHT&&Ea==mxConstants.ALIGN_TOP?"topRight":la==mxConstants.ALIGN_LEFT&&Ea==mxConstants.ALIGN_BOTTOM?"bottomLeft":la==mxConstants.ALIGN_CENTER&&Ea==mxConstants.ALIGN_BOTTOM?"bottom":la==mxConstants.ALIGN_RIGHT&&Ea==mxConstants.ALIGN_BOTTOM?"bottomRight":la==mxConstants.ALIGN_LEFT?"left":la==mxConstants.ALIGN_RIGHT?"right":@@ -3274,7 +3279,7 @@ mxConstants.STYLE_SPACING,2)),Ma.value=isNaN(la)?"":this.inUnit(la)+" "+this.getmxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var jb=this.installInputHandler(Ka,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var db=this.installInputHandler(Oa,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(pa,ab);this.addKeyHandler(Ma,ab);this.addKeyHandler(ya,ab);this.addKeyHandler(La,ab);this.addKeyHandler(Ka,ab);this.addKeyHandler(Oa,ab);d.getModel().addListener(mxEvent.CHANGE,ab);this.listeners.push({destroy:function(){d.getModel().removeListener(ab)}});ab();if(d.cellEditor.isContentEditing()){var kb=null,hb=!1;l=mxUtils.bind(this,function(){hb||(hb=!0,window.setTimeout(mxUtils.bind(this,function(){var la=d.getSelectedEditingElement();if(null!=la&&null!=d.cellEditor.textarea){var Ea=function(ca,na){if(null!=ca&&null!=na){if(ca==na)return!0;if(ca.length>na.length+1)return ca.substring(ca.length-na.length-1,ca.length)=="-"+na}return!1},za=function(ca){if(null!=d.getParentByName(la,ca,d.cellEditor.textarea))return!0;for(var na=la;null!=na&&1==na.childNodes.length;)if(na=na.childNodes[0],na.nodeName==ca)return!0;return!1},Va=function(ca){for(;null!=ca&&ca!=d.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle(ca).display)return ca;ca=ca.parentNode}return null},Ta=mxUtils.getCurrentStyle(la),q=la==d.cellEditor.textarea||""==la.style.lineHeight?null:la.style.lineHeight,B=la==d.cellEditor.textarea||""==la.style.fontSize?null:b(Ta);if(window.getSelection)for(var C=la.getElementsByTagName("*"),-E=window.getSelection(),J=0;J<C.length&&(!E.containsNode(C[J],!0)||null==C[J].style||(null==B&&""!=C[J].style.fontSize&&(B=parseFloat(C[J].style.fontSize)),null==q&&""!=C[J].style.lineHeight&&(q=C[J].style.lineHeight),null==B||null==q));J++);null==B&&(B=b(Ta));if(null==q)for(C=la;null!=C&&C!=d.cellEditor.textarea.parentNode;){if(null!=C.style&&""!=C.style.lineHeight){q=C.style.lineHeight;break}C=C.parentNode}if(null!=Ta){f(u[0],"bold"==Ta.fontWeight||400<Ta.fontWeight||za("B")||za("STRONG"));f(u[1],+F=window.getSelection(),J=0;J<C.length&&(!F.containsNode(C[J],!0)||null==C[J].style||(null==B&&""!=C[J].style.fontSize&&(B=parseFloat(C[J].style.fontSize)),null==q&&""!=C[J].style.lineHeight&&(q=C[J].style.lineHeight),null==B||null==q));J++);null==B&&(B=b(Ta));if(null==q)for(C=la;null!=C&&C!=d.cellEditor.textarea.parentNode;){if(null!=C.style&&""!=C.style.lineHeight){q=C.style.lineHeight;break}C=C.parentNode}if(null!=Ta){f(u[0],"bold"==Ta.fontWeight||400<Ta.fontWeight||za("B")||za("STRONG"));f(u[1],"italic"==Ta.fontStyle||za("I")||za("EM"));f(u[2],"underline"==Ta.textDecorationLine||za("U"));f(U,"line-through"==Ta.textDecorationLine||za("STRIKE"));f(Z,za("SUP"));f(R,za("SUB"));var P=Va(la);if(null!=P){za=function(ca,na){ma.push({name:ca,dispName:na,type:"string",getValue:function(){return Y[ca]},valueChanged:function(ta,Fa){var Da=P.style,Na=ta;parseInt(Na)==Na&&(Na+="px",null!=Fa&&(Fa.value=Na));Da[ca]=Na;""==ta&&null!=Fa&&(Fa.value=Y[ca])}})};var Y=mxUtils.getCurrentStyle(P),ma=[];za("paddingTop","Padding Top");za("paddingRight","Padding Right");za("paddingLeft","Padding Left");za("paddingBottom","Padding Bottom");za("marginTop","Margin Top");za("marginRight","Margin Right");za("marginLeft","Margin Left");za("marginBottom","Margin Bottom");za=this.createPanel();this.addProperties(za,ma,h,!0);null!=kb?kb.parentNode.replaceChild(za,kb):a.appendChild(za);kb=za}d.cellEditor.isTableSelected()?(f(ha,Ea(Ta.textAlign,"justify")),f(D,Ea(Ta.textAlign,"left")),f(G,Ea(Ta.textAlign,"center")),f(H,Ea(Ta.textAlign,"right"))):(za=d.cellEditor.align||mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),Ea(Ta.textAlign,"justify")?(f(ha,Ea(Ta.textAlign,"justify")),f(D,!1),f(G,!1),f(H,!1)):(f(ha,!1),f(D,za==mxConstants.ALIGN_LEFT),f(G,za==mxConstants.ALIGN_CENTER),f(H,za==mxConstants.ALIGN_RIGHT)));X=d.getParentByName(la,"TABLE",d.cellEditor.textarea);V=null==X?null:d.getParentByName(la,"TR",X);S=null==X?null:d.getParentByNames(la,["TD","TH"],X);$a.style.display=null!=X?"":"none";document.activeElement!=@@ -3285,8 +3290,8 @@ var b=this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_OPAStyleFormatPanel.prototype.getCssRules=function(a){var b=document.implementation.createHTMLDocument(""),e=document.createElement("style");mxUtils.setTextContent(e,a);b.body.appendChild(e);return e.sheet.cssRules};StyleFormatPanel.prototype.addSvgStyles=function(a){var b=this.editorUi.getSelectionState();a.style.paddingTop="6px";a.style.paddingBottom="6px";a.style.fontWeight="bold";a.style.display="none";try{var e=b.style.editableCssRules;if(null!=e){var f=new RegExp(e),g=b.style.image.substring(b.style.image.indexOf(",")+1),d=window.atob?decodeURIComponent(escape(atob(g))):Base64.decode(g,!0),h=mxUtils.parseXml(d);if(null!=h){var l="light"==h.documentElement.style.colorScheme||"0"==mxUtils.getValue(b.style,"darkMode",null),t=""==h.documentElement.style.colorScheme,k=h.getElementsByTagName("style");for(b=0;b<k.length;b++){var v=this.getCssRules(mxUtils.getTextContent(k[b]));for(e=0;e<v.length;e++)this.addSvgRule(a,v[e],h,k[b],v,e,f,l,t)}}}}catch(u){}return a};StyleFormatPanel.prototype.getColorSchemeFromCss=function(a){return(a=a.match(/color-scheme\s*:\s*([^;]+)/i))?a[1].trim():null};-StyleFormatPanel.prototype.addSvgRule=function(a,b,e,f,g,d,h,l,t){var k=this.editorUi,v=k.editor.graph;h.test(b.selectorText)&&(h=mxUtils.bind(this,function(u,y,z,F){var D=mxUtils.trim(u.style.getPropertyValue(y));if(""!=D&&"url("!=D.substring(0,4)){var G=D;"transparent"==G?G=mxConstants.NONE:(D=mxUtils.isLightDarkColor(G))&&F?F=!1:D||F||(G="light-dark("+G+", "+G+")");u=this.createColorOption(z+" "+u.selectorText,function(){return G},mxUtils.bind(this,function(H){g[d].style.setProperty(y,H==mxConstants.NONE?-"transparent":mxUtils.getLightDarkColor(H).cssText);H="";t&&mxUtils.isLightDarkColor(g[d].style[y])&&(e.documentElement.style.colorScheme="light dark");for(var M=0;M<g.length;M++)H+=g[M].cssText+" ";f.textContent=H;H=mxUtils.getXml(e.documentElement);v.setCellStyles(mxConstants.STYLE_IMAGE,"data:image/svg+xml,"+(window.btoa?btoa(unescape(encodeURIComponent(H))):Base64.encode(H,!0)),k.getSelectionState().cells)}),"#ffffff",{install:function(H){},destroy:function(){}},null,null,null,F);a.appendChild(u);+StyleFormatPanel.prototype.addSvgRule=function(a,b,e,f,g,d,h,l,t){var k=this.editorUi,v=k.editor.graph;h.test(b.selectorText)&&(h=mxUtils.bind(this,function(u,y,z,E){var D=mxUtils.trim(u.style.getPropertyValue(y));if(""!=D&&"url("!=D.substring(0,4)){var G=D;"transparent"==G?G=mxConstants.NONE:(D=mxUtils.isLightDarkColor(G))&&E?E=!1:D||E||(G="light-dark("+G+", "+G+")");u=this.createColorOption(z+" "+u.selectorText,function(){return G},mxUtils.bind(this,function(H){g[d].style.setProperty(y,H==mxConstants.NONE?+"transparent":mxUtils.getLightDarkColor(H).cssText);H="";t&&mxUtils.isLightDarkColor(g[d].style[y])&&(e.documentElement.style.colorScheme="light dark");for(var M=0;M<g.length;M++)H+=g[M].cssText+" ";f.textContent=H;H=mxUtils.getXml(e.documentElement);v.setCellStyles(mxConstants.STYLE_IMAGE,"data:image/svg+xml,"+(window.btoa?btoa(unescape(encodeURIComponent(H))):Base64.encode(H,!0)),k.getSelectionState().cells)}),"#ffffff",{install:function(H){},destroy:function(){}},null,null,null,E);a.appendChild(u);a.style.display=""}}),h(b,"fill",mxResources.get("fill"),l),h(b,"stroke",mxResources.get("line"),l),h(b,"stop-color",mxResources.get("gradient"),l))};StyleFormatPanel.prototype.addEditOps=function(a){var b=this.editorUi.getSelectionState();if(1==b.cells.length){var e=document.createElement("select");e.style.position="relative";e.style.marginBottom="2px";e.className="geFullWidthElement";var f="edit copyAsText editLink editShape editImage editData copyData pasteData editConnectionPoints editGeometry editPolygon editTooltip editStyle".split(" "),g=null;if(null!=this.editorUi.sidebar){var d=this.editorUi.sidebar.getKeyStyle(b.cells[0].style);g=this.editorUi.sidebar.getLibsForStyle(d);null!=g||this.editorUi.sidebar.isSearchIndexLoaded()||null==b.style.shape||"mxgraph."!=String(b.style.shape).substring(0,8)||(g=[])}null!=g&&f.push("openLibrary");for(d=0;d<f.length;d++){var h=this.editorUi.actions.get(f[d]);if(null==h||h.enabled){var l=document.createElement("option");l.setAttribute("value",f[d]);var t=mxResources.get(f[d]);mxUtils.write(l,t);null!=h&&null!=h.shortcut&&(t+=" ("+h.shortcut+")");l.setAttribute("title",t);e.appendChild(l)}}1<e.children.length&&(a.appendChild(e),mxEvent.addListener(e,@@ -3295,9 +3300,9 @@ null!=f&&null!=mxUtils.getValue(f.style,mxConstants.STYLE_IMAGE,null)&&(f=mxUtilStyleFormatPanel.prototype.addFill=function(a){function b(){h.innerHTML="";z=1;for(var G=0;G<Editor.fillStyles.length;G++){var H=document.createElement("option");H.setAttribute("value",Editor.fillStyles[G].val);mxUtils.write(H,Editor.fillStyles[G].dispName);h.appendChild(H)}}var e=this.editorUi,f=e.editor.graph,g=e.getSelectionState(),d=document.createElement("select");d.setAttribute("title",mxResources.get("gradient"));d.style.position="absolute";d.style.left="76px";d.style.width="86px";var h=d.cloneNode(!1);h.setAttribute("title",mxResources.get("fill"));mxEvent.addListener(d,"click",function(G){mxEvent.consume(G)});mxEvent.addListener(h,"click",function(G){mxEvent.consume(G)});var l=this.createCellColorOption(mxResources.get("gradient"),mxConstants.STYLE_GRADIENTCOLOR,"default",function(G){d.style.display=null==G||G==mxConstants.NONE?"none":""},function(G){f.updateCellStyles({gradientColor:G},f.getSelectionCells())},f.getDefaultColor(g.style,mxConstants.STYLE_GRADIENTCOLOR,f.shapeForegroundColor,f.shapeBackgroundColor));l.style.fontWeight="bold";var t="image"==g.style.shape?mxConstants.STYLE_IMAGE_BACKGROUND:mxConstants.STYLE_FILLCOLOR,k=this.createCellColorOption(mxResources.get("fill"),t,"default",null,mxUtils.bind(this,function(G){f.setCellStyles(t,G,g.cells)}),f.getDefaultColor(g.style,t,f.shapeBackgroundColor,f.shapeForegroundColor));k.style.fontWeight="bold";var v=mxUtils.getValue(g.style,t,null);l.style.display=null!=v&&v!=mxConstants.NONE&&g.fill&&"image"!=g.style.shape?"":"none";var u=[mxConstants.DIRECTION_NORTH,-mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_RADIAL];for(v=0;v<u.length;v++){var y=document.createElement("option");y.setAttribute("value",u[v]);mxUtils.write(y,mxResources.get(u[v]));d.appendChild(y)}l.appendChild(d);var z;b();g.gradient&&k.appendChild(h);var F=mxUtils.bind(this,function(){g=e.getSelectionState();var G=mxUtils.getValue(g.style,mxConstants.STYLE_GRADIENT_DIRECTION,mxConstants.DIRECTION_SOUTH),H=mxUtils.getValue(g.style,"fillStyle",+mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_RADIAL];for(v=0;v<u.length;v++){var y=document.createElement("option");y.setAttribute("value",u[v]);mxUtils.write(y,mxResources.get(u[v]));d.appendChild(y)}l.appendChild(d);var z;b();g.gradient&&k.appendChild(h);var E=mxUtils.bind(this,function(){g=e.getSelectionState();var G=mxUtils.getValue(g.style,mxConstants.STYLE_GRADIENT_DIRECTION,mxConstants.DIRECTION_SOUTH),H=mxUtils.getValue(g.style,"fillStyle","auto");""==G&&(G=mxConstants.DIRECTION_SOUTH);d.value=G;a.style.display=g.fill?"":"none";G=mxUtils.getValue(g.style,t,null);if(g.fill&&null!=G&&G!=mxConstants.NONE&&"filledEdge"!=g.style.shape){if("1"==g.style.sketch){if(2!=z){h.innerHTML="";z=2;for(G=0;G<Editor.roughFillStyles.length;G++){var M=document.createElement("option");M.setAttribute("value",Editor.roughFillStyles[G].val);mxUtils.write(M,Editor.roughFillStyles[G].dispName);h.appendChild(M)}h.value="auto"}}else 1!=z&&b();h.value=H;h.value||-(H="auto",h.value=H);h.style.display="1"==g.style.sketch||"none"==d.style.display?"":"none";l.style.display=!g.gradient||g.containsImage||"1"==g.style.sketch&&"solid"!=H&&"auto"!=H?"none":""}else h.style.display="none",l.style.display="none"});f.getModel().addListener(mxEvent.CHANGE,F);this.listeners.push({destroy:function(){f.getModel().removeListener(F)}});F();mxEvent.addListener(d,"change",function(G){f.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,d.value,g.cells);e.fireEvent(new mxEventObject("styleChanged",+(H="auto",h.value=H);h.style.display="1"==g.style.sketch||"none"==d.style.display?"":"none";l.style.display=!g.gradient||g.containsImage||"1"==g.style.sketch&&"solid"!=H&&"auto"!=H?"none":""}else h.style.display="none",l.style.display="none"});f.getModel().addListener(mxEvent.CHANGE,E);this.listeners.push({destroy:function(){f.getModel().removeListener(E)}});E();mxEvent.addListener(d,"change",function(G){f.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,d.value,g.cells);e.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_GRADIENT_DIRECTION],"values",[d.value],"cells",g.cells));mxEvent.consume(G)});mxEvent.addListener(h,"change",function(G){f.setCellStyles("fillStyle",h.value,g.cells);e.fireEvent(new mxEventObject("styleChanged","keys",["fillStyle"],"values",[h.value],"cells",g.cells));mxEvent.consume(G)});a.appendChild(k);a.appendChild(l);var D={};k=this.getCustomColors();for(v=0;v<k.length;v++)D[k[v].key]||(D[k[v].key]=!0,a.appendChild(this.createCellColorOption(k[v].title,k[v].key,k[v].defaultValue,null,null,k[v].defaultColorValue,k[v].undefinedColor,!0)));k=mxUtils.bind(this,function(G,H,M){if(null!=G){G=G.split(",");H=null!=H?H.split(","):null;for(var N=0;N<G.length;N++)if(!D[G[N]]){D[G[N]]=!0;var L=null!=H?H[mxUtils.mod(N,H.length)]:null,U=null!=L?L:"default";a.appendChild(this.createCellColorOption(Editor.getLabelForStylename(G[N]),G[N],U,null,null,M,L,!0))}}});k(g.style.fillColorStyles,g.style.defaultFillColors,f.shapeBackgroundColor);k(g.style.strokeColorStyles,g.style.defaultStrokeColors,f.shapeForegroundColor);return a};@@ -3309,15 +3314,15 @@ mxConstants.STYLE_STROKEWIDTH,1)&&(h.setCellStyles(mxConstants.STYLE_STROKEWIDTH"keys",[mxConstants.STYLE_STROKEWIDTH],"values",[qa],"cells",l.cells)));U.value=g.inUnit(qa)+" "+g.getUnit();mxEvent.consume(O)}var g=this,d=this.editorUi,h=d.editor.graph,l=d.getSelectionState(),t=document.createElement("div");t.className="geFormatEntry";l.stroke||(t.style.display="none");var k=document.createElement("select");k.setAttribute("title",mxResources.get("style"));k.style.position="absolute";k.style.left="72px";k.style.width="90px";for(var v=["sharp","rounded","curved"],u=0;u<v.length;u++){var y=document.createElement("option");y.setAttribute("value",v[u]);mxUtils.write(y,mxResources.get(v[u]));k.appendChild(y)}mxEvent.addListener(k,"change",function(O){h.getModel().beginUpdate();try{var qa=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],ja=["0","0"];"rounded"==k.value?ja=["1","0"]:"curved"==k.value&&(ja=["0","1"]);for(var ua=0;ua<qa.length;ua++)h.setCellStyles(qa[ua],ja[ua],l.cells);d.fireEvent(new mxEventObject("styleChanged","keys",qa,"values",ja,"cells",l.cells))}finally{h.getModel().endUpdate()}mxEvent.consume(O)});mxEvent.addListener(k,"click",function(O){mxEvent.consume(O)});var z="image"==l.style.shape?mxConstants.STYLE_IMAGE_BORDER:mxConstants.STYLE_STROKECOLOR;v="image"==l.style.shape?mxResources.get("border"):mxResources.get("line");u=this.createCellColorOption(v,z,"default",null,mxUtils.bind(this,function(O){h.setCellStyles(z,O,l.cells);if(null==O||O==mxConstants.NONE){O=[];for(var qa=0;qa<l.cells.length;qa++)(h.isTableCell(l.cells[qa])||h.isTableRow(l.cells[qa]))&&O.push(l.cells[qa]);0<O.length&&h.setCellStyles(z,-"inherit",O)}}),h.shapeForegroundColor);u.style.fontWeight="bold";u.appendChild(k);var F=t.cloneNode(!1);F.style.position="relative";var D=mxUtils.bind(this,function(O,qa,ja,ua,ya){O=this.editorUi.menus.styleChange(O,"",ua,ya,"");ua=document.createElement("div");this.addDashPattern(ua,ja);O.firstChild.firstChild.className="geStyleMenuItem";O.firstChild.firstChild.style.width=qa+"px";O.firstChild.firstChild.appendChild(ua);return O}),G=[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],H=d.toolbar.addMenu(new Menu(mxUtils.bind(this,+"inherit",O)}}),h.shapeForegroundColor);u.style.fontWeight="bold";u.appendChild(k);var E=t.cloneNode(!1);E.style.position="relative";var D=mxUtils.bind(this,function(O,qa,ja,ua,ya){O=this.editorUi.menus.styleChange(O,"",ua,ya,"");ua=document.createElement("div");this.addDashPattern(ua,ja);O.firstChild.firstChild.className="geStyleMenuItem";O.firstChild.firstChild.style.width=qa+"px";O.firstChild.firstChild.appendChild(ua);return O}),G=[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],H=d.toolbar.addMenu(new Menu(mxUtils.bind(this,function(O){D(O,110,"solid",G,[null,null]).setAttribute("title",mxResources.get("solid"));D(O,110,"dashed",G,["1",null]).setAttribute("title",mxResources.get("dashed")+" (1)");D(O,110,"8 8",G,["1","8 8"]).setAttribute("title",mxResources.get("dashed")+" (2)");D(O,110,"12 12",G,["1","12 12"]).setAttribute("title",mxResources.get("dashed")+" (3)");D(O,110,"8 4 1 4",G,["1","8 4 1 4"]).setAttribute("title",mxResources.get("dashed")+" (4)");D(O,110,"dotted",G,["1","1 1"]).setAttribute("title",mxResources.get("dotted")+-" (1)");D(O,110,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");D(O,110,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");O.addItem("",null,mxUtils.bind(this,function(){d.prompt(mxResources.get("pattern"),mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(qa){d.menus.createStyleChangeFunction(G,["1",qa])()}),!0)})).firstChild.appendChild(b(110))})),"",null,F),M=F.cloneNode(!1),N=d.toolbar.addMenu(new Menu(mxUtils.bind(this,+" (1)");D(O,110,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");D(O,110,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");O.addItem("",null,mxUtils.bind(this,function(){d.prompt(mxResources.get("pattern"),mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(qa){d.menus.createStyleChangeFunction(G,["1",qa])()}),!0)})).firstChild.appendChild(b(110))})),"",null,E),M=E.cloneNode(!1),N=d.toolbar.addMenu(new Menu(mxUtils.bind(this,function(O){var qa=[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,mxConstants.STYLE_DASHED,"width"];Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,[null,null,null,null,null],"",null,null,null,!0,Format.connectionImage.src)).setAttribute("title",mxResources.get("line"));Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["link",null,null,null,null],"",null,null,null,!0,Format.linkEdgeImage.src)).setAttribute("title",mxResources.get("link"));Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["flexArrow",null,null,null,null],"",null,null,null,!0,Format.arrowImage.src)).setAttribute("title",mxResources.get("arrow"));Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["arrow",null,null,null,null],"",null,null,null,!0,Format.simpleArrowImage.src)).setAttribute("title",mxResources.get("simpleArrow"));Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["filledEdge",null,null,null,null],"",null,null,null,!0,Format.filledEdgeImage.src)).setAttribute("title","Filled Edge");Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["pipe",null,null,null,null],"",null,null,null,!0,Format.pipeEdgeImage.src)).setAttribute("title","Pipe");Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["wire",null,null,"1",null],"",null,null,null,!0,Format.wireEdgeImage.src)).setAttribute("title","Wire")})),"",null,M);N.setAttribute("title",mxResources.get("connection"));y=d.toolbar.addMenu(new Menu(mxUtils.bind(this,function(O){D(O,44,"solid",G,[null,null]).setAttribute("title",mxResources.get("solid"));D(O,44,"dashed",G,["1",null]).setAttribute("title",mxResources.get("dashed")+" (1)");D(O,44,"8 8",G,["1","8 8"]).setAttribute("title",mxResources.get("dashed")+" (2)");D(O,44,"12 12",G,["1","12 12"]).setAttribute("title",mxResources.get("dashed")+" (3)");D(O,44,"8 4 1 4",G,["1","8 4 1 4"]).setAttribute("title",mxResources.get("dashed")+" (4)");D(O,44,"dotted",G,["1","1 1"]).setAttribute("title",mxResources.get("dotted")+-" (1)");D(O,44,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");D(O,44,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");O.addItem("",null,mxUtils.bind(this,function(){d.prompt(mxResources.get("pattern"),mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(qa){d.menus.createStyleChangeFunction(G,["1",qa])()}),!0)})).firstChild.appendChild(b(44))})),"",null,M);v=F.cloneNode(!1);var L=document.createElement("input");-L.style.position="absolute";L.style.width="52px";L.style.left="148px";L.setAttribute("title",mxResources.get("linewidth"));F.appendChild(L);var U=L.cloneNode(!0);U.style.width="56px";U.style.left="144px";M.appendChild(U);var X=this.createStepper(L,e,this.getUnitStep(),null,null,this.isFloatUnit());X.style.display=L.style.display;F.appendChild(X);X=this.createStepper(U,f,this.getUnitStep(),null,null,this.isFloatUnit());X.style.display=U.style.display;M.appendChild(X);mxEvent.addListener(L,"blur",e);+" (1)");D(O,44,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");D(O,44,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");O.addItem("",null,mxUtils.bind(this,function(){d.prompt(mxResources.get("pattern"),mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(qa){d.menus.createStyleChangeFunction(G,["1",qa])()}),!0)})).firstChild.appendChild(b(44))})),"",null,M);v=E.cloneNode(!1);var L=document.createElement("input");+L.style.position="absolute";L.style.width="52px";L.style.left="148px";L.setAttribute("title",mxResources.get("linewidth"));E.appendChild(L);var U=L.cloneNode(!0);U.style.width="56px";U.style.left="144px";M.appendChild(U);var X=this.createStepper(L,e,this.getUnitStep(),null,null,this.isFloatUnit());X.style.display=L.style.display;E.appendChild(X);X=this.createStepper(U,f,this.getUnitStep(),null,null,this.isFloatUnit());X.style.display=U.style.display;M.appendChild(X);mxEvent.addListener(L,"blur",e);mxEvent.addListener(L,"change",e);mxEvent.addListener(U,"blur",f);mxEvent.addListener(U,"change",f);var S=d.toolbar.addMenu(new Menu(mxUtils.bind(this,function(O){"arrow"!=l.style.shape&&(Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],[null,null,null],null,null,!0,Format.straightImage.src)).setAttribute("title",mxResources.get("straight")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["orthogonalEdgeStyle",null,null],null,null,!0,Format.orthogonalImage.src)).setAttribute("title",mxResources.get("orthogonal")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle","vertical",null,null],null,null,!0,Format.verticalElbowImage.src)).setAttribute("title",mxResources.get("horizontal")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle",null,null,null],null,null,!0,Format.horizontalElbowImage.src)).setAttribute("title",mxResources.get("vertical")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["isometricEdgeStyle",null,null,null],@@ -3354,7 +3359,7 @@ null,null,!1,d.getImageForMarker(qa,ja,l.style.shape,l.style.shape)),"scaleX(-1)!1,Format.ERzeroToOneMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERzeroToMany",0],null,null,!1,Format.ERzeroToManyMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_ENDARROW,"endFill"],["doubleBlock",0],null,null,!1,Format.doubleBlockMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_ENDARROW,"endFill"],["doubleBlock",1],null,null,!1,Format.doubleBlockFilledMarkerImage.src),"scaleX(-1)")):Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,null,!1,Format.blockMarkerImage.src),"scaleX(-1)").setAttribute("title",mxResources.get("block"));O.div.style.width="40px";window.setTimeout(mxUtils.bind(this,function(){null!=O.div&&mxUtils.fit(O.div)}),0)}})),"",null,v);N.style.width="67px";N.style.marginRight="2px";y.style.width="67px";y.style.marginRight="2px";S.style.width="67px";S.style.marginRight="2px";V.style.width="67px";V.style.marginRight="2px";ha.style.width="67px";ha.style.marginRight="2px";this.addArrow(N).appendChild(document.createElement("div"));this.addArrow(S).appendChild(document.createElement("div"));this.addArrow(V);this.addArrow(ha);H.style.width="142px";H=this.addArrow(H);y=this.addArrow(y);var R=document.createElement("div");R.className="gePatternPreview";R.style.width="100px";R.style.borderBottomStyle=-"solid";H.appendChild(R);var Z=document.createElement("div");Z.className="gePatternPreview";Z.style.width="36px";Z.style.borderBottomStyle="solid";y.appendChild(Z);a.appendChild(u);a.appendChild(M);a.appendChild(F);u=F.cloneNode(!1);u.style.display="block";u.style.height="60px";u.style.paddingTop="2px";u.style.overflow="visible";y=document.createElement("div");y.style.position="absolute";y.style.maxWidth="78px";y.style.overflow="hidden";y.style.textOverflow="ellipsis";y.style.marginTop="4px";y.style.fontWeight=+"solid";H.appendChild(R);var Z=document.createElement("div");Z.className="gePatternPreview";Z.style.width="36px";Z.style.borderBottomStyle="solid";y.appendChild(Z);a.appendChild(u);a.appendChild(M);a.appendChild(E);u=E.cloneNode(!1);u.style.display="block";u.style.height="60px";u.style.paddingTop="2px";u.style.overflow="visible";y=document.createElement("div");y.style.position="absolute";y.style.maxWidth="78px";y.style.overflow="hidden";y.style.textOverflow="ellipsis";y.style.marginTop="4px";y.style.fontWeight="normal";mxUtils.write(y,mxResources.get("size"));y.setAttribute("title",mxResources.get("size"));u.appendChild(y);var W=this.addUnitInput(u,this.getUnit(),82,52,function(){oa.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());W.setAttribute("title",mxResources.get("linestart"));var ba=this.addUnitInput(u,this.getUnit(),16,52,function(){da.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());ba.setAttribute("title",mxResources.get("lineend"));mxUtils.br(u);H=document.createElement("div");H.style.height="8px";u.appendChild(H);y=X=y.cloneNode(!1);mxUtils.write(y,mxResources.get("spacing"));y.setAttribute("title",mxResources.get("spacing"));u.appendChild(y);var K=this.addUnitInput(u,this.getUnit(),82,52,function(){pa.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());K.setAttribute("title",mxResources.get("linestart"));var T=this.addUnitInput(u,this.getUnit(),16,52,function(){ia.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());T.setAttribute("title",mxResources.get("lineend"));mxUtils.br(u);this.addLabel(u,mxResources.get("linestart"),82,62).style.fontSize="10px";this.addLabel(u,mxResources.get("lineend"),16,62).style.fontSize="10px";mxUtils.br(u);t=t.cloneNode(!1);t.className="geFormatEntry";y=document.createElement("div");mxUtils.write(y,mxResources.get("perimeter"));y.setAttribute("title",mxResources.get("perimeter"));t.appendChild(y);var aa=this.addUnitInput(t,this.getUnit(),16,52,function(){fa.apply(this,@@ -3362,7 +3367,7 @@ arguments)},this.getUnitStep(),null,null,this.isFloatUnit());aa.setAttribute("timxUtils.bind(this,function(O,qa,ja){function ua(ya,Ma,Oa,Ka){Oa=Oa.getElementsByTagName("div")[0];null!=Oa&&d.updateCssForMarker(Oa,Ka,l.style.shape,ya,Ma);return Oa}l=d.getSelectionState();if(ja||document.activeElement!=L)O=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)),L.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=U)O=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)),U.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();k.style.visibility="connector"==l.style.shape||"filledEdge"==l.style.shape||"wire"==l.style.shape||"pipe"==l.style.shape?"":"hidden";"1"==mxUtils.getValue(l.style,mxConstants.STYLE_CURVED,null)?k.value="curved":"1"==mxUtils.getValue(l.style,mxConstants.STYLE_ROUNDED,null)&&(k.value="rounded");R.style.borderBottom="1px solid black";"1"==mxUtils.getValue(l.style,mxConstants.STYLE_DASHED,null)&&(O=mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,""),2<=String(O).split(" ").length?(R.style.borderBottom="1px solid transparent",this.addDashPattern(R,O)):R.style.borderBottom="1px dashed black");Z.style.backgroundImage=R.style.backgroundImage;Z.style.backgroundPosition=R.style.backgroundPosition;Z.style.backgroundSize=R.style.backgroundSize;Z.style.backgroundRepeat=R.style.backgroundRepeat;Z.style.borderBottom=R.style.borderBottom;O=S.getElementsByTagName("div")[1];null!=O&&(O.style.backgroundImage="url("+d.getImageForEdgeStyle(l.style)+")");O=N.getElementsByTagName("div")[1];null!=O&&(O.style.backgroundImage=-"url("+d.getImageForEdgeShape(l.style)+")");l.edges.length==l.cells.length?(M.style.display="",F.style.display="none"):(M.style.display="none",F.style.display="");Graph.lineJumpsEnabled&&0<l.edges.length&&0==l.vertices.length&&l.lineJumps&&(a.style.borderBottomStyle="none");ua(mxUtils.getValue(l.style,mxConstants.STYLE_STARTARROW,null),mxUtils.getValue(l.style,"startFill","1"),V,"start");ua(mxUtils.getValue(l.style,mxConstants.STYLE_ENDARROW,null),mxUtils.getValue(l.style,"endFill","1"),ha,"end");+"url("+d.getImageForEdgeShape(l.style)+")");l.edges.length==l.cells.length?(M.style.display="",E.style.display="none"):(M.style.display="none",E.style.display="");Graph.lineJumpsEnabled&&0<l.edges.length&&0==l.vertices.length&&l.lineJumps&&(a.style.borderBottomStyle="none");ua(mxUtils.getValue(l.style,mxConstants.STYLE_STARTARROW,null),mxUtils.getValue(l.style,"startFill","1"),V,"start");ua(mxUtils.getValue(l.style,mxConstants.STYLE_ENDARROW,null),mxUtils.getValue(l.style,"endFill","1"),ha,"end");mxUtils.setOpacity(S,"arrow"==l.style.shape?30:100);"connector"!=l.style.shape&&"flexArrow"!=l.style.shape&&"filledEdge"!=l.style.shape&&"wire"!=l.style.shape&&"pipe"!=l.style.shape&&"mxgraph.basic.arc"!=l.style.shape&&(mxUtils.setOpacity(V,30),mxUtils.setOpacity(ha,30));if(ja||document.activeElement!=W)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)),W.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=K)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0)),K.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=ba)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE)),ba.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=K)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING,0)),T.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=aa)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_PERIMETER_SPACING,0)),aa.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit()});var oa=this.installInputHandler(W,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var pa=this.installInputHandler(K,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var da=this.installInputHandler(ba,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999,this.getUnit(" "),null,this.isFloatUnit(),@@ -3373,7 +3378,7 @@ var d=document.createElement("select");d.setAttribute("title",mxResources.get("l"values",[d.value],"cells",f.cells))}finally{e.getModel().endUpdate()}mxEvent.consume(u)});mxEvent.addListener(d,"click",function(u){mxEvent.consume(u)});a.appendChild(d);var t=this.addUnitInput(a,this.getUnit(),16,52,function(){k.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());t.setAttribute("title",mxResources.get("size"));var k=this.installInputHandler(t,"jumpSize",Graph.defaultJumpSize,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var v=mxUtils.bind(this,function(u,y,z){f=b.getSelectionState();d.value=mxUtils.getValue(f.style,"jumpStyle","none");if(z||document.activeElement!=t)u=parseInt(mxUtils.getValue(f.style,"jumpSize",Graph.defaultJumpSize)),t.value=isNaN(u)?"":this.inUnit(u)+" "+this.getUnit()});this.addKeyHandler(t,v);e.getModel().addListener(mxEvent.CHANGE,v);this.listeners.push({destroy:function(){e.getModel().removeListener(v)}});v()}else a.style.display="none";return a};StyleFormatPanel.prototype.addEffects=function(a){var b=this.editorUi,e=b.editor.graph,f=b.getSelectionState(),g=document.createElement("table");g.className="geFullWidthElement";g.style.fontWeight="bold";g.style.tableLayout="fixed";var d=document.createElement("tbody"),h=document.createElement("tr");h.style.padding="0px";var l=document.createElement("td");l.style.padding="0px";l.style.width="50%";l.style.verticalAlign="top";var t=l.cloneNode(!0);t.style.paddingLeft="8px";h.appendChild(l);h.appendChild(t);-d.appendChild(h);g.appendChild(d);a.appendChild(g);var k=l,v=mxUtils.bind(this,function(y,z,F,D){y=this.createCellOption(y,z,F,null,null,D);y.style.alignItems="top";k.appendChild(y);k=k==l?t:l;return y}),u=mxUtils.bind(this,function(y,z,F){f=b.getSelectionState();l.innerText="";t.innerText="";k=l;f.rounded&&v(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);f.swimlane&&v(mxResources.get("divider"),"swimlaneLine",1);v(mxResources.get("sketch"),"sketch",0,function(G,H){e.updateCellStyles({sketch:H?+d.appendChild(h);g.appendChild(d);a.appendChild(g);var k=l,v=mxUtils.bind(this,function(y,z,E,D){y=this.createCellOption(y,z,E,null,null,D);y.style.alignItems="top";k.appendChild(y);k=k==l?t:l;return y}),u=mxUtils.bind(this,function(y,z,E){f=b.getSelectionState();l.innerText="";t.innerText="";k=l;f.rounded&&v(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);f.swimlane&&v(mxResources.get("divider"),"swimlaneLine",1);v(mxResources.get("sketch"),"sketch",0,function(G,H){e.updateCellStyles({sketch:H?"1":null,curveFitting:H?Editor.sketchDefaultCurveFitting:null,jiggle:H?Editor.sketchDefaultJiggle:null},G)});f.glass&&v(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);y=v(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0);Editor.enableShadowOption||(y.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(y,60));0<f.edges.length&&0==f.vertices.length&&v(mxResources.get("flowAnimation",null,"Flow Animation"),"flowAnimation",0);if(null!=f.customProperties)for(var D in f.customProperties)y=f.customProperties[D],null!=y&&"bool"==y.type&&y.primary&&("function"!==typeof y.isVisible||y.isVisible(f,this))&&v(y.dispName,D,y.defVal?"1":"0")});e.getModel().addListener(mxEvent.CHANGE,u);this.listeners.push({destroy:function(){e.getModel().removeListener(u)}});u();return a};StyleFormatPanel.prototype.addStyleOps=function(a){1==this.editorUi.getSelectionState().cells.length&&this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(DiagramStylePanel,BaseFormatPanel);DiagramStylePanel.prototype.init=function(){this.container.appendChild(this.addView(this.createPanel()))};@@ -3395,9 +3400,9 @@ R!=mxConstants.STYLE_STROKECOLOR)t&&f.isEdge(S)&&R==mxConstants.STYLE_FONTCOLOR?u=document.createElement("div");u.style.whiteSpace="normal";a.appendChild(u);null==this.format.cachedStyleEntries&&(this.format.cachedStyleEntries=[]);var y=mxUtils.bind(this,function(U,X,S,V,ha){var R=this.format.cachedStyleEntries[ha];null==R&&(R=document.createElement("div"),R.className="geGraphStylePreview",t||null==V||null==V.background||(R.style.backgroundColor=V.background),v(U,X,S,V,R),mxEvent.addGestureListeners(R,mxUtils.bind(this,function(Z){R.style.opacity=.6}),null,mxUtils.bind(this,function(Z){R.style.opacity="";e.currentVertexStyle=mxUtils.clone(e.defaultVertexStyle);e.currentEdgeStyle=mxUtils.clone(e.defaultEdgeStyle);k(U,e.currentVertexStyle);k(U,e.currentEdgeStyle);k(X,e.currentVertexStyle);k(S,e.currentEdgeStyle);f.beginUpdate();try{var W=d.slice(),ba;for(ba in U)W.push(ba);h(W,V);if(!t){var K=new ChangePageSetup(b,null!=V?V.background:null);K.ignoreImage=!0;f.execute(K);f.execute(new ChangeGridColor(b,null!=V&&null!=V.gridColor?V.gridColor:g))}}finally{f.endUpdate()}})),mxClient.IS_TOUCH||(mxEvent.addListener(R,"mouseenter",mxUtils.bind(this,function(Z){var W=e.getCellStyle;Z=e.background;var ba=e.view.gridColor;t||(e.background=null!=V?V.background:null,e.view.gridColor=null!=V&&null!=V.gridColor?V.gridColor:g);e.getCellStyle=function(K,T){T=null!=T?T:!0;var aa=mxUtils.clone(W.apply(this,arguments)),ka=e.stylesheet.getDefaultVertexStyle(),oa=X;f.isEdge(K)&&(ka=e.stylesheet.getDefaultEdgeStyle(),oa=S);l(aa,d,ka);k(U,aa,K,V);k(oa,aa,K,V);T&&(aa=this.postProcessCellStyle(K,-aa));return aa};e.refresh();e.getCellStyle=W;e.background=Z;e.view.gridColor=ba})),mxEvent.addListener(R,"mouseleave",mxUtils.bind(this,function(Z){e.refresh()}))),this.format.cachedStyleEntries[ha]=R);u.appendChild(R)}),z=Math.ceil(Editor.styles.length/10);this.format.currentStylePage=null!=this.format.currentStylePage?this.format.currentStylePage:0;var F=[],D=mxUtils.bind(this,function(){0<F.length&&(F[this.format.currentStylePage].style.background="#84d7ff");for(var U=10*this.format.currentStylePage;U<-Math.min(10*(this.format.currentStylePage+1),Editor.styles.length);U++){var X=Editor.styles[U];y(X.commonStyle,X.vertexStyle,X.edgeStyle,X.graph,U)}}),G=mxUtils.bind(this,function(U){0<=U&&U<z&&(F[this.format.currentStylePage].style.background="transparent",u.innerText="",this.format.currentStylePage=U,D())});if(1<z){var H=document.createElement("div");H.className="geSwitcher";H.style.width="200px";for(var M=0;M<z;M++){var N=document.createElement("div");N.className="geSwitcherDot";mxUtils.bind(this,-function(U,X){mxEvent.addListener(N,"click",mxUtils.bind(this,function(){G(U)}))})(M,N);H.appendChild(N);F.push(N)}a.appendChild(H);D();if(15>z&&0<F.length){M=document.createElement("div");M.className="geButton";M.style.backgroundImage="url("+Editor.chevronLeftImage+")";var L=M.cloneNode(!1);L.style.backgroundImage="url("+Editor.chevronRightImage+")";H.insertBefore(M,F[0]);H.appendChild(L);mxEvent.addListener(M,"click",mxUtils.bind(this,function(){G(mxUtils.mod(this.format.currentStylePage-1,z))}));+aa));return aa};e.refresh();e.getCellStyle=W;e.background=Z;e.view.gridColor=ba})),mxEvent.addListener(R,"mouseleave",mxUtils.bind(this,function(Z){e.refresh()}))),this.format.cachedStyleEntries[ha]=R);u.appendChild(R)}),z=Math.ceil(Editor.styles.length/10);this.format.currentStylePage=null!=this.format.currentStylePage?this.format.currentStylePage:0;var E=[],D=mxUtils.bind(this,function(){0<E.length&&(E[this.format.currentStylePage].style.background="#84d7ff");for(var U=10*this.format.currentStylePage;U<+Math.min(10*(this.format.currentStylePage+1),Editor.styles.length);U++){var X=Editor.styles[U];y(X.commonStyle,X.vertexStyle,X.edgeStyle,X.graph,U)}}),G=mxUtils.bind(this,function(U){0<=U&&U<z&&(E[this.format.currentStylePage].style.background="transparent",u.innerText="",this.format.currentStylePage=U,D())});if(1<z){var H=document.createElement("div");H.className="geSwitcher";H.style.width="200px";for(var M=0;M<z;M++){var N=document.createElement("div");N.className="geSwitcherDot";mxUtils.bind(this,+function(U,X){mxEvent.addListener(N,"click",mxUtils.bind(this,function(){G(U)}))})(M,N);H.appendChild(N);E.push(N)}a.appendChild(H);D();if(15>z&&0<E.length){M=document.createElement("div");M.className="geButton";M.style.backgroundImage="url("+Editor.chevronLeftImage+")";var L=M.cloneNode(!1);L.style.backgroundImage="url("+Editor.chevronRightImage+")";H.insertBefore(M,E[0]);H.appendChild(L);mxEvent.addListener(M,"click",mxUtils.bind(this,function(){G(mxUtils.mod(this.format.currentStylePage-1,z))}));mxEvent.addListener(L,"click",mxUtils.bind(this,function(){G(mxUtils.mod(this.format.currentStylePage+1,z))}))}}else D();return a};DiagramFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(DiagramFormatPanel,BaseFormatPanel);DiagramFormatPanel.showPageView=!0;DiagramFormatPanel.prototype.showBackgroundImageOption=!0;DiagramFormatPanel.prototype.init=function(){var a=this.editorUi.editor.graph;this.container.appendChild(this.addView(this.createPanel()));a.isEnabled()&&(this.container.appendChild(this.addOptions(this.createPanel())),this.container.appendChild(this.addPaperSize(this.createPanel())),this.container.appendChild(this.addStyleOps(this.createPanel())))};DiagramFormatPanel.prototype.addView=function(a){var b=this.editorUi,e=b.editor.graph;a.appendChild(this.createTitle(mxResources.get("view")));this.addGridOption(a);DiagramFormatPanel.showPageView&&a.appendChild(this.createOption(mxResources.get("pageView"),function(){return e.pageVisible},function(d){b.actions.get("pageView").funct()},{install:function(d){this.listener=function(){d(e.pageVisible)};b.addListener("pageViewChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}}));@@ -3416,12 +3421,12 @@ DiagramFormatPanel.prototype.addDocumentProperties=function(a){a.appendChild(thiDiagramFormatPanel.prototype.addPaperSize=function(a){var b=this.editorUi,e=b.editor.graph;a.appendChild(this.createTitle(mxResources.get("paperSize")));var f=PageSetupDialog.addPageFormatPanel(a,"formatpanel",e.pageFormat,function(d){if(null==e.pageFormat||e.pageFormat.width!=d.width||e.pageFormat.height!=d.height)d=new ChangePageSetup(b,null,null,d),d.ignoreColor=!0,d.ignoreImage=!0,e.model.execute(d)});this.addKeyHandler(f.widthInput,function(){f.set(e.pageFormat)});this.addKeyHandler(f.heightInput,function(){f.set(e.pageFormat)});var g=function(){f.set(e.pageFormat)};b.addListener("pageFormatChanged",g);this.listeners.push({destroy:function(){b.removeListener(g)}});e.getModel().addListener(mxEvent.CHANGE,g);this.listeners.push({destroy:function(){e.getModel().removeListener(g)}});return a};DiagramFormatPanel.prototype.addStyleOps=function(a){this.addActions(a,["editData"]);this.addActions(a,["clearDefaultStyle"]);return a};DiagramFormatPanel.prototype.destroy=function(){BaseFormatPanel.prototype.destroy.apply(this,arguments);this.gridEnabledListener&&(this.editorUi.removeListener(this.gridEnabledListener),this.gridEnabledListener=null)};(function(){function a(c,m,p){mxShape.call(this);this.line=c;this.stroke=m;this.strokewidth=null!=p?p:1;this.updateBoundsFromLine()}function b(){mxSwimlane.call(this)}function e(){mxSwimlane.call(this)}function f(){mxCylinder.call(this)}function g(){mxConnector.call(this)}function d(){mxCylinder.call(this)}function h(){mxActor.call(this)}function l(){mxCylinder.call(this)}function t(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function v(){mxCylinder.call(this)}function u(){mxShape.call(this)}-function y(){mxShape.call(this)}function z(c,m,p,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=p;this.strokewidth=null!=n?n:1}function F(){mxActor.call(this)}function D(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function H(){mxActor.call(this)}function M(){mxActor.call(this)}function N(){mxActor.call(this)}function L(){mxActor.call(this)}function U(){mxActor.call(this)}function X(){mxActor.call(this)}function S(){mxActor.call(this)}function V(c,m){this.canvas=c;this.canvas.setLineJoin("round");+function y(){mxShape.call(this)}function z(c,m,p,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=p;this.strokewidth=null!=n?n:1}function E(){mxActor.call(this)}function D(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function H(){mxActor.call(this)}function M(){mxActor.call(this)}function N(){mxActor.call(this)}function L(){mxActor.call(this)}function U(){mxActor.call(this)}function X(){mxActor.call(this)}function S(){mxActor.call(this)}function V(c,m){this.canvas=c;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=m;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,V.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,V.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,V.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,V.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,V.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,V.prototype.arcTo)}function ha(){mxRectangleShape.call(this)}function R(){mxRectangleShape.call(this)}function Z(){mxActor.call(this)}function W(){mxActor.call(this)}function ba(){mxActor.call(this)}function K(){mxRectangleShape.call(this)}function T(){mxRectangleShape.call(this)}function aa(){mxCylinder.call(this)}function ka(){mxShape.call(this)}function oa(){mxShape.call(this)}function pa(){mxEllipse.call(this)}function da(){mxShape.call(this)}function ia(){mxShape.call(this)}function fa(){mxRectangleShape.call(this)}function O(){mxShape.call(this)}function qa(){mxShape.call(this)}function ja(){mxShape.call(this)}function ua(){mxShape.call(this)}function ya(){mxShape.call(this)}function Ma(){mxCylinder.call(this)}function Oa(){mxCylinder.call(this)}function Ka(){mxRectangleShape.call(this)}function La(){mxDoubleEllipse.call(this)}function wa(){mxDoubleEllipse.call(this)}function Ia(){mxArrowConnector.call(this);this.spacing=0}function $a(){mxArrowConnector.call(this);this.spacing=0}function ab(){mxActor.call(this)}function eb(){mxRectangleShape.call(this)}function ib(){mxActor.call(this)}function rb(){mxActor.call(this)}function jb(){mxActor.call(this)}function db(){mxActor.call(this)}function kb(){mxActor.call(this)}function hb(){mxActor.call(this)}function la(){mxActor.call(this)}function Ea(){mxActor.call(this)}function za(){mxActor.call(this)}function Va(){mxActor.call(this)}function Ta(){mxEllipse.call(this)}-function q(){mxEllipse.call(this)}function B(){mxEllipse.call(this)}function C(){mxRhombus.call(this)}function E(){mxEllipse.call(this)}function J(){mxEllipse.call(this)}function P(){mxEllipse.call(this)}function Y(){mxEllipse.call(this)}function ma(){mxActor.call(this)}function ca(){mxActor.call(this)}function na(){mxActor.call(this)}function ta(c,m,p,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=p;this.strokewidth=null!=n?n:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=+function q(){mxEllipse.call(this)}function B(){mxEllipse.call(this)}function C(){mxRhombus.call(this)}function F(){mxEllipse.call(this)}function J(){mxEllipse.call(this)}function P(){mxEllipse.call(this)}function Y(){mxEllipse.call(this)}function ma(){mxActor.call(this)}function ca(){mxActor.call(this)}function na(){mxActor.call(this)}function ta(c,m,p,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=p;this.strokewidth=null!=n?n:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Fa(){mxConnector.call(this)}function Da(){mxConnector.call(this)}function Na(){mxActor.call(this)}function Ra(c,m,p,n,r,w,x,I,A,ea){x+=A;var Q=n.clone();n.x-=r*(2*x+A);n.y-=w*(2*x+A);r*=x+A;w*=x+A;return function(){c.ellipse(Q.x-r-x,Q.y-w-x,2*x,2*x);ea?c.fillAndStroke():c.stroke()}}mxUtils.extend(a,mxShape);a.prototype.updateBoundsFromLine=function(){var c=null;if(null!=this.line)for(var m=0;m<this.line.length;m++){var p=this.line[m];null!=p&&(p=new mxRectangle(p.x,p.y,this.strokewidth,this.strokewidth),null==c?c=p:c.add(p))}this.bounds=null!=c?c:new mxRectangle};a.prototype.paintVertexShape=function(c,m,p,n,r){this.paintTableLine(c,this.line,0,0)};a.prototype.paintTableLine=function(c,m,p,n){if(null!=m){var r=null;c.begin();for(var w=0;w<m.length;w++){var x=m[w];null!=x&&(null==r?c.moveTo(x.x+p,x.y+n):null!=r&&c.lineTo(x.x+p,x.y+n));r=x}c.end();c.stroke()}};a.prototype.intersectsRectangle=function(c){var m=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var p=null,n=0;n<this.line.length&&!m;n++){var r=this.line[n];null!=r&&null!=p&&(m=mxUtils.rectangleIntersectsSegment(c,p,r));p=r}return m};mxCellRenderer.registerShape("tableLine",a);mxUtils.extend(b,mxSwimlane);b.prototype.getLabelBounds=function(c){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};b.prototype.paintVertexShape=function(c,m,p,n,r){var w=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):@@ -3440,7 +3445,7 @@ c.begin(),c.moveTo(n-w,0),c.lineTo(n-w,w),c.lineTo(n,w),c.close(),c.fill()),c.be15;u.prototype.paintVertexShape=function(c,m,p,n,r){var w=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;w=Math.min(n*Math.tan(w),.5*r);c.translate(m,p);c.begin();c.moveTo(.5*n,0);c.lineTo(n,w);c.lineTo(n,r-w);c.lineTo(.5*n,r);c.lineTo(0,r-w);c.lineTo(0,w);c.close();c.fillAndStroke();c.setShadow(!1);c.begin();c.moveTo(0,w);c.lineTo(.5*n,2*w);c.lineTo(n,w);c.moveTo(.5*n,2*w);c.lineTo(.5*n,r);c.stroke()};mxCellRenderer.registerShape("isoCube2",u);mxUtils.extend(y,mxShape);y.prototype.size=15;y.prototype.paintVertexShape=function(c,m,p,n,r){var w=Math.max(0,Math.min(.5*r,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c.translate(m,p);0==w?(c.rect(0,0,n,r),c.fillAndStroke()):(c.begin(),c.moveTo(0,w),c.arcTo(.5*n,w,0,0,1,.5*n,0),c.arcTo(.5*n,w,0,0,1,n,w),c.lineTo(n,r-w),c.arcTo(.5*n,w,0,0,1,.5*n,r),c.arcTo(.5*n,w,0,0,1,0,r-w),c.close(),c.fillAndStroke(),c.setShadow(!1),c.begin(),c.moveTo(n,w),c.arcTo(.5*n,w,0,0,1,.5*n,2*w),c.arcTo(.5*n,w,0,0,1,0,w),c.stroke())};mxCellRenderer.registerShape("cylinder2",y);mxUtils.extend(z,mxCylinder);z.prototype.size=15;z.prototype.paintVertexShape=function(c,m,p,n,r){var w=Math.max(0,Math.min(.5*r,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),x=mxUtils.getValue(this.style,"lid",!0);c.translate(m,p);0==w?(c.rect(0,0,n,r),c.fillAndStroke()):(c.begin(),x?(c.moveTo(0,w),c.arcTo(.5*n,w,0,0,1,.5*n,0),c.arcTo(.5*n,w,0,0,1,n,w)):(c.moveTo(0,0),c.arcTo(.5*n,w,0,0,0,.5*n,w),c.arcTo(.5*n,w,-0,0,0,n,0)),c.lineTo(n,r-w),c.arcTo(.5*n,w,0,0,1,.5*n,r),c.arcTo(.5*n,w,0,0,1,0,r-w),c.close(),c.fillAndStroke(),c.setShadow(!1),x&&(c.begin(),c.moveTo(n,w),c.arcTo(.5*n,w,0,0,1,.5*n,2*w),c.arcTo(.5*n,w,0,0,1,0,w),c.stroke()))};mxCellRenderer.registerShape("cylinder3",z);mxUtils.extend(F,mxActor);F.prototype.redrawPath=function(c,m,p,n,r){c.moveTo(0,0);c.quadTo(n/2,.5*r,n,0);c.quadTo(.5*n,r/2,n,r);c.quadTo(n/2,.5*r,0,r);c.quadTo(.5*n,r/2,0,0);c.end()};mxCellRenderer.registerShape("switch",F);mxUtils.extend(D,+0,0,0,n,0)),c.lineTo(n,r-w),c.arcTo(.5*n,w,0,0,1,.5*n,r),c.arcTo(.5*n,w,0,0,1,0,r-w),c.close(),c.fillAndStroke(),c.setShadow(!1),x&&(c.begin(),c.moveTo(n,w),c.arcTo(.5*n,w,0,0,1,.5*n,2*w),c.arcTo(.5*n,w,0,0,1,0,w),c.stroke()))};mxCellRenderer.registerShape("cylinder3",z);mxUtils.extend(E,mxActor);E.prototype.redrawPath=function(c,m,p,n,r){c.moveTo(0,0);c.quadTo(n/2,.5*r,n,0);c.quadTo(.5*n,r/2,n,r);c.quadTo(n/2,.5*r,0,r);c.quadTo(.5*n,r/2,0,0);c.end()};mxCellRenderer.registerShape("switch",E);mxUtils.extend(D,mxCylinder);D.prototype.tabWidth=60;D.prototype.tabHeight=20;D.prototype.tabPosition="right";D.prototype.arcSize=.1;D.prototype.isRoundable=function(){return!0};D.prototype.paintVertexShape=function(c,m,p,n,r){c.translate(m,p);m=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));p=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var w=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),x=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1),A=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));I||(A*=Math.min(n,r));A=Math.min(A,.5*n,.5*(r-p));m=Math.max(m,A);m=Math.min(n-A,m);x||(A=0);c.begin();"left"==w?(c.moveTo(Math.max(A,0),p),c.lineTo(Math.max(A,0),0),c.lineTo(m,0),c.lineTo(m,p)):(c.moveTo(n-m,p),c.lineTo(n-m,0),c.lineTo(n-Math.max(A,0),0),c.lineTo(n-Math.max(A,0),p));x?(c.moveTo(0,A+p),c.arcTo(A,A,0,0,1,A,p),c.lineTo(n-A,p),c.arcTo(A,A,0,0,1,n,A+p),c.lineTo(n,r-A),c.arcTo(A,A,0,0,1,n-A,r),c.lineTo(A,r),c.arcTo(A,A,0,0,1,0,r-A)):(c.moveTo(0,p),c.lineTo(n,p),c.lineTo(n,r),c.lineTo(0,r));c.close();c.fillAndStroke();c.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(c.begin(),c.moveTo(n-30,p+20),c.lineTo(n-20,p+10),c.lineTo(n-10,p+20),c.close(),c.stroke())};mxCellRenderer.registerShape("folder",D);D.prototype.getLabelMargins=function(c){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"tabHeight",@@ -3524,8 +3529,8 @@ c.end()};mxCellRenderer.registerShape("or",la);mxUtils.extend(Ea,mxActor);Ea.promxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(m,0),new mxPoint(n-m,0),new mxPoint(n,.8*m),new mxPoint(n,r),new mxPoint(0,r),new mxPoint(0,.8*m)],this.isRounded,p,!0);c.end()};mxCellRenderer.registerShape("loopLimit",za);mxUtils.extend(Va,mxActor);Va.prototype.size=.375;Va.prototype.isRoundable=function(){return!0};Va.prototype.redrawPath=function(c,m,p,n,r){m=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));p=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,r-m),new mxPoint(n/2,r),new mxPoint(0,r-m)],this.isRounded,p,!0);c.end()};mxCellRenderer.registerShape("offPageConnector",Va);mxUtils.extend(Ta,mxEllipse);Ta.prototype.paintVertexShape=function(c,m,p,n,r){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.begin();c.moveTo(m+n/2,p+r);c.lineTo(m+n,p+r);c.end();c.stroke()};mxCellRenderer.registerShape("tapeData",Ta);mxUtils.extend(q,mxEllipse);q.prototype.paintVertexShape=function(c,m,p,n,r){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m,p+r/2);c.lineTo(m+n,p+r/2);c.end();c.stroke();c.begin();c.moveTo(m+n/2,p);c.lineTo(m+n/2,p+r);c.end();c.stroke()};mxCellRenderer.registerShape("orEllipse",q);mxUtils.extend(B,mxEllipse);B.prototype.paintVertexShape=function(c,m,p,n,r){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m+.145*n,p+.145*-r);c.lineTo(m+.855*n,p+.855*r);c.end();c.stroke();c.begin();c.moveTo(m+.855*n,p+.145*r);c.lineTo(m+.145*n,p+.855*r);c.end();c.stroke()};mxCellRenderer.registerShape("sumEllipse",B);mxUtils.extend(C,mxRhombus);C.prototype.paintVertexShape=function(c,m,p,n,r){mxRhombus.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m,p+r/2);c.lineTo(m+n,p+r/2);c.end();c.stroke()};mxCellRenderer.registerShape("sortShape",C);mxUtils.extend(E,mxEllipse);E.prototype.paintVertexShape=-function(c,m,p,n,r){c.begin();c.moveTo(m,p);c.lineTo(m+n,p);c.lineTo(m+n/2,p+r/2);c.close();c.fillAndStroke();c.begin();c.moveTo(m,p+r);c.lineTo(m+n,p+r);c.lineTo(m+n/2,p+r/2);c.close();c.fillAndStroke()};mxCellRenderer.registerShape("collate",E);mxUtils.extend(J,mxEllipse);J.prototype.paintVertexShape=function(c,m,p,n,r){var w=c.state.strokeWidth/2,x=10+2*w,I=p+r-x/2;c.begin();c.moveTo(m,p);c.lineTo(m,p+r);c.moveTo(m+w,I);c.lineTo(m+w+x,I-x/2);c.moveTo(m+w,I);c.lineTo(m+w+x,I+x/2);c.moveTo(m+w,I);+r);c.lineTo(m+.855*n,p+.855*r);c.end();c.stroke();c.begin();c.moveTo(m+.855*n,p+.145*r);c.lineTo(m+.145*n,p+.855*r);c.end();c.stroke()};mxCellRenderer.registerShape("sumEllipse",B);mxUtils.extend(C,mxRhombus);C.prototype.paintVertexShape=function(c,m,p,n,r){mxRhombus.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m,p+r/2);c.lineTo(m+n,p+r/2);c.end();c.stroke()};mxCellRenderer.registerShape("sortShape",C);mxUtils.extend(F,mxEllipse);F.prototype.paintVertexShape=+function(c,m,p,n,r){c.begin();c.moveTo(m,p);c.lineTo(m+n,p);c.lineTo(m+n/2,p+r/2);c.close();c.fillAndStroke();c.begin();c.moveTo(m,p+r);c.lineTo(m+n,p+r);c.lineTo(m+n/2,p+r/2);c.close();c.fillAndStroke()};mxCellRenderer.registerShape("collate",F);mxUtils.extend(J,mxEllipse);J.prototype.paintVertexShape=function(c,m,p,n,r){var w=c.state.strokeWidth/2,x=10+2*w,I=p+r-x/2;c.begin();c.moveTo(m,p);c.lineTo(m,p+r);c.moveTo(m+w,I);c.lineTo(m+w+x,I-x/2);c.moveTo(m+w,I);c.lineTo(m+w+x,I+x/2);c.moveTo(m+w,I);c.lineTo(m+n-w,I);c.moveTo(m+n,p);c.lineTo(m+n,p+r);c.moveTo(m+n-w,I);c.lineTo(m+n-x-w,I-x/2);c.moveTo(m+n-w,I);c.lineTo(m+n-x-w,I+x/2);c.end();c.stroke()};mxCellRenderer.registerShape("dimension",J);mxUtils.extend(P,mxEllipse);P.prototype.drawHidden=!0;P.prototype.paintVertexShape=function(c,m,p,n,r){this.outline||c.setStrokeColor(null);if(null!=this.style){var w=c.pointerEvents,x=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||x||(c.pointerEvents=!1);var I="1"==mxUtils.getValue(this.style,"top","1"),A="1"==mxUtils.getValue(this.style,"left","1"),ea="1"==mxUtils.getValue(this.style,"right","1"),Q="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||x||this.outline||I||ea||Q||A?(c.rect(m,p,n,r),c.fill(),c.pointerEvents=w,c.setStrokeColor(this.stroke),c.setLineCap("square"),c.begin(),c.moveTo(m,p),this.outline||I?c.lineTo(m+n,p):c.moveTo(m+n,p),this.outline||ea?c.lineTo(m+n,p+r):c.moveTo(m+n,p+r),this.outline||Q?c.lineTo(m,p+r):c.moveTo(m,p+r),(this.outline||A)&&c.lineTo(m,p),c.end(),c.stroke(),c.setLineCap("flat")):c.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",P);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(c,m,p,n,r){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();"vertical"==mxUtils.getValue(this.style,"line")?(c.moveTo(m+n/2,p),c.lineTo(m+n/2,p+r)):(c.moveTo(m,p+r/2),c.lineTo(m+n,p+r/2));c.end();c.stroke()};@@ -3664,7 +3669,7 @@ mxRectangleShape.prototype.constraints;Ta.prototype.constraints=mxEllipse.prototnew mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];ka.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];Oa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,-0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];F.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,+0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];E.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];M.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)];W.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,@@ -3687,8 +3692,8 @@ parseFloat(mxUtils.getValue(this.style,"arrowWidth",db.prototype.arrowWidth)))),0),!1,null,x,w));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*x,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n));c.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,w));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*x,w));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,n));return c};fa.prototype.constraints=null;la.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)];Ea.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)];ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()}-Actions.prototype.init=function(){function a(k){d.escape();k=d.deleteCells(d.getDeletableCells(d.getSelectionCells()),k);null!=k&&d.setSelectionCells(k)}function b(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{for(var k=d.getSelectionCells(),v=0;v<k.length;v++)d.cellLabelChanged(k[v],"")}finally{d.getModel().endUpdate()}}}function e(k,v,u,y,z){z.getModel().beginUpdate();try{var F=z.getCellGeometry(k);null!=F&&u&&y&&(u/=y,F=F.clone(),1<u?F.height=F.width/u:F.width=F.height*u,z.getModel().setGeometry(k,-F));z.setCellStyles(mxConstants.STYLE_CLIP_PATH,v,[k]);z.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[k])}finally{z.getModel().endUpdate()}}var f=this.editorUi,g=f.editor,d=g.graph,h=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",function(){d.openLink(f.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";f.openFile()});var l=new Action("smartFit",function(){if(f.chromelessResize)d.isLightboxView()?(1==+Actions.prototype.init=function(){function a(k){d.escape();k=d.deleteCells(d.getDeletableCells(d.getSelectionCells()),k);null!=k&&d.setSelectionCells(k)}function b(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{for(var k=d.getSelectionCells(),v=0;v<k.length;v++)d.cellLabelChanged(k[v],"")}finally{d.getModel().endUpdate()}}}function e(k,v,u,y,z){z.getModel().beginUpdate();try{var E=z.getCellGeometry(k);null!=E&&u&&y&&(u/=y,E=E.clone(),1<u?E.height=E.width/u:E.width=E.height*u,z.getModel().setGeometry(k,+E));z.setCellStyles(mxConstants.STYLE_CLIP_PATH,v,[k]);z.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[k])}finally{z.getModel().endUpdate()}}var f=this.editorUi,g=f.editor,d=g.graph,h=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",function(){d.openLink(f.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";f.openFile()});var l=new Action("smartFit",function(){if(f.chromelessResize)d.isLightboxView()?(1==d.view.scale?f.lightboxFit():d.zoomTo(1),f.chromelessResize(!1)):f.chromelessResize(!0);else{d.popupMenuHandler.hideMenu();var k=d.view.scale,v=d.container.scrollLeft,u=d.container.scrollTop,y=d.view.translate.x,z=d.view.translate.y;f.actions.get("resetView").funct();1E-5>Math.abs(k-d.view.scale)&&5>Math.abs(v-d.container.scrollLeft)&&5>Math.abs(u-d.container.scrollTop)&&y==d.view.translate.x&&z==d.view.translate.y&&f.actions.get("fitWindow").funct()}},null,null,"Enter");l.getTitle=function(){return mxResources.get("fitWindow")+" / "+mxResources.get("resetView")};this.put("smartFit",l);this.addAction("keyPressEnter",function(){d.isSelectionEmpty()?f.actions.get("smartFit").funct():d.isEnabled()&&d.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){f.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(k,v){try{var u=mxUtils.parseXml(k);g.graph.setSelectionCells(g.graph.importGraphModel(u.documentElement))}catch(y){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+y.message)}}));f.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=h;this.addAction("save",function(){f.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=h;this.addAction("saveAs...",function(){f.saveFile(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+S");this.addAction("export...",function(){f.showDialog((new ExportDialog(f)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var k=new EditDiagramDialog(f);f.showDialog(k.container,@@ -3696,8 +3701,8 @@ d.view.scale?f.lightboxFit():d.zoomTo(1),f.chromelessResize(!1)):f.chromelessRes"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var k=null;try{k=f.copyXml(),null!=k&&d.removeCells(k,!1)}catch(v){}try{null==k&&mxClipboard.cut(d)}catch(v){f.handleError(v)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{f.copyXml()}catch(k){}try{mxClipboard.copy(d)}catch(k){f.handleError(k)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){f.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(k){f.pasteFromClipboard(d.popupMenuHandler.getTriggerPoint())});this.addAction("swap",function(){var k=d.getSelectionCells();2==k.length&&d.swapShapes(k[0],k[1])});this.addAction("copySize",function(){var k=d.getSelectionCell();d.isEnabled()&&null!=k&&d.getModel().isVertex(k)&&(k=d.getCellGeometry(k),null!=k&&(f.copiedSize=new mxRectangle(k.x,k.y,k.width,k.height)))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+F");this.addAction("pasteSize",function(){if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=f.copiedSize){d.getModel().beginUpdate();try{for(var k=d.getResizableCells(d.getSelectionCells()),v=0;v<k.length;v++)if(d.getModel().isVertex(k[v])){var u=d.getCellGeometry(k[v]);null!=u&&(u=u.clone(),u.width=f.copiedSize.width,u.height=f.copiedSize.height,d.getModel().setGeometry(k[v],u))}}finally{d.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");this.addAction("copyData",function(){var k=d.getSelectionCell()||d.getModel().getRoot();d.isEnabled()&&null!=k&&(k=k.cloneValue(),null==k||isNaN(k.nodeType)||(f.copiedValue=k))},null,null,Editor.altKey+"+"+Editor.shiftKey+-"+B");this.addAction("copyAsText",function(){var k=d.getSelectionCell();if(d.isEnabled()&&null!=k)try{d.isHtmlLabel(k)?f.writeHtmlToClipboard(d.getLabel(k),mxUtils.bind(this,function(v){f.handleError(v)})):f.writeTextToClipboard(d.getLabel(k),mxUtils.bind(this,function(v){f.handleError(v)}))}catch(v){f.handleError(v)}});this.addAction("pasteData",function(k,v){function u(F,D){var G=y.getValue(F);D=F.cloneValue(D);D.removeAttribute("placeholders");null==G||isNaN(G.nodeType)||D.setAttribute("placeholders",-G.getAttribute("placeholders"));null!=k&&mxEvent.isShiftDown(k)||D.setAttribute("label",d.convertValueToString(F));y.setValue(F,D)}k=null!=v?v:k;var y=d.getModel();if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=f.copiedValue){y.beginUpdate();try{var z=d.getEditableCells(d.getSelectionCells());if(0==z.length)u(y.getRoot(),f.copiedValue);else for(v=0;v<z.length;v++)u(z[v],f.copiedValue)}finally{y.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(k,v){k=+"+B");this.addAction("copyAsText",function(){var k=d.getSelectionCell();if(d.isEnabled()&&null!=k)try{d.isHtmlLabel(k)?f.writeHtmlToClipboard(d.getLabel(k),mxUtils.bind(this,function(v){f.handleError(v)})):f.writeTextToClipboard(d.getLabel(k),mxUtils.bind(this,function(v){f.handleError(v)}))}catch(v){f.handleError(v)}});this.addAction("pasteData",function(k,v){function u(E,D){var G=y.getValue(E);D=E.cloneValue(D);D.removeAttribute("placeholders");null==G||isNaN(G.nodeType)||D.setAttribute("placeholders",+G.getAttribute("placeholders"));null!=k&&mxEvent.isShiftDown(k)||D.setAttribute("label",d.convertValueToString(E));y.setValue(E,D)}k=null!=v?v:k;var y=d.getModel();if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=f.copiedValue){y.beginUpdate();try{var z=d.getEditableCells(d.getSelectionCells());if(0==z.length)u(y.getRoot(),f.copiedValue);else for(v=0;v<z.length;v++)u(z[v],f.copiedValue)}finally{y.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(k,v){k=null!=v?v:k;null!=k&&mxEvent.isShiftDown(k)?b():a(null!=k&&(mxEvent.isControlDown(k)||mxEvent.isMetaDown(k)||mxEvent.isAltDown(k)))},null,null,"Delete");this.addAction("deleteAll",function(){a(!0)});this.addAction("deleteLabels",function(){b()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{d.setSelectionCells(d.duplicateCells()),d.scrollCellToVisible(d.getSelectionCell())}catch(k){f.handleError(k)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var k=f.getSelectionState();if(null!=k.mergeCell){d.getModel().beginUpdate();try{d.setCellStyles("rowspan",k.rowspan,[k.mergeCell]),d.setCellStyles("colspan",k.colspan,[k.mergeCell])}finally{d.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var k=f.getSelectionState();if(0<k.cells.length){d.getModel().beginUpdate();try{d.setCellStyles("rowspan",null,k.cells),d.setCellStyles("colspan",null,k.cells)}finally{d.getModel().endUpdate()}}}));l=new Action("turn",function(k,v){k=null!=v?v:k;d.turnShapes(d.getResizableCells(d.getSelectionCells()),null!=k?mxEvent.isShiftDown(k):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");l.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",l);this.put("selectConnections",new Action("selectEdges",function(k){k=d.getSelectionCell();d.isEnabled()&&null!=k&&d.addSelectionCells(d.getEdges(k))}));this.addAction("selectVertices",function(){d.selectVertices(null,!0)},null,@@ -3712,10 +3717,10 @@ null==u&&(u=k.value.getAttribute("tooltip"));null!=u&&(v=u)}v=new TextareaDialog!0)||"";f.showLinkDialog(v,mxResources.get("ok"),function(u,y,z){d.getModel().beginUpdate();try{d.setLinkForCell(k,0<u.length?u:null),d.setAttributeForCell(k,"linkTarget",z)}finally{d.getModel().endUpdate()}},!0,d.getLinkTargetForCell(k))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+L");this.put("insertImage",new Action("image...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),f.actions.get("image").funct())})).isEnabled=h;this.addAction("editImage...",function(){f.actions.get("image").funct()});this.put("insertLink",new Action("link...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&f.showLinkDialog("",mxResources.get("ok"),function(k,v,u){k=mxUtils.trim(k);if(0<k.length){var y=null,z=d.getLinkTitle(k);null!=v&&0<v.length&&(y=v[0].iconUrl,z=v[0].name||v[0].type,z=z.charAt(0).toUpperCase()+z.substring(1),30<z.length&&(z=z.substring(0,30)+"..."));v=new mxCell(z,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=y?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+y:"spacing=10;"));v.vertex=!0;y=d.getCenterInsertPoint(d.getBoundingBoxFromGeometry([v],!0));v.geometry.x=y.x;v.geometry.y=y.y;d.setAttributeForCell(v,"linkTarget",u);d.setLinkForCell(v,k);d.cellSizeUpdated(v,!0);d.getModel().beginUpdate();try{v=d.addCell(v),d.fireEvent(new mxEventObject("cellsInserted","cells",[v]))}finally{d.getModel().endUpdate()}d.setSelectionCell(v);d.scrollCellToVisible(d.getSelectionCell())}},!0)},null,null,"L")).isEnabled=h;this.addAction("link...",mxUtils.bind(this,function(){if(d.isEnabled())if(d.cellEditor.isContentEditing()){var k=-d.getSelectedElement(),v=d.getParentByName(k,"A",d.cellEditor.textarea),u="";if(null==v&&null!=k&&null!=k.getElementsByTagName)for(var y=k.getElementsByTagName("a"),z=0;z<y.length&&null==v;z++)y[z].textContent==k.textContent&&(v=y[z]);null!=v&&"A"==v.nodeName&&(u=v.getAttribute("href")||"",d.selectNode(v));var F=d.cellEditor.saveSelection();f.showLinkDialog(u,mxResources.get("ok"),mxUtils.bind(this,function(D){d.cellEditor.restoreSelection(F);null!=D&&d.insertLink(D)}))}else d.isSelectionEmpty()?+d.getSelectedElement(),v=d.getParentByName(k,"A",d.cellEditor.textarea),u="";if(null==v&&null!=k&&null!=k.getElementsByTagName)for(var y=k.getElementsByTagName("a"),z=0;z<y.length&&null==v;z++)y[z].textContent==k.textContent&&(v=y[z]);null!=v&&"A"==v.nodeName&&(u=v.getAttribute("href")||"",d.selectNode(v));var E=d.cellEditor.saveSelection();f.showLinkDialog(u,mxResources.get("ok"),mxUtils.bind(this,function(D){d.cellEditor.restoreSelection(E);null!=D&&d.insertLink(D)}))}else d.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=h;this.addAction("autosize",function(){var k=d.getSelectionCells();if(null!=k){d.getModel().beginUpdate();try{for(var v=0;v<k.length;v++){var u=k[v];d.getModel().isVertex(u)&&(d.isAutosizeTextCell(u)&&d.setCellStyles("autosizeText",null,[u]),0<d.getModel().getChildCount(u)?d.updateGroupBounds([u],0,!0):d.updateCellSize(u))}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Y");this.addAction("snapToGrid",function(){d.snapCellsToGrid(d.getSelectionCells(),d.gridSize)});this.addAction("formattedText",function(){d.stopEditing();var k=d.getCommonStyle(d.getSelectionCells());k="1"==mxUtils.getValue(k,"html","0")?null:"1";d.getModel().beginUpdate();try{for(var v=d.getEditableCells(d.getSelectionCells()),u=0;u<v.length;u++){var y=d.getView().getState(v[u]);if(null!=y){var z=mxUtils.getValue(y.style,"html","0");if("1"==z&&null==k)d.removeTextStyleForCell(y.cell),d.setCellStyles("html",k,[v[u]]);else if("0"==-z&&"1"==k){var F=mxUtils.htmlEntities(d.convertValueToString(y.cell),!1);"0"!=mxUtils.getValue(y.style,"nl2Br","1")&&(F=F.replace(/\n/g,"<br/>"));d.cellLabelChanged(y.cell,Graph.sanitizeHtml(F));d.setCellStyles("html",k,[v[u]])}}}f.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=k?k:"0"],"cells",v))}finally{d.getModel().endUpdate()}});this.addAction("wordWrap",function(){var k=d.getView().getState(d.getSelectionCell()),v="wrap";d.stopEditing();null!=k&&"wrap"==k.style[mxConstants.STYLE_WHITE_SPACE]&&+z&&"1"==k){var E=mxUtils.htmlEntities(d.convertValueToString(y.cell),!1);"0"!=mxUtils.getValue(y.style,"nl2Br","1")&&(E=E.replace(/\n/g,"<br/>"));d.cellLabelChanged(y.cell,Graph.sanitizeHtml(E));d.setCellStyles("html",k,[v[u]])}}}f.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=k?k:"0"],"cells",v))}finally{d.getModel().endUpdate()}});this.addAction("wordWrap",function(){var k=d.getView().getState(d.getSelectionCell()),v="wrap";d.stopEditing();null!=k&&"wrap"==k.style[mxConstants.STYLE_WHITE_SPACE]&&(v=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,v)});this.addAction("rotation",function(){var k="0",v=d.getView().getState(d.getSelectionCell());null!=v&&(k=v.style[mxConstants.STYLE_ROTATION]||k);k=new FilenameDialog(f,k,mxResources.get("apply"),function(u){null!=u&&0<u.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,u)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");f.showDialog(k.container,375,80,!0,!0);k.init()});this.addAction("resetView",function(){d.zoomTo(1);f.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(k){d.isFastZoomEnabled()?d.lazyZoom(!0,!0,f.buttonZoomDelay):d.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(k){d.isFastZoomEnabled()?d.lazyZoom(!1,!0,f.buttonZoomDelay):d.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){f.fitDiagramOrPages()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+H");this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible?d.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible?d.fitPages(2):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible?d.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var k=new FilenameDialog(this.editorUi,@@ -3727,7 +3732,7 @@ mxUtils.bind(this,function(){f.setPageVisible(!d.pageVisible)}));l.setToggleActif.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});l=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());f.fireEvent(new mxEventObject("copyConnectChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});l.isEnabled=h;l=this.addAction("autosave",function(){f.editor.setAutosave(!f.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return f.editor.autosave});l.isEnabled=h;l.visible=!1;this.addAction("help",function(){var k="";mxResources.isLanguageSupported(mxClient.language)&&(k="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+k+".html")});var t=!1;l=new Action("about",function(){t||(f.showDialog((new AboutDialog(f)).container,320,280,!0,!0,function(){t=!1}),t=!0)});l.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",l);l=mxUtils.bind(this,function(k,v,u,y){return this.addAction(k,function(){if(null!=u&&d.cellEditor.isContentEditing())u();else{d.stopEditing(!1);d.getModel().beginUpdate();try{var z=d.getEditableCells(d.getSelectionCells());d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,v,z);(v&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(z,function(D){D.style.fontWeight=null;"B"==D.nodeName&&d.replaceElement(D)}):(v&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?-d.updateLabelElements(z,function(D){D.style.fontStyle=null;"I"==D.nodeName&&d.replaceElement(D)}):(v&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(z,function(D){D.style.textDecoration=null;"U"==D.nodeName&&d.replaceElement(D)});for(var F=0;F<z.length;F++)0==d.model.getChildCount(z[F])&&d.autoSizeCell(z[F],!1)}finally{d.getModel().endUpdate()}}},null,null,y)});l("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",+d.updateLabelElements(z,function(D){D.style.fontStyle=null;"I"==D.nodeName&&d.replaceElement(D)}):(v&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(z,function(D){D.style.textDecoration=null;"U"==D.nodeName&&d.replaceElement(D)});for(var E=0;E<z.length;E++)0==d.model.getChildCount(z[E])&&d.autoSizeCell(z[E],!1)}finally{d.getModel().endUpdate()}}},null,null,y)});l("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");l("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){f.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",d.shapeForegroundColor)});this.addAction("strokeColor...",function(){f.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",d.shapeForegroundColor)});this.addAction("fillColor...",function(){f.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",d.shapeBackgroundColor)});this.addAction("gradientColor...",function(){f.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",d.shapeForegroundColor)});this.addAction("backgroundColor...",function(){f.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",d.shapeBackgroundColor)});this.addAction("borderColor...",function(){f.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",d.shapeForegroundColor)});this.addAction("removeFormat",function(){if(d.isEnabled()&&!d.isSelectionEmpty()&&!d.isEditing()){d.getModel().beginUpdate();try{for(var k=d.getSelectionCells(),v=0;v<k.length;v++)d.removeTextStyleForCell(k[v],!0)}finally{d.getModel().endUpdate()}}});this.addAction("vertical",function(){f.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){f.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){d.getModel().beginUpdate();@@ -3743,11 +3748,11 @@ function(){var k=f.actions.get("removeWaypoint");null!=k.handler&&k.handler.remonull,[u]))}}finally{d.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var k=d.getSelectionCells();if(null!=k){k=d.getEditableCells(d.addAllEdges(k));d.getModel().beginUpdate();try{for(var v=0;v<k.length;v++){var u=k[v];if(d.getModel().isEdge(u)){var y=d.getCellGeometry(u);null!=y&&(y=y.clone(),y.points=null,y.x=0,y.y=0,y.offset=null,d.getModel().setGeometry(u,y))}}}finally{d.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");l=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");l=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!d.isSelectionEmpty()){var k=d.getCurrentCellStyle(d.getSelectionCell());k=mxUtils.getValue(k,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);d.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,k-1),d.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");l=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!d.isSelectionEmpty()){var k=d.getCurrentCellStyle(d.getSelectionCell());k=mxUtils.getValue(k,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);d.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,k+1),d.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");-this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var k=mxResources.get("image")+" ("+mxResources.get("url")+"):",v=d.getView().getState(d.getSelectionCell()),u="",y=null;null!=v&&(u=v.style[mxConstants.STYLE_IMAGE]||u,y=v.style[mxConstants.STYLE_CLIP_PATH]||y);var z=d.cellEditor.saveSelection();f.showImageDialog(k,u,function(F,D,G,H,M,N){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(z),d.insertImage(F,D,G);else{var L=d.getSelectionCells();-if(null!=F&&(0<F.length||0<L.length)){var U=null;d.getModel().beginUpdate();try{if(0==L.length){L=[d.insertVertex(d.getDefaultParent(),null,"",0,0,D,G,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var X=d.getCenterInsertPoint(d.getBoundingBoxFromGeometry(L,!0));L[0].geometry.x=X.x;L[0].geometry.y=X.y;null!=H&&e(L[0],H,M,N,d);U=L;d.fireEvent(new mxEventObject("cellsInserted","cells",U))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<F.length?F:null,L);var S=-d.getCurrentCellStyle(L[0]);"image"!=S[mxConstants.STYLE_SHAPE]&&"label"!=S[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",L):0==F.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,L);null==H&&d.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,L);if(null!=D&&null!=G)for(F=0;F<L.length;F++){var V=L[F];if("0"!=d.getCurrentCellStyle(V).expand){var ha=d.getModel().getGeometry(V);null!=ha&&(ha=ha.clone(),ha.width=D,ha.height=G,d.getModel().setGeometry(V,ha))}null!=H&&e(V,H,M,-N,d)}}finally{d.getModel().endUpdate()}null!=U&&(d.setSelectionCells(U),d.scrollCellToVisible(U[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing(),!0,y)}}).isEnabled=h;this.addAction("crop...",function(){var k=d.getSelectionCell();if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&null!=k){var v=d.getCurrentCellStyle(k),u=v[mxConstants.STYLE_IMAGE],y=v[mxConstants.STYLE_SHAPE];u&&"image"==y&&(v=new CropImageDialog(f,u,v[mxConstants.STYLE_CLIP_PATH],function(z,F,D){e(k,-z,F,D,d)}),f.showDialog(v.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=h;l=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(f,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){f.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),+this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var k=mxResources.get("image")+" ("+mxResources.get("url")+"):",v=d.getView().getState(d.getSelectionCell()),u="",y=null;null!=v&&(u=v.style[mxConstants.STYLE_IMAGE]||u,y=v.style[mxConstants.STYLE_CLIP_PATH]||y);var z=d.cellEditor.saveSelection();f.showImageDialog(k,u,function(E,D,G,H,M,N){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(z),d.insertImage(E,D,G);else{var L=d.getSelectionCells();+if(null!=E&&(0<E.length||0<L.length)){var U=null;d.getModel().beginUpdate();try{if(0==L.length){L=[d.insertVertex(d.getDefaultParent(),null,"",0,0,D,G,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var X=d.getCenterInsertPoint(d.getBoundingBoxFromGeometry(L,!0));L[0].geometry.x=X.x;L[0].geometry.y=X.y;null!=H&&e(L[0],H,M,N,d);U=L;d.fireEvent(new mxEventObject("cellsInserted","cells",U))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<E.length?E:null,L);var S=+d.getCurrentCellStyle(L[0]);"image"!=S[mxConstants.STYLE_SHAPE]&&"label"!=S[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",L):0==E.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,L);null==H&&d.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,L);if(null!=D&&null!=G)for(E=0;E<L.length;E++){var V=L[E];if("0"!=d.getCurrentCellStyle(V).expand){var ha=d.getModel().getGeometry(V);null!=ha&&(ha=ha.clone(),ha.width=D,ha.height=G,d.getModel().setGeometry(V,ha))}null!=H&&e(V,H,M,+N,d)}}finally{d.getModel().endUpdate()}null!=U&&(d.setSelectionCells(U),d.scrollCellToVisible(U[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing(),!0,y)}}).isEnabled=h;this.addAction("crop...",function(){var k=d.getSelectionCell();if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&null!=k){var v=d.getCurrentCellStyle(k),u=v[mxConstants.STYLE_IMAGE],y=v[mxConstants.STYLE_SHAPE];u&&"image"==y&&(v=new CropImageDialog(f,u,v[mxConstants.STYLE_CLIP_PATH],function(z,E,D){e(k,+z,E,D,d)}),f.showDialog(v.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=h;l=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(f,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){f.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),f.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+L");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));l=this.addAction("format",mxUtils.bind(this,function(){f.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return f.isFormatPanelVisible()}));l=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(f,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){f.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),f.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var k=d.getSelectionCell();if(d.isEnabled()&&null!=k){var v=d.view.getState(k);if(null!=v&&"mxgraph.basic.polygon"===mxUtils.getValue(v.style,mxConstants.STYLE_SHAPE)){var u=new PolygonDialog(f,@@ -3792,20 +3797,20 @@ u&&0<u.length&&(e.scrollCellToVisible(u[0]),e.setSelectionCells(u))}),b):(l&&(b=b.setAttribute("title",mxResources.get("insertColumnAfter")),b=a.addItem(mxResources.get("deleteColumn"),Editor.removeColumnImage,mxUtils.bind(this,function(){if(null!=f)try{h?e.deleteLane(f):e.deleteTableColumn(f)}catch(k){this.editorUi.handleError(k)}})),b.setAttribute("title",mxResources.get("deleteColumn"))),t&&(b=a.addItem(mxResources.get("insertRowBefore"),Editor.addRowAboveImage,mxUtils.bind(this,function(){try{h?e.insertLane(f,!0):e.insertTableRow(f,!0)}catch(k){this.editorUi.handleError(k)}})),b.setAttribute("title",mxResources.get("insertRowBefore")),b=a.addItem(mxResources.get("insertRowAfter"),Editor.addRowBelowImage,mxUtils.bind(this,function(){try{h?e.insertLane(f,!1):e.insertTableRow(f,!1)}catch(k){this.editorUi.handleError(k)}})),b.setAttribute("title",mxResources.get("insertRowAfter")),b=a.addItem(mxResources.get("deleteRow"),Editor.removeRowImage,mxUtils.bind(this,function(){try{h?e.deleteLane(f):e.deleteTableRow(f)}catch(k){this.editorUi.handleError(k)}})),b.setAttribute("title",mxResources.get("deleteRow")),t=this.editorUi.getSelectionState(),null!=t.mergeCell?this.addMenuItem(a,"mergeCells"):(1<t.style.colspan||1<t.style.rowspan)&&this.addMenuItem(a,"unmergeCells")))};-Menus.prototype.addInsertTableItem=function(a,b,e,f){function g(z){y=d.getParentByName(mxEvent.getSource(z),"TD");var F=!1;if(null!=y){u=d.getParentByName(y,"TR");var D=mxEvent.isMouseEvent(z)?2:4,G=k,H=Math.min(20,u.sectionRowIndex+D);D=Math.min(20,y.cellIndex+D);for(var M=G.rows.length;M<H;M++)for(var N=G.insertRow(M),L=0;L<G.rows[0].cells.length;L++)N.insertCell(-1);for(M=0;M<G.rows.length;M++)for(N=G.rows[M],L=N.cells.length;L<D;L++)N.insertCell(-1);v.innerHTML=y.cellIndex+1+"x"+(u.sectionRowIndex+-1);for(G=0;G<k.rows.length;G++)for(H=k.rows[G],D=0;D<H.cells.length;D++)M=H.cells[D],G==u.sectionRowIndex&&D==y.cellIndex&&(F="blue"==M.style.backgroundColor),M.style.backgroundColor=G<=u.sectionRowIndex&&D<=y.cellIndex?"blue":"transparent"}mxEvent.consume(z);return F}f=null!=f?f:!0;var d=this.editorUi.editor.graph;b=null!=b?b:mxUtils.bind(this,function(z,F,D){if(null!=d.getParentByName(mxEvent.getSource(z),"TD")&&null!=d.cellEditor.textarea){var G=d.cellEditor.textarea.getElementsByTagName("table");-z=[];for(var H=0;H<G.length;H++)z.push(G[H]);d.container.focus();H=d;G=H.pasteHtmlAtCaret;for(var M=["<table>"],N=0;N<F;N++){M.push("<tr>");for(var L=0;L<D;L++)M.push("<td><br></td>");M.push("</tr>")}M.push("</table>");F=M.join("");G.call(H,F);F=d.cellEditor.textarea.getElementsByTagName("table");if(F.length==z.length+1)for(H=F.length-1;0<=H;H--)if(0==H||F[H]!=z[H-1]){d.selectNode(F[H].rows[0].cells[0]);break}}});null==e&&(a.div.classList.add("geToolbarMenu"),a.labels=!1);a=a.addItem("",null,null,+Menus.prototype.addInsertTableItem=function(a,b,e,f){function g(z){y=d.getParentByName(mxEvent.getSource(z),"TD");var E=!1;if(null!=y){u=d.getParentByName(y,"TR");var D=mxEvent.isMouseEvent(z)?2:4,G=k,H=Math.min(20,u.sectionRowIndex+D);D=Math.min(20,y.cellIndex+D);for(var M=G.rows.length;M<H;M++)for(var N=G.insertRow(M),L=0;L<G.rows[0].cells.length;L++)N.insertCell(-1);for(M=0;M<G.rows.length;M++)for(N=G.rows[M],L=N.cells.length;L<D;L++)N.insertCell(-1);v.innerHTML=y.cellIndex+1+"x"+(u.sectionRowIndex++1);for(G=0;G<k.rows.length;G++)for(H=k.rows[G],D=0;D<H.cells.length;D++)M=H.cells[D],G==u.sectionRowIndex&&D==y.cellIndex&&(E="blue"==M.style.backgroundColor),M.style.backgroundColor=G<=u.sectionRowIndex&&D<=y.cellIndex?"blue":"transparent"}mxEvent.consume(z);return E}f=null!=f?f:!0;var d=this.editorUi.editor.graph;b=null!=b?b:mxUtils.bind(this,function(z,E,D){if(null!=d.getParentByName(mxEvent.getSource(z),"TD")&&null!=d.cellEditor.textarea){var G=d.cellEditor.textarea.getElementsByTagName("table");+z=[];for(var H=0;H<G.length;H++)z.push(G[H]);d.container.focus();H=d;G=H.pasteHtmlAtCaret;for(var M=["<table>"],N=0;N<E;N++){M.push("<tr>");for(var L=0;L<D;L++)M.push("<td><br></td>");M.push("</tr>")}M.push("</table>");E=M.join("");G.call(H,E);E=d.cellEditor.textarea.getElementsByTagName("table");if(E.length==z.length+1)for(H=E.length-1;0<=H;H--)if(0==H||E[H]!=z[H-1]){d.selectNode(E[H].rows[0].cells[0]);break}}});null==e&&(a.div.classList.add("geToolbarMenu"),a.labels=!1);a=a.addItem("",null,null,e,null,null,null,!0);a.firstChild.style.fontSize=Menus.prototype.defaultFontSize+"px";e=a.getElementsByTagName("td");1<e.length&&(e[1].style.display="none",e[2].style.display="none");a.firstChild.innerText="";var h=document.createElement("input");h.setAttribute("id","geTitleOption");h.setAttribute("type","checkbox");h.style.verticalAlign="middle";e=document.createElement("label");mxUtils.write(e,mxResources.get("title"));e.setAttribute("for","geTitleOption");e.style.verticalAlign="middle";mxEvent.addGestureListeners(e,null,null,mxUtils.bind(this,function(z){mxEvent.consume(z)}));mxEvent.addGestureListeners(h,null,null,mxUtils.bind(this,function(z){mxEvent.consume(z)}));var l=document.createElement("input");l.setAttribute("id","geContainerOption");l.setAttribute("type","checkbox");l.style.verticalAlign="middle";var t=document.createElement("label");mxUtils.write(t,mxResources.get("container"));t.setAttribute("for","geContainerOption");t.style.verticalAlign="middle";mxEvent.addGestureListeners(t,null,null,mxUtils.bind(this,-function(z){mxEvent.consume(z)}));mxEvent.addGestureListeners(l,null,null,mxUtils.bind(this,function(z){mxEvent.consume(z)}));f&&(a.firstChild.appendChild(h),a.firstChild.appendChild(e),mxUtils.br(a.firstChild),a.firstChild.appendChild(l),a.firstChild.appendChild(t),mxUtils.br(a.firstChild));var k=function(z,F){var D=document.createElement("table");D.className="geInsertTablePicker";D.setAttribute("border","1");D.style.borderCollapse="collapse";D.style.borderStyle="solid";D.style.marginBottom="4px";-D.style.marginTop="8px";D.setAttribute("cellPadding","8");for(var G=0;G<z;G++)for(var H=D.insertRow(G),M=0;M<F;M++)H.insertCell(-1);return D}(5,5);a.firstChild.appendChild(k);var v=document.createElement("div");v.style.textAlign="center";v.style.padding="4px";v.style.width="100%";v.innerHTML="1x1";a.firstChild.appendChild(v);var u=null,y=null;mxEvent.addGestureListeners(k,null,null,mxUtils.bind(this,function(z){var F=g(z);null!=y&&null!=u&&F&&(b(z,u.sectionRowIndex+1,y.cellIndex+1,h.checked,l.checked),+function(z){mxEvent.consume(z)}));mxEvent.addGestureListeners(l,null,null,mxUtils.bind(this,function(z){mxEvent.consume(z)}));f&&(a.firstChild.appendChild(h),a.firstChild.appendChild(e),mxUtils.br(a.firstChild),a.firstChild.appendChild(l),a.firstChild.appendChild(t),mxUtils.br(a.firstChild));var k=function(z,E){var D=document.createElement("table");D.className="geInsertTablePicker";D.setAttribute("border","1");D.style.borderCollapse="collapse";D.style.borderStyle="solid";D.style.marginBottom="4px";+D.style.marginTop="8px";D.setAttribute("cellPadding","8");for(var G=0;G<z;G++)for(var H=D.insertRow(G),M=0;M<E;M++)H.insertCell(-1);return D}(5,5);a.firstChild.appendChild(k);var v=document.createElement("div");v.style.textAlign="center";v.style.padding="4px";v.style.width="100%";v.innerHTML="1x1";a.firstChild.appendChild(v);var u=null,y=null;mxEvent.addGestureListeners(k,null,null,mxUtils.bind(this,function(z){var E=g(z);null!=y&&null!=u&&E&&(b(z,u.sectionRowIndex+1,y.cellIndex+1,h.checked,l.checked),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0))}));mxEvent.addListener(k,"mouseover",g)};-Menus.prototype.edgeStyleChange=function(a,b,e,f,g,d,h,l){return this.showIconOnly(a.addItem(b,l,mxUtils.bind(this,function(){var t=this.editorUi.editor.graph;t.stopEditing(!1);t.getModel().beginUpdate();try{for(var k=t.getSelectionCells(),v=[],u=0;u<k.length;u++){var y=k[u];if(t.getModel().isEdge(y)){if(h){var z=t.getCellGeometry(y);null!=z&&(z=z.clone(),z.points=null,t.getModel().setGeometry(y,z))}for(var F=0;F<e.length;F++)t.setCellStyles(e[F],f[F],[y]);v.push(y)}else if("mxgraph.basic.arc"==mxUtils.getValue(t.getCurrentCellStyle(y),-mxConstants.STYLE_SHAPE)){for(F=0;F<e.length;F++)t.setCellStyles(e[F],f[F],[y]);v.push(y)}}this.editorUi.fireEvent(new mxEventObject("styleChanged","cells",v,"keys",e,"values",f,"force",0==v.length))}finally{t.getModel().endUpdate()}}),d,g))};Menus.prototype.showIconOnly=function(a){var b=a.getElementsByTagName("td");for(i=0;i<b.length;i++)"mxPopupMenuItem"==b[i].getAttribute("class")&&(b[i].style.display="none");return a};+Menus.prototype.edgeStyleChange=function(a,b,e,f,g,d,h,l){return this.showIconOnly(a.addItem(b,l,mxUtils.bind(this,function(){var t=this.editorUi.editor.graph;t.stopEditing(!1);t.getModel().beginUpdate();try{for(var k=t.getSelectionCells(),v=[],u=0;u<k.length;u++){var y=k[u];if(t.getModel().isEdge(y)){if(h){var z=t.getCellGeometry(y);null!=z&&(z=z.clone(),z.points=null,t.getModel().setGeometry(y,z))}for(var E=0;E<e.length;E++)t.setCellStyles(e[E],f[E],[y]);v.push(y)}else if("mxgraph.basic.arc"==mxUtils.getValue(t.getCurrentCellStyle(y),+mxConstants.STYLE_SHAPE)){for(E=0;E<e.length;E++)t.setCellStyles(e[E],f[E],[y]);v.push(y)}}this.editorUi.fireEvent(new mxEventObject("styleChanged","cells",v,"keys",e,"values",f,"force",0==v.length))}finally{t.getModel().endUpdate()}}),d,g))};Menus.prototype.showIconOnly=function(a){var b=a.getElementsByTagName("td");for(i=0;i<b.length;i++)"mxPopupMenuItem"==b[i].getAttribute("class")&&(b[i].style.display="none");return a};Menus.prototype.styleChange=function(a,b,e,f,g,d,h,l,t,k){var v=this.createStyleChangeFunction(e,f);a=a.addItem(b,k,mxUtils.bind(this,function(){var u=this.editorUi.editor.graph;null!=h&&u.cellEditor.isContentEditing()?h():v(l)}),d,g);t&&this.showIconOnly(a);return a};Menus.prototype.createStyleChangeFunction=function(a,b){return mxUtils.bind(this,function(e){var f=this.editorUi.editor.graph;f.stopEditing(!1);f.getModel().beginUpdate();try{for(var g=f.getEditableCells(f.getSelectionCells()),d=!1,h=0;h<a.length;h++)if(f.setCellStyles(a[h],b[h],g),a[h]==mxConstants.STYLE_ALIGN&&f.updateLabelElements(g,function(l){l.removeAttribute("align");l.style.textAlign=null}),a[h]==mxConstants.STYLE_FONTFAMILY||"fontSource"==a[h])d=!0;if(d)for(d=0;d<g.length;d++)0==f.model.getChildCount(g[d])&&f.autoSizeCell(g[d],!1);null!=e&&e();this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",a,"values",b,"cells",g))}finally{f.getModel().endUpdate()}})};-Menus.prototype.promptChange=function(a,b,e,f,g,d,h,l,t,k){return a.addItem(b,null,mxUtils.bind(this,function(){var v=this.editorUi.editor.graph,u=f,y=v.getView().getState(v.getSelectionCell());null!=y&&(u=y.style[g]||u);var z=null!=k?k():!0;u=new FilenameDialog(this.editorUi,u,mxResources.get("apply"),mxUtils.bind(this,function(F){if(null!=F&&0<F.length){if(z){v.getModel().beginUpdate();try{v.stopEditing(!1),v.setCellStyles(g,F)}finally{v.getModel().endUpdate()}}null!=l&&l(F)}}),mxResources.get("enterValue")++Menus.prototype.promptChange=function(a,b,e,f,g,d,h,l,t,k){return a.addItem(b,null,mxUtils.bind(this,function(){var v=this.editorUi.editor.graph,u=f,y=v.getView().getState(v.getSelectionCell());null!=y&&(u=y.style[g]||u);var z=null!=k?k():!0;u=new FilenameDialog(this.editorUi,u,mxResources.get("apply"),mxUtils.bind(this,function(E){if(null!=E&&0<E.length){if(z){v.getModel().beginUpdate();try{v.stopEditing(!1),v.setCellStyles(g,E)}finally{v.getModel().endUpdate()}}null!=l&&l(E)}}),mxResources.get("enterValue")+(0<e.length?" "+e:""),null,null,null,null,function(){null!=l&&null!=k&&l(null)});this.editorUi.showDialog(u.container,300,80,!0,!0);u.init()}),d,t,h)};Menus.prototype.pickColor=function(a,b,e,f,g,d){this.editorUi.tryAndHandle(mxUtils.bind(this,function(){var h=this.editorUi.editor.graph;if(null!=b&&h.cellEditor.isContentEditing()){var l=h.getSelectedEditingElement();null!=l&&null!=h.cellEditor.textarea&&(l=h.getTextColor(l,"forecolor"==b),this.editorUi.pickColor(l,mxUtils.bind(this,function(k){null!=h.cellEditor.textarea&&(Graph.setTextColor(h.cellEditor.textarea,k,"forecolor"==b),this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",["forecolor"==b?mxConstants.STYLE_FONTCOLOR:mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],"values",[k],"cells",[h.cellEditor.getEditingCell()])))}),f,g,d))}else{var t=h.getCellStyle(h.getSelectionCell(),!1);l=mxConstants.NONE;null!=t&&(l=t[a]||l);this.editorUi.pickColor(l,ColorDialog.createApplyFunction(this.editorUi,a),f,g,d)}}))};@@ -3846,9 +3851,9 @@ t.addItem("",Editor.removeFormatImage,mxUtils.bind(this,function(){document.exec!1,null)}))})),null,Editor.plusImage);h.setAttribute("data-min-width",700);this.addSeparator(null,700);var l=this.addMenu(new Menu(mxUtils.bind(this,function(t){var k=b.getSelectedElement(),v=b.getParentByNames(k,["TD","TH"],b.cellEditor.text2),u=b.getParentByName(k,"TR",b.cellEditor.text2);if(null==u)this.editorUi.menus.addInsertTableItem(t);else{var y=b.getParentByName(u,"TABLE",b.cellEditor.text2);k=t.addItem("",Editor.addColumnLeftImage,mxUtils.bind(this,function(){try{b.selectNode(b.insertColumn(y,null!=v?v.cellIndex:0))}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("insertColumnBefore"));k=t.addItem("",Editor.addColumnRightImage,mxUtils.bind(this,function(){try{b.selectNode(b.insertColumn(y,null!=v?v.cellIndex+1:-1))}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("insertColumnAfter"));k=t.addItem("Delete column",Editor.removeColumnImage,mxUtils.bind(this,function(){if(null!=v)try{b.deleteColumn(y,v.cellIndex)}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("deleteColumn"));k=t.addItem("",Editor.addRowAboveImage,mxUtils.bind(this,function(){try{b.selectNode(b.insertRow(y,u.sectionRowIndex))}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("insertRowBefore"));k=t.addItem("",Editor.addRowBelowImage,mxUtils.bind(this,function(){try{b.selectNode(b.insertRow(y,u.sectionRowIndex+1))}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("insertRowAfter"));k=t.addItem("",-Editor.removeRowImage,mxUtils.bind(this,function(){try{b.deleteRow(y,u.sectionRowIndex)}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("deleteRow"));k=t.addItem("",Editor.strokeColorImage,mxUtils.bind(this,function(){var z=y.style.borderColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(F,D,G,H){return"#"+("0"+Number(D).toString(16)).substr(-2)+("0"+Number(G).toString(16)).substr(-2)+("0"+Number(H).toString(16)).substr(-2)});this.editorUi.pickColor(z,-function(F){null==F||F==mxConstants.NONE?(y.removeAttribute("border"),y.style.border="",y.style.borderCollapse=""):(y.setAttribute("border","1"),y.style.border="1px solid "+F,y.style.borderCollapse="collapse")})}));k.setAttribute("title",mxResources.get("borderColor"));k=t.addItem("",Editor.fillColorImage,mxUtils.bind(this,function(){var z=y.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(F,D,G,H){return"#"+("0"+Number(D).toString(16)).substr(-2)+("0"+Number(G).toString(16)).substr(-2)+-("0"+Number(H).toString(16)).substr(-2)});this.editorUi.pickColor(z,function(F){y.style.backgroundColor=null==F||F==mxConstants.NONE?"":F})}));k.setAttribute("title",mxResources.get("backgroundColor"));k=t.addItem("",Editor.spacingImage,mxUtils.bind(this,function(){var z=y.getAttribute("cellPadding")||0;z=new FilenameDialog(this.editorUi,z,mxResources.get("apply"),mxUtils.bind(this,function(F){null!=F&&0<F.length?y.setAttribute("cellPadding",F):y.removeAttribute("cellPadding")}),mxResources.get("spacing"));+Editor.removeRowImage,mxUtils.bind(this,function(){try{b.deleteRow(y,u.sectionRowIndex)}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("deleteRow"));k=t.addItem("",Editor.strokeColorImage,mxUtils.bind(this,function(){var z=y.style.borderColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(E,D,G,H){return"#"+("0"+Number(D).toString(16)).substr(-2)+("0"+Number(G).toString(16)).substr(-2)+("0"+Number(H).toString(16)).substr(-2)});this.editorUi.pickColor(z,+function(E){null==E||E==mxConstants.NONE?(y.removeAttribute("border"),y.style.border="",y.style.borderCollapse=""):(y.setAttribute("border","1"),y.style.border="1px solid "+E,y.style.borderCollapse="collapse")})}));k.setAttribute("title",mxResources.get("borderColor"));k=t.addItem("",Editor.fillColorImage,mxUtils.bind(this,function(){var z=y.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(E,D,G,H){return"#"+("0"+Number(D).toString(16)).substr(-2)+("0"+Number(G).toString(16)).substr(-2)++("0"+Number(H).toString(16)).substr(-2)});this.editorUi.pickColor(z,function(E){y.style.backgroundColor=null==E||E==mxConstants.NONE?"":E})}));k.setAttribute("title",mxResources.get("backgroundColor"));k=t.addItem("",Editor.spacingImage,mxUtils.bind(this,function(){var z=y.getAttribute("cellPadding")||0;z=new FilenameDialog(this.editorUi,z,mxResources.get("apply"),mxUtils.bind(this,function(E){null!=E&&0<E.length?y.setAttribute("cellPadding",E):y.removeAttribute("cellPadding")}),mxResources.get("spacing"));this.editorUi.showDialog(z.container,300,80,!0,!0);z.init()}));k.setAttribute("title",mxResources.get("spacing"));k=t.addItem("",Editor.alignLeftImage,mxUtils.bind(this,function(){y.setAttribute("align","left")}));k.setAttribute("title",mxResources.get("left"));k=t.addItem("",Editor.alignCenterImage,mxUtils.bind(this,function(){y.setAttribute("align","center")}));k.setAttribute("title",mxResources.get("center"));k=t.addItem("",Editor.alignRightImage,mxUtils.bind(this,function(){y.setAttribute("align","right")}));k.setAttribute("title",mxResources.get("right"))}})),null,Editor.tableImage);l.setAttribute("data-min-width",740);this.editorUi.dependsOnLanguage(mxUtils.bind(this,function(){e.innerText=mxResources.get("style");d.setAttribute("title",mxResources.get("format"));e.setAttribute("title",mxResources.get("style"));f.setAttribute("title",mxResources.get("fontFamily"));g.setAttribute("title",mxResources.get("fontSize"));h.setAttribute("title",mxResources.get("insert"));l.setAttribute("title",mxResources.get("table"))}))};Toolbar.prototype.hideMenu=function(){this.editorUi.hideCurrentMenu()};Toolbar.prototype.setMenuText=function(a,b){a.getElementsByTagName("span")[0].innerText=b};Toolbar.prototype.setMenuIcon=function(a,b){a.style.backgroundImage="url("+b+")"};@@ -3859,19 +3864,19 @@ d.setAttribute("title",h)})),g.addListener("stateChanged",a)),a());return d};TooN=H*(1-G);D=H*(1-G*(M%2?D-M:1-(D-M)));switch(M){case 6:case 0:return[H,D,N];case 1:return[D,H,N];case 2:return[N,H,D];case 3:return[N,D,H];case 4:return[D,N,H];case 5:return[H,N,D]}}mxEventSource.call(this);var b=document.createElement("div");b.style.overflow="visible";b.style.position="relative";b.style.top="0px";b.style.left="0px";b.style.width="230px";b.style.height="114px";var e=document.createElement("div");e.style.border="1px solid light-dark(black, white)";e.style.backgroundImage="url("+this.hsImage+")";e.style.position="absolute";e.style.overflow="hidden";e.style.cursor="crosshair";e.style.width="181px";e.style.height="101px";e.style.left="6px";e.style.top="4px";var f=document.createElement("div");f.style.background="url("+this.crossImage+")";f.style.pointerEvents="none";f.style.position="absolute";f.style.width="15px";f.style.height="15px";f.style.left="-8px";f.style.top="-8px";var g=[0,0,1],d=1;e.appendChild(f);b.appendChild(e);sliderBox=document.createElement("div");sliderBox.style.position="absolute";sliderBox.style.cursor="pointer";sliderBox.style.width="38px";sliderBox.style.height="110px";sliderBox.style.left="199px";sliderBox.style.top="4px";var h=document.createElement("div");h.style.border="1px solid light-dark(black, white)";h.style.pointerEvents="none";h.style.overflow="hidden";h.style.position="absolute";h.style.width="16px";h.style.height="101px";h.style.left="9px";h.style.top="0px";var l=!1,t=!1,k=mxUtils.bind(this,function(D){var G=Math.round(100*(1-g[1]));f.style.left=-Math.round(g[0]/6*180)-8+"px";f.style.top=G-8+"px";G=h.childNodes;var H=a(g[0],g[1],1);if(null!=H){for(var M=0;M<G.length;M++)G[M].style.backgroundColor="rgb("+H[0]*(1-M/G.length)*255+", "+H[1]*(1-M/G.length)*255+", "+H[2]*(1-M/G.length)*255+")";F.style.top=Math.round(100*(1-g[2]))-4+"px";G=a(g[0],g[1],g[2]);G="#"+("0"+Math.round(255*G[0]).toString(16)).slice(-2)+("0"+Math.round(255*G[1]).toString(16)).slice(-2)+("0"+Math.round(255*G[2]).toString(16)).slice(-2)+(1>d?("0"+Math.round(255*d).toString(16)).slice(-2):+Math.round(g[0]/6*180)-8+"px";f.style.top=G-8+"px";G=h.childNodes;var H=a(g[0],g[1],1);if(null!=H){for(var M=0;M<G.length;M++)G[M].style.backgroundColor="rgb("+H[0]*(1-M/G.length)*255+", "+H[1]*(1-M/G.length)*255+", "+H[2]*(1-M/G.length)*255+")";E.style.top=Math.round(100*(1-g[2]))-4+"px";G=a(g[0],g[1],g[2]);G="#"+("0"+Math.round(255*G[0]).toString(16)).slice(-2)+("0"+Math.round(255*G[1]).toString(16)).slice(-2)+("0"+Math.round(255*G[2]).toString(16)).slice(-2)+(1>d?("0"+Math.round(255*d).toString(16)).slice(-2):"");1!=D&&this.fireEvent(new mxEventObject("change","color",mxUtils.rgba2hex(G)))}}),v=mxUtils.bind(this,function(D){0==g[2]&&(g[2]=1);l=!0;y(D)}),u=mxUtils.bind(this,function(D){t=!0;y(D)}),y=mxUtils.bind(this,function(D){if(l){var G=e.getBoundingClientRect(),H=mxEvent.getClientX(D)-G.left;D=mxEvent.getClientY(D)-G.top;f.style.left=H-8+"px";f.style.top=D-8+"px";H*=6/180;D=1-D/100;G=void 0;0>H&&(H=0);6<H&&(H=6);0>D&&(D=0);1<D&&(D=1);0>G&&(G=0);1<G&&(G=1);H=a(null==H?g[0]:g[0]=H,null==D?g[1]:g[1]=D,null==G?g[2]:g[2]=G);this.fromString("#"+("0"+Math.floor(255*H[0]).toString(16)).slice(-2)+("0"+Math.floor(255*H[1]).toString(16)).slice(-2)+("0"+Math.floor(255*H[2]).toString(16)).slice(-2)+(1>d?("0"+Math.round(255*d).toString(16)).slice(-2):""))}else t&&(G=sliderBox.getBoundingClientRect(),D=mxEvent.getClientY(D)-G.top,g[2]=Math.max(Math.min(1,1-D/100),0),k())}),z=mxUtils.bind(this,function(){l=t=!1});mxEvent.addGestureListeners(e,v);mxEvent.addGestureListeners(sliderBox,u);mxEvent.addGestureListeners(b,-null,y,z);mxEvent.addListener(b,"mouseleave",z);for(v=0;101>v;v+=4)u=document.createElement("div"),u.style.height="4px",u.style.pointerEvents="none",h.appendChild(u);b.appendChild(h);var F=document.createElement("div");F.style.background="url("+this.arrowImage+")";F.style.position="absolute";F.style.pointerEvents="none";F.style.width="7px";F.style.height="11px";F.style.left="2px";F.style.top="-3px";sliderBox.appendChild(F);sliderBox.appendChild(h);b.appendChild(sliderBox);this.fromString=function(D,+null,y,z);mxEvent.addListener(b,"mouseleave",z);for(v=0;101>v;v+=4)u=document.createElement("div"),u.style.height="4px",u.style.pointerEvents="none",h.appendChild(u);b.appendChild(h);var E=document.createElement("div");E.style.background="url("+this.arrowImage+")";E.style.position="absolute";E.style.pointerEvents="none";E.style.width="7px";E.style.height="11px";E.style.left="2px";E.style.top="-3px";sliderBox.appendChild(E);sliderBox.appendChild(h);b.appendChild(sliderBox);this.fromString=function(D,G){G=null!=G?G:!1;if(null==D||""==D||mxUtils.isVarColor(D)||D==mxConstants.NONE)D="#ffffff",G=!0;D=mxUtils.parseColor(D);var H=D.r/255,M=D.g/255,N=D.b/255,L=Math.min(Math.min(H,M),N);var U=Math.max(Math.max(H,M),N);var X=U-L;0===X?U=[null,0,U]:(H=H===L?3+(N-M)/X:M===L?5+(H-N)/X:1+(M-H)/X,U=[6===H?0:H,X/U,U]);null!=U[0]&&(g[0]=U[0]);0!=U[2]&&(g[1]=U[1]);g[2]=U[2];d=D.a;k(G)};this.fromString("#ffffff");this.div=b};mxUtils.extend(ColorPicker,mxEventSource);ColorPicker.prototype.hsImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAABlCAIAAACEDzXRAAAKQ0lEQVR42u2d23IjKwxFBeRh5v8/9uQlzXlI2gGELoCEm6pxubp6PI69WoV3C20uIQPAH4A/AH/p41/pDcTxP4BPGDtq3vYJGPpv8craeRdo/fyTI8ZhHnodOGgcV/3rnx8QI0SABO2xfAbiCfVR8Wj+CD8jenbRJNyGOxLoAaH1iLu4EUEHAv1+MsQ4zLE4AiIOcpibv4u9OET6+cP4ASnJ1JH4/G60A9km+GbBxLlpKAkADoR2JnaBrvWD/x1GCZn9EYLEHqVfI6Efx0D7E9tDF/rBSJ54l8FqTUse0J+EvxPrdK0fD4aOLXQi7zyGxMaRvvWjjH2U8o9I44OKnf+wyCpHoR/Phk6d/COq8481YrNI3/qR2B+kMl1Fl6J8o/JrU/GEA6HdiB2ha/0YBVx7rFwNHAj9JuIl6EI/qKyJug4Yvg7xA0QEpB8nQe8itoQu9EOT8M3mTsqUSUzykH6cBO1PbA9d91+ShDzV9xrtcgW21IT6L0yfcS90FKCdw+wS6Q9ISWjVfLTVVT2mdiPGGRduFKWm7dBStWlLmI0j/QExdgp7gT5qCu2BLKiLqtc94hI7PB8auQP4KuyIvSJ960fUqXWcd2F48Khr1bHSj2dDp/afmg7tMrFxpG/9mHMFuqrH3spFw0s0Bgr9OAzamdgFutaPpMuqo6WVEXWJdSL14xhof2J76MKfS2yXWGOVB1WXXGOVdxFSx587CXoLsTE0689RH7VW4RMLeKI9wPpzz4XeS2wDzdbXR52AWStjwiSAA6HdiB2h1f6cqT0whzzuzz0LejuxATTy90Xt40v7CzdGRvKS4O/zQ0AiXaRW5x/dv4vS4A/a308LYR5pFquRRvlHIrKWoCj5woCVId4eR/KPNDjURg2tdEC7rSQN5B9DYR70X5YivVxft7AyrOvrD4V2JnaBJurr+qpemLEywlRhT6qvPx16C7ExdK0fSjcj0maAzsqgBt7rfIxGP46B9iT2gi70I842bNj0U4wd/WAG/L5VP3p0W4iNoYv6Oh6eoJmSMW5laIzF8iT1TtgeV9RZoZ7QvdEUzsQu0CP+HOMKDFoZvDFg6s89CNqf2B5a4e8Hts84W0pgeohBtspBXYp8H3Tk/H23MBtHuvbn5mp7dlU9TUkP+XNJMabzHdCIbnuYDSItzZ+bdgUWrAwNPhwInRxw1/wXuYGj+4vo7flboRpjEQ6EjgojYK9/K04NFfNTauEBypXQWQLAfqQoHl9CfvpQ6C3ExtC9/q2YW2u6X1JWzfsYFPKX3L99LrQ/sT10XR+jKh+UN2AxlDOyXfLQaxxf/fkvT4d2JnaBZv258M6h4IFu2Em7/sezoLcQG0Mjfy6xrqLnVBLGWHw1i69WP5LCCn0TNEL3DLNXpCV/n5oo5jAVLY5Em6i8Pwm6uSNuCrNxpNX+nDira20qqyZriv384xhoZ2IX6Lr/wg8eiwpXYGQqPEgjsBrX+er3X46B9ie2h6bX/4i6IfcLS2mIY++7TfoCuLj6hwgN89CwBJ3Gx8rOVsn0kQ48tDS/4X1L8SzMb3BbkGdtwsD05AbP9YOU8xui+uljZei/P/3qx2HQbsSO0Ar/lveHLZYCVK4GeN1P5N+eAb2R2Aya9ueUY+8dlhLtdhWvgfEfz4AeGf9hR2wcaeTPpacvRdzLTx8J/Qq1Ij995PrJ3/mp0p8LO5YyF0s215g/9yxoZ2IXaLo+FiwtgTlvIAznp4+G3khsBk3Pf5mYvqOwMqZnNnw3i9cRDoT2JPaCZuvreskDuXkHxfQMvfbBgdBbiI2hC/3QLCg6lESZZkrfJ7nSj3gWNEMcRkYJsf5L0BXENBl1WV8/aquMLM9/eSJ0UtxZmFGGg4MigZ75ovHnvsOcUX09zRbzjCrU/K/Rev0gT2i2vu4cZrNI1+sH2e49Yb3lRC6e9fSS9ETohjj7hdkx0rQ/57/rxIrhBQdCv494Hlrtz1lo30Qjz1z+cRh02ndTNIMm1j8NxtmePs+76i+/esJHrH/6dGh/YntoRf9l2RtQWgJXzY4bdtbqx0OhnYldoHv7I79jf4+rOGGaRWr14yToLcTG0Ky/v32rjAsdX9S5vgI4ENqT2Asa7Z/9vq0yStiGNNVHkOe/RGmqwBQ0jEDHFpoJ85BLN+jPaRoHGWl2/2yx3msxVRHjZ0Td4GfV/Bf9bCM1dBiBfrHeJ1HR6dKEedDf5yPdBLilp/efC3Ribb1VxlUHGQe8iTb0598+Hdqf2B6a3b9SOerezsoIBWaJ3IBn1fp0j4PeQmwMzc5/idLK3UZWRkmKX2zA4Vc/DoPeSGwGrdvfY24RpKmVjrLuCQdCuxE7Qkv64TZ3Z44dVPrxUOh3EK9C1/lHGpz7ZzpVsYTF7K8Hyj+Ogd5FbAk9uL9H9LIyYg821sjo13gYtD+xPbRU/9Ds/b1sZTTIr5OStMGHA6GdiV2gUf2UmQcfJdUbXOoe6HoN1A0b2uQD4EBosXJqQTwKnXvXAEX+oZlfGaS9ewetDGCLeV1exH4e9Mr+2TDpv2iggYFW+LdBsTbngv/yUroGH0jleEX7MOgtxMbQ7PzKoMuajKyM8pYIiB194HnQzsQu0Gp/LvpulVHylsgK/TgG2p/YHrqXf6T3bJUBhfxFWUDPg95CbAytm/+ycasM9WOxWu0PnTniLWE2iLRi/4Z3bJXRvY76s0+Arl93I3aMNOHPBce2PdSkL7Kpnwe9l9gGutCPoFgkUtytXAGbex0vKCznSOs00o+ToLcQG0N/QErCrG6jrTIynVUDwo896vCzssPrNnAYtD+xPfR9fwmKeu/CVhm5OAn1STPkvhxBW1KXjeP60Y/DoJ2JXaAL/RCPy+PXc80L9d7OV294dVPbC/fb4EDoLcTG0IV+TCDrrIxMHIFg512BWj9OgvYk9oK+9SMoZG55q/JMiGS40/sLjacu28T3MVfd0Aha+u3QJXr+0Q//MBtHutaPQOzh3H0RBoZS5OJ/MjqJ9x2vQb7qgSuvX0StH0+FLptzrvTDh9gl0oV+iAbi2lAsqNmbK3yBAyLNdbRzW8Y6Btqf2B76A2IURE2zZY16KGfZlwqofJSL4feABka+xCNX+ekx0LuILaFr/Zit7s4ZA7y5Qg2sDr/t4zDodxCvQt/6occctDKGriMPzH85D9qN2BG61g/QwcLSVDSGl78C6LePY6A3EptBf0BKcjWWH/GqyJqoxKnMufEVBLJxAJwJ7U9sDH3fX0CxnIB4orMyuilTyRh6g+0bfDgQ2p/YHrrQD+jV6qb/SdRrMit8TRWwyEabxgFwJrQnsQt0rR+LR3VqFNiGHRBv73ge9EZiM+haPyicuRcVmIxzAMTMl9wfi3sGtBuxF3ShH92C29yJTteU+ohbRrZk3Qe9hdgY+tYPnOqanA+mTN33ZGKE06HQbsQu0LV+MF8+94rU5dK8B8/KyJaI+6D9ie2hC/3Q12QnSnYLn5p9P/6d0D7EltAh5wz/Hv8exON/LUjHOuz5CksAAAAASUVORK5CYII=";ColorPicker.prototype.crossImage="data:image/gif;base64,R0lGODlhDwAPAKEBAAAAAP///////////yH5BAEKAAIALAAAAAAPAA8AAAIklB8Qx53b4otSUWcvyiz4/4AeQJbmKY4p1HHapBlwPL/uVRsFADs=";ColorPicker.prototype.arrowImage="data:image/gif;base64,R0lGODlhBwALAKECAAAAAP///6g8eKg8eCH5BAEKAAIALAAAAAAHAAsAAAITTIQYcLnsgGxvijrxqdQq6DRJAQA7";var ColorDialog=function(a,b,e,f,g,d,h){function l(fa){return mxUtils.color2hex("#"+fa).substring(1).toUpperCase()}function t(){W.src="none"==Z.style.display?Editor.arrowRightImage:Editor.arrowDownImage}function k(fa,O){fa||"none"==Z.style.display?(Z.style.display="flex",!1!==O&&V.focus()):Z.style.display="none";t()}function v(fa){""==fa.value&&null!=N&&U?fa.style.background=fa==V?N.dark:N.light:""==fa.value||fa.value==mxConstants.NONE||mxUtils.isVarColor(fa.value)?fa.style.background="transparent":fa.style.background="#"+fa.value;fa.style.color="transparent"==fa.style.background?"light-dark(#000000, #ffffff)":mxUtils.isDarkColor(fa.style.background)?"#ffffff":"#000000"}function u(){v(X);v(V)}function y(fa){U!=fa&&(fa?h&&null!=N?(X.value=N.light.substring(1).toUpperCase(),fa=!1):(X.value="",V.value="",ha.value="automatic",X.setAttribute("placeholder",mxResources.get("useBlackAndWhite")),V.setAttribute("title",mxResources.get("useBlackAndWhite")),X.setAttribute("title",mxResources.get("useBlackAndWhite"))):(""==X.value&&null!=N&&(X.value=N.light.substring(1).toUpperCase()),X.removeAttribute("placeholder"),X.removeAttribute("title"),""==V.value&&null!=N&&(V.style.background=N.dark,fa=mxUtils.getCurrentStyle(V),V.value=mxUtils.rgba2hex(fa.backgroundColor).substring(1).toUpperCase()),V.removeAttribute("placeholder"),V.removeAttribute("title"),fa=!1));U=fa}function z(fa){"#"==fa.value.charAt(0)&&(fa.value=fa.value.substring(1));var O=fa.value,qa=O.toLowerCase();null==g||""!=O&&"automatic"!=qa&&"default"!=qa&&qa!=mxResources.get("default").toLowerCase()&&qa!=mxResources.get("automatic").toLowerCase()||null==N?(fa.value==mxConstants.NONE||mxUtils.isVarColor(fa.value)||(fa.value=l(fa.value),ka.fromString("#"+fa.value)),y(!1),fa!=V||X.value==mxConstants.NONE&&V.value==mxConstants.NONE||(ha.value="custom"),fa==X&&"automatic"==ha.value&&(X.value==mxConstants.NONE?V.value=mxConstants.NONE:mxUtils.isVarColor(X.value)?V.value=X.value:V.value=mxUtils.rgba2hex(mxUtils.getInverseColor("#"+fa.value)).substring(1).toUpperCase()),-u()):T.click()}function F(){var fa=X.value,O=V.value;if(U&&null!=N||(/(^#?[a-zA-Z0-9]*$)/.test(fa)||mxUtils.isVarColor(fa))&&(/(^#?[a-zA-Z0-9]*$)/.test(O)||mxUtils.isVarColor(O))){if(U)fa="default";else if(""==fa&&(fa=mxConstants.NONE),""==O&&(O=mxConstants.NONE),fa==mxConstants.NONE||mxUtils.isVarColor(fa)||"#"==fa.charAt(0)||(fa="#"+l(fa)),O==mxConstants.NONE||mxUtils.isVarColor(O)||"#"==O.charAt(0)||(O="#"+l(O)),fa!=mxConstants.NONE&&O!=mxConstants.NONE||ColorDialog.addRecentColor(mxConstants.NONE,+u()):T.click()}function E(){var fa=X.value,O=V.value;if(U&&null!=N||(/(^#?[a-zA-Z0-9]*$)/.test(fa)||mxUtils.isVarColor(fa))&&(/(^#?[a-zA-Z0-9]*$)/.test(O)||mxUtils.isVarColor(O))){if(U)fa="default";else if(""==fa&&(fa=mxConstants.NONE),""==O&&(O=mxConstants.NONE),fa==mxConstants.NONE||mxUtils.isVarColor(fa)||"#"==fa.charAt(0)||(fa="#"+l(fa)),O==mxConstants.NONE||mxUtils.isVarColor(O)||"#"==O.charAt(0)||(O="#"+l(O)),fa!=mxConstants.NONE&&O!=mxConstants.NONE||ColorDialog.addRecentColor(mxConstants.NONE,12),"automatic"!=ha.value&&O!=mxConstants.NONE?fa==mxConstants.NONE?ColorDialog.addRecentColor(O.substring(1),12):ColorDialog.addRecentColor("light-dark("+fa+","+O+")",12):fa!=mxConstants.NONE&&ColorDialog.addRecentColor(fa.substring(1),12),"none"!=fa||"none"!=O)fa=fa==mxConstants.NONE?"transparent":fa,O=O==mxConstants.NONE?"transparent":O,h||"automatic"==ha.value||(fa="light-dark("+fa+","+O+")");aa(fa);a.hideDialog()}else a.handleError({message:mxResources.get("invalidInput")})}function D(){mxClient.IS_TOUCH||-window.setTimeout(function(){oa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?oa.select():document.execCommand("selectAll",!1,null)},0)}function G(){oa.value!=mxConstants.NONE&&""!=oa.value&&ka.fromString("#"+oa.value,!0)}function H(){var fa=da(0==ColorDialog.recentColors.length?["FFFFFF"]:ColorDialog.recentColors,11,"FFFFFF",!0);fa.style.marginBottom="8px";return fa}function M(fa){13==fa.keyCode&&(z(mxEvent.getSource(fa)),F())}var N=null!=d?mxUtils.getLightDarkColor(d,null,null,+window.setTimeout(function(){oa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?oa.select():document.execCommand("selectAll",!1,null)},0)}function G(){oa.value!=mxConstants.NONE&&""!=oa.value&&ka.fromString("#"+oa.value,!0)}function H(){var fa=da(0==ColorDialog.recentColors.length?["FFFFFF"]:ColorDialog.recentColors,11,"FFFFFF",!0);fa.style.marginBottom="8px";return fa}function M(fa){13==fa.keyCode&&(z(mxEvent.getSource(fa)),E())}var N=null!=d?mxUtils.getLightDarkColor(d,null,null,h):null,L=a.editor.graph;this.editorUi=a;var U=!1;"default"==b||"transparent"==b||b==mxConstants.NONE||mxUtils.isVarColor(b)||mxUtils.isHexColor(b)||mxUtils.isRgbColor(b)||mxUtils.isLightDarkColor(b)||(b=mxUtils.color2hex(b));var X=document.createElement("input");X.style.textOverflow="ellipsis";X.style.margin="0 0 0 4px";X.style.width="100%";d=document.createElement("div");d.style.padding="0 4px";var S=document.createElement("div");S.style.display="flex";S.style.alignItems="center";d.appendChild(S);var V=document.createElement("input");V.style.textOverflow="ellipsis";V.style.margin="0 4px";V.style.maxWidth="70px";V.style.width="100%";var ha=document.createElement("select");ha.style.textOverflow="ellipsis";ha.style.width="100%";var R=document.createElement("option");R.setAttribute("value","automatic");mxUtils.write(R,mxResources.get("automatic"));ha.appendChild(R);R=document.createElement("option");R.setAttribute("value","custom");mxUtils.write(R,mxResources.get("userDefined"));ha.appendChild(R);ha.value=mxUtils.isLightDarkColor(b)?"custom":"automatic";var Z=document.createElement("div");Z.style.padding="0 6px 0 6px";R=document.createElement("img");R.setAttribute("title",mxResources.get("dark"));R.className="geAdaptiveAsset";R.src=Editor.thinDarkImage;R.style.width="20px";Z.appendChild(R);mxEvent.addListener(R,"click",function(){V.focus()});Z.appendChild(V);Z.appendChild(ha);Z.style.display="flex";Z.style.alignItems="center";R=document.createElement("div");R.style.display="flex";R.style.alignItems=@@ -3883,13 +3888,13 @@ var aa=null!=e?e:this.createApplyFunction();this.init=function(){D()};var ka=newfa,z(oa),window.setTimeout(function(){oa.focus()},0))});e=document.createElement("div");e.appendChild(ka.div);var pa=document.createElement("div");pa.style.display="flex";pa.style.flexFlow="row wrap";pa.style.justifyContent="center";pa.style.paddingTop="10px";var da=mxUtils.bind(this,function(fa,O,qa,ja){O=null!=O?O:12;var ua=document.createElement("table");ua.style.borderCollapse="collapse";ua.setAttribute("cellspacing","0");ua.style.marginBottom="20px";ua.style.cellSpacing="0px";ua.style.marginLeft="1px";var ya=document.createElement("tbody");ua.appendChild(ya);for(var Ma=fa.length/O,Oa=0;Oa<Ma;Oa++){for(var Ka=document.createElement("tr"),La=0;La<O;La++)mxUtils.bind(this,function(wa){var Ia=document.createElement("td");Ia.style.border="0px solid black";Ia.style.padding="0px";Ia.style.width="16px";Ia.style.height="16px";null==wa&&(wa=qa);if(null!=wa){Ia.style.borderWidth="1px";if(wa==mxConstants.NONE||null==wa)Ia.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(mxUtils.isLightDarkColor(wa)){var $a=mxUtils.getLightDarkColor(wa);Ia.style.background="linear-gradient(to right bottom, "+$a.cssText+" 50%, "+mxUtils.invertLightDarkColor($a).cssText+" 50.3%)"}else Ia.style.backgroundColor="#"+wa;$a=this.colorNames[String(wa).toUpperCase()];null!=$a&&Ia.setAttribute("title",$a)}Ka.appendChild(Ia);null!=wa&&(Ia.style.cursor="pointer",mxEvent.addListener(Ia,"click",function(){if(wa==mxConstants.NONE){oa==V&&V.value==mxConstants.NONE?X.value=mxConstants.NONE:oa.value=mxConstants.NONE;if(oa==X||oa==V&&-X.value==mxConstants.NONE)ha.value="automatic";z(oa);window.setTimeout(function(){oa.focus()},0)}else if(mxUtils.isLightDarkColor(wa)){k(!0);ha.value="custom";var ab=mxUtils.getLightDarkColor(wa);X.value=ab.light.substring(1).toUpperCase();V.value=ab.dark.substring(1).toUpperCase();z(X);z(V);oa==X?ka.fromString(ab.light):ka.fromString(ab.dark)}else ka.fromString("#"+wa)}),mxEvent.addListener(Ia,"dblclick",F))})(fa[Oa*O+La]);ya.appendChild(Ka)}ja&&(fa=document.createElement("td"),fa.setAttribute("title",+X.value==mxConstants.NONE)ha.value="automatic";z(oa);window.setTimeout(function(){oa.focus()},0)}else if(mxUtils.isLightDarkColor(wa)){k(!0);ha.value="custom";var ab=mxUtils.getLightDarkColor(wa);X.value=ab.light.substring(1).toUpperCase();V.value=ab.dark.substring(1).toUpperCase();z(X);z(V);oa==X?ka.fromString(ab.light):ka.fromString(ab.dark)}else ka.fromString("#"+wa)}),mxEvent.addListener(Ia,"dblclick",E))})(fa[Oa*O+La]);ya.appendChild(Ka)}ja&&(fa=document.createElement("td"),fa.setAttribute("title",mxResources.get("reset")),fa.className="geAdaptiveAsset",fa.style.border="1px solid black",fa.style.padding="0px",fa.style.width="16px",fa.style.height="16px",fa.style.backgroundImage="url('"+Editor.crossImage+"')",fa.style.backgroundPosition="center center",fa.style.backgroundSize="14px 14px",fa.style.backgroundRepeat="no-repeat",fa.style.cursor="pointer",Ka.appendChild(fa),mxEvent.addListener(fa,"click",function(){ColorDialog.resetRecentColors();ua.parentNode.replaceChild(H(),ua)}));pa.appendChild(ua);return ua});h||(d.appendChild(R),!ColorDialog.collapsed||Editor.isDarkMode()&&"auto"==L.getAdaptiveColors()||"automatic"!=ha.value||(Z.style.display="none",t()),R=document.createElement("img"),R.setAttribute("title",mxResources.get("light")),R.className="geAdaptiveAsset",R.src=Editor.thinLightImage,R.style.width="20px",S.appendChild(R),mxEvent.addListener(R,"click",function(){X.focus()}));S.appendChild(X);null!=N&&(T.setAttribute("title",mxResources.get(h?"default":"useBlackAndWhite")),T.style.cursor="pointer",T.style.position="relative",T.style.marginLeft="4px",T.innerText="",L=document.createElement("div"),L.style.display="inline-block",L.style.verticalAlign="middle",L.style.borderStyle="solid",L.style.borderWidth="1px",L.style.marginTop="-2px",L.style.width="12px",L.style.height="12px",h?L.style.backgroundColor=N.light:L.style.backgroundImage="linear-gradient(to right bottom, "+N.cssText+" 50%, "+mxUtils.invertLightDarkColor(N).cssText+" 50.3%)",T.appendChild(L),S.appendChild(T),mxEvent.addListener(T,-"dblclick",F));var ia=document.createElement("input");ia.setAttribute("type","color");ia.style.position="relative";ia.style.visibility="hidden";ia.style.top="10px";ia.style.width="0px";ia.style.height="0px";ia.style.border="none";e.style.whiteSpace="nowrap";S.appendChild(ia);L=mxUtils.button("",function(){document.activeElement==ia?X.focus():(ia.value="#"+X.value,ia.click())});L.style.cursor="pointer";R=document.createElement("img");R.src=Editor.colorDropperImage;R.className="geAdaptiveAsset";R.style.position=+"dblclick",E));var ia=document.createElement("input");ia.setAttribute("type","color");ia.style.position="relative";ia.style.visibility="hidden";ia.style.top="10px";ia.style.width="0px";ia.style.height="0px";ia.style.border="none";e.style.whiteSpace="nowrap";S.appendChild(ia);L=mxUtils.button("",function(){document.activeElement==ia?X.focus():(ia.value="#"+X.value,ia.click())});L.style.cursor="pointer";R=document.createElement("img");R.src=Editor.colorDropperImage;R.className="geAdaptiveAsset";R.style.position="relative";R.style.verticalAlign="middle";R.style.marginTop="-2px";R.style.width="auto";R.style.height="14px";L.appendChild(R);S.appendChild(L);e.appendChild(d);mxEvent.addListener(ia,"change",function(){ka.fromString(ia.value)});h||e.appendChild(Z);H();d=da(this.presetColors);d.style.marginBottom="8px";d=da(this.defaultColors);d.style.marginBottom="16px";e.appendChild(pa);d=document.createElement("div");d.style.display="flex";d.style.whiteSpace="nowrap";d.style.alignItems="center";d.style.justifyContent=-"end";a.isOffline()||d.appendChild(a.createHelpIcon("https://github.com/jgraph/drawio/discussions/4713"));S=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=f&&f()});S.className="geBtn";a.editor.cancelFirst&&d.appendChild(S);L=mxUtils.button(mxResources.get("apply"),F);L.className="geBtn gePrimaryBtn";d.appendChild(L);a.editor.cancelFirst||d.appendChild(S);null!=b&&("default"==b?T.click():(S=mxUtils.getLightDarkColor(b),b==mxConstants.NONE||"transparent"==S.light?X.value=mxConstants.NONE:+"end";a.isOffline()||d.appendChild(a.createHelpIcon("https://github.com/jgraph/drawio/discussions/4713"));S=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=f&&f()});S.className="geBtn";a.editor.cancelFirst&&d.appendChild(S);L=mxUtils.button(mxResources.get("apply"),E);L.className="geBtn gePrimaryBtn";d.appendChild(L);a.editor.cancelFirst||d.appendChild(S);null!=b&&("default"==b?T.click():(S=mxUtils.getLightDarkColor(b),b==mxConstants.NONE||"transparent"==S.light?X.value=mxConstants.NONE:mxUtils.isVarColor(S.light)?X.value=S.light:(mxUtils.isRgbColor(S.light)?S.light=mxUtils.rgba2hex(S.light):mxUtils.isHexColor(S.light)||(S.light="#"+l(S.light)),X.value=S.light.substring(1).toUpperCase()),b==mxConstants.NONE||"transparent"==S.dark?V.value=mxConstants.NONE:mxUtils.isVarColor(S.dark)?V.value=S.dark:(mxUtils.isRgbColor(S.dark)?S.dark=mxUtils.rgba2hex(S.dark):mxUtils.isHexColor(S.dark)||(S.dark="#"+l(S.dark)),V.value=S.dark.substring(1).toUpperCase()),G(),u()));h||!ColorDialog.collapsed||"automatic"!=ha.value||Editor.isDarkMode()||(Z.style.display="none",t());e.appendChild(d);this.picker=ka;this.colorInput=X;mxEvent.addListener(X,"keypress",M);mxEvent.addListener(V,"keypress",M);mxEvent.addListener(e,"keydown",function(fa){27==fa.keyCode&&(a.hideDialog(),null!=f&&f(),mxEvent.consume(fa))});this.container=e};ColorDialog.prototype.presetColors="E6D0DE CDA2BE B5739D E1D5E7 C3ABD0 A680B8 D4E1F5 A9C4EB 7EA6E0 D5E8D4 9AC7BF 67AB9F D5E8D4 B9E0A5 97D077 FFF2CC FFE599 FFD966 FFF4C3 FFCE9F FFB570 F8CECC F19C99 EA6B66".split(" ");ColorDialog.prototype.colorNames={};ColorDialog.prototype.defaultColors="none FFFFFF E6E6E6 CCCCCC B3B3B3 999999 808080 666666 4D4D4D 333333 1A1A1A 000000 FFCCCC FFE6CC FFFFCC E6FFCC CCFFCC CCFFE6 CCFFFF CCE5FF CCCCFF E5CCFF FFCCFF FFCCE6 FF9999 FFCC99 FFFF99 CCFF99 99FF99 99FFCC 99FFFF 99CCFF 9999FF CC99FF FF99FF FF99CC FF6666 FFB366 FFFF66 B3FF66 66FF66 66FFB3 66FFFF 66B2FF 6666FF B266FF FF66FF FF66B3 FF3333 FF9933 FFFF33 99FF33 33FF33 33FF99 33FFFF 3399FF 3333FF 9933FF FF33FF FF3399 FF0000 FF8000 FFFF00 80FF00 00FF00 00FF80 00FFFF 007FFF 0000FF 7F00FF FF00FF FF0080 CC0000 CC6600 CCCC00 66CC00 00CC00 00CC66 00CCCC 0066CC 0000CC 6600CC CC00CC CC0066 990000 994C00 999900 4D9900 009900 00994D 009999 004C99 000099 4C0099 990099 99004D 660000 663300 666600 336600 006600 006633 006666 003366 000066 330066 660066 660033 330000 331A00 333300 1A3300 003300 00331A 003333 001933 000033 190033 330033 33001A".split(" ");@@ -3899,8 +3904,8 @@ var AboutDialog=function(a){var b=document.createElement("div");b.setAttribute(""http://www.jgraph.com/");e.setAttribute("target","_blank");mxUtils.write(e,"www.jgraph.com");b.appendChild(e);mxUtils.br(b);mxUtils.br(b);e=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.className="geBtn gePrimaryBtn";b.appendChild(e);this.container=b},SimpleTextareaDialog=function(a,b,e,f,g){var d=document.createElement("div"),h=document.createElement("textarea");h.style.position="absolute";h.style.left="30px";h.style.right="30px";h.style.top="30px";h.style.bottom="100px";h.style.resize="none";h.setAttribute("wrap","off");h.setAttribute("spellcheck","false");h.setAttribute("autocorrect","off");h.setAttribute("autocomplete","off");h.setAttribute("autocapitalize","off");h.value=null!=b?b:"";d.appendChild(h);b=document.createElement("div");b.style.position="absolute";b.style.bottom="46px";b.style.right="30px";b.style.left="30px";b.style.justifyContent="end";b.style.display="flex";null==g||a.isOffline()||b.appendChild(a.createHelpIcon(g));g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.setAttribute("title","Escape");g.className="geBtn";a.editor.cancelFirst&&b.appendChild(g);var l=mxUtils.button(null!=f?f:mxResources.get("apply"),function(){a.hideDialog();e(h.value)});l.setAttribute("title","Ctrl+Enter");l.className="geBtn gePrimaryBtn";b.appendChild(l);mxEvent.addListener(h,"keydown",function(t){13==t.keyCode&&mxEvent.isControlDown(t)&&l.click()});a.editor.cancelFirst||b.appendChild(g);this.init=function(){h.focus();h.scrollTop=0};d.appendChild(b);-this.container=d},TextareaDialog=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z,F){k=null!=k?k:!1;h=document.createElement("div");h.style.position="absolute";h.style.top="20px";h.style.bottom="20px";h.style.left="20px";h.style.right="20px";l=document.createElement("div");l.style.position="absolute";l.style.left="0px";l.style.right="0px";var D=l.cloneNode(!1),G=l.cloneNode(!1);l.style.top="0px";l.style.height="20px";D.style.top="20px";D.style.bottom="64px";G.style.display="flex";G.style.whiteSpace="nowrap";-G.style.alignItems="center";G.style.justifyContent="end";G.style.bottom="10px";G.style.height="50px";G.style.textAlign="right";G.style.paddingTop="14px";G.style.boxSizing="border-box";mxUtils.write(l,b);h.appendChild(l);h.appendChild(D);h.appendChild(G);null!=F&&l.appendChild(F);var H=document.createElement("textarea");v?H.setAttribute("wrap","off"):H.style.wordBreak="break-all";H.setAttribute("spellcheck","false");H.setAttribute("autocorrect","off");H.setAttribute("autocomplete","off");H.setAttribute("autocapitalize",+this.container=d},TextareaDialog=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z,E){k=null!=k?k:!1;h=document.createElement("div");h.style.position="absolute";h.style.top="20px";h.style.bottom="20px";h.style.left="20px";h.style.right="20px";l=document.createElement("div");l.style.position="absolute";l.style.left="0px";l.style.right="0px";var D=l.cloneNode(!1),G=l.cloneNode(!1);l.style.top="0px";l.style.height="20px";D.style.top="20px";D.style.bottom="64px";G.style.display="flex";G.style.whiteSpace="nowrap";+G.style.alignItems="center";G.style.justifyContent="end";G.style.bottom="10px";G.style.height="50px";G.style.textAlign="right";G.style.paddingTop="14px";G.style.boxSizing="border-box";mxUtils.write(l,b);h.appendChild(l);h.appendChild(D);h.appendChild(G);null!=E&&l.appendChild(E);var H=document.createElement("textarea");v?H.setAttribute("wrap","off"):H.style.wordBreak="break-all";H.setAttribute("spellcheck","false");H.setAttribute("autocorrect","off");H.setAttribute("autocomplete","off");H.setAttribute("autocapitalize","off");mxUtils.write(H,e||"");H.style.resize="none";H.style.outline="none";H.style.position="absolute";H.style.boxSizing="border-box";H.style.top="0px";H.style.left="0px";H.style.height="100%";H.style.width="100%";this.textarea=H;this.init=function(){H.focus();H.scrollTop=0};D.appendChild(H);null==y||a.isOffline()||G.appendChild(a.createHelpIcon(y));if(null!=z)for(b=0;b<z.length;b++)(function(N,L,U){N=mxUtils.button(N,function(X){L(X,H)});null!=U&&N.setAttribute("title",U);N.className="geBtn";G.appendChild(N)})(z[b][0],z[b][1],z[b][2]);d=mxUtils.button(d||mxResources.get("cancel"),function(){a.hideDialog();null!=g&&g()});d.setAttribute("title","Escape");d.className="geBtn";a.editor.cancelFirst&&G.appendChild(d);null!=t&&t(G,H);if(null!=f){var M=mxUtils.button(u||mxResources.get("apply"),function(){k||a.hideDialog();f(H.value)});M.setAttribute("title","Ctrl+Enter");M.className="geBtn gePrimaryBtn";G.appendChild(M);mxEvent.addListener(H,"keydown",function(N){13==N.keyCode&&mxEvent.isControlDown(N)&&M.click()})}a.editor.cancelFirst||G.appendChild(d);this.container=h},EditDiagramDialog=function(a){var b=document.createElement("div");b.style.position="absolute";b.style.inset="10px";var e=document.createElement("textarea");e.setAttribute("wrap","off");e.setAttribute("spellcheck","false");e.setAttribute("autocorrect","off");e.setAttribute("autocomplete","off");e.setAttribute("autocapitalize","off");e.style.overflow="auto";e.style.resize="none";e.style.position="absolute";e.style.top="20px";e.style.bottom="76px";e.style.left="20px";@@ -3908,33 +3913,33 @@ e.style.right="20px";var f=a.getDiagramSnapshot();e.value=mxUtils.getPrettyXml(f!1));var g=document.createElement("div");g.style.display="flex";g.style.whiteSpace="nowrap";g.style.alignItems="center";g.style.justifyContent="end";g.style.position="absolute";g.style.height="36px";g.style.bottom="24px";g.style.left="20px";g.style.right="20px";var d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";a.editor.cancelFirst&&g.appendChild(d);var h=document.createElement("select");h.style.textOverflow="ellipsis";h.style.width="196px";h.className="geBtn";if(a.editor.graph.isEnabled()){var l=document.createElement("option");l.setAttribute("value","apply");mxUtils.write(l,mxResources.get("apply",null,"Update Existing Drawing"));h.appendChild(l)}a.editor.graph.isEnabled()&&(l=document.createElement("option"),l.setAttribute("value","insert"),mxUtils.write(l,mxResources.get("insert")),h.appendChild(l));l=document.createElement("option");l.setAttribute("value","new");mxUtils.write(l,mxResources.get("openInNewWindow"));EditDiagramDialog.showNewWindowOption&&!navigator.standalone&&h.appendChild(l);g.appendChild(h);l=mxUtils.button(mxResources.get("ok"),function(){var t=Graph.zapGremlins(mxUtils.trim(e.value)),k=null;if("new"==h.value)a.hideDialog(),a.editor.editAsNew(t);else if("apply"==h.value)try{var v=mxUtils.parseXml(t).documentElement,u=Editor.extractParserError(v,mxResources.get("unknownError"));u?(EditorUi.debug("EditDiagramDialogParserError",[this],"node",[v],"cause",[u]),k=mxResources.get("invalidInput")+" ("+u+")"):("mxfile"==v.nodeName?a.editor.setGraphXml(v):-a.updateDiagramData(f,v),a.hideDialog())}catch(D){k=D}else if("insert"==h.value){a.editor.graph.model.beginUpdate();try{var y=mxUtils.parseXml(t),z=new mxGraphModel;(new mxCodec(y)).decode(y.documentElement,z);var F=z.getChildren(z.getChildAt(z.getRoot(),0));a.editor.graph.setSelectionCells(a.editor.graph.importCells(F));a.hideDialog()}catch(D){k=D}finally{a.editor.graph.model.endUpdate()}}null!=k&&a.handleError(k)});l.className="geBtn gePrimaryBtn";g.appendChild(l);a.editor.cancelFirst||g.appendChild(d);+a.updateDiagramData(f,v),a.hideDialog())}catch(D){k=D}else if("insert"==h.value){a.editor.graph.model.beginUpdate();try{var y=mxUtils.parseXml(t),z=new mxGraphModel;(new mxCodec(y)).decode(y.documentElement,z);var E=z.getChildren(z.getChildAt(z.getRoot(),0));a.editor.graph.setSelectionCells(a.editor.graph.importCells(E));a.hideDialog()}catch(D){k=D}finally{a.editor.graph.model.endUpdate()}}null!=k&&a.handleError(k)});l.className="geBtn gePrimaryBtn";g.appendChild(l);a.editor.cancelFirst||g.appendChild(d);b.appendChild(g);this.container=b};EditDiagramDialog.showNewWindowOption=!0;-var ExportDialog=function(a){function b(){var S=v.value,V=S.lastIndexOf(".");v.value=0<V?S.substring(0,V+1)+u.value:S+"."+u.value;"xml"===u.value?(y.setAttribute("disabled","true"),z.setAttribute("disabled","true"),F.setAttribute("disabled","true"),L.setAttribute("disabled","true")):(y.removeAttribute("disabled"),z.removeAttribute("disabled"),F.removeAttribute("disabled"),L.removeAttribute("disabled"));"png"===u.value||"svg"===u.value||"pdf"===u.value?M.removeAttribute("disabled"):M.setAttribute("disabled",-"disabled");"png"===u.value||"jpg"===u.value||"pdf"===u.value?N.removeAttribute("disabled"):N.setAttribute("disabled","disabled");"png"===u.value?(D.removeAttribute("disabled"),G.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"))}function e(){z.style.backgroundColor=z.value*F.value>MAX_AREA||0>=z.value?"red":"";F.style.backgroundColor=z.value*F.value>MAX_AREA||0>=F.value?"red":""}var f=a.editor.graph,g=f.getGraphBounds(),d=f.view.scale,h=Math.ceil(g.width/+var ExportDialog=function(a){function b(){var S=v.value,V=S.lastIndexOf(".");v.value=0<V?S.substring(0,V+1)+u.value:S+"."+u.value;"xml"===u.value?(y.setAttribute("disabled","true"),z.setAttribute("disabled","true"),E.setAttribute("disabled","true"),L.setAttribute("disabled","true")):(y.removeAttribute("disabled"),z.removeAttribute("disabled"),E.removeAttribute("disabled"),L.removeAttribute("disabled"));"png"===u.value||"svg"===u.value||"pdf"===u.value?M.removeAttribute("disabled"):M.setAttribute("disabled",+"disabled");"png"===u.value||"jpg"===u.value||"pdf"===u.value?N.removeAttribute("disabled"):N.setAttribute("disabled","disabled");"png"===u.value?(D.removeAttribute("disabled"),G.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"))}function e(){z.style.backgroundColor=z.value*E.value>MAX_AREA||0>=z.value?"red":"";E.style.backgroundColor=z.value*E.value>MAX_AREA||0>=E.value?"red":""}var f=a.editor.graph,g=f.getGraphBounds(),d=f.view.scale,h=Math.ceil(g.width/d),l=Math.ceil(g.height/d);d=document.createElement("table");var t=document.createElement("tbody");d.setAttribute("cellpadding",mxClient.IS_SF?"0":"2");g=document.createElement("tr");var k=document.createElement("td");k.style.fontSize="10pt";k.style.width="100px";mxUtils.write(k,mxResources.get("filename")+":");g.appendChild(k);var v=document.createElement("input");v.setAttribute("value",a.editor.getOrCreateFilename());v.style.width="180px";k=document.createElement("td");k.appendChild(v);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("format")+":");g.appendChild(k);var u=document.createElement("select");u.style.width="180px";k=document.createElement("option");k.setAttribute("value","png");mxUtils.write(k,mxResources.get("formatPng"));u.appendChild(k);k=document.createElement("option");ExportDialog.showGifOption&&(k.setAttribute("value","gif"),mxUtils.write(k,mxResources.get("formatGif")),u.appendChild(k));k=document.createElement("option");k.setAttribute("value","jpg");mxUtils.write(k,mxResources.get("formatJpg"));u.appendChild(k);k=document.createElement("option");k.setAttribute("value","svg");mxUtils.write(k,mxResources.get("formatSvg"));u.appendChild(k);ExportDialog.showXmlOption&&(k=document.createElement("option"),k.setAttribute("value","xml"),mxUtils.write(k,mxResources.get("formatXml")),u.appendChild(k));k=document.createElement("td");k.appendChild(u);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("zoom")+" (%):");g.appendChild(k);var y=document.createElement("input");y.setAttribute("type","number");y.setAttribute("value","100");y.style.width="180px";k=document.createElement("td");k.appendChild(y);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("width")+":");g.appendChild(k);var z=document.createElement("input");-z.setAttribute("value",h);z.style.width="180px";k=document.createElement("td");k.appendChild(z);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("height")+":");g.appendChild(k);var F=document.createElement("input");F.setAttribute("value",l);F.style.width="180px";k=document.createElement("td");k.appendChild(F);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");+z.setAttribute("value",h);z.style.width="180px";k=document.createElement("td");k.appendChild(z);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("height")+":");g.appendChild(k);var E=document.createElement("input");E.setAttribute("value",l);E.style.width="180px";k=document.createElement("td");k.appendChild(E);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("dpi")+":");g.appendChild(k);var D=document.createElement("select");D.style.width="180px";k=document.createElement("option");k.setAttribute("value","100");mxUtils.write(k,"100dpi");D.appendChild(k);k=document.createElement("option");k.setAttribute("value","200");mxUtils.write(k,"200dpi");D.appendChild(k);k=document.createElement("option");k.setAttribute("value","300");mxUtils.write(k,"300dpi");D.appendChild(k);k=document.createElement("option");k.setAttribute("value","400");mxUtils.write(k,"400dpi");D.appendChild(k);k=document.createElement("option");k.setAttribute("value","custom");mxUtils.write(k,mxResources.get("custom"));D.appendChild(k);var G=document.createElement("input");G.style.width="180px";G.style.display="none";G.setAttribute("value","100");G.setAttribute("type","number");G.setAttribute("min","50");G.setAttribute("step","50");var H=!1;mxEvent.addListener(D,"change",function(){"custom"==this.value?(this.style.display="none",G.style.display="",G.focus()):(G.value=this.value,H||(y.value=this.value))});mxEvent.addListener(G,"change",function(){var S=parseInt(G.value);isNaN(S)||0>=S?G.style.backgroundColor="red":(G.style.backgroundColor="",H||(y.value=S))});k=document.createElement("td");k.appendChild(D);k.appendChild(G);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("background")+":");g.appendChild(k);var M=document.createElement("input");M.setAttribute("type","checkbox");M.checked=null==f.background||f.background==mxConstants.NONE;k=document.createElement("td");k.appendChild(M);mxUtils.write(k,mxResources.get("transparent"));g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("grid")+":");g.appendChild(k);var N=document.createElement("input");N.setAttribute("type","checkbox");N.checked=!1;k=document.createElement("td");k.appendChild(N);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("borderWidth")+":");g.appendChild(k);var L=document.createElement("input");L.setAttribute("type","number");L.setAttribute("value",ExportDialog.lastBorderValue);L.style.width="180px";k=document.createElement("td");k.appendChild(L);g.appendChild(k);t.appendChild(g);d.appendChild(t);mxEvent.addListener(u,"change",b);b();mxEvent.addListener(y,"change",-function(){H=!0;var S=Math.max(0,parseFloat(y.value)||100)/100;y.value=parseFloat((100*S).toFixed(2));0<h?(z.value=Math.floor(h*S),F.value=Math.floor(l*S)):(y.value="100",z.value=h,F.value=l);e()});mxEvent.addListener(z,"change",function(){var S=parseInt(z.value)/h;0<S?(y.value=parseFloat((100*S).toFixed(2)),F.value=Math.floor(l*S)):(y.value="100",z.value=h,F.value=l);e()});mxEvent.addListener(F,"change",function(){var S=parseInt(F.value)/l;0<S?(y.value=parseFloat((100*S).toFixed(2)),z.value=Math.floor(h*-S)):(y.value="100",z.value=h,F.value=l);e()});g=document.createElement("tr");k=document.createElement("td");k.setAttribute("align","right");k.style.paddingTop="22px";k.colSpan=2;var U=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(){if(0>=parseInt(y.value))mxUtils.alert(mxResources.get("drawingEmpty"));else{var S=v.value,V=u.value,ha=Math.max(0,parseFloat(y.value)||100)/100,R=Math.max(0,parseInt(L.value)),Z=f.background,W=Math.max(1,parseInt(G.value));if(("svg"==V||"png"==V||+function(){H=!0;var S=Math.max(0,parseFloat(y.value)||100)/100;y.value=parseFloat((100*S).toFixed(2));0<h?(z.value=Math.floor(h*S),E.value=Math.floor(l*S)):(y.value="100",z.value=h,E.value=l);e()});mxEvent.addListener(z,"change",function(){var S=parseInt(z.value)/h;0<S?(y.value=parseFloat((100*S).toFixed(2)),E.value=Math.floor(l*S)):(y.value="100",z.value=h,E.value=l);e()});mxEvent.addListener(E,"change",function(){var S=parseInt(E.value)/l;0<S?(y.value=parseFloat((100*S).toFixed(2)),z.value=Math.floor(h*+S)):(y.value="100",z.value=h,E.value=l);e()});g=document.createElement("tr");k=document.createElement("td");k.setAttribute("align","right");k.style.paddingTop="22px";k.colSpan=2;var U=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(){if(0>=parseInt(y.value))mxUtils.alert(mxResources.get("drawingEmpty"));else{var S=v.value,V=u.value,ha=Math.max(0,parseFloat(y.value)||100)/100,R=Math.max(0,parseInt(L.value)),Z=f.background,W=Math.max(1,parseInt(G.value));if(("svg"==V||"png"==V||"pdf"==V)&&M.checked)Z=null;else if(null==Z||Z==mxConstants.NONE)Z="#ffffff";ExportDialog.lastBorderValue=R;ExportDialog.exportFile(a,S,V,Z,ha,R,W,N.checked)}}));U.className="geBtn gePrimaryBtn";var X=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});X.className="geBtn";a.editor.cancelFirst?(k.appendChild(X),k.appendChild(U)):(k.appendChild(U),k.appendChild(X));g.appendChild(k);t.appendChild(g);d.appendChild(t);this.container=d};ExportDialog.lastBorderValue=0;ExportDialog.showGifOption=!0;ExportDialog.showXmlOption=!0;ExportDialog.exportFile=function(a,b,e,f,g,d,h,l){l=a.editor.graph;if("xml"==e)ExportDialog.saveLocalFile(a,mxUtils.getXml(a.editor.getGraphXml()),b,e);else if("svg"==e)ExportDialog.saveLocalFile(a,mxUtils.getXml(l.getSvg(f,g,d)),b,e);else{var t=l.getGraphBounds(),k=mxUtils.createXmlDocument(),v=k.createElement("output");k.appendChild(v);k=new mxXmlCanvas2D(v);k.translate(Math.floor((d/g-t.x)/l.view.scale),Math.floor((d/g-t.y)/l.view.scale));k.scale(g/l.view.scale);(new mxImageExport).drawState(l.getView().getState(l.model.root),k);v="xml="+encodeURIComponent(mxUtils.getXml(v));k=Math.ceil(t.width*g/l.view.scale+2*d);g=Math.ceil(t.height*g/l.view.scale+2*d);v.length<=MAX_REQUEST_SIZE&&k*g<MAX_AREA?(a.hideDialog(),(new mxXmlRequest(EXPORT_URL,"format="+e+"&filename="+encodeURIComponent(b)+"&bg="+(null!=f?f:"none")+"&w="+k+"&h="+g+"&"+v+"&dpi="+h)).simulate(document,"_blank")):mxUtils.alert(mxResources.get("drawingTooLarge"))}};ExportDialog.saveLocalFile=function(a,b,e,f){b.length<MAX_REQUEST_SIZE?(a.hideDialog(),(new mxXmlRequest(SAVE_URL,"xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(e)+"&format="+f)).simulate(document,"_blank")):(mxUtils.alert(mxResources.get("drawingTooLarge")),mxUtils.popup(xml))};var EditDataDialog=function(a,b,e){function f(){0<L.value.length?U.removeAttribute("disabled"):U.setAttribute("disabled","disabled")}var g=document.createElement("div"),d=e||a.editor.graph,h=d.getModel().getValue(b);if(!mxUtils.isNode(h)){var l=mxUtils.createXmlDocument().createElement("object");l.setAttribute("label",h||"");h=l}var t={};try{var k=mxUtils.getValue(a.editor.graph.getCurrentCellStyle(b),"metaData",null);null!=k&&(t=JSON.parse(k))}catch(S){}var v=new mxForm("properties");v.table.style.width=-"100%";l=h.attributes;var u=[],y=[],z=0,F=null!=EditDataDialog.getDisplayIdForCell?EditDataDialog.getDisplayIdForCell(a,b,e):null,D=function(S,V){var ha=document.createElement("div");ha.style.position="relative";ha.style.display="flex";ha.style.alignItems="center";ha.style.boxSizing="border-box";ha.style.width="100%";var R=document.createElement("a"),Z=mxUtils.createImage(Dialog.prototype.closeImage);Z.style.height="9px";Z.style.fontSize="9px";R.className="geButton";R.setAttribute("title",mxResources.get("delete"));-R.style.marginLeft="8px";R.style.cursor="pointer";R.appendChild(Z);V=function(W){return function(){for(var ba=0,K=0;K<u.length;K++){if(u[K]==W){y[K]=null;v.table.deleteRow(ba+(null!=F?1:0));break}null!=y[K]&&ba++}}}(V);mxEvent.addListener(R,"click",V);V=S.parentNode;ha.appendChild(S);ha.appendChild(R);V.appendChild(ha)};e=function(S,V,ha){u[S]=V;y[S]=v.addTextarea(u[z]+":",ha,2);y[S].style.width="100%";0<ha.indexOf("\n")&&y[S].setAttribute("rows","2");D(y[S],V);null!=t[V]&&0==t[V].editable&&y[S].setAttribute("disabled",-"disabled")};k=[];for(var G=d.getModel().getParent(b)==d.getModel().getRoot(),H=d.getCellStyle(b),M=0;M<l.length;M++)("label"!=l[M].nodeName||"1"==H.metaEdit||Graph.translateDiagram||G)&&"placeholders"!=l[M].nodeName&&k.push({name:l[M].nodeName,value:l[M].nodeValue});k.sort(function(S,V){return"label"==S.name?1:"label"==V.name?-1:S.name<V.name?-1:S.name>V.name?1:0});if(null!=F){l=document.createElement("div");l.style.width="100%";l.style.fontSize="11px";l.style.textAlign="center";mxUtils.write(l,-F);var N=v.addField(mxResources.get("id")+":",l);mxEvent.addListener(l,"dblclick",function(S){S=new FilenameDialog(a,F,mxResources.get("apply"),mxUtils.bind(this,function(V){if(null!=V&&0<V.length&&V!=F)if(d.model.isRoot(b)){var ha=a.getPageById(F);if(null!=ha)if(null==a.getPageById(V)){var R=a.getPageIndex(ha);0<=R&&(a.removePage(ha),ha.node.setAttribute("id",V),F=V,N.innerHTML=mxUtils.htmlEntities(V),a.insertPage(ha,R))}else a.handleError({message:mxResources.get("alreadyExst",[mxResources.get("page")])})}else null==-d.getModel().getCell(V)?(d.getModel().cellRemoved(b),b.setId(V),F=V,N.innerHTML=mxUtils.htmlEntities(V),d.getModel().cellAdded(b)):a.handleError({message:mxResources.get("alreadyExst",[V])})}),mxResources.get("id"));a.showDialog(S.container,300,80,!0,!0);S.init()})}for(M=0;M<k.length;M++)e(z,k[M].name,k[M].value),z++;k=document.createElement("div");k.style.position="absolute";k.style.top="30px";k.style.left="30px";k.style.right="30px";k.style.bottom="80px";k.style.overflowY="auto";k.appendChild(v.table);+"100%";l=h.attributes;var u=[],y=[],z=0,E=null!=EditDataDialog.getDisplayIdForCell?EditDataDialog.getDisplayIdForCell(a,b,e):null,D=function(S,V){var ha=document.createElement("div");ha.style.position="relative";ha.style.display="flex";ha.style.alignItems="center";ha.style.boxSizing="border-box";ha.style.width="100%";var R=document.createElement("a"),Z=mxUtils.createImage(Dialog.prototype.closeImage);Z.style.height="9px";Z.style.fontSize="9px";R.className="geButton";R.setAttribute("title",mxResources.get("delete"));+R.style.marginLeft="8px";R.style.cursor="pointer";R.appendChild(Z);V=function(W){return function(){for(var ba=0,K=0;K<u.length;K++){if(u[K]==W){y[K]=null;v.table.deleteRow(ba+(null!=E?1:0));break}null!=y[K]&&ba++}}}(V);mxEvent.addListener(R,"click",V);V=S.parentNode;ha.appendChild(S);ha.appendChild(R);V.appendChild(ha)};e=function(S,V,ha){u[S]=V;y[S]=v.addTextarea(u[z]+":",ha,2);y[S].style.width="100%";0<ha.indexOf("\n")&&y[S].setAttribute("rows","2");D(y[S],V);null!=t[V]&&0==t[V].editable&&y[S].setAttribute("disabled",+"disabled")};k=[];for(var G=d.getModel().getParent(b)==d.getModel().getRoot(),H=d.getCellStyle(b),M=0;M<l.length;M++)("label"!=l[M].nodeName||"1"==H.metaEdit||Graph.translateDiagram||G)&&"placeholders"!=l[M].nodeName&&k.push({name:l[M].nodeName,value:l[M].nodeValue});k.sort(function(S,V){return"label"==S.name?1:"label"==V.name?-1:S.name<V.name?-1:S.name>V.name?1:0});if(null!=E){l=document.createElement("div");l.style.width="100%";l.style.fontSize="11px";l.style.textAlign="center";mxUtils.write(l,+E);var N=v.addField(mxResources.get("id")+":",l);mxEvent.addListener(l,"dblclick",function(S){S=new FilenameDialog(a,E,mxResources.get("apply"),mxUtils.bind(this,function(V){if(null!=V&&0<V.length&&V!=E)if(d.model.isRoot(b)){var ha=a.getPageById(E);if(null!=ha)if(null==a.getPageById(V)){var R=a.getPageIndex(ha);0<=R&&(a.removePage(ha),ha.node.setAttribute("id",V),E=V,N.innerHTML=mxUtils.htmlEntities(V),a.insertPage(ha,R))}else a.handleError({message:mxResources.get("alreadyExst",[mxResources.get("page")])})}else null==+d.getModel().getCell(V)?(d.getModel().cellRemoved(b),b.setId(V),E=V,N.innerHTML=mxUtils.htmlEntities(V),d.getModel().cellAdded(b)):a.handleError({message:mxResources.get("alreadyExst",[V])})}),mxResources.get("id"));a.showDialog(S.container,300,80,!0,!0);S.init()})}for(M=0;M<k.length;M++)e(z,k[M].name,k[M].value),z++;k=document.createElement("div");k.style.position="absolute";k.style.top="30px";k.style.left="30px";k.style.right="30px";k.style.bottom="80px";k.style.overflowY="auto";k.appendChild(v.table);l=document.createElement("div");l.style.display="flex";l.style.alignItems="center";l.style.boxSizing="border-box";l.style.paddingRight="160px";l.style.whiteSpace="nowrap";l.style.marginTop="6px";l.style.width="100%";var L=document.createElement("input");L.setAttribute("placeholder",mxResources.get("enterPropertyName"));L.setAttribute("type","text");L.setAttribute("size",mxClient.IS_IE||mxClient.IS_IE11?"36":"40");L.style.boxSizing="border-box";L.style.borderWidth="1px";L.style.borderStyle="solid";L.style.marginLeft="2px";L.style.padding="4px";L.style.width="100%";l.appendChild(L);k.appendChild(l);g.appendChild(k);var U=mxUtils.button(mxResources.get("addProperty"),function(){var S=L.value;if(0<S.length&&"label"!=S&&"id"!=S&&"placeholders"!=S&&0>S.indexOf(":"))try{var V=mxUtils.indexOf(u,S);if(0<=V&&null!=y[V])y[V].focus();else{h.cloneNode(!1).setAttribute(S,"");0<=V&&(u.splice(V,1),y.splice(V,1));u.push(S);var ha=v.addTextarea(S+":","",2);ha.style.width="100%";y.push(ha);D(ha,S);ha.focus()}U.setAttribute("disabled","disabled");L.value=""}catch(R){mxUtils.alert(R)}else mxUtils.alert(mxResources.get("invalidName"))});mxEvent.addListener(L,"keypress",function(S){13==S.keyCode&&U.click()});this.init=function(){0<y.length?y[0].focus():L.focus()};U.setAttribute("title",mxResources.get("addProperty"));U.setAttribute("disabled","disabled");U.style.textOverflow="ellipsis";U.style.position="absolute";U.style.overflow="hidden";U.style.width="144px";U.style.right="0px";U.className="geBtn";l.appendChild(U);k=mxUtils.button(mxResources.get("cancel"),@@ -3959,8 +3964,8 @@ T=document.createElement("img");T.className="geAdaptiveAsset";T.style.width="16pya=y,Ma=ya.setCellsVisible,Oa=!0,Ka=0;Ka<ua.length;Ka++)if(!z.isVisible(ua[Ka])){Oa=!1;break}Ma.call(ya,ua,!Oa)}else y.setCellsVisible([aa],!fa);mxEvent.consume(ja)});T=T.cloneNode(!1);var O=y.getCurrentCellStyle(aa);T.setAttribute("title",mxResources.get("lockUnlock"));var qa="1"==mxUtils.getValue(O,"locked","0");qa?(T.setAttribute("src",Editor.lockedImage),mxUtils.setOpacity(T,90),pa.style.color="red"):(T.setAttribute("src",Editor.unlockedImage),mxUtils.setOpacity(T,40));y.isEnabled()&&(T.style.cursor="pointer");mxEvent.addListener(T,"click",function(ja){y.isEnabled()&&(k(mxEvent.isShiftDown(ja)?t(null,!0):[aa],!qa),mxEvent.consume(ja))});oa.appendChild(T);oa.appendChild(ia);pa.appendChild(oa);mxEvent.addListener(pa,"dblclick",function(ja){var ua=mxEvent.getSource(ja).nodeName;"INPUT"!=ua&&"IMG"!=ua&&"true"!=ia.contentEditable&&(d(aa),mxEvent.consume(ja))});y.getDefaultParent()==aa&&(pa.classList.add("geActivePage"),pa.style.fontWeight=y.isEnabled()?"bold":"",N=aa);mxEvent.addListener(pa,"click",function(ja){y.isEnabled()&&"true"!=ia.contentEditable&&mxEvent.getSource(ja)!=da&&(y.setDefaultParent(ka),y.view.setCurrentRoot(null),mxEvent.isShiftDown(ja)&&(y.clearSelection(),y.selectAll(N)),mxEvent.consume(ja))});D.appendChild(pa)}y.isEnabled()?(ha.classList.remove("mxDisabled"),V.classList.remove("mxDisabled"),S.classList.remove("mxDisabled")):(ha.classList.add("mxDisabled"),V.classList.add("mxDisabled"),S.classList.add("mxDisabled"));M=z.getChildCount(z.root);D.innerText="";for(var W=new mxDictionary,-ba=M-1;0<=ba;ba--)mxUtils.bind(this,function(K){Z(ba,y.convertValueToString(K)||mxResources.get("background"),K,K,l(K))})(z.getChildAt(z.root,ba));L=W;v()}var y=a.editor.graph,z=y.getModel(),F=document.createElement("div");F.style.userSelect="none";F.style.height="100%";F.style.marginBottom="10px";F.style.overflow="auto";var D=document.createElement("div");D.style.position="absolute";D.style.overflow="auto";D.style.left="0px";D.style.right="0px";D.style.top="0px";D.style.bottom="32px";F.appendChild(D);-var G=null,H=null;mxEvent.addListener(F,"dragover",function(Z){Z.dataTransfer.dropEffect="move";H=0;Z.stopPropagation();Z.preventDefault()});mxEvent.addListener(F,"drop",function(Z){Z.stopPropagation();Z.preventDefault()});var M=null,N=null,L=new mxDictionary,U=document.createElement("div");U.className="geToolbarContainer geDialogToolbar";var X=document.createElement("a");X.className="geButton";var S=X.cloneNode(!1);S.style.backgroundImage="url("+Editor.plusImage+")";S.setAttribute("title",mxResources.get("addLayer"));+ba=M-1;0<=ba;ba--)mxUtils.bind(this,function(K){Z(ba,y.convertValueToString(K)||mxResources.get("background"),K,K,l(K))})(z.getChildAt(z.root,ba));L=W;v()}var y=a.editor.graph,z=y.getModel(),E=document.createElement("div");E.style.userSelect="none";E.style.height="100%";E.style.marginBottom="10px";E.style.overflow="auto";var D=document.createElement("div");D.style.position="absolute";D.style.overflow="auto";D.style.left="0px";D.style.right="0px";D.style.top="0px";D.style.bottom="32px";E.appendChild(D);+var G=null,H=null;mxEvent.addListener(E,"dragover",function(Z){Z.dataTransfer.dropEffect="move";H=0;Z.stopPropagation();Z.preventDefault()});mxEvent.addListener(E,"drop",function(Z){Z.stopPropagation();Z.preventDefault()});var M=null,N=null,L=new mxDictionary,U=document.createElement("div");U.className="geToolbarContainer geDialogToolbar";var X=document.createElement("a");X.className="geButton";var S=X.cloneNode(!1);S.style.backgroundImage="url("+Editor.plusImage+")";S.setAttribute("title",mxResources.get("addLayer"));mxEvent.addListener(S,"click",function(Z){if(y.isEnabled()){h(!1);z.beginUpdate();try{var W=y.addCell(new mxCell(mxResources.get("untitledLayer")),z.root);y.setDefaultParent(W)}finally{z.endUpdate()}d(W)}mxEvent.consume(Z)});y.isEnabled()||S.classList.add("mxDisabled");U.appendChild(S);var V=X.cloneNode(!1);V.style.backgroundImage="url("+Editor.menuImage+")";U.appendChild(V);mxEvent.addListener(V,"click",function(Z){if(y.isEnabled()){a.editor.graph.popupMenuHandler.hideMenu();var W=t(),ba=z.root.getIndex(N),K=0<W.length&&y.isEnabled(),T=mxResources.get("nothingIsSelected"),aa=y.getLayerForCells(y.getSelectionCells()),ka=y.convertValueToString(N)||mxResources.get("background"),oa=new mxPopupMenu(mxUtils.bind(this,function(ia,fa){var O=ia.addItem(mxResources.get("layers"),null,null,fa);ia.addItem(mxResources.get("selectAll"),null,mxUtils.bind(this,function(){u();h(!0)}),O);ia.addItem(mxResources.get("selectNone"),null,mxUtils.bind(this,function(){u();h(!1)}),O,null,0<W.length).setAttribute("title",0<W.length?mxResources.get("selectNone"):T);ia.addItem(mxResources.get("invertSelection"),null,mxUtils.bind(this,function(){u();h()}),O);ia.addSeparator(O);ia.addItem(mxResources.get("show"),null,mxUtils.bind(this,function(){y.setCellsVisible(W,!0)}),O,null,K).setAttribute("title",0<W.length?mxResources.get("show"):T);ia.addItem(mxResources.get("hide"),null,mxUtils.bind(this,function(){y.setCellsVisible(W,!1)}),O,null,K).setAttribute("title",0<W.length?mxResources.get("hide"):T);ia.addSeparator(O);ia.addItem(mxResources.get("lock"),@@ -3970,8 +3975,8 @@ null,mxUtils.bind(this,function(){d(N)}),O);ia.addItem(mxResources.get("editDataO,null,0<=ba&&ba<M-1),ia.addItem(mxResources.get("sendBackward"),null,mxUtils.bind(this,function(){y.addCell(N,z.root,ba-1)}),O,null,0<ba)));ia.addSeparator(O);ia.addItem(mxResources.get("selectObjectsInLayer"),null,mxUtils.bind(this,function(){y.clearSelection();y.selectAll(N)}),O,null,null!=N.children&&0<N.children.length);var qa=ia.addItem(mxResources.get("moveSelectionTo",[""]),null,null,fa,null,!y.isSelectionEmpty());y.isSelectionEmpty()&&qa.setAttribute("title",mxResources.get("nothingIsSelected"));for(fa=M-1;0<=fa;fa--)mxUtils.bind(this,function(ja){var ua="1"==mxUtils.getValue(y.getCurrentCellStyle(ja),"locked","0"),ya=ia.addItem(y.convertValueToString(ja)||mxResources.get("background"),null,mxUtils.bind(this,function(){ua||y.moveCells(y.getSelectionCells(),0,0,!1,ja)}),qa,null,!ua);ua&&ya.setAttribute("title",mxResources.get("locked"));ja==aa&&ia.addCheckmark(ya,Editor.checkmarkImage)})(z.getChildAt(z.root,fa))}));oa.smartSeparators=!0;oa.showDisabled=!0;oa.autoExpand=!0;oa.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(oa,arguments);oa.destroy()});var pa=mxEvent.getClientX(Z),da=mxEvent.getClientY(Z);oa.popup(pa,da,null,Z);a.setCurrentMenu(oa);mxEvent.consume(Z)}});y.isEnabled()||V.classList.add("mxDisabled");var ha=X.cloneNode(!1);ha.style.backgroundImage="url("+Editor.trashImage+")";ha.setAttribute("title",mxResources.get("delete"));U.appendChild(ha);mxEvent.addListener(ha,"click",function(Z){if(y.isEnabled()){z.beginUpdate();try{var W=z.root.getIndex(N),ba=t();-0==ba.length&&ba.push(N);y.removeCells(ba,!1);0==z.getChildCount(z.root)?(z.add(z.root,new mxCell),y.setDefaultParent(null)):0<W&&W<=z.getChildCount(z.root)?y.setDefaultParent(z.getChildAt(z.root,W-1)):y.setDefaultParent(null)}finally{z.endUpdate()}}mxEvent.consume(Z)});y.isEnabled()||ha.classList.add("mxDisabled");F.appendChild(U);var R=document.createElement("span");R.setAttribute("title",mxResources.get("allSelectedObjectsInThisLayer"));R.innerHTML="•";R.style.padding="0 2px";R.style.fontSize=-"16pt";R.style.order="1";u();z.addListener(mxEvent.CHANGE,u);y.addListener("defaultParentChanged",u);a.addListener("lockedChanged",u);y.selectionModel.addListener(mxEvent.CHANGE,function(){v()});this.window=new mxWindow(mxResources.get("layers"),F,b,e,f,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,170,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.init=function(){D.scrollTop=D.scrollHeight-+0==ba.length&&ba.push(N);y.removeCells(ba,!1);0==z.getChildCount(z.root)?(z.add(z.root,new mxCell),y.setDefaultParent(null)):0<W&&W<=z.getChildCount(z.root)?y.setDefaultParent(z.getChildAt(z.root,W-1)):y.setDefaultParent(null)}finally{z.endUpdate()}}mxEvent.consume(Z)});y.isEnabled()||ha.classList.add("mxDisabled");E.appendChild(U);var R=document.createElement("span");R.setAttribute("title",mxResources.get("allSelectedObjectsInThisLayer"));R.innerHTML="•";R.style.padding="0 2px";R.style.fontSize=+"16pt";R.style.order="1";u();z.addListener(mxEvent.CHANGE,u);y.addListener("defaultParentChanged",u);a.addListener("lockedChanged",u);y.selectionModel.addListener(mxEvent.CHANGE,function(){v()});this.window=new mxWindow(mxResources.get("layers"),E,b,e,f,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,170,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.init=function(){D.scrollTop=D.scrollHeight-D.clientHeight};this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));this.refreshLayers=u;a.installResizeHandler(this,!0)};(function(){Sidebar.prototype.tagIndex="5V1dV+M6sv01rDvngax0oLvveYQEaGaAziE0PW8sxVYSDbblI9uk6V9/VVWS7ST+kB0zL3etbmIn3ltlfZRKUqkU/rpRLN6MmFJym5yM/8QL/Xnw7yLceXQ03fA3JaOTyfjCQCKZehvu66tErCMW6J9E1M4jlJcFTJWIPP1VIKK1ixj/zML4VBRiTMaf9HOKx8G7/lwy71V/ZJEv8Vv8cKea9KW646tU41nk678/4tK7SZVu5FpC9oz/TDPVnkEPJlsn4wVma1lEnVemGByy6q+M+SXkSmaQ6Vv27gJeBDzyOQDMu1ma5FVEEVBEtuokgQhdyZ62Uv/9qWWoYPRltgx4A3U970/hc6BnIuD+kdI+KbGTcelGce6ec4evOBl/k0r8llGKtWBTvulF98xVKjzEvxWXDVS/M8VHF57Hk0TDpzpxJQGScC9TIoX3euXvVV/UcWWpDFkqsCYyfaM/1ly36vGfgVhv0oiasyfh7ypgyaaBaKHl5/nThqb5VeAvZEigXx8k0AolJJUkVjo7jGBOHFOm29Se3FZin6VsyRL42V+2U90z9crTOGAeIEK8Q1UCnMlGxk4CLWb/gsflKt0y/MLnbzyQccgjaIivAjgTT/Gtr4Quf9cXXWRLjRKxyRwvkBko75hHnjisPzUkP/kyESnHtwoAtQ7kkrehL7UyzUAtLrh6E5g7Nnn9iYo2SWW8ZVr1QYsTIW8gE+ll5kHWQlXGdr/Qug1Zl/RDe2O4FL+fWPBaiJSUZGoDT6HRYT3DN9Gdgy4agY3Q59gj+iIOdAOB/MmYYlHKqYp5PMLaFHMVirSSG2XYySnnZrGHNW19JdaZoiYxGV8LbGq+9DKsT0APT3Sk1ldzXaZszQvOpfzlkndUYodytAPDOEuxuocyEqlUmM+Jbm6HevkAq0sAW8+MB9BmQJs+8HQr1Wup3G2zL6uCetJZjXKofV7J+FLnUUWtxZyLTYa20FzpV1GxEgnVdxH4JOgyS0QECr4F3z3nEUHWUQfUjUi/ZUv7tjqTGaCkl0q6Wou0Ef9tdhslUBAn9Xq4GshZkG6gTmx0m8EqvuGoYzb4iwMYdDnVMcpbS2QM3TYB3mM0Sp71/0fuSVPf7lmki1d10DN3LE6x0/CKut+GuddVgGpRyFCtc/sZYS/Cm9FySdUj3sgIPlOZeZvWNAm1o0uTXH81UO3zZEEqQDkwD5q37t+zdAOqNe/RS/aJ6Tdi5purBt73xV930PiLapT8HTTXqz2Kh7JloQ26bIlVOtAl6dIY9uBPMhbeCdgtu/ZLJeEe1XdduTSPrpc6v9+TlIf64jakMpeQ9RumQFVr3YiV3vcb+eZyy9Viw4Ogl1p+nM2xmofSyNSdYgHjnSzA6m26fu+wTKtwYM30S1LXTkxPsYp0qp+nbu8yg271r4xnWM3/hoseBI+8qttygmLlSfLhZtmsS7CZUd1Kds295iT2m4dTh7aH0qLgF2QqGo5qVVdLtHiPvIp2mdDXinvvXtBgGhLRI4/1sJs09z5TqY6sRCNVqlU+2qxPDNuRuxm20MqLmqNOO3CqHRqxEGEclC3jNtATkMOLhFZpOynrH5FAc3UlcKRsbJHvy/9wD8iylUSFJHhrrfmRYBPaZCGDZ2Mu6QXolr3prFf16OdvsxOjqyqUVPXzVEngw+g2Qrur8WehCxWnqu71sE9gv/QWnrSalK00WglxllLFX+VXVaxv1TMae7yFcRrlV2059PNiNr2+wdxh60gmKamJ7trRDvIm4xsecYXqxI7z6sQ5pICWKDHp6jFiEyjpgtLioL1lU6MmSu3VHZm0QtcI1RVNeCPPjIeKHnuZLamxJzHnNIzdyIzsV2+DJm+Y22ZVlPINS35AxuFl1Bo4nQ5IJ7PIfxyW8xzGplLgaG9BGginPqsrUhn55RCZiLoxbRn4v4dAbkYubdBLFkWoRfXYs24CvPz8lGzpNZchT1XDzN8OSEkcF8ZBhnP+1cq2jJgddJORxMmOmMX7w5A96HXzILoS882Mr/IBWqAHTcjxejheKQPvJRo3kWNuP0g0msMlzn6upFoK36/o6A6R34t5fG0RKMGiNdXSwyFVJX4R6mwE9Y+GsodSb1gcv7cCTRUWmCEx1rI2SAbsPvY2+m9QmTl7mCeBdrAdKeMnTGC24X4ylMvU3qWtzY2Yf5/QdB+kwyKPB1i9agqkwEqZJqm+HLULWY27rx0Q72mUWoass8VjGOIQHihN0cRKenQVagMsqEtZ40YXPq4geB2yGWCXNjHdvWUBLwzZJqO0hL+TVEJ2va5urbACZWbCVYXEuLKywZep5bhnERlBRuANDHRa5c1HgwZlFJY2kWnipFFzIUE+znKy+EtINIQLcbvWDo8tdUmlOANNl1A7/85EXGmvHeBG00tYB81LS0AuLBVnVATUY8Ryv9DreSbjX5/Gw7BN6qTSVmRHniapOrKd1UqFa33dmLRcn4eiO68TzJgwXYga5OrAdj+l/P+s/3w5u4BXnkOdFpGwo5wOb+7Cf+7CX/0GtfRfzjCN8YfJX05g2BeQMAv9mxwCtgIWyOwr5L/o7pR+6SJ3Fe/5QLwwr4C6BIv1fKyzpToXHJTbLiG8/GQotrMJyTgA31zp7sYz07uavDfhI0+ET93fNFPKrlqZnmkCBaS85u7Qkeu8E9ciU7jYt/Oin4Cirkdwp8G3qlPh7jTYKupVrjsR5kytjqzkeYIFXRodnI/DcJL3VsvKmexWjgEoQCsdT/N5gLf5grrxeJ6vHTm4gO6UlxdM9fCJr5VdTooZGIdRDXwVSKniAK23gL3Xr/TsPT66RK06s+5MS1xeX2UqEqZDcGRYCDPKrMfWwKV89WhCtCt0umFC9cHJWKCO87lZ93ND0Yx1Ilesax5NH5/A6H4+Kc+ulmZcK+SoYJnx5BWnwRUNUOzoqJMouyS0VN6PSOkRm10jTnAgsGXKVzQTWkNVwXMVcD3cwHzgiccCc+0iwrV+eIB8vYYrzXPHQmiE1ZMQ1dCqZe8YRowhM391K5bkoGWFgTnpJC0cvypov69W1PHZKu61VvUKlrlgOFehv8dRqYiSVFVPrFeh9R+a6FKwUKF/2DYN5EtABZqrc/t6ZBF2b+Aky+I4EDDf0hE76YPlKyXWsFCNdaYrfEHqwDPaoVMBPZl25/OkuXfYh1AuGViPJI2HzBH4syPx50fiP/fFS0ErkVp1KFpUCxjqH1AdWqWlSspDr9t9mp8sRe05lZKcAbbwhWfvXCT5uaMGgh6KpJLW1xfoBw3LaFijA7pLbA/dLBaAHq0vExEoc+vIsCVvS8dsgKfzHs2zF5UcNegfdc9XQw7LtzEBEfnVuw5qsk9o/ZpU+TG0Qy5lmqJsZZKl/bKVR1cmoRI9kMKywhvIGYGrFIq+bi/73BQ0hZ97urenL6JXo5mqakobbtIVV66p/w8gNxay1cYALkHB9QnaBuTxx//OCudewXQalev3OcXoIopkah29PmH7C415oHVru0dODdPkGKapDAJyVt7oUe06YBVuotXIfZ+gJPdtaYfWuto0odAH8LSEDeELJ+eFgmTOYjMjHzutTu3jF0WpG5cTsOdrF/oO4OA7ZEqfB4GIEzsLWN3o6/CT3nipaAhKotcVWg06C0PjypdFnnW8zKDa16wc7zM8ads4WfHympGqW4QkbMBZ9BJqM5HWi99YkIFBog0Hzio7lkrk6FpEIqHNUzdS+rD2lUqc/dJZEPYVaHSDy8bczBP5mZ0nMo6LJDO2Kt7crnZYv2dpIkqO4Lj+UwiaZGA0N9XXHbZnPaKg7UVm+cmsVbpgLwQqTBDlK2QRjYqU9WGg36q1rR4EKSmgVoQS93g0qWbzMLnj/zKeThc2Ny9xdcxvW89tJ4FBZ+TrYS822IEJJ+OfG7MBproKdaU+lm6ha0k6VD5Wkg2Rn63EH5QRvWjn4LGOw95S7TY+lo3TH5bgr0x4r7qHlmhA5xdL8inC2+X+qnIjibHk+hEt7HPJHmiPr5FDKwqa25qJBIaLoGOvda+c0H4n10rRyKPrgymjDoVVMM5x8qynOBbcSwY9gDZTfidm4q9hNigH6Zq7EjwAgaEWn4CdRLdtSHCS1yLr+oE6voukO1CwEDCn2jNsm2CDCNlvtAe2HK3BYr8H2yZ1uJHuZl7so7STbMGZwqkd6+yc2C8a0q/ngU2T1/pvyFPmk83Tn/jK+AeZjy7QxdUCkrSe3NbTqNgL40jzsEOzt6u1D9tkTG81GT/skQ2ayLenp/lHp2H3zgzG+tdOZtsNHX1oJuNi99VAhH9Z9NF0P6/LNDBfboa6fZhgGdkTPhmqg3Eaf+zelGaa70Uruxfjpw7m7dWUBlIMPOJLqqEnlbYw7m/rCMN8W4EIq3yU28lRr/00O6EP07B7pPtJPgO3BzSObqMkNTPyh4nQVpli6C+Kh7umeGXIdYrzyrTE4a54V+7GdziaNakWdy8rutDfP+5Q6uGXHqZnFasiznRQXfSQERvNwMTfZtcLB/4N88lR1Bd6tC6Wmg+3UpO1nNAGReekn+dT/fCb2QYDbrLizeyyPyxWZ8bSBMBkfKP5KJTH8MncwhpdhJEJPjKZR2kWM4anfp4/4AqMtort1M9HJXJkDjXvCa99fDR7j1goZ+Ci5eNlH6zuA1JT24fiScpErMTelfGWWtwxQgHFjjzCtuJuPPlabFdZTK9hY7OU1LD5pjsLmKV+V7LRWsksxq1hcNHhDR5nYFYqnRg0I1Y7DGhmMD12qaM7njEng52y6I//yONAG9BDsy/0hb98H4T2Hv7Q9t5BMyMPDTB4Nn9XzMNV9SGpaZMwKq/cRu6MBdc0PRqMupDoGiLfYQUGNXqIoSzglobh11Ll0aDyYCql7wahxgrlvX5sEk9cZ8huDzRQKtakbzDk+1FCGCwTPmIQ6tuLe/08bRLHSBvMs1uV8of6M2tpff8UM/Pjklg8LY7ij2R0alrmSxLrke4KNjZKlWGvuIKL9jaT+K844epjeCsbzgtnkPNwXuM/X3fC4BwyjB44eY2kUW1gqzKElvowWzyKevTim5hHprYrSXGfbPU290OwgmbZRoHEXmVmBwR7emHQ9K589FG7k96B/hk0nQWuRNKy6Ee92NUl1NrCPFkWodFqXT7dWLX8EYuTjUw/LIFnGWQh/wD6BXjF5f1UsZTtMB/UxgsRVUy8uA9OYDJGlyEbZyNpS1HacBx90z06HU8knhzZ+GJAVIo1Vl/L92CjS6WtHnxx8r5FZ4xmPbZPYWNQQGbmEnRmuZ+BSxs5k2zBqQJpskiklWy1PIuQ4XrcZbGXdyOzpNmGIhLrhZhgucX6peINVyxIRreX0Gvda5tspRgFQCo8FlPjIwyemeTOGHtHJCIiCLF1sTgfj3fTib1jX+DJSDoQaa0feE+++5K/Z4mSnEGL3N11JS8SdE9HeEraqGfFD0fVEJwXKwldJ25PbrDKdG6T+y0F1RlOcDth5Q1LnHvED0S48Kx/2FCEsd33NxRhFplVkqLAB2obiywGV+ucayDaPEbVTg7QOnlfSrsfbDAhf+w3rmPInvWoA13OtB5XbLiyp9hIlxATesgqVVuZanqbKm6MJh1Y9lBCLL9k9Gl8cwW+HVN5dYJRLrKWiYZmurNPX2FH4z9mJNcfpaWJPKJ1YKpu6aZ3cv+m5HAb00cnVoSnzXdi39v8OjrjroXiW7JZiggXhh5ecLu4/2OIdA7Ih+C08S2Hz/Mi1Fqe56VEdMY8L6Zn4/H4j64J+gKCZEl0trLXXWAjGMsGJWQg26I8EcMmW9IrrmlhBZrg+JIlHLZJUsDSTda8UlJHNIXvj2Y5Dm0N7+NY9pee1o2LUIfB7vYSCPXf0b/4OxT2bsD8RsTjfKH/6Z9VXOcwfICpjK3rhMzX9DytZOyWPLfXrWCUPg9NPwImrq4cFDp2bgze3FOyVbYDpm9SprndbD67s+TRiPMDD27nJfk83rKrqZ7X5xQq0q9YDHNhWMhV5/fLowhZv+42gEJbG6qJssvEbZBSVOXSZTsKYuja+uiYEEIglnuoh940Z5eYnsnancUvHRghyGUuRsN2kzpsWYZVmcuVBAd9W77MgSF8cWI9JZs5sAeipm0DrrRhtrqDCGj+YStWogZxgwj9oEfBAkdsCZHMvHQ0uwCj1xdrQQeRMG1SSzqzI4JDRSpiZTWQ8TCDQIm6wsMEi66wv1qClVex6HKgZJe6zcRte5SqGO6zX6dWll1JmiVrIz2g68ZgQnab6IEXIcRmwh3ZYRxAHN5hGCfHMT5dGKlkiVuP1WAvj64TsOvFLGDWJOJAP/lY+rOPooctUXaFcG5CMCa1a0AHPB6LmSeMTZjfdEePpjmWiipzbiI1JJMhSCDb6SkZvNPUfwVnB0LYx541RzxuJ/k8hFT3ptWjI2OJC8b3RVLQnYF/CSf9GYYUlJRr45LCdn5cmnOM+J+nGctEOKfpC22h0DCFPGOcUCZPT0PubViEX01O6XyqRR4tbFvn7ONCdyczP8nnzoqrvnzzLNmUx3kP0PNFsKof4FFvGGqlYWNjR/bvu+xaITXs0W3mplMCaGSq9dDgslfw95VecO/809fRxfT0YkqMuRWRmxYdiWa1RIXZ4s43G5IMY9p07mxL6Mn4UtAY33ZVfdkuC2NpZQ2orngTjbcXfnaxl7EVNqU7WUX1OZLvoBYVfDWmbgulWK24yneHH1cVriJPvce4Kh95HZSwgX8Tx5T8neyLftHFIDycVUHfSFbhqFqHRluMTCF73Rk7urVIY0gLE+jEreOr5DkbiOfzMTy0c16rX25fTSgzM38k16QXl41tRaVVG+mqHQ9Kj2tRjO4N49KlY/vbrXN4V1f3WuAjOGZmozND0lk84L9yZ3zmzFEzTpQwu8YD2B2viUbXWWKDSOkmchQHFhbnzo2qkgRHQ8tEBty9dVYSnR8lzW0QZLBgZ46HuswCmA8R9ltgtcHh8HNJD3RKA4PMUdZbLlFOtrvUhnEyICPSHGYAsR3mR598eOA4RDUx91qTOIbeVNIBkpDJiqcJlB1dnsAJOg2hOSqwoxkt5cC8PixAfV9cX8Gqx8PJzjAM7N5oP9h+T2rYzFYabfWizslupwMJu8s4qIywhoDnZ+gK/DqkqPM94mMlfji1sFJxfTppGJD3YpwMzng2OOP54IyfB2f8cgzjvK6saydCejFOBmc8G5zxfHDGz4MzfunPCEXQt3+YDK4TahiP0Ak1jEfohBrGI3RCDeMROqGG8QidMBlcJ9QwHqETahiP0Ak1jEfohBrGI3RCDWMfnSDjVL6Y+cxIeMnoK67frkNzxEEetjrhb7XHe/VlzX35Z/NSCj73REj+FIdndDml9mfNO0Si1lGgL+nuK5gEjn+Du6vZ3iiMhyK1J7EeLjJ0IJ0MTApUp8xL0fUFY+1PIThD4lH4kcAc0ZZ7fsEUO87W7k3yOaX2XX9x6sksJg8y+L2461euSImrmyKhGTR4ZOeLfsTzjUylzdYYbqqzuZbvRY8OMSAUjkF3l2M7rL3GgfcSMN/nCg7P1gX0PUvjzEbVbDt124lo0ptoAFl6SwF7LF4S3QbMsrY0LjilL47hGt08fS+aQ3tDMPNvaYbHaMjVCm4278rUQudkb2+mtp+2Z3RgWoYf/YJS812Jv/v7mYQmH57QA7rd3d5cFu+VZMFuaksRSzpcr7Lp9ktr8l9M6+y/mNb5x6Y1f5j/18prJ60PLq+dtD64vHbS+uDyAhVlI6M799fdE5h8YAK31gsPt6BVaZt6RsUp69DTk3fr9ROx1h3yS5LHHaarfvARrtguLAODtUQzBeyZU8d6kM5KpOZkDlwuH5J18iGsZwOxPmOw7TcZpG2xuxs4cH33aI5Jd5J0A/u0wKZ8oZC56GjUdHaNAwVZp8aD2xqnlQ7dlXy5uknqlI8rfmfa4p+V00n/cZ2kaqGdDEA7r5a267C7hbLPjMiWvXFYo0Y/ZnPdiBUy+ToCJYpL0l6tk/j+06MLbE6e4m3OCmUMBlbBmIwYySAVIUXwCUXkNy1blzguKWaN4jE6VDljtma3rNJVX2ak5eHgFEcCGB0nG3TrWcrDQ+wrQdSQmIkm0+0tpXzFpGTTidwVMBCtiEwAsXob3RfLWCX4ypxyl0oZVL1mDXTKAh75Jk66e3WYbjBMgC8SL0vqzqOpBO7WH5vDDkAZ6haFYTV80TxG3EGhkULjQpwqMUeO68F4KirOKKgkwXBn/2FvzDVZc9pEc2C+SiA3Pgq6yskW3VGGFYeCeDJ2blwWhh1SQRGzpMmTZIdgizN+NtQNGoLctdpe2WPnJ+N/XIVx+o67L/O4wYoztyZe5jFhh4EpiyoZ6kje0SLH+OEmmkWxpN90tkyJ4zpgyWbHhcM19WsZkH6Ras0i8du55AloXNdaztzYgSmjVSMTb53tH+BUg7xhGZYONOBme6EMCujYxrX+rN3BeYD6xunkoQ3XlnTdTqBDlETN0hSK5ABzV3IzOXRyoYOyyjWjlS7C4Gzl2KFuctjgTfkpR62bf3bRrzgai5lv1GzlwbDVWPlKbkk35kykmnDxNfh7Eyk+b73cNsoi+HsbRY71qHcpDnlyBic7MhgeB3Q5TsmbJMsckqeTLbVSk+tI5EHclWjjK84IzRcv3ASRtGEiPyEv+h/61AUTSdPlpplatvIkMKP6LPiW06Ed6OhY1wfKmLYftpG+gY7Fc4RyhcXwxBznF3yQ2LXoERXmbJgl6LsIFIGoOEPugOC7tnWi/CywOxNXSxuzuPakZB7BoTLnqxhxGxNtsOAVRmUdSnF0fvb2MtDBzKimE2/MA2mNB7qTEI8873ZXiid0El/MsdYrniqHt38sni8oclZHCnqsvxCLcqZV5+t+fnro/r7m5ryWStYNhRnMYvM+Tnm60EOFmFThlPqfZeZcvRe6EzZntaWkS0wsOJ8spTa4HjHk+6Ibt48fQlPMCVXtlFkLkvG2iMbZYpnXMBwMWHzFas7yPYRn2FSxmTraXlU05nQ71NwNh5Uc4uTB2MANp7Sh5+EmdN03vFN026Vw7ud/xJ2r5Q8KdgOHyTIb+oN5bt1bHpGwXf/vNj8HUrMgLTPqDioiQ1eBf7KAoiFR2zLDcwecuIa+t7TluwWGYR+m9rzA4ghBJ5iZsdwJqknTOi4mHXJ0HtARirSFPaHPBXL1KyZjxYJaSwJh5izfLind6Vpr9KPN18QcHuVG8GizwuetHvkllLGJuoi6sGeG/eObVOI3NJkAhoY154U58DxDm/F6suBsH7TdDa8wy2tA3fQ6YlC9NOXTGgF0TuGI+bD1SyTEX3M0aAXOM1NHtJU7n0ZywCkYmwWjBz30PNV21NvJzuSeO0EfLBzLSaFI8HQybXkJbo+4tZ/tLMW0krl0QcGMLniY2CkXc+kC1c9lJPUyS1OcetH6+4SiDIMPmf4dGpT+0lgaIX3TQmvUXIL7tS5MjYlzg7gjwTfSQF3xN9z0aDhTy1PUXKarOmnpnCoJzWDUmgLFgLBZGF0hcDmELWGhtiVWVYyHIcbCnNNabPDKOwolTaRtHq1FxLnabcBlpslwVCMGezrNyo69hvxMhe7NKq2yCuzowiK1zpsqmSSnl5yFGAIM7kBRVJ1H68B2DYvgp5cBwwNf58z3A5yua4hje1NQxjHTqlC3Bed2VIAx6JNYZTRNUNy1A2UYw6GIJmxFftcFSGvDF8JELCgYOq0S75NO7UvgzpwS72R8qv8/ZWop8DTbmR5fknemaluT2kvj5fRFJLLje6ss2UCcubWuqSZOMX53Uj4XDH+0nxTziHBunKMpfIOWCGTtjU0KwgfbJPYIawXWuUKzqHiBn+9NQxjAUFssWiW8m2z0WSihRldm5Q/ElaZpXEz/6FMhmihnSOm+CF/mw3DTbBjZdrj6CLXi3E5041VrkdJWbsdN3SXA6E78nQk8jJVwWuBLIXHTLNl9S9Ec04PI8pHWKvfRbYEEcvuS8CixfoyRS1PbcJa+8F+wBL2m181vTnDqPM0v3FlG1+IX+QKnipndmk/ZksMe4W/ANBlflVJJs2W7StlP4oAHehqJJ3NiUn8MSXwN4xO/eAtQGNcsGjSN/bzqTf4DMn7D4rLAvbO91851AIa6CmB9wgvHx0e30ekd9TiPUo9cwMH+3uBFFLT571cSLcAO8roTkUFVIjoWj5N7XieKjDzA4dPtYd3b+jiPZCB+xaTSDirhaBFZnWFuWhNLdP3Sb/diemM6EMb2ms3QNzgeGsc+dOUKGM1ktsSZMgjAqTjuIn5idqksZYIGnp6A8MItr205EY/N+dkKcxzX0bLo3kLK9I8hiEr5BNFrh+KEfgwopR5JhgOTPkq5+gBK/QFjy4GFftODSX9ILqqJg5X/TGjj1R8yV3cYSdoPqRDXLMCAGUNSBtJGzhgsO/Y4jyg+xbxXE4/UhoiespQF77gOa0e7eWi0s/FkrD9WNG0CW882fBvwlNxvvFfyzRgorU/HptUVBG6zdODOGk83i2jQkJ/09x4uccbM/F6NH7EINuHhNEZktuOlMlO0SkxXYfnHZpoRBlaYybU5t2wpfL9lQyThV1L6NUm34kZThkF9C91FPjq0dLTEeyeea4Zle02yhLzFiaaEfORJyjLFIrtJa9XA0Uow6UZAnjseLcPmbjwh94VHlsZGJvFhyLlaFp2fuFnzDo/N8PQNxE4Sv5tiJNcw3WJ05d/Mzi2K0n03poX0KACac1zyGqKn2QyqF6wS7MV+zr3Ffc5W5pn9sNl7vLq9ZZrziinM8xgi12CwVt16W+ucAf8z04VDZ2xY+BrLXtdGBSPi9wrCaqp7RnE87+gFdANgfrM75R4c7dvjxeDKy9T7IFTkqpPoAXYQiJZlrB3kA4/TjEKfHyvEPMjQ8/9oogUz+xaPZ4rkdhWwV3hy27QQUIXFY31wI1PasqxWgZv0xJ31xJ13xv3QajQbpCI/82OJnMLpHwJG11x3p1i4shPunlAdMbY+mDQ74SadcT/xlUw/yfthJ12wCVtxPGJgw35XmVR1CLBmupkxBU53VCE5e4Jdu6a1N/jU1l1rz5B4AuZARroHljjTAMIHFadYVUBjqegcRrgofTqgIKykRANWm7VhSMLHsnbdtYLhX+yd4fYTuTUr3ZK8TFkk6wIn7BA84rk3y4CZBY38HByV/9CefZZqa1Lfl8YJ/XyCfkewgYfsgze+EV67KWnwCyZouIcpJvqubXp6Dx4JM7UHUTRkQsZPvlpZHKKVgpsUaIrDDQU11B6PcKoPHFdt7I03bXa7mAqW41X3yDo3lSmmJL/vwBFhASlaZ0jsXfm6MfThLpmtsXarWZdaWwJP3MEp9za1p9FUGY8NLHuHwdEZkWHpAMndYxfT4lC6Wk739fkD6OMCDguCJSBoA4IClZL1lcDRBKiPmgie8rc3xdFw+kwjeHIM+OwY8Pkx4M9dwLDLEephqUG/cXOaBJxi241gdIG+4kXW43VXMcosk0FYzgZhOR+E5fMgLF8GYfnan+USwwljIWfLACtK/kQvqslwVGfDUZ0PQTVlefBuPZhz8PpuYJkMwnI2CMv5kSxwXGOqMvSUXAmcQrK3XWhuFO41mYyfKrRZTYG1ki5oNfaSB2hC6bslXXbkMUtOTIXkCwSfOD/vaNHt0ykmoqEaniUbpOlZskEanyYLB3zLcLiXhOpJgh1RuSzNZBias2Fozoeh+TwMzZdhaL52pzEGUM0iQB1kRM61k/HD1QkeK5NuTjntucUb3rj/tprpZ8605QWTue7CtACZEpkVMuFND5kWP3MmIwfedJDpkq3XNBgIMnvlDFVLdMVZ0HaSDRPKa4knt0sAoRsm4wvsLhYye9Oj0RIfhHRISpdp4+kRO8y0lcR7L3nwnGCMOLdFAsNyFfA3490RiFWHF8OdweQFbLdrOSJxvmjOlJkv6jLjZBjmZqunZ7Og8kSzaixkPM4YUa53yfEfsR6TCvKKsRd7//4P";Sidebar.prototype.searchIndexData="7Z1rU+M40Kh/zVbN+wEq98vHkHDbJUxeHGDrfFEpjkh0cKwc2R6G/fVHchKGKMwuRo7Usr21xQyBzUaPW62+qfuP9tkf3bM/Go0ofg2I+POP5kB+t8Rr8kdztPq54Hi9PMWcs5fodCD/QCP2Ev7RPFvGq0D8Sl389QfhMfVxcINnJJiwiMaUiV8ZzVgcs9W7XxgEdCF/ELO1eDWKOXsmj3QeL8VrjbdXhixgXLzyR6NZS/8RP5EfrTEUX182H7Jb23y73Hzb726+pfO3NWw+89t/F9DZBz/qjuRPsxK4IU+xdQK7JS/3gZghcEcXy5IjuF9bX7+lTXBGwjjdAyglYR2DIgZGMaQboeIgdgNMCL2mGQhDHAQsicXhmMwCAoRF245+2LH43wTPgZCwtDV2JMDsjo4iET1DHJbkB2chEAj9zh6EjiGzYUi5nwSYQ6GwvyU6fTMU/kxW6xO6FQVUt49hXxj6VjA0yoohtSJxOIejIVUQHYMgvCXma3Q+X5A5uiJQD09T+vKWxf5SkPDEOnDwtlns49iXkKYhHJU1tfG1dmIBBMW+MJgKQbzXFEBA2FES4JRD14py8AISzgkHHJUxJhBbEtMXhh7xawVDwhAfmqAppgEcdWHHB/NiTtdwINiJX3vil2gkKIA+Sk2JxJRTqIZVx1B4Zk9XoivG6T8sjHFgn4clkdjj8bBdlnUaavDOkGt6j6YJB2pfmQpgbhnI1DdMEJ2GURCA7Mzdyg07o1sQkPJ/dknAieAZ3hk+jXx2OktoMKfhIjo94zj0l+j70xP1yT6NNaNhTPj5DxLG0fa1OY6EDSa+kWt5okHwfo3NTk8s54PVP6X/fEjqi8jx9jufyI8oXmBJHNBQ/E/DkPjx9gOqsNv1fRO2fQA7xfMh6/QnZztuWszPw3lZgLf2gLcPjQAjwC9JSDj10e7dio69v2971Zu2uDOxqnAlSy7Kgr5eU9zkQ5vPCPrx6L7oqDv7/lbv0N8yQtpb4SAQ8h2JDxxFRYe+82F2Gr1lB/qUBMRnq1UiPjq6YklU+KO0Xts/S3uWFMsheTQZVvDNwL8PqViWWOtr4Yk3m/uK5rA08ojEhYCvpYBHabnHWhiP6yXhOIhOr8/GaIxp+MTxqvA6RynJ/CDk/x/PYLjj+EejJkiKr5NfLPN/LjSkaOC1Uke70A+mtb85PogagHowU/aSrq3Yz2Q/oNU9DGiBeSY3eL1ZaaEfiOIFd+pwH8gY+4I+i5aFfyb9/WeS2X0w+Eyoz9l6ycLCH/O9/0zVgXkoxXc1uj1nbK7JEA3m4igRjuAQ83nRn0xH8QFBbxN0x+SP/BI8F5d2DKfblRX6ifT382xNwKe852OxksI/EeWIz575NPhE1gQ/F/+JtPdd+D7kPZKE6JHx5yjGGyLFfjK99r6PAtiR9xLx3e7HhX8uyo45vPUH5rlM8SwgcdEfiHLMtwEbXlPCVzRUy2KL90g6yiMBfKrcF9+XVzYIZI/xgc4JE278Snxb9MfS2S/R+aAsG8xjeSQzdCaLPIt/vCsFwZBDw2UyhuFlGkNBJAh2z2XF5klAotN67fIcXQzZedGfiBqG/IL2eiP49kzGG4o5Po9mvdtC30YkehaL/R80DJIoDRS//XrRn1N3/5RpfmHnGHlOf8vndBEwxqun9FZTCu0pyf+LLKP2XmjsL9Hmf1D0Z9PraFsEJp7NBeXkRdYAe4T/oD7ZPh2xqV688f8U/SEpcczeFyLLJh7S/rMp/EOpO6HVvFdx2qxKdNqo4RmgttsD5XGCg91p8+t/ir49eEN5mbHwaq2ldFbLXH6c75OaizPGjxn/ZQmchwuxCPRtiP0lQaPtzwv/XNSivsw2wY6U3lPYvcvJMMBRhC7ojBM0XMpccvD2MIr+LNRTJnNCJq9nITjQWRKTeWnQK5FlW9vghon1zEvCXKkzameuJ86HuQw+LjhL1qURdjUGmTkhrwN+mcw2xtECx8LNe5WRxtoZjsgUXSWzoqNXjttWZu9OMPpl/1xuEebyGIby9TI8A+Wec3an4XjPYNdYYfumJXsS3cyn7vGeRLUPbNIfD7yy7IG2YgVlNvqP9xQ2nRhKsBMAn8rbG+o4KM1+0G1xdLxn8TC5LctTUPzhlrWzYSW+ntbbjeLfQe/rHsdj8eWrhDvdWk3m2ygpfMcdpd4je6hHh3O3XathHqFv3Xa9WfjgsnqTzKhID3yfRBGaSKqFB71/xSL7BTEt0MPC14hpZ0n0+HpF56vIb/bmRFp8R+PC89UNtWvx9Qao3S6+AddWenFkDqtrQY6ojyacyTOv+BkMJWjywZzXo8rzHarXSmMv9xTWmR1yLdbTQdH51mu61/70AI9Rs1d85azcUcp+YV8L8kPhLTi7FvLfk6LzVV1po3zPzrzCm8iqGt61HzREmBP8LIeFn7GfRSetNNs0q4rPOJ0vCl+v3tVNomghnnrCPi5BxF5t52tUkIcyNzvGIV6Ursy/aTSOPMTF57sfuWgajVwIvsKN5mmDPRou0OYSS9GRW02NDEeja3QhvhSdsl3felj8wHJ/35bLXr2kxVf+NQ3FFR2zcim0ZdSe22AeFj4Qp10Wrw/5PqTxKzr/ueYlGH2ktgqwwDttPFN0ztr9F7U4y1nSfowG/v9LKC++q6IOrTYap9vBHu4+cqFRd3Qv5euilteGpxyH0RPjq7R71a9bxNPzwld3KaPrDIu6dzIe3BU+raIWxpj1X7zxSeEJq+2/zAbxvHs08go/WbRe2+9FmP2ChRbk+7PCFyiqAxXNVtCNSFyKi9OKx5K9G7AWZBafzFnhS5mb+4yNxkVHk2nR8SpGW/aLPVp8vZtB4UOiSqcjs7W2I9lmaszmxc9wt22q4sfRGF3QoAROttKTKPswKB3OMkWF7mi4KDrlerNjUS1fcJY2QJuXp4BcGS5rVkmnXT6Enh6s1wHFoV94Za342Gavtu56qpRGtq1ejrjC4XxJgsIPSVTqyc2WzFxN0tnsRWes1NeZtfGuULPRLDzhusVj8HpYeF9QCWZkn2Gvx7fwwftuzSZf+UlDEiMv5kQOeio67Xptv07U7CWU6+8e8m7Oig5Z7bxjNFVyXfh7VIor0jV6y+d6Mi38jL6DklujZRmC8APa1WaU5HaE1eYO1xOBe7VKQrGaEmQA1UCd4SNwgkbeTdEZd21eJb6eFv4IVPWF0fjQn2ffR0UH3FAawRi1Mf4ihW9O2doX4LrRSyeCb+ErxpXrw9knw+sAvhncopgh8UfRMasFzEYNtxu6WMYvRH5Fg8KfeXa9khsWLjjBcvTXpPCliOpMNqPKYzwofDFtbz913TAqyeNh4fm2bd7gGZ/X68W/zqrdXVwLMZnTMoQqFCOuZ9QLGRMimzmsA1z86paWzXjFmETLyn47OmSxelQvQQ9b7ZlAWphpSNHD4O+iQ27rjpvRgsxmNCAlylkrCT+jBcxjr/DunnKhxGyR1vi+8MpCyYaYjdaP/y68/Kpd240G4W4Hw/JUgfcUx9qoCXdbDSk5Ll9hIuOwDNUWysUzs/qCxBELS9CQUrkOZdRCFpBfGH/elg+tSPHHRylnoFkb7pb8TKJSdPGzrKAl5oacW3KBZ/JC1PnPmITz4mtsu01AN9zbJRBvCJy7JeCsXNrpGE2wfvdjEhSdsJI6MesTfr/16mUYl6Z2wDaan/q+TteBBivhfD/R4h+Cyn1Vs27LjnbaLHHNeOENaqVRlNl7aZPBCNWLTliZSmc2rC8JNwpPeD/QYbZIYyI8b3Tty9UVm7JSy2zWmJucFT59ojTDMJvQngyRx57iF8wLH9xXSrrMTgkVnB/onLCiQ1ZLa43mAiejwk+A2Pkgu4slNaNW8mRc/MvBjX3Chg1jzmLms60fEpShCFQxL8yOqJv8fVF0vmr3cKNBjDsck1VS+HmhVodZ3pE1wSXo86kIstnpt3L0H0HeC439ZXn69Km6w6xcTzzxb9ERW22N4RH+gwpRLjpk5cKU2eqBLeS05wtnZctMmQ3KeSRGU7Yuw4zyet3meeh5hfcElXiR2aF0nneDpoSvaFgGH1Dtvmw0xOxNC9+xT6lrNtsK2Ct+vyI1hG9WfktyT0oZ5Gy2NtF7KH4eymYQY0oC4ssufeIDlyKrumu5ZSVRImnLAc6kBHd66k1FORutw5iKpRdelq1eUJtOUAlavih5P7ORuE1RHJYrLzblTt+iiTHlif9cdMIH2tjsuZdwTgpf2lnv7NfFmb3GOn0oOt9206II35/d9euFr7y3e1HnfnyJPMJp8RMjljlX6b2j8n3ASVD4085qWOihdONIzHoeD5NbmTeVn5hXiZBjw/YKr46tCvPjoGrwclS+117hx/X19gH3jQkwm5NVhHA4R+slC0l0OsSzgKSD3FdFh66UtDSzlyin9P5o1AQ/8XWSEsznKZAgQOn7Ff0hNLUnNB/tIVzg4lcbNTq6lsnR8F8xFq/LsAXUCujsyv9oz+B6Ug4tpBg4X4iXHO0RbNvmDnxZm45K+kB6oB5IGWyj/T4SjeylZUfjn77VyVMJDudaB+zBUAolBPhgvrsoh4+mzBz6QjX80R6BbLBQDvtUewJGTs9gTdg6IKeDcM7ZgoQsidCE8KgEVYX7BSzZL/tOUnJfRz7GPnpkK1x80vt2T72W2fDRRx2WA7Vq3tTbmQNwuqwnQ9lrufig9+2YeitzlEcX9F0ShjRclIF2bz9x3c9cRqTL2qOxnIBWDiWiXAHuZ44TaNOOhVFTEtFu7Bvj2ceL5wa7FLJtDzeXbTF4dCrMn9K1A85e93m3oaXBeTAdo827VLCNwJ7ixa7rSzm4a7eL0ud+xhme+ziKS4JcbTOeObOtj1z2JhGfGe16lZQSvA0dc0kXeEbjnY7ZqZxS8rch+NeDUTlh2xD26wlKbx4vWfhaTurZm2fnQN0bXpeEtnqdJXszUX3c+2UY5eDeV6azWVDkt8PzksAGoMhvSfwUsJeyAFcG02QOHeoD342n2TVsLAt5ZcpV5usE+uRLAtq+Ttm8A7oO0VlCAxm8LTp0pcHgW2sEC9QfabxEHg2oz8KtL1p0+kpHlex9SvXhV9EW08DXuDS468qFmezzx3LgHTMux2SVg7hSfJX9rr8+8Omoyg8Zg/3AKuVtEPcj/kECEi7isqTiAPidj5QL5qWJY6kJicw1nV8nHhE/4TR+PR3KXhcUXQjyLzgo/LiAltK+JXO+2duC02Iuv0Vv71Rw5KqUZ9YreSAvi3w3lJaSmVVKHrAvcUyeCVkXX4MrI4GzX1PPBXeC+bzwpBWLMHNsNg/S19+98pyUSm+dzLer8gB+w4rfo1bp75m9nXUeoG9J/ML4c2mMkpaiuDOHY/OAPrn+uzTqRPUurUj5Nv1QGuZKNZBZZ4f/SEs9U1/nPqRPlMzRZDsFIs0sF988VGacfMUaTynq8JdTTkKxILnOqJzcs98M1+c+EjrGjxl/LQlyJb/5FU9IF/kFDUhUCtg5RLHygF0S0VZof8VW1KV9xaLCd9ZWr4N/xUTU5Xw9mT6URKpzMMh1aY+pz9kLmZVDaUMA/v2qJNIN4ITcvMOm1q0c+Uxl2FL2+tkcoMtGlJz9LIvZrcSxvpJc00bOnuIXzAk6w5Fw8cvBXenHlD11nwN32XQC8zkqg3EIQZ9vqwvLIeBKCKWXuQJLH/h9SOOy6PG2km2zED7Z1BfKeGE57HEAQcLHx8eSyHdnvx+W0Uj4Rm9vMxFp3Oo8XNDi90fVno6zPfF0mAcsKXxpSr2nNIysZVcl2qRHNHomcVx4oW7rTpDUR30xRLs3KThsJWTVym4E6sOmM+FaDpdYfM4ASSlHXjKLXqO4+E3G9Z2eHPCL43KIZ+KzFt7HVFSLDdx3JEgT9ViIOo7xDEeF1zGKZZj9qo8+9an4IRpwjotf9mZfozySGRoGSVSCeLhdwzC9Vk82fSUvZHvDXfO383gpPKlS3Lrv6Hb08LYUdR9AOZoc6IdUcsA9DHAUoRZqlwS6cg88e6vxXKArHT23DSbr9eL3ae5D0DFv/Msh8rpztfNAvu+ZXuAZp35J+B80PrQi85ckJClz9hSXw5xRskTZ+03mgf1afOIgoJvvkRfj4l/RUrMX2bNzeXD3Rrcl0S9t5bKnFd43+JVw1EB3ZMViUhLyqmb/Qnw9N/TNkjAH4aSOL/9GvVqthsZJENNoz4wv+gPQbgyfywOQ3E92ZuSmdrQc+JVZWXasmhR/kOqdUil81ZWyJ/tbg3JEpOYpOnb1nLWj9Cdnf5dEzFWLMnuWKQ/cnInXVys8C8qiXkBEhMt8mloiTle/ztOScFc0jJWD9FcoDE0uH9H4clh47B0A5+gD5XGCA3RTInkHEYPf1KxXCVYL0MsBHEY87JHx5wVnybqifnzqL9smxKcDmVINcdFhK50V39owfB72rm2zDuxLId7hHE0JX9EQF741lzLCrL77sVnod3hOGZqyl+LX4jW7ipRnbr+QB3APp7nT4l/TUMeBtDIHdXPFLS8OFP7UVHRK9qKMPJA/0pMLKocKF5229rC4fGhv36PgsBXtnf36aJ6w0Rmn8xJc/tpvLZK9L3GuzG/YpoUlGqzXAcVh8VNEfd2O57nyn3IcRmvGC38LTG3TZQf7zeAWyZpezoKg+Mb5gb+fOa71Jegc+8+neO2fDiZD5K0wj9H9xEP1Wq120pS1MA8D1Ljfhx8oPDhdLON3Cw/Ik/w2WmOfhoub9LtRva0+IvFR5uzl4+f19lQOMHX2MTUPwyJySR9Skj8Qy8yDT3uLpg0YzQfGrwk03XZKpg6YTP3QE8ufzEadDeVXVO/X2rKgieIAydph8Wvxtk/Yb2dLuwxsuNNUOsgadSdZZdVIubBq1VPxEngqZJ9C1ujX3BQvC1ux0a+7yeqDiNvxWTmqtqywalesPsmq2W+0K1afZdWqWH2SVbdTa4Ln0jFvHwguLfBcPrgmYIBLBzyXj/L3BsD0wYNp1g8j2McHU4evYRofpFOODabXbNU2ofxNWP/ku3DgQnlgbScRilX/LtQPiZ2FU2vgDVC73Wuf/I0Gc7yO6Q/yNrbRBWQWHN6BdyejunXwW9GCg7tl0wDPxp7cNMRWq+j8jg58U9GCCb1lA99c7B32VjDDxgHDqN4/vCZoAk5fHFVwqVjSNAJKBy6UesvOPurX6jW4VBotS7LSl78OlUqnfVjsfWwqAsD8rStfs9aEJDRK2ap5OEPMhffJ0UT8gMS/Sp1QQ+1eCEmMLOjh34JqA+Zkwaf6LacOZIGyYAoOcYyD1yhGLXG8f3yJExIhK1vujVCjJ8zm/S7OIfm45SckaFb23xu0VgXtS9AqQL8H1GnXmifn8BC1lPmrFrWVQNRyAJGFJOJ7RB0HENU/aIdnklEfPKFGw3yY6B2hutBFgOH0zScX3+AoXm+jhp4YR1cTQLjUe+Dmc9S/o9VspLRGJAjg8vpgJJktXq0afF5Wgisf4qrXHMAFSLzqlfLKQqtZSdeHvK7nJIx3Y7XTutCPZuGW3NG7nnio1RYKyiNhJD8wVDYW4lHb8iw08H15LXh7RxUuIgvic0t+JpHMcNfQrjHg225zoD7LGrGG8B2mu0E65z9jEs5BVwdY49RotKYTdHlesfoEq2ZjMhGbsaL1SVrTcUXrs7Ravcn/VrQ+T6vSWp9j1azVO/DCnnDoVPmpf6PTaVV0fkunXcnO7+m0BZ1Jhef3ePqdKVwuVqIBOy738OXGGp+OvHoEnY61XdWRV0ig07FQS7Gh05XNtuq1Ey9gu6olOXM4imgEl5aNq7bvcfUcw9W1iqvlFi0bF9zf0eq7RatRM1++8/3WQ/V2s9beHyY6TKKYrQjf5Q4mAY6fGF/BhWfhTNyyExp/eIO877fn032IFbR/hTYeIG90BR1Zb39olYXC+w2xVru1kbGTQ2ic/aCRQCMbMcAjeCh05svMNgw7H89MhomtoTTabdTNFwRNlq+RbBz8q2lF6x55MeNY7akOScAsOACHoD5Ua4XqNmsQW5E6OxvE1gKMzcImvR96qC2LGcF7AhasDAmn02j17ie7pJ/sTMj9XTN4qKgsaK0NqjSO6hQqC5pKoho2GmjcRJvJznDpWBIkQadW4fkXPC0X6FjbWi0nhMcank6F51/wtNxQPdbwSOlpgMdjwZJ+HJyftOsNuEwsnFaSSadicsik24LLxIJqkUy6zVbVNe4QSreCsg/l4Rw1+oC3jxWVIqC0KyiHUDoVlEMo3XalaT+iUqnaQyq9SlYUKmT2Qbt65NW7NbicbGia33BqQuYESJ46FafT5fr0aoKEA9m+/NX67n2nBECENHtJXE2+iifl4b1GMVkhPx37ex76AYsSDrgcIWsyLyc8XUfw1FtWxCfqtN3gkzW893U81+ETDekZDufoYnQHXe00zMnNhLMbcVQJfXzTadT8bUR4I05g+RhUy+/5dCo+/8qn14bKp9m1zmd0U+/U0GUPDhRd7yIXKM1GjVRUDqh0KiofUllXVA6o9IDLSlYvMy8qsGXFEpV2ReWAShv4wWwBinfTaNYiUFR61nWtgNKGDcWcpOxaCg43lcHoIiA/T+o18e8IDh0bbhGdrU6vz8aoXq/Vag8DdD/xAAHRnF4uFqZBpF2rnTQa8Klk3UV6VLrtFrph/mYvRSwgaIxDvIBclpdV9+oBuhfKBcdogkPyi9FfNK74pHyaDuiZrPPJtYB0HACSNfKtBWT+U3jOcFkYVbdCKuTBDBhH1pyaLo62TKZdPcAFYlR5CCDddiUeWxo/m8LjQeMCFd9p4mg3KxzvcVTS8R5HR0pHEy4OoyftFgdg6TCNA/hmMY2jD/iUNcyiC3lytXEW7UqJ/sLRE1rj7zZcHEY92Z/NfoXj+ZSJrwE5vSUxx9tC2r+bJ40zePd5NQPw39OFagIaTprysvxgOhzsqo6hYVKs1nrG1qK5YepWmP4T07Rfg01J9YGyTk7OD1OtgvMhnG2RpNTZcNFktXPyIbPG3EfT1kkdvOhY5rM77NGYzZMAUK0tiDP/jVPxepzkwufvljzroaOxssX+7vxCU22ufUKbbXUuWwKuOY0IGrdcOOWz5kxyp9R2gVK9ZQNTddb/G5nqlP8PQvDP96zp67zItMCTyVp9qEsmCbcue8eZ+8OGNbJCaHdXfzdt/fznmsuRKRtlhBqtNarX0OXsHBBCy3ppn+C2Spr+Q+aolZL6DcsK4AHAKqL973hSN+Wth2clR4egRjjGQyLN8O39/5m8/78dmdXsAGKlWbaSA6udWqrXpJLaMuo21hWkDyD97+jufUeJSxyTF/wKr6uEfWK7SHfjBHDhi2kLfY8LoMtkAOxzJzIjFveR4HIDF4zpMIkEs5nYhRrycpmwhgac49eK0DtC/+fCe6PUrTcKVGiWN5wmZDiG00QCzgXlBE3roC/LmFfFKZW/G3VYVBogqLSAUYEhKy3Q94ks6ZW/W52SU1nT+Sle0BiL4yc6HWz/Jv5jcSBRztWg15pRGck4/0HCONq+tiPjp0EO8YKwEWM5PfFGQTljccxW735hsP0vY7ZW+aloejUlkHOIZr35+wEZ8fpuXVEObNC3QegvGf+fiswBmSFnUXRyRvCqonNIZ0QjHyqX5uGxZIyLbKxATjYB5QmezwMClVLLovRcpt0nINOxubeuSCA/PVQ0HziVxtBcr9YkCAjYA8smmwlnsOD0FR+q2bAHZ5rwGQ3BqhtjR9Z6jTmOkwiRgKzkqk/HOFwyNc9pDYz0d/fI1LLtqN36/mjUzrcrzAOSx/xnEktXYtueTawU3bJ//gEDrrnPLePpfixsyXrNeIzOpEdHYiCo6qqIQUJ1QxZAMDXaIHfiltMdDaGAUnVWI5syPzIo75lyODvPvnaXC+T0KVmQ6HT49nep2kfEx2ltyzfP5+QlDRyxgM6RtxR2FRTToX6gvjIx/LXkvNAJh4UulshbEzIHA0kVtGxK/hiQJoQ/MSG9BJo8AUSViM8Lxo0BuOHe9BNYoQLIjKSHh3AGIcUuAe4+YTCsVtX2+zdCAK0Ci3LEVmnhPeMROkE0YqdnAXshaeLtAodQAWUUo1+LFMbntfc9B0y/3lOiesB+kqzQJFmtK2T/jQx9e5NZOKFy4MRGVPwexwswGU3gvM7/L/FjONlx4LQmNIpZWMH6FCwZvqpQfQ4Vk0ktcT7CSd+AJxZj/lrB+hSs1JeuWH2KlcyisorVjhVP41QRWnAazoVCPx1uXgEK6IMSzH/js12dgHO5XV9+hIT1zuCqc1CgrjCoaAxkVNerNfbjCtUnUP2JwZ55oDhtjM8K1X+gSt9qiHZvi8bYF69BqY2BiG1MgyDN4CSBWBH9p7IaMsGqzsWvUauOyM9Qq/T+Zzk90BnHcoUVqh2qOafiHU5H8g+gUDJe/kiXkj0x+B6EvBmT0Hnat+sMcJ2QBTDb+KZwiH+QV8YFngCsgjbM51Xakt/FquUxtv12uMSr2Sa7LDPwT/L1aqNJXlcEx+k432QFF0i2IJ0ekE0cXAhIskIbdSyEZpqsZoEUpEpBbzF5a45fKxw7HGmQ+5e8yGqxX9+N2Q8pOzvNU3ZkT4TMJbOL9M9d5glN8QzO1c56raWjgjZL+zoaeS2PcbkOHKDNm4EBo6WbjwAGfRsTsV5AufGmwqhtH9F2jz1g4dVDwWRZlDYnGKj7eCoRQ4JD41jsnuj0TJg48/TsAsKjpXU8XWzXpQGEE/wcLzlLFksgSJo9rT2jjWQY4NVa+OMXAQ4XRHgOyTqAc6uuradR9OkwASeM0hZCMIgoW6hnHEglH+9wiF2zIrI7JongiAgsKOjbiMTCdpELOxG2DHsqir2SO6jzn+tALK3i9B+cZKu7kzsS0SjGIdwwKSxMaRij2om/RSesn/m7xh5AyDS0HIjcuIyS1epV0PkBJm7Ra9sFkwhBCaCwsOxWXbEIjMetsMjWi0sfxXW4uS4EBIdCw7RgXMul+UupQ2QweBNG//YrLAHl/LEdl/iY03fhem7+eh0ioXB8SCUWtpG9wal4bHhw+kR9giay92jFJGVyR+aJD8Zi6do15e6SdZxwAmnP2A5UeCR4OhGKRBavhQt0RwKCI7JJqgBBdJi3bBlmRAMSwtlEdVWnGJcZ8VWc0BvHCAgUu66QF3NMQzASYjlAvqMB63KbZSgPYm1ASNj2lR8oeZGHzWWAowgIE800db5M0LcbOaEEUPmHrejkUpZykp8bv5DL3Fs4J2EERtP2dJSKrFOVHTzflqeNZ8QS6TtP6JqgtAr27b2B8Orr7LL8eZ0HxI859VNYYCBpGnj5Y7qgP2VjRXmsC7WEpsmMRDDlS9VT2Y62/MldYcrXNATHqf+f8xHNYoK0/YDp9P19Jm1qGmy2IFTjAII0vSd2QcNQ6K+K2ReZ/bFpYAkVnfXj8YBdwDbRNPEDsDf8oAlcGrSvYH0OlremvDDdPg3g2rNcoWKzLWTpDkQ4nKMLLquonDDwMw6oy5/aHZkJgwwMH9Wwb9qlk/YGT2VKbj1FpFAdCLTOvkxla5VgGlqjgpYdWrOC9iG0TSZvImPOINV9H9YRubG7YKJST8Z+pulb+bOaLml4ckGDFTr/gdeMA7pApDfkNn9U9ycf6CwgrIBFCu+RJ39r7lIQ2jSzFf0pUV2HJzc0JGh7T3osX4VCqK/lMaZL0ebixVh8blhc9DxpPS5/hQQDasrQtYhC/NcyfjfBMZQ70o2ODRzrZLWOTof4B41fQU3kaTT3NWwmW0cu5MssyNuwnRQIGB9W2S6drjUiYBzUxh6Rrj0iULxPazIi23iA0h9aZQI6JC5xhLZj4WCg6DYsyYQk8W7yGwwaB2WAxg6WS4I5pC3S7u5HE+qmQFwxTv9hYbxVnkBw1NvKFPi6MSBFuk+pw2FCuLzGH4gPDASFGs3tm0KRzmqCtD1Uy6JjngQYu1N1TsztEC+ZrYSbR9MaYDjCUa/tA+lmur+lB0TIBWAS9Z6xjSK7ucKZRNLfb/mWLQ+mgwHedOF+f19bGDtEHrafFRKMutLspd4ytUHQCZrT8L3vDgWJXkx4i6Q2ur7VAvM2M7nC8h7Lue+nEuOjR8YrNvts0ts1bIUXIYFjtAOBI/39ish7Ilevc46ToBKUfSw39P8ldI7+JFCuDwPhckd8uubMT0vtKzR7aDYZ/80g+grNezRpvKBCskMiB1sLzbIJoHzbqBqo9fFfxPOVidbv8WzQvPMLKj4f8HlzDyo6H9CRxl4F5gMwlcb5LZrNmn6k3crWAfbJihSm0XPOpDhbyCyyhLWpVaowfYBpz2DeGocVqA9ApTZiReY0Imuclu1Hp5d8UwPo7V76Q46dJHEcvB9FCYOYXnX/2wqzx5Hf8dqMl36Hq0KzQ7MvQvQJbOMPu3SEy/HqB4D65wGjowSXK0r/RinaXHWYcGkC0Fj+rAKWEZhUV48EjAUOjNuE8BUOxYLRON2RFaYPMckuoAmnSJiYyUyYTBWmDzGJfVYh+ggRC+icPtG0D1jAIgImdAKNjpyNULF5xyadDLvbU6UHI16TjusK+0sakuj0/GfMk3SqMLC4SF2nYYS3WaZw/8fbheZJClaYBByoCQkC4Zn8I18ENHBCjScBACVjt+A2HlRMd0yIFRijCB6m7Xui7Tuib7/uE1XQPg1tVxtcIdsi+yE2Hwmi0zMMpdZImRyUrd3Pw2Y5OhjQt2vvOxT5sAyDcxLI+NCIJ1BqgJXb7xnTRvkiASUqeo00tMEk4fN2Mk569+IsXQkUNprJRl04AorwKWKCpjh8hoJEkZeuUdUylIZLOllKbKWUivhzKCxlwqEWdnZNi8xvAaFvZ4yBiUSrnLLNFTg2p0oLfRLVDVmA7SBdr9lRTuhbGnpNBwVsKvrSv17iCFC3bcVEzDZ6SBfVdjBTdcAdgJHmIeMI2mAvrbaXulAuGPfJ/GTE8VMsyLC0yGoKqGmQcme5n+nOsjadhIfYh3KTXclhWEHRgMnC8LmdttYSnz6AIhrN/ZZBZoMSksYVC+A09OzaDNFc4eBpMxZx29pz84ZA0BzYcd1MYxt04VyHckY86PNmv12IWRfzT+w/C5tt7ojoZGquo8vmr5D5zycsiSGFPtt1i5oGUjtppZlKr2cYhNwtdwQDal6n5gkydZfRJSJrktBZEjwjTxDBCyh2it7sa10qaV474fQfoWFBq9aGWXN2wtkaDRbb4mMYSKwqFFiapGXTnH27eQUpjmQ1vr2pbxxxCubwtcxjc8Igb70kHMpBYzc+sAvlgz5kzLo2gNSHVX0qOcDOFmbrv50Pj7dsxRmOwFxDVDtEWgJTFW/8O5o7xp6ggulb5pJOqYQmO/sxk7pZH3DHSHxyOFeaDo5mC0fSFok0WyCfTj0LaEZUfkDYisYuFik1jhxVDQukLnAQEWBgFCu4Xm9Y4BKwTYsgyFvLvJ+kgAGvks0CApQsrLf2lXCmiVa5gECPNF6iCfafAbWmtUplM3wCWji72dlnYjTrLltBoG9nBFJTPyXfYR5Hau9WPFIe8k9pzz09CRdAwBlRvCJitWBKatVkqlGV8otPau9uzDh5KHsJf8I+QdfhnMpeh3DuFCvGXc8mr/NwU6N9xtPqFjAy1bHpQf2G0aYnVOpGyeHs4kyHQsvqtcff0NoiOtnVkW3Kp8AQa8AjBulKieqANow6oL8BdAdpywEUIO+ZcjgqHKQITZeyQV0grIIoCUBZBTAEiq3AZPj6+2Xz2UYw5wXkIgmCk2kyIwfn2ZBROG0xGjajYjtWEwrmeAchOx5ZUQdkp25adiLx2aJTHFKhiKPTMznwvP7fMJ5oEAxZIING4n/UrKX/iNejmLNnsvtJyNLZpl8EdQD8QK6UeaWHR1q6uA9ppT8ZbFaty6vhCC81n/zBQOijAxsR4o6A9RQr4LCy1gwvVwRsF2z6fezp+LzYAn0PhfcmtKyj1A5rp45PLfE/UXIIgtZbO4XdCXmYHzg6rgvhxqArHPvCf3l1hJsiZR8Uhxwd218kDD9T4wuRV//wBt/ReY0Ziz5RJQ4Dl2KLWRCvW4aE9o/cBGbDtvDIZ+apg6B1UMRlwdb3AhY7Y1Ps9wLpWbApvBA/O6q9rGzGGM8+0ySj4rXhNSXz+Ss6+9TAdhDMOv/ZnudozJ4Ym8vun46Q0pauC7Her2Ia4jB6uwsQEFfMiW7LJjP29EQc1V2dzEejDqkRp6GsP0SPOHYpEGZTuhRmDUeYdTsWmV3gKEbpG7gBS9mUH1RhHROW+IKm3J0YmELrg2thR6T1V0ifnNH1+0GculFdf0eiGCcch7Ezel5tjmdUZ73j5YqOV8pE6rXMUcIvAlsSHMRLH3NyOgjEZwtxOpV+TObUp6Ez21NxiTIHDa/eMGgyDIXsLUlEsSvklPPSHrkoolEqezeyGXco7TTvVfztE33nQJDs6ZppeZE845iGjkADI35DzOdUrHnhTBpOiW1kNnRzJEeQF+OnJzTgxBm91wWyW4c4XiKxOle47YvdR11ITIGTv+BK2qmrWwCUF7URwU+uMOuDYcZXOHbqcFDQZa7Pyw0dFSuLnQl+q/EQa+bI+aujrpdVZOjRoWK9pmYWLy9uF3hFg1c04dgX63BG7HRTe7nhozyK0YA6GiC3B+6ShEQswNGjwd5+3bwPOp8nm/vvjvKzJnfifbg7gfR6TTknMgeG8+XWcISbKm6Zi7tzw8aiNY1x4IzEwdmoO3KuyFxPN+mVF7nr1SoJ6T/p8eDM+QrF278On4iwhFkSoRGNCHa1ct4mwbUQPfExXQEHJXNzLT5gGMkcmAyqu0IPjtil+evAteR1tw4E4F90HhJXQpxgqN0koTt3hRRo1pzYMV6tmPiZK8l9MEou1W1ppxvxQddyfgN3BaFyk8haoHiH8IbOOHbn2i00CbwjPuNzZzQfHHxhvGk1GDhzCVC7aj83eHfXjiADE3+6JQl3KXUNRtZuk5hTlwLsutcC8wL3PfRdEjgwJ8P3JEYTpwIn7Q4QkZssMV9h3xWRazeBiNxk+RqlxpxsoInXrvBTXQlrcndHFlSs3Kk8LJRgpydeQDc4XCSfmpUNAp7a+K5nLRvrMZ+KfesR/oP67tTXQUnyeAlfuNNy66BpjTVu09HIEWZg/Igpc6fbz8EI58z3XPOidh+IYzViSehMXZ2yRa3ZJI9LQgJ/iSlHA18cDRGdBcSZ6pPdhX2gGBuOYrSm/T7G2HQEo9p6w6w0hjhOZGE75s4cINrBlNt0zV+H9Weypu7kxHq6lwB0cY3xWmzHG3cuhfVsC9gYc2e8LeusCPcTZ7ysXdt/e5uRORNF0j4YdVndknWcOFPipW2O6eKaBEnMHIHV0Y2O68Ly5B+u7ER1pKLxneiF7OUpcKdFr/W96CWhM+64dlI5D1iuON0gYLniWls3TiWsVgXrc7CmURLiFXUFl5IfNo7rnuMwccVN7LQsq60H4hAs3Tt+X4a1JmwdkNMzPHt1xnxQ3MR6rZEV1yRdtSYuVwyIrm7yQ5fWcInDRdp5MXaqpkU316vNjYViwYnvEDM1kGpc1i7ICjszp0S7B7surbE7rNSWFW/fm6Tljovd1I1H5AHLlROyqRt31oaVrFauJDTUJuzGYU3InIgVU+zMoagbTNUl5i3Zi0PjXNR6WPPKawvMFf2lBnKM+0OeWG0QOFMgoVa+Zr81rAvsPqQR+ekILjUCbdzwesRiKcJ/vGNs5YwWU9zuL/S0zhWbK7qsp1vMr08tkOO8HMHVtm2NPbKVQ25RS7vRfD68XNmNLWviFeEnEr+enlG2xP9g7krBfr2m+JKZJ2h46cK/TmyIE4cChtrZbW1cS7JKL6s+Erx2FlvmU1IX2wUOgo1t4T+7kmXTbracBzSWxMhbksCdcnLrW/SC4wV1JlDd1a2+18V1hcN5QNAjjZdOdXzU7SKnzY0uluiBBTFeuHOzrWX7INij5oxZqxuRzZWaM8V1ugVQutT+ImSNRs5c/dC+h6XL69aV4nzrJsYtC0+uWUj/SW1aPKdOFaoo4y4zx2f16aHzMHZmXwKQNuStmENRRuvu5q+cLxpyFkUOodMtstZF55o2eyvn/PJsGl1iXkDX6MqlqGNXO6ytzSxmnKA7YdbG6H7tjPvUte0IKNxccaAsajWfktAnp2JFjGNBzxmrQxvZZuUazMZ4ERJX2oB2dS+Q5MCL+sLY8NnalRia9qUbfWa3iR8Q7E6xmX5QIzdkrip/C1L2SMP5SrBwhJg6qN0ksTXjcXQ6WK2XNCbYobSTbumBl65cAxn3l+5081RFLLse08R1hiMyw85syba2EtPlRUPmJ0GJGj9pE2PCI3/BwbMrwHSvd+UALEY3OAl9Rzv9tTNXsusiG+LV2qGrEor12jWuxba8HDVd21Z4PVF3ijJsWxWS14K71LFZ8SezR6+1iYXMnfoVNXeZvVw2F1yu6C/1FnTLvAJLuy7f0CdX4ojaLfu1iQV0NXMoYamdHdflJRO8aCh0fsxfkfdMZU2Go/rsC8nLY9BzRb2psmfe/H/1A4e2qnJ4Ghe2EeUxOqPOdOlU5csCsB8OiZd2NkmXFnsJl4KEc4eAImbGjVoVnKP637xCO/9JuE+jSp99ktcF5eSFMVec84POItnrpLSBRUuXVNnBkLjsxcU5EXNGhym1eHXj2n9HbELdSfbadtIlMzQMCA4dss/2Ja1jfGtessCVCT/q+Afjtqxk5Y5oabcV0ccVzlmAHcGlPTpaF9cVFvr+MqBzd0RMYdbpGGdGn505H7Wn1+QAyyHRUoKwxg/GK8ZlMZT/jKYcU1dKoqxH/q99grbGa4Xs88i8Zxw7hGzftPjKXSVdZsK0YBx5L3S1coibbRvjTxLLeKKjuIybF3/hV+xMpaJtNXZDnwj6UxyYzlxPOgiMGWc2ZjHjM1ni6UowUREz88Urv5A13ETWNK7GJtQPqe9ayzLbVRhbalMs59I7uj07xp3MPWqO7lDzFYx3OFwQvhuu5I602S4tVrg5I2+6s+K0uTH/GTlW1Kg9aSkfaHJIgkvjvOzv0XSsxCzALgW2bZdN3bEXaeO6gks5P+vGcSWhQ0lftWON+S354Agp1Zw1XkzsYRqgM4d2onaXAm1gIY0xf0UjKl6JcODaxFDbroAnPppwoB4oeUkhOcJNe0CaPrdkhpFbxdmKrBnPcXqERPjFTVpt4wEhjwRP6DJJCzSqpHAmck5HHo0nN2UymMxkpwx3dFnHtnfuPVP0Z7JaO8JrV9Bij1dA5g7Jl3pPzngSRfAia6n5HVNmfdvKbIWDjQvlVhsb+7cmvDANAvG5s8Jm3tAQyFZs5s6kIdUFML89BTGh0hhx5yhQu0GYl7KEO3QPQG1hZh7XtkjPnbTmvq2xa8togVjDFWJKVVDmYdw5EHNnQ+p3+tekNSVhSJ3pWWnbqKhCPRlgybi1I6x2sX1rLvijUylx7flB2rTEB4vSZhgVsk8iW+KApKkkh6DZbuos+9JHbln41uWMsTm6xPGScIeoWSuMiom/PB04VPOvuyWnYsEanBz1gvqZvSAdTkO8Ihy7KlPZ20TlwMpRucoej9BiRYIATZabFbpAq6Vr1mvRYqsVdrXRtVnFLlCtE4cSabqjM7RYceZMYtumTJ3/X+K7UjGnRpkzVxpqgZK2ujuDBNX4stHNlzZIdGjeg26bLB1WY2dDpV2j1vqEvbhz8tUtnnxy9DVzBZRSoZq5RkkLlOe5gslmOGFKArKW3owznnJrP071hXRhPrxc8ZabupWo+eBqOoJLmdH81l7ZNK+WK7zqILRX2xFcVnfjvXfmCKaWbjm4DqYHOicMbYKijvBSbIiW0TPxEW+ac4+xL/50xS/s6jad+CoyjsM0T5heAz1tocclEWrMGe9HCdNkPx731q8PcED5DLuSZFWH3fWz+0T541sH2CH7X20flj1OcSyCrngE9dq+C9XOHmo9FkJXvIS+dlLtWARd8Rv0o2jHIuiKK6HdNetoBDuuENzfxV/x9Y+FsOsIQvVaYCt74UreCFezRCD0XfFDtFtU5g4w9JeMu2MP6tYtHomfK9ag9pyqI/FzxhTUrTY+Ej9nDEHtQqKc+Z1R/9V3KCADzQzc8nPnANFtqncsgM6cINp5/iMBdPQIaWfPoR0JoDNniAIQjA50JpawfwhnbyaXO8AkcvUAAXACC3iOHh4N+4eHgOfowdHM3JPpGPBcOTR6+xHorxSS5UxviB0KuyidmqwrPQnPFaWnRk3tb1xJz1WtB0L0XNF62o0jjwHvhvnOzBVU6l+slx/IFt9zMkdXdLF8wa+OYFSb1lnfwxeEc1fgKTLYsR4vkFfCYp64s4mVE8R63veC8eeAPjlz/1A5RKwXEF1id8IFHe3a5iPAc8Vy1q/aPQI8ZwxnaFVrEp4rhjM8yeMsCedIeVs3YKoWjPWc2xXmM7lwF+llb2KfOz0SUJ+t3eleogZgOtYDMG65bx1oRRt/ErJ2xgJUs23WhS+l54oJqN/8JGd6N2LrxkuWRA7VvEDbv+8YuiKHbWgG4ZitydxVEbR/CWmDzxXpA1exMWYx42nVi5sEO9YzIRMs1oGD4BV5yWxF+EKI4yMn7kRVldSIdaCyWRIWUonSXuluUuxb39iez5hD+JRqXvv4CI7RGQlcie33oF3MFADRRF6KcwQguAtd3pK66xtbjwym9JyxCqGVok5x6Ir5osYE29bDqlP8kzoCD5zVMmUvaOBOQFXhZ78iQbyfH7t0DVhpX2vd+dgBdPTosF/YJufMhc7IXxua2bzB54r0dXSnsh4HnzOVHdDusG7weS4XJYCQwZUzClB13CBYMCtn9J96gxXABk78Z3eErw9O+CQ+R6WvBUDzSXzOnL5K9137zm+Kz5XKSnC3WDf4nLm7r9ygtp5I3+BzpQlgF1zINMXnSgNA9eiwfvLeh0RAQncMOzp20H7C6IEsqexe4tSdOAWilfjfDxKcDjinP2Q7/ItA1rRFjvA7mHvyFQ9ErF8LHHtB5zhyJVOu3oL7it2SA7Hbc1d45XDS5sFL7PGlI8h2MmUb2aMjvPKoa86Bl+fMlgTCiyXVlsyIrNqSmXg9EnfsCqW1knG74gwvFnjhTL2dYoYZN1zP3KlxUkXrK16SJis+Ixx5S3cGuO/r+6+1idNjRnASvyIPB+6kUjvWoTH2jAbhXNoWAg91S+aUM9O4SpNNue7Ep8OuTC9XujN8bZSLJrJoSV29JvGlWgc9XAzHaLh053aTWh78pcmHesgSzknov6Lzn/4Sh+4YaIqsGbdnh0kkFuBKJFa10b6STdbCNWIvYRRjyl0lZlzARpyGz2nMnyXi0KSumGk7X8neqTnaJkumLHHm6GxYPjrPA/JDXmt1hFdHNc2M+wLnkfjUDhFTL1J/paIjH2BIngWuUFNOAfP78o3avTOOpmKamd+aCWeOsOopVxSMB7LPf1JnQthKAMO4RXYlzFc/cQVXu2f7iLxiMXEl1qOW+tiBha7DJ8ZXTl1wUZquGz8hr1crKl6ukGVA9kvK3LmNYTvl+x5awxFobdvVUXIIhzPx624Od/U0aUVxml+SIR9HK437X7njrUVtnEQkWblCK4eeFlq0bhmaYC4Di64Qs51V2uJy5qTs5jAGJxdgrpyS1k2LiSSDvj8J8198QmeLyixsTYfOyTzam+vBEpIlPpwjuLq2I2OytMeZZKUiW8ZtMM+p1K7tOzZTKryiGI2xv6TOtKDsWY8nbrFNEu4vceQKN+t7c5qEoTNxWOsJkfu1W2Uqii7Tk6726P8D";@@ -12270,27 +12275,27 @@ DrawioFile.prototype.setShadowPages=function(b,f){this.shadowPages=b;this.shadowDrawioFile.prototype.synchronizeFile=function(b,f,k){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[k],"savingFile",this.savingFile);if(this.savingFile)null!=f&&f({message:mxResources.get("busy")});else{var d=!0,p=window.setTimeout(mxUtils.bind(this,function(){d=!1;null!=f&&f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,f)})})}),this.ui.timeout),q=mxUtils.bind(this,function(A){d&&(window.clearTimeout(p),null!=f&&f(A))}),u=mxUtils.bind(this,function(){return!d});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(A){d&&(window.clearTimeout(p),this.sync.cleanup(b,f,A))}),q,u):this.updateFile(mxUtils.bind(this,function(){d&&(window.clearTimeout(p),null!=b&&b())}),q,u,null,null,k)}};DrawioFile.prototype.updateFile=function(b,f,k,d,p,q){if(null==k||!k())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",p,"invalidChecksum",this.invalidChecksum,"latestFile",[q]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=f&&f();else{var u=mxUtils.bind(this,function(A){try{null!=k&&k()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[A]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=f&&f():null!=A?this.mergeFile(A,-b,f,d,p):this.reloadFile(b,f))}catch(J){null!=f&&f(J)}});null!=q?u(q):this.getLatestVersion(u,f)}};-DrawioFile.prototype.mergeFile=function(b,f,k,d,p){try{var q=b.getShadowPages();if(null!=q&&0<q.length){var u=this.getShadowPages(),A=[this.ui.diffPages(null!=d?d:u,q)];d=null;try{var J=mxUtils.parseXml(b.initialData).documentElement;null!=J&&"mxfile"==J.nodeName&&(d=J.getAttribute("vars"))}catch(x){}d!=this.getShadowVars()&&(A[0][EditorUi.DIFF_FILE]={vars:d});var I=this.ignorePatches(A);if(I)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",I),null!=f&&f();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var G=this.isModified()?this.ui.diffPages(u,this.isRealtime()?this.ownPages:this.ui.pages):null,E=this.ui.patchPages(this.ui.clonePages(u),A[0]),c=this.ui.getHashValueForPages(E,{}),g=this.ui.getHashValueForPages(q,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",u,"pages",q,"patched",E,"patches",A,"changes",G,"checksum",-c,"current",g,"valid",c==g,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",p);if(null!=c&&c!=g)this.checksumError(k,A,null,null,"mergeFile",c,g,b.getCurrentRevisionId());else{this.setShadowPages(q,d);if(null!=this.sync){var l=this.sync.patchRealtime(A,DrawioFile.LAST_WRITE_WINS?G:null,null,p);null==l||mxUtils.isEmptyObject(l)||A.push(l)}this.patch(A,DrawioFile.LAST_WRITE_WINS?G:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());+b,f,d,p):this.reloadFile(b,f))}catch(I){null!=f&&f(I)}});null!=q?u(q):this.getLatestVersion(u,f)}};+DrawioFile.prototype.mergeFile=function(b,f,k,d,p){try{var q=b.getShadowPages();if(null!=q&&0<q.length){var u=this.getShadowPages(),A=[this.ui.diffPages(null!=d?d:u,q)];d=null;try{var I=mxUtils.parseXml(b.initialData).documentElement;null!=I&&"mxfile"==I.nodeName&&(d=I.getAttribute("vars"))}catch(x){}d!=this.getShadowVars()&&(A[0][EditorUi.DIFF_FILE]={vars:d});var H=this.ignorePatches(A);if(H)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",H),null!=f&&f();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(u,this.isRealtime()?this.ownPages:this.ui.pages):null,D=this.ui.patchPages(this.ui.clonePages(u),A[0]),c=this.ui.getHashValueForPages(D,{}),g=this.ui.getHashValueForPages(q,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",u,"pages",q,"patched",D,"patches",A,"changes",F,"checksum",+c,"current",g,"valid",c==g,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",p);if(null!=c&&c!=g)this.checksumError(k,A,null,null,"mergeFile",c,g,b.getCurrentRevisionId());else{this.setShadowPages(q,d);if(null!=this.sync){var l=this.sync.patchRealtime(A,DrawioFile.LAST_WRITE_WINS?F:null,null,p);null==l||mxUtils.isEmptyObject(l)||A.push(l)}this.patch(A,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=f&&f()}}catch(x){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=k&&k(x);try{var n=this.getCurrentUser(),v=null!=n?n.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),v,x)}catch(B){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(x){null!=k&&k(x)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var f=new mxCodec(mxUtils.createXmlDocument()),k=f.document.createElement("mxfile");if(null!=b)for(var d=0;d<b.length;d++){var p=f.encode(new mxGraphModel(b[d].root));"1"!=urlParams.dev&&(p=this.ui.anonymizeNode(p,!0));p.setAttribute("id",b[d].getId());b[d].viewState&&this.ui.editor.graph.saveViewState(b[d].viewState,p,!0);k.appendChild(p)}return mxUtils.getPrettyXml(k)};DrawioFile.prototype.compressReportData=function(b,f,k){f=null!=f?f:1E4;null!=k&&null!=b&&b.length>k?b=b.substring(0,k)+"[...]":null!=b&&b.length>f&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,f,k,d,p,q,u,A){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var J=this.getCurrentUser(),I=null!=J?J.id:"unknown",G=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",E=JSON.stringify(f).length,c=null;if(null!=f&&1E3>E){b=[];for(k=0;k<f.length;k++)b.push(this.ui.anonymizePatch(f[k]));c=JSON.stringify(b);c=null!=c&&1E3>-c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(g){try{var l=null!=c?"report":"error",n=this.ui.getHashValueForPages(g.getShadowPages()),v="unknown",x="unknown",B="unknown";try{var C=null!=g.initialData&&0<g.initialData.length?mxUtils.parseXml(g.initialData).documentElement:null;null!=C&&(null!=C.getAttribute("version")&&(v=C.getAttribute("version")),null!=C.getAttribute("agent")&&(x=C.getAttribute("agent")),null!=C.getAttribute("type")&&(B=C.getAttribute("type")))}catch(H){}EditorUi.logError("Checksum "+-l+" in "+p,null,this.getMode()+"."+G,"user_"+I+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+E+"-patches_"+f.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=q?"-expected_"+q:"")+(null!=u?"-current_"+u:"")+(null!=A?"-rev_"+this.ui.hashValue(A):"")+(null!=n?"-latest_"+n:"")+"-latestRev_"+this.ui.hashValue(g.getCurrentRevisionId())+("-latestVersion_"+v)+("-latestAgent_"+x)+("-latestType_"+B));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+G,action:p,label:"user_"+-I+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+E+"-patches_"+f.length+"-size_"+this.getSize()})}catch(H){}}),function(){})}catch(g){}};-DrawioFile.prototype.sendErrorReport=function(b,f,k,d){try{var p=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),q=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),u=this.getCurrentUser(),A=null!=u?this.ui.hashValue(u.id):"unknown",J=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",I=this.getTitle(),G=I.lastIndexOf(".");u="xml";0<G&&(u=I.substring(G));var E=null!=k?k.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()+" ("+u+")\nUser="+A+J+"\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!=k?"\n\nError: "+k.message:"")+"\n\nStack:\n"+E+"\n\nShadow:\n"+p+"\n\nData:\n"+q,d)}catch(c){}};+DrawioFile.prototype.checksumError=function(b,f,k,d,p,q,u,A){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var I=this.getCurrentUser(),H=null!=I?I.id:"unknown",F=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",D=JSON.stringify(f).length,c=null;if(null!=f&&1E3>D){b=[];for(k=0;k<f.length;k++)b.push(this.ui.anonymizePatch(f[k]));c=JSON.stringify(b);c=null!=c&&1E3>+c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(g){try{var l=null!=c?"report":"error",n=this.ui.getHashValueForPages(g.getShadowPages()),v="unknown",x="unknown",B="unknown";try{var C=null!=g.initialData&&0<g.initialData.length?mxUtils.parseXml(g.initialData).documentElement:null;null!=C&&(null!=C.getAttribute("version")&&(v=C.getAttribute("version")),null!=C.getAttribute("agent")&&(x=C.getAttribute("agent")),null!=C.getAttribute("type")&&(B=C.getAttribute("type")))}catch(G){}EditorUi.logError("Checksum "++l+" in "+p,null,this.getMode()+"."+F,"user_"+H+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+D+"-patches_"+f.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=q?"-expected_"+q:"")+(null!=u?"-current_"+u:"")+(null!=A?"-rev_"+this.ui.hashValue(A):"")+(null!=n?"-latest_"+n:"")+"-latestRev_"+this.ui.hashValue(g.getCurrentRevisionId())+("-latestVersion_"+v)+("-latestAgent_"+x)+("-latestType_"+B));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+F,action:p,label:"user_"++H+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+D+"-patches_"+f.length+"-size_"+this.getSize()})}catch(G){}}),function(){})}catch(g){}};+DrawioFile.prototype.sendErrorReport=function(b,f,k,d){try{var p=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),q=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),u=this.getCurrentUser(),A=null!=u?this.ui.hashValue(u.id):"unknown",I=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",H=this.getTitle(),F=H.lastIndexOf(".");u="xml";0<F&&(u=H.substring(F));var D=null!=k?k.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()+" ("+u+")\nUser="+A+I+"\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!=k?"\n\nError: "+k.message:"")+"\n\nStack:\n"+D+"\n\nShadow:\n"+p+"\n\nData:\n"+q,d)}catch(c){}};DrawioFile.prototype.reloadFile=function(b,f){try{this.stats.fileReloaded++;var k=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),d=this.ui.editor.graph,p=d.getSelectionCells(),q=d.getViewState(),u=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(A){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[k],"viewState",[q],"latestFile",A);null!=A?(this.ui.replaceFileData(A.getData(),-[k]),this.ui.restoreViewState(u,q,p),this.setDescriptor(A.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 J=this.ui.getCurrentFile();null!=J&&(J.stats=this.stats,J.patch([k]),J.fileChanged());this.ui.restoreViewState(u,q,p);null!=b&&b()}else null!=f&&f(this.ui.fileLoadedError)}),!0))}),f)}catch(A){null!=f&&f(A)}};+[k]),this.ui.restoreViewState(u,q,p),this.setDescriptor(A.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 I=this.ui.getCurrentFile();null!=I&&(I.stats=this.stats,I.patch([k]),I.fileChanged());this.ui.restoreViewState(u,q,p);null!=b&&b()}else null!=f&&f(this.ui.fileLoadedError)}),!0))}),f)}catch(A){null!=f&&f(A)}};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 k=0;k<b.length&&f;k++)f=f&&mxUtils.isEmptyObject(b[k]);return f};-DrawioFile.prototype.patch=function(b,f,k,d){if(null!=b){var p=this.ui.editor.undoManager,q=p.history.slice(),u=p.indexOfNextAdd,A=this.ui.editor.graph;A.container.style.visibility="hidden";var J=this.changeListenerEnabled;this.changeListenerEnabled=k;var I=A.foldingEnabled,G=A.mathEnabled,E=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=A.cellRenderer.redraw;A.cellRenderer.redraw=function(B){B.view.graph.isEditing(B.cell)&&(B.view.graph.scrollCellToVisible(B.cell),+DrawioFile.prototype.patch=function(b,f,k,d){if(null!=b){var p=this.ui.editor.undoManager,q=p.history.slice(),u=p.indexOfNextAdd,A=this.ui.editor.graph;A.container.style.visibility="hidden";var I=this.changeListenerEnabled;this.changeListenerEnabled=k;var H=A.foldingEnabled,F=A.mathEnabled,D=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=A.cellRenderer.redraw;A.cellRenderer.redraw=function(B){B.view.graph.isEditing(B.cell)&&(B.view.graph.scrollCellToVisible(B.cell),B.view.graph.cellEditor.resize());c.apply(this,arguments)};A.model.beginUpdate();try{if(k){for(var g=this.ui.pages.slice(),l=this.ui.currentPage,n=this.ui.applyPatches(this.ui.pages,b,!0,f,this.isModified()),v=0;v<n.length;v++){var x=mxUtils.indexOf(this.ui.pages,n[v]);0>x?this.ui.insertPage(n[v],Math.min(v,this.ui.pages.length)):this.ui.movePage(x,v)}for(v=0;v<g.length;v++)0>mxUtils.indexOf(n,g[v])&&this.ui.removePage(g[v]);0<=mxUtils.indexOf(this.ui.pages,l)&&this.ui.selectPage(l,!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);A.checkDefaultParent()}finally{A.container.style.visibility="",A.model.endUpdate(),A.cellRenderer.redraw=c,this.changeListenerEnabled=J,k||(p.history=q,p.indexOfNextAdd=u,p.fireEvent(new mxEventObject(mxEvent.CLEAR))),p=E!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):-null),(q=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&G!=A.mathEnabled?(this.ui.editor.updateGraphComponents(),A.refresh()):p?A.refresh():q&&(I!=A.foldingEnabled?A.view.revalidate():A.view.validate(),A.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!d&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",+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);A.checkDefaultParent()}finally{A.container.style.visibility="",A.model.endUpdate(),A.cellRenderer.redraw=c,this.changeListenerEnabled=I,k||(p.history=q,p.indexOfNextAdd=u,p.fireEvent(new mxEventObject(mxEvent.CLEAR))),p=D!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):+null),(q=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&F!=A.mathEnabled?(this.ui.editor.updateGraphComponents(),A.refresh()):p?A.refresh():q&&(H!=A.foldingEnabled?A.view.revalidate():A.view.validate(),A.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!d&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",f,"undoable",k)}return b};DrawioFile.prototype.save=function(b,f,k,d,p,q){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",d,"overwrite",p,"manual",q,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!p&&this.invalidChecksum)if(null!=k)k({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=f&&f();else if(null!=k)k({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(u){if(null!=k)k(u);else throw u;}};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};@@ -12340,8 +12345,8 @@ DrawioFile.prototype.compressionChanged=function(b){var f=null!=this.ownPages?thDrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new Date;this.setModified(!0);EditorUi.debug("DrawioFile.fileChanged",[this],"autosaveDelay",this.autosaveDelay,"autosave",this.isAutosave(),"saving",this.savingFile);this.isAutosave()?(null!=this.savingStatusKey&&this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"...")})),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.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(k){EditorUi.debug("DrawioFile.createSecret",[this],"secret",f,"token",k);b(f,k)}),mxUtils.bind(this,function(){b(f)})):b(f)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};-DrawioFile.prototype.fileSaved=function(b,f,k,d,p,q,u){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;q=null!=q?q:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(q),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=k&&k()):this.sync.fileSaved(q,f,k,d,p,u)}catch(I){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=d&&d(I);try{var A=this.getCurrentUser(),J=null!=A?A.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),J,I)}catch(G){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[f],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(I){this.descriptorChanged(),null!=d&&d(I)}};+DrawioFile.prototype.fileSaved=function(b,f,k,d,p,q,u){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;q=null!=q?q:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(q),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=k&&k()):this.sync.fileSaved(q,f,k,d,p,u)}catch(H){this.invalidChecksum=+this.inConflictState=!0;this.descriptorChanged();null!=d&&d(H);try{var A=this.getCurrentUser(),I=null!=A?A.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),I,H)}catch(F){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[f],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(H){this.descriptorChanged(),null!=d&&d(H)}};DrawioFile.prototype.autosave=function(b,f,k,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());var p=Date.now()-this.lastAutosave<f?b:0;this.clearAutosave();var q=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==q&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",q,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var u=this.isAutosaveRevision();u&&(this.lastAutosaveRevision=(new Date).getTime());this.save(u,mxUtils.bind(this,function(A){this.autosaveCompleted();null!=k&&k(A)}),mxUtils.bind(this,function(A){null!=d&&d(A)}))}else this.isModified()||this.ui.clearStatus(),null!=k&&k(null)}catch(A){null!=d&&d(A)}}),p);this.autosaveThread=q;EditorUi.debug("DrawioFile.autosave",[this],"thread",q,"delay",b,"maxDelay",f,"actualDelay",p,"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"))};@@ -12350,10 +12355,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,k){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,k,d,p,q,u){DrawioFile.call(this,b,f);this.title=k;this.mode=d?null:App.MODE_DEVICE;this.fileHandle=p;this.desc=q;this.editable=u};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,k,d,p){this.saveAs(this.title,f,k,d,p)};LocalFile.prototype.saveAs=function(b,f,k,d,p){this.saveFile(b,!1,f,k,null,d,p)};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,k,d,p,q,u){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;p||this.updateFileData();var A=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var J=this.getData(),I=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=k&&k()}),G=mxUtils.bind(this,function(E){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var c=mxUtils.bind(this,function(l){this.savingFile=!1;null!=d&&d({error:l})});this.saveDraft(J);this.fileHandle.createWritable().then(mxUtils.bind(this,function(l){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[n],"conflict",this.desc.lastModified!=n.lastModified);u||this.desc.lastModified==n.lastModified?l.write(A?this.ui.base64ToBlob(E,"image/png"):E).then(mxUtils.bind(this,function(){l.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(v){try{var x=this.desc;this.savingFile=!1;this.desc=v;this.fileSaved(J,x,I,c);this.removeDraft()}catch(B){c(B)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(n){this.invalidFileHandle=!0;c(n)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(E,b,A?"image/png":"text/xml",A);else if(E.length<MAX_REQUEST_SIZE){var g=b.lastIndexOf(".");g=0<g?b.substring(g+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+g+"&xml="+encodeURIComponent(E)+"&filename="+encodeURIComponent(b)+(A?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(E)}));I()}});A?(f=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(E){G(E)}),d,this.ui.getCurrentFile()!=this?J:null,f.scale,f.border)):G(J)};+LocalFile.prototype.saveFile=function(b,f,k,d,p,q,u){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;p||this.updateFileData();var A=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var I=this.getData(),H=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=k&&k()}),F=mxUtils.bind(this,function(D){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var c=mxUtils.bind(this,function(l){this.savingFile=!1;null!=d&&d({error:l})});this.saveDraft(I);this.fileHandle.createWritable().then(mxUtils.bind(this,function(l){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[n],"conflict",this.desc.lastModified!=n.lastModified);u||this.desc.lastModified==n.lastModified?l.write(A?this.ui.base64ToBlob(D,"image/png"):D).then(mxUtils.bind(this,function(){l.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(v){try{var x=this.desc;this.savingFile=!1;this.desc=v;this.fileSaved(I,x,H,c);this.removeDraft()}catch(B){c(B)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(n){this.invalidFileHandle=!0;c(n)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(D,b,A?"image/png":"text/xml",A);else if(D.length<MAX_REQUEST_SIZE){var g=b.lastIndexOf(".");g=0<g?b.substring(g+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+g+"&xml="+encodeURIComponent(D)+"&filename="+encodeURIComponent(b)+(A?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(D)}));H()}});A?(f=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(D){F(D)}),d,this.ui.getCurrentFile()!=this?I:null,f.scale,f.border)):F(I)};LocalFile.prototype.rename=function(b,f,k){this.title=b;this.descriptorChanged();null!=f&&f()};LocalLibrary=function(b,f,k){LocalFile.call(this,b,f,k)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,f,k){this.saveFile(b,!1,f,k)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,f,k){DrawioFile.call(this,b,f);this.title=k;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(k){b(this.getEtag(k))}),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,k){DrawioFile.prototype.save.apply(this,[!1,mxUtils.bind(this,function(){this.saveFile(this.getTitle(),!1,f,k)}),k])};@@ -12371,378 +12376,378 @@ StorageFile.listFiles=function(b,f,k,d){b.getDatabaseItems(function(p){var q=[];StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};StorageLibrary.prototype.isRenamable=function(b,f,k){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(b,f,k){DrawioFile.call(this,b,f);this.title=k;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(b,f,k){RemoteFile.call(this,b,f,k.title);this.libObj=k};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(b,f,k){};RemoteLibrary.prototype.saveAs=function(b,f,k){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,f,k){StorageFile.call(this,b,f,k);b=k;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,k){return!1};UrlLibrary.prototype.saveAs=function(b,f,k){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,f,k){DrawioFile.call(this,b,f);this.desc=k||{};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,k){function d(E,c,g,l,n,v){function x(){mxEvent.addListener(B,"click",null!=v?v:function(){g==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(g,!0);f()})):g==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(g,!0);f()}),function(S){b.spinner.stop();b.handleError(S)}):-(b.setMode(g,!0),f())})}A++;++u>k&&(mxUtils.br(J),u=1);var B=document.createElement("a");B.style.overflow="hidden";B.style.display="inline-block";B.className="geBaseButton";B.style.boxSizing="border-box";B.style.fontSize="11px";B.style.position="relative";B.style.margin="4px";B.style.marginTop="8px";B.style.marginBottom="0px";B.style.padding="8px 10px 8px 10px";B.style.width="88px";B.style.height="100px";B.style.whiteSpace="nowrap";B.setAttribute("title",c);var C=document.createElement("div");C.style.textOverflow=-"ellipsis";C.style.overflow="hidden";C.style.position="absolute";C.style.bottom="8px";C.style.left="0px";C.style.right="0px";mxUtils.write(C,c);B.appendChild(C);if(null!=E){var H=document.createElement("img");H.setAttribute("src",E);H.setAttribute("border","0");H.setAttribute("align","absmiddle");H.style.width="60px";H.style.height="60px";H.style.paddingBottom="6px";B.appendChild(H)}else C.style.paddingTop="5px",C.style.whiteSpace="normal",mxClient.IS_IOS?(B.style.padding="0px 10px 20px 10px",B.style.top=-"6px"):mxClient.IS_FF&&(C.style.paddingTop="0px",C.style.marginTop="-2px");if(null!=n)for(E=0;E<n.length;E++)mxUtils.br(C),mxUtils.write(C,n[E]);if(null!=l&&null==b[l]){H.style.visibility="hidden";mxUtils.setOpacity(C,10);var D=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});D.spin(B);var U=window.setTimeout(function(){null==b[l]&&(D.stop(),B.style.display="none")},3E4);b.addListener("clientLoaded",-mxUtils.bind(this,function(S,V){null!=b[l]&&V.getProperty("client")==b[l]&&(window.clearTimeout(U),mxUtils.setOpacity(C,100),H.style.visibility="",D.stop(),x(),"drive"==l&&null!=I.parentNode&&I.parentNode.removeChild(I))}))}else x();J.appendChild(B)}k=null!=k?k:2;var p=document.createElement("div");p.style.textAlign="center";p.style.whiteSpace="nowrap";p.style.paddingTop="0px";p.style.paddingBottom="20px";var q=document.createElement("div");q.style.border="1px solid #d3d3d3";q.style.borderWidth="1px 0px 1px 0px";-q.style.padding="10px 0px 20px 0px";var u=0,A=0,J=document.createElement("div");J.style.paddingTop="2px";q.appendChild(J);var I=document.createElement("p"),G=document.createElement("p");G.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(G,mxResources.get("saveDiagramsTo")+":");p.appendChild(G);p.appendChild(q);u=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&+var StorageDialog=function(b,f,k){function d(D,c,g,l,n,v){function x(){mxEvent.addListener(B,"click",null!=v?v:function(){g==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(g,!0);f()})):g==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(g,!0);f()}),function(T){b.spinner.stop();b.handleError(T)}):+(b.setMode(g,!0),f())})}A++;++u>k&&(mxUtils.br(I),u=1);var B=document.createElement("a");B.style.overflow="hidden";B.style.display="inline-block";B.className="geBaseButton";B.style.boxSizing="border-box";B.style.fontSize="11px";B.style.position="relative";B.style.margin="4px";B.style.marginTop="8px";B.style.marginBottom="0px";B.style.padding="8px 10px 8px 10px";B.style.width="88px";B.style.height="100px";B.style.whiteSpace="nowrap";B.setAttribute("title",c);var C=document.createElement("div");C.style.textOverflow=+"ellipsis";C.style.overflow="hidden";C.style.position="absolute";C.style.bottom="8px";C.style.left="0px";C.style.right="0px";mxUtils.write(C,c);B.appendChild(C);if(null!=D){var G=document.createElement("img");G.setAttribute("src",D);G.setAttribute("border","0");G.setAttribute("align","absmiddle");G.style.width="60px";G.style.height="60px";G.style.paddingBottom="6px";B.appendChild(G)}else C.style.paddingTop="5px",C.style.whiteSpace="normal",mxClient.IS_IOS?(B.style.padding="0px 10px 20px 10px",B.style.top=+"6px"):mxClient.IS_FF&&(C.style.paddingTop="0px",C.style.marginTop="-2px");if(null!=n)for(D=0;D<n.length;D++)mxUtils.br(C),mxUtils.write(C,n[D]);if(null!=l&&null==b[l]){G.style.visibility="hidden";mxUtils.setOpacity(C,10);var N=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});N.spin(B);var J=window.setTimeout(function(){null==b[l]&&(N.stop(),B.style.display="none")},3E4);b.addListener("clientLoaded",+mxUtils.bind(this,function(T,V){null!=b[l]&&V.getProperty("client")==b[l]&&(window.clearTimeout(J),mxUtils.setOpacity(C,100),G.style.visibility="",N.stop(),x(),"drive"==l&&null!=H.parentNode&&H.parentNode.removeChild(H))}))}else x();I.appendChild(B)}k=null!=k?k:2;var p=document.createElement("div");p.style.textAlign="center";p.style.whiteSpace="nowrap";p.style.paddingTop="0px";p.style.paddingBottom="20px";var q=document.createElement("div");q.style.border="1px solid #d3d3d3";q.style.borderWidth="1px 0px 1px 0px";+q.style.padding="10px 0px 20px 0px";var u=0,A=0,I=document.createElement("div");I.style.paddingTop="2px";q.appendChild(I);var H=document.createElement("p"),F=document.createElement("p");F.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(F,mxResources.get("saveDiagramsTo")+":");p.appendChild(F);p.appendChild(q);u=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365");"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.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");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");q=document.createElement("span");q.style.position="absolute";q.style.cursor="pointer";q.style.bottom="27px";q.style.color="gray";q.style.userSelect="none";q.style.textAlign="center";q.style.left="50%";mxUtils.setPrefixedStyle(q.style,"transform","translate(-50%,0)");mxUtils.write(q,mxResources.get("decideLater"));p.appendChild(q);mxEvent.addListener(q,-"click",function(){b.hideDialog();var E=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=E});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(I.style.padding="7px",I.style.fontSize="9pt",I.style.marginTop="-14px",I.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>",p.appendChild(I))},5E3);this.container=p},SplashDialog=function(b){var f=document.createElement("div");f.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var k=b.addLanguageMenu(f,!1,"28px");null!=k&&(k.style.bottom="24px")}var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width=+"click",function(){b.hideDialog();var D=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=D});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(H.style.padding="7px",H.style.fontSize="9pt",H.style.marginTop="-14px",H.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>",p.appendChild(H))},5E3);this.container=p},SplashDialog=function(b){var f=document.createElement("div");f.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var k=b.addLanguageMenu(f,!1,"28px");null!=k&&(k.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 p=document.createElement("div");p.style.margin="8px 0px 0px 0px";p.style.padding="18px 0px 24px 0px";k="";b.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",k=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",k=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",k=mxResources.get("oneDrive")):b.mode==App.MODE_M365?(d.src=IMAGE_PATH+"/onedrive-logo.svg",k=mxResources.get("m365")):b.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+"/github-logo.svg",k=mxResources.get("github")):b.mode==App.MODE_GITLAB?(d.src=IMAGE_PATH+"/gitlab-logo.svg",k=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",k=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",k=mxResources.get("trello")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",p.style.paddingBottom="10px",-p.style.paddingTop="30px",k=mxResources.get("device"));var q=document.createElement("button");q.className="geBigButton";q.style.marginBottom="8px";q.style.fontSize="18px";q.style.padding="10px";q.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)p.style.padding="42px 0px 10px 0px",q.style.marginBottom="12px";else{p.style.border="1px solid #d3d3d3";p.style.borderWidth="1px 0px 1px 0px";var u=document.createElement("table"),A=document.createElement("tbody"),J=document.createElement("tr"),-I=document.createElement("td"),G=document.createElement("td");u.setAttribute("align","center");I.appendChild(d);d=document.createElement("div");d.style.fontSize="22px";d.style.paddingBottom="6px";d.style.color="gray";mxUtils.write(d,k);G.style.textAlign="left";G.appendChild(d);J.appendChild(I);J.appendChild(G);A.appendChild(J);u.appendChild(A);f.appendChild(u);k=document.createElement("span");k.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";+p.style.paddingTop="30px",k=mxResources.get("device"));var q=document.createElement("button");q.className="geBigButton";q.style.marginBottom="8px";q.style.fontSize="18px";q.style.padding="10px";q.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)p.style.padding="42px 0px 10px 0px",q.style.marginBottom="12px";else{p.style.border="1px solid #d3d3d3";p.style.borderWidth="1px 0px 1px 0px";var u=document.createElement("table"),A=document.createElement("tbody"),I=document.createElement("tr"),+H=document.createElement("td"),F=document.createElement("td");u.setAttribute("align","center");H.appendChild(d);d=document.createElement("div");d.style.fontSize="22px";d.style.paddingBottom="6px";d.style.color="gray";mxUtils.write(d,k);F.style.textAlign="left";F.appendChild(d);I.appendChild(H);I.appendChild(F);A.appendChild(I);u.appendChild(A);f.appendChild(u);k=document.createElement("span");k.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(k.style,"transform","translate(-50%,0)");mxUtils.write(k,mxResources.get("changeStorage"));mxEvent.addListener(k,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});f.appendChild(k)}mxUtils.write(q,mxResources.get("createNewDiagram"));mxEvent.addListener(q,"click",function(){b.hideDialog();b.actions.get("new").funct()});p.appendChild(q);mxUtils.br(p);q=document.createElement("button");q.className="geBigButton";q.style.marginBottom="22px";q.style.fontSize="18px";q.style.padding="10px";q.style.width="340px";mxUtils.write(q,mxResources.get("openExistingDiagram"));mxEvent.addListener(q,"click",function(){b.actions.get("open").funct()});p.appendChild(q);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(k=function(g){q.style.marginBottom="24px";var l=document.createElement("a");l.style.display="inline-block";l.style.color="gray";l.style.cursor="pointer";l.style.marginTop="6px";mxUtils.write(l,mxResources.get("signOut"));q.style.marginBottom="16px";p.style.paddingBottom="18px";mxEvent.addListener(l,"click",function(){b.confirm(mxResources.get("areYouSure"),-function(){g()})});p.appendChild(l)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var E=b.drive.getUsersList();if(0<E.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");q.style.marginBottom="16px";p.style.paddingBottom="18px";p.appendChild(d);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(k=0;k<E.length;k++)u=document.createElement("option"),mxUtils.write(u,E[k].displayName),u.value=k,c.appendChild(u),-u=document.createElement("option"),u.innerHTML=" ",mxUtils.write(u,"<"+E[k].email+">"),u.setAttribute("disabled","disabled"),c.appendChild(u);u=document.createElement("option");mxUtils.write(u,mxResources.get("addAccount"));u.value=E.length;c.appendChild(u);mxEvent.addListener(c,"change",function(){var g=c.value,l=E.length!=g;l&&b.drive.setUser(E[g]);b.drive.authorize(l,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(n){b.handleError(n,null,function(){b.hideDialog();+function(){g()})});p.appendChild(l)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var D=b.drive.getUsersList();if(0<D.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");q.style.marginBottom="16px";p.style.paddingBottom="18px";p.appendChild(d);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(k=0;k<D.length;k++)u=document.createElement("option"),mxUtils.write(u,D[k].displayName),u.value=k,c.appendChild(u),+u=document.createElement("option"),u.innerHTML=" ",mxUtils.write(u,"<"+D[k].email+">"),u.setAttribute("disabled","disabled"),c.appendChild(u);u=document.createElement("option");mxUtils.write(u,mxResources.get("addAccount"));u.value=D.length;c.appendChild(u);mxEvent.addListener(c,"change",function(){var g=c.value,l=D.length!=g;l&&b.drive.setUser(D[g]);b.drive.authorize(l,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(n){b.handleError(n,null,function(){b.hideDialog();b.showSplash()})},!0)});p.appendChild(c)}else k(function(){b.drive.logout()})}else b.mode!=App.MODE_ONEDRIVE||null==b.oneDrive||b.oneDrive.noLogout?b.mode==App.MODE_GITHUB&&null!=b.gitHub?k(function(){b.gitHub.logout();b.openLink("https://www.github.com/logout")}):b.mode==App.MODE_GITLAB&&null!=b.gitLab?k(function(){b.gitLab.logout();var g=document.createElement("form");g.setAttribute("method","post");g.setAttribute("action",DRAWIO_GITLAB_URL+"/users/sign_out");g.setAttribute("target","_blank");document.body.appendChild(g);-g.submit();g.parentNode.removeChild(g)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&k(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&k(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):k(function(){b.oneDrive.logout()});f.appendChild(p);this.container=f},EmbedDialog=function(b,f,k,d,p,q,u,A,J){d=document.createElement("div");d.style.height="100%";d.style.display="flex";d.style.flexDirection="column";var I=/^https?:\/\//.test(f)||-/^mailto:\/\//.test(f);u=document.createElement("div");u.style.flexShrink="0";u.style.position="relative";null!=q?mxUtils.write(u,q):mxUtils.write(u,mxResources.get(5E5>f.length?I?"link":"mainEmbedNotice":"preview")+":");q=document.createElement("span");q.style.cssFloat="right";q.style.color="gray";mxUtils.write(q,b.formatFileSize(f.length));u.appendChild(q);d.appendChild(u);var G=document.createElement("textarea");G.setAttribute("autocomplete","off");G.setAttribute("autocorrect","off");G.setAttribute("autocapitalize",-"off");G.setAttribute("spellcheck","false");G.style.fontFamily="monospace";G.style.wordBreak="break-all";G.style.marginTop="10px";G.style.resize="none";G.style.flex="1";G.style.width="100%";G.style.boxSizing="border-box";G.value=mxResources.get("updatingDocument");d.appendChild(G);this.init=function(){window.setTimeout(function(){5E5>f.length?(G.value=f,G.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)):(G.setAttribute("readonly",-"true"),G.value=mxResources.get("tooLargeUseDownload"))},0)};q=document.createElement("div");q.style.flexShrink="0";q.style.textAlign="right";q.style.paddingTop="14px";q.style.whiteSpace="nowrap";u=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&I&&(u=mxUtils.button(null!=A?A:mxResources.get(5E5>f.length?"preview":"openInNewWindow"),function(){var c=5E5>f.length?G.value:f;if(null!=p)p(c);else if(I)try{var g=b.openLink(c);null!=g&&(null==k||0<k)&&window.setTimeout(mxUtils.bind(this,+g.submit();g.parentNode.removeChild(g)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&k(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&k(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):k(function(){b.oneDrive.logout()});f.appendChild(p);this.container=f},EmbedDialog=function(b,f,k,d,p,q,u,A,I){d=document.createElement("div");d.style.height="100%";d.style.display="flex";d.style.flexDirection="column";var H=/^https?:\/\//.test(f)||+/^mailto:\/\//.test(f);u=document.createElement("div");u.style.flexShrink="0";u.style.position="relative";null!=q?mxUtils.write(u,q):mxUtils.write(u,mxResources.get(5E5>f.length?H?"link":"mainEmbedNotice":"preview")+":");q=document.createElement("span");q.style.cssFloat="right";q.style.color="gray";mxUtils.write(q,b.formatFileSize(f.length));u.appendChild(q);d.appendChild(u);var F=document.createElement("textarea");F.setAttribute("autocomplete","off");F.setAttribute("autocorrect","off");F.setAttribute("autocapitalize",+"off");F.setAttribute("spellcheck","false");F.style.fontFamily="monospace";F.style.wordBreak="break-all";F.style.marginTop="10px";F.style.resize="none";F.style.flex="1";F.style.width="100%";F.style.boxSizing="border-box";F.value=mxResources.get("updatingDocument");d.appendChild(F);this.init=function(){window.setTimeout(function(){5E5>f.length?(F.value=f,F.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null)):(F.setAttribute("readonly",+"true"),F.value=mxResources.get("tooLargeUseDownload"))},0)};q=document.createElement("div");q.style.flexShrink="0";q.style.textAlign="right";q.style.paddingTop="14px";q.style.whiteSpace="nowrap";u=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&H&&(u=mxUtils.button(null!=A?A:mxResources.get(5E5>f.length?"preview":"openInNewWindow"),function(){var c=5E5>f.length?F.value:f;if(null!=p)p(c);else if(H)try{var g=b.openLink(c);null!=g&&(null==k||0<k)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=g&&null!=g.location.href&&g.location.href.substring(0,8)!=c.substring(0,8)&&(g.close(),b.handleError({message:mxResources.get("drawingTooLarge")}))}catch(n){}}),k||500)}catch(n){b.handleError({message:n.message||mxResources.get("drawingTooLarge")})}else{var l=window.open();l=null!=l?l.document:null;null!=l?(l.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>"),l.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),u.className="geBtn",q.appendChild(u));A=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=J?J:"embed.txt","txt",f,"text/plain")});A.className="geBtn";q.appendChild(A);if(!b.isOffline()&&5E5>f.length){A=mxUtils.button("",function(){try{var c="mailto:?subject="+encodeURIComponent(J||b.defaultFilename)+"&body="+encodeURIComponent(G.value);b.openLink(c)}catch(g){b.handleError({message:g.message||-mxResources.get("drawingTooLarge")})}});var E=document.createElement("img");E.className="geAdaptiveAsset";E.setAttribute("src",Editor.mailImage);E.setAttribute("width","18");E.setAttribute("height","18");E.setAttribute("border","0");E.style.marginBottom="5px";A.appendChild(E);A.style.verticalAlign="bottom";A.style.paddingTop="4px";A.style.minWidth="46px";A.className="geBtn";q.appendChild(A)}A=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});q.appendChild(A);E=mxUtils.button(mxResources.get("copy"),-function(){G.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});5E5>f.length?mxClient.IS_SF||null!=document.documentMode?A.className="geBtn gePrimaryBtn":(q.appendChild(E),E.className="geBtn gePrimaryBtn",A.className="geBtn"):null!=u&&(q.appendChild(u),A.className="geBtn",u.className="geBtn gePrimaryBtn");d.appendChild(q);this.container=d};+"</body></html>"),l.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),u.className="geBtn",q.appendChild(u));A=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=I?I:"embed.txt","txt",f,"text/plain")});A.className="geBtn";q.appendChild(A);if(!b.isOffline()&&5E5>f.length){A=mxUtils.button("",function(){try{var c="mailto:?subject="+encodeURIComponent(I||b.defaultFilename)+"&body="+encodeURIComponent(F.value);b.openLink(c)}catch(g){b.handleError({message:g.message||+mxResources.get("drawingTooLarge")})}});var D=document.createElement("img");D.className="geAdaptiveAsset";D.setAttribute("src",Editor.mailImage);D.setAttribute("width","18");D.setAttribute("height","18");D.setAttribute("border","0");D.style.marginBottom="5px";A.appendChild(D);A.style.verticalAlign="bottom";A.style.paddingTop="4px";A.style.minWidth="46px";A.className="geBtn";q.appendChild(A)}A=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});q.appendChild(A);D=mxUtils.button(mxResources.get("copy"),+function(){F.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});5E5>f.length?mxClient.IS_SF||null!=document.documentMode?A.className="geBtn gePrimaryBtn":(q.appendChild(D),D.className="geBtn gePrimaryBtn",A.className="geBtn"):null!=u&&(q.appendChild(u),A.className="geBtn",u.className="geBtn gePrimaryBtn");d.appendChild(q);this.container=d};EmbedDialog.showPreviewOption=!0;var CreateGraphDialog=function(b,f,k){var d=document.createElement("div");d.style.textAlign="right";this.init=function(){var p=document.createElement("div");p.style.position="relative";p.style.border="1px solid gray";p.style.boxSizing="border-box";p.style.width="100%";p.style.height="360px";p.style.overflow="hidden";p.style.marginBottom="16px";mxEvent.disableContextMenu(p);d.appendChild(p);var q=new Graph(p);q.setCellsCloneable(!0);q.setPanning(!0);q.setAllowDanglingEdges(!1);q.connectionHandler.select=!1;q.view.setTranslate(20,20);q.border=20;q.panningHandler.useLeftButtonForPanning=!0;mxClient.IS_SVG&&null!=q.view.getDrawPane()&&(p=q.view.getDrawPane().ownerSVGElement,null!=p&&(p.style.position="absolute"));var u="curved=1;";q.cellRenderer.installCellOverlayListeners=function(l,n,v){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(v.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(x){n.fireEvent(new mxEventObject("pointerdown","event",x,-"state",l))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(v.node,"touchstart",function(x){n.fireEvent(new mxEventObject("pointerdown","event",x,"state",l))})};q.getAllConnectionConstraints=function(){return null};q.connectionHandler.marker.highlight.keepOnTop=!1;q.connectionHandler.createEdgeState=function(l){l=q.createEdge(null,null,null,null,null,u);return new mxCellState(this.graph.view,l,this.graph.getCellStyle(l))};var A=q.getDefaultParent(),J=mxUtils.bind(this,function(l){var n=-new mxCellOverlay(this.connectImage,"Add outgoing");n.cursor="hand";n.addListener(mxEvent.CLICK,function(v,x){q.connectionHandler.reset();q.clearSelection();var B=q.getCellGeometry(l),C;E(function(){C=q.insertVertex(A,null,"Entry",B.x,B.y,80,30,"rounded=1;");J(C);q.view.refresh(C);q.insertEdge(A,null,"",l,C,u)},function(){q.scrollCellToVisible(C)})});n.addListener("pointerdown",function(v,x){v=x.getProperty("event");x=x.getProperty("state");q.popupMenuHandler.hideMenu();q.stopEditing(!1);var B=mxUtils.convertPoint(q.container,-mxEvent.getClientX(v),mxEvent.getClientY(v));q.connectionHandler.start(x,B.x,B.y);q.isMouseDown=!0;q.isMouseTrigger=mxEvent.isMouseEvent(v);mxEvent.consume(v)});q.addCellOverlay(l,n)});q.getModel().beginUpdate();try{var I=q.insertVertex(A,null,"Start",0,0,80,30,"ellipse");J(I)}finally{q.getModel().endUpdate()}if("horizontalTree"==k){var G=new mxCompactTreeLayout(q);G.edgeRouting=!1;G.levelDistance=30;G.sortEdges=!0;u="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==k?(G=new mxCompactTreeLayout(q,-!1),G.edgeRouting=!1,G.levelDistance=30,G.sortEdges=!0,u="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==k?(G=new mxRadialTreeLayout(q,!1),G.edgeRouting=!1,G.levelDistance=80):"verticalFlow"==k?G=new mxHierarchicalLayout(q,mxConstants.DIRECTION_NORTH):"horizontalFlow"==k?G=new mxHierarchicalLayout(q,mxConstants.DIRECTION_WEST):"circle"==k?G=new mxCircleLayout(q):(G=new mxFastOrganicLayout(q,!1),G.forceConstant=80);if(null!=G){var E=function(l,n){q.getModel().beginUpdate();try{null!=l&&l(),-G.execute(q.getDefaultParent(),I)}catch(v){throw v;}finally{l=new mxMorphing(q),l.addListener(mxEvent.DONE,mxUtils.bind(this,function(){q.getModel().endUpdate();null!=n&&n()})),l.startAnimation()}},c=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(l,n,v,x,B){c.apply(this,arguments);E()};q.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);E()};q.connectionHandler.addListener(mxEvent.CONNECT,function(){E()})}p=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),+"state",l))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(v.node,"touchstart",function(x){n.fireEvent(new mxEventObject("pointerdown","event",x,"state",l))})};q.getAllConnectionConstraints=function(){return null};q.connectionHandler.marker.highlight.keepOnTop=!1;q.connectionHandler.createEdgeState=function(l){l=q.createEdge(null,null,null,null,null,u);return new mxCellState(this.graph.view,l,this.graph.getCellStyle(l))};var A=q.getDefaultParent(),I=mxUtils.bind(this,function(l){var n=+new mxCellOverlay(this.connectImage,"Add outgoing");n.cursor="hand";n.addListener(mxEvent.CLICK,function(v,x){q.connectionHandler.reset();q.clearSelection();var B=q.getCellGeometry(l),C;D(function(){C=q.insertVertex(A,null,"Entry",B.x,B.y,80,30,"rounded=1;");I(C);q.view.refresh(C);q.insertEdge(A,null,"",l,C,u)},function(){q.scrollCellToVisible(C)})});n.addListener("pointerdown",function(v,x){v=x.getProperty("event");x=x.getProperty("state");q.popupMenuHandler.hideMenu();q.stopEditing(!1);var B=mxUtils.convertPoint(q.container,+mxEvent.getClientX(v),mxEvent.getClientY(v));q.connectionHandler.start(x,B.x,B.y);q.isMouseDown=!0;q.isMouseTrigger=mxEvent.isMouseEvent(v);mxEvent.consume(v)});q.addCellOverlay(l,n)});q.getModel().beginUpdate();try{var H=q.insertVertex(A,null,"Start",0,0,80,30,"ellipse");I(H)}finally{q.getModel().endUpdate()}if("horizontalTree"==k){var F=new mxCompactTreeLayout(q);F.edgeRouting=!1;F.levelDistance=30;F.sortEdges=!0;u="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==k?(F=new mxCompactTreeLayout(q,+!1),F.edgeRouting=!1,F.levelDistance=30,F.sortEdges=!0,u="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==k?(F=new mxRadialTreeLayout(q,!1),F.edgeRouting=!1,F.levelDistance=80):"verticalFlow"==k?F=new mxHierarchicalLayout(q,mxConstants.DIRECTION_NORTH):"horizontalFlow"==k?F=new mxHierarchicalLayout(q,mxConstants.DIRECTION_WEST):"circle"==k?F=new mxCircleLayout(q):(F=new mxFastOrganicLayout(q,!1),F.forceConstant=80);if(null!=F){var D=function(l,n){q.getModel().beginUpdate();try{null!=l&&l(),+F.execute(q.getDefaultParent(),H)}catch(v){throw v;}finally{l=new mxMorphing(q),l.addListener(mxEvent.DONE,mxUtils.bind(this,function(){q.getModel().endUpdate();null!=n&&n()})),l.startAnimation()}},c=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(l,n,v,x,B){c.apply(this,arguments);D()};q.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);D()};q.connectionHandler.addListener(mxEvent.CONNECT,function(){D()})}p=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});p.className="geBtn";b.editor.cancelFirst&&d.appendChild(p);var g=mxUtils.button(mxResources.get("insert"),function(l){q.clearCellOverlays();var n=q.getModel().getChildren(q.getDefaultParent());l=mxEvent.isAltDown(l)?b.editor.graph.getFreeInsertPoint():b.editor.graph.getCenterInsertPoint(q.getBoundingBoxFromGeometry(n,!0));n=b.editor.graph.importCells(n,l.x,l.y);l=b.editor.graph.view;var v=l.getBounds(n);null!=v&&(v.x-=l.translate.x,v.y-=l.translate.y,b.editor.graph.scrollRectToVisible(v),b.editor.graph.setSelectionCells(n));b.hideDialog()});d.appendChild(g);g.className="geBtn gePrimaryBtn";b.editor.cancelFirst||d.appendChild(p);this.graph=q};this.container=d};CreateGraphDialog.prototype.connectImage=new mxImage("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==",26,26);-var BackgroundImageDialog=function(b,f,k,d,p){function q(){null==z||z==mxConstants.NONE?(t.style.display="none",S.checked=!1):(t.style.backgroundColor=z,t.style.display="",S.checked=!0)}var u=b.editor.graph,A=document.createElement("div");A.style.whiteSpace="nowrap";var J=document.createElement("h2");mxUtils.write(J,mxResources.get("background"));J.style.marginTop="0px";A.appendChild(J);var I=null!=k&&null!=k.originalSrc;J=!1;var G=document.createElement("input");G.style.cssText="margin-right:8px;margin-bottom:8px;";G.setAttribute("value",-"url");G.setAttribute("type","radio");G.setAttribute("name","geBackgroundImageDialogOption");var E=document.createElement("input");E.style.cssText="margin-right:8px;margin-bottom:8px;";E.setAttribute("value","url");E.setAttribute("type","radio");E.setAttribute("name","geBackgroundImageDialogOption");var c=document.createElement("input");c.setAttribute("type","text");c.style.marginBottom="8px";c.style.width="360px";c.value=I||null==k?"":k.src;var g=document.createElement("select");g.style.width="360px";-if(null!=b.pages)for(var l=0;l<b.pages.length;l++){var n=document.createElement("option");mxUtils.write(n,b.pages[l].getName()||mxResources.get("pageWithNumber",[l+1]));n.setAttribute("value","data:page/id,"+b.pages[l].getId());b.pages[l]==b.currentPage&&n.setAttribute("disabled","disabled");null!=k&&k.originalSrc==n.getAttribute("value")&&(n.setAttribute("selected","selected"),J=!0);g.appendChild(n)}I||null!=b.pages&&1!=b.pages.length||(G.style.display="none",E.style.display="none",g.style.display=-"none");var v=document.createElement("option"),x=!1,B=!1,C=function(K,M){x||null!=K&&B||(E.checked?null!=M&&M(v.selected?null:g.value):""==c.value||b.isOffline()?(D.value="",U.value="",null!=M&&M("")):(c.value=mxUtils.trim(c.value),b.loadImage(c.value,function(m){D.value=m.width;U.value=m.height;null!=M&&M(c.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));D.value="";U.value="";null!=M&&M(null)})))},H=mxUtils.bind(this,function(K){b.importFiles(K,-0,0,b.maxBackgroundSize,function(M,m,y,F,N,O){c.value=M;C();c.focus()},function(){},function(M){return"image/"==M.type.substring(0,6)},function(M){for(var m=0;m<M.length;m++)M[m]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){I?g.focus():c.focus();mxEvent.addListener(g,"focus",function(){G.removeAttribute("checked");E.setAttribute("checked","checked");E.checked=!0});mxEvent.addListener(c,"focus",function(){E.removeAttribute("checked");G.setAttribute("checked","checked");-G.checked=!0});if(Graph.fileSupport){c.setAttribute("placeholder",mxResources.get("dragImagesHere"));var K=A.parentNode,M=null;mxEvent.addListener(K,"dragleave",function(m){null!=M&&(M.parentNode.removeChild(M),M=null);m.stopPropagation();m.preventDefault()});mxEvent.addListener(K,"dragover",mxUtils.bind(this,function(m){null==M&&(M=b.highlightElement(K));m.stopPropagation();m.preventDefault()}));mxEvent.addListener(K,"drop",mxUtils.bind(this,function(m){null!=M&&(M.parentNode.removeChild(M),M=null);-if(0<m.dataTransfer.files.length)H(m.dataTransfer.files);else if(0<=mxUtils.indexOf(m.dataTransfer.types,"text/uri-list")){var y=m.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(y)&&(c.value=decodeURIComponent(y),C())}m.stopPropagation();m.preventDefault()}),!1)}};A.appendChild(G);A.appendChild(c);mxUtils.br(A);l=document.createElement("span");l.style.marginLeft="30px";mxUtils.write(l,mxResources.get("width")+":");A.appendChild(l);var D=document.createElement("input");-D.setAttribute("type","text");D.style.width="60px";D.style.marginLeft="8px";D.style.marginRight="16px";D.value=null==k||I?"":k.width;A.appendChild(D);mxUtils.write(A,mxResources.get("height")+":");var U=document.createElement("input");U.setAttribute("type","text");U.style.width="60px";U.style.marginLeft="8px";U.style.marginRight="16px";U.value=null==k||I?"":k.height;A.appendChild(U);mxUtils.br(A);mxUtils.br(A);mxEvent.addListener(c,"change",C);ImageDialog.filePicked=function(K){K.action==google.picker.Action.PICKED&&-null!=K.docs[0].thumbnails&&(K=K.docs[0].thumbnails[K.docs[0].thumbnails.length-1],null!=K&&(c.value=K.url,C()));c.focus()};A.appendChild(E);A.appendChild(g);mxUtils.br(A);mxUtils.br(A);I?(E.setAttribute("checked","checked"),E.checked=!0):(G.setAttribute("checked","checked"),G.checked=!0);!J&&E.checked&&(mxUtils.write(v,mxResources.get("pageNotFound")),v.setAttribute("disabled","disabled"),v.setAttribute("selected","selected"),v.setAttribute("value","pageNotFound"),g.appendChild(v),mxEvent.addListener(g,-"change",function(){null==v.parentNode||v.selected||v.parentNode.removeChild(v)}));k=document.createElement("div");k.style.display=p?"inline-flex":"none";k.style.alignItems="center";k.style.cursor="default";k.style.minWidth="40%";k.style.height="20px";var S=document.createElement("input");S.setAttribute("type","checkbox");S.style.margin="0px 10px 0px 4px";S.style.verticalAlign="bottom";S.defaultChecked=d!=mxConstants.NONE&&null!=d;S.checked=S.defaultChecked;k.appendChild(S);mxUtils.write(k,mxResources.get("fillColor"));+var BackgroundImageDialog=function(b,f,k,d,p){function q(){null==z||z==mxConstants.NONE?(t.style.display="none",T.checked=!1):(t.style.backgroundColor=z,t.style.display="",T.checked=!0)}var u=b.editor.graph,A=document.createElement("div");A.style.whiteSpace="nowrap";var I=document.createElement("h2");mxUtils.write(I,mxResources.get("background"));I.style.marginTop="0px";A.appendChild(I);var H=null!=k&&null!=k.originalSrc;I=!1;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","geBackgroundImageDialogOption");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 c=document.createElement("input");c.setAttribute("type","text");c.style.marginBottom="8px";c.style.width="360px";c.value=H||null==k?"":k.src;var g=document.createElement("select");g.style.width="360px";+if(null!=b.pages)for(var l=0;l<b.pages.length;l++){var n=document.createElement("option");mxUtils.write(n,b.pages[l].getName()||mxResources.get("pageWithNumber",[l+1]));n.setAttribute("value","data:page/id,"+b.pages[l].getId());b.pages[l]==b.currentPage&&n.setAttribute("disabled","disabled");null!=k&&k.originalSrc==n.getAttribute("value")&&(n.setAttribute("selected","selected"),I=!0);g.appendChild(n)}H||null!=b.pages&&1!=b.pages.length||(F.style.display="none",D.style.display="none",g.style.display=+"none");var v=document.createElement("option"),x=!1,B=!1,C=function(K,M){x||null!=K&&B||(D.checked?null!=M&&M(v.selected?null:g.value):""==c.value||b.isOffline()?(N.value="",J.value="",null!=M&&M("")):(c.value=mxUtils.trim(c.value),b.loadImage(c.value,function(m){N.value=m.width;J.value=m.height;null!=M&&M(c.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));N.value="";J.value="";null!=M&&M(null)})))},G=mxUtils.bind(this,function(K){b.importFiles(K,+0,0,b.maxBackgroundSize,function(M,m,y,E,P,O){c.value=M;C();c.focus()},function(){},function(M){return"image/"==M.type.substring(0,6)},function(M){for(var m=0;m<M.length;m++)M[m]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){H?g.focus():c.focus();mxEvent.addListener(g,"focus",function(){F.removeAttribute("checked");D.setAttribute("checked","checked");D.checked=!0});mxEvent.addListener(c,"focus",function(){D.removeAttribute("checked");F.setAttribute("checked","checked");+F.checked=!0});if(Graph.fileSupport){c.setAttribute("placeholder",mxResources.get("dragImagesHere"));var K=A.parentNode,M=null;mxEvent.addListener(K,"dragleave",function(m){null!=M&&(M.parentNode.removeChild(M),M=null);m.stopPropagation();m.preventDefault()});mxEvent.addListener(K,"dragover",mxUtils.bind(this,function(m){null==M&&(M=b.highlightElement(K));m.stopPropagation();m.preventDefault()}));mxEvent.addListener(K,"drop",mxUtils.bind(this,function(m){null!=M&&(M.parentNode.removeChild(M),M=null);+if(0<m.dataTransfer.files.length)G(m.dataTransfer.files);else if(0<=mxUtils.indexOf(m.dataTransfer.types,"text/uri-list")){var y=m.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(y)&&(c.value=decodeURIComponent(y),C())}m.stopPropagation();m.preventDefault()}),!1)}};A.appendChild(F);A.appendChild(c);mxUtils.br(A);l=document.createElement("span");l.style.marginLeft="30px";mxUtils.write(l,mxResources.get("width")+":");A.appendChild(l);var N=document.createElement("input");+N.setAttribute("type","text");N.style.width="60px";N.style.marginLeft="8px";N.style.marginRight="16px";N.value=null==k||H?"":k.width;A.appendChild(N);mxUtils.write(A,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==k||H?"":k.height;A.appendChild(J);mxUtils.br(A);mxUtils.br(A);mxEvent.addListener(c,"change",C);ImageDialog.filePicked=function(K){K.action==google.picker.Action.PICKED&&+null!=K.docs[0].thumbnails&&(K=K.docs[0].thumbnails[K.docs[0].thumbnails.length-1],null!=K&&(c.value=K.url,C()));c.focus()};A.appendChild(D);A.appendChild(g);mxUtils.br(A);mxUtils.br(A);H?(D.setAttribute("checked","checked"),D.checked=!0):(F.setAttribute("checked","checked"),F.checked=!0);!I&&D.checked&&(mxUtils.write(v,mxResources.get("pageNotFound")),v.setAttribute("disabled","disabled"),v.setAttribute("selected","selected"),v.setAttribute("value","pageNotFound"),g.appendChild(v),mxEvent.addListener(g,+"change",function(){null==v.parentNode||v.selected||v.parentNode.removeChild(v)}));k=document.createElement("div");k.style.display=p?"inline-flex":"none";k.style.alignItems="center";k.style.cursor="default";k.style.minWidth="40%";k.style.height="20px";var T=document.createElement("input");T.setAttribute("type","checkbox");T.style.margin="0px 10px 0px 4px";T.style.verticalAlign="bottom";T.defaultChecked=d!=mxConstants.NONE&&null!=d;T.checked=T.defaultChecked;k.appendChild(T);mxUtils.write(k,mxResources.get("fillColor"));p=k.cloneNode(!1);var V=document.createElement("input");V.setAttribute("type","checkbox");V.style.margin="0px 10px 0px 30px";V.style.verticalAlign="bottom";V.defaultChecked=u.shadowVisible;V.checked=V.defaultChecked;p.appendChild(V);mxUtils.write(p,mxResources.get("shadow"));mxClient.IS_SVG&&!mxClient.IS_SF||V.setAttribute("disabled","disabled");mxEvent.addListener(p,"click",function(K){mxEvent.getSource(K)!=V&&(V.checked=!V.checked)});var t=document.createElement("button");t.style.width="36px";t.style.height=-"18px";t.style.cursor="pointer";t.style.marginLeft="10px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";t.style.verticalAlign="bottom";t.className="geColorBtn";var z=d;q();mxEvent.addListener(k,"click",function(K){mxEvent.getSource(K)!=S&&(S.checked=!S.checked);z=S.checked?"#ffffff":null;q()});mxEvent.addListener(t,"click",function(K){b.pickColor(z||"none",function(M){z=M;q()});mxEvent.consume(K)});k.appendChild(t);A.appendChild(k);A.appendChild(p);mxUtils.br(A);-d=document.createElement("div");d.style.marginTop="30px";d.style.textAlign="right";u=mxUtils.button(mxResources.get("cancel"),function(){x=!0;b.hideDialog()});u.className="geBtn";b.editor.cancelFirst&&d.appendChild(u);p=mxUtils.button(mxResources.get("reset"),function(){c.value="";D.value="";U.value="";G.checked=!0;z=mxConstants.NONE;q();x=!1});mxEvent.addGestureListeners(p,function(){x=!0});p.className="geBtn";p.width="100";d.appendChild(p);if(Graph.fileSupport){var L=document.createElement("input");-L.setAttribute("multiple","multiple");L.setAttribute("type","file");mxEvent.addListener(L,"change",function(K){null!=L.files&&(H(L.files),L.type="",L.type="file",L.value="")});L.style.display="none";A.appendChild(L);p=mxUtils.button(mxResources.get("open"),function(){L.click()});p.className="geBtn";d.appendChild(p)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();C(null,function(K){f(""!=K&&null!=K?new mxImage(K,D.value,U.value):null,null==K,z,!mxClient.IS_SVG||mxClient.IS_SF?-null:V.checked)})});mxEvent.addGestureListeners(applyBtn,function(){B=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(u);A.appendChild(d);this.container=A},ParseDialog=function(b,f,k){function d(g,l,n){if("plantUmlPng"==l||"plantUmlSvg"==l||"plantUmlTxt"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var v=function(M,m,y,F,N){var O=null;x.getModel().beginUpdate();try{O="txt"==m?b.insertAsPreText(y,q.x,q.y):x.insertVertex(null,-null,null,q.x,q.y,F,N,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(y)+";"),x.setAttributeForCell(O,"plantUmlData",JSON.stringify({data:M,format:m},null,2))}finally{x.getModel().endUpdate()}null!=O&&(x.setSelectionCell(O),x.scrollCellToVisible(O))},x=b.editor.graph,B="plantUmlTxt"==l?"txt":"plantUmlPng"==l?"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"==+"18px";t.style.cursor="pointer";t.style.marginLeft="10px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";t.style.verticalAlign="bottom";t.className="geColorBtn";var z=d;q();mxEvent.addListener(k,"click",function(K){mxEvent.getSource(K)!=T&&(T.checked=!T.checked);z=T.checked?"#ffffff":null;q()});mxEvent.addListener(t,"click",function(K){b.pickColor(z||"none",function(M){z=M;q()});mxEvent.consume(K)});k.appendChild(t);A.appendChild(k);A.appendChild(p);mxUtils.br(A);+d=document.createElement("div");d.style.marginTop="30px";d.style.textAlign="right";u=mxUtils.button(mxResources.get("cancel"),function(){x=!0;b.hideDialog()});u.className="geBtn";b.editor.cancelFirst&&d.appendChild(u);p=mxUtils.button(mxResources.get("reset"),function(){c.value="";N.value="";J.value="";F.checked=!0;z=mxConstants.NONE;q();x=!1});mxEvent.addGestureListeners(p,function(){x=!0});p.className="geBtn";p.width="100";d.appendChild(p);if(Graph.fileSupport){var L=document.createElement("input");+L.setAttribute("multiple","multiple");L.setAttribute("type","file");mxEvent.addListener(L,"change",function(K){null!=L.files&&(G(L.files),L.type="",L.type="file",L.value="")});L.style.display="none";A.appendChild(L);p=mxUtils.button(mxResources.get("open"),function(){L.click()});p.className="geBtn";d.appendChild(p)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();C(null,function(K){f(""!=K&&null!=K?new mxImage(K,N.value,J.value):null,null==K,z,!mxClient.IS_SVG||mxClient.IS_SF?+null:V.checked)})});mxEvent.addGestureListeners(applyBtn,function(){B=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(u);A.appendChild(d);this.container=A},ParseDialog=function(b,f,k){function d(g,l,n){if("plantUmlPng"==l||"plantUmlSvg"==l||"plantUmlTxt"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var v=function(M,m,y,E,P){var O=null;x.getModel().beginUpdate();try{O="txt"==m?b.insertAsPreText(y,q.x,q.y):x.insertVertex(null,+null,null,q.x,q.y,E,P,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(y)+";"),x.setAttributeForCell(O,"plantUmlData",JSON.stringify({data:M,format:m},null,2))}finally{x.getModel().endUpdate()}null!=O&&(x.setSelectionCell(O),x.scrollCellToVisible(O))},x=b.editor.graph,B="plantUmlTxt"==l?"txt":"plantUmlPng"==l?"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"==g&&"svg"==B?window.setTimeout(function(){b.spinner.stop();v(g,B,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",295,212)},200):b.generatePlantUmlImage(g,B,function(M,m,y){b.spinner.stop();v(g,B,M,m,y)},function(M){b.handleError(M)})}}else if("mermaid"==l||"mermaid2drawio"==l)b.spinner.spin(document.body,mxResources.get("inserting"))&&b.parseMermaidDiagram(g,null,mxUtils.bind(this,function(M){b.spinner.stop();var m=b.editor.graph;m.setSelectionCells(b.importXml(M,Math.max(q.x,20),Math.max(q.y,20),!0,null,null,!0));m.scrollCellToVisible(m.getSelectionCell())}),mxUtils.bind(this,function(M){b.handleError(M)}),-null,"mermaid2drawio"==l);else if("table"==l){var C=g.split("\n");l=null;var H=[],D=0,U={};for(n=0;n<C.length;n++){var S=mxUtils.trim(C[n]);if("primary key"==S.substring(0,11).toLowerCase()){var V=S.match(/\((.+)\)/);V&&V[1]&&(U[V[1]]=!0);C.splice(n,1)}else 0<S.toLowerCase().indexOf("primary key")&&(U[S.split(" ")[0]]=!0,C[n]=mxUtils.trim(S.replace(/primary key/i,"")))}for(n=0;n<C.length;n++)if(S=mxUtils.trim(C[n]),"create table"==S.substring(0,12).toLowerCase())S=mxUtils.trim(S.substring(12)),"("==-S.charAt(S.length-1)&&(S=mxUtils.trim(S.substring(0,S.length-1))),l=new mxCell(S,new mxGeometry(D,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),l.vertex=!0,H.push(l),S=b.editor.graph.getPreferredSizeForCell(t),null!=S&&(l.geometry.width=S.width+10);else if(null!=l&&")"==S.charAt(0))D+=l.geometry.width+40,l=null;else if("("!=S&&null!=l){S=S.substring(0,","==S.charAt(S.length-1)?S.length-1:S.length);-V=U[S.split(" ")[0]];var t=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="+(V?"1":"0")+";");t.vertex=!0;var z=new mxCell(V?"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;"+(V?"fontStyle=1;":-""));z.vertex=!0;t.insert(z);S=new mxCell(S,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;"+(V?"fontStyle=5;":""));S.vertex=!0;t.insert(S);S=b.editor.graph.getPreferredSizeForCell(S);null!=S&&l.geometry.width<S.width+30&&(l.geometry.width=Math.min(320,Math.max(l.geometry.width,S.width+30)));l.insert(t,V?0:null);l.geometry.height+=30}0<H.length&&(x=b.editor.graph,x.setSelectionCells(x.importCells(H,-q.x,q.y)),x.scrollCellToVisible(x.getSelectionCell()))}else if("list"==l){if(C=g.split("\n"),0<C.length){x=b.editor.graph;t=null;H=[];for(n=l=0;n<C.length;n++)";"!=C[n].charAt(0)&&(0==C[n].length?t=null:null==t?(t=new mxCell(C[n],new mxGeometry(l,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),t.vertex=!0,H.push(t),S=x.getPreferredSizeForCell(t),null!=S&&t.geometry.width<-S.width+10&&(t.geometry.width=S.width+10),l+=t.geometry.width+40):"--"==C[n]?(S=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;"),S.vertex=!0,t.geometry.height+=S.geometry.height,t.insert(S)):0<C[n].length&&(D=new mxCell(C[n],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;"),-D.vertex=!0,S=x.getPreferredSizeForCell(D),null!=S&&D.geometry.width<S.width&&(D.geometry.width=S.width),t.geometry.width=Math.max(t.geometry.width,D.geometry.width),t.geometry.height+=D.geometry.height,t.insert(D)));if(0<H.length){x.getModel().beginUpdate();try{H=x.importCells(H,q.x,q.y);S=[];for(n=0;n<H.length;n++)S.push(H[n]),S=S.concat(H[n].children);x.fireEvent(new mxEventObject("cellsInserted","cells",S))}finally{x.getModel().endUpdate()}x.setSelectionCells(H);x.scrollCellToVisible(x.getSelectionCell())}}}else{t=-function(M){var m=L[M];null==m&&(m=new mxCell(M,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),m.vertex=!0,L[M]=m,H.push(m));return m};C=g.split("\n");var L={};H=[];for(n=0;n<C.length;n++)if(";"!=C[n].charAt(0)){var K=C[n].split("->");2<=K.length&&(V=t(K[0]),z=t(K[K.length-1]),K=new mxCell(2<K.length?K[1]:"",new mxGeometry),K.edge=!0,K.geometry.relative=!0,V.insertEdge(K,!0),z.insertEdge(K,!1),H.push(K))}if(0<H.length){C=document.createElement("div");C.style.visibility="hidden";document.body.appendChild(C);-x=new Graph(C);x.getModel().beginUpdate();try{H=x.importCells(H);for(n=0;n<H.length;n++)x.getModel().isVertex(H[n])&&(S=x.getPreferredSizeForCell(H[n]),H[n].geometry.width=Math.max(H[n].geometry.width,S.width),H[n].geometry.height=Math.max(H[n].geometry.height,S.height));n=!0;"horizontalFlow"==l||"verticalFlow"==l?((new mxHierarchicalLayout(x,"horizontalFlow"==l?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(x.getDefaultParent(),H),n=!1):"circle"==l?(new mxCircleLayout(x)).execute(x.getDefaultParent()):-(D=new mxFastOrganicLayout(x),D.disableEdgeStyle=!1,D.forceConstant=180,D.execute(x.getDefaultParent()));n&&(U=new mxParallelEdgeLayout(x),U.spacing=30,U.execute(x.getDefaultParent()))}finally{x.getModel().endUpdate()}x.clearCellOverlays();S=[];b.editor.graph.getModel().beginUpdate();try{H=x.getModel().getChildren(x.getDefaultParent()),S=b.editor.graph.importCells(H,q.x,q.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",S))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(S);+null,"mermaid2drawio"==l);else if("table"==l){var C=g.split("\n");l=null;var G=[],N=0,J={};for(n=0;n<C.length;n++){var T=mxUtils.trim(C[n]);if("primary key"==T.substring(0,11).toLowerCase()){var V=T.match(/\((.+)\)/);V&&V[1]&&(J[V[1]]=!0);C.splice(n,1)}else 0<T.toLowerCase().indexOf("primary key")&&(J[T.split(" ")[0]]=!0,C[n]=mxUtils.trim(T.replace(/primary key/i,"")))}for(n=0;n<C.length;n++)if(T=mxUtils.trim(C[n]),"create table"==T.substring(0,12).toLowerCase())T=mxUtils.trim(T.substring(12)),"("==+T.charAt(T.length-1)&&(T=mxUtils.trim(T.substring(0,T.length-1))),l=new mxCell(T,new mxGeometry(N,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),l.vertex=!0,G.push(l),T=b.editor.graph.getPreferredSizeForCell(t),null!=T&&(l.geometry.width=T.width+10);else if(null!=l&&")"==T.charAt(0))N+=l.geometry.width+40,l=null;else if("("!=T&&null!=l){T=T.substring(0,","==T.charAt(T.length-1)?T.length-1:T.length);+V=J[T.split(" ")[0]];var t=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="+(V?"1":"0")+";");t.vertex=!0;var z=new mxCell(V?"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;"+(V?"fontStyle=1;":+""));z.vertex=!0;t.insert(z);T=new mxCell(T,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;"+(V?"fontStyle=5;":""));T.vertex=!0;t.insert(T);T=b.editor.graph.getPreferredSizeForCell(T);null!=T&&l.geometry.width<T.width+30&&(l.geometry.width=Math.min(320,Math.max(l.geometry.width,T.width+30)));l.insert(t,V?0:null);l.geometry.height+=30}0<G.length&&(x=b.editor.graph,x.setSelectionCells(x.importCells(G,+q.x,q.y)),x.scrollCellToVisible(x.getSelectionCell()))}else if("list"==l){if(C=g.split("\n"),0<C.length){x=b.editor.graph;t=null;G=[];for(n=l=0;n<C.length;n++)";"!=C[n].charAt(0)&&(0==C[n].length?t=null:null==t?(t=new mxCell(C[n],new mxGeometry(l,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),t.vertex=!0,G.push(t),T=x.getPreferredSizeForCell(t),null!=T&&t.geometry.width<+T.width+10&&(t.geometry.width=T.width+10),l+=t.geometry.width+40):"--"==C[n]?(T=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;"),T.vertex=!0,t.geometry.height+=T.geometry.height,t.insert(T)):0<C[n].length&&(N=new mxCell(C[n],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;"),+N.vertex=!0,T=x.getPreferredSizeForCell(N),null!=T&&N.geometry.width<T.width&&(N.geometry.width=T.width),t.geometry.width=Math.max(t.geometry.width,N.geometry.width),t.geometry.height+=N.geometry.height,t.insert(N)));if(0<G.length){x.getModel().beginUpdate();try{G=x.importCells(G,q.x,q.y);T=[];for(n=0;n<G.length;n++)T.push(G[n]),T=T.concat(G[n].children);x.fireEvent(new mxEventObject("cellsInserted","cells",T))}finally{x.getModel().endUpdate()}x.setSelectionCells(G);x.scrollCellToVisible(x.getSelectionCell())}}}else{t=+function(M){var m=L[M];null==m&&(m=new mxCell(M,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),m.vertex=!0,L[M]=m,G.push(m));return m};C=g.split("\n");var L={};G=[];for(n=0;n<C.length;n++)if(";"!=C[n].charAt(0)){var K=C[n].split("->");2<=K.length&&(V=t(K[0]),z=t(K[K.length-1]),K=new mxCell(2<K.length?K[1]:"",new mxGeometry),K.edge=!0,K.geometry.relative=!0,V.insertEdge(K,!0),z.insertEdge(K,!1),G.push(K))}if(0<G.length){C=document.createElement("div");C.style.visibility="hidden";document.body.appendChild(C);+x=new Graph(C);x.getModel().beginUpdate();try{G=x.importCells(G);for(n=0;n<G.length;n++)x.getModel().isVertex(G[n])&&(T=x.getPreferredSizeForCell(G[n]),G[n].geometry.width=Math.max(G[n].geometry.width,T.width),G[n].geometry.height=Math.max(G[n].geometry.height,T.height));n=!0;"horizontalFlow"==l||"verticalFlow"==l?((new mxHierarchicalLayout(x,"horizontalFlow"==l?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(x.getDefaultParent(),G),n=!1):"circle"==l?(new mxCircleLayout(x)).execute(x.getDefaultParent()):+(N=new mxFastOrganicLayout(x),N.disableEdgeStyle=!1,N.forceConstant=180,N.execute(x.getDefaultParent()));n&&(J=new mxParallelEdgeLayout(x),J.spacing=30,J.execute(x.getDefaultParent()))}finally{x.getModel().endUpdate()}x.clearCellOverlays();T=[];b.editor.graph.getModel().beginUpdate();try{G=x.getModel().getChildren(x.getDefaultParent()),T=b.editor.graph.importCells(G,q.x,q.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",T))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(T);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());x.destroy();C.parentNode.removeChild(C)}}}function p(){return"list"==A.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"==A.value||"mermaid2drawio"==A.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==A.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"==A.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"==A.value||"plantUmlTxt"==A.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 q=b.editor.graph.getFreeInsertPoint();f=document.createElement("div");var u=document.createElement("textarea");u.style.position="absolute";u.style.left="30px";u.style.right="30px";u.style.top="30px";u.style.bottom="100px";u.style.resize="none";u.setAttribute("wrap","off");u.setAttribute("spellcheck","false");u.setAttribute("autocorrect","off");u.setAttribute("autocomplete","off");u.setAttribute("autocapitalize","off");var A=document.createElement("select");-A.className="geBtn";if("formatSql"==k||"mermaid"==k&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())A.style.display="none";var J=document.createElement("option");J.setAttribute("value","list");mxUtils.write(J,mxResources.get("list"));"plantUml"!=k&&"mermaid"!=k&&A.appendChild(J);null!=k&&"fromText"!=k||J.setAttribute("selected","selected");J=document.createElement("option");J.setAttribute("value","table");mxUtils.write(J,mxResources.get("formatSql"));"formatSql"==k&&(A.appendChild(J),-J.setAttribute("selected","selected"));J=document.createElement("option");J.setAttribute("value","mermaid");mxUtils.write(J,mxResources.get("image"));if("mermaid"==k){if("undefined"!==typeof mxMermaidToDrawio){var I=document.createElement("option");I.setAttribute("value","mermaid2drawio");I.setAttribute("selected","selected");mxUtils.write(I,mxResources.get("diagram"));A.appendChild(I)}else A.style.display="none";A.appendChild(J)}J=document.createElement("option");J.setAttribute("value","diagram");-mxUtils.write(J,mxResources.get("diagram"));I=document.createElement("option");I.setAttribute("value","circle");mxUtils.write(I,mxResources.get("circle"));var G=document.createElement("option");G.setAttribute("value","horizontalFlow");mxUtils.write(G,mxResources.get("horizontalFlow"));var E=document.createElement("option");E.setAttribute("value","verticalFlow");mxUtils.write(E,mxResources.get("verticalFlow"));"plantUml"!=k&&"mermaid"!=k&&(A.appendChild(J),A.appendChild(I),A.appendChild(G),A.appendChild(E));-J=document.createElement("option");J.setAttribute("value","plantUmlSvg");mxUtils.write(J,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==k&&J.setAttribute("selected","selected");I=document.createElement("option");I.setAttribute("value","plantUmlPng");mxUtils.write(I,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");G=document.createElement("option");G.setAttribute("value","plantUmlTxt");mxUtils.write(G,mxResources.get("plantUml")+" ("+mxResources.get("text")+-")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==k&&(A.appendChild(J),A.appendChild(I),A.appendChild(G));var c=p();u.value=c;f.appendChild(u);J=document.createElement("div");J.style.position="absolute";J.style.bottom="46px";J.style.right="30px";J.style.left="30px";J.style.justifyContent="end";J.style.display="flex";this.init=function(){u.focus()};Graph.fileSupport&&(u.addEventListener("dragover",function(g){g.stopPropagation();g.preventDefault()},!1),u.addEventListener("drop",-function(g){g.stopPropagation();g.preventDefault();if(0<g.dataTransfer.files.length){g=g.dataTransfer.files[0];var l=new FileReader;l.onload=function(n){u.value=n.target.result};l.readAsText(g)}},!1));"plantUml"==k&&"https://plant-aws.diagrams.net"==window.PLANT_URL&&(I=document.createElement("div"),I.style.display="inline-block",I.style.color="#c00",I.style.fontSize="12px",I.style.marginRight="10px",I.style.display="flex",I.style.alignItems="center",I.innerHTML='<a href="https://github.com/jgraph/plantuml-converter/tree/main/plantuml-to-drawio" target="_blank" rel="noopener noreferrer">PlantUML project changes in 2026</a>',-J.appendChild(I));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=k&&"plantUml"!=k||J.appendChild(b.createHelpIcon("mermaid"==k?"https://mermaid.js.org/intro/":"https://plantuml.com/"));J.appendChild(A);mxEvent.addListener(A,"change",function(){var g=p();if(0==u.value.length||u.value==c)c=g,u.value=c});k=mxUtils.button(mxResources.get("close"),function(){u.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});k.className="geBtn";b.editor.cancelFirst&&J.appendChild(k);-I=mxUtils.button(mxResources.get("insert"),function(g){try{b.hideDialog(),d(u.value,A.value,g)}catch(l){b.handleError(l)}});I.className="geBtn gePrimaryBtn";J.appendChild(I);b.editor.cancelFirst||J.appendChild(k);f.appendChild(J);this.container=f},NewDialog=function(b,f,k,d,p,q,u,A,J,I,G,E,c,g,l,n,v,x,B,C){function H(Aa){null!=Aa&&(Ka=Wa=Aa?135:140);Aa=!0;if(null!=fb)for(;R<fb.length&&(Aa||0!=mxUtils.mod(R,30));){var Ia=fb[R++];Ia=L(Ia.url,Ia.libs,Ia.title,Ia.tooltip?Ia.tooltip:Ia.title,Ia.select,-Ia.imgUrl,Ia.info,Ia.onClick,Ia.preview,Ia.noImg,Ia.clibs,Ia.type);Aa&&Ia.click();Aa=!1}}function D(Aa,Ia,Da,Ja,Ea,Ha){if(null!=Aa&&mxUtils.isAncestorNode(document.body,Ja)){Aa=mxUtils.parseXml(Aa);Aa=Editor.parseDiagramNode(Aa.documentElement,null,!0);var Ma=new mxCodec(Aa.ownerDocument),Oa=new mxGraphModel;Ma.decode(Aa,Oa);b.sidebar.createTooltip(Ja,Oa.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!=Ea?mxResources.get(Ea):null,!0,new mxPoint(Ia,Da),!0,function(){ea=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=Ha&&S(Ja,null,null,Ha,infoObj,clibs)},!0,!1)}}function U(){if(ja==Pa&&null==na&&null!=ib&&null!=db)d&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+db.value+"'")&&(m=!0,b.hideDialog()),ib.click();else if(m&&b.spinner.stop(),sa&&null!=g)k||m||b.hideDialog(),g(sa,Fa,-P.value);else if(d)k||m||b.hideDialog(),d(na,P.value,Ca,ra);else{var Aa=P.value;if(null!=Aa&&0<Aa.length){var Ia=function(Ja,Ea,Ha){b.createFile(Ha,na,null!=ra&&0<ra.length?ra:null,Ja,function(){m||b.hideDialog()},null,Ea,null,null!=aa&&0<aa.length?aa:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var Da=new SaveDialog(b,Aa,mxUtils.bind(this,function(Ja,Ea,Ha){Ia(Ea,Ha,Ja.value)}),null,null,null,null,b.mode);b.showDialog(Da.container,420,150,!0,!1);Da.init()}else b.pickFolder(b.mode,-function(Ja){Ia(b.mode,Ja,Aa)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function S(Aa,Ia,Da,Ja,Ea,Ha,Ma){return ja!=Aa?(null!=ja&&(ja.classList.remove("geTemplateSelected"),ja==Pa&&(Xa.style.display="none",$a.style.display="",Qa.style.visibility="hidden",ab.style.visibility=null!=Ba?"visible":"hidden")),Aa==Pa&&(Ia=Ba,null!=Ia?(ab.style.visibility="visible",ab.style.visibility=null!=Ba?"visible":"hidden",Qa.style.visibility="visible"):(Xa.style.display="",Qa.style.visibility=-"hidden",ab.style.visibility="hidden")),X.removeAttribute("disabled"),na=Ia,ra=Da,aa=Ha,ja=Aa,sa=Ja,Ca=Ma,Fa=Ea,ja.classList.add("geTemplateSelected"),!0):!1}function V(){Xa.style.display="";$a.style.display="none";Qa.style.visibility="hidden";ab.style.visibility="hidden";db.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?db.select():document.execCommand("selectAll",!1,null)}function t(){$a.style.backgroundImage=ob;$a.style.backgroundSize="contain";Xa.style.display="none";$a.style.display=-"";Qa.style.visibility="visible";ab.style.visibility="visible"}function z(Aa){if(!Na){Na=!0;var Ia=mxUtils.trim(db.value);Aa||""==Ia?null!=da&&(db.value=da,t()):($a.style.backgroundImage="url("+Editor.spinImage+")",$a.style.backgroundSize="12px 12px",$a.style.display="",Xa.style.display="none",b.generateOpenAiMermaidDiagram(Ia,function(Da){Na=!1;ja==Pa&&"none"==Xa.style.display&&(ob="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(Da)))+")",Pa.setAttribute("title",Ia),ab.style.display=-"",Ba=na=Da,da=Ia,t(),m&&U())},mxUtils.bind(this,function(Da){Na=!1;ja==Pa&&(Xa.style.display="",$a.style.display="none",Qa.style.visibility="hidden",ab.style.visibility="hidden",b.handleError(Da))}),!0))}}function L(Aa,Ia,Da,Ja,Ea,Ha,Ma,Oa,Va,hb,bb,mb){function Ta(Ya,pb){null==sb?(nb=Ya,nb=/^https?:\/\//.test(nb)?b.editor.isCorsEnabledForUrl(nb)?nb:PROXY_URL+"?url="+encodeURIComponent(nb):TEMPLATE_PATH+"/"+nb,mxUtils.get(nb,mxUtils.bind(this,function(qb){200<=qb.getStatus()&&299>=qb.getStatus()&&-(sb=qb.getText());pb(sb,nb)}))):pb(sb,nb)}function gb(Ya,pb){if(null==Aa||Z||b.sidebar.currentElt==La)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=ba){var qb="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+ba.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+ba.naturalWidth+'" height="'+ba.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";-D(qb,mxEvent.getClientX(Ya),mxEvent.getClientY(Ya),Da,Aa)}else b.sidebar.currentElt=La,Z=!0,Ta(Aa,function(Cb){if(Z&&b.sidebar.currentElt==La)try{D(Cb,mxEvent.getClientX(Ya),mxEvent.getClientY(Ya),La,pb)}catch(Db){b.sidebar.currentElt=null,b.handleError(Db)}Z=!1})}var La=null;if("generative"!=mb||null==Pa){La=document.createElement("div");La.className="geTemplate";var sb=null,nb=Aa;null!=Da?La.setAttribute("title",mxResources.get(Da,null,Da)):null!=Ja&&0<Ja.length&&La.setAttribute("title",Ja)}else La=-Pa;var tb=document.createElement("span");tb.className="geAdaptiveAsset";mxUtils.write(tb,mxResources.get(Da,null,Da));if(null!=Ha){La.style.display="inline-flex";La.style.justifyContent="center";La.style.alignItems="center";Va=document.createElement("img");Va.setAttribute("src",Ha);Va.setAttribute("alt",Ja);Va.style.maxWidth=Ka+"px";Va.style.maxHeight=Wa+"px";ba=Va;var xb=Ha.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");La.appendChild(Va);Va.onerror=function(){this.src!=xb?this.src=-xb:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(La,mxUtils.bind(this,function(Ya){S(La,null,null,Aa,Ma,bb)}),null,null);mxEvent.addListener(La,"dblclick",function(Ya){U();mxEvent.consume(Ya)})}else if(!hb&&null!=Aa&&0<Aa.length){var yb=function(Ya){W.spin(ca)&&Ta(Aa,function(pb,qb){W.stop();null!=pb&&(S(La,pb,Ia,null,null,bb,qb),Ya&&U())})};Ha=Va||TEMPLATE_PATH+"/"+Aa.substring(0,Aa.length-4)+".png";Va=$a.cloneNode(!1);Va.style.backgroundImage="url("+Ha+")";Va.style.display=-"";La.appendChild(Va);null!=Da&&La.appendChild(tb);mxEvent.addGestureListeners(La,mxUtils.bind(this,function(Ya){yb()}),null,null);mxEvent.addListener(La,"dblclick",function(Ya){yb(!0);mxEvent.consume(Ya)})}else La.appendChild(tb),"generative"==mb&&null==Pa&&(La.appendChild($a),La.appendChild(Xa),La.appendChild(ab),La.appendChild(Qa),Pa=La),Ea&&S(La),null!=Oa?(mxEvent.addGestureListeners(La,null,null,mxUtils.bind(this,function(Ya){S(La,null,null,Aa,Ma)})),mxEvent.addListener(La,"click",Oa)):(mxEvent.addListener(La,-"click",function(Ya){S(La,null,null,Aa,Ma)&&"generative"==mb&&null==Ba&&V()}),mxEvent.addListener(La,"dblclick",function(Ya){"generative"!=mb?U():"none"==Xa.style.display&&V();mxEvent.consume(Ya)}));null!=Aa&&(Ha=Y.cloneNode(!0),La.appendChild(Ha),mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Ya){ea=b.sidebar.currentElt==La}),null,null),mxEvent.addListener(Ha,"click",mxUtils.bind(this,function(Ya){ea||gb(Ya,null!=Da?Da:Ja);mxEvent.consume(Ya)})));ca.appendChild(La);return La}function K(){function Aa(Ta,-gb){Ta=mxResources.get(Ta,null,Ta.substring(0,1).toUpperCase()+Ta.substring(1));18<Ta.length&&(Ta=Ta.substring(0,18)+"…");return Ta+(null!=gb?" ("+gb.length+")":"")}function Ia(Ta,gb,La){mxEvent.addListener(gb,"click",function(){Sa!=gb&&(null!=Sa&&(Sa.style.backgroundColor=""),Sa=gb,Sa.style.backgroundColor=u,ca.scrollTop=0,ca.innerText="",R=0,null!=Ra[Ta].content?(ca.appendChild(Ra[Ta].content),na=Ba,fb=null,null!=Ra[Ta].content.init&&Ra[Ta].content.init()):(fb=La?kb[Ta][La]:Ra[Ta],fa=null,-H(!1)))})}lb&&(lb=!1,mxEvent.addListener(ca,"scroll",function(Ta){ca.scrollTop+ca.clientHeight>=ca.scrollHeight&&(H(),mxEvent.consume(Ta))}));if(0<Za){var Da=document.createElement("div");Da.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Da,mxResources.get("custom"));Ga.appendChild(Da);for(var Ja in Ua){var Ea=document.createElement("div");Da=Ja;var Ha=Ua[Ja];18<Da.length&&(Da=Da.substring(0,18)+"…");Ea.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";-Ea.setAttribute("title",Da+" ("+Ha.length+")");mxUtils.write(Ea,Ea.getAttribute("title"));null!=I&&(Ea.style.padding=I);Ga.appendChild(Ea);(function(Ta,gb){mxEvent.addListener(Ea,"click",function(){Sa!=gb&&(Sa.style.backgroundColor="",Sa=gb,Sa.style.backgroundColor=u,ca.scrollTop=0,ca.innerText="",R=0,fb=Ua[Ta],fa=null,H(!1))})})(Ja,Ea)}Da=document.createElement("div");Da.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Da,"draw.io");Ga.appendChild(Da)}for(Ja in Ra){Da=-Ha=null;if(null!=Ra[Ja].content)Ea=document.createElement(Ma?"ul":"div"),Da=Aa(Ja),Ea.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;",Ea.setAttribute("title",Da),mxUtils.write(Ea,Da),Ga.appendChild(Ea),Da=Ea;else{var Ma=kb[Ja];Da=Ea=document.createElement(Ma?"ul":"div");Ha=Ra[Ja];var Oa=Aa(Ja,Ha);if(null!=Ma){Ha=document.createElement("li");var Va=document.createElement("div");-Va.className="geTempTreeCaret";Va.setAttribute("title",Oa);mxUtils.write(Va,Oa);Da=Va;Ha.appendChild(Va);Oa=document.createElement("ul");Oa.className="geTempTreeNested";Oa.style.visibility="hidden";for(var hb in Ma){var bb=document.createElement("li"),mb=Aa(hb,Ma[hb]);bb.setAttribute("title",mb);mxUtils.write(bb,mb);Ia(Ja,bb,hb);Oa.appendChild(bb)}Ha.appendChild(Oa);Ea.className="geTempTree";Ea.appendChild(Ha);(function(Ta,gb){mxEvent.addListener(gb,"click",function(){Ta.style.visibility="visible";-Ta.classList.toggle("geTempTreeActive");Ta.classList.toggle("geTempTreeNested")&&setTimeout(function(){Ta.style.visibility="hidden"},550);gb.classList.toggle("geTempTreeCaret-down")})})(Oa,Va)}else Ea.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;",Ea.setAttribute("title",Oa),mxUtils.write(Ea,Oa);null!=I&&(Ea.style.padding=I);Ga.appendChild(Ea)}Ia(Ja,Da);null==Sa&&Da.click()}H(!1)}-var M=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);k=null!=k?k:!0;p=null!=p?p:!1;u=null!=u?u:"light-dark(#ebf2f9, "+Editor.darkColor+")";G=null!=G?G:EditorUi.templateFile;var m=!1,y=document.createElement("div");y.style.userSelect="none";y.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.height="46px";k&&y.appendChild(F);var N=document.createElement("img");N.setAttribute("border","0");N.setAttribute("align","absmiddle");-N.style.width="40px";N.style.height="40px";N.style.marginRight="10px";N.style.paddingBottom="4px";N.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_M365?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||M||!k||F.appendChild(N);k&&mxUtils.write(F,(M?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var O=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?O=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?O=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?O=b.oneDrive.extension:b.mode==-App.MODE_GITHUB&&null!=b.gitHub?O=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?O=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(O=b.trello.extension);var P=document.createElement("input");P.setAttribute("value",b.defaultFilename+O);P.style.marginLeft="10px";P.style.width=f||M?"144px":"244px";this.init=function(){k&&Editor.selectFilename(P);null!=ca.parentNode&&null!=ca.parentNode.parentNode&&mxEvent.addGestureListeners(ca.parentNode.parentNode,mxUtils.bind(this,function(Aa){null!=-b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(k)if(F.appendChild(P),x)P.style.width=f||M?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var T=FilenameDialog.createFileTypes(b,P,b.editor.diagramFileTypes);T.style.marginLeft="6px";T.style.width=f||M?"80px":"180px";F.appendChild(T)}var Q=!1,R=0,W=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}),X=mxUtils.button(n||mxResources.get("create"),-function(){X.setAttribute("disabled","disabled");U();X.removeAttribute("disabled")});X.className="geBtn gePrimaryBtn";var Y=document.createElement("img");Y.setAttribute("src",Editor.magnifyImage);Y.setAttribute("title",mxResources.get("preview"));Y.className="geButton geRoundButton";var Z=!1,ba=null,ea=!1;if(E||c){var ha=[],fa=null,la=null,oa=null,pa=function(Aa){X.setAttribute("disabled","disabled");for(var Ia=0;Ia<ha.length;Ia++)ha[Ia].className=Ia==Aa?"geBtn gePrimaryBtn":"geBtn"};Q=!0;var va=-document.createElement("div");va.style.whiteSpace="nowrap";va.style.height="30px";y.appendChild(va);var ta=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Ga.style.display="";ka.style.display="";ca.style.left="160px";pa(0);ca.scrollTop=0;ca.innerText="";R=0;fa!=fb&&(fb=fa,Ra=la,Za=oa,Ga.innerText="",K(),fa=null)});ha.push(ta);va.appendChild(ta);var ma=function(Aa){Ga.style.display="none";ka.style.display="none";ca.style.left="30px";pa(Aa?-1:1);null==fa&&(fa=fb);ca.scrollTop=-0;ca.innerText="";W.spin(ca);var Ia=function(Da,Ja,Ea){R=0;W.stop();fb=Da;Ea=Ea||{};var Ha=0,Ma;for(Ma in Ea)Ha+=Ea[Ma].length;if(Ja)ca.innerText=Ja;else if(0==Da.length&&0==Ha)ca.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(ca.innerText="",0<Ha){Ga.style.display="";ca.style.left="160px";Ga.innerText="";Za=0;Ra={"draw.io":Da};for(Ma in Ea)Ra[Ma]=Ea[Ma];K()}else H(!0)};Aa?c(ua.value,Ia):E(Ia)};if(E){var ia=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){ma()});-va.appendChild(ia);ha.push(ia)}if(c){var qa=document.createElement("span");qa.style.marginLeft="10px";qa.innerText=mxResources.get("search")+":";va.appendChild(qa);var ua=document.createElement("input");ua.style.marginRight="10px";ua.style.marginLeft="10px";ua.style.width="220px";mxEvent.addListener(ua,"keypress",function(Aa){13==Aa.keyCode&&ma(!0)});va.appendChild(ua);var xa=mxUtils.button(mxResources.get("search"),function(){ma(!0)});xa.className="geBtn";va.appendChild(xa)}pa(0)}var ra=null,aa=-null,na=null,ja=null,sa=null,Ca=null,Fa=null,Ba=null,da=null,ca=document.createElement("div");ca.style.border="1px solid #d3d3d3";ca.style.position="absolute";ca.style.left="160px";ca.style.right="34px";var wa=(k?72:40)+(Q?30:0);ca.style.top=wa+"px";ca.style.bottom="68px";ca.style.margin="6px 0 0 -1px";ca.style.padding="6px";ca.style.overflow="auto";var ka=document.createElement("div");ka.style.cssText="position:absolute;left:30px;width:128px;top:"+wa+"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");ka.appendChild(za);var ya=document.createElement("img");ya.setAttribute("src",Editor.magnifyImage);ya.setAttribute("title",mxResources.get("search"));ya.className="geAdaptiveAsset";ya.style.position="relative";ya.style.cursor="pointer";ya.style.outline=-"none";ya.style.opacity="0.5";ya.style.height="16px";ya.style.left="-20px";ya.style.top="4px";ka.appendChild(ya);mxEvent.addListener(ya,"click",function(){ya.getAttribute("src")!=Editor.magnifyImage&&(ya.setAttribute("src",Editor.magnifyImage),ya.setAttribute("title",mxResources.get("search")),za.value="",null!=eb&&(eb.click(),eb=null));za.focus()});mxEvent.addListener(za,"keydown",mxUtils.bind(this,function(Aa){if(13==Aa.keyCode){var Ia=za.value;if(""==Ia)null!=eb&&(eb.click(),eb=null);else{if(null==-NewDialog.tagsList[G]){var Da={};for(bb in Ra)if(null==Ra[bb].content)for(var Ja=Ra[bb],Ea=0;Ea<Ja.length;Ea++){var Ha=Ja[Ea];if(null!=Ha.tags)for(var Ma=Ha.tags.toLowerCase().split(";"),Oa=0;Oa<Ma.length;Oa++)null==Da[Ma[Oa]]&&(Da[Ma[Oa]]=[]),Da[Ma[Oa]].push(Ha)}NewDialog.tagsList[G]=Da}var Va=Ia.toLowerCase().split(" ");Da=NewDialog.tagsList[G];if(0<Za&&null==Da.__tagsList__){for(bb in Ua)for(Ja=Ua[bb],Ea=0;Ea<Ja.length;Ea++)for(Ha=Ja[Ea],Ma=Ha.title.split(" "),Ma.push(bb),Oa=0;Oa<Ma.length;Oa++){var hb=-Ma[Oa].toLowerCase();null==Da[hb]&&(Da[hb]=[]);Da[hb].push(Ha)}Da.__tagsList__=!0}var bb=[];Ja={};for(Ea=Ma=0;Ea<Va.length;Ea++)if(0<Va[Ea].length){hb=Da[Va[Ea]];var mb={};bb=[];if(null!=hb)for(Oa=0;Oa<hb.length;Oa++)Ha=hb[Oa],0==Ma==(null==Ja[Ha.url])&&(mb[Ha.url]=!0,bb.push(Ha));Ja=mb;Ma++}ca.scrollTop=0;ca.innerText="";R=0;Da=document.createElement("div");Da.style.padding="6px";Da.style.whiteSpace="nowrap";Da.style.overflow="hidden";Da.style.textOverflow="ellipsis";Ha=mxResources.get(0==bb.length?-"noResultsFor":"resultsFor",[Ia]);Da.setAttribute("title",Ha);mxUtils.write(Da,Ha);ca.appendChild(Da);null!=Sa&&null==eb&&(Sa.style.backgroundColor="",eb=Sa,Sa=Da);fb=bb;fa=null;H(!1)}mxEvent.consume(Aa)}}));mxEvent.addListener(za,"keyup",mxUtils.bind(this,function(Aa){""==za.value?(ya.setAttribute("src",Editor.magnifyImage),ya.setAttribute("title",mxResources.get("search"))):(ya.setAttribute("src",Editor.crossImage),ya.setAttribute("title",mxResources.get("reset")))}));wa+=23;var Ga=document.createElement("div");-Ga.style.cssText="position:absolute;left:30px;width:128px;top:"+wa+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(ca,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var Ka=140,Wa=Ka,Pa=null,ob="url("+Editor.thinSparklesImage+")",Xa=document.createElement("div");Xa.className="geGenerateDiagramForm";Xa.style.position="absolute";Xa.style.width="100%";Xa.style.height="100%";var $a=document.createElement("div");$a.className="geTemplatePreview geAdaptiveAsset";-$a.style.backgroundImage=ob;var db=document.createElement("textarea");db.setAttribute("placeholder",mxResources.get("describeYourDiagram"));db.className="geGenerateDiagramDescription";var ib=document.createElement("button");ib.className="geBtn gePrimaryBtn geGenerateDiagramButton";ib.setAttribute("disabled","disabled");ib.setAttribute("title",mxResources.get("ok"));mxUtils.write(ib,mxResources.get("ok"));var ab=Y.cloneNode(!0);ab.style.display="none";var ub=!1;mxEvent.addGestureListeners(ab,function(Aa){ub=-null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Aa){if(!ub&&null!=Ba){var Ia="<mxfile><diagram>"+Graph.compress(Ba)+"</diagram></mxfile>";D(Ia,mxEvent.getClientX(Aa),mxEvent.getClientY(Aa),Pa,da)}});var Qa=Y.cloneNode(!0);Qa.setAttribute("src",Editor.editImage);Qa.setAttribute("title",mxResources.get("edit"));Qa.style.visibility="hidden";Qa.style.left="0px";var cb=Y.cloneNode(!0);cb.setAttribute("src",Editor.helpImage);cb.setAttribute("title",mxResources.get("help"));-mxEvent.addListener(cb,"click",function(Aa){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Aa)});Xa.appendChild(db);Xa.appendChild(ib);Xa.appendChild(cb);Xa.style.display="none";mxEvent.addListener(Qa,"click",V);mxEvent.addListener(db,"input",function(){""!=db.value?ib.removeAttribute("disabled"):ib.setAttribute("disabled","disabled")});var Na=!1;mxEvent.addListener(ib,"click",function(){z()});mxEvent.addListener(db,"keydown",function(Aa){13!=Aa.keyCode||mxEvent.isShiftDown(Aa)?-27==Aa.keyCode&&(z(!0),mxEvent.consume(Aa)):(z(),mxEvent.consume(Aa))});var Ra={},kb={},Ua={},Za=0,lb=!0,Sa=null,eb=null;Ra.basic=C?[]:[{title:"blankDiagram"}];var fb=Ra.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&Ra.basic.push({title:"generate",type:"generative"});if(!f){var vb=function(){mxUtils.get(rb,function(Aa){if(!zb){zb=!0;Aa=Aa.getXml().documentElement.firstChild;for(var Ia={};null!=Aa;){if("undefined"!==-typeof Aa.getAttribute)if("parsererror"==Aa.nodeName)null!=window.console&&console.log("Parser error in "+G+": "+Aa.textContent);else if("clibs"==Aa.nodeName){for(var Da=Aa.getAttribute("name"),Ja=Aa.getElementsByTagName("add"),Ea=[],Ha=0;Ha<Ja.length;Ha++)Ea.push(encodeURIComponent(mxUtils.getTextContent(Ja[Ha])));null!=Da&&0<Ea.length&&(Ia[Da]=Ea.join(";"))}else if(Ea=Aa.getAttribute("url"),null!=Ea){Ja=Aa.getAttribute("section");Da=Aa.getAttribute("subsection");if(null==Ja&&(Ha=Ea.indexOf("/"),-Ja=Ea.substring(0,Ha),null==Da)){var Ma=Ea.indexOf("/",Ha+1);-1<Ma&&(Da=Ea.substring(Ha+1,Ma))}Ha=Ra[Ja];null==Ha&&(Ha=[],Ra[Ja]=Ha);Ea=Aa.getAttribute("clibs");null!=Ia[Ea]&&(Ea=Ia[Ea]);Ea={url:Aa.getAttribute("url"),libs:Aa.getAttribute("libs"),title:Aa.getAttribute("title"),tooltip:Aa.getAttribute("name")||Aa.getAttribute("url"),preview:Aa.getAttribute("preview"),clibs:Ea,tags:Aa.getAttribute("tags")};Ha.push(Ea);null!=Da&&(Ha=kb[Ja],null==Ha&&(Ha={},kb[Ja]=Ha),Ja=Ha[Da],null==Ja&&(Ja=[],Ha[Da]=-Ja),Ja.push(Ea))}Aa=Aa.nextSibling}W.stop();K()}})};y.appendChild(ka);y.appendChild(Ga);y.appendChild(ca);var zb=!1,rb=G;/^https?:\/\//.test(rb)&&!b.editor.isCorsEnabledForUrl(rb)&&(rb=PROXY_URL+"?url="+encodeURIComponent(rb));W.spin(ca);null!=v?v(function(Aa,Ia){Ua=Aa;oa=Za=Ia;vb()},vb):vb();la=Ra}mxEvent.addListener(P,"keypress",function(Aa){b.dialog.container.firstChild==y&&13==Aa.keyCode&&U()});var jb=document.createElement("div");jb.style.marginTop=f?"4px":"16px";jb.style.textAlign="right";jb.style.position=-"absolute";jb.style.left="40px";jb.style.bottom="24px";jb.style.right="40px";var wb=mxUtils.button(mxResources.get("cancel"),function(){null!=q&&q();b.hideDialog(!0)});wb.className="geBtn";!b.editor.cancelFirst||p&&null==q||jb.appendChild(wb);if(!(f||"1"==urlParams.embed||p||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Ab=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Aa=new FilenameDialog(b,"",mxResources.get("create"),function(Ia){null!=Ia&&0<Ia.length&&-b.editor.loadUrl(b.editor.getProxiedUrl(Ia),function(Da){na=Da;ra=null;templateRealURl=Ia;b.hideDialog();U()},function(Da){b.handleError(Da)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Aa.container,300,80,!0,!0);Aa.init()});Ab.className="geBtn";jb.appendChild(Ab)}if(Graph.fileSupport&&l){var Bb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Aa=document.createElement("input");Aa.setAttribute("multiple","multiple");Aa.setAttribute("type","file");-mxEvent.addListener(Aa,"change",function(Ia){b.openFiles(Aa.files,!0);Aa.value=""});Aa.style.display="none";document.body.appendChild(Aa);b.newDlgFileInputElt=Aa}b.newDlgFileInputElt.click()});Bb.className="geBtn";jb.appendChild(Bb)}jb.appendChild(X);b.editor.cancelFirst||null!=d||p&&null==q||jb.appendChild(wb);y.appendChild(jb);this.container=y};NewDialog.tagsList={};-var SaveDialog=function(b,f,k,d,p,q,u,A,J,I,G){function E(m,y,F,N,O,P){var T=null;if((null==d||0>mxUtils.indexOf(d,m))&&(null==J||m==J)&&(null==I||0<=mxUtils.indexOf(I,m))){O=null!=O?O:b.getTitleForService(m);var Q=0<=mxUtils.indexOf(z,m);if(Q||null!=b.getServiceForName(m)){T=document.createElement("option");var R="";!Q&&b.isOffline(m==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(T.setAttribute("disabled","disabled"),R=" ("+mxResources.get("offline")+")");if("pick"==P)T.innerHTML=mxUtils.htmlEntities(O)+-" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+R,T.setAttribute("value","pickFolder-"+m),T.setAttribute("title",O+" - "+mxResources.get("pickFolder")+"...");else{Q=m+(null!=F?"-"+F:"");var W=K[Q];null!=W&&null!=W.option&&W.option.parentNode.removeChild(W.option);W=null;if(null!=y){"/"==y.charAt(y.length-1)&&(y=y.substring(0,y.length-1));"/"==y.charAt(0)&&(y=y.substring(1));W=y;if(m!=App.MODE_GITHUB&&m==App.MODE_GITLAB){var X=W.lastIndexOf("/");0<=X&&(W=-W.substring(X+1))}40<W.length&&(W=W.substring(0,20)+"..."+W.substring(W.length-20))}T.innerHTML=mxUtils.htmlEntities(O)+(null!=W?" – "+mxUtils.htmlEntities(W):"")+R;T.setAttribute("title",O+(null!=y?" ("+y+")":"")+(null!=F&&decodeURIComponent(F)!=y?" ["+F+"]":""));T.setAttribute("value",Q);K[Q]={option:T,mode:m,path:y,id:F};SaveDialog.lastValue==Q&&null==A&&"disabled"==!T.getAttribute("disabled")?N=!0:null==N&&("root"==P?N=null==A&&b.mode==m||null!=m&&m==A:"pickFolder-"==-t.value.substring(0,11)&&(N=!0));N&&T.setAttribute("selected","selected")}t.appendChild(T)}}return T}function c(m){b.pickFolder(m,function(y){var F=null;m==App.MODE_GOOGLE&&null!=y.docs&&0<y.docs.length?F={mode:m,path:y.docs[0].name,id:y.docs[0].id}:m==App.MODE_ONEDRIVE&&null!=y.value&&0<y.value.length?F={mode:m,path:y.value[0].name,id:OneDriveFile.prototype.getIdOf(y.value[0])}:m==App.MODE_M365&&null!=y.value&&0<y.value.length?F={mode:m,path:y.value[0].name,id:OneDriveFile.prototype.getIdOf(y.value[0])}:-(m==App.MODE_GITHUB||m==App.MODE_GITLAB)&&null!=y&&0<y.length&&(F={mode:m,path:decodeURIComponent(y),id:y});null!=F&&(b.addRecent(F,"Folders",5),y=E(F.mode,F.path,F.id,!0),t.innerHTML="",K={},g(),F=t.selectedIndex,t.value=y.value,0>t.selectedIndex&&(t.selectedIndex=F))},!0,!0,!0,!0)}function g(){var m=b.getRecent("Folders"),y=0;if(null!=m&&0<m.length)for(var F=0;F<m.length;F++)null!=E(m[F].mode,m[F].path,m[F].id)&&y++;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.m365&&E(App.MODE_M365,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);m=!Editor.useLocalStorage||"device"==urlParams.storage||null!=-b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&m&&E(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&&E(App.MODE_BROWSER);m&&E("download");Editor.popupsAllowed&&E("_blank",null,null,null,mxResources.get("openInNewWindow"));"pickFolder-"==t.value.substring(0,11)&&(m=document.createElement("option"),m.setAttribute("value",""),m.setAttribute("selected","selected"),mxUtils.write(m,-mxResources.get("pickFolder")+"..."),t.insertBefore(m,t.firstChild));L=t.value}function l(){if("pickFolder-"==t.value.substring(0,11)){var m=t.value.substring(11);t.value=L;c(m)}else if(null!=V&&null!=K[t.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[V.value].extension){m=b.getExtensionForService(K[t.value].mode);var y=S.value;null!=m&&0>f.indexOf(".")&&0>y.indexOf(".")&&(S.value=y+m)}M.innerHTML="";mxUtils.write(M,null!=G?G:mxResources.get("download"==t.value||"_blank"==-t.value||null!=J?"ok":"save"));""==t.value?M.setAttribute("disabled","disabled"):M.removeAttribute("disabled")}var n=document.createElement("div");n.style.display="flex";n.style.flexWrap="wrap";n.style.whiteSpace="nowrap";var v=document.createElement("div");v.style.display="grid";v.style.gap="5px 8px";v.style.gridAutoRows="auto auto 44px";v.style.gridAutoColumns="0fr minmax(0,1fr)";v.style.width="100%";var x=null,B=null;if(null!=p&&null!=q&&"image/"==q.substring(0,6)&&("image/svg"!=q.substring(0,-9)||mxClient.IS_SVG)){v.style.display="inline-grid";v.style.flexBasis="75%";x=document.createElement("div");x.style.display="inline-block";x.style.height="auto";x.style.maxWidth="25%";x.style.margin="auto";var C=document.createElement("img"),H=u?p:btoa(unescape(encodeURIComponent(p))),D="data:"+q+";base64,"+H;C.setAttribute("src",D);C.style.boxSizing="border-box";C.style.maxHeight="50px";C.style.maxWidth="100%";C.style.paddingLeft="10px";x.appendChild(C);"image/png"!=q&&"image/svg+xml"!=q||"function"!==-typeof window.ClipboardItem||null==navigator.clipboard||(B=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(D,null,null,q,mxUtils.bind(this,function(){"copy"==A?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))}),mxUtils.bind(this,function(m){b.handleError(m)}))},null,"geBtn"));Editor.popupsAllowed&&(null==d||0>mxUtils.indexOf(d,"_blank"))?(x.setAttribute("title",mxResources.get("openInNewWindow")),x.style.cursor="pointer",mxEvent.addGestureListeners(x,null,null,-function(m){mxEvent.isPopupTrigger(m)||b.openInNewWindow(p,q,u)})):x.setAttribute("title",mxResources.get("preview"))}H=document.createElement("div");H.style.display="flex";H.style.padding="1px";H.style.alignItems="center";H.style.justifyContent="flex-end";H.style.gridColumn="1";H.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(H,mxResources.get("saveAs")+":");var S=document.createElement("input");S.setAttribute("type","text");S.setAttribute("value",f);S.style.boxSizing="border-box";S.style.width="100%";U.appendChild(S);null==J&&(v.appendChild(H),v.appendChild(U));var V=null;null!=b.editor.diagramFileTypes&&null==q&&null==J&&(H=H.cloneNode(!1),U=U.cloneNode(!1),mxUtils.write(H,mxResources.get("type")+":"),V=FilenameDialog.createFileTypes(b,S,b.editor.diagramFileTypes),V.style.boxSizing="border-box",V.style.width=-"100%",U.appendChild(V),v.appendChild(H),v.appendChild(U));H=H.cloneNode(!1);U=U.cloneNode(!1);mxUtils.write(H,mxResources.get("where")+":");var t=document.createElement("select");t.style.textOverflow="ellipsis";t.style.gridColumn="1";var z=["browser","device","download","_blank"],L=null,K={};C=mxUtils.button(mxResources.get("reset"),function(){S.value=f;S.dispatchEvent(new Event("change"));b.resetRecent("Folders");t.innerHTML="";t.value="";pickFolderOption=null;K={};g()},null,"geBtn");var M=mxUtils.button("",-function(){SaveDialog.lastValue=t.value;var m=K[SaveDialog.lastValue];null!=m&&k(S,m.mode,m.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(S,"keypress",function(m){13==m.keyCode&&("copy"==A&&null!=B?B.click():M.click())});mxEvent.addListener(t,"change",l);g();U.appendChild(t);null!=SaveDialog.lastValue&&null!=K[SaveDialog.lastValue]&&(t.value=SaveDialog.lastValue);l();v.appendChild(H);v.appendChild(U);n.appendChild(v);null!=x&&n.appendChild(x);v=document.createElement("div");v.style.flexBasis=+A.className="geBtn";if("formatSql"==k||"mermaid"==k&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())A.style.display="none";var I=document.createElement("option");I.setAttribute("value","list");mxUtils.write(I,mxResources.get("list"));"plantUml"!=k&&"mermaid"!=k&&A.appendChild(I);null!=k&&"fromText"!=k||I.setAttribute("selected","selected");I=document.createElement("option");I.setAttribute("value","table");mxUtils.write(I,mxResources.get("formatSql"));"formatSql"==k&&(A.appendChild(I),+I.setAttribute("selected","selected"));I=document.createElement("option");I.setAttribute("value","mermaid");mxUtils.write(I,mxResources.get("image"));if("mermaid"==k){if("undefined"!==typeof mxMermaidToDrawio){var H=document.createElement("option");H.setAttribute("value","mermaid2drawio");H.setAttribute("selected","selected");mxUtils.write(H,mxResources.get("diagram"));A.appendChild(H)}else A.style.display="none";A.appendChild(I)}I=document.createElement("option");I.setAttribute("value","diagram");+mxUtils.write(I,mxResources.get("diagram"));H=document.createElement("option");H.setAttribute("value","circle");mxUtils.write(H,mxResources.get("circle"));var F=document.createElement("option");F.setAttribute("value","horizontalFlow");mxUtils.write(F,mxResources.get("horizontalFlow"));var D=document.createElement("option");D.setAttribute("value","verticalFlow");mxUtils.write(D,mxResources.get("verticalFlow"));"plantUml"!=k&&"mermaid"!=k&&(A.appendChild(I),A.appendChild(H),A.appendChild(F),A.appendChild(D));+I=document.createElement("option");I.setAttribute("value","plantUmlSvg");mxUtils.write(I,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==k&&I.setAttribute("selected","selected");H=document.createElement("option");H.setAttribute("value","plantUmlPng");mxUtils.write(H,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");F=document.createElement("option");F.setAttribute("value","plantUmlTxt");mxUtils.write(F,mxResources.get("plantUml")+" ("+mxResources.get("text")++")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==k&&(A.appendChild(I),A.appendChild(H),A.appendChild(F));var c=p();u.value=c;f.appendChild(u);I=document.createElement("div");I.style.position="absolute";I.style.bottom="46px";I.style.right="30px";I.style.left="30px";I.style.justifyContent="end";I.style.display="flex";this.init=function(){u.focus()};Graph.fileSupport&&(u.addEventListener("dragover",function(g){g.stopPropagation();g.preventDefault()},!1),u.addEventListener("drop",+function(g){g.stopPropagation();g.preventDefault();if(0<g.dataTransfer.files.length){g=g.dataTransfer.files[0];var l=new FileReader;l.onload=function(n){u.value=n.target.result};l.readAsText(g)}},!1));"plantUml"==k&&"https://plant-aws.diagrams.net"==window.PLANT_URL&&(H=document.createElement("div"),H.style.display="inline-block",H.style.color="#c00",H.style.fontSize="12px",H.style.marginRight="10px",H.style.display="flex",H.style.alignItems="center",H.innerHTML='<a href="https://github.com/jgraph/plantuml-converter/tree/main/plantuml-to-drawio" target="_blank" rel="noopener noreferrer">PlantUML project changes in 2026</a>',+I.appendChild(H));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=k&&"plantUml"!=k||I.appendChild(b.createHelpIcon("mermaid"==k?"https://mermaid.js.org/intro/":"https://plantuml.com/"));I.appendChild(A);mxEvent.addListener(A,"change",function(){var g=p();if(0==u.value.length||u.value==c)c=g,u.value=c});k=mxUtils.button(mxResources.get("close"),function(){u.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});k.className="geBtn";b.editor.cancelFirst&&I.appendChild(k);+H=mxUtils.button(mxResources.get("insert"),function(g){try{b.hideDialog(),d(u.value,A.value,g)}catch(l){b.handleError(l)}});H.className="geBtn gePrimaryBtn";I.appendChild(H);b.editor.cancelFirst||I.appendChild(k);f.appendChild(I);this.container=f},NewDialog=function(b,f,k,d,p,q,u,A,I,H,F,D,c,g,l,n,v,x,B,C){function G(Ca){null!=Ca&&(Ka=Wa=Ca?135:140);Ca=!0;if(null!=fb)for(;S<fb.length&&(Ca||0!=mxUtils.mod(S,30));){var Ia=fb[S++];Ia=L(Ia.url,Ia.libs,Ia.title,Ia.tooltip?Ia.tooltip:Ia.title,Ia.select,+Ia.imgUrl,Ia.info,Ia.onClick,Ia.preview,Ia.noImg,Ia.clibs,Ia.type);Ca&&Ia.click();Ca=!1}}function N(Ca,Ia,Ea,Ja,Fa,Ha){if(null!=Ca&&mxUtils.isAncestorNode(document.body,Ja)){Ca=mxUtils.parseXml(Ca);Ca=Editor.parseDiagramNode(Ca.documentElement,null,!0);var Ma=new mxCodec(Ca.ownerDocument),Oa=new mxGraphModel;Ma.decode(Ca,Oa);b.sidebar.createTooltip(Ja,Oa.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!=Fa?mxResources.get(Fa):null,!0,new mxPoint(Ia,Ea),!0,function(){fa=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=Ha&&T(Ja,null,null,Ha,infoObj,clibs)},!0,!1)}}function J(){if(oa==Pa&&null==Da&&null!=ib&&null!=db)d&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+db.value+"'")&&(m=!0,b.hideDialog()),ib.click();else if(m&&b.spinner.stop(),ba&&null!=g)k||m||b.hideDialog(),g(ba,Ba,+Q.value);else if(d)k||m||b.hideDialog(),d(Da,Q.value,pa,ra);else{var Ca=Q.value;if(null!=Ca&&0<Ca.length){var Ia=function(Ja,Fa,Ha){b.createFile(Ha,Da,null!=ra&&0<ra.length?ra:null,Ja,function(){m||b.hideDialog()},null,Fa,null,null!=ha&&0<ha.length?ha:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var Ea=new SaveDialog(b,Ca,mxUtils.bind(this,function(Ja,Fa,Ha){Ia(Fa,Ha,Ja.value)}),null,null,null,null,b.mode);b.showDialog(Ea.container,420,150,!0,!1);Ea.init()}else b.pickFolder(b.mode,+function(Ja){Ia(b.mode,Ja,Ca)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function T(Ca,Ia,Ea,Ja,Fa,Ha,Ma){return oa!=Ca?(null!=oa&&(oa.classList.remove("geTemplateSelected"),oa==Pa&&(Xa.style.display="none",$a.style.display="",Qa.style.visibility="hidden",ab.style.visibility=null!=xa?"visible":"hidden")),Ca==Pa&&(Ia=xa,null!=Ia?(ab.style.visibility="visible",ab.style.visibility=null!=xa?"visible":"hidden",Qa.style.visibility="visible"):(Xa.style.display="",Qa.style.visibility=+"hidden",ab.style.visibility="hidden")),X.removeAttribute("disabled"),Da=Ia,ra=Ea,ha=Ha,oa=Ca,ba=Ja,pa=Ma,Ba=Fa,oa.classList.add("geTemplateSelected"),!0):!1}function V(){Xa.style.display="";$a.style.display="none";Qa.style.visibility="hidden";ab.style.visibility="hidden";db.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?db.select():document.execCommand("selectAll",!1,null)}function t(){$a.style.backgroundImage=ob;$a.style.backgroundSize="contain";Xa.style.display="none";$a.style.display=+"";Qa.style.visibility="visible";ab.style.visibility="visible"}function z(Ca){if(!Na){Na=!0;var Ia=mxUtils.trim(db.value);Ca||""==Ia?null!=ca&&(db.value=ca,t()):($a.style.backgroundImage="url("+Editor.spinImage+")",$a.style.backgroundSize="12px 12px",$a.style.display="",Xa.style.display="none",b.generateOpenAiMermaidDiagram(Ia,function(Ea){Na=!1;oa==Pa&&"none"==Xa.style.display&&(ob="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(Ea)))+")",Pa.setAttribute("title",Ia),ab.style.display=+"",xa=Da=Ea,ca=Ia,t(),m&&J())},mxUtils.bind(this,function(Ea){Na=!1;oa==Pa&&(Xa.style.display="",$a.style.display="none",Qa.style.visibility="hidden",ab.style.visibility="hidden",b.handleError(Ea))}),!0))}}function L(Ca,Ia,Ea,Ja,Fa,Ha,Ma,Oa,Va,hb,bb,mb){function Ta(Ya,pb){null==sb?(nb=Ya,nb=/^https?:\/\//.test(nb)?b.editor.isCorsEnabledForUrl(nb)?nb:PROXY_URL+"?url="+encodeURIComponent(nb):TEMPLATE_PATH+"/"+nb,mxUtils.get(nb,mxUtils.bind(this,function(qb){200<=qb.getStatus()&&299>=qb.getStatus()&&+(sb=qb.getText());pb(sb,nb)}))):pb(sb,nb)}function gb(Ya,pb){if(null==Ca||Z||b.sidebar.currentElt==La)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=aa){var qb="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+aa.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+aa.naturalWidth+'" height="'+aa.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";+N(qb,mxEvent.getClientX(Ya),mxEvent.getClientY(Ya),Ea,Ca)}else b.sidebar.currentElt=La,Z=!0,Ta(Ca,function(Cb){if(Z&&b.sidebar.currentElt==La)try{N(Cb,mxEvent.getClientX(Ya),mxEvent.getClientY(Ya),La,pb)}catch(Db){b.sidebar.currentElt=null,b.handleError(Db)}Z=!1})}var La=null;if("generative"!=mb||null==Pa){La=document.createElement("div");La.className="geTemplate";var sb=null,nb=Ca;null!=Ea?La.setAttribute("title",mxResources.get(Ea,null,Ea)):null!=Ja&&0<Ja.length&&La.setAttribute("title",Ja)}else La=+Pa;var tb=document.createElement("span");tb.className="geAdaptiveAsset";mxUtils.write(tb,mxResources.get(Ea,null,Ea));if(null!=Ha){La.style.display="inline-flex";La.style.justifyContent="center";La.style.alignItems="center";Va=document.createElement("img");Va.setAttribute("src",Ha);Va.setAttribute("alt",Ja);Va.style.maxWidth=Ka+"px";Va.style.maxHeight=Wa+"px";aa=Va;var xb=Ha.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");La.appendChild(Va);Va.onerror=function(){this.src!=xb?this.src=+xb:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(La,mxUtils.bind(this,function(Ya){T(La,null,null,Ca,Ma,bb)}),null,null);mxEvent.addListener(La,"dblclick",function(Ya){J();mxEvent.consume(Ya)})}else if(!hb&&null!=Ca&&0<Ca.length){var yb=function(Ya){W.spin(da)&&Ta(Ca,function(pb,qb){W.stop();null!=pb&&(T(La,pb,Ia,null,null,bb,qb),Ya&&J())})};Ha=Va||TEMPLATE_PATH+"/"+Ca.substring(0,Ca.length-4)+".png";Va=$a.cloneNode(!1);Va.style.backgroundImage="url("+Ha+")";Va.style.display=+"";La.appendChild(Va);null!=Ea&&La.appendChild(tb);mxEvent.addGestureListeners(La,mxUtils.bind(this,function(Ya){yb()}),null,null);mxEvent.addListener(La,"dblclick",function(Ya){yb(!0);mxEvent.consume(Ya)})}else La.appendChild(tb),"generative"==mb&&null==Pa&&(La.appendChild($a),La.appendChild(Xa),La.appendChild(ab),La.appendChild(Qa),Pa=La),Fa&&T(La),null!=Oa?(mxEvent.addGestureListeners(La,null,null,mxUtils.bind(this,function(Ya){T(La,null,null,Ca,Ma)})),mxEvent.addListener(La,"click",Oa)):(mxEvent.addListener(La,+"click",function(Ya){T(La,null,null,Ca,Ma)&&"generative"==mb&&null==xa&&V()}),mxEvent.addListener(La,"dblclick",function(Ya){"generative"!=mb?J():"none"==Xa.style.display&&V();mxEvent.consume(Ya)}));null!=Ca&&(Ha=Y.cloneNode(!0),La.appendChild(Ha),mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Ya){fa=b.sidebar.currentElt==La}),null,null),mxEvent.addListener(Ha,"click",mxUtils.bind(this,function(Ya){fa||gb(Ya,null!=Ea?Ea:Ja);mxEvent.consume(Ya)})));da.appendChild(La);return La}function K(){function Ca(Ta,+gb){Ta=mxResources.get(Ta,null,Ta.substring(0,1).toUpperCase()+Ta.substring(1));18<Ta.length&&(Ta=Ta.substring(0,18)+"…");return Ta+(null!=gb?" ("+gb.length+")":"")}function Ia(Ta,gb,La){mxEvent.addListener(gb,"click",function(){Sa!=gb&&(null!=Sa&&(Sa.style.backgroundColor=""),Sa=gb,Sa.style.backgroundColor=u,da.scrollTop=0,da.innerText="",S=0,null!=Ra[Ta].content?(da.appendChild(Ra[Ta].content),Da=xa,fb=null,null!=Ra[Ta].content.init&&Ra[Ta].content.init()):(fb=La?kb[Ta][La]:Ra[Ta],ea=null,+G(!1)))})}lb&&(lb=!1,mxEvent.addListener(da,"scroll",function(Ta){da.scrollTop+da.clientHeight>=da.scrollHeight&&(G(),mxEvent.consume(Ta))}));if(0<Za){var Ea=document.createElement("div");Ea.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ea,mxResources.get("custom"));Ga.appendChild(Ea);for(var Ja in Ua){var Fa=document.createElement("div");Ea=Ja;var Ha=Ua[Ja];18<Ea.length&&(Ea=Ea.substring(0,18)+"…");Fa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";+Fa.setAttribute("title",Ea+" ("+Ha.length+")");mxUtils.write(Fa,Fa.getAttribute("title"));null!=H&&(Fa.style.padding=H);Ga.appendChild(Fa);(function(Ta,gb){mxEvent.addListener(Fa,"click",function(){Sa!=gb&&(Sa.style.backgroundColor="",Sa=gb,Sa.style.backgroundColor=u,da.scrollTop=0,da.innerText="",S=0,fb=Ua[Ta],ea=null,G(!1))})})(Ja,Fa)}Ea=document.createElement("div");Ea.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ea,"draw.io");Ga.appendChild(Ea)}for(Ja in Ra){Ea=+Ha=null;if(null!=Ra[Ja].content)Fa=document.createElement(Ma?"ul":"div"),Ea=Ca(Ja),Fa.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;",Fa.setAttribute("title",Ea),mxUtils.write(Fa,Ea),Ga.appendChild(Fa),Ea=Fa;else{var Ma=kb[Ja];Ea=Fa=document.createElement(Ma?"ul":"div");Ha=Ra[Ja];var Oa=Ca(Ja,Ha);if(null!=Ma){Ha=document.createElement("li");var Va=document.createElement("div");+Va.className="geTempTreeCaret";Va.setAttribute("title",Oa);mxUtils.write(Va,Oa);Ea=Va;Ha.appendChild(Va);Oa=document.createElement("ul");Oa.className="geTempTreeNested";Oa.style.visibility="hidden";for(var hb in Ma){var bb=document.createElement("li"),mb=Ca(hb,Ma[hb]);bb.setAttribute("title",mb);mxUtils.write(bb,mb);Ia(Ja,bb,hb);Oa.appendChild(bb)}Ha.appendChild(Oa);Fa.className="geTempTree";Fa.appendChild(Ha);(function(Ta,gb){mxEvent.addListener(gb,"click",function(){Ta.style.visibility="visible";+Ta.classList.toggle("geTempTreeActive");Ta.classList.toggle("geTempTreeNested")&&setTimeout(function(){Ta.style.visibility="hidden"},550);gb.classList.toggle("geTempTreeCaret-down")})})(Oa,Va)}else Fa.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;",Fa.setAttribute("title",Oa),mxUtils.write(Fa,Oa);null!=H&&(Fa.style.padding=H);Ga.appendChild(Fa)}Ia(Ja,Ea);null==Sa&&Ea.click()}G(!1)}+var M=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);k=null!=k?k:!0;p=null!=p?p:!1;u=null!=u?u:"light-dark(#ebf2f9, "+Editor.darkColor+")";F=null!=F?F:EditorUi.templateFile;var m=!1,y=document.createElement("div");y.style.userSelect="none";y.style.height="100%";var E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.height="46px";k&&y.appendChild(E);var P=document.createElement("img");P.setAttribute("border","0");P.setAttribute("align","absmiddle");+P.style.width="40px";P.style.height="40px";P.style.marginRight="10px";P.style.paddingBottom="4px";P.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_M365?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||M||!k||E.appendChild(P);k&&mxUtils.write(E,(M?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var O=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?O=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?O=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?O=b.oneDrive.extension:b.mode==+App.MODE_GITHUB&&null!=b.gitHub?O=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?O=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(O=b.trello.extension);var Q=document.createElement("input");Q.setAttribute("value",b.defaultFilename+O);Q.style.marginLeft="10px";Q.style.width=f||M?"144px":"244px";this.init=function(){k&&Editor.selectFilename(Q);null!=da.parentNode&&null!=da.parentNode.parentNode&&mxEvent.addGestureListeners(da.parentNode.parentNode,mxUtils.bind(this,function(Ca){null!=+b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(k)if(E.appendChild(Q),x)Q.style.width=f||M?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var U=FilenameDialog.createFileTypes(b,Q,b.editor.diagramFileTypes);U.style.marginLeft="6px";U.style.width=f||M?"80px":"180px";E.appendChild(U)}var R=!1,S=0,W=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}),X=mxUtils.button(n||mxResources.get("create"),+function(){X.setAttribute("disabled","disabled");J();X.removeAttribute("disabled")});X.className="geBtn gePrimaryBtn";var Y=document.createElement("img");Y.setAttribute("src",Editor.magnifyImage);Y.setAttribute("title",mxResources.get("preview"));Y.className="geButton geRoundButton";var Z=!1,aa=null,fa=!1;if(D||c){var ia=[],ea=null,ma=null,na=null,ua=function(Ca){X.setAttribute("disabled","disabled");for(var Ia=0;Ia<ia.length;Ia++)ia[Ia].className=Ia==Ca?"geBtn gePrimaryBtn":"geBtn"};R=!0;var ta=+document.createElement("div");ta.style.whiteSpace="nowrap";ta.style.height="30px";y.appendChild(ta);var sa=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Ga.style.display="";ka.style.display="";da.style.left="160px";ua(0);da.scrollTop=0;da.innerText="";S=0;ea!=fb&&(fb=ea,Ra=ma,Za=na,Ga.innerText="",K(),ea=null)});ia.push(sa);ta.appendChild(sa);var la=function(Ca){Ga.style.display="none";ka.style.display="none";da.style.left="30px";ua(Ca?-1:1);null==ea&&(ea=fb);da.scrollTop=+0;da.innerText="";W.spin(da);var Ia=function(Ea,Ja,Fa){S=0;W.stop();fb=Ea;Fa=Fa||{};var Ha=0,Ma;for(Ma in Fa)Ha+=Fa[Ma].length;if(Ja)da.innerText=Ja;else if(0==Ea.length&&0==Ha)da.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(da.innerText="",0<Ha){Ga.style.display="";da.style.left="160px";Ga.innerText="";Za=0;Ra={"draw.io":Ea};for(Ma in Fa)Ra[Ma]=Fa[Ma];K()}else G(!0)};Ca?c(va.value,Ia):D(Ia)};if(D){var ja=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){la()});+ta.appendChild(ja);ia.push(ja)}if(c){var qa=document.createElement("span");qa.style.marginLeft="10px";qa.innerText=mxResources.get("search")+":";ta.appendChild(qa);var va=document.createElement("input");va.style.marginRight="10px";va.style.marginLeft="10px";va.style.width="220px";mxEvent.addListener(va,"keypress",function(Ca){13==Ca.keyCode&&la(!0)});ta.appendChild(va);var ya=mxUtils.button(mxResources.get("search"),function(){la(!0)});ya.className="geBtn";ta.appendChild(ya)}ua(0)}var ra=null,ha=+null,Da=null,oa=null,ba=null,pa=null,Ba=null,xa=null,ca=null,da=document.createElement("div");da.style.border="1px solid #d3d3d3";da.style.position="absolute";da.style.left="160px";da.style.right="34px";var wa=(k?72:40)+(R?30:0);da.style.top=wa+"px";da.style.bottom="68px";da.style.margin="6px 0 0 -1px";da.style.padding="6px";da.style.overflow="auto";var ka=document.createElement("div");ka.style.cssText="position:absolute;left:30px;width:128px;top:"+wa+"px;height:22px;margin-top: 6px;white-space: nowrap;";+var Aa=document.createElement("input");Aa.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";Aa.setAttribute("placeholder",mxResources.get("search"));Aa.setAttribute("type","text");ka.appendChild(Aa);var za=document.createElement("img");za.setAttribute("src",Editor.magnifyImage);za.setAttribute("title",mxResources.get("search"));za.className="geAdaptiveAsset";za.style.position="relative";za.style.cursor="pointer";za.style.outline=+"none";za.style.opacity="0.5";za.style.height="16px";za.style.left="-20px";za.style.top="4px";ka.appendChild(za);mxEvent.addListener(za,"click",function(){za.getAttribute("src")!=Editor.magnifyImage&&(za.setAttribute("src",Editor.magnifyImage),za.setAttribute("title",mxResources.get("search")),Aa.value="",null!=eb&&(eb.click(),eb=null));Aa.focus()});mxEvent.addListener(Aa,"keydown",mxUtils.bind(this,function(Ca){if(13==Ca.keyCode){var Ia=Aa.value;if(""==Ia)null!=eb&&(eb.click(),eb=null);else{if(null==+NewDialog.tagsList[F]){var Ea={};for(bb in Ra)if(null==Ra[bb].content)for(var Ja=Ra[bb],Fa=0;Fa<Ja.length;Fa++){var Ha=Ja[Fa];if(null!=Ha.tags)for(var Ma=Ha.tags.toLowerCase().split(";"),Oa=0;Oa<Ma.length;Oa++)null==Ea[Ma[Oa]]&&(Ea[Ma[Oa]]=[]),Ea[Ma[Oa]].push(Ha)}NewDialog.tagsList[F]=Ea}var Va=Ia.toLowerCase().split(" ");Ea=NewDialog.tagsList[F];if(0<Za&&null==Ea.__tagsList__){for(bb in Ua)for(Ja=Ua[bb],Fa=0;Fa<Ja.length;Fa++)for(Ha=Ja[Fa],Ma=Ha.title.split(" "),Ma.push(bb),Oa=0;Oa<Ma.length;Oa++){var hb=+Ma[Oa].toLowerCase();null==Ea[hb]&&(Ea[hb]=[]);Ea[hb].push(Ha)}Ea.__tagsList__=!0}var bb=[];Ja={};for(Fa=Ma=0;Fa<Va.length;Fa++)if(0<Va[Fa].length){hb=Ea[Va[Fa]];var mb={};bb=[];if(null!=hb)for(Oa=0;Oa<hb.length;Oa++)Ha=hb[Oa],0==Ma==(null==Ja[Ha.url])&&(mb[Ha.url]=!0,bb.push(Ha));Ja=mb;Ma++}da.scrollTop=0;da.innerText="";S=0;Ea=document.createElement("div");Ea.style.padding="6px";Ea.style.whiteSpace="nowrap";Ea.style.overflow="hidden";Ea.style.textOverflow="ellipsis";Ha=mxResources.get(0==bb.length?+"noResultsFor":"resultsFor",[Ia]);Ea.setAttribute("title",Ha);mxUtils.write(Ea,Ha);da.appendChild(Ea);null!=Sa&&null==eb&&(Sa.style.backgroundColor="",eb=Sa,Sa=Ea);fb=bb;ea=null;G(!1)}mxEvent.consume(Ca)}}));mxEvent.addListener(Aa,"keyup",mxUtils.bind(this,function(Ca){""==Aa.value?(za.setAttribute("src",Editor.magnifyImage),za.setAttribute("title",mxResources.get("search"))):(za.setAttribute("src",Editor.crossImage),za.setAttribute("title",mxResources.get("reset")))}));wa+=23;var Ga=document.createElement("div");+Ga.style.cssText="position:absolute;left:30px;width:128px;top:"+wa+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(da,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var Ka=140,Wa=Ka,Pa=null,ob="url("+Editor.thinSparklesImage+")",Xa=document.createElement("div");Xa.className="geGenerateDiagramForm";Xa.style.position="absolute";Xa.style.width="100%";Xa.style.height="100%";var $a=document.createElement("div");$a.className="geTemplatePreview geAdaptiveAsset";+$a.style.backgroundImage=ob;var db=document.createElement("textarea");db.setAttribute("placeholder",mxResources.get("describeYourDiagram"));db.className="geGenerateDiagramDescription";var ib=document.createElement("button");ib.className="geBtn gePrimaryBtn geGenerateDiagramButton";ib.setAttribute("disabled","disabled");ib.setAttribute("title",mxResources.get("ok"));mxUtils.write(ib,mxResources.get("ok"));var ab=Y.cloneNode(!0);ab.style.display="none";var ub=!1;mxEvent.addGestureListeners(ab,function(Ca){ub=+null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Ca){if(!ub&&null!=xa){var Ia="<mxfile><diagram>"+Graph.compress(xa)+"</diagram></mxfile>";N(Ia,mxEvent.getClientX(Ca),mxEvent.getClientY(Ca),Pa,ca)}});var Qa=Y.cloneNode(!0);Qa.setAttribute("src",Editor.editImage);Qa.setAttribute("title",mxResources.get("edit"));Qa.style.visibility="hidden";Qa.style.left="0px";var cb=Y.cloneNode(!0);cb.setAttribute("src",Editor.helpImage);cb.setAttribute("title",mxResources.get("help"));+mxEvent.addListener(cb,"click",function(Ca){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Ca)});Xa.appendChild(db);Xa.appendChild(ib);Xa.appendChild(cb);Xa.style.display="none";mxEvent.addListener(Qa,"click",V);mxEvent.addListener(db,"input",function(){""!=db.value?ib.removeAttribute("disabled"):ib.setAttribute("disabled","disabled")});var Na=!1;mxEvent.addListener(ib,"click",function(){z()});mxEvent.addListener(db,"keydown",function(Ca){13!=Ca.keyCode||mxEvent.isShiftDown(Ca)?+27==Ca.keyCode&&(z(!0),mxEvent.consume(Ca)):(z(),mxEvent.consume(Ca))});var Ra={},kb={},Ua={},Za=0,lb=!0,Sa=null,eb=null;Ra.basic=C?[]:[{title:"blankDiagram"}];var fb=Ra.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&Ra.basic.push({title:"generate",type:"generative"});if(!f){var vb=function(){mxUtils.get(rb,function(Ca){if(!zb){zb=!0;Ca=Ca.getXml().documentElement.firstChild;for(var Ia={};null!=Ca;){if("undefined"!==+typeof Ca.getAttribute)if("parsererror"==Ca.nodeName)null!=window.console&&console.log("Parser error in "+F+": "+Ca.textContent);else if("clibs"==Ca.nodeName){for(var Ea=Ca.getAttribute("name"),Ja=Ca.getElementsByTagName("add"),Fa=[],Ha=0;Ha<Ja.length;Ha++)Fa.push(encodeURIComponent(mxUtils.getTextContent(Ja[Ha])));null!=Ea&&0<Fa.length&&(Ia[Ea]=Fa.join(";"))}else if(Fa=Ca.getAttribute("url"),null!=Fa){Ja=Ca.getAttribute("section");Ea=Ca.getAttribute("subsection");if(null==Ja&&(Ha=Fa.indexOf("/"),+Ja=Fa.substring(0,Ha),null==Ea)){var Ma=Fa.indexOf("/",Ha+1);-1<Ma&&(Ea=Fa.substring(Ha+1,Ma))}Ha=Ra[Ja];null==Ha&&(Ha=[],Ra[Ja]=Ha);Fa=Ca.getAttribute("clibs");null!=Ia[Fa]&&(Fa=Ia[Fa]);Fa={url:Ca.getAttribute("url"),libs:Ca.getAttribute("libs"),title:Ca.getAttribute("title"),tooltip:Ca.getAttribute("name")||Ca.getAttribute("url"),preview:Ca.getAttribute("preview"),clibs:Fa,tags:Ca.getAttribute("tags")};Ha.push(Fa);null!=Ea&&(Ha=kb[Ja],null==Ha&&(Ha={},kb[Ja]=Ha),Ja=Ha[Ea],null==Ja&&(Ja=[],Ha[Ea]=+Ja),Ja.push(Fa))}Ca=Ca.nextSibling}W.stop();K()}})};y.appendChild(ka);y.appendChild(Ga);y.appendChild(da);var zb=!1,rb=F;/^https?:\/\//.test(rb)&&!b.editor.isCorsEnabledForUrl(rb)&&(rb=PROXY_URL+"?url="+encodeURIComponent(rb));W.spin(da);null!=v?v(function(Ca,Ia){Ua=Ca;na=Za=Ia;vb()},vb):vb();ma=Ra}mxEvent.addListener(Q,"keypress",function(Ca){b.dialog.container.firstChild==y&&13==Ca.keyCode&&J()});var jb=document.createElement("div");jb.style.marginTop=f?"4px":"16px";jb.style.textAlign="right";jb.style.position=+"absolute";jb.style.left="40px";jb.style.bottom="24px";jb.style.right="40px";var wb=mxUtils.button(mxResources.get("cancel"),function(){null!=q&&q();b.hideDialog(!0)});wb.className="geBtn";!b.editor.cancelFirst||p&&null==q||jb.appendChild(wb);if(!(f||"1"==urlParams.embed||p||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Ab=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Ca=new FilenameDialog(b,"",mxResources.get("create"),function(Ia){null!=Ia&&0<Ia.length&&+b.editor.loadUrl(b.editor.getProxiedUrl(Ia),function(Ea){Da=Ea;ra=null;templateRealURl=Ia;b.hideDialog();J()},function(Ea){b.handleError(Ea)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Ca.container,300,80,!0,!0);Ca.init()});Ab.className="geBtn";jb.appendChild(Ab)}if(Graph.fileSupport&&l){var Bb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Ca=document.createElement("input");Ca.setAttribute("multiple","multiple");Ca.setAttribute("type","file");+mxEvent.addListener(Ca,"change",function(Ia){b.openFiles(Ca.files,!0);Ca.value=""});Ca.style.display="none";document.body.appendChild(Ca);b.newDlgFileInputElt=Ca}b.newDlgFileInputElt.click()});Bb.className="geBtn";jb.appendChild(Bb)}jb.appendChild(X);b.editor.cancelFirst||null!=d||p&&null==q||jb.appendChild(wb);y.appendChild(jb);this.container=y};NewDialog.tagsList={};+var SaveDialog=function(b,f,k,d,p,q,u,A,I,H,F){function D(m,y,E,P,O,Q){var U=null;if((null==d||0>mxUtils.indexOf(d,m))&&(null==I||m==I)&&(null==H||0<=mxUtils.indexOf(H,m))){O=null!=O?O:b.getTitleForService(m);var R=0<=mxUtils.indexOf(z,m);if(R||null!=b.getServiceForName(m)){U=document.createElement("option");var S="";!R&&b.isOffline(m==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(U.setAttribute("disabled","disabled"),S=" ("+mxResources.get("offline")+")");if("pick"==Q)U.innerHTML=mxUtils.htmlEntities(O)++" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+S,U.setAttribute("value","pickFolder-"+m),U.setAttribute("title",O+" - "+mxResources.get("pickFolder")+"...");else{R=m+(null!=E?"-"+E:"");var W=K[R];null!=W&&null!=W.option&&W.option.parentNode.removeChild(W.option);W=null;if(null!=y){"/"==y.charAt(y.length-1)&&(y=y.substring(0,y.length-1));"/"==y.charAt(0)&&(y=y.substring(1));W=y;if(m!=App.MODE_GITHUB&&m==App.MODE_GITLAB){var X=W.lastIndexOf("/");0<=X&&(W=+W.substring(X+1))}40<W.length&&(W=W.substring(0,20)+"..."+W.substring(W.length-20))}U.innerHTML=mxUtils.htmlEntities(O)+(null!=W?" – "+mxUtils.htmlEntities(W):"")+S;U.setAttribute("title",O+(null!=y?" ("+y+")":"")+(null!=E&&decodeURIComponent(E)!=y?" ["+E+"]":""));U.setAttribute("value",R);K[R]={option:U,mode:m,path:y,id:E};SaveDialog.lastValue==R&&null==A&&"disabled"==!U.getAttribute("disabled")?P=!0:null==P&&("root"==Q?P=null==A&&b.mode==m||null!=m&&m==A:"pickFolder-"==+t.value.substring(0,11)&&(P=!0));P&&U.setAttribute("selected","selected")}t.appendChild(U)}}return U}function c(m){b.pickFolder(m,function(y){var E=null;m==App.MODE_GOOGLE&&null!=y.docs&&0<y.docs.length?E={mode:m,path:y.docs[0].name,id:y.docs[0].id}:m==App.MODE_ONEDRIVE&&null!=y.value&&0<y.value.length?E={mode:m,path:y.value[0].name,id:OneDriveFile.prototype.getIdOf(y.value[0])}:m==App.MODE_M365&&null!=y.value&&0<y.value.length?E={mode:m,path:y.value[0].name,id:OneDriveFile.prototype.getIdOf(y.value[0])}:+(m==App.MODE_GITHUB||m==App.MODE_GITLAB)&&null!=y&&0<y.length&&(E={mode:m,path:decodeURIComponent(y),id:y});null!=E&&(b.addRecent(E,"Folders",5),y=D(E.mode,E.path,E.id,!0),t.innerHTML="",K={},g(),E=t.selectedIndex,t.value=y.value,0>t.selectedIndex&&(t.selectedIndex=E))},!0,!0,!0,!0)}function g(){var m=b.getRecent("Folders"),y=0;if(null!=m&&0<m.length)for(var E=0;E<m.length;E++)null!=D(m[E].mode,m[E].path,m[E].id)&&y++;D(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");D(App.MODE_GOOGLE,+null,null,null,null,"pick");null!=b.oneDrive&&(D(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),D(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.m365&&D(App.MODE_M365,null,null,null,null,"pick");null!=b.dropbox&&D(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);D(App.MODE_GITHUB,null,null,null,null,"pick");D(App.MODE_GITLAB,null,null,null,null,"pick");D(App.MODE_TRELLO);m=!Editor.useLocalStorage||"device"==urlParams.storage||null!=+b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&m&&D(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&&D(App.MODE_BROWSER);m&&D("download");Editor.popupsAllowed&&D("_blank",null,null,null,mxResources.get("openInNewWindow"));"pickFolder-"==t.value.substring(0,11)&&(m=document.createElement("option"),m.setAttribute("value",""),m.setAttribute("selected","selected"),mxUtils.write(m,+mxResources.get("pickFolder")+"..."),t.insertBefore(m,t.firstChild));L=t.value}function l(){if("pickFolder-"==t.value.substring(0,11)){var m=t.value.substring(11);t.value=L;c(m)}else if(null!=V&&null!=K[t.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[V.value].extension){m=b.getExtensionForService(K[t.value].mode);var y=T.value;null!=m&&0>f.indexOf(".")&&0>y.indexOf(".")&&(T.value=y+m)}M.innerHTML="";mxUtils.write(M,null!=F?F:mxResources.get("download"==t.value||"_blank"==+t.value||null!=I?"ok":"save"));""==t.value?M.setAttribute("disabled","disabled"):M.removeAttribute("disabled")}var n=document.createElement("div");n.style.display="flex";n.style.flexWrap="wrap";n.style.whiteSpace="nowrap";var v=document.createElement("div");v.style.display="grid";v.style.gap="5px 8px";v.style.gridAutoRows="auto auto 44px";v.style.gridAutoColumns="0fr minmax(0,1fr)";v.style.width="100%";var x=null,B=null;if(null!=p&&null!=q&&"image/"==q.substring(0,6)&&("image/svg"!=q.substring(0,+9)||mxClient.IS_SVG)){v.style.display="inline-grid";v.style.flexBasis="75%";x=document.createElement("div");x.style.display="inline-block";x.style.height="auto";x.style.maxWidth="25%";x.style.margin="auto";var C=document.createElement("img"),G=u?p:btoa(unescape(encodeURIComponent(p))),N="data:"+q+";base64,"+G;C.setAttribute("src",N);C.style.boxSizing="border-box";C.style.maxHeight="50px";C.style.maxWidth="100%";C.style.paddingLeft="10px";x.appendChild(C);"image/png"!=q&&"image/svg+xml"!=q||"function"!==+typeof window.ClipboardItem||null==navigator.clipboard||(B=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(N,null,null,q,mxUtils.bind(this,function(){"copy"==A?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))}),mxUtils.bind(this,function(m){b.handleError(m)}))},null,"geBtn"));Editor.popupsAllowed&&(null==d||0>mxUtils.indexOf(d,"_blank"))?(x.setAttribute("title",mxResources.get("openInNewWindow")),x.style.cursor="pointer",mxEvent.addGestureListeners(x,null,null,+function(m){mxEvent.isPopupTrigger(m)||b.openInNewWindow(p,q,u)})):x.setAttribute("title",mxResources.get("preview"))}G=document.createElement("div");G.style.display="flex";G.style.padding="1px";G.style.alignItems="center";G.style.justifyContent="flex-end";G.style.gridColumn="1";G.style.whiteSpace="nowrap";var J=document.createElement("div");J.style.display="grid";J.style.padding="1px";J.style.alignItems="center";J.style.gridColumn="2";J.style.gridAutoColumns="minmax(0,1fr) auto";J.style.gap="6px";+mxUtils.write(G,mxResources.get("saveAs")+":");var T=document.createElement("input");T.setAttribute("type","text");T.setAttribute("value",f);T.style.boxSizing="border-box";T.style.width="100%";J.appendChild(T);null==I&&(v.appendChild(G),v.appendChild(J));var V=null;null!=b.editor.diagramFileTypes&&null==q&&null==I&&(G=G.cloneNode(!1),J=J.cloneNode(!1),mxUtils.write(G,mxResources.get("type")+":"),V=FilenameDialog.createFileTypes(b,T,b.editor.diagramFileTypes),V.style.boxSizing="border-box",V.style.width=+"100%",J.appendChild(V),v.appendChild(G),v.appendChild(J));G=G.cloneNode(!1);J=J.cloneNode(!1);mxUtils.write(G,mxResources.get("where")+":");var t=document.createElement("select");t.style.textOverflow="ellipsis";t.style.gridColumn="1";var z=["browser","device","download","_blank"],L=null,K={};C=mxUtils.button(mxResources.get("reset"),function(){T.value=f;T.dispatchEvent(new Event("change"));b.resetRecent("Folders");t.innerHTML="";t.value="";pickFolderOption=null;K={};g()},null,"geBtn");var M=mxUtils.button("",+function(){SaveDialog.lastValue=t.value;var m=K[SaveDialog.lastValue];null!=m&&k(T,m.mode,m.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(T,"keypress",function(m){13==m.keyCode&&("copy"==A&&null!=B?B.click():M.click())});mxEvent.addListener(t,"change",l);g();J.appendChild(t);null!=SaveDialog.lastValue&&null!=K[SaveDialog.lastValue]&&(t.value=SaveDialog.lastValue);l();v.appendChild(G);v.appendChild(J);n.appendChild(v);null!=x&&n.appendChild(x);v=document.createElement("div");v.style.flexBasis="100%";v.style.textAlign="right";v.style.marginTop=null!=q?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||v.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&v.appendChild(x);v.appendChild(C);"copy"==A&&null!=B?(B.className="geBtn gePrimaryBtn",M.className="geBtn",v.appendChild(M),v.appendChild(B)):(null!=B&&v.appendChild(B),v.appendChild(M));b.editor.cancelFirst||-v.appendChild(x);n.appendChild(v);this.init=function(){Editor.selectFilename(S)};this.container=n},CreateDialog=function(b,f,k,d,p,q,u,A,J,I,G,E,c,g,l,n,v){function x(t,z,L,K){function M(){mxEvent.addListener(m,"click",function(){var P=L;if(u){var T=H.value,Q=T.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>Q){P=null!=P?P:V.value;var R="";P==App.MODE_GOOGLE?R=b.drive.extension:P==App.MODE_GITHUB?R=b.gitHub.extension:P==App.MODE_GITLAB?R=b.gitLab.extension:P==App.MODE_TRELLO?R=b.trello.extension:P==App.MODE_DROPBOX?-R=b.dropbox.extension:P==App.MODE_ONEDRIVE?R=b.oneDrive.extension:P==App.MODE_DEVICE&&(R=".drawio");0<=Q&&(T=T.substring(0,Q));H.value=T+R}}B(L)})}var m=document.createElement("a");m.style.overflow="hidden";var y=document.createElement("img");y.src=t;y.setAttribute("border","0");y.setAttribute("align","absmiddle");y.style.width="60px";y.style.height="60px";y.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(y);m.style.color="gray";m.style.fontSize="11px";var F=document.createElement("div");m.appendChild(F);mxUtils.write(F,z);if(null!=K&&null==b[K]){y.style.visibility="hidden";mxUtils.setOpacity(F,10);var N=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});N.spin(m);var O=window.setTimeout(function(){null==b[K]&&(N.stop(),m.style.display=-"none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[K]&&(window.clearTimeout(O),mxUtils.setOpacity(F,100),y.style.visibility="",N.stop(),M())}))}else M();U.appendChild(m);++S==E&&(mxUtils.br(U),S=0)}function B(t){var z=H.value;if(null==t||null!=z&&0<z.length)v&&b.hideDialog(),k(z,t,H)}G="1"==urlParams.noDevice?!1:G;u=null!=u?u:!0;A=null!=A?A:!0;E=null!=E?E:4;v=null!=v?v:!0;q=document.createElement("div");q.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(q);var C=document.createElement("h2");-mxUtils.write(C,p||mxResources.get("create"));C.style.marginTop="0px";C.style.marginBottom="24px";q.appendChild(C);p=document.createElement("span");mxUtils.write(p,mxResources.get("filename")+":");p.style.maxWidth="106px";p.style.overflow="hidden";p.style.textOverflow="ellipsis";p.style.display="inline-block";q.appendChild(p);var H=document.createElement("input");H.setAttribute("value",f);H.style.width="180px";H.style.marginLeft="10px";H.style.marginBottom="20px";H.style.maxWidth="70%";this.init=-function(){Editor.selectFilename(H)};q.appendChild(H);null!=n&&null!=b.editor.diagramFileTypes&&(n=FilenameDialog.createFileTypes(b,H,b.editor.diagramFileTypes),n.style.marginLeft="6px",n.style.width="90px",q.appendChild(n));n=null;if("1"!=urlParams.noDevice&&null!=c&&null!=g&&"image/"==g.substring(0,6)&&("image/svg"!=g.substring(0,9)||mxClient.IS_SVG)){H.style.width="160px";p=document.createElement("img");var D=l?c:btoa(unescape(encodeURIComponent(c)));p.setAttribute("src","data:"+g+";base64,"+D);-p.style.position="absolute";p.style.top="70px";p.style.right="100px";p.style.maxWidth="120px";p.style.maxHeight="80px";mxUtils.setPrefixedStyle(p.style,"transform","translate(50%,-50%)");q.appendChild(p);mxClient.IS_FF||"image/png"!=g||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(n=mxUtils.button(mxResources.get("copy"),function(t){t=b.base64ToBlob(D,"image/png");t=new ClipboardItem({"image/png":t,"text/html":new Blob(['<img src="data:'+g+";base64,"+D+'">'],{type:"text/html"})});-navigator.clipboard.write([t]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(z){b.handleError(z)}))}),n.style.marginTop="6px",n.className="geBtn");J&&Editor.popupsAllowed&&(p.style.cursor="pointer",mxEvent.addGestureListeners(p,null,null,function(t){mxEvent.isPopupTrigger(t)||B("_blank")}))}mxUtils.br(q);var U=document.createElement("div");U.style.textAlign="center";var S=0;U.style.marginTop="6px";q.appendChild(U);var V=document.createElement("select");+v.appendChild(x);n.appendChild(v);this.init=function(){Editor.selectFilename(T)};this.container=n},CreateDialog=function(b,f,k,d,p,q,u,A,I,H,F,D,c,g,l,n,v){function x(t,z,L,K){function M(){mxEvent.addListener(m,"click",function(){var Q=L;if(u){var U=G.value,R=U.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>R){Q=null!=Q?Q:V.value;var S="";Q==App.MODE_GOOGLE?S=b.drive.extension:Q==App.MODE_GITHUB?S=b.gitHub.extension:Q==App.MODE_GITLAB?S=b.gitLab.extension:Q==App.MODE_TRELLO?S=b.trello.extension:Q==App.MODE_DROPBOX?+S=b.dropbox.extension:Q==App.MODE_ONEDRIVE?S=b.oneDrive.extension:Q==App.MODE_DEVICE&&(S=".drawio");0<=R&&(U=U.substring(0,R));G.value=U+S}}B(L)})}var m=document.createElement("a");m.style.overflow="hidden";var y=document.createElement("img");y.src=t;y.setAttribute("border","0");y.setAttribute("align","absmiddle");y.style.width="60px";y.style.height="60px";y.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(y);m.style.color="gray";m.style.fontSize="11px";var E=document.createElement("div");m.appendChild(E);mxUtils.write(E,z);if(null!=K&&null==b[K]){y.style.visibility="hidden";mxUtils.setOpacity(E,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(m);var O=window.setTimeout(function(){null==b[K]&&(P.stop(),m.style.display=+"none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[K]&&(window.clearTimeout(O),mxUtils.setOpacity(E,100),y.style.visibility="",P.stop(),M())}))}else M();J.appendChild(m);++T==D&&(mxUtils.br(J),T=0)}function B(t){var z=G.value;if(null==t||null!=z&&0<z.length)v&&b.hideDialog(),k(z,t,G)}F="1"==urlParams.noDevice?!1:F;u=null!=u?u:!0;A=null!=A?A:!0;D=null!=D?D:4;v=null!=v?v:!0;q=document.createElement("div");q.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(q);var C=document.createElement("h2");+mxUtils.write(C,p||mxResources.get("create"));C.style.marginTop="0px";C.style.marginBottom="24px";q.appendChild(C);p=document.createElement("span");mxUtils.write(p,mxResources.get("filename")+":");p.style.maxWidth="106px";p.style.overflow="hidden";p.style.textOverflow="ellipsis";p.style.display="inline-block";q.appendChild(p);var G=document.createElement("input");G.setAttribute("value",f);G.style.width="180px";G.style.marginLeft="10px";G.style.marginBottom="20px";G.style.maxWidth="70%";this.init=+function(){Editor.selectFilename(G)};q.appendChild(G);null!=n&&null!=b.editor.diagramFileTypes&&(n=FilenameDialog.createFileTypes(b,G,b.editor.diagramFileTypes),n.style.marginLeft="6px",n.style.width="90px",q.appendChild(n));n=null;if("1"!=urlParams.noDevice&&null!=c&&null!=g&&"image/"==g.substring(0,6)&&("image/svg"!=g.substring(0,9)||mxClient.IS_SVG)){G.style.width="160px";p=document.createElement("img");var N=l?c:btoa(unescape(encodeURIComponent(c)));p.setAttribute("src","data:"+g+";base64,"+N);+p.style.position="absolute";p.style.top="70px";p.style.right="100px";p.style.maxWidth="120px";p.style.maxHeight="80px";mxUtils.setPrefixedStyle(p.style,"transform","translate(50%,-50%)");q.appendChild(p);mxClient.IS_FF||"image/png"!=g||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(n=mxUtils.button(mxResources.get("copy"),function(t){t=b.base64ToBlob(N,"image/png");t=new ClipboardItem({"image/png":t,"text/html":new Blob(['<img src="data:'+g+";base64,"+N+'">'],{type:"text/html"})});+navigator.clipboard.write([t]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(z){b.handleError(z)}))}),n.style.marginTop="6px",n.className="geBtn");I&&Editor.popupsAllowed&&(p.style.cursor="pointer",mxEvent.addGestureListeners(p,null,null,function(t){mxEvent.isPopupTrigger(t)||B("_blank")}))}mxUtils.br(q);var J=document.createElement("div");J.style.textAlign="center";var T=0;J.style.marginTop="6px";q.appendChild(J);var V=document.createElement("select");V.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(c,mxResources.get("googleDrive")),V.appendChild(c),x(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(c,mxResources.get("oneDrive")),V.appendChild(c),b.mode==App.MODE_ONEDRIVE&&c.setAttribute("selected","selected"),x(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),null!=b.m365&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_M365),mxUtils.write(c,mxResources.get("m365")),V.appendChild(c),b.mode==App.MODE_M365&&c.setAttribute("selected","selected"),x(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365")),"function"===typeof window.DropboxClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(c,mxResources.get("dropbox")),V.appendChild(c),b.mode==App.MODE_DROPBOX&&c.setAttribute("selected","selected"),x(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITHUB),mxUtils.write(c,mxResources.get("github")),V.appendChild(c),x(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITLAB),mxUtils.write(c,mxResources.get("gitlab")),V.appendChild(c),x(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_TRELLO),mxUtils.write(c,mxResources.get("trello")),V.appendChild(c),x(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,-"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)c=document.createElement("option"),c.setAttribute("value",App.MODE_DEVICE),mxUtils.write(c,mxResources.get("device")),V.appendChild(c),b.mode!=App.MODE_DEVICE&&A||c.setAttribute("selected","selected"),G&&x(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);A&&isLocalStorage&&"0"!=urlParams.browser&&(A=document.createElement("option"),A.setAttribute("value",-App.MODE_BROWSER),mxUtils.write(A,mxResources.get("browser")),V.appendChild(A),b.mode==App.MODE_BROWSER&&A.setAttribute("selected","selected"),x(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));A=document.createElement("div");A.style.marginTop="26px";A.style.textAlign="center";null!=I&&(G=mxUtils.button(mxResources.get("help"),function(){b.openLink(I)}),G.className="geBtn",A.appendChild(G));G=mxUtils.button(mxResources.get(null!=d?"close":"cancel"),function(){null!=d?d():-(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});G.className="geBtn";b.editor.cancelFirst&&null==d&&A.appendChild(G);null==d&&(c=mxUtils.button(mxResources.get("decideLater"),function(){B(null)}),c.className="geBtn",A.appendChild(c));J&&Editor.popupsAllowed&&(J=mxUtils.button(mxResources.get("openInNewWindow"),function(){B("_blank")}),J.className="geBtn",A.appendChild(J));CreateDialog.showDownloadButton&&(J=mxUtils.button(mxResources.get("download"),function(){B("download")}),-J.className="geBtn",A.appendChild(J),null!=n&&(J.style.marginTop="6px",A.style.marginTop="6px"));null!=n&&(mxUtils.br(A),A.appendChild(n));b.editor.cancelFirst&&null==d||A.appendChild(G);mxEvent.addListener(H,"keypress",function(t){13==t.keyCode?B(App.MODE_DEVICE):27==t.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});q.appendChild(A);this.container=q};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;+"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)c=document.createElement("option"),c.setAttribute("value",App.MODE_DEVICE),mxUtils.write(c,mxResources.get("device")),V.appendChild(c),b.mode!=App.MODE_DEVICE&&A||c.setAttribute("selected","selected"),F&&x(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);A&&isLocalStorage&&"0"!=urlParams.browser&&(A=document.createElement("option"),A.setAttribute("value",+App.MODE_BROWSER),mxUtils.write(A,mxResources.get("browser")),V.appendChild(A),b.mode==App.MODE_BROWSER&&A.setAttribute("selected","selected"),x(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));A=document.createElement("div");A.style.marginTop="26px";A.style.textAlign="center";null!=H&&(F=mxUtils.button(mxResources.get("help"),function(){b.openLink(H)}),F.className="geBtn",A.appendChild(F));F=mxUtils.button(mxResources.get(null!=d?"close":"cancel"),function(){null!=d?d():+(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});F.className="geBtn";b.editor.cancelFirst&&null==d&&A.appendChild(F);null==d&&(c=mxUtils.button(mxResources.get("decideLater"),function(){B(null)}),c.className="geBtn",A.appendChild(c));I&&Editor.popupsAllowed&&(I=mxUtils.button(mxResources.get("openInNewWindow"),function(){B("_blank")}),I.className="geBtn",A.appendChild(I));CreateDialog.showDownloadButton&&(I=mxUtils.button(mxResources.get("download"),function(){B("download")}),+I.className="geBtn",A.appendChild(I),null!=n&&(I.style.marginTop="6px",A.style.marginTop="6px"));null!=n&&(mxUtils.br(A),A.appendChild(n));b.editor.cancelFirst&&null==d||A.appendChild(F);mxEvent.addListener(G,"keypress",function(t){13==t.keyCode?B(App.MODE_DEVICE):27==t.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});q.appendChild(A);this.container=q};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;var PopupDialog=function(b,f,k,d,p){p=null!=p?p:!0;var q=document.createElement("div");q.style.textAlign="center";q.style.height="100%";mxUtils.write(q,mxResources.get("fileOpenLocation"));mxUtils.br(q);mxUtils.br(q);var u=mxUtils.button(mxResources.get("openInThisWindow"),function(){p&&b.hideDialog();null!=d&&d()});u.className="geBtn";u.style.marginBottom="8px";u.style.width="280px";q.appendChild(u);mxUtils.br(q);var A=mxUtils.button(mxResources.get("openInNewWindow"),function(){p&&b.hideDialog();-null!=k&&k();b.openLink(f,null,!0)});A.className="geBtn gePrimaryBtn";A.style.width=u.style.width;q.appendChild(A);mxUtils.br(q);mxUtils.br(q);mxUtils.write(q,mxResources.get("allowPopups"));this.container=q},ImageDialog=function(b,f,k,d,p,q,u,A){function J(){0<E.value.length?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");"data:"!=E.value.substring(0,5)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}q=null!=q?q:!0;var I=b.editor.graph,G=document.createElement("div");-mxUtils.write(G,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 E=document.createElement("input");E.setAttribute("value",k);E.setAttribute("type","text");E.setAttribute("spellcheck","false");E.setAttribute("autocorrect","off");E.setAttribute("autocomplete","off");E.setAttribute("autocapitalize","off");E.style.marginTop=-"6px";E.style.width=(Graph.fileSupport?460:340)-20+"px";E.style.backgroundImage="url('"+Editor.crossImage+"')";E.style.backgroundRepeat="no-repeat";E.style.backgroundPosition="100% 50%";E.style.paddingRight="14px";k=document.createElement("div");k.setAttribute("title",mxResources.get("reset"));k.style.position="relative";k.style.left="-16px";k.style.width="12px";k.style.height="14px";k.style.cursor="pointer";k.style.display="inline-block";k.style.top="3px";k.style.background="url('"+b.editor.transparentImage+-"')";mxEvent.addListener(k,"click",function(){E.value="";E.focus()});f.appendChild(E);f.appendChild(k);G.appendChild(f);var c=A,g,l,n=function(H,D,U,S){var V="data:"==H.substring(0,5);!b.isOffline()||V&&"undefined"===typeof chrome?0<H.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(H,function(t){b.spinner.stop();b.hideDialog();var z=!1===S?1:null!=D&&null!=U?Math.max(D/t.width,U/t.height):Math.min(1,Math.min(520/t.width,520/t.height));q&&(H=b.convertDataUri(H));d(H,-Math.round(Number(t.width)*z),Math.round(Number(t.height)*z),c,g,l)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(H,null,null,c,g,l)):(H=b.convertDataUri(H),D=null==D?120:D,U=null==U?100:U,b.hideDialog(),d(H,D,U,c,g,l))},v=function(H,D){if(null!=H){var U=p?null:I.getModel().getGeometry(I.getSelectionCell());null!=U?n(H,U.width,U.height,D):n(H,null,null,D)}else b.hideDialog(),d(null)};this.init=function(){E.focus();-if(Graph.fileSupport){E.setAttribute("placeholder",mxResources.get("dragImagesHere"));var H=G.parentNode,D=null;mxEvent.addListener(H,"dragleave",function(U){null!=D&&(D.parentNode.removeChild(D),D=null);U.stopPropagation();U.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(U){null==D&&(D=b.highlightElement(H));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(U){null!=D&&(D.parentNode.removeChild(D),D=null);if(0<U.dataTransfer.files.length)b.importFiles(U.dataTransfer.files,-0,0,b.maxImageSize,function(V,t,z,L,K,M,m,y){v(V,y)},function(){},function(V){return"image/"==V.type.substring(0,6)},function(V){for(var t=0;t<V.length;t++)V[t]()},!mxEvent.isControlDown(U),null,null,!0);else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")){var S=U.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(S)&&v(decodeURIComponent(S))}U.stopPropagation();U.preventDefault()}),!1)}};A=document.createElement("div");A.style.marginTop="14px";A.style.textAlign=-"center";k=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});k.className="geBtn";b.editor.cancelFirst&&A.appendChild(k);ImageDialog.filePicked=function(H){H.action==google.picker.Action.PICKED&&null!=H.docs[0].thumbnails&&(H=H.docs[0].thumbnails[H.docs[0].thumbnails.length-1],null!=H&&(E.value=H.url));E.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var x=document.createElement("input");x.setAttribute("multiple","multiple");x.setAttribute("type",-"file");mxEvent.addListener(x,"change",function(H){null!=x.files&&(b.importFiles(x.files,0,0,b.maxImageSize,function(D,U,S,V,t,z){v(D)},function(){},function(D){return"image/"==D.type.substring(0,6)},function(D){for(var U=0;U<D.length;U++)D[U]()},!0),x.type="",x.type="file",x.value="")});x.style.display="none";document.body.appendChild(x);b.imgDlgFileInputElt=x}f=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});f.className="geBtn";A.appendChild(f)}mxEvent.addListener(E,-"keypress",function(H){13==H.keyCode&&v(E.value)});var B=mxUtils.button(mxResources.get("crop"),function(){var H=new CropImageDialog(b,E.value,c,function(D,U,S){c=D;g=U;l=S});b.showDialog(H.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450))});u&&(B.className="geBtn",A.appendChild(B));var C=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=E.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var H=b.editor.createImageUrlConverter().convert(E.value),-D=new Image;D.onload=function(){b.editor.convertImageToDataUri(H,function(U){b.confirmImageResize(function(S){b.resizeImage(D,U,mxUtils.bind(this,function(V,t,z){b.spinner.stop();null!=V&&V.length<b.maxImageBytes?(E.value=V,J()):b.handleError({message:mxResources.get("imageTooBig")})}),S,b.maxImageSize)},D.width>b.maxImageSize||D.height>b.maxImageSize||U.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};D.onerror=function(){b.spinner.stop();-b.handleError({message:mxResources.get("fileNotFound")})};D.src=H}});C.className="geBtn";mxEvent.addListener(E,"change",function(H){c=null;J()});J();A.appendChild(C);u=mxUtils.button(mxResources.get("apply"),function(){v(E.value)});u.className="geBtn gePrimaryBtn";A.appendChild(u);b.editor.cancelFirst||A.appendChild(k);Graph.fileSupport&&(A.style.marginTop="120px",G.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",G.style.backgroundPosition="center 65%",G.style.backgroundRepeat="no-repeat",-u=document.createElement("div"),u.style.position="absolute",u.style.width="420px",u.style.top="58%",u.style.textAlign="center",u.style.fontSize="18px",u.style.color="#a0c3ff",mxUtils.write(u,mxResources.get("dragImagesHere")),G.appendChild(u));G.appendChild(A);this.container=G},LinkDialog=function(b,f,k,d,p,q,u){function A(H,D){var U=document.createElement("option");mxUtils.write(U,mxResources.get(H));U.value=H;B.appendChild(U);C[H]=D}var J=document.createElement("div");J.style.height="100%";mxUtils.write(J,-mxResources.get("editLink")+":");var I=document.createElement("div");I.className="geUrlLinkContainer";I.style.backgroundColor="transparent";I.style.borderColor="transparent";I.style.whiteSpace="nowrap";I.style.textOverflow="clip";I.style.cursor="default";var G=document.createElement("input");G.setAttribute("placeholder",mxResources.get("dragUrlsHere"));G.setAttribute("type","text");G.style.marginTop="6px";G.style.width="414px";G.style.boxSizing="border-box";G.style.backgroundRepeat="no-repeat";G.style.backgroundPosition=-"100% 50%";G.style.paddingRight="16px";G.style.marginBottom="4px";var E=document.createElement("div");E.setAttribute("title",mxResources.get("reset"));E.style.backgroundImage="url("+Editor.crossImage+")";E.className="geAdaptiveAsset";E.style.display="inline-block";E.style.position="relative";E.style.top="3px";E.style.left="-16px";E.style.width="12px";E.style.height="14px";E.style.cursor="pointer";mxEvent.addListener(E,"click",function(){G.value="";G.focus()});var c=document.createElement("input");+null!=k&&k();b.openLink(f,null,!0)});A.className="geBtn gePrimaryBtn";A.style.width=u.style.width;q.appendChild(A);mxUtils.br(q);mxUtils.br(q);mxUtils.write(q,mxResources.get("allowPopups"));this.container=q},ImageDialog=function(b,f,k,d,p,q,u,A){function I(){0<D.value.length?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");"data:"!=D.value.substring(0,5)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}q=null!=q?q:!0;var H=b.editor.graph,F=document.createElement("div");+mxUtils.write(F,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 D=document.createElement("input");D.setAttribute("value",k);D.setAttribute("type","text");D.setAttribute("spellcheck","false");D.setAttribute("autocorrect","off");D.setAttribute("autocomplete","off");D.setAttribute("autocapitalize","off");D.style.marginTop=+"6px";D.style.width=(Graph.fileSupport?460:340)-20+"px";D.style.backgroundImage="url('"+Editor.crossImage+"')";D.style.backgroundRepeat="no-repeat";D.style.backgroundPosition="100% 50%";D.style.paddingRight="14px";k=document.createElement("div");k.setAttribute("title",mxResources.get("reset"));k.style.position="relative";k.style.left="-16px";k.style.width="12px";k.style.height="14px";k.style.cursor="pointer";k.style.display="inline-block";k.style.top="3px";k.style.background="url('"+b.editor.transparentImage++"')";mxEvent.addListener(k,"click",function(){D.value="";D.focus()});f.appendChild(D);f.appendChild(k);F.appendChild(f);var c=A,g,l,n=function(G,N,J,T){var V="data:"==G.substring(0,5);!b.isOffline()||V&&"undefined"===typeof chrome?0<G.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(G,function(t){b.spinner.stop();b.hideDialog();var z=!1===T?1:null!=N&&null!=J?Math.max(N/t.width,J/t.height):Math.min(1,Math.min(520/t.width,520/t.height));q&&(G=b.convertDataUri(G));d(G,+Math.round(Number(t.width)*z),Math.round(Number(t.height)*z),c,g,l)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(G,null,null,c,g,l)):(G=b.convertDataUri(G),N=null==N?120:N,J=null==J?100:J,b.hideDialog(),d(G,N,J,c,g,l))},v=function(G,N){if(null!=G){var J=p?null:H.getModel().getGeometry(H.getSelectionCell());null!=J?n(G,J.width,J.height,N):n(G,null,null,N)}else b.hideDialog(),d(null)};this.init=function(){D.focus();+if(Graph.fileSupport){D.setAttribute("placeholder",mxResources.get("dragImagesHere"));var G=F.parentNode,N=null;mxEvent.addListener(G,"dragleave",function(J){null!=N&&(N.parentNode.removeChild(N),N=null);J.stopPropagation();J.preventDefault()});mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(J){null==N&&(N=b.highlightElement(G));J.stopPropagation();J.preventDefault()}));mxEvent.addListener(G,"drop",mxUtils.bind(this,function(J){null!=N&&(N.parentNode.removeChild(N),N=null);if(0<J.dataTransfer.files.length)b.importFiles(J.dataTransfer.files,+0,0,b.maxImageSize,function(V,t,z,L,K,M,m,y){v(V,y)},function(){},function(V){return"image/"==V.type.substring(0,6)},function(V){for(var t=0;t<V.length;t++)V[t]()},!mxEvent.isControlDown(J),null,null,!0);else if(0<=mxUtils.indexOf(J.dataTransfer.types,"text/uri-list")){var T=J.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(T)&&v(decodeURIComponent(T))}J.stopPropagation();J.preventDefault()}),!1)}};A=document.createElement("div");A.style.marginTop="14px";A.style.textAlign=+"center";k=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});k.className="geBtn";b.editor.cancelFirst&&A.appendChild(k);ImageDialog.filePicked=function(G){G.action==google.picker.Action.PICKED&&null!=G.docs[0].thumbnails&&(G=G.docs[0].thumbnails[G.docs[0].thumbnails.length-1],null!=G&&(D.value=G.url));D.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var x=document.createElement("input");x.setAttribute("multiple","multiple");x.setAttribute("type",+"file");mxEvent.addListener(x,"change",function(G){null!=x.files&&(b.importFiles(x.files,0,0,b.maxImageSize,function(N,J,T,V,t,z){v(N)},function(){},function(N){return"image/"==N.type.substring(0,6)},function(N){for(var J=0;J<N.length;J++)N[J]()},!0),x.type="",x.type="file",x.value="")});x.style.display="none";document.body.appendChild(x);b.imgDlgFileInputElt=x}f=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});f.className="geBtn";A.appendChild(f)}mxEvent.addListener(D,+"keypress",function(G){13==G.keyCode&&v(D.value)});var B=mxUtils.button(mxResources.get("crop"),function(){var G=new CropImageDialog(b,D.value,c,function(N,J,T){c=N;g=J;l=T});b.showDialog(G.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450))});u&&(B.className="geBtn",A.appendChild(B));var C=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=D.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var G=b.editor.createImageUrlConverter().convert(D.value),+N=new Image;N.onload=function(){b.editor.convertImageToDataUri(G,function(J){b.confirmImageResize(function(T){b.resizeImage(N,J,mxUtils.bind(this,function(V,t,z){b.spinner.stop();null!=V&&V.length<b.maxImageBytes?(D.value=V,I()):b.handleError({message:mxResources.get("imageTooBig")})}),T,b.maxImageSize)},N.width>b.maxImageSize||N.height>b.maxImageSize||J.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};N.onerror=function(){b.spinner.stop();+b.handleError({message:mxResources.get("fileNotFound")})};N.src=G}});C.className="geBtn";mxEvent.addListener(D,"change",function(G){c=null;I()});I();A.appendChild(C);u=mxUtils.button(mxResources.get("apply"),function(){v(D.value)});u.className="geBtn gePrimaryBtn";A.appendChild(u);b.editor.cancelFirst||A.appendChild(k);Graph.fileSupport&&(A.style.marginTop="120px",F.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",F.style.backgroundPosition="center 65%",F.style.backgroundRepeat="no-repeat",+u=document.createElement("div"),u.style.position="absolute",u.style.width="420px",u.style.top="58%",u.style.textAlign="center",u.style.fontSize="18px",u.style.color="#a0c3ff",mxUtils.write(u,mxResources.get("dragImagesHere")),F.appendChild(u));F.appendChild(A);this.container=F},LinkDialog=function(b,f,k,d,p,q,u){function A(G,N){var J=document.createElement("option");mxUtils.write(J,mxResources.get(G));J.value=G;B.appendChild(J);C[G]=N}var I=document.createElement("div");I.style.height="100%";mxUtils.write(I,+mxResources.get("editLink")+":");var H=document.createElement("div");H.className="geUrlLinkContainer";H.style.backgroundColor="transparent";H.style.borderColor="transparent";H.style.whiteSpace="nowrap";H.style.textOverflow="clip";H.style.cursor="default";var F=document.createElement("input");F.setAttribute("placeholder",mxResources.get("dragUrlsHere"));F.setAttribute("type","text");F.style.marginTop="6px";F.style.width="414px";F.style.boxSizing="border-box";F.style.backgroundRepeat="no-repeat";F.style.backgroundPosition=+"100% 50%";F.style.paddingRight="16px";F.style.marginBottom="4px";var D=document.createElement("div");D.setAttribute("title",mxResources.get("reset"));D.style.backgroundImage="url("+Editor.crossImage+")";D.className="geAdaptiveAsset";D.style.display="inline-block";D.style.position="relative";D.style.top="3px";D.style.left="-16px";D.style.width="12px";D.style.height="14px";D.style.cursor="pointer";mxEvent.addListener(D,"click",function(){F.value="";F.focus()});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 g=document.createElement("input");g.style.cssText="margin-right:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","geLinkDialogOption");var l=document.createElement("select");l.style.width="414px";var n=document.createElement("input");n.setAttribute("type","checkbox");n.style.margin=-"0 6p 0 6px";null!=u&&(n.setAttribute("checked","checked"),n.defaultChecked=!0);u=null!=u?u:"_blank";n.setAttribute("title",u);q&&(G.style.width="200px");if(p&&null!=b.pages){null!=f&&Graph.isPageLink(f)?(g.setAttribute("checked","checked"),g.defaultChecked=!0):(G.setAttribute("value",f),c.setAttribute("checked","checked"),c.defaultChecked=!0);I.appendChild(c);I.appendChild(G);I.appendChild(E);q&&(I.appendChild(n),mxUtils.write(I,mxResources.get("openInNewWindow")));mxUtils.br(I);I.appendChild(g);-p=!1;for(q=0;q<b.pages.length;q++)E=document.createElement("option"),mxUtils.write(E,b.pages[q].getName()||mxResources.get("pageWithNumber",[q+1])),E.setAttribute("value","data:page/id,"+b.pages[q].getId()),f==E.getAttribute("value")&&(E.setAttribute("selected","selected"),p=!0),l.appendChild(E);if(!p&&g.checked){var v=document.createElement("option");mxUtils.write(v,mxResources.get("pageNotFound"));v.setAttribute("disabled","disabled");v.setAttribute("selected","selected");v.setAttribute("value",-"pageNotFound");l.appendChild(v);mxEvent.addListener(l,"change",function(){null==v.parentNode||v.selected||v.parentNode.removeChild(v)})}I.appendChild(l)}else G.setAttribute("value",f),I.appendChild(G),I.appendChild(E);J.appendChild(I);var x=mxUtils.button(k,function(){b.hideDialog();d(g.checked?"pageNotFound"!==l.value?l.value:f:G.value,LinkDialog.selectedDocs,n.checked?u:null)});x.style.verticalAlign="middle";x.className="geBtn gePrimaryBtn";this.init=function(){g.checked?l.focus():(G.focus(),mxClient.IS_GC||-mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(l,"focus",function(){c.removeAttribute("checked");g.setAttribute("checked","checked");g.checked=!0});mxEvent.addListener(G,"focus",function(){g.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});if(Graph.fileSupport){var H=J.parentNode,D=null;mxEvent.addListener(H,"dragleave",function(U){null!=D&&(D.parentNode.removeChild(D),D=null);U.stopPropagation();U.preventDefault()});-mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(U){null==D&&(D=b.highlightElement(H));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(U){try{null!=D&&(D.parentNode.removeChild(D),D=null),0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")&&(G.value=decodeURIComponent(U.dataTransfer.getData("text/uri-list")),c.setAttribute("checked","checked"),c.checked=!0,x.click())}catch(S){b.handleError(S)}U.stopPropagation();U.preventDefault()}),-!1)}};k=document.createElement("div");k.style.marginTop="16px";k.style.textAlign="right";b.isOffline()||k.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));I=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});I.style.verticalAlign="middle";I.className="geBtn";b.editor.cancelFirst&&k.appendChild(I);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(H){if(H.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=H.docs;var D=H.docs[0].url;"application/mxe"==-H.docs[0].mimeType||null!=H.docs[0].mimeType&&"application/vnd.jgraph."==H.docs[0].mimeType.substring(0,23)?D="https://app.diagrams.net/#G"+H.docs[0].id:"application/vnd.google-apps.folder"==H.docs[0].mimeType&&(D="https://drive.google.com/#folders/"+H.docs[0].id);G.value=D;G.focus()}else LinkDialog.selectedDocs=null;G.focus()};var B=document.createElement("select");B.className="geBtn";B.style.position="relative";B.style.top="1px";B.style.maxWidth="120px";var C={};p=document.createElement("option");-mxUtils.write(p,mxResources.get("select")+"...");p.value="";B.appendChild(p);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&A("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 H=b.drive.createLinkPicker();b.linkPicker=H.setCallback(function(D){LinkDialog.filePicked(D)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&-"undefined"!=typeof Dropbox.choose&&A("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(H){G.value=H[0].link;G.focus()}})});null!=b.oneDrive&&A("oneDrive",function(){b.oneDrive.pickFile(function(H,D){null!=D&&null!=D.value&&0<D.value.length&&(G.value=D.value[0].webUrl,G.focus())},!0)});null!=b.gitHub&&A("github",function(){b.gitHub.pickFile(function(H){if(null!=H){H=H.split("/");var D=H[0],U=H[1],S=H[2];H=H.slice(3,H.length).join("/");G.value="https://github.com/"+-D+"/"+U+"/blob/"+S+"/"+H;G.focus()}})});null!=b.gitLab&&A("gitlab",function(){b.gitLab.pickFile(function(H){if(null!=H){H=H.split("/");var D=H[0],U=H[1],S=H[2];H=H.slice(3,H.length).join("/");G.value=DRAWIO_GITLAB_URL+"/"+D+"/"+U+"/blob/"+S+"/"+H;G.focus()}})});1<B.children.length&&(k.appendChild(B),mxEvent.addListener(B,"change",function(H){null!=C[B.value]&&(C[B.value](),B.value="")}));mxEvent.addListener(G,"keypress",function(H){13==H.keyCode&&x.click()});k.appendChild(x);b.editor.cancelFirst||-k.appendChild(I);J.appendChild(k);this.container=J},RevisionDialog=function(b,f,k){var d=document.createElement("div"),p=document.createElement("h3");p.style.marginTop="3px";mxUtils.write(p,mxResources.get("revisionHistory"));d.appendChild(p);p=document.createElement("div");p.style.position="absolute";p.style.overflow="auto";p.style.width="170px";p.style.height="378px";d.appendChild(p);var q=document.createElement("div");q.style.position="absolute";q.style.left="200px";q.style.width="470px";q.style.height=+"0 6p 0 6px";null!=u&&(n.setAttribute("checked","checked"),n.defaultChecked=!0);u=null!=u?u:"_blank";n.setAttribute("title",u);q&&(F.style.width="200px");if(p&&null!=b.pages){null!=f&&Graph.isPageLink(f)?(g.setAttribute("checked","checked"),g.defaultChecked=!0):(F.setAttribute("value",f),c.setAttribute("checked","checked"),c.defaultChecked=!0);H.appendChild(c);H.appendChild(F);H.appendChild(D);q&&(H.appendChild(n),mxUtils.write(H,mxResources.get("openInNewWindow")));mxUtils.br(H);H.appendChild(g);+p=!1;for(q=0;q<b.pages.length;q++)D=document.createElement("option"),mxUtils.write(D,b.pages[q].getName()||mxResources.get("pageWithNumber",[q+1])),D.setAttribute("value","data:page/id,"+b.pages[q].getId()),f==D.getAttribute("value")&&(D.setAttribute("selected","selected"),p=!0),l.appendChild(D);if(!p&&g.checked){var v=document.createElement("option");mxUtils.write(v,mxResources.get("pageNotFound"));v.setAttribute("disabled","disabled");v.setAttribute("selected","selected");v.setAttribute("value",+"pageNotFound");l.appendChild(v);mxEvent.addListener(l,"change",function(){null==v.parentNode||v.selected||v.parentNode.removeChild(v)})}H.appendChild(l)}else F.setAttribute("value",f),H.appendChild(F),H.appendChild(D);I.appendChild(H);var x=mxUtils.button(k,function(){b.hideDialog();d(g.checked?"pageNotFound"!==l.value?l.value:f:F.value,LinkDialog.selectedDocs,n.checked?u:null)});x.style.verticalAlign="middle";x.className="geBtn gePrimaryBtn";this.init=function(){g.checked?l.focus():(F.focus(),mxClient.IS_GC||+mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(l,"focus",function(){c.removeAttribute("checked");g.setAttribute("checked","checked");g.checked=!0});mxEvent.addListener(F,"focus",function(){g.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});if(Graph.fileSupport){var G=I.parentNode,N=null;mxEvent.addListener(G,"dragleave",function(J){null!=N&&(N.parentNode.removeChild(N),N=null);J.stopPropagation();J.preventDefault()});+mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(J){null==N&&(N=b.highlightElement(G));J.stopPropagation();J.preventDefault()}));mxEvent.addListener(G,"drop",mxUtils.bind(this,function(J){try{null!=N&&(N.parentNode.removeChild(N),N=null),0<=mxUtils.indexOf(J.dataTransfer.types,"text/uri-list")&&(F.value=decodeURIComponent(J.dataTransfer.getData("text/uri-list")),c.setAttribute("checked","checked"),c.checked=!0,x.click())}catch(T){b.handleError(T)}J.stopPropagation();J.preventDefault()}),+!1)}};k=document.createElement("div");k.style.marginTop="16px";k.style.textAlign="right";b.isOffline()||k.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&&k.appendChild(H);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(G){if(G.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=G.docs;var N=G.docs[0].url;"application/mxe"==+G.docs[0].mimeType||null!=G.docs[0].mimeType&&"application/vnd.jgraph."==G.docs[0].mimeType.substring(0,23)?N="https://app.diagrams.net/#G"+G.docs[0].id:"application/vnd.google-apps.folder"==G.docs[0].mimeType&&(N="https://drive.google.com/#folders/"+G.docs[0].id);F.value=N;F.focus()}else LinkDialog.selectedDocs=null;F.focus()};var B=document.createElement("select");B.className="geBtn";B.style.position="relative";B.style.top="1px";B.style.maxWidth="120px";var C={};p=document.createElement("option");+mxUtils.write(p,mxResources.get("select")+"...");p.value="";B.appendChild(p);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&A("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 G=b.drive.createLinkPicker();b.linkPicker=G.setCallback(function(N){LinkDialog.filePicked(N)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&+"undefined"!=typeof Dropbox.choose&&A("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(G){F.value=G[0].link;F.focus()}})});null!=b.oneDrive&&A("oneDrive",function(){b.oneDrive.pickFile(function(G,N){null!=N&&null!=N.value&&0<N.value.length&&(F.value=N.value[0].webUrl,F.focus())},!0)});null!=b.gitHub&&A("github",function(){b.gitHub.pickFile(function(G){if(null!=G){G=G.split("/");var N=G[0],J=G[1],T=G[2];G=G.slice(3,G.length).join("/");F.value="https://github.com/"++N+"/"+J+"/blob/"+T+"/"+G;F.focus()}})});null!=b.gitLab&&A("gitlab",function(){b.gitLab.pickFile(function(G){if(null!=G){G=G.split("/");var N=G[0],J=G[1],T=G[2];G=G.slice(3,G.length).join("/");F.value=DRAWIO_GITLAB_URL+"/"+N+"/"+J+"/blob/"+T+"/"+G;F.focus()}})});1<B.children.length&&(k.appendChild(B),mxEvent.addListener(B,"change",function(G){null!=C[B.value]&&(C[B.value](),B.value="")}));mxEvent.addListener(F,"keypress",function(G){13==G.keyCode&&x.click()});k.appendChild(x);b.editor.cancelFirst||+k.appendChild(H);I.appendChild(k);this.container=I},RevisionDialog=function(b,f,k){var d=document.createElement("div"),p=document.createElement("h3");p.style.marginTop="3px";mxUtils.write(p,mxResources.get("revisionHistory"));d.appendChild(p);p=document.createElement("div");p.style.position="absolute";p.style.overflow="auto";p.style.width="170px";p.style.height="378px";d.appendChild(p);var q=document.createElement("div");q.style.position="absolute";q.style.left="200px";q.style.width="470px";q.style.height="376px";q.style.overflow="hidden";q.style.borderWidth="1px";q.style.borderStyle="solid";var u=document.createElement("div");u.style.position="absolute";u.style.display="none";u.style.textAlign="center";u.style.padding="8px";u.style.borderRadius="8px";u.style.left="50%";u.style.top="50%";u.style.whiteSpace="nowrap";u.style.transform="translate(-50%, -50%)";u.style.background="inherit";u.style.border="1px solid";q.appendChild(u);mxEvent.disableContextMenu(q);d.appendChild(q);var A=new Graph(q);A.setTooltips(!1);-A.setEnabled(!1);A.setPanning(!0);A.panningHandler.ignoreCell=!0;A.panningHandler.useLeftButtonForPanning=!0;A.minFitScale=null;A.maxFitScale=null;A.centerZoom=!0;var J=0,I=null,G=0,E=A.getGlobalVariable;A.getGlobalVariable=function(Y){return"page"==Y&&null!=I&&null!=I[G]?I[G].getAttribute("name"):"pagenumber"==Y?G+1:"pagecount"==Y?null!=I?I.length:1:E.apply(this,arguments)};A.getLinkForCell=function(){return null};for(var c=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%"}),g=b.getCurrentFile(),l=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),n={},v=0;v<l.length;v++)n[l[v].getAttribute("id")]=l[v];var x=null,B=null,C=null,H=null,D=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=C&&A.zoomIn()},20);D.setAttribute("disabled","disabled");var U=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),-function(){null!=C&&A.zoomOut()},20);U.setAttribute("disabled","disabled");var S=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=C&&(1==A.view.scale?(A.maxFitScale=8,A.fit(8)):A.zoomActual(),A.center())},20);S.setAttribute("disabled","disabled");var V=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));V.setAttribute("disabled","disabled");var t=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));t.setAttribute("disabled","disabled");+A.setEnabled(!1);A.setPanning(!0);A.panningHandler.ignoreCell=!0;A.panningHandler.useLeftButtonForPanning=!0;A.minFitScale=null;A.maxFitScale=null;A.centerZoom=!0;var I=0,H=null,F=0,D=A.getGlobalVariable;A.getGlobalVariable=function(Y){return"page"==Y&&null!=H&&null!=H[F]?H[F].getAttribute("name"):"pagenumber"==Y?F+1:"pagecount"==Y?null!=H?H.length:1:D.apply(this,arguments)};A.getLinkForCell=function(){return null};for(var c=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%"}),g=b.getCurrentFile(),l=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),n={},v=0;v<l.length;v++)n[l[v].getAttribute("id")]=l[v];var x=null,B=null,C=null,G=null,N=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=C&&A.zoomIn()},20);N.setAttribute("disabled","disabled");var J=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),+function(){null!=C&&A.zoomOut()},20);J.setAttribute("disabled","disabled");var T=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=C&&(1==A.view.scale?(A.maxFitScale=8,A.fit(8)):A.zoomActual(),A.center())},20);T.setAttribute("disabled","disabled");var V=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));V.setAttribute("disabled","disabled");var t=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));t.setAttribute("disabled","disabled");var z=q.cloneNode(!1);z.style.pointerEvent="none";q.parentNode.appendChild(z);var L=new Graph(z);L.setTooltips(!1);L.setEnabled(!1);L.setPanning(!0);L.panningHandler.ignoreCell=!0;L.panningHandler.useLeftButtonForPanning=!0;L.minFitScale=null;L.maxFitScale=null;L.centerZoom=!0;var K=document.createElement("div");K.style.textAlign="left";K.style.color="gray";K.style.backgroundColor="transparent";K.style.overflow="hidden";K.style.textOverflow="ellipsis";K.style.whiteSpace="nowrap";K.style.cursor="default";-K.style.height="100%";K.style.display="inline-flex";K.style.alignItems="center";K.style.flexGrow="1";mxEvent.addListener(K,"click",function(){var Y=mxUtils.getTextContent(K);""!=Y&&b.alert(Y)});var M=null;mxEvent.addGestureListeners(V,function(Y){try{var Z=null!=I[J]?n[I[J].getAttribute("id")]:null;mxUtils.setOpacity(V,20);u.innerText="";if(null==Z)u.style.display="inline-block",mxUtils.write(u,mxResources.get("pageNotFound"));else{M=K.innerHTML;K.innerHTML=mxResources.get("current");q.style.display=-"none";z.style.display="";z.style.backgroundColor=q.style.backgroundColor;var ba=Editor.parseDiagramNode(Z);(new mxCodec(ba.ownerDocument)).decode(ba,L.getModel());L.view.scaleAndTranslate(A.view.scale,A.view.translate.x,A.view.translate.y);L.mathEnabled="1"==ba.getAttribute("math");L.setAdaptiveColors(ba.getAttribute("adaptiveColors"));Editor.MathJaxRender&&L.mathEnabled&&Editor.MathJaxRender(L.container)}}catch(ea){u.style.display="inline-block",u.innerText="",mxUtils.write(u,mxResources.get("pageNotFound")+-": "+ea.message)}},null,function(){mxUtils.setOpacity(V,60);u.style.display="none";u.innerText="";"none"==q.style.display&&(q.style.display="",K.innerHTML=M,z.style.display="none")});mxEvent.addListener(t,"click",mxUtils.bind(this,function(Y){if(null!=C){Y=b.getPagesForNode(C.documentElement);var Z=b.diffPages(b.pages,Y);Y=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(Z,null,2),function(ba){try{if(0<ba.length&&b.editor.graph.isEnabled()){var ea=[JSON.parse(ba)];b.confirm(mxResources.get("areYouSure"),-function(){try{g.patch(ea,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ha){b.handleError(ha)}})}else b.hideDialog()}catch(ha){b.handleError(ha)}},null,null,null,null,function(ba,ea){if(null!=Z[EditorUi.DIFF_UPDATE]){var ha=document.createElement("select"),fa=document.createElement("option");mxUtils.write(fa,mxResources.get("allPages"));fa.setAttribute("value","allPages");ha.appendChild(fa);for(var la in Z[EditorUi.DIFF_UPDATE]){fa=document.createElement("option");var oa=b.getPageById(la);null!=-oa&&(mxUtils.write(fa,oa.getName()),fa.setAttribute("value","page-"+la),ha.appendChild(fa))}ha.style.marginRight="8px";ha.style.order="-1";mxEvent.addListener(ha,"change",function(pa){pa=null;if("allPages"!=ha.value){var va=ha.value.substring(5);null!=Z[EditorUi.DIFF_UPDATE][va]&&(pa={},pa[EditorUi.DIFF_UPDATE]={},pa[EditorUi.DIFF_UPDATE][va]=Z[EditorUi.DIFF_UPDATE][va])}ea.value=JSON.stringify(null==pa?Z:pa,null,2)});2<ha.children.length&&ba.appendChild(ha)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?-"merge":"close"));b.showDialog(Y.container,620,460,!0,!0);Y.init()}}));var m=mxUtils.button(mxResources.get("restore"),function(Y){null!=C&&null!=H&&b.confirm(mxResources.get("areYouSure"),function(){null!=k?k(H):b.spinner.spin(document.body,mxResources.get("restoring"))&&(m.setAttribute("disabled","disabled"),g.save(!0,function(Z){b.spinner.stop();m.removeAttribute("disabled");b.replaceFileData(H);b.hideDialog()},function(Z){b.spinner.stop();m.removeAttribute("disabled");b.clearStatus();b.handleError(Z,-null!=Z?mxResources.get("errorSavingFile"):null)}))})});m.className="geBtn gePrimaryBtn";m.setAttribute("disabled","disabled");var y=document.createElement("select");y.setAttribute("disabled","disabled");y.style.userSelect="none";y.style.maxWidth="100px";y.style.marginLeft="10px";y.style.display="none";var F=null;mxEvent.addListener(y,"change",function(Y){null!=F&&(F(Y),mxEvent.consume(Y))});var N=mxUtils.button(mxResources.get("open"),function(){null!=C&&(window.openFile=new OpenFile(function(){window.openFile=-null}),window.openFile.setData(mxUtils.getXml(C.documentElement)),b.openLink(b.getUrl(),null,!0))});N.className="geBtn";N.setAttribute("disabled","disabled");var O=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});O.className="geBtn";O.setAttribute("disabled","disabled");null!=k&&(N.style.display="none");l=document.createElement("div");l.style.position="absolute";l.style.top="482px";l.style.right="28px";l.style.left="32px";l.style.justifyContent="end";l.style.display=-"flex";var P=document.createElement("div");P.className="geToolbarContainer";P.style.backgroundColor="transparent";P.style.left="32px";P.style.right="32px";P.style.border="none";P.style.top="442px";var T=null;if(null!=f&&0<f.length){q.style.cursor="move";var Q=document.createElement("table");Q.style.borderWidth="1px";Q.style.borderStyle="solid";Q.style.borderCollapse="collapse";Q.style.borderSpacing="0px";Q.style.width="100%";var R=document.createElement("tbody"),W=(new Date).toDateString();null!=-b.currentPage&&null!=b.pages&&(J=mxUtils.indexOf(b.pages,b.currentPage));for(v=f.length-1;0<=v;v--){var X=function(Y){var Z=new Date(Y.modifiedDate),ba=null;if(0<=Z.getTime()){var ea=function(fa){c.stop();u.innerText="";var la=mxUtils.parseXml(fa),oa=b.editor.extractGraphModel(la.documentElement,!0);if(null!=oa){var pa=function(qa){null!=qa&&(qa=va(Editor.parseDiagramNode(qa)));return qa},va=function(qa){var ua=qa.getAttribute("background");if(null==ua||""==ua||ua==mxConstants.NONE)ua=A.defaultPageBackgroundColor;-q.style.backgroundColor=mxUtils.getLightDarkColor(ua);(new mxCodec(qa.ownerDocument)).decode(qa,A.getModel());A.maxFitScale=1;A.fit(8);A.center();A.mathEnabled="1"==qa.getAttribute("math");A.setAdaptiveColors(qa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&A.mathEnabled&&Editor.MathJaxRender(A.container);return qa};y.style.display="none";y.innerText="";C=la;H=fa;I=parseSelectFunction=null;G=0;if("mxfile"==oa.nodeName){la=oa.getElementsByTagName("diagram");I=[];for(fa=0;fa<la.length;fa++)I.push(la[fa]);-G=Math.min(J,I.length-1);0<I.length&&pa(I[G]);if(1<I.length)for(y.removeAttribute("disabled"),y.style.display="",fa=0;fa<I.length;fa++){la=document.createElement("option");la.setAttribute("title",ta+" ("+I[fa].getAttribute("id")+")");la.setAttribute("value",fa);var ta=I[fa].getAttribute("name")||mxResources.get("pageWithNumber",[fa+1]);oa=b.getPageById(I[fa].getAttribute("id"));var ma="";if(null!=oa){var ia=new DiagramPage(I[fa]);b.getHashValueForPages([oa])!=b.getHashValueForPages([ia])&&(ma=" (M)")}else ma=-" (X)";mxUtils.write(la,ta+ma);fa==G&&la.setAttribute("selected","selected");y.appendChild(la)}F=function(){try{var qa=parseInt(y.value);G=J=qa;pa(I[qa])}catch(ua){y.value=J,b.handleError(ua)}}}else va(oa);ta=Y.lastModifyingUserName;null!=ta&&20<ta.length&&(ta=ta.substring(0,20)+"...");K.innerText="";mxUtils.write(K,(null!=ta?ta+" ":"")+Z.toLocaleDateString()+" "+Z.toLocaleTimeString());K.setAttribute("title",ba.getAttribute("title"));D.removeAttribute("disabled");U.removeAttribute("disabled");S.removeAttribute("disabled");-V.removeAttribute("disabled");t.removeAttribute("disabled");null!=g&&g.isRestricted()||(b.editor.graph.isEnabled()&&m.removeAttribute("disabled"),N.removeAttribute("disabled"),O.removeAttribute("disabled"));mxUtils.setOpacity(D,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(S,60);mxUtils.setOpacity(V,60);mxUtils.setOpacity(t,60)}else y.style.display="none",y.innerText="",K.innerText="",u.innerText="",mxUtils.write(K,mxResources.get("errorLoadingFile")),mxUtils.write(u,mxResources.get("errorLoadingFile"))};-ba=document.createElement("tr");ba.style.borderBottomWidth="1px";ba.style.borderBottomStyle="solid";ba.style.fontSize="12px";ba.style.cursor="pointer";var ha=document.createElement("td");ha.style.padding="6px";ha.style.whiteSpace="nowrap";Y==f[f.length-1]?mxUtils.write(ha,mxResources.get("current")):Z.toDateString()===W?mxUtils.write(ha,Z.toLocaleTimeString()):mxUtils.write(ha,Z.toLocaleDateString()+" "+Z.toLocaleTimeString());ba.appendChild(ha);ba.setAttribute("title",Z.toLocaleDateString()+" "+-Z.toLocaleTimeString()+(null!=Y.fileSize?" "+b.formatFileSize(parseInt(Y.fileSize)):"")+(null!=Y.lastModifyingUserName?" "+Y.lastModifyingUserName:""));mxEvent.addListener(ba,"click",function(fa){B!=Y&&(c.stop(),null!=x&&(x.style.backgroundColor=""),B=Y,x=ba,x.style.backgroundColor="light-dark(#ebf2f9, #000000)",H=C=null,K.removeAttribute("title"),K.innerText=mxResources.get("loading")+"...",q.style.backgroundColor=A.defaultPageBackgroundColor,u.innerText="",A.getModel().clear(),m.setAttribute("disabled",-"disabled"),D.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"),N.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),mxUtils.setOpacity(D,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(S,20),mxUtils.setOpacity(V,20),mxUtils.setOpacity(t,20),c.spin(q),Y.getXml(function(la){if(B==Y)try{ea(la)}catch(oa){K.innerText=mxResources.get("error")+-": "+oa.message}},function(la){c.stop();y.style.display="none";y.innerText="";K.innerText="";mxUtils.write(K,mxResources.get("errorLoadingFile"));mxUtils.write(u,mxResources.get("errorLoadingFile"))}),mxEvent.consume(fa))});mxEvent.addListener(ba,"dblclick",function(fa){N.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(fa)},!1);R.appendChild(ba)}return ba}(f[v]);null!=X&&v==f.length-1&&(T=X)}Q.appendChild(R);p.appendChild(Q)}else null==-g||null==b.drive&&g.constructor==window.DriveFile||null==b.dropbox&&g.constructor==window.DropboxFile?(q.style.display="none",P.style.display="none",mxUtils.write(p,mxResources.get("notAvailable"))):(q.style.display="none",P.style.display="none",mxUtils.write(p,mxResources.get("noRevisions")));this.init=function(){null!=T&&T.click()};p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";P.appendChild(K);P.appendChild(V);P.appendChild(U);P.appendChild(S);P.appendChild(D);-P.appendChild(y);P.appendChild(t);b.editor.cancelFirst&&l.appendChild(p);l.appendChild(N);null!=g&&g.constructor==DriveFile&&l.appendChild(O);l.appendChild(m);b.editor.cancelFirst||l.appendChild(p);d.appendChild(l);d.appendChild(P);this.container=d},DraftDialog=function(b,f,k,d,p,q,u,A,J){var I=document.createElement("div"),G=document.createElement("div");G.style.marginTop="0px";G.style.whiteSpace="nowrap";G.style.overflow="auto";G.style.lineHeight="normal";mxUtils.write(G,f);I.appendChild(G);var E=-document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==E.value?(E.value=E.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var V=this,t;return $jscomp.asyncExecutePromiseGeneratorProgram(function(z){for(t=0;t<J.length;t++)p.apply(V,[t,mxUtils.bind(V,function(){})]);b.hideDialog(!0);z.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(B=mxUtils.parseXml(J[E.value].data),C=b.editor.extractGraphModel(B.documentElement,!0),H=0,-this.init())});if(null!=J){E.style.marginLeft="4px";for(f=0;f<J.length;f++){var g=document.createElement("option");g.setAttribute("value",f);var l=new Date(J[f].created),n=new Date(J[f].modified);mxUtils.write(g,l.toLocaleDateString()+" "+l.toLocaleTimeString()+" - "+(l.toDateString(),n.toDateString(),n.toLocaleDateString())+" "+n.toLocaleTimeString());E.appendChild(g)}g=document.createElement("option");g.setAttribute("value","-1");mxUtils.write(g,mxResources.get("deleteAll"));E.appendChild(g);G.appendChild(E);-mxEvent.addListener(E,"change",c)}null==k&&(k=J[0].data);var v=document.createElement("div");v.style.position="absolute";v.style.border="1px solid lightGray";v.style.marginTop="10px";v.style.left="40px";v.style.right="40px";v.style.top="46px";v.style.bottom="74px";v.style.overflow="hidden";mxEvent.disableContextMenu(v);I.appendChild(v);var x=new Graph(v);x.setEnabled(!1);x.setPanning(!0);x.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";x.panningHandler.ignoreCell=!0;x.panningHandler.useLeftButtonForPanning=-!0;x.minFitScale=null;x.maxFitScale=null;x.centerZoom=!0;var B=mxUtils.parseXml(k),C=b.editor.extractGraphModel(B.documentElement,!0),H=0,D=null,U=x.getGlobalVariable;x.getGlobalVariable=function(V){return"page"==V&&null!=D&&null!=D[H]?D[H].getAttribute("name"):"pagenumber"==V?H+1:"pagecount"==V?null!=D?D.length:1:U.apply(this,arguments)};x.getLinkForCell=function(){return null};k=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){x.zoomIn()},20);G=b.createToolbarButton(Editor.zoomOutImage,-mxResources.get("zoomOut"),function(){x.zoomOut()},20);f=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==x.view.scale?(x.maxFitScale=8,x.fit(8)):x.zoomActual();x.center()},20);u=mxUtils.button(u||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var V=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){p.apply(V,[E.value,mxUtils.bind(V,function(){null!=E.parentNode&&(E.options[E.selectedIndex].parentNode.removeChild(E.options[E.selectedIndex]),-1<E.options.length?(E.value=E.options[0].value,c()):b.hideDialog(!0))})]);t.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});u.className="geBtn";var S=document.createElement("select");S.style.maxWidth="80px";S.style.position="relative";S.style.top="-2px";S.style.verticalAlign="bottom";S.style.marginRight="6px";S.style.display="none";q=mxUtils.button(q||mxResources.get("edit"),function(){d.apply(this,[E.value])});q.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position=+K.style.height="100%";K.style.display="inline-flex";K.style.alignItems="center";K.style.flexGrow="1";mxEvent.addListener(K,"click",function(){var Y=mxUtils.getTextContent(K);""!=Y&&b.alert(Y)});var M=null;mxEvent.addGestureListeners(V,function(Y){try{var Z=null!=H[I]?n[H[I].getAttribute("id")]:null;mxUtils.setOpacity(V,20);u.innerText="";if(null==Z)u.style.display="inline-block",mxUtils.write(u,mxResources.get("pageNotFound"));else{M=K.innerHTML;K.innerHTML=mxResources.get("current");q.style.display=+"none";z.style.display="";z.style.backgroundColor=q.style.backgroundColor;var aa=Editor.parseDiagramNode(Z);(new mxCodec(aa.ownerDocument)).decode(aa,L.getModel());L.view.scaleAndTranslate(A.view.scale,A.view.translate.x,A.view.translate.y);L.mathEnabled="1"==aa.getAttribute("math");L.setAdaptiveColors(aa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&L.mathEnabled&&Editor.MathJaxRender(L.container)}}catch(fa){u.style.display="inline-block",u.innerText="",mxUtils.write(u,mxResources.get("pageNotFound")++": "+fa.message)}},null,function(){mxUtils.setOpacity(V,60);u.style.display="none";u.innerText="";"none"==q.style.display&&(q.style.display="",K.innerHTML=M,z.style.display="none")});mxEvent.addListener(t,"click",mxUtils.bind(this,function(Y){if(null!=C){Y=b.getPagesForNode(C.documentElement);var Z=b.diffPages(b.pages,Y);Y=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(Z,null,2),function(aa){try{if(0<aa.length&&b.editor.graph.isEnabled()){var fa=[JSON.parse(aa)];b.confirm(mxResources.get("areYouSure"),+function(){try{g.patch(fa,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ia){b.handleError(ia)}})}else b.hideDialog()}catch(ia){b.handleError(ia)}},null,null,null,null,function(aa,fa){if(null!=Z[EditorUi.DIFF_UPDATE]){var ia=document.createElement("select"),ea=document.createElement("option");mxUtils.write(ea,mxResources.get("allPages"));ea.setAttribute("value","allPages");ia.appendChild(ea);for(var ma in Z[EditorUi.DIFF_UPDATE]){ea=document.createElement("option");var na=b.getPageById(ma);null!=+na&&(mxUtils.write(ea,na.getName()),ea.setAttribute("value","page-"+ma),ia.appendChild(ea))}ia.style.marginRight="8px";ia.style.order="-1";mxEvent.addListener(ia,"change",function(ua){ua=null;if("allPages"!=ia.value){var ta=ia.value.substring(5);null!=Z[EditorUi.DIFF_UPDATE][ta]&&(ua={},ua[EditorUi.DIFF_UPDATE]={},ua[EditorUi.DIFF_UPDATE][ta]=Z[EditorUi.DIFF_UPDATE][ta])}fa.value=JSON.stringify(null==ua?Z:ua,null,2)});2<ia.children.length&&aa.appendChild(ia)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?+"merge":"close"));b.showDialog(Y.container,620,460,!0,!0);Y.init()}}));var m=mxUtils.button(mxResources.get("restore"),function(Y){null!=C&&null!=G&&b.confirm(mxResources.get("areYouSure"),function(){null!=k?k(G):b.spinner.spin(document.body,mxResources.get("restoring"))&&(m.setAttribute("disabled","disabled"),g.save(!0,function(Z){b.spinner.stop();m.removeAttribute("disabled");b.replaceFileData(G);b.hideDialog()},function(Z){b.spinner.stop();m.removeAttribute("disabled");b.clearStatus();b.handleError(Z,+null!=Z?mxResources.get("errorSavingFile"):null)}))})});m.className="geBtn gePrimaryBtn";m.setAttribute("disabled","disabled");var y=document.createElement("select");y.setAttribute("disabled","disabled");y.style.userSelect="none";y.style.maxWidth="100px";y.style.marginLeft="10px";y.style.display="none";var E=null;mxEvent.addListener(y,"change",function(Y){null!=E&&(E(Y),mxEvent.consume(Y))});var P=mxUtils.button(mxResources.get("open"),function(){null!=C&&(window.openFile=new OpenFile(function(){window.openFile=+null}),window.openFile.setData(mxUtils.getXml(C.documentElement)),b.openLink(b.getUrl(),null,!0))});P.className="geBtn";P.setAttribute("disabled","disabled");var O=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});O.className="geBtn";O.setAttribute("disabled","disabled");null!=k&&(P.style.display="none");l=document.createElement("div");l.style.position="absolute";l.style.top="482px";l.style.right="28px";l.style.left="32px";l.style.justifyContent="end";l.style.display=+"flex";var Q=document.createElement("div");Q.className="geToolbarContainer";Q.style.backgroundColor="transparent";Q.style.left="32px";Q.style.right="32px";Q.style.border="none";Q.style.top="442px";var U=null;if(null!=f&&0<f.length){q.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"),W=(new Date).toDateString();null!=+b.currentPage&&null!=b.pages&&(I=mxUtils.indexOf(b.pages,b.currentPage));for(v=f.length-1;0<=v;v--){var X=function(Y){var Z=new Date(Y.modifiedDate),aa=null;if(0<=Z.getTime()){var fa=function(ea){c.stop();u.innerText="";var ma=mxUtils.parseXml(ea),na=b.editor.extractGraphModel(ma.documentElement,!0);if(null!=na){var ua=function(qa){null!=qa&&(qa=ta(Editor.parseDiagramNode(qa)));return qa},ta=function(qa){var va=qa.getAttribute("background");if(null==va||""==va||va==mxConstants.NONE)va=A.defaultPageBackgroundColor;+q.style.backgroundColor=mxUtils.getLightDarkColor(va);(new mxCodec(qa.ownerDocument)).decode(qa,A.getModel());A.maxFitScale=1;A.fit(8);A.center();A.mathEnabled="1"==qa.getAttribute("math");A.setAdaptiveColors(qa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&A.mathEnabled&&Editor.MathJaxRender(A.container);return qa};y.style.display="none";y.innerText="";C=ma;G=ea;H=parseSelectFunction=null;F=0;if("mxfile"==na.nodeName){ma=na.getElementsByTagName("diagram");H=[];for(ea=0;ea<ma.length;ea++)H.push(ma[ea]);+F=Math.min(I,H.length-1);0<H.length&&ua(H[F]);if(1<H.length)for(y.removeAttribute("disabled"),y.style.display="",ea=0;ea<H.length;ea++){ma=document.createElement("option");ma.setAttribute("title",sa+" ("+H[ea].getAttribute("id")+")");ma.setAttribute("value",ea);var sa=H[ea].getAttribute("name")||mxResources.get("pageWithNumber",[ea+1]);na=b.getPageById(H[ea].getAttribute("id"));var la="";if(null!=na){var ja=new DiagramPage(H[ea]);b.getHashValueForPages([na])!=b.getHashValueForPages([ja])&&(la=" (M)")}else la=+" (X)";mxUtils.write(ma,sa+la);ea==F&&ma.setAttribute("selected","selected");y.appendChild(ma)}E=function(){try{var qa=parseInt(y.value);F=I=qa;ua(H[qa])}catch(va){y.value=I,b.handleError(va)}}}else ta(na);sa=Y.lastModifyingUserName;null!=sa&&20<sa.length&&(sa=sa.substring(0,20)+"...");K.innerText="";mxUtils.write(K,(null!=sa?sa+" ":"")+Z.toLocaleDateString()+" "+Z.toLocaleTimeString());K.setAttribute("title",aa.getAttribute("title"));N.removeAttribute("disabled");J.removeAttribute("disabled");T.removeAttribute("disabled");+V.removeAttribute("disabled");t.removeAttribute("disabled");null!=g&&g.isRestricted()||(b.editor.graph.isEnabled()&&m.removeAttribute("disabled"),P.removeAttribute("disabled"),O.removeAttribute("disabled"));mxUtils.setOpacity(N,60);mxUtils.setOpacity(J,60);mxUtils.setOpacity(T,60);mxUtils.setOpacity(V,60);mxUtils.setOpacity(t,60)}else y.style.display="none",y.innerText="",K.innerText="",u.innerText="",mxUtils.write(K,mxResources.get("errorLoadingFile")),mxUtils.write(u,mxResources.get("errorLoadingFile"))};+aa=document.createElement("tr");aa.style.borderBottomWidth="1px";aa.style.borderBottomStyle="solid";aa.style.fontSize="12px";aa.style.cursor="pointer";var ia=document.createElement("td");ia.style.padding="6px";ia.style.whiteSpace="nowrap";Y==f[f.length-1]?mxUtils.write(ia,mxResources.get("current")):Z.toDateString()===W?mxUtils.write(ia,Z.toLocaleTimeString()):mxUtils.write(ia,Z.toLocaleDateString()+" "+Z.toLocaleTimeString());aa.appendChild(ia);aa.setAttribute("title",Z.toLocaleDateString()+" "++Z.toLocaleTimeString()+(null!=Y.fileSize?" "+b.formatFileSize(parseInt(Y.fileSize)):"")+(null!=Y.lastModifyingUserName?" "+Y.lastModifyingUserName:""));mxEvent.addListener(aa,"click",function(ea){B!=Y&&(c.stop(),null!=x&&(x.style.backgroundColor=""),B=Y,x=aa,x.style.backgroundColor="light-dark(#ebf2f9, #000000)",G=C=null,K.removeAttribute("title"),K.innerText=mxResources.get("loading")+"...",q.style.backgroundColor=A.defaultPageBackgroundColor,u.innerText="",A.getModel().clear(),m.setAttribute("disabled",+"disabled"),N.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),mxUtils.setOpacity(N,20),mxUtils.setOpacity(J,20),mxUtils.setOpacity(T,20),mxUtils.setOpacity(V,20),mxUtils.setOpacity(t,20),c.spin(q),Y.getXml(function(ma){if(B==Y)try{fa(ma)}catch(na){K.innerText=mxResources.get("error")++": "+na.message}},function(ma){c.stop();y.style.display="none";y.innerText="";K.innerText="";mxUtils.write(K,mxResources.get("errorLoadingFile"));mxUtils.write(u,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ea))});mxEvent.addListener(aa,"dblclick",function(ea){P.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ea)},!1);S.appendChild(aa)}return aa}(f[v]);null!=X&&v==f.length-1&&(U=X)}R.appendChild(S);p.appendChild(R)}else null==+g||null==b.drive&&g.constructor==window.DriveFile||null==b.dropbox&&g.constructor==window.DropboxFile?(q.style.display="none",Q.style.display="none",mxUtils.write(p,mxResources.get("notAvailable"))):(q.style.display="none",Q.style.display="none",mxUtils.write(p,mxResources.get("noRevisions")));this.init=function(){null!=U&&U.click()};p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";Q.appendChild(K);Q.appendChild(V);Q.appendChild(J);Q.appendChild(T);Q.appendChild(N);+Q.appendChild(y);Q.appendChild(t);b.editor.cancelFirst&&l.appendChild(p);l.appendChild(P);null!=g&&g.constructor==DriveFile&&l.appendChild(O);l.appendChild(m);b.editor.cancelFirst||l.appendChild(p);d.appendChild(l);d.appendChild(Q);this.container=d},DraftDialog=function(b,f,k,d,p,q,u,A,I){var H=document.createElement("div"),F=document.createElement("div");F.style.marginTop="0px";F.style.whiteSpace="nowrap";F.style.overflow="auto";F.style.lineHeight="normal";mxUtils.write(F,f);H.appendChild(F);var D=+document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==D.value?(D.value=D.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var V=this,t;return $jscomp.asyncExecutePromiseGeneratorProgram(function(z){for(t=0;t<I.length;t++)p.apply(V,[t,mxUtils.bind(V,function(){})]);b.hideDialog(!0);z.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(B=mxUtils.parseXml(I[D.value].data),C=b.editor.extractGraphModel(B.documentElement,!0),G=0,+this.init())});if(null!=I){D.style.marginLeft="4px";for(f=0;f<I.length;f++){var g=document.createElement("option");g.setAttribute("value",f);var l=new Date(I[f].created),n=new Date(I[f].modified);mxUtils.write(g,l.toLocaleDateString()+" "+l.toLocaleTimeString()+" - "+(l.toDateString(),n.toDateString(),n.toLocaleDateString())+" "+n.toLocaleTimeString());D.appendChild(g)}g=document.createElement("option");g.setAttribute("value","-1");mxUtils.write(g,mxResources.get("deleteAll"));D.appendChild(g);F.appendChild(D);+mxEvent.addListener(D,"change",c)}null==k&&(k=I[0].data);var v=document.createElement("div");v.style.position="absolute";v.style.border="1px solid lightGray";v.style.marginTop="10px";v.style.left="40px";v.style.right="40px";v.style.top="46px";v.style.bottom="74px";v.style.overflow="hidden";mxEvent.disableContextMenu(v);H.appendChild(v);var x=new Graph(v);x.setEnabled(!1);x.setPanning(!0);x.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";x.panningHandler.ignoreCell=!0;x.panningHandler.useLeftButtonForPanning=+!0;x.minFitScale=null;x.maxFitScale=null;x.centerZoom=!0;var B=mxUtils.parseXml(k),C=b.editor.extractGraphModel(B.documentElement,!0),G=0,N=null,J=x.getGlobalVariable;x.getGlobalVariable=function(V){return"page"==V&&null!=N&&null!=N[G]?N[G].getAttribute("name"):"pagenumber"==V?G+1:"pagecount"==V?null!=N?N.length:1:J.apply(this,arguments)};x.getLinkForCell=function(){return null};k=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){x.zoomIn()},20);F=b.createToolbarButton(Editor.zoomOutImage,+mxResources.get("zoomOut"),function(){x.zoomOut()},20);f=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==x.view.scale?(x.maxFitScale=8,x.fit(8)):x.zoomActual();x.center()},20);u=mxUtils.button(u||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var V=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){p.apply(V,[D.value,mxUtils.bind(V,function(){null!=D.parentNode&&(D.options[D.selectedIndex].parentNode.removeChild(D.options[D.selectedIndex]),+1<D.options.length?(D.value=D.options[0].value,c()):b.hideDialog(!0))})]);t.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});u.className="geBtn";var T=document.createElement("select");T.style.maxWidth="80px";T.style.position="relative";T.style.top="-2px";T.style.verticalAlign="bottom";T.style.marginRight="6px";T.style.display="none";q=mxUtils.button(q||mxResources.get("edit"),function(){d.apply(this,[D.value])});q.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position="absolute";g.style.bottom="30px";g.style.right="40px";g.style.textAlign="right";l=document.createElement("div");l.className="geToolbarContainer";l.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function V(K){if(null!=K){var M=K.getAttribute("background");if(null==M||""==M||M==mxConstants.NONE)M="light-dark(#ffffff, transparent)";v.style.backgroundColor=M;(new mxCodec(K.ownerDocument)).decode(K,x.getModel());-x.maxFitScale=1;x.fit(8);x.center()}return K}function t(K){null!=K&&(K=V(Editor.parseDiagramNode(K)));return K}mxEvent.addListener(S,"change",function(K){H=parseInt(S.value);t(D[H]);mxEvent.consume(K)});if("mxfile"==C.nodeName){var z=C.getElementsByTagName("diagram");D=[];for(var L=0;L<z.length;L++)D.push(z[L]);0<D.length&&t(D[H]);S.innerText="";if(1<D.length)for(S.style.display="",L=0;L<D.length;L++)z=document.createElement("option"),mxUtils.write(z,D[L].getAttribute("name")||mxResources.get("pageWithNumber",-[L+1])),z.setAttribute("value",L),L==H&&z.setAttribute("selected","selected"),S.appendChild(z);else S.style.display="none"}else V(C)};l.appendChild(S);l.appendChild(k);l.appendChild(G);l.appendChild(f);k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});k.className="geBtn";A=null!=A?mxUtils.button(mxResources.get("ignore"),A):null;null!=A&&(A.className="geBtn");b.editor.cancelFirst?(g.appendChild(k),null!=A&&g.appendChild(A),g.appendChild(u),g.appendChild(q)):(g.appendChild(q),-g.appendChild(u),null!=A&&g.appendChild(A),g.appendChild(k));I.appendChild(g);I.appendChild(l);this.container=I},FindWindow=function(b,f,k,d,p,q){function u(F,N,O){if("object"===typeof N.value&&null!=N.value.attributes){N=N.value.attributes;for(var P=0;P<N.length;P++)if("label"!=N[P].nodeName){var T=mxUtils.trim(N[P].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==F&&0<=T.indexOf(O)||null!=F&&F.test(T))return!0}}return!1}function A(){g?(M.removeAttribute("disabled"),m.removeAttribute("disabled")):-(M.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"));H.value?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}function J(F,N,O){L.innerText="";var P=G.model.getDescendants(G.model.getRoot()),T=H.value.toLowerCase(),Q=U.checked?new RegExp(T):null,R=null;n=null;E!=T&&(E=T,c=null,l=!1);var W=null==c;if(0<T.length){if(l){l=!1;for(var X,Y=0;Y<b.pages.length;Y++)if(b.currentPage==b.pages[Y]){X=Y;break}F=(X+1)%b.pages.length;c=null;do l=!1,P=b.pages[F],G=b.createTemporaryGraph(G.getStylesheet()),-b.updatePageRoot(P),G.model.setRoot(P.root),F=(F+1)%b.pages.length;while(!J(!0,N,O)&&F!=X);c&&(c=null,O?b.editor.graph.model.execute(new SelectPage(b,P)):b.selectPage(P));l=!1;G=b.editor.graph;return J(!0,N,O)}for(Y=0;Y<P.length;Y++){X=G.view.getState(P[Y]);N&&(W=W||X==c);if(null!=X&&null!=X.cell.value&&(W||null==R)&&(G.model.isVertex(X.cell)||G.model.isEdge(X.cell))){null!=X.style&&"1"==X.style.html?(V.innerHTML=G.sanitizeHtml(G.getLabel(X.cell)),label=mxUtils.extractTextWithWhitespace([V])):label=-G.getLabel(X.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Z=0;N&&q&&X==c&&(label=label.substr(v),Z=v);var ba=null==D||""==D.value;if(null==Q&&(0<=label.indexOf(T)||ba&&u(Q,X.cell,T))||null!=Q&&(Q.test(label)||ba&&u(Q,X.cell,T)))if(q&&(null!=Q?(ba=label.match(Q),null!=ba&&0<ba.length&&(n=ba[0].toLowerCase(),v=Z+ba.index+n.length)):(n=T,v=Z+label.indexOf(T)+n.length)),W){R=X;break}else null==R&&(R=X)}W=W||X==c}}if(null!=R){if(Y==P.length&&S.checked)return c=-null,l=!0,J(!0,N,O);c=R;G.scrollCellToVisible(c.cell);G.isEnabled()&&!G.isCellLocked(c.cell)?O||G.getSelectionCell()==c.cell&&1==G.getSelectionCount()||G.setSelectionCell(c.cell):G.highlightCell(c.cell)}else{if(!F&&S.checked)return l=!0,J(!0,N,O);G.isEnabled()&&!O&&G.clearSelection()}g=null!=R;q&&!F&&A();return 0==T.length||null!=R}var I=b.actions.get("findReplace"),G=b.editor.graph,E=null,c=null,g=!1,l=!1,n=null,v=0,x=1,B=document.createElement("div");B.style.userSelect="none";B.style.overflow="hidden";-B.style.padding="10px";B.style.height="100%";var C=q?"260px":"200px",H=document.createElement("input");H.setAttribute("placeholder",mxResources.get("find"));H.setAttribute("type","text");H.style.marginTop="4px";H.style.marginBottom="6px";H.style.width=C;H.style.fontSize="12px";H.style.borderRadius="4px";H.style.padding="6px";B.appendChild(H);mxUtils.br(B);if(q){var D=document.createElement("input");D.setAttribute("placeholder",mxResources.get("replaceWith"));D.setAttribute("type","text");D.style.marginTop=-"4px";D.style.marginBottom="6px";D.style.width=C;D.style.fontSize="12px";D.style.borderRadius="4px";D.style.padding="6px";B.appendChild(D);mxUtils.br(B);mxEvent.addListener(D,"input",A)}var U=document.createElement("input");U.setAttribute("id","geFindWinRegExChck");U.setAttribute("type","checkbox");U.style.marginRight="4px";B.appendChild(U);C=document.createElement("label");C.setAttribute("for","geFindWinRegExChck");B.appendChild(C);mxUtils.write(C,mxResources.get("regularExpression"));B.appendChild(C);-C=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");C.style.position="relative";C.style.marginLeft="6px";B.appendChild(C);mxUtils.br(B);var S=document.createElement("input");S.setAttribute("id","geFindWinAllPagesChck");S.setAttribute("type","checkbox");S.style.marginRight="4px";B.appendChild(S);C=document.createElement("label");C.setAttribute("for","geFindWinAllPagesChck");B.appendChild(C);mxUtils.write(C,mxResources.get("allPages"));B.appendChild(C);var V=document.createElement("div");-mxUtils.br(B);C=document.createElement("div");C.style.left="0px";C.style.right="0px";C.style.marginTop="6px";C.style.padding="0 6px 0 6px";B.appendChild(C);var t=mxUtils.button(mxResources.get("reset"),function(){L.innerText="";H.value="";H.style.backgroundColor="";q&&(D.value="",A());E=c=null;l=!1;H.focus()});t.setAttribute("title",mxResources.get("reset"));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";q||C.appendChild(t);var z=mxUtils.button(mxResources.get("find"),function(){try{H.style.backgroundColor=J()?"":"light-dark(#ffcfcf, #ff0000)"}catch(F){b.handleError(F)}});z.setAttribute("title",mxResources.get("find")+" (Enter)");z.style.float="none";z.style.width="120px";z.style.marginTop="6px";z.style.marginLeft="8px";z.style.overflow="hidden";z.style.textOverflow="ellipsis";z.className="geBtn gePrimaryBtn";C.appendChild(z);var L=document.createElement("div");L.style.marginTop=-"10px";if(q){var K=function(F,N,O,P,T){if(null==T||"1"!=T.html)return P=F.toLowerCase().indexOf(N,P),0>P?F:F.substr(0,P)+O+F.substr(P+N.length);var Q=F;N=mxUtils.htmlEntities(N,!1,!1,!1);T=[];var R=-1;for(F=F.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<(R=F.indexOf("<",R+1));)T.push(R);R=F.match(/<[^>]*>/g);F=F.replace(/<[^>]*>/g,"");P=F.toLowerCase().indexOf(N,P);if(0>P)return Q;Q=P+N.length;O=mxUtils.htmlEntities(O);F=F.substr(0,-P)+O+F.substr(Q);for(var W=0,X=0;X<T.length;X++){if(T[X]-W<P)F=F.substr(0,T[X])+R[X]+F.substr(T[X]);else{var Y=T[X]-W<Q?P+W:T[X]+(O.length-N.length);F=F.substr(0,Y)+R[X]+F.substr(Y)}W+=R[X].length}return F.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};C.style.textAlign="center";var M=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=n&&null!=c){var F=c.cell,N=G.getLabel(F);G.isCellEditable(F)&&G.model.setValue(F,K(N,n,D.value,-v-n.length,G.getCurrentCellStyle(F)));H.style.backgroundColor=J(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(O){b.handleError(O)}});M.setAttribute("title",mxResources.get("replFind"));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");C.appendChild(M);mxUtils.br(C);var m=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=-n&&null!=c){var F=c.cell,N=G.getLabel(F);G.model.setValue(F,K(N,n,D.value,v-n.length,G.getCurrentCellStyle(F)));M.setAttribute("disabled","disabled");m.setAttribute("disabled","disabled")}}catch(O){b.handleError(O)}});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");C.appendChild(m);-var y=mxUtils.button(mxResources.get("replaceAll"),function(){L.innerText="";E=null;var F=b.currentPage,N=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;G.getModel().beginUpdate();try{for(var O=0,P={};J(!1,!0,!0)&&100>O;){var T=c.cell,Q=G.getLabel(T),R=P[T.id];if(R&&R.replAllMrk==x&&R.replAllPos>=v)break;P[T.id]={replAllMrk:x,replAllPos:v};G.isCellEditable(T)&&(G.model.setValue(T,K(Q,n,D.value,v-n.length,G.getCurrentCellStyle(T))),O++)}F!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,-F));mxUtils.write(L,mxResources.get("matchesRepl",[O]))}catch(W){b.handleError(W)}finally{G.getModel().endUpdate(),b.editor.graph.setSelectionCells(N),b.editor.graph.rendering=!0}x++});y.setAttribute("title",mxResources.get("replaceAll"));y.style.float="none";y.style.width="120px";y.style.marginTop="6px";y.style.marginLeft="8px";y.style.overflow="hidden";y.style.textOverflow="ellipsis";y.className="geBtn gePrimaryBtn";y.setAttribute("disabled","disabled");C.appendChild(y);mxUtils.br(C);C.appendChild(t);-t=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));t.setAttribute("title",mxResources.get("close"));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";C.appendChild(t);mxUtils.br(C);C.appendChild(L)}else C.style.display="flex",C.style.alignItems="center",t.style.width="",z.style.width="";mxEvent.addListener(H,"keyup",function(F){if(91==-F.keyCode||93==F.keyCode||17==F.keyCode)mxEvent.consume(F);else if(27==F.keyCode)I.funct();else if(E!=H.value.toLowerCase()||13==F.keyCode)try{H.style.backgroundColor=J()?"":"light-dark(#ffcfcf, #ff0000)"}catch(N){H.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(B,"keydown",function(F){70==F.keyCode&&b.keyHandler.isControlDown(F)&&!mxEvent.isShiftDown(F)&&(I.funct(),mxEvent.consume(F))});this.window=new mxWindow(mxResources.get("find")+(q?"/"+mxResources.get("replace"):-""),B,f,k,d,p,!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()?(H.focus(),mxClient.IS_GC||mxClient.IS_FF?H.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?S.removeAttribute("disabled"):(S.checked=!1,S.setAttribute("disabled","disabled"))):G.container.focus()}));b.installResizeHandler(this,-!1);this.doSearch=function(F){H.focus();H.value=F;z.click()}},FreehandWindow=function(b,f,k,d,p,q){var u=b.editor.graph,A=document.createElement("div");A.style.textAlign="center";A.style.userSelect="none";A.style.overflow="hidden";A.style.height="100%";if(q){var J=function(){var g=u.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&&G.setAttribute("title",g))},I=document.createElement("input");I.setAttribute("id","geFreehandBrush");I.setAttribute("type","checkbox");I.checked=u.freehand.isPerfectFreehandMode();I.style.margin="10px 5px 0px 10px";I.style.float="left";A.appendChild(I);u.freehand.setPerfectFreehandMode(I.checked);q=document.createElement("label");q.setAttribute("for","geFreehandBrush");q.style.float="left";q.style.marginTop="10px";A.appendChild(q);mxUtils.write(q,mxResources.get("brush"));A.appendChild(q);-var G=document.createElement("tempDiv");G.style.display="block";G.style.width="100%";G.style.height="100%";G.style.borderRadius="2px";G.style.boxSizing="border-box";G.style.border="1px solid black";G.style.backgroundColor=u.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){G.style.backgroundColor=u.freehand.getStrokeColor()});J();q=mxUtils.button("",mxUtils.bind(this,function(g){b.pickColor(u.freehand.getStrokeColor(!0),function(l){u.freehand.setStrokeColor(l);G.style.backgroundColor=-u.freehand.getStrokeColor();J()},"default");mxEvent.consume(g)}));q.style.position="absolute";q.style.boxSizing="border-box";q.style.padding="2px";q.style.top="8px";q.style.right="8px";q.style.width="28px";q.style.height="18px";q.className="geColorBtn";q.innerText="";q.appendChild(G);A.appendChild(q);q=document.createElement("img");q.setAttribute("title",mxResources.get("settings"));q.setAttribute("src",Editor.gearImage);q.className="geButton";q.style.position="absolute";q.style.boxSizing="border-box";-q.style.padding="2px";q.style.top="8px";q.style.right="38px";q.style.width="18px";q.style.height="18px";q.style.opacity="0.6";A.appendChild(q);mxEvent.addListener(q,"click",mxUtils.bind(this,function(g){g=u.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",g,function(l){!isNaN(l)&&0<l&&20>=l&&u.freehand.setSmoothing(parseInt(l))})}));mxUtils.br(A);var E=document.createElement("input");E.setAttribute("type","range");E.setAttribute("min","2");E.setAttribute("max","30");E.setAttribute("value",-u.freehand.getBrushSize());E.style.width="90%";E.style.visibility="hidden";A.appendChild(E);mxUtils.br(A);q=function(){u.freehand.setPerfectFreehandMode(I.checked);E.style.visibility=I.checked?"visible":"hidden"};mxEvent.addListener(I,"change",q);q();mxEvent.addListener(E,"change",function(){u.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){u.freehand.isDrawing()?u.freehand.stopDrawing():u.freehand.startDrawing()});c.setAttribute("title",+x.maxFitScale=1;x.fit(8);x.center()}return K}function t(K){null!=K&&(K=V(Editor.parseDiagramNode(K)));return K}mxEvent.addListener(T,"change",function(K){G=parseInt(T.value);t(N[G]);mxEvent.consume(K)});if("mxfile"==C.nodeName){var z=C.getElementsByTagName("diagram");N=[];for(var L=0;L<z.length;L++)N.push(z[L]);0<N.length&&t(N[G]);T.innerText="";if(1<N.length)for(T.style.display="",L=0;L<N.length;L++)z=document.createElement("option"),mxUtils.write(z,N[L].getAttribute("name")||mxResources.get("pageWithNumber",+[L+1])),z.setAttribute("value",L),L==G&&z.setAttribute("selected","selected"),T.appendChild(z);else T.style.display="none"}else V(C)};l.appendChild(T);l.appendChild(k);l.appendChild(F);l.appendChild(f);k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});k.className="geBtn";A=null!=A?mxUtils.button(mxResources.get("ignore"),A):null;null!=A&&(A.className="geBtn");b.editor.cancelFirst?(g.appendChild(k),null!=A&&g.appendChild(A),g.appendChild(u),g.appendChild(q)):(g.appendChild(q),+g.appendChild(u),null!=A&&g.appendChild(A),g.appendChild(k));H.appendChild(g);H.appendChild(l);this.container=H},FindWindow=function(b,f,k,d,p,q){function u(E,P,O){if("object"===typeof P.value&&null!=P.value.attributes){P=P.value.attributes;for(var Q=0;Q<P.length;Q++)if("label"!=P[Q].nodeName){var U=mxUtils.trim(P[Q].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==E&&0<=U.indexOf(O)||null!=E&&E.test(U))return!0}}return!1}function A(){g?(M.removeAttribute("disabled"),m.removeAttribute("disabled")):+(M.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"));G.value?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}function I(E,P,O){L.innerText="";var Q=F.model.getDescendants(F.model.getRoot()),U=G.value.toLowerCase(),R=J.checked?new RegExp(U):null,S=null;n=null;D!=U&&(D=U,c=null,l=!1);var W=null==c;if(0<U.length){if(l){l=!1;for(var X,Y=0;Y<b.pages.length;Y++)if(b.currentPage==b.pages[Y]){X=Y;break}E=(X+1)%b.pages.length;c=null;do l=!1,Q=b.pages[E],F=b.createTemporaryGraph(F.getStylesheet()),+b.updatePageRoot(Q),F.model.setRoot(Q.root),E=(E+1)%b.pages.length;while(!I(!0,P,O)&&E!=X);c&&(c=null,O?b.editor.graph.model.execute(new SelectPage(b,Q)):b.selectPage(Q));l=!1;F=b.editor.graph;return I(!0,P,O)}for(Y=0;Y<Q.length;Y++){X=F.view.getState(Q[Y]);P&&(W=W||X==c);if(null!=X&&null!=X.cell.value&&(W||null==S)&&(F.model.isVertex(X.cell)||F.model.isEdge(X.cell))){null!=X.style&&"1"==X.style.html?(V.innerHTML=F.sanitizeHtml(F.getLabel(X.cell)),label=mxUtils.extractTextWithWhitespace([V])):label=+F.getLabel(X.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Z=0;P&&q&&X==c&&(label=label.substr(v),Z=v);var aa=null==N||""==N.value;if(null==R&&(0<=label.indexOf(U)||aa&&u(R,X.cell,U))||null!=R&&(R.test(label)||aa&&u(R,X.cell,U)))if(q&&(null!=R?(aa=label.match(R),null!=aa&&0<aa.length&&(n=aa[0].toLowerCase(),v=Z+aa.index+n.length)):(n=U,v=Z+label.indexOf(U)+n.length)),W){S=X;break}else null==S&&(S=X)}W=W||X==c}}if(null!=S){if(Y==Q.length&&T.checked)return c=+null,l=!0,I(!0,P,O);c=S;F.scrollCellToVisible(c.cell);F.isEnabled()&&!F.isCellLocked(c.cell)?O||F.getSelectionCell()==c.cell&&1==F.getSelectionCount()||F.setSelectionCell(c.cell):F.highlightCell(c.cell)}else{if(!E&&T.checked)return l=!0,I(!0,P,O);F.isEnabled()&&!O&&F.clearSelection()}g=null!=S;q&&!E&&A();return 0==U.length||null!=S}var H=b.actions.get("findReplace"),F=b.editor.graph,D=null,c=null,g=!1,l=!1,n=null,v=0,x=1,B=document.createElement("div");B.style.userSelect="none";B.style.overflow="hidden";+B.style.padding="10px";B.style.height="100%";var C=q?"260px":"200px",G=document.createElement("input");G.setAttribute("placeholder",mxResources.get("find"));G.setAttribute("type","text");G.style.marginTop="4px";G.style.marginBottom="6px";G.style.width=C;G.style.fontSize="12px";G.style.borderRadius="4px";G.style.padding="6px";B.appendChild(G);mxUtils.br(B);if(q){var N=document.createElement("input");N.setAttribute("placeholder",mxResources.get("replaceWith"));N.setAttribute("type","text");N.style.marginTop=+"4px";N.style.marginBottom="6px";N.style.width=C;N.style.fontSize="12px";N.style.borderRadius="4px";N.style.padding="6px";B.appendChild(N);mxUtils.br(B);mxEvent.addListener(N,"input",A)}var J=document.createElement("input");J.setAttribute("id","geFindWinRegExChck");J.setAttribute("type","checkbox");J.style.marginRight="4px";B.appendChild(J);C=document.createElement("label");C.setAttribute("for","geFindWinRegExChck");B.appendChild(C);mxUtils.write(C,mxResources.get("regularExpression"));B.appendChild(C);+C=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");C.style.position="relative";C.style.marginLeft="6px";B.appendChild(C);mxUtils.br(B);var T=document.createElement("input");T.setAttribute("id","geFindWinAllPagesChck");T.setAttribute("type","checkbox");T.style.marginRight="4px";B.appendChild(T);C=document.createElement("label");C.setAttribute("for","geFindWinAllPagesChck");B.appendChild(C);mxUtils.write(C,mxResources.get("allPages"));B.appendChild(C);var V=document.createElement("div");+mxUtils.br(B);C=document.createElement("div");C.style.left="0px";C.style.right="0px";C.style.marginTop="6px";C.style.padding="0 6px 0 6px";B.appendChild(C);var t=mxUtils.button(mxResources.get("reset"),function(){L.innerText="";G.value="";G.style.backgroundColor="";q&&(N.value="",A());D=c=null;l=!1;G.focus()});t.setAttribute("title",mxResources.get("reset"));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";q||C.appendChild(t);var z=mxUtils.button(mxResources.get("find"),function(){try{G.style.backgroundColor=I()?"":"light-dark(#ffcfcf, #ff0000)"}catch(E){b.handleError(E)}});z.setAttribute("title",mxResources.get("find")+" (Enter)");z.style.float="none";z.style.width="120px";z.style.marginTop="6px";z.style.marginLeft="8px";z.style.overflow="hidden";z.style.textOverflow="ellipsis";z.className="geBtn gePrimaryBtn";C.appendChild(z);var L=document.createElement("div");L.style.marginTop=+"10px";if(q){var K=function(E,P,O,Q,U){if(null==U||"1"!=U.html)return Q=E.toLowerCase().indexOf(P,Q),0>Q?E:E.substr(0,Q)+O+E.substr(Q+P.length);var R=E;P=mxUtils.htmlEntities(P,!1,!1,!1);U=[];var S=-1;for(E=E.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=E.indexOf("<",S+1));)U.push(S);S=E.match(/<[^>]*>/g);E=E.replace(/<[^>]*>/g,"");Q=E.toLowerCase().indexOf(P,Q);if(0>Q)return R;R=Q+P.length;O=mxUtils.htmlEntities(O);E=E.substr(0,+Q)+O+E.substr(R);for(var W=0,X=0;X<U.length;X++){if(U[X]-W<Q)E=E.substr(0,U[X])+S[X]+E.substr(U[X]);else{var Y=U[X]-W<R?Q+W:U[X]+(O.length-P.length);E=E.substr(0,Y)+S[X]+E.substr(Y)}W+=S[X].length}return E.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};C.style.textAlign="center";var M=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=n&&null!=c){var E=c.cell,P=F.getLabel(E);F.isCellEditable(E)&&F.model.setValue(E,K(P,n,N.value,+v-n.length,F.getCurrentCellStyle(E)));G.style.backgroundColor=I(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(O){b.handleError(O)}});M.setAttribute("title",mxResources.get("replFind"));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");C.appendChild(M);mxUtils.br(C);var m=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=+n&&null!=c){var E=c.cell,P=F.getLabel(E);F.model.setValue(E,K(P,n,N.value,v-n.length,F.getCurrentCellStyle(E)));M.setAttribute("disabled","disabled");m.setAttribute("disabled","disabled")}}catch(O){b.handleError(O)}});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");C.appendChild(m);+var y=mxUtils.button(mxResources.get("replaceAll"),function(){L.innerText="";D=null;var E=b.currentPage,P=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;F.getModel().beginUpdate();try{for(var O=0,Q={};I(!1,!0,!0)&&100>O;){var U=c.cell,R=F.getLabel(U),S=Q[U.id];if(S&&S.replAllMrk==x&&S.replAllPos>=v)break;Q[U.id]={replAllMrk:x,replAllPos:v};F.isCellEditable(U)&&(F.model.setValue(U,K(R,n,N.value,v-n.length,F.getCurrentCellStyle(U))),O++)}E!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,+E));mxUtils.write(L,mxResources.get("matchesRepl",[O]))}catch(W){b.handleError(W)}finally{F.getModel().endUpdate(),b.editor.graph.setSelectionCells(P),b.editor.graph.rendering=!0}x++});y.setAttribute("title",mxResources.get("replaceAll"));y.style.float="none";y.style.width="120px";y.style.marginTop="6px";y.style.marginLeft="8px";y.style.overflow="hidden";y.style.textOverflow="ellipsis";y.className="geBtn gePrimaryBtn";y.setAttribute("disabled","disabled");C.appendChild(y);mxUtils.br(C);C.appendChild(t);+t=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));t.setAttribute("title",mxResources.get("close"));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";C.appendChild(t);mxUtils.br(C);C.appendChild(L)}else C.style.display="flex",C.style.alignItems="center",t.style.width="",z.style.width="";mxEvent.addListener(G,"keyup",function(E){if(91==+E.keyCode||93==E.keyCode||17==E.keyCode)mxEvent.consume(E);else if(27==E.keyCode)H.funct();else if(D!=G.value.toLowerCase()||13==E.keyCode)try{G.style.backgroundColor=I()?"":"light-dark(#ffcfcf, #ff0000)"}catch(P){G.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(B,"keydown",function(E){70==E.keyCode&&b.keyHandler.isControlDown(E)&&!mxEvent.isShiftDown(E)&&(H.funct(),mxEvent.consume(E))});this.window=new mxWindow(mxResources.get("find")+(q?"/"+mxResources.get("replace"):+""),B,f,k,d,p,!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()?(G.focus(),mxClient.IS_GC||mxClient.IS_FF?G.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?T.removeAttribute("disabled"):(T.checked=!1,T.setAttribute("disabled","disabled"))):F.container.focus()}));b.installResizeHandler(this,+!1);this.doSearch=function(E){G.focus();G.value=E;z.click()}},FreehandWindow=function(b,f,k,d,p,q){var u=b.editor.graph,A=document.createElement("div");A.style.textAlign="center";A.style.userSelect="none";A.style.overflow="hidden";A.style.height="100%";if(q){var I=function(){var g=u.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&&F.setAttribute("title",g))},H=document.createElement("input");H.setAttribute("id","geFreehandBrush");H.setAttribute("type","checkbox");H.checked=u.freehand.isPerfectFreehandMode();H.style.margin="10px 5px 0px 10px";H.style.float="left";A.appendChild(H);u.freehand.setPerfectFreehandMode(H.checked);q=document.createElement("label");q.setAttribute("for","geFreehandBrush");q.style.float="left";q.style.marginTop="10px";A.appendChild(q);mxUtils.write(q,mxResources.get("brush"));A.appendChild(q);+var F=document.createElement("tempDiv");F.style.display="block";F.style.width="100%";F.style.height="100%";F.style.borderRadius="2px";F.style.boxSizing="border-box";F.style.border="1px solid black";F.style.backgroundColor=u.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){F.style.backgroundColor=u.freehand.getStrokeColor()});I();q=mxUtils.button("",mxUtils.bind(this,function(g){b.pickColor(u.freehand.getStrokeColor(!0),function(l){u.freehand.setStrokeColor(l);F.style.backgroundColor=+u.freehand.getStrokeColor();I()},"default");mxEvent.consume(g)}));q.style.position="absolute";q.style.boxSizing="border-box";q.style.padding="2px";q.style.top="8px";q.style.right="8px";q.style.width="28px";q.style.height="18px";q.className="geColorBtn";q.innerText="";q.appendChild(F);A.appendChild(q);q=document.createElement("img");q.setAttribute("title",mxResources.get("settings"));q.setAttribute("src",Editor.gearImage);q.className="geButton";q.style.position="absolute";q.style.boxSizing="border-box";+q.style.padding="2px";q.style.top="8px";q.style.right="38px";q.style.width="18px";q.style.height="18px";q.style.opacity="0.6";A.appendChild(q);mxEvent.addListener(q,"click",mxUtils.bind(this,function(g){g=u.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",g,function(l){!isNaN(l)&&0<l&&20>=l&&u.freehand.setSmoothing(parseInt(l))})}));mxUtils.br(A);var D=document.createElement("input");D.setAttribute("type","range");D.setAttribute("min","2");D.setAttribute("max","30");D.setAttribute("value",+u.freehand.getBrushSize());D.style.width="90%";D.style.visibility="hidden";A.appendChild(D);mxUtils.br(A);q=function(){u.freehand.setPerfectFreehandMode(H.checked);D.style.visibility=H.checked?"visible":"hidden"};mxEvent.addListener(H,"change",q);q();mxEvent.addListener(D,"change",function(){u.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){u.freehand.isDrawing()?u.freehand.stopDrawing():u.freehand.startDrawing()});c.setAttribute("title",mxResources.get("startDrawing")+" (X)");c.style.width="90%";c.style.marginLeft="0px";c.style.position="relative";c.className="geBtn gePrimaryBtn";A.appendChild(c);this.window=new mxWindow(mxResources.get("freehand"),A,f,k,d,p,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);u.addListener("freehandStateChanged",mxUtils.bind(this,function(){c.innerText="";mxUtils.write(c,mxResources.get(u.freehand.isDrawing()?"stopDrawing":"startDrawing"));var g=document.createElement("span");g.className="geShortcutKey";g.style.margin="0 2px 4px 0";mxUtils.write(g,"X");c.appendChild(g);c.setAttribute("title",mxResources.get(u.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");c.className="geBtn"+(u.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){u.freehand.isDrawing()&&u.freehand.stopDrawing()}));-b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,f,k,d,p){var q=b.editor.graph,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.height="100%";var A=document.createElement("div");A.style.display="flex";A.style.alignItems="center";A.style.justifyContent="center";A.style.paddingTop="20px";var J=document.createElement("input");J.setAttribute("type","checkbox");J.style.marginRight="4px";J.checked=!0;var I=document.createElement("input");I.setAttribute("type",-"checkbox");I.style.marginRight="4px";I.checked=!0;var G=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(q.isSelectionEmpty()?q.getVerticesAndEdges():q.getSelectionCells(),J.checked,I.checked)}));G.setAttribute("title","Convert Colors");G.className="geBtn gePrimaryBtn";A.appendChild(G);u.appendChild(A);A=A.cloneNode(!1);A.appendChild(I);A.style.paddingTop="8px";mxUtils.write(A,mxResources.get("background"));u.appendChild(A);-A=A.cloneNode(!1);A.appendChild(J);A.style.paddingTop="8px";mxUtils.write(A,mxResources.get("labels"));u.appendChild(A);this.window=new mxWindow(mxResources.get("adaptiveColors"),u,f,k,d,p,!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,k,d,p){function q(){t||-(z=n.value,L());D.style.display="createPublic"==n.value?"none":""}function u(){t=!0;n.value=z;G.isSelectionEmpty()?(B.setAttribute("disabled","disabled"),"selectionOnly"==n.value&&(n.value="includeCopyOfMyDiagram")):B.removeAttribute("disabled");b.isDiagramEmpty()?(x.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==n.value&&(n.value="help")):x.removeAttribute("disabled");t=!1}function A(K){var M=document.createElement("div");M.style.textAlign="left";M.style.padding="6px";M.style.margin=-"6px 0";mxUtils.write(M,K);c.appendChild(M);return M}function J(K){function M(ta){var ma=document.createElement("div");ma.style.display="flex";var ia=document.createElement("img");ia.className="geAdaptiveAsset geLibraryButton";ia.setAttribute("src",Editor.refreshImage);ia.setAttribute("title",null!=ta?ta:mxResources.get("tryAgain"));ma.appendChild(ia);mxEvent.addListener(ia,"click",va);return ma}function m(ta){var ma=document.createElement("div");ma.style.whiteSpace="pre-wrap";ma.style.overflow="auto";-ma.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(ta,!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return ma}function y(ta){var ma=mxResources.get("error")+": ",ia=document.createElement("div");ia.style.whiteSpace=-"pre-wrap";ta.substring(0,ma.length)!=ma&&(ta=ma+ta);mxUtils.write(ia,ta);ia.appendChild(M());return ia}var F=[],N=A(K);F.push(N);N.style.marginBottom="2px";N.style.marginLeft="40%";N.style.borderRadius="10px";N.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";var O=document.createElement("div");O.className="geInlineButtons";O.style.display="flex";O.style.justifyContent="end";F.push(O);var P=document.createElement("img");P.className="geAdaptiveAsset geLibraryButton";P.setAttribute("src",Editor.trashImage);-P.setAttribute("title",mxResources.get("remove"));O.appendChild(P);mxEvent.addListener(P,"click",mxUtils.bind(this,function(ta){if(mxEvent.isShiftDown(ta))c.innerHTML="";else{for(ta=0;ta<F.length;ta++)null!=F[ta].parentNode&&F[ta].parentNode.removeChild(F[ta]);F=[]}}));P=P.cloneNode();P.setAttribute("src",Editor.copyImage);P.setAttribute("title",mxResources.get("copy"));mxEvent.addListener(P,"click",mxUtils.bind(this,function(){b.writeTextToClipboard(K,mxUtils.bind(this,function(ta){b.handleError(ta)}),-function(){b.alert(mxResources.get("copiedToClipboard"))})}));O.appendChild(P);P=P.cloneNode();P.setAttribute("src",Editor.editImage);P.setAttribute("title",mxResources.get("edit"));O.appendChild(P);mxEvent.addListener(P,"click",mxUtils.bind(this,function(){V.value=K;V.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?V.select():document.execCommand("selectAll",!1,null)}));c.appendChild(O);var T=A("");T.className="geSidebar";T.style.marginTop="2px";var Q=mxUtils.bind(this,function(ta){T.innerHTML=-"";T.appendChild(y(ta.message));T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",ta);null!=window.console&&console.error(ta)}),R=b.currentPage,W=D.value,X=n.value,Y=null;for(O=0;O<Editor.aiModels.length;O++)if(P=Editor.aiModels[O],P.name==W){Y=P;break}if("createPublic"==X||null!=Y&&null!=Editor.aiConfigs[Y.config]){var Z=null!=Y?Editor.aiConfigs[Y.config]:null,ba=null,ea=Date.now(),ha=null,fa=null;if("includeCopyOfMyDiagram"==-X||"selectionOnly"==X)O=new mxCodec(mxUtils.createXmlDocument()),"selectionOnly"==X&&(O.isObjectIgnored=function(ta){return ta.constructor==mxCell&&!G.model.isRoot(ta)&&!G.model.isLayer(ta)&&!G.isCellSelected(ta)&&!G.isAncestorSelected(ta)}),fa=O.encode(G.getModel()),fa.ownerDocument.appendChild(fa),ha=mxUtils.getXml(fa);var la=function(ta){var ma=null;"prompt"==ta?ma=K:"data"==ta&&null!=fa?ma=ha:"model"==ta?ma=Y.model:"apiKey"==ta?ta=Z.apiKey:"action"==ta&&(ta="selectionOnly"==X||"includeCopyOfMyDiagram"==-X?"update":X);null==ma&&(ma=Editor.replacePlaceholders(Editor.aiGlobals[ta],la));return ma},oa=function(ta,ma){null==ma&&(ma=new ta.constructor);for(var ia in ta){var qa=ta[ia];ma[ia]="object"===typeof qa?oa(qa):"string"===typeof qa?Editor.replacePlaceholders(qa,la):qa}return ma},pa=null!=Z?oa(Z.request):null,va=mxUtils.bind(this,function(){T.innerHTML="";F.push(T);var ta=document.createElement("div");ta.style.display="flex";ta.style.alignItems="center";mxUtils.write(ta,mxResources.get("loading")+-"...");var ma=document.createElement("img");ma.className="geAdaptiveAsset";ma.setAttribute("src",Editor.svgSpinImage);ma.style.width="16px";ma.style.height="16px";ma.style.marginLeft="6px";ta.appendChild(ma);T.appendChild(ta);T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});var ia=mxUtils.bind(this,function(qa,ua){var xa=Date.now()-ea;EditorUi.debug("EditorUi.ChatWindow.handleResponse","data",qa,"prompt",[ua],"time",xa);var ra=null;if(null!=qa&&1<qa.length&&0<qa[1].length)try{ra=-b.stringToCells(qa[1])}catch(Ca){throw Error(Ca.toString()+"\n\n"+qa[1]);}if(null!=ra&&0<ra.length){var aa=G.getBoundingBoxFromGeometry(ra);b.sidebar.graph.moveCells(ra,-aa.x,-aa.y);var na=mxUtils.bind(this,function(Ca){null!=b.sidebar&&b.sidebar.hideTooltip();if(null!=fa&&null==ba){var Fa=new mxCodec(fa.ownerDocument);ba=new mxGraphModel;Fa.decode(fa,ba)}G.model.beginUpdate();try{if(null!=ba&&null!=R&&null!=b.getPageIndex(R)){b.selectPage(R);var Ba=mxUtils.parseXml(qa[1]),da=new mxCodec(Ba),ca=new mxGraphModel;-da.decode(Ba.documentElement,ca);var wa=b.diffCells(ba.root,ca.root);b.patchPage(R,wa,null,!0);EditorUi.debug("EditorUi.ChatWindow.handleResponse","sentModel",ba,"receivedModel",ca,"patch",wa)}else{var ka=G.getFreeInsertPoint();G.setSelectionCells(G.importCells(ra,ka.x,ka.y));EditorUi.debug("EditorUi.ChatWindow.handleResponse","cells",G.getSelectionCell())}}finally{G.model.endUpdate()}G.scrollCellToVisible(G.getSelectionCell());mxEvent.consume(Ca)});T.innerHTML="";N=T;0<qa[0].length&&N.appendChild(m(qa[0]));-if(0<qa[1].length){var ja=b.getSvgForXml(qa[1]);ja.style.overflow="visible";ja.style.padding="1px";ja.style.cursor="move";ja.style.width="160px";ja.style.height="auto";ja.style.maxHeight="460px";var sa=document.createElement("a");sa.className="geItem";sa.style.padding="4px";sa.style.borderRadius="10px";sa.appendChild(ja);N.appendChild(sa);b.sidebar.createItem(ra,ua,!0,!0,aa.width,aa.height,!0,!0,na,null,null,null,null,null,sa);S||"createPublic"==X||1!=urlParams.test||sa.setAttribute("title",W+" ("+-xa+" ms)");xa=document.createElement("div");xa.style.display="flex";aa=document.createElement("img");aa.className="geAdaptiveAsset geLibraryButton";aa.setAttribute("src",Editor.refreshImage);aa.setAttribute("title",mxResources.get("refresh"));xa.appendChild(aa);mxEvent.addListener(aa,"click",va);"draw.io"==b.getServiceName()&&(aa=aa.cloneNode(),aa.setAttribute("src",Editor.shareImage),aa.setAttribute("title",mxResources.get(b.isStandaloneApp()?"export":"openInNewWindow")),xa.appendChild(aa),mxEvent.addListener(aa,-"click",mxUtils.bind(this,function(Ca){b.isStandaloneApp()?b.saveData("export.xml","xml",qa[1],"text/xml"):b.editor.editAsNew(qa[1])})));aa=aa.cloneNode();aa.setAttribute("src",Editor.magnifyImage);aa.setAttribute("title",mxResources.get("preview"));xa.appendChild(aa);mxEvent.addListener(aa,"click",mxUtils.bind(this,function(Ca){b.sidebar.createTooltip(N,ra,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||-document.body.clientHeight)-120,1200),ua,!0,new mxPoint(mxEvent.getClientX(Ca),mxEvent.getClientY(Ca)),!0,function(){wasVisible=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},!0,!1)}));aa=aa.cloneNode();null!=fa&&null!=R&&null!=b.getPageIndex(R)?(aa.setAttribute("src",Editor.checkImage),aa.setAttribute("title",mxResources.get("apply"))):(aa.setAttribute("src",Editor.plusImage),aa.setAttribute("title",mxResources.get("insert")));xa.appendChild(aa);mxEvent.addListener(aa,"click",-na);N.appendChild(xa)}0<qa[2].length&&N.appendChild(m(qa[2]))}else T.innerHTML="",N=T,T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),null==qa?mxUtils.write(N,mxResources.get("errShowingDiag")):(N.style.whiteSpace="pre-wrap",N.appendChild(m(qa[0])),N.appendChild(m(qa[2])),N.appendChild(M(mxResources.get("refresh"))));N.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});S||"createPublic"==X?b.generateOpenAiMermaidDiagram(K,function(qa){ia(["",qa,""],K)},Q,!0):b.createTimeout(b.editor.generateTimeout,-mxUtils.bind(this,function(qa){var ua=mxUtils.bind(this,function(aa){qa.clear();Q(aa)}),xa=Editor.replacePlaceholders(Z.endpoint,la),ra=new mxXmlRequest(xa,JSON.stringify(pa),"POST");ra.setRequestHeaders=mxUtils.bind(this,function(aa,na){aa.setRequestHeader("Content-Type","application/json");for(var ja in Z.requestHeaders)aa.setRequestHeader(ja,Editor.replacePlaceholders(Z.requestHeaders[ja],la))});EditorUi.debug("EditorUi.ChatWindow.addMessage send","url",xa,"params",pa,"aiModel",Y,"config",Z);ra.send(mxUtils.bind(this,-function(aa){if(qa.clear())try{if(200<=aa.getStatus()&&299>=aa.getStatus()){var na=JSON.parse(aa.getText()),ja=Editor.executeSimpleJsonPath(na,Z.responsePath),sa=mxUtils.trim(0<ja.length?ja[0]:aa.getText()),Ca=b.extractMermaidDeclaration(sa);EditorUi.debug("EditorUi.ChatWindow.addMessage response","params",pa,"response",na,"text",[sa],"mermaid",[Ca]);null==Ca?ia(Editor.extractGraphModelFromText(sa),K):b.parseMermaidDiagram(Ca,null,mxUtils.bind(this,function(Ba){ia(["",Ba,""],K)}),mxUtils.bind(this,-function(Ba){ua(Ba)}),null,!0)}else{ja="Error: "+aa.getStatus();try{var Fa=JSON.parse(aa.getText());null!=Fa&&null!=Fa.error&&null!=Fa.error.message&&(ja=Fa.error.message)}catch(Ba){}T.innerHTML="";mxUtils.write(T,ja);T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(Ba){ua(Ba)}}),ua)}),function(qa){T.innerHTML="";T.appendChild(y(qa.message));T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.addMessage","error",qa)})});va()}else Q({message:mxResources.get("invalidCallFnNotFound",-[W])})}function I(){if(""!=mxUtils.trim(V.value))try{J(V.value),V.value=""}catch(K){EditorUi.debug("EditorUi.ChatWindow.send","error",K)}}var G=b.editor.graph,E=document.createElement("div");E.style.display="flex";E.style.flexDirection="column";E.style.overflow="hidden";E.style.height="100%";E.style.padding="10px 12px 20px 12px";E.style.boxSizing="border-box";mxEvent.addGestureListeners(E,mxUtils.bind(this,function(K){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null);var c=document.createElement("div");-c.style.flexGrow="1";c.style.overflow="auto";c.style.fontSize="12px";c.style.marginRight="-8px";c.style.paddingRight="8px";mxEvent.addListener(c,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});E.appendChild(c);var g=document.createElement("div");g.style.borderRadius="20px";g.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";g.style.padding="8px";g.style.marginTop="8px";var l=document.createElement("div");l.style.display="flex";l.style.gap="6px";l.style.paddingRight="8px";l.style.justifyContent=+b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,f,k,d,p){var q=b.editor.graph,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.height="100%";var A=document.createElement("div");A.style.display="flex";A.style.alignItems="center";A.style.justifyContent="center";A.style.paddingTop="20px";var I=document.createElement("input");I.setAttribute("type","checkbox");I.style.marginRight="4px";I.checked=!0;var H=document.createElement("input");H.setAttribute("type",+"checkbox");H.style.marginRight="4px";H.checked=!0;var F=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(q.isSelectionEmpty()?q.getVerticesAndEdges():q.getSelectionCells(),I.checked,H.checked)}));F.setAttribute("title","Convert Colors");F.className="geBtn gePrimaryBtn";A.appendChild(F);u.appendChild(A);A=A.cloneNode(!1);A.appendChild(H);A.style.paddingTop="8px";mxUtils.write(A,mxResources.get("background"));u.appendChild(A);+A=A.cloneNode(!1);A.appendChild(I);A.style.paddingTop="8px";mxUtils.write(A,mxResources.get("labels"));u.appendChild(A);this.window=new mxWindow(mxResources.get("adaptiveColors"),u,f,k,d,p,!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,k,d,p){function q(){t||+(z=n.value,L());N.style.display="createPublic"==n.value?"none":""}function u(){t=!0;n.value=z;F.isSelectionEmpty()?(B.setAttribute("disabled","disabled"),"selectionOnly"==n.value&&(n.value="includeCopyOfMyDiagram")):B.removeAttribute("disabled");b.isDiagramEmpty()?(x.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==n.value&&(n.value="help")):x.removeAttribute("disabled");t=!1}function A(K){var M=document.createElement("div");M.style.textAlign="left";M.style.padding="6px";M.style.margin=+"6px 0";mxUtils.write(M,K);c.appendChild(M);return M}function I(K){function M(sa){var la=document.createElement("div");la.style.display="flex";var ja=document.createElement("img");ja.className="geAdaptiveAsset geLibraryButton";ja.setAttribute("src",Editor.refreshImage);ja.setAttribute("title",null!=sa?sa:mxResources.get("tryAgain"));la.appendChild(ja);mxEvent.addListener(ja,"click",ta);return la}function m(sa){var la=document.createElement("div");la.style.whiteSpace="pre-wrap";la.style.overflow="auto";+la.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(sa,!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return la}function y(sa){var la=mxResources.get("error")+": ",ja=document.createElement("div");ja.style.whiteSpace=+"pre-wrap";sa.substring(0,la.length)!=la&&(sa=la+sa);mxUtils.write(ja,sa);ja.appendChild(M());return ja}var E=[],P=A(K);E.push(P);P.style.marginBottom="2px";P.style.marginLeft="40%";P.style.borderRadius="10px";P.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";var O=document.createElement("div");O.className="geInlineButtons";O.style.display="flex";O.style.justifyContent="end";E.push(O);var Q=document.createElement("img");Q.className="geAdaptiveAsset geLibraryButton";Q.setAttribute("src",Editor.trashImage);+Q.setAttribute("title",mxResources.get("remove"));O.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(sa){if(mxEvent.isShiftDown(sa))c.innerHTML="";else{for(sa=0;sa<E.length;sa++)null!=E[sa].parentNode&&E[sa].parentNode.removeChild(E[sa]);E=[]}}));Q=Q.cloneNode();Q.setAttribute("src",Editor.copyImage);Q.setAttribute("title",mxResources.get("copy"));mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){b.writeTextToClipboard(K,mxUtils.bind(this,function(sa){b.handleError(sa)}),+function(){b.alert(mxResources.get("copiedToClipboard"))})}));O.appendChild(Q);Q=Q.cloneNode();Q.setAttribute("src",Editor.editImage);Q.setAttribute("title",mxResources.get("edit"));O.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){V.value=K;V.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?V.select():document.execCommand("selectAll",!1,null)}));c.appendChild(O);var U=A("");U.className="geSidebar";U.style.marginTop="2px";var R=mxUtils.bind(this,function(sa){U.innerHTML=+"";U.appendChild(y(sa.message));U.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",sa);null!=window.console&&console.error(sa)}),S=b.currentPage,W=N.value,X=n.value,Y=null;for(O=0;O<Editor.aiModels.length;O++)if(Q=Editor.aiModels[O],Q.name==W){Y=Q;break}if("createPublic"==X||null!=Y&&null!=Editor.aiConfigs[Y.config]){var Z=null!=Y?Editor.aiConfigs[Y.config]:null,aa=null,fa=Date.now(),ia=null,ea=null;if("includeCopyOfMyDiagram"==+X||"selectionOnly"==X)O=new mxCodec(mxUtils.createXmlDocument()),"selectionOnly"==X&&(O.isObjectIgnored=function(sa){return sa.constructor==mxCell&&!F.model.isRoot(sa)&&!F.model.isLayer(sa)&&!F.isCellSelected(sa)&&!F.isAncestorSelected(sa)}),ea=O.encode(F.getModel()),ea.ownerDocument.appendChild(ea),ia=mxUtils.getXml(ea);var ma=function(sa){var la=null;"prompt"==sa?la=K:"data"==sa&&null!=ea?la=ia:"model"==sa?la=Y.model:"apiKey"==sa?sa=Z.apiKey:"action"==sa&&(sa="selectionOnly"==X||"includeCopyOfMyDiagram"==+X?"update":X);null==la&&(la=Editor.replacePlaceholders(Editor.aiGlobals[sa],ma));return la},na=function(sa,la){null==la&&(la=new sa.constructor);for(var ja in sa){var qa=sa[ja];la[ja]="object"===typeof qa?na(qa):"string"===typeof qa?Editor.replacePlaceholders(qa,ma):qa}return la},ua=null!=Z?na(Z.request):null,ta=mxUtils.bind(this,function(){U.innerHTML="";E.push(U);var sa=document.createElement("div");sa.style.display="flex";sa.style.alignItems="center";mxUtils.write(sa,mxResources.get("loading")++"...");var la=document.createElement("img");la.className="geAdaptiveAsset";la.setAttribute("src",Editor.svgSpinImage);la.style.width="16px";la.style.height="16px";la.style.marginLeft="6px";sa.appendChild(la);U.appendChild(sa);U.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});var ja=mxUtils.bind(this,function(qa,va){var ya=Date.now()-fa;EditorUi.debug("EditorUi.ChatWindow.handleResponse","data",qa,"prompt",[va],"time",ya);var ra=null;if(null!=qa&&1<qa.length&&0<qa[1].length)try{ra=+b.stringToCells(qa[1])}catch(pa){throw Error(pa.toString()+"\n\n"+qa[1]);}if(null!=ra&&0<ra.length){var ha=F.getBoundingBoxFromGeometry(ra);b.sidebar.graph.moveCells(ra,-ha.x,-ha.y);var Da=mxUtils.bind(this,function(pa){null!=b.sidebar&&b.sidebar.hideTooltip();if(null!=ea&&null==aa){var Ba=new mxCodec(ea.ownerDocument);aa=new mxGraphModel;Ba.decode(ea,aa)}F.model.beginUpdate();try{if(null!=aa&&null!=S&&null!=b.getPageIndex(S)){b.selectPage(S);var xa=mxUtils.parseXml(qa[1]),ca=new mxCodec(xa),da=new mxGraphModel;+ca.decode(xa.documentElement,da);var wa=b.diffCells(aa.root,da.root);b.patchPage(S,wa,null,!0);EditorUi.debug("EditorUi.ChatWindow.handleResponse","sentModel",aa,"receivedModel",da,"patch",wa)}else{var ka=F.getFreeInsertPoint();F.setSelectionCells(F.importCells(ra,ka.x,ka.y));EditorUi.debug("EditorUi.ChatWindow.handleResponse","cells",F.getSelectionCell())}}finally{F.model.endUpdate()}F.scrollCellToVisible(F.getSelectionCell());mxEvent.consume(pa)});U.innerHTML="";P=U;0<qa[0].length&&P.appendChild(m(qa[0]));+if(0<qa[1].length){var oa=b.getSvgForXml(qa[1]);oa.style.overflow="visible";oa.style.padding="1px";oa.style.cursor="move";oa.style.width="160px";oa.style.height="auto";oa.style.maxHeight="460px";var ba=document.createElement("a");ba.className="geItem";ba.style.padding="4px";ba.style.borderRadius="10px";ba.appendChild(oa);P.appendChild(ba);b.sidebar.createItem(ra,va,!0,!0,ha.width,ha.height,!0,!0,Da,null,null,null,null,null,ba);T||"createPublic"==X||1!=urlParams.test||ba.setAttribute("title",W+" ("++ya+" ms)");ya=document.createElement("div");ya.style.display="flex";ha=document.createElement("img");ha.className="geAdaptiveAsset geLibraryButton";ha.setAttribute("src",Editor.refreshImage);ha.setAttribute("title",mxResources.get("refresh"));ya.appendChild(ha);mxEvent.addListener(ha,"click",ta);"draw.io"==b.getServiceName()&&(ha=ha.cloneNode(),ha.setAttribute("src",Editor.shareImage),ha.setAttribute("title",mxResources.get(b.isStandaloneApp()?"export":"openInNewWindow")),ya.appendChild(ha),mxEvent.addListener(ha,+"click",mxUtils.bind(this,function(pa){b.isStandaloneApp()?b.saveData("export.xml","xml",qa[1],"text/xml"):b.editor.editAsNew(qa[1])})));ha=ha.cloneNode();ha.setAttribute("src",Editor.magnifyImage);ha.setAttribute("title",mxResources.get("preview"));ya.appendChild(ha);mxEvent.addListener(ha,"click",mxUtils.bind(this,function(pa){b.sidebar.createTooltip(P,ra,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||+document.body.clientHeight)-120,1200),va,!0,new mxPoint(mxEvent.getClientX(pa),mxEvent.getClientY(pa)),!0,function(){wasVisible=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},!0,!1)}));ha=ha.cloneNode();null!=ea&&null!=S&&null!=b.getPageIndex(S)?(ha.setAttribute("src",Editor.checkImage),ha.setAttribute("title",mxResources.get("apply"))):(ha.setAttribute("src",Editor.plusImage),ha.setAttribute("title",mxResources.get("insert")));ya.appendChild(ha);mxEvent.addListener(ha,"click",+Da);P.appendChild(ya)}0<qa[2].length&&P.appendChild(m(qa[2]))}else U.innerHTML="",P=U,U.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),null==qa?mxUtils.write(P,mxResources.get("errShowingDiag")):(P.style.whiteSpace="pre-wrap",P.appendChild(m(qa[0])),P.appendChild(m(qa[2])),P.appendChild(M(mxResources.get("refresh"))));P.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});T||"createPublic"==X?b.generateOpenAiMermaidDiagram(K,function(qa){ja(["",qa,""],K)},R,!0):b.createTimeout(b.editor.generateTimeout,+mxUtils.bind(this,function(qa){var va=mxUtils.bind(this,function(ha){qa.clear();R(ha)}),ya=Editor.replacePlaceholders(Z.endpoint,ma),ra=new mxXmlRequest(ya,JSON.stringify(ua),"POST");ra.setRequestHeaders=mxUtils.bind(this,function(ha,Da){ha.setRequestHeader("Content-Type","application/json");for(var oa in Z.requestHeaders)ha.setRequestHeader(oa,Editor.replacePlaceholders(Z.requestHeaders[oa],ma))});EditorUi.debug("EditorUi.ChatWindow.addMessage send","url",ya,"params",ua,"aiModel",Y,"config",Z);ra.send(mxUtils.bind(this,+function(ha){if(qa.clear())try{if(200<=ha.getStatus()&&299>=ha.getStatus()){var Da=JSON.parse(ha.getText()),oa=Editor.executeSimpleJsonPath(Da,Z.responsePath),ba=mxUtils.trim(0<oa.length?oa[0]:ha.getText()),pa=b.extractMermaidDeclaration(ba);EditorUi.debug("EditorUi.ChatWindow.addMessage response","params",ua,"response",Da,"text",[ba],"mermaid",[pa]);null==pa?ja(Editor.extractGraphModelFromText(ba),K):b.parseMermaidDiagram(pa,null,mxUtils.bind(this,function(xa){ja(["",xa,""],K)}),mxUtils.bind(this,+function(xa){va(xa)}),null,!0)}else{oa="Error: "+ha.getStatus();try{var Ba=JSON.parse(ha.getText());null!=Ba&&null!=Ba.error&&null!=Ba.error.message&&(oa=Ba.error.message)}catch(xa){}U.innerHTML="";mxUtils.write(U,oa);U.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(xa){va(xa)}}),va)}),function(qa){U.innerHTML="";U.appendChild(y(qa.message));U.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.addMessage","error",qa)})});ta()}else R({message:mxResources.get("invalidCallFnNotFound",+[W])})}function H(){if(""!=mxUtils.trim(V.value))try{I(V.value),V.value=""}catch(K){EditorUi.debug("EditorUi.ChatWindow.send","error",K)}}var F=b.editor.graph,D=document.createElement("div");D.style.display="flex";D.style.flexDirection="column";D.style.overflow="hidden";D.style.height="100%";D.style.padding="10px 12px 20px 12px";D.style.boxSizing="border-box";mxEvent.addGestureListeners(D,mxUtils.bind(this,function(K){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null);var c=document.createElement("div");+c.style.flexGrow="1";c.style.overflow="auto";c.style.fontSize="12px";c.style.marginRight="-8px";c.style.paddingRight="8px";mxEvent.addListener(c,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});D.appendChild(c);var g=document.createElement("div");g.style.borderRadius="20px";g.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";g.style.padding="8px";g.style.marginTop="8px";var l=document.createElement("div");l.style.display="flex";l.style.gap="6px";l.style.paddingRight="8px";l.style.justifyContent="start";var n=document.createElement("select");n.style.borderColor="transparent";n.style.textOverflow="ellipsis";n.style.padding="5px";n.style.minWidth="0";var v=document.createElement("option");"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&0<=mxUtils.indexOf(Editor.aiActions,"createPublic")&&(v.setAttribute("value","createPublic"),mxUtils.write(v,mxResources.get("create")+" ("+mxResources.get("draw.io")+")"),n.appendChild(v));var x=document.createElement("option"),B=document.createElement("option"),-C=document.createElement("option"),H=document.createElement("option");"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&0<=mxUtils.indexOf(Editor.aiActions,"create")&&(C.setAttribute("value","create"),mxUtils.write(C,mxResources.get("create")),n.appendChild(C));0<=mxUtils.indexOf(Editor.aiActions,"update")&&(x.setAttribute("value","includeCopyOfMyDiagram"),mxUtils.write(x,mxResources.get("includeCopyOfMyDiagram")),n.appendChild(x),B.setAttribute("value","selectionOnly"),mxUtils.write(B,-mxResources.get("selectionOnly")),n.appendChild(B));0<=mxUtils.indexOf(Editor.aiActions,"assist")&&(H.setAttribute("value","assist"),mxUtils.write(H,mxResources.get("help")),n.appendChild(H));var D=n.cloneNode(!1);for(C=0;C<Editor.aiModels.length;C++)if(H=Editor.aiModels[C],Editor.aiConfigs[H.config]&&null!=Editor.aiGlobals[Editor.aiConfigs[H.config].apiKey]){var U=document.createElement("option");U.setAttribute("value",H.name);mxUtils.write(U,H.name);D.appendChild(U)}var S=0==D.children.length;C=-document.createElement("div");C.style.whiteSpace="nowrap";C.style.textOverflow="clip";C.style.cursor="default";var V=document.createElement("input");V.setAttribute("type","text");V.style.width="100%";V.style.outline="none";V.style.border="none";V.style.background="transparent";V.style.padding="6px 30px 6px 10px";V.style.boxSizing="border-box";C.appendChild(V);H=document.createElement("img");H.setAttribute("src",Editor.sendImage);H.setAttribute("title",mxResources.get("sendMessage"));H.className="geAdaptiveAsset";-H.style.position="relative";H.style.cursor="pointer";H.style.opacity="0.5";H.style.height="19px";H.style.left="-28px";H.style.top="5px";C.appendChild(H);g.appendChild(C);S||(1!=urlParams.test&&v.parentNode.removeChild(v),l.appendChild(n),1<D.children.length&&l.appendChild(D),g.appendChild(l));0<n.children.length&&(n.value=n.children[0].value);var t=!1,z=n.value,L=function(){V.setAttribute("placeholder",mxResources.get("create"==n.value||"createPublic"==n.value?"describeYourDiagram":"askMeAnything"))};-L();mxEvent.addListener(n,"change",q);q();G.selectionModel.addListener(mxEvent.CHANGE,u);G.getModel().addListener(mxEvent.CHANGE,u);u();E.appendChild(g);mxEvent.addListener(H,"click",I);mxEvent.addListener(V,"keydown",function(K){13!=K.keyCode||mxEvent.isShiftDown(K)||I()});this.generate=mxUtils.bind(this,function(K){V.value=K;I()});this.window=new mxWindow(mxResources.get("generate"),E,f,k,d,p,!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);b.isOffline()||(f=b.createHelpIcon("https://www.drawio.com/doc/faq/configure-ai-options"),f.style.cursor="help",f.style.opacity="0.5",this.window.buttons.insertBefore(f,this.window.buttons.firstChild));this.window.addListener(mxEvent.DESTROY,mxUtils.bind(this,function(){G.getModel().removeListener(u)}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();V.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,-f,k,d,p){var q=b.editor.graph,u=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)u=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var A=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(J,I){if(q.isEnabled()){var G=new FilenameDialog(b,"",mxResources.get("add"),function(E){b.hideDialog();if(null!=E&&0<E.length){E=E.split(" ");for(var c=[],g=[],l=0;l<E.length;l++){var n=mxUtils.trim(E[l]);""!=n&&(g.push(n),0>mxUtils.indexOf(J,-n)&&c.push(n))}q.isSelectionEmpty()?I(J.concat(c)):q.addTagsForCells(q.getSelectionCells(),g)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(G.container,320,80,!0,!0);G.init()}},u);u=A.div;this.window=new mxWindow(mxResources.get("tags"),u,f,k,d,p,!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",+C=document.createElement("option"),G=document.createElement("option");"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&0<=mxUtils.indexOf(Editor.aiActions,"create")&&(C.setAttribute("value","create"),mxUtils.write(C,mxResources.get("create")),n.appendChild(C));0<=mxUtils.indexOf(Editor.aiActions,"update")&&(x.setAttribute("value","includeCopyOfMyDiagram"),mxUtils.write(x,mxResources.get("includeCopyOfMyDiagram")),n.appendChild(x),B.setAttribute("value","selectionOnly"),mxUtils.write(B,+mxResources.get("selectionOnly")),n.appendChild(B));0<=mxUtils.indexOf(Editor.aiActions,"assist")&&(G.setAttribute("value","assist"),mxUtils.write(G,mxResources.get("help")),n.appendChild(G));var N=n.cloneNode(!1);for(C=0;C<Editor.aiModels.length;C++)if(G=Editor.aiModels[C],Editor.aiConfigs[G.config]&&null!=Editor.aiGlobals[Editor.aiConfigs[G.config].apiKey]){var J=document.createElement("option");J.setAttribute("value",G.name);mxUtils.write(J,G.name);N.appendChild(J)}var T=0==N.children.length;C=+document.createElement("div");C.style.whiteSpace="nowrap";C.style.textOverflow="clip";C.style.cursor="default";var V=document.createElement("input");V.setAttribute("type","text");V.style.width="100%";V.style.outline="none";V.style.border="none";V.style.background="transparent";V.style.padding="6px 30px 6px 10px";V.style.boxSizing="border-box";C.appendChild(V);G=document.createElement("img");G.setAttribute("src",Editor.sendImage);G.setAttribute("title",mxResources.get("sendMessage"));G.className="geAdaptiveAsset";+G.style.position="relative";G.style.cursor="pointer";G.style.opacity="0.5";G.style.height="19px";G.style.left="-28px";G.style.top="5px";C.appendChild(G);g.appendChild(C);T||(1!=urlParams.test&&v.parentNode.removeChild(v),l.appendChild(n),1<N.children.length&&l.appendChild(N),g.appendChild(l));0<n.children.length&&(n.value=n.children[0].value);var t=!1,z=n.value,L=function(){V.setAttribute("placeholder",mxResources.get("create"==n.value||"createPublic"==n.value?"describeYourDiagram":"askMeAnything"))};+L();mxEvent.addListener(n,"change",q);q();F.selectionModel.addListener(mxEvent.CHANGE,u);F.getModel().addListener(mxEvent.CHANGE,u);u();D.appendChild(g);mxEvent.addListener(G,"click",H);mxEvent.addListener(V,"keydown",function(K){13!=K.keyCode||mxEvent.isShiftDown(K)||H()});this.generate=mxUtils.bind(this,function(K){V.value=K;H()});this.window=new mxWindow(mxResources.get("generate"),D,f,k,d,p,!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);b.isOffline()||(f=b.createHelpIcon("https://www.drawio.com/doc/faq/configure-ai-options"),f.style.cursor="help",f.style.opacity="0.5",this.window.buttons.insertBefore(f,this.window.buttons.firstChild));this.window.addListener(mxEvent.DESTROY,mxUtils.bind(this,function(){F.getModel().removeListener(u)}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();V.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,+f,k,d,p){var q=b.editor.graph,u=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)u=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var A=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(I,H){if(q.isEnabled()){var F=new FilenameDialog(b,"",mxResources.get("add"),function(D){b.hideDialog();if(null!=D&&0<D.length){D=D.split(" ");for(var c=[],g=[],l=0;l<D.length;l++){var n=mxUtils.trim(D[l]);""!=n&&(g.push(n),0>mxUtils.indexOf(I,+n)&&c.push(n))}q.isSelectionEmpty()?H(I.concat(c)):q.addTagsForCells(q.getSelectionCells(),g)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(F.container,320,80,!0,!0);F.init()}},u);u=A.div;this.window=new mxWindow(mxResources.get("tags"),u,f,k,d,p,!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(){A.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AuthDialog=function(b,f,k,d){var p=document.createElement("div");p.style.textAlign="center";var q=document.createElement("p");q.style.fontSize="16pt";q.style.padding="0px";q.style.margin="0px";q.style.color="gray";mxUtils.write(q,mxResources.get("authorizationRequired"));var u="Unknown",A=document.createElement("img");A.setAttribute("border","0");A.setAttribute("align","absmiddle");A.style.marginRight="10px";f==b.drive?(u=mxResources.get("googleDrive"),A.src=IMAGE_PATH+"/google-drive-logo-white.svg"):f==b.dropbox?(u=mxResources.get("dropbox"),A.src=IMAGE_PATH+"/dropbox-logo-white.svg"):f==b.oneDrive?(u=mxResources.get("oneDrive"),A.src=IMAGE_PATH+"/onedrive-logo-white.svg"):f==b.gitHub?(u=mxResources.get("github"),A.src=IMAGE_PATH+"/github-logo-white.svg"):f==b.gitLab?(u=mxResources.get("gitlab"),A.src=IMAGE_PATH+"/gitlab-logo.svg",A.style.width="32px"):f==b.trello?(u=mxResources.get("trello"),A.src=-IMAGE_PATH+"/trello-logo-white.svg"):f==b.m365&&(u=mxResources.get("m365"),A.src=IMAGE_PATH+"/onedrive-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[u]));var J=document.createElement("input");J.setAttribute("type","checkbox");u=mxUtils.button(mxResources.get("authorize"),function(){d(J.checked)});u.insertBefore(A,u.firstChild);u.style.marginTop="6px";u.className="geBigButton";u.style.fontSize="18px";u.style.padding="14px";p.appendChild(q);p.appendChild(b);-p.appendChild(u);k&&(k=document.createElement("p"),k.style.marginTop="20px",k.appendChild(J),q=document.createElement("span"),mxUtils.write(q," "+mxResources.get("rememberMe")),k.appendChild(q),p.appendChild(k),J.checked=!0,J.defaultChecked=!0,mxEvent.addListener(q,"click",function(I){J.checked=!J.checked;mxEvent.consume(I)}));this.container=p},MoreShapesDialog=function(b,f,k){k=null!=k?k:b.sidebar.entries;var d=document.createElement("div"),p=[];if(null!=b.sidebar.customEntries)for(var q=0;q<b.sidebar.customEntries.length;q++){for(var u=-b.sidebar.customEntries[q]||{},A={title:b.getResource(u.title),entries:[]},J=0;null!=u.entries&&J<u.entries.length;J++){var I=u.entries[J];A.entries.push({id:I.id,title:b.getResource(I.title),desc:b.getResource(I.desc),image:I.preview})}0<A.entries.length&&p.push(A)}for(q=0;q<k.length;q++)if(null==b.sidebar.enabledLibraries)p.push(k[q]);else{A={title:k[q].title,entries:[]};for(J=0;J<k[q].entries.length;J++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,k[q].entries[J].id)&&A.entries.push(k[q].entries[J]);-0<A.entries.length&&p.push(A)}k=p;if(f){q=mxUtils.bind(this,function(U){for(var S=0;S<U.length;S++)(function(V){var t=l.cloneNode(!1);t.style.fontWeight="bold";t.style.backgroundColor="light-dark(#e5e5e5, #505759)";t.style.padding="6px 0px 6px 20px";mxUtils.write(t,V.title);G.appendChild(t);for(var z=0;z<V.entries.length;z++)(function(L){var K=l.cloneNode(!1);K.style.cursor="pointer";K.style.padding="4px 0px 4px 20px";K.style.whiteSpace="nowrap";K.style.overflow="hidden";K.style.textOverflow="ellipsis";-K.setAttribute("title",L.title+" ("+L.id+")");var M=document.createElement("input");M.setAttribute("type","checkbox");M.checked=b.sidebar.isEntryVisible(L.id);M.defaultChecked=M.checked;K.appendChild(M);mxUtils.write(K," "+L.title);G.appendChild(K);var m=function(y){if(null==y||"INPUT"!=mxEvent.getSource(y).nodeName){E.style.textAlign="center";E.style.padding="0px";E.style.color="";E.innerText="";if(null!=L.desc){var F=document.createElement("pre");F.style.boxSizing="border-box";F.style.fontFamily=-"inherit";F.style.margin="20px";F.style.right="0px";F.style.textAlign="left";mxUtils.write(F,L.desc);E.appendChild(F)}null!=L.imageCallback?L.imageCallback(E):null!=L.image?(F=document.createElement("img"),F.setAttribute("border","0"),F.style.maxWidth="100%",F.setAttribute("src",L.image),E.appendChild(F)):null==L.desc&&(E.style.padding="20px",E.style.color="rgb(179, 179, 179)",mxUtils.write(E,mxResources.get("noPreview")));null!=c&&(c.style.backgroundColor="");c=K;c.style.backgroundColor="light-dark(#ebf2f9, #000000)";-null!=y&&mxEvent.consume(y)}};mxEvent.addListener(K,"click",m);mxEvent.addListener(K,"dblclick",function(y){M.checked=!M.checked;mxEvent.consume(y)});g.push(function(){return M.checked?L.id:null});0==S&&0==z&&m()})(V.entries[z])})(U[S])});J=document.createElement("div");J.className="geDialogTitle";mxUtils.write(J,mxResources.get("shapes"));J.style.position="absolute";J.style.top="0px";J.style.left="0px";J.style.lineHeight="40px";J.style.height="40px";J.style.right="0px";var G=document.createElement("div"),-E=document.createElement("div");G.style.position="absolute";G.style.top="40px";G.style.left="0px";G.style.width="202px";G.style.bottom="60px";G.style.overflow="auto";E.style.position="absolute";E.style.left="202px";E.style.right="0px";E.style.top="40px";E.style.bottom="60px";E.style.overflow="auto";E.style.borderLeftStyle="solid";E.style.borderLeftWidth="1px";E.style.textAlign="center";var c=null,g=[],l=document.createElement("div");l.style.position="relative";l.style.left="0px";l.style.right="0px";-q(k);d.style.padding="30px";d.appendChild(J);d.appendChild(G);d.appendChild(E);k=document.createElement("div");k.className="geDialogFooter";k.style.position="absolute";k.style.paddingRight="16px";k.style.left="0px";k.style.right="0px";k.style.bottom="0px";k.style.height="60px";k.style.lineHeight="52px";var n=document.createElement("input");n.setAttribute("type","checkbox");n.style.position="relative";n.style.top="1px";n.checked=b.sidebar.sidebarTitles;n.defaultChecked=n.checked;k.appendChild(n);q=-document.createElement("span");mxUtils.write(q," "+mxResources.get("labels"));q.style.paddingRight="20px";k.appendChild(q);mxEvent.addListener(q,"click",function(U){n.checked=!n.checked;mxEvent.consume(U)});var v=document.createElement("input");v.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)q=document.createElement("span"),q.style.paddingRight="20px",q.appendChild(v),mxUtils.write(q," "+mxResources.get("rememberThisSetting")),v.style.position="relative",v.style.top="1px",-v.checked=!0,v.defaultChecked=!0,mxEvent.addListener(q,"click",function(U){mxEvent.getSource(U)!=v&&(v.checked=!v.checked,mxEvent.consume(U))}),k.appendChild(q);q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";J=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var U=[],S=0;S<g.length;S++){var V=g[S].apply(this,arguments);null!=V&&U.push(V)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||-(S=mxUtils.indexOf(U,".scratchpad"),null!=b.scratchpad!=(0<=S&&0<U.splice(S,1).length)&&b.toggleScratchpad(),S=mxUtils.indexOf(U,"search"),mxSettings.settings.search=0<=S&&0<U.splice(S,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),v.checked&&mxSettings.save());b.sidebar.showEntries(U.join(";"),v.checked,!0);b.setSidebarTitles(n.checked,v.checked)});J.className="geBtn gePrimaryBtn"}else{var x=document.createElement("table");q=document.createElement("tbody");d.style.height="100%";-d.style.overflow="auto";J=document.createElement("tr");x.style.width="100%";f=document.createElement("td");p=document.createElement("td");u=document.createElement("td");var B=mxUtils.bind(this,function(U,S,V){var t=document.createElement("input");t.type="checkbox";x.appendChild(t);t.checked=b.sidebar.isEntryVisible(V);var z=document.createElement("span");mxUtils.write(z,S);S=document.createElement("div");S.style.display="block";S.appendChild(t);S.appendChild(z);mxEvent.addListener(z,"click",function(L){t.checked=-!t.checked;mxEvent.consume(L)});U.appendChild(S);return function(){return t.checked?V:null}});J.appendChild(f);J.appendChild(p);J.appendChild(u);q.appendChild(J);x.appendChild(q);g=[];var C=0;for(q=0;q<k.length;q++)for(J=0;J<k[q].entries.length;J++)C++;var H=[f,p,u],D=0;for(q=0;q<k.length;q++)(function(U){for(var S=0;S<U.entries.length;S++){var V=U.entries[S];g.push(B(H[Math.floor(D/(C/3))],V.title,V.id));D++}})(k[q]);d.appendChild(x);k=document.createElement("div");k.style.marginTop="18px";k.style.textAlign=-"center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=!0,k.appendChild(v),q=document.createElement("span"),mxUtils.write(q," "+mxResources.get("rememberThisSetting")),k.appendChild(q),mxEvent.addListener(q,"click",function(U){v.checked=!v.checked;mxEvent.consume(U)}));d.appendChild(k);q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";J=mxUtils.button(mxResources.get("apply"),function(){for(var U=-["search"],S=0;S<g.length;S++){var V=g[S].apply(this,arguments);null!=V&&U.push(V)}b.sidebar.showEntries(0<U.length?U.join(";"):"",v.checked);b.hideDialog()});J.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.marginTop="26px";k.style.textAlign="right"}b.editor.cancelFirst?(k.appendChild(q),k.appendChild(J)):(k.appendChild(J),k.appendChild(q));d.appendChild(k);this.container=d},PluginsDialog=function(b,f,k,d){function p(){J=!0;if(0==A.length)u.innerText=mxResources.get("noPlugins");+IMAGE_PATH+"/trello-logo-white.svg"):f==b.m365&&(u=mxResources.get("m365"),A.src=IMAGE_PATH+"/onedrive-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[u]));var I=document.createElement("input");I.setAttribute("type","checkbox");u=mxUtils.button(mxResources.get("authorize"),function(){d(I.checked)});u.insertBefore(A,u.firstChild);u.style.marginTop="6px";u.className="geBigButton";u.style.fontSize="18px";u.style.padding="14px";p.appendChild(q);p.appendChild(b);+p.appendChild(u);k&&(k=document.createElement("p"),k.style.marginTop="20px",k.appendChild(I),q=document.createElement("span"),mxUtils.write(q," "+mxResources.get("rememberMe")),k.appendChild(q),p.appendChild(k),I.checked=!0,I.defaultChecked=!0,mxEvent.addListener(q,"click",function(H){I.checked=!I.checked;mxEvent.consume(H)}));this.container=p},MoreShapesDialog=function(b,f,k){k=null!=k?k:b.sidebar.entries;var d=document.createElement("div"),p=[];if(null!=b.sidebar.customEntries)for(var q=0;q<b.sidebar.customEntries.length;q++){for(var u=+b.sidebar.customEntries[q]||{},A={title:b.getResource(u.title),entries:[]},I=0;null!=u.entries&&I<u.entries.length;I++){var H=u.entries[I];A.entries.push({id:H.id,title:b.getResource(H.title),desc:b.getResource(H.desc),image:H.preview})}0<A.entries.length&&p.push(A)}for(q=0;q<k.length;q++)if(null==b.sidebar.enabledLibraries)p.push(k[q]);else{A={title:k[q].title,entries:[]};for(I=0;I<k[q].entries.length;I++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,k[q].entries[I].id)&&A.entries.push(k[q].entries[I]);+0<A.entries.length&&p.push(A)}k=p;if(f){q=mxUtils.bind(this,function(J){for(var T=0;T<J.length;T++)(function(V){var t=l.cloneNode(!1);t.style.fontWeight="bold";t.style.backgroundColor="light-dark(#e5e5e5, #505759)";t.style.padding="6px 0px 6px 20px";mxUtils.write(t,V.title);F.appendChild(t);for(var z=0;z<V.entries.length;z++)(function(L){var K=l.cloneNode(!1);K.style.cursor="pointer";K.style.padding="4px 0px 4px 20px";K.style.whiteSpace="nowrap";K.style.overflow="hidden";K.style.textOverflow="ellipsis";+K.setAttribute("title",L.title+" ("+L.id+")");var M=document.createElement("input");M.setAttribute("type","checkbox");M.checked=b.sidebar.isEntryVisible(L.id);M.defaultChecked=M.checked;K.appendChild(M);mxUtils.write(K," "+L.title);F.appendChild(K);var m=function(y){if(null==y||"INPUT"!=mxEvent.getSource(y).nodeName){D.style.textAlign="center";D.style.padding="0px";D.style.color="";D.innerText="";if(null!=L.desc){var E=document.createElement("pre");E.style.boxSizing="border-box";E.style.fontFamily=+"inherit";E.style.margin="20px";E.style.right="0px";E.style.textAlign="left";mxUtils.write(E,L.desc);D.appendChild(E)}null!=L.imageCallback?L.imageCallback(D):null!=L.image?(E=document.createElement("img"),E.setAttribute("border","0"),E.style.maxWidth="100%",E.setAttribute("src",L.image),D.appendChild(E)):null==L.desc&&(D.style.padding="20px",D.style.color="rgb(179, 179, 179)",mxUtils.write(D,mxResources.get("noPreview")));null!=c&&(c.style.backgroundColor="");c=K;c.style.backgroundColor="light-dark(#ebf2f9, #000000)";+null!=y&&mxEvent.consume(y)}};mxEvent.addListener(K,"click",m);mxEvent.addListener(K,"dblclick",function(y){M.checked=!M.checked;mxEvent.consume(y)});g.push(function(){return M.checked?L.id:null});0==T&&0==z&&m()})(V.entries[z])})(J[T])});I=document.createElement("div");I.className="geDialogTitle";mxUtils.write(I,mxResources.get("shapes"));I.style.position="absolute";I.style.top="0px";I.style.left="0px";I.style.lineHeight="40px";I.style.height="40px";I.style.right="0px";var F=document.createElement("div"),+D=document.createElement("div");F.style.position="absolute";F.style.top="40px";F.style.left="0px";F.style.width="202px";F.style.bottom="60px";F.style.overflow="auto";D.style.position="absolute";D.style.left="202px";D.style.right="0px";D.style.top="40px";D.style.bottom="60px";D.style.overflow="auto";D.style.borderLeftStyle="solid";D.style.borderLeftWidth="1px";D.style.textAlign="center";var c=null,g=[],l=document.createElement("div");l.style.position="relative";l.style.left="0px";l.style.right="0px";+q(k);d.style.padding="30px";d.appendChild(I);d.appendChild(F);d.appendChild(D);k=document.createElement("div");k.className="geDialogFooter";k.style.position="absolute";k.style.paddingRight="16px";k.style.left="0px";k.style.right="0px";k.style.bottom="0px";k.style.height="60px";k.style.lineHeight="52px";var n=document.createElement("input");n.setAttribute("type","checkbox");n.style.position="relative";n.style.top="1px";n.checked=b.sidebar.sidebarTitles;n.defaultChecked=n.checked;k.appendChild(n);q=+document.createElement("span");mxUtils.write(q," "+mxResources.get("labels"));q.style.paddingRight="20px";k.appendChild(q);mxEvent.addListener(q,"click",function(J){n.checked=!n.checked;mxEvent.consume(J)});var v=document.createElement("input");v.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)q=document.createElement("span"),q.style.paddingRight="20px",q.appendChild(v),mxUtils.write(q," "+mxResources.get("rememberThisSetting")),v.style.position="relative",v.style.top="1px",+v.checked=!0,v.defaultChecked=!0,mxEvent.addListener(q,"click",function(J){mxEvent.getSource(J)!=v&&(v.checked=!v.checked,mxEvent.consume(J))}),k.appendChild(q);q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";I=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var J=[],T=0;T<g.length;T++){var V=g[T].apply(this,arguments);null!=V&&J.push(V)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||+(T=mxUtils.indexOf(J,".scratchpad"),null!=b.scratchpad!=(0<=T&&0<J.splice(T,1).length)&&b.toggleScratchpad(),T=mxUtils.indexOf(J,"search"),mxSettings.settings.search=0<=T&&0<J.splice(T,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),v.checked&&mxSettings.save());b.sidebar.showEntries(J.join(";"),v.checked,!0);b.setSidebarTitles(n.checked,v.checked)});I.className="geBtn gePrimaryBtn"}else{var x=document.createElement("table");q=document.createElement("tbody");d.style.height="100%";+d.style.overflow="auto";I=document.createElement("tr");x.style.width="100%";f=document.createElement("td");p=document.createElement("td");u=document.createElement("td");var B=mxUtils.bind(this,function(J,T,V){var t=document.createElement("input");t.type="checkbox";x.appendChild(t);t.checked=b.sidebar.isEntryVisible(V);var z=document.createElement("span");mxUtils.write(z,T);T=document.createElement("div");T.style.display="block";T.appendChild(t);T.appendChild(z);mxEvent.addListener(z,"click",function(L){t.checked=+!t.checked;mxEvent.consume(L)});J.appendChild(T);return function(){return t.checked?V:null}});I.appendChild(f);I.appendChild(p);I.appendChild(u);q.appendChild(I);x.appendChild(q);g=[];var C=0;for(q=0;q<k.length;q++)for(I=0;I<k[q].entries.length;I++)C++;var G=[f,p,u],N=0;for(q=0;q<k.length;q++)(function(J){for(var T=0;T<J.entries.length;T++){var V=J.entries[T];g.push(B(G[Math.floor(N/(C/3))],V.title,V.id));N++}})(k[q]);d.appendChild(x);k=document.createElement("div");k.style.marginTop="18px";k.style.textAlign=+"center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=!0,k.appendChild(v),q=document.createElement("span"),mxUtils.write(q," "+mxResources.get("rememberThisSetting")),k.appendChild(q),mxEvent.addListener(q,"click",function(J){v.checked=!v.checked;mxEvent.consume(J)}));d.appendChild(k);q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";I=mxUtils.button(mxResources.get("apply"),function(){for(var J=+["search"],T=0;T<g.length;T++){var V=g[T].apply(this,arguments);null!=V&&J.push(V)}b.sidebar.showEntries(0<J.length?J.join(";"):"",v.checked);b.hideDialog()});I.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.marginTop="26px";k.style.textAlign="right"}b.editor.cancelFirst?(k.appendChild(q),k.appendChild(I)):(k.appendChild(I),k.appendChild(q));d.appendChild(k);this.container=d},PluginsDialog=function(b,f,k,d){function p(){I=!0;if(0==A.length)u.innerText=mxResources.get("noPlugins");else{u.innerText="";for(var g=0;g<A.length;g++){var l=document.createElement("span");l.style.display="flex";l.style.alignItems="center";l.style.whiteSpace="nowrap";var n=document.createElement("img");n.src=Editor.trashImage;n.style.position="relative";n.style.cursor="pointer";n.style.marginRight="4px";n.style.display="inline-block";n.style.width="18px";n.setAttribute("title",mxResources.get("delete"));l.appendChild(n);mxUtils.write(l,A[g]);u.appendChild(l);mxUtils.br(u);mxEvent.addListener(n,"click",-function(v){return function(){b.confirm(mxResources.get("delete")+' "'+A[v]+'"?',function(){null!=k&&k(A[v]);A.splice(v,1);p()})}}(g))}}}var q=document.createElement("div"),u=document.createElement("div");u.style.height="180px";u.style.overflow="auto";var A=mxSettings.getPlugins().slice(),J=!1;q.appendChild(u);p();J=!1;var I=mxUtils.button(mxResources.get("add"),null!=f?function(){f(function(g){g&&0>mxUtils.indexOf(A,g)&&A.push(g);p()})}:function(){var g=document.createElement("div"),l=document.createElement("span");+function(v){return function(){b.confirm(mxResources.get("delete")+' "'+A[v]+'"?',function(){null!=k&&k(A[v]);A.splice(v,1);p()})}}(g))}}}var q=document.createElement("div"),u=document.createElement("div");u.style.height="180px";u.style.overflow="auto";var A=mxSettings.getPlugins().slice(),I=!1;q.appendChild(u);p();I=!1;var H=mxUtils.button(mxResources.get("add"),null!=f?function(){f(function(g){g&&0>mxUtils.indexOf(A,g)&&A.push(g);p()})}:function(){var g=document.createElement("div"),l=document.createElement("span");l.style.marginTop="6px";mxUtils.write(l,mxResources.get("builtinPlugins")+": ");g.appendChild(l);var n=document.createElement("select");n.style.width="150px";for(l=0;l<App.publicPlugin.length;l++){var v=document.createElement("option");mxUtils.write(v,App.publicPlugin[l]);v.value=App.publicPlugin[l];n.appendChild(v)}g.appendChild(n);mxUtils.br(g);mxUtils.br(g);l=mxUtils.button(mxResources.get("custom")+"...",function(){var x=new FilenameDialog(b,"",mxResources.get("add"),function(B){b.hideDialog();-if(null!=B&&0<B.length){B=B.split(";");for(var C=0;C<B.length;C++){var H=B[C],D=App.pluginRegistry[H];null!=D&&(H=D);0<H.length&&0>mxUtils.indexOf(A,H)&&A.push(H)}p()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(x.container,300,80,!0,!0);x.init()});l.className="geBtn";ALLOW_CUSTOM_PLUGINS||(l.style.display="none");g=new CustomDialog(b,g,mxUtils.bind(this,function(){var x=App.pluginRegistry[n.value];0>mxUtils.indexOf(A,x)&&(A.push(x),p())}),null,null,null,l);b.showDialog(g.container,-360,100,!0,!0)});I.className="geBtn";var G=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});G.className="geBtn";var E=mxUtils.button(d?mxResources.get("close"):mxResources.get("apply"),function(){J?(mxSettings.setPlugins(A),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});E.className="geBtn gePrimaryBtn";var c=document.createElement("div");c.style.marginTop="14px";c.style.textAlign="right";b.isOffline()||c.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));-b.editor.cancelFirst?(d||c.appendChild(G),c.appendChild(I),c.appendChild(E)):(c.appendChild(I),c.appendChild(E),d||c.appendChild(G));q.appendChild(c);this.container=q},CropImageDialog=function(b,f,k,d){function p(){null!=g&&(E.style.overflow="hidden",g.maxFitScale=null,g.fit(8),g.center(),E.style.overflow="auto")}function q(T){var Q=document.createElement("span");Q.style.marginLeft="6px";Q.style.fontSize="11px";mxUtils.write(Q,T);V.appendChild(Q);T=document.createElement("input");T.setAttribute("type",-"text");T.style.cssText="width:46px;margin:0 2px;text-align:right;";V.appendChild(T);return T}function u(){var T=x.geometry;z.value=Math.round(T.x);L.value=Math.round(T.y);K.value=Math.round(T.width);M.value=Math.round(T.height)}function A(){if(null!=g){var T=parseFloat(z.value),Q=parseFloat(L.value),R=parseFloat(K.value),W=parseFloat(M.value);if(isFinite(T)&&isFinite(Q)&&isFinite(R)&&isFinite(W)&&0<R&&0<W){var X=x.geometry.clone();X.x=T;X.y=Q;X.width=R;X.height=W;g.model.setGeometry(x,X);g.model.setStyle(x,-H+J());g.selectAll()}}}function J(){var T=y.checked,Q=F.checked,R=x.geometry;0>R.x?(R.width+=R.x,R.x=0):R.x+R.width>B&&(R.width=B-R.x,R.x=Math.min(R.x,B));0>R.y?(R.height+=R.y,R.y=0):R.y+R.height>C&&(R.height=C-R.y,R.y=Math.min(R.y,C));var W=R.x/B*100,X=100-(R.x+R.width)/B*100,Y=100-(R.y+R.height)/C*100;return"inset("+mxUtils.format(R.y/C*100)+"% "+mxUtils.format(X)+"% "+mxUtils.format(Y)+"% "+mxUtils.format(W)+"%"+(T?" round "+v+"%":Q?" round 50%":"")+")"}function I(T){null!=g&&(!0!==T&&(g.model.setGeometry(x,-n.clone()),v=5,O.value=v),g.model.setStyle(x,H+J()),g.selectAll(),u(),N.style.visibility=y.checked?"visible":"hidden")}var G=document.createElement("div");G.style.display="flex";G.style.flexDirection="column";G.style.height="100%";var E=document.createElement("div");E.style.flex="1";E.style.minHeight="0";E.style.overflow="auto";E.style.border="1px solid";G.appendChild(E);var c=f.replace(";base64",""),g=null,l=null,n=null,v=5,x=new mxCell("",new mxGeometry(0,0,1,1),""),B=0,C=0,H="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+-c+";clipPath=",D="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",U="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",S=new Image;S.onload=function(){function T(){g.model.setStyle(x,H+J());u()}B=S.naturalWidth;C=S.naturalHeight;n=new mxGeometry(.15*B,.15*C,.7*B,.7*C);x.geometry=n.clone();g=new Graph(E);g.autoExtend=!1;g.autoScroll=!1;g.setGridEnabled(!1);g.setEnabled(!0);-g.setPanning(!0);g.setConnectable(!1);g.getRubberband().setEnabled(!1);g.graphHandler.allowLivePreview=!1;g.centerZoom=!0;g.background="#ffffff";var Q=g.createVertexHandler;g.createVertexHandler=function(){var oa=Q.apply(this,arguments);oa.livePreview=!1;return oa};var R=g.isCellSelectable;g.isCellSelectable=function(oa){return oa===x&&R.apply(this,arguments)};l=new mxCell("",new mxGeometry(0,0,B,C),D);l.vertex=!0;g.addCell(l);if(null!=k)try{if("inset"==k.substring(0,5)){var W=x.geometry,X=k.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),-Y=parseFloat(X[0]),Z=parseFloat(X[1]),ba=parseFloat(X[2]),ea=parseFloat(X[3]);isFinite(Y)&&isFinite(Z)&&isFinite(ba)&&isFinite(ea)?(W.x=ea/100*B,W.y=Y/100*C,W.width=(100-Z)/100*B-W.x,W.height=(100-ba)/100*C-W.y,"round"==X[4]?"50%"==X[5]?F.setAttribute("checked","checked"):(v=parseInt(X[5]),O.value=v,y.setAttribute("checked","checked"),N.style.visibility="visible"):m.setAttribute("checked","checked")):k=null}else k=null}catch(oa){}x.style=H+(k?k:J());x.vertex=!0;g.addCell(x);g.selectAll();g.addListener(mxEvent.CELLS_MOVED,-T);g.addListener(mxEvent.CELLS_RESIZED,T);var ha=g.graphHandler.mouseUp,fa=g.graphHandler.mouseDown;g.graphHandler.mouseUp=function(){ha.apply(this,arguments);null!=l&&g.model.setStyle(l,D)};g.graphHandler.mouseDown=function(){fa.apply(this,arguments);null!=l&&g.model.setStyle(l,U)};g.dblClick=function(){};var la=g.getSelectionModel().changeSelection;g.getSelectionModel().changeSelection=function(){la.call(this,[x],[x])};u();p()};S.onerror=function(){S.onload=null;S.src=Editor.errorImage};S.src=f;+if(null!=B&&0<B.length){B=B.split(";");for(var C=0;C<B.length;C++){var G=B[C],N=App.pluginRegistry[G];null!=N&&(G=N);0<G.length&&0>mxUtils.indexOf(A,G)&&A.push(G)}p()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(x.container,300,80,!0,!0);x.init()});l.className="geBtn";ALLOW_CUSTOM_PLUGINS||(l.style.display="none");g=new CustomDialog(b,g,mxUtils.bind(this,function(){var x=App.pluginRegistry[n.value];0>mxUtils.indexOf(A,x)&&(A.push(x),p())}),null,null,null,l);b.showDialog(g.container,+360,100,!0,!0)});H.className="geBtn";var F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";var D=mxUtils.button(d?mxResources.get("close"):mxResources.get("apply"),function(){I?(mxSettings.setPlugins(A),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});D.className="geBtn gePrimaryBtn";var c=document.createElement("div");c.style.marginTop="14px";c.style.textAlign="right";b.isOffline()||c.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));+b.editor.cancelFirst?(d||c.appendChild(F),c.appendChild(H),c.appendChild(D)):(c.appendChild(H),c.appendChild(D),d||c.appendChild(F));q.appendChild(c);this.container=q},CropImageDialog=function(b,f,k,d){function p(){null!=g&&(D.style.overflow="hidden",g.maxFitScale=null,g.fit(8),g.center(),D.style.overflow="auto")}function q(U){var R=document.createElement("span");R.style.marginLeft="6px";R.style.fontSize="11px";mxUtils.write(R,U);V.appendChild(R);U=document.createElement("input");U.setAttribute("type",+"text");U.style.cssText="width:46px;margin:0 2px;text-align:right;";V.appendChild(U);return U}function u(){var U=x.geometry;z.value=Math.round(U.x);L.value=Math.round(U.y);K.value=Math.round(U.width);M.value=Math.round(U.height)}function A(){if(null!=g){var U=parseFloat(z.value),R=parseFloat(L.value),S=parseFloat(K.value),W=parseFloat(M.value);if(isFinite(U)&&isFinite(R)&&isFinite(S)&&isFinite(W)&&0<S&&0<W){var X=x.geometry.clone();X.x=U;X.y=R;X.width=S;X.height=W;g.model.setGeometry(x,X);g.model.setStyle(x,+G+I());g.selectAll()}}}function I(){var U=y.checked,R=E.checked,S=x.geometry;0>S.x?(S.width+=S.x,S.x=0):S.x+S.width>B&&(S.width=B-S.x,S.x=Math.min(S.x,B));0>S.y?(S.height+=S.y,S.y=0):S.y+S.height>C&&(S.height=C-S.y,S.y=Math.min(S.y,C));var W=S.x/B*100,X=100-(S.x+S.width)/B*100,Y=100-(S.y+S.height)/C*100;return"inset("+mxUtils.format(S.y/C*100)+"% "+mxUtils.format(X)+"% "+mxUtils.format(Y)+"% "+mxUtils.format(W)+"%"+(U?" round "+v+"%":R?" round 50%":"")+")"}function H(U){null!=g&&(!0!==U&&(g.model.setGeometry(x,+n.clone()),v=5,O.value=v),g.model.setStyle(x,G+I()),g.selectAll(),u(),P.style.visibility=y.checked?"visible":"hidden")}var F=document.createElement("div");F.style.display="flex";F.style.flexDirection="column";F.style.height="100%";var D=document.createElement("div");D.style.flex="1";D.style.minHeight="0";D.style.overflow="auto";D.style.border="1px solid";F.appendChild(D);var c=f.replace(";base64",""),g=null,l=null,n=null,v=5,x=new mxCell("",new mxGeometry(0,0,1,1),""),B=0,C=0,G="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="++c+";clipPath=",N="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",J="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",T=new Image;T.onload=function(){function U(){g.model.setStyle(x,G+I());u()}B=T.naturalWidth;C=T.naturalHeight;n=new mxGeometry(.15*B,.15*C,.7*B,.7*C);x.geometry=n.clone();g=new Graph(D);g.autoExtend=!1;g.autoScroll=!1;g.setGridEnabled(!1);g.setEnabled(!0);+g.setPanning(!0);g.setConnectable(!1);g.getRubberband().setEnabled(!1);g.graphHandler.allowLivePreview=!1;g.centerZoom=!0;g.background="#ffffff";var R=g.createVertexHandler;g.createVertexHandler=function(){var na=R.apply(this,arguments);na.livePreview=!1;return na};var S=g.isCellSelectable;g.isCellSelectable=function(na){return na===x&&S.apply(this,arguments)};l=new mxCell("",new mxGeometry(0,0,B,C),N);l.vertex=!0;g.addCell(l);if(null!=k)try{if("inset"==k.substring(0,5)){var W=x.geometry,X=k.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),+Y=parseFloat(X[0]),Z=parseFloat(X[1]),aa=parseFloat(X[2]),fa=parseFloat(X[3]);isFinite(Y)&&isFinite(Z)&&isFinite(aa)&&isFinite(fa)?(W.x=fa/100*B,W.y=Y/100*C,W.width=(100-Z)/100*B-W.x,W.height=(100-aa)/100*C-W.y,"round"==X[4]?"50%"==X[5]?E.setAttribute("checked","checked"):(v=parseInt(X[5]),O.value=v,y.setAttribute("checked","checked"),P.style.visibility="visible"):m.setAttribute("checked","checked")):k=null}else k=null}catch(na){}x.style=G+(k?k:I());x.vertex=!0;g.addCell(x);g.selectAll();g.addListener(mxEvent.CELLS_MOVED,+U);g.addListener(mxEvent.CELLS_RESIZED,U);var ia=g.graphHandler.mouseUp,ea=g.graphHandler.mouseDown;g.graphHandler.mouseUp=function(){ia.apply(this,arguments);null!=l&&g.model.setStyle(l,N)};g.graphHandler.mouseDown=function(){ea.apply(this,arguments);null!=l&&g.model.setStyle(l,J)};g.dblClick=function(){};var ma=g.getSelectionModel().changeSelection;g.getSelectionModel().changeSelection=function(){ma.call(this,[x],[x])};u();p()};T.onerror=function(){T.onload=null;T.src=Editor.errorImage};T.src=f;var V=document.createElement("div");V.style.display="flex";V.style.flexShrink="0";V.style.alignItems="center";V.style.justifyContent="center";V.style.paddingTop="6px";f=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=g&&g.zoomIn()});c=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=g&&g.zoomOut()});var t=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){p()});V.appendChild(f);V.appendChild(c);V.appendChild(t);-var z=q("X"),L=q("Y"),K=q("W"),M=q("H");mxEvent.addListener(z,"change",A);mxEvent.addListener(L,"change",A);mxEvent.addListener(K,"change",A);mxEvent.addListener(M,"change",A);G.appendChild(V);f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.display="flex";f.style.flexShrink="0";f.style.alignItems="center";f.style.justifyContent="center";var m=document.createElement("input");m.setAttribute("type","radio");m.setAttribute("id","croppingRect");m.setAttribute("name","croppingShape");+var z=q("X"),L=q("Y"),K=q("W"),M=q("H");mxEvent.addListener(z,"change",A);mxEvent.addListener(L,"change",A);mxEvent.addListener(K,"change",A);mxEvent.addListener(M,"change",A);F.appendChild(V);f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.display="flex";f.style.flexShrink="0";f.style.alignItems="center";f.style.justifyContent="center";var m=document.createElement("input");m.setAttribute("type","radio");m.setAttribute("id","croppingRect");m.setAttribute("name","croppingShape");m.setAttribute("checked","checked");m.style.margin="5px";f.appendChild(m);c=document.createElement("label");c.setAttribute("for","croppingRect");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rectangle"));f.appendChild(c);var y=document.createElement("input");y.setAttribute("type","radio");y.setAttribute("id","croppingRounded");y.setAttribute("name","croppingShape");y.style.margin="5px";f.appendChild(y);c=document.createElement("label");-c.setAttribute("for","croppingRounded");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rounded"));f.appendChild(c);var F=document.createElement("input");F.setAttribute("type","radio");F.setAttribute("id","croppingEllipse");F.setAttribute("name","croppingShape");F.style.margin="5px";f.appendChild(F);c=document.createElement("label");c.setAttribute("for","croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding=-"3px";mxUtils.write(c,mxResources.get("ellipse"));f.appendChild(c);G.appendChild(f);mxEvent.addListener(m,"change",I);mxEvent.addListener(y,"change",I);mxEvent.addListener(F,"change",I);var N=document.createElement("div");N.style.textAlign="center";N.style.flexShrink="0";N.style.visibility="hidden";var O=document.createElement("input");O.setAttribute("type","range");O.setAttribute("min","1");O.setAttribute("max","49");O.setAttribute("value",v);O.setAttribute("title",mxResources.get("arcSize"));N.appendChild(O);-G.appendChild(N);mxEvent.addListener(O,"change",function(){v=this.value;I(!0)});f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){d(J(),x.geometry.width,x.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";t=mxUtils.button(mxResources.get("reset"),function(){d(null,B,C);b.hideDialog()});t.className="geBtn";var P=document.createElement("div");P.style.flexShrink="0";P.style.marginTop="10px";-P.style.whiteSpace="nowrap";P.style.display="flex";P.style.justifyContent="flex-end";b.editor.cancelFirst?(P.appendChild(f),P.appendChild(t),P.appendChild(c)):(P.appendChild(t),P.appendChild(c),P.appendChild(f));G.appendChild(P);this.container=G},EditGeometryDialog=function(b,f){var k=b.editor.graph,d=1==f.length?k.getCellGeometry(f[0]):null,p=document.createElement("div"),q=document.createElement("table"),u=document.createElement("tbody"),A=document.createElement("tr"),J=document.createElement("td"),-I=document.createElement("td");q.style.paddingLeft="6px";mxUtils.write(J,mxResources.get("relative")+":");var G=document.createElement("input");G.setAttribute("type","checkbox");null!=d&&d.relative&&(G.setAttribute("checked","checked"),G.defaultChecked=!0);this.init=function(){G.focus()};I.appendChild(G);A.appendChild(J);A.appendChild(I);u.appendChild(A);A=document.createElement("tr");J=document.createElement("td");I=document.createElement("td");mxUtils.write(J,mxResources.get("left")+":");var E=-document.createElement("input");E.setAttribute("type","text");E.style.width="100px";E.value=null!=d?d.x:"";I.appendChild(E);A.appendChild(J);A.appendChild(I);u.appendChild(A);A=document.createElement("tr");J=document.createElement("td");I=document.createElement("td");mxUtils.write(J,mxResources.get("top")+":");var c=document.createElement("input");c.setAttribute("type","text");c.style.width="100px";c.value=null!=d?d.y:"";I.appendChild(c);A.appendChild(J);A.appendChild(I);u.appendChild(A);A=document.createElement("tr");-J=document.createElement("td");I=document.createElement("td");mxUtils.write(J,mxResources.get("dx")+":");var g=document.createElement("input");g.setAttribute("type","text");g.style.width="100px";g.value=null!=d&&null!=d.offset?d.offset.x:"";I.appendChild(g);A.appendChild(J);A.appendChild(I);u.appendChild(A);A=document.createElement("tr");J=document.createElement("td");I=document.createElement("td");mxUtils.write(J,mxResources.get("dy")+":");var l=document.createElement("input");l.setAttribute("type",-"text");l.style.width="100px";l.value=null!=d&&null!=d.offset?d.offset.y:"";I.appendChild(l);A.appendChild(J);A.appendChild(I);u.appendChild(A);A=document.createElement("tr");J=document.createElement("td");I=document.createElement("td");mxUtils.write(J,mxResources.get("width")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=d?d.width:"";I.appendChild(n);A.appendChild(J);A.appendChild(I);u.appendChild(A);A=document.createElement("tr");J=-document.createElement("td");I=document.createElement("td");mxUtils.write(J,mxResources.get("height")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=d?d.height:"";I.appendChild(v);A.appendChild(J);A.appendChild(I);u.appendChild(A);A=document.createElement("tr");J=document.createElement("td");I=document.createElement("td");mxUtils.write(J,mxResources.get("rotation")+":");var x=document.createElement("input");x.setAttribute("type","text");-x.style.width="100px";x.value=1==f.length?mxUtils.getValue(k.getCellStyle(f[0]),mxConstants.STYLE_ROTATION,0):"";I.appendChild(x);A.appendChild(J);A.appendChild(I);u.appendChild(A);q.appendChild(u);p.appendChild(q);d=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});d.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();k.getModel().beginUpdate();try{for(var C=0;C<f.length;C++){var H=k.getCellGeometry(f[C]);null!=H&&(H=H.clone(),k.isCellMovable(f[C])&&-(H.relative=G.checked,0<mxUtils.trim(E.value).length&&(H.x=Number(E.value)),0<mxUtils.trim(c.value).length&&(H.y=Number(c.value)),0<mxUtils.trim(g.value).length&&(null==H.offset&&(H.offset=new mxPoint),H.offset.x=Number(g.value)),0<mxUtils.trim(l.value).length&&(null==H.offset&&(H.offset=new mxPoint),H.offset.y=Number(l.value))),k.isCellResizable(f[C])&&(0<mxUtils.trim(n.value).length&&(H.width=Number(n.value)),0<mxUtils.trim(v.value).length&&(H.height=Number(v.value))),k.getModel().setGeometry(f[C],-H));0<mxUtils.trim(x.value).length&&k.setCellStyles(mxConstants.STYLE_ROTATION,Number(x.value),[f[C]])}}finally{k.getModel().endUpdate()}});B.className="geBtn gePrimaryBtn";mxEvent.addListener(p,"keypress",function(C){13==C.keyCode&&B.click()});q=document.createElement("div");q.style.marginTop="20px";q.style.textAlign="right";b.editor.cancelFirst?(q.appendChild(d),q.appendChild(B)):(q.appendChild(B),q.appendChild(d));p.appendChild(q);this.container=p},LibraryDialog=function(b,f,k,d,p,q,u){function A(t){for(t=-document.elementFromPoint(t.clientX,t.clientY);null!=t&&t.parentNode!=n;)t=t.parentNode;var z=null;if(null!=t){var L=n.firstChild;for(z=0;null!=L&&L!=t;)L=L.nextSibling,z++}return z}function J(t,z,L,K,M,m,y,F,N){try{if(b.spinner.stop(),null==z||"image/"==z.substring(0,6))if(null==t&&null!=y||null==x[t]){var O=function(){Z.innerText="";Z.style.cursor="pointer";Z.style.whiteSpace="nowrap";Z.style.textOverflow="ellipsis";mxUtils.write(Z,null!=ba.title&&0<ba.title.length?ba.title:mxResources.get("untitled"));-Z.style.color=null==ba.title||0==ba.title.length?"#d0d0d0":""};n.style.backgroundImage="";v.style.display="none";var P=M,T=m;if(M>b.maxImageSize||m>b.maxImageSize){var Q=Math.min(1,Math.min(b.maxImageSize/Math.max(1,M)),b.maxImageSize/Math.max(1,m));M*=Q;m*=Q}P>T?(T=Math.round(100*T/P),P=100):(P=Math.round(100*P/T),T=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!=t){var W=document.createElement("img");W.setAttribute("src",D.convert(t));W.style.width=P+"px";W.style.height=T+"px";W.style.margin="10px";W.style.paddingBottom=Math.floor((100-T)/2)+"px";W.style.paddingLeft=Math.floor((100-P)/2)+"px";R.appendChild(W)}else if(null!=y){var X=b.stringToCells("<"==y.xml.charAt(0)?y.xml:Graph.decompress(y.xml));0<X.length&&(b.sidebar.createThumb(X,100,100,R,null,!0,!1,null,null,c.shapeBackgroundColor),-R.firstChild.style.display="inline-block",R.firstChild.style.cursor="")}var Y=document.createElement("img");Y.setAttribute("src",Editor.closeBlackImage);Y.setAttribute("border","0");Y.setAttribute("title",mxResources.get("delete"));Y.setAttribute("align","top");Y.style.paddingTop="4px";Y.style.position="absolute";Y.style.marginLeft="-12px";Y.style.zIndex="1";Y.style.cursor="pointer";mxEvent.addListener(Y,"dragstart",function(oa){mxEvent.consume(oa)});(function(oa,pa,va){mxEvent.addListener(Y,"click",-function(ta){x[pa]=null;for(var ma=0;ma<E.length;ma++)if(null!=E[ma].data&&E[ma].data==pa||null!=E[ma].xml&&null!=va&&E[ma].xml==va.xml){E.splice(ma,1);break}R.parentNode.removeChild(oa);0==E.length&&(n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(ta)});mxEvent.addListener(Y,"dblclick",function(ta){mxEvent.consume(ta)})})(R,t,y);R.appendChild(Y);R.style.marginBottom="30px";var Z=document.createElement("div");Z.style.position="absolute";Z.style.boxSizing=-"border-box";Z.style.bottom="-18px";Z.style.left="10px";Z.style.right="10px";Z.style.backgroundColor="light-dark(#ffffff, transparent)";Z.style.overflow="hidden";Z.style.textAlign="center";Z.setAttribute("title",mxResources.get("rename"));var ba=null;null!=t?(ba={data:t,w:M,h:m,title:N},null!=F&&(ba.aspect=F),x[t]=W,E.push(ba)):null!=y&&(y.aspect="fixed",E.push(y),ba=y);mxEvent.addListener(Z,"keydown",function(oa){13==oa.keyCode&&null!=H&&(H(),H=null,mxEvent.consume(oa))});O();R.appendChild(Z);mxEvent.addListener(Z,-"mousedown",function(oa){"true"!=Z.getAttribute("contentEditable")&&mxEvent.consume(oa)});X=function(oa){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var pa=new FilenameDialog(b,ba.title||"",mxResources.get("ok"),function(va){null!=va&&(ba.title=va,O())},mxResources.get("enterValue"));b.showDialog(pa.container,300,80,!0,!0);pa.init();mxEvent.consume(oa)}else if("true"!=Z.getAttribute("contentEditable")){null!=H&&(H(),H=null);if(null==ba.title||0==ba.title.length)Z.innerText=-"";Z.style.textOverflow="";Z.style.whiteSpace="";Z.style.cursor="text";Z.style.color="";Z.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(Z.style,"user-select","text");Z.focus();document.execCommand("selectAll",!1,null);H=function(){Z.removeAttribute("contentEditable");Z.style.cursor="pointer";ba.title=mxUtils.getTextContent(Z);O()};mxEvent.consume(oa)}};mxEvent.addListener(Z,"click",X);mxEvent.addListener(R,"dblclick",X);n.appendChild(R);mxEvent.addListener(R,"dragstart",function(oa){null==-H&&(null==t&&null!=y&&(Y.style.visibility="hidden",Z.style.visibility="hidden"),mxClient.IS_FF&&null!=y.xml&&oa.dataTransfer.setData("Text",y.xml),B=A(oa),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);Y.style.visibility="";Z.style.visibility=""},0))});mxEvent.addListener(R,"dragend",function(oa){"hidden"==Y.style.visibility&&(Y.style.visibility="",Z.style.visibility="");B=null;mxUtils.setOpacity(R,-100);mxUtils.setPrefixedStyle(R.style,"transform",null)})}else U||(U=!0,b.handleError({message:mxResources.get("fileExists")}));else{M=!1;try{if(P=mxUtils.parseXml(t),"mxlibrary"==P.documentElement.nodeName){T=JSON.parse(mxUtils.getTextContent(P.documentElement));if(null!=T&&0<T.length)for(var ea=0;ea<T.length;ea++)null!=T[ea].xml?J(null,null,0,0,0,0,T[ea]):J(T[ea].data,null,0,0,T[ea].w,T[ea].h,null,"fixed",T[ea].title);M=!0}else if("mxfile"==P.documentElement.nodeName){var ha=P.documentElement.getElementsByTagName("diagram");-for(ea=0;ea<ha.length;ea++){var fa=Editor.getDiagramNodeXml(ha[ea]);X=b.stringToCells(fa);if(0<X.length){var la=b.editor.graph.getBoundingBoxFromGeometry(X);null!=la&&J(null,null,0,0,0,0,{xml:fa,w:la.width,h:la.height})}}M=!0}}catch(oa){null!=window.console&&console.error("Error in library dialog: "+oa)}M||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(oa){null!=window.console&&console.log("Error in library dialog: "+oa)}return null}function I(t){t.dataTransfer.dropEffect=-null!=B?"move":"copy";t.stopPropagation();t.preventDefault()}function G(t){t.stopPropagation();t.preventDefault();U=!1;C=A(t);if(null!=B)null!=C&&C<n.children.length?(E.splice(C>B?C-1:C,0,E.splice(B,1)[0]),n.insertBefore(n.children[B],n.children[C])):(E.push(E.splice(B,1)[0]),n.appendChild(n.children[B]));else if(0<t.dataTransfer.files.length)b.importFiles(t.dataTransfer.files,0,0,b.maxImageSize,S(t));else if(0<=mxUtils.indexOf(t.dataTransfer.types,"text/uri-list")){var z=decodeURIComponent(t.dataTransfer.getData("text/uri-list"));-(/(\.jpg)($|\?)/i.test(z)||/(\.png)($|\?)/i.test(z)||/(\.gif)($|\?)/i.test(z)||/(\.svg)($|\?)/i.test(z))&&b.loadImage(z,function(L){J(z,null,0,0,L.width,L.height);n.scrollTop=n.scrollHeight})}t.stopPropagation();t.preventDefault()}var E=[],c=b.editor.graph;k=document.createElement("div");k.style.height="100%";var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.height="40px";k.appendChild(g);mxUtils.write(g,mxResources.get("filename")+":");null==f&&(f=b.defaultLibraryName+".xml");+c.setAttribute("for","croppingRounded");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rounded"));f.appendChild(c);var E=document.createElement("input");E.setAttribute("type","radio");E.setAttribute("id","croppingEllipse");E.setAttribute("name","croppingShape");E.style.margin="5px";f.appendChild(E);c=document.createElement("label");c.setAttribute("for","croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding=+"3px";mxUtils.write(c,mxResources.get("ellipse"));f.appendChild(c);F.appendChild(f);mxEvent.addListener(m,"change",H);mxEvent.addListener(y,"change",H);mxEvent.addListener(E,"change",H);var P=document.createElement("div");P.style.textAlign="center";P.style.flexShrink="0";P.style.visibility="hidden";var O=document.createElement("input");O.setAttribute("type","range");O.setAttribute("min","1");O.setAttribute("max","49");O.setAttribute("value",v);O.setAttribute("title",mxResources.get("arcSize"));P.appendChild(O);+F.appendChild(P);mxEvent.addListener(O,"change",function(){v=this.value;H(!0)});f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){d(I(),x.geometry.width,x.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";t=mxUtils.button(mxResources.get("reset"),function(){d(null,B,C);b.hideDialog()});t.className="geBtn";var Q=document.createElement("div");Q.style.flexShrink="0";Q.style.marginTop="10px";+Q.style.whiteSpace="nowrap";Q.style.display="flex";Q.style.justifyContent="flex-end";b.editor.cancelFirst?(Q.appendChild(f),Q.appendChild(t),Q.appendChild(c)):(Q.appendChild(t),Q.appendChild(c),Q.appendChild(f));F.appendChild(Q);this.container=F},EditGeometryDialog=function(b,f){var k=b.editor.graph,d=1==f.length?k.getCellGeometry(f[0]):null,p=document.createElement("div"),q=document.createElement("table"),u=document.createElement("tbody"),A=document.createElement("tr"),I=document.createElement("td"),+H=document.createElement("td");q.style.paddingLeft="6px";mxUtils.write(I,mxResources.get("relative")+":");var F=document.createElement("input");F.setAttribute("type","checkbox");null!=d&&d.relative&&(F.setAttribute("checked","checked"),F.defaultChecked=!0);this.init=function(){F.focus()};H.appendChild(F);A.appendChild(I);A.appendChild(H);u.appendChild(A);A=document.createElement("tr");I=document.createElement("td");H=document.createElement("td");mxUtils.write(I,mxResources.get("left")+":");var D=+document.createElement("input");D.setAttribute("type","text");D.style.width="100px";D.value=null!=d?d.x:"";H.appendChild(D);A.appendChild(I);A.appendChild(H);u.appendChild(A);A=document.createElement("tr");I=document.createElement("td");H=document.createElement("td");mxUtils.write(I,mxResources.get("top")+":");var c=document.createElement("input");c.setAttribute("type","text");c.style.width="100px";c.value=null!=d?d.y:"";H.appendChild(c);A.appendChild(I);A.appendChild(H);u.appendChild(A);A=document.createElement("tr");+I=document.createElement("td");H=document.createElement("td");mxUtils.write(I,mxResources.get("dx")+":");var g=document.createElement("input");g.setAttribute("type","text");g.style.width="100px";g.value=null!=d&&null!=d.offset?d.offset.x:"";H.appendChild(g);A.appendChild(I);A.appendChild(H);u.appendChild(A);A=document.createElement("tr");I=document.createElement("td");H=document.createElement("td");mxUtils.write(I,mxResources.get("dy")+":");var l=document.createElement("input");l.setAttribute("type",+"text");l.style.width="100px";l.value=null!=d&&null!=d.offset?d.offset.y:"";H.appendChild(l);A.appendChild(I);A.appendChild(H);u.appendChild(A);A=document.createElement("tr");I=document.createElement("td");H=document.createElement("td");mxUtils.write(I,mxResources.get("width")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=d?d.width:"";H.appendChild(n);A.appendChild(I);A.appendChild(H);u.appendChild(A);A=document.createElement("tr");I=+document.createElement("td");H=document.createElement("td");mxUtils.write(I,mxResources.get("height")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=d?d.height:"";H.appendChild(v);A.appendChild(I);A.appendChild(H);u.appendChild(A);A=document.createElement("tr");I=document.createElement("td");H=document.createElement("td");mxUtils.write(I,mxResources.get("rotation")+":");var x=document.createElement("input");x.setAttribute("type","text");+x.style.width="100px";x.value=1==f.length?mxUtils.getValue(k.getCellStyle(f[0]),mxConstants.STYLE_ROTATION,0):"";H.appendChild(x);A.appendChild(I);A.appendChild(H);u.appendChild(A);q.appendChild(u);p.appendChild(q);d=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});d.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();k.getModel().beginUpdate();try{for(var C=0;C<f.length;C++){var G=k.getCellGeometry(f[C]);null!=G&&(G=G.clone(),k.isCellMovable(f[C])&&+(G.relative=F.checked,0<mxUtils.trim(D.value).length&&(G.x=Number(D.value)),0<mxUtils.trim(c.value).length&&(G.y=Number(c.value)),0<mxUtils.trim(g.value).length&&(null==G.offset&&(G.offset=new mxPoint),G.offset.x=Number(g.value)),0<mxUtils.trim(l.value).length&&(null==G.offset&&(G.offset=new mxPoint),G.offset.y=Number(l.value))),k.isCellResizable(f[C])&&(0<mxUtils.trim(n.value).length&&(G.width=Number(n.value)),0<mxUtils.trim(v.value).length&&(G.height=Number(v.value))),k.getModel().setGeometry(f[C],+G));0<mxUtils.trim(x.value).length&&k.setCellStyles(mxConstants.STYLE_ROTATION,Number(x.value),[f[C]])}}finally{k.getModel().endUpdate()}});B.className="geBtn gePrimaryBtn";mxEvent.addListener(p,"keypress",function(C){13==C.keyCode&&B.click()});q=document.createElement("div");q.style.marginTop="20px";q.style.textAlign="right";b.editor.cancelFirst?(q.appendChild(d),q.appendChild(B)):(q.appendChild(B),q.appendChild(d));p.appendChild(q);this.container=p},LibraryDialog=function(b,f,k,d,p,q,u){function A(t){for(t=+document.elementFromPoint(t.clientX,t.clientY);null!=t&&t.parentNode!=n;)t=t.parentNode;var z=null;if(null!=t){var L=n.firstChild;for(z=0;null!=L&&L!=t;)L=L.nextSibling,z++}return z}function I(t,z,L,K,M,m,y,E,P){try{if(b.spinner.stop(),null==z||"image/"==z.substring(0,6))if(null==t&&null!=y||null==x[t]){var O=function(){Z.innerText="";Z.style.cursor="pointer";Z.style.whiteSpace="nowrap";Z.style.textOverflow="ellipsis";mxUtils.write(Z,null!=aa.title&&0<aa.title.length?aa.title:mxResources.get("untitled"));+Z.style.color=null==aa.title||0==aa.title.length?"#d0d0d0":""};n.style.backgroundImage="";v.style.display="none";var Q=M,U=m;if(M>b.maxImageSize||m>b.maxImageSize){var R=Math.min(1,Math.min(b.maxImageSize/Math.max(1,M)),b.maxImageSize/Math.max(1,m));M*=R;m*=R}Q>U?(U=Math.round(100*U/Q),Q=100):(Q=Math.round(100*Q/U),U=100);var S=document.createElement("div");S.setAttribute("draggable","true");S.style.display="inline-block";S.style.position="relative";S.style.padding="0 12px";S.style.cursor="move";+mxUtils.setPrefixedStyle(S.style,"transition","transform .1s ease-in-out");if(null!=t){var W=document.createElement("img");W.setAttribute("src",N.convert(t));W.style.width=Q+"px";W.style.height=U+"px";W.style.margin="10px";W.style.paddingBottom=Math.floor((100-U)/2)+"px";W.style.paddingLeft=Math.floor((100-Q)/2)+"px";S.appendChild(W)}else if(null!=y){var X=b.stringToCells("<"==y.xml.charAt(0)?y.xml:Graph.decompress(y.xml));0<X.length&&(b.sidebar.createThumb(X,100,100,S,null,!0,!1,null,null,c.shapeBackgroundColor),+S.firstChild.style.display="inline-block",S.firstChild.style.cursor="")}var Y=document.createElement("img");Y.setAttribute("src",Editor.closeBlackImage);Y.setAttribute("border","0");Y.setAttribute("title",mxResources.get("delete"));Y.setAttribute("align","top");Y.style.paddingTop="4px";Y.style.position="absolute";Y.style.marginLeft="-12px";Y.style.zIndex="1";Y.style.cursor="pointer";mxEvent.addListener(Y,"dragstart",function(na){mxEvent.consume(na)});(function(na,ua,ta){mxEvent.addListener(Y,"click",+function(sa){x[ua]=null;for(var la=0;la<D.length;la++)if(null!=D[la].data&&D[la].data==ua||null!=D[la].xml&&null!=ta&&D[la].xml==ta.xml){D.splice(la,1);break}S.parentNode.removeChild(na);0==D.length&&(n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(sa)});mxEvent.addListener(Y,"dblclick",function(sa){mxEvent.consume(sa)})})(S,t,y);S.appendChild(Y);S.style.marginBottom="30px";var Z=document.createElement("div");Z.style.position="absolute";Z.style.boxSizing=+"border-box";Z.style.bottom="-18px";Z.style.left="10px";Z.style.right="10px";Z.style.backgroundColor="light-dark(#ffffff, transparent)";Z.style.overflow="hidden";Z.style.textAlign="center";Z.setAttribute("title",mxResources.get("rename"));var aa=null;null!=t?(aa={data:t,w:M,h:m,title:P},null!=E&&(aa.aspect=E),x[t]=W,D.push(aa)):null!=y&&(y.aspect="fixed",D.push(y),aa=y);mxEvent.addListener(Z,"keydown",function(na){13==na.keyCode&&null!=G&&(G(),G=null,mxEvent.consume(na))});O();S.appendChild(Z);mxEvent.addListener(Z,+"mousedown",function(na){"true"!=Z.getAttribute("contentEditable")&&mxEvent.consume(na)});X=function(na){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ua=new FilenameDialog(b,aa.title||"",mxResources.get("ok"),function(ta){null!=ta&&(aa.title=ta,O())},mxResources.get("enterValue"));b.showDialog(ua.container,300,80,!0,!0);ua.init();mxEvent.consume(na)}else if("true"!=Z.getAttribute("contentEditable")){null!=G&&(G(),G=null);if(null==aa.title||0==aa.title.length)Z.innerText=+"";Z.style.textOverflow="";Z.style.whiteSpace="";Z.style.cursor="text";Z.style.color="";Z.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(Z.style,"user-select","text");Z.focus();document.execCommand("selectAll",!1,null);G=function(){Z.removeAttribute("contentEditable");Z.style.cursor="pointer";aa.title=mxUtils.getTextContent(Z);O()};mxEvent.consume(na)}};mxEvent.addListener(Z,"click",X);mxEvent.addListener(S,"dblclick",X);n.appendChild(S);mxEvent.addListener(S,"dragstart",function(na){null==+G&&(null==t&&null!=y&&(Y.style.visibility="hidden",Z.style.visibility="hidden"),mxClient.IS_FF&&null!=y.xml&&na.dataTransfer.setData("Text",y.xml),B=A(na),mxClient.IS_GC&&(S.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(S.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(S,30);Y.style.visibility="";Z.style.visibility=""},0))});mxEvent.addListener(S,"dragend",function(na){"hidden"==Y.style.visibility&&(Y.style.visibility="",Z.style.visibility="");B=null;mxUtils.setOpacity(S,+100);mxUtils.setPrefixedStyle(S.style,"transform",null)})}else J||(J=!0,b.handleError({message:mxResources.get("fileExists")}));else{M=!1;try{if(Q=mxUtils.parseXml(t),"mxlibrary"==Q.documentElement.nodeName){U=JSON.parse(mxUtils.getTextContent(Q.documentElement));if(null!=U&&0<U.length)for(var fa=0;fa<U.length;fa++)null!=U[fa].xml?I(null,null,0,0,0,0,U[fa]):I(U[fa].data,null,0,0,U[fa].w,U[fa].h,null,"fixed",U[fa].title);M=!0}else if("mxfile"==Q.documentElement.nodeName){var ia=Q.documentElement.getElementsByTagName("diagram");+for(fa=0;fa<ia.length;fa++){var ea=Editor.getDiagramNodeXml(ia[fa]);X=b.stringToCells(ea);if(0<X.length){var ma=b.editor.graph.getBoundingBoxFromGeometry(X);null!=ma&&I(null,null,0,0,0,0,{xml:ea,w:ma.width,h:ma.height})}}M=!0}}catch(na){null!=window.console&&console.error("Error in library dialog: "+na)}M||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(na){null!=window.console&&console.log("Error in library dialog: "+na)}return null}function H(t){t.dataTransfer.dropEffect=+null!=B?"move":"copy";t.stopPropagation();t.preventDefault()}function F(t){t.stopPropagation();t.preventDefault();J=!1;C=A(t);if(null!=B)null!=C&&C<n.children.length?(D.splice(C>B?C-1:C,0,D.splice(B,1)[0]),n.insertBefore(n.children[B],n.children[C])):(D.push(D.splice(B,1)[0]),n.appendChild(n.children[B]));else if(0<t.dataTransfer.files.length)b.importFiles(t.dataTransfer.files,0,0,b.maxImageSize,T(t));else if(0<=mxUtils.indexOf(t.dataTransfer.types,"text/uri-list")){var z=decodeURIComponent(t.dataTransfer.getData("text/uri-list"));+(/(\.jpg)($|\?)/i.test(z)||/(\.png)($|\?)/i.test(z)||/(\.gif)($|\?)/i.test(z)||/(\.svg)($|\?)/i.test(z))&&b.loadImage(z,function(L){I(z,null,0,0,L.width,L.height);n.scrollTop=n.scrollHeight})}t.stopPropagation();t.preventDefault()}var D=[],c=b.editor.graph;k=document.createElement("div");k.style.height="100%";var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.height="40px";k.appendChild(g);mxUtils.write(g,mxResources.get("filename")+":");null==f&&(f=b.defaultLibraryName+".xml");var l=document.createElement("input");l.setAttribute("value",f);l.style.marginRight="20px";l.style.marginLeft="10px";l.style.width="500px";null==p||p.isRenamable()||l.setAttribute("disabled","true");this.init=function(){if(null==p||p.isRenamable())l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null)};g.appendChild(l);Editor.enableUncompressedLibraries&&(l.style.width="420px",f=document.createElement("input"),f.setAttribute("type",-"checkbox"),f.style.marginRight="10px",g.appendChild(f),mxUtils.write(g,mxResources.get("compressed")));var n=document.createElement("div");n.style.borderWidth="1px 0px 1px 0px";n.style.borderColor="#d3d3d3";n.style.borderStyle="solid";n.style.marginTop="6px";n.style.overflow="auto";n.style.height="340px";n.style.backgroundPosition="center center";n.style.backgroundRepeat="no-repeat";0==E.length&&Graph.fileSupport&&(n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var v=document.createElement("div");-v.style.position="absolute";v.style.width="640px";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));k.appendChild(v);var x={},B=null,C=null,H=null;g=function(t){"true"!=mxEvent.getSource(t).getAttribute("contentEditable")&&null!=H&&(H(),H=null,mxEvent.consume(t))};mxEvent.addListener(n,"mousedown",g);mxEvent.addListener(n,"pointerdown",g);mxEvent.addListener(n,"touchstart",g);var D=new mxUrlConverter,U=-!1;if(null!=d)for(g=0;g<d.length;g++)f=d[g],J(f.data,null,0,0,f.w,f.h,f,f.aspect,f.title);mxEvent.addListener(n,"dragleave",function(t){v.style.cursor="";for(var z=mxEvent.getSource(t);null!=z;){if(z==n||z==v){t.stopPropagation();t.preventDefault();break}z=z.parentNode}});var S=function(t){return function(z,L,K,M,m,y,F,N,O){null!=O&&EditorUi.isVisioFilename(O.name)?b.importVisio(O,mxUtils.bind(this,function(P){J(P,L,K,M,m,y,F,"fixed",mxEvent.isAltDown(t)?null:F.substring(0,F.lastIndexOf(".")).replace(/_/g,-" "))})):null!=O&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(z,O.name)?b.isExternalDataComms()?b.parseFile(O,mxUtils.bind(this,function(P){4==P.readyState&&(b.spinner.stop(),200<=P.status&&299>=P.status&&(J(P.responseText,L,K,M,m,y,F,"fixed",mxEvent.isAltDown(t)?null:F.substring(0,F.lastIndexOf(".")).replace(/_/g," ")),n.scrollTop=n.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(J(z,L,K,M,m,y,F,"fixed",mxEvent.isAltDown(t)?null:F.substring(0,-F.lastIndexOf(".")).replace(/_/g," ")),n.scrollTop=n.scrollHeight)}};mxEvent.addListener(n,"dragover",I);mxEvent.addListener(n,"drop",G);mxEvent.addListener(v,"dragover",I);mxEvent.addListener(v,"drop",G);k.appendChild(n);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});g.setAttribute("id","btnCancel");g.className="geBtn";b.editor.cancelFirst&&d.appendChild(g);"draw.io"!=b.getServiceName()||+"checkbox"),f.style.marginRight="10px",g.appendChild(f),mxUtils.write(g,mxResources.get("compressed")));var n=document.createElement("div");n.style.borderWidth="1px 0px 1px 0px";n.style.borderColor="#d3d3d3";n.style.borderStyle="solid";n.style.marginTop="6px";n.style.overflow="auto";n.style.height="340px";n.style.backgroundPosition="center center";n.style.backgroundRepeat="no-repeat";0==D.length&&Graph.fileSupport&&(n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var v=document.createElement("div");+v.style.position="absolute";v.style.width="640px";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));k.appendChild(v);var x={},B=null,C=null,G=null;g=function(t){"true"!=mxEvent.getSource(t).getAttribute("contentEditable")&&null!=G&&(G(),G=null,mxEvent.consume(t))};mxEvent.addListener(n,"mousedown",g);mxEvent.addListener(n,"pointerdown",g);mxEvent.addListener(n,"touchstart",g);var N=new mxUrlConverter,J=+!1;if(null!=d)for(g=0;g<d.length;g++)f=d[g],I(f.data,null,0,0,f.w,f.h,f,f.aspect,f.title);mxEvent.addListener(n,"dragleave",function(t){v.style.cursor="";for(var z=mxEvent.getSource(t);null!=z;){if(z==n||z==v){t.stopPropagation();t.preventDefault();break}z=z.parentNode}});var T=function(t){return function(z,L,K,M,m,y,E,P,O){null!=O&&EditorUi.isVisioFilename(O.name)?b.importVisio(O,mxUtils.bind(this,function(Q){I(Q,L,K,M,m,y,E,"fixed",mxEvent.isAltDown(t)?null:E.substring(0,E.lastIndexOf(".")).replace(/_/g,+" "))})):null!=O&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(z,O.name)?b.isExternalDataComms()?b.parseFile(O,mxUtils.bind(this,function(Q){4==Q.readyState&&(b.spinner.stop(),200<=Q.status&&299>=Q.status&&(I(Q.responseText,L,K,M,m,y,E,"fixed",mxEvent.isAltDown(t)?null:E.substring(0,E.lastIndexOf(".")).replace(/_/g," ")),n.scrollTop=n.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(I(z,L,K,M,m,y,E,"fixed",mxEvent.isAltDown(t)?null:E.substring(0,+E.lastIndexOf(".")).replace(/_/g," ")),n.scrollTop=n.scrollHeight)}};mxEvent.addListener(n,"dragover",H);mxEvent.addListener(n,"drop",F);mxEvent.addListener(v,"dragover",H);mxEvent.addListener(v,"drop",F);k.appendChild(n);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});g.setAttribute("id","btnCancel");g.className="geBtn";b.editor.cancelFirst&&d.appendChild(g);"draw.io"!=b.getServiceName()||null==p||p.constructor!=DriveLibrary&&p.constructor!=GitHubLibrary||(f=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(p,function(t){if(null!=t){var z=b.getSearch("create title mode url drive splash state clibs ui".split(" "));z+=(0==z.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(t);t=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+z,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(t.container,450,270,!0,!0,null,!1,null,-new mxRectangle(0,0,400,250));t.init()}else p.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(p.getId(),p)}),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 t=b.createLibraryDataFromImages(E),z=l.value;+new mxRectangle(0,0,400,250));t.init()}else p.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(p.getId(),p)}),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 t=b.createLibraryDataFromImages(D),z=l.value;/(\.xml)$/i.test(z)||(z+=".xml");b.isLocalFileSave()?b.saveLocalFile(t,z,"text/xml",null,null,null!=u?u:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(z)+"&format=xml&xml="+encodeURIComponent(t))).simulate(document,"_blank")});f.setAttribute("id","btnDownload");f.className="geBtn";d.appendChild(f);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(t){U=!1;b.importFiles(V.files,0,0,b.maxImageSize,function(z,L,K,M,m,y,F,N,O){null!=V.files&&(S(t)(z,L,K,M,m,y,F,N,O),V.type="",V.type="file",V.value="")});n.scrollTop=n.scrollHeight});V.style.display="none";document.body.appendChild(V);b.libDlgFileInputElt=V}f=mxUtils.button(mxResources.get("import"),function(){null!=H&&(H(),H=null);b.libDlgFileInputElt.click()});f.setAttribute("id","btnAddImage");f.className="geBtn";d.appendChild(f)}f=mxUtils.button(mxResources.get("addImages"),-function(){null!=H&&(H(),H=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(t,z,L){U=!1;if(null!=t){if("data:image/"==t.substring(0,11)){var K=t.indexOf(",");0<K&&(t=t.substring(0,K)+";base64,"+t.substring(K+1))}J(t,null,0,0,z,L);n.scrollTop=n.scrollHeight}})});f.setAttribute("id","btnAddImageUrl");f.className="geBtn";d.appendChild(f);this.saveBtnClickHandler=function(t,z,L,K){b.saveLibrary(t,z,L,K)};f=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=H&&-(H(),H=null);this.saveBtnClickHandler(l.value,E,p,q)}));f.setAttribute("id","btnSave");f.className="geBtn gePrimaryBtn";d.appendChild(f);b.editor.cancelFirst||d.appendChild(g);k.appendChild(d);this.container=k},EditShapeDialog=function(b,f,k){var d=document.createElement("div");d.style.position="absolute";d.style.left="30px";d.style.right="30px";d.style.top="30px";d.style.bottom="30px";var p=document.createElement("div");p.style.position="absolute";p.style.top="0px";mxUtils.write(p,k);d.appendChild(p);+"change",function(t){J=!1;b.importFiles(V.files,0,0,b.maxImageSize,function(z,L,K,M,m,y,E,P,O){null!=V.files&&(T(t)(z,L,K,M,m,y,E,P,O),V.type="",V.type="file",V.value="")});n.scrollTop=n.scrollHeight});V.style.display="none";document.body.appendChild(V);b.libDlgFileInputElt=V}f=mxUtils.button(mxResources.get("import"),function(){null!=G&&(G(),G=null);b.libDlgFileInputElt.click()});f.setAttribute("id","btnAddImage");f.className="geBtn";d.appendChild(f)}f=mxUtils.button(mxResources.get("addImages"),+function(){null!=G&&(G(),G=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(t,z,L){J=!1;if(null!=t){if("data:image/"==t.substring(0,11)){var K=t.indexOf(",");0<K&&(t=t.substring(0,K)+";base64,"+t.substring(K+1))}I(t,null,0,0,z,L);n.scrollTop=n.scrollHeight}})});f.setAttribute("id","btnAddImageUrl");f.className="geBtn";d.appendChild(f);this.saveBtnClickHandler=function(t,z,L,K){b.saveLibrary(t,z,L,K)};f=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=G&&+(G(),G=null);this.saveBtnClickHandler(l.value,D,p,q)}));f.setAttribute("id","btnSave");f.className="geBtn gePrimaryBtn";d.appendChild(f);b.editor.cancelFirst||d.appendChild(g);k.appendChild(d);this.container=k},EditShapeDialog=function(b,f,k){var d=document.createElement("div");d.style.position="absolute";d.style.left="30px";d.style.right="30px";d.style.top="30px";d.style.bottom="30px";var p=document.createElement("div");p.style.position="absolute";p.style.top="0px";mxUtils.write(p,k);d.appendChild(p);k=document.createElement("div");k.style.position="absolute";k.style.width="100%";k.style.display="flex";k.style.alignItems="stretch";k.style.top="24px";k.style.bottom="50px";var q=document.createElement("textarea");q.style.outline="none";q.style.resize="horizontal";q.style.width="430px";q.style.maxWidth="calc(100% - 100px)";q.style.flexShrink="0";q.style.borderRadius="4px";q.style.marginRight="4px";k.appendChild(q);var u=document.createElement("div");u.style.borderWidth="1px";u.style.borderStyle=-"solid";u.style.padding="20px";u.style.flexGrow="1";u.style.borderRadius="4px";mxEvent.disableContextMenu(u);k.appendChild(u);var A=new Graph(u);A.setEnabled(!1);var J=b.editor.graph.cloneCell(f);A.addCells([J]);p=A.view.getState(J);var I="";null!=p.shape&&null!=p.shape.stencil&&(I=mxUtils.getPrettyXml(p.shape.stencil.desc));mxUtils.write(q,I||"");d.appendChild(k);k=document.createElement("div");k.style.position="absolute";k.style.display="flex";k.style.alignItems="center";k.style.justifyContent=-"end";k.style.bottom="6px";k.style.height="30px";k.style.width="100%";b.isOffline()||k.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";b.editor.cancelFirst&&k.appendChild(p);var G=function(c,g,l){var n=q.value,v=mxUtils.parseXml(n);n=mxUtils.getPrettyXml(v.documentElement);v=v.documentElement.getElementsByTagName("parsererror");if(null!=v&&0<v.length)b.showError(mxResources.get("error"),-mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(l&&b.hideDialog(),v=!c.model.contains(g),!l||v||n!=I){n=Graph.compress(n);c.getModel().beginUpdate();try{if(v){var x=b.editor.graph.getFreeInsertPoint();g.geometry.x=x.x;g.geometry.y=x.y;c.addCell(g)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+n+")",[g])}catch(B){throw B;}finally{c.getModel().endUpdate()}v&&(c.setSelectionCell(g),c.scrollCellToVisible(g))}},E=mxUtils.button(mxResources.get("preview"),function(){G(A,-J,!1);A.fit()});E.className="geBtn";k.appendChild(E);E=mxUtils.button(mxResources.get("apply"),function(){G(b.editor.graph,f,!0)});E.className="geBtn gePrimaryBtn";k.appendChild(E);b.editor.cancelFirst||k.appendChild(p);d.appendChild(k);this.init=function(){q.focus();q.scrollTop=0;A.fit();u.style.overflow="auto";A.fit()};this.container=d},CustomDialog=function(b,f,k,d,p,q,u,A,J,I,G,E){var c=document.createElement("div");c.appendChild(f);var g=document.createElement("div");g.style.marginTop=null!=-E?E:"30px";g.style.textAlign="right";null!=u&&g.appendChild(u);b.isOffline()||null==q||g.appendChild(b.createHelpIcon(q));f=mxUtils.button(J||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d()});f.className="geBtn";A&&(f.style.display="none");b.editor.cancelFirst&&g.appendChild(f);p=mxUtils.button(p||mxResources.get("ok"),mxUtils.bind(this,function(){I||b.hideDialog(null,null,this.container);if(null!=k){var l=k();if("string"===typeof l){b.showError(mxResources.get("error"),l);return}}I&&-b.hideDialog(null,null,this.container)}));g.appendChild(p);p.className="geBtn gePrimaryBtn";b.editor.cancelFirst||g.appendChild(f);if(null!=G)for(A=0;A<G.length;A++)(function(l,n,v){l=mxUtils.button(l,function(x){n(x)});null!=v&&l.setAttribute("title",v);l.className="geBtn";g.appendChild(l)})(G[A][0],G[A][1],G[A][2]);c.appendChild(g);this.cancelBtn=f;this.okButton=p;this.container=c},BtnDialog=function(b,f,k,d){var p=document.createElement("div");p.style.textAlign="center";var q=document.createElement("p");+"solid";u.style.padding="20px";u.style.flexGrow="1";u.style.borderRadius="4px";mxEvent.disableContextMenu(u);k.appendChild(u);var A=new Graph(u);A.setEnabled(!1);var I=b.editor.graph.cloneCell(f);A.addCells([I]);p=A.view.getState(I);var H="";null!=p.shape&&null!=p.shape.stencil&&(H=mxUtils.getPrettyXml(p.shape.stencil.desc));mxUtils.write(q,H||"");d.appendChild(k);k=document.createElement("div");k.style.position="absolute";k.style.display="flex";k.style.alignItems="center";k.style.justifyContent=+"end";k.style.bottom="6px";k.style.height="30px";k.style.width="100%";b.isOffline()||k.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";b.editor.cancelFirst&&k.appendChild(p);var F=function(c,g,l){var n=q.value,v=mxUtils.parseXml(n);n=mxUtils.getPrettyXml(v.documentElement);v=v.documentElement.getElementsByTagName("parsererror");if(null!=v&&0<v.length)b.showError(mxResources.get("error"),+mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(l&&b.hideDialog(),v=!c.model.contains(g),!l||v||n!=H){n=Graph.compress(n);c.getModel().beginUpdate();try{if(v){var x=b.editor.graph.getFreeInsertPoint();g.geometry.x=x.x;g.geometry.y=x.y;c.addCell(g)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+n+")",[g])}catch(B){throw B;}finally{c.getModel().endUpdate()}v&&(c.setSelectionCell(g),c.scrollCellToVisible(g))}},D=mxUtils.button(mxResources.get("preview"),function(){F(A,+I,!1);A.fit()});D.className="geBtn";k.appendChild(D);D=mxUtils.button(mxResources.get("apply"),function(){F(b.editor.graph,f,!0)});D.className="geBtn gePrimaryBtn";k.appendChild(D);b.editor.cancelFirst||k.appendChild(p);d.appendChild(k);this.init=function(){q.focus();q.scrollTop=0;A.fit();u.style.overflow="auto";A.fit()};this.container=d},CustomDialog=function(b,f,k,d,p,q,u,A,I,H,F,D){var c=document.createElement("div");c.appendChild(f);var g=document.createElement("div");g.style.marginTop=null!=+D?D:"30px";g.style.textAlign="right";null!=u&&g.appendChild(u);b.isOffline()||null==q||g.appendChild(b.createHelpIcon(q));f=mxUtils.button(I||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d()});f.className="geBtn";A&&(f.style.display="none");b.editor.cancelFirst&&g.appendChild(f);p=mxUtils.button(p||mxResources.get("ok"),mxUtils.bind(this,function(){H||b.hideDialog(null,null,this.container);if(null!=k){var l=k();if("string"===typeof l){b.showError(mxResources.get("error"),l);return}}H&&+b.hideDialog(null,null,this.container)}));g.appendChild(p);p.className="geBtn gePrimaryBtn";b.editor.cancelFirst||g.appendChild(f);if(null!=F)for(A=0;A<F.length;A++)(function(l,n,v){l=mxUtils.button(l,function(x){n(x)});null!=v&&l.setAttribute("title",v);l.className="geBtn";g.appendChild(l)})(F[A][0],F[A][1],F[A][2]);c.appendChild(g);this.cancelBtn=f;this.okButton=p;this.container=c},BtnDialog=function(b,f,k,d){var p=document.createElement("div");p.style.textAlign="center";var q=document.createElement("p");q.style.fontSize="16pt";q.style.padding="0px";q.style.margin="0px";q.style.color="gray";mxUtils.write(q,mxResources.get("done"));var u="Unknown",A=document.createElement("img");A.setAttribute("border","0");A.setAttribute("align","absmiddle");A.style.marginRight="10px";f==b.drive?(u=mxResources.get("googleDrive"),A.src=IMAGE_PATH+"/google-drive-logo-white.svg"):f==b.dropbox?(u=mxResources.get("dropbox"),A.src=IMAGE_PATH+"/dropbox-logo-white.svg"):f==b.oneDrive?(u=mxResources.get("oneDrive"),A.src=IMAGE_PATH+"/onedrive-logo-white.svg"):f==b.gitHub?(u=mxResources.get("github"),A.src=IMAGE_PATH+"/github-logo-white.svg"):f==b.gitLab?(u=mxResources.get("gitlab"),A.src=IMAGE_PATH+"/gitlab-logo.svg"):f==b.trello&&(u=mxResources.get("trello"),A.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[u],"You are now authorized in {1}"));k=mxUtils.button(k,d);k.insertBefore(A,k.firstChild);k.style.marginTop="6px";k.className="geBigButton";-k.style.fontSize="18px";k.style.padding="14px";p.appendChild(q);p.appendChild(b);p.appendChild(k);this.container=p},FontDialog=function(b,f,k,d,p){function q(C){this.style.border="";13==C.keyCode&&B.click()}var u=document.createElement("table"),A=document.createElement("tbody");u.style.marginTop="8px";var J=document.createElement("tr");var I=document.createElement("td");I.colSpan=2;I.style.whiteSpace="nowrap";I.style.fontSize="10pt";I.style.fontWeight="bold";var G=document.createElement("input");-G.style.cssText="margin-right:8px;margin-bottom:8px;";G.setAttribute("value","sysfonts");G.setAttribute("type","radio");G.setAttribute("name","current-fontdialog");G.setAttribute("id","fontdialog-sysfonts");I.appendChild(G);var E=document.createElement("label");E.setAttribute("for","fontdialog-sysfonts");mxUtils.write(E,mxResources.get("sysFonts",null,"System Fonts"));I.appendChild(E);J.appendChild(I);A.appendChild(J);J=document.createElement("tr");I=document.createElement("td");I.style.whiteSpace=-"nowrap";I.style.fontSize="10pt";I.style.width="120px";I.style.paddingLeft="15px";mxUtils.write(I,mxResources.get("fontname",null,"Font Name")+":");J.appendChild(I);var c=document.createElement("input");"s"==d&&c.setAttribute("value",f);c.style.marginLeft="4px";c.style.width="250px";c.className="dlg_fontName_s";I=document.createElement("td");I.appendChild(c);J.appendChild(I);A.appendChild(J);J=document.createElement("tr");I=document.createElement("td");I.colSpan=2;I.style.whiteSpace="nowrap";I.style.fontSize=-"10pt";I.style.fontWeight="bold";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-bottom:8px;";g.setAttribute("value","googlefonts");g.setAttribute("type","radio");g.setAttribute("name","current-fontdialog");g.setAttribute("id","fontdialog-googlefonts");I.appendChild(g);E=document.createElement("label");E.setAttribute("for","fontdialog-googlefonts");mxUtils.write(E,mxResources.get("googleFonts",null,"Google Fonts"));I.appendChild(E);if(!b.isOffline()||EditorUi.isElectronApp)E=-b.createHelpIcon("https://fonts.google.com/"),I.appendChild(E);J.appendChild(I);"0"!=urlParams.isGoogleFontsEnabled&&A.appendChild(J);J=document.createElement("tr");I=document.createElement("td");I.style.whiteSpace="nowrap";I.style.fontSize="10pt";I.style.width="120px";I.style.paddingLeft="15px";mxUtils.write(I,mxResources.get("fontname",null,"Font Name")+":");J.appendChild(I);var l=document.createElement("input");"g"==d&&l.setAttribute("value",f);l.style.marginLeft="4px";l.style.width="250px";l.className=-"dlg_fontName_g";I=document.createElement("td");I.appendChild(l);J.appendChild(I);"0"!=urlParams.isGoogleFontsEnabled&&A.appendChild(J);J=document.createElement("tr");I=document.createElement("td");I.colSpan=2;I.style.whiteSpace="nowrap";I.style.fontSize="10pt";I.style.fontWeight="bold";var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";n.setAttribute("value","webfonts");n.setAttribute("type","radio");n.setAttribute("name","current-fontdialog");n.setAttribute("id",-"fontdialog-webfonts");I.appendChild(n);E=document.createElement("label");E.setAttribute("for","fontdialog-webfonts");mxUtils.write(E,mxResources.get("webfonts",null,"Web Fonts"));I.appendChild(E);J.appendChild(I);Editor.enableWebFonts&&A.appendChild(J);J=document.createElement("tr");I=document.createElement("td");I.style.whiteSpace="nowrap";I.style.fontSize="10pt";I.style.width="120px";I.style.paddingLeft="15px";mxUtils.write(I,mxResources.get("fontname",null,"Font Name")+":");J.appendChild(I);var v=-document.createElement("input");"w"==d&&(Editor.enableWebFonts?v.setAttribute("value",f):c.setAttribute("value",f));v.style.marginLeft="4px";v.style.width="250px";v.className="dlg_fontName_w";I=document.createElement("td");I.appendChild(v);J.appendChild(I);Editor.enableWebFonts&&A.appendChild(J);J=document.createElement("tr");I=document.createElement("td");I.style.whiteSpace="nowrap";I.style.fontSize="10pt";I.style.width="120px";I.style.paddingLeft="15px";mxUtils.write(I,mxResources.get("fontUrl",-null,"Font URL")+":");J.appendChild(I);var x=document.createElement("input");x.setAttribute("value",k||"");x.style.marginLeft="4px";x.style.width="250px";x.className="dlg_fontUrl";I=document.createElement("td");I.appendChild(x);J.appendChild(I);Editor.enableWebFonts&&A.appendChild(J);this.init=function(){var C=c;"g"==d?C=l:"w"==d&&Editor.enableWebFonts&&(C=v);C.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?C.select():document.execCommand("selectAll",!1,null)};J=document.createElement("tr");-I=document.createElement("td");I.colSpan=2;I.style.paddingTop="20px";I.style.whiteSpace="nowrap";I.setAttribute("align","right");b.isOffline()||I.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();p()});f.className="geBtn";b.editor.cancelFirst&&I.appendChild(f);var B=mxUtils.button(mxResources.get("apply"),function(){if(G.checked){var C=c.value;var H="s"}else if(g.checked){C=l.value;var D=Editor.GOOGLE_FONTS+-encodeURIComponent(C).replace(/%20/g,"+");H="g"}else n.checked&&(C=v.value,D=x.value,H="w");var U=C;var S=D,V=H,t=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,z=u.querySelector(".dlg_fontName_"+V);null==z||null!=U&&0!=U.length?(z=u.querySelector(".dlg_fontUrl"),null==z||"w"!=V||t.test(S)?U=!0:(z.style.border="1px solid red",U=!1)):(z.style.border="1px solid red",U=!1);U&&(p(C,D,H),b.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(c,"keypress",-q);mxEvent.addListener(l,"keypress",q);mxEvent.addListener(v,"keypress",q);mxEvent.addListener(x,"keypress",q);mxEvent.addListener(c,"focus",function(){G.setAttribute("checked","checked");G.checked=!0});mxEvent.addListener(l,"focus",function(){g.setAttribute("checked","checked");g.checked=!0});mxEvent.addListener(v,"focus",function(){n.setAttribute("checked","checked");n.checked=!0});mxEvent.addListener(x,"focus",function(){n.setAttribute("checked","checked");n.checked=!0});I.appendChild(B);b.editor.cancelFirst||-I.appendChild(f);J.appendChild(I);A.appendChild(J);u.appendChild(A);this.container=u};+k.style.fontSize="18px";k.style.padding="14px";p.appendChild(q);p.appendChild(b);p.appendChild(k);this.container=p},FontDialog=function(b,f,k,d,p){function q(C){this.style.border="";13==C.keyCode&&B.click()}var u=document.createElement("table"),A=document.createElement("tbody");u.style.marginTop="8px";var I=document.createElement("tr");var H=document.createElement("td");H.colSpan=2;H.style.whiteSpace="nowrap";H.style.fontSize="10pt";H.style.fontWeight="bold";var F=document.createElement("input");+F.style.cssText="margin-right:8px;margin-bottom:8px;";F.setAttribute("value","sysfonts");F.setAttribute("type","radio");F.setAttribute("name","current-fontdialog");F.setAttribute("id","fontdialog-sysfonts");H.appendChild(F);var D=document.createElement("label");D.setAttribute("for","fontdialog-sysfonts");mxUtils.write(D,mxResources.get("sysFonts",null,"System Fonts"));H.appendChild(D);I.appendChild(H);A.appendChild(I);I=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")+":");I.appendChild(H);var c=document.createElement("input");"s"==d&&c.setAttribute("value",f);c.style.marginLeft="4px";c.style.width="250px";c.className="dlg_fontName_s";H=document.createElement("td");H.appendChild(c);I.appendChild(H);A.appendChild(I);I=document.createElement("tr");H=document.createElement("td");H.colSpan=2;H.style.whiteSpace="nowrap";H.style.fontSize=+"10pt";H.style.fontWeight="bold";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-bottom:8px;";g.setAttribute("value","googlefonts");g.setAttribute("type","radio");g.setAttribute("name","current-fontdialog");g.setAttribute("id","fontdialog-googlefonts");H.appendChild(g);D=document.createElement("label");D.setAttribute("for","fontdialog-googlefonts");mxUtils.write(D,mxResources.get("googleFonts",null,"Google Fonts"));H.appendChild(D);if(!b.isOffline()||EditorUi.isElectronApp)D=+b.createHelpIcon("https://fonts.google.com/"),H.appendChild(D);I.appendChild(H);"0"!=urlParams.isGoogleFontsEnabled&&A.appendChild(I);I=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")+":");I.appendChild(H);var l=document.createElement("input");"g"==d&&l.setAttribute("value",f);l.style.marginLeft="4px";l.style.width="250px";l.className=+"dlg_fontName_g";H=document.createElement("td");H.appendChild(l);I.appendChild(H);"0"!=urlParams.isGoogleFontsEnabled&&A.appendChild(I);I=document.createElement("tr");H=document.createElement("td");H.colSpan=2;H.style.whiteSpace="nowrap";H.style.fontSize="10pt";H.style.fontWeight="bold";var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";n.setAttribute("value","webfonts");n.setAttribute("type","radio");n.setAttribute("name","current-fontdialog");n.setAttribute("id",+"fontdialog-webfonts");H.appendChild(n);D=document.createElement("label");D.setAttribute("for","fontdialog-webfonts");mxUtils.write(D,mxResources.get("webfonts",null,"Web Fonts"));H.appendChild(D);I.appendChild(H);Editor.enableWebFonts&&A.appendChild(I);I=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")+":");I.appendChild(H);var v=+document.createElement("input");"w"==d&&(Editor.enableWebFonts?v.setAttribute("value",f):c.setAttribute("value",f));v.style.marginLeft="4px";v.style.width="250px";v.className="dlg_fontName_w";H=document.createElement("td");H.appendChild(v);I.appendChild(H);Editor.enableWebFonts&&A.appendChild(I);I=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")+":");I.appendChild(H);var x=document.createElement("input");x.setAttribute("value",k||"");x.style.marginLeft="4px";x.style.width="250px";x.className="dlg_fontUrl";H=document.createElement("td");H.appendChild(x);I.appendChild(H);Editor.enableWebFonts&&A.appendChild(I);this.init=function(){var C=c;"g"==d?C=l:"w"==d&&Editor.enableWebFonts&&(C=v);C.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?C.select():document.execCommand("selectAll",!1,null)};I=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"));f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();p()});f.className="geBtn";b.editor.cancelFirst&&H.appendChild(f);var B=mxUtils.button(mxResources.get("apply"),function(){if(F.checked){var C=c.value;var G="s"}else if(g.checked){C=l.value;var N=Editor.GOOGLE_FONTS++encodeURIComponent(C).replace(/%20/g,"+");G="g"}else n.checked&&(C=v.value,N=x.value,G="w");var J=C;var T=N,V=G,t=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,z=u.querySelector(".dlg_fontName_"+V);null==z||null!=J&&0!=J.length?(z=u.querySelector(".dlg_fontUrl"),null==z||"w"!=V||t.test(T)?J=!0:(z.style.border="1px solid red",J=!1)):(z.style.border="1px solid red",J=!1);J&&(p(C,N,G),b.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(c,"keypress",+q);mxEvent.addListener(l,"keypress",q);mxEvent.addListener(v,"keypress",q);mxEvent.addListener(x,"keypress",q);mxEvent.addListener(c,"focus",function(){F.setAttribute("checked","checked");F.checked=!0});mxEvent.addListener(l,"focus",function(){g.setAttribute("checked","checked");g.checked=!0});mxEvent.addListener(v,"focus",function(){n.setAttribute("checked","checked");n.checked=!0});mxEvent.addListener(x,"focus",function(){n.setAttribute("checked","checked");n.checked=!0});H.appendChild(B);b.editor.cancelFirst||+H.appendChild(f);I.appendChild(H);A.appendChild(I);u.appendChild(A);this.container=u};function AspectDialog(b,f,k,d,p){this.aspect={pageId:f||(b.pages?b.pages[0].getId():null),layerIds:k||[]};f=document.createElement("div");var q=document.createElement("h5");q.style.margin="0 0 10px";mxUtils.write(q,mxResources.get("pages"));f.appendChild(q);k=document.createElement("div");k.className="geAspectDlgList";f.appendChild(k);q=document.createElement("h5");q.style.margin="0 0 10px";mxUtils.write(q,mxResources.get("layers"));f.appendChild(q);q=document.createElement("div");q.className="geAspectDlgList";f.appendChild(q);this.pagesContainer=k;this.layersContainer=q;this.ui=b;k=document.createElement("div");k.style.marginTop="16px";k.style.textAlign="center";q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=p&&p()});q.className="geBtn";b.editor.cancelFirst&&k.appendChild(q);var u=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();d({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));k.appendChild(u);u.className="geBtn gePrimaryBtn";b.editor.cancelFirst||k.appendChild(q);u.setAttribute("disabled","disabled");this.okBtn=u;f.appendChild(k);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)};@@ -12752,77 +12757,77 @@ AspectDialog.prototype.createPageItem=function(b,f,k){var d=document.createElemethis.selectedPage=b;d.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var q=p.model;q=q.getChildCells(q.getRoot());for(var u=0;u<q.length;u++)this.createLayerItem(q[u],b,p,k)});mxEvent.addListener(d,"click",f);this.aspect.pageId==b&&f()};AspectDialog.prototype.createLayerItem=function(b,f,k,d){f=k.convertValueToString(b)||mxResources.get("background")||"Background";var p=document.createElement("div");p.setAttribute("data-layer-id",b.id);p.className="geAspectDlgListItem";p.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(f)+"</div>";this.layersContainer.appendChild(p);this.createViewer(p.childNodes[0],d,b.id);d=mxUtils.bind(this,function(){0<=p.className.indexOf("geAspectDlgListItemSelected")?(p.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(p.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(p,"click",d);-1!=this.aspect.layerIds.indexOf(b.id)&&d()};-var FilePropertiesDialog=function(b,f){function k(H){var D=I;I=function(U,S){try{H(function(){D(U,S)},S)}catch(V){S(V)}}}var d=document.createElement("table"),p=document.createElement("tbody");d.style.width="100%";d.style.height="100%";d.style.tableLayout="fixed";var q=b.getCurrentFile(),u=null!=q&&null!=q.getTitle()?q.getTitle():b.defaultFilename,A=/(\.png)$/i.test(u),J=/(\.svg)$/i.test(u),I=function(H,D){H()},G=null!=q?q.isLocked():!1;var E=document.createElement("tr");var c=document.createElement("td");-c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("locked")+":");E.appendChild(c);var g=document.createElement("input");g.setAttribute("type","checkbox");G&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(g);E.appendChild(c);p.appendChild(E);this.init=function(){g.focus()};k(function(H,D){null!=b.fileNode&&G!=g.checked?window.setTimeout(function(){null!=-q&&q.setLocked(g.checked);H()},0):H()});if(A||J){u=1;A=0;E=b.fileNode;null!=E&&(E.hasAttribute("scale")&&(u=parseFloat(E.getAttribute("scale"))),E.hasAttribute("border")&&(A=parseInt(E.getAttribute("border"))));E=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("zoom")+":");E.appendChild(c);var l=document.createElement("input");l.setAttribute("value",100*u+"%");l.style.boxSizing="border-box";l.style.width=-"100%";c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(l);E.appendChild(c);p.appendChild(E);E=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("borderWidth")+":");E.appendChild(c);var n=document.createElement("input");n.setAttribute("value",A);n.style.boxSizing="border-box";n.style.width="100%";c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(n);E.appendChild(c);-p.appendChild(E);this.init=this.init||function(){l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null)};k(function(H,D){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(l.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(n.value))),null!=q&&q.fileChanged());H()})}else if(!/(\.html)$/i.test(u)&&!/(\.svg)$/i.test(u)){var v=null!=q?q.isCompressed():Editor.defaultCompressed;E=document.createElement("tr");-c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("compressed")+":");E.appendChild(c);var x=document.createElement("input");x.setAttribute("type","checkbox");v&&(x.setAttribute("checked","checked"),x.defaultChecked=!0);c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(x);E.appendChild(c);p.appendChild(E);this.init=this.init||function(){x.focus()};k(function(H,-D){null!=b.fileNode&&v!=x.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",x.checked?"true":"false");null!=q&&(q.compressionChanged(x.checked),q.fileChanged());H()},0):H()})}if(null!=q&&q.isRealtimeOptional()){E=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("realtimeCollaboration")+":");E.appendChild(c);var B=document.createElement("input");-B.setAttribute("type","checkbox");var C=q.isRealtimeEnabled();if(C="disabled"!=b.drive.getCustomProperty(q.desc,"collaboration"))B.setAttribute("checked","checked"),B.defaultChecked=!0;k(function(H,D){B.checked!=C?q.setRealtimeEnabled(B.checked,H,D):H()});this.init=null!=this.init?this.init:function(){B.focus()};c=document.createElement("td");c.style.whiteSpace="nowrap";u=document.createElement("div");u.style.display="flex";u.style.alignItems="center";u.style.justifyContent="start";u.appendChild(B);-u.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));c.appendChild(u);E.appendChild(c);p.appendChild(E)}null!=q&&"draw.io"==b.getServiceName()&&0<q.getSize()&&"1"!=urlParams.embed&&(E=document.createElement("tr"),c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("size")+":"),E.appendChild(c),c=b.formatFileSize(q.getSize()),u=document.createElement("input"),-u.setAttribute("title",c),u.setAttribute("value",c),u.setAttribute("disabled","disabled"),u.style.boxSizing="border-box",u.style.width="100%",c=document.createElement("td"),c.style.whiteSpace="nowrap",c.appendChild(u),E.appendChild(c),p.appendChild(E));null!=f&&(E=document.createElement("tr"),c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("publicDiagramUrl")+":"),E.appendChild(c),-u=document.createElement("a"),u.setAttribute("href",f),u.setAttribute("title",f),u.style.whiteSpace="nowrap",u.style.overflow="hidden",u.style.textOverflow="ellipsis",u.style.display="block",u.style.margin="2px",u.style.fontSize="10pt",mxUtils.write(u,f),mxEvent.addListener(u,"click",function(H){b.openLink(f);mxEvent.consume(H)}),c=document.createElement("td"),c.appendChild(u),E.appendChild(c),p.appendChild(E));null!=q&&null!=q.fileObject&&null!=q.fileObject.path&&(E=document.createElement("tr"),-c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("pathFilename")+":"),E.appendChild(c),u=document.createElement("input"),u.setAttribute("title",q.fileObject.path),u.setAttribute("value",q.fileObject.path),u.setAttribute("disabled","disabled"),u.style.boxSizing="border-box",u.style.width="100%",c=document.createElement("td"),c.appendChild(u),E.appendChild(c),p.appendChild(E));-this.init=null!=this.init?this.init:function(){};u=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&I(function(){b.spinner.stop();b.hideDialog()},function(H){b.spinner.stop();b.handleError(H,mxResources.get("error"))})});u.className="geBtn gePrimaryBtn";E=document.createElement("tr");c=document.createElement("td");c.colSpan=2;c.style.paddingTop="20px";c.style.whiteSpace="nowrap";c.setAttribute("align","right");A=mxUtils.button(mxResources.get("cancel"),-function(){b.hideDialog()});A.className="geBtn";b.editor.cancelFirst&&c.appendChild(A);null!=b.fileNode&&(J=mxUtils.button(mxResources.get("editData")+"...",function(){b.hideDialog();var H={};try{var D=b.fileNode.getAttribute("vars");null!=D&&0<D.length&&(H=JSON.parse(D))}catch(V){}D=mxUtils.createXmlDocument().createElement("object");D.setAttribute("label","");for(var U in H)D.setAttribute(U,H[U]);H=b.createTemporaryGraph(b.editor.graph.getStylesheet());var S=new mxCell(D);H.getModel().add(H.getDefaultParent(),-S);H.getModel().addListener(mxEvent.CHANGE,function(V,t){V=t.getProperty("edit").changes;for(t=0;t<V.length;t++)if(V[t]instanceof mxValueChange&&V[t].cell===S){for(var z={},L=V[t].value.attributes,K=0;K<L.length;K++)"label"!=L[K].nodeName&&(z[L[K].nodeName]=L[K].nodeValue);z=JSON.stringify(z);"{}"==z?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",z);b.updateFileVars();b.editor.graph.refresh();z=b.getCurrentFile();null!=z&&z.fileChanged()}});H=new EditDataDialog(b,S,H);b.showDialog(H.container,-480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));H.init()}),J.className="geBtn",c.appendChild(J));c.appendChild(u);b.editor.cancelFirst||c.appendChild(A);E.appendChild(c);p.appendChild(E);d.appendChild(p);this.container=d},ConnectionPointsDialog=function(b,f){function k(){null!=p&&p.destroy()}var d=document.createElement("div");d.style.userSelect="none";d.style.display="flex";d.style.flexDirection="column";d.style.height="100%";var p=null;this.init=function(){function q(K,M,m){var y="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+-b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";K=new mxCell("",new mxGeometry(K,M,6,6),y);K.vertex=!0;K.cp=!0;K.constObj=m;return E.addCell(K)}function u(K){K=E.getSelectionCells();E.deleteCells(K)}function A(){var K=parseInt(V.value)||0;K=0>K?0:100<K?100:K;V.value=K;var M=parseInt(z.value)||0;M=0>M?0:100<M?100:M;z.value=M;var m=parseInt(t.value)||0,y=parseInt(L.value)||0;m=new mxConnectionConstraint(new mxPoint(K/100,M/100),!1,null,m,y);K=E.getConnectionPoint(l,m);M=E.getSelectionCell();-if(null!=M){M.constObj=m;m=M.geometry.clone();y=E.view.scale;var F=E.view.translate;m.x=(K.x-3*y)/y-F.x;m.y=(K.y-3*y)/y-F.y;E.model.setGeometry(M,m)}}function J(K){if(K.constObj)return{x:K.constObj.point.x,y:K.constObj.point.y,dx:K.constObj.dx,dy:K.constObj.dy};var M=0,m=0,y=c.geometry,F=mxUtils.format((K.geometry.x+3-y.x)/y.width);K=mxUtils.format((K.geometry.y+3-y.y)/y.height);0>F?(M=F*y.width,F=0):1<F&&(M=(F-1)*y.width,F=1);0>K?(m=K*y.height,K=0):1<K&&(m=(K-1)*y.height,K=1);return{x:F,y:K,dx:parseInt(M),-dy:parseInt(m)}}function I(K){if(1==E.getSelectionCount()){var M=E.getSelectionCell();K&&(M.constObj=null);K=J(M);V.value=100*K.x;z.value=100*K.y;t.value=K.dx;L.value=K.dy;S.style.visibility=""}else S.style.visibility="hidden"}var G=document.createElement("div");G.style.flex="1";G.style.minHeight="0";G.style.overflow="hidden";G.style.borderStyle="solid";G.style.borderWidth="1px";G.style.boxSizing="border-box";mxEvent.disableContextMenu(G);d.appendChild(G);var E=new Graph(G);E.transparentBackground=-!1;E.autoExtend=!1;E.autoScroll=!1;E.setGridEnabled(!1);E.setEnabled(!0);E.setPanning(!0);E.setConnectable(!1);E.setTooltips(!1);E.minFitScale=null;E.maxFitScale=null;E.centerZoom=!0;E.maxFitScale=2;G=f.geometry;var c=new mxCell(f.value,new mxGeometry(0,0,G.width,G.height),f.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");c.vertex=!0;E.addCell(c);E.dblClick=function(K,M){if(null!=M&&M!=c)E.setSelectionCell(M);else{M=mxUtils.convertPoint(E.container,mxEvent.getClientX(K),-mxEvent.getClientY(K));mxEvent.consume(K);K=E.view.scale;var m=E.view.translate;E.setSelectionCell(q((M.x-3*K)/K-m.x,(M.y-3*K)/K-m.y))}};p=new mxKeyHandler(E);p.bindKey(46,u);p.bindKey(8,u);E.getRubberband().isForceRubberbandEvent=function(K){return 0==K.evt.button&&(null==K.getCell()||K.getCell()==c)};E.panningHandler.isForcePanningEvent=function(K){return 2==K.evt.button};var g=E.isCellSelectable;E.isCellSelectable=function(K){return K==c?!1:g.apply(this,arguments)};E.getLinkForCell=function(){return null};-var l=E.view.getState(c);G=E.getAllConnectionConstraints(l);for(var n=0;null!=G&&n<G.length;n++){var v=E.getConnectionPoint(l,G[n]);q(v.x-3,v.y-3,G[n])}n=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){E.zoomIn()});v=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){E.zoomOut()});var x=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==E.view.scale?(E.maxFitScale=8,E.fit(8)):E.zoomActual();E.center()}),B=function(){b.prompt(mxResources.get("gridSize"),-E.gridSize,function(K){!isNaN(K)&&0<K&&(E.setGridSize(K),E.setGridEnabled(!0),E.refresh())})},C=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(K){mxEvent.isShiftDown(K)?B():(E.setGridEnabled(!E.isGridEnabled()),E.refresh())});mxEvent.addListener(C,"dblclick",B);var H=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),u);mxUtils.setOpacity(H,10);G=document.createElement("div");G.style.display="flex";G.style.flexShrink="0";G.style.alignItems="center";G.style.paddingTop=-"6px";G.appendChild(n);G.appendChild(v);G.appendChild(x);G.appendChild(C);G.appendChild(H);d.appendChild(G);var D=document.createElement("input");D.setAttribute("type","number");D.setAttribute("min","1");D.setAttribute("value","1");D.style.width="45px";D.style.position="relative";D.style.margin="0 4px 0 4px";var U=document.createElement("select");U.style.position="relative";v=["left","right","top","bottom"];for(n=0;n<v.length;n++)x=v[n],C=document.createElement("option"),mxUtils.write(C,mxResources.get(x)),-C.value=x,U.appendChild(C);n=mxUtils.button(mxResources.get("add"),function(){var K=parseInt(D.value);K=1>K?1:100<K?100:K;D.value=K;for(var M=U.value,m=c.geometry,y=[],F=0;F<K;F++){switch(M){case "left":var N=m.x;var O=m.y+(F+1)*m.height/(K+1);break;case "right":N=m.x+m.width;O=m.y+(F+1)*m.height/(K+1);break;case "top":N=m.x+(F+1)*m.width/(K+1);O=m.y;break;case "bottom":N=m.x+(F+1)*m.width/(K+1),O=m.y+m.height}y.push(q(N-3,O-3))}E.setSelectionCells(y)});n.style.marginLeft="auto";G.appendChild(n);-G.appendChild(D);G.appendChild(U);var S=document.createElement("div");S.style.flexShrink="0";S.style.margin="4px 0px 8px 0px";S.style.whiteSpace="nowrap";S.style.height="24px";G=document.createElement("span");mxUtils.write(G,mxResources.get("dx"));S.appendChild(G);var V=document.createElement("input");V.setAttribute("type","number");V.setAttribute("min","0");V.setAttribute("max","100");V.style.width="45px";V.style.margin="0 4px 0 4px";S.appendChild(V);mxUtils.write(S,"%");var t=document.createElement("input");-t.setAttribute("type","number");t.style.width="45px";t.style.margin="0 4px 0 4px";S.appendChild(t);mxUtils.write(S,"pt");G=document.createElement("span");mxUtils.write(G,mxResources.get("dy"));G.style.marginLeft="12px";S.appendChild(G);var z=document.createElement("input");z.setAttribute("type","number");z.setAttribute("min","0");z.setAttribute("max","100");z.style.width="45px";z.style.margin="0 4px 0 4px";S.appendChild(z);mxUtils.write(S,"%");var L=document.createElement("input");L.setAttribute("type",-"number");L.style.width="45px";L.style.margin="0 4px 0 4px";S.appendChild(L);mxUtils.write(S,"pt");d.appendChild(S);I();E.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<E.getSelectionCount()?mxUtils.setOpacity(H,60):mxUtils.setOpacity(H,10);I()});E.addListener(mxEvent.CELLS_MOVED,I);mxEvent.addListener(V,"change",A);mxEvent.addListener(z,"change",A);mxEvent.addListener(t,"change",A);mxEvent.addListener(L,"change",A);G=mxUtils.button(mxResources.get("cancel"),function(){k();b.hideDialog()});-G.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){var K=E.model.cells,M=[],m=[],y;for(y in K){var F=K[y];F.cp&&m.push(J(F))}m.sort(function(N,O){return N.x!=O.x?N.x-O.x:N.y!=O.y?N.y-O.y:N.dx!=O.dx?N.dx-O.dx:N.dy-O.dy});for(K=0;K<m.length;K++)0<K&&m[K].x==m[K-1].x&&m[K].y==m[K-1].y&&m[K].dx==m[K-1].dx&&m[K].dy==m[K-1].dy||M.push("["+m[K].x+","+m[K].y+",0,"+m[K].dx+","+m[K].dy+"]");b.editor.graph.setCellStyles("points","["+M.join(",")+"]",[f]);k();b.hideDialog()});n.className=-"geBtn gePrimaryBtn";v=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[f]);k();b.hideDialog()});v.className="geBtn";x=document.createElement("div");x.style.flexShrink="0";x.style.marginTop="10px";x.style.textAlign="right";b.isOffline()||x.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&x.appendChild(G);x.appendChild(v);x.appendChild(n);b.editor.cancelFirst||x.appendChild(G);d.appendChild(x);-E.fit(8);E.center()};this.destroy=k;this.container=d},PolygonDialog=function(b,f,k){function d(da){var ca=ea.getBoundingClientRect();if(0<ca.width&&0<ca.height){var wa=t+L/2,ka=z+K/2;M=Math.max(.05,Math.min(5,da));L=ca.width*M;K=ca.height*M;t=wa-L/2;z=ka-K/2;p()}}function p(){ea.setAttribute("viewBox",t+" "+z+" "+L+" "+K);var da=ba.getBoundingClientRect();if(!(0>=da.width||0>=da.height)){var ca=da.width-12,wa=Math.max(20,ca*Math.min(1,L/1200)),ka=1200-L;ka=0<ka?(t- -400)/ka:.5;ka=Math.max(0,Math.min(1,-ka));ta.style.width=wa+"px";ta.style.left=ka*(ca-wa)+"px";da=da.height-12;ca=Math.max(20,da*Math.min(1,K/1200));wa=1200-K;wa=0<wa?(z- -400)/wa:.5;wa=Math.max(0,Math.min(1,wa));ia.style.height=ca+"px";ia.style.top=wa*(da-ca)+"px"}}function q(da){return B?20*Math.round(da/20):Math.round(da)}function u(da){var ca=ea.getBoundingClientRect(),wa=z+((null!=da.touches?da.touches[0].clientY:da.clientY)-ca.top)/ca.height*K;return{x:q(t+((null!=da.touches?da.touches[0].clientX:da.clientX)-ca.left)/ca.width*-L),y:q(wa)}}function A(da){var ca=ea.getBoundingClientRect(),wa=t+((null!=da.touches?da.touches[0].clientX:da.clientX)-ca.left)/ca.width*L;da=z+((null!=da.touches?da.touches[0].clientY:da.clientY)-ca.top)/ca.height*K;ca=L/400*9;if(x&&2<n.length&&"Q"===n[0].type){var ka=n[0].cx-wa,za=n[0].cy-da;if(Math.sqrt(ka*ka+za*za)<=ca)return{type:"control",index:0}}for(var ya=1;ya<n.length;ya++)if("Q"===n[ya].type&&(ka=n[ya].cx-wa,za=n[ya].cy-da,Math.sqrt(ka*ka+za*za)<=ca))return{type:"control",index:ya};for(ya=-0;ya<n.length;ya++)if(ka=n[ya].x-wa,za=n[ya].y-da,Math.sqrt(ka*ka+za*za)<=ca)return{type:"vertex",index:ya};return null}function J(){C.push(JSON.stringify(n));H=[];E()}function I(){0<C.length&&(H.push(JSON.stringify(n)),n=JSON.parse(C.pop()),v=Math.min(v,n.length-1),c(),E())}function G(){0<H.length&&(C.push(JSON.stringify(n)),n=JSON.parse(H.pop()),v=Math.min(v,n.length-1),c(),E())}function E(){null!=Fa&&(Fa.style.opacity=0<C.length?"1":"0.3",Fa.style.pointerEvents=0<C.length?"":"none");null!=Ba&&-(Ba.style.opacity=0<H.length?"1":"0.3",Ba.style.pointerEvents=0<H.length?"":"none")}function c(){for(var da="",ca=0;ca<n.length;ca++)da=0===ca?da+("M"+n[ca].x+" "+n[ca].y):"Q"===n[ca].type?da+("Q"+n[ca].cx+" "+n[ca].cy+" "+n[ca].x+" "+n[ca].y):da+("L"+n[ca].x+" "+n[ca].y);x&&2<n.length&&("Q"===n[0].type&&(da+="Q"+n[0].cx+" "+n[0].cy+" "+n[0].x+" "+n[0].y),da+="Z");fa.setAttribute("d",da);for(fa.setAttribute("fill",x&&2<n.length?"rgba(66, 133, 244, 0.1)":"none");la.firstChild;)la.removeChild(la.firstChild);-for(ca=1;ca<n.length;ca++)"Q"===n[ca].type&&(da=document.createElementNS("http://www.w3.org/2000/svg","polyline"),da.setAttribute("points",n[ca-1].x+","+n[ca-1].y+" "+n[ca].cx+","+n[ca].cy+" "+n[ca].x+","+n[ca].y),da.setAttribute("fill","none"),da.setAttribute("stroke","#f0a030"),da.setAttribute("stroke-width","1"),da.setAttribute("stroke-dasharray","4,3"),la.appendChild(da));x&&2<n.length&&"Q"===n[0].type&&(ca=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ca.setAttribute("points",-n[n.length-1].x+","+n[n.length-1].y+" "+n[0].cx+","+n[0].cy+" "+n[0].x+","+n[0].y),ca.setAttribute("fill","none"),ca.setAttribute("stroke","#f0a030"),ca.setAttribute("stroke-width","1"),ca.setAttribute("stroke-dasharray","4,3"),la.appendChild(ca));for(;oa.firstChild;)oa.removeChild(oa.firstChild);for(ca=0;ca<n.length;ca++)da=document.createElementNS("http://www.w3.org/2000/svg","circle"),da.setAttribute("cx",n[ca].x),da.setAttribute("cy",n[ca].y),da.setAttribute("r",5),da.setAttribute("fill",ca===-v?"#ff4444":"#4285f4"),da.setAttribute("stroke","#fff"),da.setAttribute("stroke-width","1.5"),da.style.cursor="move",oa.appendChild(da);for(;pa.firstChild;)pa.removeChild(pa.firstChild);for(ca=1;ca<n.length;ca++)"Q"===n[ca].type&&(da=document.createElementNS("http://www.w3.org/2000/svg","rect"),da.setAttribute("x",n[ca].cx-5),da.setAttribute("y",n[ca].cy-5),da.setAttribute("width",10),da.setAttribute("height",10),da.setAttribute("fill",ca===v?"#ff8800":"#f0a030"),da.setAttribute("stroke","#fff"),-da.setAttribute("stroke-width","1.5"),da.style.cursor="move",pa.appendChild(da));x&&2<n.length&&"Q"===n[0].type&&(ca=document.createElementNS("http://www.w3.org/2000/svg","rect"),ca.setAttribute("x",n[0].cx-5),ca.setAttribute("y",n[0].cy-5),ca.setAttribute("width",10),ca.setAttribute("height",10),ca.setAttribute("fill",0===v?"#ff8800":"#f0a030"),ca.setAttribute("stroke","#fff"),ca.setAttribute("stroke-width","1.5"),ca.style.cursor="move",pa.appendChild(ca));g()}function g(){ja.innerHTML="";if(0===-n.length){var da=document.createElement("div");da.style.padding="20px 10px";da.style.textAlign="center";da.style.opacity="0.5";da.style.fontSize="12px";mxUtils.write(da,mxResources.get("clickToAdd"));ja.appendChild(da)}else for(da=0;da<n.length;da++)(function(ca){var wa=document.createElement("div");wa.style.display="flex";wa.style.alignItems="center";wa.style.padding="2px 4px";wa.style.gap="4px";wa.style.borderRadius="3px";wa.style.marginBottom="2px";wa.style.fontSize="12px";wa.setAttribute("draggable",-"true");wa.setAttribute("data-idx",ca);ca===v&&(wa.style.backgroundColor="rgba(66, 133, 244, 0.15)");wa.style.cursor="pointer";mxEvent.addListener(wa,"click",function(){v=ca;c()});var ka=document.createElement("span");ka.innerHTML="☰";ka.style.cursor="grab";ka.style.fontSize="11px";ka.style.opacity="0.4";ka.style.flexShrink="0";wa.appendChild(ka);ka=document.createElement("span");ka.style.minWidth="18px";ka.style.fontWeight="bold";mxUtils.write(ka,ca+1+"");wa.appendChild(ka);ka=document.createElement("input");-ka.type="number";ka.value=Math.round(n[ca].x);ka.style.width="48px";ka.style.fontSize="11px";ka.style.padding="1px 3px";ka.title="X";mxEvent.addListener(ka,"change",function(){J();n[ca].x=parseInt(this.value)||0;c()});mxEvent.addListener(ka,"click",function(ya){ya.stopPropagation()});wa.appendChild(ka);ka=document.createElement("input");ka.type="number";ka.value=Math.round(n[ca].y);ka.style.width="48px";ka.style.fontSize="11px";ka.style.padding="1px 3px";ka.title="Y";mxEvent.addListener(ka,"change",-function(){J();n[ca].y=parseInt(this.value)||0;c()});mxEvent.addListener(ka,"click",function(ya){ya.stopPropagation()});wa.appendChild(ka);if(0<ca||0===ca&&x&&2<n.length){ka=document.createElement("label");ka.style.display="flex";ka.style.alignItems="center";ka.style.cursor="pointer";ka.style.flexShrink="0";ka.title=mxResources.get("curved");var za=document.createElement("input");za.type="checkbox";za.checked="Q"===n[ca].type;za.style.margin="0";mxEvent.addListener(za,"click",function(ya){ya.stopPropagation()});-mxEvent.addListener(za,"change",function(){J();if("Q"===n[ca].type)n[ca].type="L",delete n[ca].cx,delete n[ca].cy;else{var ya=0<ca?n[ca-1]:n[n.length-1];var Ga=n[ca];var Ka=(ya.x+Ga.x)/2;var Wa=(ya.y+Ga.y)/2;var Pa=Ga.x-ya.x,ob=Ga.y-ya.y;ya=Math.sqrt(Pa*Pa+ob*ob);0!==ya&&(Ga=.25*ya,Ka=Math.round(Ka+-ob/ya*Ga),Wa=Math.round(Wa+Pa/ya*Ga));n[ca].type="Q";n[ca].cx=Ka;n[ca].cy=Wa}c()});ka.appendChild(za);wa.appendChild(ka)}ka=document.createElement("img");ka.setAttribute("src",Editor.trashImage);ka.style.cursor=-"pointer";ka.style.marginLeft="auto";ka.style.width="14px";ka.style.height="14px";ka.style.opacity="0.5";ka.style.flexShrink="0";ka.title=mxResources.get("delete");Editor.isDarkMode()&&(ka.style.filter="invert(1)");mxEvent.addListener(ka,"click",function(ya){ya.stopPropagation();J();n.splice(ca,1);v>=n.length&&(v=n.length-1);c()});wa.appendChild(ka);mxEvent.addListener(wa,"dragstart",function(ya){T=ca;wa.style.opacity="0.4";ya.dataTransfer.effectAllowed="move";ya.dataTransfer.setData("text/plain",-""+ca);ya.stopPropagation()});mxEvent.addListener(wa,"dragover",function(ya){ya.preventDefault();ya.stopPropagation();ya.dataTransfer.dropEffect="move";ya=parseInt(wa.getAttribute("data-idx"));null!==T&&ya!==T&&(wa.style.borderTop=ya<T?"2px solid #4285f4":"",wa.style.borderBottom=ya>T?"2px solid #4285f4":"")});mxEvent.addListener(wa,"dragleave",function(ya){wa.style.borderTop="";wa.style.borderBottom=""});mxEvent.addListener(wa,"drop",function(ya){ya.preventDefault();ya.stopPropagation();wa.style.borderTop=-"";wa.style.borderBottom="";var Ga=parseInt(wa.getAttribute("data-idx"));null!==T&&Ga!==T&&(J(),ya=n.splice(T,1)[0],Ga=Ga>T?Ga-1:Ga,n.splice(Ga,0,ya),v===T?v=Ga:T<v&&Ga>=v?v--:T>v&&Ga<=v&&v++,c());T=null});mxEvent.addListener(wa,"dragend",function(ya){wa.style.opacity="";wa.style.borderTop="";wa.style.borderBottom="";T=null});ja.appendChild(wa)})(da)}var l=b.editor.graph,n=[],v=-1,x=!0,B=!0,C=[],H=[],D=-1,U=null,S=!1,V=!1,t=0,z=0,L=400,K=400,M=1,m=!1,y=0,F=0,N=0,O=0,P=!1,T=null,Q=l.view.getState(f);-if(null!=Q)try{var R=JSON.parse(mxUtils.getValue(Q.style,"polyCoords","[]")),W=JSON.parse(mxUtils.getValue(Q.style,"polyCurves","[]")),X=mxUtils.getValue(Q.style,"polyline",0);x=!(1==X||!0===X||"true"===X||"1"===X);for(Q=0;Q<R.length;Q++){var Y={x:Math.round(400*R[Q][0]),y:Math.round(400*R[Q][1]),type:"L"};0<Q&&W.length>Q-1&&null!=W[Q-1]&&3<=W[Q-1].length&&"Q"===W[Q-1][0]&&(Y.type="Q",Y.cx=Math.round(400*W[Q-1][1]),Y.cy=Math.round(400*W[Q-1][2]));n.push(Y)}x&&2<R.length&&W.length>=R.length&&null!=-W[R.length-1]&&3<=W[R.length-1].length&&"Q"===W[R.length-1][0]&&(n[0].type="Q",n[0].cx=Math.round(400*W[R.length-1][1]),n[0].cy=Math.round(400*W[R.length-1][2]))}catch(da){}var Z=document.createElement("div");Z.style.userSelect="none";Z.setAttribute("tabindex","0");Z.style.outline="none";Z.style.position="absolute";Z.style.left="30px";Z.style.right="30px";Z.style.top="30px";Z.style.bottom="30px";R=document.createElement("div");R.style.display="flex";R.style.gap="10px";R.style.position="absolute";-R.style.left="0px";R.style.right="0px";R.style.top="0px";R.style.bottom="40px";Z.appendChild(R);var ba=document.createElement("div");ba.style.border="1px solid";ba.style.borderColor="inherit";ba.style.borderRadius="4px";ba.style.flexGrow="1";ba.style.flexShrink="1";ba.style.minWidth="200px";ba.style.position="relative";ba.style.overflow="hidden";R.appendChild(ba);var ea=document.createElementNS("http://www.w3.org/2000/svg","svg");ea.setAttribute("width","100%");ea.setAttribute("height","100%");ea.setAttribute("viewBox",-"0 0 400 400");ea.style.display="block";ea.style.cursor="crosshair";W=document.createElementNS("http://www.w3.org/2000/svg","defs");Y=document.createElementNS("http://www.w3.org/2000/svg","pattern");Q="polygonGrid_"+Date.now();Y.setAttribute("id",Q);Y.setAttribute("width",20);Y.setAttribute("height",20);Y.setAttribute("patternUnits","userSpaceOnUse");X=document.createElementNS("http://www.w3.org/2000/svg","path");X.setAttribute("d","M 20 0 L 0 0 0 20");X.setAttribute("fill","none");X.setAttribute("stroke",-"#e0e0e0");X.setAttribute("stroke-width","0.5");Y.appendChild(X);W.appendChild(Y);ea.appendChild(W);var ha=document.createElementNS("http://www.w3.org/2000/svg","rect");ha.setAttribute("x","-5000");ha.setAttribute("y","-5000");ha.setAttribute("width","10000");ha.setAttribute("height","10000");ha.setAttribute("fill","url(#"+Q+")");ea.appendChild(ha);var fa=document.createElementNS("http://www.w3.org/2000/svg","path");fa.setAttribute("fill","rgba(66, 133, 244, 0.1)");fa.setAttribute("stroke","#4285f4");-fa.setAttribute("stroke-width","2");ea.appendChild(fa);var la=document.createElementNS("http://www.w3.org/2000/svg","g");ea.appendChild(la);var oa=document.createElementNS("http://www.w3.org/2000/svg","g");ea.appendChild(oa);var pa=document.createElementNS("http://www.w3.org/2000/svg","g");ea.appendChild(pa);ba.appendChild(ea);var va=document.createElement("div");va.style.position="absolute";va.style.bottom="0px";va.style.left="0px";va.style.right="12px";va.style.height="12px";va.style.backgroundColor=-"rgba(128,128,128,0.08)";var ta=document.createElement("div");ta.style.position="absolute";ta.style.top="2px";ta.style.height="8px";ta.style.borderRadius="4px";ta.style.backgroundColor="rgba(128,128,128,0.35)";ta.style.cursor="pointer";ta.style.minWidth="20px";va.appendChild(ta);ba.appendChild(va);var ma=document.createElement("div");ma.style.position="absolute";ma.style.top="0px";ma.style.right="0px";ma.style.bottom="12px";ma.style.width="12px";ma.style.backgroundColor="rgba(128,128,128,0.08)";var ia=-document.createElement("div");ia.style.position="absolute";ia.style.left="2px";ia.style.width="8px";ia.style.borderRadius="4px";ia.style.backgroundColor="rgba(128,128,128,0.35)";ia.style.cursor="pointer";ia.style.minHeight="20px";ma.appendChild(ia);ba.appendChild(ma);var qa=!1,ua=!1,xa=0,ra=0;mxEvent.addListener(ta,"mousedown",function(da){qa=!0;xa=da.clientX;ra=t;da.preventDefault();da.stopPropagation()});mxEvent.addListener(ia,"mousedown",function(da){ua=!0;xa=da.clientY;ra=z;da.preventDefault();-da.stopPropagation()});mxEvent.addListener(va,"mousedown",function(da){if(da.target===va){var ca=va.getBoundingClientRect().width,wa=da.clientX-va.getBoundingClientRect().left,ka=1200-L;0<ka&&(t=-400+wa/ca*ka,p());da.preventDefault();da.stopPropagation()}});mxEvent.addListener(ma,"mousedown",function(da){if(da.target===ma){var ca=ma.getBoundingClientRect().height,wa=da.clientY-ma.getBoundingClientRect().top,ka=1200-K;0<ka&&(z=-400+wa/ca*ka,p());da.preventDefault();da.stopPropagation()}});var aa=function(da){if(qa){var ca=-ba.getBoundingClientRect().width-12,wa=parseFloat(ta.style.width)||20,ka=1200-L;ca>wa&&0<ka&&(t=ra+(da.clientX-xa)/(ca-wa)*ka,p());da.preventDefault()}ua&&(ca=ba.getBoundingClientRect().height-12,wa=parseFloat(ia.style.height)||20,ka=1200-K,ca>wa&&0<ka&&(z=ra+(da.clientY-xa)/(ca-wa)*ka,p()),da.preventDefault())},na=function(da){ua=qa=!1};mxEvent.addListener(document,"mousemove",aa);mxEvent.addListener(document,"mouseup",na);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var da=-ea.getBoundingClientRect();if(0<da.width&&0<da.height){var ca=t+L/2,wa=z+K/2;L=da.width*M;K=da.height*M;t=ca-L/2;z=wa-K/2;p()}})).observe(ba);var ja=document.createElement("div");ja.style.width="200px";ja.style.flexShrink="0";ja.style.overflowY="auto";ja.style.border="1px solid";ja.style.borderColor="inherit";ja.style.borderRadius="4px";ja.style.padding="4px";R.appendChild(ja);mxEvent.addGestureListeners(ea,function(da){if(!P&&1!==da.button&&2!==da.button){var ca=A(da);if(null!=ca)D=ca.index,U=ca.type,-S=!0,V=!1,v=ca.index;else{ca=u(da);J();if(2>n.length)n.push({x:ca.x,y:ca.y,type:"L"}),v=n.length-1;else{for(var wa=Infinity,ka=n.length-1,za=x?n.length:n.length-1,ya=0;ya<za;ya++){var Ga=(ya+1)%n.length;Ga=mxUtils.ptSegDistSq(n[ya].x,n[ya].y,n[Ga].x,n[Ga].y,ca.x,ca.y);Ga<wa&&(wa=Ga,ka=ya)}n.splice(ka+1,0,{x:ca.x,y:ca.y,type:"L"});v=ka+1}D=v;U="vertex";V=S=!0}c();mxEvent.consume(da)}},function(da){if(S&&0<=D){V||(J(),V=!0);var ca=u(da);"control"===U?(n[D].cx=ca.x,n[D].cy=ca.y):(n[D].x=ca.x,n[D].y=-ca.y);c();mxEvent.consume(da)}},function(da){!P&&1!==da.button&&2!==da.button&&S&&0<=D&&(S=!1,D=-1,U=null,mxEvent.consume(da))});mxEvent.addListener(ea,"wheel",function(da){da.preventDefault();var ca=ea.getBoundingClientRect(),wa=(da.clientX-ca.left)/ca.width,ka=(da.clientY-ca.top)/ca.height,za=t+wa*L,ya=z+ka*K;M=Math.max(.05,Math.min(5,M*(0<da.deltaY?1.15:1/1.15)));L=ca.width*M;K=ca.height*M;t=za-wa*L;z=ya-ka*K;p()});mxEvent.addListener(ea,"contextmenu",function(da){da.preventDefault()});mxEvent.addListener(ea,-"mousedown",function(da){if(1===da.button||2===da.button||0===da.button&&P)m=!0,y=da.clientX,F=da.clientY,N=t,O=z,ea.style.cursor="grabbing",da.preventDefault()});var sa=function(da){if(m){var ca=ea.getBoundingClientRect();t=N-(da.clientX-y)/ca.width*L;z=O-(da.clientY-F)/ca.height*K;p();da.preventDefault()}},Ca=function(da){m&&(m=!1,ea.style.cursor=P?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",sa);mxEvent.addListener(document,"mouseup",Ca);R=document.createElement("div");R.style.display=-"flex";R.style.alignItems="center";R.style.gap="6px";R.style.position="absolute";R.style.left="0px";R.style.right="0px";R.style.bottom="0px";R.style.height="34px";var Fa=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),function(){I()});R.appendChild(Fa);var Ba=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){G()});R.appendChild(Ba);W=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){d(M/1.15)});R.appendChild(W);W=b.createToolbarButton(Editor.zoomOutImage,-mxResources.get("zoomOut"),function(){d(1.15*M)});R.appendChild(W);W=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var da=ea.getBoundingClientRect();if(0<da.width&&0<da.height){if(1==M)if(0<n.length){for(var ca=n[0].x,wa=n[0].y,ka=n[0].x,za=n[0].y,ya=1;ya<n.length;ya++)ca=Math.min(ca,n[ya].x),wa=Math.min(wa,n[ya].y),ka=Math.max(ka,n[ya].x),za=Math.max(za,n[ya].y),"Q"===n[ya].type&&(ca=Math.min(ca,n[ya].cx),wa=Math.min(wa,n[ya].cy),ka=Math.max(ka,n[ya].cx),za=Math.max(za,-n[ya].cy));ka=ka-ca+40;za=za-wa+40;M=1/Math.min(da.width/ka,da.height/za);L=da.width*M;K=da.height*M;t=ca-20+(ka-L)/2;z=wa-20+(za-K)/2}else M=1,L=da.width,K=da.height,t=(400-L)/2,z=(400-K)/2;else M=1,L=da.width*M,K=da.height*M,t=(400-L)/2,z=(400-K)/2;p()}});R.appendChild(W);W=mxUtils.button(mxResources.get("deleteAll"),function(){0<n.length&&(J(),n=[],v=-1,c())});W.className="geBtn";W.style.padding="2px 10px";W.style.fontSize="12px";R.appendChild(W);W=document.createElement("span");W.style.flexGrow=-"1";R.appendChild(W);W=document.createElement("label");W.style.display="flex";W.style.alignItems="center";W.style.gap="4px";W.style.fontSize="12px";W.style.cursor="pointer";W.style.whiteSpace="nowrap";Y=document.createElement("input");Y.type="checkbox";Y.checked=B;mxEvent.addListener(Y,"change",function(){B=this.checked;ha.style.display=B?"":"none"});W.appendChild(Y);mxUtils.write(W,mxResources.get("grid"));R.appendChild(W);W=document.createElement("label");W.style.display="flex";W.style.alignItems=-"center";W.style.gap="4px";W.style.fontSize="12px";W.style.cursor="pointer";W.style.whiteSpace="nowrap";Y=document.createElement("input");Y.type="checkbox";Y.checked=x;mxEvent.addListener(Y,"change",function(){x=this.checked;c()});W.appendChild(Y);mxUtils.write(W,mxResources.get("closePath"));R.appendChild(W);W=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});W.className="geBtn";Y=mxUtils.button(mxResources.get("apply"),function(){if(2>n.length)b.showError(mxResources.get("error"),-mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var da=n[0].x,ca=n[0].x,wa=n[0].y,ka=n[0].y,za=0;za<n.length;za++)da=Math.min(da,n[za].x),ca=Math.max(ca,n[za].x),wa=Math.min(wa,n[za].y),ka=Math.max(ka,n[za].y),"Q"===n[za].type&&(da=Math.min(da,n[za].cx),ca=Math.max(ca,n[za].cx),wa=Math.min(wa,n[za].cy),ka=Math.max(ka,n[za].cy));var ya=ca-da,Ga=ka-wa,Ka=function(Pa){return 0<ya?Math.round((Pa-da)/ya*100)/100:.5},Wa=function(Pa){return 0<Ga?Math.round((Pa-wa)/Ga*100)/100:.5};ca=[];ka=-[];for(za=0;za<n.length;za++)ca.push([Ka(n[za].x),Wa(n[za].y)]),0<za&&("Q"===n[za].type?ka.push(["Q",Ka(n[za].cx),Wa(n[za].cy)]):ka.push([]));x&&2<n.length&&"Q"===n[0].type&&ka.push(["Q",Ka(n[0].cx),Wa(n[0].cy)]);if(null!=k)za="shape=mxgraph.basic.polygon;polyCoords="+JSON.stringify(ca)+";polyCurves="+JSON.stringify(ka)+";polyline="+(x?"0":"1")+";whiteSpace=wrap;html=1;",k(za);else{za=l.getCellGeometry(f);null!=za&&(za=za.clone(),0<ya&&(za.x+=da/400*za.width,za.width*=ya/400),0<Ga&&(za.y+=wa/400*-za.height,za.height*=Ga/400));l.getModel().beginUpdate();try{null!=za&&l.getModel().setGeometry(f,za),l.setCellStyles("polyCoords",JSON.stringify(ca),[f]),l.setCellStyles("polyCurves",JSON.stringify(ka),[f]),l.setCellStyles("polyline",x?"0":"1",[f])}finally{l.getModel().endUpdate()}}b.hideDialog()}});Y.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(R.appendChild(W),R.appendChild(Y)):(R.appendChild(Y),R.appendChild(W));Z.appendChild(R);mxEvent.addListener(Z,"keydown",function(da){32===da.keyCode?-(P||(P=!0,ea.style.cursor="grab"),mxEvent.consume(da)):46===da.keyCode||8===da.keyCode?0<=v&&v<n.length&&"INPUT"!==da.target.tagName&&(J(),n.splice(v,1),v>=n.length&&(v=n.length-1),c(),mxEvent.consume(da)):90===da.keyCode&&(da.ctrlKey||da.metaKey)?(da.shiftKey?G():I(),mxEvent.consume(da)):89===da.keyCode&&(da.ctrlKey||da.metaKey)&&(G(),mxEvent.consume(da))});mxEvent.addListener(Z,"keyup",function(da){32===da.keyCode&&(P=!1,m||(ea.style.cursor="crosshair"))});c();E();this.init=function(){Z.focus();-var da=ea.getBoundingClientRect();0<da.width&&0<da.height&&(M=1,L=da.width*M,K=da.height*M,t=(400-L)/2,z=(400-K)/2,p())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",aa);mxEvent.removeListener(document,"mouseup",na);mxEvent.removeListener(document,"mousemove",sa);mxEvent.removeListener(document,"mouseup",Ca)};this.container=Z};(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.thinFormatImage=+var FilePropertiesDialog=function(b,f){function k(G){var N=H;H=function(J,T){try{G(function(){N(J,T)},T)}catch(V){T(V)}}}var d=document.createElement("table"),p=document.createElement("tbody");d.style.width="100%";d.style.height="100%";d.style.tableLayout="fixed";var q=b.getCurrentFile(),u=null!=q&&null!=q.getTitle()?q.getTitle():b.defaultFilename,A=/(\.png)$/i.test(u),I=/(\.svg)$/i.test(u),H=function(G,N){G()},F=null!=q?q.isLocked():!1;var D=document.createElement("tr");var c=document.createElement("td");+c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("locked")+":");D.appendChild(c);var g=document.createElement("input");g.setAttribute("type","checkbox");F&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(g);D.appendChild(c);p.appendChild(D);this.init=function(){g.focus()};k(function(G,N){null!=b.fileNode&&F!=g.checked?window.setTimeout(function(){null!=+q&&q.setLocked(g.checked);G()},0):G()});if(A||I){u=1;A=0;D=b.fileNode;null!=D&&(D.hasAttribute("scale")&&(u=parseFloat(D.getAttribute("scale"))),D.hasAttribute("border")&&(A=parseInt(D.getAttribute("border"))));D=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("zoom")+":");D.appendChild(c);var l=document.createElement("input");l.setAttribute("value",100*u+"%");l.style.boxSizing="border-box";l.style.width=+"100%";c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(l);D.appendChild(c);p.appendChild(D);D=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("borderWidth")+":");D.appendChild(c);var n=document.createElement("input");n.setAttribute("value",A);n.style.boxSizing="border-box";n.style.width="100%";c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(n);D.appendChild(c);+p.appendChild(D);this.init=this.init||function(){l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null)};k(function(G,N){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(l.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(n.value))),null!=q&&q.fileChanged());G()})}else if(!/(\.html)$/i.test(u)&&!/(\.svg)$/i.test(u)){var v=null!=q?q.isCompressed():Editor.defaultCompressed;D=document.createElement("tr");+c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("compressed")+":");D.appendChild(c);var x=document.createElement("input");x.setAttribute("type","checkbox");v&&(x.setAttribute("checked","checked"),x.defaultChecked=!0);c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(x);D.appendChild(c);p.appendChild(D);this.init=this.init||function(){x.focus()};k(function(G,+N){null!=b.fileNode&&v!=x.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",x.checked?"true":"false");null!=q&&(q.compressionChanged(x.checked),q.fileChanged());G()},0):G()})}if(null!=q&&q.isRealtimeOptional()){D=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("realtimeCollaboration")+":");D.appendChild(c);var B=document.createElement("input");+B.setAttribute("type","checkbox");var C=q.isRealtimeEnabled();if(C="disabled"!=b.drive.getCustomProperty(q.desc,"collaboration"))B.setAttribute("checked","checked"),B.defaultChecked=!0;k(function(G,N){B.checked!=C?q.setRealtimeEnabled(B.checked,G,N):G()});this.init=null!=this.init?this.init:function(){B.focus()};c=document.createElement("td");c.style.whiteSpace="nowrap";u=document.createElement("div");u.style.display="flex";u.style.alignItems="center";u.style.justifyContent="start";u.appendChild(B);+u.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));c.appendChild(u);D.appendChild(c);p.appendChild(D)}null!=q&&"draw.io"==b.getServiceName()&&0<q.getSize()&&"1"!=urlParams.embed&&(D=document.createElement("tr"),c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("size")+":"),D.appendChild(c),c=b.formatFileSize(q.getSize()),u=document.createElement("input"),+u.setAttribute("title",c),u.setAttribute("value",c),u.setAttribute("disabled","disabled"),u.style.boxSizing="border-box",u.style.width="100%",c=document.createElement("td"),c.style.whiteSpace="nowrap",c.appendChild(u),D.appendChild(c),p.appendChild(D));null!=f&&(D=document.createElement("tr"),c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("publicDiagramUrl")+":"),D.appendChild(c),+u=document.createElement("a"),u.setAttribute("href",f),u.setAttribute("title",f),u.style.whiteSpace="nowrap",u.style.overflow="hidden",u.style.textOverflow="ellipsis",u.style.display="block",u.style.margin="2px",u.style.fontSize="10pt",mxUtils.write(u,f),mxEvent.addListener(u,"click",function(G){b.openLink(f);mxEvent.consume(G)}),c=document.createElement("td"),c.appendChild(u),D.appendChild(c),p.appendChild(D));null!=q&&null!=q.fileObject&&null!=q.fileObject.path&&(D=document.createElement("tr"),+c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("pathFilename")+":"),D.appendChild(c),u=document.createElement("input"),u.setAttribute("title",q.fileObject.path),u.setAttribute("value",q.fileObject.path),u.setAttribute("disabled","disabled"),u.style.boxSizing="border-box",u.style.width="100%",c=document.createElement("td"),c.appendChild(u),D.appendChild(c),p.appendChild(D));+this.init=null!=this.init?this.init:function(){};u=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&H(function(){b.spinner.stop();b.hideDialog()},function(G){b.spinner.stop();b.handleError(G,mxResources.get("error"))})});u.className="geBtn gePrimaryBtn";D=document.createElement("tr");c=document.createElement("td");c.colSpan=2;c.style.paddingTop="20px";c.style.whiteSpace="nowrap";c.setAttribute("align","right");A=mxUtils.button(mxResources.get("cancel"),+function(){b.hideDialog()});A.className="geBtn";b.editor.cancelFirst&&c.appendChild(A);null!=b.fileNode&&(I=mxUtils.button(mxResources.get("editData")+"...",function(){b.hideDialog();var G={};try{var N=b.fileNode.getAttribute("vars");null!=N&&0<N.length&&(G=JSON.parse(N))}catch(V){}N=mxUtils.createXmlDocument().createElement("object");N.setAttribute("label","");for(var J in G)N.setAttribute(J,G[J]);G=b.createTemporaryGraph(b.editor.graph.getStylesheet());var T=new mxCell(N);G.getModel().add(G.getDefaultParent(),+T);G.getModel().addListener(mxEvent.CHANGE,function(V,t){V=t.getProperty("edit").changes;for(t=0;t<V.length;t++)if(V[t]instanceof mxValueChange&&V[t].cell===T){for(var z={},L=V[t].value.attributes,K=0;K<L.length;K++)"label"!=L[K].nodeName&&(z[L[K].nodeName]=L[K].nodeValue);z=JSON.stringify(z);"{}"==z?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",z);b.updateFileVars();b.editor.graph.refresh();z=b.getCurrentFile();null!=z&&z.fileChanged()}});G=new EditDataDialog(b,T,G);b.showDialog(G.container,+480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));G.init()}),I.className="geBtn",c.appendChild(I));c.appendChild(u);b.editor.cancelFirst||c.appendChild(A);D.appendChild(c);p.appendChild(D);d.appendChild(p);this.container=d},ConnectionPointsDialog=function(b,f){function k(){null!=p&&p.destroy()}var d=document.createElement("div");d.style.userSelect="none";d.style.display="flex";d.style.flexDirection="column";d.style.height="100%";var p=null;this.init=function(){function q(K,M,m){var y="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="++b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";K=new mxCell("",new mxGeometry(K,M,6,6),y);K.vertex=!0;K.cp=!0;K.constObj=m;return D.addCell(K)}function u(K){K=D.getSelectionCells();D.deleteCells(K)}function A(){var K=parseInt(V.value)||0;K=0>K?0:100<K?100:K;V.value=K;var M=parseInt(z.value)||0;M=0>M?0:100<M?100:M;z.value=M;var m=parseInt(t.value)||0,y=parseInt(L.value)||0;m=new mxConnectionConstraint(new mxPoint(K/100,M/100),!1,null,m,y);K=D.getConnectionPoint(l,m);M=D.getSelectionCell();+if(null!=M){M.constObj=m;m=M.geometry.clone();y=D.view.scale;var E=D.view.translate;m.x=(K.x-3*y)/y-E.x;m.y=(K.y-3*y)/y-E.y;D.model.setGeometry(M,m)}}function I(K){if(K.constObj)return{x:K.constObj.point.x,y:K.constObj.point.y,dx:K.constObj.dx,dy:K.constObj.dy};var M=0,m=0,y=c.geometry,E=mxUtils.format((K.geometry.x+3-y.x)/y.width);K=mxUtils.format((K.geometry.y+3-y.y)/y.height);0>E?(M=E*y.width,E=0):1<E&&(M=(E-1)*y.width,E=1);0>K?(m=K*y.height,K=0):1<K&&(m=(K-1)*y.height,K=1);return{x:E,y:K,dx:parseInt(M),+dy:parseInt(m)}}function H(K){if(1==D.getSelectionCount()){var M=D.getSelectionCell();K&&(M.constObj=null);K=I(M);V.value=100*K.x;z.value=100*K.y;t.value=K.dx;L.value=K.dy;T.style.visibility=""}else T.style.visibility="hidden"}var F=document.createElement("div");F.style.flex="1";F.style.minHeight="0";F.style.overflow="hidden";F.style.borderStyle="solid";F.style.borderWidth="1px";F.style.boxSizing="border-box";mxEvent.disableContextMenu(F);d.appendChild(F);var D=new Graph(F);D.transparentBackground=+!1;D.autoExtend=!1;D.autoScroll=!1;D.setGridEnabled(!1);D.setEnabled(!0);D.setPanning(!0);D.setConnectable(!1);D.setTooltips(!1);D.minFitScale=null;D.maxFitScale=null;D.centerZoom=!0;D.maxFitScale=2;F=f.geometry;var c=new mxCell(f.value,new mxGeometry(0,0,F.width,F.height),f.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");c.vertex=!0;D.addCell(c);D.dblClick=function(K,M){if(null!=M&&M!=c)D.setSelectionCell(M);else{M=mxUtils.convertPoint(D.container,mxEvent.getClientX(K),+mxEvent.getClientY(K));mxEvent.consume(K);K=D.view.scale;var m=D.view.translate;D.setSelectionCell(q((M.x-3*K)/K-m.x,(M.y-3*K)/K-m.y))}};p=new mxKeyHandler(D);p.bindKey(46,u);p.bindKey(8,u);D.getRubberband().isForceRubberbandEvent=function(K){return 0==K.evt.button&&(null==K.getCell()||K.getCell()==c)};D.panningHandler.isForcePanningEvent=function(K){return 2==K.evt.button};var g=D.isCellSelectable;D.isCellSelectable=function(K){return K==c?!1:g.apply(this,arguments)};D.getLinkForCell=function(){return null};+var l=D.view.getState(c);F=D.getAllConnectionConstraints(l);for(var n=0;null!=F&&n<F.length;n++){var v=D.getConnectionPoint(l,F[n]);q(v.x-3,v.y-3,F[n])}n=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){D.zoomIn()});v=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){D.zoomOut()});var x=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==D.view.scale?(D.maxFitScale=8,D.fit(8)):D.zoomActual();D.center()}),B=function(){b.prompt(mxResources.get("gridSize"),+D.gridSize,function(K){!isNaN(K)&&0<K&&(D.setGridSize(K),D.setGridEnabled(!0),D.refresh())})},C=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(K){mxEvent.isShiftDown(K)?B():(D.setGridEnabled(!D.isGridEnabled()),D.refresh())});mxEvent.addListener(C,"dblclick",B);var G=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),u);mxUtils.setOpacity(G,10);F=document.createElement("div");F.style.display="flex";F.style.flexShrink="0";F.style.alignItems="center";F.style.paddingTop=+"6px";F.appendChild(n);F.appendChild(v);F.appendChild(x);F.appendChild(C);F.appendChild(G);d.appendChild(F);var N=document.createElement("input");N.setAttribute("type","number");N.setAttribute("min","1");N.setAttribute("value","1");N.style.width="45px";N.style.position="relative";N.style.margin="0 4px 0 4px";var J=document.createElement("select");J.style.position="relative";v=["left","right","top","bottom"];for(n=0;n<v.length;n++)x=v[n],C=document.createElement("option"),mxUtils.write(C,mxResources.get(x)),+C.value=x,J.appendChild(C);n=mxUtils.button(mxResources.get("add"),function(){var K=parseInt(N.value);K=1>K?1:100<K?100:K;N.value=K;for(var M=J.value,m=c.geometry,y=[],E=0;E<K;E++){switch(M){case "left":var P=m.x;var O=m.y+(E+1)*m.height/(K+1);break;case "right":P=m.x+m.width;O=m.y+(E+1)*m.height/(K+1);break;case "top":P=m.x+(E+1)*m.width/(K+1);O=m.y;break;case "bottom":P=m.x+(E+1)*m.width/(K+1),O=m.y+m.height}y.push(q(P-3,O-3))}D.setSelectionCells(y)});n.style.marginLeft="auto";F.appendChild(n);+F.appendChild(N);F.appendChild(J);var T=document.createElement("div");T.style.flexShrink="0";T.style.margin="4px 0px 8px 0px";T.style.whiteSpace="nowrap";T.style.height="24px";F=document.createElement("span");mxUtils.write(F,mxResources.get("dx"));T.appendChild(F);var V=document.createElement("input");V.setAttribute("type","number");V.setAttribute("min","0");V.setAttribute("max","100");V.style.width="45px";V.style.margin="0 4px 0 4px";T.appendChild(V);mxUtils.write(T,"%");var t=document.createElement("input");+t.setAttribute("type","number");t.style.width="45px";t.style.margin="0 4px 0 4px";T.appendChild(t);mxUtils.write(T,"pt");F=document.createElement("span");mxUtils.write(F,mxResources.get("dy"));F.style.marginLeft="12px";T.appendChild(F);var z=document.createElement("input");z.setAttribute("type","number");z.setAttribute("min","0");z.setAttribute("max","100");z.style.width="45px";z.style.margin="0 4px 0 4px";T.appendChild(z);mxUtils.write(T,"%");var L=document.createElement("input");L.setAttribute("type",+"number");L.style.width="45px";L.style.margin="0 4px 0 4px";T.appendChild(L);mxUtils.write(T,"pt");d.appendChild(T);H();D.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<D.getSelectionCount()?mxUtils.setOpacity(G,60):mxUtils.setOpacity(G,10);H()});D.addListener(mxEvent.CELLS_MOVED,H);mxEvent.addListener(V,"change",A);mxEvent.addListener(z,"change",A);mxEvent.addListener(t,"change",A);mxEvent.addListener(L,"change",A);F=mxUtils.button(mxResources.get("cancel"),function(){k();b.hideDialog()});+F.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){var K=D.model.cells,M=[],m=[],y;for(y in K){var E=K[y];E.cp&&m.push(I(E))}m.sort(function(P,O){return P.x!=O.x?P.x-O.x:P.y!=O.y?P.y-O.y:P.dx!=O.dx?P.dx-O.dx:P.dy-O.dy});for(K=0;K<m.length;K++)0<K&&m[K].x==m[K-1].x&&m[K].y==m[K-1].y&&m[K].dx==m[K-1].dx&&m[K].dy==m[K-1].dy||M.push("["+m[K].x+","+m[K].y+",0,"+m[K].dx+","+m[K].dy+"]");b.editor.graph.setCellStyles("points","["+M.join(",")+"]",[f]);k();b.hideDialog()});n.className=+"geBtn gePrimaryBtn";v=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[f]);k();b.hideDialog()});v.className="geBtn";x=document.createElement("div");x.style.flexShrink="0";x.style.marginTop="10px";x.style.textAlign="right";b.isOffline()||x.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&x.appendChild(F);x.appendChild(v);x.appendChild(n);b.editor.cancelFirst||x.appendChild(F);d.appendChild(x);+D.fit(8);D.center()};this.destroy=k;this.container=d},PolygonDialog=function(b,f,k){function d(ca){var da=fa.getBoundingClientRect();if(0<da.width&&0<da.height){var wa=t+L/2,ka=z+K/2;M=Math.max(.05,Math.min(5,ca));L=da.width*M;K=da.height*M;t=wa-L/2;z=ka-K/2;p()}}function p(){fa.setAttribute("viewBox",t+" "+z+" "+L+" "+K);var ca=aa.getBoundingClientRect();if(!(0>=ca.width||0>=ca.height)){var da=ca.width-12,wa=Math.max(20,da*Math.min(1,L/1200)),ka=1200-L;ka=0<ka?(t- -400)/ka:.5;ka=Math.max(0,Math.min(1,+ka));sa.style.width=wa+"px";sa.style.left=ka*(da-wa)+"px";ca=ca.height-12;da=Math.max(20,ca*Math.min(1,K/1200));wa=1200-K;wa=0<wa?(z- -400)/wa:.5;wa=Math.max(0,Math.min(1,wa));ja.style.height=da+"px";ja.style.top=wa*(ca-da)+"px"}}function q(ca){return B?20*Math.round(ca/20):Math.round(ca)}function u(ca){var da=fa.getBoundingClientRect(),wa=z+((null!=ca.touches?ca.touches[0].clientY:ca.clientY)-da.top)/da.height*K;return{x:q(t+((null!=ca.touches?ca.touches[0].clientX:ca.clientX)-da.left)/da.width*+L),y:q(wa)}}function A(ca){var da=fa.getBoundingClientRect(),wa=t+((null!=ca.touches?ca.touches[0].clientX:ca.clientX)-da.left)/da.width*L;ca=z+((null!=ca.touches?ca.touches[0].clientY:ca.clientY)-da.top)/da.height*K;da=L/400*9;if(x&&2<n.length&&"Q"===n[0].type){var ka=n[0].cx-wa,Aa=n[0].cy-ca;if(Math.sqrt(ka*ka+Aa*Aa)<=da)return{type:"control",index:0}}for(var za=1;za<n.length;za++)if("Q"===n[za].type&&(ka=n[za].cx-wa,Aa=n[za].cy-ca,Math.sqrt(ka*ka+Aa*Aa)<=da))return{type:"control",index:za};for(za=+0;za<n.length;za++)if(ka=n[za].x-wa,Aa=n[za].y-ca,Math.sqrt(ka*ka+Aa*Aa)<=da)return{type:"vertex",index:za};return null}function I(){C.push(JSON.stringify(n));G=[];D()}function H(){0<C.length&&(G.push(JSON.stringify(n)),n=JSON.parse(C.pop()),v=Math.min(v,n.length-1),c(),D())}function F(){0<G.length&&(C.push(JSON.stringify(n)),n=JSON.parse(G.pop()),v=Math.min(v,n.length-1),c(),D())}function D(){null!=Ba&&(Ba.style.opacity=0<C.length?"1":"0.3",Ba.style.pointerEvents=0<C.length?"":"none");null!=xa&&+(xa.style.opacity=0<G.length?"1":"0.3",xa.style.pointerEvents=0<G.length?"":"none")}function c(){for(var ca="",da=0;da<n.length;da++)ca=0===da?ca+("M"+n[da].x+" "+n[da].y):"Q"===n[da].type?ca+("Q"+n[da].cx+" "+n[da].cy+" "+n[da].x+" "+n[da].y):ca+("L"+n[da].x+" "+n[da].y);x&&2<n.length&&("Q"===n[0].type&&(ca+="Q"+n[0].cx+" "+n[0].cy+" "+n[0].x+" "+n[0].y),ca+="Z");ea.setAttribute("d",ca);for(ea.setAttribute("fill",x&&2<n.length?"rgba(66, 133, 244, 0.1)":"none");ma.firstChild;)ma.removeChild(ma.firstChild);+for(da=1;da<n.length;da++)"Q"===n[da].type&&(ca=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ca.setAttribute("points",n[da-1].x+","+n[da-1].y+" "+n[da].cx+","+n[da].cy+" "+n[da].x+","+n[da].y),ca.setAttribute("fill","none"),ca.setAttribute("stroke","#f0a030"),ca.setAttribute("stroke-width","1"),ca.setAttribute("stroke-dasharray","4,3"),ma.appendChild(ca));x&&2<n.length&&"Q"===n[0].type&&(da=document.createElementNS("http://www.w3.org/2000/svg","polyline"),da.setAttribute("points",+n[n.length-1].x+","+n[n.length-1].y+" "+n[0].cx+","+n[0].cy+" "+n[0].x+","+n[0].y),da.setAttribute("fill","none"),da.setAttribute("stroke","#f0a030"),da.setAttribute("stroke-width","1"),da.setAttribute("stroke-dasharray","4,3"),ma.appendChild(da));for(;na.firstChild;)na.removeChild(na.firstChild);for(da=0;da<n.length;da++)ca=document.createElementNS("http://www.w3.org/2000/svg","circle"),ca.setAttribute("cx",n[da].x),ca.setAttribute("cy",n[da].y),ca.setAttribute("r",5),ca.setAttribute("fill",da===+v?"#ff4444":"#4285f4"),ca.setAttribute("stroke","#fff"),ca.setAttribute("stroke-width","1.5"),ca.style.cursor="move",na.appendChild(ca);for(;ua.firstChild;)ua.removeChild(ua.firstChild);for(da=1;da<n.length;da++)"Q"===n[da].type&&(ca=document.createElementNS("http://www.w3.org/2000/svg","rect"),ca.setAttribute("x",n[da].cx-5),ca.setAttribute("y",n[da].cy-5),ca.setAttribute("width",10),ca.setAttribute("height",10),ca.setAttribute("fill",da===v?"#ff8800":"#f0a030"),ca.setAttribute("stroke","#fff"),+ca.setAttribute("stroke-width","1.5"),ca.style.cursor="move",ua.appendChild(ca));x&&2<n.length&&"Q"===n[0].type&&(da=document.createElementNS("http://www.w3.org/2000/svg","rect"),da.setAttribute("x",n[0].cx-5),da.setAttribute("y",n[0].cy-5),da.setAttribute("width",10),da.setAttribute("height",10),da.setAttribute("fill",0===v?"#ff8800":"#f0a030"),da.setAttribute("stroke","#fff"),da.setAttribute("stroke-width","1.5"),da.style.cursor="move",ua.appendChild(da));g()}function g(){oa.innerHTML="";if(0===+n.length){var ca=document.createElement("div");ca.style.padding="20px 10px";ca.style.textAlign="center";ca.style.opacity="0.5";ca.style.fontSize="12px";mxUtils.write(ca,mxResources.get("clickToAdd"));oa.appendChild(ca)}else for(ca=0;ca<n.length;ca++)(function(da){var wa=document.createElement("div");wa.style.display="flex";wa.style.alignItems="center";wa.style.padding="2px 4px";wa.style.gap="4px";wa.style.borderRadius="3px";wa.style.marginBottom="2px";wa.style.fontSize="12px";wa.setAttribute("draggable",+"true");wa.setAttribute("data-idx",da);da===v&&(wa.style.backgroundColor="rgba(66, 133, 244, 0.15)");wa.style.cursor="pointer";mxEvent.addListener(wa,"click",function(){v=da;c()});var ka=document.createElement("span");ka.innerHTML="☰";ka.style.cursor="grab";ka.style.fontSize="11px";ka.style.opacity="0.4";ka.style.flexShrink="0";wa.appendChild(ka);ka=document.createElement("span");ka.style.minWidth="18px";ka.style.fontWeight="bold";mxUtils.write(ka,da+1+"");wa.appendChild(ka);ka=document.createElement("input");+ka.type="number";ka.value=Math.round(n[da].x);ka.style.width="48px";ka.style.fontSize="11px";ka.style.padding="1px 3px";ka.title="X";mxEvent.addListener(ka,"change",function(){I();n[da].x=parseInt(this.value)||0;c()});mxEvent.addListener(ka,"click",function(za){za.stopPropagation()});wa.appendChild(ka);ka=document.createElement("input");ka.type="number";ka.value=Math.round(n[da].y);ka.style.width="48px";ka.style.fontSize="11px";ka.style.padding="1px 3px";ka.title="Y";mxEvent.addListener(ka,"change",+function(){I();n[da].y=parseInt(this.value)||0;c()});mxEvent.addListener(ka,"click",function(za){za.stopPropagation()});wa.appendChild(ka);if(0<da||0===da&&x&&2<n.length){ka=document.createElement("label");ka.style.display="flex";ka.style.alignItems="center";ka.style.cursor="pointer";ka.style.flexShrink="0";ka.title=mxResources.get("curved");var Aa=document.createElement("input");Aa.type="checkbox";Aa.checked="Q"===n[da].type;Aa.style.margin="0";mxEvent.addListener(Aa,"click",function(za){za.stopPropagation()});+mxEvent.addListener(Aa,"change",function(){I();if("Q"===n[da].type)n[da].type="L",delete n[da].cx,delete n[da].cy;else{var za=0<da?n[da-1]:n[n.length-1];var Ga=n[da];var Ka=(za.x+Ga.x)/2;var Wa=(za.y+Ga.y)/2;var Pa=Ga.x-za.x,ob=Ga.y-za.y;za=Math.sqrt(Pa*Pa+ob*ob);0!==za&&(Ga=.25*za,Ka=Math.round(Ka+-ob/za*Ga),Wa=Math.round(Wa+Pa/za*Ga));n[da].type="Q";n[da].cx=Ka;n[da].cy=Wa}c()});ka.appendChild(Aa);wa.appendChild(ka)}ka=document.createElement("img");ka.setAttribute("src",Editor.trashImage);ka.style.cursor=+"pointer";ka.style.marginLeft="auto";ka.style.width="14px";ka.style.height="14px";ka.style.opacity="0.5";ka.style.flexShrink="0";ka.title=mxResources.get("delete");Editor.isDarkMode()&&(ka.style.filter="invert(1)");mxEvent.addListener(ka,"click",function(za){za.stopPropagation();I();n.splice(da,1);v>=n.length&&(v=n.length-1);c()});wa.appendChild(ka);mxEvent.addListener(wa,"dragstart",function(za){U=da;wa.style.opacity="0.4";za.dataTransfer.effectAllowed="move";za.dataTransfer.setData("text/plain",+""+da);za.stopPropagation()});mxEvent.addListener(wa,"dragover",function(za){za.preventDefault();za.stopPropagation();za.dataTransfer.dropEffect="move";za=parseInt(wa.getAttribute("data-idx"));null!==U&&za!==U&&(wa.style.borderTop=za<U?"2px solid #4285f4":"",wa.style.borderBottom=za>U?"2px solid #4285f4":"")});mxEvent.addListener(wa,"dragleave",function(za){wa.style.borderTop="";wa.style.borderBottom=""});mxEvent.addListener(wa,"drop",function(za){za.preventDefault();za.stopPropagation();wa.style.borderTop=+"";wa.style.borderBottom="";var Ga=parseInt(wa.getAttribute("data-idx"));null!==U&&Ga!==U&&(I(),za=n.splice(U,1)[0],Ga=Ga>U?Ga-1:Ga,n.splice(Ga,0,za),v===U?v=Ga:U<v&&Ga>=v?v--:U>v&&Ga<=v&&v++,c());U=null});mxEvent.addListener(wa,"dragend",function(za){wa.style.opacity="";wa.style.borderTop="";wa.style.borderBottom="";U=null});oa.appendChild(wa)})(ca)}var l=b.editor.graph,n=[],v=-1,x=!0,B=!0,C=[],G=[],N=-1,J=null,T=!1,V=!1,t=0,z=0,L=400,K=400,M=1,m=!1,y=0,E=0,P=0,O=0,Q=!1,U=null,R=l.view.getState(f);+if(null!=R)try{var S=JSON.parse(mxUtils.getValue(R.style,"polyCoords","[]")),W=JSON.parse(mxUtils.getValue(R.style,"polyCurves","[]")),X=mxUtils.getValue(R.style,"polyline",0);x=!(1==X||!0===X||"true"===X||"1"===X);for(R=0;R<S.length;R++){var Y={x:Math.round(400*S[R][0]),y:Math.round(400*S[R][1]),type:"L"};0<R&&W.length>R-1&&null!=W[R-1]&&3<=W[R-1].length&&"Q"===W[R-1][0]&&(Y.type="Q",Y.cx=Math.round(400*W[R-1][1]),Y.cy=Math.round(400*W[R-1][2]));n.push(Y)}x&&2<S.length&&W.length>=S.length&&null!=+W[S.length-1]&&3<=W[S.length-1].length&&"Q"===W[S.length-1][0]&&(n[0].type="Q",n[0].cx=Math.round(400*W[S.length-1][1]),n[0].cy=Math.round(400*W[S.length-1][2]))}catch(ca){}var Z=document.createElement("div");Z.style.userSelect="none";Z.setAttribute("tabindex","0");Z.style.outline="none";Z.style.position="absolute";Z.style.left="30px";Z.style.right="30px";Z.style.top="30px";Z.style.bottom="30px";S=document.createElement("div");S.style.display="flex";S.style.gap="10px";S.style.position="absolute";+S.style.left="0px";S.style.right="0px";S.style.top="0px";S.style.bottom="40px";Z.appendChild(S);var aa=document.createElement("div");aa.style.border="1px solid";aa.style.borderColor="inherit";aa.style.borderRadius="4px";aa.style.flexGrow="1";aa.style.flexShrink="1";aa.style.minWidth="200px";aa.style.position="relative";aa.style.overflow="hidden";S.appendChild(aa);var fa=document.createElementNS("http://www.w3.org/2000/svg","svg");fa.setAttribute("width","100%");fa.setAttribute("height","100%");fa.setAttribute("viewBox",+"0 0 400 400");fa.style.display="block";fa.style.cursor="crosshair";W=document.createElementNS("http://www.w3.org/2000/svg","defs");Y=document.createElementNS("http://www.w3.org/2000/svg","pattern");R="polygonGrid_"+Date.now();Y.setAttribute("id",R);Y.setAttribute("width",20);Y.setAttribute("height",20);Y.setAttribute("patternUnits","userSpaceOnUse");X=document.createElementNS("http://www.w3.org/2000/svg","path");X.setAttribute("d","M 20 0 L 0 0 0 20");X.setAttribute("fill","none");X.setAttribute("stroke",+"#e0e0e0");X.setAttribute("stroke-width","0.5");Y.appendChild(X);W.appendChild(Y);fa.appendChild(W);var ia=document.createElementNS("http://www.w3.org/2000/svg","rect");ia.setAttribute("x","-5000");ia.setAttribute("y","-5000");ia.setAttribute("width","10000");ia.setAttribute("height","10000");ia.setAttribute("fill","url(#"+R+")");fa.appendChild(ia);var ea=document.createElementNS("http://www.w3.org/2000/svg","path");ea.setAttribute("fill","rgba(66, 133, 244, 0.1)");ea.setAttribute("stroke","#4285f4");+ea.setAttribute("stroke-width","2");fa.appendChild(ea);var ma=document.createElementNS("http://www.w3.org/2000/svg","g");fa.appendChild(ma);var na=document.createElementNS("http://www.w3.org/2000/svg","g");fa.appendChild(na);var ua=document.createElementNS("http://www.w3.org/2000/svg","g");fa.appendChild(ua);aa.appendChild(fa);var ta=document.createElement("div");ta.style.position="absolute";ta.style.bottom="0px";ta.style.left="0px";ta.style.right="12px";ta.style.height="12px";ta.style.backgroundColor=+"rgba(128,128,128,0.08)";var sa=document.createElement("div");sa.style.position="absolute";sa.style.top="2px";sa.style.height="8px";sa.style.borderRadius="4px";sa.style.backgroundColor="rgba(128,128,128,0.35)";sa.style.cursor="pointer";sa.style.minWidth="20px";ta.appendChild(sa);aa.appendChild(ta);var la=document.createElement("div");la.style.position="absolute";la.style.top="0px";la.style.right="0px";la.style.bottom="12px";la.style.width="12px";la.style.backgroundColor="rgba(128,128,128,0.08)";var ja=+document.createElement("div");ja.style.position="absolute";ja.style.left="2px";ja.style.width="8px";ja.style.borderRadius="4px";ja.style.backgroundColor="rgba(128,128,128,0.35)";ja.style.cursor="pointer";ja.style.minHeight="20px";la.appendChild(ja);aa.appendChild(la);var qa=!1,va=!1,ya=0,ra=0;mxEvent.addListener(sa,"mousedown",function(ca){qa=!0;ya=ca.clientX;ra=t;ca.preventDefault();ca.stopPropagation()});mxEvent.addListener(ja,"mousedown",function(ca){va=!0;ya=ca.clientY;ra=z;ca.preventDefault();+ca.stopPropagation()});mxEvent.addListener(ta,"mousedown",function(ca){if(ca.target===ta){var da=ta.getBoundingClientRect().width,wa=ca.clientX-ta.getBoundingClientRect().left,ka=1200-L;0<ka&&(t=-400+wa/da*ka,p());ca.preventDefault();ca.stopPropagation()}});mxEvent.addListener(la,"mousedown",function(ca){if(ca.target===la){var da=la.getBoundingClientRect().height,wa=ca.clientY-la.getBoundingClientRect().top,ka=1200-K;0<ka&&(z=-400+wa/da*ka,p());ca.preventDefault();ca.stopPropagation()}});var ha=function(ca){if(qa){var da=+aa.getBoundingClientRect().width-12,wa=parseFloat(sa.style.width)||20,ka=1200-L;da>wa&&0<ka&&(t=ra+(ca.clientX-ya)/(da-wa)*ka,p());ca.preventDefault()}va&&(da=aa.getBoundingClientRect().height-12,wa=parseFloat(ja.style.height)||20,ka=1200-K,da>wa&&0<ka&&(z=ra+(ca.clientY-ya)/(da-wa)*ka,p()),ca.preventDefault())},Da=function(ca){va=qa=!1};mxEvent.addListener(document,"mousemove",ha);mxEvent.addListener(document,"mouseup",Da);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var ca=+fa.getBoundingClientRect();if(0<ca.width&&0<ca.height){var da=t+L/2,wa=z+K/2;L=ca.width*M;K=ca.height*M;t=da-L/2;z=wa-K/2;p()}})).observe(aa);var oa=document.createElement("div");oa.style.width="200px";oa.style.flexShrink="0";oa.style.overflowY="auto";oa.style.border="1px solid";oa.style.borderColor="inherit";oa.style.borderRadius="4px";oa.style.padding="4px";S.appendChild(oa);mxEvent.addGestureListeners(fa,function(ca){if(!Q&&1!==ca.button&&2!==ca.button){var da=A(ca);if(null!=da)N=da.index,J=da.type,+T=!0,V=!1,v=da.index;else{da=u(ca);I();if(2>n.length)n.push({x:da.x,y:da.y,type:"L"}),v=n.length-1;else{for(var wa=Infinity,ka=n.length-1,Aa=x?n.length:n.length-1,za=0;za<Aa;za++){var Ga=(za+1)%n.length;Ga=mxUtils.ptSegDistSq(n[za].x,n[za].y,n[Ga].x,n[Ga].y,da.x,da.y);Ga<wa&&(wa=Ga,ka=za)}n.splice(ka+1,0,{x:da.x,y:da.y,type:"L"});v=ka+1}N=v;J="vertex";V=T=!0}c();mxEvent.consume(ca)}},function(ca){if(T&&0<=N){V||(I(),V=!0);var da=u(ca);"control"===J?(n[N].cx=da.x,n[N].cy=da.y):(n[N].x=da.x,n[N].y=+da.y);c();mxEvent.consume(ca)}},function(ca){!Q&&1!==ca.button&&2!==ca.button&&T&&0<=N&&(T=!1,N=-1,J=null,mxEvent.consume(ca))});mxEvent.addListener(fa,"wheel",function(ca){ca.preventDefault();var da=fa.getBoundingClientRect(),wa=(ca.clientX-da.left)/da.width,ka=(ca.clientY-da.top)/da.height,Aa=t+wa*L,za=z+ka*K;M=Math.max(.05,Math.min(5,M*(0<ca.deltaY?1.15:1/1.15)));L=da.width*M;K=da.height*M;t=Aa-wa*L;z=za-ka*K;p()});mxEvent.addListener(fa,"contextmenu",function(ca){ca.preventDefault()});mxEvent.addListener(fa,+"mousedown",function(ca){if(1===ca.button||2===ca.button||0===ca.button&&Q)m=!0,y=ca.clientX,E=ca.clientY,P=t,O=z,fa.style.cursor="grabbing",ca.preventDefault()});var ba=function(ca){if(m){var da=fa.getBoundingClientRect();t=P-(ca.clientX-y)/da.width*L;z=O-(ca.clientY-E)/da.height*K;p();ca.preventDefault()}},pa=function(ca){m&&(m=!1,fa.style.cursor=Q?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",ba);mxEvent.addListener(document,"mouseup",pa);S=document.createElement("div");S.style.display=+"flex";S.style.alignItems="center";S.style.gap="6px";S.style.position="absolute";S.style.left="0px";S.style.right="0px";S.style.bottom="0px";S.style.height="34px";var Ba=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),function(){H()});S.appendChild(Ba);var xa=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){F()});S.appendChild(xa);W=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){d(M/1.15)});S.appendChild(W);W=b.createToolbarButton(Editor.zoomOutImage,+mxResources.get("zoomOut"),function(){d(1.15*M)});S.appendChild(W);W=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var ca=fa.getBoundingClientRect();if(0<ca.width&&0<ca.height){if(1==M)if(0<n.length){for(var da=n[0].x,wa=n[0].y,ka=n[0].x,Aa=n[0].y,za=1;za<n.length;za++)da=Math.min(da,n[za].x),wa=Math.min(wa,n[za].y),ka=Math.max(ka,n[za].x),Aa=Math.max(Aa,n[za].y),"Q"===n[za].type&&(da=Math.min(da,n[za].cx),wa=Math.min(wa,n[za].cy),ka=Math.max(ka,n[za].cx),Aa=Math.max(Aa,+n[za].cy));ka=ka-da+40;Aa=Aa-wa+40;M=1/Math.min(ca.width/ka,ca.height/Aa);L=ca.width*M;K=ca.height*M;t=da-20+(ka-L)/2;z=wa-20+(Aa-K)/2}else M=1,L=ca.width,K=ca.height,t=(400-L)/2,z=(400-K)/2;else M=1,L=ca.width*M,K=ca.height*M,t=(400-L)/2,z=(400-K)/2;p()}});S.appendChild(W);W=mxUtils.button(mxResources.get("deleteAll"),function(){0<n.length&&(I(),n=[],v=-1,c())});W.className="geBtn";W.style.padding="2px 10px";W.style.fontSize="12px";S.appendChild(W);W=document.createElement("span");W.style.flexGrow=+"1";S.appendChild(W);W=document.createElement("label");W.style.display="flex";W.style.alignItems="center";W.style.gap="4px";W.style.fontSize="12px";W.style.cursor="pointer";W.style.whiteSpace="nowrap";Y=document.createElement("input");Y.type="checkbox";Y.checked=B;mxEvent.addListener(Y,"change",function(){B=this.checked;ia.style.display=B?"":"none"});W.appendChild(Y);mxUtils.write(W,mxResources.get("grid"));S.appendChild(W);W=document.createElement("label");W.style.display="flex";W.style.alignItems=+"center";W.style.gap="4px";W.style.fontSize="12px";W.style.cursor="pointer";W.style.whiteSpace="nowrap";Y=document.createElement("input");Y.type="checkbox";Y.checked=x;mxEvent.addListener(Y,"change",function(){x=this.checked;c()});W.appendChild(Y);mxUtils.write(W,mxResources.get("closePath"));S.appendChild(W);W=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});W.className="geBtn";Y=mxUtils.button(mxResources.get("apply"),function(){if(2>n.length)b.showError(mxResources.get("error"),+mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var ca=n[0].x,da=n[0].x,wa=n[0].y,ka=n[0].y,Aa=0;Aa<n.length;Aa++)ca=Math.min(ca,n[Aa].x),da=Math.max(da,n[Aa].x),wa=Math.min(wa,n[Aa].y),ka=Math.max(ka,n[Aa].y),"Q"===n[Aa].type&&(ca=Math.min(ca,n[Aa].cx),da=Math.max(da,n[Aa].cx),wa=Math.min(wa,n[Aa].cy),ka=Math.max(ka,n[Aa].cy));var za=da-ca,Ga=ka-wa,Ka=function(Pa){return 0<za?Math.round((Pa-ca)/za*100)/100:.5},Wa=function(Pa){return 0<Ga?Math.round((Pa-wa)/Ga*100)/100:.5};da=[];ka=+[];for(Aa=0;Aa<n.length;Aa++)da.push([Ka(n[Aa].x),Wa(n[Aa].y)]),0<Aa&&("Q"===n[Aa].type?ka.push(["Q",Ka(n[Aa].cx),Wa(n[Aa].cy)]):ka.push([]));x&&2<n.length&&"Q"===n[0].type&&ka.push(["Q",Ka(n[0].cx),Wa(n[0].cy)]);if(null!=k)Aa="shape=mxgraph.basic.polygon;polyCoords="+JSON.stringify(da)+";polyCurves="+JSON.stringify(ka)+";polyline="+(x?"0":"1")+";whiteSpace=wrap;html=1;",k(Aa);else{Aa=l.getCellGeometry(f);null!=Aa&&(Aa=Aa.clone(),0<za&&(Aa.x+=ca/400*Aa.width,Aa.width*=za/400),0<Ga&&(Aa.y+=wa/400*+Aa.height,Aa.height*=Ga/400));l.getModel().beginUpdate();try{null!=Aa&&l.getModel().setGeometry(f,Aa),l.setCellStyles("polyCoords",JSON.stringify(da),[f]),l.setCellStyles("polyCurves",JSON.stringify(ka),[f]),l.setCellStyles("polyline",x?"0":"1",[f])}finally{l.getModel().endUpdate()}}b.hideDialog()}});Y.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(S.appendChild(W),S.appendChild(Y)):(S.appendChild(Y),S.appendChild(W));Z.appendChild(S);mxEvent.addListener(Z,"keydown",function(ca){32===ca.keyCode?+(Q||(Q=!0,fa.style.cursor="grab"),mxEvent.consume(ca)):46===ca.keyCode||8===ca.keyCode?0<=v&&v<n.length&&"INPUT"!==ca.target.tagName&&(I(),n.splice(v,1),v>=n.length&&(v=n.length-1),c(),mxEvent.consume(ca)):90===ca.keyCode&&(ca.ctrlKey||ca.metaKey)?(ca.shiftKey?F():H(),mxEvent.consume(ca)):89===ca.keyCode&&(ca.ctrlKey||ca.metaKey)&&(F(),mxEvent.consume(ca))});mxEvent.addListener(Z,"keyup",function(ca){32===ca.keyCode&&(Q=!1,m||(fa.style.cursor="crosshair"))});c();D();this.init=function(){Z.focus();+var ca=fa.getBoundingClientRect();0<ca.width&&0<ca.height&&(M=1,L=ca.width*M,K=ca.height*M,t=(400-L)/2,z=(400-K)/2,p())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",ha);mxEvent.removeListener(document,"mouseup",Da);mxEvent.removeListener(document,"mousemove",ba);mxEvent.removeListener(document,"mouseup",pa)};this.container=Z};(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.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";Editor.thinShapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI5Ljc1IDI5Ljc1Wm0tMTMgNS40NXEuNC4wNS43NS4wNUgxOS4wNXY0LjY1cTAgLjI1LjE3NS40MjV0LjQyNS4xNzVIMzkuOXEuMjUgMCAuNDI1LS4xNzV0LjE3NS0uNDI1VjE5LjY1cTAtLjI1LS4xNzUtLjQyNXQtLjQyNS0uMTc1aC00LjY1VjE3LjVxMC0uMzUtLjA1LS43NWg0LjdxMS4xNSAwIDIgLjg3NS44NS44NzUuODUgMi4wMjVWMzkuOXEwIDEuMTUtLjg1IDItLjg1Ljg1LTIgLjg1SDE5LjY1cS0xLjE1IDAtMi4wMjUtLjg1dC0uODc1LTJabTEuNS0zLjk1cS01LjQ1IDAtOS4yMjUtMy44LTMuNzc1LTMuOC0zLjc3NS05LjIgMC01LjQ1IDMuNzc1LTkuMjI1UTEyLjggNS4yNSAxOC4yNSA1LjI1cTUuNCAwIDkuMiAzLjc3NSAzLjggMy43NzUgMy44IDkuMjI1IDAgNS40LTMuOCA5LjItMy44IDMuOC05LjIgMy44Wm0tLjA1LTIuM3E0LjQ1IDAgNy42LTMuMTI1IDMuMTUtMy4xMjUgMy4xNS03LjU3NXQtMy4xMjUtNy42UTIyLjcgNy41IDE4LjI1IDcuNXQtNy42IDMuMTI1UTcuNSAxMy43NSA3LjUgMTguMnQzLjEyNSA3LjZxMy4xMjUgMy4xNSA3LjU3NSAzLjE1Wm0uMDUtMTAuN1oiLz48L3N2Zz4=";@@ -12877,7 +12882,7 @@ update:"You are a helpful assistant that helps with the following draw.io diagraendpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",messages:[{role:"assistant",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.6 Opus",model:"claude-opus-4-6",config:"claude"},{name:"Claude 4.6 Sonnet",model:"claude-sonnet-4-6",config:"claude"},{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(m,y){return{name:y,dispName:m,-type:"bool",defVal:!1,isVisible:function(F,N){return 1==F.vertices.length?(N=N.editorUi.editor.graph.model,F=N.getParent(F.vertices[0]),N.isEdge(F)||N.isVertex(F)):!1},getValue:function(F,N){return"inherit"==mxUtils.getValue(F.style,y)},valueChanged:function(F,N,O,P){N=P.editorUi.editor.graph;"1"==F?N.setCellStyles(y,"inherit",O.vertices):N.setCellStyles(y,null,O.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(m){m.refresh()}},{name:"enumerateValue",+type:"bool",defVal:!1,isVisible:function(E,P){return 1==E.vertices.length?(P=P.editorUi.editor.graph.model,E=P.getParent(E.vertices[0]),P.isEdge(E)||P.isVertex(E)):!1},getValue:function(E,P){return"inherit"==mxUtils.getValue(E.style,y)},valueChanged:function(E,P,O,Q){P=Q.editorUi.editor.graph;"1"==E?P.setCellStyles(y,"inherit",O.vertices):P.setCellStyles(y,null,O.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(m){m.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(m,y){return"1"==mxUtils.getValue(m.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(m,y){return"1"!=mxUtils.getValue(m.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(m,y){return"1"==mxUtils.getValue(m.style,"comic","0")||"1"==mxUtils.getValue(m.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(m,y){return"1"==mxUtils.getValue(m.style,"sketch","1"==urlParams.rough?"1":"0")&&0<m.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(m,y){return"1"==mxUtils.getValue(m.style,"sketch","1"==urlParams.rough?"1":"0")&&0<m.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(m,y){return"1"==mxUtils.getValue(m.style,"sketch","1"==urlParams.rough?"1":"0")&&0<m.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(m,y){return"1"==mxUtils.getValue(m.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(m,y){return"1"==mxUtils.getValue(m.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(m,y){return"1"==mxUtils.getValue(m.style,"sketch",@@ -12901,127 +12906,128 @@ 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(m,y){return y.editorUi.editor.graph.isCellConnectable(0<m.vertices.length&&0==m.edges.length?m.vertices[0]:null)},isVisible:function(m,y){return 0<m.vertices.length&&0==m.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(m,y){m=0<m.vertices.length&&0==m.edges.length?m.vertices[0]:null;y=y.editorUi.editor.graph;return null!=m&&y.isSwimlane(m)},isVisible:function(m,y){return 0<m.vertices.length&&0==-m.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(m,y){m=1==m.vertices.length&&0==m.edges.length?m.vertices[0]:null;y=y.editorUi.editor.graph;return null!=m&&(y.isSwimlane(m)||0<y.model.getChildCount(m))},isVisible:function(m,y){return 1==m.vertices.length&&0==m.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(m,y){var F=1==m.vertices.length&&0==m.edges.length?m.vertices[0]:null;y=y.editorUi.editor.graph;return null!=-F&&(y.isContainer(F)&&"0"!=m.style.collapsible||!y.isContainer(F)&&"1"==m.style.collapsible)},isVisible:function(m,y){return 1==m.vertices.length&&0==m.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(m,y){return 1==m.vertices.length&&0==m.edges.length&&!y.editorUi.editor.graph.isSwimlane(m.vertices[0])&&null==mxUtils.getValue(m.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",+m.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(m,y){m=1==m.vertices.length&&0==m.edges.length?m.vertices[0]:null;y=y.editorUi.editor.graph;return null!=m&&(y.isSwimlane(m)||0<y.model.getChildCount(m))},isVisible:function(m,y){return 1==m.vertices.length&&0==m.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(m,y){var E=1==m.vertices.length&&0==m.edges.length?m.vertices[0]:null;y=y.editorUi.editor.graph;return null!=+E&&(y.isContainer(E)&&"0"!=m.style.collapsible||!y.isContainer(E)&&"1"==m.style.collapsible)},isVisible:function(m,y){return 1==m.vertices.length&&0==m.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(m,y){return 1==m.vertices.length&&0==m.edges.length&&!y.editorUi.editor.graph.isSwimlane(m.vertices[0])&&null==mxUtils.getValue(m.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(m,y){y=y.editorUi.editor.graph.model;return 0<m.vertices.length?y.isVertex(y.getParent(m.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(m,y){m=0<m.vertices.length?y.editorUi.editor.graph.getCellGeometry(m.vertices[0]):null;return null!=m&&!m.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(m,y){return 0<m.vertices.length&&y.editorUi.editor.graph.isAutoSizeCell(m.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(m,y){var F=mxUtils.getValue(m.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||y.editorUi.editor.graph.isSwimlane(m.vertices[0])||null==F||F==mxConstants.NONE||0==mxUtils.getValue(m.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(m.style,mxConstants.STYLE_OPACITY,100)||null!=m.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",+type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(m,y){var E=mxUtils.getValue(m.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||y.editorUi.editor.graph.isSwimlane(m.vertices[0])||null==E||E==mxConstants.NONE||0==mxUtils.getValue(m.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(m.style,mxConstants.STYLE_OPACITY,100)||null!=m.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(m,y){return 0<m.vertices.length&&y.editorUi.editor.graph.isContainer(m.vertices[0])}},{name:"expandToFront",dispName:"Expand to Front",type:"bool",defVal:!1,isVisible:function(m,y){return 0<m.vertices.length&&y.editorUi.editor.graph.isContainer(m.vertices[0])}},Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].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://app.diagrams.net,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://app.diagrams.net,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://app.diagrams.net,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://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.canvasSupported=!1;(function(){try{var m=document.createElement("canvas");Editor.canvasSupported=!(!m.getContext||!m.getContext("2d"))}catch(y){}})();Editor.useCanvasForExport=!1;(function(){try{var m=document.createElement("canvas"),y=new Image;y.onload=function(){try{m.getContext("2d").drawImage(y,0,0);var F=m.toDataURL("image/png");Editor.useCanvasForExport=null!=F&&6<F.length}catch(N){}};y.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(F){}})();-Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var m=document.createElement("canvas");m.width=m.height=1;var y=m.toDataURL("image/jpeg");Editor.jpgSupported=null!==y.match("image/jpeg");y=m.toDataURL("image/webp");Editor.webpSupported=null!==y.match("image/webp")}catch(F){}})();Editor.loadCompatibleCss=function(m){mxUtils.lightDarkColorSupported||mxUtils.get(m||"styles/grapheditor.css",mxUtils.bind(this,function(y){if(200<=y.getStatus()&&299>=y.getStatus()){var F=document.createElement("style");-F.type="text/css";var N=F.appendChild,O=document,P=O.createTextNode;y=y.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(y=y.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(T){}N.call(F,P.call(O,y));document.head.appendChild(F)}}))};Editor.replacePlaceholders=function(m,-y){var F=[];if(null!=m&&null!=y){for(var N=RegExp("{([^{}\"'=;]+)}","g"),O,P=0;O=N.exec(m);){var T=O[0];if(2<T.length){var Q=y(T.substring(1,T.length-1)),R=T;null!=Q&&(R=Q);F.push(m.substring(P,O.index)+R);P=O.index+T.length}}F.push(m.substring(P))}return F.join("")};Editor.executeSimpleJsonPath=function(m,y){y=y.replace(/^\$\.?/,"").split(".");y=$jscomp.makeIterator(y);for(var F=y.next();!F.done;F=y.next()){var N=F.value;if(!m)return[];if(F=N.match(/([^\[]+)\[(\d+)\]/))if(N=F[1],F=parseInt(F[2]),-m=m[N],Array.isArray(m)&&F<m.length)m=m[F];else return[];else m=m[N]}return void 0!==m?[m]:[]};Editor.createRoughCanvas=function(m){var y=rough.canvas({getContext:function(){return m}});y.draw=function(F){var N=F.sets||[];F=F.options||this.getDefaultOptions();for(var O=0;O<N.length;O++){var P=N[O];switch(P.type){case "path":null!=F.stroke&&this._drawToContext(m,P,F);break;case "fillPath":this._drawToContext(m,P,F);break;case "fillSketch":this.fillSketch(m,P,F)}}};y.fillSketch=function(F,N,O){var P=-m.state.strokeColor,T=m.state.strokeWidth,Q=m.state.strokeAlpha,R=m.state.dashed,W=O.fillWeight;0>W&&(W=O.strokeWidth/2);m.setStrokeAlpha(m.state.fillAlpha);m.setStrokeColor(O.fill||"");m.setStrokeWidth(W);m.setDashed(!1);this._drawToContext(F,N,O);m.setDashed(R);m.setStrokeWidth(T);m.setStrokeColor(P);m.setStrokeAlpha(Q)};y._drawToContext=function(F,N,O){F.begin();for(var P=0;P<N.ops.length;P++){var T=N.ops[P],Q=T.data;switch(T.op){case "move":F.moveTo(Q[0],Q[1]);break;case "bcurveTo":F.curveTo(Q[0],-Q[1],Q[2],Q[3],Q[4],Q[5]);break;case "lineTo":F.lineTo(Q[0],Q[1])}}F.end();"fillPath"===N.type&&O.filled?F.fill():F.stroke()};return y};(function(){function m(P,T,Q){this.canvas=P;this.rc=T;this.shape=Q;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,m.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,m.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,+Editor.canvasSupported=!1;(function(){try{var m=document.createElement("canvas");Editor.canvasSupported=!(!m.getContext||!m.getContext("2d"))}catch(y){}})();Editor.useCanvasForExport=!1;(function(){try{var m=document.createElement("canvas"),y=new Image;y.onload=function(){try{m.getContext("2d").drawImage(y,0,0);var E=m.toDataURL("image/png");Editor.useCanvasForExport=null!=E&&6<E.length}catch(P){}};y.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(E){}})();+Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var m=document.createElement("canvas");m.width=m.height=1;var y=m.toDataURL("image/jpeg");Editor.jpgSupported=null!==y.match("image/jpeg");y=m.toDataURL("image/webp");Editor.webpSupported=null!==y.match("image/webp")}catch(E){}})();Editor.loadCompatibleCss=function(m){mxUtils.lightDarkColorSupported||mxUtils.get(m||"styles/grapheditor.css",mxUtils.bind(this,function(y){if(200<=y.getStatus()&&299>=y.getStatus()){var E=document.createElement("style");+E.type="text/css";var P=E.appendChild,O=document,Q=O.createTextNode;y=y.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(y=y.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(U){}P.call(E,Q.call(O,y));document.head.appendChild(E)}}))};Editor.replacePlaceholders=function(m,+y){var E=[];if(null!=m&&null!=y){for(var P=RegExp("{([^{}\"'=;]+)}","g"),O,Q=0;O=P.exec(m);){var U=O[0];if(2<U.length){var R=y(U.substring(1,U.length-1)),S=U;null!=R&&(S=R);E.push(m.substring(Q,O.index)+S);Q=O.index+U.length}}E.push(m.substring(Q))}return E.join("")};Editor.executeSimpleJsonPath=function(m,y){y=y.replace(/^\$\.?/,"").split(".");y=$jscomp.makeIterator(y);for(var E=y.next();!E.done;E=y.next()){var P=E.value;if(!m)return[];if(E=P.match(/([^\[]+)\[(\d+)\]/))if(P=E[1],E=parseInt(E[2]),+m=m[P],Array.isArray(m)&&E<m.length)m=m[E];else return[];else m=m[P]}return void 0!==m?[m]:[]};Editor.createRoughCanvas=function(m){var y=rough.canvas({getContext:function(){return m}});y.draw=function(E){var P=E.sets||[];E=E.options||this.getDefaultOptions();for(var O=0;O<P.length;O++){var Q=P[O];switch(Q.type){case "path":null!=E.stroke&&this._drawToContext(m,Q,E);break;case "fillPath":this._drawToContext(m,Q,E);break;case "fillSketch":this.fillSketch(m,Q,E)}}};y.fillSketch=function(E,P,O){var Q=+m.state.strokeColor,U=m.state.strokeWidth,R=m.state.strokeAlpha,S=m.state.dashed,W=O.fillWeight;0>W&&(W=O.strokeWidth/2);m.setStrokeAlpha(m.state.fillAlpha);m.setStrokeColor(O.fill||"");m.setStrokeWidth(W);m.setDashed(!1);this._drawToContext(E,P,O);m.setDashed(S);m.setStrokeWidth(U);m.setStrokeColor(Q);m.setStrokeAlpha(R)};y._drawToContext=function(E,P,O){E.begin();for(var Q=0;Q<P.ops.length;Q++){var U=P.ops[Q],R=U.data;switch(U.op){case "move":E.moveTo(R[0],R[1]);break;case "bcurveTo":E.curveTo(R[0],+R[1],R[2],R[3],R[4],R[5]);break;case "lineTo":E.lineTo(R[0],R[1])}}E.end();"fillPath"===P.type&&O.filled?E.fill():E.stroke()};return y};(function(){function m(Q,U,R){this.canvas=Q;this.rc=U;this.shape=R;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,m.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,m.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,m.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,m.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,m.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,m.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,m.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,m.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,m.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,m.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,m.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,m.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,m.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;-this.canvas.fillAndStroke=mxUtils.bind(this,m.prototype.fillAndStroke);this.path=[];this.passThrough=!1}m.prototype.moveOp="M";m.prototype.lineOp="L";m.prototype.quadOp="Q";m.prototype.curveOp="C";m.prototype.closeOp="Z";m.prototype.getStyle=function(P,T){var Q=1;if(null!=this.shape.state){var R=this.shape.state.cell.id;if(null!=R)for(var W=0;W<R.length;W++)Q=(Q<<5)-Q+R.charCodeAt(W)<<0}Q={strokeWidth:this.canvas.state.strokeWidth,seed:Q,preserveVertices:!0};R=this.rc.getDefaultOptions();Q.stroke=-P?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;P=null;(Q.filled=T)?(Q.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,P=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):Q.fill="";Q.bowing=mxUtils.getValue(this.shape.style,"bowing",R.bowing);Q.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",R.hachureAngle);Q.curveFitting=mxUtils.getValue(this.shape.style,-"curveFitting",R.curveFitting);Q.roughness=mxUtils.getValue(this.shape.style,"jiggle",R.roughness);Q.simplification=mxUtils.getValue(this.shape.style,"simplification",R.simplification);Q.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",R.disableMultiStroke);Q.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",R.disableMultiStrokeFill);T=mxUtils.getValue(this.shape.style,"hachureGap",-1);Q.hachureGap="auto"==T?-1:T;Q.dashGap=mxUtils.getValue(this.shape.style,-"dashGap",T);Q.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",T);Q.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",T);T=mxUtils.getValue(this.shape.style,"fillWeight",-1);Q.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!=Q.fill&&(null!=P||0<=mxUtils.indexOf(T,mxUtils.hex2rgb(Q.fill)))?"solid":R.fillStyle);Q.fillStyle=T;return Q};m.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};m.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};m.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var P=2;P<arguments.length;P+=2)this.lastX=arguments[P-1],this.lastY=arguments[P],-this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};m.prototype.lineTo=function(P,T){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,P,T),this.lastX=P,this.lastY=T)};m.prototype.moveTo=function(P,T){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,P,T),this.lastX=P,this.lastY=T,this.firstX=P,this.firstY=T)};m.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,-arguments):this.addOp(this.closeOp)};m.prototype.quadTo=function(P,T,Q,R){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,P,T,Q,R),this.lastX=Q,this.lastY=R)};m.prototype.curveTo=function(P,T,Q,R,W,X){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,P,T,Q,R,W,X),this.lastX=W,this.lastY=X)};m.prototype.arcTo=function(P,T,Q,R,W,X,Y){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var Z=mxUtils.arcToCurves(this.lastX,-this.lastY,P,T,Q,R,W,X,Y);if(null!=Z)for(var ba=0;ba<Z.length;ba+=6)this.curveTo(Z[ba],Z[ba+1],Z[ba+2],Z[ba+3],Z[ba+4],Z[ba+5]);this.lastX=X;this.lastY=Y}};m.prototype.rect=function(P,T,Q,R){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(P,T,Q,R,this.getStyle(!0,!0)))};m.prototype.ellipse=function(P,T,Q,R){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(P+-Q/2,T+R/2,Q,R,this.getStyle(!0,!0)))};m.prototype.roundrect=function(P,T,Q,R,W,X){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(P+W,T),this.lineTo(P+Q-W,T),this.quadTo(P+Q,T,P+Q,T+X),this.lineTo(P+Q,T+R-X),this.quadTo(P+Q,T+R,P+Q-W,T+R),this.lineTo(P+W,T+R),this.quadTo(P,T+R,P,T+R-X),this.lineTo(P,T+X),this.quadTo(P,T,P+W,T))};m.prototype.drawPath=function(P){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),P)}catch(Q){}this.passThrough=-!1}else if(null!=this.nextShape){for(var T in P)this.nextShape.options[T]=P[T];P.stroke!=mxConstants.NONE&&null!=P.stroke||delete this.nextShape.options.stroke;P.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};m.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};m.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):+this.canvas.fillAndStroke=mxUtils.bind(this,m.prototype.fillAndStroke);this.path=[];this.passThrough=!1}m.prototype.moveOp="M";m.prototype.lineOp="L";m.prototype.quadOp="Q";m.prototype.curveOp="C";m.prototype.closeOp="Z";m.prototype.getStyle=function(Q,U){var R=1;if(null!=this.shape.state){var S=this.shape.state.cell.id;if(null!=S)for(var W=0;W<S.length;W++)R=(R<<5)-R+S.charCodeAt(W)<<0}R={strokeWidth:this.canvas.state.strokeWidth,seed:R,preserveVertices:!0};S=this.rc.getDefaultOptions();R.stroke=+Q?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;Q=null;(R.filled=U)?(R.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,Q=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):R.fill="";R.bowing=mxUtils.getValue(this.shape.style,"bowing",S.bowing);R.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",S.hachureAngle);R.curveFitting=mxUtils.getValue(this.shape.style,+"curveFitting",S.curveFitting);R.roughness=mxUtils.getValue(this.shape.style,"jiggle",S.roughness);R.simplification=mxUtils.getValue(this.shape.style,"simplification",S.simplification);R.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",S.disableMultiStroke);R.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",S.disableMultiStrokeFill);U=mxUtils.getValue(this.shape.style,"hachureGap",-1);R.hachureGap="auto"==U?-1:U;R.dashGap=mxUtils.getValue(this.shape.style,+"dashGap",U);R.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",U);R.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",U);U=mxUtils.getValue(this.shape.style,"fillWeight",-1);R.fillWeight="auto"==U?-1:U;U=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==U&&(U="auto");"auto"==U&&(U=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&U.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&U.push(mxUtils.hex2rgb(Editor.darkColor)),+U=null!=R.fill&&(null!=Q||0<=mxUtils.indexOf(U,mxUtils.hex2rgb(R.fill)))?"solid":S.fillStyle);R.fillStyle=U;return R};m.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};m.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};m.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var Q=2;Q<arguments.length;Q+=2)this.lastX=arguments[Q-1],this.lastY=arguments[Q],+this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};m.prototype.lineTo=function(Q,U){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,Q,U),this.lastX=Q,this.lastY=U)};m.prototype.moveTo=function(Q,U){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,Q,U),this.lastX=Q,this.lastY=U,this.firstX=Q,this.firstY=U)};m.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,+arguments):this.addOp(this.closeOp)};m.prototype.quadTo=function(Q,U,R,S){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,Q,U,R,S),this.lastX=R,this.lastY=S)};m.prototype.curveTo=function(Q,U,R,S,W,X){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,Q,U,R,S,W,X),this.lastX=W,this.lastY=X)};m.prototype.arcTo=function(Q,U,R,S,W,X,Y){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var Z=mxUtils.arcToCurves(this.lastX,+this.lastY,Q,U,R,S,W,X,Y);if(null!=Z)for(var aa=0;aa<Z.length;aa+=6)this.curveTo(Z[aa],Z[aa+1],Z[aa+2],Z[aa+3],Z[aa+4],Z[aa+5]);this.lastX=X;this.lastY=Y}};m.prototype.rect=function(Q,U,R,S){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(Q,U,R,S,this.getStyle(!0,!0)))};m.prototype.ellipse=function(Q,U,R,S){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(Q++R/2,U+S/2,R,S,this.getStyle(!0,!0)))};m.prototype.roundrect=function(Q,U,R,S,W,X){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(Q+W,U),this.lineTo(Q+R-W,U),this.quadTo(Q+R,U,Q+R,U+X),this.lineTo(Q+R,U+S-X),this.quadTo(Q+R,U+S,Q+R-W,U+S),this.lineTo(Q+W,U+S),this.quadTo(Q,U+S,Q,U+S-X),this.lineTo(Q,U+X),this.quadTo(Q,U,Q+W,U))};m.prototype.drawPath=function(Q){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),Q)}catch(R){}this.passThrough=+!1}else if(null!=this.nextShape){for(var U in Q)this.nextShape.options[U]=Q[U];Q.stroke!=mxConstants.NONE&&null!=Q.stroke||delete this.nextShape.options.stroke;Q.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};m.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};m.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};m.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};m.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(P){return new m(P,Editor.createRoughCanvas(P),this)};var y=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(P){return this.outline||-null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?y.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(P):this.createRoughCanvas(P)};var F=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(P,T,Q,R,W){null!=P.handJiggle&&P.handJiggle.passThrough||F.apply(this,arguments)};var N=mxShape.prototype.paint;mxShape.prototype.paint=function(P){var T=P.addTolerance,Q=!0;null!=this.style&&(Q="1"==mxUtils.getValue(this.style,-mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=P.handJiggle&&P.handJiggle.constructor==m&&!this.outline){P.save();var R=this.fill,W=this.stroke;this.stroke=this.fill=null;var X=this.configurePointerEvents,Y=P.setStrokeColor;P.setStrokeColor=function(){};var Z=P.setFillColor;P.setFillColor=function(){};Q||null==R||(this.configurePointerEvents=function(){});P.handJiggle.passThrough=!0;N.apply(this,arguments);P.handJiggle.passThrough=!1;P.setFillColor=Z;P.setStrokeColor=Y;this.configurePointerEvents=-X;this.stroke=W;this.fill=R;P.restore();Q&&null!=R&&(P.addTolerance=function(){})}N.apply(this,arguments);P.addTolerance=T};var O=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(P,T,Q,R,W,X){null!=P.handJiggle&&P.handJiggle.constructor==m?(P.handJiggle.passThrough=!0,O.apply(this,arguments),P.handJiggle.passThrough=!1):O.apply(this,arguments)}})();Editor.fastCompress=function(m){return null==m||0==m.length||"undefined"===typeof pako?m:Graph.arrayBufferToString(pako.deflateRaw(m))};-Editor.fastDecompress=function(m){return null==m||0==m.length||"undefined"===typeof pako?m:pako.inflateRaw(Graph.stringToArrayBuffer(atob(m)),{to:"string"})};Editor.extractGraphModel=function(m,y,F){if(null!=m&&"undefined"!==typeof pako){var N=m.ownerDocument.getElementsByTagName("div"),O=[];if(null!=N&&0<N.length)for(var P=0;P<N.length;P++)if("mxgraph"==N[P].getAttribute("class")){O.push(N[P]);break}0<O.length&&(N=O[0].getAttribute("data-mxgraph"),null!=N?(O=JSON.parse(N),null!=O&&null!=O.xml&&(m=-mxUtils.parseXml(O.xml),m=m.documentElement)):(O=O[0].getElementsByTagName("div"),0<O.length&&(N=mxUtils.getTextContent(O[0]),N=Graph.decompress(N,null,F),0<N.length&&(m=mxUtils.parseXml(N),m=m.documentElement))))}if(null!=m&&"svg"==m.nodeName)if(N=m.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)m=mxUtils.parseXml(N).documentElement;else throw{message:mxResources.get("notADiagramFile")};-null==m||y||(O=null,"diagram"==m.nodeName?O=m:"mxfile"==m.nodeName&&(N=m.getElementsByTagName("diagram"),0<N.length&&(O=N[Math.max(0,Math.min(N.length-1,urlParams.page||0))])),null!=O&&(m=Editor.parseDiagramNode(O,F)));null==m||"mxGraphModel"==m.nodeName||y&&"mxfile"==m.nodeName||(m=null);return m};Editor.parseDiagramNode=function(m,y,F){Editor.validateDiagramNode(m);var N=mxUtils.trim(mxUtils.getTextContent(m)),O=null;0<N.length?(y=Graph.decompress(N,null,y),null!=y&&0<y.length&&(O=mxUtils.parseXml(y).documentElement)):-(m=mxUtils.getChildNodes(m),0<m.length&&(O=m[0],F&&(O=Editor.parseDiagramNode(O,y,!1)),y=mxUtils.createXmlDocument(),y.appendChild(y.importNode(O,!0)),O=y.documentElement));return O};Editor.getDiagramNodeXml=function(m){Editor.validateDiagramNode(m);var y=mxUtils.getNodeValue(m),F=null;0<y.length?F=Graph.decompress(y):(m=m.getElementsByTagName("mxGraphModel"),null!=m&&0<m.length&&(F=mxUtils.getXml(m[0])));return F};Editor.validateDiagramNode=function(m){if(0==mxUtils.trim(mxUtils.getTextContent(m)).length&&-0==mxUtils.getChildNodes(m).length){var y=new mxCodec,F=new mxGraphModel;m.appendChild(y.encode(F))}return m};Editor.extractGraphModelFromPdf=function(m){var y=null;m=m.substring(m.indexOf(",")+1);m=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0);if("%PDF-1.7"==m.substring(0,8)){var F=m.indexOf("EmbeddedFile");if(-1<F){var N=m.indexOf("stream",F)+9;if(0<m.substring(F,N).indexOf("application#2Fvnd.jgraph.mxfile")){var O=m.indexOf("endstream",N-1);return pako.inflateRaw(Graph.stringToArrayBuffer(m.substring(N,-O)),{to:"string"})}}for(F=m.indexOf("/ObjStm");0<F;){N=m.indexOf("stream",F)+9;O=m.indexOf("endstream",N-1);N=pako.inflateRaw(Graph.stringToArrayBuffer(m.substring(N,O)),{to:"string"});O=N.indexOf("/Subject <");if(0<O){F=N.substring(O+14,N.indexOf(">",O));if(null!=F){y=F;F=[];for(N=0;N<y.length;N+=2)O=y.substr(N,2),"00"!=O&&F.push(String.fromCharCode(parseInt(O,16)));y=F.join("")}break}F=m.indexOf("/ObjStm",F+1)}}if(null==y&&"%PDF-1.4"==m.substring(0,8)){F="";O=N=0;for(var P=[],T=null;O<m.length;){var Q=-m.charCodeAt(O);O+=1;10!=Q&&(F+=String.fromCharCode(Q));Q=="/Subject (%3Cmxfile".charCodeAt(N)?N++:N=0;if(19==N){var R=m.indexOf("%3C%2Fmxfile%3E",O)+15;O-=9;if(R>O){y=m.substring(O,R);break}}10==Q&&("endobj"==F?T=null:"obj"==F.substring(F.length-3,F.length)||"xref"==F||"trailer"==F?(T=[],P[F.split(" ")[0]]=T):null!=T&&T.push(F),F="")}}null==y&&null!=P&&(y=Editor.extractGraphModelFromXref(P));null!=y&&(y=decodeURIComponent(y.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return y};Editor.extractGraphModelFromXref=-function(m){var y=m.trailer,F=null;null!=y&&(y=/.* \/Info (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(y=m[y[1]],null!=y&&(y=/.* \/Subject (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(m=m[y[1]],null!=m&&(m=m.join("\n"),F=m.substring(1,m.length-1))))));return F};Editor.extractParserError=function(m,y){var F=null;m=null!=m?m.getElementsByTagName("parsererror"):null;null!=m&&0<m.length&&(F=y||mxResources.get("invalidChars"),y=m[0].getElementsByTagName("div"),0<y.length&&(F=mxUtils.getTextContent(y[0])));-return null!=F?mxUtils.trim(F):F};Editor.addRetryToError=function(m,y){null!=m&&(m=null!=m.error?m.error:m,null==m.retry&&(m.retry=y))};Editor.mermaidToDrawio=function(m,y,F){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(m,y,F)};Editor.configure=function(m){if(null!=m){Editor.config=m;Editor.configVersion=m.version;m.debug&&(urlParams.test="1");m.passiveScroll&&(Editor.passiveScroll=!0);m.noResizers&&(Editor.noResizers=!0);m.preserveViewState&&(Editor.preserveViewState=!0);m.useInternalClipboard&&+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(Q){return new m(Q,Editor.createRoughCanvas(Q),this)};var y=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(Q){return this.outline||+null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?y.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(Q):this.createRoughCanvas(Q)};var E=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(Q,U,R,S,W){null!=Q.handJiggle&&Q.handJiggle.passThrough||E.apply(this,arguments)};var P=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){var U=Q.addTolerance,R=!0;null!=this.style&&(R="1"==mxUtils.getValue(this.style,+mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=Q.handJiggle&&Q.handJiggle.constructor==m&&!this.outline){Q.save();var S=this.fill,W=this.stroke;this.stroke=this.fill=null;var X=this.configurePointerEvents,Y=Q.setStrokeColor;Q.setStrokeColor=function(){};var Z=Q.setFillColor;Q.setFillColor=function(){};R||null==S||(this.configurePointerEvents=function(){});Q.handJiggle.passThrough=!0;P.apply(this,arguments);Q.handJiggle.passThrough=!1;Q.setFillColor=Z;Q.setStrokeColor=Y;this.configurePointerEvents=+X;this.stroke=W;this.fill=S;Q.restore();R&&null!=S&&(Q.addTolerance=function(){})}P.apply(this,arguments);Q.addTolerance=U};var O=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(Q,U,R,S,W,X){null!=Q.handJiggle&&Q.handJiggle.constructor==m?(Q.handJiggle.passThrough=!0,O.apply(this,arguments),Q.handJiggle.passThrough=!1):O.apply(this,arguments)}})();Editor.fastCompress=function(m){return null==m||0==m.length||"undefined"===typeof pako?m:Graph.arrayBufferToString(pako.deflateRaw(m))};+Editor.fastDecompress=function(m){return null==m||0==m.length||"undefined"===typeof pako?m:pako.inflateRaw(Graph.stringToArrayBuffer(atob(m)),{to:"string"})};Editor.extractGraphModel=function(m,y,E){if(null!=m&&"undefined"!==typeof pako){var P=m.ownerDocument.getElementsByTagName("div"),O=[];if(null!=P&&0<P.length)for(var Q=0;Q<P.length;Q++)if("mxgraph"==P[Q].getAttribute("class")){O.push(P[Q]);break}0<O.length&&(P=O[0].getAttribute("data-mxgraph"),null!=P?(O=JSON.parse(P),null!=O&&null!=O.xml&&(m=+mxUtils.parseXml(O.xml),m=m.documentElement)):(O=O[0].getElementsByTagName("div"),0<O.length&&(P=mxUtils.getTextContent(O[0]),P=Graph.decompress(P,null,E),0<P.length&&(m=mxUtils.parseXml(P),m=m.documentElement))))}if(null!=m&&"svg"==m.nodeName)if(P=m.getAttribute("content"),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)m=mxUtils.parseXml(P).documentElement;else throw{message:mxResources.get("notADiagramFile")};+null==m||y||(O=null,"diagram"==m.nodeName?O=m:"mxfile"==m.nodeName&&(P=m.getElementsByTagName("diagram"),0<P.length&&(O=P[Math.max(0,Math.min(P.length-1,urlParams.page||0))])),null!=O&&(m=Editor.parseDiagramNode(O,E)));null==m||"mxGraphModel"==m.nodeName||y&&"mxfile"==m.nodeName||(m=null);return m};Editor.parseDiagramNode=function(m,y,E){Editor.validateDiagramNode(m);var P=mxUtils.trim(mxUtils.getTextContent(m)),O=null;0<P.length?(y=Graph.decompress(P,null,y),null!=y&&0<y.length&&(O=mxUtils.parseXml(y).documentElement)):+(m=mxUtils.getChildNodes(m),0<m.length&&(O=m[0],E&&(O=Editor.parseDiagramNode(O,y,!1)),y=mxUtils.createXmlDocument(),y.appendChild(y.importNode(O,!0)),O=y.documentElement));return O};Editor.getDiagramNodeXml=function(m){Editor.validateDiagramNode(m);var y=mxUtils.getNodeValue(m),E=null;0<y.length?E=Graph.decompress(y):(m=m.getElementsByTagName("mxGraphModel"),null!=m&&0<m.length&&(E=mxUtils.getXml(m[0])));return E};Editor.validateDiagramNode=function(m){if(0==mxUtils.trim(mxUtils.getTextContent(m)).length&&+0==mxUtils.getChildNodes(m).length){var y=new mxCodec,E=new mxGraphModel;m.appendChild(y.encode(E))}return m};Editor.extractGraphModelFromPdf=function(m){var y=null;m=m.substring(m.indexOf(",")+1);m=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0);if("%PDF-1.7"==m.substring(0,8)){var E=m.indexOf("EmbeddedFile");if(-1<E){var P=m.indexOf("stream",E)+9;if(0<m.substring(E,P).indexOf("application#2Fvnd.jgraph.mxfile")){var O=m.indexOf("endstream",P-1);return pako.inflateRaw(Graph.stringToArrayBuffer(m.substring(P,+O)),{to:"string"})}}for(E=m.indexOf("/ObjStm");0<E;){P=m.indexOf("stream",E)+9;O=m.indexOf("endstream",P-1);P=pako.inflateRaw(Graph.stringToArrayBuffer(m.substring(P,O)),{to:"string"});O=P.indexOf("/Subject <");if(0<O){E=P.substring(O+14,P.indexOf(">",O));if(null!=E){y=E;E=[];for(P=0;P<y.length;P+=2)O=y.substr(P,2),"00"!=O&&E.push(String.fromCharCode(parseInt(O,16)));y=E.join("")}break}E=m.indexOf("/ObjStm",E+1)}}if(null==y&&"%PDF-1.4"==m.substring(0,8)){E="";O=P=0;for(var Q=[],U=null;O<m.length;){var R=+m.charCodeAt(O);O+=1;10!=R&&(E+=String.fromCharCode(R));R=="/Subject (%3Cmxfile".charCodeAt(P)?P++:P=0;if(19==P){var S=m.indexOf("%3C%2Fmxfile%3E",O)+15;O-=9;if(S>O){y=m.substring(O,S);break}}10==R&&("endobj"==E?U=null:"obj"==E.substring(E.length-3,E.length)||"xref"==E||"trailer"==E?(U=[],Q[E.split(" ")[0]]=U):null!=U&&U.push(E),E="")}}null==y&&null!=Q&&(y=Editor.extractGraphModelFromXref(Q));null!=y&&(y=decodeURIComponent(y.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return y};Editor.extractGraphModelFromXref=+function(m){var y=m.trailer,E=null;null!=y&&(y=/.* \/Info (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(y=m[y[1]],null!=y&&(y=/.* \/Subject (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(m=m[y[1]],null!=m&&(m=m.join("\n"),E=m.substring(1,m.length-1))))));return E};Editor.extractParserError=function(m,y){var E=null;m=null!=m?m.getElementsByTagName("parsererror"):null;null!=m&&0<m.length&&(E=y||mxResources.get("invalidChars"),y=m[0].getElementsByTagName("div"),0<y.length&&(E=mxUtils.getTextContent(y[0])));+return null!=E?mxUtils.trim(E):E};Editor.addRetryToError=function(m,y){null!=m&&(m=null!=m.error?m.error:m,null==m.retry&&(m.retry=y))};Editor.mermaidToDrawio=function(m,y,E){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(m,y,E)};Editor.configure=function(m){if(null!=m){Editor.config=m;Editor.configVersion=m.version;m.debug&&(urlParams.test="1");m.passiveScroll&&(Editor.passiveScroll=!0);m.noResizers&&(Editor.noResizers=!0);m.preserveViewState&&(Editor.preserveViewState=!0);m.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=m.useInternalClipboard);if(null!=m.customCss){var y=document.createElement("style");y.type="text/css";y.appendChild(document.createTextNode(m.customCss));document.head.appendChild(y)}null!=m.defaultFonts&&(Menus.prototype.defaultFonts=m.defaultFonts);null!=m.presetColors&&(ColorDialog.prototype.presetColors=m.presetColors);null!=m.defaultColors&&(ColorDialog.prototype.defaultColors=m.defaultColors);null!=m.colorNames&&(ColorDialog.prototype.colorNames=m.colorNames);-null!=m.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=m.defaultColorSchemes);null!=m.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=m.defaultEdgeLength);null!=m.selectParentLayer&&(Graph.selectParentLayer=m.selectParentLayer);null!=m.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=m.autosaveDelay);null!=m.templateFile&&(EditorUi.templateFile=m.templateFile);null!=m.styles&&(Array.isArray(m.styles)?Editor.styles=m.styles:EditorUi.debug("Configuration Error: Array expected for styles"));-null!=m.globalVars&&(Editor.globalVars=m.globalVars);null!=m.compressXml&&(Editor.defaultCompressed=m.compressXml,Editor.compressXml=m.compressXml);null!=m.includeDiagram&&(Editor.defaultIncludeDiagram=m.includeDiagram);null!=m.simpleLabels&&(Editor.simpleLabels=m.simpleLabels);null!=m.pasteAtMousePointer&&(Editor.pasteAtMousePointer=m.pasteAtMousePointer);null!=m.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=m.fitDiagramOnLoad);null!=m.fitDiagramOnPage&&(Editor.fitDiagramOnPage=m.fitDiagramOnPage);-null!=m.showLinkIcons&&(Editor.showLinkIcons=m.showLinkIcons);null!=m.showTooltipIcons&&(Editor.showTooltipIcons=m.showTooltipIcons);null!=m.showConnectHandle&&(Editor.showConnectHandle=m.showConnectHandle);null!=m.enableInlineToolbar&&(Editor.enableInlineToolbar=m.enableInlineToolbar);null!=m.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=m.oneDriveInlinePicker);null!=m.enableNativeClipboard&&(Editor.enableNativeClipboard=m.enableNativeClipboard);null!=m.enableExportUrl&&(Editor.enableExportUrl=-m.enableExportUrl);null!=m.defaultAdaptiveColors?Graph.defaultAdaptiveColors=m.defaultAdaptiveColors:0==m.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=m.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=m.enableLightDarkColors);null!=m.darkColor&&(Editor.darkColor=m.darkColor);null!=m.darkColorVar&&(Editor.darkColorVar=m.darkColorVar);Graph.prototype.defaultPageBackgroundColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+-Editor.darkColorVar+", "+Editor.darkColor+"))";null!=m.settingsName&&(Editor.configurationKey="."+m.settingsName+"-configuration",Editor.settingsKey="."+m.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=m.customFonts&&(Menus.prototype.defaultFonts=m.customFonts.concat(Menus.prototype.defaultFonts));null!=m.customPresetColors&&(ColorDialog.prototype.presetColors=m.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=m.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=-m.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=m.css){y=document.createElement("style");y.setAttribute("type","text/css");y.appendChild(document.createTextNode(m.css));var F=document.getElementsByTagName("script")[0];F.parentNode.insertBefore(y,F)}null!=m.expandLibraries&&(Sidebar.prototype.expandLibraries=m.expandLibraries);null!=m.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=m.appendCustomLibraries);null!=m.libraries&&(Sidebar.prototype.customEntries=-m.libraries);null!=m.enabledLibraries&&(Array.isArray(m.enabledLibraries)?Sidebar.prototype.enabledLibraries=m.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=m.defaultLibraries&&(Sidebar.prototype.defaultEntries=m.defaultLibraries);null!=m.defaultCustomLibraries&&(Editor.defaultCustomLibraries=m.defaultCustomLibraries);null!=m.enableCustomLibraries&&(Editor.enableCustomLibraries=m.enableCustomLibraries);null!=m.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=-m.defaultVertexStyle);null!=m.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=m.defaultEdgeStyle);null!=m.defaultPageVisible&&(Graph.prototype.defaultPageVisible=m.defaultPageVisible);null!=m.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=m.defaultGridEnabled);null!=m.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=m.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=m.defaultConnectionArrowsEnabled);null!=m.defaultConnectable&&(Graph.prototype.defaultConnectable=-m.defaultConnectable);null!=m.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=m.defaultFoldingEnabled);null!=m.zoomWheel&&(Graph.zoomWheel=m.zoomWheel);null!=m.zoomFactor&&(y=parseFloat(m.zoomFactor),!isNaN(y)&&1<y?Graph.prototype.zoomFactor=y:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=m.defaultGridSize&&(y=parseInt(m.defaultGridSize),!isNaN(y)&&0<y?mxGraph.prototype.gridSize=y:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));-null!=m.gridSteps&&(y=parseInt(m.gridSteps),!isNaN(y)&&0<y?mxGraphView.prototype.gridSteps=y:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=m.pageFormat&&(y=parseInt(m.pageFormat.width),F=parseInt(m.pageFormat.height),!isNaN(y)&&0<y&&!isNaN(F)&&0<F?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,y,F),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=-m.thumbWidth&&(Sidebar.prototype.thumbWidth=m.thumbWidth);null!=m.thumbHeight&&(Sidebar.prototype.thumbHeight=m.thumbHeight);null!=m.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=m.emptyLibraryXml);null!=m.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=m.emptyDiagramXml);null!=m.sidebarWidth&&(EditorUi.prototype.hsplitPosition=m.sidebarWidth);null!=m.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=m.updateDefaultStyle);null!=m.sidebarTitles&&(Sidebar.prototype.sidebarTitles=-m.sidebarTitles);null!=m.sidebarTitleSize&&(y=parseInt(m.sidebarTitleSize),!isNaN(y)&&0<y?Sidebar.prototype.sidebarTitleSize=y:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=m.fontCss&&("string"===typeof m.fontCss?Editor.configureFontCss(m.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=m.autosaveDelay&&(y=parseInt(m.autosaveDelay),!isNaN(y)&&0<y?DrawioFile.prototype.autosaveDelay=y:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));-null!=m.maxImageBytes&&(EditorUi.prototype.maxImageBytes=m.maxImageBytes);null!=m.maxImageSize&&(EditorUi.prototype.maxImageSize=m.maxImageSize);null!=m.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=m.shareCursorPosition);null!=m.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=m.showRemoteCursors);null!=m.restrictExport&&(DrawioFile.RESTRICT_EXPORT=m.restrictExport);null!=m.removeImageMetadata&&(Editor.removeImageMetadata=m.removeImageMetadata);null!=m.defaultTextStyle&&(Editor.defaultTextStyle=-m.defaultTextStyle);null!=m.replaceSvgDataUris&&(Editor.replaceSvgDataUris=m.replaceSvgDataUris);null!=m.foreignObjectImages&&(Editor.foreignObjectImages=m.foreignObjectImages);null!=m.shadowColor&&(mxConstants.SHADOW_COLOR=m.shadowColor);null!=m.shadowOpacity&&(mxConstants.SHADOW_OPACITY=m.shadowOpacity);null!=m.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=m.shadowOffsetX);null!=m.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=m.shadowOffsetY);null!=m.shadowBlur&&(mxConstants.SHADOW_BLUR=m.shadowBlur);-null!=m.enableAnimations&&(Editor.enableAnimations=m.enableAnimations);null!=m.enableWindowDocking&&(Editor.enableWindowDocking=m.enableWindowDocking);null!=m.compact&&(EditorUi.prototype.defaultCompact=m.compact);null!=m.noAutoFocus&&(EditorUi.prototype.noAutoFocus=m.noAutoFocus);if(null!=m.hideMenuItems)if(Array.isArray(m.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},y=0;y<m.hideMenuItems.length;y++)Menus.prototype.hiddenMenuItems[m.hideMenuItems[y]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");-if(null!=m.hideMenus)if(Array.isArray(m.hideMenus)){var N={};for(y=0;y<m.hideMenus.length;y++)N[m.hideMenus[y]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(O){return!N[O]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=m.enableAi&&(Editor.enableAi=m.enableAi);null!=m.enableChatGpt&&(Editor.enableAi=m.enableChatGpt);null!=m.gptApiKey&&(Editor.aiGlobals.gptApiKey=m.gptApiKey);null!=m.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=-m.geminiApiKey);null!=m.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=m.claudeApiKey);null!=m.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=m.gptUrl);null!=m.aiActions&&(Editor.aiActions=m.aiActions);null!=m.aiGlobals&&(Editor.aiGlobals=m.aiGlobals);null!=m.aiConfigs&&(Editor.aiConfigs=m.aiConfigs);null!=m.aiModels&&(Editor.aiModels=m.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=-function(m){if(null!=m){Editor.prototype.fontCss=m;var y=document.getElementsByTagName("script")[0];if(null!=y&&null!=y.parentNode){var F=document.createElement("style");F.setAttribute("type","text/css");F.appendChild(document.createTextNode(m));y.parentNode.insertBefore(F,y);m=m.split("url(");for(F=1;F<m.length;F++){var N=m[F].indexOf(")");N=Editor.trimCssUrl(m[F].substring(0,N));var O=document.createElement("link");O.setAttribute("rel","preload");O.setAttribute("href",N);O.setAttribute("as","font");-O.setAttribute("crossorigin","");y.parentNode.insertBefore(O,y)}}}};Editor.trimCssUrl=function(m){return m.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(m){m=null!=m?m:Editor.GUID_LENGTH;for(var y=[],F=0;F<m;F++)y.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*-Editor.GUID_ALPHABET.length)));return y.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.generateTimeout=6E4;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(m){m=null!=m&&"mxlibrary"!=m.nodeName?this.extractGraphModel(m):-null;if(null!=m){var y=Editor.extractParserError(m,mxResources.get("invalidOrMissingFile"));if(y)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[m],"cause",[y]),Error(mxResources.get("notADiagramFile")+" ("+y+")");if("mxGraphModel"==m.nodeName){y=m.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=y&&""!=y)y!=this.graph.currentStyle&&(F=null!=this.graph.themes?this.graph.themes[y]:mxUtils.load(STYLE_PATH+"/"+y+".xml").getDocumentElement(),null!=F&&(N=new mxCodec(F.ownerDocument),-N.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 N=new mxCodec(F.ownerDocument);N.decode(F,this.graph.getStylesheet())}}this.graph.currentStyle=y;this.graph.mathEnabled="1"==urlParams.math||"1"==m.getAttribute("math");this.graph.setAdaptiveColors(m.getAttribute("adaptiveColors"));y=m.getAttribute("backgroundImage");null!=y?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(y)):-this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==m.getAttribute("shadow"),!1);if(y=m.getAttribute("extFonts"))try{for(y=y.split("|").map(function(O){O=O.split("^");return{name:O[0],url:O[1]}}),F=0;F<y.length;F++)this.graph.addExtFont(y[F].name,y[F].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 f=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(m,y){m=null!=m?m:!0;var F=f.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&F.setAttribute("style",this.graph.currentStyle);var N=this.graph.getBackgroundImageObject(this.graph.backgroundImage,-y);null!=N&&F.setAttribute("backgroundImage",JSON.stringify(N));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&&(N=this.graph.extFonts.map(function(O){return O.name+"^"+O.url}),F.setAttribute("extFonts",N.join("|")));return F};Editor.prototype.isDataSvg=-function(m){try{var y=mxUtils.parseXml(m).documentElement.getAttribute("content");if(null!=y&&(null!=y&&"<"!=y.charAt(0)&&"%"!=y.charAt(0)&&(y=unescape(window.atob?atob(y):Base64.decode(cont,y))),null!=y&&"%"==y.charAt(0)&&(y=decodeURIComponent(y)),null!=y&&0<y.length)){var F=mxUtils.parseXml(y).documentElement;return"mxfile"==F.nodeName||"mxGraphModel"==F.nodeName}}catch(N){}return!1};Editor.prototype.extractGraphModel=function(m,y,F){return Editor.extractGraphModel.apply(this,arguments)};var k=-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();k.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(m,y){if("undefined"===typeof window.MathJax){var F=function(){N=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};m=null!=m?m:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var N=null;Editor.doMathJaxRender=function(T){try{null==N?(MathJax.typesetClear([T]),MathJax.typeset([T]),F()):N!=T&&Editor.mathJaxQueue.push(T)}catch(Q){MathJax.typesetClear([T]),-null!=Q.retry?(N=T,Q.retry.then(function(){MathJax.typesetPromise([T]).then(F)["catch"](function(R){console.log("Error in MathJax.typesetPromise: "+R.toString());F()})})["catch"](function(R){console.log("Error in MathJax.retry: "+R.toString());F()})):null!=window.console&&console.log("Error in MathJax.typeset: "+Q.toString())}};window.MathJax=null!=y?y:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg",-"input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},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 O=Editor.prototype.init;Editor.prototype.init=function(){O.apply(this,arguments);-var T=mxUtils.bind(this,function(Q,R){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)};y=document.getElementsByTagName("script");if(null!=y&&0<y.length){var P=document.createElement("script");P.setAttribute("type","text/javascript");P.setAttribute("src",m);y[0].parentNode.appendChild(P)}}};Editor.prototype.csvToArray=function(m){if(0<m.length){var y="",F=[""],N=-0,O=!0,P;m=$jscomp.makeIterator(m);for(P=m.next();!P.done;P=m.next())P=P.value,'"'===P?(O&&P===y&&(F[N]+=P),O=!O):","===P&&O?P=F[++N]="":F[N]+=P,y=P;return F}return[]};Editor.prototype.getProxiedUrl=function(m){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(m)){var y=EditorUi.isVisioFilename(m);y=/\.png$/i.test(m)||/\.pdf$/i.test(m)||y;var F="t="+(new Date).getTime();m=PROXY_URL+"?url="+encodeURIComponent(m)+"&"+-F+(y?"&base64=1":"")}return m};Editor.prototype.isCorsEnabledForUrl=function(m){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||m.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(m)||"https://raw.githubusercontent.com/"===m.substring(0,34)||"https://fonts.googleapis.com/"===m.substring(0,29)||"https://fonts.gstatic.com/"===-m.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var m=new mxUrlConverter;m.updateBaseUrl();var y=m.convert,F=this;m.convert=function(N){null!=N&&navigator.onLine&&("http://"!=N.substring(0,7)&&"https://"!=N.substring(0,8)||N.substring(0,m.baseUrl.length)==m.baseUrl||F.crossOriginImages&&F.isCorsEnabledForUrl(N)?"chrome-extension://"!=N.substring(0,19)&&(N=y.apply(this,arguments)):N=PROXY_URL+"?url="+encodeURIComponent(N));return N};return m};Editor.createSvgDataUri=function(m){return"data:image/svg+xml;base64,"+-btoa(unescape(encodeURIComponent(m)))};Editor.prototype.convertImageToDataUri=function(m,y,F,N,O){try{var P=!0,T=window.setTimeout(mxUtils.bind(this,function(){P=!1;y(m)}),this.timeout),Q=mxUtils.bind(this,function(){null!=N?this.convertImageToDataUri(m,y,F,N,!0):y(m)});if(/(\.svg)$/i.test(m)&&!O)mxUtils.get(m,mxUtils.bind(this,function(W){window.clearTimeout(T);P&&(200>W.getStatus()||299<W.getStatus()?Q():y(Editor.createSvgDataUri(W.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(T);-P&&Q()}));else{var R=new Image;this.crossOriginImages&&(R.crossOrigin="anonymous");R.onload=function(){window.clearTimeout(T);if(P)try{N=null!=N&&O?N:1;var W=document.createElement("canvas"),X=W.getContext("2d");X.scale(N,N);W.height=R.height*N;W.width=R.width*N;X.drawImage(R,0,0);y(W.toDataURL())}catch(Y){y(m)}};R.onerror=function(){window.clearTimeout(T);P&&(null!=F?F():y(m))};R.src=m}}catch(W){null!=F?F():y(m)}};Editor.prototype.convertImages=function(m,y,F,N){function O(){0<P.length?P.shift()():-y(m)}null==N&&(N=this.createImageUrlConverter());var P=[],T=F||{};F=mxUtils.bind(this,function(Q,R){Q=m.getElementsByTagName(Q);for(var W=0;W<Q.length;W++)mxUtils.bind(this,function(X){P.push(mxUtils.bind(this,function(){try{if(null!=X){var Y=N.convert(X.getAttribute(R));if(null!=Y&&"data:"!=Y.substring(0,5)){var Z=T[Y];null==Z?this.convertImageToDataUri(Y,function(ba){null!=ba&&(T[Y]=ba,X.setAttribute(R,ba));O()},null,Editor.svgRasterScale):(X.setAttribute(R,Z),O())}else null!=Y&&X.setAttribute(R,-Y),O()}}catch(ba){O()}}))})(Q[W])});F("image","xlink:href");F("img","src");O()};Editor.base64Encode=function(m){for(var y="",F=0,N=m.length,O,P,T;F<N;){O=m.charCodeAt(F++)&255;if(F==N){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&3)<<4);y+="==";break}P=m.charCodeAt(F++);if(F==N){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&-3)<<4|(P&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&15)<<2);y+="=";break}T=m.charCodeAt(F++);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&3)<<4|(P&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&15)<<2|(T&192)>>6);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T&63)}return y};-Editor.prototype.loadUrl=function(m,y,F,N,O,P,T,Q){try{var R=!T&&(N||/(\.png)($|\?)/i.test(m)||/(\.jpe?g)($|\?)/i.test(m)||/(\.gif)($|\?)/i.test(m)||/(\.pdf)($|\?)/i.test(m));O=null!=O?O:!0;var W=mxUtils.bind(this,function(){mxUtils.get(m,mxUtils.bind(this,function(X){200<=X.getStatus()&&299>=X.getStatus()?null!=y&&(X=X.getText(),R&&(P=null!=P?P:"data:image/png;base64,",X=P+Editor.base64Encode(X)),y(X)):null!=F&&(0==X.getStatus()?F({message:mxResources.get("accessDenied")},X):404==X.getStatus()?F({message:mxResources.get("fileNotFound"),-code:X.getStatus()},X):F({message:this.getErrorMessage(X)},X))}),function(X){null!=F&&F({message:mxResources.get("error")+" "+X.getStatus()})},R,this.timeout,function(){O&&null!=F&&F({code:App.ERROR_TIMEOUT,retry:W})},Q)});W()}catch(X){null!=F&&F(X)}};Editor.prototype.getErrorMessage=function(m){var y=mxResources.get("error")+" "+m.getStatus();try{var F=m.getText(),N=JSON.parse(F);null!=N&&null!=N.error&&null!=N.error.message&&(y=N.error.message+" ("+y+")")}catch(O){}return y};Editor.prototype.absoluteCssFonts=-function(m){var y=null;if(null!=m){var F=m.split("url(");if(0<F.length){y=[F[0]];m=window.location.pathname;var N=null!=m?m.lastIndexOf("/"):-1;0<=N&&(m=m.substring(0,N+1));N=document.getElementsByTagName("base");var O=null;null!=N&&0<N.length&&(O=N[0].getAttribute("href"));for(var P=1;P<F.length;P++)if(N=F[P].indexOf(")"),0<N){var T=Editor.trimCssUrl(F[P].substring(0,N));this.graph.isRelativeUrl(T)&&(T=null!=O?O+T:window.location.protocol+"//"+window.location.hostname+("/"==T.charAt(0)?"":m)+T);-y.push('url("'+T+'"'+F[P].substring(N))}else y.push(F[P])}else y=[m]}return null!=y?y.join(""):null};Editor.prototype.mapFontUrl=function(m,y,F){/^https?:\/\//.test(y)&&!this.isCorsEnabledForUrl(y)&&(y=PROXY_URL+"?url="+encodeURIComponent(y));F(m,y)};Editor.prototype.embedCssFonts=function(m,y){var F=m.split("url("),N=0;null==this.cachedFonts&&(this.cachedFonts={});var O=mxUtils.bind(this,function(){if(0==N){for(var R=[F[0]],W=1;W<F.length;W++){var X=F[W].indexOf(")");R.push('url("');R.push(this.cachedFonts[Editor.trimCssUrl(F[W].substring(0,-X))]);R.push('"'+F[W].substring(X))}y(R.join(""))}});if(0<F.length){for(m=1;m<F.length;m++){var P=F[m].indexOf(")"),T=null,Q=F[m].indexOf("format(",P);0<Q&&(T=Editor.trimCssUrl(F[m].substring(Q+7,F[m].indexOf(")",Q))));mxUtils.bind(this,function(R){if(null==this.cachedFonts[R]){this.cachedFonts[R]=R;N++;var W="application/x-font-ttf";if("svg"==T||/(\.svg)($|\?)/i.test(R))W="image/svg+xml";else if("otf"==T||"embedded-opentype"==T||/(\.otf)($|\?)/i.test(R))W="application/x-font-opentype";else if("woff"==-T||/(\.woff)($|\?)/i.test(R))W="application/font-woff";else if("woff2"==T||/(\.woff2)($|\?)/i.test(R))W="application/font-woff2";else if("eot"==T||/(\.eot)($|\?)/i.test(R))W="application/vnd.ms-fontobject";else if("sfnt"==T||/(\.sfnt)($|\?)/i.test(R))W="application/font-sfnt";this.mapFontUrl(W,R,mxUtils.bind(this,function(X,Y){this.loadUrl(Y,mxUtils.bind(this,function(Z){this.cachedFonts[R]=Z;N--;O()}),mxUtils.bind(this,function(Z){N--;O()}),!0,null,"data:"+X+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(F[m].substring(0,-P)),T)}O()}else y(m)};Editor.prototype.loadFonts=function(m){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(y){this.resolvedFontCss=y;null!=m&&m()})):null!=m&&m()};Editor.prototype.createGoogleFontCache=function(){var m={},y;for(y in Graph.fontMapping)Graph.isCssFontUrl(y)&&(m[y]=Graph.fontMapping[y]);return m};Editor.prototype.embedExtFonts=function(m){var y=this.graph.getCustomFonts();if(0<y.length){var F=[],N=0;null==this.cachedGoogleFonts&&-(this.cachedGoogleFonts=this.createGoogleFontCache());for(var O=mxUtils.bind(this,function(){0==N&&this.embedCssFonts(F.join(""),m)}),P=0;P<y.length;P++)mxUtils.bind(this,function(T,Q){Graph.isCssFontUrl(Q)?null==this.cachedGoogleFonts[Q]?(N++,this.loadUrl(Graph.rewriteGoogleFontUrl(Q),mxUtils.bind(this,function(R){this.cachedGoogleFonts[Q]=R;F.push(R+"\n");N--;O()}),mxUtils.bind(this,function(R){N--;F.push("@import url("+Q+");\n");O()}))):F.push(this.cachedGoogleFonts[Q]+"\n"):F.push('@font-face {font-family: "'+-T+'";src: url("'+Q+'")}\n')})(y[P].name,y[P].url);O()}else m()};Editor.prototype.addMathCss=function(m){m=m.getElementsByTagName("defs");if(null!=m&&0<m.length)for(var y=document.getElementsByTagName("style"),F=0;F<y.length;F++){var N=mxUtils.getTextContent(y[F]);0>N.indexOf("mxPageSelector")&&0<N.indexOf("MathJax")&&m[0].appendChild(y[F].cloneNode(!0))}};Editor.prototype.addFontCss=function(m,y){y=null!=y?y:this.absoluteCssFonts(this.fontCss);if(null!=y){var F=mxUtils.getSvgDefs(m),N=y.split("\n");-y=[];for(var O=[],P=0;P<N.length;P++)"@import"==N[P].substring(0,7)?y.push(N[P]):O.push(N[P]);m=m.ownerDocument;m=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"style"):m.createElement("style");m.setAttribute("type","text/css");0<y.length&&(mxUtils.setTextContent(m,y.join("\n")),F.appendChild(m));0<O.length&&(m=m.cloneNode(!1),mxUtils.setTextContent(m,O.join("\n")),F.appendChild(m))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};-Editor.prototype.getMaxCanvasScale=function(m,y,F){var N=mxClient.IS_FF?8192:16384;return Math.min(F,Math.min(N/m,N/y))};Editor.prototype.exportToCanvas=function(m,y,F,N,O,P,T,Q,R,W,X,Y,Z,ba,ea,ha,fa,la){try{P=null!=P?P:!0;T=null!=T?T:!0;Y=null!=Y?Y:this.graph;Z=null!=Z?Z:0;var oa=R?null:Y.background;oa==mxConstants.NONE&&(oa=null);null==oa&&(oa=N);null==oa&&0==R&&(oa="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(Y.getSvg(null,null,Z,ba,null,T,null,null,null,W,null,ha,fa,la),mxUtils.bind(this,-function(pa){try{pa.style.setProperty("-webkit-font-smoothing","antialiased");pa.style.setProperty("-moz-osx-font-smoothing","grayscale");var va=new Image;va.onload=mxUtils.bind(this,function(){try{var ma=function(){mxClient.IS_SF?window.setTimeout(function(){xa.drawImage(va,0,0);m(ia,pa)},0):(xa.drawImage(va,0,0),m(ia,pa))},ia=document.createElement("canvas"),qa=parseInt(pa.getAttribute("width")),ua=parseInt(pa.getAttribute("height"));Q=null!=Q?Q:1;null!=y&&(Q=P?Math.min(1,Math.min(3*y/(4*ua),y/-qa)):y/qa);Q=this.getMaxCanvasScale(qa,ua,Q);qa=Math.ceil(Q*qa);ua=Math.ceil(Q*ua);ia.setAttribute("width",qa);ia.setAttribute("height",ua);var xa=ia.getContext("2d");if(null!=oa){var ra=mxUtils.getLightDarkColor(oa);xa.beginPath();xa.rect(0,0,qa,ua);xa.fillStyle="dark"==ha&&"none"!=Y.getAdaptiveColors()?ra.dark:ra.light;xa.fill()}1!=Q&&xa.scale(Q,Q);if(ea){var aa=Y.view,na=aa.scale;aa.scale=1;var ja=btoa(unescape(encodeURIComponent(aa.createSvgGrid(aa.gridColor))));aa.scale=na;ja="data:image/svg+xml;base64,"+-ja;var sa=Y.gridSize*aa.gridSteps*Q,Ca=Y.getGraphBounds(),Fa=aa.translate.x*na,Ba=aa.translate.y*na,da=Fa+(Ca.x-Fa)/na-Z,ca=Ba+(Ca.y-Ba)/na-Z,wa=new Image;wa.onload=function(){try{for(var ka=-Math.round(sa-mxUtils.mod((Fa-da)*Q,sa)),za=-Math.round(sa-mxUtils.mod((Ba-ca)*Q,sa));ka<qa;ka+=sa)for(var ya=za;ya<ua;ya+=sa)xa.drawImage(wa,ka/Q,ya/Q);ma()}catch(Ga){null!=O&&O(Ga)}};wa.onerror=function(ka){null!=O&&O(ka)};wa.src=ja}else ma()}catch(ka){null!=O&&O(ka)}});va.onerror=function(ma){null!=O&&O(ma)};-W&&this.graph.addSvgShadow(pa);this.graph.mathEnabled&&this.addMathCss(pa);var ta=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(pa,this.resolvedFontCss),va.src=Editor.createSvgDataUri(mxUtils.getXml(pa))}catch(ma){null!=O&&O(ma)}});this.embedExtFonts(mxUtils.bind(this,function(ma){try{null!=ma&&this.addFontCss(pa,ma),this.loadFonts(ta)}catch(ia){null!=O&&O(ia)}}))}catch(ma){null!=O&&O(ma)}}),F,X)}catch(pa){null!=O&&O(pa)}};Editor.crcTable=[];for(var p=0;256>p;p++)for(var q=-p,u=0;8>u;u++)q=1==(q&1)?3988292384^q>>>1:q>>>1,Editor.crcTable[p]=q;Editor.updateCRC=function(m,y,F,N){for(var O=0;O<N;O++)m=Editor.crcTable[(m^y.charCodeAt(F+O))&255]^m>>>8;return m};Editor.crc32=function(m){for(var y=-1,F=0;F<m.length;F++)y=y>>>8^Editor.crcTable[(y^m.charCodeAt(F))&255];return(y^-1)>>>0};Editor.writeGraphModelToPng=function(m,y,F,N,O){function P(X,Y){var Z=R;R+=Y;return X.substring(Z,R)}function T(X){X=P(X,4);return X.charCodeAt(3)+(X.charCodeAt(2)<<8)+(X.charCodeAt(1)<<16)+(X.charCodeAt(0)<<-24)}function Q(X){return String.fromCharCode(X>>24&255,X>>16&255,X>>8&255,X&255)}m=m.substring(m.indexOf(",")+1);m=window.atob?atob(m):Base64.decode(m,!0);var R=0;if(P(m,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=O&&O();else if(P(m,4),"IHDR"!=P(m,4))null!=O&&O();else{P(m,17);O=m.substring(0,R);do{var W=T(m);if("IDAT"==P(m,4)){O=m.substring(0,R-8);"pHYs"==y&&"dpi"==F?(F=Math.round(N/.0254),F=Q(F)+Q(F)+String.fromCharCode(1)):F=F+String.fromCharCode(0)+("zTXt"==y?String.fromCharCode(0):-"")+N;N=4294967295;N=Editor.updateCRC(N,y,0,4);N=Editor.updateCRC(N,F,0,F.length);O+=Q(F.length)+y+F+Q(N^4294967295);O+=m.substring(R-8,m.length);break}O+=m.substring(R-8,R-4+W);P(m,W);P(m,4)}while(W);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 A=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(m,y){A.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);-mxSettings.save()};var J=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){J.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(m,y,F){var N=null;if(null!=F)return null;null!=m.editor.graph.getModel().getParent(y)?N=y.getId():null!=m.currentPage&&(N=m.currentPage.getId());return N});if(null!=window.StyleFormatPanel){var I=Format.prototype.init;Format.prototype.init=-function(){I.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var G=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?G.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(m){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var E=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=-function(m){m=E.apply(this,arguments);var y=this.editorUi,F=y.editor.graph;if(F.isEnabled()){var N=y.getCurrentFile();null!=N&&N.isAutosaveOptional()&&m.appendChild(this.createOption(mxResources.get("autosave"),function(){return y.editor.autosave},function(P){y.editor.setAutosave(P);y.editor.autosave&&N.isModified()&&N.fileChanged()},{install:function(P){this.listener=function(){P(y.editor.autosave)};y.editor.addListener("autosaveChanged",this.listener)},destroy:function(){y.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&-F.isEnabled()&&"undefined"!==typeof MathJax){var O=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return F.mathEnabled},function(P){y.actions.get("mathematicalTypesetting").funct()},{install:function(P){this.listener=function(){P(F.mathEnabled)};y.addListener("mathEnabledChanged",this.listener)},destroy:function(){y.removeListener(this.listener)}});m.appendChild(O);(!y.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&O.appendChild(y.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return m};-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.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];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(m){return"0"==mxUtils.getValue(m.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(m){return"1"==mxUtils.getValue(m.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,isVisible:function(m){return"0"==mxUtils.getValue(m.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(m){return"1"==mxUtils.getValue(m.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,-min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",-dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",-dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",-min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",-type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",-type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",-type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);-mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},-{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},-{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=+null!=m.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=m.defaultColorSchemes);null!=m.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=m.defaultEdgeLength);null!=m.selectParentLayer&&(Graph.selectParentLayer=m.selectParentLayer);null!=m.intersectionSelect&&(Graph.intersectionSelect=m.intersectionSelect);null!=m.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=m.autosaveDelay);null!=m.templateFile&&(EditorUi.templateFile=m.templateFile);null!=m.styles&&(Array.isArray(m.styles)?+Editor.styles=m.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=m.globalVars&&(Editor.globalVars=m.globalVars);null!=m.compressXml&&(Editor.defaultCompressed=m.compressXml,Editor.compressXml=m.compressXml);null!=m.includeDiagram&&(Editor.defaultIncludeDiagram=m.includeDiagram);null!=m.simpleLabels&&(Editor.simpleLabels=m.simpleLabels);null!=m.pasteAtMousePointer&&(Editor.pasteAtMousePointer=m.pasteAtMousePointer);null!=m.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=m.fitDiagramOnLoad);+null!=m.fitDiagramOnPage&&(Editor.fitDiagramOnPage=m.fitDiagramOnPage);null!=m.showLinkIcons&&(Editor.showLinkIcons=m.showLinkIcons);null!=m.showTooltipIcons&&(Editor.showTooltipIcons=m.showTooltipIcons);null!=m.showConnectHandle&&(Editor.showConnectHandle=m.showConnectHandle);null!=m.enableInlineToolbar&&(Editor.enableInlineToolbar=m.enableInlineToolbar);null!=m.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=m.oneDriveInlinePicker);null!=m.enableNativeClipboard&&(Editor.enableNativeClipboard=+m.enableNativeClipboard);null!=m.enableExportUrl&&(Editor.enableExportUrl=m.enableExportUrl);null!=m.defaultAdaptiveColors?Graph.defaultAdaptiveColors=m.defaultAdaptiveColors:0==m.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=m.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=m.enableLightDarkColors);null!=m.darkColor&&(Editor.darkColor=m.darkColor);null!=m.darkColorVar&&(Editor.darkColorVar=m.darkColorVar);Graph.prototype.defaultPageBackgroundColor="light-dark(#ffffff, "++Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=m.settingsName&&(Editor.configurationKey="."+m.settingsName+"-configuration",Editor.settingsKey="."+m.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=m.customFonts&&(Menus.prototype.defaultFonts=m.customFonts.concat(Menus.prototype.defaultFonts));null!=m.customPresetColors&&(ColorDialog.prototype.presetColors=m.customPresetColors.concat(ColorDialog.prototype.presetColors));+null!=m.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=m.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=m.css){y=document.createElement("style");y.setAttribute("type","text/css");y.appendChild(document.createTextNode(m.css));var E=document.getElementsByTagName("script")[0];E.parentNode.insertBefore(y,E)}null!=m.expandLibraries&&(Sidebar.prototype.expandLibraries=m.expandLibraries);null!=m.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=+m.appendCustomLibraries);null!=m.libraries&&(Sidebar.prototype.customEntries=m.libraries);null!=m.enabledLibraries&&(Array.isArray(m.enabledLibraries)?Sidebar.prototype.enabledLibraries=m.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=m.defaultLibraries&&(Sidebar.prototype.defaultEntries=m.defaultLibraries);null!=m.defaultCustomLibraries&&(Editor.defaultCustomLibraries=m.defaultCustomLibraries);null!=m.enableCustomLibraries&&(Editor.enableCustomLibraries=+m.enableCustomLibraries);null!=m.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=m.defaultVertexStyle);null!=m.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=m.defaultEdgeStyle);null!=m.shapePicker&&(EditorUi.prototype.defaultShapePickerEntries=m.shapePicker.shapes);null!=m.defaultPageVisible&&(Graph.prototype.defaultPageVisible=m.defaultPageVisible);null!=m.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=m.defaultGridEnabled);null!=m.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=+m.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=m.defaultConnectionArrowsEnabled);null!=m.defaultConnectable&&(Graph.prototype.defaultConnectable=m.defaultConnectable);null!=m.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=m.defaultFoldingEnabled);null!=m.zoomWheel&&(Graph.zoomWheel=m.zoomWheel);null!=m.zoomFactor&&(y=parseFloat(m.zoomFactor),!isNaN(y)&&1<y?Graph.prototype.zoomFactor=y:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));+null!=m.defaultGridSize&&(y=parseInt(m.defaultGridSize),!isNaN(y)&&0<y?mxGraph.prototype.gridSize=y:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=m.gridSteps&&(y=parseInt(m.gridSteps),!isNaN(y)&&0<y?mxGraphView.prototype.gridSteps=y:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=m.pageFormat&&(y=parseInt(m.pageFormat.width),E=parseInt(m.pageFormat.height),!isNaN(y)&&0<y&&!isNaN(E)&&0<E?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,+0,y,E),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=m.thumbWidth&&(Sidebar.prototype.thumbWidth=m.thumbWidth);null!=m.thumbHeight&&(Sidebar.prototype.thumbHeight=m.thumbHeight);null!=m.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=m.emptyLibraryXml);null!=m.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=m.emptyDiagramXml);null!=m.sidebarWidth&&(EditorUi.prototype.hsplitPosition=+m.sidebarWidth);null!=m.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=m.updateDefaultStyle);null!=m.sidebarTitles&&(Sidebar.prototype.sidebarTitles=m.sidebarTitles);null!=m.sidebarTitleSize&&(y=parseInt(m.sidebarTitleSize),!isNaN(y)&&0<y?Sidebar.prototype.sidebarTitleSize=y:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=m.fontCss&&("string"===typeof m.fontCss?Editor.configureFontCss(m.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));+null!=m.autosaveDelay&&(y=parseInt(m.autosaveDelay),!isNaN(y)&&0<y?DrawioFile.prototype.autosaveDelay=y:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=m.maxImageBytes&&(EditorUi.prototype.maxImageBytes=m.maxImageBytes);null!=m.maxImageSize&&(EditorUi.prototype.maxImageSize=m.maxImageSize);null!=m.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=m.shareCursorPosition);null!=m.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=m.showRemoteCursors);+null!=m.restrictExport&&(DrawioFile.RESTRICT_EXPORT=m.restrictExport);null!=m.removeImageMetadata&&(Editor.removeImageMetadata=m.removeImageMetadata);null!=m.defaultTextStyle&&(Editor.defaultTextStyle=m.defaultTextStyle);null!=m.replaceSvgDataUris&&(Editor.replaceSvgDataUris=m.replaceSvgDataUris);null!=m.foreignObjectImages&&(Editor.foreignObjectImages=m.foreignObjectImages);null!=m.shadowColor&&(mxConstants.SHADOW_COLOR=m.shadowColor);null!=m.shadowOpacity&&(mxConstants.SHADOW_OPACITY=m.shadowOpacity);+null!=m.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=m.shadowOffsetX);null!=m.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=m.shadowOffsetY);null!=m.shadowBlur&&(mxConstants.SHADOW_BLUR=m.shadowBlur);null!=m.enableAnimations&&(Editor.enableAnimations=m.enableAnimations);null!=m.enableWindowDocking&&(Editor.enableWindowDocking=m.enableWindowDocking);null!=m.compact&&(EditorUi.prototype.defaultCompact=m.compact);null!=m.noAutoFocus&&(EditorUi.prototype.noAutoFocus=m.noAutoFocus);if(null!=m.hideMenuItems)if(Array.isArray(m.hideMenuItems))for(Menus.prototype.hiddenMenuItems=+{},y=0;y<m.hideMenuItems.length;y++)Menus.prototype.hiddenMenuItems[m.hideMenuItems[y]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=m.hideMenus)if(Array.isArray(m.hideMenus)){var P={};for(y=0;y<m.hideMenus.length;y++)P[m.hideMenus[y]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(O){return!P[O]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=m.enableAi&&(Editor.enableAi=m.enableAi);+null!=m.enableChatGpt&&(Editor.enableAi=m.enableChatGpt);null!=m.gptApiKey&&(Editor.aiGlobals.gptApiKey=m.gptApiKey);null!=m.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=m.geminiApiKey);null!=m.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=m.claudeApiKey);null!=m.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=m.gptUrl);null!=m.aiActions&&(Editor.aiActions=m.aiActions);null!=m.aiGlobals&&(Editor.aiGlobals=m.aiGlobals);null!=m.aiConfigs&&(Editor.aiConfigs=m.aiConfigs);null!=m.aiModels&&+(Editor.aiModels=m.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(m){if(null!=m){Editor.prototype.fontCss=m;var y=document.getElementsByTagName("script")[0];if(null!=y&&null!=y.parentNode){var E=document.createElement("style");E.setAttribute("type","text/css");E.appendChild(document.createTextNode(m));y.parentNode.insertBefore(E,y);m=m.split("url(");for(E=1;E<m.length;E++){var P=+m[E].indexOf(")");P=Editor.trimCssUrl(m[E].substring(0,P));var O=document.createElement("link");O.setAttribute("rel","preload");O.setAttribute("href",P);O.setAttribute("as","font");O.setAttribute("crossorigin","");y.parentNode.insertBefore(O,y)}}}};Editor.trimCssUrl=function(m){return m.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(m){m=null!=m?m:Editor.GUID_LENGTH;for(var y=[],E=0;E<m;E++)y.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return y.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.generateTimeout=6E4;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(m){m=null!=m&&"mxlibrary"!=m.nodeName?this.extractGraphModel(m):null;if(null!=m){var y=Editor.extractParserError(m,mxResources.get("invalidOrMissingFile"));if(y)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[m],"cause",[y]),Error(mxResources.get("notADiagramFile")+" ("+y+")");if("mxGraphModel"==m.nodeName){y=m.getAttribute("style")||+"default-style2";if("1"==urlParams.embed||null!=y&&""!=y)y!=this.graph.currentStyle&&(E=null!=this.graph.themes?this.graph.themes[y]:mxUtils.load(STYLE_PATH+"/"+y+".xml").getDocumentElement(),null!=E&&(P=new mxCodec(E.ownerDocument),P.decode(E,this.graph.getStylesheet())));else{var E=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=E){var P=new mxCodec(E.ownerDocument);P.decode(E,this.graph.getStylesheet())}}this.graph.currentStyle=+y;this.graph.mathEnabled="1"==urlParams.math||"1"==m.getAttribute("math");this.graph.setAdaptiveColors(m.getAttribute("adaptiveColors"));y=m.getAttribute("backgroundImage");null!=y?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(y)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==m.getAttribute("shadow"),!1);if(y=m.getAttribute("extFonts"))try{for(y=+y.split("|").map(function(O){O=O.split("^");return{name:O[0],url:O[1]}}),E=0;E<y.length;E++)this.graph.addExtFont(y[E].name,y[E].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 f=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(m,y){m=null!=+m?m:!0;var E=f.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&E.setAttribute("style",this.graph.currentStyle);var P=this.graph.getBackgroundImageObject(this.graph.backgroundImage,y);null!=P&&E.setAttribute("backgroundImage",JSON.stringify(P));E.setAttribute("math",this.graph.mathEnabled?"1":"0");E.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?E.setAttribute("adaptiveColors",this.graph.adaptiveColors):E.removeAttribute("adaptiveColors");+null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(P=this.graph.extFonts.map(function(O){return O.name+"^"+O.url}),E.setAttribute("extFonts",P.join("|")));return E};Editor.prototype.isDataSvg=function(m){try{var y=mxUtils.parseXml(m).documentElement.getAttribute("content");if(null!=y&&(null!=y&&"<"!=y.charAt(0)&&"%"!=y.charAt(0)&&(y=unescape(window.atob?atob(y):Base64.decode(cont,y))),null!=y&&"%"==y.charAt(0)&&(y=decodeURIComponent(y)),null!=y&&0<y.length)){var E=mxUtils.parseXml(y).documentElement;+return"mxfile"==E.nodeName||"mxGraphModel"==E.nodeName}}catch(P){}return!1};Editor.prototype.extractGraphModel=function(m,y,E){return Editor.extractGraphModel.apply(this,arguments)};var k=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();+k.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(m,y){if("undefined"===typeof window.MathJax){var E=function(){P=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};m=null!=m?+m:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var P=null;Editor.doMathJaxRender=function(U){try{null==P?(MathJax.typesetClear([U]),MathJax.typeset([U]),E()):P!=U&&Editor.mathJaxQueue.push(U)}catch(R){MathJax.typesetClear([U]),null!=R.retry?(P=U,R.retry.then(function(){MathJax.typesetPromise([U]).then(E)["catch"](function(S){console.log("Error in MathJax.typesetPromise: "+S.toString());E()})})["catch"](function(S){console.log("Error in MathJax.retry: "+S.toString());E()})):null!=window.console&&+console.log("Error in MathJax.typeset: "+R.toString())}};window.MathJax=null!=y?y:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var U=0;U<Editor.mathJaxQueue.length;U++)Editor.doMathJaxRender(Editor.mathJaxQueue[U])}}};Editor.MathJaxRender=function(U){"undefined"!==+typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(U):Editor.mathJaxQueue.push(U)};Editor.onMathJaxDone=function(){};var O=Editor.prototype.init;Editor.prototype.init=function(){O.apply(this,arguments);var U=mxUtils.bind(this,function(R,S){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,U);this.graph.addListener(mxEvent.REFRESH,U)};y=document.getElementsByTagName("script");if(null!=+y&&0<y.length){var Q=document.createElement("script");Q.setAttribute("type","text/javascript");Q.setAttribute("src",m);y[0].parentNode.appendChild(Q)}}};Editor.prototype.csvToArray=function(m){if(0<m.length){var y="",E=[""],P=0,O=!0,Q;m=$jscomp.makeIterator(m);for(Q=m.next();!Q.done;Q=m.next())Q=Q.value,'"'===Q?(O&&Q===y&&(E[P]+=Q),O=!O):","===Q&&O?Q=E[++P]="":E[P]+=Q,y=Q;return E}return[]};Editor.prototype.getProxiedUrl=function(m){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&+!this.isCorsEnabledForUrl(m)){var y=EditorUi.isVisioFilename(m);y=/\.png$/i.test(m)||/\.pdf$/i.test(m)||y;var E="t="+(new Date).getTime();m=PROXY_URL+"?url="+encodeURIComponent(m)+"&"+E+(y?"&base64=1":"")}return m};Editor.prototype.isCorsEnabledForUrl=function(m){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||m.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(m)||"https://raw.githubusercontent.com/"===m.substring(0,34)||"https://fonts.googleapis.com/"===m.substring(0,29)||"https://fonts.gstatic.com/"===m.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var m=new mxUrlConverter;m.updateBaseUrl();var y=m.convert,E=this;m.convert=function(P){null!=P&&navigator.onLine&&("http://"!=P.substring(0,7)&&"https://"!=P.substring(0,8)||P.substring(0,m.baseUrl.length)==m.baseUrl||E.crossOriginImages&&+E.isCorsEnabledForUrl(P)?"chrome-extension://"!=P.substring(0,19)&&(P=y.apply(this,arguments)):P=PROXY_URL+"?url="+encodeURIComponent(P));return P};return m};Editor.createSvgDataUri=function(m){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(m)))};Editor.prototype.convertImageToDataUri=function(m,y,E,P,O){try{var Q=!0,U=window.setTimeout(mxUtils.bind(this,function(){Q=!1;y(m)}),this.timeout),R=mxUtils.bind(this,function(){null!=P?this.convertImageToDataUri(m,y,E,P,!0):y(m)});if(/(\.svg)$/i.test(m)&&+!O)mxUtils.get(m,mxUtils.bind(this,function(W){window.clearTimeout(U);Q&&(200>W.getStatus()||299<W.getStatus()?R():y(Editor.createSvgDataUri(W.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(U);Q&&R()}));else{var S=new Image;this.crossOriginImages&&(S.crossOrigin="anonymous");S.onload=function(){window.clearTimeout(U);if(Q)try{P=null!=P&&O?P:1;var W=document.createElement("canvas");W.height=S.height*P;W.width=S.width*P;var X=W.getContext("2d");X.scale(P,P);X.drawImage(S,0,0);y(W.toDataURL())}catch(Y){y(m)}};+S.onerror=function(){window.clearTimeout(U);Q&&(null!=E?E():y(m))};S.src=m}}catch(W){null!=E?E():y(m)}};Editor.prototype.convertImages=function(m,y,E,P){function O(){0<Q.length?Q.shift()():y(m)}null==P&&(P=this.createImageUrlConverter());var Q=[],U=E||{};E=mxUtils.bind(this,function(R,S){R=m.getElementsByTagName(R);for(var W=0;W<R.length;W++)mxUtils.bind(this,function(X){Q.push(mxUtils.bind(this,function(){try{if(null!=X){var Y=P.convert(X.getAttribute(S));if(null!=Y&&"data:"!=Y.substring(0,5)){var Z=+U[Y];null==Z?this.convertImageToDataUri(Y,function(aa){null!=aa&&(U[Y]=aa,X.setAttribute(S,aa));O()},null,Editor.svgRasterScale):(X.setAttribute(S,Z),O())}else null!=Y&&X.setAttribute(S,Y),O()}}catch(aa){O()}}))})(R[W])});E("image","xlink:href");E("img","src");O()};Editor.base64Encode=function(m){for(var y="",E=0,P=m.length,O,Q,U;E<P;){O=m.charCodeAt(E++)&255;if(E==P){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&+3)<<4);y+="==";break}Q=m.charCodeAt(E++);if(E==P){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&3)<<4|(Q&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&15)<<2);y+="=";break}U=m.charCodeAt(E++);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&+3)<<4|(Q&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&15)<<2|(U&192)>>6);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U&63)}return y};Editor.prototype.loadUrl=function(m,y,E,P,O,Q,U,R){try{var S=!U&&(P||/(\.png)($|\?)/i.test(m)||/(\.jpe?g)($|\?)/i.test(m)||/(\.gif)($|\?)/i.test(m)||/(\.pdf)($|\?)/i.test(m));O=null!=O?O:!0;var W=mxUtils.bind(this,function(){mxUtils.get(m,mxUtils.bind(this,function(X){200<=X.getStatus()&&299>=+X.getStatus()?null!=y&&(X=X.getText(),S&&(Q=null!=Q?Q:"data:image/png;base64,",X=Q+Editor.base64Encode(X)),y(X)):null!=E&&(0==X.getStatus()?E({message:mxResources.get("accessDenied")},X):404==X.getStatus()?E({message:mxResources.get("fileNotFound"),code:X.getStatus()},X):E({message:this.getErrorMessage(X)},X))}),function(X){null!=E&&E({message:mxResources.get("error")+" "+X.getStatus()})},S,this.timeout,function(){O&&null!=E&&E({code:App.ERROR_TIMEOUT,retry:W})},R)});W()}catch(X){null!=E&&E(X)}};+Editor.prototype.getErrorMessage=function(m){var y=mxResources.get("error")+" "+m.getStatus();try{var E=m.getText(),P=JSON.parse(E);null!=P&&null!=P.error&&null!=P.error.message&&(y=P.error.message+" ("+y+")")}catch(O){}return y};Editor.prototype.absoluteCssFonts=function(m){var y=null;if(null!=m){var E=m.split("url(");if(0<E.length){y=[E[0]];m=window.location.pathname;var P=null!=m?m.lastIndexOf("/"):-1;0<=P&&(m=m.substring(0,P+1));P=document.getElementsByTagName("base");var O=null;null!=P&&0<P.length&&+(O=P[0].getAttribute("href"));for(var Q=1;Q<E.length;Q++)if(P=E[Q].indexOf(")"),0<P){var U=Editor.trimCssUrl(E[Q].substring(0,P));this.graph.isRelativeUrl(U)&&(U=null!=O?O+U:window.location.protocol+"//"+window.location.hostname+("/"==U.charAt(0)?"":m)+U);y.push('url("'+U+'"'+E[Q].substring(P))}else y.push(E[Q])}else y=[m]}return null!=y?y.join(""):null};Editor.prototype.mapFontUrl=function(m,y,E){/^https?:\/\//.test(y)&&!this.isCorsEnabledForUrl(y)&&(y=PROXY_URL+"?url="+encodeURIComponent(y));E(m,+y)};Editor.prototype.embedCssFonts=function(m,y){var E=m.split("url("),P=0;null==this.cachedFonts&&(this.cachedFonts={});var O=mxUtils.bind(this,function(){if(0==P){for(var S=[E[0]],W=1;W<E.length;W++){var X=E[W].indexOf(")");S.push('url("');S.push(this.cachedFonts[Editor.trimCssUrl(E[W].substring(0,X))]);S.push('"'+E[W].substring(X))}y(S.join(""))}});if(0<E.length){for(m=1;m<E.length;m++){var Q=E[m].indexOf(")"),U=null,R=E[m].indexOf("format(",Q);0<R&&(U=Editor.trimCssUrl(E[m].substring(R+7,E[m].indexOf(")",+R))));mxUtils.bind(this,function(S){if(null==this.cachedFonts[S]){this.cachedFonts[S]=S;P++;var W="application/x-font-ttf";if("svg"==U||/(\.svg)($|\?)/i.test(S))W="image/svg+xml";else if("otf"==U||"embedded-opentype"==U||/(\.otf)($|\?)/i.test(S))W="application/x-font-opentype";else if("woff"==U||/(\.woff)($|\?)/i.test(S))W="application/font-woff";else if("woff2"==U||/(\.woff2)($|\?)/i.test(S))W="application/font-woff2";else if("eot"==U||/(\.eot)($|\?)/i.test(S))W="application/vnd.ms-fontobject";else if("sfnt"==+U||/(\.sfnt)($|\?)/i.test(S))W="application/font-sfnt";this.mapFontUrl(W,S,mxUtils.bind(this,function(X,Y){this.loadUrl(Y,mxUtils.bind(this,function(Z){this.cachedFonts[S]=Z;P--;O()}),mxUtils.bind(this,function(Z){P--;O()}),!0,null,"data:"+X+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(E[m].substring(0,Q)),U)}O()}else y(m)};Editor.prototype.loadFonts=function(m){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(y){this.resolvedFontCss=y;+null!=m&&m()})):null!=m&&m()};Editor.prototype.createGoogleFontCache=function(){var m={},y;for(y in Graph.fontMapping)Graph.isCssFontUrl(y)&&(m[y]=Graph.fontMapping[y]);return m};Editor.prototype.embedExtFonts=function(m){var y=this.graph.getCustomFonts();if(0<y.length){var E=[],P=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var O=mxUtils.bind(this,function(){0==P&&this.embedCssFonts(E.join(""),m)}),Q=0;Q<y.length;Q++)mxUtils.bind(this,function(U,R){Graph.isCssFontUrl(R)?+null==this.cachedGoogleFonts[R]?(P++,this.loadUrl(Graph.rewriteGoogleFontUrl(R),mxUtils.bind(this,function(S){this.cachedGoogleFonts[R]=S;E.push(S+"\n");P--;O()}),mxUtils.bind(this,function(S){P--;E.push("@import url("+R+");\n");O()}))):E.push(this.cachedGoogleFonts[R]+"\n"):E.push('@font-face {font-family: "'+U+'";src: url("'+R+'")}\n')})(y[Q].name,y[Q].url);O()}else m()};Editor.prototype.addMathCss=function(m){m=m.getElementsByTagName("defs");if(null!=m&&0<m.length)for(var y=document.getElementsByTagName("style"),+E=0;E<y.length;E++){var P=mxUtils.getTextContent(y[E]);0>P.indexOf("mxPageSelector")&&0<P.indexOf("MathJax")&&m[0].appendChild(y[E].cloneNode(!0))}};Editor.prototype.addFontCss=function(m,y){y=null!=y?y:this.absoluteCssFonts(this.fontCss);if(null!=y){var E=mxUtils.getSvgDefs(m),P=y.split("\n");y=[];for(var O=[],Q=0;Q<P.length;Q++)"@import"==P[Q].substring(0,7)?y.push(P[Q]):O.push(P[Q]);m=m.ownerDocument;m=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"style"):m.createElement("style");+m.setAttribute("type","text/css");0<y.length&&(mxUtils.setTextContent(m,y.join("\n")),E.appendChild(m));0<O.length&&(m=m.cloneNode(!1),mxUtils.setTextContent(m,O.join("\n")),E.appendChild(m))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(m,y,E){var P=mxClient.IS_FF?8192:16384;return Math.min(E,Math.min(P/m,P/y))};Editor.prototype.exportToCanvas=function(m,y,E,P,O,Q,U,R,S,W,X,Y,Z,aa,fa,ia,ea,ma){try{Q=+null!=Q?Q:!0;U=null!=U?U:!0;Y=null!=Y?Y:this.graph;Z=null!=Z?Z:0;var na=S?null:Y.background;na==mxConstants.NONE&&(na=null);null==na&&(na=P);null==na&&0==S&&(na="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(Y.getSvg(null,null,Z,aa,null,U,null,null,null,W,null,ia,ea,ma),mxUtils.bind(this,function(ua){try{ua.style.setProperty("-webkit-font-smoothing","antialiased");ua.style.setProperty("-moz-osx-font-smoothing","grayscale");var ta=new Image;ta.onload=mxUtils.bind(this,function(){try{var la=+function(){mxClient.IS_SF?window.setTimeout(function(){ya.drawImage(ta,0,0);m(ja,ua)},0):(ya.drawImage(ta,0,0),m(ja,ua))},ja=document.createElement("canvas"),qa=parseInt(ua.getAttribute("width")),va=parseInt(ua.getAttribute("height"));R=null!=R?R:1;null!=y&&(R=Q?Math.min(1,Math.min(3*y/(4*va),y/qa)):y/qa);R=this.getMaxCanvasScale(qa,va,R);qa=Math.ceil(R*qa);va=Math.ceil(R*va);ja.setAttribute("width",qa);ja.setAttribute("height",va);var ya=ja.getContext("2d");if(null!=na){var ra=mxUtils.getLightDarkColor(na);+ya.beginPath();ya.rect(0,0,qa,va);ya.fillStyle="dark"==ia&&"none"!=Y.getAdaptiveColors()?ra.dark:ra.light;ya.fill()}1!=R&&ya.scale(R,R);if(fa){var ha=Y.view,Da=ha.scale;ha.scale=1;var oa=btoa(unescape(encodeURIComponent(ha.createSvgGrid(ha.gridColor))));ha.scale=Da;oa="data:image/svg+xml;base64,"+oa;var ba=Y.gridSize*ha.gridSteps*R,pa=Y.getGraphBounds(),Ba=ha.translate.x*Da,xa=ha.translate.y*Da,ca=Ba+(pa.x-Ba)/Da-Z,da=xa+(pa.y-xa)/Da-Z,wa=new Image;wa.onload=function(){try{for(var ka=-Math.round(ba-+mxUtils.mod((Ba-ca)*R,ba)),Aa=-Math.round(ba-mxUtils.mod((xa-da)*R,ba));ka<qa;ka+=ba)for(var za=Aa;za<va;za+=ba)ya.drawImage(wa,ka/R,za/R);la()}catch(Ga){null!=O&&O(Ga)}};wa.onerror=function(ka){null!=O&&O(ka)};wa.src=oa}else la()}catch(ka){null!=O&&O(ka)}});ta.onerror=function(la){null!=O&&O(la)};W&&this.graph.addSvgShadow(ua);this.graph.mathEnabled&&this.addMathCss(ua);var sa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ua,this.resolvedFontCss),ta.src=Editor.createSvgDataUri(mxUtils.getXml(ua))}catch(la){null!=+O&&O(la)}});this.embedExtFonts(mxUtils.bind(this,function(la){try{null!=la&&this.addFontCss(ua,la),this.loadFonts(sa)}catch(ja){null!=O&&O(ja)}}))}catch(la){null!=O&&O(la)}}),E,X)}catch(ua){null!=O&&O(ua)}};Editor.crcTable=[];for(var p=0;256>p;p++)for(var q=p,u=0;8>u;u++)q=1==(q&1)?3988292384^q>>>1:q>>>1,Editor.crcTable[p]=q;Editor.updateCRC=function(m,y,E,P){for(var O=0;O<P;O++)m=Editor.crcTable[(m^y.charCodeAt(E+O))&255]^m>>>8;return m};Editor.crc32=function(m){for(var y=-1,E=0;E<m.length;E++)y=+y>>>8^Editor.crcTable[(y^m.charCodeAt(E))&255];return(y^-1)>>>0};Editor.writeGraphModelToPng=function(m,y,E,P,O){function Q(X,Y){var Z=S;S+=Y;return X.substring(Z,S)}function U(X){X=Q(X,4);return X.charCodeAt(3)+(X.charCodeAt(2)<<8)+(X.charCodeAt(1)<<16)+(X.charCodeAt(0)<<24)}function R(X){return String.fromCharCode(X>>24&255,X>>16&255,X>>8&255,X&255)}m=m.substring(m.indexOf(",")+1);m=window.atob?atob(m):Base64.decode(m,!0);var S=0;if(Q(m,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,+10,26,10))null!=O&&O();else if(Q(m,4),"IHDR"!=Q(m,4))null!=O&&O();else{Q(m,17);O=m.substring(0,S);do{var W=U(m);if("IDAT"==Q(m,4)){O=m.substring(0,S-8);"pHYs"==y&&"dpi"==E?(E=Math.round(P/.0254),E=R(E)+R(E)+String.fromCharCode(1)):E=E+String.fromCharCode(0)+("zTXt"==y?String.fromCharCode(0):"")+P;P=4294967295;P=Editor.updateCRC(P,y,0,4);P=Editor.updateCRC(P,E,0,E.length);O+=R(E.length)+y+E+R(P^4294967295);O+=m.substring(S-8,m.length);break}O+=m.substring(S-8,S-4+W);Q(m,W);Q(m,4)}while(W);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 A=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(m,y){A.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var I=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){I.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==+typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(m,y,E){var P=null;if(null!=E)return null;null!=m.editor.graph.getModel().getParent(y)?P=y.getId():null!=m.currentPage&&(P=m.currentPage.getId());return P});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 F=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||+"1"==urlParams.embed||this.editorUi.editor.chromeless?F.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(m){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var D=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(m){m=D.apply(this,arguments);var y=this.editorUi,E=y.editor.graph;if(E.isEnabled()){var P=y.getCurrentFile();null!=P&&P.isAutosaveOptional()&&m.appendChild(this.createOption(mxResources.get("autosave"),+function(){return y.editor.autosave},function(Q){y.editor.setAutosave(Q);y.editor.autosave&&P.isModified()&&P.fileChanged()},{install:function(Q){this.listener=function(){Q(y.editor.autosave)};y.editor.addListener("autosaveChanged",this.listener)},destroy:function(){y.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&E.isEnabled()&&"undefined"!==typeof MathJax){var O=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return E.mathEnabled},function(Q){y.actions.get("mathematicalTypesetting").funct()},+{install:function(Q){this.listener=function(){Q(E.mathEnabled)};y.addListener("mathEnabledChanged",this.listener)},destroy:function(){y.removeListener(this.listener)}});m.appendChild(O);(!y.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&O.appendChild(y.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return m};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.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];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(m){return"0"==mxUtils.getValue(m.style,+"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(m){return"1"==mxUtils.getValue(m.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,isVisible:function(m){return"0"==mxUtils.getValue(m.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",+min:0,defVal:25,isVisible:function(m){return"1"==mxUtils.getValue(m.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",+min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=+[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},+{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},+{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",+type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=+[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];+mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",+type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",+type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",+dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",@@ -13030,88 +13036,88 @@ font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764"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;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var m=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=m.style.shape&&!m.containsLabel&&0<m.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=m.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),m.customProperties,m))};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(m){var y=this.editorUi.getSelectionState();1==y.cells.length?this.addActions(m,["copyStyle","pasteStyle"]):1<=y.cells.length&&this.addActions(m,["pasteStyle","pasteData"]);g.apply(this,arguments);return m};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=-function(m,y,F,N){function O(xa,ra,aa,na,ja){if(null!=aa.valueChanged)aa.valueChanged(ra,ja,F,Y);else{Z.getModel().beginUpdate();try{ja=[];var sa=[];if(null!=aa.index){for(var Ca=[],Fa=aa.parentRow.nextSibling;Fa&&Fa.getAttribute("data-pName")==xa;)Ca.push(Fa.getAttribute("data-pValue")),Fa=Fa.nextSibling;aa.index<Ca.length?null!=na?Ca.splice(na,1):Ca[aa.index]=ra:Ca.push(ra);null!=aa.size&&Ca.length>aa.size&&(Ca=Ca.slice(0,aa.size));ra=Ca.join(",");null!=aa.countProperty&&(Z.setCellStyles(aa.countProperty,-Ca.length,Z.getSelectionCells()),ja.push(aa.countProperty),sa.push(Ca.length))}Z.setCellStyles(xa,ra,Z.getSelectionCells());ja.push(xa);sa.push(ra);if(null!=aa.dependentProps)for(xa=0;xa<aa.dependentProps.length;xa++){var Ba=aa.dependentPropsDefVal[xa],da=aa.dependentPropsVals[xa];if(da.length>ra)da=da.slice(0,ra);else for(var ca=da.length;ca<ra;ca++)da.push(Ba);da=da.join(",");Z.setCellStyles(aa.dependentProps[xa],da,Z.getSelectionCells());ja.push(aa.dependentProps[xa]);sa.push(da)}if("function"==-typeof aa.onChange)aa.onChange(Z,ra);Y.editorUi.fireEvent(new mxEventObject("styleChanged","keys",ja,"values",sa,"cells",Z.getSelectionCells()))}finally{Z.getModel().endUpdate()}}}function P(xa,ra){ra.style.left="0px";ra.style.top="0px";ra.style.position="relative";ra.style.right="0px";ra.style.bottom="0px";ra.style.width="100%";ra.style.maxWidth="100%";ra.style.maxHeight="100%";ra.style.textAlign="left"}function T(xa,ra,aa){function na(sa){if(null==sa||sa==mxConstants.NONE)ja.style.background="url('"+-Dialog.prototype.noColorImage+"')";else if("default"==sa)ja.style.background="";else{var Ca=mxUtils.getLightDarkColor(sa);mxUtils.isLightDarkColor(sa)&&Ca.light!=Ca.dark?ja.style.background="linear-gradient(to right bottom, "+Ca.cssText+" 50%, "+mxUtils.invertLightDarkColor(Ca).cssText+" 50.3%)":ja.style.background=sa}}var ja=document.createElement("div");ja.style.width="32px";ja.style.height="8px";ja.style.margin="2px";ja.style.borderStyle="solid";ja.style.borderWidth="1px";na(ra);btn=mxUtils.button("",-mxUtils.bind(Y,function(sa){this.editorUi.pickColor(ra,function(Ca){O(xa,Ca,aa);na(Ca)});mxEvent.consume(sa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(ja);return btn}function Q(xa,ra,aa,na,ja,sa,Ca){null!=ra&&(ra=ra.split(","),ba.push({name:xa,values:ra,type:aa,defVal:na,countProperty:ja,parentRow:sa,isDeletable:!0,flipBkg:Ca}));btn=mxUtils.button("+",mxUtils.bind(Y,function(Fa){for(var Ba=sa,da=-0;null!=Ba.nextSibling;)if(Ba.nextSibling.getAttribute("data-pName")==xa)Ba=Ba.nextSibling,da++;else break;var ca={type:aa,parentRow:sa,index:da,isDeletable:!0,defVal:na,countProperty:ja};da=X(xa,"",ca,0==da%2,Ca);O(xa,na,ca);Ba.parentNode.insertBefore(da,Ba.nextSibling);mxEvent.consume(Fa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function R(xa,ra,aa,na,ja,sa,Ca){if(0<ja){var Fa=Array(ja);ra=null!=ra?ra.split(","):[];for(var Ba=0;Ba<ja;Ba++)Fa[Ba]=null!=-ra[Ba]?ra[Ba]:null!=na?na:"";ba.push({name:xa,values:Fa,type:aa,defVal:na,parentRow:sa,flipBkg:Ca,size:ja})}return document.createElement("div")}function W(xa,ra,aa){var na=document.createElement("input");na.type="checkbox";na.checked="1"==ra;mxEvent.addListener(na,"change",function(){O(xa,na.checked?"1":"0",aa,null,na)});return na}function X(xa,ra,aa,na,ja){var sa=aa.dispName,Ca=aa.type,Fa=document.createElement("tr");Fa.className="gePropRow"+(ja?"Dark":"")+(na?"Alt":"")+" gePropNonHeaderRow";Fa.setAttribute("data-pName",-xa);Fa.setAttribute("data-pValue",ra);na=!1;null!=aa.index&&(Fa.setAttribute("data-index",aa.index),sa=(null!=sa?sa:"")+"["+aa.index+"]",na=!0);var Ba=document.createElement("td");Ba.className="gePropRowCell";sa=mxResources.get(sa,null,sa);mxUtils.write(Ba,sa);Ba.setAttribute("title",sa);na&&(Ba.style.textAlign="right");Fa.appendChild(Ba);Ba=document.createElement("td");Ba.className="gePropRowCell";Ba.setAttribute("title",null!=ra?decodeURIComponent(ra):mxResources.get("none"));mxEvent.addListener(Ba,-"click",mxUtils.bind(Y,function(ka){!mxUtils.isAncestorNode(Fa,document.activeElement)&&mxUtils.isAncestorNode(Fa.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ka))}));if("color"==Ca)Ba.appendChild(T(xa,ra,aa));else if("bool"==Ca||"boolean"==Ca)Ba.appendChild(W(xa,ra,aa));else if("enum"==Ca){var da=aa.enumList;Ba.innerHTML="";var ca=document.createElement("div");ca.className="gePropValue";Ba.appendChild(ca);-for(ja=0;ja<da.length;ja++)if(sa=da[ja],sa.val==ra){mxUtils.write(ca,mxResources.get(sa.dispName,null,sa.dispName));break}mxEvent.addListener(Ba,"click",mxUtils.bind(Y,function(ka){var za=mxEvent.getSource(ka);if(!(za!=Ba&&za!=ca||mxEvent.isConsumed(ka))){ca.innerHTML="";var ya=document.createElement("select"),Ga=null;P(Ba,ya);for(ka=0;ka<da.length;ka++){za=da[ka];var Ka=document.createElement("option");Ka.value=mxUtils.htmlEntities(za.val);mxUtils.write(Ka,mxResources.get(za.dispName,null,za.dispName));-ya.appendChild(Ka);null==za.val&&(Ka.value="null",Ga=Ka)}ya.value=null==ra&&null!=Ga?"null":ra;ca.appendChild(ya);mxEvent.addListener(ya,"change",function(){var Wa=mxUtils.htmlEntities(ya.value);if(ya[ya.selectedIndex]==Ga||"null"==Wa.value)Wa=null;O(xa,Wa,aa)});ya.focus();mxEvent.addListener(ya,"blur",function(){ca.innerHTML="";for(var Wa=0;Wa<da.length;Wa++){var Pa=da[Wa];if(Pa.val==ya.value){mxUtils.write(ca,mxResources.get(Pa.dispName,null,Pa.dispName));break}}})}}))}else if("dynamicArr"==Ca)Ba.appendChild(Q(xa,-ra,aa.subType,aa.subDefVal,aa.countProperty,Fa,ja));else if("staticArr"==Ca)Ba.appendChild(R(xa,ra,aa.subType,aa.subDefVal,aa.size,Fa,ja));else if("readOnly"==Ca)ja=document.createElement("input"),ja.setAttribute("readonly",""),ja.value=ra,ja.style.borderWidth="0px","id"==xa||"shape"==xa?(Fa.firstChild.innerHTML="",Fa.firstChild.setAttribute("colspan","2"),ja.style.flexGrow="1",ja.style.marginLeft="4px",ja.style.textAlign="id"==xa?"center":"left",ja.setAttribute("title",ra),sa=document.createElement("div"),-mxUtils.write(sa,mxResources.get(xa)+":"),sa.style.display="inline-flex",sa.style.alignItems="center",sa.style.width="100%",sa.appendChild(ja),Fa.firstChild.appendChild(sa)):(ja.style.width="96px",Ba.appendChild(ja));else{Ba.innerHTML="";var wa=document.createElement("div");wa.className="gePropValue";Ba.appendChild(wa);wa.innerHTML=mxUtils.htmlEntities(decodeURIComponent(ra));mxEvent.addListener(Ba,"click",mxUtils.bind(Y,function(ka){function za(){var Ka=Ga.value;Ka=0==Ka.length&&"string"!=Ca&&"numbers"!=-Ca?0:Ka;aa.allowAuto&&(null!=Ka.trim&&"auto"==Ka.trim().toLowerCase()?(Ka="auto",Ca="string"):(Ka=parseFloat(Ka),Ka=isNaN(Ka)?0:Ka));null!=aa.min&&Ka<aa.min?Ka=aa.min:null!=aa.max&&Ka>aa.max&&(Ka=aa.max);var Wa=null;try{Wa="numbers"==Ca?Ka.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==Ca?parseInt(Ka):Ka)+"")}catch(Pa){}O(xa,Wa,aa,null,Ga)}var ya=mxEvent.getSource(ka);if(!(ya!=Ba&&ya!=wa||mxEvent.isConsumed(ka))){wa.innerHTML="";var Ga=document.createElement("input");P(wa,Ga);Ga.value=-decodeURIComponent(ra);Ga.className="gePropEditor";"int"!=Ca&&"float"!=Ca||aa.allowAuto||(Ga.type="number",Ga.step="int"==Ca?"1":"any",null!=aa.min&&(Ga.min=parseFloat(aa.min)),null!=aa.max&&(Ga.max=parseFloat(aa.max)));wa.appendChild(Ga);mxEvent.addListener(Ga,"keypress",function(Ka){13==Ka.keyCode&&za()});Ga.focus();mxEvent.addListener(Ga,"blur",function(){za()})}}))}aa.isDeletable&&(ja=mxUtils.button("-",mxUtils.bind(Y,function(ka){O(xa,"",aa,aa.index);mxEvent.consume(ka)})),ja.style.height="16px",-ja.style.width="25px",ja.style.float="right",ja.className="geColorBtn",Ba.appendChild(ja));Fa.appendChild(Ba);return Fa}var Y=this,Z=this.editorUi.editor.graph,ba=[],ea=document.createElement("table");ea.className="geProperties geFullWidthElement";var ha=document.createElement("tr");ha.className="gePropHeader";var fa=document.createElement("th");fa.className="gePropHeaderCell";fa.style.paddingLeft="16px";fa.style.backgroundRepeat="no-repeat";fa.style.backgroundPosition="-2px 50%";fa.style.backgroundSize=-"20px";mxUtils.write(fa,mxResources.get("property"));ha.style.cursor="pointer";var la=function(){var xa=ea.querySelectorAll(".gePropNonHeaderRow");if(Y.editorUi.propertiesCollapsed){fa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ra="none";for(var aa=m.childNodes.length-1;0<=aa;aa--)try{var na=m.childNodes[aa],ja=na.nodeName.toUpperCase();"INPUT"!=ja&&"SELECT"!=ja||m.removeChild(na)}catch(sa){}}else fa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ra="";for(aa=0;aa<xa.length;aa++)xa[aa].style.display=-ra};mxEvent.addListener(ha,"click",function(){Y.editorUi.propertiesCollapsed=!Y.editorUi.propertiesCollapsed;la()});ha.appendChild(fa);var oa=document.createElement("th");oa.className="gePropHeaderCell";oa.style.paddingLeft="4px";mxUtils.write(oa,mxResources.get("value"));ha.appendChild(oa);ea.appendChild(ha);var pa=oa=!1;ha=null;1==F.vertices.length&&0==F.edges.length?ha=F.vertices[0].id:0==F.vertices.length&&1==F.edges.length&&(ha=F.edges[0].id);null==ha||N||(ea.appendChild(X("id",mxUtils.htmlEntities(ha),-{dispName:"id",type:"readOnly"},!0,!1)),null!=F.style&&null!=F.style.shape&&ea.appendChild(X("shape",mxUtils.htmlEntities(F.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var va in y)if(N=y[va],("function"!=typeof N.isVisible||N.isVisible(F,this))&&!N.primary){var ta=null!=N.getValue?N.getValue(F,this):null!=F.style[va]?mxUtils.htmlEntities(F.style[va]+""):null!=N.getDefaultValue?N.getDefaultValue(F,this):N.defVal;if("separator"==N.type)pa=!pa;else{if("staticArr"==N.type)N.size=parseInt(F.style[N.sizeProperty]||-y[N.sizeProperty].defVal)||0;else if(null!=N.dependentProps){var ma=N.dependentProps,ia=[],qa=[];for(ha=0;ha<ma.length;ha++)if(null!=y[ma[ha]]){var ua=F.style[ma[ha]];qa.push(y[ma[ha]].subDefVal);ia.push(null!=ua?ua.split(","):[])}N.dependentPropsDefVal=qa;N.dependentPropsVals=ia}ea.appendChild(X(va,ta,N,oa,pa));oa=!oa}}for(ha=0;ha<ba.length;ha++)for(N=ba[ha],y=N.parentRow,va=0;va<N.values.length;va++)oa=X(N.name,N.values[va],{type:N.type,parentRow:N.parentRow,isDeletable:N.isDeletable,index:va,defVal:N.defVal,-countProperty:N.countProperty,size:N.size},0==va%2,N.flipBkg),y.parentNode.insertBefore(oa,y.nextSibling),y=oa;m.appendChild(ea);la();return m};StyleFormatPanel.prototype.addStyles=function(m){if(null!=this.defaultColorSchemes){var y=this.editorUi,F=y.editor.graph,N=document.createElement("div");N.style.padding="6px 20px 0 24px";m.appendChild(N);var O=document.createElement("div");O.className="geSwitcher";O.style.padding="4px 18px 6px 0px";for(var P=[],T=0;T<this.defaultColorSchemes.length;T++){var Q=-document.createElement("div");Q.className="geSwitcherDot";mxUtils.bind(this,function(Z){mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){R(Z)}))})(T);P.push(Q);O.appendChild(Q)}var R=mxUtils.bind(this,function(Z){null!=P[Z]&&(null!=this.format.currentScheme&&null!=P[this.format.currentScheme]&&(P[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Z,W(this.defaultColorSchemes[this.format.currentScheme]),P[this.format.currentScheme].style.background="#84d7ff")}),-W=mxUtils.bind(this,function(Z){var ba=mxUtils.clone(F.defaultVertexStyle);ba[mxConstants.STYLE_STROKECOLOR]=null!=ba[mxConstants.STYLE_STROKECOLOR]?ba[mxConstants.STYLE_STROKECOLOR]:"default";ba[mxConstants.STYLE_FILLCOLOR]=null!=ba[mxConstants.STYLE_FILLCOLOR]?ba[mxConstants.STYLE_FILLCOLOR]:"default";ba[mxConstants.STYLE_FONTCOLOR]=null!=ba[mxConstants.STYLE_FONTCOLOR]?ba[mxConstants.STYLE_FONTCOLOR]:"default";F.replaceDefaultColors(new mxCell,ba);var ea=mxUtils.bind(this,function(fa){var la=mxUtils.button("",-mxUtils.bind(this,function(va){F.getModel().beginUpdate();try{for(var ta=y.getSelectionState().cells,ma=0;ma<ta.length;ma++){var ia=F.getModel().getStyle(ta[ma]);null!=fa?(mxEvent.isShiftDown(va)||(ia=""==fa.fill||null==fa.fill?mxUtils.setStyle(ia,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ia,mxConstants.STYLE_FILLCOLOR,fa.fill),ia=""==fa.gradient||null==fa.gradient?mxUtils.setStyle(ia,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ia,mxConstants.STYLE_GRADIENTCOLOR,fa.gradient),mxEvent.isControlDown(va)||-mxClient.IS_MAC&&mxEvent.isMetaDown(va)||!F.getModel().isVertex(ta[ma])||(ia=""==fa.font||null==fa.font?mxUtils.setStyle(ia,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ia,mxConstants.STYLE_FONTCOLOR,fa.font))),mxEvent.isAltDown(va)||(ia=""==fa.stroke||null==fa.fill?mxUtils.setStyle(ia,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ia,mxConstants.STYLE_STROKECOLOR,fa.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),F.getModel().isVertex(ta[ma])&&(ia=mxUtils.setStyle(ia,mxConstants.STYLE_FONTCOLOR,null)));F.getModel().setStyle(ta[ma],ia)}}finally{F.getModel().endUpdate()}}));la.className="geStyleButton";la.style.width="36px";la.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";la.style.margin="0px 6px 6px 0px";if(null!=fa){var oa="1px solid";null!=fa.border&&(oa=fa.border);if(null!=fa.gradient)la.style.backgroundImage="linear-gradient("+-mxUtils.getLightDarkColor(fa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(fa.gradient).cssText+" 100%)";else if(fa.fill==mxConstants.NONE)la.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==fa.fill||""==fa.fill)la.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ba,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var pa=mxUtils.getLightDarkColor(fa.fill);la.style.backgroundImage="linear-gradient(to right bottom, "+pa.cssText+" 50%, "+pa.light+" 50.3%)"}null==-fa.stroke||fa.stroke==mxConstants.NONE?la.style.border=oa+" transparent":""==fa.stroke?la.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ba,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(pa=mxUtils.getLightDarkColor(fa.stroke),la.style.border=oa+" "+pa.cssText,la.style.borderRightColor=pa.light,la.style.borderBottomColor=la.style.borderRightColor);null!=fa.title&&la.setAttribute("title",fa.title)}else oa=mxUtils.getValue(ba,mxConstants.STYLE_FILLCOLOR,"#ffffff"),pa=mxUtils.getValue(ba,-mxConstants.STYLE_STROKECOLOR,"#000000"),la.style.backgroundColor=oa,la.style.border="1px solid "+pa;la.style.borderRadius="0";N.appendChild(la);null!=fa&&null!=fa.gradient&&(oa=la.cloneNode(!1),oa.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(fa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(fa.gradient).light+") 100%)",oa.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",oa.style.backgroundColor="transparent",N.appendChild(oa),-oa.style.marginLeft="-42px",mxEvent.addListener(oa,"click",function(){la.click()}))});N.innerText="";if(null!=Z)for(var ha=0;ha<Z.length;ha++)0<ha&&0==mxUtils.mod(ha,4)&&mxUtils.br(N),ea(Z[ha])});null==this.format.currentScheme?R(Math.min(P.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):R(this.format.currentScheme);T=10>=this.defaultColorSchemes.length?43:23;var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:0px;bottom:"+T+"px;width:20px;background-image:url("+-Editor.chevronLeftImage+");";mxEvent.addListener(X,"click",mxUtils.bind(this,function(){R(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var Y=document.createElement("div");Y.className="geButton";Y.style.cssText="position:absolute;left:186px;bottom:"+T+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(m.appendChild(X),m.appendChild(Y));mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){R(mxUtils.mod(this.format.currentScheme++function(m,y,E,P){function O(ya,ra,ha,Da,oa){if(null!=ha.valueChanged)ha.valueChanged(ra,oa,E,Y);else{Z.getModel().beginUpdate();try{oa=[];var ba=[];if(null!=ha.index){for(var pa=[],Ba=ha.parentRow.nextSibling;Ba&&Ba.getAttribute("data-pName")==ya;)pa.push(Ba.getAttribute("data-pValue")),Ba=Ba.nextSibling;ha.index<pa.length?null!=Da?pa.splice(Da,1):pa[ha.index]=ra:pa.push(ra);null!=ha.size&&pa.length>ha.size&&(pa=pa.slice(0,ha.size));ra=pa.join(",");null!=ha.countProperty&&(Z.setCellStyles(ha.countProperty,+pa.length,Z.getSelectionCells()),oa.push(ha.countProperty),ba.push(pa.length))}Z.setCellStyles(ya,ra,Z.getSelectionCells());oa.push(ya);ba.push(ra);if(null!=ha.dependentProps)for(ya=0;ya<ha.dependentProps.length;ya++){var xa=ha.dependentPropsDefVal[ya],ca=ha.dependentPropsVals[ya];if(ca.length>ra)ca=ca.slice(0,ra);else for(var da=ca.length;da<ra;da++)ca.push(xa);ca=ca.join(",");Z.setCellStyles(ha.dependentProps[ya],ca,Z.getSelectionCells());oa.push(ha.dependentProps[ya]);ba.push(ca)}if("function"==+typeof ha.onChange)ha.onChange(Z,ra);Y.editorUi.fireEvent(new mxEventObject("styleChanged","keys",oa,"values",ba,"cells",Z.getSelectionCells()))}finally{Z.getModel().endUpdate()}}}function Q(ya,ra){ra.style.left="0px";ra.style.top="0px";ra.style.position="relative";ra.style.right="0px";ra.style.bottom="0px";ra.style.width="100%";ra.style.maxWidth="100%";ra.style.maxHeight="100%";ra.style.textAlign="left"}function U(ya,ra,ha){function Da(ba){if(null==ba||ba==mxConstants.NONE)oa.style.background="url('"++Dialog.prototype.noColorImage+"')";else if("default"==ba)oa.style.background="";else{var pa=mxUtils.getLightDarkColor(ba);mxUtils.isLightDarkColor(ba)&&pa.light!=pa.dark?oa.style.background="linear-gradient(to right bottom, "+pa.cssText+" 50%, "+mxUtils.invertLightDarkColor(pa).cssText+" 50.3%)":oa.style.background=ba}}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";Da(ra);btn=mxUtils.button("",+mxUtils.bind(Y,function(ba){this.editorUi.pickColor(ra,function(pa){O(ya,pa,ha);Da(pa)});mxEvent.consume(ba)}));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 R(ya,ra,ha,Da,oa,ba,pa){null!=ra&&(ra=ra.split(","),aa.push({name:ya,values:ra,type:ha,defVal:Da,countProperty:oa,parentRow:ba,isDeletable:!0,flipBkg:pa}));btn=mxUtils.button("+",mxUtils.bind(Y,function(Ba){for(var xa=ba,ca=+0;null!=xa.nextSibling;)if(xa.nextSibling.getAttribute("data-pName")==ya)xa=xa.nextSibling,ca++;else break;var da={type:ha,parentRow:ba,index:ca,isDeletable:!0,defVal:Da,countProperty:oa};ca=X(ya,"",da,0==ca%2,pa);O(ya,Da,da);xa.parentNode.insertBefore(ca,xa.nextSibling);mxEvent.consume(Ba)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function S(ya,ra,ha,Da,oa,ba,pa){if(0<oa){var Ba=Array(oa);ra=null!=ra?ra.split(","):[];for(var xa=0;xa<oa;xa++)Ba[xa]=null!=+ra[xa]?ra[xa]:null!=Da?Da:"";aa.push({name:ya,values:Ba,type:ha,defVal:Da,parentRow:ba,flipBkg:pa,size:oa})}return document.createElement("div")}function W(ya,ra,ha){var Da=document.createElement("input");Da.type="checkbox";Da.checked="1"==ra;mxEvent.addListener(Da,"change",function(){O(ya,Da.checked?"1":"0",ha,null,Da)});return Da}function X(ya,ra,ha,Da,oa){var ba=ha.dispName,pa=ha.type,Ba=document.createElement("tr");Ba.className="gePropRow"+(oa?"Dark":"")+(Da?"Alt":"")+" gePropNonHeaderRow";Ba.setAttribute("data-pName",+ya);Ba.setAttribute("data-pValue",ra);Da=!1;null!=ha.index&&(Ba.setAttribute("data-index",ha.index),ba=(null!=ba?ba:"")+"["+ha.index+"]",Da=!0);var xa=document.createElement("td");xa.className="gePropRowCell";ba=mxResources.get(ba,null,ba);mxUtils.write(xa,ba);xa.setAttribute("title",ba);Da&&(xa.style.textAlign="right");Ba.appendChild(xa);xa=document.createElement("td");xa.className="gePropRowCell";xa.setAttribute("title",null!=ra?decodeURIComponent(ra):mxResources.get("none"));mxEvent.addListener(xa,+"click",mxUtils.bind(Y,function(ka){!mxUtils.isAncestorNode(Ba,document.activeElement)&&mxUtils.isAncestorNode(Ba.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ka))}));if("color"==pa)xa.appendChild(U(ya,ra,ha));else if("bool"==pa||"boolean"==pa)xa.appendChild(W(ya,ra,ha));else if("enum"==pa){var ca=ha.enumList;xa.innerHTML="";var da=document.createElement("div");da.className="gePropValue";xa.appendChild(da);+for(oa=0;oa<ca.length;oa++)if(ba=ca[oa],ba.val==ra){mxUtils.write(da,mxResources.get(ba.dispName,null,ba.dispName));break}mxEvent.addListener(xa,"click",mxUtils.bind(Y,function(ka){var Aa=mxEvent.getSource(ka);if(!(Aa!=xa&&Aa!=da||mxEvent.isConsumed(ka))){da.innerHTML="";var za=document.createElement("select"),Ga=null;Q(xa,za);for(ka=0;ka<ca.length;ka++){Aa=ca[ka];var Ka=document.createElement("option");Ka.value=mxUtils.htmlEntities(Aa.val);mxUtils.write(Ka,mxResources.get(Aa.dispName,null,Aa.dispName));+za.appendChild(Ka);null==Aa.val&&(Ka.value="null",Ga=Ka)}za.value=null==ra&&null!=Ga?"null":ra;da.appendChild(za);mxEvent.addListener(za,"change",function(){var Wa=mxUtils.htmlEntities(za.value);if(za[za.selectedIndex]==Ga||"null"==Wa.value)Wa=null;O(ya,Wa,ha)});za.focus();mxEvent.addListener(za,"blur",function(){da.innerHTML="";for(var Wa=0;Wa<ca.length;Wa++){var Pa=ca[Wa];if(Pa.val==za.value){mxUtils.write(da,mxResources.get(Pa.dispName,null,Pa.dispName));break}}})}}))}else if("dynamicArr"==pa)xa.appendChild(R(ya,+ra,ha.subType,ha.subDefVal,ha.countProperty,Ba,oa));else if("staticArr"==pa)xa.appendChild(S(ya,ra,ha.subType,ha.subDefVal,ha.size,Ba,oa));else if("readOnly"==pa)oa=document.createElement("input"),oa.setAttribute("readonly",""),oa.value=ra,oa.style.borderWidth="0px","id"==ya||"shape"==ya?(Ba.firstChild.innerHTML="",Ba.firstChild.setAttribute("colspan","2"),oa.style.flexGrow="1",oa.style.marginLeft="4px",oa.style.textAlign="id"==ya?"center":"left",oa.setAttribute("title",ra),ba=document.createElement("div"),+mxUtils.write(ba,mxResources.get(ya)+":"),ba.style.display="inline-flex",ba.style.alignItems="center",ba.style.width="100%",ba.appendChild(oa),Ba.firstChild.appendChild(ba)):(oa.style.width="96px",xa.appendChild(oa));else{xa.innerHTML="";var wa=document.createElement("div");wa.className="gePropValue";xa.appendChild(wa);wa.innerHTML=mxUtils.htmlEntities(decodeURIComponent(ra));mxEvent.addListener(xa,"click",mxUtils.bind(Y,function(ka){function Aa(){var Ka=Ga.value;Ka=0==Ka.length&&"string"!=pa&&"numbers"!=+pa?0:Ka;ha.allowAuto&&(null!=Ka.trim&&"auto"==Ka.trim().toLowerCase()?(Ka="auto",pa="string"):(Ka=parseFloat(Ka),Ka=isNaN(Ka)?0:Ka));null!=ha.min&&Ka<ha.min?Ka=ha.min:null!=ha.max&&Ka>ha.max&&(Ka=ha.max);var Wa=null;try{Wa="numbers"==pa?Ka.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==pa?parseInt(Ka):Ka)+"")}catch(Pa){}O(ya,Wa,ha,null,Ga)}var za=mxEvent.getSource(ka);if(!(za!=xa&&za!=wa||mxEvent.isConsumed(ka))){wa.innerHTML="";var Ga=document.createElement("input");Q(wa,Ga);Ga.value=+decodeURIComponent(ra);Ga.className="gePropEditor";"int"!=pa&&"float"!=pa||ha.allowAuto||(Ga.type="number",Ga.step="int"==pa?"1":"any",null!=ha.min&&(Ga.min=parseFloat(ha.min)),null!=ha.max&&(Ga.max=parseFloat(ha.max)));wa.appendChild(Ga);mxEvent.addListener(Ga,"keypress",function(Ka){13==Ka.keyCode&&Aa()});Ga.focus();mxEvent.addListener(Ga,"blur",function(){Aa()})}}))}ha.isDeletable&&(oa=mxUtils.button("-",mxUtils.bind(Y,function(ka){O(ya,"",ha,ha.index);mxEvent.consume(ka)})),oa.style.height="16px",+oa.style.width="25px",oa.style.float="right",oa.className="geColorBtn",xa.appendChild(oa));Ba.appendChild(xa);return Ba}var Y=this,Z=this.editorUi.editor.graph,aa=[],fa=document.createElement("table");fa.className="geProperties geFullWidthElement";var ia=document.createElement("tr");ia.className="gePropHeader";var ea=document.createElement("th");ea.className="gePropHeaderCell";ea.style.paddingLeft="16px";ea.style.backgroundRepeat="no-repeat";ea.style.backgroundPosition="-2px 50%";ea.style.backgroundSize=+"20px";mxUtils.write(ea,mxResources.get("property"));ia.style.cursor="pointer";var ma=function(){var ya=fa.querySelectorAll(".gePropNonHeaderRow");if(Y.editorUi.propertiesCollapsed){ea.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ra="none";for(var ha=m.childNodes.length-1;0<=ha;ha--)try{var Da=m.childNodes[ha],oa=Da.nodeName.toUpperCase();"INPUT"!=oa&&"SELECT"!=oa||m.removeChild(Da)}catch(ba){}}else ea.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ra="";for(ha=0;ha<ya.length;ha++)ya[ha].style.display=+ra};mxEvent.addListener(ia,"click",function(){Y.editorUi.propertiesCollapsed=!Y.editorUi.propertiesCollapsed;ma()});ia.appendChild(ea);var na=document.createElement("th");na.className="gePropHeaderCell";na.style.paddingLeft="4px";mxUtils.write(na,mxResources.get("value"));ia.appendChild(na);fa.appendChild(ia);var ua=na=!1;ia=null;1==E.vertices.length&&0==E.edges.length?ia=E.vertices[0].id:0==E.vertices.length&&1==E.edges.length&&(ia=E.edges[0].id);null==ia||P||(fa.appendChild(X("id",mxUtils.htmlEntities(ia),+{dispName:"id",type:"readOnly"},!0,!1)),null!=E.style&&null!=E.style.shape&&fa.appendChild(X("shape",mxUtils.htmlEntities(E.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var ta in y)if(P=y[ta],("function"!=typeof P.isVisible||P.isVisible(E,this))&&!P.primary){var sa=null!=P.getValue?P.getValue(E,this):null!=E.style[ta]?mxUtils.htmlEntities(E.style[ta]+""):null!=P.getDefaultValue?P.getDefaultValue(E,this):P.defVal;if("separator"==P.type)ua=!ua;else{if("staticArr"==P.type)P.size=parseInt(E.style[P.sizeProperty]||+y[P.sizeProperty].defVal)||0;else if(null!=P.dependentProps){var la=P.dependentProps,ja=[],qa=[];for(ia=0;ia<la.length;ia++)if(null!=y[la[ia]]){var va=E.style[la[ia]];qa.push(y[la[ia]].subDefVal);ja.push(null!=va?va.split(","):[])}P.dependentPropsDefVal=qa;P.dependentPropsVals=ja}fa.appendChild(X(ta,sa,P,na,ua));na=!na}}for(ia=0;ia<aa.length;ia++)for(P=aa[ia],y=P.parentRow,ta=0;ta<P.values.length;ta++)na=X(P.name,P.values[ta],{type:P.type,parentRow:P.parentRow,isDeletable:P.isDeletable,index:ta,defVal:P.defVal,+countProperty:P.countProperty,size:P.size},0==ta%2,P.flipBkg),y.parentNode.insertBefore(na,y.nextSibling),y=na;m.appendChild(fa);ma();return m};StyleFormatPanel.prototype.addStyles=function(m){if(null!=this.defaultColorSchemes){var y=this.editorUi,E=y.editor.graph,P=document.createElement("div");P.style.padding="6px 20px 0 24px";m.appendChild(P);var O=document.createElement("div");O.className="geSwitcher";O.style.padding="4px 18px 6px 0px";for(var Q=[],U=0;U<this.defaultColorSchemes.length;U++){var R=+document.createElement("div");R.className="geSwitcherDot";mxUtils.bind(this,function(Z){mxEvent.addListener(R,"click",mxUtils.bind(this,function(){S(Z)}))})(U);Q.push(R);O.appendChild(R)}var S=mxUtils.bind(this,function(Z){null!=Q[Z]&&(null!=this.format.currentScheme&&null!=Q[this.format.currentScheme]&&(Q[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Z,W(this.defaultColorSchemes[this.format.currentScheme]),Q[this.format.currentScheme].style.background="#84d7ff")}),+W=mxUtils.bind(this,function(Z){var aa=mxUtils.clone(E.defaultVertexStyle);aa[mxConstants.STYLE_STROKECOLOR]=null!=aa[mxConstants.STYLE_STROKECOLOR]?aa[mxConstants.STYLE_STROKECOLOR]:"default";aa[mxConstants.STYLE_FILLCOLOR]=null!=aa[mxConstants.STYLE_FILLCOLOR]?aa[mxConstants.STYLE_FILLCOLOR]:"default";aa[mxConstants.STYLE_FONTCOLOR]=null!=aa[mxConstants.STYLE_FONTCOLOR]?aa[mxConstants.STYLE_FONTCOLOR]:"default";E.replaceDefaultColors(new mxCell,aa);var fa=mxUtils.bind(this,function(ea){var ma=mxUtils.button("",+mxUtils.bind(this,function(ta){E.getModel().beginUpdate();try{for(var sa=y.getSelectionState().cells,la=0;la<sa.length;la++){var ja=E.getModel().getStyle(sa[la]);null!=ea?(mxEvent.isShiftDown(ta)||(ja=""==ea.fill||null==ea.fill?mxUtils.setStyle(ja,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ja,mxConstants.STYLE_FILLCOLOR,ea.fill),ja=""==ea.gradient||null==ea.gradient?mxUtils.setStyle(ja,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ja,mxConstants.STYLE_GRADIENTCOLOR,ea.gradient),mxEvent.isControlDown(ta)||+mxClient.IS_MAC&&mxEvent.isMetaDown(ta)||!E.getModel().isVertex(sa[la])||(ja=""==ea.font||null==ea.font?mxUtils.setStyle(ja,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ja,mxConstants.STYLE_FONTCOLOR,ea.font))),mxEvent.isAltDown(ta)||(ja=""==ea.stroke||null==ea.fill?mxUtils.setStyle(ja,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ja,mxConstants.STYLE_STROKECOLOR,ea.stroke))):(ja=mxUtils.setStyle(ja,mxConstants.STYLE_FILLCOLOR,null),ja=mxUtils.setStyle(ja,mxConstants.STYLE_STROKECOLOR,+null),ja=mxUtils.setStyle(ja,mxConstants.STYLE_GRADIENTCOLOR,null),E.getModel().isVertex(sa[la])&&(ja=mxUtils.setStyle(ja,mxConstants.STYLE_FONTCOLOR,null)));E.getModel().setStyle(sa[la],ja)}}finally{E.getModel().endUpdate()}}));ma.className="geStyleButton";ma.style.width="36px";ma.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ma.style.margin="0px 6px 6px 0px";if(null!=ea){var na="1px solid";null!=ea.border&&(na=ea.border);if(null!=ea.gradient)ma.style.backgroundImage="linear-gradient("++mxUtils.getLightDarkColor(ea.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(ea.gradient).cssText+" 100%)";else if(ea.fill==mxConstants.NONE)ma.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==ea.fill||""==ea.fill)ma.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(aa,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ua=mxUtils.getLightDarkColor(ea.fill);ma.style.backgroundImage="linear-gradient(to right bottom, "+ua.cssText+" 50%, "+ua.light+" 50.3%)"}null==+ea.stroke||ea.stroke==mxConstants.NONE?ma.style.border=na+" transparent":""==ea.stroke?ma.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(aa,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ua=mxUtils.getLightDarkColor(ea.stroke),ma.style.border=na+" "+ua.cssText,ma.style.borderRightColor=ua.light,ma.style.borderBottomColor=ma.style.borderRightColor);null!=ea.title&&ma.setAttribute("title",ea.title)}else na=mxUtils.getValue(aa,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ua=mxUtils.getValue(aa,+mxConstants.STYLE_STROKECOLOR,"#000000"),ma.style.backgroundColor=na,ma.style.border="1px solid "+ua;ma.style.borderRadius="0";P.appendChild(ma);null!=ea&&null!=ea.gradient&&(na=ma.cloneNode(!1),na.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(ea.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(ea.gradient).light+") 100%)",na.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",na.style.backgroundColor="transparent",P.appendChild(na),+na.style.marginLeft="-42px",mxEvent.addListener(na,"click",function(){ma.click()}))});P.innerText="";if(null!=Z)for(var ia=0;ia<Z.length;ia++)0<ia&&0==mxUtils.mod(ia,4)&&mxUtils.br(P),fa(Z[ia])});null==this.format.currentScheme?S(Math.min(Q.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):S(this.format.currentScheme);U=10>=this.defaultColorSchemes.length?43:23;var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:0px;bottom:"+U+"px;width:20px;background-image:url("++Editor.chevronLeftImage+");";mxEvent.addListener(X,"click",mxUtils.bind(this,function(){S(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var Y=document.createElement("div");Y.className="geButton";Y.style.cssText="position:absolute;left:186px;bottom:"+U+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(m.appendChild(X),m.appendChild(Y));mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){S(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));W(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&m.appendChild(O)}return m}}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(m){return m.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||-m.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(m){return Graph.isGoogleFontUrl(m)};Graph.rewriteGoogleFontUrl=function(m){null!=m&&m.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(m=Editor.GOOGLE_FONTS_CSS2+m.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return m};Graph.createFontElement=function(m,y){var F=Graph.fontMapping[y];null==F&&Graph.isCssFontUrl(y)?(m=document.createElement("link"),m.setAttribute("rel","stylesheet"),-m.setAttribute("type","text/css"),m.setAttribute("charset","UTF-8"),m.setAttribute("href",Graph.rewriteGoogleFontUrl(y))):(null==F&&(F='@font-face {\nfont-family: "'+m+'";\nsrc: url("'+y+'");\n}'),m=document.createElement("style"),mxUtils.write(m,F));return m};Graph.addRecentCustomFont=function(m,y){};Graph.addFont=function(m,y,F,N){if(null!=m&&0<m.length&&null!=y&&0<y.length){N=null!=N?N:Graph.customFontElements;var O=m.toLowerCase();if("helvetica"!=O&&"arial"!=m&&"sans-serif"!=O){var P=N[O];null!=-P&&P.url!=y&&(P.elt.parentNode.removeChild(P.elt),P=null);null==P?(P=y,"http:"==y.substring(0,5)&&(P=PROXY_URL+"?url="+encodeURIComponent(y)),P={name:m,url:y,elt:Graph.createFontElement(m,P)},N[O]=P,y=N==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=F&&("link"==P.elt.nodeName.toLowerCase()?(P.elt.onload=F,P.elt.onerror=F):F()),null!=y&&y.appendChild(P.elt)):null!=F&&F()}else null!=F&&F()}else null!=F&&F();return m};Graph.getFontUrl=function(m,y){m=Graph.customFontElements[m.toLowerCase()];-null!=m&&(y=m.url);return y};Graph.processFontAttributes=function(m){m=m.getElementsByTagName("*");for(var y=0;y<m.length;y++){var F=m[y].getAttribute("data-font-src");if(null!=F){var N="FONT"==m[y].nodeName?m[y].getAttribute("face"):m[y].style.fontFamily;null!=N&&Graph.addFont(N,F)}}};Graph.processFontStyle=function(m){if(null!=m){var y=mxUtils.getValue(m,"fontSource",null);if(null!=y){var F=mxUtils.getValue(m,mxConstants.STYLE_FONTFAMILY,null);if(null!=F)try{Graph.addFont(F,decodeURIComponent(y))}catch(N){}}}return m};+m.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(m){return Graph.isGoogleFontUrl(m)};Graph.rewriteGoogleFontUrl=function(m){null!=m&&m.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(m=Editor.GOOGLE_FONTS_CSS2+m.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return m};Graph.createFontElement=function(m,y){var E=Graph.fontMapping[y];null==E&&Graph.isCssFontUrl(y)?(m=document.createElement("link"),m.setAttribute("rel","stylesheet"),+m.setAttribute("type","text/css"),m.setAttribute("charset","UTF-8"),m.setAttribute("href",Graph.rewriteGoogleFontUrl(y))):(null==E&&(E='@font-face {\nfont-family: "'+m+'";\nsrc: url("'+y+'");\n}'),m=document.createElement("style"),mxUtils.write(m,E));return m};Graph.addRecentCustomFont=function(m,y){};Graph.addFont=function(m,y,E,P){if(null!=m&&0<m.length&&null!=y&&0<y.length){P=null!=P?P:Graph.customFontElements;var O=m.toLowerCase();if("helvetica"!=O&&"arial"!=m&&"sans-serif"!=O){var Q=P[O];null!=+Q&&Q.url!=y&&(Q.elt.parentNode.removeChild(Q.elt),Q=null);null==Q?(Q=y,"http:"==y.substring(0,5)&&(Q=PROXY_URL+"?url="+encodeURIComponent(y)),Q={name:m,url:y,elt:Graph.createFontElement(m,Q)},P[O]=Q,y=P==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=E&&("link"==Q.elt.nodeName.toLowerCase()?(Q.elt.onload=E,Q.elt.onerror=E):E()),null!=y&&y.appendChild(Q.elt)):null!=E&&E()}else null!=E&&E()}else null!=E&&E();return m};Graph.getFontUrl=function(m,y){m=Graph.customFontElements[m.toLowerCase()];+null!=m&&(y=m.url);return y};Graph.processFontAttributes=function(m){m=m.getElementsByTagName("*");for(var y=0;y<m.length;y++){var E=m[y].getAttribute("data-font-src");if(null!=E){var P="FONT"==m[y].nodeName?m[y].getAttribute("face"):m[y].style.fontFamily;null!=P&&Graph.addFont(P,E)}}};Graph.processFontStyle=function(m){if(null!=m){var y=mxUtils.getValue(m,"fontSource",null);if(null!=y){var E=mxUtils.getValue(m,mxConstants.STYLE_FONTFAMILY,null);if(null!=E)try{Graph.addFont(E,decodeURIComponent(y))}catch(P){}}}return m};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.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var l=Graph.prototype.init;Graph.prototype.init=function(){function m(O){y=-O}l.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var y=null;mxEvent.addListener(this.container,"mouseenter",m);mxEvent.addListener(this.container,"mousemove",m);mxEvent.addListener(this.container,"mouseleave",function(O){y=null});this.isMouseInsertPoint=function(){return null!=y};var F=this.getInsertPoint;this.getInsertPoint=function(O){return null==y||O?F.apply(this,arguments):this.getPointForEvent(y)};var N=this.layoutManager.getLayout;this.layoutManager.getLayout=-function(O){var P=this.graph.getCellStyle(O);if(null!=P&&"rack"==P.childLayout){var T=new mxStackLayout(this.graph,!1);T.gridSize=null!=P.rackUnitSize?parseFloat(P.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;T.marginLeft=P.marginLeft||0;T.marginRight=P.marginRight||0;T.marginTop=P.marginTop||0;T.marginBottom=P.marginBottom||0;T.allowGaps=P.allowGaps||0;T.horizontal="1"==mxUtils.getValue(P,"horizontalRack","0");T.resizeParent=!1;T.fill=!0;return T}return N.apply(this,-arguments)};this.updateGlobalUrlVariables()};var n=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(m,y){return Graph.processFontStyle(n.apply(this,arguments))};var v=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(m,y,F,N,O,P,T,Q,R,W,X,Y){v.apply(this,arguments);Graph.processFontAttributes(Y)};var x=mxText.prototype.redraw;mxText.prototype.redraw=function(){x.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&-Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(m,y,F,N){function O(){for(var ha=Q.getSelectionCells(),fa=[],la=0;la<ha.length;la++)Q.isCellVisible(ha[la])&&fa.push(ha[la]);Q.setSelectionCells(fa)}function P(ha){Q.setHiddenTags(ha?[]:R.slice());O();Q.refresh()}function T(ha,fa){X.innerText="";if(0<ha.length){var la=document.createElement("table");la.setAttribute("cellpadding","2");la.style.boxSizing="border-box";la.style.tableLayout="fixed";la.style.width="100%";-var oa=document.createElement("tbody");if(null!=ha&&0<ha.length)for(var pa=0;pa<ha.length;pa++)(function(va){function ta(){var ra=Q.getCellsForTags([va],null,null,!0);Q.isEnabled()?Q.setSelectionCells(ra):Q.highlightCells(ra,null,null,70)}var ma=0>mxUtils.indexOf(Q.hiddenTags,va),ia=document.createElement("tr"),qa=document.createElement("td");qa.style.align="center";qa.style.width="16px";var ua=document.createElement("img");ua.setAttribute("src",ma?Editor.visibleImage:Editor.hiddenImage);ua.setAttribute("title",-mxResources.get(ma?"hideIt":"show",[va]));mxUtils.setOpacity(ua,ma?75:25);ua.className="geAdaptiveAsset";ua.style.verticalAlign="middle";ua.style.cursor="pointer";ua.style.width="16px";if(y||Editor.isDarkMode())ua.style.filter="invert(100%)";qa.appendChild(ua);mxEvent.addListener(ua,"click",function(ra){mxEvent.isShiftDown(ra)?P(0<=mxUtils.indexOf(Q.hiddenTags,va)):(Q.toggleHiddenTag(va),O(),Q.refresh());mxEvent.consume(ra)});ia.appendChild(qa);qa=document.createElement("td");qa.style.align="center";-qa.style.width="16px";ua=document.createElement("img");ua.setAttribute("src",Editor.selectImage);ua.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(ua,ma?75:25);ua.className="geAdaptiveAsset";ua.style.verticalAlign="middle";ua.style.cursor="pointer";ua.style.width="16px";if(y||Editor.isDarkMode())ua.style.filter="invert(100%)";mxEvent.addListener(ua,"click",function(ra){P(!0);ta();mxEvent.consume(ra)});qa.appendChild(ua);ia.appendChild(qa);qa=document.createElement("td");qa.style.overflow=-"hidden";qa.style.whiteSpace="nowrap";qa.style.textOverflow="ellipsis";qa.style.verticalAlign="middle";qa.style.cursor="pointer";qa.setAttribute("title",va);a=document.createElement("a");mxUtils.write(a,va);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,ma?100:40);qa.appendChild(a);mxEvent.addListener(qa,"click",function(ra){if(mxEvent.isShiftDown(ra))P(!0),ta();else if(ma&&0<Q.hiddenTags.length)P(!0);else{var aa=R.slice(),na=mxUtils.indexOf(aa,va);aa.splice(na,1);-Q.setHiddenTags(aa);O();Q.refresh()}mxEvent.consume(ra)});ia.appendChild(qa);if(Q.isEnabled()){qa=document.createElement("td");qa.style.verticalAlign="middle";qa.style.textAlign="center";qa.style.width="18px";if(null==fa){qa.style.align="center";qa.style.width="16px";ua=document.createElement("img");ua.setAttribute("src",Editor.trashImage);ua.setAttribute("title",mxResources.get("removeIt",[va]));mxUtils.setOpacity(ua,ma?75:25);ua.className="geAdaptiveAsset";ua.style.verticalAlign="middle";ua.style.cursor=-"pointer";ua.style.width="16px";if(y||Editor.isDarkMode())ua.style.filter="invert(100%)";mxEvent.addListener(ua,"click",function(ra){var aa=mxUtils.indexOf(R,va);0<=aa&&R.splice(aa,1);Q.removeTagsForCells(Q.model.getDescendants(Q.model.getRoot()),[va]);Q.refresh();mxEvent.consume(ra)});qa.appendChild(ua)}else{var xa=document.createElement("input");xa.setAttribute("type","checkbox");xa.style.margin="0px";xa.defaultChecked=null!=fa&&0<=mxUtils.indexOf(fa,va);xa.checked=xa.defaultChecked;xa.style.background=-"transparent";xa.setAttribute("title",mxResources.get(xa.defaultChecked?"removeIt":"add",[va]));mxEvent.addListener(xa,"change",function(ra){xa.checked?Q.addTagsForCells(Q.getSelectionCells(),[va]):Q.removeTagsForCells(Q.getSelectionCells(),[va]);mxEvent.consume(ra)});qa.appendChild(xa)}ia.appendChild(qa)}oa.appendChild(ia)})(ha[pa]);la.appendChild(oa);X.appendChild(la)}}var Q=this,R=Q.hiddenTags.slice(),W=document.createElement("div");W.style.userSelect="none";W.style.overflow="hidden";W.style.padding=-"10px";W.style.height="100%";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.userSelect="none";X.style.overflow="auto";X.style.padding="3px";X.style.left="0px";X.style.right="0px";X.style.top="0px";X.style.bottom="0px";W.appendChild(X);Q.addListener(mxEvent.ROOT,function(){R=Q.hiddenTags.slice()});var Y=mxUtils.bind(this,function(ha,fa){if(m()){ha=Q.getAllTags();for(fa=0;fa<ha.length;fa++)0>mxUtils.indexOf(R,ha[fa])&&R.push(ha[fa]);R.sort();Q.isSelectionEmpty()?-T(R):T(R,Q.getCommonTagsForCells(Q.getSelectionCells()))}});Q.selectionModel.addListener(mxEvent.CHANGE,Y);Q.model.addListener(mxEvent.CHANGE,Y);Q.addListener(mxEvent.REFRESH,Y);var Z=document.createElement("div");Z.className="geToolbarContainer geDialogToolbar";Z.style.position="absolute";Z.style.display="flex";Z.style.bottom="0px";Z.style.left="0px";Z.style.right="0px";Z.style.height="32px";Z.style.overflow="hidden";Z.style.padding="3px 4px 4px 4px";Z.style.borderWidth="1px 0px 0px 0px";Z.style.borderStyle=-"solid";Z.style.whiteSpace="nowrap";if(Q.isEnabled()){X.style.bottom="32px";var ba=document.createElement("a");ba.className="geButton";var ea=ba.cloneNode(!1);ea.style.backgroundImage="url("+Editor.visibleImage+")";ea.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ea,"click",function(ha){Q.setHiddenTags([]);mxEvent.isShiftDown(ha)||(R=Q.hiddenTags.slice());O();Q.refresh();mxEvent.consume(ha)});Z.appendChild(ea);null!=F&&(ba=ba.cloneNode(!1),ba.style.backgroundImage="url("+Editor.plusImage+-")",ba.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ba,"click",function(ha){F(R,function(fa){R=fa;Y()});mxEvent.consume(ha)}),Z.appendChild(ba));W.appendChild(Z)}null!=N&&Z.appendChild(N);return{div:W,refresh:Y}};Graph.prototype.getCustomFonts=function(){var m=this.extFonts;m=null!=m?m.slice():[];for(var y in Graph.customFontElements){var F=Graph.customFontElements[y];m.push({name:F.name,url:F.url})}return m};Graph.prototype.setFont=function(m,y){Graph.addFont(m,y);var F=Editor.guid();-document.execCommand("fontname",!1,F);for(var N=this.cellEditor.textarea.getElementsByTagName("font"),O=!1,P=0;P<N.length;P++)N[P].getAttribute("face")==F&&(O=!0,N[P].setAttribute("face",m),null!=y?N[P].setAttribute("data-font-src",y):N[P].removeAttribute("data-font-src"));O||document.execCommand("fontname",!1,m)};var B=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return B.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 m=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=m)for(var y in m)this.globalVars[y]=m[y]}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 C=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=-function(m){var y=C.apply(this,arguments);null==y&&null!=this.globalVars&&(y=this.globalVars[m]);return y};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var m=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(m.ownerDocument)).decode(m)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var H=Graph.prototype.getSvg;Graph.prototype.getSvg=function(m,y,F,N,O,P,T,Q,R,W,X,Y,Z,ba,ea,ha){var fa=H.apply(this,arguments);-if(null!=Y){var la=fa.getAttribute("style");null==la&&(la="");Y="auto"==Y||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":Y;fa.setAttribute("style",la+(" color-scheme: "+Y+";"))}var oa=this.getCustomFonts();if(X&&0<oa.length){var pa=fa.ownerDocument;la=null!=pa.createElementNS?pa.createElementNS(mxConstants.NS_SVG,"style"):pa.createElement("style");null!=pa.setAttributeNS?la.setAttributeNS("type","text/css"):la.setAttribute("type","text/css");for(var va="",-ta="",ma=0;ma<oa.length;ma++){var ia=oa[ma].name,qa=oa[ma].url;Graph.isCssFontUrl(qa)?va+="@import url("+Graph.rewriteGoogleFontUrl(qa)+");\n":ta+='@font-face {\nfont-family: "'+ia+'";\nsrc: url("'+qa+'");\n}\n'}la.appendChild(pa.createTextNode(va+ta));fa.getElementsByTagName("defs")[0].appendChild(la)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(fa);this.mathEnabled&&(document.body.appendChild(fa),Editor.MathJaxRender(fa),-fa.parentNode.removeChild(fa),la=fa.ownerDocument.getElementById("MJX-SVG-styles"),null!=la&&fa.getElementsByTagName("defs")[0].appendChild(la.cloneNode(!0)));return fa};var D=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(m){D.apply(this,arguments);null!=m.secondLabel&&(m.secondLabel.destroy(),m.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(m){return[m.shape,m.text,m.secondLabel,m.control]};var U=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=-function(){U.apply(this,arguments);this.enumerationState=0};var S=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(m){null!=m.shape&&this.redrawEnumerationState(m);return S.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(m){m=decodeURIComponent(mxUtils.getValue(m.style,"enumerateValue",""));""==m&&(m=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(m)+-"</div>"};mxGraphView.prototype.redrawEnumerationState=function(m){var y="1"==mxUtils.getValue(m.style,"enumerate",0);y&&null==m.secondLabel?(m.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),m.secondLabel.size=12,m.secondLabel.state=m,m.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(m,m.secondLabel)):y||null==m.secondLabel||(m.secondLabel.destroy(),m.secondLabel=null);y=m.secondLabel;if(null!=y){var F=m.view.scale,-N=this.createEnumerationValue(m);m=this.graph.model.isVertex(m.cell)?new mxRectangle(m.x+m.width-4*F,m.y+4*F,0,0):mxRectangle.fromPoint(m.view.getPoint(m));y.bounds.equals(m)&&y.value==N&&y.scale==F||(y.bounds=m,y.value=N,y.scale=F,y.redraw())}};var V=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();V.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),-this.view.validateBackgroundImage())};var t=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){t.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(m,y){"data:action/json,"==m.substring(0,17)&&(m=JSON.parse(m.substring(17)),null!=m.actions&&this.executeCustomActions(m.actions,null,y))};Graph.prototype.executeCustomActions=function(m,y,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 N=!1,O=0,P=0,T=mxUtils.bind(this,function(){N||(N=!0,this.model.beginUpdate())}),Q=mxUtils.bind(this,function(){N&&(N=!1,this.model.endUpdate())}),R=mxUtils.bind(this,function(){0<O&&O--;0==O&&W()}),W=mxUtils.bind(this,function(){if(P<m.length){var X=this.stoppingCustomActions,Y=m[P++],-Z=[];if(null!=Y.open)if(Q(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,F))return}else this.openLink(Y.open);null==Y.wait||X||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;R()}),O++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),Q());null!=Y.opacity&&null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),-Y.opacity.value);null!=Y.fadeIn&&(O++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,R,X?0:Y.fadeIn.delay));null!=Y.fadeOut&&(O++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,R,X?0:Y.fadeOut.delay));null!=Y.wipeIn&&(Z=Z.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(Z=Z.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,!0),!1)));null!=Y.toggle&&(T(),this.toggleCells(this.getCellsForAction(Y.toggle,-!0)));if(null!=Y.show){T();var ba=this.getCellsForAction(Y.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ba),1);this.setCellsVisible(ba,!0)}null!=Y.hide&&(T(),ba=this.getCellsForAction(Y.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ba),0),this.setCellsVisible(ba,!1));null!=Y.toggleStyle&&null!=Y.toggleStyle.key&&(T(),this.toggleCellStyles(Y.toggleStyle.key,null!=Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:"0",this.getCellsForAction(Y.toggleStyle,!0)));null!=Y.style&&-null!=Y.style.key&&(T(),this.setCellStyles(Y.style.key,Y.style.value,this.getCellsForAction(Y.style,!0)));ba=[];null!=Y.select&&this.isEnabled()&&(ba=this.getCellsForAction(Y.select),this.setSelectionCells(ba));null!=Y.highlight&&(ba=this.getCellsForAction(Y.highlight),this.highlightCells(ba,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(ba=this.getCellsForAction(Y.scroll));null!=Y.viewbox&&this.fitWindow(Y.viewbox,Y.viewbox.border);0<ba.length&&this.scrollCellToVisible(ba[0]);-null!=F&&null!=Y.explore&&Graph.exploreFromCell(this,F,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle){var ea=Y.tags.toggle;0==ea.length&&(ea=this.getAllTags());for(ba=0;ba<ea.length;ba++)this.toggleHiddenTag(ea[ba])}ea=null;null!=Y.tags.hidden&&(null==ea&&(ea=[]),ea=ea.concat(Y.tags.hidden));if(null!=Y.tags.visible){null==ea&&(ea=[]);var ha=this.getAllTags();for(ba=0;ba<ha.length;ba++)0>mxUtils.indexOf(Y.tags.visible,ha[ba])&&0>mxUtils.indexOf(ea,ha[ba])&&ea.push(ha[ba])}null!=ea&&this.setHiddenTags(ea);-this.refresh()}0<Z.length&&(O++,this.executeAnimations(Z,R,X?1:Y.steps,X?0:Y.delay));0==O?W():Q()}else this.stoppingCustomActions=this.executingCustomActions=!1,Q(),null!=y&&y()});W()}};Graph.prototype.doUpdateCustomLinksForCell=function(m,y){var F=this.getLinkForCell(y);null!=F&&"data:action/json,"==F.substring(0,17)&&this.setLinkForCell(y,this.updateCustomLink(m,F));if(this.isHtmlLabel(y)){var N=document.createElement("div");N.innerHTML=Graph.sanitizeHtml(this.getLabel(y));for(var O=N.getElementsByTagName("a"),-P=!1,T=0;T<O.length;T++)F=O[T].getAttribute("href"),null!=F&&"data:action/json,"==F.substring(0,17)&&(O[T].setAttribute("href",this.updateCustomLink(m,F)),P=!0);P&&this.labelChanged(y,N.innerHTML)}};Graph.prototype.updateCustomLink=function(m,y){if("data:action/json,"==y.substring(0,17))try{var F=JSON.parse(y.substring(17));null!=F.actions&&(this.updateCustomLinkActions(m,F.actions),y="data:action/json,"+JSON.stringify(F))}catch(N){}return y};Graph.prototype.updateCustomLinkActions=function(m,y){for(var F=-0;F<y.length;F++){var N=y[F],O;for(O in N)this.updateCustomLinkAction(m,N[O],"cells"),this.updateCustomLinkAction(m,N[O],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(m,y,F){if(null!=y&&null!=y[F]){for(var N=[],O=0;O<y[F].length;O++)if("*"==y[F][O])N.push(y[F][O]);else{var P=m[y[F][O]];null!=P?""!=P&&N.push(P):N.push(y[F][O])}y[F]=N}};Graph.prototype.getCellsForAction=function(m,y){y=this.getCellsById(m.cells).concat(this.getCellsForTags(m.tags,null,y));if(null!=m.excludeCells){for(var F=-[],N=0;N<y.length;N++)0>m.excludeCells.indexOf(y[N].id)&&F.push(y[N]);y=F}return y};Graph.prototype.getCellsById=function(m){var y=[];if(null!=m)for(var F=0;F<m.length;F++)if("*"==m[F]){var N=this.model.getRoot();y=y.concat(this.model.filterDescendants(function(P){return P!=N},N))}else{var O=this.model.getCell(m[F]);null!=O&&y.push(O)}return y};var z=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(m){return z.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(m))};+O}l.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var y=null;mxEvent.addListener(this.container,"mouseenter",m);mxEvent.addListener(this.container,"mousemove",m);mxEvent.addListener(this.container,"mouseleave",function(O){y=null});this.isMouseInsertPoint=function(){return null!=y};var E=this.getInsertPoint;this.getInsertPoint=function(O){return null==y||O?E.apply(this,arguments):this.getPointForEvent(y)};var P=this.layoutManager.getLayout;this.layoutManager.getLayout=+function(O){var Q=this.graph.getCellStyle(O);if(null!=Q&&"rack"==Q.childLayout){var U=new mxStackLayout(this.graph,!1);U.gridSize=null!=Q.rackUnitSize?parseFloat(Q.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;U.marginLeft=Q.marginLeft||0;U.marginRight=Q.marginRight||0;U.marginTop=Q.marginTop||0;U.marginBottom=Q.marginBottom||0;U.allowGaps=Q.allowGaps||0;U.horizontal="1"==mxUtils.getValue(Q,"horizontalRack","0");U.resizeParent=!1;U.fill=!0;return U}return P.apply(this,+arguments)};this.updateGlobalUrlVariables()};var n=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(m,y){return Graph.processFontStyle(n.apply(this,arguments))};var v=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(m,y,E,P,O,Q,U,R,S,W,X,Y){v.apply(this,arguments);Graph.processFontAttributes(Y)};var x=mxText.prototype.redraw;mxText.prototype.redraw=function(){x.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&+Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(m,y,E,P){function O(){for(var ia=R.getSelectionCells(),ea=[],ma=0;ma<ia.length;ma++)R.isCellVisible(ia[ma])&&ea.push(ia[ma]);R.setSelectionCells(ea)}function Q(ia){R.setHiddenTags(ia?[]:S.slice());O();R.refresh()}function U(ia,ea){X.innerText="";if(0<ia.length){var ma=document.createElement("table");ma.setAttribute("cellpadding","2");ma.style.boxSizing="border-box";ma.style.tableLayout="fixed";ma.style.width="100%";+var na=document.createElement("tbody");if(null!=ia&&0<ia.length)for(var ua=0;ua<ia.length;ua++)(function(ta){function sa(){var ra=R.getCellsForTags([ta],null,null,!0);R.isEnabled()?R.setSelectionCells(ra):R.highlightCells(ra,null,null,70)}var la=0>mxUtils.indexOf(R.hiddenTags,ta),ja=document.createElement("tr"),qa=document.createElement("td");qa.style.align="center";qa.style.width="16px";var va=document.createElement("img");va.setAttribute("src",la?Editor.visibleImage:Editor.hiddenImage);va.setAttribute("title",+mxResources.get(la?"hideIt":"show",[ta]));mxUtils.setOpacity(va,la?75:25);va.className="geAdaptiveAsset";va.style.verticalAlign="middle";va.style.cursor="pointer";va.style.width="16px";if(y||Editor.isDarkMode())va.style.filter="invert(100%)";qa.appendChild(va);mxEvent.addListener(va,"click",function(ra){mxEvent.isShiftDown(ra)?Q(0<=mxUtils.indexOf(R.hiddenTags,ta)):(R.toggleHiddenTag(ta),O(),R.refresh());mxEvent.consume(ra)});ja.appendChild(qa);qa=document.createElement("td");qa.style.align="center";+qa.style.width="16px";va=document.createElement("img");va.setAttribute("src",Editor.selectImage);va.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(va,la?75:25);va.className="geAdaptiveAsset";va.style.verticalAlign="middle";va.style.cursor="pointer";va.style.width="16px";if(y||Editor.isDarkMode())va.style.filter="invert(100%)";mxEvent.addListener(va,"click",function(ra){Q(!0);sa();mxEvent.consume(ra)});qa.appendChild(va);ja.appendChild(qa);qa=document.createElement("td");qa.style.overflow=+"hidden";qa.style.whiteSpace="nowrap";qa.style.textOverflow="ellipsis";qa.style.verticalAlign="middle";qa.style.cursor="pointer";qa.setAttribute("title",ta);a=document.createElement("a");mxUtils.write(a,ta);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,la?100:40);qa.appendChild(a);mxEvent.addListener(qa,"click",function(ra){if(mxEvent.isShiftDown(ra))Q(!0),sa();else if(la&&0<R.hiddenTags.length)Q(!0);else{var ha=S.slice(),Da=mxUtils.indexOf(ha,ta);ha.splice(Da,1);+R.setHiddenTags(ha);O();R.refresh()}mxEvent.consume(ra)});ja.appendChild(qa);if(R.isEnabled()){qa=document.createElement("td");qa.style.verticalAlign="middle";qa.style.textAlign="center";qa.style.width="18px";if(null==ea){qa.style.align="center";qa.style.width="16px";va=document.createElement("img");va.setAttribute("src",Editor.trashImage);va.setAttribute("title",mxResources.get("removeIt",[ta]));mxUtils.setOpacity(va,la?75:25);va.className="geAdaptiveAsset";va.style.verticalAlign="middle";va.style.cursor=+"pointer";va.style.width="16px";if(y||Editor.isDarkMode())va.style.filter="invert(100%)";mxEvent.addListener(va,"click",function(ra){var ha=mxUtils.indexOf(S,ta);0<=ha&&S.splice(ha,1);R.removeTagsForCells(R.model.getDescendants(R.model.getRoot()),[ta]);R.refresh();mxEvent.consume(ra)});qa.appendChild(va)}else{var ya=document.createElement("input");ya.setAttribute("type","checkbox");ya.style.margin="0px";ya.defaultChecked=null!=ea&&0<=mxUtils.indexOf(ea,ta);ya.checked=ya.defaultChecked;ya.style.background=+"transparent";ya.setAttribute("title",mxResources.get(ya.defaultChecked?"removeIt":"add",[ta]));mxEvent.addListener(ya,"change",function(ra){ya.checked?R.addTagsForCells(R.getSelectionCells(),[ta]):R.removeTagsForCells(R.getSelectionCells(),[ta]);mxEvent.consume(ra)});qa.appendChild(ya)}ja.appendChild(qa)}na.appendChild(ja)})(ia[ua]);ma.appendChild(na);X.appendChild(ma)}}var R=this,S=R.hiddenTags.slice(),W=document.createElement("div");W.style.userSelect="none";W.style.overflow="hidden";W.style.padding=+"10px";W.style.height="100%";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.userSelect="none";X.style.overflow="auto";X.style.padding="3px";X.style.left="0px";X.style.right="0px";X.style.top="0px";X.style.bottom="0px";W.appendChild(X);R.addListener(mxEvent.ROOT,function(){S=R.hiddenTags.slice()});var Y=mxUtils.bind(this,function(ia,ea){if(m()){ia=R.getAllTags();for(ea=0;ea<ia.length;ea++)0>mxUtils.indexOf(S,ia[ea])&&S.push(ia[ea]);S.sort();R.isSelectionEmpty()?+U(S):U(S,R.getCommonTagsForCells(R.getSelectionCells()))}});R.selectionModel.addListener(mxEvent.CHANGE,Y);R.model.addListener(mxEvent.CHANGE,Y);R.addListener(mxEvent.REFRESH,Y);var Z=document.createElement("div");Z.className="geToolbarContainer geDialogToolbar";Z.style.position="absolute";Z.style.display="flex";Z.style.bottom="0px";Z.style.left="0px";Z.style.right="0px";Z.style.height="32px";Z.style.overflow="hidden";Z.style.padding="3px 4px 4px 4px";Z.style.borderWidth="1px 0px 0px 0px";Z.style.borderStyle=+"solid";Z.style.whiteSpace="nowrap";if(R.isEnabled()){X.style.bottom="32px";var aa=document.createElement("a");aa.className="geButton";var fa=aa.cloneNode(!1);fa.style.backgroundImage="url("+Editor.visibleImage+")";fa.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(fa,"click",function(ia){R.setHiddenTags([]);mxEvent.isShiftDown(ia)||(S=R.hiddenTags.slice());O();R.refresh();mxEvent.consume(ia)});Z.appendChild(fa);null!=E&&(aa=aa.cloneNode(!1),aa.style.backgroundImage="url("+Editor.plusImage++")",aa.setAttribute("title",mxResources.get("add")),mxEvent.addListener(aa,"click",function(ia){E(S,function(ea){S=ea;Y()});mxEvent.consume(ia)}),Z.appendChild(aa));W.appendChild(Z)}null!=P&&Z.appendChild(P);return{div:W,refresh:Y}};Graph.prototype.getCustomFonts=function(){var m=this.extFonts;m=null!=m?m.slice():[];for(var y in Graph.customFontElements){var E=Graph.customFontElements[y];m.push({name:E.name,url:E.url})}return m};Graph.prototype.setFont=function(m,y){Graph.addFont(m,y);var E=Editor.guid();+document.execCommand("fontname",!1,E);for(var P=this.cellEditor.textarea.getElementsByTagName("font"),O=!1,Q=0;Q<P.length;Q++)P[Q].getAttribute("face")==E&&(O=!0,P[Q].setAttribute("face",m),null!=y?P[Q].setAttribute("data-font-src",y):P[Q].removeAttribute("data-font-src"));O||document.execCommand("fontname",!1,m)};var B=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return B.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 m=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=m)for(var y in m)this.globalVars[y]=m[y]}catch(E){null!=window.console&&console.log("Error in vars URL parameter: "+E)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var C=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=+function(m){var y=C.apply(this,arguments);null==y&&null!=this.globalVars&&(y=this.globalVars[m]);return y};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var m=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(m.ownerDocument)).decode(m)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var G=Graph.prototype.getSvg;Graph.prototype.getSvg=function(m,y,E,P,O,Q,U,R,S,W,X,Y,Z,aa,fa,ia){var ea=G.apply(this,arguments);+if(null!=Y){var ma=ea.getAttribute("style");null==ma&&(ma="");Y="auto"==Y||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":Y;ea.setAttribute("style",ma+(" color-scheme: "+Y+";"))}var na=this.getCustomFonts();if(X&&0<na.length){var ua=ea.ownerDocument;ma=null!=ua.createElementNS?ua.createElementNS(mxConstants.NS_SVG,"style"):ua.createElement("style");null!=ua.setAttributeNS?ma.setAttributeNS("type","text/css"):ma.setAttribute("type","text/css");for(var ta="",+sa="",la=0;la<na.length;la++){var ja=na[la].name,qa=na[la].url;Graph.isCssFontUrl(qa)?ta+="@import url("+Graph.rewriteGoogleFontUrl(qa)+");\n":sa+='@font-face {\nfont-family: "'+ja+'";\nsrc: url("'+qa+'");\n}\n'}ma.appendChild(ua.createTextNode(ta+sa));ea.getElementsByTagName("defs")[0].appendChild(ma)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ea);this.mathEnabled&&(document.body.appendChild(ea),Editor.MathJaxRender(ea),+ea.parentNode.removeChild(ea),ma=ea.ownerDocument.getElementById("MJX-SVG-styles"),null!=ma&&ea.getElementsByTagName("defs")[0].appendChild(ma.cloneNode(!0)));return ea};var N=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(m){N.apply(this,arguments);null!=m.secondLabel&&(m.secondLabel.destroy(),m.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(m){return[m.shape,m.text,m.secondLabel,m.control]};var J=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=+function(){J.apply(this,arguments);this.enumerationState=0};var T=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(m){null!=m.shape&&this.redrawEnumerationState(m);return T.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(m){m=decodeURIComponent(mxUtils.getValue(m.style,"enumerateValue",""));""==m&&(m=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(m)++"</div>"};mxGraphView.prototype.redrawEnumerationState=function(m){var y="1"==mxUtils.getValue(m.style,"enumerate",0);y&&null==m.secondLabel?(m.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),m.secondLabel.size=12,m.secondLabel.state=m,m.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(m,m.secondLabel)):y||null==m.secondLabel||(m.secondLabel.destroy(),m.secondLabel=null);y=m.secondLabel;if(null!=y){var E=m.view.scale,+P=this.createEnumerationValue(m);m=this.graph.model.isVertex(m.cell)?new mxRectangle(m.x+m.width-4*E,m.y+4*E,0,0):mxRectangle.fromPoint(m.view.getPoint(m));y.bounds.equals(m)&&y.value==P&&y.scale==E||(y.bounds=m,y.value=P,y.scale=E,y.redraw())}};var V=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();V.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),+this.view.validateBackgroundImage())};var t=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){t.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(m,y){"data:action/json,"==m.substring(0,17)&&(m=JSON.parse(m.substring(17)),null!=m.actions&&this.executeCustomActions(m.actions,null,y))};Graph.prototype.executeCustomActions=function(m,y,E){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 P=!1,O=0,Q=0,U=mxUtils.bind(this,function(){P||(P=!0,this.model.beginUpdate())}),R=mxUtils.bind(this,function(){P&&(P=!1,this.model.endUpdate())}),S=mxUtils.bind(this,function(){0<O&&O--;0==O&&W()}),W=mxUtils.bind(this,function(){if(Q<m.length){var X=this.stoppingCustomActions,Y=m[Q++],+Z=[];if(null!=Y.open)if(R(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,E))return}else this.openLink(Y.open);null==Y.wait||X||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;S()}),O++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),R());null!=Y.opacity&&null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),+Y.opacity.value);null!=Y.fadeIn&&(O++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,S,X?0:Y.fadeIn.delay));null!=Y.fadeOut&&(O++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,S,X?0:Y.fadeOut.delay));null!=Y.wipeIn&&(Z=Z.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(Z=Z.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,!0),!1)));null!=Y.toggle&&(U(),this.toggleCells(this.getCellsForAction(Y.toggle,+!0)));if(null!=Y.show){U();var aa=this.getCellsForAction(Y.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(aa),1);this.setCellsVisible(aa,!0)}null!=Y.hide&&(U(),aa=this.getCellsForAction(Y.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),0),this.setCellsVisible(aa,!1));null!=Y.toggleStyle&&null!=Y.toggleStyle.key&&(U(),this.toggleCellStyles(Y.toggleStyle.key,null!=Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:"0",this.getCellsForAction(Y.toggleStyle,!0)));null!=Y.style&&+null!=Y.style.key&&(U(),this.setCellStyles(Y.style.key,Y.style.value,this.getCellsForAction(Y.style,!0)));aa=[];null!=Y.select&&this.isEnabled()&&(aa=this.getCellsForAction(Y.select),this.setSelectionCells(aa));null!=Y.highlight&&(aa=this.getCellsForAction(Y.highlight),this.highlightCells(aa,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(aa=this.getCellsForAction(Y.scroll));null!=Y.viewbox&&this.fitWindow(Y.viewbox,Y.viewbox.border);0<aa.length&&this.scrollCellToVisible(aa[0]);+null!=E&&null!=Y.explore&&Graph.exploreFromCell(this,E,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle){var fa=Y.tags.toggle;0==fa.length&&(fa=this.getAllTags());for(aa=0;aa<fa.length;aa++)this.toggleHiddenTag(fa[aa])}fa=null;null!=Y.tags.hidden&&(null==fa&&(fa=[]),fa=fa.concat(Y.tags.hidden));if(null!=Y.tags.visible){null==fa&&(fa=[]);var ia=this.getAllTags();for(aa=0;aa<ia.length;aa++)0>mxUtils.indexOf(Y.tags.visible,ia[aa])&&0>mxUtils.indexOf(fa,ia[aa])&&fa.push(ia[aa])}null!=fa&&this.setHiddenTags(fa);+this.refresh()}0<Z.length&&(O++,this.executeAnimations(Z,S,X?1:Y.steps,X?0:Y.delay));0==O?W():R()}else this.stoppingCustomActions=this.executingCustomActions=!1,R(),null!=y&&y()});W()}};Graph.prototype.doUpdateCustomLinksForCell=function(m,y){var E=this.getLinkForCell(y);null!=E&&"data:action/json,"==E.substring(0,17)&&this.setLinkForCell(y,this.updateCustomLink(m,E));if(this.isHtmlLabel(y)){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(this.getLabel(y));for(var O=P.getElementsByTagName("a"),+Q=!1,U=0;U<O.length;U++)E=O[U].getAttribute("href"),null!=E&&"data:action/json,"==E.substring(0,17)&&(O[U].setAttribute("href",this.updateCustomLink(m,E)),Q=!0);Q&&this.labelChanged(y,P.innerHTML)}};Graph.prototype.updateCustomLink=function(m,y){if("data:action/json,"==y.substring(0,17))try{var E=JSON.parse(y.substring(17));null!=E.actions&&(this.updateCustomLinkActions(m,E.actions),y="data:action/json,"+JSON.stringify(E))}catch(P){}return y};Graph.prototype.updateCustomLinkActions=function(m,y){for(var E=+0;E<y.length;E++){var P=y[E],O;for(O in P)this.updateCustomLinkAction(m,P[O],"cells"),this.updateCustomLinkAction(m,P[O],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(m,y,E){if(null!=y&&null!=y[E]){for(var P=[],O=0;O<y[E].length;O++)if("*"==y[E][O])P.push(y[E][O]);else{var Q=m[y[E][O]];null!=Q?""!=Q&&P.push(Q):P.push(y[E][O])}y[E]=P}};Graph.prototype.getCellsForAction=function(m,y){y=this.getCellsById(m.cells).concat(this.getCellsForTags(m.tags,null,y));if(null!=m.excludeCells){for(var E=+[],P=0;P<y.length;P++)0>m.excludeCells.indexOf(y[P].id)&&E.push(y[P]);y=E}return y};Graph.prototype.getCellsById=function(m){var y=[];if(null!=m)for(var E=0;E<m.length;E++)if("*"==m[E]){var P=this.model.getRoot();y=y.concat(this.model.filterDescendants(function(Q){return Q!=P},P))}else{var O=this.model.getCell(m[E]);null!=O&&y.push(O)}return y};var z=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(m){return z.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(m))};Graph.prototype.setHiddenTags=function(m){this.hiddenTags=m;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(m){var y=mxUtils.indexOf(this.hiddenTags,m);0>y?this.hiddenTags.push(m):0<=y&&this.hiddenTags.splice(y,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(m){if(null==m||0==m.length||0==this.hiddenTags.length)return!1;m=m.split(" ");if(m.length>this.hiddenTags.length)return!1;for(var y=0;y<m.length;y++)if(0>-mxUtils.indexOf(this.hiddenTags,m[y]))return!1;return!0};Graph.prototype.getCellsForTags=function(m,y,F,N){var O=[];if(null!=m){y=null!=y?y:this.model.getDescendants(this.model.getRoot());for(var P=0,T={},Q=0;Q<m.length;Q++)0<m[Q].length&&(T[m[Q]]=!0,P++);for(Q=0;Q<y.length;Q++)if(F&&this.model.getParent(y[Q])==this.model.root||this.model.isVertex(y[Q])||this.model.isEdge(y[Q])){var R=this.getTagsForCell(y[Q]),W=!1;if(0<R.length&&(R=R.split(" "),R.length>=m.length)){for(var X=W=0;X<R.length&&W<P;X++)null!=-T[R[X]]&&W++;W=W==P}W&&(1!=N||this.isCellVisible(y[Q]))&&O.push(y[Q])}}return O};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(m){for(var y=null,F=[],N=0;N<m.length;N++){var O=this.getTagsForCell(m[N]);F=[];if(0<O.length){O=O.split(" ");for(var P={},T=0;T<O.length;T++)if(null==y||null!=y[O[T]])P[O[T]]=!0,F.push(O[T]);y=P}else return[]}return F};Graph.prototype.getTagsForCells=function(m){for(var y=-[],F={},N=0;N<m.length;N++){var O=this.getTagsForCell(m[N]);if(0<O.length){O=O.split(" ");for(var P=0;P<O.length;P++)null==F[O[P]]&&(F[O[P]]=!0,y.push(O[P]))}}return y};Graph.prototype.getTagsForCell=function(m){return this.getAttributeForCell(m,"tags","")};Graph.prototype.addTagsForCells=function(m,y){if(0<m.length&&0<y.length){this.model.beginUpdate();try{for(var F=0;F<m.length;F++){for(var N=this.getTagsForCell(m[F]),O=N.split(" "),P=!1,T=0;T<y.length;T++){var Q=mxUtils.trim(y[T]);""!=Q&&0>mxUtils.indexOf(O,-Q)&&(N=0<N.length?N+" "+Q:Q,P=!0)}P&&this.setAttributeForCell(m[F],"tags",N)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(m,y){if(0<m.length&&0<y.length){this.model.beginUpdate();try{for(var F=0;F<m.length;F++){var N=this.getTagsForCell(m[F]);if(0<N.length){for(var O=N.split(" "),P=!1,T=0;T<y.length;T++){var Q=mxUtils.indexOf(O,y[T]);0<=Q&&(O.splice(Q,1),P=!0)}P&&this.setAttributeForCell(m[F],"tags",O.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=-function(m){this.model.beginUpdate();try{for(var y=0;y<m.length;y++)this.model.setVisible(m[y],!this.model.isVisible(m[y]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(m,y){this.model.beginUpdate();try{for(var F=0;F<m.length;F++)this.model.setVisible(m[F],y)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(m,y,F,N){for(var O=0;O<m.length;O++)this.highlightCell(m[O],y,F,N)};Graph.prototype.highlightCell=function(m,y,F,N,O){y=null!=y?y:mxConstants.DEFAULT_VALID_COLOR;-F=null!=F?F:1E3;m=this.view.getState(m);var P=null;null!=m&&(O=null!=O?O:4,O=Math.max(O+1,mxUtils.getValue(m.style,mxConstants.STYLE_STROKEWIDTH,1)+O),P=new mxCellHighlight(this,y,O,!1),null!=N&&(P.opacity=N),P.highlight(m),window.setTimeout(function(){null!=P.shape&&(mxUtils.setPrefixedStyle(P.shape.node.style,"transition","all 1200ms ease-in-out"),P.shape.node.style.opacity=0);window.setTimeout(function(){P.destroy()},1200)},F));return P};Graph.prototype.addSvgShadow=function(m,y,F,N){N=null!=N?-N:!0;var O=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=F&&F||(y=null!=y?y:m.getElementsByTagName("g")[0],null!=y&&(this.updateShadowFilter(y,!0),!isNaN(parseInt(m.getAttribute("width")))&&N&&(m.setAttribute("width",parseInt(m.getAttribute("width"))+O),m.setAttribute("height",parseInt(m.getAttribute("height"))+O),y=m.getAttribute("viewBox"),null!=y&&0<y.length&&(y=y.split(" "),3<y.length&&(w=parseFloat(y[2])+O,h=parseFloat(y[3])+O,m.setAttribute("viewBox",y[0]+" "+y[1]+" "+w+" "+h))))));+mxUtils.indexOf(this.hiddenTags,m[y]))return!1;return!0};Graph.prototype.getCellsForTags=function(m,y,E,P){var O=[];if(null!=m){y=null!=y?y:this.model.getDescendants(this.model.getRoot());for(var Q=0,U={},R=0;R<m.length;R++)0<m[R].length&&(U[m[R]]=!0,Q++);for(R=0;R<y.length;R++)if(E&&this.model.getParent(y[R])==this.model.root||this.model.isVertex(y[R])||this.model.isEdge(y[R])){var S=this.getTagsForCell(y[R]),W=!1;if(0<S.length&&(S=S.split(" "),S.length>=m.length)){for(var X=W=0;X<S.length&&W<Q;X++)null!=+U[S[X]]&&W++;W=W==Q}W&&(1!=P||this.isCellVisible(y[R]))&&O.push(y[R])}}return O};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(m){for(var y=null,E=[],P=0;P<m.length;P++){var O=this.getTagsForCell(m[P]);E=[];if(0<O.length){O=O.split(" ");for(var Q={},U=0;U<O.length;U++)if(null==y||null!=y[O[U]])Q[O[U]]=!0,E.push(O[U]);y=Q}else return[]}return E};Graph.prototype.getTagsForCells=function(m){for(var y=+[],E={},P=0;P<m.length;P++){var O=this.getTagsForCell(m[P]);if(0<O.length){O=O.split(" ");for(var Q=0;Q<O.length;Q++)null==E[O[Q]]&&(E[O[Q]]=!0,y.push(O[Q]))}}return y};Graph.prototype.getTagsForCell=function(m){return this.getAttributeForCell(m,"tags","")};Graph.prototype.addTagsForCells=function(m,y){if(0<m.length&&0<y.length){this.model.beginUpdate();try{for(var E=0;E<m.length;E++){for(var P=this.getTagsForCell(m[E]),O=P.split(" "),Q=!1,U=0;U<y.length;U++){var R=mxUtils.trim(y[U]);""!=R&&0>mxUtils.indexOf(O,+R)&&(P=0<P.length?P+" "+R:R,Q=!0)}Q&&this.setAttributeForCell(m[E],"tags",P)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(m,y){if(0<m.length&&0<y.length){this.model.beginUpdate();try{for(var E=0;E<m.length;E++){var P=this.getTagsForCell(m[E]);if(0<P.length){for(var O=P.split(" "),Q=!1,U=0;U<y.length;U++){var R=mxUtils.indexOf(O,y[U]);0<=R&&(O.splice(R,1),Q=!0)}Q&&this.setAttributeForCell(m[E],"tags",O.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=+function(m){this.model.beginUpdate();try{for(var y=0;y<m.length;y++)this.model.setVisible(m[y],!this.model.isVisible(m[y]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(m,y){this.model.beginUpdate();try{for(var E=0;E<m.length;E++)this.model.setVisible(m[E],y)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(m,y,E,P){for(var O=0;O<m.length;O++)this.highlightCell(m[O],y,E,P)};Graph.prototype.highlightCell=function(m,y,E,P,O){y=null!=y?y:mxConstants.DEFAULT_VALID_COLOR;+E=null!=E?E:1E3;m=this.view.getState(m);var Q=null;null!=m&&(O=null!=O?O:4,O=Math.max(O+1,mxUtils.getValue(m.style,mxConstants.STYLE_STROKEWIDTH,1)+O),Q=new mxCellHighlight(this,y,O,!1),null!=P&&(Q.opacity=P),Q.highlight(m),window.setTimeout(function(){null!=Q.shape&&(mxUtils.setPrefixedStyle(Q.shape.node.style,"transition","all 1200ms ease-in-out"),Q.shape.node.style.opacity=0);window.setTimeout(function(){Q.destroy()},1200)},E));return Q};Graph.prototype.addSvgShadow=function(m,y,E,P){P=null!=P?+P:!0;var O=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=E&&E||(y=null!=y?y:m.getElementsByTagName("g")[0],null!=y&&(this.updateShadowFilter(y,!0),!isNaN(parseInt(m.getAttribute("width")))&&P&&(m.setAttribute("width",parseInt(m.getAttribute("width"))+O),m.setAttribute("height",parseInt(m.getAttribute("height"))+O),y=m.getAttribute("viewBox"),null!=y&&0<y.length&&(y=y.split(" "),3<y.length&&(w=parseFloat(y[2])+O,h=parseFloat(y[3])+O,m.setAttribute("viewBox",y[0]+" "+y[1]+" "+w+" "+h))))));return O};Graph.prototype.updateShadowFilter=function(m,y){mxClient.IS_SF||(y?(y=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),m.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+y.cssText+")"):m.style.filter="")};Graph.prototype.setShadowVisible=function(m,y){y=null!=y?y:!0;this.shadowVisible=m;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);-y&&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 m=this.model.getChildCount(this.model.root),y=0;do var F=this.model.getChildAt(this.model.root,y);while(y++<m&&"1"==mxUtils.getValue(this.getCellStyle(F),"locked","0"));null!=F&&this.setDefaultParent(F)}};+y&&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 m=this.model.getChildCount(this.model.root),y=0;do var E=this.model.getChildAt(this.model.root,y);while(y++<m&&"1"==mxUtils.getValue(this.getCellStyle(E),"locked","0"));null!=E&&this.setDefaultParent(E)}};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"];@@ -13124,32 +13130,32 @@ STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation""/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.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.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(m){var y=null;null!=m&&0<m.length&&("ER"==m.substring(0,2)?y="mxgraph.er":"sysML"==m.substring(0,5)&&(y="mxgraph.sysml"));return y};var L=mxMarker.createMarker;mxMarker.createMarker=function(m,y,F,N,O,P,T,Q,R,W){if(null!=F&&null==mxMarker.markers[F]){var X=this.getPackageForType(F);null!=X&&mxStencilRegistry.getStencil(X)}return L.apply(this,arguments)};var K=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(m,y,F,N,O,P){"1"==mxUtils.getValue(y.style,"lineShape",null)&&-m.setFillColor(mxUtils.getValue(y.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return K.apply(this,arguments)};PrintDialog.prototype.create=function(m,y,F,N){function O(){ea.value=Math.max(1,Math.min(X,Math.max(parseInt(ea.value),parseInt(ba.value))));ba.value=Math.max(1,Math.min(X,Math.min(parseInt(ea.value),parseInt(ba.value))))}function P(ka){m.lastPrintPagesRadioChecked=Z.checked;m.lastPrintSelectionOnlyChecked=fa.checked;m.lastPrintCropRadioChecked=oa.checked;m.lastPrintFitRadioChecked=-pa.checked;Z.checked&&ba.value<ea.value?(m.lastPrintPagesFromInput=ba.value,m.lastPrintPagesToInput=ea.value):(m.lastPrintPagesFromInput=null,m.lastPrintPagesToInput=null);sa.value=Math.max(1,Math.min(1600,parseInt(sa.value)))+"%";m.lastPrintZoom=sa.value;m.lastPrintBorder=ja.value;m.lastPrintGrid=Ca.checked;m.lastPrintTransparent=Ba.checked;m.lastPrintInclude=da.checked;m.lastPrintSheetsAcross=aa.value;m.lastPrintSheetsDown=na.value;var za={};za.border=parseInt(ja.value);za.scale=parseInt(sa.value)/-100;za.grid=Ca.checked;za.shadows=Fa.checked;za.transparent=Ba.checked;za.includeCopy=da.checked;za.sheetsAcross=parseInt(aa.value);za.sheetsDown=parseInt(na.value);za.pagesFrom=parseInt(ba.value);za.pagesTo=parseInt(ea.value);za.allPages=Y.checked;za.selection=fa.checked;za.pageView=la.checked;za.crop=oa.checked;za.fit=pa.checked;return null!=F?F(!ka,za):m.print(!ka,za)}var T=m.editor.graph,Q=document.createElement("div"),R=document.createElement("h3");R.style.width="100%";R.style.textAlign="center";-R.style.marginTop="0px";mxUtils.write(R,y||mxResources.get("print"));Q.appendChild(R);var W=1,X=1;R=document.createElement("div");R.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");R.appendChild(Y);y=document.createElement("span");mxUtils.write(y,mxResources.get("allPages"));mxEvent.addListener(y,"click",function(){Y.checked=!0});R.appendChild(y);mxUtils.br(R);-var Z=Y.cloneNode(!0);R.appendChild(Z);y=document.createElement("span");mxUtils.write(y,mxResources.get("pages")+":");R.appendChild(y);mxEvent.addListener(y,"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";R.appendChild(ba);y=document.createElement("span");mxUtils.write(y,mxResources.get("to"));R.appendChild(y);var ea=ba.cloneNode(!0);R.appendChild(ea);-mxEvent.addListener(ba,"focus",function(){Z.checked=!0});mxEvent.addListener(ea,"focus",function(){Z.checked=!0});mxEvent.addListener(ba,"change",O);mxEvent.addListener(ea,"change",O);if(null!=m.pages&&(X=m.pages.length,null!=m.currentPage))for(var ha=0;ha<X;ha++)if(m.currentPage==m.pages[ha]){W=ha+1;break}null!=m.lastPrintPagesFromInput&&null!=m.lastPrintPagesToInput?(ba.value=Math.min(X,Math.max(1,m.lastPrintPagesFromInput)),ea.value=Math.min(X,Math.max(1,m.lastPrintPagesToInput))):(ba.value=W,-ea.value=W);ba.setAttribute("max",X);ea.setAttribute("max",X);ha=mxUtils.button(mxResources.get("currentPage"),function(ka){ba.value=W;ea.value=W;Z.checked=!0});ha.setAttribute("title",mxResources.get("currentPage"));ha.style.marginLeft="4px";ha.style.maxWidth="100px";ha.style.overflow="hidden";ha.style.textOverflow="ellipsis";ha.style.whiteSpace="nowrap";R.appendChild(ha);1<X&&Q.appendChild(R);R=document.createElement("div");R.style.borderBottom="1px solid lightGray";R.style.paddingBottom="12px";-R.style.marginBottom="12px";R.style.whiteSpace="nowrap";var fa=document.createElement("input");fa.setAttribute("name","pages-printdialog");fa.setAttribute("type",1==X?"checkbox":"radio");fa.style.marginRight="8px";T.isSelectionEmpty()&&fa.setAttribute("disabled","disabled");T.isEnabled()&&(R.appendChild(fa),y=document.createElement("span"),mxUtils.write(y,mxResources.get("selectionOnly")),R.appendChild(y));(T.isEnabled()||1<X)&&Q.appendChild(R);!m.isPagesEnabled()||m.lastPrintPagesRadioChecked?Z.checked=-!0:!T.isSelectionEmpty()&&m.lastPrintSelectionOnlyChecked?fa.checked=!0:Y.checked=!0;T.isSelectionEmpty()||mxEvent.addListener(y,"click",function(){fa.checked=!fa.checked});T=document.createElement("div");T.style.whiteSpace="nowrap";var la=document.createElement("input");la.style.marginBottom="8px";la.style.marginRight="8px";la.setAttribute("type","radio");la.setAttribute("name","printSize");T.appendChild(la);y=document.createElement("span");mxUtils.write(y,mxResources.get("pageView"));T.appendChild(y);-mxEvent.addListener(T,"click",function(){la.checked=!0});Q.appendChild(T);T=document.createElement("div");T.style.whiteSpace="nowrap";var oa=document.createElement("input");oa.style.marginBottom="8px";oa.style.marginRight="8px";oa.setAttribute("type","radio");oa.setAttribute("name","printSize");T.appendChild(oa);y=document.createElement("span");mxUtils.write(y,mxResources.get("crop"));T.appendChild(y);mxEvent.addListener(T,"click",function(){oa.checked=!0});Q.appendChild(T);T=document.createElement("div");-T.style.whiteSpace="nowrap";var pa=document.createElement("input");pa.style.marginBottom="8px";pa.style.marginRight="8px";pa.setAttribute("type","radio");pa.setAttribute("name","printSize");y=document.createElement("div");y.style.display="inline-block";y.style.verticalAlign="top";y.style.paddingTop="2px";y.appendChild(pa);T.appendChild(y);R=document.createElement("table");R.style.display="inline-block";R.style.borderSpacing="0";ha=document.createElement("tbody");var va=document.createElement("tr"),-ta=va.cloneNode(!0),ma=document.createElement("td"),ia=ma.cloneNode(!0),qa=ma.cloneNode(!0),ua=ma.cloneNode(!0),xa=ma.cloneNode(!0),ra=ma.cloneNode(!0);ma.style.textAlign="right";ua.style.textAlign="right";mxUtils.write(ma,mxResources.get("fitTo"));mxEvent.addListener(T,"click",function(ka){mxEvent.getSource(ka)!=pa&&(pa.checked=!pa.checked)});var aa=document.createElement("input");aa.style.margin="0 2px";aa.style.boxSizing="border-box";aa.setAttribute("value",m.lastPrintSheetsAcross||"1");aa.setAttribute("min",-"1");aa.setAttribute("type","number");aa.style.width="40px";ia.appendChild(aa);y=document.createElement("span");mxUtils.write(y,mxResources.get("fitToSheetsAcross"));qa.appendChild(y);mxUtils.write(ua,mxResources.get("fitToBy"));var na=aa.cloneNode(!0);na.setAttribute("value",m.lastPrintSheetsDown||"1");xa.appendChild(na);mxEvent.addListener(aa,"click",function(ka){pa.checked=!0;mxEvent.consume(ka)});mxEvent.addListener(na,"click",function(ka){pa.checked=!0;mxEvent.consume(ka)});m.lastPrintCropRadioChecked?-oa.checked=!0:m.lastPrintFitRadioChecked?pa.checked=!0:la.checked=!0;y=document.createElement("span");mxUtils.write(y,mxResources.get("fitToSheetsDown"));ra.appendChild(y);va.appendChild(ma);va.appendChild(ia);va.appendChild(qa);ta.appendChild(ua);ta.appendChild(xa);ta.appendChild(ra);ha.appendChild(va);ha.appendChild(ta);R.appendChild(ha);T.appendChild(R);Q.appendChild(T);T=document.createElement("div");T.style.borderTop="1px solid lightGray";T.style.whiteSpace="nowrap";T.style.paddingTop="12px";-T.style.marginTop="12px";T.style.paddingLeft="8px";mxUtils.write(T,mxResources.get("borderWidth")+":");var ja=document.createElement("input");ja.setAttribute("type","number");ja.setAttribute("min","0");ja.style.width="40px";ja.style.marginLeft="4px";ja.value=null!=m.lastPrintBorder?m.lastPrintBorder:mxPrintPreview.prototype.pageMargin;T.appendChild(ja);y=document.createElement("span");y.style.marginLeft="8px";mxUtils.write(y,mxResources.get("zoom")+":");T.appendChild(y);var sa=document.createElement("input");-sa.style.width="60px";sa.style.marginLeft="4px";sa.value=null!=m.lastPrintZoom?m.lastPrintZoom:"100%";T.appendChild(sa);mxUtils.br(T);var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.style.marginTop="12px";Ca.checked=null!=m.lastPrintGrid?m.lastPrintGrid:!1;T.appendChild(Ca);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("grid"));T.appendChild(y);mxEvent.addListener(y,"click",function(ka){Ca.checked=!0;-mxEvent.consume(ka)});var Fa=document.createElement("input");Fa.setAttribute("type","checkbox");Fa.style.marginTop="12px";Fa.checked=null!=m.lastPrintShadow?m.lastPrintShadow:!1;T.appendChild(Fa);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("shadows"));T.appendChild(y);m.isOffline()&&!mxClient.IS_CHROMEAPP||y.appendChild(m.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));mxEvent.addListener(y,"click",function(ka){"IMG"!=-mxEvent.getSource(ka).nodeName&&(Fa.checked=!0,mxEvent.consume(ka))});Editor.enableShadowOption?null!=F&&mxUtils.br(T):(Fa.style.display="none",y.style.display="none");var Ba=document.createElement("input");Ba.setAttribute("type","checkbox");Ba.style.marginTop="10px";Ba.checked=null!=m.lastPrintTransparent?m.lastPrintTransparent:!1;null!=F&&(T.appendChild(Ba),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("transparentBackground")),T.appendChild(y),mxEvent.addListener(y,-"click",function(ka){Ba.checked=!0;mxEvent.consume(ka)}));var da=document.createElement("input");da.setAttribute("type","checkbox");da.style.marginTop="10px";da.checked=null!=m.lastPrintInclude?m.lastPrintInclude:Editor.defaultIncludeDiagram;null==F||mxClient.IS_CHROMEAPP||"draw.io"!=m.getServiceName()||(mxUtils.br(T),T.appendChild(da),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("includeCopyOfMyDiagram")),T.appendChild(y),mxEvent.addListener(y,"click",-function(ka){da.checked=!0;mxEvent.consume(ka)}));Q.appendChild(T);y=document.createElement("div");y.style.marginTop="30px";y.style.textAlign="right";y.style.whiteSpace="nowrap";m.isOffline()&&!mxClient.IS_CHROMEAPP||null!=F||y.appendChild(m.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));T=mxUtils.button(mxResources.get("cancel"),function(){m.hideDialog()});T.className="geBtn";m.editor.cancelFirst&&y.appendChild(T);PrintDialog.previewEnabled&&null==F&&(R=mxUtils.button(mxResources.get("preview"),-function(){try{m.hideDialog(),P(!1)}catch(ka){m.handleError(ka)}}),R.className="geBtn",y.appendChild(R));N=null!=N?N:null!=F?"export":PrintDialog.previewEnabled?"print":"ok";N=mxUtils.button(mxResources.get(N),function(){try{m.hideDialog(),P(!0)}catch(ka){m.handleError(ka)}});N.className="geBtn gePrimaryBtn";y.appendChild(N);m.editor.cancelFirst||y.appendChild(T);Q.appendChild(y);if(m.editor.isChromelessView()){var ca=function(){Editor.isDarkMode()?(Q.classList.add("geDarkMode"),Q.style.colorScheme=-"dark"):(Q.classList.remove("geDarkMode"),Q.style.colorScheme="light")};m.addListener("darkModeChanged",ca);ca();var wa=function(ka,za){ka=za.getProperty("dialog");Q.parentNode==ka.container&&(m.editor.removeListener(wa),m.removeListener(ca))};m.editor.addListener("hideDialog",wa)}this.container=Q};var M=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||+function(m){var y=null;null!=m&&0<m.length&&("ER"==m.substring(0,2)?y="mxgraph.er":"sysML"==m.substring(0,5)&&(y="mxgraph.sysml"));return y};var L=mxMarker.createMarker;mxMarker.createMarker=function(m,y,E,P,O,Q,U,R,S,W){if(null!=E&&null==mxMarker.markers[E]){var X=this.getPackageForType(E);null!=X&&mxStencilRegistry.getStencil(X)}return L.apply(this,arguments)};var K=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(m,y,E,P,O,Q){"1"==mxUtils.getValue(y.style,"lineShape",null)&&+m.setFillColor(mxUtils.getValue(y.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return K.apply(this,arguments)};PrintDialog.prototype.create=function(m,y,E,P){function O(){fa.value=Math.max(1,Math.min(X,Math.max(parseInt(fa.value),parseInt(aa.value))));aa.value=Math.max(1,Math.min(X,Math.min(parseInt(fa.value),parseInt(aa.value))))}function Q(ka){m.lastPrintPagesRadioChecked=Z.checked;m.lastPrintSelectionOnlyChecked=ea.checked;m.lastPrintCropRadioChecked=na.checked;m.lastPrintFitRadioChecked=+ua.checked;Z.checked&&aa.value<fa.value?(m.lastPrintPagesFromInput=aa.value,m.lastPrintPagesToInput=fa.value):(m.lastPrintPagesFromInput=null,m.lastPrintPagesToInput=null);ba.value=Math.max(1,Math.min(1600,parseInt(ba.value)))+"%";m.lastPrintZoom=ba.value;m.lastPrintBorder=oa.value;m.lastPrintGrid=pa.checked;m.lastPrintTransparent=xa.checked;m.lastPrintInclude=ca.checked;m.lastPrintSheetsAcross=ha.value;m.lastPrintSheetsDown=Da.value;var Aa={};Aa.border=parseInt(oa.value);Aa.scale=parseInt(ba.value)/+100;Aa.grid=pa.checked;Aa.shadows=Ba.checked;Aa.transparent=xa.checked;Aa.includeCopy=ca.checked;Aa.sheetsAcross=parseInt(ha.value);Aa.sheetsDown=parseInt(Da.value);Aa.pagesFrom=parseInt(aa.value);Aa.pagesTo=parseInt(fa.value);Aa.allPages=Y.checked;Aa.selection=ea.checked;Aa.pageView=ma.checked;Aa.crop=na.checked;Aa.fit=ua.checked;return null!=E?E(!ka,Aa):m.print(!ka,Aa)}var U=m.editor.graph,R=document.createElement("div"),S=document.createElement("h3");S.style.width="100%";S.style.textAlign="center";+S.style.marginTop="0px";mxUtils.write(S,y||mxResources.get("print"));R.appendChild(S);var W=1,X=1;S=document.createElement("div");S.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");S.appendChild(Y);y=document.createElement("span");mxUtils.write(y,mxResources.get("allPages"));mxEvent.addListener(y,"click",function(){Y.checked=!0});S.appendChild(y);mxUtils.br(S);+var Z=Y.cloneNode(!0);S.appendChild(Z);y=document.createElement("span");mxUtils.write(y,mxResources.get("pages")+":");S.appendChild(y);mxEvent.addListener(y,"click",function(){Z.checked=!0});var aa=document.createElement("input");aa.style.margin="0 4px";aa.setAttribute("value","1");aa.setAttribute("type","number");aa.setAttribute("min","1");aa.style.width="40px";S.appendChild(aa);y=document.createElement("span");mxUtils.write(y,mxResources.get("to"));S.appendChild(y);var fa=aa.cloneNode(!0);S.appendChild(fa);+mxEvent.addListener(aa,"focus",function(){Z.checked=!0});mxEvent.addListener(fa,"focus",function(){Z.checked=!0});mxEvent.addListener(aa,"change",O);mxEvent.addListener(fa,"change",O);if(null!=m.pages&&(X=m.pages.length,null!=m.currentPage))for(var ia=0;ia<X;ia++)if(m.currentPage==m.pages[ia]){W=ia+1;break}null!=m.lastPrintPagesFromInput&&null!=m.lastPrintPagesToInput?(aa.value=Math.min(X,Math.max(1,m.lastPrintPagesFromInput)),fa.value=Math.min(X,Math.max(1,m.lastPrintPagesToInput))):(aa.value=W,+fa.value=W);aa.setAttribute("max",X);fa.setAttribute("max",X);ia=mxUtils.button(mxResources.get("currentPage"),function(ka){aa.value=W;fa.value=W;Z.checked=!0});ia.setAttribute("title",mxResources.get("currentPage"));ia.style.marginLeft="4px";ia.style.maxWidth="100px";ia.style.overflow="hidden";ia.style.textOverflow="ellipsis";ia.style.whiteSpace="nowrap";S.appendChild(ia);1<X&&R.appendChild(S);S=document.createElement("div");S.style.borderBottom="1px solid lightGray";S.style.paddingBottom="12px";+S.style.marginBottom="12px";S.style.whiteSpace="nowrap";var ea=document.createElement("input");ea.setAttribute("name","pages-printdialog");ea.setAttribute("type",1==X?"checkbox":"radio");ea.style.marginRight="8px";U.isSelectionEmpty()&&ea.setAttribute("disabled","disabled");U.isEnabled()&&(S.appendChild(ea),y=document.createElement("span"),mxUtils.write(y,mxResources.get("selectionOnly")),S.appendChild(y));(U.isEnabled()||1<X)&&R.appendChild(S);!m.isPagesEnabled()||m.lastPrintPagesRadioChecked?Z.checked=+!0:!U.isSelectionEmpty()&&m.lastPrintSelectionOnlyChecked?ea.checked=!0:Y.checked=!0;U.isSelectionEmpty()||mxEvent.addListener(y,"click",function(){ea.checked=!ea.checked});U=document.createElement("div");U.style.whiteSpace="nowrap";var ma=document.createElement("input");ma.style.marginBottom="8px";ma.style.marginRight="8px";ma.setAttribute("type","radio");ma.setAttribute("name","printSize");U.appendChild(ma);y=document.createElement("span");mxUtils.write(y,mxResources.get("pageView"));U.appendChild(y);+mxEvent.addListener(U,"click",function(){ma.checked=!0});R.appendChild(U);U=document.createElement("div");U.style.whiteSpace="nowrap";var na=document.createElement("input");na.style.marginBottom="8px";na.style.marginRight="8px";na.setAttribute("type","radio");na.setAttribute("name","printSize");U.appendChild(na);y=document.createElement("span");mxUtils.write(y,mxResources.get("crop"));U.appendChild(y);mxEvent.addListener(U,"click",function(){na.checked=!0});R.appendChild(U);U=document.createElement("div");+U.style.whiteSpace="nowrap";var ua=document.createElement("input");ua.style.marginBottom="8px";ua.style.marginRight="8px";ua.setAttribute("type","radio");ua.setAttribute("name","printSize");y=document.createElement("div");y.style.display="inline-block";y.style.verticalAlign="top";y.style.paddingTop="2px";y.appendChild(ua);U.appendChild(y);S=document.createElement("table");S.style.display="inline-block";S.style.borderSpacing="0";ia=document.createElement("tbody");var ta=document.createElement("tr"),+sa=ta.cloneNode(!0),la=document.createElement("td"),ja=la.cloneNode(!0),qa=la.cloneNode(!0),va=la.cloneNode(!0),ya=la.cloneNode(!0),ra=la.cloneNode(!0);la.style.textAlign="right";va.style.textAlign="right";mxUtils.write(la,mxResources.get("fitTo"));mxEvent.addListener(U,"click",function(ka){mxEvent.getSource(ka)!=ua&&(ua.checked=!ua.checked)});var ha=document.createElement("input");ha.style.margin="0 2px";ha.style.boxSizing="border-box";ha.setAttribute("value",m.lastPrintSheetsAcross||"1");ha.setAttribute("min",+"1");ha.setAttribute("type","number");ha.style.width="40px";ja.appendChild(ha);y=document.createElement("span");mxUtils.write(y,mxResources.get("fitToSheetsAcross"));qa.appendChild(y);mxUtils.write(va,mxResources.get("fitToBy"));var Da=ha.cloneNode(!0);Da.setAttribute("value",m.lastPrintSheetsDown||"1");ya.appendChild(Da);mxEvent.addListener(ha,"click",function(ka){ua.checked=!0;mxEvent.consume(ka)});mxEvent.addListener(Da,"click",function(ka){ua.checked=!0;mxEvent.consume(ka)});m.lastPrintCropRadioChecked?+na.checked=!0:m.lastPrintFitRadioChecked?ua.checked=!0:ma.checked=!0;y=document.createElement("span");mxUtils.write(y,mxResources.get("fitToSheetsDown"));ra.appendChild(y);ta.appendChild(la);ta.appendChild(ja);ta.appendChild(qa);sa.appendChild(va);sa.appendChild(ya);sa.appendChild(ra);ia.appendChild(ta);ia.appendChild(sa);S.appendChild(ia);U.appendChild(S);R.appendChild(U);U=document.createElement("div");U.style.borderTop="1px solid lightGray";U.style.whiteSpace="nowrap";U.style.paddingTop="12px";+U.style.marginTop="12px";U.style.paddingLeft="8px";mxUtils.write(U,mxResources.get("borderWidth")+":");var oa=document.createElement("input");oa.setAttribute("type","number");oa.setAttribute("min","0");oa.style.width="40px";oa.style.marginLeft="4px";oa.value=null!=m.lastPrintBorder?m.lastPrintBorder:mxPrintPreview.prototype.pageMargin;U.appendChild(oa);y=document.createElement("span");y.style.marginLeft="8px";mxUtils.write(y,mxResources.get("zoom")+":");U.appendChild(y);var ba=document.createElement("input");+ba.style.width="60px";ba.style.marginLeft="4px";ba.value=null!=m.lastPrintZoom?m.lastPrintZoom:"100%";U.appendChild(ba);mxUtils.br(U);var pa=document.createElement("input");pa.setAttribute("type","checkbox");pa.style.marginTop="12px";pa.checked=null!=m.lastPrintGrid?m.lastPrintGrid:!1;U.appendChild(pa);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("grid"));U.appendChild(y);mxEvent.addListener(y,"click",function(ka){pa.checked=!0;+mxEvent.consume(ka)});var Ba=document.createElement("input");Ba.setAttribute("type","checkbox");Ba.style.marginTop="12px";Ba.checked=null!=m.lastPrintShadow?m.lastPrintShadow:!1;U.appendChild(Ba);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("shadows"));U.appendChild(y);m.isOffline()&&!mxClient.IS_CHROMEAPP||y.appendChild(m.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));mxEvent.addListener(y,"click",function(ka){"IMG"!=+mxEvent.getSource(ka).nodeName&&(Ba.checked=!0,mxEvent.consume(ka))});Editor.enableShadowOption?null!=E&&mxUtils.br(U):(Ba.style.display="none",y.style.display="none");var xa=document.createElement("input");xa.setAttribute("type","checkbox");xa.style.marginTop="10px";xa.checked=null!=m.lastPrintTransparent?m.lastPrintTransparent:!1;null!=E&&(U.appendChild(xa),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("transparentBackground")),U.appendChild(y),mxEvent.addListener(y,+"click",function(ka){xa.checked=!0;mxEvent.consume(ka)}));var ca=document.createElement("input");ca.setAttribute("type","checkbox");ca.style.marginTop="10px";ca.checked=null!=m.lastPrintInclude?m.lastPrintInclude:Editor.defaultIncludeDiagram;null==E||mxClient.IS_CHROMEAPP||"draw.io"!=m.getServiceName()||(mxUtils.br(U),U.appendChild(ca),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("includeCopyOfMyDiagram")),U.appendChild(y),mxEvent.addListener(y,"click",+function(ka){ca.checked=!0;mxEvent.consume(ka)}));R.appendChild(U);y=document.createElement("div");y.style.marginTop="30px";y.style.textAlign="right";y.style.whiteSpace="nowrap";m.isOffline()&&!mxClient.IS_CHROMEAPP||null!=E||y.appendChild(m.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));U=mxUtils.button(mxResources.get("cancel"),function(){m.hideDialog()});U.className="geBtn";m.editor.cancelFirst&&y.appendChild(U);PrintDialog.previewEnabled&&null==E&&(S=mxUtils.button(mxResources.get("preview"),+function(){try{m.hideDialog(),Q(!1)}catch(ka){m.handleError(ka)}}),S.className="geBtn",y.appendChild(S));P=null!=P?P:null!=E?"export":PrintDialog.previewEnabled?"print":"ok";P=mxUtils.button(mxResources.get(P),function(){try{m.hideDialog(),Q(!0)}catch(ka){m.handleError(ka)}});P.className="geBtn gePrimaryBtn";y.appendChild(P);m.editor.cancelFirst||y.appendChild(U);R.appendChild(y);if(m.editor.isChromelessView()){var da=function(){Editor.isDarkMode()?(R.classList.add("geDarkMode"),R.style.colorScheme=+"dark"):(R.classList.remove("geDarkMode"),R.style.colorScheme="light")};m.addListener("darkModeChanged",da);da();var wa=function(ka,Aa){ka=Aa.getProperty("dialog");R.parentNode==ka.container&&(m.editor.removeListener(wa),m.removeListener(da))};m.editor.addListener("hideDialog",wa)}this.container=R};var M=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 m=this.image;null!=m&&null!=m.src&&Graph.isPageLink(m.src)&&(m={originalSrc:m.src});this.page.viewState.backgroundImage=m}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 M.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&&(m=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=m?m:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.6.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)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&+this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.6.5";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)||/.*\.cdn\.prod\.atlassian-dev\.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||"1"==urlParams.dev;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,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:{useWidth:1E3,useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,@@ -13160,7 +13166,7 @@ urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{mxLog.debug(c.join(" "))):console.log.apply(console,c)}}catch(l){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var g=[],l=0;l<c.length;l++)g.push(c[l]);for(l=0;l<g.length;l++)EditorUi.replaceSvgImage(g[l])};EditorUi.replaceSvgImage=function(c){try{var g=null;g=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var l=EditorUi.getSvgSubtree(g);if(null!=l&&"svg"==l.nodeName){var n=l.getAttribute("width"),v=l.getAttribute("height");l.setAttribute("x",c.getAttribute("x"));l.setAttribute("y",c.getAttribute("y"));l.setAttribute("width",c.getAttribute("width"));l.setAttribute("height",c.getAttribute("height"));l.style.fontFamily="initial";0<n&&0<v&&null==l.getAttribute("viewBox")&&l.setAttribute("viewBox","0 0 "+n+" "+v);var x=mxUtils.createElementNs(l.ownerDocument,mxConstants.NS_SVG,"g");x.appendChild(l);c.hasAttribute("transform")&&x.setAttribute("transform",c.getAttribute("transform"));c.parentNode.replaceChild(x,c)}}catch(B){}};EditorUi.getSvgSubtree=function(c){var g=Graph.getSvgFromDataUri(c);c=null;if(null!=g){c=Graph.sanitizeNode(mxUtils.parseXml(g).documentElement);g=c.getElementsByTagName("style");if(0<g.length){var l="svg-image-"+Editor.guid();c.setAttribute("id",l);for(var n=document.implementation.createHTMLDocument(""),v=document.createElement("style"),x=0;x<g.length;x++){v.textContent=g[x].textContent;n.body.appendChild(v);for(var B="",C=-0;C<v.sheet.cssRules.length;C++){var H=v.sheet.cssRules[C];if(null!=H.selectorText){for(var D=H.selectorText.split(","),U=0;U<D.length;U++)D[U]="#"+l+" "+D[U];H.selectorText=D.join(",")}B+=H.cssText+"\n"}g[x].textContent=B}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");g=c.getElementsByTagName("*");for(l=0;l<g.length;l++)g[l].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+0;C<v.sheet.cssRules.length;C++){var G=v.sheet.cssRules[C];if(null!=G.selectorText){for(var N=G.selectorText.split(","),J=0;J<N.length;J++)N[J]="#"+l+" "+N[J];G.selectorText=N.join(",")}B+=G.cssText+"\n"}g[x].textContent=B}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");g=c.getElementsByTagName("*");for(l=0;l<g.length;l++)g[l].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.sidebarEnabled="0"!=urlParams.sidebar;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedMessageSource=null;EditorUi.prototype.defaultCompact=!1;EditorUi.prototype.noAutoFocus=!1;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;EditorUi.prototype.createButtonContainer=function(){var c=document.createElement("div");c.className="geButtonContainer";return c};EditorUi.prototype.openLink=@@ -13168,10 +13174,10 @@ function(c,g,l){return this.editor.graph.openLink(c,g,l)};EditorUi.prototype.shoc;this.fireEvent(new mxEventObject("shareCursorPositionChanged"))};EditorUi.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 g=this.editor.graph;g.mathEnabled=c;null!=g.view.backgroundImage&&(g.view.backgroundImage.destroy(),g.view.backgroundImage=null);this.editor.updateGraphComponents();g.refresh();g.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,g,l){var n=null==c||null==g;l=null!=l?l:24;var v=new Spinner({lines:12,length:l,width:Math.round(l/-3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),x=this.timeout,B=v.spin,C=null,H=null,D=mxUtils.bind(this,function(V){null!=V&&V()}),U=this;v.spin=function(V,t,z,L){L=null!=L?L:x;var K=!1;if(!this.active){var M=Date.now();null!=z&&(C=window.setTimeout(function(){v.stop();C=null;z({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:H})},L));n&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||-0)/2,c=document.body.clientWidth/2-2);V==document.body&&"1"==urlParams.embedInline&&(V=U.diagramContainer,c=V.scrollLeft+V.clientWidth/2,g=V.scrollTop+V.clientHeight/2);B.call(this,V);"1"==urlParams.embedInline&&null!=v.el&&(v.el.style.marginTop=V.scrollTop+"px",v.el.style.marginLeft=V.scrollLeft+"px");this.active=!0;null!=t&&(K=document.createElement("div"),K.className="geSpinnerStatus",K.setAttribute("title",t),V==document.body?(K.style.left=Math.max(0,c)+"px",K.style.top=Math.max(0,g+66)+"px"):-(K.style.left="50%",K.style.top="50%",K.style.marginTop="70px"),"..."!=t.substring(t.length-3,t.length)&&"!"!=t.charAt(t.length-1)&&(t+="..."),K.innerText=t,V.appendChild(K),v.status=K);this.pause=mxUtils.bind(this,function(){var m=D;this.active&&(L=Math.max(0,L-(Date.now()-M)),m=mxUtils.bind(this,function(y){this.spin(V,t,z,L);if(null!=y)try{y(),H=mxUtils.bind(this,function(){this.spin(V,t,z,L);try{y()}catch(F){null!=z&&z(F)}})}catch(F){null!=z&&z(F)}}));this.stop();return m});K=!0}return K};var S=-v.stop;v.stop=function(){S.call(this);this.active&&(this.active=!1,null!=C&&(window.clearTimeout(C),C=null),null!=v.status&&null!=v.status.parentNode&&v.status.parentNode.removeChild(v.status),v.status=null)};v.pause=function(){return D};return v};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var g=mxUtils.parseXml(c),l=this.editor.extractGraphModel(g.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}}catch(n){}return!1};+3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),x=this.timeout,B=v.spin,C=null,G=null,N=mxUtils.bind(this,function(V){null!=V&&V()}),J=this;v.spin=function(V,t,z,L){L=null!=L?L:x;var K=!1;if(!this.active){var M=Date.now();null!=z&&(C=window.setTimeout(function(){v.stop();C=null;z({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:G})},L));n&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||+0)/2,c=document.body.clientWidth/2-2);V==document.body&&"1"==urlParams.embedInline&&(V=J.diagramContainer,c=V.scrollLeft+V.clientWidth/2,g=V.scrollTop+V.clientHeight/2);B.call(this,V);"1"==urlParams.embedInline&&null!=v.el&&(v.el.style.marginTop=V.scrollTop+"px",v.el.style.marginLeft=V.scrollLeft+"px");this.active=!0;null!=t&&(K=document.createElement("div"),K.className="geSpinnerStatus",K.setAttribute("title",t),V==document.body?(K.style.left=Math.max(0,c)+"px",K.style.top=Math.max(0,g+66)+"px"):+(K.style.left="50%",K.style.top="50%",K.style.marginTop="70px"),"..."!=t.substring(t.length-3,t.length)&&"!"!=t.charAt(t.length-1)&&(t+="..."),K.innerText=t,V.appendChild(K),v.status=K);this.pause=mxUtils.bind(this,function(){var m=N;this.active&&(L=Math.max(0,L-(Date.now()-M)),m=mxUtils.bind(this,function(y){this.spin(V,t,z,L);if(null!=y)try{y(),G=mxUtils.bind(this,function(){this.spin(V,t,z,L);try{y()}catch(E){null!=z&&z(E)}})}catch(E){null!=z&&z(E)}}));this.stop();return m});K=!0}return K};var T=+v.stop;v.stop=function(){T.call(this);this.active&&(this.active=!1,null!=C&&(window.clearTimeout(C),C=null),null!=v.status&&null!=v.status.parentNode&&v.status.parentNode.removeChild(v.status),v.status=null)};v.pause=function(){return N};return v};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var g=mxUtils.parseXml(c),l=this.editor.extractGraphModel(g.documentElement,!0);return null!=l&&0==l.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 g=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=g.getFunction,n=this.editor.graph,v=this;g.getFunction=function(x){if(n.isSelectionEmpty()&&null!=v.pages&&0<v.pages.length){var B=v.getSelectedPageIndex();if(mxEvent.isShiftDown(x)){if(37==x.keyCode)return function(){0<B&&v.movePage(B,B-1)};if(38==x.keyCode)return function(){0<B&&v.movePage(B,0)};if(39==x.keyCode)return function(){B<v.pages.length-1&&v.movePage(B,B+1)};if(40==x.keyCode)return function(){B<v.pages.length-1&&v.movePage(B,v.pages.length-1)}}else if(mxEvent.isControlDown(x)||mxClient.IS_MAC&&@@ -13180,12 +13186,12 @@ arguments):null}}return g};var f=EditorUi.prototype.extractGraphModelFromHtml;Edg=null!=x?mxUtils.getXml(x):""}}catch(B){}return g};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var g=c.indexOf('<meta charset="utf-8">');0<=g&&(c=c.slice(0,g)+'<meta charset="utf-8"/>'+c.slice(g+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,g){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",g);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=null!=c?this.editor.extractGraphModel(c,!0):null;null!=l&&(c=l);if(null!=c){l=this.editor.graph;l.model.beginUpdate();try{var n=null!=this.pages?this.pages.slice():null,v=c.getElementsByTagName("diagram");if(1<v.length||1==v.length&&v[0].hasAttribute("name")){this.fileNode=c;l.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var x=v.length-1;0<=x;x--){var B=this.updatePageRoot(new DiagramPage(v[x]));null==B.getName()&&B.setName(mxResources.get("pageWithNumber",[x+1]));l.model.execute(new ChangePage(this,B,0==x?B: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])),l.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,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=-n)for(x=0;x<n.length;x++)l.model.execute(new ChangePage(this,n[x],null));var C=this.getCurrentFile();null!=C&&C.fileReplaced(g)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,g,l,n,v,x,B,C,H,D,U,S,V){g=null!=g?g:this.editor.graph;v=null!=v?v:!1;H=null!=H?H:!0;D=null!=D?D:this.defaultCompact;U=null!=U?U:!Editor.defaultCompressed;var t=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var z="_blank";else t=z=n;if(null==c)return"";var L=c;if("mxfile"!=-L.nodeName.toLowerCase()){if(U){var K=c.ownerDocument.createElement("diagram");K.setAttribute("name",mxResources.get("pageWithNumber",[1]));K.setAttribute("id",Editor.guid());K.appendChild(c)}else{K=Graph.zapGremlins(mxUtils.getXml(c));L=Graph.compress(K);if(Graph.decompress(L)!=K)return K;K=c.ownerDocument.createElement("diagram");K.setAttribute("name",mxResources.get("pageWithNumber",[1]));K.setAttribute("id",Editor.guid());mxUtils.setTextContent(K,L)}L=c.ownerDocument.createElement("mxfile");L.appendChild(K)}D?+n)for(x=0;x<n.length;x++)l.model.execute(new ChangePage(this,n[x],null));var C=this.getCurrentFile();null!=C&&C.fileReplaced(g)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,g,l,n,v,x,B,C,G,N,J,T,V){g=null!=g?g:this.editor.graph;v=null!=v?v:!1;G=null!=G?G:!0;N=null!=N?N:this.defaultCompact;J=null!=J?J:!Editor.defaultCompressed;var t=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var z="_blank";else t=z=n;if(null==c)return"";var L=c;if("mxfile"!=+L.nodeName.toLowerCase()){if(J){var K=c.ownerDocument.createElement("diagram");K.setAttribute("name",mxResources.get("pageWithNumber",[1]));K.setAttribute("id",Editor.guid());K.appendChild(c)}else{K=Graph.zapGremlins(mxUtils.getXml(c));L=Graph.compress(K);if(Graph.decompress(L)!=K)return K;K=c.ownerDocument.createElement("diagram");K.setAttribute("name",mxResources.get("pageWithNumber",[1]));K.setAttribute("id",Editor.guid());mxUtils.setTextContent(K,L)}L=c.ownerDocument.createElement("mxfile");L.appendChild(K)}N?(L=L.cloneNode(!0),L.removeAttribute("modified"),L.removeAttribute("host"),L.removeAttribute("agent"),L.removeAttribute("etag"),L.removeAttribute("userAgent"),L.removeAttribute("version"),L.removeAttribute("editor"),L.removeAttribute("type")):(L.removeAttribute("userAgent"),L.removeAttribute("modified"),L.removeAttribute("version"),L.removeAttribute("editor"),L.removeAttribute("pages"),L.removeAttribute("type"),L.removeAttribute("etag"),mxClient.IS_CHROMEAPP?L.setAttribute("host","Chrome"):EditorUi.isElectronApp?-L.setAttribute("host","Electron"):L.setAttribute("host",window.location.hostname),L.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),L.setAttribute("version",EditorUi.VERSION),1<L.getElementsByTagName("diagram").length&&null!=this.pages&&L.setAttribute("pages",this.pages.length));null!=S&&(L=L.cloneNode(!0),L.setAttribute("scale",S));null!=V&&(L=L.cloneNode(!0),L.setAttribute("border",V));c=U?mxUtils.getPrettyXml(L):mxUtils.getXml(L);if(!x&&!v&&(B||null!=l&&-/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(L),g,null!=l?l.getTitle():null,z,t);else if(x||!v&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(L),c=this.getEmbeddedSvg(c,g,n,null,C,H,t,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,n){c=null!=c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var v=this.editor.getGraphXml(c,-n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(H){var D=H.getElementsByTagName("mxGraphModel"),U=0<D.length?D[0]:null;D=H;null==U&&l?(U=mxUtils.getNodeValue(H),0<U.length&&(U=Graph.decompress(U),null!=U&&0<U.length&&(D=H.cloneNode(!1),D.appendChild(mxUtils.parseXml(U).documentElement)))):null==U||l?D=H.cloneNode(!0):(D=H.cloneNode(!1),mxUtils.setTextContent(D,Graph.compressNode(U)));v.appendChild(D)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(v),+L.setAttribute("host","Electron"):L.setAttribute("host",window.location.hostname),L.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),L.setAttribute("version",EditorUi.VERSION),1<L.getElementsByTagName("diagram").length&&null!=this.pages&&L.setAttribute("pages",this.pages.length));null!=T&&(L=L.cloneNode(!0),L.setAttribute("scale",T));null!=V&&(L=L.cloneNode(!0),L.setAttribute("border",V));c=J?mxUtils.getPrettyXml(L):mxUtils.getXml(L);if(!x&&!v&&(B||null!=l&&+/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(L),g,null!=l?l.getTitle():null,z,t);else if(x||!v&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(L),c=this.getEmbeddedSvg(c,g,n,null,C,G,t,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,n){c=null!=c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var v=this.editor.getGraphXml(c,+n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(G){var N=G.getElementsByTagName("mxGraphModel"),J=0<N.length?N[0]:null;N=G;null==J&&l?(J=mxUtils.getNodeValue(G),0<J.length&&(J=Graph.decompress(J),null!=J&&0<J.length&&(N=G.cloneNode(!1),N.appendChild(mxUtils.parseXml(J).documentElement)))):null==J||l?N=G.cloneNode(!0):(N=G.cloneNode(!1),mxUtils.setTextContent(N,Graph.compressNode(J)));v.appendChild(N)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(v),v=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var x=this.pages[g],B=x.node;if(x!=this.currentPage)if(x.needsUpdate){var C=new mxCodec(mxUtils.createXmlDocument());C=C.encode(new mxGraphModel(x.root));this.editor.graph.saveViewState(x.viewState,C,null,n);EditorUi.removeChildNodes(B);B.appendChild(C);delete x.needsUpdate}else n&&(this.updatePageRoot(x),null!=x.viewState.backgroundImage&&null!=x.viewState.backgroundImage.originalSrc&&(C=new mxCodec(mxUtils.createXmlDocument()),C=C.encode(new mxGraphModel(x.root)),this.editor.graph.saveViewState(x.viewState,C,null,n,x),B=B.cloneNode(!1),B.appendChild(C)));c(B)}return v};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],n=0;n<c.length;n++){var v=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(v)?l.push(v):isNaN(parseInt(v))?v.toLowerCase()!=v?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):v.toUpperCase()!=v?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(v)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(x){c[EditorUi.DIFF_INSERT][g].data=x.message}if(null!=@@ -13193,10 +13199,10 @@ c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var v=c[EditorUi.g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(v.cells)&&delete v.cells);mxUtils.isEmptyObject(v)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(c,g){g=c.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&g[l].setAttribute("value","["+g[l].getAttribute("value").length+"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length+"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),-this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,g,l,n,v,x,B,C,H,D,U,S,V){v=null!=v?v:!0;x=null!=x?x:!1;D=null!=D?D:!Editor.defaultCompressed;var t=-this.editor.graph;if((g||!c&&null!=H&&/(\.svg)$/i.test(H.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var z=t.getGlobalVariable;t=this.createTemporaryGraph(t.getStylesheet());t.setBackgroundImage=this.editor.graph.setBackgroundImage;t.background=this.editor.graph.background;var L=null!=this.pages?this.pages[0]:null;null==L||this.currentPage==L?t.setBackgroundImage(this.editor.graph.backgroundImage):null!=L.viewState&&null!=L.viewState&&t.setBackgroundImage(L.viewState.backgroundImage);-t.getGlobalVariable=function(K){return"page"==K&&null!=L?L.getName():"pagenumber"==K?1:z.apply(this,arguments)};document.body.appendChild(t.container);null!=L&&t.model.setRoot(L.root)}B=null!=B?B:this.getXmlFileData(v,x,D,U);H=null!=H?H:this.getCurrentFile();c=this.createFileData(B,t,H,window.location.href,c,g,l,n,v,C,D,S,V);t!=this.editor.graph&&t.container.parentNode.removeChild(t.container);return c};EditorUi.prototype.getHtml=function(c,g,l,n,v,x){x=null!=x?x:!0;var B=null,C=EditorUi.drawHost+-"/js/embed-static.min.js";if(null!=g){B=x?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var H=g.view.scale;x=Math.floor(B.x/H-g.view.translate.x);H=Math.floor(B.y/H-g.view.translate.y);B=g.background;null==v&&(g=this.getBasenames().join(";"),0<g.length&&(C=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",x);c.setAttribute("y0",H)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),+this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,g,l,n,v,x,B,C,G,N,J,T,V){v=null!=v?v:!0;x=null!=x?x:!1;N=null!=N?N:!Editor.defaultCompressed;var t=+this.editor.graph;if((g||!c&&null!=G&&/(\.svg)$/i.test(G.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var z=t.getGlobalVariable;t=this.createTemporaryGraph(t.getStylesheet());t.setBackgroundImage=this.editor.graph.setBackgroundImage;t.background=this.editor.graph.background;var L=null!=this.pages?this.pages[0]:null;null==L||this.currentPage==L?t.setBackgroundImage(this.editor.graph.backgroundImage):null!=L.viewState&&null!=L.viewState&&t.setBackgroundImage(L.viewState.backgroundImage);+t.getGlobalVariable=function(K){return"page"==K&&null!=L?L.getName():"pagenumber"==K?1:z.apply(this,arguments)};document.body.appendChild(t.container);null!=L&&t.model.setRoot(L.root)}B=null!=B?B:this.getXmlFileData(v,x,N,J);G=null!=G?G:this.getCurrentFile();c=this.createFileData(B,t,G,window.location.href,c,g,l,n,v,C,N,T,V);t!=this.editor.graph&&t.container.parentNode.removeChild(t.container);return c};EditorUi.prototype.getHtml=function(c,g,l,n,v,x){x=null!=x?x:!0;var B=null,C=EditorUi.drawHost++"/js/embed-static.min.js";if(null!=g){B=x?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var G=g.view.scale;x=Math.floor(B.x/G-g.view.translate.x);G=Math.floor(B.y/G-g.view.translate.y);B=g.background;null==v&&(g=this.getBasenames().join(";"),0<g.length&&(C=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",x);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!=v&&(v=v.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=encodeURIComponent(c));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!=l?"<title>"+mxUtils.htmlEntities(l)+"</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;">'+n+"</div>\n</div>\n"+(null==v?'<script type="text/javascript" src="'+C+'">\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(c,g,l,n,v){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=v&&(v=v.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==v?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':@@ -13205,400 +13211,402 @@ EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};Editthis.pages=this.fileNode=this.currentPage=null;g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var n=this.getHashObject(),v=null;this.fileNode=g;this.editor.graph.defaultExportLinkTarget=g.getAttribute("linkTarget");this.pages=[];for(var x=0;x<c.length;x++){null==c[x].getAttribute("id")&&c[x].setAttribute("id",x);g=new DiagramPage(c[x]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[x+1]));this.pages.push(g);if(null==n.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||null!=n.pageId&&g.getId()==n.pageId)v=g;if(null==l[g.getId()])l[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(x=0;x<B.length;x++)g[B[x]]=!0;var C=this.editor.graph.getModel(),H=C.getChildren(C.root);for(x=0;x<H.length;x++){var D=H[x];C.setVisible(D,g[D.id]||!1)}}catch(U){}};EditorUi.prototype.fileStats=function(c,g){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=g.getElementsByTagName("diagram");g=-{};g.modified=c.getLastModifiedDate();g.fileMode=c.getMode();g.fileSize=c.getSize();g.fileHash=c.getHash();g.pages=l.length;g.redundantStencils=0;g.redundantImages=0;g.redundantSize=0;g.stencils=0;g.images=0;for(var n=g.cells=0;n<l.length;n++){var v=l[n].getElementsByTagName("mxCell");g.cells+=v.length;for(var x={},B=0;B<v.length;B++){var C=v[B].getAttribute("style");if(null!=C)for(var H=C.split(";"),D=0;D<H.length;D++){var U=H[D];if(U.startsWith("image=data:")||U.startsWith("shape=stencil("))null==-x[U]?x[U]=1:x[U]++}}for(var S in x){var V=x[S];S.startsWith("shape=stencil(")?g.stencils+=V:g.images+=V;1<V&&(g.redundantSize+=S.length*(V-1),S.startsWith("shape=stencil(")?g.redundantStencils+=V-1:g.redundantImages+=V-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(g)})}}catch(t){}};EditorUi.prototype.getBaseFilename=function(c){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(".")));!c&&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(c,g,l,n,v,x,B,C,H,D,U,S,V,t,z,L,K){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();-var M=this.getBaseFilename(!v),m=M+("xml"==c||"pdf"==c&&U?".drawio":"")+"."+c;if("xml"==c){var y=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,v,null,null,null,g);this.saveData(m,c,y,"text/xml")}else if("html"==c)y=this.getHtml2(this.getFileData(!0),this.editor.graph,M),this.saveData(m,c,y,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?m=M+".png":"jpeg"==c&&(m=M+".jpg"),this.saveRequest(m,c,mxUtils.bind(this,function(T,-Q){try{return this.createDownloadRequest(T,c,n,Q,B,v,C,H,D,U,S,void 0,void 0,!x,V,t,z,L,K)}catch(R){this.handleError(R)}}));else{var F=null,N=mxUtils.bind(this,function(T){T.length<=MAX_REQUEST_SIZE?this.saveData(m,"svg",T,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(F)}))});if("svg"==c){var O=this.editor.graph.background;if(B||O==mxConstants.NONE)O=null;var P=this.editor.graph.getSvg(O,null,null,-null,null,n);l&&this.editor.graph.addSvgShadow(P);this.editor.convertImages(P,mxUtils.bind(this,mxUtils.bind(this,function(T){this.spinner.stop();N(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(T))})))}else m=M+".svg",F=this.getFileData(!1,!0,null,mxUtils.bind(this,function(T){this.spinner.stop();N(T)}),n)}}catch(T){this.handleError(T)}};EditorUi.prototype.createDownloadRequest=function(c,g,l,n,v,x,B,C,H,D,U,S,V,t,z,L,K,M,m){c=this.downloadRequestBuilder(c,g,l,n,v,x,B,C,H,D,U,S,V,-t,z,L,K,M,m);g="";for(var y in c)l=c[y],null!=l&&(g+=y+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,l,n,v,x,B,C,H,D,U,S,V,t,z,L,K,M,m){var y=this.editor.graph,F=y.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==x?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var N=null,O=null,P=null;if(!EditorUi.isElectronApp&&(F.width*F.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};-D=D?"1":"0";"pdf"==g&&(null!=U?(N=U.from,O=U.to):0==x&&(P="1"));"xmlpng"==g&&(D="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(x=0;x<this.pages.length;x++)if(this.pages[x]==this.currentPage){N=x;break}x=y.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!v?v||null!=x&&x!=mxConstants.NONE||(x="#ffffff"):x=mxConstants.NONE;v={globalVars:y.getExportVariables()};null!=U&&null!=U.from&&(v.globalVars.pagenumber=U.from+1);H&&(v.grid={size:y.gridSize,steps:y.view.gridSteps,-color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:y.view.gridColor});Graph.translateDiagram&&(v.diagramLanguage=Graph.diagramLanguage);return{format:g,from:N,to:O,allPages:P,bg:null!=x?x:mxConstants.NONE,base64:n,embedXml:D,xml:l,filename:null!=c?c:"",extras:JSON.stringify(v),scale:B,border:C,pageMargin:z,w:S&&isFinite(S)?S:null,h:V&&isFinite(V)?V:null,crop:null!=t&&t?"1":"0",fit:null!=L&&L?"1":"0",shadows:null!=m&&m?"1":"0",sheetsAcross:K,sheetsDown:M}};EditorUi.prototype.setMode=-function(c,g){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 g=c.indexOf("#");0<=g&&(c=c.substring(0,g))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,g={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{g=JSON.parse(c)}catch(n){}}}return g};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 g=window.location.hash;if(null==g||""==g)g="#";var l=g.lastIndexOf("#");0<l&&(g=g.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(g=g+"#"+encodeURIComponent(JSON.stringify(c)))}catch(n){}0<l&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};-EditorUi.prototype.loadDescriptor=function(c,g,l){var n=window.location.hash,v=mxUtils.bind(this,function(B){var C=null!=c.data?c.data:"";null!=B&&0<B.length&&(0<C.length&&(C+="\n"),C+=B);B=new LocalFile(this,"csv"!=c.format&&0<C.length?C:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);B.getHash=function(){return n};this.fileLoaded(B);"csv"==c.format&&this.importCsv(C,mxUtils.bind(this,function(V){this.editor.undoManager.clear();this.editor.setModified(!1);-this.clearStatus()}));if(null!=c.update){var H=null!=c.interval?parseInt(c.interval):6E4,D=null,U=mxUtils.bind(this,function(){var V=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(t){V===this.currentPage&&(200<=t.getStatus()&&300>=t.getStatus()?(this.updateDiagram(t.getText()),S()):this.handleError({message:mxResources.get("error")+" "+t.getStatus()}))}),mxUtils.bind(this,function(t){this.handleError(t)}))}),S=-mxUtils.bind(this,function(){window.clearTimeout(D);D=window.setTimeout(U,H)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){S();U()}));S();U()}null!=g&&g()});if(null!=c.url&&0<c.url.length){var x=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(x,mxUtils.bind(this,function(B){v(B)}),mxUtils.bind(this,function(B){null!=l&&l(B)}))}else v("")};EditorUi.prototype.updateDiagram=function(c){function g(y){var F=new mxCellOverlay(y.image||v.warningImage,y.tooltip,y.align,y.valign,-y.offset);F.addListener(mxEvent.CLICK,function(N,O){n.alert(y.tooltip)});return F}var l=null,n=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var v=this.editor.graph,x=v.getModel();x.beginUpdate();var B=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var C=x.getCell(c.getAttribute("id"));if(null!=C){try{var H=c.getAttribute("value");if(null!=H){var D=mxUtils.parseXml(H).documentElement;if(null!=D)if("1"==D.getAttribute("replace-value"))x.setValue(C,-D);else for(var U=D.attributes,S=0;S<U.length;S++)v.setAttributeForCell(C,U[S].nodeName,0<U[S].nodeValue.length?U[S].nodeValue:null)}}catch(y){null!=window.console&&console.log("Error in value for "+C.id+": "+y)}try{var V=c.getAttribute("style");null!=V&&v.model.setStyle(C,V)}catch(y){null!=window.console&&console.log("Error in style for "+C.id+": "+y)}try{var t=c.getAttribute("icon");if(null!=t){var z=0<t.length?JSON.parse(t):null;null!=z&&z.append||v.removeCellOverlays(C);null!=z&&v.addCellOverlay(C,-g(z))}}catch(y){null!=window.console&&console.log("Error in icon for "+C.id+": "+y)}try{var L=c.getAttribute("geometry");if(null!=L){L=JSON.parse(L);var K=v.getCellGeometry(C);if(null!=K){K=K.clone();for(key in L){var M=parseFloat(L[key]);"dx"==key?K.x+=M:"dy"==key?K.y+=M:"dw"==key?K.width+=M:"dh"==key?K.height+=M:K[key]=parseFloat(L[key])}v.model.setGeometry(C,K)}}}catch(y){null!=window.console&&console.log("Error in icon for "+C.id+": "+y)}}}else if("model"==c.nodeName){for(var m=c.firstChild;null!=-m&&m.nodeType!=mxConstants.NODETYPE_ELEMENT;)m=m.nextSibling;null!=m&&(new mxCodec(c.firstChild)).decode(m,x)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(v.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))v.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(B=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{x.endUpdate()}null!=-B&&this.chromelessResize&&this.chromelessResize(!0,B)}return l};EditorUi.prototype.getCopyFilename=function(c,g){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var n=l.lastIndexOf(".");0<=n&&(c=l.substring(n),l=l.substring(0,n));if(g){g=l;var v=new Date;l=v.getFullYear();n=v.getMonth()+1;var x=v.getDate(),B=v.getHours(),C=v.getMinutes();v=v.getSeconds();l=g+(" "+(l+"-"+n+"-"+x+"-"+B+"-"+C+"-"+v))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=-function(c,g){try{null!=c&&g&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,g,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[g]);var n=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var v=!1;this.hideDialog();null!=n&&(n.removeListener(this.descriptorChangedListener),this.logIfModified(n,!0),n.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var x=mxUtils.bind(this,-function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=n&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!g&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();g||("0"!=urlParams.splash?this.showSplash():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=-c)try{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.clearStatus():this.updateStatus(mxUtils.bind(this,function(){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||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));v=!0;if(!this.isOffline()&&-null!=c.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.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+B})}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(C){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(C){}}catch(C){this.fileLoadedError=C;if(null!=c)try{c.close()}catch(H){}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)||x():x()});g?c():(null!=C.fallbackFileData&&-(C.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var H=new LocalFile(this,C.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(H)})}),this.handleError(C,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else x();return v};EditorUi.prototype.getHashValueForPages=function(c,g){var l=0,n=new mxGraphModel,v=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var x=0;x<c.length;x++){this.updatePageRoot(c[x]);-var B=c[x].node.cloneNode(!1);B.removeAttribute("name");n.root=c[x].root;var C=v.encode(n);this.editor.graph.saveViewState(c[x].viewState,C,!0);C.removeAttribute("pageWidth");C.removeAttribute("pageHeight");B.appendChild(C);null!=g&&(g.eltCount+=B.getElementsByTagName("*").length,g.nodeCount+=B.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(B,function(H,D,U,S){return!S||"mxGeometry"!=H.nodeName&&"mxPoint"!=H.nodeName||"x"!=D&&"y"!=D&&"width"!=D&&"height"!=D?S&&"mxCell"==H.nodeName&&-"previous"==D?null:U:Math.round(U)},g)<<0}return l};EditorUi.prototype.hashValue=function(c,g,l){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,g,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var v=0;v<c.attributes.length;v++){var x=c.attributes[v].name,B=null!=g?g(c,x,c.attributes[v].value,!0):c.attributes[v].value;null!=B&&(n^=this.hashValue(x,-g,l)+this.hashValue(B,g,l))}}if(null!=c.childNodes)for(v=0;v<c.childNodes.length;v++)n=(n<<5)-n+this.hashValue(c.childNodes[v],g,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);g=0;null!=l&&(l.byteCount+=c.length);for(v=0;v<c.length;v++)g=(g<<5)-g+c.charCodeAt(v)<<0;n^=g}return n};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,g,l,n,v,x,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(c){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var g=0;g<c.length;g++)null!=c[g].xml&&"<"!=c[g].xml.charAt(0)&&-(c[g].xml=mxUtils.trim(Graph.decompress(c[g].xml)));g=mxUtils.createXmlDocument();var l=g.createElement("mxlibrary");mxUtils.setTextContent(l,JSON.stringify(c,null,2));g.appendChild(l);return mxUtils.getXml(g,"\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 g=this.sidebar.palettes[c];-if(null!=g){for(var l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,g){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!g){null==c&&(g=this.sidebar.palettes["L.scratchpad"],null==g&&(g=this.sidebar.palettes.search),null!=g&&(c=g[g.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;g=l.lastChild;var n=g.previousSibling;l.insertBefore(g,c);l.insertBefore(n,-g)}};EditorUi.prototype.loadLibrary=function(c,g){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var n=JSON.parse(mxUtils.getTextContent(l.documentElement));this.libraryLoaded(c,n,l.documentElement.getAttribute("title"),g,l.documentElement.getAttribute("tags"))}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.showSearchWindow=function(c,g){var l=c?"findReplace":"find",n=l+"Window";if(null==this[n]){var v="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=c?v?330:300:240;this[n]=new FindWindow(this,document.body.offsetWidth-(x+20),100,x,c?v?304:288:180,c);this[n].window.addListener("show",function(){this.fireEvent(new mxEventObject(l))});this[n].window.addListener("hide",function(){this.fireEvent(new mxEventObject(l))});-this[n].window.setVisible(!0)}else null==g&&this[n].window.setVisible(!this[n].window.isVisible());null!=g&&(this[n].doSearch(g),this[n].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,g,l,n,v){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var x=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var B=0;B<this.openLibraries.length;B++)if(this.openLibraries[B].file.getHash()==-c.getHash()){mxUtils.remove(this.openLibraries[B],this.openLibraries);break}x={file:c,images:g,title:l,expand:n};this.openLibraries.push(x)}else this.scratchpad=c;B=this.sidebar.palettes[c.getHash()];B=null!=B?B[B.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var C=null,H=mxUtils.bind(this,function(m,y){0==m.length&&c.isEditable()?(null==C&&(C=document.createElement("div"),C.className="geDropTarget",mxUtils.write(C,mxResources.get("dragElementsHere"))),y.appendChild(C)):this.addLibraryEntries(m,-y)});null!=this.sidebar&&null!=g&&this.sidebar.addEntries(g,v);null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var D=this.sidebar.addPalette(c.getHash(),l,null!=n?n:!0,mxUtils.bind(this,function(m){H(g,m)}));null!=x&&(x.div=D);this.repositionLibrary(B,"L.scratchpad"!=c.getHash());n=D.parentNode.previousSibling;l=n.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var U=document.createElement("div");-U.style.backgroundColor="inherit";n.style.position="relative";var S=document.createElement("img");S.className="geLibraryButton";S.setAttribute("src",Editor.crossImage);S.setAttribute("title",mxResources.get("close"));var V=null;if(".scratchpad"!=c.title||this.closableScratchpad)U.appendChild(S),mxEvent.addListener(S,"click",mxUtils.bind(this,function(m){if(!mxEvent.isConsumed(m)){var y=mxUtils.bind(this,function(){null!=x&&mxUtils.remove(x,this.openLibraries);this.closeLibrary(c)});null!=V?this.confirm(mxResources.get("allChangesLost"),-null,y,mxResources.get("cancel"),mxResources.get("discardChanges")):y();mxEvent.consume(m)}}));if(c.isEditable()){var t=this.editor.graph,z=null;l=mxUtils.bind(this,function(m){this.showLibraryDialog(c.getTitle(),D,g,c,c.getMode());mxEvent.consume(m)});var L=mxUtils.bind(this,function(m){c.setModified(!0);c.isAutosave()?(null!=z&&null!=z.parentNode&&z.parentNode.removeChild(z),z=S.cloneNode(!1),z.setAttribute("src",Editor.spinImage),z.setAttribute("title",mxResources.get("saving")),z.style.cursor=-"default",z.style.marginRight="2px",z.style.marginTop="-2px",U.insertBefore(z,U.firstChild),this.saveLibrary(c.getTitle(),g,c,c.getMode(),!0,!0,function(){null!=z&&null!=z.parentNode&&z.parentNode.removeChild(z)})):null==V&&(V=S.cloneNode(!1),V.setAttribute("src",Editor.saveImage),V.setAttribute("title",mxResources.get("save")),U.insertBefore(V,U.firstChild),mxEvent.addListener(V,"click",mxUtils.bind(this,function(y){this.saveLibrary(c.getTitle(),g,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==-V||c.isModified()||(V.parentNode.removeChild(V),V=null)});mxEvent.consume(y)})))}),K=mxUtils.bind(this,function(m,y,F,N){m=t.cloneCells(mxUtils.sortCells(t.model.getTopmostCells(m)));for(var O=0;O<m.length;O++){var P=t.getCellGeometry(m[O]);null!=P&&P.translate(-y.x,-y.y)}D.appendChild(this.sidebar.createVertexTemplateFromCells(m,y.width,y.height,N||"",!0,null,!1));m=mxUtils.getXml(this.editor.graph.encodeCells(m));Editor.defaultCompressed&&(m=Graph.compress(m));y={xml:m,w:y.width,h:y.height};null!=-N&&(y.title=N);g.push(y);L(F);null!=C&&null!=C.parentNode&&0<g.length&&(C.parentNode.removeChild(C),C=null)}),M=mxUtils.bind(this,function(m){if(t.isSelectionEmpty())t.getRubberband().isActive()?(t.getRubberband().execute(m),t.getRubberband().reset()):null!=m&&mxEvent.getSource(m).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var y=t.getSelectionCells(),F=t.view.getBounds(y);if(null!=F&&0<F.width&&0<-F.height){var N=t.view.scale;F.x/=N;F.y/=N;F.width/=N;F.height/=N;F.x-=t.view.translate.x;F.y-=t.view.translate.y;K(y,F)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(m)});mxEvent.addGestureListeners(D,function(){},mxUtils.bind(this,function(m){t.isMouseDown&&null!=t.panningManager&&null!=t.graphHandler.first&&(t.graphHandler.suspend(),null!=t.graphHandler.hint&&(t.graphHandler.hint.style.visibility="hidden"),D.style.backgroundColor=-"light-dark(#fefefe, #000000)",D.style.cursor="copy",t.panningManager.stop(),t.autoScroll=!1,mxEvent.consume(m))}),mxUtils.bind(this,function(m){t.isMouseDown&&null!=t.panningManager&&null!=t.graphHandler&&(D.style.backgroundColor="",D.style.cursor="default",this.sidebar.showTooltips=!0,t.panningManager.stop(),t.graphHandler.reset(),t.isMouseDown=!1,t.autoScroll=!0,M(m),mxEvent.consume(m))}));mxEvent.addListener(D,"mouseleave",mxUtils.bind(this,function(m){t.isMouseDown&&null!=t.graphHandler.first&&-(t.graphHandler.resume(),null!=t.graphHandler.hint&&(t.graphHandler.hint.style.visibility="visible"),D.style.backgroundColor="",D.style.cursor="",t.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(m){D.style.backgroundColor="light-dark(#fefefe, #000000)";m.dataTransfer.dropEffect="copy";D.style.cursor="copy";this.sidebar.hideTooltip();m.stopPropagation();m.preventDefault()})),mxEvent.addListener(D,"drop",mxUtils.bind(this,function(m){D.style.cursor=-"";D.style.backgroundColor="";0<m.dataTransfer.files.length&&this.importFiles(m.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(y,F,N,O,P,T,Q,R,W){if(null!=y&&"image/"==F.substring(0,6))y="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(y),y=[new mxCell("",new mxGeometry(0,0,P,T),y)],y[0].vertex=!0,K(y,new mxRectangle(0,0,P,T),m,mxEvent.isAltDown(m)?null:Q.substring(0,Q.lastIndexOf(".")).replace(/_/g," ")),null!=-C&&null!=C.parentNode&&0<g.length&&(C.parentNode.removeChild(C),C=null);else{var X=!1,Y=mxUtils.bind(this,function(Z,ba){null!=Z&&"application/pdf"==ba&&(ba=Editor.extractGraphModelFromPdf(Z),null!=ba&&0<ba.length&&(Z=ba));if(null!=Z)if(Z=mxUtils.parseXml(Z),"mxlibrary"==Z.documentElement.nodeName)try{var ea=JSON.parse(mxUtils.getTextContent(Z.documentElement));H(ea,D);g=g.concat(ea);L(m);this.spinner.stop();X=!0}catch(oa){}else if("mxfile"==Z.documentElement.nodeName)try{var ha=Z.documentElement.getElementsByTagName("diagram");-for(ea=0;ea<ha.length;ea++){var fa=this.stringToCells(Editor.getDiagramNodeXml(ha[ea])),la=this.editor.graph.getBoundingBoxFromGeometry(fa);null!=la&&K(fa,new mxRectangle(0,0,la.width,la.height),m)}X=!0}catch(oa){null!=window.console&&console.log("error in drop handler:",oa)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=C&&null!=C.parentNode&&0<g.length&&(C.parentNode.removeChild(C),C=null)});null!=W&&null!=Q&&EditorUi.isVisioFilename(Q)?this.importVisio(W,-function(Z){Y(Z,"text/xml")},null,Q):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(y,Q)&&null!=W?this.isExternalDataComms()?this.parseFile(W,mxUtils.bind(this,function(Z){4==Z.readyState&&(this.spinner.stop(),200<=Z.status&&299>=Z.status?Y(Z.responseText,"text/xml"):this.handleError({message:mxResources.get(413==Z.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):-Y(y,F)}}));m.stopPropagation();m.preventDefault()})),mxEvent.addListener(D,"dragleave",function(m){D.style.cursor="";D.style.backgroundColor="";m.stopPropagation();m.preventDefault()}));S=S.cloneNode(!1);S.setAttribute("src",Editor.editImage);S.setAttribute("title",mxResources.get("edit"));U.insertBefore(S,U.firstChild);mxEvent.addListener(S,"click",l);l=S.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));U.insertBefore(l,U.firstChild);mxEvent.addListener(l,-"click",M);".scratchpad"==c.title&&(this.addSelectionToScratchpad=M);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",U.insertBefore(l,U.firstChild))}n.appendChild(U);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,g){for(var l=0;l<c.length;l++)try{var n=c[l],v=n.data;if(null!=v){v="data:"==v.substring(0,5)?this.convertDataUri(v):-v;var x="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(x+="aspect=fixed;");x=x+"image="+v+";";null!=n.style&&(x+=n.style);g.appendChild(this.sidebar.createVertexTemplate(x,n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var B=this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),C=0==B.length?mxResources.get("drawingEmpty"):null!=n.title?n.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(B,n.w,n.h,C,!0,null,-!0))}}catch(H){C=null!=H.message?mxResources.get("error")+": "+H.message:String(H),x=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,C,!0,null,!0),g.appendChild(x)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=-".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,g,l,n,v,x,B){c=new ImageDialog(this,c,g,l,n,v,x,B);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,g,l,n,v,x){var B=localStorage.getItem(g);c=new TextareaDialog(this,c,null!=B?JSON.stringify(JSON.parse(B),null,2):"",mxUtils.bind(this,function(C){if(null!=C)try{if(null!=x&&x(C),C==B)this.hideDialog();else{if(0<C.length){var H=-JSON.parse(C);localStorage.setItem(g,JSON.stringify(H))}else localStorage.removeItem(g);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(D){this.handleError(D)}}),null,mxResources.get("close"),null,null,null,!0,null,null,v,l,n);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,g,l,n){c=null!=c?c:mxUtils.bind(this,function(v,x,B,C){x||(v=new ChangePageSetup(this,-n?B:null,v),v.ignoreColor=!n,null!=C&&n&&(v.shadowVisible=C),this.editor.graph.model.execute(v))});c=new BackgroundImageDialog(this,c,g,l,n);this.showDialog(c.container,400,n?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,g,l,n,v){c=new LibraryDialog(this,c,g,l,n,v);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(x){x&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var k=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=-function(c){var g=k.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&g.refresh()}));return g};EditorUi.prototype.handleError=function(c,g,l,n,v,x,B){var C=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},H=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{B||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,-c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!B||null==window.console||console.error("EditorUi.handleError:",c)}catch(V){}if(null!=H||null!=g){B=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var D=mxResources.get("ok"),U=null;g=null!=g?g:mxResources.get("error");if(null!=H){null!=H.retry&&(D=mxResources.get("cancel"),U=function(){C();H.retry()});if(404==H.code||404==H.status||403==H.code){B=403==H.code?null!=H.message?mxUtils.htmlEntities(H.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 S=null!=v?null:null!=x?x:window.location.hash;if(null!=S&&("#G"==S.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==S.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==H.code||404==H.status)){S="#U"==S.substring(0,2)?S.substring(45,S.lastIndexOf("%26ex")):S.substring(2);this.showError(g,B,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+S);null!=n&&n()}),U,mxResources.get("changeUser"),mxUtils.bind(this,function(){function V(){K.innerText="";for(var M=0;M<t.length;M++){var m=document.createElement("option");mxUtils.write(m,t[M].displayName);m.value=M;K.appendChild(m);m=document.createElement("option");-m.innerHTML=" ";mxUtils.write(m,"<"+t[M].email+">");m.setAttribute("disabled","disabled");K.appendChild(m)}m=document.createElement("option");mxUtils.write(m,mxResources.get("addAccount"));m.value=t.length;K.appendChild(m)}var t=this.drive.getUsersList(),z=document.createElement("div"),L=document.createElement("div");L.style.marginBottom="6px";mxUtils.write(L,mxResources.get("changeUser")+": ");z.appendChild(L);var K=document.createElement("select");K.style.width="100%";V();mxEvent.addListener(K,-"change",mxUtils.bind(this,function(){var M=K.value,m=t.length!=M;m&&this.drive.setUser(t[M]);this.drive.authorize(m,mxUtils.bind(this,function(){m||(t=this.drive.getUsersList(),V())}),mxUtils.bind(this,function(y){this.handleError(y)}),!0)}));z.appendChild(K);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!=l&&l()}),-520,150);return}}null!=H.message?B=""==H.message&&null!=H.name?mxUtils.htmlEntities(H.name,!1):mxUtils.htmlEntities(H.message,!1):null!=H.response&&null!=H.response.error?B=mxUtils.htmlEntities(H.response.error,!1):"undefined"!==typeof window.App&&(H.code==App.ERROR_TIMEOUT?B=mxUtils.htmlEntities(mxResources.get("timeout"),!1):H.code==App.ERROR_BUSY?B=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof H&&0<H.length&&(B=mxUtils.htmlEntities(H,!1)))}v=c=null;null!=H&&null!=H.helpLink?-(c=mxResources.get("help"),v=mxUtils.bind(this,function(){return this.editor.graph.openLink(H.helpLink)})):null!=H&&null!=H.ownerEmail?(c=mxResources.get("contactOwner"),B+=mxUtils.htmlEntities(" ("+c+": "+H.ownerEmail+")",!1),v=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(H.ownerEmail))})):null!=H&&null!=H.alternateAction&&(c=H.alternateAction.label,v=H.alternateAction.funct);this.showError(g,B,D,l,U,null,null,c,v,null,null,null,n?l:null)}else null!=l&&l()};EditorUi.prototype.alert=-function(c,g,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),g);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,g,l,n,v,x){c=null!=c?c:"";var B=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},C=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){B();null!=g&&g()},function(){B();null!=l&&l()},n,v,null,null,null,null,C);this.showDialog(c.container,340,46+C,!0,x);c.init()};EditorUi.prototype.showBanner=-function(c,g,l,n,v,x,B,C,H){x=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){B=null!=B?B:"translate(-50%,120%)";C=null!=C?C:"translate(-50%,0%)";var D=document.createElement("div");D.className="geBtn gePrimaryBtn geBanner"+(v?" geSmallBanner":"");D.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(D.style,"transform",B);mxUtils.setPrefixedStyle(D.style,"transition","all 1000ms ease");null!=H&&mxUtils.setPrefixedStyle(D.style,-"transform-origin",H);H=H=document.createElement("img");H.setAttribute("src",Editor.crossImage);H.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));H.setAttribute("border","0");v||(x=document.createElement("img"),x.setAttribute("src",IMAGE_PATH+"/logo.png"),x.setAttribute("border","0"),x.setAttribute("align","absmiddle"),x.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",D.appendChild(x),H.style.cssText=(v?"right:6px;top:9px;":"right:10px;top:12px;")+-"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",D.appendChild(H));mxUtils.write(D,g);document.body.appendChild(D);this.bannerShowing=!0;v&&(H.className="geLibraryButton",D.appendChild(H));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 U=document.createElement("input");U.setAttribute("type","checkbox");U.setAttribute("id","geDoNotShowAgainCheckbox");-U.style.marginRight="6px";if(!n){g.appendChild(U);var S=document.createElement("label");S.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(S,mxResources.get("doNotShowAgain"));g.appendChild(S);D.style.paddingBottom=v?"16px":"30px";D.appendChild(g)}var V=mxUtils.bind(this,function(){null!=D.parentNode&&(D.parentNode.removeChild(D),this.bannerShowing=!1,U.checked||n)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});-null!=H&&mxEvent.addListener(H,"click",mxUtils.bind(this,function(z){mxEvent.consume(z);V()}));var t=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(D.style,"transform",B);window.setTimeout(mxUtils.bind(this,function(){V()}),1E3)});mxEvent.addListener(D,"click",mxUtils.bind(this,function(z){var L=mxEvent.getSource(z);L!=U&&L!=S?(null!=l&&l(),V(),mxEvent.consume(z)):t()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(D.style,"transform",C)}),500);window.setTimeout(t,-v?5E3:3E4);x=!0}return x};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,g,l,n){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<n&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=-function(c,g,l,n,v){var x="jpeg"==l?"jpg":l;n=this.getBaseFilename(n)+(null!=g?".drawio":"")+"."+x;c=this.createImageDataUri(c,g,l,v);this.saveData(n,x,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("formatAnimatedGif",null,"Animated GIF"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";-c.appendChild(g);mxUtils.write(c,mxResources.get("speed",null,"Speed")+":");var l=document.createElement("select");l.style.marginLeft="4px";l.style.width="80px";var n=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(g=0;g<n.length;g++){var v=document.createElement("option");mxUtils.write(v,n[g].label);v.setAttribute("value",n[g].value);15==n[g].value&&v.setAttribute("selected","selected");-l.appendChild(v)}c.appendChild(l);mxUtils.br(c);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("zoom")+":");var x=document.createElement("input");x.setAttribute("type","text");x.style.width="60px";x.style.marginLeft="4px";x.value="100%";g.appendChild(x);c.appendChild(g);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("borderWidth",null,"Border Width")+":");var B=document.createElement("input");B.setAttribute("type",-"text");B.style.width="60px";B.style.marginLeft="4px";B.value="0";g.appendChild(B);c.appendChild(g);n=document.createElement("div");n.style.marginTop="10px";mxUtils.write(n,mxResources.get("loops",null,"Loops")+":");var C=document.createElement("select");C.style.marginLeft="4px";C.style.width="80px";var H=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(g=0;g<H.length;g++)v=document.createElement("option"),mxUtils.write(v,-H[g].label),v.setAttribute("value",H[g].value),0==H[g].value&&v.setAttribute("selected","selected"),C.appendChild(v);n.appendChild(C);c.appendChild(n);var D=this.addCheckbox(c,mxResources.get("transparentBackground",null,"Transparent Background"),!1);c=new CustomDialog(this,c,mxUtils.bind(this,function(){var U=parseInt(x.value);if(isNaN(U)||0>=U)U=100;this.exportAnimatedGif({fps:parseInt(l.value),scale:U/100,border:parseInt(B.value)||0,repeat:parseInt(C.value),transparent:D.checked,background:D.checked?-null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"#ffffff"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,300,260,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(g){this.spinner.stop();if(null!=g){var l=-this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(g,l);else{var n=document.createElement("a");n.href=URL.createObjectURL(g);n.download=l;document.body.appendChild(n);n.click();setTimeout(function(){document.body.removeChild(n);URL.revokeObjectURL(n.href)},0)}}}),mxUtils.bind(this,function(g){this.spinner.stop();this.handleError(g)}))}catch(g){this.spinner.stop(),this.handleError(g)}};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,g){c=new TextareaDialog(this,c,g,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,g,l,n,v,x){"text/xml"!=-l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=x?x:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=n?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=-l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,l,n);else{var B=document.createElement("a");x=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof B.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var C=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);x=65==(C?parseInt(C[2],10):!1)?!1:x}if(x||this.isOffline()){B.href=URL.createObjectURL(n?this.base64ToBlob(c,l):new Blob([c],{type:l}));x?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(H){}}else this.createEchoRequest(c,g,l,n,v).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,l,n,v,x){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=v?"&format="+v:"")+(null!=x?"&base64="+x:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=-function(c,g,l,n,v,x,B,C,H){x=null!=x?x:!1;B=null!=B?B:"vsdx"!=v&&(!mxClient.IS_IOS||!navigator.standalone);var D=mxUtils.bind(this,function(S,V,t,z){try{if("_blank"==V)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,n);else if(null!=l&&"text/html"==l.substring(0,9)){var L=new EmbedDialog(this,c);this.showDialog(L.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));L.init()}else{var K=window.open("about:blank");null==K?mxUtils.popup(c,!0):(K.document.write("<pre>"+mxUtils.htmlEntities(c,-!1)+"</pre>"),K.document.close())}else if(V==App.MODE_DEVICE||"download"==V)this.doSaveLocalFile(c,S,l,n,null,C);else if(null!=S&&0<S.length){var M=mxUtils.bind(this,function(m){try{this.exportFile(c,S,l,n,V,m)}catch(y){this.handleError(y)}});null!=z?M(z):this.pickFolder(V,M)}}catch(m){this.handleError(m)}});v=[];x||v.push(App.MODE_BROWSER);B||v.push("_blank");var U=new SaveDialog(this,g,mxUtils.bind(this,function(S,V,t){D(S.value,V,S,t);this.hideDialog(null,null,U.container)}),v,c,l,n,H);this.showDialog(U.container,-420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));U.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var v="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var x=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=x&&(v="background: "+x+";")}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||l?(x=l?c:btoa(unescape(encodeURIComponent(c))),n.document.write(v+'<img style="max-width:100%;" src="data:'+g+";base64,"+x+'"/></body></html>')):n.document.write(v+c+"</body></html>"):n.document.write(v+"<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 g=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.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=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),-this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var v=g.getBoundingClientRect();this.tagsDialog.style.left=v.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";v=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=-v.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();g.style.display=0<n.length?"":"none"}))}d.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),-this.layersDialog=null)}));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.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()&&"1"!=urlParams.noExport){this.exportDialog=null;var l=c(mxUtils.bind(this,function(n){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 x=l.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=x.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=x.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(C){B.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var H=this.createImageDataUri(C,null,"png");C=document.createElement("img");-C.style.maxWidth="140px";C.style.maxHeight="140px";C.style.cursor="pointer";C.style.backgroundColor="white";C.setAttribute("title",mxResources.get("openInNewWindow"));C.setAttribute("border","0");C.setAttribute("src",H);this.exportDialog.appendChild(C);mxEvent.addListener(C,"click",mxUtils.bind(this,function(){this.openInNewWindow(H.substring(H.indexOf(",")+1),"image/png",!0);v.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(C){B.stop();null!=this.exportDialog&&-null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(C)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,n,v,x){this.isLocalFileSave()?this.saveLocalFile(l,c,n,v,g,x):this.saveRequest(c,g,mxUtils.bind(this,function(B,C){return this.createEchoRequest(l,B,n,v,g,C)}),l,v,n)};EditorUi.prototype.saveRequest=-function(c,g,l,n,v,x,B){B=null!=B?B:!mxClient.IS_IOS||!navigator.standalone;var C=mxUtils.bind(this,function(D,U,S,V){if("_blank"==U||null!=D&&0<D.length){var t=l("_blank"==U?null:D,U==App.MODE_DEVICE||"download"==U||null==U||"_blank"==U?"0":"1");null!=t&&(U==App.MODE_DEVICE||"download"==U||"_blank"==U?t.simulate(document,"_blank"):(S=mxUtils.bind(this,function(z){x=null!=x?x:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,D,x,!0,U,z)}catch(L){this.handleError(L)}else this.spinner.spin(document.body,-mxResources.get("saving"))&&t.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=t.getStatus()&&299>=t.getStatus())try{this.exportFile(t.getText(),D,x,!0,U,z)}catch(L){this.handleError(L)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(L){this.spinner.stop();this.handleError(L)}))}),null!=V?S(V):this.pickFolder(U,S)))}});v=[App.MODE_BROWSER];B||v.push("_blank");var H=new SaveDialog(this,c,mxUtils.bind(this,function(D,U,S){C(D.value,U,D,S);-this.hideDialog(null,null,H.container)}),v,null,"application/pdf");this.showDialog(H.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));H.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,g,l,n,v,x){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=-function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,n,v,x,B,C,H,D,U,S,V,t){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(Y){Editor.addRetryToError(Y,mxUtils.bind(this,function(){this.exportSvg(c,g,l,n,v,x,B,C,H,D,U,S,V,t)}));this.handleError(Y)})))try{var z=this.editor.graph.isSelectionEmpty();l=null!=l?l:z;var L=g?null:this.editor.graph.background;L==mxConstants.NONE&&(L=null);null==L&&0==g&&(L=this.editor.graph.shapeBackgroundColor);-var K=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var M=mxUtils.lightDarkColorSupported,m=mxUtils.preferDarkColor;if("light"==U||"dark"==U)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==U;var y=Graph.addFont,F={};Graph.addFont=function(Y,Z,ba,ea){y.call(this,Y,Z,ba,F)};var N=this.editor.graph.createSvgImageExport(v),O=N.drawCellState;N.drawCellState=function(Y,Z){null!=Y&&Graph.processFontStyle(Y.style);-O.apply(this,arguments)};var P=this.editor.graph.getSvg(L,c,B,C,null,l,null,N,"blank"==D?"_blank":"self"==D?"_top":null,null,!V,U,S);mxUtils.lightDarkColorSupported=M;mxUtils.preferDarkColor=m;this.editor.graph.addForeignObjectWarning=K;n&&this.editor.graph.addSvgShadow(P);var T=this.getBaseFilename()+(v?".drawio":"")+".svg";t=null!=t?t:mxUtils.bind(this,function(Y){this.isLocalFileSave()||Y.length<=MAX_REQUEST_SIZE?this.saveData(T,"svg",Y,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Y)}))});var Q=mxUtils.bind(this,function(Y){this.spinner.stop();v&&Y.setAttribute("content",this.getFileData(!0,null,null,null,l,H,null,null,null,null,null,c,B));t(Graph.xmlDeclaration+"\n"+(v?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(Y))});this.editor.graph.mathEnabled&&this.editor.addMathCss(P);var R=mxUtils.bind(this,function(Y){Editor.replaceSvgDataUris&&x&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&-V?this.replaceAlternateContent(Y,U,Q):Q(Y)}),W=Graph.customFontElements;Graph.customFontElements=F;var X=mxUtils.bind(this,function(Y){Graph.customFontElements=W;Graph.addFont=y;x&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(Y,R,this.thumbImageCache)):R(Y)});V?this.embedFonts(P,X):(this.editor.addFontCss(P),X(P))}catch(Y){this.handleError(Y)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function n(S,V,t,-z,L){var K=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");K.setAttribute("x",V);K.setAttribute("y",t+.5);K.setAttribute("width",z.width);K.setAttribute("height",z.height);null==K.setAttributeNS?K.setAttribute("xlink:href",L):K.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",L);S.replaceChild(K,S.lastChild);C()}function v(){if(B<U.length)U[B++](v)}var x="";g=c.getElementsByTagName("style");for(var B=0;B<g.length;B++)x+=g[B].innerHTML;g=c.getElementsByTagName("switch");counter=-g.length;var C=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),H={},D={},U=[];for(B=0;B<g.length;B++)mxUtils.bind(this,function(S){var V=S.getElementsByTagName("div");if(0<V.length)try{var t=V[0].cloneNode(!0),z=parseInt(t.style.marginLeft),L=parseInt(t.style.paddingTop),K=t.getElementsByTagName("div")[1],M=V=!1,m=t.style.alignItems,y=t.style.justifyContent;if(null!=t.style.writingMode){var F=t.style.writingMode;M="vertical-"==F.substring(0,9);V="-rl"==F.substring(F.length-3)}var N=!M&&-"1px"==t.style.width||M&&"1px"==t.style.height;if(!M&&"1px"==t.style.height||M&&"1px"==t.style.width)t.style.alignItems=M&&V?"unsafe flex-end":"unsafe flex-start";N&&(t.style.justifyContent="unsafe flex-start");t.style.paddingTop="";t.style.marginLeft="";var O=t.outerHTML,P=H[O];null==P&&(t.style.position="absolute",t.style.visibility="hidden",document.body.appendChild(t),F=1,F="1px"==t.style.width?K.offsetWidth:parseInt(t.style.width),N=1,N="1px"==t.style.height?K.offsetHeight:parseInt(t.style.height),-document.body.removeChild(t),P=new mxRectangle(z,L,F,N),H[O]=P);"1px"==t.style.height&&("unsafe center"==m?L-=P.height/2:"unsafe flex-end"==m&&(L-=P.height));if("1px"==t.style.width)if(!M&&"unsafe center"==y||M&&"unsafe center"==m)z-=P.width/2;else if(!M&&"unsafe flex-end"==y||M&&(!V&&"unsafe flex-end"==m||V&&"unsafe flex-start"==m))z-=P.width;P=new mxRectangle(z,L,P.width,P.height+parseInt(K.style.fontSize)/4);U.push(mxUtils.bind(this,function(T){var Q=D[O];null==Q?Graph.htmlToPng(O,P.width,P.height,-mxUtils.bind(this,function(R){n(S,z,L,P,R);D[O]=R;T()}),x):(n(S,z,L,P,Q),T())}))}catch(T){C()}else C()})(g[B]);0==counter&&l(c);B=0;v()};EditorUi.prototype.addRadiobox=function(c,g,l,n,v,x,B){return this.addCheckbox(c,l,n,v,x,B,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,n,v,x,B,C){x=null!=x?x:!0;var H=document.createElement("input");H.style.marginRight="8px";H.style.marginTop="16px";H.setAttribute("type",B?"radio":"checkbox");B="geCheckbox-"+Editor.guid();H.id=B;null!=C&&H.setAttribute("name",-C);l&&(H.setAttribute("checked","checked"),H.defaultChecked=!0);n&&H.setAttribute("disabled","disabled");x&&(c.appendChild(H),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",B),c.appendChild(l),v||mxUtils.br(c));return H};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var n=this.getCurrentFile(),v="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(v=window.location.href);-var x=document.createElement("select");x.style.maxWidth="200px";x.style.width="auto";x.style.marginLeft="8px";x.style.marginRight="10px";x.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));x.appendChild(n);var B=document.createElement("option");B.setAttribute("value","custom");mxUtils.write(B,mxResources.get("custom")+"...");x.appendChild(B);c.appendChild(x);mxEvent.addListener(x,"change",mxUtils.bind(this,function(){if("custom"==-x.value){var C=new FilenameDialog(this,v,mxResources.get("ok"),function(H){null!=H?(v=H,B.setAttribute("title",H)):(x.value="blank",B.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){x.value="blank"});this.showDialog(C.container,300,80,!0,!1);C.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?-"blank"===x.value?"_blank":v:null},getEditInput:function(){return l},getEditSelect:function(){return x}}};EditorUi.prototype.addLinkSection=function(c,g){function l(){var C=document.createElement("div");C.style.width="100%";C.style.height="100%";C.style.boxSizing="border-box";null!=x&&x!=mxConstants.NONE?(C.style.border="1px solid black",C.style.backgroundColor=x):(C.style.backgroundPosition="center center",C.style.backgroundRepeat="no-repeat",C.style.backgroundImage="url('"+Dialog.prototype.closeImage+-"')");B.innerText="";B.appendChild(C)}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 v=document.createElement("option");v.setAttribute("value","auto");mxUtils.write(v,mxResources.get("automatic"));n.appendChild(v);v=document.createElement("option");v.setAttribute("value","blank");mxUtils.write(v,mxResources.get("openInNewWindow"));n.appendChild(v);-v=document.createElement("option");v.setAttribute("value","self");mxUtils.write(v,mxResources.get("openInThisWindow"));n.appendChild(v);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var x="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(C){this.pickColor(x||"none",function(H){x=H;l()});-mxEvent.consume(C)}));l();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";c.appendChild(B);mxUtils.br(c);return{getColor:function(){return x},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,n,v,x){x=null!=x?x:[];l&&(x.push("lightbox=1"),-"auto"!=c&&x.push("target="+c),null!=g&&g!=mxConstants.NONE&&x.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=n&&0<n.length&&x.push("edit="+encodeURIComponent(n)),v&&x.push("layers=1"),this.editor.graph.foldingEnabled&&x.push("nav=1"));return x};EditorUi.prototype.createLink=function(c,g,l,n,v,x,B,C,H,D,U,S,V){var t=this.getCurrentFile();H=this.createUrlParameters(c,g,n,v,x,H);c=!0;null!=B?l="#U"+encodeURIComponent(B):C||null==t||""==t.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,-null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+t.getHash(),c=!1);c&&null!=t&&null!=t.getTitle()&&t.getTitle()!=this.defaultFilename&&H.push("title="+encodeURIComponent(t.getTitle()));D&&1<l.length&&(H.push("open="+l.substring(1)),l="");U&&null!=this.currentPage&&H.push("page-id="+this.currentPage.getId());S&&H.push("transparent=1");null!=V&&H.push("dark="+V);return(n&&(null!=B||null!=t&&t.getMode()!=App.MODE_GITHUB&&t.getMode()!=App.MODE_GITLAB)?-EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<H.length?"?"+H.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,n,v,x,B,C,H,D,U,S,V){this.getBasenames();var t={};""!=v&&v!=mxConstants.NONE&&(t.highlight=v);"auto"!==n&&(t.target=n);D||(t.lightbox=!1);t.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(t.zoom=l/100);l=[];B&&(l.push("pages"),-t.resize=!0,null!=this.pages&&null!=this.currentPage&&(t.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),t.resize=!0);C&&l.push("layers");H&&l.push("tags");null!=V&&(t["dark-mode"]=V);0<l.length&&(D&&l.push("lightbox"),t.toolbar=l.join(" "));null!=U&&0<U.length&&(t.edit=U);null!=c?t.url=c:t.xml=this.getFileData(!0,null,null,null,null,!B);g='<div class="mxgraph" style="'+(x?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(t))+-'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";S(g,'<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,g,l,n){var v=document.createElement("div");v.style.whiteSpace=-"nowrap";var x=document.createElement("h3");mxUtils.write(x,mxResources.get("html"));x.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";v.appendChild(x);var B=document.createElement("div");B.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var C=document.createElement("input");C.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";C.setAttribute("value","url");C.setAttribute("type","radio");C.setAttribute("name","type-embedhtmldialog");-x=C.cloneNode(!0);x.setAttribute("value","copy");B.appendChild(x);var H=document.createElement("span");mxUtils.write(H,mxResources.get("includeCopyOfMyDiagram"));B.appendChild(H);mxUtils.br(B);B.appendChild(C);H=document.createElement("span");mxUtils.write(H,mxResources.get("publicDiagramUrl"));B.appendChild(H);var D=this.getCurrentFile();null==l&&null!=D&&D.constructor==window.DriveFile&&(H=document.createElement("a"),H.style.paddingLeft="12px",H.style.color="gray",H.style.cursor="pointer",mxUtils.write(H,-mxResources.get("share")),B.appendChild(H),mxEvent.addListener(H,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(D.getId(),D)})));x.setAttribute("checked","checked");null==l&&C.setAttribute("disabled","disabled");v.appendChild(B);B=380;var U=this.addLinkSection(v),S=document.createElement("select");S.style.maxWidth="260px";S.style.marginLeft="8px";S.style.marginTop="16px";H=document.createElement("option");H.setAttribute("value","light");mxUtils.write(H,mxResources.get("light"));-S.appendChild(H);H=document.createElement("option");H.setAttribute("value","dark");mxUtils.write(H,mxResources.get("dark"));S.appendChild(H);H=document.createElement("option");H.setAttribute("value","auto");mxUtils.write(H,mxResources.get("automatic"));H.setAttribute("selected","selected");S.appendChild(H);H.setAttribute("selected","selected");mxUtils.write(v,mxResources.get("appearance")+":");v.appendChild(S);mxUtils.br(v);B+=26;var V=this.addCheckbox(v,mxResources.get("zoom"),!0,null,!0);mxUtils.write(v,-":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value="100%";v.appendChild(t);var z=this.addCheckbox(v,mxResources.get("fit"),!0);H=null!=this.pages&&1<this.pages.length;var L=L=this.addCheckbox(v,mxResources.get("allPages"),H,!H),K=this.addCheckbox(v,mxResources.get("layers"),!0),M=this.addCheckbox(v,mxResources.get("tags"),!0),m=this.addCheckbox(v,mxResources.get("lightbox"),-!0),y=null;if(EditorUi.enableHtmlEditOption){y=this.addEditButton(v,m);var F=y.getEditInput();F.style.marginBottom="16px";B+=50;mxEvent.addListener(m,"change",function(){m.checked?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled");F.checked&&m.checked?y.getEditSelect().removeAttribute("disabled"):y.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,v,mxUtils.bind(this,function(){n(C.checked?l:null,V.checked,t.value,U.getTarget(),U.getColor(),z.checked,L.checked,-K.checked,M.checked,m.checked,null!=y?y.getLink():null,null!=S?S.value:null)}),null,c,g);this.showDialog(c.container,340,B,!0,!0);x.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,n,v,x,B,C,H,D,U,S){var V=document.createElement("div");V.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,c||mxResources.get("publish"));t.style.width="100%";t.style.textAlign="center";t.style.marginTop="2px";t.style.marginBottom="20px";V.appendChild(t);var z=document.createElement("select");-c=30;z.className="geBtn";z.style.marginBottom="8px";z.style.marginLeft="0px";z.style.width="100%";z.style.boxSizing="border-box";if(null==C||""==C.getHash())v=null!=v?v:"https://www.drawio.com/doc/faq/publish-diagram-as-link",t=document.createElement("option"),mxUtils.write(t,mxResources.get("makeCopy")),t.setAttribute("value","copy"),z.appendChild(t);t=document.createElement("option");mxUtils.write(t,mxResources.get("authorizationRequired"));t.setAttribute("value","auth");z.appendChild(t);null!=-C&&""!=C.getHash()||t.setAttribute("disabled","disabled");C=document.createElement("option");C.setAttribute("value","public");z.appendChild(C);null!=B?(mxUtils.write(C,mxResources.get("publicDiagramUrl")),C.setAttribute("title",B),z.value="public"):(mxUtils.write(C,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),C.setAttribute("disabled","disabled"));V.appendChild(z);mxUtils.br(V);z.focus();var L=null,K=null;if(null!=g||null!=l)c+=30,mxUtils.write(V,mxResources.get("width")+-":"),L=document.createElement("input"),L.setAttribute("type","text"),L.style.marginRight="16px",L.style.width="50px",L.style.marginLeft="6px",L.style.marginRight="16px",L.style.marginBottom="10px",L.value="100%",V.appendChild(L),mxUtils.write(V,mxResources.get("height")+":"),K=document.createElement("input"),K.setAttribute("type","text"),K.style.width="50px",K.style.marginLeft="6px",K.style.marginBottom="10px",K.value=l+"px",V.appendChild(K),mxUtils.br(V);var M=this.addLinkSection(V,n),m=D?this.addCheckbox(V,-mxResources.get("transparentBackground"),!1):null;null!=m&&(c+=20);var y=document.createElement("select");y.className="geBtn";y.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");y.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");y.appendChild(g);var F=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&-(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),S&&(mxUtils.write(V,mxResources.get("pages")+":"),V.appendChild(y),mxUtils.br(V),c+=30),F=this.addCheckbox(V,mxResources.get("selectedPage")+": "+g));var N=document.createElement("select");N.style.maxWidth="260px";N.style.marginLeft="8px";N.style.marginTop="16px";S=document.createElement("option");S.setAttribute("value","0");mxUtils.write(S,mxResources.get("light"));N.appendChild(S);S=document.createElement("option");-S.setAttribute("value","1");mxUtils.write(S,mxResources.get("dark"));N.appendChild(S);S=document.createElement("option");S.setAttribute("value","auto");mxUtils.write(S,mxResources.get("automatic"));S.setAttribute("selected","selected");N.appendChild(S);U&&(mxUtils.write(V,mxResources.get("appearance")+":"),V.appendChild(N),mxUtils.br(V),c+=30);var O=this.addCheckbox(V,mxResources.get("lightbox"),!0,null,null,!n),P=this.addEditButton(V,O),T=P.getEditInput();n&&(T.style.marginLeft=O.style.marginLeft,-O.style.display="none",c-=20);var Q=this.addCheckbox(V,mxResources.get("layers"),!0);Q.style.marginLeft=T.style.marginLeft;Q.style.marginTop="8px";var R=this.addCheckbox(V,mxResources.get("tags"),!0);R.style.marginLeft=T.style.marginLeft;R.style.marginBottom="16px";R.style.marginTop="16px";mxEvent.addListener(O,"change",function(){O.checked?(Q.removeAttribute("disabled"),T.removeAttribute("disabled"),R.removeAttribute("disabled")):(Q.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"),-R.setAttribute("disabled","disabled"));T.checked&&O.checked?P.getEditSelect().removeAttribute("disabled"):P.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,V,mxUtils.bind(this,function(){H(M.getTarget(),M.getColor(),null==F?!1:F.checked,O.checked,P.getLink(),Q.checked,null!=L?L.value:null,null!=K?K.value:null,R.checked,z.value,null!=m?m.checked:!1,N.value,"allPages"==y.value)}),null,mxResources.get("create"),v,x);this.showDialog(n.container,340,296+c,!0,!0);null!=L?(L.focus(),-mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null)):null==z.parentNode;M.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,g,l,n,v){var x=document.createElement("div");x.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";x.appendChild(B);if(v){mxUtils.write(x,mxResources.get("zoom")+-":");var C=document.createElement("input");C.setAttribute("type","text");C.style.marginRight="16px";C.style.width="60px";C.style.marginLeft="4px";C.style.marginRight="12px";C.value=this.lastExportZoom||"100%";x.appendChild(C);mxUtils.write(x,mxResources.get("borderWidth")+":");var H=document.createElement("input");H.setAttribute("type","text");H.style.marginRight="16px";H.style.width="60px";H.style.marginLeft="4px";H.value=this.lastExportBorder||"0";x.appendChild(H);mxUtils.br(x)}var D=this.addCheckbox(x,-mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),U=n?null:this.addCheckbox(x,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);B=this.editor.graph;var S=n?null:this.addCheckbox(x,mxResources.get("transparentBackground"),B.background==mxConstants.NONE||null==B.background);null!=S&&(S.style.marginBottom="16px");c=new CustomDialog(this,x,mxUtils.bind(this,function(){var V=parseInt(C.value)/100||1,t=parseInt(H.value)||0;l(!D.checked,null!=U?U.checked:!1,-null!=S?S.checked:!1,V,t)}),null,c,g);this.showDialog(c.container,300,(v?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,n,v,x,B,C,H){B=null!=B?B:Editor.defaultIncludeDiagram;var D=document.createElement("div");D.style.whiteSpace="nowrap";var U=this.editor.graph,S="jpeg"==C||"webp"==C?220:320,V=document.createElement("h3");mxUtils.write(V,c);V.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";D.appendChild(V);mxUtils.write(D,mxResources.get("zoom")+-":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";D.appendChild(t);mxUtils.write(D,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";D.appendChild(z);mxUtils.br(D);var L=this.addCheckbox(D,-mxResources.get("selectionOnly"),!1,U.isSelectionEmpty()),K=document.createElement("input");K.style.marginTop="16px";K.style.marginRight="8px";K.style.marginLeft="24px";K.setAttribute("disabled","disabled");K.setAttribute("type","checkbox");var M=document.createElement("select");M.style.marginTop="16px";M.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(V=0;V<c.length;V++)if(!U.isSelectionEmpty()||"selectionOnly"!=c[V]){var m=document.createElement("option");mxUtils.write(m,mxResources.get(c[V]));-m.setAttribute("value",c[V]);M.appendChild(m)}H?(mxUtils.write(D,mxResources.get("size")+":"),D.appendChild(M),mxUtils.br(D),S+=26,mxEvent.addListener(M,"change",function(){"selectionOnly"==M.value&&(L.checked=!0)})):x&&(D.appendChild(K),mxUtils.write(D,mxResources.get("crop")),mxUtils.br(D),S+=30,mxEvent.addListener(L,"change",function(){L.checked?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")}));U.isSelectionEmpty()?H&&(L.style.display="none",L.nextSibling.style.display="none",-L.nextSibling.nextSibling.style.display="none",S-=30):(M.value="diagram",K.setAttribute("checked","checked"),K.defaultChecked=!0,mxEvent.addListener(L,"change",function(){M.value=L.checked?"selectionOnly":"diagram"}));var y=this.addCheckbox(D,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=C&&"webp"!=C),F=document.createElement("select");F.style.maxWidth="260px";F.style.marginLeft="8px";F.style.marginTop="16px";x=document.createElement("option");x.setAttribute("value","light");mxUtils.write(x,-mxResources.get("light"));F.appendChild(x);H=document.createElement("option");H.setAttribute("value","dark");mxUtils.write(H,mxResources.get("dark"));F.appendChild(H);"svg"==C&&mxUtils.lightDarkColorSupported?(x=document.createElement("option"),x.setAttribute("value","auto"),mxUtils.write(x,mxResources.get("automatic")),x.setAttribute("selected","selected"),F.appendChild(x)):Editor.isDarkMode()?H.setAttribute("selected","selected"):x.setAttribute("selected","selected");mxUtils.write(D,mxResources.get("appearance")+-":");D.appendChild(F);mxUtils.br(D);S+=26;var N=this.addCheckbox(D,mxResources.get("shadow"),U.shadowVisible),O=null;if("png"==C||"jpeg"==C||"webp"==C)O=this.addCheckbox(D,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),S+=30;U=null!=this.pages?this.pages.length:1;var P=this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram")+(1<U?":":""),B,null,null,"jpeg"!=C&&"webp"!=C),T=document.createElement("select");T.style.maxWidth="260px";T.style.marginLeft="28px";"png"==C||-"svg"==C?(B=function(){P.checked?T.removeAttribute("disabled"):T.setAttribute("disabled","disabled")},x=document.createElement("option"),x.setAttribute("value","allPages"),mxUtils.write(x,mxResources.get("allPages")),T.appendChild(x),x=document.createElement("option"),x.setAttribute("value","currentPage"),mxUtils.write(x,mxResources.get("currentPage")),T.appendChild(x),1<U?(P.style.marginBottom="12px",T.style.marginBottom="16px",D.appendChild(T),mxUtils.br(D),S+=20):P.style.marginBottom="16px",null!=-this.lastEmbedInclude&&(T.value=this.lastEmbedInclude),mxEvent.addListener(P,"change",B),B()):P.style.marginBottom="16px";var Q=document.createElement("input");Q.style.marginBottom="16px";Q.style.marginRight="8px";Q.setAttribute("type","checkbox");Q.id="geCheckbox-"+Editor.guid();var R=document.createElement("input");R.style.marginBottom="16px";R.style.marginRight="8px";R.setAttribute("type","checkbox");R.id="geCheckbox-"+Editor.guid();g&&(Q.checked=null!=this.lastEmbedImages?this.lastEmbedImages:-!0,D.appendChild(Q),B=document.createElement("label"),mxUtils.write(B,mxResources.get("embedImages")),B.setAttribute("for",Q.id),D.appendChild(B),mxUtils.br(D),R.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,D.appendChild(R),B=document.createElement("label"),mxUtils.write(B,mxResources.get("embedFonts")),B.setAttribute("for",R.id),D.appendChild(B),mxUtils.br(D),S+=50);var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";x=document.createElement("option");-x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));W.appendChild(x);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"==C&&(mxUtils.write(D,-mxResources.get("links")+":"),D.appendChild(W),D.appendChild(B),mxUtils.br(D),mxUtils.br(D),S+=50);l=new CustomDialog(this,D,mxUtils.bind(this,function(){this.lastExportBorder=z.value;this.lastExportZoom=t.value;this.lastEmbedImages=Q.checked;this.lastEmbedFonts=R.checked;this.lastEmbedInclude=T.value;v(t.value,y.checked,!L.checked,N.checked,P.checked,Q.checked&&g,z.value,K.checked,("png"==C||"svg"==C)&&"currentPage"==T.value,W.value,null!=O?O.checked:null,null!=F?F.value:null,M.value,R.checked)}),-null,l,n);this.showDialog(l.container,340,S,!0,!0,null,null,null,null,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,l,n,v){var x=document.createElement("div");x.style.whiteSpace="nowrap";var B=this.editor.graph;if(null!=g){var C=document.createElement("h3");mxUtils.write(C,g);C.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";x.appendChild(C)}var H=-this.addCheckbox(x,mxResources.get("fit"),!0),D=this.addCheckbox(x,mxResources.get("shadow"),B.shadowVisible&&n,!n),U=this.addCheckbox(x,l),S=this.addCheckbox(x,mxResources.get("lightbox"),!0),V=this.addEditButton(x,S),t=V.getEditInput(),z=1<B.model.getChildCount(B.model.getRoot()),L=this.addCheckbox(x,mxResources.get("layers"),z,!z);L.style.marginLeft=t.style.marginLeft;L.style.marginBottom="12px";L.style.marginTop="8px";mxEvent.addListener(S,"change",function(){S.checked?(z&&L.removeAttribute("disabled"),-t.removeAttribute("disabled")):(L.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&S.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,x,mxUtils.bind(this,function(){c(H.checked,D.checked,U.checked,S.checked,V.getLink(),L.checked)}),null,mxResources.get("embed"),v);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,n,v,x,B,C){function H(t){var z=-" ",L="";n&&(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!=U?"&page="+U:"")+(v?"&edit=_blank":"")+(x?"&layers=1":"")+"');}})(this);\"",L+="cursor:pointer;");c&&(L+="max-width:100%;");var K=-"";l&&(K=' width="'+Math.round(D.width)+'" height="'+Math.round(D.height)+'"');B('<img src="'+t+'"'+K+(""!=L?' style="'+L+'"':"")+z+"/>")}var D=this.editor.graph.getGraphBounds(),U=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(t){var z=n?this.getFileData(!0):null;t=this.createImageDataUri(t,z,"png");H(t)}),null,null,null,mxUtils.bind(this,function(t){C({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,-Editor.defaultBorder);else if(g=this.getFileData(!0),D.width*D.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var S="";l&&(S="&w="+Math.round(2*D.width)+"&h="+Math.round(2*D.height));var V=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+S+"&xml="+encodeURIComponent(g));V.send(mxUtils.bind(this,function(){200<=V.getStatus()&&299>=V.getStatus()?H("data:image/png;base64,"+V.getText()):C({message:mxResources.get("unknownError")})}))}else C({message:mxResources.get("drawingTooLarge")})};-EditorUi.prototype.createEmbedSvg=function(c,g,l,n,v,x,B){var C=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),H=C.getElementsByTagName("a");if(null!=H)for(var D=0;D<H.length;D++){var U=H[D].getAttribute("href");null!=U&&"#"==U.charAt(0)&&"_blank"==H[D].getAttribute("target")&&H[D].removeAttribute("target")}n&&C.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(C);if(l){var S=" ",V="";n&&(S="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":"")+(x?"&layers=1":"")+"');}})(this);\"",V+="cursor:pointer;");c&&(V+="max-width:100%;");this.editor.convertImages(C,mxUtils.bind(this,function(t){B('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(t))+'"'+(""!=V?' style="'+V+'"':"")+S+"/>")}))}else V="",n&&(g=this.getSelectedPageIndex(),C.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var B=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(x=0;x<B.length;x++)g[B[x]]=!0;var C=this.editor.graph.getModel(),G=C.getChildren(C.root);for(x=0;x<G.length;x++){var N=G[x];C.setVisible(N,g[N.id]||!1)}}catch(J){}};EditorUi.prototype.fileStats=function(c,g){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=g.getElementsByTagName("diagram");g=+{};g.modified=c.getLastModifiedDate();g.fileMode=c.getMode();g.fileSize=c.getSize();g.fileHash=c.getHash();g.pages=l.length;g.redundantStencils=0;g.redundantImages=0;g.redundantSize=0;g.stencils=0;g.images=0;for(var n=g.cells=0;n<l.length;n++){var v=l[n].getElementsByTagName("mxCell");g.cells+=v.length;for(var x={},B=0;B<v.length;B++){var C=v[B].getAttribute("style");if(null!=C)for(var G=C.split(";"),N=0;N<G.length;N++){var J=G[N];if(J.startsWith("image=data:")||J.startsWith("shape=stencil("))null==+x[J]?x[J]=1:x[J]++}}for(var T in x){var V=x[T];T.startsWith("shape=stencil(")?g.stencils+=V:g.images+=V;1<V&&(g.redundantSize+=T.length*(V-1),T.startsWith("shape=stencil(")?g.redundantStencils+=V-1:g.redundantImages+=V-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(g)})}}catch(t){}};EditorUi.prototype.getBaseFilename=function(c){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(".")));!c&&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(c,g,l,n,v,x,B,C,G,N,J,T,V,t,z,L,K){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();+var M=this.getBaseFilename(!v),m=M+("xml"==c||"pdf"==c&&J?".drawio":"")+"."+c;if("xml"==c){var y=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,v,null,null,null,g);this.saveData(m,c,y,"text/xml")}else if("html"==c)y=this.getHtml2(this.getFileData(!0),this.editor.graph,M),this.saveData(m,c,y,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?m=M+".png":"jpeg"==c&&(m=M+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&+this.embedExportProtocol){var E=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(m,c,n,"1",B,v,C,G,N,J,T,void 0,void 0,!x,V,t,z,L,K).send(mxUtils.bind(this,function(R){this.spinner.stop();if(200<=R.getStatus()&&299>=R.getStatus()){var S=this.createLoadMessage("export");S.format=c;S.filename=m;S.data="data:application/pdf;base64,"+R.getText();S.xml=this.getFileData(!0);E.postMessage(JSON.stringify(S),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),+mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(m,c,mxUtils.bind(this,function(R,S){try{return this.createDownloadRequest(R,c,n,S,B,v,C,G,N,J,T,void 0,void 0,!x,V,t,z,L,K)}catch(W){this.handleError(W)}}));else{var P=null,O=mxUtils.bind(this,function(R){R.length<=MAX_REQUEST_SIZE?this.saveData(m,"svg",R,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,+function(){mxUtils.popup(P)}))});if("svg"==c){var Q=this.editor.graph.background;if(B||Q==mxConstants.NONE)Q=null;var U=this.editor.graph.getSvg(Q,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(U);this.editor.convertImages(U,mxUtils.bind(this,mxUtils.bind(this,function(R){this.spinner.stop();O(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(R))})))}else m=M+".svg",P=this.getFileData(!1,!0,null,mxUtils.bind(this,function(R){this.spinner.stop();O(R)}),n)}}catch(R){this.handleError(R)}};+EditorUi.prototype.createDownloadRequest=function(c,g,l,n,v,x,B,C,G,N,J,T,V,t,z,L,K,M,m){c=this.downloadRequestBuilder(c,g,l,n,v,x,B,C,G,N,J,T,V,t,z,L,K,M,m);g="";for(var y in c)l=c[y],null!=l&&(g+=y+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,l,n,v,x,B,C,G,N,J,T,V,t,z,L,K,M,m){var y=this.editor.graph,E=y.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==x?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,+"pdf"==g);var P=null,O=null,Q=null;if(!EditorUi.isElectronApp&&(E.width*E.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};N=N?"1":"0";"pdf"==g&&(null!=J?(P=J.from,O=J.to):0==x&&(Q="1"));"xmlpng"==g&&(N="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(x=0;x<this.pages.length;x++)if(this.pages[x]==this.currentPage){P=x;break}x=y.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!v?v||null!=x&&x!=mxConstants.NONE||(x="#ffffff"):+x=mxConstants.NONE;v={globalVars:y.getExportVariables()};null!=J&&null!=J.from&&(v.globalVars.pagenumber=J.from+1);G&&(v.grid={size:y.gridSize,steps:y.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:y.view.gridColor});Graph.translateDiagram&&(v.diagramLanguage=Graph.diagramLanguage);return{format:g,from:P,to:O,allPages:Q,bg:null!=x?x:mxConstants.NONE,base64:n,embedXml:N,xml:l,filename:null!=c?c:"",extras:JSON.stringify(v),scale:B,border:C,pageMargin:z,w:T&&+isFinite(T)?T:null,h:V&&isFinite(V)?V:null,crop:null!=t&&t?"1":"0",fit:null!=L&&L?"1":"0",shadows:null!=m&&m?"1":"0",sheetsAcross:K,sheetsDown:M}};EditorUi.prototype.setMode=function(c,g){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 g=c.indexOf("#");0<=g&&(c=c.substring(0,g))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,g={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");+if(0<l){c=decodeURIComponent(c.substring(l+1));try{g=JSON.parse(c)}catch(n){}}}return g};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 g=window.location.hash;if(null==g||""==g)g="#";var l=g.lastIndexOf("#");0<l&&(g=g.substring(0,+l));try{null==c||mxUtils.isEmptyObject(c)||(g=g+"#"+encodeURIComponent(JSON.stringify(c)))}catch(n){}0<l&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=function(c,g,l){var n=window.location.hash,v=mxUtils.bind(this,function(B){var C=null!=c.data?c.data:"";null!=B&&0<B.length&&(0<C.length&&(C+="\n"),C+=B);B=new LocalFile(this,"csv"!=c.format&&0<C.length?C:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,+!0);B.getHash=function(){return n};this.fileLoaded(B);"csv"==c.format&&this.importCsv(C,mxUtils.bind(this,function(V){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var G=null!=c.interval?parseInt(c.interval):6E4,N=null,J=mxUtils.bind(this,function(){var V=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(t){V===this.currentPage&&(200<=t.getStatus()&&300>=t.getStatus()?+(this.updateDiagram(t.getText()),T()):this.handleError({message:mxResources.get("error")+" "+t.getStatus()}))}),mxUtils.bind(this,function(t){this.handleError(t)}))}),T=mxUtils.bind(this,function(){window.clearTimeout(N);N=window.setTimeout(J,G)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){T();J()}));T();J()}null!=g&&g()});if(null!=c.url&&0<c.url.length){var x=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(x,mxUtils.bind(this,function(B){v(B)}),mxUtils.bind(this,function(B){null!=+l&&l(B)}))}else v("")};EditorUi.prototype.updateDiagram=function(c){function g(y){var E=new mxCellOverlay(y.image||v.warningImage,y.tooltip,y.align,y.valign,y.offset);E.addListener(mxEvent.CLICK,function(P,O){n.alert(y.tooltip)});return E}var l=null,n=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var v=this.editor.graph,x=v.getModel();x.beginUpdate();var B=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var C=x.getCell(c.getAttribute("id"));+if(null!=C){try{var G=c.getAttribute("value");if(null!=G){var N=mxUtils.parseXml(G).documentElement;if(null!=N)if("1"==N.getAttribute("replace-value"))x.setValue(C,N);else for(var J=N.attributes,T=0;T<J.length;T++)v.setAttributeForCell(C,J[T].nodeName,0<J[T].nodeValue.length?J[T].nodeValue:null)}}catch(y){null!=window.console&&console.log("Error in value for "+C.id+": "+y)}try{var V=c.getAttribute("style");null!=V&&v.model.setStyle(C,V)}catch(y){null!=window.console&&console.log("Error in style for "++C.id+": "+y)}try{var t=c.getAttribute("icon");if(null!=t){var z=0<t.length?JSON.parse(t):null;null!=z&&z.append||v.removeCellOverlays(C);null!=z&&v.addCellOverlay(C,g(z))}}catch(y){null!=window.console&&console.log("Error in icon for "+C.id+": "+y)}try{var L=c.getAttribute("geometry");if(null!=L){L=JSON.parse(L);var K=v.getCellGeometry(C);if(null!=K){K=K.clone();for(key in L){var M=parseFloat(L[key]);"dx"==key?K.x+=M:"dy"==key?K.y+=M:"dw"==key?K.width+=M:"dh"==key?K.height+=M:K[key]=parseFloat(L[key])}v.model.setGeometry(C,+K)}}}catch(y){null!=window.console&&console.log("Error in icon for "+C.id+": "+y)}}}else if("model"==c.nodeName){for(var m=c.firstChild;null!=m&&m.nodeType!=mxConstants.NODETYPE_ELEMENT;)m=m.nextSibling;null!=m&&(new mxCodec(c.firstChild)).decode(m,x)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(v.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))v.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==+c.nodeName&&(B=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{x.endUpdate()}null!=B&&this.chromelessResize&&this.chromelessResize(!0,B)}return l};EditorUi.prototype.getCopyFilename=function(c,g){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var n=l.lastIndexOf(".");0<=n&&(c=l.substring(n),l=l.substring(0,n));if(g){g=l;var v=new Date;l=v.getFullYear();n=v.getMonth()+1;var x=v.getDate(),B=v.getHours(),C=v.getMinutes();v=v.getSeconds();+l=g+(" "+(l+"-"+n+"-"+x+"-"+B+"-"+C+"-"+v))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=function(c,g){try{null!=c&&g&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,g,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[g]);var n=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var v=!1;this.hideDialog();null!=n&&(n.removeListener(this.descriptorChangedListener),this.logIfModified(n,+!0),n.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var x=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=n&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!g&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();g||("0"!=urlParams.splash?this.showSplash():+this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=c)try{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.clearStatus():this.updateStatus(mxUtils.bind(this,function(){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||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&+this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));v=!0;if(!this.isOffline()&&null!=c.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.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+B})}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(C){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(C){}}catch(C){this.fileLoadedError=C;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)||x():x()});g?c():(null!=C.fallbackFileData&&(C.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var G=new LocalFile(this,C.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(G)})}),this.handleError(C,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else x();return v};EditorUi.prototype.getHashValueForPages=function(c,g){var l=+0,n=new mxGraphModel,v=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var x=0;x<c.length;x++){this.updatePageRoot(c[x]);var B=c[x].node.cloneNode(!1);B.removeAttribute("name");n.root=c[x].root;var C=v.encode(n);this.editor.graph.saveViewState(c[x].viewState,C,!0);C.removeAttribute("pageWidth");C.removeAttribute("pageHeight");B.appendChild(C);null!=g&&(g.eltCount+=B.getElementsByTagName("*").length,g.nodeCount+=B.getElementsByTagName("mxCell").length);l=(l<<5)-l++this.hashValue(B,function(G,N,J,T){return!T||"mxGeometry"!=G.nodeName&&"mxPoint"!=G.nodeName||"x"!=N&&"y"!=N&&"width"!=N&&"height"!=N?T&&"mxCell"==G.nodeName&&"previous"==N?null:J:Math.round(J)},g)<<0}return l};EditorUi.prototype.hashValue=function(c,g,l){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,g,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);+for(var v=0;v<c.attributes.length;v++){var x=c.attributes[v].name,B=null!=g?g(c,x,c.attributes[v].value,!0):c.attributes[v].value;null!=B&&(n^=this.hashValue(x,g,l)+this.hashValue(B,g,l))}}if(null!=c.childNodes)for(v=0;v<c.childNodes.length;v++)n=(n<<5)-n+this.hashValue(c.childNodes[v],g,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);g=0;null!=l&&(l.byteCount+=c.length);for(v=0;v<c.length;v++)g=(g<<5)-g+c.charCodeAt(v)<<0;n^=g}return n};EditorUi.prototype.descriptorChanged=function(){};+EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,g,l,n,v,x,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(c){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):+this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var g=0;g<c.length;g++)null!=c[g].xml&&"<"!=c[g].xml.charAt(0)&&(c[g].xml=mxUtils.trim(Graph.decompress(c[g].xml)));g=mxUtils.createXmlDocument();var l=g.createElement("mxlibrary");mxUtils.setTextContent(l,JSON.stringify(c,null,2));g.appendChild(l);return mxUtils.getXml(g,"\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 g=this.sidebar.palettes[c];if(null!=g){for(var l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,g){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!g){null==c&&(g=this.sidebar.palettes["L.scratchpad"],+null==g&&(g=this.sidebar.palettes.search),null!=g&&(c=g[g.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;g=l.lastChild;var n=g.previousSibling;l.insertBefore(g,c);l.insertBefore(n,g)}};EditorUi.prototype.loadLibrary=function(c,g){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var n=JSON.parse(mxUtils.getTextContent(l.documentElement));this.libraryLoaded(c,n,l.documentElement.getAttribute("title"),g,l.documentElement.getAttribute("tags"))}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.showSearchWindow=function(c,g){var l=c?"findReplace":"find",n=l+"Window";if(null==this[n]){var v="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=c?v?330:300:240;this[n]=new FindWindow(this,document.body.offsetWidth-(x+20),100,x,c?v?304:288:+180,c);this[n].window.addListener("show",function(){this.fireEvent(new mxEventObject(l))});this[n].window.addListener("hide",function(){this.fireEvent(new mxEventObject(l))});this[n].window.setVisible(!0)}else null==g&&this[n].window.setVisible(!this[n].window.isVisible());null!=g&&(this[n].doSearch(g),this[n].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,g,l,n,v){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var x=null;if(c.constructor!=+StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var B=0;B<this.openLibraries.length;B++)if(this.openLibraries[B].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[B],this.openLibraries);break}x={file:c,images:g,title:l,expand:n};this.openLibraries.push(x)}else this.scratchpad=c;B=this.sidebar.palettes[c.getHash()];B=null!=B?B[B.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var C=null,G=mxUtils.bind(this,function(m,y){0==+m.length&&c.isEditable()?(null==C&&(C=document.createElement("div"),C.className="geDropTarget",mxUtils.write(C,mxResources.get("dragElementsHere"))),y.appendChild(C)):this.addLibraryEntries(m,y)});null!=this.sidebar&&null!=g&&this.sidebar.addEntries(g,v);null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var N=this.sidebar.addPalette(c.getHash(),l,null!=n?n:!0,mxUtils.bind(this,function(m){G(g,m)}));null!=x&&(x.div=N);this.repositionLibrary(B,"L.scratchpad"!=+c.getHash());n=N.parentNode.previousSibling;l=n.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var J=document.createElement("div");J.style.backgroundColor="inherit";n.style.position="relative";var T=document.createElement("img");T.className="geLibraryButton";T.setAttribute("src",Editor.crossImage);T.setAttribute("title",mxResources.get("close"));var V=null;if(".scratchpad"!=c.title||this.closableScratchpad)J.appendChild(T),+mxEvent.addListener(T,"click",mxUtils.bind(this,function(m){if(!mxEvent.isConsumed(m)){var y=mxUtils.bind(this,function(){null!=x&&mxUtils.remove(x,this.openLibraries);this.closeLibrary(c)});null!=V?this.confirm(mxResources.get("allChangesLost"),null,y,mxResources.get("cancel"),mxResources.get("discardChanges")):y();mxEvent.consume(m)}}));if(c.isEditable()){var t=this.editor.graph,z=null;l=mxUtils.bind(this,function(m){this.showLibraryDialog(c.getTitle(),N,g,c,c.getMode());mxEvent.consume(m)});var L=+mxUtils.bind(this,function(m){c.setModified(!0);c.isAutosave()?(null!=z&&null!=z.parentNode&&z.parentNode.removeChild(z),z=T.cloneNode(!1),z.setAttribute("src",Editor.spinImage),z.setAttribute("title",mxResources.get("saving")),z.style.cursor="default",z.style.marginRight="2px",z.style.marginTop="-2px",J.insertBefore(z,J.firstChild),this.saveLibrary(c.getTitle(),g,c,c.getMode(),!0,!0,function(){null!=z&&null!=z.parentNode&&z.parentNode.removeChild(z)})):null==V&&(V=T.cloneNode(!1),V.setAttribute("src",+Editor.saveImage),V.setAttribute("title",mxResources.get("save")),J.insertBefore(V,J.firstChild),mxEvent.addListener(V,"click",mxUtils.bind(this,function(y){this.saveLibrary(c.getTitle(),g,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==V||c.isModified()||(V.parentNode.removeChild(V),V=null)});mxEvent.consume(y)})))}),K=mxUtils.bind(this,function(m,y,E,P){m=t.cloneCells(mxUtils.sortCells(t.model.getTopmostCells(m)));for(var O=0;O<m.length;O++){var Q=t.getCellGeometry(m[O]);null!=Q&&+Q.translate(-y.x,-y.y)}N.appendChild(this.sidebar.createVertexTemplateFromCells(m,y.width,y.height,P||"",!0,null,!1));m=mxUtils.getXml(this.editor.graph.encodeCells(m));Editor.defaultCompressed&&(m=Graph.compress(m));y={xml:m,w:y.width,h:y.height};null!=P&&(y.title=P);g.push(y);L(E);null!=C&&null!=C.parentNode&&0<g.length&&(C.parentNode.removeChild(C),C=null)}),M=mxUtils.bind(this,function(m){if(t.isSelectionEmpty())t.getRubberband().isActive()?(t.getRubberband().execute(m),t.getRubberband().reset()):+null!=m&&mxEvent.getSource(m).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var y=t.getSelectionCells(),E=t.view.getBounds(y);if(null!=E&&0<E.width&&0<E.height){var P=t.view.scale;E.x/=P;E.y/=P;E.width/=P;E.height/=P;E.x-=t.view.translate.x;E.y-=t.view.translate.y;K(y,E)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(m)});mxEvent.addGestureListeners(N,+function(){},mxUtils.bind(this,function(m){t.isMouseDown&&null!=t.panningManager&&null!=t.graphHandler.first&&(t.graphHandler.suspend(),null!=t.graphHandler.hint&&(t.graphHandler.hint.style.visibility="hidden"),N.style.backgroundColor="light-dark(#fefefe, #000000)",N.style.cursor="copy",t.panningManager.stop(),t.autoScroll=!1,mxEvent.consume(m))}),mxUtils.bind(this,function(m){t.isMouseDown&&null!=t.panningManager&&null!=t.graphHandler&&(N.style.backgroundColor="",N.style.cursor="default",this.sidebar.showTooltips=+!0,t.panningManager.stop(),t.graphHandler.reset(),t.isMouseDown=!1,t.autoScroll=!0,M(m),mxEvent.consume(m))}));mxEvent.addListener(N,"mouseleave",mxUtils.bind(this,function(m){t.isMouseDown&&null!=t.graphHandler.first&&(t.graphHandler.resume(),null!=t.graphHandler.hint&&(t.graphHandler.hint.style.visibility="visible"),N.style.backgroundColor="",N.style.cursor="",t.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(N,"dragover",mxUtils.bind(this,function(m){N.style.backgroundColor="light-dark(#fefefe, #000000)";+m.dataTransfer.dropEffect="copy";N.style.cursor="copy";this.sidebar.hideTooltip();m.stopPropagation();m.preventDefault()})),mxEvent.addListener(N,"drop",mxUtils.bind(this,function(m){N.style.cursor="";N.style.backgroundColor="";0<m.dataTransfer.files.length&&this.importFiles(m.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(y,E,P,O,Q,U,R,S,W){if(null!=y&&"image/"==E.substring(0,6))y="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="++this.convertDataUri(y),y=[new mxCell("",new mxGeometry(0,0,Q,U),y)],y[0].vertex=!0,K(y,new mxRectangle(0,0,Q,U),m,mxEvent.isAltDown(m)?null:R.substring(0,R.lastIndexOf(".")).replace(/_/g," ")),null!=C&&null!=C.parentNode&&0<g.length&&(C.parentNode.removeChild(C),C=null);else{var X=!1,Y=mxUtils.bind(this,function(Z,aa){null!=Z&&"application/pdf"==aa&&(aa=Editor.extractGraphModelFromPdf(Z),null!=aa&&0<aa.length&&(Z=aa));if(null!=Z)if(Z=mxUtils.parseXml(Z),"mxlibrary"==Z.documentElement.nodeName)try{var fa=+JSON.parse(mxUtils.getTextContent(Z.documentElement));G(fa,N);g=g.concat(fa);L(m);this.spinner.stop();X=!0}catch(na){}else if("mxfile"==Z.documentElement.nodeName)try{var ia=Z.documentElement.getElementsByTagName("diagram");for(fa=0;fa<ia.length;fa++){var ea=this.stringToCells(Editor.getDiagramNodeXml(ia[fa])),ma=this.editor.graph.getBoundingBoxFromGeometry(ea);null!=ma&&K(ea,new mxRectangle(0,0,ma.width,ma.height),m)}X=!0}catch(na){null!=window.console&&console.log("error in drop handler:",na)}X||+(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=C&&null!=C.parentNode&&0<g.length&&(C.parentNode.removeChild(C),C=null)});null!=W&&null!=R&&EditorUi.isVisioFilename(R)?this.importVisio(W,function(Z){Y(Z,"text/xml")},null,R):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(y,R)&&null!=W?this.isExternalDataComms()?this.parseFile(W,mxUtils.bind(this,function(Z){4==Z.readyState&&(this.spinner.stop(),200<=Z.status&&299>=Z.status?Y(Z.responseText,"text/xml"):+this.handleError({message:mxResources.get(413==Z.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):Y(y,E)}}));m.stopPropagation();m.preventDefault()})),mxEvent.addListener(N,"dragleave",function(m){N.style.cursor="";N.style.backgroundColor="";m.stopPropagation();m.preventDefault()}));T=T.cloneNode(!1);T.setAttribute("src",Editor.editImage);T.setAttribute("title",+mxResources.get("edit"));J.insertBefore(T,J.firstChild);mxEvent.addListener(T,"click",l);l=T.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));J.insertBefore(l,J.firstChild);mxEvent.addListener(l,"click",M);".scratchpad"==c.title&&(this.addSelectionToScratchpad=M);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",J.insertBefore(l,J.firstChild))}n.appendChild(J);+this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,g){for(var l=0;l<c.length;l++)try{var n=c[l],v=n.data;if(null!=v){v="data:"==v.substring(0,5)?this.convertDataUri(v):v;var x="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(x+="aspect=fixed;");x=x+"image="+v+";";null!=n.style&&(x+=n.style);g.appendChild(this.sidebar.createVertexTemplate(x,n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var B=+this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),C=0==B.length?mxResources.get("drawingEmpty"):null!=n.title?n.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(B,n.w,n.h,C,!0,null,!0))}}catch(G){C=null!=G.message?mxResources.get("error")+": "+G.message:String(G),x=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,C,!0,null,!0),g.appendChild(x)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&+(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,g,l,n,v,x,B){c=new ImageDialog(this,c,g,l,n,v,x,B);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,+g,l,n,v,x){var B=localStorage.getItem(g);c=new TextareaDialog(this,c,null!=B?JSON.stringify(JSON.parse(B),null,2):"",mxUtils.bind(this,function(C){if(null!=C)try{if(null!=x&&x(C),C==B)this.hideDialog();else{if(0<C.length){var G=JSON.parse(C);localStorage.setItem(g,JSON.stringify(G))}else localStorage.removeItem(g);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(N){this.handleError(N)}}),null,mxResources.get("close"),null,null,null,!0,null,null,v,l,n);this.showDialog(c.container,+660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,g,l,n){c=null!=c?c:mxUtils.bind(this,function(v,x,B,C){x||(v=new ChangePageSetup(this,n?B:null,v),v.ignoreColor=!n,null!=C&&n&&(v.shadowVisible=C),this.editor.graph.model.execute(v))});c=new BackgroundImageDialog(this,c,g,l,n);this.showDialog(c.container,400,n?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,g,l,n,v){c=new LibraryDialog(this,+c,g,l,n,v);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(x){x&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var k=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var g=k.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&g.refresh()}));return g};EditorUi.prototype.handleError=function(c,g,l,n,v,x,B){var C=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{B||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!B||null==window.console||console.error("EditorUi.handleError:",c)}catch(V){}if(null!=G||null!=g){B=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var N=mxResources.get("ok"),J=null;+g=null!=g?g:mxResources.get("error");if(null!=G){null!=G.retry&&(N=mxResources.get("cancel"),J=function(){C();G.retry()});if(404==G.code||404==G.status||403==G.code){B=403==G.code?null!=G.message?mxUtils.htmlEntities(G.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 T=null!=v?null:null!=x?x:window.location.hash;if(null!=T&&+("#G"==T.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==T.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)){T="#U"==T.substring(0,2)?T.substring(45,T.lastIndexOf("%26ex")):T.substring(2);this.showError(g,B,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="++T);null!=n&&n()}),J,mxResources.get("changeUser"),mxUtils.bind(this,function(){function V(){K.innerText="";for(var M=0;M<t.length;M++){var m=document.createElement("option");mxUtils.write(m,t[M].displayName);m.value=M;K.appendChild(m);m=document.createElement("option");m.innerHTML=" ";mxUtils.write(m,"<"+t[M].email+">");m.setAttribute("disabled","disabled");K.appendChild(m)}m=document.createElement("option");mxUtils.write(m,mxResources.get("addAccount"));m.value=t.length;K.appendChild(m)}+var t=this.drive.getUsersList(),z=document.createElement("div"),L=document.createElement("div");L.style.marginBottom="6px";mxUtils.write(L,mxResources.get("changeUser")+": ");z.appendChild(L);var K=document.createElement("select");K.style.width="100%";V();mxEvent.addListener(K,"change",mxUtils.bind(this,function(){var M=K.value,m=t.length!=M;m&&this.drive.setUser(t[M]);this.drive.authorize(m,mxUtils.bind(this,function(){m||(t=this.drive.getUsersList(),V())}),mxUtils.bind(this,function(y){this.handleError(y)}),+!0)}));z.appendChild(K);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!=l&&l()}),520,150);return}}null!=G.message?B=""==G.message&&null!=G.name?mxUtils.htmlEntities(G.name,!1):mxUtils.htmlEntities(G.message,!1):null!=G.response&&null!=G.response.error?B=mxUtils.htmlEntities(G.response.error,!1):"undefined"!==typeof window.App&&+(G.code==App.ERROR_TIMEOUT?B=mxUtils.htmlEntities(mxResources.get("timeout"),!1):G.code==App.ERROR_BUSY?B=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof G&&0<G.length&&(B=mxUtils.htmlEntities(G,!1)))}v=c=null;null!=G&&null!=G.helpLink?(c=mxResources.get("help"),v=mxUtils.bind(this,function(){return this.editor.graph.openLink(G.helpLink)})):null!=G&&null!=G.ownerEmail?(c=mxResources.get("contactOwner"),B+=mxUtils.htmlEntities(" ("+c+": "+G.ownerEmail+")",!1),v=mxUtils.bind(this,+function(){return this.openLink("mailto:"+mxUtils.htmlEntities(G.ownerEmail))})):null!=G&&null!=G.alternateAction&&(c=G.alternateAction.label,v=G.alternateAction.funct);this.showError(g,B,N,l,J,null,null,c,v,null,null,null,n?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,g,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),g);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,g,l,n,v,x){c=null!=c?c:"";var B=null!=this.spinner&&null!=this.spinner.pause?+this.spinner.pause():function(){},C=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){B();null!=g&&g()},function(){B();null!=l&&l()},n,v,null,null,null,null,C);this.showDialog(c.container,340,46+C,!0,x);c.init()};EditorUi.prototype.showBanner=function(c,g,l,n,v,x,B,C,G){x=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){B=null!=B?B:"translate(-50%,120%)";C=null!=C?C:"translate(-50%,0%)";+var N=document.createElement("div");N.className="geBtn gePrimaryBtn geBanner"+(v?" geSmallBanner":"");N.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(N.style,"transform",B);mxUtils.setPrefixedStyle(N.style,"transition","all 1000ms ease");null!=G&&mxUtils.setPrefixedStyle(N.style,"transform-origin",G);G=G=document.createElement("img");G.setAttribute("src",Editor.crossImage);G.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));G.setAttribute("border","0");v||(x=document.createElement("img"),+x.setAttribute("src",IMAGE_PATH+"/logo.png"),x.setAttribute("border","0"),x.setAttribute("align","absmiddle"),x.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",N.appendChild(x),G.style.cssText=(v?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",N.appendChild(G));mxUtils.write(N,g);document.body.appendChild(N);this.bannerShowing=!0;v&&(G.className="geLibraryButton",N.appendChild(G));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 J=document.createElement("input");J.setAttribute("type","checkbox");J.setAttribute("id","geDoNotShowAgainCheckbox");J.style.marginRight="6px";if(!n){g.appendChild(J);var T=document.createElement("label");T.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(T,mxResources.get("doNotShowAgain"));g.appendChild(T);N.style.paddingBottom=+v?"16px":"30px";N.appendChild(g)}var V=mxUtils.bind(this,function(){null!=N.parentNode&&(N.parentNode.removeChild(N),this.bannerShowing=!1,J.checked||n)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=G&&mxEvent.addListener(G,"click",mxUtils.bind(this,function(z){mxEvent.consume(z);V()}));var t=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(N.style,"transform",B);window.setTimeout(mxUtils.bind(this,+function(){V()}),1E3)});mxEvent.addListener(N,"click",mxUtils.bind(this,function(z){var L=mxEvent.getSource(z);L!=J&&L!=T?(null!=l&&l(),V(),mxEvent.consume(z)):t()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(N.style,"transform",C)}),500);window.setTimeout(t,v?5E3:3E4);x=!0}return x};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=+function(c,g,l,n){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<n&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,g,l,n,v){var x="jpeg"==l?"jpg":l;n=this.getBaseFilename(n)+(null!=g?".drawio":"")+"."+x;c=this.createImageDataUri(c,g,l,v);this.saveData(n,x,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=+function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("formatAnimatedGif",null,"Animated GIF"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(g);mxUtils.write(c,mxResources.get("speed",null,"Speed")+":");var l=document.createElement("select");l.style.marginLeft="4px";l.style.width="80px";var n=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",+null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(g=0;g<n.length;g++){var v=document.createElement("option");mxUtils.write(v,n[g].label);v.setAttribute("value",n[g].value);15==n[g].value&&v.setAttribute("selected","selected");l.appendChild(v)}c.appendChild(l);mxUtils.br(c);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("zoom")+":");var x=document.createElement("input");x.setAttribute("type","text");x.style.width="60px";x.style.marginLeft=+"4px";x.value="100%";g.appendChild(x);c.appendChild(g);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("borderWidth",null,"Border Width")+":");var B=document.createElement("input");B.setAttribute("type","text");B.style.width="60px";B.style.marginLeft="4px";B.value="0";g.appendChild(B);c.appendChild(g);n=document.createElement("div");n.style.marginTop="10px";mxUtils.write(n,mxResources.get("loops",null,"Loops")+":");var C=document.createElement("select");C.style.marginLeft=+"4px";C.style.width="80px";var G=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(g=0;g<G.length;g++)v=document.createElement("option"),mxUtils.write(v,G[g].label),v.setAttribute("value",G[g].value),0==G[g].value&&v.setAttribute("selected","selected"),C.appendChild(v);n.appendChild(C);c.appendChild(n);var N=this.addCheckbox(c,mxResources.get("transparentBackground",null,"Transparent Background"),!1);c=new CustomDialog(this,+c,mxUtils.bind(this,function(){var J=parseInt(x.value);if(isNaN(J)||0>=J)J=100;this.exportAnimatedGif({fps:parseInt(l.value),scale:J/100,border:parseInt(B.value)||0,repeat:parseInt(C.value),transparent:N.checked,background:N.checked?null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"#ffffff"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,300,260,!0,!0,null,null,null,+null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(g){this.spinner.stop();if(null!=g){var l=this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(g,l);else{var n=document.createElement("a");n.href=URL.createObjectURL(g);n.download=l;document.body.appendChild(n);n.click();setTimeout(function(){document.body.removeChild(n);+URL.revokeObjectURL(n.href)},0)}}}),mxUtils.bind(this,function(g){this.spinner.stop();this.handleError(g)}))}catch(g){this.spinner.stop(),this.handleError(g)}};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,g){c=new TextareaDialog(this,+c,g,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,g,l,n,v,x){"text/xml"!=l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=x?x:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=n?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)l=window.open("about:blank",+"_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,l,n);else{var B=document.createElement("a");x=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof B.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var C=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);+x=65==(C?parseInt(C[2],10):!1)?!1:x}if(x||this.isOffline()){B.href=URL.createObjectURL(n?this.base64ToBlob(c,l):new Blob([c],{type:l}));x?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(G){}}else this.createEchoRequest(c,g,l,n,v).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,l,n,v,x){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,+c+(null!=l?"&mime="+l:"")+(null!=v?"&format="+v:"")+(null!=x?"&base64="+x:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,g,l,n,v,x,B,C,G){x=null!=x?x:!1;B=null!=B?B:"vsdx"!=v&&(!mxClient.IS_IOS||!navigator.standalone);var N=mxUtils.bind(this,function(T,V,t,z){try{if("_blank"==V)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,n);else if(null!=l&&"text/html"==l.substring(0,9)){var L=new EmbedDialog(this,c);this.showDialog(L.container,+450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));L.init()}else{var K=window.open("about:blank");null==K?mxUtils.popup(c,!0):(K.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),K.document.close())}else if(V==App.MODE_DEVICE||"download"==V)this.doSaveLocalFile(c,T,l,n,null,C);else if(null!=T&&0<T.length){var M=mxUtils.bind(this,function(m){try{this.exportFile(c,T,l,n,V,m)}catch(y){this.handleError(y)}});null!=z?M(z):this.pickFolder(V,M)}}catch(m){this.handleError(m)}});v=[];x||v.push(App.MODE_BROWSER);+B||v.push("_blank");var J=new SaveDialog(this,g,mxUtils.bind(this,function(T,V,t){N(T.value,V,T,t);this.hideDialog(null,null,J.container)}),v,c,l,n,G);this.showDialog(J.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var v="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var x=mxUtils.parseXml(c).documentElement.style.backgroundColor;+""!=x&&(v="background: "+x+";")}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||l?(x=l?c:btoa(unescape(encodeURIComponent(c))),n.document.write(v+'<img style="max-width:100%;" src="data:'+g+";base64,"+x+'"/></body></html>')):n.document.write(v+c+"</body></html>"):n.document.write(v+"<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 g=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.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=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor=+"#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var v=g.getBoundingClientRect();this.tagsDialog.style.left=v.left+"px";+this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";v=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=v.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();+g.style.display=0<n.length?"":"none"}))}d.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));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.editor.isExportToCanvas()&&+this.isChromelessImageExportEnabled()&&"1"!=urlParams.noExport){this.exportDialog=null;var l=c(mxUtils.bind(this,function(n){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 x=l.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=x.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)++this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=x.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(C){B.stop();this.exportDialog.style.width=+"auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var G=this.createImageDataUri(C,null,"png");C=document.createElement("img");C.style.maxWidth="140px";C.style.maxHeight="140px";C.style.cursor="pointer";C.style.backgroundColor="white";C.setAttribute("title",mxResources.get("openInNewWindow"));C.setAttribute("border","0");C.setAttribute("src",G);this.exportDialog.appendChild(C);mxEvent.addListener(C,"click",mxUtils.bind(this,function(){this.openInNewWindow(G.substring(G.indexOf(",")++1),"image/png",!0);v.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(C){B.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(C)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,n,v,x){if("1"==urlParams.embed&&"json"==urlParams.proto&&+this.embedExportProtocol){x=this.embedMessageSource||window.opener||window.parent;var B=this.createLoadMessage("export");B.format=g;B.filename=c;B.data=v?"data:"+n+";base64,"+l:l;B.xml=this.getFileData(!0);x.postMessage(JSON.stringify(B),"*")}else this.isLocalFileSave()?this.saveLocalFile(l,c,n,v,g,x):this.saveRequest(c,g,mxUtils.bind(this,function(C,G){return this.createEchoRequest(l,C,n,v,g,G)}),l,v,n)};EditorUi.prototype.saveRequest=function(c,g,l,n,v,x,B){B=null!=B?B:!mxClient.IS_IOS||!navigator.standalone;+var C=mxUtils.bind(this,function(N,J,T,V){if("_blank"==J||null!=N&&0<N.length){var t=l("_blank"==J?null:N,J==App.MODE_DEVICE||"download"==J||null==J||"_blank"==J?"0":"1");null!=t&&(J==App.MODE_DEVICE||"download"==J||"_blank"==J?t.simulate(document,"_blank"):(T=mxUtils.bind(this,function(z){x=null!=x?x:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,N,x,!0,J,z)}catch(L){this.handleError(L)}else this.spinner.spin(document.body,mxResources.get("saving"))&&t.send(mxUtils.bind(this,+function(){this.spinner.stop();if(200<=t.getStatus()&&299>=t.getStatus())try{this.exportFile(t.getText(),N,x,!0,J,z)}catch(L){this.handleError(L)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(L){this.spinner.stop();this.handleError(L)}))}),null!=V?T(V):this.pickFolder(J,T)))}});v=[App.MODE_BROWSER];B||v.push("_blank");var G=new SaveDialog(this,c,mxUtils.bind(this,function(N,J,T){C(N.value,J,N,T);this.hideDialog(null,null,G.container)}),v,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,g,l,n,v,x){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=+function(c,g,l,n,v,x,B,C,G,N,J,T,V,t){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(Y){Editor.addRetryToError(Y,mxUtils.bind(this,function(){this.exportSvg(c,g,l,n,v,x,B,C,G,N,J,T,V,t)}));this.handleError(Y)})))try{var z=this.editor.graph.isSelectionEmpty();l=null!=l?l:z;var L=g?null:this.editor.graph.background;L==mxConstants.NONE&&(L=null);null==L&&0==g&&(L=this.editor.graph.shapeBackgroundColor);var K=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var M=mxUtils.lightDarkColorSupported,m=mxUtils.preferDarkColor;if("light"==J||"dark"==J)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==J;var y=Graph.addFont,E={};Graph.addFont=function(Y,Z,aa,fa){y.call(this,Y,Z,aa,E)};var P=this.editor.graph.createSvgImageExport(v),O=P.drawCellState;P.drawCellState=function(Y,Z){null!=Y&&Graph.processFontStyle(Y.style);O.apply(this,arguments)};var Q=this.editor.graph.getSvg(L,c,B,C,null,+l,null,P,"blank"==N?"_blank":"self"==N?"_top":null,null,!V,J,T);mxUtils.lightDarkColorSupported=M;mxUtils.preferDarkColor=m;this.editor.graph.addForeignObjectWarning=K;n&&this.editor.graph.addSvgShadow(Q);var U=this.getBaseFilename()+(v?".drawio":"")+".svg";t=null!=t?t:mxUtils.bind(this,function(Y){this.isLocalFileSave()||Y.length<=MAX_REQUEST_SIZE?this.saveData(U,"svg",Y,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Y)}))});+var R=mxUtils.bind(this,function(Y){this.spinner.stop();v&&Y.setAttribute("content",this.getFileData(!0,null,null,null,l,G,null,null,null,null,null,c,B));t(Graph.xmlDeclaration+"\n"+(v?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(Y))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Q);var S=mxUtils.bind(this,function(Y){Editor.replaceSvgDataUris&&x&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&V?this.replaceAlternateContent(Y,J,R):R(Y)}),W=Graph.customFontElements;+Graph.customFontElements=E;var X=mxUtils.bind(this,function(Y){Graph.customFontElements=W;Graph.addFont=y;x&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(Y,S,this.thumbImageCache)):S(Y)});V?this.embedFonts(Q,X):(this.editor.addFontCss(Q),X(Q))}catch(Y){this.handleError(Y)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function n(T,V,t,z,L){var K=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");+K.setAttribute("x",V);K.setAttribute("y",t+.5);K.setAttribute("width",z.width);K.setAttribute("height",z.height);null==K.setAttributeNS?K.setAttribute("xlink:href",L):K.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",L);T.replaceChild(K,T.lastChild);C()}function v(){if(B<J.length)J[B++](v)}var x="";g=c.getElementsByTagName("style");for(var B=0;B<g.length;B++)x+=g[B].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var C=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),G={},+N={},J=[];for(B=0;B<g.length;B++)mxUtils.bind(this,function(T){var V=T.getElementsByTagName("div");if(0<V.length)try{var t=V[0].cloneNode(!0),z=parseInt(t.style.marginLeft),L=parseInt(t.style.paddingTop),K=t.getElementsByTagName("div")[1],M=V=!1,m=t.style.alignItems,y=t.style.justifyContent;if(null!=t.style.writingMode){var E=t.style.writingMode;M="vertical-"==E.substring(0,9);V="-rl"==E.substring(E.length-3)}var P=!M&&"1px"==t.style.width||M&&"1px"==t.style.height;if(!M&&"1px"==t.style.height||M&&+"1px"==t.style.width)t.style.alignItems=M&&V?"unsafe flex-end":"unsafe flex-start";P&&(t.style.justifyContent="unsafe flex-start");t.style.paddingTop="";t.style.marginLeft="";var O=t.outerHTML,Q=G[O];null==Q&&(t.style.position="absolute",t.style.visibility="hidden",document.body.appendChild(t),E=1,E="1px"==t.style.width?K.offsetWidth:parseInt(t.style.width),P=1,P="1px"==t.style.height?K.offsetHeight:parseInt(t.style.height),document.body.removeChild(t),Q=new mxRectangle(z,L,E,P),G[O]=Q);"1px"==t.style.height&&+("unsafe center"==m?L-=Q.height/2:"unsafe flex-end"==m&&(L-=Q.height));if("1px"==t.style.width)if(!M&&"unsafe center"==y||M&&"unsafe center"==m)z-=Q.width/2;else if(!M&&"unsafe flex-end"==y||M&&(!V&&"unsafe flex-end"==m||V&&"unsafe flex-start"==m))z-=Q.width;Q=new mxRectangle(z,L,Q.width,Q.height+parseInt(K.style.fontSize)/4);J.push(mxUtils.bind(this,function(U){var R=N[O];null==R?Graph.htmlToPng(O,Q.width,Q.height,mxUtils.bind(this,function(S){n(T,z,L,Q,S);N[O]=S;U()}),x):(n(T,z,L,Q,R),U())}))}catch(U){C()}else C()})(g[B]);+0==counter&&l(c);B=0;v()};EditorUi.prototype.addRadiobox=function(c,g,l,n,v,x,B){return this.addCheckbox(c,l,n,v,x,B,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,n,v,x,B,C){x=null!=x?x:!0;var G=document.createElement("input");G.style.marginRight="8px";G.style.marginTop="16px";G.setAttribute("type",B?"radio":"checkbox");B="geCheckbox-"+Editor.guid();G.id=B;null!=C&&G.setAttribute("name",C);l&&(G.setAttribute("checked","checked"),G.defaultChecked=!0);n&&G.setAttribute("disabled","disabled");+x&&(c.appendChild(G),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",B),c.appendChild(l),v||mxUtils.br(c));return G};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var n=this.getCurrentFile(),v="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(v=window.location.href);var x=document.createElement("select");x.style.maxWidth="200px";x.style.width="auto";x.style.marginLeft=+"8px";x.style.marginRight="10px";x.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));x.appendChild(n);var B=document.createElement("option");B.setAttribute("value","custom");mxUtils.write(B,mxResources.get("custom")+"...");x.appendChild(B);c.appendChild(x);mxEvent.addListener(x,"change",mxUtils.bind(this,function(){if("custom"==x.value){var C=new FilenameDialog(this,v,mxResources.get("ok"),function(G){null!=G?(v=G,B.setAttribute("title",+G)):(x.value="blank",B.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){x.value="blank"});this.showDialog(C.container,300,80,!0,!1);C.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===x.value?"_blank":v:null},getEditInput:function(){return l},getEditSelect:function(){return x}}};+EditorUi.prototype.addLinkSection=function(c,g){function l(){var C=document.createElement("div");C.style.width="100%";C.style.height="100%";C.style.boxSizing="border-box";null!=x&&x!=mxConstants.NONE?(C.style.border="1px solid black",C.style.backgroundColor=x):(C.style.backgroundPosition="center center",C.style.backgroundRepeat="no-repeat",C.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");B.innerText="";B.appendChild(C)}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 v=document.createElement("option");v.setAttribute("value","auto");mxUtils.write(v,mxResources.get("automatic"));n.appendChild(v);v=document.createElement("option");v.setAttribute("value","blank");mxUtils.write(v,mxResources.get("openInNewWindow"));n.appendChild(v);v=document.createElement("option");v.setAttribute("value","self");mxUtils.write(v,mxResources.get("openInThisWindow"));+n.appendChild(v);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var x="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(C){this.pickColor(x||"none",function(G){x=G;l()});mxEvent.consume(C)}));l();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";c.appendChild(B);mxUtils.br(c);return{getColor:function(){return x},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,n,v,x){x=null!=x?x:[];l&&(x.push("lightbox=1"),"auto"!=c&&x.push("target="+c),null!=g&&g!=mxConstants.NONE&&x.push("highlight="+("#"==g.charAt(0)?g.substring(1):+g)),null!=n&&0<n.length&&x.push("edit="+encodeURIComponent(n)),v&&x.push("layers=1"),this.editor.graph.foldingEnabled&&x.push("nav=1"));return x};EditorUi.prototype.createLink=function(c,g,l,n,v,x,B,C,G,N,J,T,V){var t=this.getCurrentFile();G=this.createUrlParameters(c,g,n,v,x,G);c=!0;null!=B?l="#U"+encodeURIComponent(B):C||null==t||""==t.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l=+"#"+t.getHash(),c=!1);c&&null!=t&&null!=t.getTitle()&&t.getTitle()!=this.defaultFilename&&G.push("title="+encodeURIComponent(t.getTitle()));N&&1<l.length&&(G.push("open="+l.substring(1)),l="");J&&null!=this.currentPage&&G.push("page-id="+this.currentPage.getId());T&&G.push("transparent=1");null!=V&&G.push("dark="+V);return(n&&(null!=B||null!=t&&t.getMode()!=App.MODE_GITHUB&&t.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("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,n,v,x,B,C,G,N,J,T,V){this.getBasenames();var t={};""!=v&&v!=mxConstants.NONE&&(t.highlight=v);"auto"!==n&&(t.target=n);N||(t.lightbox=!1);t.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(t.zoom=l/100);l=[];B&&(l.push("pages"),t.resize=!0,null!=this.pages&&null!=this.currentPage&&(t.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),+t.resize=!0);C&&l.push("layers");G&&l.push("tags");null!=V&&(t["dark-mode"]=V);0<l.length&&(N&&l.push("lightbox"),t.toolbar=l.join(" "));null!=J&&0<J.length&&(t.edit=J);null!=c?t.url=c:t.xml=this.getFileData(!0,null,null,null,null,!B);g='<div class="mxgraph" style="'+(x?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(t))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";T(g,'<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,g,l,n){var v=document.createElement("div");v.style.whiteSpace="nowrap";var x=document.createElement("h3");mxUtils.write(x,mxResources.get("html"));x.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";+v.appendChild(x);var B=document.createElement("div");B.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var C=document.createElement("input");C.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";C.setAttribute("value","url");C.setAttribute("type","radio");C.setAttribute("name","type-embedhtmldialog");x=C.cloneNode(!0);x.setAttribute("value","copy");B.appendChild(x);var G=document.createElement("span");mxUtils.write(G,mxResources.get("includeCopyOfMyDiagram"));+B.appendChild(G);mxUtils.br(B);B.appendChild(C);G=document.createElement("span");mxUtils.write(G,mxResources.get("publicDiagramUrl"));B.appendChild(G);var N=this.getCurrentFile();null==l&&null!=N&&N.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")),B.appendChild(G),mxEvent.addListener(G,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(N.getId(),+N)})));x.setAttribute("checked","checked");null==l&&C.setAttribute("disabled","disabled");v.appendChild(B);B=380;var J=this.addLinkSection(v),T=document.createElement("select");T.style.maxWidth="260px";T.style.marginLeft="8px";T.style.marginTop="16px";G=document.createElement("option");G.setAttribute("value","light");mxUtils.write(G,mxResources.get("light"));T.appendChild(G);G=document.createElement("option");G.setAttribute("value","dark");mxUtils.write(G,mxResources.get("dark"));T.appendChild(G);+G=document.createElement("option");G.setAttribute("value","auto");mxUtils.write(G,mxResources.get("automatic"));G.setAttribute("selected","selected");T.appendChild(G);G.setAttribute("selected","selected");mxUtils.write(v,mxResources.get("appearance")+":");v.appendChild(T);mxUtils.br(v);B+=26;var V=this.addCheckbox(v,mxResources.get("zoom"),!0,null,!0);mxUtils.write(v,":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft=+"4px";t.style.marginRight="12px";t.value="100%";v.appendChild(t);var z=this.addCheckbox(v,mxResources.get("fit"),!0);G=null!=this.pages&&1<this.pages.length;var L=L=this.addCheckbox(v,mxResources.get("allPages"),G,!G),K=this.addCheckbox(v,mxResources.get("layers"),!0),M=this.addCheckbox(v,mxResources.get("tags"),!0),m=this.addCheckbox(v,mxResources.get("lightbox"),!0),y=null;if(EditorUi.enableHtmlEditOption){y=this.addEditButton(v,m);var E=y.getEditInput();E.style.marginBottom="16px";B+=50;mxEvent.addListener(m,+"change",function(){m.checked?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled");E.checked&&m.checked?y.getEditSelect().removeAttribute("disabled"):y.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,v,mxUtils.bind(this,function(){n(C.checked?l:null,V.checked,t.value,J.getTarget(),J.getColor(),z.checked,L.checked,K.checked,M.checked,m.checked,null!=y?y.getLink():null,null!=T?T.value:null)}),null,c,g);this.showDialog(c.container,340,B,!0,!0);x.focus()};+EditorUi.prototype.showPublishLinkDialog=function(c,g,l,n,v,x,B,C,G,N,J,T){var V=document.createElement("div");V.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,c||mxResources.get("publish"));t.style.width="100%";t.style.textAlign="center";t.style.marginTop="2px";t.style.marginBottom="20px";V.appendChild(t);var z=document.createElement("select");c=30;z.className="geBtn";z.style.marginBottom="8px";z.style.marginLeft="0px";z.style.width="100%";z.style.boxSizing="border-box";+if(null==C||""==C.getHash())v=null!=v?v:"https://www.drawio.com/doc/faq/publish-diagram-as-link",t=document.createElement("option"),mxUtils.write(t,mxResources.get("makeCopy")),t.setAttribute("value","copy"),z.appendChild(t);t=document.createElement("option");mxUtils.write(t,mxResources.get("authorizationRequired"));t.setAttribute("value","auth");z.appendChild(t);null!=C&&""!=C.getHash()||t.setAttribute("disabled","disabled");C=document.createElement("option");C.setAttribute("value","public");z.appendChild(C);+null!=B?(mxUtils.write(C,mxResources.get("publicDiagramUrl")),C.setAttribute("title",B),z.value="public"):(mxUtils.write(C,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),C.setAttribute("disabled","disabled"));V.appendChild(z);mxUtils.br(V);z.focus();var L=null,K=null;if(null!=g||null!=l)c+=30,mxUtils.write(V,mxResources.get("width")+":"),L=document.createElement("input"),L.setAttribute("type","text"),L.style.marginRight="16px",L.style.width="50px",L.style.marginLeft=+"6px",L.style.marginRight="16px",L.style.marginBottom="10px",L.value="100%",V.appendChild(L),mxUtils.write(V,mxResources.get("height")+":"),K=document.createElement("input"),K.setAttribute("type","text"),K.style.width="50px",K.style.marginLeft="6px",K.style.marginBottom="10px",K.value=l+"px",V.appendChild(K),mxUtils.br(V);var M=this.addLinkSection(V,n),m=N?this.addCheckbox(V,mxResources.get("transparentBackground"),!1):null;null!=m&&(c+=20);var y=document.createElement("select");y.className="geBtn";+y.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");y.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");y.appendChild(g);var E=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),T&&(mxUtils.write(V,+mxResources.get("pages")+":"),V.appendChild(y),mxUtils.br(V),c+=30),E=this.addCheckbox(V,mxResources.get("selectedPage")+": "+g));var P=document.createElement("select");P.style.maxWidth="260px";P.style.marginLeft="8px";P.style.marginTop="16px";T=document.createElement("option");T.setAttribute("value","0");mxUtils.write(T,mxResources.get("light"));P.appendChild(T);T=document.createElement("option");T.setAttribute("value","1");mxUtils.write(T,mxResources.get("dark"));P.appendChild(T);T=document.createElement("option");+T.setAttribute("value","auto");mxUtils.write(T,mxResources.get("automatic"));T.setAttribute("selected","selected");P.appendChild(T);J&&(mxUtils.write(V,mxResources.get("appearance")+":"),V.appendChild(P),mxUtils.br(V),c+=30);var O=this.addCheckbox(V,mxResources.get("lightbox"),!0,null,null,!n),Q=this.addEditButton(V,O),U=Q.getEditInput();n&&(U.style.marginLeft=O.style.marginLeft,O.style.display="none",c-=20);var R=this.addCheckbox(V,mxResources.get("layers"),!0);R.style.marginLeft=U.style.marginLeft;+R.style.marginTop="8px";var S=this.addCheckbox(V,mxResources.get("tags"),!0);S.style.marginLeft=U.style.marginLeft;S.style.marginBottom="16px";S.style.marginTop="16px";mxEvent.addListener(O,"change",function(){O.checked?(R.removeAttribute("disabled"),U.removeAttribute("disabled"),S.removeAttribute("disabled")):(R.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"));U.checked&&O.checked?Q.getEditSelect().removeAttribute("disabled"):Q.getEditSelect().setAttribute("disabled",+"disabled")});n=new CustomDialog(this,V,mxUtils.bind(this,function(){G(M.getTarget(),M.getColor(),null==E?!1:E.checked,O.checked,Q.getLink(),R.checked,null!=L?L.value:null,null!=K?K.value:null,S.checked,z.value,null!=m?m.checked:!1,P.value,"allPages"==y.value)}),null,mxResources.get("create"),v,x);this.showDialog(n.container,340,296+c,!0,!0);null!=L?(L.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null)):null==z.parentNode;M.focus()};+EditorUi.prototype.showRemoteExportDialog=function(c,g,l,n,v){var x=document.createElement("div");x.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";x.appendChild(B);if(v){mxUtils.write(x,mxResources.get("zoom")+":");var C=document.createElement("input");C.setAttribute("type","text");C.style.marginRight="16px";C.style.width="60px";C.style.marginLeft=+"4px";C.style.marginRight="12px";C.value=this.lastExportZoom||"100%";x.appendChild(C);mxUtils.write(x,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";x.appendChild(G);mxUtils.br(x)}var N=this.addCheckbox(x,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),J=n?null:this.addCheckbox(x,mxResources.get("includeCopyOfMyDiagram"),+Editor.defaultIncludeDiagram);B=this.editor.graph;var T=n?null:this.addCheckbox(x,mxResources.get("transparentBackground"),B.background==mxConstants.NONE||null==B.background);null!=T&&(T.style.marginBottom="16px");c=new CustomDialog(this,x,mxUtils.bind(this,function(){var V=parseInt(C.value)/100||1,t=parseInt(G.value)||0;l(!N.checked,null!=J?J.checked:!1,null!=T?T.checked:!1,V,t)}),null,c,g);this.showDialog(c.container,300,(v?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,+g,l,n,v,x,B,C,G){B=null!=B?B:Editor.defaultIncludeDiagram;var N=document.createElement("div");N.style.whiteSpace="nowrap";var J=this.editor.graph,T="jpeg"==C||"webp"==C?220:320,V=document.createElement("h3");mxUtils.write(V,c);V.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";N.appendChild(V);mxUtils.write(N,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft=+"4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";N.appendChild(t);mxUtils.write(N,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";N.appendChild(z);mxUtils.br(N);var L=this.addCheckbox(N,mxResources.get("selectionOnly"),!1,J.isSelectionEmpty()),K=document.createElement("input");K.style.marginTop="16px";K.style.marginRight=+"8px";K.style.marginLeft="24px";K.setAttribute("disabled","disabled");K.setAttribute("type","checkbox");var M=document.createElement("select");M.style.marginTop="16px";M.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(V=0;V<c.length;V++)if(!J.isSelectionEmpty()||"selectionOnly"!=c[V]){var m=document.createElement("option");mxUtils.write(m,mxResources.get(c[V]));m.setAttribute("value",c[V]);M.appendChild(m)}G?(mxUtils.write(N,mxResources.get("size")+":"),N.appendChild(M),mxUtils.br(N),+T+=26,mxEvent.addListener(M,"change",function(){"selectionOnly"==M.value&&(L.checked=!0)})):x&&(N.appendChild(K),mxUtils.write(N,mxResources.get("crop")),mxUtils.br(N),T+=30,mxEvent.addListener(L,"change",function(){L.checked?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")}));J.isSelectionEmpty()?G&&(L.style.display="none",L.nextSibling.style.display="none",L.nextSibling.nextSibling.style.display="none",T-=30):(M.value="diagram",K.setAttribute("checked","checked"),K.defaultChecked=+!0,mxEvent.addListener(L,"change",function(){M.value=L.checked?"selectionOnly":"diagram"}));var y=this.addCheckbox(N,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=C&&"webp"!=C),E=document.createElement("select");E.style.maxWidth="260px";E.style.marginLeft="8px";E.style.marginTop="16px";x=document.createElement("option");x.setAttribute("value","light");mxUtils.write(x,mxResources.get("light"));E.appendChild(x);G=document.createElement("option");G.setAttribute("value","dark");mxUtils.write(G,+mxResources.get("dark"));E.appendChild(G);"svg"==C&&mxUtils.lightDarkColorSupported?(x=document.createElement("option"),x.setAttribute("value","auto"),mxUtils.write(x,mxResources.get("automatic")),x.setAttribute("selected","selected"),E.appendChild(x)):Editor.isDarkMode()?G.setAttribute("selected","selected"):x.setAttribute("selected","selected");mxUtils.write(N,mxResources.get("appearance")+":");N.appendChild(E);mxUtils.br(N);T+=26;var P=this.addCheckbox(N,mxResources.get("shadow"),J.shadowVisible),+O=null;if("png"==C||"jpeg"==C||"webp"==C)O=this.addCheckbox(N,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),T+=30;J=null!=this.pages?this.pages.length:1;var Q=this.addCheckbox(N,mxResources.get("includeCopyOfMyDiagram")+(1<J?":":""),B,null,null,"jpeg"!=C&&"webp"!=C),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="28px";"png"==C||"svg"==C?(B=function(){Q.checked?U.removeAttribute("disabled"):U.setAttribute("disabled","disabled")},x=document.createElement("option"),+x.setAttribute("value","allPages"),mxUtils.write(x,mxResources.get("allPages")),U.appendChild(x),x=document.createElement("option"),x.setAttribute("value","currentPage"),mxUtils.write(x,mxResources.get("currentPage")),U.appendChild(x),1<J?(Q.style.marginBottom="12px",U.style.marginBottom="16px",N.appendChild(U),mxUtils.br(N),T+=20):Q.style.marginBottom="16px",null!=this.lastEmbedInclude&&(U.value=this.lastEmbedInclude),mxEvent.addListener(Q,"change",B),B()):Q.style.marginBottom="16px";var R=document.createElement("input");+R.style.marginBottom="16px";R.style.marginRight="8px";R.setAttribute("type","checkbox");R.id="geCheckbox-"+Editor.guid();var S=document.createElement("input");S.style.marginBottom="16px";S.style.marginRight="8px";S.setAttribute("type","checkbox");S.id="geCheckbox-"+Editor.guid();g&&(R.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,N.appendChild(R),B=document.createElement("label"),mxUtils.write(B,mxResources.get("embedImages")),B.setAttribute("for",R.id),N.appendChild(B),mxUtils.br(N),+S.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,N.appendChild(S),B=document.createElement("label"),mxUtils.write(B,mxResources.get("embedFonts")),B.setAttribute("for",S.id),N.appendChild(B),mxUtils.br(N),T+=50);var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));W.appendChild(x);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"==C&&(mxUtils.write(N,mxResources.get("links")+":"),N.appendChild(W),N.appendChild(B),mxUtils.br(N),mxUtils.br(N),T+=50);l=new CustomDialog(this,N,mxUtils.bind(this,function(){this.lastExportBorder=+z.value;this.lastExportZoom=t.value;this.lastEmbedImages=R.checked;this.lastEmbedFonts=S.checked;this.lastEmbedInclude=U.value;v(t.value,y.checked,!L.checked,P.checked,Q.checked,R.checked&&g,z.value,K.checked,("png"==C||"svg"==C)&&"currentPage"==U.value,W.value,null!=O?O.checked:null,null!=E?E.value:null,M.value,S.checked)}),null,l,n);this.showDialog(l.container,340,T,!0,!0,null,null,null,null,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",+!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,l,n,v){var x=document.createElement("div");x.style.whiteSpace="nowrap";var B=this.editor.graph;if(null!=g){var C=document.createElement("h3");mxUtils.write(C,g);C.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";x.appendChild(C)}var G=this.addCheckbox(x,mxResources.get("fit"),!0),N=this.addCheckbox(x,mxResources.get("shadow"),B.shadowVisible&&n,!n),J=this.addCheckbox(x,l),T=this.addCheckbox(x,mxResources.get("lightbox"),+!0),V=this.addEditButton(x,T),t=V.getEditInput(),z=1<B.model.getChildCount(B.model.getRoot()),L=this.addCheckbox(x,mxResources.get("layers"),z,!z);L.style.marginLeft=t.style.marginLeft;L.style.marginBottom="12px";L.style.marginTop="8px";mxEvent.addListener(T,"change",function(){T.checked?(z&&L.removeAttribute("disabled"),t.removeAttribute("disabled")):(L.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&T.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled",+"disabled")});g=new CustomDialog(this,x,mxUtils.bind(this,function(){c(G.checked,N.checked,J.checked,T.checked,V.getLink(),L.checked)}),null,mxResources.get("embed"),v);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,n,v,x,B,C){function G(t){var z=" ",L="";n&&(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!=J?"&page="+J:"")+(v?"&edit=_blank":"")+(x?"&layers=1":"")+"');}})(this);\"",L+="cursor:pointer;");c&&(L+="max-width:100%;");var K="";l&&(K=' width="'+Math.round(N.width)+'" height="'+Math.round(N.height)+'"');B('<img src="'+t+'"'+K+(""!=L?' style="'+L+'"':"")+z+"/>")}var N=this.editor.graph.getGraphBounds(),J=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(t){var z=n?this.getFileData(!0):+null;t=this.createImageDataUri(t,z,"png");G(t)}),null,null,null,mxUtils.bind(this,function(t){C({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),N.width*N.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var T="";l&&(T="&w="+Math.round(2*N.width)+"&h="+Math.round(2*N.height));var V=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+T+"&xml="+encodeURIComponent(g));V.send(mxUtils.bind(this,function(){200<=+V.getStatus()&&299>=V.getStatus()?G("data:image/png;base64,"+V.getText()):C({message:mxResources.get("unknownError")})}))}else C({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,n,v,x,B){var C=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),G=C.getElementsByTagName("a");if(null!=G)for(var N=0;N<G.length;N++){var J=G[N].getAttribute("href");null!=J&&"#"==J.charAt(0)&&"_blank"==G[N].getAttribute("target")&&G[N].removeAttribute("target")}n&&+C.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(C);if(l){var T=" ",V="";n&&(T="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":"")+(x?"&layers=1":+"")+"');}})(this);\"",V+="cursor:pointer;");c&&(V+="max-width:100%;");this.editor.convertImages(C,mxUtils.bind(this,function(t){B('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(t))+'"'+(""!=V?' style="'+V+'"':"")+T+"/>")}))}else V="",n&&(g=this.getSelectedPageIndex(),C.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=g?"&page="+g:"")+(v?"&edit=_blank":"")+(x?"&layers=1":"")+"');}}})(this);"),V+="cursor:pointer;"),c&&(c=parseInt(C.getAttribute("width")),v=parseInt(C.getAttribute("height")),C.setAttribute("viewBox","-0.5 -0.5 "+c+" "+v),V+="max-width:100%;max-height:"+v+"px;",C.removeAttribute("height")),""!=V&&C.setAttribute("style",V),this.editor.addFontCss(C),this.editor.graph.mathEnabled&&this.editor.addMathCss(C),B(mxUtils.getXml(C))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var g=Math.floor(c/31536E3);if(1<g)return g+" "+mxResources.get("years");g=Math.floor(c/2592E3);if(1<g)return g+" "+mxResources.get("months");g=Math.floor(c/86400);if(1<g)return g+" "+mxResources.get("days");g=Math.floor(c/3600);if(1<g)return g+" "+mxResources.get("hours");g=Math.floor(c/60);return 1<g?g+" "+mxResources.get("minutes"):1==g?g+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,g){if(null!=c){var l=null;if("diagram"==c.nodeName)l=c;else if("mxfile"==c.nodeName){var n=c.getElementsByTagName("diagram");if(0<n.length){l=n[0];var v=g.getGlobalVariable;g.getGlobalVariable=function(x){return"page"==x?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==x?1:v.apply(this,arguments)}}}null!=l&&(c=Editor.parseDiagramNode(l))}n=this.editor.graph;try{this.editor.graph=g,this.editor.setGraphXml(c)}catch(x){}finally{this.editor.graph=n}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};EditorUi.prototype.getPngFileProperties=function(c){var g=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var n=parseFloat(c.getAttribute("scale"));!isNaN(n)&&0<n&&(g=n)}c.hasAttribute("border")&&(n=parseInt(c.getAttribute("border")),!isNaN(n)&&0<n&&(l=n))}return{scale:g,border:l}};EditorUi.prototype.getEmbeddedPng=function(c,g,l,n,v){try{var x=this.editor.graph,B=null;if(null!=l&&0<l.length)x=this.createTemporaryGraph(x.getStylesheet()),document.body.appendChild(x.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,-!0),x),B=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){x=this.createTemporaryGraph(x.getStylesheet());var C=x.getGlobalVariable;x.setBackgroundImage=this.editor.graph.setBackgroundImage;var H=this.pages[0];this.currentPage==H?x.setBackgroundImage(this.editor.graph.backgroundImage):null!=H.viewState&&null!=H.viewState&&x.setBackgroundImage(H.viewState.backgroundImage);x.getGlobalVariable=function(D){return"page"==D?H.getName():"pagenumber"==D?1:C.apply(this,arguments)};document.body.appendChild(x.container);-x.model.setRoot(H.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(D){try{null==B&&(B=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var U=D.toDataURL("image/png");U=Editor.writeGraphModelToPng(U,"tEXt","mxfile",encodeURIComponent(B));c(U.substring(U.lastIndexOf(",")+1));x!=this.editor.graph&&x.container.parentNode.removeChild(x.container)}catch(S){null!=g&&g(S)}}),null,null,null,mxUtils.bind(this,function(D){null!=g&&g(D)}),null,null,n,null,x.shadowVisible,null,x,v,null,-null,null,"diagram",null)}catch(D){null!=g&&g(D)}};EditorUi.prototype.getEmbeddedSvg=function(c,g,l,n,v,x,B,C,H,D,U,S,V){C=null!=C?C:!0;U=null!=U?U:0;B=null!=H?H:g.background;B==mxConstants.NONE&&(B=null);null==B&&"none"==g.getAdaptiveColors()&&(B="#ffffff");H=this.editor.graph.createSvgImageExport(null!=c);x=g.getSvg(B,D,U,null,null,x,null,H,null,g.shadowVisible||S,null,V,"diagram");(g.shadowVisible||S)&&g.addSvgShadow(x,null,null,0==U);null!=c&&x.setAttribute("content",c);null!=l&&x.setAttribute("resource",+!0),x),B=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){x=this.createTemporaryGraph(x.getStylesheet());var C=x.getGlobalVariable;x.setBackgroundImage=this.editor.graph.setBackgroundImage;var G=this.pages[0];this.currentPage==G?x.setBackgroundImage(this.editor.graph.backgroundImage):null!=G.viewState&&null!=G.viewState&&x.setBackgroundImage(G.viewState.backgroundImage);x.getGlobalVariable=function(N){return"page"==N?G.getName():"pagenumber"==N?1:C.apply(this,arguments)};document.body.appendChild(x.container);+x.model.setRoot(G.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(N){try{null==B&&(B=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var J=N.toDataURL("image/png");J=Editor.writeGraphModelToPng(J,"tEXt","mxfile",encodeURIComponent(B));c(J.substring(J.lastIndexOf(",")+1));x!=this.editor.graph&&x.container.parentNode.removeChild(x.container)}catch(T){null!=g&&g(T)}}),null,null,null,mxUtils.bind(this,function(N){null!=g&&g(N)}),null,null,n,null,x.shadowVisible,null,x,v,null,+null,null,"diagram",null)}catch(N){null!=g&&g(N)}};EditorUi.prototype.getEmbeddedSvg=function(c,g,l,n,v,x,B,C,G,N,J,T,V){C=null!=C?C:!0;J=null!=J?J:0;B=null!=G?G:g.background;B==mxConstants.NONE&&(B=null);null==B&&"none"==g.getAdaptiveColors()&&(B="#ffffff");G=this.editor.graph.createSvgImageExport(null!=c);x=g.getSvg(B,N,J,null,null,x,null,G,null,g.shadowVisible||T,null,V,"diagram");(g.shadowVisible||T)&&g.addSvgShadow(x,null,null,0==J);null!=c&&x.setAttribute("content",c);null!=l&&x.setAttribute("resource",l);var t=mxUtils.bind(this,function(z){z=(n?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(z);null!=v&&v(z);return z});g.mathEnabled&&this.editor.addMathCss(x);if(null!=v)this.embedFonts(x,mxUtils.bind(this,function(z){C?this.editor.convertImages(z,mxUtils.bind(this,function(L){t(L)})):t(z)}));else return t(x)};EditorUi.prototype.embedFonts=function(c,g){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(l){try{null!=l&&this.editor.addFontCss(c,l),g(c)}catch(n){g(c)}}))}catch(l){g(c)}}))};EditorUi.prototype.exportImage=function(c,g,l,n,v,x,B,C,H,D,U,S,V){H=null!=H?H:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(z){Editor.addRetryToError(z,mxUtils.bind(this,function(){this.exportImage(c,g,l,n,v,x,B,C,H,D,U,S,V)}));this.handleError(z)}))){var t=this.editor.graph.isSelectionEmpty();-l=null!=l?l:t;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,l,C,null,null,null,null,null,c,x):null,H,null==this.pages||0==this.pages.length,U)}catch(L){this.handleError(L)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),null,l,c||1,g,n,null,null,x,B,D,S,V)}catch(z){this.spinner.stop(),this.handleError(z)}}};+this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(l){try{null!=l&&this.editor.addFontCss(c,l),g(c)}catch(n){g(c)}}))}catch(l){g(c)}}))};EditorUi.prototype.exportImage=function(c,g,l,n,v,x,B,C,G,N,J,T,V){G=null!=G?G:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(z){Editor.addRetryToError(z,mxUtils.bind(this,function(){this.exportImage(c,g,l,n,v,x,B,C,G,N,J,T,V)}));this.handleError(z)}))){var t=this.editor.graph.isSelectionEmpty();+l=null!=l?l:t;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,l,C,null,null,null,null,null,c,x):null,G,null==this.pages||0==this.pages.length,J)}catch(L){this.handleError(L)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),null,l,c||1,g,n,null,null,x,B,N,T,V)}catch(z){this.spinner.stop(),this.handleError(z)}}};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 g=0;g<this.pages.length;g++)c[this.pages[g].getId()]=this.pages[g].getId();return c};EditorUi.prototype.importXml=function(c,g,l,n,v,x,B){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[g],"dy",[l],"crop",[n],"noErrorHandling",[v],"addNewPage",[x],"applyDefaultStyles",[B]);g=null!=g?g:0;l=null!=l?l:-0;var C=[];try{if(null!=c&&0<c.length){var H=null!=this.pages?this.pages.length:0,D=this.isDiagramEmpty(),U=this.currentPage,S=this.editor.graph;S.model.beginUpdate();try{var V=mxUtils.parseXml(c);c={};var t=this.editor.extractGraphModel(V.documentElement,null!=this.pages);if(null!=t&&"mxfile"==t.nodeName&&null!=this.pages){var z=t.getElementsByTagName("diagram");if(0<z.length){V=[];var L=0;if(1==z.length&&!x){if(null!=this.currentPage&&(c[z[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var K=-z[0].getAttribute("name");null!=K&&""!=K&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,K))}t=Editor.parseDiagramNode(z[0]);n=!1;L=1}for(;L<z.length;L++){var M=z[L].getAttribute("id");z[L].removeAttribute("id");var m=this.updatePageRoot(new DiagramPage(z[L]));c[M]=z[L].getAttribute("id");var y=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[y+1]));S.model.execute(new ChangePage(this,m,m,y,0<L));V.push(m)}this.updatePageLinks(c,V)}}if(null!=t&&-"mxGraphModel"===t.nodeName){C=S.importGraphModel(t,g,l,n);if(null!=C)for(this.addLocalPagesToMapping(c),L=0;L<C.length;L++)this.updatePageLinksForCell(c,C[L]);var F=S.parseBackgroundImage(t.getAttribute("backgroundImage"));if(null!=F&&null!=F.originalSrc&&this.updateBackgroundPageLink(c,F)){var N=new ChangePageSetup(this,null,F);N.ignoreColor=!0;S.model.execute(N)}}B&&S.pasteCellStyles(S.includeDescendants(C),S.defaultVertexStyle,S.defaultEdgeStyle);!x&&U!=this.currentPage&&null!=this.pages&&1<this.pages.length&&-D&&1==H&&this.removePage(U)}finally{S.model.endUpdate()}}}catch(O){if(v)throw O;this.handleError(O)}return C};EditorUi.prototype.updatePageLinks=function(c,g){for(var l=0;l<g.length;l++)this.updatePageLinksForCell(c,g[l].root),null!=g[l].viewState&&this.updateBackgroundPageLink(c,g[l].viewState.backgroundImage)&&(g[l]==this.currentPage&&this.editor.graph.setViewState(g[l].viewState,!0),g[l].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,g){var l=!1;try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var n=-c[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=n&&(g.originalSrc="data:page/id,"+n,l=!0)}}catch(v){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,g){var l=document.createElement("div"),n=this.editor.graph,v=n.getLinkForCell(g);null!=v&&n.setLinkForCell(g,this.updatePageLink(c,v));if(n.isHtmlLabel(g)){l.innerHTML=Graph.sanitizeHtml(n.getLabel(g));for(var x=l.getElementsByTagName("a"),B=!1,C=0;C<x.length;C++)v=x[C].getAttribute("href"),null!=v&&(x[C].setAttribute("href",-this.updatePageLink(c,v)),B=!0);B&&n.labelChanged(g,l.innerHTML)}for(C=0;C<n.model.getChildCount(g);C++)this.updatePageLinksForCell(c,n.model.getChildAt(g,C))};EditorUi.prototype.updatePageLink=function(c,g){if(Graph.isPageLink(g)){var l=c[g.substring(g.indexOf(",")+1)];g=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==g.substring(0,17))try{var n=JSON.parse(g.substring(17));if(null!=n.actions){for(var v=0;v<n.actions.length;v++){var x=n.actions[v];if(null!=x.open&&Graph.isPageLink(x.open)){var B=-x.open.substring(x.open.indexOf(",")+1);l=c[B];null!=l?x.open="data:page/id,"+l:null==this.getPageById(B)&&delete x.open}}g="data:action/json,"+JSON.stringify(n)}}catch(C){}return g};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,g,l,n,v){var x=mxUtils.bind(this,function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){n=-null!=n?n:c.name;var C=mxUtils.bind(this,function(D){B.clear()&&x(D)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var D=this.isRemoteVisioFormat(n);try{var U=n.lastIndexOf(".");if(0<=U&&U<n.length)n.substring(U+1).toUpperCase();else{var S=n.lastIndexOf("/");0<=S&&S<n.length&&(n=n.substring(S+1))}}catch(t){}if(D)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(n)?C({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):C({message:"draw.io"!=-this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{D=new FormData;D.append("file1",c,n);var V=new XMLHttpRequest;V.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));V.responseType="blob";this.addRemoteServiceSecurityCheck(V);null!=v&&V.setRequestHeader("x-convert-custom",v);V.onreadystatechange=mxUtils.bind(this,function(){if(4==V.readyState&&B.clear())if(200<=V.status&&299>=V.status)try{var t=V.response;if("text/xml"==-t.type){var z=new FileReader;z.onload=mxUtils.bind(this,function(L){try{g(L.target.result)}catch(K){C({message:mxResources.get("errorLoadingFile")})}});z.readAsText(t)}else this.doImportVisio(t,g,C,n)}catch(L){C(L)}else try{""==V.responseType||"text"==V.responseType?C({message:V.responseText}):(z=new FileReader,z.onload=function(){try{C({message:JSON.parse(z.result).Message})}catch(L){null!=z.result&&0<z.result.length?C({message:z.result}):C(L)}},z.readAsText(V.response))}catch(L){C({})}});V.send(D)}else if(B.clear())try{this.doImportVisio(c,-g,C,n)}catch(t){C(t)}}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?H():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,C))}),x)};EditorUi.prototype.importGraphML=function(c,g,l){var n=mxUtils.bind(this,function(v){this.loadingExtensions=!1;null!=l?l(v):this.handleError(v)});this.createTimeout(null,mxUtils.bind(this,function(v){var x=mxUtils.bind(this,function(C){v.clear()&&-n(C)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(v.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,g,n)}catch(C){x(C)}else x({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,x))}),n)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var g=-mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var n=mxUtils.bind(this,function(x){l.clear()&&g(x)}),v=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(l.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||n({message:mxResources.get("unknownError")})}catch(x){n(x)}else n({message:mxResources.get("serviceUnavailableOrBlocked")})});+0;var C=[];try{if(null!=c&&0<c.length){var G=null!=this.pages?this.pages.length:0,N=this.isDiagramEmpty(),J=this.currentPage,T=this.editor.graph;T.model.beginUpdate();try{var V=mxUtils.parseXml(c);c={};var t=this.editor.extractGraphModel(V.documentElement,null!=this.pages);if(null!=t&&"mxfile"==t.nodeName&&null!=this.pages){var z=t.getElementsByTagName("diagram");if(0<z.length){V=[];var L=0;if(1==z.length&&!x){if(null!=this.currentPage&&(c[z[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var K=+z[0].getAttribute("name");null!=K&&""!=K&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,K))}t=Editor.parseDiagramNode(z[0]);n=!1;L=1}for(;L<z.length;L++){var M=z[L].getAttribute("id");z[L].removeAttribute("id");var m=this.updatePageRoot(new DiagramPage(z[L]));c[M]=z[L].getAttribute("id");var y=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[y+1]));T.model.execute(new ChangePage(this,m,m,y,0<L));V.push(m)}this.updatePageLinks(c,V)}}if(null!=t&&+"mxGraphModel"===t.nodeName){C=T.importGraphModel(t,g,l,n);if(null!=C)for(this.addLocalPagesToMapping(c),L=0;L<C.length;L++)this.updatePageLinksForCell(c,C[L]);var E=T.parseBackgroundImage(t.getAttribute("backgroundImage"));if(null!=E&&null!=E.originalSrc&&this.updateBackgroundPageLink(c,E)){var P=new ChangePageSetup(this,null,E);P.ignoreColor=!0;T.model.execute(P)}}B&&T.pasteCellStyles(T.includeDescendants(C),T.defaultVertexStyle,T.defaultEdgeStyle);!x&&J!=this.currentPage&&null!=this.pages&&1<this.pages.length&&+N&&1==G&&this.removePage(J)}finally{T.model.endUpdate()}}}catch(O){if(v)throw O;this.handleError(O)}return C};EditorUi.prototype.updatePageLinks=function(c,g){for(var l=0;l<g.length;l++)this.updatePageLinksForCell(c,g[l].root),g[l]!=this.currentPage&&(g[l].needsUpdate=!0),null!=g[l].viewState&&this.updateBackgroundPageLink(c,g[l].viewState.backgroundImage)&&(g[l]==this.currentPage&&this.editor.graph.setViewState(g[l].viewState,!0),g[l].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=+function(c,g){var l=!1;try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var n=c[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=n&&(g.originalSrc="data:page/id,"+n,l=!0)}}catch(v){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,g){var l=document.createElement("div"),n=this.editor.graph,v=n.getLinkForCell(g);null!=v&&n.setLinkForCell(g,this.updatePageLink(c,v));if(n.isHtmlLabel(g)){l.innerHTML=Graph.sanitizeHtml(n.getLabel(g));for(var x=l.getElementsByTagName("a"),B=!1,+C=0;C<x.length;C++)v=x[C].getAttribute("href"),null!=v&&(x[C].setAttribute("href",this.updatePageLink(c,v)),B=!0);B&&n.labelChanged(g,l.innerHTML)}for(C=0;C<n.model.getChildCount(g);C++)this.updatePageLinksForCell(c,n.model.getChildAt(g,C))};EditorUi.prototype.updatePageLink=function(c,g){if(Graph.isPageLink(g)){var l=c[g.substring(g.indexOf(",")+1)];g=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==g.substring(0,17))try{var n=JSON.parse(g.substring(17));if(null!=n.actions){for(var v=+0;v<n.actions.length;v++){var x=n.actions[v];if(null!=x.open&&Graph.isPageLink(x.open)){var B=x.open.substring(x.open.indexOf(",")+1);l=c[B];null!=l?x.open="data:page/id,"+l:null==this.getPageById(B)&&delete x.open}}g="data:action/json,"+JSON.stringify(n)}}catch(C){}return g};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,g,l,n,v){var x=mxUtils.bind(this,function(B){this.loadingExtensions=+!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){n=null!=n?n:c.name;var C=mxUtils.bind(this,function(N){B.clear()&&x(N)}),G=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var N=this.isRemoteVisioFormat(n);try{var J=n.lastIndexOf(".");if(0<=J&&J<n.length)n.substring(J+1).toUpperCase();else{var T=n.lastIndexOf("/");0<=T&&T<n.length&&(n=n.substring(T+1))}}catch(t){}if(N)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(n)?+C({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):C({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{N=new FormData;N.append("file1",c,n);var V=new XMLHttpRequest;V.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));V.responseType="blob";this.addRemoteServiceSecurityCheck(V);null!=v&&V.setRequestHeader("x-convert-custom",v);V.onreadystatechange=mxUtils.bind(this,function(){if(4==V.readyState&&+B.clear())if(200<=V.status&&299>=V.status)try{var t=V.response;if("text/xml"==t.type){var z=new FileReader;z.onload=mxUtils.bind(this,function(L){try{g(L.target.result)}catch(K){C({message:mxResources.get("errorLoadingFile")})}});z.readAsText(t)}else this.doImportVisio(t,g,C,n)}catch(L){C(L)}else try{""==V.responseType||"text"==V.responseType?C({message:V.responseText}):(z=new FileReader,z.onload=function(){try{C({message:JSON.parse(z.result).Message})}catch(L){null!=z.result&&0<z.result.length?C({message:z.result}):+C(L)}},z.readAsText(V.response))}catch(L){C({})}});V.send(N)}else if(B.clear())try{this.doImportVisio(c,g,C,n)}catch(t){C(t)}}else C({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,C))}),x)};EditorUi.prototype.importGraphML=function(c,g,l){var n=mxUtils.bind(this,function(v){this.loadingExtensions=!1;null!=l?l(v):this.handleError(v)});+this.createTimeout(null,mxUtils.bind(this,function(v){var x=mxUtils.bind(this,function(C){v.clear()&&n(C)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(v.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,g,n)}catch(C){x(C)}else x({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,x))}),n)};EditorUi.prototype.exportVisio=+function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var g=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var n=mxUtils.bind(this,function(x){l.clear()&&g(x)}),v=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(l.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||n({message:mxResources.get("unknownError")})}catch(x){n(x)}else n({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,n))}),g):g({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,g,l){var n=mxUtils.bind(this,function(v){this.loadingExtensions=!1;null!=l?l(v):this.handleError(v)});this.createTimeout(null,mxUtils.bind(this,function(v){var x=mxUtils.bind(this,function(C){v.clear()&&-n(C)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(v.clear())if("undefined"!==typeof window.LucidImporter)try{var C=JSON.parse(c);g(LucidImporter.importState(C));try{if(null!=window.console&&"1"==urlParams.test){var H=[(new Date).toISOString(),"convertLucidChart",C];null!=C.state&&H.push(JSON.parse(C.state));if(null!=C.svgThumbs)for(var D=0;D<C.svgThumbs.length;D++)H.push(Editor.createSvgDataUri(C.svgThumbs[D]));null!=C.thumb&&H.push(C.thumb);console.log.apply(console,H)}}catch(U){}}catch(U){null!=-window.console&&console.error(U),x(U)}else x({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",+n(C)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(v.clear())if("undefined"!==typeof window.LucidImporter)try{var C=JSON.parse(c);g(LucidImporter.importState(C));try{if(null!=window.console&&"1"==urlParams.test){var G=[(new Date).toISOString(),"convertLucidChart",C];null!=C.state&&G.push(JSON.parse(C.state));if(null!=C.svgThumbs)for(var N=0;N<C.svgThumbs.length;N++)G.push(Editor.createSvgDataUri(C.svgThumbs[N]));null!=C.thumb&&G.push(C.thumb);console.log.apply(console,G)}}catch(J){}}catch(J){null!=+window.console&&console.error(J),x(J)}else x({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,x)},null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,x))}),n)};EditorUi.prototype.createMermaidXml=function(c,g,l,n,v,x){var B=new Graph(document.createElement("div"));l=B.insertVertex(null,null,null,0,0,n,v,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+l+";");B.setAttributeForCell(l,"mermaidData",JSON.stringify({data:c,config:g},null,2));null!=x&&B.setAttributeForCell(l,"templatePrompt",x);c=(new mxCodec).encode(B.getModel());return mxUtils.getXml(c)};EditorUi.prototype.getSvgForXml=function(c){var g=null,l=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(l.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,l.getModel()),g=l.getSvg(null,null,null,null,null,null,null,null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(l.container)}return g};EditorUi.prototype.generateOpenAiMermaidDiagram=-function(c,g,l,n,v){var x=0,B=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(C){var H="";if(null!=this.drive&&null!=this.drive.getUser()){var D=this.drive.getUser();null!=D.email&&0<D.email.indexOf("@")&&(H=D.email.substring(D.email.indexOf("@")+1))}var U={prompt:c,driveDomain:H,options:null!=v?v:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",n,"data",[U],"url",["https://www.draw.io/generate/v3"]);var S=Date.now();-H=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(U),"POST");var V=mxUtils.bind(this,function(z){C.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[U],"error",[z],"time",Date.now()-S+" ms"),l(z))}),t=mxUtils.bind(this,function(z){3>x++?C.clear()&&B():V(z)});H.send(mxUtils.bind(this,function(z){if(C.isAlive())if(200<=z.getStatus()&&299>=z.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var K=z.getText();try{K=JSON.parse(K),result=K.result}catch(M){result=-K}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[U],"response",[K],"time",Date.now()-S+" ms");n?"<"==result.charAt(0)?C.clear()&&(K=Editor.extractGraphModelFromText(result),g(null!=K&&3==K.length?K[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(M){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&g(M)}),V)}),V,t,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(M,m,y){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&+function(c,g,l,n,v){var x=0,B=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(C){var G="";if(null!=this.drive&&null!=this.drive.getUser()){var N=this.drive.getUser();null!=N.email&&0<N.email.indexOf("@")&&(G=N.email.substring(N.email.indexOf("@")+1))}var J={prompt:c,driveDomain:G,options:null!=v?v:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",n,"data",[J],"url",["https://www.draw.io/generate/v3"]);var T=Date.now();+G=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(J),"POST");var V=mxUtils.bind(this,function(z){C.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[J],"error",[z],"time",Date.now()-T+" ms"),l(z))}),t=mxUtils.bind(this,function(z){3>x++?C.clear()&&B():V(z)});G.send(mxUtils.bind(this,function(z){if(C.isAlive())if(200<=z.getStatus()&&299>=z.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var K=z.getText();try{K=JSON.parse(K),result=K.result}catch(M){result=+K}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[J],"response",[K],"time",Date.now()-T+" ms");n?"<"==result.charAt(0)?C.clear()&&(K=Editor.extractGraphModelFromText(result),g(null!=K&&3==K.length?K[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(M){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&g(M)}),V)}),V,t,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(M,m,y){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&g(result,M,m,y)}),V)}),V,t)}),V,!0);else{var L={message:mxResources.get("error")+" "+z.getStatus()};try{L=JSON.parse(z.getText()),null!=L.error&&(L.message=L.error)}catch(K){}V(L)}}),V)}),l)});B()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var g=c.split("```");g=1<g.length?g:c.split("<pre>");g=1<g.length?g:c.split("~~~");g=1<g.length?g:c.split("(Begins)");for(var l=mxUtils.trim(1>=g.length?c:g[1]),n=l.split("\n"),v=0;v<n.length&&("mermaid"==n[v]||0==n[v].trim().length||"%%"==n[v].substring(0,2));)v++;l=[];for(var x=v;x<n.length;x++){var B=mxUtils.trim(n[x]);if("%%"!=B.substring(0,2)&&"classDef "!=B.substring(0,9))l.push(n[x]);else if("mermaid"==B)break}n=l;l=mxUtils.trim(n.join("\n"));x=1<n.length?n[0]:null;null!=x&&(B=x.indexOf("-"),0<B&&x.substring(0,B));x=n[0].split(" ")[0].replace(/:$/,"");B=x.indexOf("-");0<B&&(x=x.substring(0,B));EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[l],"type",[x],"startLine",v,"lines",n,"tokens",g);0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,x)&&(l=null);return l};EditorUi.prototype.isSupportedMermaidDiagramType=function(c){return"graph"==c||"flowchart"==c||"sequencediagram"==c||"classdiagram"==c||"statediagram-v2"==c||"statediagram"==c||"erdiagram"==c||"requirementdiagram"==c||"gitgraph"==c||"mindmap"==c||"journey"==c};EditorUi.prototype.getMermaidDiagramType=function(c){c=c.split("\n");for(var g=0;g<c.length&&(0==c[g].trim().length||"%%"==c[g].substring(0,2));)g++;if("---"==c[g].trim()){do g++;while(g<c.length&&"---"!=c[g].trim());g++}c=c[g].trim().toLowerCase();g=c.indexOf(" ");return c.substring(0,0<g?g:c.length)};EditorUi.prototype.parseMermaidDiagram=function(c,g,l,n,v,x){var B=!1;x&&"undefined"!==typeof mxMermaidToDrawio&&this.isSupportedMermaidDiagramType(this.getMermaidDiagramType(c))&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(C){B||C==this.emptyDiagramXml||(B=!0,l(C))}));this.generateMermaidImage(c,g,mxUtils.bind(this,function(C,-H,D){B||(B=!0,l(this.createMermaidXml(c,g,C,H,D)))}),n,v)};EditorUi.prototype.loadMermaid=function(c,g){var l=mxUtils.bind(this,function(v){this.loadingMermaid=!1;g(v)}),n=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(v){l(v)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(n,0):(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",n,null,null,null,l):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",n,-null,null,null,l))};EditorUi.prototype.mermaidSvgToDataUri=function(c,g,l,n){try{c=c.replace(/xlink:href/g,"href").replace(/<br>/g,"<br/>");var v=mxUtils.parseXml(c).getElementsByTagName("svg");if(0<v.length&&"error"!=v[0].getAttribute("aria-roledescription")){var x=parseFloat(v[0].getAttribute("width")),B=parseFloat(v[0].getAttribute("height"));if(isNaN(x)||isNaN(B))try{var C=v[0].getAttribute("viewBox").split(/\s+/);x=parseFloat(C[2]);B=parseFloat(C[3])}catch(H){x=x||100,B=B||100}g(this.convertDataUri(Editor.createSvgDataUri(c)),-x,B)}else null!=n?n():l({message:mxResources.get("invalidInput")})}catch(H){l(H)}};EditorUi.prototype.getMermaidConfig=function(c,g){g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=c.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme="dark");return g};EditorUi.prototype.generateMermaidImage=function(c,g,l,n,v){var x=mxUtils.bind(this,+G,N){B||(B=!0,l(this.createMermaidXml(c,g,C,G,N)))}),n,v)};EditorUi.prototype.loadMermaid=function(c,g){var l=mxUtils.bind(this,function(v){this.loadingMermaid=!1;g(v)}),n=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(v){l(v)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(n,0):(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",n,null,null,null,l):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",n,+null,null,null,l))};EditorUi.prototype.mermaidSvgToDataUri=function(c,g,l,n){try{c=c.replace(/xlink:href/g,"href").replace(/<br>/g,"<br/>");var v=mxUtils.parseXml(c).getElementsByTagName("svg");if(0<v.length&&"error"!=v[0].getAttribute("aria-roledescription")){var x=parseFloat(v[0].getAttribute("width")),B=parseFloat(v[0].getAttribute("height"));if(isNaN(x)||isNaN(B))try{var C=v[0].getAttribute("viewBox").split(/\s+/);x=parseFloat(C[2]);B=parseFloat(C[3])}catch(G){x=x||100,B=B||100}g(this.convertDataUri(Editor.createSvgDataUri(c)),+x,B)}else null!=n?n():l({message:mxResources.get("invalidInput")})}catch(G){l(G)}};EditorUi.prototype.getMermaidConfig=function(c,g){g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=c.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme="dark");return g};EditorUi.prototype.generateMermaidImage=function(c,g,l,n,v){var x=mxUtils.bind(this,function(B){null!=n?n(B):this.handleError(B)});this.loadMermaid(mxUtils.bind(this,function(){try{mermaid.mermaidAPI.initialize(this.getMermaidConfig(c,g)),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(mxUtils.bind(this,function(B){this.mermaidSvgToDataUri(B.svg,l,n,v)})).catch(mxUtils.bind(this,function(B){this.removeMermaidErrors();B=Error(B.toString()+"\n\n"+c);"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();null!=v?v(B):x(B)}))}catch(B){x(B)}}),-x)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),g=0;g<c.length;g++)null!=c[g].parentNode&&c[g].parentNode.removeChild(c[g])};EditorUi.prototype.generatePlantUmlImage=function(c,g,l,n){function v(C,H,D){c1=C>>2;c2=(C&3)<<4|H>>4;c3=(H&15)<<2|D>>6;c4=D&63;r="";r+=x(c1&63);r+=x(c2&63);r+=x(c3&63);return r+=x(c4&63)}function x(C){if(10>C)return String.fromCharCode(48+C);C-=10;if(26>C)return String.fromCharCode(65+C);C-=26;if(26>+x)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),g=0;g<c.length;g++)null!=c[g].parentNode&&c[g].parentNode.removeChild(c[g])};EditorUi.prototype.generatePlantUmlImage=function(c,g,l,n){function v(C,G,N){c1=C>>2;c2=(C&3)<<4|G>>4;c3=(G&15)<<2|N>>6;c4=N&63;r="";r+=x(c1&63);r+=x(c2&63);r+=x(c3&63);return r+=x(c4&63)}function x(C){if(10>C)return String.fromCharCode(48+C);C-=10;if(26>C)return String.fromCharCode(65+C);C-=26;if(26>C)return String.fromCharCode(97+C);C-=26;return 0==C?"-":1==C?"_":"?"}var B=new XMLHttpRequest;B.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(C){r="";for(i=0;i<C.length;i+=3)r=i+2==C.length?r+v(C.charCodeAt(i),C.charCodeAt(i+1),0):i+1==C.length?r+v(C.charCodeAt(i),0,0):r+v(C.charCodeAt(i),C.charCodeAt(i+1),C.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=g&&(B.responseType="blob");B.onload=function(C){if(200<=this.status&&-300>this.status)if("txt"==g)l(this.response);else{var H=new FileReader;H.readAsDataURL(this.response);H.onloadend=function(D){var U=new Image;U.onload=function(){try{var S=U.width,V=U.height;if(0==S&&0==V){var t=H.result,z=t.indexOf(","),L=decodeURIComponent(escape(atob(t.substring(z+1)))),K=mxUtils.parseXml(L).getElementsByTagName("svg");0<K.length&&(S=parseFloat(K[0].getAttribute("width")),V=parseFloat(K[0].getAttribute("height")))}l(H.result,S,V)}catch(M){n(M)}};U.src=H.result};H.onerror=function(D){n(D)}}else n(C)};+300>this.status)if("txt"==g)l(this.response);else{var G=new FileReader;G.readAsDataURL(this.response);G.onloadend=function(N){var J=new Image;J.onload=function(){try{var T=J.width,V=J.height;if(0==T&&0==V){var t=G.result,z=t.indexOf(","),L=decodeURIComponent(escape(atob(t.substring(z+1)))),K=mxUtils.parseXml(L).getElementsByTagName("svg");0<K.length&&(T=parseFloat(K[0].getAttribute("width")),V=parseFloat(K[0].getAttribute("height")))}l(G.result,T,V)}catch(M){n(M)}};J.src=G.result};G.onerror=function(N){n(N)}}else n(C)};B.onerror=function(C){n(C)};B.send()};EditorUi.prototype.insertAsPreText=function(c,g,l){var n=this.editor.graph,v=null;n.getModel().beginUpdate();try{v=n.insertVertex(null,null,"<pre>"+c+"</pre>",g,l,1,1,"text;html=1;align=left;verticalAlign=top;"),n.updateCellSize(v,!0)}finally{n.getModel().endUpdate()}return v};EditorUi.prototype.insertTextAt=function(c,g,l,n,v,x,B,C){x=null!=x?x:!0;B=null!=B?B:!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,g,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(v||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var H=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var D=Editor.extractGraphModelFromPdf(c);if(null!=-D&&0<D.length)return this.importXml(D,g,l,x,!0,C)}if(Editor.isPngDataUrl(c)&&(D=Editor.extractGraphModelFromPng(c),null!=D&&0<D.length))return this.importXml(D,g,l,x,!0,C);if("data:image/svg+xml;"==c.substring(0,19))try{D=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(D=c.substring(c.indexOf(",")+1),D=window.atob&&!mxClient.IS_SF?atob(D):Base64.decode(D,!0)):D=decodeURIComponent(c.substring(c.indexOf(",")+1));var U=this.importXml(D,g,l,x,!0,C);if(0<U.length)return U}catch(V){}this.loadImage(c,-mxUtils.bind(this,function(V){if("data:"==c.substring(0,5))this.resizeImage(V,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(L,K,M){H.setSelectionCell(H.insertVertex(null,null,"",H.snap(g),H.snap(l),K,M,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(L)+";"))}),B,this.maxImageSize);else{var t=Math.min(1,Math.min(this.maxImageSize/V.width,this.maxImageSize/V.height)),-z=Math.round(V.width*t);V=Math.round(V.height*t);H.setSelectionCell(H.insertVertex(null,null,"",H.snap(g),H.snap(l),z,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var V=null;H.getModel().beginUpdate();try{V=H.insertVertex(H.getDefaultParent(),null,c,H.snap(g),H.snap(l),1,1,"text;"+(n?"html=1;":"")),H.updateCellSize(V),H.fireEvent(new mxEventObject("textInserted","cells",[V]))}finally{H.getModel().endUpdate()}H.setSelectionCell(V)}))}else{c=-Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,g,l,x,null,C);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(V){this.editor.graph.setSelectionCells(this.importXml(V,g,l,x,null,C))}),mxUtils.bind(this,function(V){this.handleError(V)}));else{H=this.editor.graph;v=null;H.getModel().beginUpdate();try{v=H.insertVertex(H.getDefaultParent(),null,"",H.snap(g),H.snap(l),1,1,"text;whiteSpace=wrap;"+(n?"html=1;":""));H.fireEvent(new mxEventObject("textInserted",-"cells",[v]));n&&(c=H.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");v.value=c;H.updateCellSize(v);if(0<this.maxTextWidth&&v.geometry.width>this.maxTextWidth){var S=H.getPreferredSizeForCell(v,this.maxTextWidth);v.geometry.width=S.width;v.geometry.height=S.height}Graph.isLink(v.value)&&H.setLinkForCell(v,v.value);v.geometry.width+=H.gridSize;v.geometry.height+=H.gridSize}finally{H.getModel().endUpdate()}return[v]}}return[]};EditorUi.prototype.formatFileSize=+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,g,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(v||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var G=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var N=Editor.extractGraphModelFromPdf(c);if(null!=+N&&0<N.length)return this.importXml(N,g,l,x,!0,C)}if(Editor.isPngDataUrl(c)&&(N=Editor.extractGraphModelFromPng(c),null!=N&&0<N.length))return this.importXml(N,g,l,x,!0,C);if("data:image/svg+xml;"==c.substring(0,19))try{N=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(N=c.substring(c.indexOf(",")+1),N=window.atob&&!mxClient.IS_SF?atob(N):Base64.decode(N,!0)):N=decodeURIComponent(c.substring(c.indexOf(",")+1));var J=this.importXml(N,g,l,x,!0,C);if(0<J.length)return J}catch(V){}this.loadImage(c,+mxUtils.bind(this,function(V){if("data:"==c.substring(0,5))this.resizeImage(V,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(L,K,M){G.setSelectionCell(G.insertVertex(null,null,"",G.snap(g),G.snap(l),K,M,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(L)+";"))}),B,this.maxImageSize);else{var t=Math.min(1,Math.min(this.maxImageSize/V.width,this.maxImageSize/V.height)),+z=Math.round(V.width*t);V=Math.round(V.height*t);G.setSelectionCell(G.insertVertex(null,null,"",G.snap(g),G.snap(l),z,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var V=null;G.getModel().beginUpdate();try{V=G.insertVertex(G.getDefaultParent(),null,c,G.snap(g),G.snap(l),1,1,"text;"+(n?"html=1;":"")),G.updateCellSize(V),G.fireEvent(new mxEventObject("textInserted","cells",[V]))}finally{G.getModel().endUpdate()}G.setSelectionCell(V)}))}else{c=+Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,g,l,x,null,C);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(V){this.editor.graph.setSelectionCells(this.importXml(V,g,l,x,null,C))}),mxUtils.bind(this,function(V){this.handleError(V)}));else{G=this.editor.graph;v=null;G.getModel().beginUpdate();try{v=G.insertVertex(G.getDefaultParent(),null,"",G.snap(g),G.snap(l),1,1,"text;whiteSpace=wrap;"+(n?"html=1;":""));G.fireEvent(new mxEventObject("textInserted",+"cells",[v]));n&&(c=G.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");v.value=c;G.updateCellSize(v);if(0<this.maxTextWidth&&v.geometry.width>this.maxTextWidth){var T=G.getPreferredSizeForCell(v,this.maxTextWidth);v.geometry.width=T.width;v.geometry.height=T.height}Graph.isLink(v.value)&&G.setLinkForCell(v,v.value);v.geometry.width+=G.gridSize;v.geometry.height+=G.gridSize}finally{G.getModel().endUpdate()}return[v]}}return[]};EditorUi.prototype.formatFileSize=function(c){var g=-1;do c/=1024,g++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var g=c.indexOf(";");0<g&&(c=c.substring(0,g)+c.substring(c.indexOf(",",g+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,g){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,g){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var l=document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=-!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(B,C){StorageFile.listFiles(this,"F",B,C)});window.openBrowserFile=mxUtils.bind(this,function(B,C,H){StorageFile.getFileContent(this,B,C,H)});window.deleteBrowserFile=mxUtils.bind(this,function(B,C,H){StorageFile.deleteFile(this,B,C,H)});if(!g){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(B){this.hideDialog(B)}));window.openFile.setConsumer(mxUtils.bind(this,-function(B,C){null!=C&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(C)?(B=new Blob([B],{type:"application/octet-stream"}),this.importVisio(B,mxUtils.bind(this,function(H){this.importXml(H,0,0,!0)}),null,C)):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,x=v.close;this.dialog.close=mxUtils.bind(this,function(B){Editor.useLocalStorage=-n;x.apply(v,arguments);B&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,g,l){var n=this,v=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(x){if(mxUtils.isEmptyObject(x.files))l();else{var B=0,C,H=!1;x.forEach(function(D,U){D=U.name.toLowerCase();"diagram/diagram.xml"==D?(H=!0,U.async("string").then(function(S){0==S.indexOf("<mxfile ")?g(S):l()})):0==D.indexOf("versions/")&&-(D=parseInt(D.substr(9)),D>B&&(B=D,C=U))});0<B?C.async("string").then(function(D){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(D,c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l):n.parseFileData(D,mxUtils.bind(this,function(U){4==U.readyState&&(200<=U.status&&299>=U.status?g(U.responseText):l())}),c.name):l()}):H||l()}},function(x){l(x)}):l()});"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,l))};EditorUi.prototype.importFile=function(c,g,l,n,v,x,B,C,H,D,U,S){D=null!=D?D:!0;var V=!1,t=null,z=mxUtils.bind(this,function(L){var K=null;null!=L&&"<mxlibrary"==L.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,L,B)),this.showSidebar()):K=this.importXml(L,l,n,D,null,null!=S?mxEvent.isControlDown(S):null);null!=C&&C(K)});"image"==g.substring(0,5)?(H=!1,"image/png"==g.substring(0,9)&&(U=U?null:this.extractGraphModelFromPng(c),-null!=U&&0<U.length&&(t=this.importXml(U,l,n,D,null,null!=S?mxEvent.isControlDown(S):null),H=!0)),H||(H=this.editor.graph,U=c.indexOf(";"),0<U&&(c=c.substring(0,U)+c.substring(c.indexOf(",",U+1))),D&&H.isGridEnabled()&&(l=H.snap(l),n=H.snap(n)),U="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==g.substring(0,9)&&(U+="editableCssRules=.*;"),t=[H.insertVertex(null,null,"",l,n,v,x,U+"image="+c+";")])):/(\.*<graphml )/.test(c)?-(V=!0,this.importGraphML(c,z)):null!=H&&null!=B&&EditorUi.isVisioFilename(B)?(V=!0,this.importVisio(H,z)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,B)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(V=!0,g=mxUtils.bind(this,function(L){4==L.readyState&&(200<=L.status&&299>=L.status?z(L.responseText):null!=C&&(C(null),this.showError(mxResources.get("error"),413==L.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),-null!=c?this.parseFileData(c,g,B):this.parseFile(H,g,B)):0==c.indexOf("PK")&&null!=H?(V=!0,this.importZipFile(H,z,mxUtils.bind(this,function(){t=this.insertTextAt(this.validateFileData(c),l,n,!0,null,D);C(t)}))):/(\.v(sd|dx))($|\?)/i.test(B)||/(\.vs(s|x))($|\?)/i.test(B)||(t=this.insertTextAt(this.validateFileData(c),l,n,!0,null,D,null,null!=S?mxEvent.isControlDown(S):null));V||null==C||C(t);return t};EditorUi.prototype.importFiles=function(c,g,l,n,v,x,B,C,H,D,U,S,V){n=null!=n?n:this.maxImageSize;-D=null!=D?D:this.maxImageBytes;var t=null!=g&&null!=l,z=!0;g=null!=g?g:0;l=null!=l?l:0;var L=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var K=U||this.resampleThreshold,M=0;M<c.length;M++)if("image/svg"!==c[M].type.substring(0,9)&&"image/"===c[M].type.substring(0,6)&&c[M].size>K){L=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[g],"y",[l],"maxSize",[n],"maxBytes",[D],"resampleThreshold",[this.resampleThreshold],"largeImages",[L],"crop",[t],"resizeImages",[z],"ignoreEmbeddedXml",-[S],"evt",[V]);var m=mxUtils.bind(this,function(){var y=this.editor.graph,F=y.gridSize;v=null!=v?v:mxUtils.bind(this,function(W,X,Y,Z,ba,ea,ha,fa,la){try{if(null!=W&&"<mxlibrary"==W.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,W,ha)),this.showSidebar(),null;this.isCompatibleString(W)&&1==c.length&&null!=V&&"drop"==V.type&&this.isBlankFile()&&!this.canUndo()&&(t=!1,Z=Y=0);return this.importFile(W,X,Y,Z,ba,ea,ha,fa,la,t,S,V)}catch(oa){return this.handleError(oa),-null}});x=null!=x?x:mxUtils.bind(this,function(W){y.setSelectionCells(W)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var N=this.currentPage,O=c.length,P=O,T=[],Q=mxUtils.bind(this,function(W,X){T[W]=X;if(0==--P){this.spinner.stop();if(null!=C)C(T);else{var Y=[];y.getModel().beginUpdate();try{for(W=0;W<T.length;W++){var Z=T[W]();null!=Z&&(Y=Y.concat(Z))}}finally{y.getModel().endUpdate()}}N!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),-0);x(Y)}}),R=0;R<O;R++)mxUtils.bind(this,function(W){var X=c[W];if(null!=X){var Y=new FileReader;Y.onload=mxUtils.bind(this,function(Z){if(null==B||B(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var ba=Graph.clipSvgDataUri(Z.target.result),ea=ba.indexOf(","),ha=decodeURIComponent(escape(atob(ba.substring(ea+1)))),fa=mxUtils.parseXml(ha),la=fa.getElementsByTagName("svg");if(0<la.length){var oa=la[0],pa=S?null:oa.getAttribute("content");null!=pa&&"<"!=pa.charAt(0)&&-"%"!=pa.charAt(0)&&(pa=unescape(window.atob?atob(pa):Base64.decode(pa,!0)));null!=pa&&"%"==pa.charAt(0)&&(pa=decodeURIComponent(pa));null==pa||"<mxfile "!==pa.substring(0,8)&&"<mxGraphModel>"!==pa.substring(0,14)&&"<mxGraphModel "!==pa.substring(0,14)?Q(W,mxUtils.bind(this,function(){try{if(null!=fa){var ma=fa.getElementsByTagName("svg");if(0<ma.length){var ia=ma[0],qa=ia.getAttribute("width"),ua=ia.getAttribute("height");qa=null!=qa&&"%"!=qa.charAt(qa.length-1)?parseFloat(qa):NaN;ua=null!=ua&&"%"!=-ua.charAt(ua.length-1)?parseFloat(ua):NaN;var xa=ia.getAttribute("viewBox");if(null==xa||0==xa.length)ia.setAttribute("viewBox","0 0 "+qa+" "+ua);else if(isNaN(qa)||isNaN(ua)){var ra=xa.split(" ");3<ra.length&&(qa=parseFloat(ra[2]),ua=parseFloat(ra[3]))}ba=Editor.createSvgDataUri(mxUtils.getXml(ia));var aa=Math.min(1,Math.min(n/Math.max(1,qa)),n/Math.max(1,ua)),na=v(ba,X.type,g+W*F,l+W*F,Math.max(1,Math.round(qa*aa)),Math.max(1,Math.round(ua*aa)),X.name);if(null!=na&&(isNaN(qa)||isNaN(ua))){var ja=-new Image;ja.onload=mxUtils.bind(this,function(){qa=Math.max(1,ja.width);ua=Math.max(1,ja.height);na[0].geometry.width=qa;na[0].geometry.height=ua;ia.setAttribute("viewBox","0 0 "+qa+" "+ua);ba=Editor.createSvgDataUri(mxUtils.getXml(ia));var sa=ba.indexOf(";");0<sa&&(ba=ba.substring(0,sa)+ba.substring(ba.indexOf(",",sa+1)));y.setCellStyles("image",ba,[na[0]])});ja.src=Editor.createSvgDataUri(mxUtils.getXml(ia))}return na}}}catch(sa){}return null})):Q(W,mxUtils.bind(this,function(){return v(pa,"text/xml",-g+W*F,l+W*F,0,0,X.name)}))}else Q(W,mxUtils.bind(this,function(){return null}))}else{ea=!1;if("image/png"==X.type){var va=S?null:this.extractGraphModelFromPng(Z.target.result);if(null!=va&&0<va.length){var ta=new Image;ta.src=Z.target.result;Q(W,mxUtils.bind(this,function(){return v(va,"text/xml",g+W*F,l+W*F,ta.width,ta.height,X.name)}));ea=!0}}ea||(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(Z.target.result,mxUtils.bind(this,function(ma){this.resizeImage(ma,Editor.stripImageMetadata(Z.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(ia,qa,ua){Q(W,mxUtils.bind(this,function(){if(null!=ia&&ia.length<D){var xa=z&&this.isResampleImageSize(X.size,U)?Math.min(1,Math.min(n/qa,n/ua)):1;return v(ia,X.type,g+W*F,l+W*F,Math.round(qa*xa),-Math.round(ua*xa),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),z,n,U,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ba=Z.target.result,v(ba,X.type,g+W*F,l+W*F,240,160,X.name,function(ma){Q(W,function(){return ma})},X)}catch(ma){Q(W,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ma,X)}else Q(W,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?-v(null,X.type,g+W*F,l+W*F,240,160,X.name,function(Z){Q(W,function(){return Z})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?Y.readAsDataURL(X):Y.readAsText(X)}})(R)});if(L){L=[];for(M=0;M<c.length;M++)L.push(c[M]);c=L;this.confirmImageResize(function(y){z=y;m()},H)}else m()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=+!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(B,C){StorageFile.listFiles(this,"F",B,C)});window.openBrowserFile=mxUtils.bind(this,function(B,C,G){StorageFile.getFileContent(this,B,C,G)});window.deleteBrowserFile=mxUtils.bind(this,function(B,C,G){StorageFile.deleteFile(this,B,C,G)});if(!g){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(B){this.hideDialog(B)}));window.openFile.setConsumer(mxUtils.bind(this,+function(B,C){null!=C&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(C)?(B=new Blob([B],{type:"application/octet-stream"}),this.importVisio(B,mxUtils.bind(this,function(G){this.importXml(G,0,0,!0)}),null,C)):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,x=v.close;this.dialog.close=mxUtils.bind(this,function(B){Editor.useLocalStorage=+n;x.apply(v,arguments);B&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,g,l){var n=this,v=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(x){if(mxUtils.isEmptyObject(x.files))l();else{var B=0,C,G=!1;x.forEach(function(N,J){N=J.name.toLowerCase();"diagram/diagram.xml"==N?(G=!0,J.async("string").then(function(T){0==T.indexOf("<mxfile ")?g(T):l()})):0==N.indexOf("versions/")&&+(N=parseInt(N.substr(9)),N>B&&(B=N,C=J))});0<B?C.async("string").then(function(N){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(N,c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l):n.parseFileData(N,mxUtils.bind(this,function(J){4==J.readyState&&(200<=J.status&&299>=J.status?g(J.responseText):l())}),c.name):l()}):G||l()}},function(x){l(x)}):l()});"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,l))};EditorUi.prototype.importFile=function(c,g,l,n,v,x,B,C,G,N,J,T){N=null!=N?N:!0;var V=!1,t=null,z=mxUtils.bind(this,function(L){var K=null;null!=L&&"<mxlibrary"==L.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,L,B)),this.showSidebar()):K=this.importXml(L,l,n,N,null,null!=T?mxEvent.isControlDown(T):null);null!=C&&C(K)});"image"==g.substring(0,5)?(G=!1,"image/png"==g.substring(0,9)&&(J=J?null:this.extractGraphModelFromPng(c),+null!=J&&0<J.length&&(t=this.importXml(J,l,n,N,null,null!=T?mxEvent.isControlDown(T):null),G=!0)),G||(G=this.editor.graph,J=c.indexOf(";"),0<J&&(c=c.substring(0,J)+c.substring(c.indexOf(",",J+1))),N&&G.isGridEnabled()&&(l=G.snap(l),n=G.snap(n)),J="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==g.substring(0,9)&&(J+="editableCssRules=.*;"),t=[G.insertVertex(null,null,"",l,n,v,x,J+"image="+c+";")])):/(\.*<graphml )/.test(c)?+(V=!0,this.importGraphML(c,z)):null!=G&&null!=B&&EditorUi.isVisioFilename(B)?(V=!0,this.importVisio(G,z)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,B)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(V=!0,g=mxUtils.bind(this,function(L){4==L.readyState&&(200<=L.status&&299>=L.status?z(L.responseText):null!=C&&(C(null),this.showError(mxResources.get("error"),413==L.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),+null!=c?this.parseFileData(c,g,B):this.parseFile(G,g,B)):0==c.indexOf("PK")&&null!=G?(V=!0,this.importZipFile(G,z,mxUtils.bind(this,function(){t=this.insertTextAt(this.validateFileData(c),l,n,!0,null,N);C(t)}))):/(\.v(sd|dx))($|\?)/i.test(B)||/(\.vs(s|x))($|\?)/i.test(B)||(t=this.insertTextAt(this.validateFileData(c),l,n,!0,null,N,null,null!=T?mxEvent.isControlDown(T):null));V||null==C||C(t);return t};EditorUi.prototype.importFiles=function(c,g,l,n,v,x,B,C,G,N,J,T,V){n=null!=n?n:this.maxImageSize;+N=null!=N?N:this.maxImageBytes;var t=null!=g&&null!=l,z=!0;g=null!=g?g:0;l=null!=l?l:0;var L=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var K=J||this.resampleThreshold,M=0;M<c.length;M++)if("image/svg"!==c[M].type.substring(0,9)&&"image/"===c[M].type.substring(0,6)&&c[M].size>K){L=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[g],"y",[l],"maxSize",[n],"maxBytes",[N],"resampleThreshold",[this.resampleThreshold],"largeImages",[L],"crop",[t],"resizeImages",[z],"ignoreEmbeddedXml",+[T],"evt",[V]);var m=mxUtils.bind(this,function(){var y=this.editor.graph,E=y.gridSize;v=null!=v?v:mxUtils.bind(this,function(W,X,Y,Z,aa,fa,ia,ea,ma){try{if(null!=W&&"<mxlibrary"==W.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,W,ia)),this.showSidebar(),null;this.isCompatibleString(W)&&1==c.length&&null!=V&&"drop"==V.type&&this.isBlankFile()&&!this.canUndo()&&(t=!1,Z=Y=0);return this.importFile(W,X,Y,Z,aa,fa,ia,ea,ma,t,T,V)}catch(na){return this.handleError(na),+null}});x=null!=x?x:mxUtils.bind(this,function(W){y.setSelectionCells(W)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var P=this.currentPage,O=c.length,Q=O,U=[],R=mxUtils.bind(this,function(W,X){U[W]=X;if(0==--Q){this.spinner.stop();if(null!=C)C(U);else{var Y=[];y.getModel().beginUpdate();try{for(W=0;W<U.length;W++){var Z=U[W]();null!=Z&&(Y=Y.concat(Z))}}finally{y.getModel().endUpdate()}}P!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),+0);x(Y)}}),S=0;S<O;S++)mxUtils.bind(this,function(W){var X=c[W];if(null!=X){var Y=new FileReader;Y.onload=mxUtils.bind(this,function(Z){if(null==B||B(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var aa=Graph.clipSvgDataUri(Z.target.result),fa=aa.indexOf(","),ia=decodeURIComponent(escape(atob(aa.substring(fa+1)))),ea=mxUtils.parseXml(ia),ma=ea.getElementsByTagName("svg");if(0<ma.length){var na=ma[0],ua=T?null:na.getAttribute("content");null!=ua&&"<"!=ua.charAt(0)&&+"%"!=ua.charAt(0)&&(ua=unescape(window.atob?atob(ua):Base64.decode(ua,!0)));null!=ua&&"%"==ua.charAt(0)&&(ua=decodeURIComponent(ua));null==ua||"<mxfile "!==ua.substring(0,8)&&"<mxGraphModel>"!==ua.substring(0,14)&&"<mxGraphModel "!==ua.substring(0,14)?R(W,mxUtils.bind(this,function(){try{if(null!=ea){var la=ea.getElementsByTagName("svg");if(0<la.length){var ja=la[0],qa=ja.getAttribute("width"),va=ja.getAttribute("height");qa=null!=qa&&"%"!=qa.charAt(qa.length-1)?parseFloat(qa):NaN;va=null!=va&&"%"!=+va.charAt(va.length-1)?parseFloat(va):NaN;var ya=ja.getAttribute("viewBox");if(null==ya||0==ya.length)ja.setAttribute("viewBox","0 0 "+qa+" "+va);else if(isNaN(qa)||isNaN(va)){var ra=ya.split(" ");3<ra.length&&(qa=parseFloat(ra[2]),va=parseFloat(ra[3]))}aa=Editor.createSvgDataUri(mxUtils.getXml(ja));var ha=Math.min(1,Math.min(n/Math.max(1,qa)),n/Math.max(1,va)),Da=v(aa,X.type,g+W*E,l+W*E,Math.max(1,Math.round(qa*ha)),Math.max(1,Math.round(va*ha)),X.name);if(null!=Da&&(isNaN(qa)||isNaN(va))){var oa=+new Image;oa.onload=mxUtils.bind(this,function(){qa=Math.max(1,oa.width);va=Math.max(1,oa.height);Da[0].geometry.width=qa;Da[0].geometry.height=va;ja.setAttribute("viewBox","0 0 "+qa+" "+va);aa=Editor.createSvgDataUri(mxUtils.getXml(ja));var ba=aa.indexOf(";");0<ba&&(aa=aa.substring(0,ba)+aa.substring(aa.indexOf(",",ba+1)));y.setCellStyles("image",aa,[Da[0]])});oa.src=Editor.createSvgDataUri(mxUtils.getXml(ja))}return Da}}}catch(ba){}return null})):R(W,mxUtils.bind(this,function(){return v(ua,"text/xml",+g+W*E,l+W*E,0,0,X.name)}))}else R(W,mxUtils.bind(this,function(){return null}))}else{fa=!1;if("image/png"==X.type){var ta=T?null:this.extractGraphModelFromPng(Z.target.result);if(null!=ta&&0<ta.length){var sa=new Image;sa.src=Z.target.result;R(W,mxUtils.bind(this,function(){return v(ta,"text/xml",g+W*E,l+W*E,sa.width,sa.height,X.name)}));fa=!0}}fa||(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(Z.target.result,mxUtils.bind(this,function(la){this.resizeImage(la,Editor.stripImageMetadata(Z.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(ja,qa,va){R(W,mxUtils.bind(this,function(){if(null!=ja&&ja.length<N){var ya=z&&this.isResampleImageSize(X.size,J)?Math.min(1,Math.min(n/qa,n/va)):1;return v(ja,X.type,g+W*E,l+W*E,Math.round(qa*ya),+Math.round(va*ya),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),z,n,J,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else aa=Z.target.result,v(aa,X.type,g+W*E,l+W*E,240,160,X.name,function(la){R(W,function(){return la})},X)}catch(la){R(W,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(la,X)}else R(W,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?+v(null,X.type,g+W*E,l+W*E,240,160,X.name,function(Z){R(W,function(){return Z})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?Y.readAsDataURL(X):Y.readAsText(X)}})(S)});if(L){L=[];for(M=0;M<c.length;M++)L.push(c[M]);c=L;this.confirmImageResize(function(y){z=y;m()},G)}else m()};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,g){g=null!=g?g:!1;var l=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},n=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,v=function(x,B){if(x||g)mxSettings.setResizeImages(x?B:null),mxSettings.save();l();c(B)};null==n||g?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(x){v(x,!0)},function(x){v(x,!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,n)};EditorUi.prototype.parseFile=function(c,g,l){l=null!=l?l:c.name;var n=new FileReader;n.onload=mxUtils.bind(this,function(){this.parseFileData(n.result,g,l)});n.readAsText(c)};EditorUi.prototype.parseFileData=function(c,g,l){var n=new XMLHttpRequest;n.open("POST",OPEN_URL);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");-n.onreadystatechange=function(){g(n)};n.send("format=xml&filename="+encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(v){}};EditorUi.prototype.isResampleImageSize=function(c,g){g=null!=g?g:this.resampleThreshold;return c>g};EditorUi.prototype.resizeImage=function(c,g,l,n,v,x,B){v=null!=v?v:this.maxImageSize;var C=Math.max(1,c.width),H=Math.max(1,c.height),D=g;if(n&&this.isResampleImageSize(null!=B?B:g.length,-x))try{var U=Math.max(C/v,H/v);if(1<U){var S=Math.round(C/U),V=Math.round(H/U),t=document.createElement("canvas");t.width=S;t.height=V;t.getContext("2d").drawImage(c,0,0,S,V);var z=t.toDataURL();if(z.length<g.length){var L=document.createElement("canvas");L.width=S;L.height=V;var K=L.toDataURL();z!==K&&(g=z,C=S,H=V)}}}catch(M){}n&&D!=g&&v>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(c,g,l,n,v/1.5,x,B):l(g,C,H)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};+n.onreadystatechange=function(){g(n)};n.send("format=xml&filename="+encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(v){}};EditorUi.prototype.isResampleImageSize=function(c,g){g=null!=g?g:this.resampleThreshold;return c>g};EditorUi.prototype.resizeImage=function(c,g,l,n,v,x,B){v=null!=v?v:this.maxImageSize;var C=Math.max(1,c.width),G=Math.max(1,c.height),N=g;if(n&&this.isResampleImageSize(null!=B?B:g.length,+x))try{var J=Math.max(C/v,G/v);if(1<J){var T=Math.round(C/J),V=Math.round(G/J),t=document.createElement("canvas");t.width=T;t.height=V;t.getContext("2d").drawImage(c,0,0,T,V);var z=t.toDataURL();if(z.length<g.length){var L=document.createElement("canvas");L.width=T;L.height=V;var K=L.toDataURL();z!==K&&(g=z,C=T,G=V)}}}catch(M){}n&&N!=g&&v>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(c,g,l,n,v/1.5,x,B):l(g,C,G)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,g,l){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=0<n.height?n.height:120;g(n)};null!=l&&(n.onerror=l);n.src=c}catch(v){if(null!=l)l(v);else throw v;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var p=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);p.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=-mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,g=this.editor.graph,l=g.isEnabled;g.isEnabled=function(){return l.apply(this,arguments)&&!c.isLocked()};g.showLinkIcons=Editor.showLinkIcons;g.showTooltipIcons=Editor.showTooltipIcons;var n=this;g.editTooltip=function(Q){null!=Q&&n.actions.get("editTooltip").funct()};g.getLinkOverlayTooltip=function(Q){if(Graph.isPageLink(Q)&&null!=n.pages){var R=Q.substring(Q.indexOf(",")+1);R=n.getPageById(R);if(null!=R)return R.getName()||mxResources.get("pageWithNumber",-[mxUtils.indexOf(n.pages,R)+1])}return Q};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(Q){var R=Q.getEvent();return null==Q.getState()&&!mxEvent.isMouseEvent(R)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(R)&&(null==Q.getState()||mxEvent.isControlDown(R)||mxEvent.isShiftDown(R))});g.cellEditor.editPlantUmlData=function(Q,R,W){var X=JSON.parse(W);R=new SimpleTextareaDialog(c,X.data,function(Y){null!=Y&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(Y,-X.format,function(Z,ba,ea){c.spinner.stop();g.getModel().beginUpdate();try{if("txt"==X.format)g.labelChanged(Q,"<pre>"+Z+"</pre>"),g.updateCellSize(Q,!0);else{g.setCellStyles("image",c.convertDataUri(Z),[Q]);var ha=g.model.getGeometry(Q);null!=ha&&(ha=ha.clone(),ha.width=ba,ha.height=ea,g.cellsResized([Q],[ha],!1))}g.setAttributeForCell(Q,"plantUmlData",JSON.stringify({data:Y,format:X.format}))}finally{g.getModel().endUpdate()}},function(Z){c.handleError(Z)})});c.showDialog(R.container,640,420,!0,-!0,null,null,null,new mxRectangle(0,0,320,280));R.init()};g.cellEditor.editMermaidData=function(Q,R,W){var X=JSON.parse(W);R=new SimpleTextareaDialog(c,X.data,function(Y){null!=Y&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(Y,X.config,function(Z,ba,ea){c.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",Z,[Q]);var ha=g.model.getGeometry(Q);null!=ha&&(ha=ha.clone(),ha.width=Math.max(ha.width,ba),ha.height=Math.max(ha.height,ea),g.cellsResized([Q],-[ha],!1));g.setAttributeForCell(Q,"mermaidData",JSON.stringify({data:Y,config:X.config},null,2))}finally{g.getModel().endUpdate()}},function(Z){c.handleError(Z)})});c.showDialog(R.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));R.init()};var v=g.cellEditor.startEditing;g.cellEditor.startEditing=function(Q,R){try{var W=this.graph.getAttributeForCell(Q,"plantUmlData");if(null!=W)this.editPlantUmlData(Q,R,W);else if(W=this.graph.getAttributeForCell(Q,"mermaidData"),null!=W&&window.isMermaidEnabled)this.editMermaidData(Q,-R,W);else{var X=g.getCellStyle(Q);"1"==mxUtils.getValue(X,"metaEdit","0")?c.showDataDialog(Q):v.apply(this,arguments)}}catch(Y){c.handleError(Y)}};g.getLinkTitle=function(Q){return c.getLinkTitle(Q)};g.customLinkClicked=function(Q,R){var W=!1;try{var X=this.getGraphBounds();c.handleCustomLink(Q,R);W=!0;c.chromelessResize&&!X.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(R))}catch(Y){c.handleError(Y)}return W};var x=g.parseBackgroundImage;g.parseBackgroundImage=function(Q){var R=-x.apply(this,arguments);null!=R&&null!=R.src&&Graph.isPageLink(R.src)&&(R={originalSrc:R.src});return R};var B=g.setBackgroundImage;g.setBackgroundImage=function(Q){null!=Q&&null!=Q.originalSrc&&(Q=c.createImageForPageLink(Q.originalSrc,c.currentPage,this));B.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(Q,R){Q=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=Q){var W=Q.indexOf(",");if(0<W)for(Q=Q.substring(W+1),R=R.getProperty("patches"),W=0;W<R.length;W++)if(null!=R[W][EditorUi.DIFF_UPDATE]&&null!=R[W][EditorUi.DIFF_UPDATE][Q]||null!=R[W][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(R[W][EditorUi.DIFF_REMOVE],Q)){g.refreshBackgroundImage();break}}}));var C=g.getBackgroundImageObject;g.getBackgroundImageObject=function(Q,R,W){var X=C.apply(this,arguments);-null!=X&&null!=X.originalSrc&&(X=R?c.createImageForPageLink(X.originalSrc,W,null,!0):{src:X.originalSrc});return X};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 H=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(Q){Q=-null!=Q?Q:"";"1"==urlParams.dev&&(Q+=(0<Q.length?"&":"?")+"dev=1");"1"==urlParams.test&&(Q+=(0<Q.length?"&":"?")+"test=1");return H.apply(this,arguments)};var D=g.addClickHandler;g.addClickHandler=function(Q,R,W){var X=R;R=function(Y,Z,ba){if(null==Z){var ea=mxEvent.getSource(Y);"a"==ea.nodeName.toLowerCase()&&(Z=ea.getAttribute("href"))}null!=Z&&g.isCustomLink(Z)&&(mxEvent.isTouchEvent(Y)||!mxEvent.isPopupTrigger(Y))&&g.customLinkClicked(Z,ba)&&mxEvent.consume(Y);null!=X&&X(Y,Z,ba)};D.call(this,-Q,R,W)};q.apply(this,arguments);this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var U=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(Q,R,W){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(Q,["zoomIn","zoomOut","-"],null,W);if(Editor.passiveScroll&&null!=W){var X=mxUtils.convertPoint(g.container,mxEvent.getClientX(W),mxEvent.getClientY(W));g._contextMenuPoint=new mxPoint(g.snap(X.x/g.view.scale-g.view.translate.x),-g.snap(X.y/g.view.scale-g.view.translate.y));g._contextMenuScreenPoint=mxUtils.convertPoint(g.container,mxEvent.getClientX(W),mxEvent.getClientY(W))}g.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",Q,null),Q.addSeparator());U.apply(this,arguments);g.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(Q,["-","addToScratchpad"],null,W);g.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(Q,["-","exitGroup","home"],null,W)};-var S=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(Q,R,W){if(c.editor.graph.isSelectionEmpty())S.apply(this,arguments),c.menus.addMenuItems(Q,["copyAsImage","copyAsSvg"],null,W);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(Q,R,W):this.addPopupMenuArrangeItems(Q,R,W),this.addMenuItems(Q,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,W),Editor.passiveScroll&&(1==g.getSelectionCount()?this.addMenuItems(Q,["-","copyStyle","pasteStyle"],null,-W):this.addMenuItems(Q,["-","pasteStyle"],null,W)),this.addMenuItems(Q,["-"],null,W),this.isShowCellEditItems()||this.addPopupDeleteItem(Q,R,W),this.addMenuItems(Q,["lockUnlock","-"],null,W),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(R)&&g.isCellEditable(R)&&(this.addSubmenu("editCell",Q,null,mxResources.get("edit")),Q.addSeparator(),g.getModel().isEdge(R))){this.addSubmenu("line",Q);var X=g.getModel().getGeometry(R);null!=X&&null!=X.points&&0<X.points.length&&this.addMenuItems(Q,-["clearWaypoints"],null,W)}1==g.getSelectionCount()&&this.addMenuItems(Q,["enterGroup"],null,W);X=c.getSelectionState();null!=X.mergeCell?this.addMenuItem(Q,"mergeCells"):(1<X.style.colspan||1<X.style.rowspan)&&this.addMenuItem(Q,"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}if(Editor.passiveScroll){var V=g.getCenterInsertPoint;g.getCenterInsertPoint=function(Q){if(null!=this._contextMenuPoint){var R=this._contextMenuPoint;Q=null!=Q?Q:new mxRectangle;return new mxPoint(g.snap(R.x-(Q.width||0)/2),g.snap(R.y-(Q.height||0)/2))}return V.apply(this,arguments)};var t=g.popupMenuHandler.hideMenu;g.popupMenuHandler.hideMenu=function(){t.apply(this,arguments);window.setTimeout(function(){g._contextMenuPoint=null;g._contextMenuScreenPoint=-null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var z=g.getExportVariables;g.getExportVariables=function(){var Q=z.apply(this,arguments),R=c.getCurrentFile();null!=R&&(Q.filename=R.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var W in c.fileVars)null==Q[W]&&(Q[W]=c.fileVars[W]);Q.pagecount=null!=c.pages?c.pages.length:1;Q.page=null!=c.currentPage?c.currentPage.getName():-"";Q.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return Q};var L=g.getGlobalVariable;g.getGlobalVariable=function(Q){var R=c.getCurrentFile();if("filename"==Q&&null!=R)return R.getTitle();if("page"==Q&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==Q)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==Q)return null!=c.pages?c.pages.length:1;R=L.apply(this,arguments);null==R&&(c.updateFileVars(),-null!=c.fileVars&&(R=c.fileVars[Q]));return R};var K=null,M=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var Q=this.getCurrentFile(),R=null!=Q&&null!=Q.getTitle()?Q.getTitle():this.defaultFilename;K!=R&&Q==M&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());K=R;M=Q}));var m=g.labelLinkClicked;g.labelLinkClicked=function(Q,R,W){var X=R.getAttribute("href");if(null==X||!g.isCustomLink(X)||!mxEvent.isTouchEvent(W)&&mxEvent.isPopupTrigger(W))m.apply(this,-arguments);else{if(!g.isEnabled()||null!=Q&&g.isCellLocked(Q.cell))g.customLinkClicked(X),g.getRubberband().reset();mxEvent.consume(W)}};this.editor.getOrCreateFilename=function(){var Q=c.defaultFilename,R=c.getCurrentFile();null!=R&&(Q=null!=R.getTitle()?R.getTitle():Q);return Q};var y=this.actions.get("print");y.setEnabled(!mxClient.IS_IOS||!navigator.standalone);y.visible=y.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,+mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,g=this.editor.graph,l=g.isEnabled;g.isEnabled=function(){return l.apply(this,arguments)&&!c.isLocked()};g.showLinkIcons=Editor.showLinkIcons;g.showTooltipIcons=Editor.showTooltipIcons;var n=this;g.editTooltip=function(R){null!=R&&n.actions.get("editTooltip").funct()};g.getLinkOverlayTooltip=function(R){if(Graph.isPageLink(R)&&null!=n.pages){var S=R.substring(R.indexOf(",")+1);S=n.getPageById(S);if(null!=S)return S.getName()||mxResources.get("pageWithNumber",+[mxUtils.indexOf(n.pages,S)+1])}return R};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(R){var S=R.getEvent();return null==R.getState()&&!mxEvent.isMouseEvent(S)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(S)&&(null==R.getState()||mxEvent.isControlDown(S)||mxEvent.isShiftDown(S))});g.cellEditor.editPlantUmlData=function(R,S,W){var X=JSON.parse(W);S=new SimpleTextareaDialog(c,X.data,function(Y){null!=Y&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(Y,+X.format,function(Z,aa,fa){c.spinner.stop();g.getModel().beginUpdate();try{if("txt"==X.format)g.labelChanged(R,"<pre>"+Z+"</pre>"),g.updateCellSize(R,!0);else{g.setCellStyles("image",c.convertDataUri(Z),[R]);var ia=g.model.getGeometry(R);null!=ia&&(ia=ia.clone(),ia.width=aa,ia.height=fa,g.cellsResized([R],[ia],!1))}g.setAttributeForCell(R,"plantUmlData",JSON.stringify({data:Y,format:X.format}))}finally{g.getModel().endUpdate()}},function(Z){c.handleError(Z)})});c.showDialog(S.container,640,420,!0,+!0,null,null,null,new mxRectangle(0,0,320,280));S.init()};g.cellEditor.editMermaidData=function(R,S,W){var X=JSON.parse(W);S=new SimpleTextareaDialog(c,X.data,function(Y){null!=Y&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(Y,X.config,function(Z,aa,fa){c.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",Z,[R]);var ia=g.model.getGeometry(R);null!=ia&&(ia=ia.clone(),ia.width=Math.max(ia.width,aa),ia.height=Math.max(ia.height,fa),g.cellsResized([R],+[ia],!1));g.setAttributeForCell(R,"mermaidData",JSON.stringify({data:Y,config:X.config},null,2))}finally{g.getModel().endUpdate()}},function(Z){c.handleError(Z)})});c.showDialog(S.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));S.init()};var v=g.cellEditor.startEditing;g.cellEditor.startEditing=function(R,S){try{var W=this.graph.getAttributeForCell(R,"plantUmlData");if(null!=W)this.editPlantUmlData(R,S,W);else if(W=this.graph.getAttributeForCell(R,"mermaidData"),null!=W&&window.isMermaidEnabled)this.editMermaidData(R,+S,W);else{var X=g.getCellStyle(R);"1"==mxUtils.getValue(X,"metaEdit","0")?c.showDataDialog(R):v.apply(this,arguments)}}catch(Y){c.handleError(Y)}};g.getLinkTitle=function(R){return c.getLinkTitle(R)};g.customLinkClicked=function(R,S){var W=!1;try{var X=this.getGraphBounds();c.handleCustomLink(R,S);W=!0;c.chromelessResize&&!X.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(S))}catch(Y){c.handleError(Y)}return W};var x=g.parseBackgroundImage;g.parseBackgroundImage=function(R){var S=+x.apply(this,arguments);null!=S&&null!=S.src&&Graph.isPageLink(S.src)&&(S={originalSrc:S.src});return S};var B=g.setBackgroundImage;g.setBackgroundImage=function(R){null!=R&&null!=R.originalSrc&&(R=c.createImageForPageLink(R.originalSrc,c.currentPage,this));B.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(R,S){R=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=R){var W=R.indexOf(",");if(0<W)for(R=R.substring(W+1),S=S.getProperty("patches"),W=0;W<S.length;W++)if(null!=S[W][EditorUi.DIFF_UPDATE]&&null!=S[W][EditorUi.DIFF_UPDATE][R]||null!=S[W][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(S[W][EditorUi.DIFF_REMOVE],R)){g.refreshBackgroundImage();break}}}));var C=g.getBackgroundImageObject;g.getBackgroundImageObject=function(R,S,W){var X=C.apply(this,arguments);+null!=X&&null!=X.originalSrc&&(X=S?c.createImageForPageLink(X.originalSrc,W,null,!0):{src:X.originalSrc});return X};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 G=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(R){R=+null!=R?R:"";"1"==urlParams.dev&&(R+=(0<R.length?"&":"?")+"dev=1");"1"==urlParams.test&&(R+=(0<R.length?"&":"?")+"test=1");return G.apply(this,arguments)};var N=g.addClickHandler;g.addClickHandler=function(R,S,W){var X=S;S=function(Y,Z,aa){if(null==Z){var fa=mxEvent.getSource(Y);"a"==fa.nodeName.toLowerCase()&&(Z=fa.getAttribute("href"))}null!=Z&&g.isCustomLink(Z)&&(mxEvent.isTouchEvent(Y)||!mxEvent.isPopupTrigger(Y))&&g.customLinkClicked(Z,aa)&&mxEvent.consume(Y);null!=X&&X(Y,Z,aa)};N.call(this,+R,S,W)};q.apply(this,arguments);this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var J=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(R,S,W){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(R,["zoomIn","zoomOut","-"],null,W);if(Editor.passiveScroll&&null!=W){var X=mxUtils.convertPoint(g.container,mxEvent.getClientX(W),mxEvent.getClientY(W));g._contextMenuPoint=new mxPoint(g.snap(X.x/g.view.scale-g.view.translate.x),+g.snap(X.y/g.view.scale-g.view.translate.y));g._contextMenuScreenPoint=mxUtils.convertPoint(g.container,mxEvent.getClientX(W),mxEvent.getClientY(W))}g.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",R,null),R.addSeparator());J.apply(this,arguments);g.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(R,["-","addToScratchpad"],null,W);g.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(R,["-","exitGroup","home"],null,W)};+var T=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(R,S,W){if(c.editor.graph.isSelectionEmpty())T.apply(this,arguments),c.menus.addMenuItems(R,["copyAsImage","copyAsSvg"],null,W);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(R,S,W):this.addPopupMenuArrangeItems(R,S,W),this.addMenuItems(R,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,W),Editor.passiveScroll&&(1==g.getSelectionCount()?this.addMenuItems(R,["-","copyStyle","pasteStyle"],null,+W):this.addMenuItems(R,["-","pasteStyle"],null,W)),this.addMenuItems(R,["-"],null,W),this.isShowCellEditItems()||this.addPopupDeleteItem(R,S,W),this.addMenuItems(R,["lockUnlock","-"],null,W),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(S)&&g.isCellEditable(S)&&(this.addSubmenu("editCell",R,null,mxResources.get("edit")),R.addSeparator(),g.getModel().isEdge(S))){this.addSubmenu("line",R);var X=g.getModel().getGeometry(S);null!=X&&null!=X.points&&0<X.points.length&&this.addMenuItems(R,+["clearWaypoints"],null,W)}1==g.getSelectionCount()&&this.addMenuItems(R,["enterGroup"],null,W);X=c.getSelectionState();null!=X.mergeCell?this.addMenuItem(R,"mergeCells"):(1<X.style.colspan||1<X.style.rowspan)&&this.addMenuItem(R,"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}if(Editor.passiveScroll){var V=g.getCenterInsertPoint;g.getCenterInsertPoint=function(R){if(null!=this._contextMenuPoint){var S=this._contextMenuPoint;R=null!=R?R:new mxRectangle;return new mxPoint(g.snap(S.x-(R.width||0)/2),g.snap(S.y-(R.height||0)/2))}return V.apply(this,arguments)};var t=g.popupMenuHandler.hideMenu;g.popupMenuHandler.hideMenu=function(){t.apply(this,arguments);window.setTimeout(function(){g._contextMenuPoint=null;g._contextMenuScreenPoint=+null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var z=g.getExportVariables;g.getExportVariables=function(){var R=z.apply(this,arguments),S=c.getCurrentFile();null!=S&&(R.filename=S.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var W in c.fileVars)null==R[W]&&(R[W]=c.fileVars[W]);R.pagecount=null!=c.pages?c.pages.length:1;R.page=null!=c.currentPage?c.currentPage.getName():+"";R.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return R};var L=g.getGlobalVariable;g.getGlobalVariable=function(R){var S=c.getCurrentFile();if("filename"==R&&null!=S)return S.getTitle();if("page"==R&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==R)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==R)return null!=c.pages?c.pages.length:1;S=L.apply(this,arguments);null==S&&(c.updateFileVars(),+null!=c.fileVars&&(S=c.fileVars[R]));return S};var K=null,M=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var R=this.getCurrentFile(),S=null!=R&&null!=R.getTitle()?R.getTitle():this.defaultFilename;K!=S&&R==M&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());K=S;M=R}));var m=g.labelLinkClicked;g.labelLinkClicked=function(R,S,W){var X=S.getAttribute("href");if(null==X||!g.isCustomLink(X)||!mxEvent.isTouchEvent(W)&&mxEvent.isPopupTrigger(W))m.apply(this,+arguments);else{if(!g.isEnabled()||null!=R&&g.isCellLocked(R.cell))g.customLinkClicked(X),g.getRubberband().reset();mxEvent.consume(W)}};this.editor.getOrCreateFilename=function(){var R=c.defaultFilename,S=c.getCurrentFile();null!=S&&(R=null!=S.getTitle()?S.getTitle():R);return R};var y=this.actions.get("print");y.setEnabled(!mxClient.IS_IOS||!navigator.standalone);y.visible=y.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&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||g.addListener(mxEvent.ESCAPE,function(Q,R){null!=R&&g.isEnabled()&&!g.isEditing()&&null!=R.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),-this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(Q){var R=g.cellEditor.text2,W=null;null!=R&&(mxEvent.addListener(R,"dragleave",function(X){null!=W&&(W.parentNode.removeChild(W),W=null);X.stopPropagation();X.preventDefault()}),mxEvent.addListener(R,"dragover",mxUtils.bind(this,function(X){null==W&&(W=this.highlightElement(R));-X.stopPropagation();X.preventDefault()})),mxEvent.addListener(R,"drop",mxUtils.bind(this,function(X){null!=W&&(W.parentNode.removeChild(W),W=null);if(0<X.dataTransfer.files.length)this.importFiles(X.dataTransfer.files,0,0,this.maxImageSize,function(Z,ba,ea,ha,fa,la){g.insertImage(Z,fa,la)},function(){},function(Z){return"image/"==Z.type.substring(0,6)},function(Z){for(var ba=0;ba<Z.length;ba++)Z[ba]()},mxEvent.isControlDown(X));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")){var Y=-X.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Y)?this.loadImage(decodeURIComponent(Y),mxUtils.bind(this,function(Z){var ba=Math.max(1,Z.width);Z=Math.max(1,Z.height);var ea=this.maxImageSize;ea=Math.min(1,Math.min(ea/Math.max(1,ba)),ea/Math.max(1,Z));g.insertImage(decodeURIComponent(Y),ba*ea,Z*ea)})):document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")?document.execCommand("insertHTML",-!1,X.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"));X.stopPropagation();X.preventDefault()})))}));if(Editor.isSettingsEnabled()){y=this.editor.graph.view;var F=mxSettings.getUnit();y.setUnit(F);Editor.pageSizeUnit=F==mxConstants.METERS?mxConstants.MILLIMETERS:F;y.addListener("unitChanged",function(Q,R){Q=R.getProperty("unit");mxSettings.setUnit(Q);mxSettings.save();Editor.pageSizeUnit=-Q==mxConstants.METERS?mxConstants.MILLIMETERS:Q});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,y.unit);this.refresh()}if("1"==urlParams.styledev){y=document.getElementById("geFooter");null!=y&&(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)})),y.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(Q,R){0<this.editor.graph.getSelectionCount()?(Q=this.editor.graph.getSelectionCell(),-Q=this.editor.graph.getModel().getStyle(Q),this.styleInput.value=Q||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var N=this.isSelectionAllowed;this.isSelectionAllowed=function(Q){return mxEvent.getSource(Q)==this.styleInput?!0:N.apply(this,arguments)}}y=document.getElementById("geInfo");null!=y&&y.parentNode.removeChild(y);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var O=null;mxEvent.addListener(g.container,"dragleave",function(Q){g.isEnabled()&&-(null!=O&&(O.parentNode.removeChild(O),O=null),Q.stopPropagation(),Q.preventDefault())});mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(Q){null==O&&(O=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();Q.stopPropagation();Q.preventDefault()}));mxEvent.addListener(g.container,"drop",mxUtils.bind(this,function(Q){null!=O&&(O.parentNode.removeChild(O),O=null);if(g.isEnabled()){var R=mxUtils.convertPoint(g.container,mxEvent.getClientX(Q),mxEvent.getClientY(Q)),-W=Q.dataTransfer.files,X=g.view.translate,Y=g.view.scale,Z=R.x/Y-X.x,ba=R.y/Y-X.y;if(0<W.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(Q)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(W,!0)):(mxEvent.isAltDown(Q)&&(ba=Z=null),this.importFiles(W,Z,ba,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(Q),null,null,mxEvent.isShiftDown(Q),Q));else{mxEvent.isAltDown(Q)&&(ba=Z=0);var ea=0<=mxUtils.indexOf(Q.dataTransfer.types,"text/uri-list")?-Q.dataTransfer.getData("text/uri-list"):null;R=this.extractGraphModelFromEvent(Q,null!=this.pages);if(null!=R)g.setSelectionCells(this.importXml(R,Z,ba,!0));else if(0<=mxUtils.indexOf(Q.dataTransfer.types,"text/html")){var ha=Q.dataTransfer.getData("text/html");R=document.createElement("div");R.innerHTML=Graph.sanitizeHtml(ha);var fa=null;W=R.getElementsByTagName("img");null!=W&&1==W.length?(ha=W[0].getAttribute("src"),null==ha&&(ha=W[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ha)||-(fa=!0)):(W=R.getElementsByTagName("a"),null!=W&&1==W.length?ha=W[0].getAttribute("href"):(R=R.getElementsByTagName("pre"),null!=R&&1==R.length&&(ha=mxUtils.getTextContent(R[0]))));var la=!0,oa=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(ha,Z,ba,!0,fa,null,la,mxEvent.isControlDown(Q)))});fa&&null!=ha&&ha.length>this.resampleThreshold?this.confirmImageResize(function(pa){la=pa;oa()},mxEvent.isControlDown(Q)):oa()}else null!=ea&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ea)?this.loadImage(decodeURIComponent(ea),-mxUtils.bind(this,function(pa){var va=Math.max(1,pa.width);pa=Math.max(1,pa.height);var ta=this.maxImageSize;ta=Math.min(1,Math.min(ta/Math.max(1,va)),ta/Math.max(1,pa));g.setSelectionCell(g.insertVertex(null,null,"",Z,ba,va*ta,pa*ta,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ea+";"))}),mxUtils.bind(this,function(pa){g.setSelectionCells(this.insertTextAt(ea,Z,ba,!0))})):0<=mxUtils.indexOf(Q.dataTransfer.types,"text/plain")&&-g.setSelectionCells(this.insertTextAt(Q.dataTransfer.getData("text/plain"),Z,ba,!0))}}Q.stopPropagation();Q.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(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",-function(){mxClient.IS_SF&&g.view.validateBackground()});g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var Q=parseInt(this.div.offsetLeft),R=parseInt(this.div.offsetWidth),W=c.embedViewport.x+c.embedViewport.width,X=parseInt(this.div.offsetTop),Y=parseInt(this.div.offsetHeight),Z=c.embedViewport.y+c.embedViewport.height;-this.div.style.left=Math.max(c.embedViewport.x,Math.min(Q,W-R))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(X,Z-Y))+"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"}};var P=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(Q,R){P.call(this,Q,R);c.hideCurrentMenu()};var T=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(Q,-R){T.call(this,Q,R);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){y=Editor.currentTheme;if("simple"==y||"sketch"==y)this.doSetCurrentTheme(y,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,F<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==y&&F<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==y&&(this.lastWindowWidth=F)),this.fireEvent(new mxEventObject("themeInitialized"));-"kennedy"==y&&(F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,F<Editor.smallScreenWidth&&(this.formatWidth=0),F<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=F)}y=!1;if(null!=urlParams.dark)y=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)y="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||y&&"auto"!=mxSettings.settings.darkMode||(y=mxSettings.settings.darkMode);"auto"==y&&this.isAutoDarkModeSupported()&&-(y=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof y?"1"==y:y);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(Q){this.isAutoDarkMode()&&this.setDarkMode(Q.matches)}))}catch(Q){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);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(Q,R){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;-screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var u=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?-this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));g=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}u.apply(this,arguments);-null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,n=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(D),mxEvent.getClientY(D)),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 x=null,B=null,C=null,H=null;mxEvent.addGestureListeners(v,mxUtils.bind(this,function(D){H=parseInt(this.diagramContainer.style.height);B=mxEvent.getClientY(D);n.popupMenuHandler.hideMenu();-mxEvent.consume(D)}));v=v.cloneNode(!1);v.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(v);this.rightResizer=v;mxEvent.addGestureListeners(v,mxUtils.bind(this,function(D){C=parseInt(this.diagramContainer.style.width);x=mxEvent.getClientX(D);n.popupMenuHandler.hideMenu();mxEvent.consume(D)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(D){var U=!1;null!=x&&(this.diagramContainer.style.width=Math.max(20,C+mxEvent.getClientX(D)-x)+"px",U=!0);null!=-B&&(this.diagramContainer.style.height=Math.max(20,H+mxEvent.getClientY(D)-B)+"px",U=!0);U&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(D){null==x&&null==B||mxEvent.consume(D);B=x=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";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(D){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(D){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";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete",-"off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height=-"1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.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(x){var B=mxEvent.getSource(x);null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==B.nodeName||"TEXTAREA"==B.nodeName&&B!==this.typingShim||"true"==B.contentEditable||224!=x.keyCode&&(mxClient.IS_MAC||-17!=x.keyCode)&&(!mxClient.IS_MAC||91!=x.keyCode&&93!=x.keyCode)||n||(l.style.left=g.container.scrollLeft+10+"px",l.style.top=g.container.scrollTop+10+"px",x=g.container.scrollLeft,B=g.container.scrollTop,g.container.appendChild(l),n=!0,l.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=x,g.container.scrollTop=B)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(x){var B=x.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=B&&17!=B&&91!=B&&93!=-B||(n=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(x){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l),c()}catch(B){this.handleError(B)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(x){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l,!0),c()}catch(B){this.handleError(B)}}));mxEvent.addListener(l,"paste",-mxUtils.bind(this,function(x){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=x.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(x,l,!0,!0)),!mxEvent.isConsumed(x)){var B=g.container.scrollLeft,C=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{g.container.scrollLeft=B,g.container.scrollTop=C,Graph.removePasteFormatting(l.firstChild),this.pasteCells(x,l,!1,!0)}catch(H){this.handleError(H)}}),0)}}catch(H){this.handleError(H)}}),-!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(x){return mxEvent.getSource(x)==l?!0:v.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,g){mxSettings.setUi(c);(g=this.doSetCurrentTheme(c)||g)||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,g){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":-"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||g)g=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(g);return l};EditorUi.prototype.saveScrollState=function(c){var g=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,-n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,n-=this.embedViewport.y):(l+=this.embedViewport.x,n+=this.embedViewport.y));g={x:l,y:n,tx:g.x,ty:g.y};c&&(g.boundingRect=this.diagramContainer.getBoundingClientRect());return g};EditorUi.prototype.restoreScrollState=function(c){var g=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x--n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*g;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*g};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var g=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||g||-(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var n=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;g=null!=n&&null!=n.getAttribute("class");if(!g&&null!=n){n=n.getAttribute("title");var v=this.getCurrentFile();v=null!=v?v.savingStatusKey:DrawioFile.prototype.savingStatusKey;n==mxResources.get(v)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+-mxUtils.htmlEntities(mxResources.get(v))+'..."src="'+Editor.tailSpin+'"></div>',g=!0)}this.statusContainer.style.display="none";n=32>=c.clientWidth;c.style.visibility=n&&""==this.editor.getStatus()?"hidden":"";if(n||g)this.statusContainer.style.display="",g=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};-EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,-this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),-this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&-(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),-this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,g,l){var n=this.threshold,v=c<=n;c=c+l.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-n;var x=g<=n;g=g+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||-document.body.clientHeight)-n;return v&&x?"top-left":c&&x?"top-right":v&&g?"bottom-left":c&&g?"bottom-right":v?"left":c?"right":x?"top":g?"bottom":null},dock:function(c,g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,v=parseInt(c.div.style.width),x=parseInt(c.div.style.height),B=c.getX(),C=c.getY();c.dockState=g;c.div.classList.add("mxWindowDocked");var H=0<=g.indexOf("right"),-D=0<=g.indexOf("bottom");0<=g.indexOf("left")?B=0:0<=g.indexOf("right")&&(B=l-v);0<=g.indexOf("top")?C=0:0<=g.indexOf("bottom")&&(C=n-x);H||(H=B+v/2>l/2);D||(D=C+x/2>n/2);c._dockAnchorRight=H;c._dockAnchorBottom=D;c._dockOffsetX=H?l-B-v:B;c._dockOffsetY=D?n-C-x:C;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",g))},undock:function(c){var g=c.dockState;if(null!=g){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");-c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",g))}},pinToEdge:function(c){var g=c.dockState;if(null!=g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,v=parseInt(c.div.style.width),x=parseInt(c.div.style.height);var B=c._dockAnchorRight?l-v-(c._dockOffsetX||0):-c._dockOffsetX||0;var C=c._dockAnchorBottom?n-x-(c._dockOffsetY||0):c._dockOffsetY||0;0<=g.indexOf("left")?B=0:0<=g.indexOf("right")&&(B=l-v);0<=g.indexOf("top")?C=0:0<=g.indexOf("bottom")&&(C=n-x);B=Math.max(0,Math.min(B,l-v));C=Math.max(0,Math.min(C,n-x));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,B,C);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,g){null==this.previewElement&&(this.previewElement=-document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,v=this.previewElement,x=g.div.offsetWidth,B=g.div.offsetHeight,C=g.getX();g=g.getY();0<=c.indexOf("left")?C=0:0<=c.indexOf("right")&&(C=l-x);0<=c.indexOf("top")?g=0:0<=c.indexOf("bottom")&&(g=n-B);C=Math.max(0,-Math.min(C,l-x));g=Math.max(0,Math.min(g,n-B));v.style.display="block";v.style.left=C+"px";v.style.top=g+"px";v.style.width=x+"px";v.style.height=B+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var g=0;g<this.windows.length;g++)if(this.windows[g]===c){this.windows.splice(g,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),-this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var A=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,g,l){A.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var n=c.window;null==this.dockManager&&this.createDockManager();var v=this.dockManager,x=!1,B=null,C=n.setLocation;n.setLocation=-function(U,S){(null==this.dockState||this._undocking||this._relayouting)&&C.call(this,U,S)};var H=n.setSize;n.setSize=function(U,S){null==this.dockState&&H.call(this,U,S)};n.addListener(mxEvent.MOVE_START,function(U,S){x=!0;B=null;null!=n.dockState&&(n._undocking=!0,v.undock(n),n._undocking=!1)});n.addListener(mxEvent.MOVE,function(U,S){x&&(U=v.getDockZone(n.getX(),n.getY(),n.div),U!=B&&(B=U,null!=U?v.showPreview(U,n):v.hidePreview()))});n.addListener(mxEvent.MOVE_END,function(U,S){x=!1;v.hidePreview();-null!=B&&v.dock(n,B);B=null});n.addListener(mxEvent.NORMALIZE,function(U,S){null!=n.dockState&&v.pinToEdge(n)});n.addListener(mxEvent.MAXIMIZE,function(U,S){null!=n.dockState&&(n._undocking=!0,v.undock(n),n._undocking=!1)});n.addListener(mxEvent.SHOW,function(U,S){null!=n.dockState&&v.pinToEdge(n)});var D=c.destroy;c.destroy=function(){v.removeWindow(n);D.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var g=this.editor.graph;g.defaultEdgeLength=Graph.prototype.defaultEdgeLength;-g.defaultGridEnabled=Graph.prototype.defaultGridEnabled;g.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)g.defaultEdgeLength=120;null==urlParams.grid&&(g.defaultGridEnabled=!1);null==urlParams.pv&&(g.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=-function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var g=this.getCurrentFile();null!=g&&(g.invalidChecksum?c=mxResources.get("error")+-": "+mxResources.get("checksum"):null==g.sync||g.sync.enabled&&g.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==g.sync||g.sync.isConnected()?g.isRealtimeEnabled()&&g.isRealtimeSupported()&&1<g.getRealtimeState()&&(c=g.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=-function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};-EditorUi.prototype.createMenu=function(c,g,l,n){l=null!=l?l:"geButton";var v=this.menus.get(c);n=this.menubar.addMenu(mxResources.get(c),v.funct,null,n);n.className=l;n.setAttribute("title",mxResources.get(c));this.menus.menuCreated(v,n,l);null!=g&&(n.style.backgroundImage="url("+g+")",n.innerText="");return n};EditorUi.prototype.addButton=function(c,g,l,n){c=this.createToolbarButton(c,g,l);n=null!=n?n:this.container;n.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,g,l){var n=-document.createElement("a");n.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(n.style.backgroundImage="url("+c+")");null!=g&&n.setAttribute("title",g);null!=l&&mxEvent.addListener(n,"click",function(v){"disabled"!=n.getAttribute("disabled")&&l(v);mxEvent.consume(v)});mxEvent.preventDefault(n);return n};EditorUi.prototype.createMenuItem=function(c,g,l){var n=this.actions.get(c),v=null!=n?n.funct:null,x=this.createToolbarButton(g,mxResources.get(c)+(null!=n&&null!=n.shortcut?" ("+n.shortcut+-")":""),v);null==n||l||(c=function(){n.isEnabled()?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),n.addListener("stateChanged",c),c());return x};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,g=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),l="1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=-new WrapperWindow(this,mxResources.get("format"),g,60,240,l,mxUtils.bind(this,function(x){x.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var n=this.formatWindow.window.toggleMinimized,v=240;this.formatWindow.window.toggleMinimized=function(){n.apply(this,arguments);this.minimized?(v=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width=-"140px",this.div.style.left=parseInt(this.div.style.left)+v-140+"px"):(this.div.style.width=v+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-v+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(x){mxEvent.getSource(x)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,-80);"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,B=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>x||690>B)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var J=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=-function(c){var g=this.formatWindow;null!=g?g.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):J.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,g){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var n=this.hsplitPosition,v=mxUtils.bind(this,function(){this.hsplitPosition=x;this.refresh();g||(this.diagramContainer.scrollLeft-=n-this.hsplitPosition)}),x=c?l:0,B=-Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==x?"translateX(0)":"translateX(-100%)");0!=x&&v();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==x?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+B+"s 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==x&&v();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*B)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var I=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;-return null!=c?c.window.isVisible():I.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var g=mxUtils.bind(this,function(B,C){var H=this.menus.get(B);B=this.createMenuElement(C,mxUtils.bind(this,function(){H.funct.apply(this,arguments)}));B.setAttribute("title",C);B.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";B.className="geButton";c.parentNode.appendChild(B);return B});if(Editor.enableCustomLibraries&&("1"!=-urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),-c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var l=g("newLibrary","");l.style.left="0px";l.style.right="50%";var n=document.createElement("span");l.appendChild(n);var v=g("openLibraryFrom","");v.style.borderLeftWidth="1px";v.style.left="50%";v.style.right="0px";var x=document.createElement("span");v.appendChild(x);this.dependsOnLanguage(mxUtils.bind(this,function(){n.innerHTML="";mxUtils.write(n,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));-x.innerHTML="";mxUtils.write(x,mxResources.get("openLibraryFrom"));v.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=-new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-g)/2):56,c-6,g-6,mxUtils.bind(this,function(n){this.createShapesPanel(n)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=-function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var g=c;"auto"==c&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=-function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,g){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();-this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var g=-document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,n=g.getAttribute("media");(n="all"==n||"not all"!=n&&l)&&!c?g.setAttribute("media",l?"not all":"(forced-colors: active)"):!n&&c&&g.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);-mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-g.x;this.diagramContainer.scrollTop+=c.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||-Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),-null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,g){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),-this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,-l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left=-"0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var n=this.diagramContainer.getAttribute("data-bounds");if(null!=n){this.diagramContainer.removeAttribute("data-bounds");var v=n.split(" ");n=mxUtils.getDocumentSize();this.diagramContainer.style.top=v[0];this.diagramContainer.style.left=v[1];var x=parseInt(v[2]);v=parseInt(v[3]);x=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,-x):x,n.width-80);v=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,v):v,n.height-80);this.diagramContainer.style.width=x+"px";this.diagramContainer.style.height=v+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop--g.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=g.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight--this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;n="1"==urlParams.embedInline&&-Editor.passiveScroll;g.style.visibility=n?"hidden":"";c.style.visibility=n?"hidden":"";l.style.display=n?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&-null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle=-"none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing=-"8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch=-"1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=-mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(g=this.getPageById(c.substring(l+1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(g=this.getCustomLinkTitle(c));return g};EditorUi.prototype.getCustomLinkTitle=function(c){var g=mxResources.get("action");-if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(g=l.title)}catch(n){}return g};EditorUi.prototype.handleCustomLink=function(c,g){if(Graph.isPageLink(c))if(g=c.indexOf(","),c=this.getPageById(c.substring(g+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=-mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",-mxUtils.bind(this,function(g,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",-mxUtils.bind(this,function(g,l){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(g,l){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(g,l){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,l){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.writeImageToClipboard=function(c,g,l,n,v,x){n=null!=n?n:"image/png";var B=null==g||null==l?'<img src="'+c+'">':'<img src="'+c+'" width="'+g+'" height="'+l+'">',C={"text/html":new Blob([B],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(n)&&(C[n]=this.base64ToBlob(c.substring(c.indexOf(",")+1),n));var H=new ClipboardItem(C);navigator.clipboard.write([H]).then(v)["catch"](x);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",-[c],"w",g,"h",l,"type",n,"html",[B],"data",[C],"item",[H])};EditorUi.prototype.writeHtmlToClipboard=function(c,g){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](g)};EditorUi.prototype.writeTextToClipboard=function(c,g,l){navigator.clipboard.writeText(c)["catch"](g).then(function(){null!=l&&l()})};EditorUi.prototype.copySvg=function(c,g,l){try{if(null!=navigator.clipboard&&-"function"===typeof window.ClipboardItem){var n=this.editor.graph.getSvg(null,l,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);n.setAttribute("content",g);var v=Editor.createSvgDataUri(mxUtils.getXml(n)),x=parseInt(n.getAttribute("width")),B=parseInt(n.getAttribute("height"));this.writeImageToClipboard(v,x,B,"image/svg+xml",null,mxUtils.bind(this,function(C){this.handleError(C)}))}}catch(C){this.handleError(C)}};EditorUi.prototype.copyImage=function(c,g,l){try{l=null!=l?-l:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(n,v){try{this.spinner.stop();var x=this.createImageDataUri(n,g,"png"),B=Math.round(parseInt(v.getAttribute("width"))/l),C=Math.round(parseInt(v.getAttribute("height"))/l);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[g],"scale",[l]);this.writeImageToClipboard(x,B,C,"image/png",null,mxUtils.bind(this,-function(){if(this.isLocalFileSave()){var H=this.getBaseFilename(!1)+(null!=g?".drawio":"")+".png";this.saveLocalFile(x.substring(x.lastIndexOf(",")+1),H,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(H){this.handleError(H)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,l,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,g){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";else{var n=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),v=mxUtils.getXml(l.encodeCells(n));mxUtils.setTextContent(c,encodeURIComponent(v));g?(l.removeCells(n,!1),l.lastPasteXml=null):(l.lastPasteXml=v,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeClipboard){var g=this.editor.graph;-g.isSelectionEmpty()||(c=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),g=mxUtils.getXml(g.encodeCells(c)),navigator.clipboard.writeText(g))}return c};EditorUi.prototype.pasteXml=function(c,g,l,n,v,x){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[g],"compat",[l],"evt",[n],"html",[v],"pt",[x]);v=null!=v?v:!0;var B=this.editor.graph,C=null!=x?x:Editor.pasteAtMousePointer&&B.isMouseInsertPoint()?B.getInsertPoint():null;x=null;B.lastPasteXml==-c?null==C&&B.pasteCounter++:(B.lastPasteXml=c,B.pasteCounter=0);var H=B.pasteCounter*B.gridSize;if(l||this.isCompatibleString(c)){B.model.beginUpdate();try{if(x=this.importXml(c,H,H),null!=C){var D=B.getBoundingBoxFromGeometry(x,!0);if(null!=D){var U=Math.round(B.snap(C.x)),S=Math.round(B.snap(C.y));B.cellsMoved(x,U-D.x,S-D.y)}}}finally{B.model.endUpdate()}B.setSelectionCells(x)}else if(g&&1==B.getSelectionCount()){g=B.getStartEditingCell(B.getSelectionCell(),n);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&-"image"==B.getCurrentCellStyle(g)[mxConstants.STYLE_SHAPE])B.setCellStyles(mxConstants.STYLE_IMAGE,c,[g]);else{B.model.beginUpdate();try{B.labelChanged(g,c),Graph.isLink(c)&&B.setLinkForCell(g,c)}finally{B.model.endUpdate()}}B.setSelectionCell(g)}else C=null!=C?C:B.getInsertPoint(),B.isMouseInsertPoint()&&(H=0,B.lastPasteXml==c&&0<B.pasteCounter&&B.pasteCounter--),x=this.insertTextAt(c,C.x+H,C.y+H,v),B.setSelectionCells(x);B.isSelectionEmpty()||(B.scrollCellToVisible(B.getSelectionCell()),null!=this.hoverIcons&&-this.hoverIcons.update(B.view.getState(B.getSelectionCell())));return x};EditorUi.prototype.pasteCells=function(c,g,l,n){if(!mxEvent.isConsumed(c)){var v=c.clipboardData,x=this.editor.graph,B=!1,C=g;if(l&&null!=v&&v.getData){var H=v.getData("text/plain"),D=!1;if(null!=H&&0<H.length&&"%3CmxGraphModel%3E"==H.substring(0,18))try{var U=decodeURIComponent(H);this.isCompatibleString(U)&&(D=!0,H=U)}catch(M){}D=D?null:v.getData("text/html");null!=D&&0<D.length?(C=this.parseHtmlData(D),B="text/plain"!=C.getAttribute("data-type")):-null!=H&&0<H.length&&(C=document.createElement("div"),mxUtils.setTextContent(C,D))}H=C.getElementsByTagName("span");if(null!=H&&0<H.length&&"application/vnd.lucid.chart.objects"===H[0].getAttribute("data-lucid-type"))l=H[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(M){var m=this.editor.graph;m.lastPasteXml==M?m.pasteCounter++:(m.lastPasteXml=M,m.pasteCounter=0);var y=m.pasteCounter*m.gridSize;m.setSelectionCells(this.importXml(M,y,-y));m.scrollCellToVisible(m.getSelectionCell())}),mxUtils.bind(this,function(M){this.handleError(M)})),mxEvent.consume(c));else{var S=!1,V="";V=B?null!=C.textContent&&"<mxfile"==C.textContent.substring(0,7)&&"</mxfile>"==C.textContent.substring(C.textContent.length-9)||"<mxGraphModel"==C.textContent.substring(0,13)&&"</mxGraphModel>"==C.textContent.substring(C.textContent.length-15)?C.textContent.replace(/\u00a0/g," "):C.innerHTML:mxUtils.trim(null==C.innerText?mxUtils.getTextContent(C):C.innerText);-try{var t=V.lastIndexOf("%3E");0<=t&&t<V.length-3&&(V=V.substring(0,t+3))}catch(M){}try{H=C.getElementsByTagName("span"),(U=null!=H&&0<H.length?mxUtils.trim(decodeURIComponent(H[0].textContent)):decodeURIComponent(V))&&(this.isCompatibleString(U)||0==U.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(S=!0,V=U)}catch(M){}U=null;try{if(!S&&""==C.textContent)for(t=0;t<v.items.length;t++){var z=v.items[t];if("file"===z.kind){U=z.getAsFile();break}}}catch(M){}EditorUi.debug("EditorUi.pasteCells",-[this],"evt",[c],"realElt",[g.outerHTML],"elt",[C.outerHTML],"useEvent",l,"pasteAsLabel",n,"xml",[V],"compat",S,"asHtml",B,"data",v,"items",[v.items.length],"files",[v.files.length],"types",[JSON.stringify(v.types)],"blob",[U]);try{if(S||null==U)if(null!=V&&0<V.length){if(0==V.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var K=mxUtils.bind(this,function(){try{V=(new MiroImporter).importMiroJson(JSON.parse(V)),this.pasteXml(V,n,S,c)}catch(M){console.log("Miro import error:",M)}});-"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",K):K()}else this.pasteXml(V,n,S,c,B);mxEvent.consume(c)}else l||(x.lastPasteXml=null,x.pasteCounter=0);else{var L=x.getInsertPoint();this.importFiles([U],L.x,L.y,this.maxImageSize);mxEvent.consume(c)}}catch(M){this.handleError(M)}}}g.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var g=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&g.isMouseInsertPoint()&&(c=g.getInsertPoint());if(g.isEnabled()&&+!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||g.addListener(mxEvent.ESCAPE,function(R,S){null!=S&&g.isEnabled()&&!g.isEditing()&&null!=S.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),+this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(R){var S=g.cellEditor.text2,W=null;null!=S&&(mxEvent.addListener(S,"dragleave",function(X){null!=W&&(W.parentNode.removeChild(W),W=null);X.stopPropagation();X.preventDefault()}),mxEvent.addListener(S,"dragover",mxUtils.bind(this,function(X){null==W&&(W=this.highlightElement(S));+X.stopPropagation();X.preventDefault()})),mxEvent.addListener(S,"drop",mxUtils.bind(this,function(X){null!=W&&(W.parentNode.removeChild(W),W=null);if(0<X.dataTransfer.files.length)this.importFiles(X.dataTransfer.files,0,0,this.maxImageSize,function(Z,aa,fa,ia,ea,ma){g.insertImage(Z,ea,ma)},function(){},function(Z){return"image/"==Z.type.substring(0,6)},function(Z){for(var aa=0;aa<Z.length;aa++)Z[aa]()},mxEvent.isControlDown(X));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")){var Y=+X.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Y)?this.loadImage(decodeURIComponent(Y),mxUtils.bind(this,function(Z){var aa=Math.max(1,Z.width);Z=Math.max(1,Z.height);var fa=this.maxImageSize;fa=Math.min(1,Math.min(fa/Math.max(1,aa)),fa/Math.max(1,Z));g.insertImage(decodeURIComponent(Y),aa*fa,Z*fa)})):document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")?document.execCommand("insertHTML",+!1,X.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"));X.stopPropagation();X.preventDefault()})))}));if(Editor.isSettingsEnabled()){y=this.editor.graph.view;var E=mxSettings.getUnit();y.setUnit(E);Editor.pageSizeUnit=E==mxConstants.METERS?mxConstants.MILLIMETERS:E;y.addListener("unitChanged",function(R,S){R=S.getProperty("unit");mxSettings.setUnit(R);mxSettings.save();Editor.pageSizeUnit=+R==mxConstants.METERS?mxConstants.MILLIMETERS:R});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,y.unit);this.refresh()}if("1"==urlParams.styledev){y=document.getElementById("geFooter");null!=y&&(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)})),y.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(R,S){0<this.editor.graph.getSelectionCount()?(R=this.editor.graph.getSelectionCell(),+R=this.editor.graph.getModel().getStyle(R),this.styleInput.value=R||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var P=this.isSelectionAllowed;this.isSelectionAllowed=function(R){return mxEvent.getSource(R)==this.styleInput?!0:P.apply(this,arguments)}}y=document.getElementById("geInfo");null!=y&&y.parentNode.removeChild(y);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var O=null;mxEvent.addListener(g.container,"dragleave",function(R){g.isEnabled()&&+(null!=O&&(O.parentNode.removeChild(O),O=null),R.stopPropagation(),R.preventDefault())});mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(R){null==O&&(O=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();R.stopPropagation();R.preventDefault()}));mxEvent.addListener(g.container,"drop",mxUtils.bind(this,function(R){null!=O&&(O.parentNode.removeChild(O),O=null);if(g.isEnabled()){var S=mxUtils.convertPoint(g.container,mxEvent.getClientX(R),mxEvent.getClientY(R)),+W=R.dataTransfer.files,X=g.view.translate,Y=g.view.scale,Z=S.x/Y-X.x,aa=S.y/Y-X.y;if(0<W.length)if(S=this.isBlankFile()&&!this.canUndo(),X=1==W.length&&(EditorUi.isVisioFilename(W[0].name)||/(\.drawio)$/i.test(W[0].name)||/(\.xml)$/i.test(W[0].name)),"1"!=urlParams.embed&&S&&(X||mxEvent.isShiftDown(R))){this.fileLoaded(null,!0);var fa=mxUtils.bind(this,function(){this.editor.removeListener(fa);var ta=this.getCurrentFile();null!=ta&&ta.fileChanged()});this.editor.addListener("fileLoaded",fa);this.openFiles(W,+!0)}else mxEvent.isAltDown(R)&&(aa=Z=null),this.importFiles(W,Z,aa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(R),null,null,mxEvent.isShiftDown(R),R);else{mxEvent.isAltDown(R)&&(aa=Z=0);var ia=0<=mxUtils.indexOf(R.dataTransfer.types,"text/uri-list")?R.dataTransfer.getData("text/uri-list"):null;W=this.extractGraphModelFromEvent(R,null!=this.pages);if(null!=W)g.setSelectionCells(this.importXml(W,Z,aa,!0));else if(0<=mxUtils.indexOf(R.dataTransfer.types,"text/html")){var ea=R.dataTransfer.getData("text/html");+W=document.createElement("div");W.innerHTML=Graph.sanitizeHtml(ea);var ma=null;S=W.getElementsByTagName("img");null!=S&&1==S.length?(ea=S[0].getAttribute("src"),null==ea&&(ea=S[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ea)||(ma=!0)):(S=W.getElementsByTagName("a"),null!=S&&1==S.length?ea=S[0].getAttribute("href"):(W=W.getElementsByTagName("pre"),null!=W&&1==W.length&&(ea=mxUtils.getTextContent(W[0]))));var na=!0,ua=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(ea,+Z,aa,!0,ma,null,na,mxEvent.isControlDown(R)))});ma&&null!=ea&&ea.length>this.resampleThreshold?this.confirmImageResize(function(ta){na=ta;ua()},mxEvent.isControlDown(R)):ua()}else null!=ia&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ia)?this.loadImage(decodeURIComponent(ia),mxUtils.bind(this,function(ta){var sa=Math.max(1,ta.width);ta=Math.max(1,ta.height);var la=this.maxImageSize;la=Math.min(1,Math.min(la/Math.max(1,sa)),la/Math.max(1,ta));g.setSelectionCell(g.insertVertex(null,null,"",Z,aa,sa*la,ta*+la,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ia+";"))}),mxUtils.bind(this,function(ta){g.setSelectionCells(this.insertTextAt(ia,Z,aa,!0))})):0<=mxUtils.indexOf(R.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(R.dataTransfer.getData("text/plain"),Z,aa,!0))}}R.stopPropagation();R.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(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&g.view.validateBackground()});g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||+null==c.embedViewport)mxUtils.fit(this.div);else{var R=parseInt(this.div.offsetLeft),S=parseInt(this.div.offsetWidth),W=c.embedViewport.x+c.embedViewport.width,X=parseInt(this.div.offsetTop),Y=parseInt(this.div.offsetHeight),Z=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(R,W-S))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(X,Z-Y))+"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"}};var Q=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(R,S){Q.call(this,R,S);c.hideCurrentMenu()};var U=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(R,S){U.call(this,R,S);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){y=Editor.currentTheme;if("simple"==y||"sketch"==y)this.doSetCurrentTheme(y,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(E=window.innerWidth||+document.documentElement.clientWidth||document.body.clientWidth,E<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==y&&E<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==y&&(this.lastWindowWidth=E)),this.fireEvent(new mxEventObject("themeInitialized"));"kennedy"==y&&(E=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,E<Editor.smallScreenWidth&&(this.formatWidth=0),E<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=E)}y=+!1;if(null!=urlParams.dark)y=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)y="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||y&&"auto"!=mxSettings.settings.darkMode||(y=mxSettings.settings.darkMode);"auto"==y&&this.isAutoDarkModeSupported()&&(y=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof y?"1"==y:y);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",+mxUtils.bind(this,function(R){this.isAutoDarkMode()&&this.setDarkMode(R.matches)}))}catch(R){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);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&+this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(R,S){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var u=EditorUi.prototype.windowResized;+EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));g=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&+this.lastWindowWidth>=g&&c<g?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}u.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,n=this.editor.graph;l.style.transform=+"";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(N){mxEvent.getSource(N)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(N),mxEvent.getClientY(N)),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 x=null,B=null,C=null,G=null;mxEvent.addGestureListeners(v,mxUtils.bind(this,function(N){G=parseInt(this.diagramContainer.style.height);B=mxEvent.getClientY(N);n.popupMenuHandler.hideMenu();mxEvent.consume(N)}));v=v.cloneNode(!1);v.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(v);this.rightResizer=v;mxEvent.addGestureListeners(v,mxUtils.bind(this,function(N){C=parseInt(this.diagramContainer.style.width);+x=mxEvent.getClientX(N);n.popupMenuHandler.hideMenu();mxEvent.consume(N)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(N){var J=!1;null!=x&&(this.diagramContainer.style.width=Math.max(20,C+mxEvent.getClientX(N)-x)+"px",J=!0);null!=B&&(this.diagramContainer.style.height=Math.max(20,G+mxEvent.getClientY(N)-B)+"px",J=!0);J&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),+"*"),this.inlineSizeChanged(),this.refresh())}),function(N){null==x&&null==B||mxEvent.consume(N);B=x=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";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(N){this.inlineSizeChanged();+Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(N){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";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=+function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position=+"absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.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(x){var B=mxEvent.getSource(x);+null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==B.nodeName||"TEXTAREA"==B.nodeName&&B!==this.typingShim||"true"==B.contentEditable||224!=x.keyCode&&(mxClient.IS_MAC||17!=x.keyCode)&&(!mxClient.IS_MAC||91!=x.keyCode&&93!=x.keyCode)||n||(l.style.left=g.container.scrollLeft+10+"px",l.style.top=g.container.scrollTop+10+"px",x=g.container.scrollLeft,B=g.container.scrollTop,g.container.appendChild(l),n=!0,l.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=+x,g.container.scrollTop=B)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(x){var B=x.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=B&&17!=B&&91!=B&&93!=B||(n=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(x){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l),c()}catch(B){this.handleError(B)}}));+mxEvent.addListener(l,"cut",mxUtils.bind(this,function(x){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l,!0),c()}catch(B){this.handleError(B)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(x){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=x.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(x,l,!0,!0)),!mxEvent.isConsumed(x)){var B=g.container.scrollLeft,C=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,+function(){try{g.container.scrollLeft=B,g.container.scrollTop=C,Graph.removePasteFormatting(l.firstChild),this.pasteCells(x,l,!1,!0)}catch(G){this.handleError(G)}}),0)}}catch(G){this.handleError(G)}}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(x){return mxEvent.getSource(x)==l?!0:v.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,g){mxSettings.setUi(c);(g=this.doSetCurrentTheme(c)||g)||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,g){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||g)g=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),+this.restoreScrollState(g);return l};EditorUi.prototype.saveScrollState=function(c){var g=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,n-=this.embedViewport.y):(l+=this.embedViewport.x,n+=this.embedViewport.y));g={x:l,y:n,tx:g.x,ty:g.y};c&&(g.boundingRect=this.diagramContainer.getBoundingClientRect());return g};EditorUi.prototype.restoreScrollState=function(c){var g=+this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*g;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*g};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var g=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&+(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||g||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var n=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;g=null!=n&&null!=n.getAttribute("class");if(!g&&null!=n){n=n.getAttribute("title");var v=this.getCurrentFile();+v=null!=v?v.savingStatusKey:DrawioFile.prototype.savingStatusKey;n==mxResources.get(v)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(v))+'..."src="'+Editor.tailSpin+'"></div>',g=!0)}this.statusContainer.style.display="none";n=32>=c.clientWidth;c.style.visibility=n&&""==this.editor.getStatus()?"hidden":"";if(n||g)this.statusContainer.style.display="",g=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=+0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=+function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),g=0;g<+c.length;g++)null!=c[g]&&c[g].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=+null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=+null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,g,l){var n=this.threshold,v=c<=n;c=c+l.offsetWidth>=(window.innerWidth||+document.documentElement.clientWidth||document.body.clientWidth)-n;var x=g<=n;g=g+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-n;return v&&x?"top-left":c&&x?"top-right":v&&g?"bottom-left":c&&g?"bottom-right":v?"left":c?"right":x?"top":g?"bottom":null},dock:function(c,g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,+v=parseInt(c.div.style.width),x=parseInt(c.div.style.height),B=c.getX(),C=c.getY();c.dockState=g;c.div.classList.add("mxWindowDocked");var G=0<=g.indexOf("right"),N=0<=g.indexOf("bottom");0<=g.indexOf("left")?B=0:0<=g.indexOf("right")&&(B=l-v);0<=g.indexOf("top")?C=0:0<=g.indexOf("bottom")&&(C=n-x);G||(G=B+v/2>l/2);N||(N=C+x/2>n/2);c._dockAnchorRight=G;c._dockAnchorBottom=N;c._dockOffsetX=G?l-B-v:B;c._dockOffsetY=N?n-C-x:C;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,+"side",g))},undock:function(c){var g=c.dockState;if(null!=g){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",g))}},pinToEdge:function(c){var g=c.dockState;if(null!=g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=+window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,v=parseInt(c.div.style.width),x=parseInt(c.div.style.height);var B=c._dockAnchorRight?l-v-(c._dockOffsetX||0):c._dockOffsetX||0;var C=c._dockAnchorBottom?n-x-(c._dockOffsetY||0):c._dockOffsetY||0;0<=g.indexOf("left")?B=0:0<=g.indexOf("right")&&(B=l-v);0<=g.indexOf("top")?C=0:0<=g.indexOf("bottom")&&(C=n-x);B=Math.max(0,Math.min(B,l-v));C=Math.max(0,Math.min(C,n-x));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,+B,C);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,g){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,v=this.previewElement,+x=g.div.offsetWidth,B=g.div.offsetHeight,C=g.getX();g=g.getY();0<=c.indexOf("left")?C=0:0<=c.indexOf("right")&&(C=l-x);0<=c.indexOf("top")?g=0:0<=c.indexOf("bottom")&&(g=n-B);C=Math.max(0,Math.min(C,l-x));g=Math.max(0,Math.min(g,n-B));v.style.display="block";v.style.left=C+"px";v.style.top=g+"px";v.style.width=x+"px";v.style.height=B+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var g=0;g<this.windows.length;g++)if(this.windows[g]===+c){this.windows.splice(g,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var A=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,g,l){A.apply(this,arguments);+if(EditorUi.windowed&&Editor.enableWindowDocking){var n=c.window;null==this.dockManager&&this.createDockManager();var v=this.dockManager,x=!1,B=null,C=n.setLocation;n.setLocation=function(J,T){(null==this.dockState||this._undocking||this._relayouting)&&C.call(this,J,T)};var G=n.setSize;n.setSize=function(J,T){null==this.dockState&&G.call(this,J,T)};n.addListener(mxEvent.MOVE_START,function(J,T){x=!0;B=null;null!=n.dockState&&(n._undocking=!0,v.undock(n),n._undocking=!1)});n.addListener(mxEvent.MOVE,+function(J,T){x&&(J=v.getDockZone(n.getX(),n.getY(),n.div),J!=B&&(B=J,null!=J?v.showPreview(J,n):v.hidePreview()))});n.addListener(mxEvent.MOVE_END,function(J,T){x=!1;v.hidePreview();null!=B&&v.dock(n,B);B=null});n.addListener(mxEvent.NORMALIZE,function(J,T){null!=n.dockState&&v.pinToEdge(n)});n.addListener(mxEvent.MAXIMIZE,function(J,T){null!=n.dockState&&(n._undocking=!0,v.undock(n),n._undocking=!1)});n.addListener(mxEvent.SHOW,function(J,T){null!=n.dockState&&v.pinToEdge(n)});var N=c.destroy;c.destroy=+function(){v.removeWindow(n);N.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var g=this.editor.graph;g.defaultEdgeLength=Graph.prototype.defaultEdgeLength;g.defaultGridEnabled=Graph.prototype.defaultGridEnabled;g.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)g.defaultEdgeLength=+120;null==urlParams.grid&&(g.defaultGridEnabled=!1);null==urlParams.pv&&(g.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=+function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var g=this.getCurrentFile();null!=g&&(g.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==g.sync||g.sync.enabled&&g.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==g.sync||g.sync.isConnected()?g.isRealtimeEnabled()&&g.isRealtimeSupported()&&1<g.getRealtimeState()&&(c=g.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:+mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);+null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,g,l,n){l=null!=l?l:"geButton";var v=this.menus.get(c);n=this.menubar.addMenu(mxResources.get(c),v.funct,null,n);n.className=l;n.setAttribute("title",mxResources.get(c));this.menus.menuCreated(v,n,l);null!=g&&(n.style.backgroundImage="url("+g+")",n.innerText="");return n};EditorUi.prototype.addButton=function(c,g,+l,n){c=this.createToolbarButton(c,g,l);n=null!=n?n:this.container;n.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,g,l){var n=document.createElement("a");n.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(n.style.backgroundImage="url("+c+")");null!=g&&n.setAttribute("title",g);null!=l&&mxEvent.addListener(n,"click",function(v){"disabled"!=n.getAttribute("disabled")&&l(v);mxEvent.consume(v)});mxEvent.preventDefault(n);return n};EditorUi.prototype.createMenuItem=+function(c,g,l){var n=this.actions.get(c),v=null!=n?n.funct:null,x=this.createToolbarButton(g,mxResources.get(c)+(null!=n&&null!=n.shortcut?" ("+n.shortcut+")":""),v);null==n||l||(c=function(){n.isEnabled()?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),n.addListener("stateChanged",c),c());return x};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,g=Math.max(10,this.diagramContainer.parentNode.clientWidth-+256),l="1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),g,60,240,l,mxUtils.bind(this,function(x){x.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var n=this.formatWindow.window.toggleMinimized,v=240;this.formatWindow.window.toggleMinimized=+function(){n.apply(this,arguments);this.minimized?(v=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+v-140+"px"):(this.div.style.width=v+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-v+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(x){mxEvent.getSource(x)==this.formatWindow.window.title&&+this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,B=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>x||690>B)&&this.formatWindow.window.toggleMinimized()}),+0)):this.formatWindow.window.setVisible(!1)}};var I=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var g=this.formatWindow;null!=g?g.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):I.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,g){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var n=this.hsplitPosition,v=mxUtils.bind(this,+function(){this.hsplitPosition=x;this.refresh();g||(this.diagramContainer.scrollLeft-=n-this.hsplitPosition)}),x=c?l:0,B=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==x?"translateX(0)":"translateX(-100%)");0!=x&&v();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==x?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+B+"s 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==x&&v();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*B)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};+var H=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():H.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var g=mxUtils.bind(this,function(B,C){var G=this.menus.get(B);B=this.createMenuElement(C,mxUtils.bind(this,function(){G.funct.apply(this,arguments)}));B.setAttribute("title",C);B.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";+B.className="geButton";c.parentNode.appendChild(B);return B});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),+g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var l=g("newLibrary","");l.style.left="0px";l.style.right="50%";var n=document.createElement("span");l.appendChild(n);var v=g("openLibraryFrom","");v.style.borderLeftWidth="1px";v.style.left="50%";v.style.right="0px";var x=document.createElement("span");v.appendChild(x);this.dependsOnLanguage(mxUtils.bind(this,+function(){n.innerHTML="";mxUtils.write(n,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));x.innerHTML="";mxUtils.write(x,mxResources.get("openLibraryFrom"));v.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,+650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-g)/2):56,c-6,g-6,mxUtils.bind(this,function(n){this.createShapesPanel(n)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,+0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var g=c;"auto"==c&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==+urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,g){this.dependsOnLanguage(mxUtils.bind(this,+function(){c.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&+window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var g=document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,n=g.getAttribute("media");(n="all"==n||"not all"!=n&&l)&&!c?g.setAttribute("media",l?"not all":"(forced-colors: active)"):!n&&c&&g.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};+EditorUi.prototype.setRulerVisible=function(c){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-g.x;this.diagramContainer.scrollTop+=c.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=+window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),+c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,g){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=+c,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=+function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),+this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var n=this.diagramContainer.getAttribute("data-bounds");if(null!=n){this.diagramContainer.removeAttribute("data-bounds");var v=n.split(" ");n=mxUtils.getDocumentSize();this.diagramContainer.style.top=v[0];this.diagramContainer.style.left=v[1];var x=parseInt(v[2]);+v=parseInt(v[3]);x=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,x):x,n.width-80);v=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,v):v,n.height-80);this.diagramContainer.style.width=x+"px";this.diagramContainer.style.height=v+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=+this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop-g.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=g.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/+2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":+"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;n="1"==urlParams.embedInline&&Editor.passiveScroll;g.style.visibility=n?"hidden":"";c.style.visibility=n?"hidden":"";l.style.display=n?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=+mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||+null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize=+"14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=+Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==+Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(g=this.getPageById(c.substring(l+1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,+5)&&(g=this.getCustomLinkTitle(c));return g};EditorUi.prototype.getCustomLinkTitle=function(c){var g=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(g=l.title)}catch(n){}return g};EditorUi.prototype.handleCustomLink=function(c,g){if(Graph.isPageLink(c))if(g=c.indexOf(","),c=this.getPageById(c.substring(g+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,+g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged",+"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(g,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));+c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(g,l){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(g,l){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(g,l){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,l){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.writeImageToClipboard=function(c,g,l,n,v,x){n=null!=n?n:"image/png";var B=null==g||null==l?'<img src="'+c+'">':'<img src="'+c+'" width="'+g+'" height="'+l+'">',C={"text/html":new Blob([B],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(n)&&(C[n]=this.base64ToBlob(c.substring(c.indexOf(",")+1),n));var G=new ClipboardItem(C);+navigator.clipboard.write([G]).then(v)["catch"](x);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",g,"h",l,"type",n,"html",[B],"data",[C],"item",[G])};EditorUi.prototype.writeHtmlToClipboard=function(c,g){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](g)};EditorUi.prototype.writeTextToClipboard=function(c,g,l){navigator.clipboard.writeText(c)["catch"](g).then(function(){null!=+l&&l()})};EditorUi.prototype.copySvg=function(c,g,l){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var n=this.editor.graph.getSvg(null,l,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);null!=g&&n.setAttribute("content",g);var v=Editor.createSvgDataUri(mxUtils.getXml(n)),x=parseInt(n.getAttribute("width")),B=parseInt(n.getAttribute("height"));this.writeImageToClipboard(v,x,B,"image/svg+xml",null,mxUtils.bind(this,function(C){this.handleError(C)}))}}catch(C){this.handleError(C)}};+EditorUi.prototype.copyImage=function(c,g,l){try{l=null!=l?l:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(n,v){try{this.spinner.stop();var x=this.createImageDataUri(n,g,"png"),B=Math.round(parseInt(v.getAttribute("width"))/l),C=Math.round(parseInt(v.getAttribute("height"))/l);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[g],"scale",[l]);this.writeImageToClipboard(x,+B,C,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var G=this.getBaseFilename(!1)+(null!=g?".drawio":"")+".png";this.saveLocalFile(x.substring(x.lastIndexOf(",")+1),G,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(G){this.handleError(G)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,l,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,g){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";else{var n=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),v=mxUtils.getXml(l.encodeCells(n));mxUtils.setTextContent(c,encodeURIComponent(v));g?(l.removeCells(n,!1),l.lastPasteXml=null):(l.lastPasteXml=v,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=+null;if(Editor.enableNativeClipboard){var g=this.editor.graph;g.isSelectionEmpty()||(c=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),g=mxUtils.getXml(g.encodeCells(c)),navigator.clipboard.writeText(g))}return c};EditorUi.prototype.pasteXml=function(c,g,l,n,v,x){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[g],"compat",[l],"evt",[n],"html",[v],"pt",[x]);v=null!=v?v:!0;var B=this.editor.graph,C=null!=x?x:Editor.pasteAtMousePointer&&B.isMouseInsertPoint()?+B.getInsertPoint():null;x=null;B.lastPasteXml==c?null==C&&B.pasteCounter++:(B.lastPasteXml=c,B.pasteCounter=0);var G=B.pasteCounter*B.gridSize;if(l||this.isCompatibleString(c)){B.model.beginUpdate();try{if(x=this.importXml(c,G,G),null!=C){var N=B.getBoundingBoxFromGeometry(x,!0);if(null!=N){var J=Math.round(B.snap(C.x)),T=Math.round(B.snap(C.y));B.cellsMoved(x,J-N.x,T-N.y)}}}finally{B.model.endUpdate()}B.setSelectionCells(x)}else if(g&&1==B.getSelectionCount()){g=B.getStartEditingCell(B.getSelectionCell(),+n);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==B.getCurrentCellStyle(g)[mxConstants.STYLE_SHAPE])B.setCellStyles(mxConstants.STYLE_IMAGE,c,[g]);else{B.model.beginUpdate();try{B.labelChanged(g,c),Graph.isLink(c)&&B.setLinkForCell(g,c)}finally{B.model.endUpdate()}}B.setSelectionCell(g)}else C=null!=C?C:B.getInsertPoint(),B.isMouseInsertPoint()&&(G=0,B.lastPasteXml==c&&0<B.pasteCounter&&B.pasteCounter--),x=this.insertTextAt(c,C.x+G,C.y+G,v),B.setSelectionCells(x);B.isSelectionEmpty()||(B.scrollCellToVisible(B.getSelectionCell()),+null!=this.hoverIcons&&this.hoverIcons.update(B.view.getState(B.getSelectionCell())));return x};EditorUi.prototype.pasteCells=function(c,g,l,n){if(!mxEvent.isConsumed(c)){var v=c.clipboardData,x=this.editor.graph,B=!1,C=g;if(l&&null!=v&&v.getData){var G=v.getData("text/plain"),N=!1;if(null!=G&&0<G.length&&"%3CmxGraphModel%3E"==G.substring(0,18))try{var J=decodeURIComponent(G);this.isCompatibleString(J)&&(N=!0,G=J)}catch(M){}N=N?null:v.getData("text/html");null!=N&&0<N.length?(C=this.parseHtmlData(N),+B="text/plain"!=C.getAttribute("data-type")):null!=G&&0<G.length&&(C=document.createElement("div"),mxUtils.setTextContent(C,N))}G=C.getElementsByTagName("span");if(null!=G&&0<G.length&&"application/vnd.lucid.chart.objects"===G[0].getAttribute("data-lucid-type"))l=G[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(M){var m=this.editor.graph;m.lastPasteXml==M?m.pasteCounter++:(m.lastPasteXml=M,m.pasteCounter=0);var y=m.pasteCounter*m.gridSize;+m.setSelectionCells(this.importXml(M,y,y));m.scrollCellToVisible(m.getSelectionCell())}),mxUtils.bind(this,function(M){this.handleError(M)})),mxEvent.consume(c));else{var T=!1,V="";V=B?null!=C.textContent&&"<mxfile"==C.textContent.substring(0,7)&&"</mxfile>"==C.textContent.substring(C.textContent.length-9)||"<mxGraphModel"==C.textContent.substring(0,13)&&"</mxGraphModel>"==C.textContent.substring(C.textContent.length-15)?C.textContent.replace(/\u00a0/g," "):C.innerHTML:mxUtils.trim(null==C.innerText?+mxUtils.getTextContent(C):C.innerText);try{var t=V.lastIndexOf("%3E");0<=t&&t<V.length-3&&(V=V.substring(0,t+3))}catch(M){}try{G=C.getElementsByTagName("span"),(J=null!=G&&0<G.length?mxUtils.trim(decodeURIComponent(G[0].textContent)):decodeURIComponent(V))&&(this.isCompatibleString(J)||0==J.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(T=!0,V=J)}catch(M){}J=null;try{if(!T&&""==C.textContent)for(t=0;t<v.items.length;t++){var z=v.items[t];if("file"===z.kind){J=z.getAsFile();break}}}catch(M){}EditorUi.debug("EditorUi.pasteCells",+[this],"evt",[c],"realElt",[g.outerHTML],"elt",[C.outerHTML],"useEvent",l,"pasteAsLabel",n,"xml",[V],"compat",T,"asHtml",B,"data",v,"items",[v.items.length],"files",[v.files.length],"types",[JSON.stringify(v.types)],"blob",[J]);try{if(T||null==J)if(null!=V&&0<V.length){if(0==V.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var K=mxUtils.bind(this,function(){try{V=(new MiroImporter).importMiroJson(JSON.parse(V)),this.pasteXml(V,n,T,c)}catch(M){console.log("Miro import error:",M)}});+"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",K):K()}else this.pasteXml(V,n,T,c,B);mxEvent.consume(c)}else l||(x.lastPasteXml=null,x.pasteCounter=0);else{var L=x.getInsertPoint();this.importFiles([J],L.x,L.y,this.maxImageSize);mxEvent.consume(c)}}catch(M){this.handleError(M)}}}g.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var g=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&g.isMouseInsertPoint()&&(c=g.getInsertPoint());if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(l,n,v,x,B){if(null!=l){g.getModel().beginUpdate();try{this.pasteXml(l,!0,null,null,null,c)}finally{g.getModel().endUpdate()}}else l=null!=n?n:null!=v?v:x,null!=l?(c=null!=c?c:g.getInsertPoint(),this.importFiles([l],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(l){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var g=this.editor.graph;g.getModel().beginUpdate();try{g.moveCellsTo(mxClipboard.paste(g),c)}finally{g.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(g){for(var l=null!=g.clipboardData?g.clipboardData:g.originalEvent.clipboardData,n=!1,v=null,x=0;x<l.types.length;x++)if("text/"===l.types[x].substring(0,5)){n=!0;break}for(x=0;x<l.items.length;x++){var B=l.items[x];if("file"===B.kind){v=-B.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[g],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",n,"file",[v],"editing",c.isEditing());var C=mxUtils.bind(this,function(){try{if(!n&&null!=v){if(c.isEditing())this.importFiles([v],0,0,this.maxImageSize,function(D,U,S,V,t,z){c.insertImage(D,t,z)},function(){},function(D){return"image/"==D.type.substring(0,6)},function(D){for(var U=0;U<D.length;U++)D[U]()});-else{var H=this.editor.graph.getInsertPoint();this.importFiles([v],H.x,H.y,this.maxImageSize)}mxEvent.consume(g)}}catch(D){}});if(!mxEvent.isConsumed(g)&&!n)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(H){this.readTypeFromClipboardData(H,"image/svg+xml",mxUtils.bind(this,function(D){if(null!=D){D=new Blob([D],{type:"image/svg+xml"});var U=this.editor.graph.getInsertPoint();this.importFiles([D],U.x,U.y,this.maxImageSize)}else C()}),"image")}))["catch"](C);+B.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[g],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",n,"file",[v],"editing",c.isEditing());var C=mxUtils.bind(this,function(){try{if(!n&&null!=v){if(c.isEditing())this.importFiles([v],0,0,this.maxImageSize,function(N,J,T,V,t,z){c.insertImage(N,t,z)},function(){},function(N){return"image/"==N.type.substring(0,6)},function(N){for(var J=0;J<N.length;J++)N[J]()});+else{var G=this.editor.graph.getInsertPoint();this.importFiles([v],G.x,G.y,this.maxImageSize)}mxEvent.consume(g)}}catch(N){}});if(!mxEvent.isConsumed(g)&&!n)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(G){this.readTypeFromClipboardData(G,"image/svg+xml",mxUtils.bind(this,function(N){if(null!=N){N=new Blob([N],{type:"image/svg+xml"});var J=this.editor.graph.getInsertPoint();this.importFiles([N],J.x,J.y,this.maxImageSize)}else C()}),"image")}))["catch"](C);else C()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(g){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",g,"types",null!=g&&0<g.length?[JSON.stringify(g[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(g,mxUtils.bind(this,function(l,n){null!=l?c(l):this.readGraphModelFromImageClipboardData(g,mxUtils.bind(this,function(v,x,B){null!=v?c(v):this.readTypeFromClipboardData(g,"text/plain",mxUtils.bind(this,-function(C){c(C,x,B,n,g)}))}))}))}catch(l){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,g){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(l){var n=null,v=null;try{var x=this.parseHtmlData(l);if(null!=x){n="text/plain"!=x.getAttribute("data-type")?x.innerHTML:mxUtils.trim(null==x.innerText?mxUtils.getTextContent(x):x.innerText);try{var B=n.lastIndexOf("%3E");0<=B&&B<n.length-3&&(n=n.substring(0,B+3))}catch(D){}try{null==-n&&(l=null,""==x.textContent&&1==x.children.length&&"IMG"==x.firstChild.nodeName&&(l=x.firstChild.getAttribute("src")),null!=l&&0<l.length&&("data:image/png;base64,"==l.substring(0,22)?v=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==l.substring(0,26)&&(v=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/svg+xml"))))}catch(D){}try{var C=x.getElementsByTagName("span"),H=null!=C&&0<C.length?mxUtils.trim(decodeURIComponent(C[0].textContent)):decodeURIComponent(n);-this.isCompatibleString(H)&&(n=H)}catch(D){}}}catch(D){}g(this.isCompatibleString(n)?n:null,v)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,g){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(l,n){var v=null;try{null!=l&&(v=mxUtils.parseXml(l).documentElement.getAttribute("content"))}catch(x){}this.isCompatibleString(v)?g(v):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(x,B){v=Editor.extractGraphModelFromPng("data:image/png;base64,"++function(C){c(C,x,B,n,g)}))}))}))}catch(l){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,g){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(l){var n=null,v=null;try{var x=this.parseHtmlData(l);if(null!=x){n="text/plain"!=x.getAttribute("data-type")?x.innerHTML:mxUtils.trim(null==x.innerText?mxUtils.getTextContent(x):x.innerText);try{var B=n.lastIndexOf("%3E");0<=B&&B<n.length-3&&(n=n.substring(0,B+3))}catch(N){}try{null==+n&&(l=null,""==x.textContent&&1==x.children.length&&"IMG"==x.firstChild.nodeName&&(l=x.firstChild.getAttribute("src")),null!=l&&0<l.length&&("data:image/png;base64,"==l.substring(0,22)?v=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==l.substring(0,26)&&(v=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/svg+xml"))))}catch(N){}try{var C=x.getElementsByTagName("span"),G=null!=C&&0<C.length?mxUtils.trim(decodeURIComponent(C[0].textContent)):decodeURIComponent(n);+this.isCompatibleString(G)&&(n=G)}catch(N){}}}catch(N){}g(this.isCompatibleString(n)?n:null,v)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,g){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(l,n){var v=null;try{null!=l&&(v=mxUtils.parseXml(l).documentElement.getAttribute("content"))}catch(x){}this.isCompatibleString(v)?g(v):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(x,B){v=Editor.extractGraphModelFromPng("data:image/png;base64,"+x);this.isCompatibleString(v)?g(v):g(null,n,B)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,g,l){var n=!1;if(null!=c&&0<c.length)for(var v=0;v<c.length&&!n;v++)(function(x){0<=mxUtils.indexOf(x.types,g)&&(n=!0,x.getType(g).then(mxUtils.bind(this,function(B){if("image/png"==g)B.arrayBuffer().then(function(C){l(btoa(Graph.arrayBufferToString(C)),B)})["catch"](function(){l(null)});else B.text().then(mxUtils.bind(this,function(C){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],"data",[c],"type",[g],"result",[C]);l(C,B)}))["catch"](function(){l(null)})}))["catch"](function(){l(null)}))})(c[v]);n||l()};EditorUi.prototype.parseHtmlData=function(c){var g=null;if(null!=c&&0<c.length){var l="<meta "==c.substring(0,6);g=document.createElement("div");g.innerHTML=(l?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;l=g.getElementsByTagName("style");if(null!=l)for(;0<l.length;)l[0].parentNode.removeChild(l[0]);if(null!=g.firstChild&&g.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=g.firstChild.nextSibling&&g.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==g.firstChild.nodeName&&"A"==g.firstChild.nextSibling.nodeName&&null==g.firstChild.nextSibling.nextSibling){var n=null==g.firstChild.nextSibling.innerText?mxUtils.getTextContent(g.firstChild.nextSibling):g.firstChild.nextSibling.innerText;n==g.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(g,n),asHtml=!1)}if(""==g.textContent&&(l=g.getElementsByTagName("img"),1==l.length&&(n=l[0].getAttribute("src"),l=null,null!=n))){if(Editor.isPngDataUrl(n)){var v=Editor.extractGraphModelFromPng(n);null!=v&&0<v.length&&(l=v)}else if("data:image/svg+xml;base64,"==n.substring(0,26)){img=this.base64ToBlob(n.substring(n.indexOf(",")+1),"image/svg+xml");n=Graph.getSvgFromDataUri(n);try{v=mxUtils.parseXml(n).documentElement.getAttribute("content"),this.isCompatibleString(v)&&(l=v)}catch(x){}}null!=l&&(mxUtils.setTextContent(g,l),asHtml=!1)}asHtml?Graph.removePasteFormatting(g):g.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[g],"asHtml",asHtml);return g};EditorUi.prototype.showPrintDialog=function(c,g,l){var n=330;this.editor.graph.isEnabled()&&(n+=40);null!=this.pages&&1<this.pages.length&&(n+=40,this.editor.graph.isEnabled()||(n+=10));null==g||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(n+=20);this.showDialog((new PrintDialog(this,c,g,l)).container,320,n,!0,!0)};EditorUi.prototype.print=function(c,g){var l=this.editor,n=l.graph,-v=this.getPageIndex(this.currentPage),x=null!=v?v+1:1,B=mxUtils.bind(this,function(M,m,y,F){var N=M.useCssTransforms,O=M.currentTranslate,P=M.currentScale,T=M.view.translate,Q=M.view.scale;M.useCssTransforms&&(M.useCssTransforms=!1,M.currentTranslate=new mxPoint(0,0),M.currentScale=1,M.view.translate=new mxPoint(0,0),M.view.scale=1);var R=M.getGraphBounds(),W=0,X=0,Y=mxRectangle.fromRectangle(M.pageFormat),Z=g.fit||g.crop||!M.pageVisible,ba=g.scale;Y.width=Math.ceil(Y.width*M.pageScale);Y.height=-Math.ceil(Y.height*M.pageScale);var ea=1;if(g.fit){ea=g.sheetsAcross;var ha=g.sheetsDown;isNaN(ba)||(Y.width=Math.ceil(Y.width*ba),Y.height=Math.ceil(Y.height*ba));ea=Math.min(Y.height*ha/(R.height/M.view.scale),Y.width*ea/(R.width/M.view.scale))}else ea=isNaN(ba)?1:ba;ea*=1;!Z&&M.pageVisible?(ba=M.getPageLayout(),W-=ba.x*Y.width,X-=ba.y*Y.height):Z=!0;g.crop&&(g.selection&&(R=n.getBoundingBox(n.getSelectionCells())),Y.width=(R.width+1)*ea/M.view.scale,Y.height=(R.height+1)*ea/M.view.scale);Y.width=-Math.ceil(1*Y.width);Y.height=Math.ceil(1*Y.height);F=null!=F?"page/id,"+F:null;if(null==m){m=PrintDialog.createPrintPreview(M,ea,null,0,W,X,Z);m.title=this.getBaseFilename(!0);m.pageSelector=!1;m.mathEnabled=!1;W=g.border;isNaN(W)||(m.pageMargin=W);g.selection&&(m.isCellVisible=function(pa){return M.isCellSelected(pa)});var fa=m.writeHead;m.writeHead=function(pa,va){va=null!=va?va:"";g.shadows||(va+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(va+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");-null!=l.fontCss&&(va+=l.fontCss);fa.apply(this,arguments);for(var ta=M.getCustomFonts(),ma=0;ma<ta.length;ma++){var ia=ta[ma].name,qa=ta[ma].url;Graph.isCssFontUrl(qa)?pa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(qa))+'" charset="UTF-8" type="text/css">'):(pa.writeln('<style type="text/css">'),pa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ia)+'";\nsrc: url("'+mxUtils.htmlEntities(qa)+'");\n}'),pa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var la=-m.drawBackgroundImage;m.drawBackgroundImage=function(pa){la.apply(this,arguments);null!=pa.node&&(EditorUi.embedSvgImages(pa.node),n.disableSvgLinks(pa.node,function(va){va.setAttribute("href","javascript:void(0)")}))}}var oa=m.addGraphFragment;m.addGraphFragment=function(pa,va,ta,ma,ia,qa){oa.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ia.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var ua=ia.getElementsByTagName("svg"),xa=0;xa<ua.length;xa++)M.addSvgShadow(ua[xa])};-g.grid&&(m.gridSize=M.gridSize,m.gridSteps=M.view.gridSteps,m.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:M.view.gridColor);m.open(null,null,y,!0,F,Y,g.selection?M.getSelectionCells():null)}else{R=M.background;if(null==R||""==R||R==mxConstants.NONE)R="#ffffff";m.backgroundColor=R;m.autoOrigin=Z;g.grid&&(m.gridSize=M.gridSize,m.gridSteps=M.view.gridSteps,m.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:M.view.gridColor);m.appendGraph(M,ea,W,X,y,!0,F,Y,-g.selection?M.getSelectionCells():null);y=M.getCustomFonts();if(null!=m.wnd)for(Y=0;Y<y.length;Y++)W=y[Y].name,X=y[Y].url,Graph.isCssFontUrl(X)?m.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(m.wnd.document.writeln('<style type="text/css">'),m.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(W)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),m.wnd.document.writeln("</style>"))}N&&(M.useCssTransforms=N,-M.currentTranslate=O,M.currentScale=P,M.view.translate=T,M.view.scale=Q);return m}),C=g.pagesFrom,H=g.pagesTo,D=!g.allPages;v=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{D&&(D=g.selection||C==x&&H==x);if(!D&&null!=this.pages&&this.pages.length){D=0;x=this.pages.length-1;g.allPages||(D=parseInt(C)-1,x=parseInt(H)-1);for(var U=D;U<=x;U++){var S=this.pages[U];C=S==this.currentPage?n:null;if(null==C){C=this.createTemporaryGraph(n.stylesheet);C.shapeForegroundColor=n.shapeForegroundColor;-C.shapeBackgroundColor=n.shapeBackgroundColor;H=!0;var V=D=!1,t=null,z=null;null==S.viewState&&null==S.root&&this.updatePageRoot(S);null!=S.viewState&&(H=S.viewState.pageVisible,D=S.viewState.mathEnabled,V=S.viewState.shadowVisible,t=S.viewState.background,z=S.viewState.backgroundImage,C.pageFormat=S.viewState.pageFormat,C.gridSize=S.viewState.gridSize);null!=z&&null!=z.originalSrc&&(z=this.createImageForPageLink(z.originalSrc,S));C.background=t;C.backgroundImage=null!=z?new mxImage(z.src,z.width,-z.height,z.x,z.y):null;C.pageVisible=H;C.mathEnabled=D;C.shadowVisible=V;var L=C.getGraphBounds;C.getGraphBounds=function(){var M=L.apply(this,arguments),m=this.backgroundImage;if(null!=m&&null!=m.width&&null!=m.height){var y=this.view.translate,F=this.view.scale;M=mxRectangle.fromRectangle(M);M.add(new mxRectangle((y.x+m.x)*F,(y.y+m.y)*F,m.width*F,m.height*F))}return M};var K=C.getGlobalVariable;C.getGlobalVariable=function(M){return"page"==M?S.getName():"pagenumber"==M?U+1:"pagecount"==M?null!=-this.pages?this.pages.length:1:K.apply(this,arguments)};document.body.appendChild(C.container);this.updatePageRoot(S);C.model.setRoot(S.root)}v=B(C,v,U!=x,S.getId());C!=n&&C.container.parentNode.removeChild(C.container)}}else v=B(n);null==v||null==v.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(v.mathEnabled&&(B=v.wnd.document,c||(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,+v=this.getPageIndex(this.currentPage),x=null!=v?v+1:1,B=mxUtils.bind(this,function(M,m,y,E){var P=M.useCssTransforms,O=M.currentTranslate,Q=M.currentScale,U=M.view.translate,R=M.view.scale;M.useCssTransforms&&(M.useCssTransforms=!1,M.currentTranslate=new mxPoint(0,0),M.currentScale=1,M.view.translate=new mxPoint(0,0),M.view.scale=1);var S=M.getGraphBounds(),W=0,X=0,Y=mxRectangle.fromRectangle(M.pageFormat),Z=g.fit||g.crop||!M.pageVisible,aa=g.scale;Y.width=Math.ceil(Y.width*M.pageScale);Y.height=+Math.ceil(Y.height*M.pageScale);var fa=1;if(g.fit){fa=g.sheetsAcross;var ia=g.sheetsDown;isNaN(aa)||(Y.width=Math.ceil(Y.width*aa),Y.height=Math.ceil(Y.height*aa));fa=Math.min(Y.height*ia/(S.height/M.view.scale),Y.width*fa/(S.width/M.view.scale))}else fa=isNaN(aa)?1:aa;fa*=1;!Z&&M.pageVisible?(aa=M.getPageLayout(),W-=aa.x*Y.width,X-=aa.y*Y.height):Z=!0;g.crop&&(g.selection&&(S=n.getBoundingBox(n.getSelectionCells())),Y.width=(S.width+1)*fa/M.view.scale,Y.height=(S.height+1)*fa/M.view.scale);Y.width=+Math.ceil(1*Y.width);Y.height=Math.ceil(1*Y.height);E=null!=E?"page/id,"+E:null;if(null==m){m=PrintDialog.createPrintPreview(M,fa,null,0,W,X,Z);m.title=this.getBaseFilename(!0);m.pageSelector=!1;m.mathEnabled=!1;W=g.border;isNaN(W)||(m.pageMargin=W);g.selection&&(m.isCellVisible=function(ua){return M.isCellSelected(ua)});var ea=m.writeHead;m.writeHead=function(ua,ta){ta=null!=ta?ta:"";g.shadows||(ta+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(ta+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");+null!=l.fontCss&&(ta+=l.fontCss);ea.apply(this,arguments);for(var sa=M.getCustomFonts(),la=0;la<sa.length;la++){var ja=sa[la].name,qa=sa[la].url;Graph.isCssFontUrl(qa)?ua.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(qa))+'" charset="UTF-8" type="text/css">'):(ua.writeln('<style type="text/css">'),ua.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ja)+'";\nsrc: url("'+mxUtils.htmlEntities(qa)+'");\n}'),ua.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ma=+m.drawBackgroundImage;m.drawBackgroundImage=function(ua){ma.apply(this,arguments);null!=ua.node&&(EditorUi.embedSvgImages(ua.node),n.disableSvgLinks(ua.node,function(ta){ta.setAttribute("href","javascript:void(0)")}))}}var na=m.addGraphFragment;m.addGraphFragment=function(ua,ta,sa,la,ja,qa){na.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ja.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var va=ja.getElementsByTagName("svg"),ya=0;ya<va.length;ya++)M.addSvgShadow(va[ya])};+g.grid&&(m.gridSize=M.gridSize,m.gridSteps=M.view.gridSteps,m.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:M.view.gridColor);m.open(null,null,y,!0,E,Y,g.selection?M.getSelectionCells():null)}else{S=M.background;if(null==S||""==S||S==mxConstants.NONE)S="#ffffff";m.backgroundColor=S;m.autoOrigin=Z;g.grid&&(m.gridSize=M.gridSize,m.gridSteps=M.view.gridSteps,m.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:M.view.gridColor);m.appendGraph(M,fa,W,X,y,!0,E,Y,+g.selection?M.getSelectionCells():null);y=M.getCustomFonts();if(null!=m.wnd)for(Y=0;Y<y.length;Y++)W=y[Y].name,X=y[Y].url,Graph.isCssFontUrl(X)?m.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(m.wnd.document.writeln('<style type="text/css">'),m.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(W)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),m.wnd.document.writeln("</style>"))}P&&(M.useCssTransforms=P,+M.currentTranslate=O,M.currentScale=Q,M.view.translate=U,M.view.scale=R);return m}),C=g.pagesFrom,G=g.pagesTo,N=!g.allPages;v=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{N&&(N=g.selection||C==x&&G==x);if(!N&&null!=this.pages&&this.pages.length){N=0;x=this.pages.length-1;g.allPages||(N=parseInt(C)-1,x=parseInt(G)-1);for(var J=N;J<=x;J++){var T=this.pages[J];C=T==this.currentPage?n:null;if(null==C){C=this.createTemporaryGraph(n.stylesheet);C.shapeForegroundColor=n.shapeForegroundColor;+C.shapeBackgroundColor=n.shapeBackgroundColor;G=!0;var V=N=!1,t=null,z=null;null==T.viewState&&null==T.root&&this.updatePageRoot(T);null!=T.viewState&&(G=T.viewState.pageVisible,N=T.viewState.mathEnabled,V=T.viewState.shadowVisible,t=T.viewState.background,z=T.viewState.backgroundImage,C.pageFormat=T.viewState.pageFormat,C.gridSize=T.viewState.gridSize);null!=z&&null!=z.originalSrc&&(z=this.createImageForPageLink(z.originalSrc,T));C.background=t;C.backgroundImage=null!=z?new mxImage(z.src,z.width,+z.height,z.x,z.y):null;C.pageVisible=G;C.mathEnabled=N;C.shadowVisible=V;var L=C.getGraphBounds;C.getGraphBounds=function(){var M=L.apply(this,arguments),m=this.backgroundImage;if(null!=m&&null!=m.width&&null!=m.height){var y=this.view.translate,E=this.view.scale;M=mxRectangle.fromRectangle(M);M.add(new mxRectangle((y.x+m.x)*E,(y.y+m.y)*E,m.width*E,m.height*E))}return M};var K=C.getGlobalVariable;C.getGlobalVariable=function(M){return"page"==M?T.getName():"pagenumber"==M?J+1:"pagecount"==M?null!=+this.pages?this.pages.length:1:K.apply(this,arguments)};document.body.appendChild(C.container);this.updatePageRoot(T);C.model.setRoot(T.root)}v=B(C,v,J!=x,T.getId());C!=n&&C.container.parentNode.removeChild(C.container)}}else v=B(n);null==v||null==v.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(v.mathEnabled&&(B=v.wnd.document,c||(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||c||PrintDialog.printPreview(v));return v}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var g=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(n){null!=g&&(g.parentNode.removeChild(g),g=null);n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c[l],"dragover",mxUtils.bind(this,function(n){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==g&&(g=this.highlightElement());n.stopPropagation();n.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(n){null!=g&&(g.parentNode.removeChild(g),g=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<n.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(n.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(n)&&!mxEvent.isShiftDown(n)):this.openFiles(n.dataTransfer.files,!0);else{var v=this.extractGraphModelFromEvent(n);if(null==v){var x=null!=n.dataTransfer?n.dataTransfer:n.clipboardData;null!=x&&(10==document.documentMode||11==document.documentMode?v=x.getData("Text"):(v=null,v=0<=mxUtils.indexOf(x.types,"text/uri-list")?n.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(x.types,"text/html")?x.getData("text/html"):null,null!=v&&0<v.length?(x=document.createElement("div"),x.innerHTML=Graph.sanitizeHtml(v),x=x.getElementsByTagName("img"),0<x.length&&(v=x[0].getAttribute("src"))):0<=mxUtils.indexOf(x.types,"text/plain")&&(v=x.getData("text/plain"))),null!=v&&@@ -13606,171 +13614,175 @@ n.clipboardData;null!=x&&(10==document.documentMode||11==document.documentMode?vmxResources.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)}n.stopPropagation();n.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var g=0,l=0;if(null==c){var n=document.body;var v=document.documentElement;var x=(n.clientWidth||v.clientWidth)-3;n=Math.max(n.clientHeight||0,v.clientHeight)-3}else n=c.getBoundingClientRect(),g=n.top,l=n.left,x=n.width,n=n.height;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=l+"px";v.style.width=Math.max(0,x-3)+"px";v.style.height=Math.max(0,n-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(v):document.body.appendChild(v);return v};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var g=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=g){var l=new mxCodec(g.ownerDocument),n=new mxGraphModel;l.decode(g,n);g=n.getChildAt(n.getRoot(),0);for(l=0;l<n.getChildCount(g);l++)c.push(n.getChildAt(g,l))}return c};EditorUi.prototype.openFileHandle=function(c,g,l,n,v,x){if(null!=g&&0<g.length){if(!Editor.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(H){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==H.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,H,g)),this.showSidebar()}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(H,g,n)});if(EditorUi.isVisioFilename(g))this.importVisio(l,-mxUtils.bind(this,function(H){this.spinner.stop();B(H)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(H){this.spinner.stop();B(H)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(H){4==H.readyState&&(this.spinner.stop(),200<=H.status&&299>=H.status?B(H.responseText):this.handleError({message:mxResources.get(413==-H.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(H){this.spinner.stop();this.openLocalFile(H,g,n)}),mxUtils.bind(this,function(H){this.spinner.stop();this.handleError(H)}));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,l.name)),this.showSidebar()}catch(H){this.handleError(H,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(H){this.spinner.stop();B(H)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,g,n)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var C=Editor.extractGraphModelFromPdf(c);null!=+g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var B=mxUtils.bind(this,function(G){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".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,g)),this.showSidebar()}catch(N){this.handleError(N,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(G,g,n)});if(EditorUi.isVisioFilename(g))this.importVisio(l,+mxUtils.bind(this,function(G){this.spinner.stop();B(G)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(G){this.spinner.stop();B(G)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(G){4==G.readyState&&(this.spinner.stop(),200<=G.status&&299>=G.status?B(G.responseText):this.handleError({message:mxResources.get(413==+G.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(G){this.spinner.stop();this.openLocalFile(G,g,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,l.name)),this.showSidebar()}catch(G){this.handleError(G,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(G){this.spinner.stop();B(G)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,g,n)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var C=Editor.extractGraphModelFromPdf(c);null!=C&&(v=null,n=!0,c=C)}this.spinner.stop();this.openLocalFile(c,g,n,v,null!=v?l:null,x)}}};EditorUi.prototype.openFiles=function(c,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=0;l<c.length;l++)mxUtils.bind(this,function(n){var v=new FileReader;v.onload=mxUtils.bind(this,function(x){try{this.openFileHandle(x.target.result,n.name,n,g)}catch(B){this.handleError(B)}});v.onerror=mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x);window.openFile=null});"image"!==-n.type.substring(0,5)&&"application/pdf"!==n.type||"image/svg"===n.type.substring(0,9)?v.readAsText(n):v.readAsDataURL(n)})(c[l])};EditorUi.prototype.openLocalFile=function(c,g,l,n,v,x){var B=this.getCurrentFile(),C=mxUtils.bind(this,function(){window.openFile=null;if(null==g&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var H=mxUtils.parseXml(c);null!=H&&(this.editor.setGraphXml(H.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,g||this.defaultFilename,+n.type.substring(0,5)&&"application/pdf"!==n.type||"image/svg"===n.type.substring(0,9)?v.readAsText(n):v.readAsDataURL(n)})(c[l])};EditorUi.prototype.openLocalFile=function(c,g,l,n,v,x){var B=this.getCurrentFile(),C=mxUtils.bind(this,function(){window.openFile=null;if(null==g&&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,g||this.defaultFilename,l,n,v,x))});if(null!=c&&0<c.length)null==B||!B.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n)?C():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n)&&null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),null,C,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,g),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),null,C,mxResources.get("cancel"),mxResources.get("discardChanges")):C()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),this.addBasenamesForCell(this.pages[g].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);g=[];for(var l in c)g.push(l);return g};EditorUi.prototype.addBasenamesForCell=function(c,g){function l(B){if(null!=B){var C=B.lastIndexOf(".");0<C&&(B=B.substring(C+1,B.length));null==g[B]&&(g[B]=!0)}}var n=this.editor.graph,v=n.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(v[mxConstants.STYLE_SHAPE]));n.model.isEdge(c)&&(l(mxMarker.getPackageForType(v[mxConstants.STYLE_STARTARROW])),l(mxMarker.getPackageForType(v[mxConstants.STYLE_ENDARROW])));v=n.model.getChildCount(c);for(var x=0;x<v;x++)this.addBasenamesForCell(n.model.getChildAt(c,x),g)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||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(g,l,n,v){c||(c=!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);Editor.fitDiagramOnLoad&&-this.initialFitDiagram();if(v)try{var x=this.editor.graph;x.setGridEnabled(!1);x.pageVisible=!1;var B=x.model.cells,C;for(C in B){var H=B[C];null!=H&&null!=H.style&&(H.style+=";sketch=1;"+(-1==H.style.indexOf("fontFamily=")||-1<H.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(D){console.log(D)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():+this.initialFitDiagram();if(v)try{var x=this.editor.graph;x.setGridEnabled(!1);x.pageVisible=!1;var B=x.model.cells,C;for(C in B){var G=B[C];null!=G&&null!=G.style&&(G.style+=";sketch=1;"+(-1==G.style.indexOf("fontFamily=")||-1<G.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(N){console.log(N)}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||this.noAutoFocus||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,g){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(l){this.spinner.stop();g(l)})):g(null)};EditorUi.prototype.createLoadMessage=function(c){var g=this.editor.graph,l=g.getGraphBounds(),n=g.view.scale,v=g.view.translate;return{event:c,pageVisible:g.pageVisible,translate:v,bounds:l,currentPage:this.getSelectedPageIndex(),scale:n,page:g.view.getBackgroundPageBounds(),modelBounds:{x:l.x/n-v.x,y:l.y/n-v.y,width:l.width/n,height:l.height/n},containerSize:{width:g.container.clientWidth,height:g.container.clientHeight,offsetWidth:g.container.offsetWidth,offsetHeight:g.container.offsetHeight}}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var g=this.editor.graph;g.isEditing()&&g.stopEditing(!g.isInvokesStopCellEditing());var l=this.embedMessageSource||window.opener||window.parent;if(this.editor.modified){var n=g.background;if(null==n||n==mxConstants.NONE)n=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),g,null,!0,mxUtils.bind(this,function(v){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(v)}),"*")}),null,null,!0,n,1,this.embedExportBorder,null,this.embedExportTheme)}else c||l.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");c||(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){c||this.handleError(v)}};EditorUi.prototype.installMessageHandler=function(c){var g=null,l=!1,n=!1,v=null,x=mxUtils.bind(this,function(H,D){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):-this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,x);mxEvent.addListener(window,"message",mxUtils.bind(this,function(H){if(H.source==(this.embedMessageSource||window.opener||window.parent)){var D=H.data,U=null,S=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(na){}return aa});if("json"==urlParams.proto){var V=!1;try{D=JSON.parse(D),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[H],"data",[D])}catch(aa){D=null}try{var t=D;if(null==D)return;if("dialog"==D.action){this.showError(null!=D.titleKey?mxResources.get(D.titleKey):D.title,null!=D.messageKey?mxResources.get(D.messageKey):mxUtils.htmlEntities(D.message),-null!=D.buttonKey?mxResources.get(D.buttonKey):D.button);null!=D.modified&&(this.editor.modified=D.modified);return}if("layout"==D.action){this.executeLayouts(this.editor.graph.createLayouts(D.layouts));return}if("prompt"==D.action){this.spinner.stop();var z=new FilenameDialog(this,D.defaultValue||"",null!=D.okKey?mxResources.get(D.okKey):D.ok,function(aa){null!=aa?B.postMessage(JSON.stringify({event:"prompt",value:aa,message:D}),"*"):B.postMessage(JSON.stringify({event:"prompt-cancel",message:D}),-"*")},null!=D.titleKey?mxResources.get(D.titleKey):D.title,null,null,null,null,function(){B.postMessage(JSON.stringify({event:"prompt-cancel",message:D}),"*")});this.showDialog(z.container,300,80,!0,!1);z.init();return}if("draft"==D.action){var L=S(D.xml);this.spinner.stop();z=new DraftDialog(this,mxResources.get("draftFound",[D.name||this.defaultFilename]),L,mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"edit",message:D}),"*")}),mxUtils.bind(this,-function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"discard",message:D}),"*")}),D.editKey?mxResources.get(D.editKey):null,D.discardKey?mxResources.get(D.discardKey):null,D.ignore?mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"ignore",message:D}),"*")}):null);this.showDialog(z.container,640,480,!0,!1,mxUtils.bind(this,function(aa){aa&&this.actions.get("exit").funct()}));try{z.init()}catch(aa){B.postMessage(JSON.stringify({event:"draft",-error:aa.toString(),message:D}),"*")}return}if("template"==D.action){this.spinner.stop();var K=1==D.enableRecent,M=1==D.enableSearch,m=1==D.enableCustomTemp;z=new NewDialog(this,!1,D.templatesOnly?!1:null!=D.callback,mxUtils.bind(this,function(aa,na,ja,sa){aa=aa||this.emptyDiagramXml;null!=D.callback?B.postMessage(JSON.stringify({event:"template",xml:aa,blank:aa==this.emptyDiagramXml,name:na,tempUrl:ja,libs:sa,builtIn:!0,message:D}),"*"):(c(aa,H,aa!=this.emptyDiagramXml,D.toSketch),this.editor.modified||-this.clearStatus())}),null,null,null,null,null,null,null,K?mxUtils.bind(this,function(aa){this.remoteInvoke("getRecentDiagrams",[null],null,aa,function(){aa(null,"Network Error!")})}):null,M?mxUtils.bind(this,function(aa,na){this.remoteInvoke("searchDiagrams",[aa,null],null,na,function(){na(null,"Network Error!")})}):null,mxUtils.bind(this,function(aa,na,ja){B.postMessage(JSON.stringify({event:"template",docUrl:aa,info:na,name:ja}),"*")}),null,null,m?mxUtils.bind(this,function(aa){this.remoteInvoke("getCustomTemplates",-null,null,aa,function(){aa({},0)})}):null,1==D.withoutType,null,D.templatesOnly);this.showDialog(z.container,620,460,!0,!1,mxUtils.bind(this,function(aa){null!=this.sidebar&&this.sidebar.hideTooltip();aa&&!D.noExitOnCancel&&this.actions.get("exit").funct()}));z.init();return}if("textContent"==D.action){var y=this.getDiagramTextContent();B.postMessage(JSON.stringify({event:"textContent",data:y,message:D}),"*");return}if("status"==D.action){this.updateStatus(mxUtils.bind(this,function(){null!=D.messageKey?-this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(D.messageKey))):null!=D.message&&this.editor.setStatus(mxUtils.htmlEntities(D.message))}));null!=D.modified&&(this.editor.modified=D.modified);return}if("spinner"==D.action){var F=null!=D.messageKey?mxResources.get(D.messageKey):D.message;null==D.show||D.show?this.spinner.spin(document.body,F):this.spinner.stop();return}if("exit"==D.action){this.actions.get("exit").funct();return}if("viewport"==D.action){if(null!=D.viewport){var N=this.editor.graph,-O=N.view.translate.x,P=N.view.translate.y;this.embedViewport=D.viewport;N.refresh();this.diagramContainer.scrollTop-=(P-N.view.translate.y)*N.view.scale;this.diagramContainer.scrollLeft-=(O-N.view.translate.x)*N.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==D.action){var T=this.actions.get(D.actionName);null!=T&&T.funct();return}if("resetEditor"==D.action){N=this.editor.graph;N.isEditing()&&N.stopEditing(!1);this.hideCurrentMenu();N.popupMenuHandler.hideMenu();-N.clearSelection();return}if("fit"==D.action){N=this.editor.graph;var Q=N.maxFitScale;N.maxFitScale=null!=D.maxScale?D.maxScale:1;N.fit(null!=D.border?D.border:16,null,null,null,null,!0);N.maxFitScale=Q;F=this.createLoadMessage("fit");F.message=D;B.postMessage(JSON.stringify(F),"*");return}if("fullscreenChanged"==D.action){z=null;try{var R=this.diagramContainer.getAttribute("data-scrollState");null!=R&&(this.diagramContainer.removeAttribute("data-scrollState"),z=JSON.parse(R))}catch(aa){}Editor.inlineFullscreen=-D.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=z&&this.restoreScrollState(z);return}if("snapshot"==D.action){this.sendEmbeddedSvgExport(!0);return}if("export"==D.action){if("png"==D.format||"xmlpng"==D.format){if(null==D.spin&&null==D.spinKey||this.spinner.spin(document.body,null!=D.spinKey?mxResources.get(D.spinKey):D.spin)){var W=null!=D.xml?D.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);N=this.editor.graph;var X=mxUtils.bind(this,function(aa,na){if(D.withSvg)D.withSvg=-!1,this.getEmbeddedSvg(W,this.editor.graph,null,!0,function(sa){X(aa,sa)},null,null,D.embedImages,this.editor.graph.background,D.scale,D.border,D.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ja=this.createLoadMessage("export");ja.format=D.format;ja.message=t;ja.data=aa;ja.svg=na;ja.xml=W;B.postMessage(JSON.stringify(ja),"*")}}),Y=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==D.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(W)));-N!=this.editor.graph&&N.container.parentNode.removeChild(N.container);X(aa)}),Z=D.pageId||(null!=this.pages?D.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ba=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Z){var aa=N.getGlobalVariable;N=this.createTemporaryGraph(N.getStylesheet());for(var na,ja=0;ja<this.pages.length;ja++)if(this.pages[ja].getId()==Z){na=this.updatePageRoot(this.pages[ja]);break}null==na&&(na=-this.currentPage);N.getGlobalVariable=function(Ba){return"page"==Ba?na.getName():"pagenumber"==Ba?1:aa.apply(this,arguments)};document.body.appendChild(N.container);N.model.setRoot(na.root)}if(null!=D.layerIds){var sa=N.model,Ca=sa.getChildCells(sa.getRoot()),Fa={};for(ja=0;ja<D.layerIds.length;ja++)Fa[D.layerIds[ja]]=!0;for(ja=0;ja<Ca.length;ja++)sa.setVisible(Ca[ja],Fa[Ca[ja].id]||!1)}ja=null;D.keepTheme&&(ja=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Ba){Y(Ba.toDataURL("image/png"))}),-D.width,null,D.background,mxUtils.bind(this,function(){Y(null)}),null,null,D.scale,D.transparent,D.shadow,null,N,D.border,null,D.grid,ja,D.size)});null!=D.xml&&0<D.xml.length&&(l=!0,this.setFileData(W),l=!1);ba()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==D.format?"1":"0")+(null!=Z?"&pageId="+Z:"")+(null!=D.layerIds&&0<D.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:D.layerIds})):"")+(null!=D.scale?"&scale="+D.scale:"")+"&base64=1&xml="+encodeURIComponent(W))).send(mxUtils.bind(this,-function(aa){200<=aa.getStatus()&&299>=aa.getStatus()?X("data:image/png;base64,"+aa.getText()):Y(null)}),mxUtils.bind(this,function(){Y(null)}))}}else if(ba=mxUtils.bind(this,function(){var aa=this.createLoadMessage("export");aa.message=D;if("html2"==D.format||"html"==D.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var na=this.getXmlFileData();aa.xml=mxUtils.getXml(na);aa.data=this.getFileData(null,null,!0,null,null,null,na);aa.format=D.format}else if("html"==D.format)na=-this.editor.getGraphXml(),aa.data=this.getHtml(na,this.editor.graph),aa.xml=mxUtils.getXml(na),aa.format=D.format;else{if("xml"==D.format)aa.xml=this.getFileData(!0),aa.format=D.format,B.postMessage(JSON.stringify(aa),"*");else{mxSvgCanvas2D.prototype.foAltText=null;na=null!=D.background?D.background:this.editor.graph.background;na==mxConstants.NONE&&(na=null);aa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);aa.format="svg";var ja=mxUtils.bind(this,function(Ca){this.editor.graph.setEnabled(!0);-this.spinner.stop();aa.data=D.asText?Ca:Editor.createSvgDataUri(Ca);B.postMessage(JSON.stringify(aa),"*")}),sa="auto";D.keepTheme&&(sa=Editor.isDarkMode()?"dark":"light");null!=D.theme&&(sa=D.theme);if("xmlsvg"==D.format){if(null==D.spin&&null==D.spinKey||this.spinner.spin(document.body,null!=D.spinKey?mxResources.get(D.spinKey):D.spin)){sa=null;if(this.isAutoDarkMode()||Editor.isDarkMode())sa="auto";null!=D.theme&&(sa=D.theme);this.getEmbeddedSvg(aa.xml,this.editor.graph,null,!0,ja,null,null,D.embedImages,-na,D.scale,D.border,D.shadow,sa)}}else if(null==D.spin&&null==D.spinKey||this.spinner.spin(document.body,null!=D.spinKey?mxResources.get(D.spinKey):D.spin))this.editor.graph.setEnabled(!1),na=this.editor.graph.getSvg(na,D.scale,D.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||D.shadow,null,sa),(this.editor.graph.shadowVisible||D.shadow)&&this.editor.graph.addSvgShadow(na),this.embedFonts(na,mxUtils.bind(this,function(Ca){D.embedImages||null==D.embedImages?this.editor.convertImages(Ca,-mxUtils.bind(this,function(Fa){ja(mxUtils.getXml(Fa))})):ja(mxUtils.getXml(Ca))}))}return}B.postMessage(JSON.stringify(aa),"*")}),null!=D.xml&&0<D.xml.length){if(this.editor.graph.mathEnabled){var ea=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ea.apply(this,arguments);ba()}}l=!0;this.setFileData(D.xml);l=!1;this.editor.graph.mathEnabled||ba()}else ba();return}if("load"==D.action){V=D.toSketch;n=1==D.autosave;var ha=D.sourceMetadata||null;this.hideDialog();null!=D.modified&&null==urlParams.modified&&-(urlParams.modified=D.modified);null!=D.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=D.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+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=D.noSaveBtn&&null==urlParams.noSaveBtn&&-(urlParams.noSaveBtn=D.noSaveBtn);if(null!=D.rough){var fa=Editor.sketchMode;this.doSetSketchMode(D.rough);fa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=D.dark&&this.setDarkMode(D.dark);null!=D.border&&(this.embedExportBorder=D.border);null!=D.theme&&(this.embedExportTheme=D.theme);null!=D.background&&(this.embedExportBackground=D.background);null!=D.viewport&&(this.embedViewport=D.viewport);this.embedExitPoint=null;if(null!=D.scale){var la=D.scale,oa=null!=D.scaleBorder?-D.scaleBorder:this.embedExportBorder||0,pa=null!=D.border?D.border:0;U=mxUtils.bind(this,function(){var aa=this.editor.graph,na=aa.getGraphBounds();if(0<na.width&&0<na.height){var ja=aa.view.scale;aa.view.scaleAndTranslate(la,aa.view.translate.x+pa-na.x/ja+oa/la,aa.view.translate.y+pa-na.y/ja+oa/la)}})}else if(null!=D.fit){var va=null!=D.border?D.border:0,ta=D.maxFitScale||1;U=mxUtils.bind(this,function(){var aa=this.editor.graph,na=aa.maxFitScale;aa.maxFitScale=ta;aa.fit(va,null,null,null,null,!0);-aa.maxFitScale=na})}if(null!=D.rect){pa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,D.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,D.rect.top)+"px";this.minInlineWidth=D.minWidth;this.minInlineHeight=D.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var ma=D.maxFitScale,ia=D.rect.width+2*pa,qa=D.rect.height+2*pa;U=mxUtils.bind(this,function(){var aa=mxUtils.getDocumentSize();-ia=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ia):ia,aa.width-80);aa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,qa):qa,aa.height-80);this.diagramContainer.style.width=ia+"px";this.diagramContainer.style.height=aa+"px";var na=this.editor.graph;aa=na.maxFitScale;na.maxFitScale=ma;na.fit(2*pa,null,null,null,null,null,qa);this.setPageVisible(!1);if(null!=this.minInlineWidth&&na.getGraphBounds().width<this.minInlineWidth){var ja=na.container.scrollTop;this.resetScrollbars();-na.container.scrollTop=ja}na.maxFitScale=aa;na.container.scrollTop-=pa;na.container.scrollLeft-=pa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[D]));na.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=na.container.style.top);var sa=na.getGraphBounds();na.container.clientWidth>sa.width+2*pa&&(na.container.scrollLeft=sa.x+(sa.width+pa-na.container.clientWidth)/-2)}),10)})}null!=D.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=D.noExitBtn);null!=D.title&&null!=this.buttonContainer&&this.setEmbedTitle(D.title);try{D.libs&&this.sidebar.showEntries(D.libs)}catch(aa){}if(null!=D.xmlpng)D=this.extractGraphModelFromPng(D.xmlpng);else if(null!=D.descriptor){if(D=D.descriptor,"mermaid"==D.format){window.isMermaidEnabled?this.parseMermaidDiagram(D.data,null,mxUtils.bind(this,function(aa){c(aa,H,null,V);aa=this.createLoadMessage("load");aa.xml=this.getFileData(!0,-null,null,null,null,null,null,null,null,!0);aa.message=t;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(aa),"*");if(null!=ha&&null!=ha.key&&null!=ha.value){aa=this.editor.graph;var na=aa.getModel().getRoot();if(null!=na){aa.getModel().beginUpdate();try{aa.setAttributeForCell(na,ha.key,ha.value)}finally{aa.getModel().endUpdate()}}}}),mxUtils.bind(this,function(aa){this.handleError(aa)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},-mxResources.get("errorLoadingFile"));return}}else D=D.xml}else{if("merge"==D.action){var ua=this.getCurrentFile();null!=ua&&(L=S(D.xml),null!=L&&""!=L&&ua.mergeFile(new LocalFile(this,L),function(){B.postMessage(JSON.stringify({event:"merge",message:D}),"*")},function(aa){B.postMessage(JSON.stringify({event:"merge",message:D,error:aa}),"*")}))}else"remoteInvokeReady"==D.action?this.handleRemoteInvokeReady(B):"remoteInvoke"==D.action?this.handleRemoteInvoke(D,H.origin):"remoteInvokeResponse"==D.action?-this.handleRemoteInvokeResponse(D):B.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(D)}),"*");return}}catch(aa){this.handleError(aa)}}var xa=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ra=mxUtils.bind(this,function(aa,na){l=!0;try{c(aa,na,null,V)}catch(ja){this.handleError(ja)}l=!1;null!=urlParams.modified&&this.clearStatus();v=xa();n&&null==g&&(g=mxUtils.bind(this,-function(ja,sa){ja=xa();ja==v||l||(sa=this.createLoadMessage("autosave"),sa.xml=ja,sa.message=t,(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(sa),"*"));v=ja}),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));null!=U&&U();if("1"==urlParams.returnbounds||"json"==urlParams.proto)na=this.createLoadMessage("load"),na.xml=aa,B.postMessage(JSON.stringify(na),"*")});null!=D&&"function"===typeof D.substring&&"data:application/vnd.visio;base64,"==D.substring(0,34)?(S="0M8R4KGxGuE"==D.substring(34,45)?"raw.vsd":-"raw.vsdx",this.importVisio(this.base64ToBlob(D.substring(D.indexOf(",")+1)),function(aa){ra(aa,H)},mxUtils.bind(this,function(aa){this.handleError(aa)}),S)):null!=D&&"function"===typeof D.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(D,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(D,mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?-ra(aa.responseText,H):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=D&&"function"===typeof D.substring&&this.isLucidChartData(D)?this.convertLucidChart(D,mxUtils.bind(this,function(aa){ra(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):null==D||"object"!==typeof D||null==D.format||null==D.data&&null==D.url?(D=S(D),ra(D,H)):this.loadDescriptor(D,mxUtils.bind(this,function(aa){ra(xa(),H)}),mxUtils.bind(this,function(aa){this.handleError(aa,-mxResources.get("errorLoadingFile"))}))}}));var B=this.embedMessageSource||window.opener||window.parent;x="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";B.postMessage(x,"*");if("json"==urlParams.proto){var C=this.editor.graph.openLink;this.editor.graph.openLink=function(H,D,U){C.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",href:H,target:D,allowOpener:U}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,g,l,n){var v=document.createElement("button");-v.className="geEmbedBtn geBtn";v.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(v,c);n&&v.classList.add("gePrimaryBtn");mxEvent.addListener(v,"click",g);return v};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=-c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==-urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,-Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,-640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var g=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var n=JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(n));this.customLayoutConfig=n;this.hideDialog()}catch(v){this.handleError(v)}}),null,null,null,null,mxUtils.bind(this,function(l,-n){var v=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var x=n.value;n.value=JSON.stringify(JSON.parse(x));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=x}catch(B){this.handleError(B)}}));v.setAttribute("title","copy");v.className="geBtn";l.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(c,g){this.createTimeout(null,mxUtils.bind(this,function(l){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),v=mxUtils.bind(this,function(x){this.loadingOrgChart=!1;l.clear()&&this.handleError(x)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))n();else if(g||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",n,null,null,null,v)},null,null,null,v)},null,null,null,v)},null,null,null,v):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",n,null,null,null,v)}),onerror)};EditorUi.prototype.importCsv=function(c,g,l,n){this.loadOrgChartLayouts(mxUtils.bind(this,-function(){this.doImportCsv(c,g,l)}),n)};EditorUi.prototype.doImportCsv=function(c,g,l){try{var n=c.split("\n"),v=[],x=[],B=[],C={};if(0<n.length){var H={};l=null!=l?l:this.editor.graph;var D=null,U=null,S=null,V=null,t=null,z=null,L=null,K="whiteSpace=wrap;html=1;",M=null,m=null,y="",F="auto",N="auto",O=!1,P=null,T=null,Q=40,R=40,W=100,X=0,Y=mxUtils.bind(this,function(){null!=g?g(ka):(l.setSelectionCells(ka),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,-function(){this.chromelessResize(!0)}),0)}),Z=l.getFreeInsertPoint(),ba=Z.x,ea=Z.y;Z=ea;var ha=null,fa="auto";m=null;for(var la=[],oa=null,pa=null,va=0;va<n.length&&"#"==n[va].charAt(0);){c=n[va].replace(/\r$/,"");for(va++;va<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[va].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(n[va].substring(1)),va++;if("#"!=c.charAt(1)){var ta=c.indexOf(":");if(0<ta){var ma=mxUtils.trim(c.substring(1,ta)),ia=mxUtils.trim(c.substring(ta+1));"label"==ma?ha=Graph.sanitizeHtml(ia):-"labelname"==ma&&0<ia.length&&"-"!=ia?t=ia:"labels"==ma&&0<ia.length&&"-"!=ia?L=JSON.parse(ia):"style"==ma?U=ia:"parentstyle"==ma?K=ia:"unknownStyle"==ma&&"-"!=ia?z=ia:"stylename"==ma&&0<ia.length&&"-"!=ia?V=ia:"styles"==ma&&0<ia.length&&"-"!=ia?S=JSON.parse(ia):"vars"==ma&&0<ia.length&&"-"!=ia?D=JSON.parse(ia):"identity"==ma&&0<ia.length&&"-"!=ia?M=ia:"parent"==ma&&0<ia.length&&"-"!=ia?m=ia:"namespace"==ma&&0<ia.length&&"-"!=ia?y=ia:"width"==ma?F=ia:"height"==ma?N=ia:"collapsed"==ma&&"-"!=ia?O="true"==-ia:"left"==ma&&0<ia.length?P=ia:"top"==ma&&0<ia.length?T=ia:"ignore"==ma?pa=ia.split(","):"connect"==ma?la.push(JSON.parse(ia)):"link"==ma?oa=ia:"padding"==ma?X=parseFloat(ia):"edgespacing"==ma?Q=parseFloat(ia):"nodespacing"==ma?R=parseFloat(ia):"levelspacing"==ma?W=parseFloat(ia):"layout"==ma&&(fa=ia)}}}if(null==n[va])throw Error(mxResources.get("invalidOrMissingFile"));var qa=this.editor.csvToArray(n[va].replace(/\r$/,""));ta=c=null;ma=[];for(ia=0;ia<qa.length;ia++)M==qa[ia]&&(c=ia),m==qa[ia]&&-(ta=ia),ma.push(mxUtils.trim(qa[ia]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ha&&(ha="%"+ma[0]+"%");if(null!=la)for(var ua=0;ua<la.length;ua++)null==H[la[ua].to]&&(H[la[ua].to]={});M=[];for(ia=va+1;ia<n.length;ia++){var xa=this.editor.csvToArray(n[ia].replace(/\r$/,""));if(null==xa){var ra=40<n[ia].length?n[ia].substring(0,40)+"...":n[ia];throw Error(ra+" ("+ia+"):\n"+mxResources.get("containsValidationErrors"));}0<xa.length&&M.push(xa)}l.model.beginUpdate();try{for(ia=-0;ia<M.length;ia++){xa=M[ia];var aa=null,na=null!=c?y+xa[c]:null;n=!1;null!=na&&(aa=l.model.getCell(na),n=null==aa||0<=mxUtils.indexOf(v,aa));var ja=new mxCell(ha,new mxGeometry(ba,Z,0,0),U||"whiteSpace=wrap;html=1;");ja.collapsed=O;ja.vertex=!0;ja.id=na;null==aa||n||l.model.setCollapsed(aa,O);for(var sa=0;sa<xa.length;sa++)l.setAttributeForCell(ja,ma[sa],xa[sa]),null==aa||n||l.setAttributeForCell(aa,ma[sa],xa[sa]);if(null!=t&&null!=L){var Ca=L[ja.getAttribute(t)];null!=Ca&&(l.labelChanged(ja,Ca),-null==aa||n||l.cellLabelChanged(aa,Ca))}if(null!=V&&null!=S){var Fa=S[ja.getAttribute(V)];null!=Fa&&(ja.style=Fa)}l.setAttributeForCell(ja,"placeholders","1");ja.style=l.replacePlaceholders(ja,ja.style,D);null==aa||n?l.fireEvent(new mxEventObject("cellsInserted","cells",[ja])):(l.model.setStyle(aa,ja.style),0>mxUtils.indexOf(B,aa)&&B.push(aa),l.fireEvent(new mxEventObject("cellsInserted","cells",[aa])));n=null!=aa;aa=ja;if(!n)for(ua=0;ua<la.length;ua++)H[la[ua].to][aa.getAttribute(la[ua].to)]=aa;-null!=oa&&"link"!=oa&&(l.setLinkForCell(aa,aa.getAttribute(oa)),l.setAttributeForCell(aa,oa,null));var Ba=l.getPreferredSizeForCell(aa);m=null!=ta?l.model.getCell(y+xa[ta]):null;if(aa.vertex){ra=null!=m?0:ba;va=null!=m?0:ea;null!=P&&null!=aa.getAttribute(P)&&(aa.geometry.x=ra+parseFloat(aa.getAttribute(P)));null!=T&&null!=aa.getAttribute(T)&&(aa.geometry.y=va+parseFloat(aa.getAttribute(T)));var da="@"==F.charAt(0)?aa.getAttribute(F.substring(1)):null;aa.geometry.width=null!=da&&"auto"!=da?parseFloat(aa.getAttribute(F.substring(1))):-"auto"==F||"auto"==da?Ba.width+X:parseFloat(F);var ca="@"==N.charAt(0)?aa.getAttribute(N.substring(1)):null;aa.geometry.height=null!=ca&&"auto"!=ca&&"width"!=N?parseFloat(ca):"auto"==N||"auto"==ca?Ba.height+X:"width"==N?aa.geometry.width:parseFloat(N);Z+=aa.geometry.height+R}n?(null==C[na]&&(C[na]=[]),C[na].push(aa)):(v.push(aa),null!=m?(m.style=l.replacePlaceholders(m,K,D),l.addCell(aa,m),x.push(m)):B.push(l.addCell(aa)))}for(ia=0;ia<x.length;ia++)da="@"==F.charAt(0)?x[ia].getAttribute(F.substring(1)):-null,ca="@"==N.charAt(0)?x[ia].getAttribute(N.substring(1)):null,"auto"!=F&&"auto"!=da||"auto"!=N&&"auto"!=ca||l.updateGroupBounds([x[ia]],X,!0);var wa=B.slice(),ka=B.slice();for(ua=0;ua<la.length;ua++){var za=la[ua];for(ia=0;ia<v.length;ia++){aa=v[ia];var ya=mxUtils.bind(this,function(Qa,cb,Na){var Ra=cb.getAttribute(Na.from);if(null!=Ra&&""!=Ra){Ra=Ra.split(",");for(var kb=0;kb<Ra.length;kb++){var Ua=H[Na.to][Ra[kb]];if(null==Ua&&null!=z){Ua=new mxCell(Ra[kb],new mxGeometry(ba,ea,0,0),z);Ua.style=-l.replacePlaceholders(cb,Ua.style,D);var Za=l.getPreferredSizeForCell(Ua);Ua.geometry.width=Za.width+X;Ua.geometry.height=Za.height+X;H[Na.to][Ra[kb]]=Ua;Ua.vertex=!0;Ua.id=Ra[kb];B.push(l.addCell(Ua))}if(null!=Ua){Za=Na.label;null!=Na.fromlabel&&(Za=(cb.getAttribute(Na.fromlabel)||"")+(Za||""));null!=Na.sourcelabel&&(Za=l.replacePlaceholders(cb,Na.sourcelabel,D)+(Za||""));null!=Na.tolabel&&(Za=(Za||"")+(Ua.getAttribute(Na.tolabel)||""));null!=Na.targetlabel&&(Za=(Za||"")+l.replacePlaceholders(Ua,-Na.targetlabel,D));var lb="target"==Na.placeholders==!Na.invert?Ua:Qa;lb=null!=Na.style?l.replacePlaceholders(lb,Na.style,D):l.createCurrentEdgeStyle();Za=l.insertEdge(null,null,Za||"",Na.invert?Ua:Qa,Na.invert?Qa:Ua,lb);if(null!=Na.labels)for(lb=0;lb<Na.labels.length;lb++){var Sa=Na.labels[lb],eb=new mxCell(Sa.label||lb,new mxGeometry(null!=Sa.x?Sa.x:0,null!=Sa.y?Sa.y:0,0,0),"resizable=0;html=1;");eb.vertex=!0;eb.connectable=!1;eb.geometry.relative=!0;null!=Sa.placeholders&&(eb.value=l.replacePlaceholders("target"==-Sa.placeholders==!Na.invert?Ua:Qa,eb.value,D));if(null!=Sa.dx||null!=Sa.dy)eb.geometry.offset=new mxPoint(null!=Sa.dx?Sa.dx:0,null!=Sa.dy?Sa.dy:0);Za.insert(eb)}if(null!=Na.data)for(var fb in Na.data)l.setAttributeForCell(Za,fb,Na.data[fb]);ka.push(Za);mxUtils.remove(Na.invert?Qa:Ua,wa)}}}});ya(aa,aa,za);if(null!=C[aa.id])for(sa=0;sa<C[aa.id].length;sa++)ya(aa,C[aa.id][sa],za)}}if(null!=pa)for(ia=0;ia<v.length;ia++)for(aa=v[ia],sa=0;sa<pa.length;sa++)l.setAttributeForCell(aa,mxUtils.trim(pa[sa]),-null);if(0<B.length){var Ga=new mxParallelEdgeLayout(l);Ga.spacing=Q;Ga.checkOverlap=!0;var Ka=function(){0<Ga.spacing&&Ga.execute(l.getDefaultParent());for(var Qa=0;Qa<B.length;Qa++){var cb=l.getCellGeometry(B[Qa]);cb.x=Math.round(l.snap(cb.x));cb.y=Math.round(l.snap(cb.y));"auto"==F&&(cb.width=Math.round(l.snap(cb.width)));"auto"==N&&(cb.height=Math.round(l.snap(cb.height)))}};if("["==fa.charAt(0)){var Wa=Y;l.view.validate();this.executeLayouts(l.createLayouts(JSON.parse(fa)),function(){Ka();Wa()});-Y=null}else if("circle"==fa){var Pa=new mxCircleLayout(l);Pa.disableEdgeStyle=!1;Pa.resetEdges=!1;var ob=Pa.isVertexIgnored;Pa.isVertexIgnored=function(Qa){return ob.apply(this,arguments)||0>mxUtils.indexOf(B,Qa)};this.executeLayout(function(){Pa.execute(l.getDefaultParent());Ka()},!0,Y);Y=null}else if("horizontaltree"==fa||"verticaltree"==fa||"auto"==fa&&ka.length==2*B.length-1&&1==wa.length){l.view.validate();var Xa=new mxCompactTreeLayout(l,"horizontaltree"==fa);Xa.levelDistance=R;Xa.edgeRouting=-!1;Xa.resetEdges=!1;Xa.sortEdges=!0;this.executeLayout(function(){Xa.execute(l.getDefaultParent(),0<wa.length?wa[0]:null)},!0,Y);Y=null}else if("horizontalflow"==fa||"verticalflow"==fa||"auto"==fa&&1==wa.length){l.view.validate();var $a=new mxHierarchicalLayout(l,"horizontalflow"==fa?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);$a.intraCellSpacing=R;$a.parallelEdgeSpacing=Q;$a.interRankCellSpacing=W;$a.disableEdgeStyle=!1;this.executeLayout(function(){$a.execute(l.getDefaultParent(),ka);-l.moveCells(ka,ba,ea)},!0,Y);Y=null}else if("orgchart"==fa){l.view.validate();var db=new mxOrgChartLayout(l,2,W,R),ib=db.isVertexIgnored;db.isVertexIgnored=function(Qa){return ib.apply(this,arguments)||0>mxUtils.indexOf(B,Qa)};this.executeLayout(function(){db.execute(l.getDefaultParent());Ka()},!0,Y);Y=null}else if("organic"==fa||"auto"==fa&&ka.length>B.length){l.view.validate();var ab=new mxFastOrganicLayout(l);ab.forceConstant=3*R;ab.disableEdgeStyle=!1;ab.resetEdges=!1;var ub=ab.isVertexIgnored;-ab.isVertexIgnored=function(Qa){return ub.apply(this,arguments)||0>mxUtils.indexOf(B,Qa)};this.executeLayout(function(){ab.execute(l.getDefaultParent());Ka()},!0,Y);Y=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=Y&&Y()}}catch(Qa){this.handleError(Qa)}};EditorUi.prototype.getSearch=function(c){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(g+=l+n+"="+urlParams[n],-l="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var g=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(l,n)&&(c=0==g?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],g++))}return c};EditorUi.prototype.showLinkDialog=function(c,g,l,n,v){c=new LinkDialog(this,-c,g,l,!0,n,v);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){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.m365&&g++;null!=this.gitHub&&g++;null!=this.gitLab&&g++;c&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();-this.updateActionStates();var c=this.getCurrentFile(),g=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);this.menus.get("viewZoom").setEnabled(g);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||-this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g);this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g);this.menus.get("edit").setEnabled(g);-this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();-return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var g=0;g<c.length;g++)this.libraryLoaded(c[g].file,c[g].images,c[g].title,null!=c[g].div?"none"!=c[g].div.style.display:c[g].expand)};var G=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){G.apply(this,arguments);var c=this.editor.graph,g=this.getCurrentFile(),l=-this.getSelectionState(),n=this.isDiagramActive(),v="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=g&&g.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&v);this.actions.get("redo").setEnabled(this.canRedo()&&v);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==l.edges.length||1==l.vertices.length));-this.actions.get("editConnectionPoints").setEnabled(n&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(n&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(n&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(n&&l.image&&0<l.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<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length);this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);this.actions.get("moveToFolder").setEnabled(null!=g);this.actions.get("makeCopy").setEnabled(null!=-g&&!g.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==g||!g.isRestricted()));this.actions.get("publishLink").setEnabled(null!=g&&!g.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);-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("none"!=this.diagramContainer.style.display);g.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 E=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);E.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,g,l,n,v,x,B,C){var H=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(g,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");-else if("svg"==l)c.hideDialog(),c.saveData(g,"svg",mxUtils.getXml(H.getSvg(n,v,x)),"image/svg+xml");else{var D=c.getFileData(!0,null,null,null,null,!0),U=H.getGraphBounds(),S=Math.floor(U.width*v/H.view.scale),V=Math.floor(U.height*v/H.view.scale);if(D.length<=MAX_REQUEST_SIZE&&S*V<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas()){var t={globalVars:H.getExportVariables()};C&&(t.grid={size:H.gridSize,steps:H.view.gridSteps,color:H.view.gridColor});c.saveRequest(g,-l,function(z,L){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(L||"0")+(null!=z?"&filename="+encodeURIComponent(z):"")+"&extras="+encodeURIComponent(JSON.stringify(t))+(0<B?"&dpi="+B:"")+"&bg="+(null!=n?n:"none")+"&w="+S+"&h="+V+"&border="+x+"&xml="+encodeURIComponent(D))})}else"png"==l?c.exportImage(v,null==n||"none"==n,!0,!1,!1,x,!0,!1,null,C,B):c.exportImage(v,!1,!0,!1,!1,x,!0,!1,"jpeg",C);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=-function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,g="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var n=c;this.currentPage!=this.pages[l]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),n.model.setRoot(this.pages[l].root));g+=this.pages[l].getName()+" "+n.getIndexableText()+" "}else g=c.getIndexableText();this.editor.graph.setEnabled(!0);return g};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var g={},l=document.createElement("div");-l.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";l.appendChild(n);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 x={};try{var B=mxSettings.getCustomLibraries();for(c=0;c<B.length;c++){var C=B[c];if("R"==-C.substring(0,1)){var H=JSON.parse(decodeURIComponent(C.substring(1)));x[H[0]]={id:H[0],title:H[1],downloadUrl:H[2]}}}}catch(D){}this.remoteInvoke("getCustomLibraries",null,null,function(D){v.innerText="";if(0==D.length)v.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var U=0;U<D.length;U++){var S=D[U];x[S.id]&&(g[S.id]=S);var V=this.addCheckbox(v,S.title,x[S.id]);(function(t,z){mxEvent.addListener(z,-"change",function(){this.checked?g[t.id]=t:delete g[t.id]})})(S,V)}},mxUtils.bind(this,function(D){v.innerText="";var U=document.createElement("div");U.style.padding="8px";U.style.textAlign="center";mxUtils.write(U,mxResources.get("error")+": ");mxUtils.write(U,null!=D&&null!=D.message?D.message:mxResources.get("unknownError"));v.appendChild(U)}));l.appendChild(v);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var D=0,U;for(U in g)null==-x[U]&&(D++,mxUtils.bind(this,function(S){this.remoteInvoke("getFileContent",[S.downloadUrl],null,mxUtils.bind(this,function(V){D--;0==D&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,V,S)),this.showSidebar()}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){D--;0==D&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[U]));for(U in x)g[U]||this.closeLibrary(new RemoteLibrary(this,null,x[U]));0==D&&this.spinner.stop()}),-null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.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 g=0;g<this.remoteInvokeQueue.length;g++)c.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var g=c.msgMarkers,l=this.remoteInvokeCallbacks[g.callbackId];if(null==l)throw Error("No callback for "+(null!=g?g.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[g.callbackId]=-null};EditorUi.prototype.remoteInvoke=function(c,g,l,n,v){var x=!0,B=window.setTimeout(mxUtils.bind(this,function(){x=!1;v({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),C=mxUtils.bind(this,function(){window.clearTimeout(B);x&&n.apply(this,arguments)}),H=mxUtils.bind(this,function(){window.clearTimeout(B);x&&v.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:C,error:H});c=JSON.stringify({event:"remoteInvoke",-funtionName:c,functionArgs:g,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,g){var l=mxUtils.bind(this,function(D,U){var S={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=U?S.error={errResp:U}:null!=D&&(S.resp=D);this.remoteWin.postMessage(JSON.stringify(S),"*")});try{var n=c.funtionName,v=this.remoteInvokableFns[n];if(null!=v&&"function"===typeof this[n]){if(v.allowedDomains){for(var x=-!1,B=0;B<v.allowedDomains.length;B++)if(g=="https://"+v.allowedDomains[B]){x=!0;break}if(!x){l(null,"Invalid Call: "+n+" is not allowed.");return}}var C=c.functionArgs;Array.isArray(C)||(C=[]);if(v.isAsync)C.push(function(){l(Array.prototype.slice.apply(arguments))}),C.push(function(D){l(null,D||"Unkown Error")}),this[n].apply(this,C);else{var H=this[n].apply(this,C);l([H])}}else l(null,"Invalid Call: "+n+" is not found.")}catch(D){l(null,"Invalid Call: An error occurred, "+D.message)}};EditorUi.prototype.openDatabase=-function(c,g){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var n=l.open("database",2);n.onupgradeneeded=function(v){try{var x=n.result;1>v.oldVersion&&x.createObjectStore("objects",{keyPath:"key"});2>v.oldVersion&&(x.createObjectStore("files",{keyPath:"title"}),x.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(B){null!=g&&g(B)}};n.onsuccess=mxUtils.bind(this,function(v){try{var x=n.result;-this.database=x;EditorUi.migrateStorageFiles&&(StorageFile.migrate(x),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)&&"1"==urlParams.forceMigration){var C=document.createElement("iframe");C.style.display="none";C.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);-document.body.appendChild(C);var H=!0,D=!1,U,S=0,V=mxUtils.bind(this,function(){D=!0;this.setDatabaseItem(".drawioMigrated3",!0);C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),t=mxUtils.bind(this,function(){S++;z()}),z=mxUtils.bind(this,function(){try{if(S>=U.length)V();else{var K=U[S];StorageFile.getFileContent(this,K,mxUtils.bind(this,function(M){null==M||".scratchpad"==K&&M==this.emptyLibraryXml?C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",-funtionName:"getLocalStorageFile",functionArgs:[K]}),"*"):t()}),t)}}catch(M){console.log(M)}}),L=mxUtils.bind(this,function(K){try{this.setDatabaseItem(null,[{title:K.title,size:K.data.length,lastModified:Date.now(),type:K.isLib?"L":"F"},{title:K.title,data:K.data}],t,t,["filesInfo","files"])}catch(M){console.log(M)}});B=mxUtils.bind(this,function(K){try{if(K.source==C.contentWindow){var M={};try{M=JSON.parse(K.data)}catch(m){}"init"==M.event?(C.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),-"*"),C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=M.event||D||(H?null!=M.resp&&0<M.resp.length&&null!=M.resp[0]?(U=M.resp[0],H=!1,z()):V():null!=M.resp&&0<M.resp.length&&null!=M.resp[0]?L(M.resp[0]):t())}}catch(m){console.log(m)}});window.addEventListener("message",B)}})));c(x);x.onversionchange=function(){x.close()}}catch(B){null!=g?g(B):null!=window.console&&console.warn(B)}});n.onerror=g;n.onblocked=function(){}}catch(v){null!=-g?g(v):null!=window.console&&console.error(v)}else null!=g&&g(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,g,l,n,v){this.openDatabase(mxUtils.bind(this,function(x){try{v=v||"objects";Array.isArray(v)||(v=[v],c=[c],g=[g]);var B=x.transaction(v,"readwrite");B.oncomplete=l;B.onerror=n;for(x=0;x<v.length;x++)B.objectStore(v[x]).put(null!=c&&null!=c[x]?{key:c[x],data:g[x]}:g[x])}catch(C){null!=n&&n(C)}}),n)};EditorUi.prototype.removeDatabaseItem=-function(c,g,l,n){this.openDatabase(mxUtils.bind(this,function(v){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var x=v.transaction(n,"readwrite");x.oncomplete=g;x.onerror=l;for(v=0;v<n.length;v++)x.objectStore(n[v]).delete(c[v])}catch(B){null!=l&&l(B)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,g,l,n){this.openDatabase(mxUtils.bind(this,function(v){try{n=n||"objects";var x=v.transaction([n],"readonly").objectStore(n).get(c);x.onsuccess=function(){g(x.result)};x.onerror=l}catch(B){null!=-l&&l(B)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";var v=n.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),x=[];v.onsuccess=function(B){null==B.target.result?c(x):(x.push(B.target.result.value),B.target.result.continue())};v.onerror=g}catch(B){null!=g&&g(B)}}),g)};EditorUi.prototype.getDatabaseItemKeys=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";-var v=n.transaction([l],"readonly").objectStore(l).getAllKeys();v.onsuccess=function(){c(v.result)};v.onerror=g}catch(x){null!=g&&g(x)}}),g)};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,g){var l=this.getCurrentFile();null!=l?l.getComments(c,g):c([])};EditorUi.prototype.addComment=function(c,g,l){var n=this.getCurrentFile();null!=n?n.addComment(c,g,l):g(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,g){var l=this.getCurrentFile();-return null!=l?l.newComment(c,g):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,g){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,g):g({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.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,g,l,n,v,x,B,C){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,g,l,n,v,x,B,C)};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,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,g)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};-EditorUi.prototype.exportToCanvas=function(c,g,l,n,v,x,B,C,H,D,U,S,V,t,z,L){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,g,l,n,v,x,B,C,H,D,U,S,V,t,z,L)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,g,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,-g,l,n)};EditorUi.prototype.convertImageToDataUri=function(c,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,g)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,g,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,g,l,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");-return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,g,l,n,v){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,g,l,n,v)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],g=0;g<localStorage.length;g++){var l=localStorage.key(g),n=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<n.length){var v=-"<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(v||n)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var g=localStorage.getItem(c);return{title:c,data:g,isLib:"<mxlibrary>"===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,f,k,d,p,q){function u(){for(var z=B.getElementsByTagName("div"),L=0,K=0;K<z.length;K++)"none"!=z[K].style.display&&z[K].parentNode==B&&L++;C.style.display=0==L?"block":"none"}function A(z,L,K,M){function m(){L.removeChild(N);L.removeChild(O);F.style.display="block";y.style.display="block"}n={div:L,comment:z,saveCallback:K,deleteOnCancel:M};var y=L.querySelector(".geCommentTxt"),F=L.querySelector(".geCommentActionsList"),N=document.createElement("textarea");N.className=-"geCommentEditTxtArea";N.style.minHeight=y.offsetHeight+"px";N.value=z.content;L.insertBefore(N,y);var O=document.createElement("div");O.className="geCommentEditBtns";var P=mxUtils.button(mxResources.get("cancel"),function(){M?(L.parentNode.removeChild(L),u()):m();n=null});P.className="geCommentEditBtn";O.appendChild(P);var T=mxUtils.button(mxResources.get("save"),function(){y.innerText="";z.content=N.value;mxUtils.write(y,z.content);m();K(z);n=null});mxEvent.addListener(N,"keydown",mxUtils.bind(this,-function(Q){mxEvent.isConsumed(Q)||((mxEvent.isControlDown(Q)||mxClient.IS_MAC&&mxEvent.isMetaDown(Q))&&13==Q.keyCode?(T.click(),mxEvent.consume(Q)):27==Q.keyCode&&(P.click(),mxEvent.consume(Q)))}));T.focus();T.className="geCommentEditBtn gePrimaryBtn";O.appendChild(T);L.insertBefore(O,y);F.style.display="none";y.style.display="none";N.focus()}function J(z,L){L.innerText="";z=new Date(z.modifiedDate);var K=b.timeSince(z);null==K&&(K=mxResources.get("lessThanAMinute"));mxUtils.write(L,mxResources.get("timeAgo",-[K],"{1} ago"));L.setAttribute("title",z.toLocaleDateString()+" "+z.toLocaleTimeString())}function I(z){var L=document.createElement("img");L.className="geCommentBusyImg";L.src=IMAGE_PATH+"/spin.gif";z.appendChild(L);z.busyImg=L}function G(z){z.style.border="1px solid red";z.busyImg.parentNode==z&&z.removeChild(z.busyImg)}function E(z){z.style.border="";z.busyImg.parentNode==z&&z.removeChild(z.busyImg)}function c(z,L,K,M,m){function y(W,X,Y){var Z=document.createElement("li");Z.className="geCommentAction";-var ba=document.createElement("a");ba.className="geCommentActionLnk";mxUtils.write(ba,W);Z.appendChild(ba);mxEvent.addListener(ba,"click",function(ea){X(ea,z);ea.preventDefault();mxEvent.consume(ea)});R.appendChild(Z);Y&&(Z.style.display="none")}function F(){function W(Z){X.push(Y);if(null!=Z.replies)for(var ba=0;ba<Z.replies.length;ba++)Y=Y.nextSibling,W(Z.replies[ba])}var X=[],Y=O;W(z);return{pdiv:Y,replies:X}}function N(W,X,Y,Z,ba){function ea(){I(oa);z.addReply(la,function(pa){la.id=pa;z.replies.push(la);-E(oa);Y&&Y()},function(pa){ha();G(oa);b.handleError(pa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,ba)}function ha(){A(la,oa,function(pa){ea()},!0)}var fa=F().pdiv,la=b.newComment(W,b.getCurrentUser());la.pCommentId=z.id;null==z.replies&&(z.replies=[]);var oa=c(la,z.replies,fa,M+1);X?ha():ea()}if(m||!z.isResolved){C.style.display="none";var O=document.createElement("div");O.className="geCommentContainer";O.setAttribute("data-commentId",z.id);O.style.marginLeft=20*M+-5+"px";z.isResolved&&(v.style.opacity="0.7");var P=document.createElement("div");P.className="geCommentHeader";var T=document.createElement("img");T.className="geCommentUserImg";T.src=null!=z.user&&null!=z.user.pictureUrl?z.user.pictureUrl:Editor.userImage;P.appendChild(T);T=document.createElement("div");T.className="geCommentHeaderTxt";P.appendChild(T);var Q=document.createElement("div");Q.className="geCommentUsername";mxUtils.write(Q,null!=z.user?z.user.displayName:mxResources.get("unknownUser"));-T.appendChild(Q);Q=document.createElement("div");Q.className="geCommentDate";Q.setAttribute("data-commentId",z.id);J(z,Q);T.appendChild(Q);O.appendChild(P);P=document.createElement("div");P.className="geCommentTxt";mxUtils.write(P,z.content||"");O.appendChild(P);z.isLocked&&(O.style.opacity="0.5");P=document.createElement("div");P.className="geCommentActions";var R=document.createElement("ul");R.className="geCommentActionsList";P.appendChild(R);g||z.isLocked||0!=M&&!l||y(mxResources.get("reply"),-function(){N("",!0)},z.isResolved);T=b.getCurrentUser();null==T||null==z.user||T.id!=z.user.id||g||z.isLocked||(y(mxResources.get("edit"),function(){function W(){A(z,O,function(){I(O);z.editComment(z.content,function(){E(O)},function(X){G(O);W();b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}W()},z.isResolved),y(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){I(O);z.deleteComment(function(W){if(!0===W){W=O.querySelector(".geCommentTxt");-W.innerText="";mxUtils.write(W,mxResources.get("msgDeleted"));var X=O.querySelectorAll(".geCommentAction");for(W=0;W<X.length;W++)X[W].parentNode.removeChild(X[W]);E(O);O.style.opacity="0.5"}else{X=F(z).replies;for(W=0;W<X.length;W++)B.removeChild(X[W]);for(W=0;W<L.length;W++)if(L[W]==z){L.splice(W,1);break}C.style.display=0==B.getElementsByTagName("div").length?"block":"none"}},function(W){G(O);b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},z.isResolved));-g||z.isLocked||0!=M||y(z.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(W){function X(){var Y=W.target;Y.innerText="";z.isResolved=!z.isResolved;mxUtils.write(Y,z.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Z=z.isResolved?"none":"",ba=F(z).replies,ea="light-dark("+(z.isResolved?"ghostWhite":"white")+", transparent)",ha=0;ha<ba.length;ha++){ba[ha].style.backgroundColor=ea;for(var fa=ba[ha].querySelectorAll(".geCommentAction"),la=0;la<fa.length;la++)fa[la]!=-Y.parentNode&&(fa[la].style.display=Z);S||(ba[ha].style.display="none")}u()}z.isResolved?N(mxResources.get("reOpened")+": ",!0,X,!1,!0):N(mxResources.get("markedAsResolved"),!1,X,!0)});O.appendChild(P);null!=K?B.insertBefore(O,K.nextSibling):B.appendChild(O);for(K=0;null!=z.replies&&K<z.replies.length;K++)P=z.replies[K],P.isResolved=z.isResolved,c(P,z.replies,null,M+1,m);null!=n&&(n.comment.id==z.id?(m=z.content,z.content=n.comment.content,A(z,O,n.saveCallback,n.deleteOnCancel),z.content=m):null==+this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(v){c||this.handleError(v)}};EditorUi.prototype.installMessageHandler=function(c){var g=null,l=!1,n=!1,v=null,x=null,B=mxUtils.bind(this,function(N,J){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):+this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,B);mxEvent.addListener(window,"message",mxUtils.bind(this,function(N){if(N.source==(this.embedMessageSource||window.opener||window.parent)){var J=N.data,T=null,V=mxUtils.bind(this,function(ba){if(null!=ba&&"function"===typeof ba.charAt&&"<"!=ba.charAt(0))try{Editor.isPngDataUrl(ba)?ba=Editor.extractGraphModelFromPng(ba):"data:image/svg+xml;base64,"==ba.substring(0,26)?ba=atob(ba.substring(26)):"data:image/svg+xml;utf8,"==ba.substring(0,+24)&&(ba=ba.substring(24)),null!=ba&&(""==ba.trim()?ba=null:"%"==ba.charAt(0)?ba=decodeURIComponent(ba):"<"!=ba.charAt(0)&&(ba=Graph.decompress(ba)))}catch(pa){}return ba});if("json"==urlParams.proto){var t=!1;try{J=JSON.parse(J),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[N],"data",[J])}catch(ba){J=null}try{var z=J;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 L=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(ba){null!=ba?C.postMessage(JSON.stringify({event:"prompt",value:ba,message:J}),"*"):C.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),+"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){C.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(L.container,300,80,!0,!1);L.init();return}if("draft"==J.action){var K=V(J.xml);this.spinner.stop();L=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),K,mxUtils.bind(this,function(){this.hideDialog();C.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,+function(){this.hideDialog();C.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();C.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(L.container,640,480,!0,!1,mxUtils.bind(this,function(ba){ba&&this.actions.get("exit").funct()}));try{L.init()}catch(ba){C.postMessage(JSON.stringify({event:"draft",+error:ba.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var M=1==J.enableRecent,m=1==J.enableSearch,y=1==J.enableCustomTemp;L=new NewDialog(this,!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,function(ba,pa,Ba,xa){ba=ba||this.emptyDiagramXml;null!=J.callback?C.postMessage(JSON.stringify({event:"template",xml:ba,blank:ba==this.emptyDiagramXml,name:pa,tempUrl:Ba,libs:xa,builtIn:!0,message:J}),"*"):(c(ba,N,ba!=this.emptyDiagramXml,J.toSketch),this.editor.modified||+this.clearStatus())}),null,null,null,null,null,null,null,M?mxUtils.bind(this,function(ba){this.remoteInvoke("getRecentDiagrams",[null],null,ba,function(){ba(null,"Network Error!")})}):null,m?mxUtils.bind(this,function(ba,pa){this.remoteInvoke("searchDiagrams",[ba,null],null,pa,function(){pa(null,"Network Error!")})}):null,mxUtils.bind(this,function(ba,pa,Ba){C.postMessage(JSON.stringify({event:"template",docUrl:ba,info:pa,name:Ba}),"*")}),null,null,y?mxUtils.bind(this,function(ba){this.remoteInvoke("getCustomTemplates",+null,null,ba,function(){ba({},0)})}):null,1==J.withoutType,null,J.templatesOnly);this.showDialog(L.container,620,460,!0,!1,mxUtils.bind(this,function(ba){null!=this.sidebar&&this.sidebar.hideTooltip();ba&&!J.noExitOnCancel&&this.actions.get("exit").funct()}));L.init();return}if("textContent"==J.action){var E=this.getDiagramTextContent();C.postMessage(JSON.stringify({event:"textContent",data:E,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){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 P=null!=J.messageKey?mxResources.get(J.messageKey):J.message;null==J.show||J.show?this.spinner.spin(document.body,P):this.spinner.stop();return}if("exit"==J.action){this.actions.get("exit").funct();return}if("viewport"==J.action){if(null!=J.viewport){var O=this.editor.graph,+Q=O.view.translate.x,U=O.view.translate.y;this.embedViewport=J.viewport;O.refresh();this.diagramContainer.scrollTop-=(U-O.view.translate.y)*O.view.scale;this.diagramContainer.scrollLeft-=(Q-O.view.translate.x)*O.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==J.action){var R=this.actions.get(J.actionName);null!=R&&R.funct();return}if("resetEditor"==J.action){O=this.editor.graph;O.isEditing()&&O.stopEditing(!1);this.hideCurrentMenu();O.popupMenuHandler.hideMenu();+O.clearSelection();return}if("fit"==J.action){O=this.editor.graph;var S=O.maxFitScale;O.maxFitScale=null!=J.maxScale?J.maxScale:1;O.fit(null!=J.border?J.border:16,null,null,null,null,!0);O.maxFitScale=S;P=this.createLoadMessage("fit");P.message=J;C.postMessage(JSON.stringify(P),"*");return}if("fullscreenChanged"==J.action){var W=null;try{var X=this.diagramContainer.getAttribute("data-scrollState");null!=X&&(this.diagramContainer.removeAttribute("data-scrollState"),W=JSON.parse(X))}catch(ba){}Editor.inlineFullscreen=+J.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=W&&this.restoreScrollState(W);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 Y=null!=J.xml?J.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);O=this.editor.graph;var Z=mxUtils.bind(this,function(ba,pa){if(J.withSvg)J.withSvg=+!1,this.getEmbeddedSvg(Y,this.editor.graph,null,!0,function(xa){Z(ba,xa)},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 Ba=this.createLoadMessage("export");Ba.format=J.format;Ba.message=z;Ba.data=ba;Ba.svg=pa;Ba.xml=Y;C.postMessage(JSON.stringify(Ba),"*")}}),aa=mxUtils.bind(this,function(ba){null==ba&&(ba=Editor.blankImage);"xmlpng"==J.format&&(ba=Editor.writeGraphModelToPng(ba,"tEXt","mxfile",encodeURIComponent(Y)));+O!=this.editor.graph&&O.container.parentNode.removeChild(O.container);Z(ba)}),fa=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ia=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=fa){var ba=O.getGlobalVariable;O=this.createTemporaryGraph(O.getStylesheet());for(var pa,Ba=0;Ba<this.pages.length;Ba++)if(this.pages[Ba].getId()==fa){pa=this.updatePageRoot(this.pages[Ba]);break}null==pa&&(pa=+this.currentPage);O.getGlobalVariable=function(wa){return"page"==wa?pa.getName():"pagenumber"==wa?1:ba.apply(this,arguments)};document.body.appendChild(O.container);O.model.setRoot(pa.root)}if(null!=J.layerIds){var xa=O.model,ca=xa.getChildCells(xa.getRoot()),da={};for(Ba=0;Ba<J.layerIds.length;Ba++)da[J.layerIds[Ba]]=!0;for(Ba=0;Ba<ca.length;Ba++)xa.setVisible(ca[Ba],da[ca[Ba].id]||!1)}Ba=null;J.keepTheme&&(Ba=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(wa){aa(wa.toDataURL("image/png"))}),+J.width,null,J.background,mxUtils.bind(this,function(){aa(null)}),null,null,J.scale,J.transparent,J.shadow,null,O,J.border,null,J.grid,Ba,J.size)});null!=J.xml&&0<J.xml.length&&(l=!0,this.setFileData(Y),l=!1);ia()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==J.format?"1":"0")+(null!=fa?"&pageId="+fa:"")+(null!=J.layerIds&&0<J.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:J.layerIds})):"")+(null!=J.scale?"&scale="+J.scale:"")+"&base64=1&xml="+encodeURIComponent(Y))).send(mxUtils.bind(this,+function(ba){200<=ba.getStatus()&&299>=ba.getStatus()?Z("data:image/png;base64,"+ba.getText()):aa(null)}),mxUtils.bind(this,function(){aa(null)}))}}else if(ia=mxUtils.bind(this,function(){var ba=this.createLoadMessage("export");ba.message=J;if("html2"==J.format||"html"==J.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var pa=this.getXmlFileData();ba.xml=mxUtils.getXml(pa);ba.data=this.getFileData(null,null,!0,null,null,null,pa);ba.format=J.format}else if("html"==J.format)pa=+this.editor.getGraphXml(),ba.data=this.getHtml(pa,this.editor.graph),ba.xml=mxUtils.getXml(pa),ba.format=J.format;else{if("xml"==J.format)ba.xml=this.getFileData(!0),ba.format=J.format,C.postMessage(JSON.stringify(ba),"*");else{mxSvgCanvas2D.prototype.foAltText=null;pa=null!=J.background?J.background:this.editor.graph.background;pa==mxConstants.NONE&&(pa=null);ba.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ba.format="svg";var Ba=mxUtils.bind(this,function(ca){this.editor.graph.setEnabled(!0);+this.spinner.stop();ba.data=J.asText?ca:Editor.createSvgDataUri(ca);C.postMessage(JSON.stringify(ba),"*")}),xa="auto";J.keepTheme&&(xa=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(xa=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)){xa=null;if(this.isAutoDarkMode()||Editor.isDarkMode())xa="auto";null!=J.theme&&(xa=J.theme);this.getEmbeddedSvg(ba.xml,this.editor.graph,null,!0,Ba,null,null,J.embedImages,+pa,J.scale,J.border,J.shadow,xa)}}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),pa=this.editor.graph.getSvg(pa,J.scale,J.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||J.shadow,null,xa),(this.editor.graph.shadowVisible||J.shadow)&&this.editor.graph.addSvgShadow(pa),this.embedFonts(pa,mxUtils.bind(this,function(ca){J.embedImages||null==J.embedImages?this.editor.convertImages(ca,+mxUtils.bind(this,function(da){Ba(mxUtils.getXml(da))})):Ba(mxUtils.getXml(ca))}))}return}C.postMessage(JSON.stringify(ba),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ea=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ea.apply(this,arguments);ia()}}l=!0;this.setFileData(J.xml);l=!1;this.editor.graph.mathEnabled||ia()}else ia();return}if("load"==J.action){t=J.toSketch;n=1==J.autosave;this.embedDiffSync=null!=J.diffSync&&!1!==J.diffSync;this.embedDiffSyncPatchOnly=+"object"===typeof J.diffSync&&null!=J.diffSync&&1==J.diffSync.patchOnly;this.embedExportProtocol=1==J.exportProtocol;var ma=J.sourceMetadata||null;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+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=J.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=J.noSaveBtn);if(null!=J.rough){var na=Editor.sketchMode;this.doSetSketchMode(J.rough);na!=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.scale){var ua=J.scale,ta=null!=J.scaleBorder?J.scaleBorder:this.embedExportBorder||0,sa=null!=J.border?J.border:0;T=mxUtils.bind(this,function(){var ba=this.editor.graph,pa=ba.getGraphBounds();if(0<pa.width&&0<pa.height){var Ba=ba.view.scale;ba.view.scaleAndTranslate(ua,ba.view.translate.x+sa-pa.x/Ba+ta/ua,ba.view.translate.y+sa-pa.y/Ba+ta/ua)}})}else if(null!=+J.fit){var la=null!=J.border?J.border:0,ja=J.maxFitScale||1;T=mxUtils.bind(this,function(){var ba=this.editor.graph,pa=ba.maxFitScale;ba.maxFitScale=ja;ba.fit(la,null,null,null,null,!0);ba.maxFitScale=pa})}if(null!=J.rect){sa=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 qa=J.maxFitScale,va=J.rect.width+2*sa,ya=J.rect.height+2*sa;T=mxUtils.bind(this,function(){var ba=mxUtils.getDocumentSize();va=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,va):va,ba.width-80);ba=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ya):ya,ba.height-80);this.diagramContainer.style.width=va+"px";this.diagramContainer.style.height=ba+"px";var pa=this.editor.graph;ba=pa.maxFitScale;pa.maxFitScale=qa;pa.fit(2*sa,+null,null,null,null,null,ya);this.setPageVisible(!1);if(null!=this.minInlineWidth&&pa.getGraphBounds().width<this.minInlineWidth){var Ba=pa.container.scrollTop;this.resetScrollbars();pa.container.scrollTop=Ba}pa.maxFitScale=ba;pa.container.scrollTop-=sa;pa.container.scrollLeft-=sa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[J]));pa.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&+(this.formatWindow.window.div.style.top=pa.container.style.top);var xa=pa.getGraphBounds();pa.container.clientWidth>xa.width+2*sa&&(pa.container.scrollLeft=xa.x+(xa.width+sa-pa.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&this.setEmbedTitle(J.title);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(ba){}if(null!=J.xmlpng)J=this.extractGraphModelFromPng(J.xmlpng);else if(null!=J.descriptor){if(J=+J.descriptor,"mermaid"==J.format){window.isMermaidEnabled?this.parseMermaidDiagram(J.data,null,mxUtils.bind(this,function(ba){c(ba,N,null,t);ba=this.createLoadMessage("load");ba.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);ba.message=z;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ba),"*");if(null!=ma&&null!=ma.key&&null!=ma.value){ba=this.editor.graph;var pa=ba.getModel().getRoot();if(null!=pa){ba.getModel().beginUpdate();try{ba.setAttributeForCell(pa,+ma.key,ma.value)}finally{ba.getModel().endUpdate()}}}}),mxUtils.bind(this,function(ba){this.handleError(ba)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else J=J.xml}else{if("merge"==J.action){var ra=this.getCurrentFile();null!=ra&&(K=V(J.xml),null!=K&&""!=K&&ra.mergeFile(new LocalFile(this,K),mxUtils.bind(this,function(){this.embedDiffSync&&(x=this.clonePages(this.pages),v=Da());C.postMessage(JSON.stringify({event:"merge",+message:J}),"*")}),function(ba){C.postMessage(JSON.stringify({event:"merge",message:J,error:ba}),"*")}))}else if("patch"==J.action){if(ra=this.getCurrentFile(),null!=ra&&null!=J.patch)try{l=!0,ra.patch([J.patch]),this.embedDiffSync&&null!=x&&(x=this.applyPatches(x,[J.patch])),v=Da(),l=!1,X={event:"patch",message:J},W=this.getHashValueForPages(this.pages),X.checksum=W,null!=J.checksum&&J.checksum!=W&&(X.checksumMismatch=!0),C.postMessage(JSON.stringify(X),"*")}catch(ba){l=!1,C.postMessage(JSON.stringify({event:"patch",+message:J,error:ba.message||ba.toString()}),"*")}}else if("getDiff"==J.action){P={event:"getDiff",message:J};if(this.embedDiffSync&&null!=x){var ha=this.clonePages(this.pages);P.patch=this.diffPages(x,ha);P.checksum=this.getHashValueForPages(ha)}else P.xml=Da();C.postMessage(JSON.stringify(P),"*")}else"resetDiff"==J.action?this.embedDiffSync&&(null!=J.xml?(K=V(J.xml),ra=this.getCurrentFile(),null!=K&&""!=K&&null!=ra&&ra.mergeFile(new LocalFile(this,K),mxUtils.bind(this,function(){x=this.clonePages(this.pages);+v=Da();C.postMessage(JSON.stringify({event:"resetDiff",message:J,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ba){C.postMessage(JSON.stringify({event:"resetDiff",message:J,error:ba}),"*")})):(x=this.clonePages(this.pages),v=Da(),C.postMessage(JSON.stringify({event:"resetDiff",message:J,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==J.action?this.handleRemoteInvokeReady(C):"remoteInvoke"==J.action?this.handleRemoteInvoke(J,N.origin):"remoteInvokeResponse"==+J.action?this.handleRemoteInvokeResponse(J):C.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(J)}),"*");return}}catch(ba){this.handleError(ba)}}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())}),oa=mxUtils.bind(this,function(ba,pa){l=!0;try{c(ba,pa,null,t)}catch(Ba){this.handleError(Ba)}l=!1;null!=urlParams.modified&&this.clearStatus();v=Da();this.embedDiffSync&&+(x=this.clonePages(this.pages));n&&null==g&&(g=mxUtils.bind(this,function(Ba,xa){Ba=Da();if(Ba!=v&&!l){xa=this.createLoadMessage("autosave");xa.message=z;if(this.embedDiffSync&&null!=x){var ca=this.clonePages(this.pages),da=this.diffPages(x,ca);mxUtils.isEmptyObject(da)?xa.xml=Ba:(xa.patch=da,xa.checksum=this.getHashValueForPages(ca),this.embedDiffSyncPatchOnly||(xa.xml=Ba));x=ca}else xa.xml=Ba;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(xa),"*")}v=Ba}),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));null!=T&&T();if("1"==+urlParams.returnbounds||"json"==urlParams.proto)pa=this.createLoadMessage("load"),pa.xml=ba,this.embedDiffSync&&null!=this.pages&&(pa.checksum=this.getHashValueForPages(this.pages)),C.postMessage(JSON.stringify(pa),"*")});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,34)?(V="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(ba){oa(ba,N)},mxUtils.bind(this,function(ba){this.handleError(ba)}),+V)):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(ba){4==ba.readyState&&(200<=ba.status&&299>=ba.status&&"<mxGraphModel"==ba.responseText.substring(0,13)?oa(ba.responseText,N):this.handleError({message:413==ba.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=J&&"function"===+typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(ba){oa(ba)}),mxUtils.bind(this,function(ba){this.handleError(ba)})):null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=V(J),oa(J,N)):this.loadDescriptor(J,mxUtils.bind(this,function(ba){oa(Da(),N)}),mxUtils.bind(this,function(ba){this.handleError(ba,mxResources.get("errorLoadingFile"))}))}}));var C=this.embedMessageSource||window.opener||window.parent;B="json"==urlParams.proto?+JSON.stringify({event:"init"}):urlParams.ready||"ready";C.postMessage(B,"*");if("json"==urlParams.proto){var G=this.editor.graph.openLink;this.editor.graph.openLink=function(N,J,T){G.apply(this,arguments);C.postMessage(JSON.stringify({event:"openLink",href:N,target:J,allowOpener:T}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,g,l,n){var v=document.createElement("button");v.className="geEmbedBtn geBtn";v.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(v,c);n&&v.classList.add("gePrimaryBtn");+mxEvent.addListener(v,"click",g);return v};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&+this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey++"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==+urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};+EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var g=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var n=JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(n));this.customLayoutConfig=n;this.hideDialog()}catch(v){this.handleError(v)}}),null,null,null,null,mxUtils.bind(this,function(l,n){var v=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var x=+n.value;n.value=JSON.stringify(JSON.parse(x));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=x}catch(B){this.handleError(B)}}));v.setAttribute("title","copy");v.className="geBtn";l.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(c,g){this.createTimeout(null,mxUtils.bind(this,function(l){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),v=mxUtils.bind(this,function(x){this.loadingOrgChart=!1;l.clear()&&this.handleError(x)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))n();else if(g||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",n,null,null,null,v)},null,null,null,v)},null,null,null,v)},null,null,null,v):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",n,null,null,null,v)}),onerror)};EditorUi.prototype.importCsv=function(c,g,l,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,g,l)}),n)};EditorUi.prototype.doImportCsv=function(c,+g,l){try{var n=c.split("\n"),v=[],x=[],B=[],C={};if(0<n.length){var G={};l=null!=l?l:this.editor.graph;var N=null,J=null,T=null,V=null,t=null,z=null,L=null,K="whiteSpace=wrap;html=1;",M=null,m=null,y="",E="auto",P="auto",O=!1,Q=null,U=null,R=40,S=40,W=100,X=0,Y=mxUtils.bind(this,function(){null!=g?g(ka):(l.setSelectionCells(ka),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=l.getFreeInsertPoint(),+aa=Z.x,fa=Z.y;Z=fa;var ia=null,ea="auto";m=null;for(var ma=[],na=null,ua=null,ta=0;ta<n.length&&"#"==n[ta].charAt(0);){c=n[ta].replace(/\r$/,"");for(ta++;ta<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[ta].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(n[ta].substring(1)),ta++;if("#"!=c.charAt(1)){var sa=c.indexOf(":");if(0<sa){var la=mxUtils.trim(c.substring(1,sa)),ja=mxUtils.trim(c.substring(sa+1));"label"==la?ia=Graph.sanitizeHtml(ja):"labelname"==la&&0<ja.length&&"-"!=ja?t=ja:"labels"==la&&+0<ja.length&&"-"!=ja?L=JSON.parse(ja):"style"==la?J=ja:"parentstyle"==la?K=ja:"unknownStyle"==la&&"-"!=ja?z=ja:"stylename"==la&&0<ja.length&&"-"!=ja?V=ja:"styles"==la&&0<ja.length&&"-"!=ja?T=JSON.parse(ja):"vars"==la&&0<ja.length&&"-"!=ja?N=JSON.parse(ja):"identity"==la&&0<ja.length&&"-"!=ja?M=ja:"parent"==la&&0<ja.length&&"-"!=ja?m=ja:"namespace"==la&&0<ja.length&&"-"!=ja?y=ja:"width"==la?E=ja:"height"==la?P=ja:"collapsed"==la&&"-"!=ja?O="true"==ja:"left"==la&&0<ja.length?Q=ja:"top"==la&&0<ja.length?+U=ja:"ignore"==la?ua=ja.split(","):"connect"==la?ma.push(JSON.parse(ja)):"link"==la?na=ja:"padding"==la?X=parseFloat(ja):"edgespacing"==la?R=parseFloat(ja):"nodespacing"==la?S=parseFloat(ja):"levelspacing"==la?W=parseFloat(ja):"layout"==la&&(ea=ja)}}}if(null==n[ta])throw Error(mxResources.get("invalidOrMissingFile"));var qa=this.editor.csvToArray(n[ta].replace(/\r$/,""));sa=c=null;la=[];for(ja=0;ja<qa.length;ja++)M==qa[ja]&&(c=ja),m==qa[ja]&&(sa=ja),la.push(mxUtils.trim(qa[ja]).replace(/[^a-z0-9]+/ig,+"_").replace(/^\d+/,"").replace(/_+$/,""));null==ia&&(ia="%"+la[0]+"%");if(null!=ma)for(var va=0;va<ma.length;va++)null==G[ma[va].to]&&(G[ma[va].to]={});M=[];for(ja=ta+1;ja<n.length;ja++){var ya=this.editor.csvToArray(n[ja].replace(/\r$/,""));if(null==ya){var ra=40<n[ja].length?n[ja].substring(0,40)+"...":n[ja];throw Error(ra+" ("+ja+"):\n"+mxResources.get("containsValidationErrors"));}0<ya.length&&M.push(ya)}l.model.beginUpdate();try{for(ja=0;ja<M.length;ja++){ya=M[ja];var ha=null,Da=null!=c?y+ya[c]:+null;n=!1;null!=Da&&(ha=l.model.getCell(Da),n=null==ha||0<=mxUtils.indexOf(v,ha));var oa=new mxCell(ia,new mxGeometry(aa,Z,0,0),J||"whiteSpace=wrap;html=1;");oa.collapsed=O;oa.vertex=!0;oa.id=Da;null==ha||n||l.model.setCollapsed(ha,O);for(var ba=0;ba<ya.length;ba++)l.setAttributeForCell(oa,la[ba],ya[ba]),null==ha||n||l.setAttributeForCell(ha,la[ba],ya[ba]);if(null!=t&&null!=L){var pa=L[oa.getAttribute(t)];null!=pa&&(l.labelChanged(oa,pa),null==ha||n||l.cellLabelChanged(ha,pa))}if(null!=V&&null!=T){var Ba=+T[oa.getAttribute(V)];null!=Ba&&(oa.style=Ba)}l.setAttributeForCell(oa,"placeholders","1");oa.style=l.replacePlaceholders(oa,oa.style,N);null==ha||n?l.fireEvent(new mxEventObject("cellsInserted","cells",[oa])):(l.model.setStyle(ha,oa.style),0>mxUtils.indexOf(B,ha)&&B.push(ha),l.fireEvent(new mxEventObject("cellsInserted","cells",[ha])));n=null!=ha;ha=oa;if(!n)for(va=0;va<ma.length;va++)G[ma[va].to][ha.getAttribute(ma[va].to)]=ha;null!=na&&"link"!=na&&(l.setLinkForCell(ha,ha.getAttribute(na)),l.setAttributeForCell(ha,+na,null));var xa=l.getPreferredSizeForCell(ha);m=null!=sa?l.model.getCell(y+ya[sa]):null;if(ha.vertex){ra=null!=m?0:aa;ta=null!=m?0:fa;null!=Q&&null!=ha.getAttribute(Q)&&(ha.geometry.x=ra+parseFloat(ha.getAttribute(Q)));null!=U&&null!=ha.getAttribute(U)&&(ha.geometry.y=ta+parseFloat(ha.getAttribute(U)));var ca="@"==E.charAt(0)?ha.getAttribute(E.substring(1)):null;ha.geometry.width=null!=ca&&"auto"!=ca?parseFloat(ha.getAttribute(E.substring(1))):"auto"==E||"auto"==ca?xa.width+X:parseFloat(E);var da=+"@"==P.charAt(0)?ha.getAttribute(P.substring(1)):null;ha.geometry.height=null!=da&&"auto"!=da&&"width"!=P?parseFloat(da):"auto"==P||"auto"==da?xa.height+X:"width"==P?ha.geometry.width:parseFloat(P);Z+=ha.geometry.height+S}n?(null==C[Da]&&(C[Da]=[]),C[Da].push(ha)):(v.push(ha),null!=m?(m.style=l.replacePlaceholders(m,K,N),l.addCell(ha,m),x.push(m)):B.push(l.addCell(ha)))}for(ja=0;ja<x.length;ja++)ca="@"==E.charAt(0)?x[ja].getAttribute(E.substring(1)):null,da="@"==P.charAt(0)?x[ja].getAttribute(P.substring(1)):+null,"auto"!=E&&"auto"!=ca||"auto"!=P&&"auto"!=da||l.updateGroupBounds([x[ja]],X,!0);var wa=B.slice(),ka=B.slice();for(va=0;va<ma.length;va++){var Aa=ma[va];for(ja=0;ja<v.length;ja++){ha=v[ja];var za=mxUtils.bind(this,function(Qa,cb,Na){var Ra=cb.getAttribute(Na.from);if(null!=Ra&&""!=Ra){Ra=Ra.split(",");for(var kb=0;kb<Ra.length;kb++){var Ua=G[Na.to][Ra[kb]];if(null==Ua&&null!=z){Ua=new mxCell(Ra[kb],new mxGeometry(aa,fa,0,0),z);Ua.style=l.replacePlaceholders(cb,Ua.style,N);var Za=l.getPreferredSizeForCell(Ua);+Ua.geometry.width=Za.width+X;Ua.geometry.height=Za.height+X;G[Na.to][Ra[kb]]=Ua;Ua.vertex=!0;Ua.id=Ra[kb];B.push(l.addCell(Ua))}if(null!=Ua){Za=Na.label;null!=Na.fromlabel&&(Za=(cb.getAttribute(Na.fromlabel)||"")+(Za||""));null!=Na.sourcelabel&&(Za=l.replacePlaceholders(cb,Na.sourcelabel,N)+(Za||""));null!=Na.tolabel&&(Za=(Za||"")+(Ua.getAttribute(Na.tolabel)||""));null!=Na.targetlabel&&(Za=(Za||"")+l.replacePlaceholders(Ua,Na.targetlabel,N));var lb="target"==Na.placeholders==!Na.invert?Ua:Qa;lb=+null!=Na.style?l.replacePlaceholders(lb,Na.style,N):l.createCurrentEdgeStyle();Za=l.insertEdge(null,null,Za||"",Na.invert?Ua:Qa,Na.invert?Qa:Ua,lb);if(null!=Na.labels)for(lb=0;lb<Na.labels.length;lb++){var Sa=Na.labels[lb],eb=new mxCell(Sa.label||lb,new mxGeometry(null!=Sa.x?Sa.x:0,null!=Sa.y?Sa.y:0,0,0),"resizable=0;html=1;");eb.vertex=!0;eb.connectable=!1;eb.geometry.relative=!0;null!=Sa.placeholders&&(eb.value=l.replacePlaceholders("target"==Sa.placeholders==!Na.invert?Ua:Qa,eb.value,N));if(null!=+Sa.dx||null!=Sa.dy)eb.geometry.offset=new mxPoint(null!=Sa.dx?Sa.dx:0,null!=Sa.dy?Sa.dy:0);Za.insert(eb)}if(null!=Na.data)for(var fb in Na.data)l.setAttributeForCell(Za,fb,Na.data[fb]);ka.push(Za);mxUtils.remove(Na.invert?Qa:Ua,wa)}}}});za(ha,ha,Aa);if(null!=C[ha.id])for(ba=0;ba<C[ha.id].length;ba++)za(ha,C[ha.id][ba],Aa)}}if(null!=ua)for(ja=0;ja<v.length;ja++)for(ha=v[ja],ba=0;ba<ua.length;ba++)l.setAttributeForCell(ha,mxUtils.trim(ua[ba]),null);if(0<B.length){var Ga=new mxParallelEdgeLayout(l);+Ga.spacing=R;Ga.checkOverlap=!0;var Ka=function(){0<Ga.spacing&&Ga.execute(l.getDefaultParent());for(var Qa=0;Qa<B.length;Qa++){var cb=l.getCellGeometry(B[Qa]);cb.x=Math.round(l.snap(cb.x));cb.y=Math.round(l.snap(cb.y));"auto"==E&&(cb.width=Math.round(l.snap(cb.width)));"auto"==P&&(cb.height=Math.round(l.snap(cb.height)))}};if("["==ea.charAt(0)){var Wa=Y;l.view.validate();this.executeLayouts(l.createLayouts(JSON.parse(ea)),function(){Ka();Wa()});Y=null}else if("circle"==ea){var Pa=new mxCircleLayout(l);+Pa.disableEdgeStyle=!1;Pa.resetEdges=!1;var ob=Pa.isVertexIgnored;Pa.isVertexIgnored=function(Qa){return ob.apply(this,arguments)||0>mxUtils.indexOf(B,Qa)};this.executeLayout(function(){Pa.execute(l.getDefaultParent());Ka()},!0,Y);Y=null}else if("horizontaltree"==ea||"verticaltree"==ea||"auto"==ea&&ka.length==2*B.length-1&&1==wa.length){l.view.validate();var Xa=new mxCompactTreeLayout(l,"horizontaltree"==ea);Xa.levelDistance=S;Xa.edgeRouting=!1;Xa.resetEdges=!1;Xa.sortEdges=!0;this.executeLayout(function(){Xa.execute(l.getDefaultParent(),+0<wa.length?wa[0]:null)},!0,Y);Y=null}else if("horizontalflow"==ea||"verticalflow"==ea||"auto"==ea&&1==wa.length){l.view.validate();var $a=new mxHierarchicalLayout(l,"horizontalflow"==ea?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);$a.intraCellSpacing=S;$a.parallelEdgeSpacing=R;$a.interRankCellSpacing=W;$a.disableEdgeStyle=!1;this.executeLayout(function(){$a.execute(l.getDefaultParent(),ka);l.moveCells(ka,aa,fa)},!0,Y);Y=null}else if("orgchart"==ea){l.view.validate();var db=new mxOrgChartLayout(l,+2,W,S),ib=db.isVertexIgnored;db.isVertexIgnored=function(Qa){return ib.apply(this,arguments)||0>mxUtils.indexOf(B,Qa)};this.executeLayout(function(){db.execute(l.getDefaultParent());Ka()},!0,Y);Y=null}else if("organic"==ea||"auto"==ea&&ka.length>B.length){l.view.validate();var ab=new mxFastOrganicLayout(l);ab.forceConstant=3*S;ab.disableEdgeStyle=!1;ab.resetEdges=!1;var ub=ab.isVertexIgnored;ab.isVertexIgnored=function(Qa){return ub.apply(this,arguments)||0>mxUtils.indexOf(B,Qa)};this.executeLayout(function(){ab.execute(l.getDefaultParent());+Ka()},!0,Y);Y=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=Y&&Y()}}catch(Qa){this.handleError(Qa)}};EditorUi.prototype.getSearch=function(c){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(g+=l+n+"="+urlParams[n],l="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var g=0<c.indexOf("?")?1:0;+if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(l,n)&&(c=0==g?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],g++))}return c};EditorUi.prototype.showLinkDialog=function(c,g,l,n,v){c=new LinkDialog(this,c,g,l,!0,n,v);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){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.m365&&g++;null!=this.gitHub&&g++;null!=this.gitLab&&g++;c&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),g=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);+this.menus.get("viewZoom").setEnabled(g);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));+c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g);this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g);this.menus.get("edit").setEnabled(g);this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);+this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var g=+0;g<c.length;g++)this.libraryLoaded(c[g].file,c[g].images,c[g].title,null!=c[g].div?"none"!=c[g].div.style.display:c[g].expand)};var F=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){F.apply(this,arguments);var c=this.editor.graph,g=this.getCurrentFile(),l=this.getSelectionState(),n=this.isDiagramActive(),v="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=g&&g.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&v);this.actions.get("redo").setEnabled(this.canRedo()&&+v);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(n&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(n&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(n&&+l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(n&&l.image&&0<l.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<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length);+this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);this.actions.get("moveToFolder").setEnabled(null!=g);this.actions.get("makeCopy").setEnabled(null!=g&&!g.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==g||!g.isRestricted()));this.actions.get("publishLink").setEnabled(null!=g&&!g.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&+!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);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("none"!=this.diagramContainer.style.display);g.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 D=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);D.apply(this,arguments)};+null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,g,l,n,v,x,B,C){var G=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(g,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(g,"svg",mxUtils.getXml(G.getSvg(n,v,x)),"image/svg+xml");else{var N=c.getFileData(!0,null,null,null,null,!0),J=G.getGraphBounds(),T=Math.floor(J.width*v/G.view.scale),V=Math.floor(J.height*v/G.view.scale);+if(N.length<=MAX_REQUEST_SIZE&&T*V<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas()){var t={globalVars:G.getExportVariables()};C&&(t.grid={size:G.gridSize,steps:G.view.gridSteps,color:G.view.gridColor});c.saveRequest(g,l,function(z,L){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(L||"0")+(null!=z?"&filename="+encodeURIComponent(z):"")+"&extras="+encodeURIComponent(JSON.stringify(t))+(0<B?"&dpi="+B:"")+"&bg="+(null!=n?n:"none")+"&w="+T+"&h="+V+"&border="++x+"&xml="+encodeURIComponent(N))})}else"png"==l?c.exportImage(v,null==n||"none"==n,!0,!1,!1,x,!0,!1,null,C,B):c.exportImage(v,!1,!0,!1,!1,x,!0,!1,"jpeg",C);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,g="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var n=c;this.currentPage!=this.pages[l]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),+n.model.setRoot(this.pages[l].root));g+=this.pages[l].getName()+" "+n.getIndexableText()+" "}else g=c.getIndexableText();this.editor.graph.setEnabled(!0);return g};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var g={},l=document.createElement("div");l.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";l.appendChild(n);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 x={};try{var B=mxSettings.getCustomLibraries();for(c=0;c<B.length;c++){var C=B[c];if("R"==C.substring(0,1)){var G=JSON.parse(decodeURIComponent(C.substring(1)));x[G[0]]={id:G[0],title:G[1],downloadUrl:G[2]}}}}catch(N){}this.remoteInvoke("getCustomLibraries",null,null,function(N){v.innerText="";if(0==N.length)v.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'++mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var J=0;J<N.length;J++){var T=N[J];x[T.id]&&(g[T.id]=T);var V=this.addCheckbox(v,T.title,x[T.id]);(function(t,z){mxEvent.addListener(z,"change",function(){this.checked?g[t.id]=t:delete g[t.id]})})(T,V)}},mxUtils.bind(this,function(N){v.innerText="";var J=document.createElement("div");J.style.padding="8px";J.style.textAlign="center";mxUtils.write(J,mxResources.get("error")+": ");mxUtils.write(J,null!=N&&null!=N.message?N.message:+mxResources.get("unknownError"));v.appendChild(J)}));l.appendChild(v);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var N=0,J;for(J in g)null==x[J]&&(N++,mxUtils.bind(this,function(T){this.remoteInvoke("getFileContent",[T.downloadUrl],null,mxUtils.bind(this,function(V){N--;0==N&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,V,T)),this.showSidebar()}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}),+mxUtils.bind(this,function(){N--;0==N&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[J]));for(J in x)g[J]||this.closeLibrary(new RemoteLibrary(this,null,x[J]));0==N&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.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 g=0;g<this.remoteInvokeQueue.length;g++)c.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var g=c.msgMarkers,l=this.remoteInvokeCallbacks[g.callbackId];+if(null==l)throw Error("No callback for "+(null!=g?g.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[g.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,g,l,n,v){var x=!0,B=window.setTimeout(mxUtils.bind(this,function(){x=!1;v({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),C=mxUtils.bind(this,function(){window.clearTimeout(B);x&&n.apply(this,arguments)}),G=mxUtils.bind(this,+function(){window.clearTimeout(B);x&&v.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:C,error:G});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:g,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,g){var l=mxUtils.bind(this,function(N,J){var T={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=J?+T.error={errResp:J}:null!=N&&(T.resp=N);this.remoteWin.postMessage(JSON.stringify(T),"*")});try{var n=c.funtionName,v=this.remoteInvokableFns[n];if(null!=v&&"function"===typeof this[n]){if(v.allowedDomains){for(var x=!1,B=0;B<v.allowedDomains.length;B++)if(g=="https://"+v.allowedDomains[B]){x=!0;break}if(!x){l(null,"Invalid Call: "+n+" is not allowed.");return}}var C=c.functionArgs;Array.isArray(C)||(C=[]);if(v.isAsync)C.push(function(){l(Array.prototype.slice.apply(arguments))}),C.push(function(N){l(null,+N||"Unkown Error")}),this[n].apply(this,C);else{var G=this[n].apply(this,C);l([G])}}else l(null,"Invalid Call: "+n+" is not found.")}catch(N){l(null,"Invalid Call: An error occurred, "+N.message)}};EditorUi.prototype.openDatabase=function(c,g){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var n=l.open("database",2);n.onupgradeneeded=function(v){try{var x=n.result;1>v.oldVersion&&x.createObjectStore("objects",{keyPath:"key"});2>v.oldVersion&&+(x.createObjectStore("files",{keyPath:"title"}),x.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(B){null!=g&&g(B)}};n.onsuccess=mxUtils.bind(this,function(v){try{var x=n.result;this.database=x;EditorUi.migrateStorageFiles&&(StorageFile.migrate(x),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)&&"1"==urlParams.forceMigration){var C=document.createElement("iframe");C.style.display="none";C.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(C);var G=!0,N=!1,J,T=0,V=mxUtils.bind(this,function(){N=!0;this.setDatabaseItem(".drawioMigrated3",!0);C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),t=mxUtils.bind(this,function(){T++;z()}),+z=mxUtils.bind(this,function(){try{if(T>=J.length)V();else{var K=J[T];StorageFile.getFileContent(this,K,mxUtils.bind(this,function(M){null==M||".scratchpad"==K&&M==this.emptyLibraryXml?C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[K]}),"*"):t()}),t)}}catch(M){console.log(M)}}),L=mxUtils.bind(this,function(K){try{this.setDatabaseItem(null,[{title:K.title,size:K.data.length,lastModified:Date.now(),type:K.isLib?"L":"F"},{title:K.title,+data:K.data}],t,t,["filesInfo","files"])}catch(M){console.log(M)}});B=mxUtils.bind(this,function(K){try{if(K.source==C.contentWindow){var M={};try{M=JSON.parse(K.data)}catch(m){}"init"==M.event?(C.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=M.event||N||(G?null!=M.resp&&0<M.resp.length&&null!=M.resp[0]?(J=M.resp[0],G=!1,z()):V():null!=+M.resp&&0<M.resp.length&&null!=M.resp[0]?L(M.resp[0]):t())}}catch(m){console.log(m)}});window.addEventListener("message",B)}})));c(x);x.onversionchange=function(){x.close()}}catch(B){null!=g?g(B):null!=window.console&&console.warn(B)}});n.onerror=g;n.onblocked=function(){}}catch(v){null!=g?g(v):null!=window.console&&console.error(v)}else null!=g&&g(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,g,l,n,v){this.openDatabase(mxUtils.bind(this,function(x){try{v=+v||"objects";Array.isArray(v)||(v=[v],c=[c],g=[g]);var B=x.transaction(v,"readwrite");B.oncomplete=l;B.onerror=n;for(x=0;x<v.length;x++)B.objectStore(v[x]).put(null!=c&&null!=c[x]?{key:c[x],data:g[x]}:g[x])}catch(C){null!=n&&n(C)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,g,l,n){this.openDatabase(mxUtils.bind(this,function(v){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var x=v.transaction(n,"readwrite");x.oncomplete=g;x.onerror=l;for(v=0;v<n.length;v++)x.objectStore(n[v]).delete(c[v])}catch(B){null!=+l&&l(B)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,g,l,n){this.openDatabase(mxUtils.bind(this,function(v){try{n=n||"objects";var x=v.transaction([n],"readonly").objectStore(n).get(c);x.onsuccess=function(){g(x.result)};x.onerror=l}catch(B){null!=l&&l(B)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";var v=n.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),x=[];v.onsuccess=function(B){null==+B.target.result?c(x):(x.push(B.target.result.value),B.target.result.continue())};v.onerror=g}catch(B){null!=g&&g(B)}}),g)};EditorUi.prototype.getDatabaseItemKeys=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";var v=n.transaction([l],"readonly").objectStore(l).getAllKeys();v.onsuccess=function(){c(v.result)};v.onerror=g}catch(x){null!=g&&g(x)}}),g)};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,g){var l=this.getCurrentFile();null!=l?l.getComments(c,g):c([])};EditorUi.prototype.addComment=function(c,g,l){var n=this.getCurrentFile();null!=n?n.addComment(c,g,l):g(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,g){var l=this.getCurrentFile();return null!=l?l.newComment(c,g):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=+function(c,g){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,g):g({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.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=+function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,g,l,n,v,x,B,C){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,g,l,n,v,x,B,C)};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,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,g)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,g,l,n,v,x,B,C,G,N,J,T,V,t,z,L){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,g,l,n,v,x,B,C,G,N,J,T,V,t,z,L)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");+return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,g,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,g,l,n)};EditorUi.prototype.convertImageToDataUri=function(c,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,g)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=+function(c,g,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,g,l,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,g,l,n,v){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,g,l,n,v)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=+urlParams.forceMigration)return null;for(var c=[],g=0;g<localStorage.length;g++){var l=localStorage.key(g),n=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<n.length){var v="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(v||n)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;+var g=localStorage.getItem(c);return{title:c,data:g,isLib:"<mxlibrary>"===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();+var CommentsWindow=function(b,f,k,d,p,q){function u(){for(var z=B.getElementsByTagName("div"),L=0,K=0;K<z.length;K++)"none"!=z[K].style.display&&z[K].parentNode==B&&L++;C.style.display=0==L?"block":"none"}function A(z,L,K,M){function m(){L.removeChild(P);L.removeChild(O);E.style.display="block";y.style.display="block"}n={div:L,comment:z,saveCallback:K,deleteOnCancel:M};var y=L.querySelector(".geCommentTxt"),E=L.querySelector(".geCommentActionsList"),P=document.createElement("textarea");P.className=+"geCommentEditTxtArea";P.style.minHeight=y.offsetHeight+"px";P.value=z.content;L.insertBefore(P,y);var O=document.createElement("div");O.className="geCommentEditBtns";var Q=mxUtils.button(mxResources.get("cancel"),function(){M?(L.parentNode.removeChild(L),u()):m();n=null});Q.className="geCommentEditBtn";O.appendChild(Q);var U=mxUtils.button(mxResources.get("save"),function(){y.innerText="";z.content=P.value;mxUtils.write(y,z.content);m();K(z);n=null});mxEvent.addListener(P,"keydown",mxUtils.bind(this,+function(R){mxEvent.isConsumed(R)||((mxEvent.isControlDown(R)||mxClient.IS_MAC&&mxEvent.isMetaDown(R))&&13==R.keyCode?(U.click(),mxEvent.consume(R)):27==R.keyCode&&(Q.click(),mxEvent.consume(R)))}));U.focus();U.className="geCommentEditBtn gePrimaryBtn";O.appendChild(U);L.insertBefore(O,y);E.style.display="none";y.style.display="none";P.focus()}function I(z,L){L.innerText="";z=new Date(z.modifiedDate);var K=b.timeSince(z);null==K&&(K=mxResources.get("lessThanAMinute"));mxUtils.write(L,mxResources.get("timeAgo",+[K],"{1} ago"));L.setAttribute("title",z.toLocaleDateString()+" "+z.toLocaleTimeString())}function H(z){var L=document.createElement("img");L.className="geCommentBusyImg";L.src=IMAGE_PATH+"/spin.gif";z.appendChild(L);z.busyImg=L}function F(z){z.style.border="1px solid red";z.busyImg.parentNode==z&&z.removeChild(z.busyImg)}function D(z){z.style.border="";z.busyImg.parentNode==z&&z.removeChild(z.busyImg)}function c(z,L,K,M,m){function y(W,X,Y){var Z=document.createElement("li");Z.className="geCommentAction";+var aa=document.createElement("a");aa.className="geCommentActionLnk";mxUtils.write(aa,W);Z.appendChild(aa);mxEvent.addListener(aa,"click",function(fa){X(fa,z);fa.preventDefault();mxEvent.consume(fa)});S.appendChild(Z);Y&&(Z.style.display="none")}function E(){function W(Z){X.push(Y);if(null!=Z.replies)for(var aa=0;aa<Z.replies.length;aa++)Y=Y.nextSibling,W(Z.replies[aa])}var X=[],Y=O;W(z);return{pdiv:Y,replies:X}}function P(W,X,Y,Z,aa){function fa(){H(na);z.addReply(ma,function(ua){ma.id=ua;z.replies.push(ma);+D(na);Y&&Y()},function(ua){ia();F(na);b.handleError(ua,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,aa)}function ia(){A(ma,na,function(ua){fa()},!0)}var ea=E().pdiv,ma=b.newComment(W,b.getCurrentUser());ma.pCommentId=z.id;null==z.replies&&(z.replies=[]);var na=c(ma,z.replies,ea,M+1);X?ia():fa()}if(m||!z.isResolved){C.style.display="none";var O=document.createElement("div");O.className="geCommentContainer";O.setAttribute("data-commentId",z.id);O.style.marginLeft=20*M++5+"px";z.isResolved&&(v.style.opacity="0.7");var Q=document.createElement("div");Q.className="geCommentHeader";var U=document.createElement("img");U.className="geCommentUserImg";U.src=null!=z.user&&null!=z.user.pictureUrl?z.user.pictureUrl:Editor.userImage;Q.appendChild(U);U=document.createElement("div");U.className="geCommentHeaderTxt";Q.appendChild(U);var R=document.createElement("div");R.className="geCommentUsername";mxUtils.write(R,null!=z.user?z.user.displayName:mxResources.get("unknownUser"));+U.appendChild(R);R=document.createElement("div");R.className="geCommentDate";R.setAttribute("data-commentId",z.id);I(z,R);U.appendChild(R);O.appendChild(Q);Q=document.createElement("div");Q.className="geCommentTxt";mxUtils.write(Q,z.content||"");O.appendChild(Q);z.isLocked&&(O.style.opacity="0.5");Q=document.createElement("div");Q.className="geCommentActions";var S=document.createElement("ul");S.className="geCommentActionsList";Q.appendChild(S);g||z.isLocked||0!=M&&!l||y(mxResources.get("reply"),+function(){P("",!0)},z.isResolved);U=b.getCurrentUser();null==U||null==z.user||U.id!=z.user.id||g||z.isLocked||(y(mxResources.get("edit"),function(){function W(){A(z,O,function(){H(O);z.editComment(z.content,function(){D(O)},function(X){F(O);W();b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}W()},z.isResolved),y(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){H(O);z.deleteComment(function(W){if(!0===W){W=O.querySelector(".geCommentTxt");+W.innerText="";mxUtils.write(W,mxResources.get("msgDeleted"));var X=O.querySelectorAll(".geCommentAction");for(W=0;W<X.length;W++)X[W].parentNode.removeChild(X[W]);D(O);O.style.opacity="0.5"}else{X=E(z).replies;for(W=0;W<X.length;W++)B.removeChild(X[W]);for(W=0;W<L.length;W++)if(L[W]==z){L.splice(W,1);break}C.style.display=0==B.getElementsByTagName("div").length?"block":"none"}},function(W){F(O);b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},z.isResolved));+g||z.isLocked||0!=M||y(z.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(W){function X(){var Y=W.target;Y.innerText="";z.isResolved=!z.isResolved;mxUtils.write(Y,z.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Z=z.isResolved?"none":"",aa=E(z).replies,fa="light-dark("+(z.isResolved?"ghostWhite":"white")+", transparent)",ia=0;ia<aa.length;ia++){aa[ia].style.backgroundColor=fa;for(var ea=aa[ia].querySelectorAll(".geCommentAction"),ma=0;ma<ea.length;ma++)ea[ma]!=+Y.parentNode&&(ea[ma].style.display=Z);T||(aa[ia].style.display="none")}u()}z.isResolved?P(mxResources.get("reOpened")+": ",!0,X,!1,!0):P(mxResources.get("markedAsResolved"),!1,X,!0)});O.appendChild(Q);null!=K?B.insertBefore(O,K.nextSibling):B.appendChild(O);for(K=0;null!=z.replies&&K<z.replies.length;K++)Q=z.replies[K],Q.isResolved=z.isResolved,c(Q,z.replies,null,M+1,m);null!=n&&(n.comment.id==z.id?(m=z.content,z.content=n.comment.content,A(z,O,n.saveCallback,n.deleteOnCancel),z.content=m):null==n.comment.id&&n.comment.pCommentId==z.id&&(B.appendChild(n.div),A(n.comment,n.div,n.saveCallback,n.deleteOnCancel)));return O}}var g=!b.canComment(),l=b.canReplyToReplies(),n=null,v=document.createElement("div");v.className="geCommentsWin";var x=EditorUi.compactUi?"26px":"30px",B=document.createElement("div");B.className="geCommentsList";B.style.bottom=parseInt(x)+7+"px";v.appendChild(B);var C=document.createElement("span");C.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(C,-mxResources.get("noCommentsFound"));var H=document.createElement("div");H.className="geToolbarContainer geCommentsToolbar";H.style.height=x;H.style.padding="3px 4px 4px 4px";x=document.createElement("a");x.className="geButton";if(!g){var D=x.cloneNode();D.style.backgroundImage="url("+Editor.plusImage+")";D.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(D,"click",function(z){function L(){A(K,M,function(m){I(M);b.addComment(m,function(y){m.id=y;V.push(m);E(M)},function(y){G(M);-L();b.handleError(y,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var K=b.newComment("",b.getCurrentUser()),M=c(K,V,null,0);L();z.preventDefault();mxEvent.consume(z)});H.appendChild(D)}var U=x.cloneNode();U.style.backgroundImage="url("+Editor.checkImage+")";U.setAttribute("title",mxResources.get("showResolved"));var S=!1;mxEvent.addListener(U,"click",function(z){(S=!S)?U.classList.add("geActiveItem"):U.classList.remove("geActiveItem");t();z.preventDefault();mxEvent.consume(z)});-H.appendChild(U);b.commentsRefreshNeeded()&&(D=x.cloneNode(),D.style.backgroundImage="url("+Editor.refreshImage+")",D.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(D,"click",function(z){t();z.preventDefault();mxEvent.consume(z)}),H.appendChild(D));b.commentsSaveNeeded()&&(x=x.cloneNode(),x.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',x.setAttribute("title",mxResources.get("save")),x.className="geButton geAdaptiveAsset",mxEvent.addListener(x,-"click",function(z){q();z.preventDefault();mxEvent.consume(z)}),H.appendChild(x));v.appendChild(H);var V=[],t=mxUtils.bind(this,function(){this.hasError=!1;if(null!=n)try{n.div=n.div.cloneNode(!0);var z=n.div.querySelector(".geCommentEditTxtArea"),L=n.div.querySelector(".geCommentEditBtns");n.comment.content=z.value;z.parentNode.removeChild(z);L.parentNode.removeChild(L)}catch(K){b.handleError(K)}B.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+-mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(K){function M(m){if(null!=m){m.sort(function(F,N){return new Date(F.modifiedDate)-new Date(N.modifiedDate)});for(var y=0;y<m.length;y++)M(m[y].replies)}}K.sort(function(m,y){return new Date(m.modifiedDate)-new Date(y.modifiedDate)});B.innerText="";B.appendChild(C);C.style.display="block";V=K;for(K=0;K<V.length;K++)M(V[K].replies),c(V[K],V,null,0,S);null!=n&&null==n.comment.id&&-null==n.comment.pCommentId&&(B.appendChild(n.div),A(n.comment,n.div,n.saveCallback,n.deleteOnCancel))},mxUtils.bind(this,function(K){B.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(K&&K.message?": "+K.message:""));this.hasError=!0})):B.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});t();this.refreshComments=t;H=mxUtils.bind(this,function(){function z(y){var F=K[y.id];if(null!=F)for(J(y,F),F=0;null!=y.replies&&F<y.replies.length;F++)z(y.replies[F])}if(this.window.isVisible()){for(var L=-B.querySelectorAll(".geCommentDate"),K={},M=0;M<L.length;M++){var m=L[M];K[m.getAttribute("data-commentId")]=m}for(M=0;M<V.length;M++)z(V[M])}});setInterval(H,6E4);this.refreshCommentsTime=H;this.window=new mxWindow(mxResources.get("comments"),v,f,k,d,p,!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,k,d,p,q,u,A,J,I,G){var E=document.createElement("div");E.style.textAlign="center";G=null!=G?G:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=G+"px";c.style.lineHeight="1.2em";mxUtils.write(c,f);E.appendChild(c);null!=I&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",f=document.createElement("img"),f.setAttribute("src",I),c.appendChild(f),-E.appendChild(c));I=document.createElement("div");I.style.textAlign="center";I.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");q=mxUtils.button(q||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d(g.checked)});q.className="geBtn";null!=A&&(q.innerHTML=A+"<br>"+q.innerHTML,q.style.display="inline-block",q.style.paddingBottom="8px",q.style.paddingTop="8px",q.style.height="auto",q.style.width="40%");b.editor.cancelFirst&&I.appendChild(q);-var l=mxUtils.button(p||mxResources.get("ok"),function(){b.hideDialog();null!=k&&k(g.checked)});I.appendChild(l);null!=u?(l.innerHTML=u+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom="8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||I.appendChild(q);E.appendChild(I);J?(I.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom=-"0px",c.appendChild(g),p=document.createElement("span"),mxUtils.write(p," "+mxResources.get("rememberThisSetting")),c.appendChild(p),E.appendChild(c),mxEvent.addListener(p,"click",function(n){g.checked=!g.checked;mxEvent.consume(n)})):I.style.marginTop="12px";this.init=function(){l.focus()};this.container=E},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};+mxResources.get("noCommentsFound"));var G=document.createElement("div");G.className="geToolbarContainer geCommentsToolbar";G.style.height=x;G.style.padding="3px 4px 4px 4px";x=document.createElement("a");x.className="geButton";if(!g){var N=x.cloneNode();N.style.backgroundImage="url("+Editor.plusImage+")";N.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(N,"click",function(z){function L(){A(K,M,function(m){H(M);b.addComment(m,function(y){m.id=y;V.push(m);D(M)},function(y){F(M);+L();b.handleError(y,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var K=b.newComment("",b.getCurrentUser()),M=c(K,V,null,0);L();z.preventDefault();mxEvent.consume(z)});G.appendChild(N)}var J=x.cloneNode();J.style.backgroundImage="url("+Editor.checkImage+")";J.setAttribute("title",mxResources.get("showResolved"));var T=!1;mxEvent.addListener(J,"click",function(z){(T=!T)?J.classList.add("geActiveItem"):J.classList.remove("geActiveItem");t();z.preventDefault();mxEvent.consume(z)});+G.appendChild(J);b.commentsRefreshNeeded()&&(N=x.cloneNode(),N.style.backgroundImage="url("+Editor.refreshImage+")",N.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(N,"click",function(z){t();z.preventDefault();mxEvent.consume(z)}),G.appendChild(N));b.commentsSaveNeeded()&&(x=x.cloneNode(),x.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',x.setAttribute("title",mxResources.get("save")),x.className="geButton geAdaptiveAsset",mxEvent.addListener(x,+"click",function(z){q();z.preventDefault();mxEvent.consume(z)}),G.appendChild(x));v.appendChild(G);var V=[],t=mxUtils.bind(this,function(){this.hasError=!1;if(null!=n)try{n.div=n.div.cloneNode(!0);var z=n.div.querySelector(".geCommentEditTxtArea"),L=n.div.querySelector(".geCommentEditBtns");n.comment.content=z.value;z.parentNode.removeChild(z);L.parentNode.removeChild(L)}catch(K){b.handleError(K)}B.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '++mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(K){function M(m){if(null!=m){m.sort(function(E,P){return new Date(E.modifiedDate)-new Date(P.modifiedDate)});for(var y=0;y<m.length;y++)M(m[y].replies)}}K.sort(function(m,y){return new Date(m.modifiedDate)-new Date(y.modifiedDate)});B.innerText="";B.appendChild(C);C.style.display="block";V=K;for(K=0;K<V.length;K++)M(V[K].replies),c(V[K],V,null,0,T);null!=n&&null==n.comment.id&&+null==n.comment.pCommentId&&(B.appendChild(n.div),A(n.comment,n.div,n.saveCallback,n.deleteOnCancel))},mxUtils.bind(this,function(K){B.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(K&&K.message?": "+K.message:""));this.hasError=!0})):B.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});t();this.refreshComments=t;G=mxUtils.bind(this,function(){function z(y){var E=K[y.id];if(null!=E)for(I(y,E),E=0;null!=y.replies&&E<y.replies.length;E++)z(y.replies[E])}if(this.window.isVisible()){for(var L=+B.querySelectorAll(".geCommentDate"),K={},M=0;M<L.length;M++){var m=L[M];K[m.getAttribute("data-commentId")]=m}for(M=0;M<V.length;M++)z(V[M])}});setInterval(G,6E4);this.refreshCommentsTime=G;this.window=new mxWindow(mxResources.get("comments"),v,f,k,d,p,!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,k,d,p,q,u,A,I,H,F){var D=document.createElement("div");D.style.textAlign="center";F=null!=F?F:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=F+"px";c.style.lineHeight="1.2em";mxUtils.write(c,f);D.appendChild(c);null!=H&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",f=document.createElement("img"),f.setAttribute("src",H),c.appendChild(f),+D.appendChild(c));H=document.createElement("div");H.style.textAlign="center";H.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");q=mxUtils.button(q||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d(g.checked)});q.className="geBtn";null!=A&&(q.innerHTML=A+"<br>"+q.innerHTML,q.style.display="inline-block",q.style.paddingBottom="8px",q.style.paddingTop="8px",q.style.height="auto",q.style.width="40%");b.editor.cancelFirst&&H.appendChild(q);+var l=mxUtils.button(p||mxResources.get("ok"),function(){b.hideDialog();null!=k&&k(g.checked)});H.appendChild(l);null!=u?(l.innerHTML=u+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom="8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||H.appendChild(q);D.appendChild(H);I?(H.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom=+"0px",c.appendChild(g),p=document.createElement("span"),mxUtils.write(p," "+mxResources.get("rememberThisSetting")),c.appendChild(p),D.appendChild(c),mxEvent.addListener(p,"click",function(n){g.checked=!g.checked;mxEvent.consume(n)})):H.style.marginTop="12px";this.init=function(){l.focus()};this.container=D},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.DIFF_FILE="f";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,k,d,p){if(null!=f)for(var q=0;q<f.length;q++)null!=f[q]&&(b=this.patchPages(b,f[q],k,d,p));return b};EditorUi.prototype.patchFileNode=function(b){var f=!1;if(null!=this.fileNode&&null!=b)for(var k=0;k<b.length;k++)if(null!=b[k]&&null!=b[k][EditorUi.DIFF_FILE])for(var d in b[k][EditorUi.DIFF_FILE])f=b[k][EditorUi.DIFF_FILE][d],null!=f?this.fileNode.setAttribute(d,f):this.fileNode.removeAttribute(d),f=!0;return f};-EditorUi.prototype.patchPages=function(b,f,k,d,p){var q={},u=[],A={},J={},I={},G={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var E in d[EditorUi.DIFF_UPDATE])q[E]=d[EditorUi.DIFF_UPDATE][E];if(null!=f[EditorUi.DIFF_REMOVE])for(d=0;d<f[EditorUi.DIFF_REMOVE].length;d++)J[f[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=f[EditorUi.DIFF_INSERT])for(d=0;d<f[EditorUi.DIFF_INSERT].length;d++)A[f[EditorUi.DIFF_INSERT][d].previous]=f[EditorUi.DIFF_INSERT][d];if(null!=f[EditorUi.DIFF_UPDATE])for(E in f[EditorUi.DIFF_UPDATE])d=-f[EditorUi.DIFF_UPDATE][E],null!=d.previous&&(G[d.previous]=E);if(null!=b){var c="";for(d=0;d<b.length;d++){var g=b[d].getId();I[g]=b[d];null!=G[c]||J[g]||null!=f[EditorUi.DIFF_UPDATE]&&null!=f[EditorUi.DIFF_UPDATE][g]&&null!=f[EditorUi.DIFF_UPDATE][g].previous||(G[c]=g);c=g}}var l={},n=mxUtils.bind(this,function(x){var B=null!=x?x.getId():"";if(null!=x&&!l[B]){l[B]=!0;u.push(x);var C=null!=f[EditorUi.DIFF_UPDATE]?f[EditorUi.DIFF_UPDATE][B]:null;null!=C&&(this.updatePageRoot(x),null!=C.name&&x.setName(C.name),-null!=C.view&&this.patchViewState(x,C.view),null!=C.cells&&this.patchPage(x,C.cells,q[x.getId()],p),!k||null==C.cells&&null==C.view||(x.needsUpdate=!0))}x=G[B];null!=x&&(delete G[B],n(I[x]));x=A[B];null!=x&&(delete A[B],v(x))}),v=mxUtils.bind(this,function(x){x=mxUtils.parseXml(x.data).documentElement;x=new DiagramPage(x);this.updatePageRoot(x);var B=I[x.getId()];null==B?n(x):(this.patchPage(B,this.diffPages([B],[x]),q[B.getId()],p),k&&(B.needsUpdate=!0))});n();for(E in G)n(I[G[E]]),delete G[E];for(E in A)v(A[E]),-delete A[E];return u};EditorUi.prototype.patchViewState=function(b,f){if(null!=b.viewState&&null!=f){b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var k in f)try{this.patchViewStateProperty(b,f,k)}catch(d){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,f,k){b.viewState[k]=JSON.parse(f[k])};-EditorUi.prototype.createParentLookup=function(b,f){function k(I){var G=d[I];null==G&&(G={inserted:[],moved:{}},d[I]=G);return G}var d={};if(null!=f[EditorUi.DIFF_INSERT])for(var p=0;p<f[EditorUi.DIFF_INSERT].length;p++){var q=f[EditorUi.DIFF_INSERT][p],u=null!=q.parent?q.parent:"",A=null!=q.previous?q.previous:"";k(u).inserted[A]=q}if(null!=f[EditorUi.DIFF_UPDATE])for(var J in f[EditorUi.DIFF_UPDATE])q=f[EditorUi.DIFF_UPDATE][J],null!=q.previous&&(u=q.parent,null==u&&(p=b.getCell(J),null!=p&&(p=-b.getParent(p),null!=p&&(u=p.getId()))),null!=u&&(k(u).moved[q.previous]=J));return d};-EditorUi.prototype.patchPage=function(b,f,k,d){var p=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),q=this.createParentLookup(p,f);p.beginUpdate();try{var u=p.updateEdgeParent,A=new mxDictionary,J=[];p.updateEdgeParent=function(v,x){!A.get(v)&&d&&(A.put(v,!0),J.push(v))};var I=q[""],G=null!=I&&null!=I.inserted?I.inserted[""]:null,E=null;null!=G&&(E=this.getCellForJson(G));if(null==E){var c=null!=I&&null!=I.moved?I.moved[""]:null;null!=c&&(E=p.getCell(c))}null!=E&&(p.setRoot(E),-b.root=E,EditorUi.debug("EditorUi.patchPage: Root changed",E.id));this.patchCellRecursive(b,p,p.root,q,f);if(null!=f[EditorUi.DIFF_REMOVE])for(var g=0;g<f[EditorUi.DIFF_REMOVE].length;g++){c=f[EditorUi.DIFF_REMOVE][g];var l=p.getCell(c);null!=l&&p.remove(l)}if(null!=f[EditorUi.DIFF_UPDATE]){var n=null!=k&&null!=k.cells?k.cells[EditorUi.DIFF_UPDATE]:null;for(c in f[EditorUi.DIFF_UPDATE])l=p.getCell(c),null!=l?this.patchCell(p,l,f[EditorUi.DIFF_UPDATE][c],null!=n?n[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",-c,"diff",[f[EditorUi.DIFF_UPDATE][c]])}if(null!=f[EditorUi.DIFF_INSERT])for(g=0;g<f[EditorUi.DIFF_INSERT].length;g++)G=f[EditorUi.DIFF_INSERT][g],l=p.getCell(G.id),null!=l&&(p.setTerminal(l,p.getCell(G.source),!0),p.setTerminal(l,p.getCell(G.target),!1));p.updateEdgeParent=u;if(d&&0<J.length)for(g=0;g<J.length;g++)p.contains(J[g])&&p.updateEdgeParent(J[g])}finally{p.endUpdate()}};-EditorUi.prototype.patchCellRecursive=function(b,f,k,d,p){if(null!=k){var q=d[k.getId()],u=null!=q&&null!=q.inserted?q.inserted:{};q=null!=q&&null!=q.moved?q.moved:{};for(var A=0,J=f.getChildCount(k),I="",G=0;G<J;G++){var E=f.getChildAt(k,G).getId();null==q[I]&&(null==p[EditorUi.DIFF_UPDATE]||null==p[EditorUi.DIFF_UPDATE][E]||null==p[EditorUi.DIFF_UPDATE][E].previous&&null==p[EditorUi.DIFF_UPDATE][E].parent)&&(q[I]=E);I=E}J=mxUtils.bind(this,function(c,g){var l=null!=c?c.getId():"";null==l&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",-"cell",c);null!=c&&g&&(g=f.getCell(l),null!=g&&g!=c&&(c=null));null!=c&&(f.getChildAt(k,A)!=c&&f.add(k,c,A),this.patchCellRecursive(b,f,c,d,p),A++);return l});for(I=[null];0<I.length;)if(G=I.shift(),G=J(null!=G?G.child:null,null!=G?G.insert:!1),E=q[G],null!=E&&(delete q[G],I.push({child:f.getCell(E)})),E=u[G],null!=E&&(delete u[G],I.push({child:this.getCellForJson(E),insert:!0})),0==I.length){for(G in q)I.push({child:f.getCell(q[G])}),delete q[G];for(G in u)I.push({child:this.getCellForJson(u[G]),-insert:!0}),delete u[G]}}};+EditorUi.prototype.patchPages=function(b,f,k,d,p){var q={},u=[],A={},I={},H={},F={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var D in d[EditorUi.DIFF_UPDATE])q[D]=d[EditorUi.DIFF_UPDATE][D];if(null!=f[EditorUi.DIFF_REMOVE])for(d=0;d<f[EditorUi.DIFF_REMOVE].length;d++)I[f[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=f[EditorUi.DIFF_INSERT])for(d=0;d<f[EditorUi.DIFF_INSERT].length;d++)A[f[EditorUi.DIFF_INSERT][d].previous]=f[EditorUi.DIFF_INSERT][d];if(null!=f[EditorUi.DIFF_UPDATE])for(D in f[EditorUi.DIFF_UPDATE])d=+f[EditorUi.DIFF_UPDATE][D],null!=d.previous&&(F[d.previous]=D);if(null!=b){var c="";for(d=0;d<b.length;d++){var g=b[d].getId();H[g]=b[d];null!=F[c]||I[g]||null!=f[EditorUi.DIFF_UPDATE]&&null!=f[EditorUi.DIFF_UPDATE][g]&&null!=f[EditorUi.DIFF_UPDATE][g].previous||(F[c]=g);c=g}}var l={},n=mxUtils.bind(this,function(x){var B=null!=x?x.getId():"";if(null!=x&&!l[B]){l[B]=!0;u.push(x);var C=null!=f[EditorUi.DIFF_UPDATE]?f[EditorUi.DIFF_UPDATE][B]:null;null!=C&&(this.updatePageRoot(x),null!=C.name&&x.setName(C.name),+null!=C.view&&this.patchViewState(x,C.view),null!=C.cells&&this.patchPage(x,C.cells,q[x.getId()],p),!k||null==C.cells&&null==C.view||(x.needsUpdate=!0))}x=F[B];null!=x&&(delete F[B],n(H[x]));x=A[B];null!=x&&(delete A[B],v(x))}),v=mxUtils.bind(this,function(x){x=mxUtils.parseXml(x.data).documentElement;x=new DiagramPage(x);this.updatePageRoot(x);var B=H[x.getId()];null==B?n(x):(this.patchPage(B,this.diffPages([B],[x]),q[B.getId()],p),k&&(B.needsUpdate=!0))});n();for(D in F)n(H[F[D]]),delete F[D];for(D in A)v(A[D]),+delete A[D];return u};EditorUi.prototype.patchViewState=function(b,f){if(null!=b.viewState&&null!=f){b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var k in f)try{this.patchViewStateProperty(b,f,k)}catch(d){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,f,k){b.viewState[k]=JSON.parse(f[k])};+EditorUi.prototype.createParentLookup=function(b,f){function k(H){var F=d[H];null==F&&(F={inserted:[],moved:{}},d[H]=F);return F}var d={};if(null!=f[EditorUi.DIFF_INSERT])for(var p=0;p<f[EditorUi.DIFF_INSERT].length;p++){var q=f[EditorUi.DIFF_INSERT][p],u=null!=q.parent?q.parent:"",A=null!=q.previous?q.previous:"";k(u).inserted[A]=q}if(null!=f[EditorUi.DIFF_UPDATE])for(var I in f[EditorUi.DIFF_UPDATE])q=f[EditorUi.DIFF_UPDATE][I],null!=q.previous&&(u=q.parent,null==u&&(p=b.getCell(I),null!=p&&(p=+b.getParent(p),null!=p&&(u=p.getId()))),null!=u&&(k(u).moved[q.previous]=I));return d};+EditorUi.prototype.patchPage=function(b,f,k,d){var p=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),q=this.createParentLookup(p,f);p.beginUpdate();try{var u=p.updateEdgeParent,A=new mxDictionary,I=[];p.updateEdgeParent=function(v,x){!A.get(v)&&d&&(A.put(v,!0),I.push(v))};var H=q[""],F=null!=H&&null!=H.inserted?H.inserted[""]:null,D=null;null!=F&&(D=this.getCellForJson(F));if(null==D){var c=null!=H&&null!=H.moved?H.moved[""]:null;null!=c&&(D=p.getCell(c))}null!=D&&(p.setRoot(D),+b.root=D,EditorUi.debug("EditorUi.patchPage: Root changed",D.id));this.patchCellRecursive(b,p,p.root,q,f);if(null!=f[EditorUi.DIFF_REMOVE])for(var g=0;g<f[EditorUi.DIFF_REMOVE].length;g++){c=f[EditorUi.DIFF_REMOVE][g];var l=p.getCell(c);null!=l&&p.remove(l)}if(null!=f[EditorUi.DIFF_UPDATE]){var n=null!=k&&null!=k.cells?k.cells[EditorUi.DIFF_UPDATE]:null;for(c in f[EditorUi.DIFF_UPDATE])l=p.getCell(c),null!=l?this.patchCell(p,l,f[EditorUi.DIFF_UPDATE][c],null!=n?n[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",+c,"diff",[f[EditorUi.DIFF_UPDATE][c]])}if(null!=f[EditorUi.DIFF_INSERT])for(g=0;g<f[EditorUi.DIFF_INSERT].length;g++)F=f[EditorUi.DIFF_INSERT][g],l=p.getCell(F.id),null!=l&&(p.setTerminal(l,p.getCell(F.source),!0),p.setTerminal(l,p.getCell(F.target),!1));p.updateEdgeParent=u;if(d&&0<I.length)for(g=0;g<I.length;g++)p.contains(I[g])&&p.updateEdgeParent(I[g])}finally{p.endUpdate()}};+EditorUi.prototype.patchCellRecursive=function(b,f,k,d,p){if(null!=k){var q=d[k.getId()],u=null!=q&&null!=q.inserted?q.inserted:{};q=null!=q&&null!=q.moved?q.moved:{};for(var A=0,I=f.getChildCount(k),H="",F=0;F<I;F++){var D=f.getChildAt(k,F).getId();null==q[H]&&(null==p[EditorUi.DIFF_UPDATE]||null==p[EditorUi.DIFF_UPDATE][D]||null==p[EditorUi.DIFF_UPDATE][D].previous&&null==p[EditorUi.DIFF_UPDATE][D].parent)&&(q[H]=D);H=D}I=mxUtils.bind(this,function(c,g){var l=null!=c?c.getId():"";null==l&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",+"cell",c);null!=c&&g&&(g=f.getCell(l),null!=g&&g!=c&&(c=null));null!=c&&(f.getChildAt(k,A)!=c&&f.add(k,c,A),this.patchCellRecursive(b,f,c,d,p),A++);return l});for(H=[null];0<H.length;)if(F=H.shift(),F=I(null!=F?F.child:null,null!=F?F.insert:!1),D=q[F],null!=D&&(delete q[F],H.push({child:f.getCell(D)})),D=u[F],null!=D&&(delete u[F],H.push({child:this.getCellForJson(D),insert:!0})),0==H.length){for(F in q)H.push({child:f.getCell(q[F])}),delete q[F];for(F in u)H.push({child:this.getCellForJson(u[F]),+insert:!0}),delete u[F]}}};EditorUi.prototype.patchCell=function(b,f,k,d){if(null!=f&&null!=k){if(null==d||null==d.xmlValue&&(null==d.value||""==d.value))"value"in k?b.setValue(f,k.value):null!=k.xmlValue&&b.setValue(f,mxUtils.parseXml(k.xmlValue).documentElement);null!=d&&null!=d.style||null==k.style||b.setStyle(f,k.style);null!=k.visible&&b.setVisible(f,1==k.visible);null!=k.collapsed&&b.setCollapsed(f,1==k.collapsed);null!=k.vertex&&(f.vertex=1==k.vertex);null!=k.edge&&(f.edge=1==k.edge);null!=k.connectable&&(f.connectable=1==k.connectable);null!=k.geometry&&b.setGeometry(f,this.codec.decode(mxUtils.parseXml(k.geometry).documentElement));null!=k.source&&b.setTerminal(f,b.getCell(k.source),!0);null!=k.target&&b.setTerminal(f,b.getCell(k.target),!1);for(var p in k)this.cellProperties[p]||(f[p]=k[p])}};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 k=0;k<b.length;k++){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[k].root));this.editor.graph.saveViewState(b[k].viewState,d);var p=b[k].node.cloneNode(!1);p.appendChild(d);f.appendChild(p)}}return f};EditorUi.prototype.getPagesForXml=function(b){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement)};EditorUi.prototype.getPagesForNode=function(b,f){var k=this.editor.extractGraphModel(b,!0,!0);null!=k&&(b=k);f=b.getElementsByTagName(f||"diagram");k=[];if(0<f.length)for(b=0;b<f.length;b++){var d=new DiagramPage(f[b]);this.updatePageRoot(d,!0);k.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)),k.push(d));return k};-EditorUi.prototype.diffPages=function(b,f){var k=[],d=[],p={},q={},u={},A=null;if(null!=b&&null!=f){for(var J=0;J<f.length;J++)q[f[J].getId()]={page:f[J],prev:A},A=f[J];A=null;for(J=0;J<b.length;J++){var I=b[J].getId();f=q[I];if(null==f)d.push(I);else{this.updatePageRoot(b[J]);this.updatePageRoot(f.page);var G=this.diffCells(b[J].root,f.page.root),E={};mxUtils.isEmptyObject(G)||(E.cells=G);G=this.diffViewState(b[J],f.page);mxUtils.isEmptyObject(G)||(E.view=G);if((null!=f.prev?null==A:null!=A)||null!=-A&&null!=f.prev&&A.getId()!=f.prev.getId())E.previous=null!=f.prev?f.prev.getId():"";null!=f.page.getName()&&b[J].getName()!=f.page.getName()&&(E.name=f.page.getName());mxUtils.isEmptyObject(E)||(u[I]=E)}delete q[b[J].getId()];A=b[J]}for(I in q)f=q[I],k.push({id:f.page.getId(),data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});mxUtils.isEmptyObject(u)||(p[EditorUi.DIFF_UPDATE]=u);0<d.length&&(p[EditorUi.DIFF_REMOVE]=d);0<k.length&&(p[EditorUi.DIFF_INSERT]=k)}return p};+EditorUi.prototype.diffPages=function(b,f){var k=[],d=[],p={},q={},u={},A=null;if(null!=b&&null!=f){for(var I=0;I<f.length;I++)q[f[I].getId()]={page:f[I],prev:A},A=f[I];A=null;for(I=0;I<b.length;I++){var H=b[I].getId();f=q[H];if(null==f)d.push(H);else{this.updatePageRoot(b[I]);this.updatePageRoot(f.page);var F=this.diffCells(b[I].root,f.page.root),D={};mxUtils.isEmptyObject(F)||(D.cells=F);F=this.diffViewState(b[I],f.page);mxUtils.isEmptyObject(F)||(D.view=F);if((null!=f.prev?null==A:null!=A)||null!=+A&&null!=f.prev&&A.getId()!=f.prev.getId())D.previous=null!=f.prev?f.prev.getId():"";null!=f.page.getName()&&b[I].getName()!=f.page.getName()&&(D.name=f.page.getName());mxUtils.isEmptyObject(D)||(u[H]=D)}delete q[b[I].getId()];A=b[I]}for(H in q)f=q[H],k.push({id:f.page.getId(),data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});mxUtils.isEmptyObject(u)||(p[EditorUi.DIFF_UPDATE]=u);0<d.length&&(p[EditorUi.DIFF_REMOVE]=d);0<k.length&&(p[EditorUi.DIFF_INSERT]=k)}return p};EditorUi.prototype.createCellLookup=function(b,f,k){k=null!=k?k:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):k[b.getId()]={cell:b,prev:f};var d=b.getChildCount();f=null;for(var p=0;p<d;p++){var q=b.getChildAt(p);this.createCellLookup(q,f,k);f=q}return k};EditorUi.prototype.diffCellRecursive=function(b,f,k,d,p){d=null!=d?d:{};var q=k[b.getId()];delete k[b.getId()];if(null==q)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):p.push(b.getId());else{var u=this.diffCell(b,q.cell);if(null!=u.parent||(null!=q.prev?null==f:null!=f)||null!=f&&null!=q.prev&&f.getId()!=q.prev.getId())u.previous=null!=q.prev?q.prev.getId():"";mxUtils.isEmptyObject(u)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",b,"diff",u):d[b.getId()]=u)}q=b.getChildCount();f=null;for(u=0;u<q;u++){var A=b.getChildAt(u);this.diffCellRecursive(A,f,k,d,p);f=A}return d};@@ -13852,9 +13864,9 @@ DrawioFileSync.prototype.patchRealtime=function(b,f,k,d){var p=null;if(this.fileDrawioFileSync.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),k=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;k!=this.snapshotVars&&(f[EditorUi.DIFF_FILE]={vars:k});this.snapshotVars=k;this.file.ownPages=this.ui.patchPages(this.file.ownPages,f,!0);this.snapshot=b;var d=this.ui.resolveCrossReferences(f,this.ui.diffPages(this.file.ownPages,this.ui.pages));this.file.ownPages=this.ui.patchPages(this.file.ownPages,d,!0);this.isRealtimeActive()&&this.doSendLocalChanges([d,f])}this.localFileWasChanged=!1}catch(p){b=this.file.getCurrentUser(),b=null!=b?b.id:"unknown",EditorUi.logError("Error in sendLocalChanges",null,this.file.getMode()+"."+this.file.getId(),b,p)}};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,k,d,p,q,u){try{this.file.stats.merged++;this.lastModified=new Date;var A=this.file.getDescriptorRevisionId(k);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var J=this.ui.clonePages(this.file.getShadowPages()),I=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(J,this.ui.pages):null,G=this.file.isRealtime()?this.ui.diffPages(J,this.file.ownPages):null;J=this.ui.applyPatches(J,b);var E=null==f?null:this.ui.getHashValueForPages(J);-EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",I,"pending",G,"checksum",f,"current",E,"valid",f==E,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",A,"etag",this.file.getDescriptorEtag(k),"immediate",u);if(null!=f&&f!=E){this.reload(mxUtils.bind(this,function(){null!=d&&d()}),mxUtils.bind(this,function(){null!=p&&p()}),q,null,u);return}var c=this.file.getShadowVars();for(f=0;f<b.length;f++)null!=b[f]&&null!=b[f][EditorUi.DIFF_FILE]&&-void 0!==b[f][EditorUi.DIFF_FILE].vars&&(c=b[f][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(J,c);if(null==this.patchRealtime(b,null,G,u))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?I:null);else{var g=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var l=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;g!=l&&(this.ui.editor.graph.refresh(),this.snapshotVars=l)}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),+DrawioFileSync.prototype.merge=function(b,f,k,d,p,q,u){try{this.file.stats.merged++;this.lastModified=new Date;var A=this.file.getDescriptorRevisionId(k);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var I=this.ui.clonePages(this.file.getShadowPages()),H=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(I,this.ui.pages):null,F=this.file.isRealtime()?this.ui.diffPages(I,this.file.ownPages):null;I=this.ui.applyPatches(I,b);var D=null==f?null:this.ui.getHashValueForPages(I);+EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",H,"pending",F,"checksum",f,"current",D,"valid",f==D,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",A,"etag",this.file.getDescriptorEtag(k),"immediate",u);if(null!=f&&f!=D){this.reload(mxUtils.bind(this,function(){null!=d&&d()}),mxUtils.bind(this,function(){null!=p&&p()}),q,null,u);return}var c=this.file.getShadowVars();for(f=0;f<b.length;f++)null!=b[f]&&null!=b[f][EditorUi.DIFF_FILE]&&+void 0!==b[f][EditorUi.DIFF_FILE].vars&&(c=b[f][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(I,c);if(null==this.patchRealtime(b,null,F,u))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?H:null);else{var g=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var l=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;g!=l&&(this.ui.editor.graph.refresh(),this.snapshotVars=l)}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),k);null!=d&&d(!0)}catch(x){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=p&&p(x);try{var n=this.file.getCurrentUser(),v=null!=n?n.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),v,x)}catch(B){}}};DrawioFileSync.prototype.fileChanged=function(b,f,k,d,p){var q=window.setTimeout(mxUtils.bind(this,function(){null!=k&&k()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",d,"immediate",p,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(u){null!=k&&k()||(this.isValidState()?this.catchup(u,b,f,k,p):null!=f&&f())}),f)):null!=f&&f())}),d?this.cacheReadyDelay:0);return this.notifyThread=q};@@ -13863,19 +13875,19 @@ this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;f=this.cleanupThreadDrawioFileSync.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,k,d,p){if(null!=b&&(null==d||!d())){var q=this.file.getCurrentRevisionId(),u=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",q,"to",u,"immediate",p,"valid",this.isValidState());if(q==u)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 A=this.file.getDescriptorChecksum(b),J=this.file.getDescriptorSecret(b);if(null!=A&&A==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=f&&f(!0);else if(Editor.enableRealtimeCache&&null!=J&&"1"!=urlParams.lockdown){var I=0,G=!1,E=mxUtils.bind(this,function(){if(null==d||!d())if(q!=this.file.getCurrentRevisionId())null!=f&&-f(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var c=!0,g=window.setTimeout(mxUtils.bind(this,function(){c=!1;this.reload(f,k,d,null,p)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(q)+"&to="+encodeURIComponent(u)+(null!=J?"&secret="+encodeURIComponent(J):""),mxUtils.bind(this,function(l){this.file.stats.bytesReceived+=l.getText().length;window.clearTimeout(g);if(c&&(null==d||!d()))if(q!=this.file.getCurrentRevisionId())null!=-f&&f(!0);else if(this.isValidState()){var n=null,v=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[l],"status",l.getStatus(),"cacheReadyRetryCount",I,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=l.getStatus()&&299>=l.getStatus()&&0<l.getText().length)try{var x=JSON.parse(l.getText());if(null!=x&&0<x.length)for(var B=0;B<x.length;B++){var C=this.stringToObject(x[B]);if(C.v>DrawioFileSync.PROTOCOL){G=!0;v=[];break}else if(C.v===DrawioFileSync.PROTOCOL&&null!=C.d)n=C.d.checksum,-v.push(C.d.patch);else{G=!0;v=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[x],"status",G?"failed":"ok","temp",v,"checksum",n)}catch(H){v=[],null!=window.console&&"1"==urlParams.test&&console.log(H)}try{0<v.length?(this.file.stats.cacheHits++,this.merge(v,n,b,f,k,d,p)):I<=this.maxCacheReadyRetries-1&&!G&&401!=l.getStatus()&&503!=l.getStatus()&&410!=l.getStatus()?(I++,this.file.stats.cacheMiss++,window.setTimeout(E,(I+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,-this.reload(f,k,d,null,p))}catch(H){null!=k&&k(H)}}else null!=k&&k()}),k)}else null!=k&&k()});window.setTimeout(E,this.cacheReadyDelay)}else this.reload(f,k,d,null,p)}else null!=k&&k()}};DrawioFileSync.prototype.reload=function(b,f,k,d,p){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",p);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(q){null!=f&&f(q)}),k,d,p)};+document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=f&&f(!0);else if(this.isValidState()){var A=this.file.getDescriptorChecksum(b),I=this.file.getDescriptorSecret(b);if(null!=A&&A==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=f&&f(!0);else if(Editor.enableRealtimeCache&&null!=I&&"1"!=urlParams.lockdown){var H=0,F=!1,D=mxUtils.bind(this,function(){if(null==d||!d())if(q!=this.file.getCurrentRevisionId())null!=f&&+f(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var c=!0,g=window.setTimeout(mxUtils.bind(this,function(){c=!1;this.reload(f,k,d,null,p)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(q)+"&to="+encodeURIComponent(u)+(null!=I?"&secret="+encodeURIComponent(I):""),mxUtils.bind(this,function(l){this.file.stats.bytesReceived+=l.getText().length;window.clearTimeout(g);if(c&&(null==d||!d()))if(q!=this.file.getCurrentRevisionId())null!=+f&&f(!0);else if(this.isValidState()){var n=null,v=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[l],"status",l.getStatus(),"cacheReadyRetryCount",H,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=l.getStatus()&&299>=l.getStatus()&&0<l.getText().length)try{var x=JSON.parse(l.getText());if(null!=x&&0<x.length)for(var B=0;B<x.length;B++){var C=this.stringToObject(x[B]);if(C.v>DrawioFileSync.PROTOCOL){F=!0;v=[];break}else if(C.v===DrawioFileSync.PROTOCOL&&null!=C.d)n=C.d.checksum,+v.push(C.d.patch);else{F=!0;v=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[x],"status",F?"failed":"ok","temp",v,"checksum",n)}catch(G){v=[],null!=window.console&&"1"==urlParams.test&&console.log(G)}try{0<v.length?(this.file.stats.cacheHits++,this.merge(v,n,b,f,k,d,p)):H<=this.maxCacheReadyRetries-1&&!F&&401!=l.getStatus()&&503!=l.getStatus()&&410!=l.getStatus()?(H++,this.file.stats.cacheMiss++,window.setTimeout(D,(H+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,+this.reload(f,k,d,null,p))}catch(G){null!=k&&k(G)}}else null!=k&&k()}),k)}else null!=k&&k()});window.setTimeout(D,this.cacheReadyDelay)}else this.reload(f,k,d,null,p)}else null!=k&&k()}};DrawioFileSync.prototype.reload=function(b,f,k,d,p){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",p);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(q){null!=f&&f(q)}),k,d,p)};DrawioFileSync.prototype.descriptorChanged=function(b){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var f=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),k=this.file.getCurrentRevisionId(),d=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(b)+"&to="+encodeURIComponent(k)+"&msg="+encodeURIComponent(f)+"&data="+encodeURIComponent(d));this.file.stats.bytesSent+=d.length;this.file.stats.msgSent++;EditorUi.debug("DrawioFileSync.descriptorChanged",[this],"from",b,"to",k)}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,k){var d=!0,p=window.setTimeout(mxUtils.bind(this,function(){d=!1;k({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(q){window.clearTimeout(p);d&&(200<=q.getStatus()&&299>=q.getStatus()?f(q.getText()):k({code:q.getStatus(),message:"Token Error "+q.getStatus()}))}),k)};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,k,d,p,q){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 u=this.file.getDescriptorSecret(this.file.getDescriptor()),A=this.createMessage({m:this.lastModified.getTime()}),J=this.file.getDescriptorRevisionId(f),I=this.file.getCurrentRevisionId();if(null!=u&&null!=p&&-"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var G=this.ui.diffPages(this.file.getShadowPages(),b),E=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=E&&(G[EditorUi.DIFF_FILE]={vars:c});f=this.file.getDescriptorSecret(f);q=null!=q?q:this.ui.getHashValueForPages(b);E=this.objectToString(this.createMessage({patch:G,checksum:q}));this.file.stats.bytesSent+=E.length;this.file.stats.msgSent++;var g=!0,l=window.setTimeout(mxUtils.bind(this,function(){g=-!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(J)+"&to="+encodeURIComponent(I)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(A)))+(null!=u?"&secret="+encodeURIComponent(u):"")+(null!=f?"&last-secret="+encodeURIComponent(f):"")+(E.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(E):"")+(null!=p?"&token="+encodeURIComponent(p):""),mxUtils.bind(this,-function(n){window.clearTimeout(l);g&&(200<=n.getStatus()&&299>=n.getStatus()?(Editor.p2pSyncNotify&&this.notify(A),null!=k&&k()):d({message:mxResources.get("realtimeCollaboration")+(0!=n.getStatus()?": "+n.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",J,"to",I,"etag",this.file.getCurrentEtag(),"diff",G,E.length,"bytes","msg",A,"checksum",q)}else this.notify(A),null!=k&&k(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",J,"to",I,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);+DrawioFileSync.prototype.fileSaved=function(b,f,k,d,p,q){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 u=this.file.getDescriptorSecret(this.file.getDescriptor()),A=this.createMessage({m:this.lastModified.getTime()}),I=this.file.getDescriptorRevisionId(f),H=this.file.getCurrentRevisionId();if(null!=u&&null!=p&&+"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var F=this.ui.diffPages(this.file.getShadowPages(),b),D=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=D&&(F[EditorUi.DIFF_FILE]={vars:c});f=this.file.getDescriptorSecret(f);q=null!=q?q:this.ui.getHashValueForPages(b);D=this.objectToString(this.createMessage({patch:F,checksum:q}));this.file.stats.bytesSent+=D.length;this.file.stats.msgSent++;var g=!0,l=window.setTimeout(mxUtils.bind(this,function(){g=+!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(I)+"&to="+encodeURIComponent(H)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(A)))+(null!=u?"&secret="+encodeURIComponent(u):"")+(null!=f?"&last-secret="+encodeURIComponent(f):"")+(D.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(D):"")+(null!=p?"&token="+encodeURIComponent(p):""),mxUtils.bind(this,+function(n){window.clearTimeout(l);g&&(200<=n.getStatus()&&299>=n.getStatus()?(Editor.p2pSyncNotify&&this.notify(A),null!=k&&k()):d({message:mxResources.get("realtimeCollaboration")+(0!=n.getStatus()?": "+n.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",I,"to",H,"etag",this.file.getCurrentEtag(),"diff",F,D.length,"bytes","msg",A,"checksum",q)}else this.notify(A),null!=k&&k(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",I,"to",H,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);this.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;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,k){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,k):this.fileChanged(f,k)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=k&&k({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(),@@ -13888,12 +13900,12 @@ mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waimxAsyncCanvas.prototype.setAlpha=function(b){this.state.alpha=b};mxAsyncCanvas.prototype.setFontColor=function(b){this.state.fontColor=b};mxAsyncCanvas.prototype.setFontBackgroundColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBackgroundColor=b};mxAsyncCanvas.prototype.setFontBorderColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBorderColor=b};mxAsyncCanvas.prototype.setFontSize=function(b){this.state.fontSize=b};mxAsyncCanvas.prototype.setFontFamily=function(b){this.state.fontFamily=b};mxAsyncCanvas.prototype.setFontStyle=function(b){this.state.fontStyle=b};mxAsyncCanvas.prototype.rect=function(b,f,k,d){};mxAsyncCanvas.prototype.roundrect=function(b,f,k,d,p,q){};mxAsyncCanvas.prototype.ellipse=function(b,f,k,d){};mxAsyncCanvas.prototype.rewriteImageSource=function(b){if("http://"==b.substring(0,7)||"https://"==b.substring(0,8))b="/proxy?url="+encodeURIComponent(b);return b};mxAsyncCanvas.prototype.image=function(b,f,k,d,p,q,u,A){p=this.rewriteImageSource(p);b=this.htmlCanvas.images[p];null==b&&(b=new Image,b.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),b.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[p]=b,b.src=p)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};-mxAsyncCanvas.prototype.text=function(b,f,k,d,p,q,u,A,J,I,G,E){if(null!=p&&0!=p.length&&(b=this.state.scale,"html"==J&&"function"===typeof html2canvas)){this.incWaitCounter();var c=this.canvasIndex++;html2canvas(p,{onrendered:mxUtils.bind(this,function(g){this.htmlCanvas.subCanvas[c]=g;this.decWaitCounter()}),scale:b,logging:!0})}};mxAsyncCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function mxJsCanvas(b){mxAbstractCanvas2D.call(this);this.ctx=b.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;+mxAsyncCanvas.prototype.text=function(b,f,k,d,p,q,u,A,I,H,F,D){if(null!=p&&0!=p.length&&(b=this.state.scale,"html"==I&&"function"===typeof html2canvas)){this.incWaitCounter();var c=this.canvasIndex++;html2canvas(p,{onrendered:mxUtils.bind(this,function(g){this.htmlCanvas.subCanvas[c]=g;this.decWaitCounter()}),scale:b,logging:!0})}};mxAsyncCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function mxJsCanvas(b){mxAbstractCanvas2D.call(this);this.ctx=b.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(b){b=b.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(f,k,d,p){return k+k+d+d+p+p});return(b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(b))?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++};mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var b="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(b+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(b+="italic ");this.ctx.font=b+this.state.fontSize+"px "+this.state.fontFamily};mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(b){this.state.scale*=b;this.state.strokeWidth*=b;this.ctx.scale(b,b)};mxJsCanvas.prototype.translate=function(b,f){this.state.dx+=b;this.state.dy+=f;this.ctx.translate(b,f)};mxJsCanvas.prototype.rotate=function(b,f,k,d,p){d-=this.state.dx;p-=this.state.dy;this.ctx.translate(d,p);(f||k)&&this.ctx.scale(f?-1:1,k?-1:1);this.ctx.rotate(b*this.M_RAD_PER_DEG);this.ctx.translate(-d,-p)};mxJsCanvas.prototype.setAlpha=function(b){this.state.alpha=b;this.ctx.globalAlpha=b};mxJsCanvas.prototype.setFillColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fillColor=b;this.state.gradientColor=null;this.ctx.fillStyle=b};-mxJsCanvas.prototype.setGradient=function(b,f,k,d,p,q,u,A,J){k=this.ctx.createLinearGradient(0,d,0,d+q);d=this.state;d.fillColor=b;d.fillAlpha=null!=A?A:1;d.gradientColor=f;d.gradientAlpha=null!=J?J:1;d.gradientDirection=u;b=this.hexToRgb(b);f=this.hexToRgb(f);null!=b&&k.addColorStop(0,"rgba("+b.r+","+b.g+","+b.b+","+d.fillAlpha+")");null!=f&&k.addColorStop(1,"rgba("+f.r+","+f.g+","+f.b+","+d.gradientAlpha+")");this.ctx.fillStyle=k};+mxJsCanvas.prototype.setGradient=function(b,f,k,d,p,q,u,A,I){k=this.ctx.createLinearGradient(0,d,0,d+q);d=this.state;d.fillColor=b;d.fillAlpha=null!=A?A:1;d.gradientColor=f;d.gradientAlpha=null!=I?I:1;d.gradientDirection=u;b=this.hexToRgb(b);f=this.hexToRgb(f);null!=b&&k.addColorStop(0,"rgba("+b.r+","+b.g+","+b.b+","+d.fillAlpha+")");null!=f&&k.addColorStop(1,"rgba("+f.r+","+f.g+","+f.b+","+d.gradientAlpha+")");this.ctx.fillStyle=k};mxJsCanvas.prototype.setStrokeColor=function(b){null!=b&&(b==mxConstants.NONE?(this.state.strokeColor=null,this.ctx.strokeStyle="rgba(0, 0, 0, 0)"):(this.ctx.strokeStyle=b,this.state.strokeColor=b))};mxJsCanvas.prototype.setStrokeWidth=function(b){this.ctx.lineWidth=b};mxJsCanvas.prototype.setDashed=function(b){if(this.state.dashed=b){b=this.state.dashPattern.split(" ");for(var f=0;f<b.length;f++)b[f]=parseInt(b[f],10);this.setLineDash(b)}else this.setLineDash([0])};mxJsCanvas.prototype.setLineDash=function(b){try{"function"===typeof this.ctx.setLineDash&&this.ctx.setLineDash(b)}catch(f){}};mxJsCanvas.prototype.setDashPattern=function(b){this.state.dashPattern=b;if(this.state.dashed){b=b.split(" ");for(var f=0;f<b.length;f++)b[f]=parseInt(b[f],10);this.ctx.setLineDash(b)}};mxJsCanvas.prototype.setLineCap=function(b){this.ctx.lineCap=b};mxJsCanvas.prototype.setLineJoin=function(b){this.ctx.lineJoin=b};mxJsCanvas.prototype.setMiterLimit=function(b){this.ctx.lineJoin=b};mxJsCanvas.prototype.setFontColor=function(b){this.ctx.fillStyle=b};mxJsCanvas.prototype.setFontBackgroundColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBackgroundColor=b};mxJsCanvas.prototype.setFontBorderColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBorderColor=b};mxJsCanvas.prototype.setFontSize=function(b){this.state.fontSize=b};@@ -13903,13 +13915,13 @@ mxJsCanvas.prototype.setShadowOffset=function(b,f){this.state.shadowDx=b;this.stmxJsCanvas.prototype.arcTo=function(b,f,k,d,p,q,u){b=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,b,f,k,d,p,q,u);if(null!=b)for(f=0;f<b.length;f+=6)this.curveTo(b[f],b[f+1],b[f+2],b[f+3],b[f+4],b[f+5])};mxJsCanvas.prototype.curveTo=function(b,f,k,d,p,q){this.ctx.bezierCurveTo(b,f,k,d,p,q);this.lastMoveX=p;this.lastMoveY=q};mxJsCanvas.prototype.rect=function(b,f,k,d){this.begin();this.moveTo(b,f);this.lineTo(b+k,f);this.lineTo(b+k,f+d);this.lineTo(b,f+d);this.close()};mxJsCanvas.prototype.roundrect=function(b,f,k,d,p,q){this.begin();this.moveTo(b+p,f);this.lineTo(b+k-p,f);this.quadTo(b+k,f,b+k,f+q);this.lineTo(b+k,f+d-q);this.quadTo(b+k,f+d,b+k-p,f+d);this.lineTo(b+p,f+d);this.quadTo(b,f+d,b,f+d-q);this.lineTo(b,f+q);this.quadTo(b,f,b+p,f)};mxJsCanvas.prototype.ellipse=function(b,f,k,d){this.ctx.save();this.ctx.translate(b+k/2,f+d/2);this.ctx.scale(k/2,d/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()};mxJsCanvas.prototype.rewriteImageSource=function(b){if("http://"==b.substring(0,7)||"https://"==b.substring(0,8))b="/proxy?url="+encodeURIComponent(b);return b};-mxJsCanvas.prototype.image=function(b,f,k,d,p,q,u,A){p=this.rewriteImageSource(p);p=this.images[p];if(null!=p&&0<p.height&&0<p.width){var J=this.ctx;J.save();if(q){q=p.width;var I=p.height,G=Math.min(k/q,d/I);b+=(k-q*G)/2;f+=(d-I*G)/2;k=q*G;d=I*G}u&&(J.translate(2*b+k,0),J.scale(-1,1));A&&(J.translate(0,2*f+d),J.scale(1,-1));J.drawImage(p,b,f,k,d);J.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};+mxJsCanvas.prototype.image=function(b,f,k,d,p,q,u,A){p=this.rewriteImageSource(p);p=this.images[p];if(null!=p&&0<p.height&&0<p.width){var I=this.ctx;I.save();if(q){q=p.width;var H=p.height,F=Math.min(k/q,d/H);b+=(k-q*F)/2;f+=(d-H*F)/2;k=q*F;d=H*F}u&&(I.translate(2*b+k,0),I.scale(-1,1));A&&(I.translate(0,2*f+d),I.scale(1,-1));I.drawImage(p,b,f,k,d);I.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};mxJsCanvas.prototype.fill=function(){this.ctx.fill()};mxJsCanvas.prototype.stroke=function(){this.ctx.stroke()};mxJsCanvas.prototype.fillAndStroke=function(){if(this.state.shadow){this.ctx.stroke();this.ctx.fill();var b=this.ctx.shadowColor,f=this.ctx.shadowOffsetX,k=this.ctx.shadowOffsetY;this.ctx.shadowColor="transparent";this.ctx.shadowOffsetX=0;this.ctx.shadowOffsetY=0;this.ctx.stroke();this.ctx.shadowColor=b;this.ctx.shadowOffsetX=f;this.ctx.shadowOffsetY=k}else this.ctx.fill(),this.ctx.stroke()};-mxJsCanvas.prototype.text=function(b,f,k,d,p,q,u,A,J,I,G,E){if(null!=p&&0!=p.length){k=this.state.scale;0!=E&&(this.ctx.translate(Math.round(b),Math.round(f)),this.ctx.rotate(E*Math.PI/180),this.ctx.translate(Math.round(-b),Math.round(-f)));if("html"==J){p=this.subCanvas[this.canvasIndex++];J=p.height;E=p.width;switch(u){case mxConstants.ALIGN_MIDDLE:f-=J/2/k;break;case mxConstants.ALIGN_BOTTOM:f-=J/k}switch(q){case mxConstants.ALIGN_CENTER:b-=E/2/k;break;case mxConstants.ALIGN_RIGHT:b-=E/k}this.ctx.save();+mxJsCanvas.prototype.text=function(b,f,k,d,p,q,u,A,I,H,F,D){if(null!=p&&0!=p.length){k=this.state.scale;0!=D&&(this.ctx.translate(Math.round(b),Math.round(f)),this.ctx.rotate(D*Math.PI/180),this.ctx.translate(Math.round(-b),Math.round(-f)));if("html"==I){p=this.subCanvas[this.canvasIndex++];I=p.height;D=p.width;switch(u){case mxConstants.ALIGN_MIDDLE:f-=I/2/k;break;case mxConstants.ALIGN_BOTTOM:f-=I/k}switch(q){case mxConstants.ALIGN_CENTER:b-=D/2/k;break;case mxConstants.ALIGN_RIGHT:b-=D/k}this.ctx.save();if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(b)-.5,Math.round(f)-.5,Math.round(p.width/k),Math.round(p.height/k))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(b)-.5,Math.round(f)-.5,Math.round(p.width/k),Math.round(p.height/k)));this.ctx.scale(1/k,1/k);this.ctx.drawImage(p,-Math.round(b*k),Math.round(f*k))}else{this.ctx.save();this.updateFont();E=document.createElement("div");E.innerHTML=p;E.style.position="absolute";E.style.top="-9999px";E.style.left="-9999px";E.style.fontFamily=this.state.fontFamily;E.style.fontWeight="bold";E.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(E);J=[E.offsetWidth,E.offsetHeight];document.body.removeChild(E);p=p.split("\n");E=J[1];this.ctx.textBaseline="top";J=f;switch(u){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=-"middle";f-=(p.length-1)*E/2;J=f-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",f-=E*(p.length-1),J=f-this.state.fontSize}u=[];E=[];for(k=0;k<p.length;k++)E[k]=b,u[k]=this.ctx.measureText(p[k]).width,null!=q&&q!=mxConstants.ALIGN_LEFT&&(E[k]-=u[k],q==mxConstants.ALIGN_CENTER&&(E[k]+=u[k]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){b=E[0];q=u[0];for(k=1;k<p.length;k++)b=Math.min(b,E[k]),q=Math.max(q,u[k]);this.ctx.save();-b=Math.round(b)-.5;J=Math.round(J)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(b,J,q,this.state.fontSize*mxConstants.LINE_HEIGHT*p.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(b,J,q,this.state.fontSize*mxConstants.LINE_HEIGHT*p.length));this.ctx.restore()}for(k=0;k<p.length;k++)this.ctx.fillText(p[k],E[k],f),f+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};+Math.round(b*k),Math.round(f*k))}else{this.ctx.save();this.updateFont();D=document.createElement("div");D.innerHTML=p;D.style.position="absolute";D.style.top="-9999px";D.style.left="-9999px";D.style.fontFamily=this.state.fontFamily;D.style.fontWeight="bold";D.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(D);I=[D.offsetWidth,D.offsetHeight];document.body.removeChild(D);p=p.split("\n");D=I[1];this.ctx.textBaseline="top";I=f;switch(u){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=+"middle";f-=(p.length-1)*D/2;I=f-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",f-=D*(p.length-1),I=f-this.state.fontSize}u=[];D=[];for(k=0;k<p.length;k++)D[k]=b,u[k]=this.ctx.measureText(p[k]).width,null!=q&&q!=mxConstants.ALIGN_LEFT&&(D[k]-=u[k],q==mxConstants.ALIGN_CENTER&&(D[k]+=u[k]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){b=D[0];q=u[0];for(k=1;k<p.length;k++)b=Math.min(b,D[k]),q=Math.max(q,u[k]);this.ctx.save();+b=Math.round(b)-.5;I=Math.round(I)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(b,I,q,this.state.fontSize*mxConstants.LINE_HEIGHT*p.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(b,I,q,this.state.fontSize*mxConstants.LINE_HEIGHT*p.length));this.ctx.restore()}for(k=0;k<p.length;k++)this.ctx.fillText(p[k],D[k],f),f+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};mxJsCanvas.prototype.getCanvas=function(){return canvas};mxJsCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function GifEncoder(b,f){this.width=b;this.height=f;this.delay=100;this.repeat=0;this.transparent=!1;this.dispose=2;this.out=[];this.frameCount=0;this.started=!1}GifEncoder.prototype.setDelay=function(b){this.delay=Math.max(10,Math.round(b))};GifEncoder.prototype.setRepeat=function(b){this.repeat=b};GifEncoder.prototype.setTransparent=function(b){this.transparent=b};GifEncoder.prototype.addFrame=function(b){var f=b.getContext("2d").getImageData(0,0,this.width,this.height).data,k=f.length/4;if(this.started){b=this.globalPalette;var d=this.globalTransparentIndex;var p=new Uint8Array(k);for(var q=0;q<k;q++){var u=4*q;p[q]=this.transparent&&128>f[u+3]?d:GifEncoder.findClosest(b,f[u],f[u+1],f[u+2],d)}}else f=GifEncoder.quantize(f,256,this.transparent),b=f.palette,p=f.indexedPixels,d=f.transparentIndex,this.globalPalette=b,this.globalTransparentIndex=d,this.started=!0,this.writeHeader(),this.writeLogicalScreenDescriptor(b),this.writeGlobalColorTable(b),0<=this.repeat&&this.writeNetscapeExtension();this.writeGraphicControlExtension(d);this.writeImageDescriptor();this.writeImageData(p,b);this.frameCount++};GifEncoder.prototype.finish=function(){if(!this.started)return null;this.out.push(59);return new Blob([new Uint8Array(this.out)],{type:"image/gif"})};GifEncoder.prototype.writeHeader=function(){this.writeString("GIF89a")};@@ -13917,18 +13929,18 @@ GifEncoder.prototype.writeLogicalScreenDescriptor=function(b){this.writeShort(thGifEncoder.prototype.writeNetscapeExtension=function(){this.out.push(33);this.out.push(255);this.out.push(11);this.writeString("NETSCAPE2.0");this.out.push(3);this.out.push(1);this.writeShort(this.repeat);this.out.push(0)};GifEncoder.prototype.writeGraphicControlExtension=function(b){this.out.push(33);this.out.push(249);this.out.push(4);var f=0<=b;this.out.push(this.dispose<<2|(f?1:0));this.writeShort(Math.round(this.delay/10));this.out.push(f?b:0);this.out.push(0)};GifEncoder.prototype.writeImageDescriptor=function(){this.out.push(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);this.out.push(0)};GifEncoder.prototype.writeImageData=function(b,f){f=GifEncoder.colorDepthFor(f.length);f=Math.max(2,f);this.out.push(f);b=GifEncoder.lzwEncode(b,f);for(f=0;f<b.length;){var k=Math.min(255,b.length-f);this.out.push(k);for(var d=0;d<k;d++)this.out.push(b[f+d]);f+=k}this.out.push(0)};GifEncoder.prototype.writeShort=function(b){this.out.push(b&255);this.out.push(b>>8&255)};GifEncoder.prototype.writeString=function(b){for(var f=0;f<b.length;f++)this.out.push(b.charCodeAt(f))};GifEncoder.colorTableSizeFor=function(b){for(var f=0;2<<f<b;)f++;return Math.min(f,7)};GifEncoder.colorTableEntries=function(b){for(var f=2;f<b;)f*=2;return Math.min(f,256)};GifEncoder.colorDepthFor=function(b){for(var f=1;1<<f<b;)f++;return f};-GifEncoder.quantize=function(b,f,k){var d=b.length/4,p=-1;k&&--f;for(var q=[],u=1E5<d?Math.floor(d/5E4):1,A=0;A<d;A+=u){var J=4*A;128>b[J+3]||q.push([b[J],b[J+1],b[J+2]])}q.length<=f?(u=GifEncoder.uniqueColors(q),u.length>f&&(u=GifEncoder.medianCut(q,f))):u=GifEncoder.medianCut(q,f);for(;2>u.length;)u.push([0,0,0]);k&&(p=u.length,u.push([0,0,0]));f=new Uint8Array(d);for(A=0;A<d;A++)J=4*A,f[A]=k&&128>b[J+3]?p:GifEncoder.findClosest(u,b[J],b[J+1],b[J+2],p);return{palette:u,indexedPixels:f,transparentIndex:p}};+GifEncoder.quantize=function(b,f,k){var d=b.length/4,p=-1;k&&--f;for(var q=[],u=1E5<d?Math.floor(d/5E4):1,A=0;A<d;A+=u){var I=4*A;128>b[I+3]||q.push([b[I],b[I+1],b[I+2]])}q.length<=f?(u=GifEncoder.uniqueColors(q),u.length>f&&(u=GifEncoder.medianCut(q,f))):u=GifEncoder.medianCut(q,f);for(;2>u.length;)u.push([0,0,0]);k&&(p=u.length,u.push([0,0,0]));f=new Uint8Array(d);for(A=0;A<d;A++)I=4*A,f[A]=k&&128>b[I+3]?p:GifEncoder.findClosest(u,b[I],b[I+1],b[I+2],p);return{palette:u,indexedPixels:f,transparentIndex:p}};GifEncoder.uniqueColors=function(b){for(var f={},k=[],d=0;d<b.length;d++){var p=b[d][0]<<16|b[d][1]<<8|b[d][2];null==f[p]&&(f[p]=!0,k.push(b[d]))}return k};-GifEncoder.medianCut=function(b,f){if(0==b.length)return[[0,0,0]];for(b=[b];b.length<f;){for(var k=-1,d=0,p=0;p<b.length;p++)if(!(1>=b[p].length)){var q=GifEncoder.colorRange(b[p]);q.maxRange>k&&(k=q.maxRange,d=p)}if(0>=k)break;p=b[d];q=GifEncoder.colorRange(p);p.sort(function(I,G){return I[q.channel]-G[q.channel]});k=Math.floor(p.length/2);b.splice(d,1,p.slice(0,k),p.slice(k))}f=[];for(p=0;p<b.length;p++){d=b[p];for(var u=k=0,A=0,J=0;J<d.length;J++)k+=d[J][0],u+=d[J][1],A+=d[J][2];f.push([Math.round(k/-d.length),Math.round(u/d.length),Math.round(A/d.length)])}return f};GifEncoder.colorRange=function(b){for(var f=255,k=0,d=255,p=0,q=255,u=0,A=0;A<b.length;A++){var J=b[A];J[0]<f&&(f=J[0]);J[0]>k&&(k=J[0]);J[1]<d&&(d=J[1]);J[1]>p&&(p=J[1]);J[2]<q&&(q=J[2]);J[2]>u&&(u=J[2])}b=k-f;d=p-d;q=u-q;return b>=d&&b>=q?{channel:0,maxRange:b}:d>=b&&d>=q?{channel:1,maxRange:d}:{channel:2,maxRange:q}};-GifEncoder.findClosest=function(b,f,k,d,p){for(var q=Infinity,u=0,A=0;A<b.length;A++)if(A!==p){var J=f-b[A][0],I=k-b[A][1],G=d-b[A][2];J=J*J+I*I+G*G;J<q&&(q=J,u=A)}return u};-GifEncoder.lzwEncode=function(b,f){for(var k=1<<f,d=k+1,p=f+1,q=d+1,u=1<<p,A={},J=0;J<k;J++)A[String(J)]=J;var I=0,G=0,E=[],c=function(n){I|=n<<G;for(G+=p;8<=G;)E.push(I&255),I>>=8,G-=8};c(k);if(0==b.length)return c(d),0<G&&E.push(I&255),new Uint8Array(E);var g=String(b[0]);for(J=1;J<b.length;J++){var l=g+","+b[J];if(null!=A[l])g=l;else{c(A[g]);if(4096>q)A[l]=q,q++,q>u&&12>p&&(p++,u=1<<p);else{c(k);A={};for(q=0;q<k;q++)A[String(q)]=q;p=f+1;q=d+1;u=1<<p}g=String(b[J])}}c(A[g]);c(d);0<G&&E.push(I&255);-return new Uint8Array(E)};function AnimatedGifExport(b){this.editorUi=b}-AnimatedGifExport.prototype.doExport=function(b,f,k){var d=this.editorUi.editor.graph,p=this.editorUi.editor;b=b||{};var q=b.fps||15,u=b.scale||1,A=b.border||0,J=b.transparent||!1,I=null!=b.repeat?b.repeat:0,G=J?null:null!=b.background&&b.background!=mxConstants.NONE?b.background:"#ffffff",E=b.theme||null;try{var c=d.getSvg(G,u,A,!0,null,!0,null,null,null,d.shadowVisible,null,E),g=AnimatedGifExport.findAnimatedPaths(c);if(0==g.length)null!=k&&k(Error(mxResources.get("noAnimationsInDiagram")));else{var l=-b.duration||AnimatedGifExport.detectDuration(g)||1E3,n=Math.max(2,Math.round(q*l/1E3));AnimatedGifExport.removeAnimationCss(c,g);p.convertImages(c,mxUtils.bind(this,function(v){try{this.renderFrames(v,g,n,q,u,J,I,G,E,f,k)}catch(x){null!=k&&k(x)}}),null,p.createImageUrlConverter())}}catch(v){null!=k&&k(v)}};-AnimatedGifExport.prototype.renderFrames=function(b,f,k,d,p,q,u,A,J,I,G){var E=parseInt(b.getAttribute("width")),c=parseInt(b.getAttribute("height"));if(isNaN(E)||isNaN(c)||0>=E||0>=c)null!=G&&G(Error("Invalid SVG dimensions"));else{var g=this.editorUi.editor.getMaxCanvasScale(E,c,1);1>g&&(E=Math.ceil(E*g),c=Math.ceil(c*g));var l=new GifEncoder(E,c);l.setDelay(Math.round(1E3/d));l.setRepeat(u);l.setTransparent(q);var n=0,v=mxUtils.bind(this,function(){if(n>=k)try{var x=l.finish();I(x)}catch(U){null!=-G&&G(U)}else{x=1<k?n/k:0;for(var B=0;B<f.length;B++){var C=f[B];if("alternate"===C.direction||"alternate-reverse"===C.direction){var H=.5>x?2*x:2*(1-x);H="alternate"===C.direction?C.dashSum*(1-H):C.dashSum*H}else H="reverse"===C.direction?C.dashSum*x:C.dashSum*(1-x);C.node.style.strokeDashoffset=H}x=Editor.createSvgDataUri(mxUtils.getXml(b));var D=new Image;D.onload=function(){try{var U=document.createElement("canvas");U.width=E;U.height=c;var S=U.getContext("2d");null!=A&&(S.fillStyle=A,S.fillRect(0,-0,E,c));1>g&&S.scale(g,g);S.drawImage(D,0,0);l.addFrame(U);n++;setTimeout(v,0)}catch(V){null!=G&&G(V)}};D.onerror=function(){null!=G&&G(Error("Failed to render SVG frame"))};D.src=x}});v()}};+GifEncoder.medianCut=function(b,f){if(0==b.length)return[[0,0,0]];for(b=[b];b.length<f;){for(var k=-1,d=0,p=0;p<b.length;p++)if(!(1>=b[p].length)){var q=GifEncoder.colorRange(b[p]);q.maxRange>k&&(k=q.maxRange,d=p)}if(0>=k)break;p=b[d];q=GifEncoder.colorRange(p);p.sort(function(H,F){return H[q.channel]-F[q.channel]});k=Math.floor(p.length/2);b.splice(d,1,p.slice(0,k),p.slice(k))}f=[];for(p=0;p<b.length;p++){d=b[p];for(var u=k=0,A=0,I=0;I<d.length;I++)k+=d[I][0],u+=d[I][1],A+=d[I][2];f.push([Math.round(k/+d.length),Math.round(u/d.length),Math.round(A/d.length)])}return f};GifEncoder.colorRange=function(b){for(var f=255,k=0,d=255,p=0,q=255,u=0,A=0;A<b.length;A++){var I=b[A];I[0]<f&&(f=I[0]);I[0]>k&&(k=I[0]);I[1]<d&&(d=I[1]);I[1]>p&&(p=I[1]);I[2]<q&&(q=I[2]);I[2]>u&&(u=I[2])}b=k-f;d=p-d;q=u-q;return b>=d&&b>=q?{channel:0,maxRange:b}:d>=b&&d>=q?{channel:1,maxRange:d}:{channel:2,maxRange:q}};+GifEncoder.findClosest=function(b,f,k,d,p){for(var q=Infinity,u=0,A=0;A<b.length;A++)if(A!==p){var I=f-b[A][0],H=k-b[A][1],F=d-b[A][2];I=I*I+H*H+F*F;I<q&&(q=I,u=A)}return u};+GifEncoder.lzwEncode=function(b,f){for(var k=1<<f,d=k+1,p=f+1,q=d+1,u=1<<p,A={},I=0;I<k;I++)A[String(I)]=I;var H=0,F=0,D=[],c=function(n){H|=n<<F;for(F+=p;8<=F;)D.push(H&255),H>>=8,F-=8};c(k);if(0==b.length)return c(d),0<F&&D.push(H&255),new Uint8Array(D);var g=String(b[0]);for(I=1;I<b.length;I++){var l=g+","+b[I];if(null!=A[l])g=l;else{c(A[g]);if(4096>q)A[l]=q,q++,q>u&&12>p&&(p++,u=1<<p);else{c(k);A={};for(q=0;q<k;q++)A[String(q)]=q;p=f+1;q=d+1;u=1<<p}g=String(b[I])}}c(A[g]);c(d);0<F&&D.push(H&255);+return new Uint8Array(D)};function AnimatedGifExport(b){this.editorUi=b}+AnimatedGifExport.prototype.doExport=function(b,f,k){var d=this.editorUi.editor.graph,p=this.editorUi.editor;b=b||{};var q=b.fps||15,u=b.scale||1,A=b.border||0,I=b.transparent||!1,H=null!=b.repeat?b.repeat:0,F=I?null:null!=b.background&&b.background!=mxConstants.NONE?b.background:"#ffffff",D=b.theme||null;try{var c=d.getSvg(F,u,A,!0,null,!0,null,null,null,d.shadowVisible,null,D),g=AnimatedGifExport.findAnimatedPaths(c);if(0==g.length)null!=k&&k(Error(mxResources.get("noAnimationsInDiagram")));else{var l=+b.duration||AnimatedGifExport.detectDuration(g)||1E3,n=Math.max(2,Math.round(q*l/1E3));AnimatedGifExport.removeAnimationCss(c,g);p.convertImages(c,mxUtils.bind(this,function(v){try{this.renderFrames(v,g,n,q,u,I,H,F,D,f,k)}catch(x){null!=k&&k(x)}}),null,p.createImageUrlConverter())}}catch(v){null!=k&&k(v)}};+AnimatedGifExport.prototype.renderFrames=function(b,f,k,d,p,q,u,A,I,H,F){var D=parseInt(b.getAttribute("width")),c=parseInt(b.getAttribute("height"));if(isNaN(D)||isNaN(c)||0>=D||0>=c)null!=F&&F(Error("Invalid SVG dimensions"));else{var g=this.editorUi.editor.getMaxCanvasScale(D,c,1);1>g&&(D=Math.ceil(D*g),c=Math.ceil(c*g));var l=new GifEncoder(D,c);l.setDelay(Math.round(1E3/d));l.setRepeat(u);l.setTransparent(q);var n=0,v=mxUtils.bind(this,function(){if(n>=k)try{var x=l.finish();H(x)}catch(J){null!=+F&&F(J)}else{x=1<k?n/k:0;for(var B=0;B<f.length;B++){var C=f[B];if("alternate"===C.direction||"alternate-reverse"===C.direction){var G=.5>x?2*x:2*(1-x);G="alternate"===C.direction?C.dashSum*(1-G):C.dashSum*G}else G="reverse"===C.direction?C.dashSum*x:C.dashSum*(1-x);C.node.style.strokeDashoffset=G}x=Editor.createSvgDataUri(mxUtils.getXml(b));var N=new Image;N.onload=function(){try{var J=document.createElement("canvas");J.width=D;J.height=c;var T=J.getContext("2d");null!=A&&(T.fillStyle=A,T.fillRect(0,+0,D,c));1>g&&T.scale(g,g);T.drawImage(N,0,0);l.addFrame(J);n++;setTimeout(v,0)}catch(V){null!=F&&F(V)}};N.onerror=function(){null!=F&&F(Error("Failed to render SVG frame"))};N.src=x}});v()}};AnimatedGifExport.findAnimatedPaths=function(b){var f=[];b=b.getElementsByTagName("path");for(var k=0;k<b.length;k++){var d=b[k],p=d.style.animation||d.getAttribute("style");if(null!=p&&0<=p.indexOf("ge-flow-animation")){var q=parseFloat(d.style.strokeDashoffset);isNaN(q)&&(q=parseFloat(d.getAttribute("stroke-dashoffset")));if(!isNaN(q)&&0<q){var u="normal";"string"===typeof p&&(0<=p.indexOf("alternate-reverse")?u="alternate-reverse":0<=p.indexOf("alternate")?u="alternate":0<=p.indexOf("reverse")&&(u="reverse"));var A=500;p="string"===typeof p?p.match(/(\d+)ms/):null;null!=p&&(A=parseInt(p[1]));f.push({node:d,dashSum:q,duration:A,direction:u})}}}return f};AnimatedGifExport.detectDuration=function(b){for(var f=0,k=0;k<b.length;k++)b[k].duration>f&&(f=b[k].duration);return f};AnimatedGifExport.removeAnimationCss=function(b,f){for(var k=0;k<f.length;k++)f[k].node.style.animation="",f[k].node.style.animationName="";k=b.getElementsByTagName("defs");if(0<k.length)for(b=k[0].getElementsByTagName("style"),k=b.length-1;0<=k;k--)null!=b[k].innerHTML&&0<=b[k].innerHTML.indexOf("ge-flow-animation")&&b[k].parentNode.removeChild(b[k])};DrawioClient=function(b,f){mxEventSource.call(this);this.ui=b;this.cookieName=f;this.token=this.getPersistentToken()};mxUtils.extend(DrawioClient,mxEventSource);DrawioClient.prototype.token=null;DrawioClient.prototype.user=null;DrawioClient.prototype.setUser=function(b){this.user=b;this.fireEvent(new mxEventObject("userChanged"))};DrawioClient.prototype.getUser=function(){return this.user};@@ -13939,9 +13951,9 @@ DriveFile.prototype.isConflict=function(b){return null!=b&&null!=b.error&&412==bDriveFile.prototype.getFolderUrl=function(){return null!=this.desc.labels&&this.desc.labels.trashed?"https://drive.google.com/drive/trash":null!=this.desc.parents&&0<this.desc.parents.length?"https://drive.google.com/drive/folders/"+this.desc.parents[0].id:null};DriveFile.prototype.getPublicUrl=function(b){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsAllDrives=true"},mxUtils.bind(this,function(f){if(null!=f&&null!=f.items)for(var k=0;k<f.items.length;k++)if("anyoneWithLink"===f.items[k].id||"anyone"===f.items[k].id){b(this.desc.webContentLink);return}b(null)}),mxUtils.bind(this,function(){b(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.isTrashed=function(){return this.desc.labels.trashed};DriveFile.prototype.save=function(b,f,k,d,p){DrawioFile.prototype.save.apply(this,[b,mxUtils.bind(this,function(){this.saveFile(null,b,f,k,d,p)}),k,d,p])};-DriveFile.prototype.saveFile=function(b,f,k,d,p,q){try{this.isEditable()?this.savingFile||(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(u,A){var J=mxUtils.bind(this,function(I,G){try{var E=this.desc;null!=this.sync&&this.sync.fileSaving();this.ui.drive.saveFile(this,G,mxUtils.bind(this,function(c,g,l,n){try{this.savingFile=!1,0!=c?(this.setModified(this.getShadowModified()),f&&(this.lastAutosaveRevision=(new Date).getTime()),-this.autosaveDelay=Math.round(Math.min(1E4,Math.max(DriveFile.prototype.autosaveDelay,this.saveDelay))),this.desc=c,this.fileSaved(g,E,mxUtils.bind(this,function(){this.contentChanged();null!=k&&k(c)}),d,A,l,n)):null!=d&&d(c)}catch(v){if(this.savingFile=!1,null!=d)d(v);else throw v;}}),mxUtils.bind(this,function(c,g){try{this.savingFile=!1,this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(g,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,-function(){this.updateFileData();this.setShadowModified(!1);J(I,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(c)}catch(l){if(this.savingFile=!1,null!=d)d(l);else throw l;}}),p,p,I,null,u)}catch(c){if(this.savingFile=!1,null!=d)d(c);else throw c;}});J(q,f)}))):null!=k&&k()}catch(u){if(null!=d)d(u);else throw u;}};+DriveFile.prototype.saveFile=function(b,f,k,d,p,q){try{this.isEditable()?this.savingFile||(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(u,A){var I=mxUtils.bind(this,function(H,F){try{var D=this.desc;null!=this.sync&&this.sync.fileSaving();this.ui.drive.saveFile(this,F,mxUtils.bind(this,function(c,g,l,n){try{this.savingFile=!1,0!=c?(this.setModified(this.getShadowModified()),f&&(this.lastAutosaveRevision=(new Date).getTime()),+this.autosaveDelay=Math.round(Math.min(1E4,Math.max(DriveFile.prototype.autosaveDelay,this.saveDelay))),this.desc=c,this.fileSaved(g,D,mxUtils.bind(this,function(){this.contentChanged();null!=k&&k(c)}),d,A,l,n)):null!=d&&d(c)}catch(v){if(this.savingFile=!1,null!=d)d(v);else throw v;}}),mxUtils.bind(this,function(c,g){try{this.savingFile=!1,this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(g,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,+function(){this.updateFileData();this.setShadowModified(!1);I(H,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(c)}catch(l){if(this.savingFile=!1,null!=d)d(l);else throw l;}}),p,p,H,null,u)}catch(c){if(this.savingFile=!1,null!=d)d(c);else throw c;}});I(q,f)}))):null!=k&&k()}catch(u){if(null!=d)d(u);else throw u;}};DriveFile.prototype.copyFile=function(b,f,k){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,b,f)}catch(d){f(d)}}),f,null!=k?k:this.ui.getCopyFilename(this,!0))};DriveFile.prototype.makeCopy=function(b,f,k){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(k,mxUtils.bind(this,function(d){null!=this.sync&&(this.sync.stop(),this.sync.channelId=null,this.sync.key=null);this.desc=d;null!=this.sync&&this.sync.start();this.ui.spinner.stop();this.setModified(!1);this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();b()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=f&&f()}))};DriveFile.prototype.saveAs=function(b,f,k){this.ui.drive.copyFile(this.getId(),b,f,k)};DriveFile.prototype.rename=function(b,f,k){var d=this.getCurrentRevisionId();this.ui.drive.renameFile(this.getId(),b,mxUtils.bind(this,function(p){this.hasSameExtension(b,this.getTitle())?(this.desc=p,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=f&&f(p)):(this.desc=p,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,f,k))}),k)};@@ -13963,89 +13975,89 @@ DriveClient.prototype.catchupFields="etag,headRevisionId,modifiedDate,properties"-").replace(/\//g,"_");DriveClient.prototype.placeholderMimeType="image/png";DriveClient.prototype.libraryMimeType="application/vnd.jgraph.mxlibrary";DriveClient.prototype.newAppHostname="app.diagrams.net";DriveClient.prototype.extension=".drawio";DriveClient.prototype.tokenRefreshInterval=0;DriveClient.prototype.lastTokenRefresh=0;DriveClient.prototype.maxRetries=5;DriveClient.prototype.staleEtagMaxRetries=4;DriveClient.prototype.coolOff=1E3;DriveClient.prototype.mimeTypeCheckCoolOff=6E4;DriveClient.prototype.user=null;DriveClient.prototype.sameWinAuthMode=!1;DriveClient.prototype.sameWinRedirectUrl=null;DriveClient.prototype.setUser=function(k){this.user=k;null==this.user?(this.userId=null,null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null)):this.userId=k.id;this.fireEvent(new mxEventObject("userChanged"))};DriveClient.prototype.setUserId=function(k){this.userId=k;null!=this.user&&this.user.id!=this.userId&&(this.user=null)};DriveClient.prototype.getUser=function(){return this.user};DriveClient.prototype.getUsersList=function(){var k=[],d=JSON.parse(this.getPersistentToken(!0)),p=null;if(null!=d){null!=d.current&&(p=d.current.userId,k.push(d[p].user),k[0].isCurrent=!0);for(var q in d)"current"!=q&&q!=p&&k.push(d[q].user)}return k};DriveClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&userId="+this.userId+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();-this.setUser(null);b=null};DriveClient.prototype.execute=function(k){var d=mxUtils.bind(this,function(p){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(q,u){this.authorize(!1,mxUtils.bind(this,function(){null!=u&&u();k()}),mxUtils.bind(this,function(A){var J=null!=A.message?A.message:mxResources.get("cannotLogin");null!=A&&null!=A.error&&403==A.error.code&&null!=A.error.data&&0<A.error.data.length&&"domainPolicy"==A.error.data[0].reason&&(J=A.error.message);this.logout();this.ui.showError(mxResources.get("error"),-J,mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/doc/faq/gsuite-authorisation-troubleshoot")}),null,mxResources.get("ok"))}),q)}))});this.authorize(!0,k,d)};DriveClient.prototype.executeRequest=function(k,d,p){try{var q=!0,u=null,A=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var J=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=k;null!=u&&window.clearTimeout(u);u=window.setTimeout(mxUtils.bind(this,-function(){q=!1;null!=p&&p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:J})}),this.ui.timeout);var I=null,G=!1;"string"===typeof k.params?I=k.params:null!=k.params&&(I=JSON.stringify(k.params),G=!0);var E=k.fullUrl||this.GDriveBaseUrl+k.url;G&&(E+=(0<E.indexOf("?")?"&":"?")+"alt=json");var c=new mxXmlRequest(E,I,k.method||"GET");c.setRequestHeaders=mxUtils.bind(this,function(g,l){if(null!=k.headers)for(var n in k.headers)g.setRequestHeader(n,k.headers[n]);else null!=k.contentType?-g.setRequestHeader("Content-Type",k.contentType):G&&g.setRequestHeader("Content-Type","application/json");g.setRequestHeader("Authorization","Bearer "+b)});c.send(mxUtils.bind(this,function(g){try{if(window.clearTimeout(u),q){try{var l=JSON.parse(g.getText())}catch(x){l=null}if(200<=g.getStatus()&&299>=g.getStatus())null!=d&&d(l);else{var n=null!=l&&null!=l.error?null!=l.error.data?l.error.data:l.error.errors:null,v=null!=n&&0<n.length?n[0].reason:null;null==p||null==l||null==l.error||-1!=l.error.code&&-(403!=l.error.code||"domainPolicy"!=v&&"The requested mime type change is forbidden."!=l.error.message)?null!=l&&null!=l.error&&(401==l.error.code||403==l.error.code&&"rateLimitExceeded"!=v)?403==l.error.code&&this.retryAuth||401==l.error.code&&this.retryAuth&&"authError"==v?(null!=p&&p(l),this.retryAuth=!1):(this.retryAuth=!0,this.execute(J)):null!=l&&null!=l.error&&412!=l.error.code&&404!=l.error.code&&400!=l.error.code&&this.currentRequest==k&&A<this.maxRetries?(A++,this.requestThread=window.setTimeout(J,-Math.round(Math.pow(2,A)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=p&&p(l):p(l)}}}catch(x){if(null!=p)p(x);else throw x;}}))}catch(g){if(null!=p)p(g);else throw g;}});null!=b&&this.authCalled?J():this.execute(J)}catch(I){if(null!=p)p(I);else throw I;}};DriveClient.prototype.createAuthWin=function(k){return window.open(k?k:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};+this.setUser(null);b=null};DriveClient.prototype.execute=function(k){var d=mxUtils.bind(this,function(p){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(q,u){this.authorize(!1,mxUtils.bind(this,function(){null!=u&&u();k()}),mxUtils.bind(this,function(A){var I=null!=A.message?A.message:mxResources.get("cannotLogin");null!=A&&null!=A.error&&403==A.error.code&&null!=A.error.data&&0<A.error.data.length&&"domainPolicy"==A.error.data[0].reason&&(I=A.error.message);this.logout();this.ui.showError(mxResources.get("error"),+I,mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/doc/faq/gsuite-authorisation-troubleshoot")}),null,mxResources.get("ok"))}),q)}))});this.authorize(!0,k,d)};DriveClient.prototype.executeRequest=function(k,d,p){try{var q=!0,u=null,A=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var I=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=k;null!=u&&window.clearTimeout(u);u=window.setTimeout(mxUtils.bind(this,+function(){q=!1;null!=p&&p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:I})}),this.ui.timeout);var H=null,F=!1;"string"===typeof k.params?H=k.params:null!=k.params&&(H=JSON.stringify(k.params),F=!0);var D=k.fullUrl||this.GDriveBaseUrl+k.url;F&&(D+=(0<D.indexOf("?")?"&":"?")+"alt=json");var c=new mxXmlRequest(D,H,k.method||"GET");c.setRequestHeaders=mxUtils.bind(this,function(g,l){if(null!=k.headers)for(var n in k.headers)g.setRequestHeader(n,k.headers[n]);else null!=k.contentType?+g.setRequestHeader("Content-Type",k.contentType):F&&g.setRequestHeader("Content-Type","application/json");g.setRequestHeader("Authorization","Bearer "+b)});c.send(mxUtils.bind(this,function(g){try{if(window.clearTimeout(u),q){try{var l=JSON.parse(g.getText())}catch(x){l=null}if(200<=g.getStatus()&&299>=g.getStatus())null!=d&&d(l);else{var n=null!=l&&null!=l.error?null!=l.error.data?l.error.data:l.error.errors:null,v=null!=n&&0<n.length?n[0].reason:null;null==p||null==l||null==l.error||-1!=l.error.code&&+(403!=l.error.code||"domainPolicy"!=v&&"The requested mime type change is forbidden."!=l.error.message)?null!=l&&null!=l.error&&(401==l.error.code||403==l.error.code&&"rateLimitExceeded"!=v)?403==l.error.code&&this.retryAuth||401==l.error.code&&this.retryAuth&&"authError"==v?(null!=p&&p(l),this.retryAuth=!1):(this.retryAuth=!0,this.execute(I)):null!=l&&null!=l.error&&412!=l.error.code&&404!=l.error.code&&400!=l.error.code&&this.currentRequest==k&&A<this.maxRetries?(A++,this.requestThread=window.setTimeout(I,+Math.round(Math.pow(2,A)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=p&&p(l):p(l)}}}catch(x){if(null!=p)p(x);else throw x;}}))}catch(g){if(null!=p)p(g);else throw g;}});null!=b&&this.authCalled?I():this.execute(I)}catch(H){if(null!=p)p(H);else throw H;}};DriveClient.prototype.createAuthWin=function(k){return window.open(k?k:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};DriveClient.prototype.authorize=function(k,d,p,q,u){this.isExtAuth&&!k?window.parent.driveAuth(mxUtils.bind(this,function(A){this.updateAuthInfo(A,!0,!0,d,p)}),p):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(A){200<=A.getStatus()&&299>=A.getStatus()?this.authorizeStep2(A.getText(),k,d,p,q,u):null!=p&&p(A)}),p)};DriveClient.prototype.updateAuthInfo=function(k,d,p,q,u){b=k.access_token;delete k.access_token;k.expires=Date.now()+1E3*parseInt(k.expires_in);-k.remember=d;this.resetTokenRefresh(k);this.authCalled=!0;if(p||null==this.user){var A=JSON.stringify(k);this.updateUser(mxUtils.bind(this,function(){var J=JSON.parse(A);this.setPersistentToken(J,!d);null!=q&&q()}),u)}else null!=q&&(this.setPersistentToken(k,!d),q())};DriveClient.prototype.authorizeStep2=function(k,d,p,q,u,A){try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));if(null==this.userId){var J=-JSON.parse(this.getPersistentToken(!0));J&&null!=J.current&&(this.userId=J.current.userId)}if(d&&null==this.userId)null!=q&&q();else if(d)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k)+"&userId="+this.userId,null,"GET")).send(mxUtils.bind(this,function(G){try{if(200<=G.getStatus()&&299>=G.getStatus()){var E=JSON.parse(G.getText());this.updateAuthInfo(E,!0,!1,p,q)}else 0!=G.getStatus()&&this.logout(),null!=q&&q(G)}catch(c){if(null!=-window.console&&console.log("DriveClient.authorizeStep2",c),null!=q)q(c);else throw c;}}),q);else{var I="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(u?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k+(this.sameWinRedirectUrl?-"&redirect="+this.sameWinRedirectUrl:""));this.sameWinAuthMode?(window.location.assign(I),A=null):null==A?A=this.createAuthWin(I):A.location=I;null!=A?(window.onGoogleDriveCallback=mxUtils.bind(this,function(G,E){window.onGoogleDriveCallback=null;try{null==G?null!=q&&q({message:mxResources.get("accessDenied")}):this.updateAuthInfo(G,u,!0,p,q)}catch(c){null!=q&&q(c)}finally{null!=E&&E.close()}}),A.focus()):null!=q&&q({message:mxResources.get("allowPopups")})}}catch(G){if(null!=q)q(G);else throw G;+k.remember=d;this.resetTokenRefresh(k);this.authCalled=!0;if(p||null==this.user){var A=JSON.stringify(k);this.updateUser(mxUtils.bind(this,function(){var I=JSON.parse(A);this.setPersistentToken(I,!d);null!=q&&q()}),u)}else null!=q&&(this.setPersistentToken(k,!d),q())};DriveClient.prototype.authorizeStep2=function(k,d,p,q,u,A){try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));if(null==this.userId){var I=+JSON.parse(this.getPersistentToken(!0));I&&null!=I.current&&(this.userId=I.current.userId)}if(d&&null==this.userId)null!=q&&q();else if(d)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k)+"&userId="+this.userId,null,"GET")).send(mxUtils.bind(this,function(F){try{if(200<=F.getStatus()&&299>=F.getStatus()){var D=JSON.parse(F.getText());this.updateAuthInfo(D,!0,!1,p,q)}else 0!=F.getStatus()&&this.logout(),null!=q&&q(F)}catch(c){if(null!=+window.console&&console.log("DriveClient.authorizeStep2",c),null!=q)q(c);else throw c;}}),q);else{var H="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(u?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k+(this.sameWinRedirectUrl?+"&redirect="+this.sameWinRedirectUrl:""));this.sameWinAuthMode?(window.location.assign(H),A=null):null==A?A=this.createAuthWin(H):A.location=H;null!=A?(window.onGoogleDriveCallback=mxUtils.bind(this,function(F,D){window.onGoogleDriveCallback=null;try{null==F?null!=q&&q({message:mxResources.get("accessDenied")}):this.updateAuthInfo(F,u,!0,p,q)}catch(c){null!=q&&q(c)}finally{null!=D&&D.close()}}),A.focus()):null!=q&&q({message:mxResources.get("allowPopups")})}}catch(F){if(null!=q)q(F);else throw F;}};DriveClient.prototype.resetTokenRefresh=function(k){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=k&&null==k.error&&0<k.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(k.expires_in),this.lastTokenRefresh=Date.now(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*k.expires_in))};DriveClient.prototype.checkToken=function(k){var d=-0<this.lastTokenRefresh;Date.now()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){k();d&&this.fireEvent(new mxEventObject("disconnected"))})):k()};DriveClient.prototype.updateUser=function(k,d){try{var p={Authorization:"Bearer "+b};this.ui.editor.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(q){try{var u=JSON.parse(q);this.executeRequest({url:"/about"},mxUtils.bind(this,function(A){var J=-mxResources.get("notAvailable"),I=J,G=null;null!=A&&null!=A.user&&(J=A.user.emailAddress,I=A.user.displayName,G=null!=A.user.picture?A.user.picture.url:null);this.setUser(new DrawioUser(u.id,J,I,G,u.locale));this.userId=u.id;null!=k&&k()}),d)}catch(A){null!=d&&d(A)}}),d,null,null,null,null,p)}catch(q){if(null!=d)d(q);else throw q;}};DriveClient.prototype.copyFile=function(k,d,p,q){null!=k&&null!=d&&this.executeRequest({url:"/files/"+k+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true&enforceSingleParent=true",+0<this.lastTokenRefresh;Date.now()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){k();d&&this.fireEvent(new mxEventObject("disconnected"))})):k()};DriveClient.prototype.updateUser=function(k,d){try{var p={Authorization:"Bearer "+b};this.ui.editor.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(q){try{var u=JSON.parse(q);this.executeRequest({url:"/about"},mxUtils.bind(this,function(A){var I=+mxResources.get("notAvailable"),H=I,F=null;null!=A&&null!=A.user&&(I=A.user.emailAddress,H=A.user.displayName,F=null!=A.user.picture?A.user.picture.url:null);this.setUser(new DrawioUser(u.id,I,H,F,u.locale));this.userId=u.id;null!=k&&k()}),d)}catch(A){null!=d&&d(A)}}),d,null,null,null,null,p)}catch(q){if(null!=d)d(q);else throw q;}};DriveClient.prototype.copyFile=function(k,d,p,q){null!=k&&null!=d&&this.executeRequest({url:"/files/"+k+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true&enforceSingleParent=true",method:"POST",params:{title:d,properties:[{key:"channel",value:Editor.guid()}]}},p,q)};DriveClient.prototype.renameFile=function(k,d,p,q){null!=k&&null!=d&&this.executeRequest(this.createDriveRequest(k,{title:d}),p,q)};DriveClient.prototype.moveFile=function(k,d,p,q){null!=k&&null!=d&&this.executeRequest(this.createDriveRequest(k,{parents:[{kind:"drive#fileLink",id:d}]}),p,q)};DriveClient.prototype.createDriveRequest=function(k,d){return{url:"/files/"+k+"?uploadType=multipart&supportsAllDrives=true",method:"PUT",contentType:"application/json; charset=UTF-8",params:d}};DriveClient.prototype.getLibrary=function(k,d,p){return this.getFile(k,d,p,!0,!0)};DriveClient.prototype.loadDescriptor=function(k,d,p,q){this.executeRequest({url:"/files/"+k+"?supportsAllDrives=true&fields="+(null!=q?q:this.allFields)},d,p)};DriveClient.prototype.listFiles=function(k,d,p,q,u){this.executeRequest({url:"/files?supportsAllDrives=true&includeItemsFromAllDrives=true&q="+encodeURIComponent("(mimeType contains '"+this.xmlMimeType+"') "+(k?" and (title contains '"+k+"')":"")+(d?" and (modifiedDate > '"+d.toISOString()+"')":"")+(p?" and ('me' in owners)":""))+"&orderBy=modifiedDate desc,title"},q,u)};DriveClient.prototype.getCustomProperty=function(k,d){k=k.properties;var p=null;if(null!=k)for(var q=0;q<k.length;q++)if(k[q].key==d){p=k[q].value;break}return p};DriveClient.prototype.getFile=function(k,d,p,q,u){q=null!=q?q:!1;u=null!=u?u:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+k+"/revisions/"+urlParams.rev+"?supportsAllDrives=true"},-mxUtils.bind(this,function(A){A.title=A.originalFilename;A.headRevisionId=A.id;A.id=k;this.getXmlFile(A,d,p)}),p):this.loadDescriptor(k,mxUtils.bind(this,function(A){try{if(null!=this.user){var J=/\.png$/i.test(A.title);/\.v(dx|sdx?)$/i.test(A.title)||/\.gliffy$/i.test(A.title)||!Editor.useCanvasForExport&&J?this.ui.convertFile(A.downloadUrl,A.title,A.mimeType,this.extension,d,p,null,{Authorization:"Bearer "+b}):q||u||A.mimeType==this.libraryMimeType||A.mimeType==this.xmlMimeType?this.getXmlFile(A,-d,p,!0,u):this.getXmlFile(A,d,p)}else p({message:mxResources.get("loggedOut")})}catch(I){if(null!=p)p(I);else throw I;}}),p)};DriveClient.prototype.isGoogleRealtimeMimeType=function(k){return null!=k&&"application/vnd.jgraph.mxfile."==k.substring(0,30)};DriveClient.prototype.getXmlFile=function(k,d,p,q,u){try{var A={Authorization:"Bearer "+b},J=k.downloadUrl;if(null==J)null!=p&&p({message:mxResources.get("exportOptionsDisabledDetails")});else{var I=0,G=mxUtils.bind(this,function(){this.ui.editor.loadUrl(J,-mxUtils.bind(this,function(E){try{if(null==E)p({message:mxResources.get("invalidOrMissingFile")});else if(k.mimeType==this.libraryMimeType||u)k.mimeType!=this.libraryMimeType||u?d(new DriveLibrary(this.ui,E,k)):p({message:mxResources.get("notADiagramFile")});else{var c=!1;if(/\.png$/i.test(k.title)){var g=E.lastIndexOf(",");if(0<g){var l=this.ui.extractGraphModelFromPng(E);if(null!=l&&0<l.length)E=l;else try{l=E.substring(g+1);var n=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(l):-atob(l),v=this.ui.editor.extractGraphModel(mxUtils.parseXml(n).documentElement,!0);null==v||0<v.getElementsByTagName("parsererror").length?c=!0:E=n}catch(x){c=!0}}}else/\.pdf$/i.test(k.title)?(l=Editor.extractGraphModelFromPdf(E),null!=l&&0<l.length&&(c=!0,E=l)):"data:image/png;base64,PG14ZmlsZS"==E.substring(0,32)&&(n=E.substring(22),E=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(E,J)?this.ui.parseFileData(E,mxUtils.bind(this,-function(x){try{4==x.readyState&&(200<=x.status&&299>=x.status?d(new LocalFile(this.ui,x.responseText,k.title+this.extension,!0)):null!=p&&p({message:mxResources.get("errorLoadingFile")}))}catch(B){if(null!=p)p(B);else throw B;}}),k.title):d(c?new LocalFile(this.ui,E,k.title,!0):new DriveFile(this.ui,E,k))}}catch(x){if(null!=p)p(x);else throw x;}}),mxUtils.bind(this,function(E,c){if(I<this.maxRetries&&null!=c&&403==c.getStatus())I++,window.setTimeout(G,2*I*this.coolOff*(1+.1*(Math.random()-.5)));-else if(null!=p)p(E);else throw E;}),null!=k.mimeType&&"image/"==k.mimeType.substring(0,6)&&"image/svg"!=k.mimeType.substring(0,9)||/\.png$/i.test(k.title)||/\.jpe?g$/i.test(k.title)||/\.pdf$/i.test(k.title),null,null,null,A)});G()}}catch(E){if(null!=p)p(E);else throw E;}};DriveClient.prototype.saveFile=function(k,d,p,q,u,A,J,I,G){try{var E=0;k.saveLevel=1;var c=mxUtils.bind(this,function(S){if(null!=q)q(S);else throw S;}),g=mxUtils.bind(this,function(S){c(S);try{EditorUi.logError(S.message,null,-null,null,S)}catch(V){}});if(k.isEditable()&&null!=k.desc){var l=Date.now(),n=k.desc.etag,v=k.desc.modifiedDate,x=k.desc.headRevisionId,B=Editor.useCanvasForExport&&/(\.png)$/i.test(k.getTitle());A=null!=A?A:!1;var C=null,H=!1,D={mimeType:k.desc.mimeType,title:k.getTitle()};if(this.isGoogleRealtimeMimeType(D.mimeType))D.mimeType=this.xmlMimeType,C=k.desc,H=d=!0;else if("application/octet-stream"==D.mimeType||"1"==urlParams["override-mime"]&&D.mimeType!=this.xmlMimeType)D.mimeType=this.xmlMimeType;-var U=mxUtils.bind(this,function(S,V,t){try{k.saveLevel=3;var z=k.getData(),L=null,K=null;k.constructor==DriveFile&&(null==I&&(I=[]),null==k.getChannelId()&&I.push({key:"channel",value:Editor.guid(32)}),null==k.getChannelKey()&&I.push({key:"key",value:Editor.guid(32)}),G=null!=G?G:Editor.guid(32),I.push({key:"secret",value:G}),K=this.ui.getPagesForXml(z),L=this.ui.getHashValueForPages(K),I.push({key:"checksum",value:G+":"+L}));t||(null!=S||A||(S=this.placeholderThumbnail,V=this.placeholderMimeType),-null!=S&&null!=V&&(D.thumbnail={image:S,mimeType:V}));var M=mxUtils.bind(this,function(F){try{if(k.saveDelay=Date.now()-l,k.saveLevel=null,p(F,z,K,L),null!=C){this.executeRequest({url:"/files/"+C.id+"/revisions/"+C.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(N){N.pinned=!0;this.executeRequest({url:"/files/"+C.id+"/revisions/"+C.headRevisionId,method:"PUT",params:N})})));try{EditorUi.logEvent({category:k.convertedFrom+"-CONVERT-FILE-"+k.getHash(),action:"from_"+-C.id+"."+C.headRevisionId+"-to_"+k.desc.id+"."+k.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=k.sync?"-client_"+k.sync.clientId:"nosync")})}catch(N){}}}catch(N){g(N)}}),m=mxUtils.bind(this,function(F,N){k.saveLevel=4;try{null!=I&&(D.properties=I);var O=J||k.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:k.getCurrentEtag(),P=mxUtils.bind(this,function(R){k.saveLevel=5;try{var W=k.desc.mimeType!=this.xmlMimeType&&k.desc.mimeType!=this.mimeType&&-k.desc.mimeType!=this.libraryMimeType,X=!0,Y=null;try{Y=window.setTimeout(mxUtils.bind(this,function(){X=!1;c({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Z){}this.executeRequest(this.createUploadRequest(k.getId(),D,F,d||R||W,N,R?null:O,H),mxUtils.bind(this,function(Z){window.clearTimeout(Y);if(X){var ba=null!=Z?(new Date(Z.modifiedDate)).getTime()-(new Date(v)).getTime():0;if(0>=ba||n==Z.etag||d&&x==Z.headRevisionId){var ea=[];null==Z?ea.push("Empty response"):(0>=ba&&ea.push("Invalid modified time"),-n==Z.etag&&ea.push("Stale etag"),d&&x==Z.headRevisionId&&ea.push("Stale revision"),O=Z.etag);0==ea.length&&ea.push(mxResources.get("unknownError"));ba=ea.join(", ");if(E<this.staleEtagMaxRetries)E++,ea=Math.round(Math.pow(2,E)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(P,ea),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",E,"delay",ea,"rev",null!=Z?Z.headRevisionId:"null","errors",ba);else{k.saveLevel=12;c({message:mxResources.get("error")+": "+ba},Z);try{EditorUi.logError("Saving to Google Drive failed",-null,"id-"+k.desc.id+"-from-"+x+"."+v+"-"+this.ui.hashValue(n)+"-to-"+Z.headRevisionId+"."+Z.modifiedDate+"-"+this.ui.hashValue(Z.etag)+(0<ba.length?"-errors-"+ba:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=k.sync?"-client_"+k.sync.clientId:"-nosync")+"-retries-"+E+"-delay-"+(Date.now()-l))}catch(ha){}}}else M(Z)}}),mxUtils.bind(this,function(Z){window.clearTimeout(Y);if(X){k.saveLevel=6;try{k.isConflict(Z)?this.executeRequest({url:"/files/"+k.getId()+"?supportsAllDrives=true&fields="+-this.catchupFields},mxUtils.bind(this,function(ba){k.saveLevel=7;try{if(null!=ba&&ba.etag==O)if(E<this.staleEtagMaxRetries){E++;var ea=Math.round(2*E*this.coolOff*(1+.1*(Math.random()-.5)));window.setTimeout(T,ea);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",E,"delay",ea)}else{T(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+k.getHash(),action:"rev_"+k.desc.headRevisionId+"-mod_"+k.desc.modifiedDate+"-size_"+k.getSize()+"-mime_"+k.desc.mimeType+(this.ui.editor.autosave?-"":"-nosave")+(k.isAutosave()?"":"-noauto")+(k.changeListenerEnabled?"":"-nolisten")+(k.inConflictState?"-conflict":"")+(k.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=k.sync?"-client_"+k.sync.clientId:"-nosync")})}catch(ha){}}else"1"==urlParams.test&&ba.headRevisionId==x&&EditorUi.debug("DriveClient: Remote Etag Changed","local",O,"remote",ba.etag,"rev",k.desc.headRevisionId,"response",[ba],"file",[k]),c(Z,ba)}catch(ha){g(ha)}}),mxUtils.bind(this,function(){c(Z)})):-c(Z)}catch(ba){g(ba)}}}))}catch(Z){g(Z)}}),T=mxUtils.bind(this,function(R){k.saveLevel=9;if(R||null==O)P(R);else{var W=!0,X=null;try{X=window.setTimeout(mxUtils.bind(this,function(){W=!1;c({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(Y){}this.executeRequest({url:"/files/"+k.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){k.saveLevel=10;try{null!=Y&&Y.headRevisionId==x?("1"==urlParams.test&&O!=Y.etag&&EditorUi.debug("DriveClient: Preflight Etag Update",-"from",O,"to",Y.etag,"rev",k.desc.headRevisionId,"response",[Y],"file",[k]),O=Y.etag,P(R)):c({error:{code:412}},Y)}catch(Z){g(Z)}}}),mxUtils.bind(this,function(Y){window.clearTimeout(X);W&&(k.saveLevel=11,c(Y))}))}});if(B&&null==S){k.saveLevel=8;var Q=new Image;Q.onload=mxUtils.bind(this,function(){try{var R=this.thumbnailWidth/Q.width,W=document.createElement("canvas");W.width=this.thumbnailWidth;W.height=Math.floor(Q.height*R);W.getContext("2d").drawImage(Q,0,0,W.width,W.height);var X=W.toDataURL();-X=X.substring(X.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");D.thumbnail={image:X,mimeType:"image/png"};T(!1)}catch(Y){try{T(!1)}catch(Z){g(Z)}}});Q.src="data:image/png;base64,"+F}else T(!1)}catch(R){g(R)}});if(B){var y=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(F){m(F,!0)}),c,this.ui.getCurrentFile()!=k?z:null,y.scale,y.border)}else m(z,!1)}catch(F){g(F)}});try{k.saveLevel=2,(A||B||k.constructor==DriveLibrary||!this.enableThumbnails||-"0"==urlParams.thumb||null!=D.mimeType&&"application/vnd.jgraph.mxfile"!=D.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(S){try{var V=null;try{null!=S&&(V=S.toDataURL("image/png")),null!=V&&(V=V.length>this.maxThumbnailSize?null:V.substring(V.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(t){V=null}U(V,"image/png")}catch(t){g(t)}}),20))&&U(null,null,k.constructor!=DriveLibrary)}catch(S){g(S)}}else this.ui.editor.graph.reset(),c({message:mxResources.get("readOnly")})}catch(S){g(S)}};-DriveClient.prototype.insertFile=function(k,d,p,q,u,A,J){A=null!=A?A:this.xmlMimeType;k={mimeType:A,title:k};null!=p&&(k.parents=[{kind:"drive#fileLink",id:p}]);this.executeRequest(this.createUploadRequest(null,k,d,!1,J),mxUtils.bind(this,function(I){A==this.libraryMimeType?q(new DriveLibrary(this.ui,d,I)):0==I?null!=u&&u({message:mxResources.get("errorSavingFile")}):q(new DriveFile(this.ui,d,I))}),u)};DriveClient.prototype.createUploadRequest=function(k,d,p,q,u,A,J){u=null!=u?u:!1;var I={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};-null!=A&&(I["If-Match"]=A);k={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=k?"/"+k:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=k?"PUT":"POST",headers:I,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(d)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=p?u?p:!window.btoa||-mxClient.IS_IE||mxClient.IS_IE11?Base64.encode(p):Graph.base64EncodeUnicode(p):"")+"\r\n---------314159265358979323846--"};q||(k.fullUrl+="&newRevision=false");J&&(k.fullUrl+="&pinned=true");return k};DriveClient.prototype.createLinkPicker=function(){var k=f.linkPicker;if(null==k||f.linkPickerToken!=b){f.linkPickerToken=b;k=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0);var d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),+mxUtils.bind(this,function(A){A.title=A.originalFilename;A.headRevisionId=A.id;A.id=k;this.getXmlFile(A,d,p)}),p):this.loadDescriptor(k,mxUtils.bind(this,function(A){try{if(null!=this.user){var I=/\.png$/i.test(A.title);/\.v(dx|sdx?)$/i.test(A.title)||/\.gliffy$/i.test(A.title)||!Editor.useCanvasForExport&&I?this.ui.convertFile(A.downloadUrl,A.title,A.mimeType,this.extension,d,p,null,{Authorization:"Bearer "+b}):q||u||A.mimeType==this.libraryMimeType||A.mimeType==this.xmlMimeType?this.getXmlFile(A,+d,p,!0,u):this.getXmlFile(A,d,p)}else p({message:mxResources.get("loggedOut")})}catch(H){if(null!=p)p(H);else throw H;}}),p)};DriveClient.prototype.isGoogleRealtimeMimeType=function(k){return null!=k&&"application/vnd.jgraph.mxfile."==k.substring(0,30)};DriveClient.prototype.getXmlFile=function(k,d,p,q,u){try{var A={Authorization:"Bearer "+b},I=k.downloadUrl;if(null==I)null!=p&&p({message:mxResources.get("exportOptionsDisabledDetails")});else{var H=0,F=mxUtils.bind(this,function(){this.ui.editor.loadUrl(I,+mxUtils.bind(this,function(D){try{if(null==D)p({message:mxResources.get("invalidOrMissingFile")});else if(k.mimeType==this.libraryMimeType||u)k.mimeType!=this.libraryMimeType||u?d(new DriveLibrary(this.ui,D,k)):p({message:mxResources.get("notADiagramFile")});else{var c=!1;if(/\.png$/i.test(k.title)){var g=D.lastIndexOf(",");if(0<g){var l=this.ui.extractGraphModelFromPng(D);if(null!=l&&0<l.length)D=l;else try{l=D.substring(g+1);var n=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(l):+atob(l),v=this.ui.editor.extractGraphModel(mxUtils.parseXml(n).documentElement,!0);null==v||0<v.getElementsByTagName("parsererror").length?c=!0:D=n}catch(x){c=!0}}}else/\.pdf$/i.test(k.title)?(l=Editor.extractGraphModelFromPdf(D),null!=l&&0<l.length&&(c=!0,D=l)):"data:image/png;base64,PG14ZmlsZS"==D.substring(0,32)&&(n=D.substring(22),D=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(D,I)?this.ui.parseFileData(D,mxUtils.bind(this,+function(x){try{4==x.readyState&&(200<=x.status&&299>=x.status?d(new LocalFile(this.ui,x.responseText,k.title+this.extension,!0)):null!=p&&p({message:mxResources.get("errorLoadingFile")}))}catch(B){if(null!=p)p(B);else throw B;}}),k.title):d(c?new LocalFile(this.ui,D,k.title,!0):new DriveFile(this.ui,D,k))}}catch(x){if(null!=p)p(x);else throw x;}}),mxUtils.bind(this,function(D,c){if(H<this.maxRetries&&null!=c&&403==c.getStatus())H++,window.setTimeout(F,2*H*this.coolOff*(1+.1*(Math.random()-.5)));+else if(null!=p)p(D);else throw D;}),null!=k.mimeType&&"image/"==k.mimeType.substring(0,6)&&"image/svg"!=k.mimeType.substring(0,9)||/\.png$/i.test(k.title)||/\.jpe?g$/i.test(k.title)||/\.pdf$/i.test(k.title),null,null,null,A)});F()}}catch(D){if(null!=p)p(D);else throw D;}};DriveClient.prototype.saveFile=function(k,d,p,q,u,A,I,H,F){try{var D=0;k.saveLevel=1;var c=mxUtils.bind(this,function(T){if(null!=q)q(T);else throw T;}),g=mxUtils.bind(this,function(T){c(T);try{EditorUi.logError(T.message,null,+null,null,T)}catch(V){}});if(k.isEditable()&&null!=k.desc){var l=Date.now(),n=k.desc.etag,v=k.desc.modifiedDate,x=k.desc.headRevisionId,B=Editor.useCanvasForExport&&/(\.png)$/i.test(k.getTitle());A=null!=A?A:!1;var C=null,G=!1,N={mimeType:k.desc.mimeType,title:k.getTitle()};if(this.isGoogleRealtimeMimeType(N.mimeType))N.mimeType=this.xmlMimeType,C=k.desc,G=d=!0;else if("application/octet-stream"==N.mimeType||"1"==urlParams["override-mime"]&&N.mimeType!=this.xmlMimeType)N.mimeType=this.xmlMimeType;+var J=mxUtils.bind(this,function(T,V,t){try{k.saveLevel=3;var z=k.getData(),L=null,K=null;k.constructor==DriveFile&&(null==H&&(H=[]),null==k.getChannelId()&&H.push({key:"channel",value:Editor.guid(32)}),null==k.getChannelKey()&&H.push({key:"key",value:Editor.guid(32)}),F=null!=F?F:Editor.guid(32),H.push({key:"secret",value:F}),K=this.ui.getPagesForXml(z),L=this.ui.getHashValueForPages(K),H.push({key:"checksum",value:F+":"+L}));t||(null!=T||A||(T=this.placeholderThumbnail,V=this.placeholderMimeType),+null!=T&&null!=V&&(N.thumbnail={image:T,mimeType:V}));var M=mxUtils.bind(this,function(E){try{if(k.saveDelay=Date.now()-l,k.saveLevel=null,p(E,z,K,L),null!=C){this.executeRequest({url:"/files/"+C.id+"/revisions/"+C.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(P){P.pinned=!0;this.executeRequest({url:"/files/"+C.id+"/revisions/"+C.headRevisionId,method:"PUT",params:P})})));try{EditorUi.logEvent({category:k.convertedFrom+"-CONVERT-FILE-"+k.getHash(),action:"from_"++C.id+"."+C.headRevisionId+"-to_"+k.desc.id+"."+k.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=k.sync?"-client_"+k.sync.clientId:"nosync")})}catch(P){}}}catch(P){g(P)}}),m=mxUtils.bind(this,function(E,P){k.saveLevel=4;try{null!=H&&(N.properties=H);var O=I||k.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:k.getCurrentEtag(),Q=mxUtils.bind(this,function(S){k.saveLevel=5;try{var W=k.desc.mimeType!=this.xmlMimeType&&k.desc.mimeType!=this.mimeType&&+k.desc.mimeType!=this.libraryMimeType,X=!0,Y=null;try{Y=window.setTimeout(mxUtils.bind(this,function(){X=!1;c({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Z){}this.executeRequest(this.createUploadRequest(k.getId(),N,E,d||S||W,P,S?null:O,G),mxUtils.bind(this,function(Z){window.clearTimeout(Y);if(X){var aa=null!=Z?(new Date(Z.modifiedDate)).getTime()-(new Date(v)).getTime():0;if(0>=aa||n==Z.etag||d&&x==Z.headRevisionId){var fa=[];null==Z?fa.push("Empty response"):(0>=aa&&fa.push("Invalid modified time"),+n==Z.etag&&fa.push("Stale etag"),d&&x==Z.headRevisionId&&fa.push("Stale revision"),O=Z.etag);0==fa.length&&fa.push(mxResources.get("unknownError"));aa=fa.join(", ");if(D<this.staleEtagMaxRetries)D++,fa=Math.round(Math.pow(2,D)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(Q,fa),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",D,"delay",fa,"rev",null!=Z?Z.headRevisionId:"null","errors",aa);else{k.saveLevel=12;c({message:mxResources.get("error")+": "+aa},Z);try{EditorUi.logError("Saving to Google Drive failed",+null,"id-"+k.desc.id+"-from-"+x+"."+v+"-"+this.ui.hashValue(n)+"-to-"+Z.headRevisionId+"."+Z.modifiedDate+"-"+this.ui.hashValue(Z.etag)+(0<aa.length?"-errors-"+aa:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=k.sync?"-client_"+k.sync.clientId:"-nosync")+"-retries-"+D+"-delay-"+(Date.now()-l))}catch(ia){}}}else M(Z)}}),mxUtils.bind(this,function(Z){window.clearTimeout(Y);if(X){k.saveLevel=6;try{k.isConflict(Z)?this.executeRequest({url:"/files/"+k.getId()+"?supportsAllDrives=true&fields="++this.catchupFields},mxUtils.bind(this,function(aa){k.saveLevel=7;try{if(null!=aa&&aa.etag==O)if(D<this.staleEtagMaxRetries){D++;var fa=Math.round(2*D*this.coolOff*(1+.1*(Math.random()-.5)));window.setTimeout(U,fa);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",D,"delay",fa)}else{U(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+k.getHash(),action:"rev_"+k.desc.headRevisionId+"-mod_"+k.desc.modifiedDate+"-size_"+k.getSize()+"-mime_"+k.desc.mimeType+(this.ui.editor.autosave?+"":"-nosave")+(k.isAutosave()?"":"-noauto")+(k.changeListenerEnabled?"":"-nolisten")+(k.inConflictState?"-conflict":"")+(k.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=k.sync?"-client_"+k.sync.clientId:"-nosync")})}catch(ia){}}else"1"==urlParams.test&&aa.headRevisionId==x&&EditorUi.debug("DriveClient: Remote Etag Changed","local",O,"remote",aa.etag,"rev",k.desc.headRevisionId,"response",[aa],"file",[k]),c(Z,aa)}catch(ia){g(ia)}}),mxUtils.bind(this,function(){c(Z)})):+c(Z)}catch(aa){g(aa)}}}))}catch(Z){g(Z)}}),U=mxUtils.bind(this,function(S){k.saveLevel=9;if(S||null==O)Q(S);else{var W=!0,X=null;try{X=window.setTimeout(mxUtils.bind(this,function(){W=!1;c({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(Y){}this.executeRequest({url:"/files/"+k.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){k.saveLevel=10;try{null!=Y&&Y.headRevisionId==x?("1"==urlParams.test&&O!=Y.etag&&EditorUi.debug("DriveClient: Preflight Etag Update",+"from",O,"to",Y.etag,"rev",k.desc.headRevisionId,"response",[Y],"file",[k]),O=Y.etag,Q(S)):c({error:{code:412}},Y)}catch(Z){g(Z)}}}),mxUtils.bind(this,function(Y){window.clearTimeout(X);W&&(k.saveLevel=11,c(Y))}))}});if(B&&null==T){k.saveLevel=8;var R=new Image;R.onload=mxUtils.bind(this,function(){try{var S=this.thumbnailWidth/R.width,W=document.createElement("canvas");W.width=this.thumbnailWidth;W.height=Math.floor(R.height*S);W.getContext("2d").drawImage(R,0,0,W.width,W.height);var X=W.toDataURL();+X=X.substring(X.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");N.thumbnail={image:X,mimeType:"image/png"};U(!1)}catch(Y){try{U(!1)}catch(Z){g(Z)}}});R.src="data:image/png;base64,"+E}else U(!1)}catch(S){g(S)}});if(B){var y=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(E){m(E,!0)}),c,this.ui.getCurrentFile()!=k?z:null,y.scale,y.border)}else m(z,!1)}catch(E){g(E)}});try{k.saveLevel=2,(A||B||k.constructor==DriveLibrary||!this.enableThumbnails||+"0"==urlParams.thumb||null!=N.mimeType&&"application/vnd.jgraph.mxfile"!=N.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(T){try{var V=null;try{null!=T&&(V=T.toDataURL("image/png")),null!=V&&(V=V.length>this.maxThumbnailSize?null:V.substring(V.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(t){V=null}J(V,"image/png")}catch(t){g(t)}}),20))&&J(null,null,k.constructor!=DriveLibrary)}catch(T){g(T)}}else this.ui.editor.graph.reset(),c({message:mxResources.get("readOnly")})}catch(T){g(T)}};+DriveClient.prototype.insertFile=function(k,d,p,q,u,A,I){A=null!=A?A:this.xmlMimeType;k={mimeType:A,title:k};null!=p&&(k.parents=[{kind:"drive#fileLink",id:p}]);this.executeRequest(this.createUploadRequest(null,k,d,!1,I),mxUtils.bind(this,function(H){A==this.libraryMimeType?q(new DriveLibrary(this.ui,d,H)):0==H?null!=u&&u({message:mxResources.get("errorSavingFile")}):q(new DriveFile(this.ui,d,H))}),u)};DriveClient.prototype.createUploadRequest=function(k,d,p,q,u,A,I){u=null!=u?u:!1;var H={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};+null!=A&&(H["If-Match"]=A);k={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=k?"/"+k:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=k?"PUT":"POST",headers:H,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(d)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=p?u?p:!window.btoa||+mxClient.IS_IE||mxClient.IS_IE11?Base64.encode(p):Graph.base64EncodeUnicode(p):"")+"\r\n---------314159265358979323846--"};q||(k.fullUrl+="&newRevision=false");I&&(k.fullUrl+="&pinned=true");return k};DriveClient.prototype.createLinkPicker=function(){var k=f.linkPicker;if(null==k||f.linkPickerToken!=b){f.linkPickerToken=b;k=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0);var d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),p=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0);k=(new google.picker.PickerBuilder).setAppId(this.appId).setLocale(mxLanguage).setOAuthToken(f.linkPickerToken).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(k).addView(d).addView(p).addView(google.picker.ViewId.RECENTLY_PICKED)}return k};DriveClient.prototype.pickFile=function(k,d,p){this.filePickerCallback=null!=k?k:mxUtils.bind(this,function(q){this.ui.loadFile("G"+q)});this.filePicked=mxUtils.bind(this,function(q){q.action==google.picker.Action.PICKED&&this.filePickerCallback(q.docs[0].id,q.docs[0])});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var q=d?"genericPicker":"filePicker",u=mxUtils.bind(this,function(c){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(c).className&&(mxEvent.removeListener(document,"click",u),this[q].setVisible(!1),p&&p())});if(null==f[q]||f[q+"Token"]!=-b){f[q+"Token"]=b;var A=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),J=(new google.picker.DocsView).setIncludeFolders(!0),I=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),G=(new google.picker.DocsUploadView).setIncludeFolders(!0);d?(A.setMimeTypes("*/*"),J.setMimeTypes("*/*"),I.setMimeTypes("*/*")):(A.setMimeTypes(this.mimeTypes),J.setMimeTypes(this.mimeTypes),I.setMimeTypes(this.mimeTypes));f[q]=(new google.picker.PickerBuilder).setOAuthToken(f[q+-"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(A).addView(J).addView(I).addView(google.picker.ViewId.RECENTLY_PICKED).addView(G);if(urlParams.gPickerSize){var E=urlParams.gPickerSize.split(",");f[q]=f[q].setSize(E[0],E[1])}urlParams.topBaseUrl&&(f[q]=f[q].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));f[q]=f[q].setCallback(mxUtils.bind(this,function(c){if(c.action==google.picker.Action.PICKED||c.action==google.picker.Action.CANCEL)mxEvent.removeListener(document,+b){f[q+"Token"]=b;var A=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),I=(new google.picker.DocsView).setIncludeFolders(!0),H=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),F=(new google.picker.DocsUploadView).setIncludeFolders(!0);d?(A.setMimeTypes("*/*"),I.setMimeTypes("*/*"),H.setMimeTypes("*/*")):(A.setMimeTypes(this.mimeTypes),I.setMimeTypes(this.mimeTypes),H.setMimeTypes(this.mimeTypes));f[q]=(new google.picker.PickerBuilder).setOAuthToken(f[q++"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(A).addView(I).addView(H).addView(google.picker.ViewId.RECENTLY_PICKED).addView(F);if(urlParams.gPickerSize){var D=urlParams.gPickerSize.split(",");f[q]=f[q].setSize(D[0],D[1])}urlParams.topBaseUrl&&(f[q]=f[q].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));f[q]=f[q].setCallback(mxUtils.bind(this,function(c){if(c.action==google.picker.Action.PICKED||c.action==google.picker.Action.CANCEL)mxEvent.removeListener(document,"click",u),p&&c.action==google.picker.Action.CANCEL&&p();c.action==google.picker.Action.PICKED&&this.filePicked(c)})).build()}mxEvent.addListener(document,"click",u);f[q].setVisible(!0)}catch(c){this.ui.spinner.stop(),this.ui.handleError(c)}}))};DriveClient.prototype.pickFolder=function(k,d){this.folderPickerCallback=k;var p=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var q=-mxUtils.bind(this,function(G){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(G).className&&(mxEvent.removeListener(document,"click",q),f.folderPicker.setVisible(!1))});if(null==f.folderPicker||f.folderPickerToken!=b){f.folderPickerToken=b;var u=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),A=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),-J=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");f.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(f.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(u).addView(A).addView(J).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder"));-if(urlParams.gPickerSize){var I=urlParams.gPickerSize.split(",");f.folderPicker=f.folderPicker.setSize(I[0],I[1])}urlParams.topBaseUrl&&(f.folderPicker=f.folderPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));f.folderPicker=f.folderPicker.setCallback(mxUtils.bind(this,function(G){G.action!=google.picker.Action.PICKED&&G.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",q);this.folderPickerCallback(G)})).build()}mxEvent.addListener(document,"click",q);f.folderPicker.setVisible(!0)}catch(G){this.ui.spinner.stop(),-this.ui.handleError(G)}}))}catch(q){this.ui.handleError(q)}});d?p():this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop(),this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){p()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)}catch(q){this.ui.handleError(q)}}))};-DriveClient.prototype.pickLibrary=function(k){this.filePickerCallback=k;this.filePicked=mxUtils.bind(this,function(d){d.action==google.picker.Action.PICKED?this.filePickerCallback(d.docs[0].id):d.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var d=mxUtils.bind(this,function(I){"picker modal-dialog-bg picker-dialog-bg"==-mxEvent.getSource(I).className&&(mxEvent.removeListener(document,"click",d),f.libraryPicker.setVisible(!1))});if(null==f.libraryPicker||f.libraryPickerToken!=b){f.libraryPickerToken=b;var p=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),q=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),-u=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),A=(new google.picker.DocsUploadView).setIncludeFolders(!0);f.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(f.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(p).addView(q).addView(u).addView(google.picker.ViewId.RECENTLY_PICKED).addView(A);if(urlParams.gPickerSize){var J=-urlParams.gPickerSize.split(",");f.libraryPicker=f.libraryPicker.setSize(J[0],J[1])}urlParams.topBaseUrl&&(f.libraryPicker=f.libraryPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));f.libraryPicker=f.libraryPicker.setCallback(mxUtils.bind(this,function(I){I.action!=google.picker.Action.PICKED&&I.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",d);I.action==google.picker.Action.PICKED&&this.filePicked(I)})).build()}mxEvent.addListener(document,"click",d);f.libraryPicker.setVisible(!0)}catch(I){this.ui.spinner.stop(),-this.ui.handleError(I)}}))};DriveClient.prototype.showPermissions=function(k,d){var p=mxUtils.bind(this,function(){var q=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){var u=null!=d?d.getFolderUrl():"https://drive.google.com/open?id="+k;this.ui.editor.graph.openLink(u)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(q.container,400,150,!0,!0);q.init()});this.sharingFailed?p():this.checkToken(mxUtils.bind(this,-function(){try{var q=new gapi.drive.share.ShareClient(this.appId);q.setOAuthToken(b);q.setItemIds([k]);q.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(u){for(var A=!1,J=0;J<u.length;J++)for(var I=0;I<u[J].addedNodes.length;I++){var G=u[J].addedNodes[I];"BUTTON"==G.nodeName&&"ok"==G.getAttribute("name")&&null!=G.parentNode&&null!=G.parentNode.parentNode&&-"dialog"==G.parentNode.parentNode.getAttribute("role")?(this.sharingFailed=!0,G.click(),p(),A=!0):"DIV"==G.nodeName&&"shr-q-shr-r-shr-xb"==G.className&&(A=!0)}A&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(u){this.ui.handleError(u)}}))};DriveClient.prototype.clearPersistentToken=function(){var k=JSON.parse(this.getPersistentToken(!0))||{};delete k.current;delete k[this.userId];for(var d in k){k.current={userId:d,+mxUtils.bind(this,function(F){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(F).className&&(mxEvent.removeListener(document,"click",q),f.folderPicker.setVisible(!1))});if(null==f.folderPicker||f.folderPickerToken!=b){f.folderPickerToken=b;var u=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),A=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),+I=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");f.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(f.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(u).addView(A).addView(I).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder"));+if(urlParams.gPickerSize){var H=urlParams.gPickerSize.split(",");f.folderPicker=f.folderPicker.setSize(H[0],H[1])}urlParams.topBaseUrl&&(f.folderPicker=f.folderPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));f.folderPicker=f.folderPicker.setCallback(mxUtils.bind(this,function(F){F.action!=google.picker.Action.PICKED&&F.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",q);this.folderPickerCallback(F)})).build()}mxEvent.addListener(document,"click",q);f.folderPicker.setVisible(!0)}catch(F){this.ui.spinner.stop(),+this.ui.handleError(F)}}))}catch(q){this.ui.handleError(q)}});d?p():this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop(),this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){p()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)}catch(q){this.ui.handleError(q)}}))};+DriveClient.prototype.pickLibrary=function(k){this.filePickerCallback=k;this.filePicked=mxUtils.bind(this,function(d){d.action==google.picker.Action.PICKED?this.filePickerCallback(d.docs[0].id):d.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var d=mxUtils.bind(this,function(H){"picker modal-dialog-bg picker-dialog-bg"==+mxEvent.getSource(H).className&&(mxEvent.removeListener(document,"click",d),f.libraryPicker.setVisible(!1))});if(null==f.libraryPicker||f.libraryPickerToken!=b){f.libraryPickerToken=b;var p=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),q=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),+u=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),A=(new google.picker.DocsUploadView).setIncludeFolders(!0);f.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(f.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(p).addView(q).addView(u).addView(google.picker.ViewId.RECENTLY_PICKED).addView(A);if(urlParams.gPickerSize){var I=+urlParams.gPickerSize.split(",");f.libraryPicker=f.libraryPicker.setSize(I[0],I[1])}urlParams.topBaseUrl&&(f.libraryPicker=f.libraryPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));f.libraryPicker=f.libraryPicker.setCallback(mxUtils.bind(this,function(H){H.action!=google.picker.Action.PICKED&&H.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",d);H.action==google.picker.Action.PICKED&&this.filePicked(H)})).build()}mxEvent.addListener(document,"click",d);f.libraryPicker.setVisible(!0)}catch(H){this.ui.spinner.stop(),+this.ui.handleError(H)}}))};DriveClient.prototype.showPermissions=function(k,d){var p=mxUtils.bind(this,function(){var q=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){var u=null!=d?d.getFolderUrl():"https://drive.google.com/open?id="+k;this.ui.editor.graph.openLink(u)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(q.container,400,150,!0,!0);q.init()});this.sharingFailed?p():this.checkToken(mxUtils.bind(this,+function(){try{var q=new gapi.drive.share.ShareClient(this.appId);q.setOAuthToken(b);q.setItemIds([k]);q.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(u){for(var A=!1,I=0;I<u.length;I++)for(var H=0;H<u[I].addedNodes.length;H++){var F=u[I].addedNodes[H];"BUTTON"==F.nodeName&&"ok"==F.getAttribute("name")&&null!=F.parentNode&&null!=F.parentNode.parentNode&&+"dialog"==F.parentNode.parentNode.getAttribute("role")?(this.sharingFailed=!0,F.click(),p(),A=!0):"DIV"==F.nodeName&&"shr-q-shr-r-shr-xb"==F.className&&(A=!0)}A&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(u){this.ui.handleError(u)}}))};DriveClient.prototype.clearPersistentToken=function(){var k=JSON.parse(this.getPersistentToken(!0))||{};delete k.current;delete k[this.userId];for(var d in k){k.current={userId:d,expires:0};break}DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(k))};DriveClient.prototype.setPersistentToken=function(k,d){var p=JSON.parse(this.getPersistentToken(!0))||{};k.userId=this.userId;p.current=k;p[this.userId]={user:this.user};DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(p),d)}})();DropboxFile=function(b,f,k){DrawioFile.call(this,b,f);this.stat=k};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};DropboxFile.prototype.isRenamable=function(){return!0};DropboxFile.prototype.getSize=function(){return this.stat.size};DropboxFile.prototype.isRevisionHistorySupported=function(){return!0};DropboxFile.prototype.getFileUrl=function(){return"https://www.dropbox.com/home/Apps"+this.ui.dropbox.appPath+this.stat.path_display};DropboxFile.prototype.getFolderUrl=function(){var b=this.getFileUrl();return b.substring(0,b.lastIndexOf("/"))};-DropboxFile.prototype.getRevisions=function(b,f){var k=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});k.then(mxUtils.bind(this,function(d){try{for(var p=[],q=d.entries.length-1;0<=q;q--)mxUtils.bind(this,function(u){p.push({modifiedDate:u.client_modified,fileSize:u.size,getXml:mxUtils.bind(this,function(A,J){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:u.rev},A,J)}),getUrl:mxUtils.bind(this,function(A){return this.ui.getUrl(window.location.pathname+"?rev="++DropboxFile.prototype.getRevisions=function(b,f){var k=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});k.then(mxUtils.bind(this,function(d){try{for(var p=[],q=d.entries.length-1;0<=q;q--)mxUtils.bind(this,function(u){p.push({modifiedDate:u.client_modified,fileSize:u.size,getXml:mxUtils.bind(this,function(A,I){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:u.rev},A,I)}),getUrl:mxUtils.bind(this,function(A){return this.ui.getUrl(window.location.pathname+"?rev="+u.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=A?"&page="+A:""))+window.location.hash})})})(d.entries[q]);b(p)}catch(u){f(u)}}));k["catch"](function(d){f(d)})};DropboxFile.prototype.getLatestVersion=function(b,f){this.ui.dropbox.getFile(this.getId(),b,f)};DropboxFile.prototype.updateDescriptor=function(b){this.stat=b.stat};DropboxFile.prototype.save=function(b,f,k,d,p){this.doSave(this.getTitle(),b,f,k,d,p)};DropboxFile.prototype.saveAs=function(b,f,k){this.doSave(b,!1,f,k)};DropboxFile.prototype.doSave=function(b,f,k,d,p,q){var u=this.stat.name;this.stat.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.stat.name=u;this.saveFile(b,f,k,d,p,q)}),d,p,q])};-DropboxFile.prototype.saveFile=function(b,f,k,d){this.isEditable()?this.savingFile?null!=d&&d({code:App.ERROR_BUSY}):(f=mxUtils.bind(this,function(p){if(p)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var q=mxUtils.bind(this,function(A){var J=this.stat.path_display.lastIndexOf("/");J=1<J?this.stat.path_display.substring(1,J+1):null;this.ui.dropbox.saveFile(b,A,mxUtils.bind(this,function(I){this.setModified(this.getShadowModified());this.savingFile=!1;this.stat=I;this.contentChanged();-null!=k&&k()}),mxUtils.bind(this,function(I){this.savingFile=!1;null!=d&&d(I)}),J)});if(Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())){var u=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(A){q(this.ui.base64ToBlob(A,"image/png"))}),d,this.ui.getCurrentFile()!=this?this.getData():null,u.scale,u.border)}else q(this.getData())}catch(A){if(this.savingFile=!1,null!=d)d(A);else throw A;}else null!=d&&d()}),this.getTitle()==b?f(!0):this.ui.dropbox.checkExists(b,+DropboxFile.prototype.saveFile=function(b,f,k,d){this.isEditable()?this.savingFile?null!=d&&d({code:App.ERROR_BUSY}):(f=mxUtils.bind(this,function(p){if(p)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var q=mxUtils.bind(this,function(A){var I=this.stat.path_display.lastIndexOf("/");I=1<I?this.stat.path_display.substring(1,I+1):null;this.ui.dropbox.saveFile(b,A,mxUtils.bind(this,function(H){this.setModified(this.getShadowModified());this.savingFile=!1;this.stat=H;this.contentChanged();+null!=k&&k()}),mxUtils.bind(this,function(H){this.savingFile=!1;null!=d&&d(H)}),I)});if(Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())){var u=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(A){q(this.ui.base64ToBlob(A,"image/png"))}),d,this.ui.getCurrentFile()!=this?this.getData():null,u.scale,u.border)}else q(this.getData())}catch(A){if(this.savingFile=!1,null!=d)d(A);else throw A;}else null!=d&&d()}),this.getTitle()==b?f(!0):this.ui.dropbox.checkExists(b,f)):null!=k&&k()};DropboxFile.prototype.rename=function(b,f,k){this.ui.dropbox.renameFile(this,b,mxUtils.bind(this,function(d){this.hasSameExtension(b,this.getTitle())?(this.stat=d,this.descriptorChanged(),null!=f&&f()):(this.stat=d,this.descriptorChanged(),this.save(!0,f,k))}),k)};DropboxLibrary=function(b,f,k){DropboxFile.call(this,b,f,k)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!0};DropboxLibrary.prototype.doSave=function(b,f,k){this.saveFile(b,!1,f,k)};DropboxLibrary.prototype.open=function(){};(function(){var b=null;window.DropboxClient=function(f){DrawioClient.call(this,f,"dbauth");this.client=new Dropbox({clientId:this.clientId})};mxUtils.extend(DropboxClient,DrawioClient);DropboxClient.prototype.appPath="/drawio-diagrams/";DropboxClient.prototype.extension=".drawio";DropboxClient.prototype.writingFile=!1;DropboxClient.prototype.maxRetries=4;DropboxClient.prototype.clientId=window.DRAWIO_DROPBOX_ID;DropboxClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"dropbox";DropboxClient.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.client.authTokenRevoke().then(mxUtils.bind(this,function(){this.client.setAccessToken(null)}))};DropboxClient.prototype.updateUser=function(f,k,d){var p=!0,q=window.setTimeout(mxUtils.bind(this,function(){p=!1;k({code:App.ERROR_TIMEOUT})}),this.ui.timeout),u=this.client.usersGetCurrentAccount();u.then(mxUtils.bind(this,function(A){window.clearTimeout(q);p&&(this.setUser(new DrawioUser(A.account_id,A.email,A.name.display_name)),f())}));u["catch"](mxUtils.bind(this,function(A){window.clearTimeout(q);p&&(null==A||401!==A.status||d?k({message:mxResources.get("accessDenied")}):(this.setUser(null),this.client.setAccessToken(null),b=null,this.authenticate(mxUtils.bind(this,function(){this.updateUser(f,k,!0)}),k)))}))};DropboxClient.prototype.authenticate=function(f,k){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()?this.authenticateStep2(d.getText(),f,k):null!=k&&k(d)}),k)};DropboxClient.prototype.authenticateStep2=function(f,k,d){if(null==window.onDropboxCallback){var p=mxUtils.bind(this,function(){var q=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f),null,"GET")).send(mxUtils.bind(this,function(u){if(200<=u.getStatus()&&299>=u.getStatus())try{b=JSON.parse(u.getText()).access_token,this.client.setAccessToken(b),this.setUser(null),k()}catch(A){d({message:mxResources.get("authFailed"),retry:p})}else this.clearPersistentToken(),this.setUser(null),b=null,this.client.setAccessToken(null),401==u.getStatus()?p():d({message:mxResources.get("accessDenied"),retry:p})}),d):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(u,A){null!=window.open("https://www.dropbox.com/oauth2/authorize?client_id="+this.clientId+-(u?"&token_access_type=offline":"")+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(J,I){if(q){window.onDropboxCallback=null;q=!1;try{null==J?d({message:mxResources.get("accessDenied"),retry:p}):(null!=A&&A(),b=J.access_token,this.client.setAccessToken(b),this.setUser(null),u&&this.setPersistentToken("remembered"),k())}catch(G){d(G)}finally{null!=-I&&I.close()}}else null!=I&&I.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:p})}),mxUtils.bind(this,function(){q&&(window.onDropboxCallback=null,q=!1,d({message:mxResources.get("accessDenied"),retry:p}))}))});p()}else d({code:App.ERROR_BUSY})};DropboxClient.prototype.executePromise=function(f,k,d){var p=mxUtils.bind(this,function(u){var A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;d({code:App.ERROR_TIMEOUT,retry:q})}),this.ui.timeout),I=f();I.then(mxUtils.bind(this,-function(G){window.clearTimeout(J);A&&null!=k&&k(G)}));I["catch"](mxUtils.bind(this,function(G){window.clearTimeout(J);A&&(null==G||500!=G.status&&400!=G.status&&401!=G.status?d({message:mxResources.get("error")+" "+G.status}):(this.setUser(null),this.client.setAccessToken(null),b=null,u?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){q(!0)},d)})}):this.authenticate(function(){p(!0)},d)))}))}),q=mxUtils.bind(this,function(u){null==this.user?+(u?"&token_access_type=offline":"")+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(I,H){if(q){window.onDropboxCallback=null;q=!1;try{null==I?d({message:mxResources.get("accessDenied"),retry:p}):(null!=A&&A(),b=I.access_token,this.client.setAccessToken(b),this.setUser(null),u&&this.setPersistentToken("remembered"),k())}catch(F){d(F)}finally{null!=+H&&H.close()}}else null!=H&&H.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:p})}),mxUtils.bind(this,function(){q&&(window.onDropboxCallback=null,q=!1,d({message:mxResources.get("accessDenied"),retry:p}))}))});p()}else d({code:App.ERROR_BUSY})};DropboxClient.prototype.executePromise=function(f,k,d){var p=mxUtils.bind(this,function(u){var A=!0,I=window.setTimeout(mxUtils.bind(this,function(){A=!1;d({code:App.ERROR_TIMEOUT,retry:q})}),this.ui.timeout),H=f();H.then(mxUtils.bind(this,+function(F){window.clearTimeout(I);A&&null!=k&&k(F)}));H["catch"](mxUtils.bind(this,function(F){window.clearTimeout(I);A&&(null==F||500!=F.status&&400!=F.status&&401!=F.status?d({message:mxResources.get("error")+" "+F.status}):(this.setUser(null),this.client.setAccessToken(null),b=null,u?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){q(!0)},d)})}):this.authenticate(function(){p(!0)},d)))}))}),q=mxUtils.bind(this,function(u){null==this.user?this.updateUser(function(){q(!0)},d,u):p(u)});null==b?this.authenticate(function(){q(!0)},d):q(!1)};DropboxClient.prototype.getLibrary=function(f,k,d){this.getFile(f,k,d,!0)};DropboxClient.prototype.getFile=function(f,k,d,p){p=null!=p?p:!1;var q=/\.png$/i.test(f);if(/^https:\/\//i.test(f)||/\.v(dx|sdx?)$/i.test(f)||/\.gliffy$/i.test(f)||/\.pdf$/i.test(f)||!Editor.useCanvasForExport&&q){var u=mxUtils.bind(this,function(){var A=f.split("/");this.ui.convertFile(f,0<A.length?A[A.length-1]:f,null,this.extension,-k,d)});null!=b?u():this.authenticate(u,d)}else u={path:"/"+f},null!=urlParams.rev&&(u.rev=urlParams.rev),this.readFile(u,mxUtils.bind(this,function(A,J){var I=null;if(0<(q?A.lastIndexOf(","):-1)){var G=this.ui.extractGraphModelFromPng(A);null!=G&&0<G.length?A=G:I=new LocalFile(this,A,f,!0)}k(null!=I?I:p?new DropboxLibrary(this.ui,A,J):new DropboxFile(this.ui,A,J))}),d,q)};DropboxClient.prototype.readFile=function(f,k,d,p){var q=mxUtils.bind(this,function(A){var J=!0,I=window.setTimeout(mxUtils.bind(this,-function(){J=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),G=this.client.filesGetMetadata({path:"/"+f.path.substring(1),include_deleted:!1});G.then(mxUtils.bind(this,function(E){}));G["catch"](function(E){window.clearTimeout(I);J&&null!=E&&409==E.status&&(J=!1,d({message:mxResources.get("fileNotFound")}))});G=this.client.filesDownload(f);G.then(mxUtils.bind(this,function(E){window.clearTimeout(I);if(J){J=!1;try{var c=new FileReader;c.onload=mxUtils.bind(this,function(g){k(c.result,E)});p?c.readAsDataURL(E.fileBlob):-c.readAsText(E.fileBlob)}catch(g){d(g)}}}));G["catch"](mxUtils.bind(this,function(E){window.clearTimeout(I);J&&(J=!1,null==E||500!=E.status&&400!=E.status&&401!=E.status?d({message:mxResources.get("error")+" "+E.status}):(this.client.setAccessToken(null),this.setUser(null),b=null,A?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){u(!0)},d)})}):this.authenticate(function(){q(!0)},d)))}))}),u=mxUtils.bind(this,function(A){null==this.user?this.updateUser(function(){u(!0)},+k,d)});null!=b?u():this.authenticate(u,d)}else u={path:"/"+f},null!=urlParams.rev&&(u.rev=urlParams.rev),this.readFile(u,mxUtils.bind(this,function(A,I){var H=null;if(0<(q?A.lastIndexOf(","):-1)){var F=this.ui.extractGraphModelFromPng(A);null!=F&&0<F.length?A=F:H=new LocalFile(this,A,f,!0)}k(null!=H?H:p?new DropboxLibrary(this.ui,A,I):new DropboxFile(this.ui,A,I))}),d,q)};DropboxClient.prototype.readFile=function(f,k,d,p){var q=mxUtils.bind(this,function(A){var I=!0,H=window.setTimeout(mxUtils.bind(this,+function(){I=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),F=this.client.filesGetMetadata({path:"/"+f.path.substring(1),include_deleted:!1});F.then(mxUtils.bind(this,function(D){}));F["catch"](function(D){window.clearTimeout(H);I&&null!=D&&409==D.status&&(I=!1,d({message:mxResources.get("fileNotFound")}))});F=this.client.filesDownload(f);F.then(mxUtils.bind(this,function(D){window.clearTimeout(H);if(I){I=!1;try{var c=new FileReader;c.onload=mxUtils.bind(this,function(g){k(c.result,D)});p?c.readAsDataURL(D.fileBlob):+c.readAsText(D.fileBlob)}catch(g){d(g)}}}));F["catch"](mxUtils.bind(this,function(D){window.clearTimeout(H);I&&(I=!1,null==D||500!=D.status&&400!=D.status&&401!=D.status?d({message:mxResources.get("error")+" "+D.status}):(this.client.setAccessToken(null),this.setUser(null),b=null,A?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){u(!0)},d)})}):this.authenticate(function(){q(!0)},d)))}))}),u=mxUtils.bind(this,function(A){null==this.user?this.updateUser(function(){u(!0)},d,A):q(A)});null==b?this.authenticate(function(){u(!0)},d):u(!1)};DropboxClient.prototype.checkExists=function(f,k,d){var p=mxUtils.bind(this,function(){return this.client.filesGetMetadata({path:"/"+f.toLowerCase(),include_deleted:!1})});this.executePromise(p,mxUtils.bind(this,function(q){d?k(!1,!0,q):this.ui.confirm(mxResources.get("replaceIt",[f]),function(){k(!0,!0,q)},function(){k(!1,!0,q)})}),function(q){k(!0,!1)})};DropboxClient.prototype.renameFile=function(f,k,d,p){if(/[\\\/:\?\*"\|]/.test(k))p({message:mxResources.get("dropboxCharsNotAllowed")});-else{if(null!=f&&null!=k){var q=f.stat.path_display.substring(1),u=q.lastIndexOf("/");0<u&&(k=q.substring(0,u+1)+k)}null!=f&&null!=k&&f.stat.path_lower.substring(1)!==k.toLowerCase()?this.checkExists(k,mxUtils.bind(this,function(A,J,I){A?(A=mxUtils.bind(this,function(G){G=mxUtils.bind(this,function(){return this.client.filesMove({from_path:f.stat.path_display,to_path:"/"+k,autorename:!1})});this.executePromise(G,d,p)}),J&&I.path_lower.substring(1)!==k.toLowerCase()?(J=mxUtils.bind(this,function(){return this.client.filesDelete({path:"/"+-k.toLowerCase()})}),this.executePromise(J,A,p)):A()):p()})):p({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(f,k,d,p){this.insertFile(f,k,d,p,!0)};DropboxClient.prototype.insertFile=function(f,k,d,p,q){q=null!=q?q:!1;this.checkExists(f,mxUtils.bind(this,function(u){u?this.saveFile(f,k,mxUtils.bind(this,function(A){q?d(new DropboxLibrary(this.ui,k,A)):d(new DropboxFile(this.ui,k,A))}),p):p()}))};DropboxClient.prototype.saveFile=function(f,k,d,p,q){if(/[\\\/:\?\*"\|]/.test(f))p({message:mxResources.get("dropboxCharsNotAllowed")});+else{if(null!=f&&null!=k){var q=f.stat.path_display.substring(1),u=q.lastIndexOf("/");0<u&&(k=q.substring(0,u+1)+k)}null!=f&&null!=k&&f.stat.path_lower.substring(1)!==k.toLowerCase()?this.checkExists(k,mxUtils.bind(this,function(A,I,H){A?(A=mxUtils.bind(this,function(F){F=mxUtils.bind(this,function(){return this.client.filesMove({from_path:f.stat.path_display,to_path:"/"+k,autorename:!1})});this.executePromise(F,d,p)}),I&&H.path_lower.substring(1)!==k.toLowerCase()?(I=mxUtils.bind(this,function(){return this.client.filesDelete({path:"/"++k.toLowerCase()})}),this.executePromise(I,A,p)):A()):p()})):p({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(f,k,d,p){this.insertFile(f,k,d,p,!0)};DropboxClient.prototype.insertFile=function(f,k,d,p,q){q=null!=q?q:!1;this.checkExists(f,mxUtils.bind(this,function(u){u?this.saveFile(f,k,mxUtils.bind(this,function(A){q?d(new DropboxLibrary(this.ui,k,A)):d(new DropboxFile(this.ui,k,A))}),p):p()}))};DropboxClient.prototype.saveFile=function(f,k,d,p,q){if(/[\\\/:\?\*"\|]/.test(f))p({message:mxResources.get("dropboxCharsNotAllowed")});else if(15E7<=k.length)p({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(k.length)+" / 150 MB)"});else{q=null!=q?q:"";var u=mxUtils.bind(this,function(){return this.client.filesUpload({path:"/"+q+f,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([k],{type:"text/plain"})})});this.executePromise(u,d,p)}};DropboxClient.prototype.pickLibrary=function(f){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(k){if(this.ui.spinner.spin(document.body,-mxResources.get("loading"))){var d=mxUtils.bind(this,function(u){this.ui.spinner.stop();this.ui.handleError(u)}),p=null!=k[0].link?k[0].link.indexOf(this.appPath):-1;if(0<p){var q=decodeURIComponent(k[0].link.substring(p+this.appPath.length-1));this.readFile({path:q},mxUtils.bind(this,function(u,A){if(null!=A&&A.id==k[0].id)try{this.ui.spinner.stop(),f(q.substring(1),new DropboxLibrary(this.ui,u,A))}catch(J){this.ui.handleError(J)}else this.createLibrary(k[0],f,d)}),d)}else this.createLibrary(k[0],+mxResources.get("loading"))){var d=mxUtils.bind(this,function(u){this.ui.spinner.stop();this.ui.handleError(u)}),p=null!=k[0].link?k[0].link.indexOf(this.appPath):-1;if(0<p){var q=decodeURIComponent(k[0].link.substring(p+this.appPath.length-1));this.readFile({path:q},mxUtils.bind(this,function(u,A){if(null!=A&&A.id==k[0].id)try{this.ui.spinner.stop(),f(q.substring(1),new DropboxLibrary(this.ui,u,A))}catch(I){this.ui.handleError(I)}else this.createLibrary(k[0],f,d)}),d)}else this.createLibrary(k[0],f,d)}})})};DropboxClient.prototype.createLibrary=function(f,k,d){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[f.name]),mxUtils.bind(this,function(){this.ui.editor.loadUrl(f.link,mxUtils.bind(this,function(p){this.insertFile(f.name,p,mxUtils.bind(this,function(q){try{this.ui.spinner.stop(),k(q.getHash().substring(1),q)}catch(u){d(u)}}),d,!0)}),d)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};DropboxClient.prototype.pickFile=function(f,k){null!=-Dropbox.choose?(f=null!=f?f:mxUtils.bind(this,function(d,p){this.ui.loadFile(null!=d?"D"+encodeURIComponent(d):p.getHash(),null,p)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(d){if(this.ui.spinner.spin(document.body,mxResources.get("loading")))if(k)this.ui.spinner.stop(),f(d[0].link);else{var p=mxUtils.bind(this,function(I){this.ui.spinner.stop();this.ui.handleError(I)}),q=mxUtils.bind(this,function(I,G){this.ui.spinner.stop();f(I,-G)}),u=/\.png$/i.test(d[0].name);if(/\.vsdx$/i.test(d[0].name)||/\.gliffy$/i.test(d[0].name)||!Editor.useCanvasForExport&&u)q(d[0].link);else{var A=null!=d[0].link?d[0].link.indexOf(this.appPath):-1;if(0<A){var J=decodeURIComponent(d[0].link.substring(A+this.appPath.length-1));this.readFile({path:J},mxUtils.bind(this,function(I,G){if(null!=G&&G.id==d[0].id){var E=u?I.lastIndexOf(","):-1;this.ui.spinner.stop();var c=null;0<E&&(E=this.ui.extractGraphModelFromPng(I),null!=E&&0<E.length?I=E:c=new LocalFile(this,-I,J,!0));f(J.substring(1),null!=c?c:new DropboxFile(this.ui,I,G))}else this.createFile(d[0],q,p)}),p,u)}else this.createFile(d[0],q,p)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};DropboxClient.prototype.createFile=function(f,k,d){var p=/(\.png)$/i.test(f.name);this.ui.editor.loadUrl(f.link,mxUtils.bind(this,function(q){null!=q&&0<q.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[f.name]),mxUtils.bind(this,+Dropbox.choose?(f=null!=f?f:mxUtils.bind(this,function(d,p){this.ui.loadFile(null!=d?"D"+encodeURIComponent(d):p.getHash(),null,p)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(d){if(this.ui.spinner.spin(document.body,mxResources.get("loading")))if(k)this.ui.spinner.stop(),f(d[0].link);else{var p=mxUtils.bind(this,function(H){this.ui.spinner.stop();this.ui.handleError(H)}),q=mxUtils.bind(this,function(H,F){this.ui.spinner.stop();f(H,+F)}),u=/\.png$/i.test(d[0].name);if(/\.vsdx$/i.test(d[0].name)||/\.gliffy$/i.test(d[0].name)||!Editor.useCanvasForExport&&u)q(d[0].link);else{var A=null!=d[0].link?d[0].link.indexOf(this.appPath):-1;if(0<A){var I=decodeURIComponent(d[0].link.substring(A+this.appPath.length-1));this.readFile({path:I},mxUtils.bind(this,function(H,F){if(null!=F&&F.id==d[0].id){var D=u?H.lastIndexOf(","):-1;this.ui.spinner.stop();var c=null;0<D&&(D=this.ui.extractGraphModelFromPng(H),null!=D&&0<D.length?H=D:c=new LocalFile(this,+H,I,!0));f(I.substring(1),null!=c?c:new DropboxFile(this.ui,H,F))}else this.createFile(d[0],q,p)}),p,u)}else this.createFile(d[0],q,p)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};DropboxClient.prototype.createFile=function(f,k,d){var p=/(\.png)$/i.test(f.name);this.ui.editor.loadUrl(f.link,mxUtils.bind(this,function(q){null!=q&&0<q.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[f.name]),mxUtils.bind(this,function(){var u=p?q.lastIndexOf(","):-1;0<u&&(u=this.ui.extractGraphModelFromPng(q.substring(u+1)),null!=u&&0<u.length&&(q=u));this.insertFile(f.name,q,mxUtils.bind(this,function(A){k(f.name,A)}),d)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):(this.ui.spinner.stop(),d({message:mxResources.get("errorLoadingFile")}))}),d,p)}})();OneDriveFile=function(b,f,k,d){DrawioFile.call(this,b,f);this.meta=k;this.isSP=d};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.autosaveDelay=500;OneDriveFile.prototype.isRealtimeSupported=function(){return!0};OneDriveFile.prototype.getFileUrl=function(){var b=this.meta.webUrl;b=b.substring(0,b.lastIndexOf("/"));if(null!=this.meta.parentReference)try{if("personal"==this.meta.parentReference.driveType)b="https://onedrive.live.com/?cid="+encodeURIComponent(this.meta.parentReference.driveId)+"&id="+encodeURIComponent(this.meta.id);else if("documentLibrary"==this.meta.parentReference.driveType){var f=this.meta.parentReference.path;f=f.substring(f.indexOf("/root:")+6);var k=this.meta.webUrl;b=k.substring(0,k.length-f.length-encodeURIComponent(this.meta.name).length-1);k=k.substring(k.indexOf("/",8));b=b+"/Forms/AllItems.aspx?id="+k+"&parent="+k.substring(0,k.lastIndexOf("/"))}else if("business"==this.meta.parentReference.driveType){b=this.meta["@microsoft.graph.downloadUrl"];var d=b.indexOf("/_layouts/15/download.aspx?");f=k=this.meta.webUrl;k=k.substring(8);k=k.substring(k.indexOf("/"));f=f.substring(0,f.lastIndexOf("/"));f=f.substring(f.indexOf("/",8));b=b.substring(0,d)+"/_layouts/15/onedrive.aspx?id="+@@ -14057,185 +14069,185 @@ OneDriveFile.prototype.loadDescriptor=function(b,f){var k=this.isSP?this.ui.m365OneDriveFile.prototype.setDescriptor=function(b){this.meta=b};OneDriveFile.prototype.getDescriptorEtag=function(b){return b.eTag};OneDriveFile.prototype.setDescriptorEtag=function(b,f){b.eTag=f};OneDriveFile.prototype.loadPatchDescriptor=function(b,f){var k=this.isSP?this.ui.m365:this.ui.oneDrive,d=k.getItemURL(this.getId());k.executeRequest(d+"?select=etag,file",mxUtils.bind(this,function(p){200<=p.getStatus()&&299>=p.getStatus()?b(JSON.parse(p.getText())):f(k.parseRequestText(p))}),f)};OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(b,f,k,d,p){this.doSave(this.getTitle(),b,f,k,d,p)};OneDriveFile.prototype.saveAs=function(b,f,k){this.doSave(b,!1,f,k)};OneDriveFile.prototype.doSave=function(b,f,k,d,p,q){var u=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=u;this.saveFile(b,f,k,d,p,q)}),d,p,q])};-OneDriveFile.prototype.saveFile=function(b,f,k,d,p,q){if(!this.isEditable())null!=k&&k();else if(!this.savingFile)if(this.getTitle()==b){var u=mxUtils.bind(this,function(){try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var A=q||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),J=this.meta;null!=this.sync&&this.sync.fileSaving();(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(I,-G){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=I;this.fileSaved(G,J,mxUtils.bind(this,function(){this.contentChanged();null!=k&&k()}),d)}),mxUtils.bind(this,function(I,G){try{this.savingFile=!1,this.isConflict(G)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();u()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=-!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(I)}catch(E){if(this.savingFile=!1,null!=d)d(E);else throw E;}}),A)}catch(I){if(this.savingFile=!1,null!=d)d(I);else throw I;}});u()}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,(this.isSP?this.ui.m365:this.ui.oneDrive).insertFile(b,this.getData(),mxUtils.bind(this,function(A){this.setModified(this.getShadowModified());this.savingFile=!1;null!=k&&k();this.ui.fileLoaded(A)}),mxUtils.bind(this,function(){this.savingFile=+OneDriveFile.prototype.saveFile=function(b,f,k,d,p,q){if(!this.isEditable())null!=k&&k();else if(!this.savingFile)if(this.getTitle()==b){var u=mxUtils.bind(this,function(){try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var A=q||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),I=this.meta;null!=this.sync&&this.sync.fileSaving();(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(H,+F){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=H;this.fileSaved(F,I,mxUtils.bind(this,function(){this.contentChanged();null!=k&&k()}),d)}),mxUtils.bind(this,function(H,F){try{this.savingFile=!1,this.isConflict(F)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();u()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=+!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(H)}catch(D){if(this.savingFile=!1,null!=d)d(D);else throw D;}}),A)}catch(H){if(this.savingFile=!1,null!=d)d(H);else throw H;}});u()}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,(this.isSP?this.ui.m365:this.ui.oneDrive).insertFile(b,this.getData(),mxUtils.bind(this,function(A){this.setModified(this.getShadowModified());this.savingFile=!1;null!=k&&k();this.ui.fileLoaded(A)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))};OneDriveFile.prototype.rename=function(b,f,k){var d=this.getCurrentRevisionId();(this.isSP?this.ui.m365:this.ui.oneDrive).renameFile(this,b,mxUtils.bind(this,function(p){this.hasSameExtension(b,this.getTitle())?(this.meta=p,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=f&&f(p)):(this.meta=p,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,f,k))}),k)};-OneDriveFile.prototype.move=function(b,f,k){(this.isSP?this.ui.m365:this.ui.oneDrive).moveFile(this.getId(),b,mxUtils.bind(this,function(d){this.meta=d;this.descriptorChanged();null!=f&&f(d)}),k)};OneDriveLibrary=function(b,f,k,d){OneDriveFile.call(this,b,f,k,d)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(b,f,k){(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(d){this.desc=d;null!=f&&f(d)}),k)};OneDriveLibrary.prototype.open=function(){};(function(){var b=null,f=null,k=null,d=null,p=null,q=null,u=null,A=null;window.OneDriveClient=function(E,c,g,l,n){this.sharepointMode=!0===n;null==c&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(c=!0);null==g&&(g=null!=window.Editor?Editor.oneDriveInlinePicker:!0);null==l&&null!=window.urlParams&&"1"==window.urlParams.noLogoutOD&&(l=!0);DrawioClient.call(this,E,c?"oneDriveExtAuthInfo":this.sharepointMode?"ms365AuthInfo":"oneDriveAuthInfo");this.isExtAuth=c;this.inlinePicker=g;this.noLogout=-l;E=JSON.parse(this.token);null!=E&&(this.endpointHint=null!=E.endpointHint?E.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):E.endpointHint);this.sharepointMode&&(this.redirectUri=window.DRAWIO_SERVER_URL+"ms365")};mxUtils.extend(OneDriveClient,DrawioClient);OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"95e4b4ed-ed5c-4a05-935b-b411b4562ef2":"24b129a6-117b-4394-bdc8-3b9955e5cdef");OneDriveClient.prototype.clientId="app.diagrams.net"==+OneDriveFile.prototype.move=function(b,f,k){(this.isSP?this.ui.m365:this.ui.oneDrive).moveFile(this.getId(),b,mxUtils.bind(this,function(d){this.meta=d;this.descriptorChanged();null!=f&&f(d)}),k)};OneDriveLibrary=function(b,f,k,d){OneDriveFile.call(this,b,f,k,d)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(b,f,k){(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(d){this.desc=d;null!=f&&f(d)}),k)};OneDriveLibrary.prototype.open=function(){};(function(){var b=null,f=null,k=null,d=null,p=null,q=null,u=null,A=null;window.OneDriveClient=function(D,c,g,l,n){this.sharepointMode=!0===n;null==c&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(c=!0);null==g&&(g=null!=window.Editor?Editor.oneDriveInlinePicker:!0);null==l&&null!=window.urlParams&&"1"==window.urlParams.noLogoutOD&&(l=!0);DrawioClient.call(this,D,c?"oneDriveExtAuthInfo":this.sharepointMode?"ms365AuthInfo":"oneDriveAuthInfo");this.isExtAuth=c;this.inlinePicker=g;this.noLogout=+l;D=JSON.parse(this.token);null!=D&&(this.endpointHint=null!=D.endpointHint?D.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):D.endpointHint);this.sharepointMode&&(this.redirectUri=window.DRAWIO_SERVER_URL+"ms365")};mxUtils.extend(OneDriveClient,DrawioClient);OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"95e4b4ed-ed5c-4a05-935b-b411b4562ef2":"24b129a6-117b-4394-bdc8-3b9955e5cdef");OneDriveClient.prototype.clientId="app.diagrams.net"==window.location.hostname?"b5ff67d6-3155-4fca-965a-59a3655c4476":OneDriveClient.prototype.clientId;OneDriveClient.prototype.clientId="viewer.diagrams.net"==window.location.hostname?"417a451a-a343-4788-b6c1-901e63182565":OneDriveClient.prototype.clientId;OneDriveClient.prototype.scopes="user.read files.readwrite.all sites.read.all";OneDriveClient.prototype.scopesSP="https://microsoft.sharepoint.com/AllSites.Write https://microsoft.sharepoint.com/MyFiles.Write";OneDriveClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"microsoft";OneDriveClient.prototype.pickerRedirectUri=window.DRAWIO_SERVER_URL+"onedrive3.html";OneDriveClient.prototype.defEndpointHint="api.onedrive.com";OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint;OneDriveClient.prototype.rootId={id:"root",name:"root",parentReference:{driveId:"me"}};OneDriveClient.prototype.extension=".drawio";OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";OneDriveClient.prototype.authUrl="https://login.microsoftonline.com/"+-(window.DRAWIO_MSGRAPH_TENANT_ID||"common");OneDriveClient.prototype.PICKER_SDK_VERSION="8.0";OneDriveClient.prototype.FILE_EXTENSIONS=".drawio .xml .svg .png .pdf .vsdx".split(" ");OneDriveClient.prototype.sharepointMode=!1;OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];OneDriveClient.prototype.isValidFilename=function(E){if(null==-E||""===E)return!1;for(var c=0;c<this.invalidFilenameRegExs.length;c++)if(this.invalidFilenameRegExs[c].test(E))return!1;return!0};OneDriveClient.prototype.get=function(E,c,g){E=new mxXmlRequest(E,null,"GET");E.setRequestHeaders=mxUtils.bind(this,function(l,n){l.setRequestHeader("Authorization","Bearer "+b)});E.send(c,g);return E};OneDriveClient.prototype.updateUser=function(E,c,g){var l=!0,n=window.setTimeout(mxUtils.bind(this,function(){l=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+-"/me",mxUtils.bind(this,function(v){window.clearTimeout(n);if(l)if(200>v.getStatus()||300<=v.getStatus())g?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(E,c,!0)}),c,null,this.sharepointMode));else try{var x=JSON.parse(v.getText());this.setUser(new DrawioUser(x.id,x.mail,x.displayName));E()}catch(B){c(B)}}),mxUtils.bind(this,function(v){window.clearTimeout(n);l&&c(v)}))};OneDriveClient.prototype.resetTokenRefresh=function(E){null!=-this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<E&&(this.tokenRefreshInterval=1E3*E,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0,this.sharepointMode)}),900*E))};OneDriveClient.prototype.authenticate=function(E,c,g,l,n){this.isExtAuth?(window.oneDriveAuth?window.oneDriveAuth:window.parent.oneDriveAuth)(mxUtils.bind(this,function(v){this.updateAuthInfo(v,!0,null==this.endpointHint,-E,c)}),c,null!=window.urlParams&&"1"==urlParams.odAuthCancellable):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(v){200<=v.getStatus()&&299>=v.getStatus()?this.authenticateStep2(v.getText(),E,c,g,l,n):null!=c&&c({message:mxResources.get("error")+" "+v.getStatus()})}),c)};OneDriveClient.prototype.updateAuthInfo=function(E,c,g,l,n,v){g&&this.setUser(null);v?k=E.access_token:(b=E.access_token,this.sharepointMode&&(f=E.access_token));delete E.access_token;-E.expiresOn=Date.now()+1E3*E.expires_in;this.tokenExpiresOn=E.expiresOn;E.remember=c;this.setPersistentToken(JSON.stringify(E),!c);this.resetTokenRefresh(E.expires_in);g?this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){l()}),n):l()};OneDriveClient.prototype.authenticateStep2=function(E,c,g,l,n,v){if(null==window.onOneDriveCallback){var x=mxUtils.bind(this,function(){var B=!0,C=JSON.parse(this.getPersistentToken(!0));null!=C?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+-this.clientId+"&domain="+window.location.host+"&token="+E)+"&scopes="+encodeURIComponent(n?this.scopesSP:this.scopes),null,"GET")).send(mxUtils.bind(this,function(H){if(200<=H.getStatus()&&299>=H.getStatus())try{this.updateAuthInfo(JSON.parse(H.getText()),C.remember,v,mxUtils.bind(this,function(){n?this.authenticate(c,g,l,!1):c()}),g,n)}catch(D){g({message:mxResources.get("authFailed"),retry:x})}else this.clearPersistentToken(),this.setUser(null),b=null,this.sharepointMode&&(f=null),401!=H.getStatus()&&-400!=H.getStatus()||l?g({message:mxResources.get("accessDenied"),retry:x}):x()}),g):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(H,D){var U=this.authUrl+"/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&prompt=select_account&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent((n?this.scopesSP:this.scopes)+(H?" offline_access":""))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+E);U=window.open(U,-"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=U&&(window.onOneDriveCallback=mxUtils.bind(this,function(S,V){if(B){window.onOneDriveCallback=null;B=!1;try{null==S?g({message:mxResources.get("accessDenied"),retry:x}):(null!=D&&D(),this.updateAuthInfo(S,H,!n,mxUtils.bind(this,function(){n?this.authenticate(c,g,l,!1,-!0):c()}),g,n))}catch(t){g(t)}finally{null!=V&&V.close()}}else null!=V&&V.close()}),U.focus())}),mxUtils.bind(this,function(){B&&(window.onOneDriveCallback=null,B=!1,g({message:mxResources.get("accessDenied"),retry:x}))}))});x()}else g({code:App.ERROR_BUSY})};OneDriveClient.prototype.getAccountTypeAndEndpoint=function(E,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(g){try{if(200<=g.getStatus()&&299>=g.getStatus()){var l=JSON.parse(g.getText());0<l.webUrl.indexOf(".sharepoint.com")?-this.endpointHint=l.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var n=JSON.parse(this.getPersistentToken(!0));null!=n&&(n.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(n),!n.remember));E();return}}catch(v){}c({message:mxResources.get("unknownError")+" (Code: "+g.getStatus()+")"})}),c)};OneDriveClient.prototype.executeRequest=function(E,c,g){this.sharepointMode&&(b=f);var l=mxUtils.bind(this,function(n){var v=!0,x=window.setTimeout(mxUtils.bind(this,-function(){v=!1;g({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout);this.get(E,mxUtils.bind(this,function(B){window.clearTimeout(x);v&&(200<=B.getStatus()&&299>=B.getStatus()||404==B.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(B)):n||401!==B.getStatus()&&400!==B.getStatus()?g(this.parseRequestText(B)):this.authenticate(function(){l(!0)},g,n,this.sharepointMode))}),mxUtils.bind(this,function(B){window.clearTimeout(x);v&&g(B)}))});null==b||6E4>this.tokenExpiresOn--Date.now()?this.authenticate(function(){l(!0)},g,null,this.sharepointMode):l(!1)};OneDriveClient.prototype.checkToken=function(E,c){this.sharepointMode&&(b=f);null==b||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(E,null!=c?c:this.emptyFn,null,this.sharepointMode):E()};OneDriveClient.prototype.getItemRef=function(E){var c=E.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:E}};OneDriveClient.prototype.getItemURL=function(E,c){var g=E.split("/");return 1<-g.length?(E=g[1],(c?"":this.baseUrl)+"/drives/"+g[0]+("root"==E?"/root":"/items/"+E)):(c?"":this.baseUrl)+"/me/drive/items/"+E};OneDriveClient.prototype.getLibrary=function(E,c,g){this.getFile(E,c,g,!1,!0)};OneDriveClient.prototype.removeExtraHtmlContent=function(E){var c=E.lastIndexOf('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" ');0<c&&(E=E.substring(0,c));return E};OneDriveClient.prototype.getFile=function(E,c,g,l,n){n=null!=n?n:!1;this.executeRequest(this.getItemURL(E),-mxUtils.bind(this,function(v){if(200<=v.getStatus()&&299>=v.getStatus()){var x=JSON.parse(v.getText()),B=/\.png$/i.test(x.name);if(/\.v(dx|sdx?)$/i.test(x.name)||/\.gliffy$/i.test(x.name)||/\.pdf$/i.test(x.name)||!Editor.useCanvasForExport&&B)this.ui.convertFile(x["@microsoft.graph.downloadUrl"],x.name,null!=x.file?x.file.mimeType:null,this.extension,c,g);else{var C=!0,H=window.setTimeout(mxUtils.bind(this,function(){C=!1;g({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(x["@microsoft.graph.downloadUrl"],-mxUtils.bind(this,function(D){try{if(window.clearTimeout(H),C){/\.html$/i.test(x.name)&&(D=this.removeExtraHtmlContent(D));var U=null;if(0<(B?D.lastIndexOf(","):-1)){var S=this.ui.extractGraphModelFromPng(D);null!=S&&0<S.length?D=S:U=new LocalFile(this.ui,D,x.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==D.substring(0,32)){var V=D.substring(22);D=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V)}Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(D,x["@microsoft.graph.downloadUrl"])?-this.ui.parseFileData(D,mxUtils.bind(this,function(t){try{4==t.readyState&&(200<=t.status&&299>=t.status?c(new LocalFile(this.ui,t.responseText,x.name+this.extension,!0)):null!=g&&g({message:mxResources.get("errorLoadingFile")}))}catch(z){if(null!=g)g(z);else throw z;}}),x.name):null!=U?c(U):n?c(new OneDriveLibrary(this.ui,D,x,this.sharepointMode)):c(new OneDriveFile(this.ui,D,x,this.sharepointMode))}}catch(t){if(null!=g)g(t);else throw t;}}),mxUtils.bind(this,function(D){window.clearTimeout(H);C&&-g(this.parseRequestText(D))}),B||null!=x.file&&null!=x.file.mimeType&&("image/"==x.file.mimeType.substring(0,6)&&"image/svg"!=x.file.mimeType.substring(0,9)||"application/pdf"==x.file.mimeType))}}else this.isExtAuth?g({message:mxResources.get("fileNotFoundOrDenied"),ownerEmail:null!=window.urlParams?urlParams.ownerEml:null}):g(this.parseRequestText(v))}),function(v){null!=g&&(null!=v&&null!=v.error&&"ObjectHandle is Invalid"===v.error.message&&(v.error.message=mxResources.get("fileNotFoundOrDenied")),-g(v))})};OneDriveClient.prototype.renameFile=function(E,c,g,l){null!=E&&null!=c&&(this.isValidFilename(c)?this.checkExists(E.getParentId(),c,!1,mxUtils.bind(this,function(n){n?this.writeFile(this.getItemURL(E.getId()),JSON.stringify({name:c}),"PATCH","application/json",g,l):l()})):l({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};OneDriveClient.prototype.moveFile=function(E,c,g,l){c=this.getItemRef(c);var n=-this.getItemRef(E);c.driveId!=n.driveId?l({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(E),JSON.stringify({parentReference:c}),"PATCH","application/json",g,l)};OneDriveClient.prototype.insertLibrary=function(E,c,g,l,n){this.insertFile(E,c,g,l,!0,n)};OneDriveClient.prototype.insertFile=function(E,c,g,l,n,v){this.isValidFilename(E)?(n=null!=n?n:!1,this.checkExists(v,E,!0,mxUtils.bind(this,function(x){if(x){x=-"/me/drive/root";null!=v&&(x=this.getItemURL(v,!0));var B=mxUtils.bind(this,function(C){n?g(new OneDriveLibrary(this.ui,c,C,this.sharepointMode)):g(new OneDriveFile(this.ui,c,C,this.sharepointMode))});x=this.baseUrl+x+"/children/"+encodeURIComponent(E)+"/content";4E6<=c.length?this.writeFile(x,"","PUT",null,mxUtils.bind(this,function(C){this.writeLargeFile(this.getItemURL(C.id),c,B,l)}),l):this.writeFile(x,c,"PUT",null,B,l)}else l()}))):l({message:this.invalidFilenameRegExs[0].test(E)?mxResources.get("oneDriveCharsNotAllowed"):-mxResources.get("oneDriveInvalidDeviceName")})};OneDriveClient.prototype.checkExists=function(E,c,g,l){var n="/me/drive/root";null!=E&&(n=this.getItemURL(E,!0));this.executeRequest(this.baseUrl+n+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(v){404==v.getStatus()?l(!0):g?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){l(!0)},function(){l(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),-function(){l(!1)}))}),function(v){l(!1)},!0)};OneDriveClient.prototype.saveFile=function(E,c,g,l){try{var n=E.getData(),v=mxUtils.bind(this,function(B){var C=mxUtils.bind(this,function(D){c(D,n)}),H=this.getItemURL(E.getId());4E6<=B.length?this.writeLargeFile(H,B,C,g,l):this.writeFile(H+"/content/",B,"PUT",null,C,g,l)});if(Editor.useCanvasForExport&&/(\.png)$/i.test(E.meta.name)){var x=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(B){v(this.ui.base64ToBlob(B,-"image/png"))}),g,this.ui.getCurrentFile()!=E?n:null,x.scale,x.border)}else v(n)}catch(B){g(B)}};OneDriveClient.prototype.writeLargeFile=function(E,c,g,l,n){this.sharepointMode&&(b=f);try{if(null!=c){var v=(new TextEncoder).encode(c).length,x=mxUtils.bind(this,function(C,H,D,U){try{U=U||0;var S=!0,V=null;V=window.setTimeout(mxUtils.bind(this,function(){S=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout);var t=c.substr(H,4194304),z=(new TextEncoder).encode(t).length,L=new mxXmlRequest(C,t,"PUT");L.setRequestHeaders=-mxUtils.bind(this,function(K,M){K.setRequestHeader("Content-Range","bytes "+D+"-"+(D+z-1)+"/"+v)});L.send(mxUtils.bind(this,function(K){window.clearTimeout(V);if(S){var M=K.getStatus();200<=M&&299>=M?(M=H+t.length,M==c.length?g(JSON.parse(K.getText())):x(C,M,D+z,U)):500<=M&&599>=M&&2>U?(U++,x(C,H,D,U)):l(this.parseRequestText(K),K)}}),mxUtils.bind(this,function(K){window.clearTimeout(V);S&&l(this.parseRequestText(K))}))}catch(K){l(K)}}),B=mxUtils.bind(this,function(C){try{var H=!0,D=null;try{D=window.setTimeout(mxUtils.bind(this,-function(){H=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(S){}var U=new mxXmlRequest(E+"/createUploadSession","{}","POST");U.setRequestHeaders=mxUtils.bind(this,function(S,V){S.setRequestHeader("Content-Type","application/json");S.setRequestHeader("Authorization","Bearer "+b);null!=n&&S.setRequestHeader("If-Match",n)});U.send(mxUtils.bind(this,function(S){window.clearTimeout(D);H&&(200<=S.getStatus()&&299>=S.getStatus()?(S=JSON.parse(S.getText()),x(S.uploadUrl,0,0)):C||401!==S.getStatus()?-l(this.parseRequestText(S),S):this.authenticate(function(){B(!0)},l,C,this.sharepointMode))}),mxUtils.bind(this,function(S){window.clearTimeout(D);H&&l(this.parseRequestText(S))}))}catch(S){l(S)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){B(!0)},l,null,this.sharepointMode):B(!1)}else l({message:mxResources.get("unknownError")})}catch(C){l(C)}};OneDriveClient.prototype.writeFile=function(E,c,g,l,n,v,x){this.sharepointMode&&(b=f);try{if(null!=E&&null!=c){var B=mxUtils.bind(this,-function(C){try{var H=!0,D=null;try{D=window.setTimeout(mxUtils.bind(this,function(){H=!1;v({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(S){}var U=new mxXmlRequest(E,c,g);U.setRequestHeaders=mxUtils.bind(this,function(S,V){S.setRequestHeader("Content-Type",l||" ");S.setRequestHeader("Authorization","Bearer "+b);null!=x&&S.setRequestHeader("If-Match",x)});U.send(mxUtils.bind(this,function(S){window.clearTimeout(D);H&&(200<=S.getStatus()&&299>=S.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,-this.emptyFn,!0),n(JSON.parse(S.getText()))):C||401!==S.getStatus()?v(this.parseRequestText(S),S):this.authenticate(function(){B(!0)},v,C,this.sharepointMode))}),mxUtils.bind(this,function(S){window.clearTimeout(D);H&&v(this.parseRequestText(S))}))}catch(S){v(S)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){B(!0)},v,null,this.sharepointMode):B(!1)}else v({message:mxResources.get("unknownError")})}catch(C){v(C)}};OneDriveClient.prototype.parseRequestText=function(E){var c=-{message:mxResources.get("unknownError")};try{c=JSON.parse(E.getText()),c.status=E.getStatus(),c.error&&(c.error.status=c.status,c.error.code=c.status)}catch(g){}return c};OneDriveClient.prototype.pickLibrary=function(E){this.pickFile(function(c){E(c)})};OneDriveClient.prototype.createInlinePicker=function(E,c,g){return mxUtils.bind(this,function(){var l=null,n=document.createElement("div");n.style.position="relative";var v=new CustomDialog(this.ui,n,mxUtils.bind(this,function(){var x=l.getSelectedItem();-if(null!=x)if(c&&"object"==typeof x.folder)E({value:[x]});else{if(!x.folder&&this.ui.spinner.spin(document.body,mxResources.get("loading"))){var B=OneDriveFile.prototype.getIdOf(x);this.executeRequest(this.getItemURL(B),mxUtils.bind(this,function(C){this.ui.spinner.stop();200<=C.getStatus()&&299>=C.getStatus()?(C=JSON.parse(C.getText()),E(B,{value:[C]})):this.ui.handleError({code:C.getStatus()})}),mxUtils.bind(this,function(C){this.ui.spinner.stop();this.ui.handleError(C)}))}}else return mxResources.get("invalidSel",-null,"Invalid selection")}),null,mxResources.get(c?"select":"open"),null,null,null,null,!0);this.ui.showDialog(v.container,550,500,!0,!0);n.style.width=parseInt(v.container.parentNode.style.width)-60+"px";n.style.height=parseInt(v.container.parentNode.style.height)-120+"px";l=new mxODPicker(n,null,mxUtils.bind(this,function(x,B,C,H){this.executeRequest(H?x:this.baseUrl+x,function(D){B(JSON.parse(D.getText()))},C)}),mxUtils.bind(this,function(x,B,C,H){this.executeRequest(this.baseUrl+"/drives/"+B+-"/items/"+x,function(D){C(JSON.parse(D.getText()))},H)}),null,null,function(x){c?E({value:[x]}):E(OneDriveFile.prototype.getIdOf(x))},mxUtils.bind(this,function(x){this.ui.showError(mxResources.get("error"),x)}),c,null,null,null,null,g)})};var J=function(){null!=A&&(clearInterval(A),A=null);if(null!=u){try{window.removeEventListener("message",u)}catch(E){}u=null}if(null!=p){try{p.close&&p.close()}catch(E){}p=null}if(null!=q)try{q.closed||q.close()}catch(E){}q=null},I=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,-function(E){var c=16*Math.random()|0;return("x"===E?c:c&3|8).toString(16)})};OneDriveClient.prototype.createPickerConfig=function(E,c){return{sdk:this.PICKER_SDK_VERSION,entry:{sharePoint:{byPath:{web:c}}},authentication:{},messaging:{origin:location.origin,channelId:I()},typesAndSources:Object.assign({},{mode:E},"files"===E&&{filters:this.FILE_EXTENSIONS},{pivots:{oneDrive:!0,recent:!0,shared:!1,sharedLibraries:!0,myOrganization:!1,site:!0}}),selection:{mode:"single"},theme:Editor.isDarkMode()?"dark":-"default"}};OneDriveClient.prototype.setupPickerMessageListener=function(E,c){if(null!=u){try{window.removeEventListener("message",u)}catch(l){}u=null}var g=function(l){if(l.source&&l.source===q){var n=l.data;"initialize"===n.type&&n.channelId===E&&(p=l.ports[0],p.addEventListener("message",c),p.start(),p.postMessage({type:"activate"}))}};u=g;window.addEventListener("message",g)};var G=function(E,c){var g,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){p.postMessage({type:"acknowledge",-id:E.id});g=E.data;try{switch(g.command){case "authenticate":if(l=k)p.postMessage({type:"result",id:E.id,data:{result:"token",token:l}});else throw Error("Could not get auth token for command: "+JSON.stringify(g));break;case "close":J();break;case "pick":p.postMessage({type:"result",id:E.id,data:{result:"success"}});J();c(g);break;default:console.warn("Unsupported command: "+JSON.stringify(g)),p.postMessage({type:"result",id:E.id,data:{result:"error",error:{code:"unsupportedCommand",message:g.command},-isExpected:!0}})}}catch(v){console.error("Error handling picker command:",v),p.postMessage({type:"result",id:E.id,data:{result:"error",error:{code:"commandError",message:v.message},isExpected:!0}})}n.jumpToEnd()})};OneDriveClient.prototype.handleFolderPickerMessage=function(E){var c,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=E;g=c.data;switch(g.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(G(g,function(n){d({value:n.items})}),-4):l.jumpTo(0)})};OneDriveClient.prototype.handleFilePickerMessage=function(E){var c,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=E;g=c.data;switch(g.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(G(g,function(n){n=n.items[0];d((null!=n.parentReference&&null!=n.parentReference.driveId?n.parentReference.driveId+"/":"")+(n.id+(n.folder&&n.folder.isRoot?"/root":"")))}),4):l.jumpTo(0)})};OneDriveClient.prototype.pickFile=-function(E,c){this.sharepointMode?this.pickFileSP(E,c):this.pickFileOD(E,c)};OneDriveClient.prototype.pickFolder=function(E,c){var g=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){g.sharepointMode?g.pickFolderSP(E,c):g.pickFolderOD(E,c);l.jumpToEnd()})};OneDriveClient.prototype.pickFileSP=function(E,c){var g;E=null!=(g=E)?g:mxUtils.bind(this,function(l){this.ui.loadFile("M"+encodeURIComponent(l))});this.launchPicker(E,"files")};OneDriveClient.prototype.pickFolderSP=function(E,-c){var g=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){g.launchPicker(E,"folders");l.jumpToEnd()})};OneDriveClient.prototype.launchPicker=function(E,c){var g=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){try{d=E,J(),g.executeRequest(g.baseUrl+"/me/drive",mxUtils.bind(g,function(n){if(200<=n.getStatus()&&299>=n.getStatus()){n=JSON.parse(n.getText()).webUrl;if(null!=n){var v=n.lastIndexOf("/");0<v&&(n=n.substring(0,v))}v=this.createPickerConfig(c,n);var x=-new URLSearchParams({filePicker:JSON.stringify(v)});q=window.open("","SharePointPicker","width=1080,height=680,left="+(screen.width-1080)/2+",top="+(screen.height-680)/2+",menubar=no,toolbar=no,location=no,status=no");null==q?(this.ui.showError(mxResources.get("error"),"Popup blocked. Please allow popups for this site."),J()):(n=n+"/_layouts/15/FilePicker.aspx?"+x,this.setupPickerMessageListener(v.messaging.channelId,"files"===c?this.handleFilePickerMessage:this.handleFolderPickerMessage),q.location.href=-n,A=setInterval(function(){(null==q||q.closed)&&J()},500))}else this.ui.handleError({code:n.getStatus()})}),mxUtils.bind(g,function(n){this.ui.handleError(n)}))}catch(n){J(),g.ui.showError(mxResources.get("error"),n&&n.message?n.message:n)}l.jumpToEnd()})};OneDriveClient.prototype.pickFolderOD=function(E,c){var g=mxUtils.bind(this,function(n){this.ui.showError(mxResources.get("error"),n&&n.message?n.message:n)}),l=mxUtils.bind(this,function(n){var v=this.inlinePicker?this.createInlinePicker(E,!0):-mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(x){E(x);mxClient.IS_IE11&&(b=x.accessToken)}),cancel:mxUtils.bind(this,function(){}),error:g})});n?v():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){E({value:[this.rootId]})}),-v,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){l(this.inlinePicker&&c)}),g):l(c)};OneDriveClient.prototype.pickFileOD=function(E,c){E=null!=E?E:mxUtils.bind(this,function(n){this.ui.loadFile("W"+encodeURIComponent(n))});var g=mxUtils.bind(this,function(n){this.ui.showError(mxResources.get("authFailed"),n&&n.message?n.message:-n)}),l=this.inlinePicker?this.createInlinePicker(E,null,c):mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference,webUrl",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(n){null!=n&&null!=n.value&&0<n.value.length&&(mxClient.IS_IE11&&(b=n.accessToken),E(OneDriveFile.prototype.getIdOf(n.value[0]),-n))}),cancel:mxUtils.bind(this,function(){}),error:g});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.inlinePicker?l():this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,function(){this.ui.hideDialog();l()}))).container,300,140,!0,!0)}),g):l()};OneDriveClient.prototype.logout=function(){if(isLocalStorage){var E=localStorage.getItem("odpickerv7cache");-null!=E&&'{"odsdkLoginHint":{'==E.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}window.open(this.authUrl+"/oauth2/v2.0/logout","logout","width=525,height=525,status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes");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.sharepointMode&&(f=k=null)}})();GitHubFile=function(b,f,k){DrawioFile.call(this,b,f);this.meta=k;this.peer=this.ui.gitHub};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.share=function(){this.ui.editor.graph.openLink("https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/settings/access")};+(window.DRAWIO_MSGRAPH_TENANT_ID||"common");OneDriveClient.prototype.PICKER_SDK_VERSION="8.0";OneDriveClient.prototype.FILE_EXTENSIONS=".drawio .xml .svg .png .pdf .vsdx".split(" ");OneDriveClient.prototype.sharepointMode=!1;OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];OneDriveClient.prototype.isValidFilename=function(D){if(null==+D||""===D)return!1;for(var c=0;c<this.invalidFilenameRegExs.length;c++)if(this.invalidFilenameRegExs[c].test(D))return!1;return!0};OneDriveClient.prototype.get=function(D,c,g){D=new mxXmlRequest(D,null,"GET");D.setRequestHeaders=mxUtils.bind(this,function(l,n){l.setRequestHeader("Authorization","Bearer "+b)});D.send(c,g);return D};OneDriveClient.prototype.updateUser=function(D,c,g){var l=!0,n=window.setTimeout(mxUtils.bind(this,function(){l=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl++"/me",mxUtils.bind(this,function(v){window.clearTimeout(n);if(l)if(200>v.getStatus()||300<=v.getStatus())g?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(D,c,!0)}),c,null,this.sharepointMode));else try{var x=JSON.parse(v.getText());this.setUser(new DrawioUser(x.id,x.mail,x.displayName));D()}catch(B){c(B)}}),mxUtils.bind(this,function(v){window.clearTimeout(n);l&&c(v)}))};OneDriveClient.prototype.resetTokenRefresh=function(D){null!=+this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<D&&(this.tokenRefreshInterval=1E3*D,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0,this.sharepointMode)}),900*D))};OneDriveClient.prototype.authenticate=function(D,c,g,l,n){this.isExtAuth?(window.oneDriveAuth?window.oneDriveAuth:window.parent.oneDriveAuth)(mxUtils.bind(this,function(v){this.updateAuthInfo(v,!0,null==this.endpointHint,+D,c)}),c,null!=window.urlParams&&"1"==urlParams.odAuthCancellable):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(v){200<=v.getStatus()&&299>=v.getStatus()?this.authenticateStep2(v.getText(),D,c,g,l,n):null!=c&&c({message:mxResources.get("error")+" "+v.getStatus()})}),c)};OneDriveClient.prototype.updateAuthInfo=function(D,c,g,l,n,v){g&&this.setUser(null);v?k=D.access_token:(b=D.access_token,this.sharepointMode&&(f=D.access_token));delete D.access_token;+D.expiresOn=Date.now()+1E3*D.expires_in;this.tokenExpiresOn=D.expiresOn;D.remember=c;this.setPersistentToken(JSON.stringify(D),!c);this.resetTokenRefresh(D.expires_in);g?this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){l()}),n):l()};OneDriveClient.prototype.authenticateStep2=function(D,c,g,l,n,v){if(null==window.onOneDriveCallback){var x=mxUtils.bind(this,function(){var B=!0,C=JSON.parse(this.getPersistentToken(!0));null!=C?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="++this.clientId+"&domain="+window.location.host+"&token="+D)+"&scopes="+encodeURIComponent(n?this.scopesSP:this.scopes),null,"GET")).send(mxUtils.bind(this,function(G){if(200<=G.getStatus()&&299>=G.getStatus())try{this.updateAuthInfo(JSON.parse(G.getText()),C.remember,v,mxUtils.bind(this,function(){n?this.authenticate(c,g,l,!1):c()}),g,n)}catch(N){g({message:mxResources.get("authFailed"),retry:x})}else this.clearPersistentToken(),this.setUser(null),b=null,this.sharepointMode&&(f=null),401!=G.getStatus()&&+400!=G.getStatus()||l?g({message:mxResources.get("accessDenied"),retry:x}):x()}),g):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(G,N){var J=this.authUrl+"/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&prompt=select_account&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent((n?this.scopesSP:this.scopes)+(G?" offline_access":""))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+D);J=window.open(J,+"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=J&&(window.onOneDriveCallback=mxUtils.bind(this,function(T,V){if(B){window.onOneDriveCallback=null;B=!1;try{null==T?g({message:mxResources.get("accessDenied"),retry:x}):(null!=N&&N(),this.updateAuthInfo(T,G,!n,mxUtils.bind(this,function(){n?this.authenticate(c,g,l,!1,+!0):c()}),g,n))}catch(t){g(t)}finally{null!=V&&V.close()}}else null!=V&&V.close()}),J.focus())}),mxUtils.bind(this,function(){B&&(window.onOneDriveCallback=null,B=!1,g({message:mxResources.get("accessDenied"),retry:x}))}))});x()}else g({code:App.ERROR_BUSY})};OneDriveClient.prototype.getAccountTypeAndEndpoint=function(D,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(g){try{if(200<=g.getStatus()&&299>=g.getStatus()){var l=JSON.parse(g.getText());0<l.webUrl.indexOf(".sharepoint.com")?+this.endpointHint=l.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var n=JSON.parse(this.getPersistentToken(!0));null!=n&&(n.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(n),!n.remember));D();return}}catch(v){}c({message:mxResources.get("unknownError")+" (Code: "+g.getStatus()+")"})}),c)};OneDriveClient.prototype.executeRequest=function(D,c,g){this.sharepointMode&&(b=f);var l=mxUtils.bind(this,function(n){var v=!0,x=window.setTimeout(mxUtils.bind(this,+function(){v=!1;g({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout);this.get(D,mxUtils.bind(this,function(B){window.clearTimeout(x);v&&(200<=B.getStatus()&&299>=B.getStatus()||404==B.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(B)):n||401!==B.getStatus()&&400!==B.getStatus()?g(this.parseRequestText(B)):this.authenticate(function(){l(!0)},g,n,this.sharepointMode))}),mxUtils.bind(this,function(B){window.clearTimeout(x);v&&g(B)}))});null==b||6E4>this.tokenExpiresOn-+Date.now()?this.authenticate(function(){l(!0)},g,null,this.sharepointMode):l(!1)};OneDriveClient.prototype.checkToken=function(D,c){this.sharepointMode&&(b=f);null==b||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(D,null!=c?c:this.emptyFn,null,this.sharepointMode):D()};OneDriveClient.prototype.getItemRef=function(D){var c=D.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:D}};OneDriveClient.prototype.getItemURL=function(D,c){var g=D.split("/");return 1<+g.length?(D=g[1],(c?"":this.baseUrl)+"/drives/"+g[0]+("root"==D?"/root":"/items/"+D)):(c?"":this.baseUrl)+"/me/drive/items/"+D};OneDriveClient.prototype.getLibrary=function(D,c,g){this.getFile(D,c,g,!1,!0)};OneDriveClient.prototype.removeExtraHtmlContent=function(D){var c=D.lastIndexOf('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" ');0<c&&(D=D.substring(0,c));return D};OneDriveClient.prototype.getFile=function(D,c,g,l,n){n=null!=n?n:!1;this.executeRequest(this.getItemURL(D),+mxUtils.bind(this,function(v){if(200<=v.getStatus()&&299>=v.getStatus()){var x=JSON.parse(v.getText()),B=/\.png$/i.test(x.name);if(/\.v(dx|sdx?)$/i.test(x.name)||/\.gliffy$/i.test(x.name)||/\.pdf$/i.test(x.name)||!Editor.useCanvasForExport&&B)this.ui.convertFile(x["@microsoft.graph.downloadUrl"],x.name,null!=x.file?x.file.mimeType:null,this.extension,c,g);else{var C=!0,G=window.setTimeout(mxUtils.bind(this,function(){C=!1;g({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(x["@microsoft.graph.downloadUrl"],+mxUtils.bind(this,function(N){try{if(window.clearTimeout(G),C){/\.html$/i.test(x.name)&&(N=this.removeExtraHtmlContent(N));var J=null;if(0<(B?N.lastIndexOf(","):-1)){var T=this.ui.extractGraphModelFromPng(N);null!=T&&0<T.length?N=T:J=new LocalFile(this.ui,N,x.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==N.substring(0,32)){var V=N.substring(22);N=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V)}Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(N,x["@microsoft.graph.downloadUrl"])?+this.ui.parseFileData(N,mxUtils.bind(this,function(t){try{4==t.readyState&&(200<=t.status&&299>=t.status?c(new LocalFile(this.ui,t.responseText,x.name+this.extension,!0)):null!=g&&g({message:mxResources.get("errorLoadingFile")}))}catch(z){if(null!=g)g(z);else throw z;}}),x.name):null!=J?c(J):n?c(new OneDriveLibrary(this.ui,N,x,this.sharepointMode)):c(new OneDriveFile(this.ui,N,x,this.sharepointMode))}}catch(t){if(null!=g)g(t);else throw t;}}),mxUtils.bind(this,function(N){window.clearTimeout(G);C&&+g(this.parseRequestText(N))}),B||null!=x.file&&null!=x.file.mimeType&&("image/"==x.file.mimeType.substring(0,6)&&"image/svg"!=x.file.mimeType.substring(0,9)||"application/pdf"==x.file.mimeType))}}else this.isExtAuth?g({message:mxResources.get("fileNotFoundOrDenied"),ownerEmail:null!=window.urlParams?urlParams.ownerEml:null}):g(this.parseRequestText(v))}),function(v){null!=g&&(null!=v&&null!=v.error&&"ObjectHandle is Invalid"===v.error.message&&(v.error.message=mxResources.get("fileNotFoundOrDenied")),+g(v))})};OneDriveClient.prototype.renameFile=function(D,c,g,l){null!=D&&null!=c&&(this.isValidFilename(c)?this.checkExists(D.getParentId(),c,!1,mxUtils.bind(this,function(n){n?this.writeFile(this.getItemURL(D.getId()),JSON.stringify({name:c}),"PATCH","application/json",g,l):l()})):l({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};OneDriveClient.prototype.moveFile=function(D,c,g,l){c=this.getItemRef(c);var n=+this.getItemRef(D);c.driveId!=n.driveId?l({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(D),JSON.stringify({parentReference:c}),"PATCH","application/json",g,l)};OneDriveClient.prototype.insertLibrary=function(D,c,g,l,n){this.insertFile(D,c,g,l,!0,n)};OneDriveClient.prototype.insertFile=function(D,c,g,l,n,v){this.isValidFilename(D)?(n=null!=n?n:!1,this.checkExists(v,D,!0,mxUtils.bind(this,function(x){if(x){x=+"/me/drive/root";null!=v&&(x=this.getItemURL(v,!0));var B=mxUtils.bind(this,function(C){n?g(new OneDriveLibrary(this.ui,c,C,this.sharepointMode)):g(new OneDriveFile(this.ui,c,C,this.sharepointMode))});x=this.baseUrl+x+"/children/"+encodeURIComponent(D)+"/content";4E6<=c.length?this.writeFile(x,"","PUT",null,mxUtils.bind(this,function(C){this.writeLargeFile(this.getItemURL(C.id),c,B,l)}),l):this.writeFile(x,c,"PUT",null,B,l)}else l()}))):l({message:this.invalidFilenameRegExs[0].test(D)?mxResources.get("oneDriveCharsNotAllowed"):+mxResources.get("oneDriveInvalidDeviceName")})};OneDriveClient.prototype.checkExists=function(D,c,g,l){var n="/me/drive/root";null!=D&&(n=this.getItemURL(D,!0));this.executeRequest(this.baseUrl+n+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(v){404==v.getStatus()?l(!0):g?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){l(!0)},function(){l(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),+function(){l(!1)}))}),function(v){l(!1)},!0)};OneDriveClient.prototype.saveFile=function(D,c,g,l){try{var n=D.getData(),v=mxUtils.bind(this,function(B){var C=mxUtils.bind(this,function(N){c(N,n)}),G=this.getItemURL(D.getId());4E6<=B.length?this.writeLargeFile(G,B,C,g,l):this.writeFile(G+"/content/",B,"PUT",null,C,g,l)});if(Editor.useCanvasForExport&&/(\.png)$/i.test(D.meta.name)){var x=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(B){v(this.ui.base64ToBlob(B,+"image/png"))}),g,this.ui.getCurrentFile()!=D?n:null,x.scale,x.border)}else v(n)}catch(B){g(B)}};OneDriveClient.prototype.writeLargeFile=function(D,c,g,l,n){this.sharepointMode&&(b=f);try{if(null!=c){var v=(new TextEncoder).encode(c).length,x=mxUtils.bind(this,function(C,G,N,J){try{J=J||0;var T=!0,V=null;V=window.setTimeout(mxUtils.bind(this,function(){T=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout);var t=c.substr(G,4194304),z=(new TextEncoder).encode(t).length,L=new mxXmlRequest(C,t,"PUT");L.setRequestHeaders=+mxUtils.bind(this,function(K,M){K.setRequestHeader("Content-Range","bytes "+N+"-"+(N+z-1)+"/"+v)});L.send(mxUtils.bind(this,function(K){window.clearTimeout(V);if(T){var M=K.getStatus();200<=M&&299>=M?(M=G+t.length,M==c.length?g(JSON.parse(K.getText())):x(C,M,N+z,J)):500<=M&&599>=M&&2>J?(J++,x(C,G,N,J)):l(this.parseRequestText(K),K)}}),mxUtils.bind(this,function(K){window.clearTimeout(V);T&&l(this.parseRequestText(K))}))}catch(K){l(K)}}),B=mxUtils.bind(this,function(C){try{var G=!0,N=null;try{N=window.setTimeout(mxUtils.bind(this,+function(){G=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(T){}var J=new mxXmlRequest(D+"/createUploadSession","{}","POST");J.setRequestHeaders=mxUtils.bind(this,function(T,V){T.setRequestHeader("Content-Type","application/json");T.setRequestHeader("Authorization","Bearer "+b);null!=n&&T.setRequestHeader("If-Match",n)});J.send(mxUtils.bind(this,function(T){window.clearTimeout(N);G&&(200<=T.getStatus()&&299>=T.getStatus()?(T=JSON.parse(T.getText()),x(T.uploadUrl,0,0)):C||401!==T.getStatus()?+l(this.parseRequestText(T),T):this.authenticate(function(){B(!0)},l,C,this.sharepointMode))}),mxUtils.bind(this,function(T){window.clearTimeout(N);G&&l(this.parseRequestText(T))}))}catch(T){l(T)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){B(!0)},l,null,this.sharepointMode):B(!1)}else l({message:mxResources.get("unknownError")})}catch(C){l(C)}};OneDriveClient.prototype.writeFile=function(D,c,g,l,n,v,x){this.sharepointMode&&(b=f);try{if(null!=D&&null!=c){var B=mxUtils.bind(this,+function(C){try{var G=!0,N=null;try{N=window.setTimeout(mxUtils.bind(this,function(){G=!1;v({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(T){}var J=new mxXmlRequest(D,c,g);J.setRequestHeaders=mxUtils.bind(this,function(T,V){T.setRequestHeader("Content-Type",l||" ");T.setRequestHeader("Authorization","Bearer "+b);null!=x&&T.setRequestHeader("If-Match",x)});J.send(mxUtils.bind(this,function(T){window.clearTimeout(N);G&&(200<=T.getStatus()&&299>=T.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,+this.emptyFn,!0),n(JSON.parse(T.getText()))):C||401!==T.getStatus()?v(this.parseRequestText(T),T):this.authenticate(function(){B(!0)},v,C,this.sharepointMode))}),mxUtils.bind(this,function(T){window.clearTimeout(N);G&&v(this.parseRequestText(T))}))}catch(T){v(T)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){B(!0)},v,null,this.sharepointMode):B(!1)}else v({message:mxResources.get("unknownError")})}catch(C){v(C)}};OneDriveClient.prototype.parseRequestText=function(D){var c=+{message:mxResources.get("unknownError")};try{c=JSON.parse(D.getText()),c.status=D.getStatus(),c.error&&(c.error.status=c.status,c.error.code=c.status)}catch(g){}return c};OneDriveClient.prototype.pickLibrary=function(D){this.pickFile(function(c){D(c)})};OneDriveClient.prototype.createInlinePicker=function(D,c,g){return mxUtils.bind(this,function(){var l=null,n=document.createElement("div");n.style.position="relative";var v=new CustomDialog(this.ui,n,mxUtils.bind(this,function(){var x=l.getSelectedItem();+if(null!=x)if(c&&"object"==typeof x.folder)D({value:[x]});else{if(!x.folder&&this.ui.spinner.spin(document.body,mxResources.get("loading"))){var B=OneDriveFile.prototype.getIdOf(x);this.executeRequest(this.getItemURL(B),mxUtils.bind(this,function(C){this.ui.spinner.stop();200<=C.getStatus()&&299>=C.getStatus()?(C=JSON.parse(C.getText()),D(B,{value:[C]})):this.ui.handleError({code:C.getStatus()})}),mxUtils.bind(this,function(C){this.ui.spinner.stop();this.ui.handleError(C)}))}}else return mxResources.get("invalidSel",+null,"Invalid selection")}),null,mxResources.get(c?"select":"open"),null,null,null,null,!0);this.ui.showDialog(v.container,550,500,!0,!0);n.style.width=parseInt(v.container.parentNode.style.width)-60+"px";n.style.height=parseInt(v.container.parentNode.style.height)-120+"px";l=new mxODPicker(n,null,mxUtils.bind(this,function(x,B,C,G){this.executeRequest(G?x:this.baseUrl+x,function(N){B(JSON.parse(N.getText()))},C)}),mxUtils.bind(this,function(x,B,C,G){this.executeRequest(this.baseUrl+"/drives/"+B++"/items/"+x,function(N){C(JSON.parse(N.getText()))},G)}),null,null,function(x){c?D({value:[x]}):D(OneDriveFile.prototype.getIdOf(x))},mxUtils.bind(this,function(x){this.ui.showError(mxResources.get("error"),x)}),c,null,null,null,null,g)})};var I=function(){null!=A&&(clearInterval(A),A=null);if(null!=u){try{window.removeEventListener("message",u)}catch(D){}u=null}if(null!=p){try{p.close&&p.close()}catch(D){}p=null}if(null!=q)try{q.closed||q.close()}catch(D){}q=null},H=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,+function(D){var c=16*Math.random()|0;return("x"===D?c:c&3|8).toString(16)})};OneDriveClient.prototype.createPickerConfig=function(D,c){return{sdk:this.PICKER_SDK_VERSION,entry:{sharePoint:{byPath:{web:c}}},authentication:{},messaging:{origin:location.origin,channelId:H()},typesAndSources:Object.assign({},{mode:D},"files"===D&&{filters:this.FILE_EXTENSIONS},{pivots:{oneDrive:!0,recent:!0,shared:!1,sharedLibraries:!0,myOrganization:!1,site:!0}}),selection:{mode:"single"},theme:Editor.isDarkMode()?"dark":+"default"}};OneDriveClient.prototype.setupPickerMessageListener=function(D,c){if(null!=u){try{window.removeEventListener("message",u)}catch(l){}u=null}var g=function(l){if(l.source&&l.source===q){var n=l.data;"initialize"===n.type&&n.channelId===D&&(p=l.ports[0],p.addEventListener("message",c),p.start(),p.postMessage({type:"activate"}))}};u=g;window.addEventListener("message",g)};var F=function(D,c){var g,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){p.postMessage({type:"acknowledge",+id:D.id});g=D.data;try{switch(g.command){case "authenticate":if(l=k)p.postMessage({type:"result",id:D.id,data:{result:"token",token:l}});else throw Error("Could not get auth token for command: "+JSON.stringify(g));break;case "close":I();break;case "pick":p.postMessage({type:"result",id:D.id,data:{result:"success"}});I();c(g);break;default:console.warn("Unsupported command: "+JSON.stringify(g)),p.postMessage({type:"result",id:D.id,data:{result:"error",error:{code:"unsupportedCommand",message:g.command},+isExpected:!0}})}}catch(v){console.error("Error handling picker command:",v),p.postMessage({type:"result",id:D.id,data:{result:"error",error:{code:"commandError",message:v.message},isExpected:!0}})}n.jumpToEnd()})};OneDriveClient.prototype.handleFolderPickerMessage=function(D){var c,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=D;g=c.data;switch(g.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(F(g,function(n){d({value:n.items})}),+4):l.jumpTo(0)})};OneDriveClient.prototype.handleFilePickerMessage=function(D){var c,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=D;g=c.data;switch(g.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(F(g,function(n){n=n.items[0];d((null!=n.parentReference&&null!=n.parentReference.driveId?n.parentReference.driveId+"/":"")+(n.id+(n.folder&&n.folder.isRoot?"/root":"")))}),4):l.jumpTo(0)})};OneDriveClient.prototype.pickFile=+function(D,c){this.sharepointMode?this.pickFileSP(D,c):this.pickFileOD(D,c)};OneDriveClient.prototype.pickFolder=function(D,c){var g=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){g.sharepointMode?g.pickFolderSP(D,c):g.pickFolderOD(D,c);l.jumpToEnd()})};OneDriveClient.prototype.pickFileSP=function(D,c){var g;D=null!=(g=D)?g:mxUtils.bind(this,function(l){this.ui.loadFile("M"+encodeURIComponent(l))});this.launchPicker(D,"files")};OneDriveClient.prototype.pickFolderSP=function(D,+c){var g=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){g.launchPicker(D,"folders");l.jumpToEnd()})};OneDriveClient.prototype.launchPicker=function(D,c){var g=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){try{d=D,I(),g.executeRequest(g.baseUrl+"/me/drive",mxUtils.bind(g,function(n){if(200<=n.getStatus()&&299>=n.getStatus()){n=JSON.parse(n.getText()).webUrl;if(null!=n){var v=n.lastIndexOf("/");0<v&&(n=n.substring(0,v))}v=this.createPickerConfig(c,n);var x=+new URLSearchParams({filePicker:JSON.stringify(v)});q=window.open("","SharePointPicker","width=1080,height=680,left="+(screen.width-1080)/2+",top="+(screen.height-680)/2+",menubar=no,toolbar=no,location=no,status=no");null==q?(this.ui.showError(mxResources.get("error"),"Popup blocked. Please allow popups for this site."),I()):(n=n+"/_layouts/15/FilePicker.aspx?"+x,this.setupPickerMessageListener(v.messaging.channelId,"files"===c?this.handleFilePickerMessage:this.handleFolderPickerMessage),q.location.href=+n,A=setInterval(function(){(null==q||q.closed)&&I()},500))}else this.ui.handleError({code:n.getStatus()})}),mxUtils.bind(g,function(n){this.ui.handleError(n)}))}catch(n){I(),g.ui.showError(mxResources.get("error"),n&&n.message?n.message:n)}l.jumpToEnd()})};OneDriveClient.prototype.pickFolderOD=function(D,c){var g=mxUtils.bind(this,function(n){this.ui.showError(mxResources.get("error"),n&&n.message?n.message:n)}),l=mxUtils.bind(this,function(n){var v=this.inlinePicker?this.createInlinePicker(D,!0):+mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(x){D(x);mxClient.IS_IE11&&(b=x.accessToken)}),cancel:mxUtils.bind(this,function(){}),error:g})});n?v():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){D({value:[this.rootId]})}),+v,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){l(this.inlinePicker&&c)}),g):l(c)};OneDriveClient.prototype.pickFileOD=function(D,c){D=null!=D?D:mxUtils.bind(this,function(n){this.ui.loadFile("W"+encodeURIComponent(n))});var g=mxUtils.bind(this,function(n){this.ui.showError(mxResources.get("authFailed"),n&&n.message?n.message:+n)}),l=this.inlinePicker?this.createInlinePicker(D,null,c):mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference,webUrl",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(n){null!=n&&null!=n.value&&0<n.value.length&&(mxClient.IS_IE11&&(b=n.accessToken),D(OneDriveFile.prototype.getIdOf(n.value[0]),+n))}),cancel:mxUtils.bind(this,function(){}),error:g});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.inlinePicker?l():this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,function(){this.ui.hideDialog();l()}))).container,300,140,!0,!0)}),g):l()};OneDriveClient.prototype.logout=function(){if(isLocalStorage){var D=localStorage.getItem("odpickerv7cache");+null!=D&&'{"odsdkLoginHint":{'==D.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}window.open(this.authUrl+"/oauth2/v2.0/logout","logout","width=525,height=525,status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes");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.sharepointMode&&(f=k=null)}})();GitHubFile=function(b,f,k){DrawioFile.call(this,b,f);this.meta=k;this.peer=this.ui.gitHub};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.share=function(){this.ui.editor.graph.openLink("https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/settings/access")};GitHubFile.prototype.getId=function(){return encodeURIComponent(this.meta.org)+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitHubFile.prototype.getHash=function(){return encodeURIComponent("H"+this.getId())};GitHubFile.prototype.getFileUrl=function(){return"https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/blob/"+this.meta.ref+"/"+this.meta.path};GitHubFile.prototype.getFolderUrl=function(){return"https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/tree/"+this.meta.ref+"/"+this.meta.path.split("/").slice(0,-1).join("/")};GitHubFile.prototype.getPublicUrl=function(b){if(null!=this.meta.download_url)try{""!=(new URL(this.meta.download_url)).search?b(null):mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(f){b(200<=f.getStatus()&&299>=f.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){b(null)}))}catch(f){b(null)}else b(null)};GitHubFile.prototype.isConflict=function(b){return null!=b&&409==b.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name};GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(b,f){this.peer.getFile(this.getId(),b,f)};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(b){this.meta=b};GitHubFile.prototype.getDescriptorEtag=function(b){return b.sha};GitHubFile.prototype.setDescriptorEtag=function(b,f){b.sha=f};GitHubFile.prototype.save=function(b,f,k,d,p,q){this.doSave(this.getTitle(),f,k,d,p,q)};GitHubFile.prototype.saveAs=function(b,f,k){this.doSave(b,f,k)};GitHubFile.prototype.doSave=function(b,f,k,d,p,q){var u=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=u;this.saveFile(b,!1,f,k,d,p,q)}),k,d,p])};-GitHubFile.prototype.saveFile=function(b,f,k,d,p,q,u){if(this.isEditable())if(this.savingFile)null!=d&&d({code:App.ERROR_BUSY});else{var A=mxUtils.bind(this,function(J){if(this.getTitle()==b)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var I=this.getCurrentEtag(),G=this.data;this.peer.saveFile(this,mxUtils.bind(this,function(E){this.setModified(this.getShadowModified());this.savingFile=!1;this.setDescriptorEtag(this.meta,E);this.fileSaved(G,I,mxUtils.bind(this,function(){this.contentChanged();-null!=k&&k()}),d)}),mxUtils.bind(this,function(E){this.savingFile=!1;this.isConflict(E)?(this.inConflictState=!0,null!=d&&(E.commitMessage=J,d(E))):null!=d&&d(E)}),q,J)}catch(E){if(this.savingFile=!1,null!=d)d(E);else throw E;}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(E){this.peer.insertFile(b,this.getData(),mxUtils.bind(this,function(c){this.setModified(this.getShadowModified());this.savingFile=!1;-null!=k&&k();this.ui.fileLoaded(c)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,E,J)}))});null!=u?A(u):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(J){A(J)}),d)}else null!=k&&k()};GitHubLibrary=function(b,f,k){GitHubFile.call(this,b,f,k)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(b,f,k){this.saveFile(b,!1,f,k)};GitHubLibrary.prototype.open=function(){};(function(){var b=null;window.GitHubClient=function(f,k){DrawioClient.call(this,f,k||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"Iv1.1218f5567fbc258a":window.DRAWIO_GITHUB_ID;GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl=DRAWIO_GITHUB_API_URL;GitHubClient.prototype.baseHostUrl=DRAWIO_GITHUB_URL;GitHubClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"github2";GitHubClient.prototype.maxFileSize=-5E7;GitHubClient.prototype.authToken="token";GitHubClient.prototype.setToken=function(f){b=f};GitHubClient.prototype.updateUser=function(f,k,d){var p=!0,q=window.setTimeout(mxUtils.bind(this,function(){p=!1;k({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),u=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),A=this.authToken+" "+b;u.setRequestHeaders=function(J,I){J.setRequestHeader("Authorization",A)};u.send(mxUtils.bind(this,function(){window.clearTimeout(q);p&&(401===+GitHubFile.prototype.saveFile=function(b,f,k,d,p,q,u){if(this.isEditable())if(this.savingFile)null!=d&&d({code:App.ERROR_BUSY});else{var A=mxUtils.bind(this,function(I){if(this.getTitle()==b)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var H=this.getCurrentEtag(),F=this.data;this.peer.saveFile(this,mxUtils.bind(this,function(D){this.setModified(this.getShadowModified());this.savingFile=!1;this.setDescriptorEtag(this.meta,D);this.fileSaved(F,H,mxUtils.bind(this,function(){this.contentChanged();+null!=k&&k()}),d)}),mxUtils.bind(this,function(D){this.savingFile=!1;this.isConflict(D)?(this.inConflictState=!0,null!=d&&(D.commitMessage=I,d(D))):null!=d&&d(D)}),q,I)}catch(D){if(this.savingFile=!1,null!=d)d(D);else throw D;}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(D){this.peer.insertFile(b,this.getData(),mxUtils.bind(this,function(c){this.setModified(this.getShadowModified());this.savingFile=!1;+null!=k&&k();this.ui.fileLoaded(c)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,D,I)}))});null!=u?A(u):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(I){A(I)}),d)}else null!=k&&k()};GitHubLibrary=function(b,f,k){GitHubFile.call(this,b,f,k)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(b,f,k){this.saveFile(b,!1,f,k)};GitHubLibrary.prototype.open=function(){};(function(){var b=null;window.GitHubClient=function(f,k){DrawioClient.call(this,f,k||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"Iv1.1218f5567fbc258a":window.DRAWIO_GITHUB_ID;GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl=DRAWIO_GITHUB_API_URL;GitHubClient.prototype.baseHostUrl=DRAWIO_GITHUB_URL;GitHubClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"github2";GitHubClient.prototype.maxFileSize=+5E7;GitHubClient.prototype.authToken="token";GitHubClient.prototype.setToken=function(f){b=f};GitHubClient.prototype.updateUser=function(f,k,d){var p=!0,q=window.setTimeout(mxUtils.bind(this,function(){p=!1;k({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),u=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),A=this.authToken+" "+b;u.setRequestHeaders=function(I,H){I.setRequestHeader("Authorization",A)};u.send(mxUtils.bind(this,function(){window.clearTimeout(q);p&&(401===u.getStatus()?d?k({code:u.getStatus(),message:this.getErrorMessage(u,mxResources.get("accessDenied"))}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(f,k,!0)}),k)):200>u.getStatus()||300<=u.getStatus()?k({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(u.getText()))),f()))}),k)};GitHubClient.prototype.createUser=function(f){return new DrawioUser(f.id,f.email,f.name)};GitHubClient.prototype.authenticate=function(f,k){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()?this.authenticateStep2(d.getText(),f,k):null!=k&&k(d)}),k)};GitHubClient.prototype.authenticateStep2=function(f,k,d){if(null==window.onGitHubCallback){var p=mxUtils.bind(this,function(){var q=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f),null,"GET")).send(mxUtils.bind(this,function(u){if(200<=u.getStatus()&&299>=u.getStatus())try{b=JSON.parse(u.getText()).access_token,this.setUser(null),k()}catch(A){d({message:mxResources.get("authFailed"),retry:p})}else this.clearPersistentToken(),this.setUser(null),b=null,401==u.getStatus()?p():d({message:mxResources.get("accessDenied"),retry:p})}),d):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(u,A){null!=window.open(this.baseHostUrl+"/login/oauth/authorize?client_id="+this.clientId+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+-window.location.host+"&token="+f),"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(J,I){q?(window.onGitHubCallback=null,q=!1,null==J?d({message:mxResources.get("accessDenied"),retry:p}):(null!=A&&A(),b=J.access_token,this.setUser(null),u&&this.setPersistentToken("remembered"),k(),null!=I&&I.close())):null!=I&&I.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:p})}),mxUtils.bind(this,function(){q&&(window.onGitHubCallback=null,q=!1,d({message:mxResources.get("accessDenied"),+window.location.host+"&token="+f),"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(I,H){q?(window.onGitHubCallback=null,q=!1,null==I?d({message:mxResources.get("accessDenied"),retry:p}):(null!=A&&A(),b=I.access_token,this.setUser(null),u&&this.setPersistentToken("remembered"),k(),null!=H&&H.close())):null!=H&&H.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:p})}),mxUtils.bind(this,function(){q&&(window.onGitHubCallback=null,q=!1,d({message:mxResources.get("accessDenied"),retry:p}))}))});p()}else d({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(f,k){try{var d=JSON.parse(f.getText());null!=d&&null!=d.message&&(k=d.message)}catch(p){}return k};GitHubClient.prototype.showAuthorizeDialog=function(f,k){this.ui.showError(mxResources.get("accessDenied"),mxResources.get("authorizationRequired"),mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/blog/single-repository-diagrams")}),f,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")}),mxResources.get("cancel"),k,480,null,!1)};GitHubClient.prototype.executeRequest=function(f,k,d,p,q){var u=mxUtils.bind(this,function(J){var I=!0,G=window.setTimeout(mxUtils.bind(this,function(){I=!1;d({code:App.ERROR_TIMEOUT,retry:A})}),this.ui.timeout),E=this.authToken+" "+b;f.setRequestHeaders=function(c,g){c.setRequestHeader("Authorization",-E)};f.send(mxUtils.bind(this,function(){window.clearTimeout(G);var c=mxUtils.bind(this,function(){var n=this.ui.spinner.pause();this.showAuthorizeDialog(mxUtils.bind(this,function(){n();A()}),mxUtils.bind(this,function(){this.ui.hideDialog();d({name:"AbortError"})}))});if(I)if(200<=f.getStatus()&&299>=f.getStatus()||p&&404==f.getStatus())k(f);else if(401===f.getStatus())J?d({code:f.getStatus(),message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){A(!0)},+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")}),mxResources.get("cancel"),k,480,null,!1)};GitHubClient.prototype.executeRequest=function(f,k,d,p,q){var u=mxUtils.bind(this,function(I){var H=!0,F=window.setTimeout(mxUtils.bind(this,function(){H=!1;d({code:App.ERROR_TIMEOUT,retry:A})}),this.ui.timeout),D=this.authToken+" "+b;f.setRequestHeaders=function(c,g){c.setRequestHeader("Authorization",+D)};f.send(mxUtils.bind(this,function(){window.clearTimeout(F);var c=mxUtils.bind(this,function(){var n=this.ui.spinner.pause();this.showAuthorizeDialog(mxUtils.bind(this,function(){n();A()}),mxUtils.bind(this,function(){this.ui.hideDialog();d({name:"AbortError"})}))});if(H)if(200<=f.getStatus()&&299>=f.getStatus()||p&&404==f.getStatus())k(f);else if(401===f.getStatus())I?d({code:f.getStatus(),message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){A(!0)},d)})}):this.authenticate(function(){u(!0)},d);else if(403===f.getStatus()){var g=!1;try{var l=JSON.parse(f.getText());null!=l&&"Resource not accessible by integration"==l.message?c():(null!=l&&null!=l.errors&&0<l.errors.length&&(g="too_large"==l.errors[0].code),d({message:mxResources.get(g?"drawingTooLarge":"forbidden")}))}catch(n){d({message:mxResources.get(g?"drawingTooLarge":"forbidden")})}}else 404===f.getStatus()?q?d({code:f.getStatus(),message:this.getErrorMessage(f,mxResources.get("fileNotFound"))}):-c():409===f.getStatus()?d({code:f.getStatus(),status:409}):d({code:f.getStatus(),message:this.getErrorMessage(f,mxResources.get("error")+" "+f.getStatus())})}),mxUtils.bind(this,function(c){window.clearTimeout(G);I&&d(c)}))}),A=mxUtils.bind(this,function(J){null==this.user?this.updateUser(function(){A(!0)},d,J):u(J)});null==b?this.authenticate(function(){A(!0)},d):A(!1)};GitHubClient.prototype.getLibrary=function(f,k,d){this.getFile(f,k,d,!0)};GitHubClient.prototype.getSha=function(f,k,d,p,q,u,A){var J=-"&t="+(new Date).getTime();f=new mxXmlRequest(this.baseUrl+"/repos/"+f+"/"+k+"/contents/"+d+"?ref="+p+J,null,"HEAD");this.executeRequest(f,mxUtils.bind(this,function(I){try{q(I.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(G){u(G)}}),u,null,A)};GitHubClient.prototype.getFile=function(f,k,d,p,q){p=null!=p?p:!1;var u=f.split("/"),A=u[0],J=u[1],I=u[2];f=u.slice(3,u.length).join("/");u=/\.png$/i.test(f);if(!q&&(/\.v(dx|sdx?)$/i.test(f)||/\.gliffy$/i.test(f)||/\.pdf$/i.test(f)||!Editor.useCanvasForExport&&-u))if(null!=b){q=this.baseUrl+"/repos/"+A+"/"+J+"/contents/"+f+"?ref="+I;var G={Authorization:"token "+b};u=f.split("/");this.ui.convertFile(q,0<u.length?u[u.length-1]:f,null,this.extension,k,d,null,G)}else d({message:mxResources.get("accessDenied")});else u="&t="+(new Date).getTime(),f=new mxXmlRequest(this.baseUrl+"/repos/"+A+"/"+J+"/contents/"+f+"?ref="+I+u,null,"GET"),this.executeRequest(f,mxUtils.bind(this,function(E){try{var c=JSON.parse(E.getText());if(""==c.content&&null!=c.git_url){var g=-new mxXmlRequest(c.git_url,null,"GET");this.executeRequest(g,mxUtils.bind(this,function(l){l=JSON.parse(l.getText());""!=l.content?(c.content=l.content,c.encoding=l.encoding,k(this.createGitHubFile(A,J,I,c,p))):d({message:mxResources.get("errorLoadingFile")})}),d)}else k(this.createGitHubFile(A,J,I,c,p))}catch(l){d(l)}}),d)};GitHubClient.prototype.createGitHubFile=function(f,k,d,p,q){f={org:f,repo:k,ref:d,name:p.name,path:p.path,sha:p.sha,html_url:p.html_url,download_url:p.download_url};k=p.content;+c():409===f.getStatus()?d({code:f.getStatus(),status:409}):d({code:f.getStatus(),message:this.getErrorMessage(f,mxResources.get("error")+" "+f.getStatus())})}),mxUtils.bind(this,function(c){window.clearTimeout(F);H&&d(c)}))}),A=mxUtils.bind(this,function(I){null==this.user?this.updateUser(function(){A(!0)},d,I):u(I)});null==b?this.authenticate(function(){A(!0)},d):A(!1)};GitHubClient.prototype.getLibrary=function(f,k,d){this.getFile(f,k,d,!0)};GitHubClient.prototype.getSha=function(f,k,d,p,q,u,A){var I=+"&t="+(new Date).getTime();f=new mxXmlRequest(this.baseUrl+"/repos/"+f+"/"+k+"/contents/"+d+"?ref="+p+I,null,"HEAD");this.executeRequest(f,mxUtils.bind(this,function(H){try{q(H.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(F){u(F)}}),u,null,A)};GitHubClient.prototype.getFile=function(f,k,d,p,q){p=null!=p?p:!1;var u=f.split("/"),A=u[0],I=u[1],H=u[2];f=u.slice(3,u.length).join("/");u=/\.png$/i.test(f);if(!q&&(/\.v(dx|sdx?)$/i.test(f)||/\.gliffy$/i.test(f)||/\.pdf$/i.test(f)||!Editor.useCanvasForExport&&+u))if(null!=b){q=this.baseUrl+"/repos/"+A+"/"+I+"/contents/"+f+"?ref="+H;var F={Authorization:"token "+b};u=f.split("/");this.ui.convertFile(q,0<u.length?u[u.length-1]:f,null,this.extension,k,d,null,F)}else d({message:mxResources.get("accessDenied")});else u="&t="+(new Date).getTime(),f=new mxXmlRequest(this.baseUrl+"/repos/"+A+"/"+I+"/contents/"+f+"?ref="+H+u,null,"GET"),this.executeRequest(f,mxUtils.bind(this,function(D){try{var c=JSON.parse(D.getText());if(""==c.content&&null!=c.git_url){var g=+new mxXmlRequest(c.git_url,null,"GET");this.executeRequest(g,mxUtils.bind(this,function(l){l=JSON.parse(l.getText());""!=l.content?(c.content=l.content,c.encoding=l.encoding,k(this.createGitHubFile(A,I,H,c,p))):d({message:mxResources.get("errorLoadingFile")})}),d)}else k(this.createGitHubFile(A,I,H,c,p))}catch(l){d(l)}}),d)};GitHubClient.prototype.createGitHubFile=function(f,k,d,p,q){f={org:f,repo:k,ref:d,name:p.name,path:p.path,sha:p.sha,html_url:p.html_url,download_url:p.download_url};k=p.content;"base64"===p.encoding&&(/\.jpe?g$/i.test(p.name)?k="data:image/jpeg;base64,"+k:/\.gif$/i.test(p.name)?k="data:image/gif;base64,"+k:/\.png$/i.test(p.name)?(p=this.ui.extractGraphModelFromPng(k),k=null!=p&&0<p.length?p:"data:image/png;base64,"+k):k=Base64.decode(k));return q?new GitHubLibrary(this.ui,k,f):new GitHubFile(this.ui,k,f)};GitHubClient.prototype.insertLibrary=function(f,k,d,p,q){this.insertFile(f,k,d,p,!0,q,!1)};GitHubClient.prototype.insertFile=function(f,k,d,p,q,u,A){q=null!=q?q:!1;u=u.split("/");-var J=u[0],I=u[1],G=u[2],E=u.slice(3,u.length).join("/");0<E.length&&(E+="/");E+=f;this.checkExists(J+"/"+I+"/"+G+"/"+E,!0,mxUtils.bind(this,function(c,g){c?q?(A||(k=Base64.encode(k)),this.showCommitDialog(f,!0,mxUtils.bind(this,function(l){this.writeFile(J,I,G,E,l,k,g,mxUtils.bind(this,function(n){try{var v=JSON.parse(n.getText());d(this.createGitHubFile(J,I,G,v.content,q))}catch(x){p(x)}}),p)}),p)):d(new GitHubFile(this.ui,k,{org:J,repo:I,ref:G,name:f,path:E,sha:g,isNew:!0})):p()}))};GitHubClient.prototype.showCommitDialog=-function(f,k,d,p){var q=this.ui.spinner.pause();f=new FilenameDialog(this.ui,mxResources.get(k?"addedFile":"updateFile",[f]),mxResources.get("ok"),mxUtils.bind(this,function(u){q(function(){d(u)})}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){p()}));this.ui.showDialog(f.container,400,80,!0,!1);f.init()};GitHubClient.prototype.writeFile=function(f,k,d,p,q,u,A,J,I){u.length>=this.maxFileSize?I({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(u.length)+-" / 1 MB)"}):(d={path:p,branch:decodeURIComponent(d),message:q,content:u},null!=A&&(d.sha=A),f=new mxXmlRequest(this.baseUrl+"/repos/"+f+"/"+k+"/contents/"+p,JSON.stringify(d),"PUT"),this.executeRequest(f,mxUtils.bind(this,function(G){J(G)}),mxUtils.bind(this,function(G){404==G.code&&(G.helpLink=this.baseHostUrl+"/settings/connections/applications/"+this.clientId,G.code=null);I(G)})))};GitHubClient.prototype.checkExists=function(f,k,d){var p=f.split("/"),q=p[0],u=p[1],A=p[2];f=p.slice(3,p.length).join("/");-this.getSha(q,u,f,A,mxUtils.bind(this,function(J){if(k){var I=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[f]),function(){I();d(!0,J)},function(){I();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(J){d(!0)}),!0)};GitHubClient.prototype.saveFile=function(f,k,d,p,q){var u=f.meta.org,A=f.meta.repo,J=f.meta.ref,I=f.meta.path,G=mxUtils.bind(this,function(c,-g){this.writeFile(u,A,J,I,q,g,c,mxUtils.bind(this,function(l){delete f.meta.isNew;k(JSON.parse(l.getText()).content.sha)}),mxUtils.bind(this,function(l){d(l)}))}),E=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(I)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(g){G(f.meta.sha,g)}),d,this.ui.getCurrentFile()!=f?f.getData():null,c.scale,c.border)}else G(f.meta.sha,Base64.encode(f.getData()))});p?this.getSha(u,A,I,-J,mxUtils.bind(this,function(c){f.meta.sha=c;E()}),d):E()};GitHubClient.prototype.pickLibrary=function(f){this.pickFile(f)};GitHubClient.prototype.pickFolder=function(f){this.showGitHubDialog(!1,f,!0)};GitHubClient.prototype.pickFile=function(f){f=null!=f?f:mxUtils.bind(this,function(k){this.ui.loadFile("H"+encodeURIComponent(k))});this.showGitHubDialog(!0,f)};GitHubClient.prototype.showGitHubDialog=function(f,k,d){var p=null,q=null,u=null,A=null,J=document.createElement("div");J.style.whiteSpace=-"nowrap";J.style.overflow="hidden";J.style.height="320px";var I=document.createElement("h3");mxUtils.write(I,mxResources.get(f?"selectFile":"selectFolder"));I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";J.appendChild(I);I=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){H()}));I.style.position="absolute";I.style.right="40px";I.style.top="26px";J.appendChild(I);var G=document.createElement("div");G.style.whiteSpace=-"nowrap";G.style.border="1px solid lightgray";G.style.boxSizing="border-box";G.style.padding="4px";G.style.overflow="auto";G.style.lineHeight="1.2em";G.style.height="290px";J.appendChild(G);var E=document.createElement("div");E.style.textOverflow="ellipsis";E.style.boxSizing="border-box";E.style.overflow="hidden";E.style.padding="4px";E.style.width="100%";var c=new CustomDialog(this.ui,J,mxUtils.bind(this,function(){k(p+"/"+q+"/"+encodeURIComponent(u)+"/"+A)}),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(c.container,420,370,!0,!0);f&&c.okButton.parentNode.removeChild(c.okButton);var g=mxUtils.bind(this,function(D,U,S,V){var t=document.createElement("a");t.setAttribute("title",D);t.style.cursor="pointer";mxUtils.write(t,D);mxEvent.addListener(t,"click",-U);V&&(t.style.textDecoration="underline");null!=S&&(D=E.cloneNode(),D.style.padding=S,D.appendChild(t),t=D);return t}),l=mxUtils.bind(this,function(D){var U=document.createElement("div");U.style.marginBottom="8px";U.appendChild(g(p+"/"+q,mxUtils.bind(this,function(){A=null;H()}),null,!0));D||(mxUtils.write(U," / "),U.appendChild(g(decodeURIComponent(u),mxUtils.bind(this,function(){A=null;C()}),null,!0)));if(null!=A&&0<A.length){var S=A.split("/");for(D=0;D<S.length;D++)(function(V){mxUtils.write(U,-" / ");U.appendChild(g(S[V],mxUtils.bind(this,function(){A=S.slice(0,V+1).join("/");B()}),null,!0))})(D)}G.appendChild(U)}),n=mxUtils.bind(this,function(D){this.ui.handleError(D,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(A=u=q=p=null,H()):this.ui.hideDialog()}),null,{})}),v=null,x=null,B=mxUtils.bind(this,function(D){null==D&&(G.innerText="",D=1);var U=new mxXmlRequest(this.baseUrl+"/repos/"+p+"/"+q+"/contents/"+A+"?ref="+encodeURIComponent(u)+"&per_page=100&page="+-D,null,"GET");this.ui.spinner.spin(G,mxResources.get("loading"));c.okButton.removeAttribute("disabled");null!=x&&(mxEvent.removeListener(G,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var S=mxUtils.bind(this,function(){B(D+1)});mxEvent.addListener(v,"click",S);this.executeRequest(U,mxUtils.bind(this,function(V){this.ui.tryAndHandle(mxUtils.bind(this,-function(){this.ui.spinner.stop();1==D&&(l(),G.appendChild(g("../ [Up]",mxUtils.bind(this,function(){if(""==A)A=null,H();else{var M=A.split("/");A=M.slice(0,M.length-1).join("/");B()}}),"4px")));var t=JSON.parse(V.getText());if(null==t||0==t.length)d||(mxUtils.br(G),mxUtils.write(G,mxResources.get("noFiles")));else{var z=!0,L=0,K=mxUtils.bind(this,function(M){for(var m=0;m<t.length;m++)mxUtils.bind(this,function(y,F){if(M==("dir"==y.type)){F=E.cloneNode();F.style.backgroundColor=z?Editor.isDarkMode()?-"#000000":"#eeeeee":"";z=!z;var N=document.createElement("img");N.src=IMAGE_PATH+"/"+("dir"==y.type?"folder.png":"file.png");N.setAttribute("align","absmiddle");N.style.marginRight="4px";N.style.marginTop="-4px";N.width=20;F.appendChild(N);F.appendChild(g(y.name+("dir"==y.type?"/":""),mxUtils.bind(this,function(){"dir"==y.type?(A=y.path,B()):f&&"file"==y.type&&(this.ui.hideDialog(),k(p+"/"+q+"/"+encodeURIComponent(u)+"/"+y.path))})));G.appendChild(F);L++}})(t[m],m)});K(!0);f&&K(!1)}}))}),n,!0)}),-C=mxUtils.bind(this,function(D,U){null==D&&(G.innerText="",D=1);var S=new mxXmlRequest(this.baseUrl+"/repos/"+p+"/"+q+"/branches?per_page=100&page="+D,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(G,mxResources.get("loading"));null!=x&&(mxEvent.removeListener(G,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var V=-mxUtils.bind(this,function(){C(D+1)});mxEvent.addListener(v,"click",V);this.executeRequest(S,mxUtils.bind(this,function(t){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==D&&(l(!0),G.appendChild(g("../ [Up]",mxUtils.bind(this,function(){A=null;H()}),"4px")));var z=JSON.parse(t.getText());if(null==z||0==z.length)mxUtils.br(G),mxUtils.write(G,mxResources.get("repositoryNotFound"));else if(1==z.length&&U)u=z[0].name,A="",B();else{for(var L=0;L<z.length;L++)mxUtils.bind(this,-function(K,M){var m=E.cloneNode();m.style.backgroundColor=0==M%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";m.appendChild(g(K.name,mxUtils.bind(this,function(){u=K.name;A="";B()})));G.appendChild(m)})(z[L],L);100==z.length&&(G.appendChild(v),x=function(){G.scrollTop>=G.scrollHeight-G.offsetHeight&&V()},mxEvent.addListener(G,"scroll",x))}}))}),n)}),H=mxUtils.bind(this,function(D){null==D&&(G.innerText="",D=1);var U=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+D,null,"GET");c.okButton.setAttribute("disabled",-"disabled");this.ui.spinner.spin(G,mxResources.get("loading"));null!=x&&mxEvent.removeListener(G,"scroll",x);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var S=mxUtils.bind(this,function(){H(D+1)});mxEvent.addListener(v,"click",S);this.executeRequest(U,mxUtils.bind(this,function(V){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();var t=JSON.parse(V.getText());-if(null==t||0==t.length)mxUtils.br(G),mxUtils.write(G,mxResources.get("repositoryNotFound"));else{1==D&&(G.appendChild(g(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var L=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(K){if(null!=K){var M=K.split("/");if(1<M.length){K=M[0];var m=M[1];3>M.length?(p=K,q=m,A=u=null,C()):this.ui.spinner.spin(G,mxResources.get("loading"))&&(M=encodeURIComponent(M.slice(2,M.length).join("/")),this.getFile(K+-"/"+m+"/"+M,mxUtils.bind(this,function(y){this.ui.spinner.stop();p=y.meta.org;q=y.meta.repo;u=decodeURIComponent(y.meta.ref);A="";B()}),mxUtils.bind(this,function(y){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(L.container,300,80,!0,!1);L.init()}))),mxUtils.br(G),mxUtils.br(G));for(var z=0;z<t.length;z++)mxUtils.bind(this,-function(L,K){var M=E.cloneNode();M.style.backgroundColor=0==K%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";M.appendChild(g(L.full_name,mxUtils.bind(this,function(){p=L.owner.login;q=L.name;A="";C(null,!0)})));G.appendChild(M)})(t[z],z)}100==t.length&&(G.appendChild(v),x=function(){G.scrollTop>=G.scrollHeight-G.offsetHeight&&S()},mxEvent.addListener(G,"scroll",x))}))}),n)});H()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,f,k){DrawioFile.call(this,b,f);this.meta=k;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};+var I=u[0],H=u[1],F=u[2],D=u.slice(3,u.length).join("/");0<D.length&&(D+="/");D+=f;this.checkExists(I+"/"+H+"/"+F+"/"+D,!0,mxUtils.bind(this,function(c,g){c?q?(A||(k=Base64.encode(k)),this.showCommitDialog(f,!0,mxUtils.bind(this,function(l){this.writeFile(I,H,F,D,l,k,g,mxUtils.bind(this,function(n){try{var v=JSON.parse(n.getText());d(this.createGitHubFile(I,H,F,v.content,q))}catch(x){p(x)}}),p)}),p)):d(new GitHubFile(this.ui,k,{org:I,repo:H,ref:F,name:f,path:D,sha:g,isNew:!0})):p()}))};GitHubClient.prototype.showCommitDialog=+function(f,k,d,p){var q=this.ui.spinner.pause();f=new FilenameDialog(this.ui,mxResources.get(k?"addedFile":"updateFile",[f]),mxResources.get("ok"),mxUtils.bind(this,function(u){q(function(){d(u)})}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){p()}));this.ui.showDialog(f.container,400,80,!0,!1);f.init()};GitHubClient.prototype.writeFile=function(f,k,d,p,q,u,A,I,H){u.length>=this.maxFileSize?H({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(u.length)++" / 1 MB)"}):(d={path:p,branch:decodeURIComponent(d),message:q,content:u},null!=A&&(d.sha=A),f=new mxXmlRequest(this.baseUrl+"/repos/"+f+"/"+k+"/contents/"+p,JSON.stringify(d),"PUT"),this.executeRequest(f,mxUtils.bind(this,function(F){I(F)}),mxUtils.bind(this,function(F){404==F.code&&(F.helpLink=this.baseHostUrl+"/settings/connections/applications/"+this.clientId,F.code=null);H(F)})))};GitHubClient.prototype.checkExists=function(f,k,d){var p=f.split("/"),q=p[0],u=p[1],A=p[2];f=p.slice(3,p.length).join("/");+this.getSha(q,u,f,A,mxUtils.bind(this,function(I){if(k){var H=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[f]),function(){H();d(!0,I)},function(){H();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(I){d(!0)}),!0)};GitHubClient.prototype.saveFile=function(f,k,d,p,q){var u=f.meta.org,A=f.meta.repo,I=f.meta.ref,H=f.meta.path,F=mxUtils.bind(this,function(c,+g){this.writeFile(u,A,I,H,q,g,c,mxUtils.bind(this,function(l){delete f.meta.isNew;k(JSON.parse(l.getText()).content.sha)}),mxUtils.bind(this,function(l){d(l)}))}),D=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(H)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(g){F(f.meta.sha,g)}),d,this.ui.getCurrentFile()!=f?f.getData():null,c.scale,c.border)}else F(f.meta.sha,Base64.encode(f.getData()))});p?this.getSha(u,A,H,+I,mxUtils.bind(this,function(c){f.meta.sha=c;D()}),d):D()};GitHubClient.prototype.pickLibrary=function(f){this.pickFile(f)};GitHubClient.prototype.pickFolder=function(f){this.showGitHubDialog(!1,f,!0)};GitHubClient.prototype.pickFile=function(f){f=null!=f?f:mxUtils.bind(this,function(k){this.ui.loadFile("H"+encodeURIComponent(k))});this.showGitHubDialog(!0,f)};GitHubClient.prototype.showGitHubDialog=function(f,k,d){var p=null,q=null,u=null,A=null,I=document.createElement("div");I.style.whiteSpace=+"nowrap";I.style.overflow="hidden";I.style.height="320px";var H=document.createElement("h3");mxUtils.write(H,mxResources.get(f?"selectFile":"selectFolder"));H.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";I.appendChild(H);H=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){G()}));H.style.position="absolute";H.style.right="40px";H.style.top="26px";I.appendChild(H);var F=document.createElement("div");F.style.whiteSpace=+"nowrap";F.style.border="1px solid lightgray";F.style.boxSizing="border-box";F.style.padding="4px";F.style.overflow="auto";F.style.lineHeight="1.2em";F.style.height="290px";I.appendChild(F);var D=document.createElement("div");D.style.textOverflow="ellipsis";D.style.boxSizing="border-box";D.style.overflow="hidden";D.style.padding="4px";D.style.width="100%";var c=new CustomDialog(this.ui,I,mxUtils.bind(this,function(){k(p+"/"+q+"/"+encodeURIComponent(u)+"/"+A)}),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(c.container,420,370,!0,!0);f&&c.okButton.parentNode.removeChild(c.okButton);var g=mxUtils.bind(this,function(N,J,T,V){var t=document.createElement("a");t.setAttribute("title",N);t.style.cursor="pointer";mxUtils.write(t,N);mxEvent.addListener(t,"click",+J);V&&(t.style.textDecoration="underline");null!=T&&(N=D.cloneNode(),N.style.padding=T,N.appendChild(t),t=N);return t}),l=mxUtils.bind(this,function(N){var J=document.createElement("div");J.style.marginBottom="8px";J.appendChild(g(p+"/"+q,mxUtils.bind(this,function(){A=null;G()}),null,!0));N||(mxUtils.write(J," / "),J.appendChild(g(decodeURIComponent(u),mxUtils.bind(this,function(){A=null;C()}),null,!0)));if(null!=A&&0<A.length){var T=A.split("/");for(N=0;N<T.length;N++)(function(V){mxUtils.write(J,+" / ");J.appendChild(g(T[V],mxUtils.bind(this,function(){A=T.slice(0,V+1).join("/");B()}),null,!0))})(N)}F.appendChild(J)}),n=mxUtils.bind(this,function(N){this.ui.handleError(N,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(A=u=q=p=null,G()):this.ui.hideDialog()}),null,{})}),v=null,x=null,B=mxUtils.bind(this,function(N){null==N&&(F.innerText="",N=1);var J=new mxXmlRequest(this.baseUrl+"/repos/"+p+"/"+q+"/contents/"+A+"?ref="+encodeURIComponent(u)+"&per_page=100&page="++N,null,"GET");this.ui.spinner.spin(F,mxResources.get("loading"));c.okButton.removeAttribute("disabled");null!=x&&(mxEvent.removeListener(F,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){B(N+1)});mxEvent.addListener(v,"click",T);this.executeRequest(J,mxUtils.bind(this,function(V){this.ui.tryAndHandle(mxUtils.bind(this,+function(){this.ui.spinner.stop();1==N&&(l(),F.appendChild(g("../ [Up]",mxUtils.bind(this,function(){if(""==A)A=null,G();else{var M=A.split("/");A=M.slice(0,M.length-1).join("/");B()}}),"4px")));var t=JSON.parse(V.getText());if(null==t||0==t.length)d||(mxUtils.br(F),mxUtils.write(F,mxResources.get("noFiles")));else{var z=!0,L=0,K=mxUtils.bind(this,function(M){for(var m=0;m<t.length;m++)mxUtils.bind(this,function(y,E){if(M==("dir"==y.type)){E=D.cloneNode();E.style.backgroundColor=z?Editor.isDarkMode()?+"#000000":"#eeeeee":"";z=!z;var P=document.createElement("img");P.src=IMAGE_PATH+"/"+("dir"==y.type?"folder.png":"file.png");P.setAttribute("align","absmiddle");P.style.marginRight="4px";P.style.marginTop="-4px";P.width=20;E.appendChild(P);E.appendChild(g(y.name+("dir"==y.type?"/":""),mxUtils.bind(this,function(){"dir"==y.type?(A=y.path,B()):f&&"file"==y.type&&(this.ui.hideDialog(),k(p+"/"+q+"/"+encodeURIComponent(u)+"/"+y.path))})));F.appendChild(E);L++}})(t[m],m)});K(!0);f&&K(!1)}}))}),n,!0)}),+C=mxUtils.bind(this,function(N,J){null==N&&(F.innerText="",N=1);var T=new mxXmlRequest(this.baseUrl+"/repos/"+p+"/"+q+"/branches?per_page=100&page="+N,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(F,mxResources.get("loading"));null!=x&&(mxEvent.removeListener(F,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var V=+mxUtils.bind(this,function(){C(N+1)});mxEvent.addListener(v,"click",V);this.executeRequest(T,mxUtils.bind(this,function(t){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==N&&(l(!0),F.appendChild(g("../ [Up]",mxUtils.bind(this,function(){A=null;G()}),"4px")));var z=JSON.parse(t.getText());if(null==z||0==z.length)mxUtils.br(F),mxUtils.write(F,mxResources.get("repositoryNotFound"));else if(1==z.length&&J)u=z[0].name,A="",B();else{for(var L=0;L<z.length;L++)mxUtils.bind(this,+function(K,M){var m=D.cloneNode();m.style.backgroundColor=0==M%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";m.appendChild(g(K.name,mxUtils.bind(this,function(){u=K.name;A="";B()})));F.appendChild(m)})(z[L],L);100==z.length&&(F.appendChild(v),x=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&V()},mxEvent.addListener(F,"scroll",x))}}))}),n)}),G=mxUtils.bind(this,function(N){null==N&&(F.innerText="",N=1);var J=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+N,null,"GET");c.okButton.setAttribute("disabled",+"disabled");this.ui.spinner.spin(F,mxResources.get("loading"));null!=x&&mxEvent.removeListener(F,"scroll",x);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){G(N+1)});mxEvent.addListener(v,"click",T);this.executeRequest(J,mxUtils.bind(this,function(V){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();var t=JSON.parse(V.getText());+if(null==t||0==t.length)mxUtils.br(F),mxUtils.write(F,mxResources.get("repositoryNotFound"));else{1==N&&(F.appendChild(g(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var L=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(K){if(null!=K){var M=K.split("/");if(1<M.length){K=M[0];var m=M[1];3>M.length?(p=K,q=m,A=u=null,C()):this.ui.spinner.spin(F,mxResources.get("loading"))&&(M=encodeURIComponent(M.slice(2,M.length).join("/")),this.getFile(K++"/"+m+"/"+M,mxUtils.bind(this,function(y){this.ui.spinner.stop();p=y.meta.org;q=y.meta.repo;u=decodeURIComponent(y.meta.ref);A="";B()}),mxUtils.bind(this,function(y){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(L.container,300,80,!0,!1);L.init()}))),mxUtils.br(F),mxUtils.br(F));for(var z=0;z<t.length;z++)mxUtils.bind(this,+function(L,K){var M=D.cloneNode();M.style.backgroundColor=0==K%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";M.appendChild(g(L.full_name,mxUtils.bind(this,function(){p=L.owner.login;q=L.name;A="";C(null,!0)})));F.appendChild(M)})(t[z],z)}100==t.length&&(F.appendChild(v),x=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&T()},mxEvent.addListener(F,"scroll",x))}))}),n)});G()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,f,k){DrawioFile.call(this,b,f);this.meta=k;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,f,k){this.doSave(this.getTitle(),f,k)};TrelloFile.prototype.saveAs=function(b,f,k){this.doSave(b,f,k)};TrelloFile.prototype.doSave=function(b,f,k){var d=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=d;this.saveFile(b,!1,f,k)}),k])};TrelloFile.prototype.saveFile=function(b,f,k,d){this.isEditable()?this.savingFile?null!=d&&(this.saveNeededCounter++,d({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(p){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=p;this.contentChanged();null!=k&&k();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,f,k,d))}),mxUtils.bind(this,function(p){this.savingFile=!1;null!=d&&d(p)})):this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(p){this.ui.trello.insertFile(b,this.getData(),mxUtils.bind(this,function(q){this.savingFile=!1;null!=k&&k();this.ui.fileLoaded(q);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,f,k,d))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,p)}))):null!=k&&k()};TrelloLibrary=function(b,f,k){TrelloFile.call(this,b,f,k)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(b,f,k){this.saveFile(b,!1,f,k)};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";TrelloClient.prototype.authenticate=function(b,f,k){k&&this.logout();k=mxUtils.bind(this,function(d,p){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:d?"never":"1hour",success:function(){localStorage.setItem("drawio_trello_token",localStorage.trello_token);null!=p&&p();b()},error:function(){null!=p&&p();null!=f&&f(mxResources.get("loggedOut"))}})});this.isAuthorized()?k(!0):this.ui.showAuthDialog(this,!0,k)};TrelloClient.prototype.getLibrary=function(b,f,k){this.getFile(b,f,k,!1,!0)};-TrelloClient.prototype.getFile=function(b,f,k,d,p){p=null!=p?p:!1;var q=mxUtils.bind(this,function(){var u=b.split(this.SEPARATOR),A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;k({code:App.ERROR_TIMEOUT,retry:q})}),this.ui.timeout);Trello.cards.get(u[0]+"/attachments/"+u[1],mxUtils.bind(this,function(I){window.clearTimeout(J);if(A){var G=/\.png$/i.test(I.name),E={Authorization:'OAuth oauth_consumer_key="'+Trello.key()+'", oauth_token="'+Trello.token()+'"'};/\.v(dx|sdx?)$/i.test(I.name)||-/\.gliffy$/i.test(I.name)||!Editor.useCanvasForExport&&G?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(I.url),I.name,I.mimeType,this.extension,f,k,null,E):(A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;k({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(I.url),mxUtils.bind(this,function(c){window.clearTimeout(J);if(A){I.compoundId=b;if(0<(G?c.lastIndexOf(","):-1)){var g=this.ui.extractGraphModelFromPng(c);null!=g&&0<g.length&&-(c=g)}p?f(new TrelloLibrary(this.ui,c,I)):f(new TrelloFile(this.ui,c,I))}}),mxUtils.bind(this,function(c,g){window.clearTimeout(J);A&&(401==g.status?this.authenticate(q,k,!0):k())}),G||null!=I.mimeType&&"image/"==I.mimeType.substring(0,6),null,null,null,E))}}),mxUtils.bind(this,function(I){window.clearTimeout(J);A&&(null!=I&&401==I.status?this.authenticate(q,k,!0):k())}))});this.authenticate(q,k)};TrelloClient.prototype.insertLibrary=function(b,f,k,d,p){this.insertFile(b,f,k,d,!0,p)};-TrelloClient.prototype.insertFile=function(b,f,k,d,p,q){p=null!=p?p:!1;var u=mxUtils.bind(this,function(){var A=mxUtils.bind(this,function(J){this.writeFile(b,J,q,mxUtils.bind(this,function(I){p?k(new TrelloLibrary(this.ui,f,I)):k(new TrelloFile(this.ui,f,I))}),d)});Editor.useCanvasForExport&&/(\.png)$/i.test(b)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(J){A(this.ui.base64ToBlob(J,"image/png"))}),d,f):A(f)});this.authenticate(u,d)};-TrelloClient.prototype.saveFile=function(b,f,k){var d=b.meta.compoundId.split(this.SEPARATOR),p=mxUtils.bind(this,function(u){this.writeFile(b.meta.name,u,d[0],function(A){Trello.del("cards/"+d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(){f(A)}),mxUtils.bind(this,function(J){null!=J&&401==J.status?this.authenticate(q,k,!0):k()}))},k)}),q=mxUtils.bind(this,function(){Editor.useCanvasForExport&&/(\.png)$/i.test(b.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(u){p(this.ui.base64ToBlob(u,+TrelloClient.prototype.getFile=function(b,f,k,d,p){p=null!=p?p:!1;var q=mxUtils.bind(this,function(){var u=b.split(this.SEPARATOR),A=!0,I=window.setTimeout(mxUtils.bind(this,function(){A=!1;k({code:App.ERROR_TIMEOUT,retry:q})}),this.ui.timeout);Trello.cards.get(u[0]+"/attachments/"+u[1],mxUtils.bind(this,function(H){window.clearTimeout(I);if(A){var F=/\.png$/i.test(H.name),D={Authorization:'OAuth oauth_consumer_key="'+Trello.key()+'", oauth_token="'+Trello.token()+'"'};/\.v(dx|sdx?)$/i.test(H.name)||+/\.gliffy$/i.test(H.name)||!Editor.useCanvasForExport&&F?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(H.url),H.name,H.mimeType,this.extension,f,k,null,D):(A=!0,I=window.setTimeout(mxUtils.bind(this,function(){A=!1;k({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(H.url),mxUtils.bind(this,function(c){window.clearTimeout(I);if(A){H.compoundId=b;if(0<(F?c.lastIndexOf(","):-1)){var g=this.ui.extractGraphModelFromPng(c);null!=g&&0<g.length&&+(c=g)}p?f(new TrelloLibrary(this.ui,c,H)):f(new TrelloFile(this.ui,c,H))}}),mxUtils.bind(this,function(c,g){window.clearTimeout(I);A&&(401==g.status?this.authenticate(q,k,!0):k())}),F||null!=H.mimeType&&"image/"==H.mimeType.substring(0,6),null,null,null,D))}}),mxUtils.bind(this,function(H){window.clearTimeout(I);A&&(null!=H&&401==H.status?this.authenticate(q,k,!0):k())}))});this.authenticate(q,k)};TrelloClient.prototype.insertLibrary=function(b,f,k,d,p){this.insertFile(b,f,k,d,!0,p)};+TrelloClient.prototype.insertFile=function(b,f,k,d,p,q){p=null!=p?p:!1;var u=mxUtils.bind(this,function(){var A=mxUtils.bind(this,function(I){this.writeFile(b,I,q,mxUtils.bind(this,function(H){p?k(new TrelloLibrary(this.ui,f,H)):k(new TrelloFile(this.ui,f,H))}),d)});Editor.useCanvasForExport&&/(\.png)$/i.test(b)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(I){A(this.ui.base64ToBlob(I,"image/png"))}),d,f):A(f)});this.authenticate(u,d)};+TrelloClient.prototype.saveFile=function(b,f,k){var d=b.meta.compoundId.split(this.SEPARATOR),p=mxUtils.bind(this,function(u){this.writeFile(b.meta.name,u,d[0],function(A){Trello.del("cards/"+d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(){f(A)}),mxUtils.bind(this,function(I){null!=I&&401==I.status?this.authenticate(q,k,!0):k()}))},k)}),q=mxUtils.bind(this,function(){Editor.useCanvasForExport&&/(\.png)$/i.test(b.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(u){p(this.ui.base64ToBlob(u,"image/png"))}),k,this.ui.getCurrentFile()!=b?b.getData():null):p(b.getData())});this.authenticate(q,k)};-TrelloClient.prototype.writeFile=function(b,f,k,d,p){if(null!=b&&null!=f)if(f.length>=this.maxFileSize)p({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(f.length)+" / 10 MB)"});else{var q=mxUtils.bind(this,function(){var u=!0,A=window.setTimeout(mxUtils.bind(this,function(){u=!1;p({code:App.ERROR_TIMEOUT,retry:q})}),this.ui.timeout),J=new FormData;J.append("key",Trello.key());J.append("token",Trello.token());J.append("file","string"===typeof f?new Blob([f]):f,b);J.append("name",-b);var I=new XMLHttpRequest;I.responseType="json";I.onreadystatechange=mxUtils.bind(this,function(){if(4===I.readyState&&(window.clearTimeout(A),u))if(200==I.status){var G=I.response;G.compoundId=k+this.SEPARATOR+G.id;d(G)}else 401==I.status?this.authenticate(q,p,!0):p()});I.open("POST",this.baseUrl+"cards/"+k+"/attachments");I.send(J)});this.authenticate(q,p)}else p({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(b){this.pickFile(b)};+TrelloClient.prototype.writeFile=function(b,f,k,d,p){if(null!=b&&null!=f)if(f.length>=this.maxFileSize)p({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(f.length)+" / 10 MB)"});else{var q=mxUtils.bind(this,function(){var u=!0,A=window.setTimeout(mxUtils.bind(this,function(){u=!1;p({code:App.ERROR_TIMEOUT,retry:q})}),this.ui.timeout),I=new FormData;I.append("key",Trello.key());I.append("token",Trello.token());I.append("file","string"===typeof f?new Blob([f]):f,b);I.append("name",+b);var H=new XMLHttpRequest;H.responseType="json";H.onreadystatechange=mxUtils.bind(this,function(){if(4===H.readyState&&(window.clearTimeout(A),u))if(200==H.status){var F=H.response;F.compoundId=k+this.SEPARATOR+F.id;d(F)}else 401==H.status?this.authenticate(q,p,!0):p()});H.open("POST",this.baseUrl+"cards/"+k+"/attachments");H.send(I)});this.authenticate(q,p)}else p({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(b){this.pickFile(b)};TrelloClient.prototype.pickFolder=function(b){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,b)}),mxUtils.bind(this,function(f){this.ui.showError(mxResources.get("error"),f)}))};TrelloClient.prototype.pickFile=function(b,f){b=null!=b?b:mxUtils.bind(this,function(k){this.ui.loadFile("T"+encodeURIComponent(k))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,b)}),mxUtils.bind(this,function(k){this.ui.showError(mxResources.get("error"),k,mxResources.get("ok"))}))};TrelloClient.prototype.showTrelloDialog=function(b,f){var k=null,d="@me",p=0,q=document.createElement("div");q.style.whiteSpace="nowrap";q.style.overflow="hidden";q.style.height="224px";var u=document.createElement("h3");mxUtils.write(u,b?mxResources.get("selectFile"):mxResources.get("selectCard"));u.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";q.appendChild(u);var A=document.createElement("div");A.style.whiteSpace="nowrap";A.style.overflow="auto";A.style.height=-"194px";q.appendChild(A);q=new CustomDialog(this.ui,q);this.ui.showDialog(q.container,340,290,!0,!0);q.okButton.parentNode.removeChild(q.okButton);var J=mxUtils.bind(this,function(l,n,v){p++;var x=document.createElement("div");x.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;padding:2px 0 2px 0;background:"+(0==p%2?Editor.isDarkMode()?"#000":"#eee":Editor.isDarkMode()?"":"#fff");var B=document.createElement("a");B.style.cursor="pointer";if(null!=v){var C=document.createElement("img");-C.src=v.url;C.width=v.width;C.height=v.height;C.style="border: 1px solid black;margin:5px;vertical-align:middle";B.appendChild(C)}mxUtils.write(B,l);mxEvent.addListener(B,"click",n);x.appendChild(B);return x}),I=mxUtils.bind(this,function(l){this.ui.handleError(l,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),G=mxUtils.bind(this,function(){p=0;A.innerText="";this.ui.spinner.spin(A,mxResources.get("loading"));var l=mxUtils.bind(this,function(){Trello.cards.get(k+-"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(n){this.ui.spinner.stop();A.appendChild(J("../ [Up]",mxUtils.bind(this,function(){g()})));mxUtils.br(A);null==n||0==n.length?mxUtils.write(A,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var v=0;v<n.length;v++)mxUtils.bind(this,function(x){A.appendChild(J(x.name,mxUtils.bind(this,function(){this.ui.hideDialog();f(k+this.SEPARATOR+x.id)}),null!=x.previews?x.previews[0]:null))})(n[v])})()}),mxUtils.bind(this,function(n){401==-n.status?this.authenticate(l,I,!0):null!=I&&I(n)}))});l()}),E=null,c=null,g=mxUtils.bind(this,function(l){null==l&&(p=0,A.innerText="",l=1);this.ui.spinner.spin(A,mxResources.get("loading"));null!=E&&null!=E.parentNode&&E.parentNode.removeChild(E);E=document.createElement("a");E.style.display="block";E.style.cursor="pointer";mxUtils.write(E,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){mxEvent.removeListener(A,"scroll",c);g(l+1)});mxEvent.addListener(E,"click",n);var v=mxUtils.bind(this,-function(){Trello.get("search",{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:l-1},mxUtils.bind(this,function(x){this.ui.spinner.stop();x=null!=x?x.cards:null;if(null==x||0==x.length)mxUtils.write(A,mxResources.get("noFiles"));else{1==l&&(A.appendChild(J(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var C=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(H){null!=H&&(d=H,g())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");-this.ui.showDialog(C.container,300,80,!0,!1);C.init()}))),mxUtils.br(A));for(var B=0;B<x.length;B++)mxUtils.bind(this,function(C){A.appendChild(J(C.name,mxUtils.bind(this,function(){b?(k=C.id,G()):(this.ui.hideDialog(),f(C.id))})))})(x[B]);100==x.length&&(A.appendChild(E),c=function(){A.scrollTop>=A.scrollHeight-A.offsetHeight&&n()},mxEvent.addListener(A,"scroll",c))}}),mxUtils.bind(this,function(x){401==x.status?this.authenticate(v,I,!0):null!=I&&I({message:x.responseText})}))});v()});g()};+"194px";q.appendChild(A);q=new CustomDialog(this.ui,q);this.ui.showDialog(q.container,340,290,!0,!0);q.okButton.parentNode.removeChild(q.okButton);var I=mxUtils.bind(this,function(l,n,v){p++;var x=document.createElement("div");x.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;padding:2px 0 2px 0;background:"+(0==p%2?Editor.isDarkMode()?"#000":"#eee":Editor.isDarkMode()?"":"#fff");var B=document.createElement("a");B.style.cursor="pointer";if(null!=v){var C=document.createElement("img");+C.src=v.url;C.width=v.width;C.height=v.height;C.style="border: 1px solid black;margin:5px;vertical-align:middle";B.appendChild(C)}mxUtils.write(B,l);mxEvent.addListener(B,"click",n);x.appendChild(B);return x}),H=mxUtils.bind(this,function(l){this.ui.handleError(l,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),F=mxUtils.bind(this,function(){p=0;A.innerText="";this.ui.spinner.spin(A,mxResources.get("loading"));var l=mxUtils.bind(this,function(){Trello.cards.get(k++"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(n){this.ui.spinner.stop();A.appendChild(I("../ [Up]",mxUtils.bind(this,function(){g()})));mxUtils.br(A);null==n||0==n.length?mxUtils.write(A,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var v=0;v<n.length;v++)mxUtils.bind(this,function(x){A.appendChild(I(x.name,mxUtils.bind(this,function(){this.ui.hideDialog();f(k+this.SEPARATOR+x.id)}),null!=x.previews?x.previews[0]:null))})(n[v])})()}),mxUtils.bind(this,function(n){401==+n.status?this.authenticate(l,H,!0):null!=H&&H(n)}))});l()}),D=null,c=null,g=mxUtils.bind(this,function(l){null==l&&(p=0,A.innerText="",l=1);this.ui.spinner.spin(A,mxResources.get("loading"));null!=D&&null!=D.parentNode&&D.parentNode.removeChild(D);D=document.createElement("a");D.style.display="block";D.style.cursor="pointer";mxUtils.write(D,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){mxEvent.removeListener(A,"scroll",c);g(l+1)});mxEvent.addListener(D,"click",n);var v=mxUtils.bind(this,+function(){Trello.get("search",{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:l-1},mxUtils.bind(this,function(x){this.ui.spinner.stop();x=null!=x?x.cards:null;if(null==x||0==x.length)mxUtils.write(A,mxResources.get("noFiles"));else{1==l&&(A.appendChild(I(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var C=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(G){null!=G&&(d=G,g())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");+this.ui.showDialog(C.container,300,80,!0,!1);C.init()}))),mxUtils.br(A));for(var B=0;B<x.length;B++)mxUtils.bind(this,function(C){A.appendChild(I(C.name,mxUtils.bind(this,function(){b?(k=C.id,F()):(this.ui.hideDialog(),f(C.id))})))})(x[B]);100==x.length&&(A.appendChild(D),c=function(){A.scrollTop>=A.scrollHeight-A.offsetHeight&&n()},mxEvent.addListener(A,"scroll",c))}}),mxUtils.bind(this,function(x){401==x.status?this.authenticate(v,H,!0):null!=H&&H({message:x.responseText})}))});v()});g()};TrelloClient.prototype.isAuthorized=function(){try{var b=localStorage.trello_token;null==b&&(b=localStorage.drawio_trello_token,null!=b&&localStorage.setItem("trello_token",b));return null!=b}catch(f){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("drawio_trello_token");Trello.deauthorize()};GitLabFile=function(b,f,k){GitHubFile.call(this,b,f,k);this.peer=this.ui.gitLab};mxUtils.extend(GitLabFile,GitHubFile);GitLabFile.prototype.getFileUrl=function(){return this.meta.html_url};GitLabFile.prototype.getFolderUrl=function(){var b=this.getFileUrl();return b.substring(0,b.lastIndexOf("/"))};GitLabFile.prototype.share=function(){this.ui.editor.graph.openLink(DRAWIO_GITLAB_URL+"/"+this.meta.org+"/"+encodeURIComponent(this.meta.repo)+"/-/project_members")};GitLabFile.prototype.getId=function(){return this.meta.org+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitLabFile.prototype.getHash=function(){return encodeURIComponent("A"+this.getId())};GitLabFile.prototype.isConflict=function(b){return null!=b&&400==b.status};GitLabFile.prototype.getMode=function(){return App.MODE_GITLAB};GitLabFile.prototype.getDescriptorEtag=function(b){return b.last_commit_id};GitLabFile.prototype.setDescriptorEtag=function(b,f){b.last_commit_id=f};GitLabLibrary=function(b,f,k){GitLabFile.call(this,b,f,k)};mxUtils.extend(GitLabLibrary,GitLabFile);GitLabLibrary.prototype.doSave=function(b,f,k){this.saveFile(b,!1,f,k)};GitLabLibrary.prototype.open=function(){};(function(){var b=null;window.GitLabClient=function(f){GitHubClient.call(this,f,"gitlabauth")};mxUtils.extend(GitLabClient,GitHubClient);GitLabClient.prototype.clientId=DRAWIO_GITLAB_ID;GitLabClient.prototype.scope="api%20read_repository%20write_repository";GitLabClient.prototype.baseUrl=DRAWIO_GITLAB_URL+"/api/v4";GitLabClient.prototype.maxFileSize=1E7;GitLabClient.prototype.authToken="Bearer";GitLabClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"gitlab";GitLabClient.prototype.authenticate=function(f,k){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()?this.authenticateStep2(d.getText(),f,k):null!=k&&k(d)}),k)};GitLabClient.prototype.authenticateStep2=function(f,k,d){if(null==window.onGitLabCallback){var p=mxUtils.bind(this,function(){var q=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f),null,"GET")).send(mxUtils.bind(this,function(u){if(200<=u.getStatus()&&299>=u.getStatus())try{b=JSON.parse(u.getText()).access_token,this.setToken(b),this.setUser(null),k()}catch(A){d({message:mxResources.get("authFailed"),retry:p})}else this.clearPersistentToken(),this.setUser(null),b=null,this.setToken(null),401==u.getStatus()?p():d({message:mxResources.get("accessDenied"),retry:p})}),d):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(u,A){null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+-this.clientId+"&scope="+this.scope+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f),"gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,function(J,I){q?(window.onGitLabCallback=null,q=!1,null==J?d({message:mxResources.get("accessDenied"),retry:p}):(null!=A&&A(),b=J.access_token,this.setToken(b),this.setUser(null),u&&this.setPersistentToken("remembered"),k(),null!=I&&I.close())):-null!=I&&I.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:p})}),mxUtils.bind(this,function(){q&&(window.onGitLabCallback=null,q=!1,d({message:mxResources.get("accessDenied"),retry:p}))}))});p()}else d({code:App.ERROR_BUSY})};GitLabClient.prototype.executeRequest=function(f,k,d,p){var q=mxUtils.bind(this,function(A){var J=!0,I=window.setTimeout(mxUtils.bind(this,function(){J=!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),G=this.authToken+-" "+b;f.setRequestHeaders=function(E,c){E.setRequestHeader("Authorization",G);E.setRequestHeader("PRIVATE_TOKEN",G);E.setRequestHeader("Content-Type","application/json")};f.send(mxUtils.bind(this,function(){window.clearTimeout(I);if(J)if(200<=f.getStatus()&&299>=f.getStatus()||p&&404==f.getStatus())k(f);else if(401===f.getStatus())A?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){u(!0)},d)})}):this.authenticate(function(){q(!0)},d);else if(403===-f.getStatus()){var E=!1;try{var c=JSON.parse(f.getText());null!=c&&null!=c.errors&&0<c.errors.length&&(E="too_large"==c.errors[0].code)}catch(g){}d({message:mxResources.get(E?"drawingTooLarge":"forbidden")})}else 404===f.getStatus()?d({message:this.getErrorMessage(f,mxResources.get("fileNotFound"))}):d({status:f.getStatus(),message:this.getErrorMessage(f,mxResources.get("error")+" "+f.getStatus())})}),mxUtils.bind(this,function(E){window.clearTimeout(I);J&&d(E)}))}),u=mxUtils.bind(this,function(A){null==-this.user?this.updateUser(function(){u(!0)},d,A):q(A)});null==b?this.authenticate(function(){u(!0)},d):u(!1)};GitLabClient.prototype.getRefIndex=function(f,k,d,p,q,u){if(null!=q)d(f,q);else{var A=f.length-2,J=mxUtils.bind(this,function(){if(2>A)p({message:mxResources.get("fileNotFound")});else{var I=Math.max(A-1,0),G=f.slice(0,I).join("/");I=f[I];var E=f[A],c=f.slice(A+1,f.length).join("/");G=this.baseUrl+"/projects/"+encodeURIComponent(G+"/"+I)+"/repository/"+(k?u?"branches?per_page=1&page=1&ref="+-E:"tree?path="+c+"&ref="+E:"files/"+encodeURIComponent(c)+"?ref="+E);var g=new mxXmlRequest(G,null,"HEAD");this.executeRequest(g,mxUtils.bind(this,function(){200==g.getStatus()?d(f,A):p({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==g.getStatus()?(A--,J()):p({message:mxResources.get("fileNotFound")})}))}});J()}};GitLabClient.prototype.getFile=function(f,k,d,p,q,u){p=null!=p?p:!1;this.getRefIndex(f.split("/"),!1,mxUtils.bind(this,function(A,J){var I=Math.max(J-1,0),-G=A.slice(0,I).join("/"),E=A[I],c=A[J];f=A.slice(J+1,A.length).join("/");A=/\.png$/i.test(f);if(!q&&(/\.v(dx|sdx?)$/i.test(f)||/\.gliffy$/i.test(f)||/\.pdf$/i.test(f)||!Editor.useCanvasForExport&&A))if(null!=b){I="&t="+(new Date).getTime();var g=this.baseUrl+"/projects/"+encodeURIComponent(G+"/"+E)+"/repository/files/"+encodeURIComponent(f)+"?ref="+c;A=f.split("/");this.ui.convertFile(g+I,0<A.length?A[A.length-1]:f,null,this.extension,k,d,mxUtils.bind(this,function(l,n,v){l=new mxXmlRequest(l,null,-"GET");this.executeRequest(l,mxUtils.bind(this,function(x){try{n(this.getFileContent(JSON.parse(x.getText())))}catch(B){v(B)}}),v)}))}else d({message:mxResources.get("accessDenied")});else I="&t="+(new Date).getTime(),g=this.baseUrl+"/projects/"+encodeURIComponent(G+"/"+E)+"/repository/files/"+encodeURIComponent(f)+"?ref="+c,A=new mxXmlRequest(g+I,null,"GET"),this.executeRequest(A,mxUtils.bind(this,function(l){try{k(this.createGitLabFile(G,E,c,JSON.parse(l.getText()),p,J))}catch(n){d(n)}}),d)}),d,+this.clientId+"&scope="+this.scope+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f),"gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,function(I,H){q?(window.onGitLabCallback=null,q=!1,null==I?d({message:mxResources.get("accessDenied"),retry:p}):(null!=A&&A(),b=I.access_token,this.setToken(b),this.setUser(null),u&&this.setPersistentToken("remembered"),k(),null!=H&&H.close())):+null!=H&&H.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:p})}),mxUtils.bind(this,function(){q&&(window.onGitLabCallback=null,q=!1,d({message:mxResources.get("accessDenied"),retry:p}))}))});p()}else d({code:App.ERROR_BUSY})};GitLabClient.prototype.executeRequest=function(f,k,d,p){var q=mxUtils.bind(this,function(A){var I=!0,H=window.setTimeout(mxUtils.bind(this,function(){I=!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),F=this.authToken++" "+b;f.setRequestHeaders=function(D,c){D.setRequestHeader("Authorization",F);D.setRequestHeader("PRIVATE_TOKEN",F);D.setRequestHeader("Content-Type","application/json")};f.send(mxUtils.bind(this,function(){window.clearTimeout(H);if(I)if(200<=f.getStatus()&&299>=f.getStatus()||p&&404==f.getStatus())k(f);else if(401===f.getStatus())A?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){u(!0)},d)})}):this.authenticate(function(){q(!0)},d);else if(403===+f.getStatus()){var D=!1;try{var c=JSON.parse(f.getText());null!=c&&null!=c.errors&&0<c.errors.length&&(D="too_large"==c.errors[0].code)}catch(g){}d({message:mxResources.get(D?"drawingTooLarge":"forbidden")})}else 404===f.getStatus()?d({message:this.getErrorMessage(f,mxResources.get("fileNotFound"))}):d({status:f.getStatus(),message:this.getErrorMessage(f,mxResources.get("error")+" "+f.getStatus())})}),mxUtils.bind(this,function(D){window.clearTimeout(H);I&&d(D)}))}),u=mxUtils.bind(this,function(A){null==+this.user?this.updateUser(function(){u(!0)},d,A):q(A)});null==b?this.authenticate(function(){u(!0)},d):u(!1)};GitLabClient.prototype.getRefIndex=function(f,k,d,p,q,u){if(null!=q)d(f,q);else{var A=f.length-2,I=mxUtils.bind(this,function(){if(2>A)p({message:mxResources.get("fileNotFound")});else{var H=Math.max(A-1,0),F=f.slice(0,H).join("/");H=f[H];var D=f[A],c=f.slice(A+1,f.length).join("/");F=this.baseUrl+"/projects/"+encodeURIComponent(F+"/"+H)+"/repository/"+(k?u?"branches?per_page=1&page=1&ref="++D:"tree?path="+c+"&ref="+D:"files/"+encodeURIComponent(c)+"?ref="+D);var g=new mxXmlRequest(F,null,"HEAD");this.executeRequest(g,mxUtils.bind(this,function(){200==g.getStatus()?d(f,A):p({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==g.getStatus()?(A--,I()):p({message:mxResources.get("fileNotFound")})}))}});I()}};GitLabClient.prototype.getFile=function(f,k,d,p,q,u){p=null!=p?p:!1;this.getRefIndex(f.split("/"),!1,mxUtils.bind(this,function(A,I){var H=Math.max(I-1,0),+F=A.slice(0,H).join("/"),D=A[H],c=A[I];f=A.slice(I+1,A.length).join("/");A=/\.png$/i.test(f);if(!q&&(/\.v(dx|sdx?)$/i.test(f)||/\.gliffy$/i.test(f)||/\.pdf$/i.test(f)||!Editor.useCanvasForExport&&A))if(null!=b){H="&t="+(new Date).getTime();var g=this.baseUrl+"/projects/"+encodeURIComponent(F+"/"+D)+"/repository/files/"+encodeURIComponent(f)+"?ref="+c;A=f.split("/");this.ui.convertFile(g+H,0<A.length?A[A.length-1]:f,null,this.extension,k,d,mxUtils.bind(this,function(l,n,v){l=new mxXmlRequest(l,null,+"GET");this.executeRequest(l,mxUtils.bind(this,function(x){try{n(this.getFileContent(JSON.parse(x.getText())))}catch(B){v(B)}}),v)}))}else d({message:mxResources.get("accessDenied")});else H="&t="+(new Date).getTime(),g=this.baseUrl+"/projects/"+encodeURIComponent(F+"/"+D)+"/repository/files/"+encodeURIComponent(f)+"?ref="+c,A=new mxXmlRequest(g+H,null,"GET"),this.executeRequest(A,mxUtils.bind(this,function(l){try{k(this.createGitLabFile(F,D,c,JSON.parse(l.getText()),p,I))}catch(n){d(n)}}),d)}),d,u)};GitLabClient.prototype.getFileContent=function(f){var k=f.file_name,d=f.content;"base64"===f.encoding&&(/\.jpe?g$/i.test(k)?d="data:image/jpeg;base64,"+d:/\.gif$/i.test(k)?d="data:image/gif;base64,"+d:/\.pdf$/i.test(k)?d="data:application/pdf;base64,"+d:/\.png$/i.test(k)?(f=this.ui.extractGraphModelFromPng(d),d=null!=f&&0<f.length?f:"data:image/png;base64,"+d):d=Base64.decode(d));return d};GitLabClient.prototype.createGitLabFile=function(f,k,d,p,q,u){var A=DRAWIO_GITLAB_URL+"/";f={org:f,repo:k,-ref:d,name:p.file_name,path:p.file_path,html_url:A+f+"/"+k+"/blob/"+d+"/"+p.file_path,download_url:A+f+"/"+k+"/raw/"+d+"/"+p.file_path+"?inline=false",last_commit_id:p.last_commit_id,refPos:u};p=this.getFileContent(p);return q?new GitLabLibrary(this.ui,p,f):new GitLabFile(this.ui,p,f)};GitLabClient.prototype.insertFile=function(f,k,d,p,q,u,A){q=null!=q?q:!1;u=u.split("/");this.getRefIndex(u,!0,mxUtils.bind(this,function(J,I){var G=Math.max(I-1,0),E=J.slice(0,G).join("/"),c=J[G],g=J[I];path=J.slice(I+-1,J.length).join("/");0<path.length&&(path+="/");path+=f;this.checkExists(E+"/"+c+"/"+g+"/"+path,!0,mxUtils.bind(this,function(l,n){l?q?(A||(k=Base64.encode(k)),this.showCommitDialog(f,!0,mxUtils.bind(this,function(v){this.writeFile(E,c,g,path,v,k,n,mxUtils.bind(this,function(x){try{var B=JSON.parse(x.getText());d(this.createGitLabFile(E,c,g,null!=B.content?B.content:B,q,I))}catch(C){p(C)}}),p)}),p)):(l=DRAWIO_GITLAB_URL+"/",d(new GitLabFile(this.ui,k,{org:E,repo:c,ref:g,name:f,path:path,html_url:l+-E+"/"+c+"/blob/"+g+"/"+path,download_url:l+E+"/"+c+"/raw/"+g+"/"+path+"?inline=false",refPos:I,last_commit_id:n,isNew:!0}))):p()}))}),p,null,4>=u.length)};GitLabClient.prototype.checkExists=function(f,k,d){this.getFile(f,mxUtils.bind(this,function(p){if(k){var q=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[f]),function(){q();d(!0,p.getCurrentEtag())},function(){q();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),-mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(p){d(!0)}),null,!0)};GitLabClient.prototype.writeFile=function(f,k,d,p,q,u,A,J,I){if(u.length>=this.maxFileSize)I({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(u.length)+" / 10 MB)"});else{var G="POST";d={path:encodeURIComponent(p),branch:decodeURIComponent(d),commit_message:q,content:u,encoding:"base64"};null!=A&&(d.last_commit_id=A,G="PUT");f=this.baseUrl+"/projects/"+encodeURIComponent(f+"/"+k)+"/repository/files/"+-encodeURIComponent(p);G=new mxXmlRequest(f,JSON.stringify(d),G);this.executeRequest(G,mxUtils.bind(this,function(E){J(E)}),I)}};GitLabClient.prototype.saveFile=function(f,k,d,p,q){var u=f.meta.org,A=f.meta.repo,J=f.meta.ref,I=f.meta.path,G=mxUtils.bind(this,function(c,g){this.writeFile(u,A,J,I,q,g,c,mxUtils.bind(this,function(l){delete f.meta.isNew;this.getFile(u+"/"+A+"/"+J+"/"+I,mxUtils.bind(this,function(n){n.getData()==f.getData()?k(n.getCurrentEtag()):k({content:f.getCurrentEtag()})}),d,null,-null,f.meta.refPos)}),d)}),E=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(I)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(g){G(f.meta.last_commit_id,g)}),d,this.ui.getCurrentFile()!=f?f.getData():null,c.scale,c.border)}else G(f.meta.last_commit_id,Base64.encode(f.getData()))});p?this.getFile(u+"/"+A+"/"+J+"/"+I,mxUtils.bind(this,function(c){f.meta.last_commit_id=c.meta.last_commit_id;E()}),d):E()};GitLabClient.prototype.pickFolder=-function(f){this.showGitLabDialog(!1,f,!0)};GitLabClient.prototype.pickFile=function(f){f=null!=f?f:mxUtils.bind(this,function(k){this.ui.loadFile("A"+encodeURIComponent(k))});this.showGitLabDialog(!0,f)};GitLabClient.prototype.showGitLabDialog=function(f,k,d){var p=null,q=null,u=null,A=null,J=document.createElement("div");J.style.whiteSpace="nowrap";J.style.overflow="hidden";J.style.height="304px";var I=document.createElement("h3");mxUtils.write(I,mxResources.get(f?"selectFile":"selectFolder"));-I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";J.appendChild(I);var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.border="1px solid lightgray";G.style.boxSizing="border-box";G.style.padding="4px";G.style.overflow="auto";G.style.lineHeight="1.2em";G.style.height="274px";J.appendChild(G);var E=document.createElement("div");E.style.textOverflow="ellipsis";E.style.boxSizing="border-box";E.style.overflow="hidden";E.style.padding="4px";E.style.width=-"100%";var c=new CustomDialog(this.ui,J,mxUtils.bind(this,function(){k(p+"/"+q+"/"+encodeURIComponent(u)+"/"+A)}));this.ui.showDialog(c.container,420,370,!0,!0);f&&c.okButton.parentNode.removeChild(c.okButton);var g=mxUtils.bind(this,function(D,U,S,V){var t=document.createElement("a");t.setAttribute("title",D);t.style.cursor="pointer";mxUtils.write(t,D);mxEvent.addListener(t,"click",U);V&&(t.style.textDecoration="underline");null!=S&&(D=E.cloneNode(),D.style.padding=S,D.appendChild(t),t=D);return t}),-l=mxUtils.bind(this,function(D){var U=document.createElement("div");U.style.marginBottom="8px";U.appendChild(g(p+"/"+q,mxUtils.bind(this,function(){A=null;H()}),null,!0));D||(mxUtils.write(U," / "),U.appendChild(g(decodeURIComponent(u),mxUtils.bind(this,function(){A=null;C()}),null,!0)));if(null!=A&&0<A.length){var S=A.split("/");for(D=0;D<S.length;D++)(function(V){mxUtils.write(U," / ");U.appendChild(g(S[V],mxUtils.bind(this,function(){A=S.slice(0,V+1).join("/");B()}),null,!0))})(D)}G.appendChild(U)}),-n=mxUtils.bind(this,function(D){this.ui.handleError(D,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(A=u=q=p=null,H()):this.ui.hideDialog()}))}),v=null,x=null,B=mxUtils.bind(this,function(D){null==D&&(G.innerText="",D=1);var U=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(p+"/"+q)+"/repository/tree?path="+A+"&ref="+u+"&per_page=100&page="+D,null,"GET");this.ui.spinner.spin(G,mxResources.get("loading"));c.okButton.removeAttribute("disabled");null!=x&&-(mxEvent.removeListener(G,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var S=mxUtils.bind(this,function(){B(D+1)});mxEvent.addListener(v,"click",S);this.executeRequest(U,mxUtils.bind(this,function(V){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==D&&(l(!u),G.appendChild(g("../ [Up]",mxUtils.bind(this,function(){if(""==-A||null==A)A=null,H();else{var M=A.split("/");A=M.slice(0,M.length-1).join("/");B()}}),"4px")));var t=JSON.parse(V.getText());if(null==t||0==t.length)d||(mxUtils.br(G),mxUtils.write(G,mxResources.get("noFiles")));else{var z=!0,L=0,K=mxUtils.bind(this,function(M){for(var m=0;m<t.length;m++)mxUtils.bind(this,function(y){if(M==("tree"==y.type)){var F=E.cloneNode();F.style.backgroundColor=z?Editor.isDarkMode()?"#000000":"#eeeeee":"";z=!z;var N=document.createElement("img");N.src=IMAGE_PATH+"/"+("tree"==-y.type?"folder.png":"file.png");N.setAttribute("align","absmiddle");N.style.marginRight="4px";N.style.marginTop="-4px";N.width=20;F.appendChild(N);F.appendChild(g(y.name+("tree"==y.type?"/":""),mxUtils.bind(this,function(){"tree"==y.type?(A=y.path,B()):f&&"blob"==y.type&&(this.ui.hideDialog(),k(p+"/"+q+"/"+u+"/"+y.path))})));G.appendChild(F);L++}})(t[m])});K(!0);f&&K(!1);100==L&&(G.appendChild(v),x=function(){G.scrollTop>=G.scrollHeight-G.offsetHeight&&S()},mxEvent.addListener(G,"scroll",x))}}))}),-n,!0)}),C=mxUtils.bind(this,function(D,U){null==D&&(G.innerText="",D=1);var S=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(p+"/"+q)+"/repository/branches?per_page=100&page="+D,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(G,mxResources.get("loading"));null!=x&&(mxEvent.removeListener(G,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,-mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){C(D+1)});mxEvent.addListener(v,"click",V);this.executeRequest(S,mxUtils.bind(this,function(t){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==D&&(l(!0),G.appendChild(g("../ [Up]",mxUtils.bind(this,function(){A=null;H()}),"4px")));var z=JSON.parse(t.getText());if(null==z||0==z.length)mxUtils.br(G),mxUtils.write(G,mxResources.get("repositoryNotFound"));else if(1==z.length&&U)u=z[0].name,A="",B();else{for(var L=-0;L<z.length;L++)mxUtils.bind(this,function(K,M){var m=E.cloneNode();m.style.backgroundColor=0==M%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";m.appendChild(g(K.name,mxUtils.bind(this,function(){u=encodeURIComponent(K.name);A="";B()})));G.appendChild(m)})(z[L],L);100==z.length&&(G.appendChild(v),x=function(){G.scrollTop>=G.scrollHeight-G.offsetHeight&&V()},mxEvent.addListener(G,"scroll",x))}}))}),n)});c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(G,mxResources.get("loading"));-var H=mxUtils.bind(this,function(D){var U=this.ui.spinner,S=0;this.ui.spinner.stop();var V=function(){U.spin(G,mxResources.get("loading"));S+=1},t=function(){--S;0===S&&U.stop()};null==D&&(G.innerText="",D=1);null!=x&&(mxEvent.removeListener(G,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var z=mxUtils.bind(this,function(){0===S&&H(D+1)});mxEvent.addListener(v,-"click",z);var L=mxUtils.bind(this,function(M){V();var m=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(m,mxUtils.bind(this,function(y){this.ui.tryAndHandle(mxUtils.bind(this,function(){M(JSON.parse(y.getText()));t()}))}),n)}),K=mxUtils.bind(this,function(M,m){V();var y=new mxXmlRequest(this.baseUrl+"/groups/"+M.id+"/projects?per_page=100",null,"GET");this.executeRequest(y,mxUtils.bind(this,function(F){this.ui.tryAndHandle(mxUtils.bind(this,function(){404==F.getStatus()?-m(M,[]):m(M,JSON.parse(F.getText()));t()}))}),n,!0)});L(mxUtils.bind(this,function(M){if(null==this.user)mxUtils.write(G,mxResources.get("loggedOut"));else{V();var m=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+D,null,"GET");this.executeRequest(m,mxUtils.bind(this,function(y){y=JSON.parse(y.getText());if(null!=y&&0!=y.length||null!=M&&0!=M.length){1==D&&(G.appendChild(g(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){if(0===S){var O=new FilenameDialog(this.ui,-"group/project",mxResources.get("ok"),mxUtils.bind(this,function(P){null!=P&&(P=P.split("/"),1<P.length?(p=P.slice(0,P.length-1).join("/"),q=P[P.length-1],A="",C(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(O.container,300,80,!0,!1);O.init()}}))),mxUtils.br(G),mxUtils.br(G));for(var F=!0,N=0;N<y.length;N++)mxUtils.bind(this,function(O){var P=E.cloneNode();P.style.backgroundColor=F?Editor.isDarkMode()?-"#000000":"#eeeeee":"";F=!F;P.appendChild(g(O.name_with_namespace,mxUtils.bind(this,function(){0===S&&(p=O.owner.username,q=O.path,A="",C(null,!0))})));G.appendChild(P)})(y[N]);for(N=0;N<M.length;N++)V(),K(M[N],mxUtils.bind(this,function(O,P){t();for(var T=0;T<P.length;T++){var Q=E.cloneNode();Q.style.backgroundColor=F?Editor.isDarkMode()?"#000000":"#eeeeee":"";F=!F;mxUtils.bind(this,function(R){Q.appendChild(g(R.name_with_namespace,mxUtils.bind(this,function(){0===S&&(p=O.full_path,q=R.path,A="",-C(null,!0))})));G.appendChild(Q)})(P[T])}}));t()}else t(),mxUtils.br(G),mxUtils.write(G,mxResources.get("repositoryNotFound"));100==y.length&&(G.appendChild(v),x=function(){G.scrollTop>=G.scrollHeight-G.offsetHeight&&z()},mxEvent.addListener(G,"scroll",x))}),n)}}))});b?this.user?H():this.updateUser(function(){H()},n,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){H()},n,!0)}),n)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="++ref:d,name:p.file_name,path:p.file_path,html_url:A+f+"/"+k+"/blob/"+d+"/"+p.file_path,download_url:A+f+"/"+k+"/raw/"+d+"/"+p.file_path+"?inline=false",last_commit_id:p.last_commit_id,refPos:u};p=this.getFileContent(p);return q?new GitLabLibrary(this.ui,p,f):new GitLabFile(this.ui,p,f)};GitLabClient.prototype.insertFile=function(f,k,d,p,q,u,A){q=null!=q?q:!1;u=u.split("/");this.getRefIndex(u,!0,mxUtils.bind(this,function(I,H){var F=Math.max(H-1,0),D=I.slice(0,F).join("/"),c=I[F],g=I[H];path=I.slice(H++1,I.length).join("/");0<path.length&&(path+="/");path+=f;this.checkExists(D+"/"+c+"/"+g+"/"+path,!0,mxUtils.bind(this,function(l,n){l?q?(A||(k=Base64.encode(k)),this.showCommitDialog(f,!0,mxUtils.bind(this,function(v){this.writeFile(D,c,g,path,v,k,n,mxUtils.bind(this,function(x){try{var B=JSON.parse(x.getText());d(this.createGitLabFile(D,c,g,null!=B.content?B.content:B,q,H))}catch(C){p(C)}}),p)}),p)):(l=DRAWIO_GITLAB_URL+"/",d(new GitLabFile(this.ui,k,{org:D,repo:c,ref:g,name:f,path:path,html_url:l++D+"/"+c+"/blob/"+g+"/"+path,download_url:l+D+"/"+c+"/raw/"+g+"/"+path+"?inline=false",refPos:H,last_commit_id:n,isNew:!0}))):p()}))}),p,null,4>=u.length)};GitLabClient.prototype.checkExists=function(f,k,d){this.getFile(f,mxUtils.bind(this,function(p){if(k){var q=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[f]),function(){q();d(!0,p.getCurrentEtag())},function(){q();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),+mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(p){d(!0)}),null,!0)};GitLabClient.prototype.writeFile=function(f,k,d,p,q,u,A,I,H){if(u.length>=this.maxFileSize)H({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(u.length)+" / 10 MB)"});else{var F="POST";d={path:encodeURIComponent(p),branch:decodeURIComponent(d),commit_message:q,content:u,encoding:"base64"};null!=A&&(d.last_commit_id=A,F="PUT");f=this.baseUrl+"/projects/"+encodeURIComponent(f+"/"+k)+"/repository/files/"++encodeURIComponent(p);F=new mxXmlRequest(f,JSON.stringify(d),F);this.executeRequest(F,mxUtils.bind(this,function(D){I(D)}),H)}};GitLabClient.prototype.saveFile=function(f,k,d,p,q){var u=f.meta.org,A=f.meta.repo,I=f.meta.ref,H=f.meta.path,F=mxUtils.bind(this,function(c,g){this.writeFile(u,A,I,H,q,g,c,mxUtils.bind(this,function(l){delete f.meta.isNew;this.getFile(u+"/"+A+"/"+I+"/"+H,mxUtils.bind(this,function(n){n.getData()==f.getData()?k(n.getCurrentEtag()):k({content:f.getCurrentEtag()})}),d,null,+null,f.meta.refPos)}),d)}),D=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(H)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(g){F(f.meta.last_commit_id,g)}),d,this.ui.getCurrentFile()!=f?f.getData():null,c.scale,c.border)}else F(f.meta.last_commit_id,Base64.encode(f.getData()))});p?this.getFile(u+"/"+A+"/"+I+"/"+H,mxUtils.bind(this,function(c){f.meta.last_commit_id=c.meta.last_commit_id;D()}),d):D()};GitLabClient.prototype.pickFolder=+function(f){this.showGitLabDialog(!1,f,!0)};GitLabClient.prototype.pickFile=function(f){f=null!=f?f:mxUtils.bind(this,function(k){this.ui.loadFile("A"+encodeURIComponent(k))});this.showGitLabDialog(!0,f)};GitLabClient.prototype.showGitLabDialog=function(f,k,d){var p=null,q=null,u=null,A=null,I=document.createElement("div");I.style.whiteSpace="nowrap";I.style.overflow="hidden";I.style.height="304px";var H=document.createElement("h3");mxUtils.write(H,mxResources.get(f?"selectFile":"selectFolder"));+H.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";I.appendChild(H);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.border="1px solid lightgray";F.style.boxSizing="border-box";F.style.padding="4px";F.style.overflow="auto";F.style.lineHeight="1.2em";F.style.height="274px";I.appendChild(F);var D=document.createElement("div");D.style.textOverflow="ellipsis";D.style.boxSizing="border-box";D.style.overflow="hidden";D.style.padding="4px";D.style.width=+"100%";var c=new CustomDialog(this.ui,I,mxUtils.bind(this,function(){k(p+"/"+q+"/"+encodeURIComponent(u)+"/"+A)}));this.ui.showDialog(c.container,420,370,!0,!0);f&&c.okButton.parentNode.removeChild(c.okButton);var g=mxUtils.bind(this,function(N,J,T,V){var t=document.createElement("a");t.setAttribute("title",N);t.style.cursor="pointer";mxUtils.write(t,N);mxEvent.addListener(t,"click",J);V&&(t.style.textDecoration="underline");null!=T&&(N=D.cloneNode(),N.style.padding=T,N.appendChild(t),t=N);return t}),+l=mxUtils.bind(this,function(N){var J=document.createElement("div");J.style.marginBottom="8px";J.appendChild(g(p+"/"+q,mxUtils.bind(this,function(){A=null;G()}),null,!0));N||(mxUtils.write(J," / "),J.appendChild(g(decodeURIComponent(u),mxUtils.bind(this,function(){A=null;C()}),null,!0)));if(null!=A&&0<A.length){var T=A.split("/");for(N=0;N<T.length;N++)(function(V){mxUtils.write(J," / ");J.appendChild(g(T[V],mxUtils.bind(this,function(){A=T.slice(0,V+1).join("/");B()}),null,!0))})(N)}F.appendChild(J)}),+n=mxUtils.bind(this,function(N){this.ui.handleError(N,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(A=u=q=p=null,G()):this.ui.hideDialog()}))}),v=null,x=null,B=mxUtils.bind(this,function(N){null==N&&(F.innerText="",N=1);var J=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(p+"/"+q)+"/repository/tree?path="+A+"&ref="+u+"&per_page=100&page="+N,null,"GET");this.ui.spinner.spin(F,mxResources.get("loading"));c.okButton.removeAttribute("disabled");null!=x&&+(mxEvent.removeListener(F,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){B(N+1)});mxEvent.addListener(v,"click",T);this.executeRequest(J,mxUtils.bind(this,function(V){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==N&&(l(!u),F.appendChild(g("../ [Up]",mxUtils.bind(this,function(){if(""==+A||null==A)A=null,G();else{var M=A.split("/");A=M.slice(0,M.length-1).join("/");B()}}),"4px")));var t=JSON.parse(V.getText());if(null==t||0==t.length)d||(mxUtils.br(F),mxUtils.write(F,mxResources.get("noFiles")));else{var z=!0,L=0,K=mxUtils.bind(this,function(M){for(var m=0;m<t.length;m++)mxUtils.bind(this,function(y){if(M==("tree"==y.type)){var E=D.cloneNode();E.style.backgroundColor=z?Editor.isDarkMode()?"#000000":"#eeeeee":"";z=!z;var P=document.createElement("img");P.src=IMAGE_PATH+"/"+("tree"==+y.type?"folder.png":"file.png");P.setAttribute("align","absmiddle");P.style.marginRight="4px";P.style.marginTop="-4px";P.width=20;E.appendChild(P);E.appendChild(g(y.name+("tree"==y.type?"/":""),mxUtils.bind(this,function(){"tree"==y.type?(A=y.path,B()):f&&"blob"==y.type&&(this.ui.hideDialog(),k(p+"/"+q+"/"+u+"/"+y.path))})));F.appendChild(E);L++}})(t[m])});K(!0);f&&K(!1);100==L&&(F.appendChild(v),x=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&T()},mxEvent.addListener(F,"scroll",x))}}))}),+n,!0)}),C=mxUtils.bind(this,function(N,J){null==N&&(F.innerText="",N=1);var T=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(p+"/"+q)+"/repository/branches?per_page=100&page="+N,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(F,mxResources.get("loading"));null!=x&&(mxEvent.removeListener(F,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,+mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){C(N+1)});mxEvent.addListener(v,"click",V);this.executeRequest(T,mxUtils.bind(this,function(t){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==N&&(l(!0),F.appendChild(g("../ [Up]",mxUtils.bind(this,function(){A=null;G()}),"4px")));var z=JSON.parse(t.getText());if(null==z||0==z.length)mxUtils.br(F),mxUtils.write(F,mxResources.get("repositoryNotFound"));else if(1==z.length&&J)u=z[0].name,A="",B();else{for(var L=+0;L<z.length;L++)mxUtils.bind(this,function(K,M){var m=D.cloneNode();m.style.backgroundColor=0==M%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";m.appendChild(g(K.name,mxUtils.bind(this,function(){u=encodeURIComponent(K.name);A="";B()})));F.appendChild(m)})(z[L],L);100==z.length&&(F.appendChild(v),x=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&V()},mxEvent.addListener(F,"scroll",x))}}))}),n)});c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(F,mxResources.get("loading"));+var G=mxUtils.bind(this,function(N){var J=this.ui.spinner,T=0;this.ui.spinner.stop();var V=function(){J.spin(F,mxResources.get("loading"));T+=1},t=function(){--T;0===T&&J.stop()};null==N&&(F.innerText="",N=1);null!=x&&(mxEvent.removeListener(F,"scroll",x),x=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.style.cursor="pointer";mxUtils.write(v,mxResources.get("more")+"...");var z=mxUtils.bind(this,function(){0===T&&G(N+1)});mxEvent.addListener(v,+"click",z);var L=mxUtils.bind(this,function(M){V();var m=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(m,mxUtils.bind(this,function(y){this.ui.tryAndHandle(mxUtils.bind(this,function(){M(JSON.parse(y.getText()));t()}))}),n)}),K=mxUtils.bind(this,function(M,m){V();var y=new mxXmlRequest(this.baseUrl+"/groups/"+M.id+"/projects?per_page=100",null,"GET");this.executeRequest(y,mxUtils.bind(this,function(E){this.ui.tryAndHandle(mxUtils.bind(this,function(){404==E.getStatus()?+m(M,[]):m(M,JSON.parse(E.getText()));t()}))}),n,!0)});L(mxUtils.bind(this,function(M){if(null==this.user)mxUtils.write(F,mxResources.get("loggedOut"));else{V();var m=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+N,null,"GET");this.executeRequest(m,mxUtils.bind(this,function(y){y=JSON.parse(y.getText());if(null!=y&&0!=y.length||null!=M&&0!=M.length){1==N&&(F.appendChild(g(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){if(0===T){var O=new FilenameDialog(this.ui,+"group/project",mxResources.get("ok"),mxUtils.bind(this,function(Q){null!=Q&&(Q=Q.split("/"),1<Q.length?(p=Q.slice(0,Q.length-1).join("/"),q=Q[Q.length-1],A="",C(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(O.container,300,80,!0,!1);O.init()}}))),mxUtils.br(F),mxUtils.br(F));for(var E=!0,P=0;P<y.length;P++)mxUtils.bind(this,function(O){var Q=D.cloneNode();Q.style.backgroundColor=E?Editor.isDarkMode()?+"#000000":"#eeeeee":"";E=!E;Q.appendChild(g(O.name_with_namespace,mxUtils.bind(this,function(){0===T&&(p=O.owner.username,q=O.path,A="",C(null,!0))})));F.appendChild(Q)})(y[P]);for(P=0;P<M.length;P++)V(),K(M[P],mxUtils.bind(this,function(O,Q){t();for(var U=0;U<Q.length;U++){var R=D.cloneNode();R.style.backgroundColor=E?Editor.isDarkMode()?"#000000":"#eeeeee":"";E=!E;mxUtils.bind(this,function(S){R.appendChild(g(S.name_with_namespace,mxUtils.bind(this,function(){0===T&&(p=O.full_path,q=S.path,A="",+C(null,!0))})));F.appendChild(R)})(Q[U])}}));t()}else t(),mxUtils.br(F),mxUtils.write(F,mxResources.get("repositoryNotFound"));100==y.length&&(F.appendChild(v),x=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&z()},mxEvent.addListener(F,"scroll",x))}),n)}}))});b?this.user?G():this.updateUser(function(){G()},n,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){G()},n,!0)}),n)};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,f,k,d,p,q,u){this.file=b;this.id=f;this.content=k;this.modifiedDate=d;this.createdDate=p;this.isResolved=q;this.user=u;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,f,k,d,p){f()};DrawioComment.prototype.editComment=function(b,f,k){f()};DrawioComment.prototype.deleteComment=function(b,f){b()};DriveComment=function(b,f,k,d,p,q,u,A){DrawioComment.call(this,b,f,k,d,p,q,u);this.pCommentId=A};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(b,f,k,d,p){b={content:b.content};d?b.verb="resolve":p&&(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(q){f(q.replyId)}),k)};DriveComment.prototype.editComment=function(b,f,k){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"},f,k)};-DriveComment.prototype.deleteComment=function(b,f){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,f)};function mxODPicker(b,f,k,d,p,q,u,A,J,I,G,E,c,g){function l(W,X){X=X||document;return X.querySelector(W)}function n(W,X,Y){if(null==W["@microsoft.graph.downloadUrl"])if(null==W.parentReference)Y();else{d(W.id,W.parentReference.driveId,function(ea){n(ea,X,Y)},Y);return}var Z=new XMLHttpRequest;Z.open("GET",W["@microsoft.graph.downloadUrl"]);var ba=W.file?"image/png"==W.file.mimeType:!1;Z.onreadystatechange=function(){if(4==this.readyState){if(200<=this.status&&299>=this.status)try{var ea=Z.responseText;-ba?(ea="data:image/png;base64,"+Editor.base64Encode(ea),ea=Editor.extractGraphModelFromPng(ea)):/\.pdf$/.test(W.name)&&(ea="data:application/pdf;base64,"+Editor.base64Encode(ea),ea=Editor.extractGraphModelFromPdf(ea));var ha=mxUtils.parseXml(ea),fa="mxlibrary"==ha.documentElement.nodeName?ha.documentElement:Editor.extractGraphModel(ha.documentElement);if(null!=fa){X(fa.ownerDocument);return}}catch(la){}Y()}};(ba||/\.pdf$/.test(W.name))&&Z.overrideMimeType&&Z.overrideMimeType("text/plain; charset=x-user-defined");-Z.send()}function v(){E&&null!=L?z.exportToCanvas(function(W){W=EditorUi.prototype.createImageDataUri(W,null,"png");u(K,W);q(K)},400,null,null,function(W){console.log(W)},600,null,null,null,null,null,L):(u(K,void 0),q(K))}function x(W){function X(Y){T.style.background="transparent";T.innerText="";var Z=document.createElement("div");Z.className="odPreviewStatus";mxUtils.write(Z,Y);T.appendChild(Z);t.stop()}if(null!=T)if(T.style.background="transparent",T.innerText="",null==W||W.folder||/\.drawiolib$/.test(W.name))X(mxResources.get("noPreview"));-else try{null!=W.remoteItem&&(W=W.remoteItem),N=W,t.spin(T),n(W,function(Y){t.stop();if(N==W)if("mxlibrary"==Y.documentElement.nodeName)X(mxResources.get("noPreview"));else{var Z=Y.getElementsByTagName("diagram");L=AspectDialog.prototype.createViewer(T,0==Z.length?Y.documentElement:Z[0],null,"transparent")}},function(){K=null;X(mxResources.get("notADiagramFile"))})}catch(Y){K=null,X(mxResources.get("notADiagramFile"))}}function B(){var W=l(".odFilesBreadcrumb");if(null!=W){W.innerText="";for(var X=-0;X<y.length-1;X++){var Y=document.createElement("span");Y.className="odBCFolder";Y.innerHTML=mxUtils.htmlEntities(y[X].name||mxResources.get("home"));W.appendChild(Y);(function(ba,ea){Y.addEventListener("click",function(){f(null);y=y.slice(0,ea);H(ba.driveId,ba.folderId,ba.siteId,ba.name)})})(y[X],X);var Z=document.createElement("span");Z.innerHTML=" > ";W.appendChild(Z)}null!=y[y.length-1]&&(X=document.createElement("span"),X.innerHTML=mxUtils.htmlEntities(1==y.length?mxResources.get(J?"selectFolder":-"officeSelDiag"):y[y.length-1].name||mxResources.get("home")),W.appendChild(X))}}function C(){if(null!=K&&!m)if("sharepoint"==M)H("site",null,K.id,K.displayName);else if("site"==M)H("subsite",null,K.id,K.name);else{var W=K.folder;K=K.remoteItem?K.remoteItem:K;var X=(K.parentReference?K.parentReference.driveId:null)||M,Y=K.id;W?H(X,Y,null,K.name):v()}}function H(W,X,Y,Z,ba){function ea(ua){t.stop();var xa=document.createElement("table");xa.className="odFileListGrid";for(var ra=null,aa=0,na=0;null!=-ua&&na<ua.length;na++){var ja=ua[na];if(1!=la||!ja.webUrl||0<ja.webUrl.indexOf("sharepoint.com/sites/")||0>ja.webUrl.indexOf("sharepoint.com/")){var sa=ja.displayName||ja.name,Ca=mxUtils.htmlEntities(ja.description||sa);la&&(ja.folder=2==la?{isRoot:!0}:!0);var Fa=null!=ja.folder;if(!J||Fa){var Ba=document.createElement("tr");Ba.className=aa++%2?"odOddRow":"odEvenRow";var da=document.createElement("td");da.style.width="36px";var ca=document.createElement("img");ca.src="/images/"+(Fa?"folder.png":"file.png");-ca.className="odFileImg";da.appendChild(ca);Ba.appendChild(da);da=document.createElement("td");Fa=document.createElement("div");Fa.className="odFileTitle";Fa.innerHTML=mxUtils.htmlEntities(sa);Fa.setAttribute("title",Ca);da.appendChild(Fa);Ba.appendChild(da);xa.appendChild(Ba);null==ra&&(ra=Ba,ra.className+=" odRowSelected",K=ja,M=W,g||f(K));(function(wa,ka){Ba.addEventListener("dblclick",C);Ba.addEventListener("click",function(){ra!=ka&&(ra.className=ra.className.replace("odRowSelected",""),ra=ka,-ra.className+=" odRowSelected",K=wa,M=W,g||f(K))})})(ja,Ba)}}}0==aa?(ua=document.createElement("div"),ua.className="odEmptyFolder",ua.innerHTML=mxUtils.htmlEntities(mxResources.get("folderEmpty",null,"Folder is empty!")),pa.appendChild(ua)):pa.appendChild(xa);B();m=!1}function ha(ua){k(ua?ua:ia,function(xa){if(fa){var ra=xa.value||[];if(g||la)Array.prototype.push.apply(qa,ra);else{for(var aa=0;aa<ra.length;aa++){var na=ra[aa],ja=na.file?na.file.mimeType:null;(na.folder||"text/html"==ja||"text/xml"==-ja||"application/xml"==ja||"image/png"==ja||/\.svg$/.test(na.name)||/\.html$/.test(na.name)||/\.xml$/.test(na.name)||/\.png$/.test(na.name)||/\.drawio$/.test(na.name)||/\.drawiolib$/.test(na.name)||/\.pdf$/.test(na.name))&&qa.push(na)}qa.sort(function(sa,Ca){var Fa=sa.name.toLowerCase(),Ba=Ca.name.toLowerCase();return sa.folder&&!Ca.folder?-1:!sa.folder&&Ca.folder?1:Fa<Ba?-1:Fa>Ba?1:0})}xa["@odata.nextLink"]&&1E3>qa.length?ha(xa["@odata.nextLink"]):(clearTimeout(oa),ea(qa))}},function(xa){if(fa){clearTimeout(oa);-var ra=null;try{ra=JSON.parse(xa.responseText).error.message}catch(aa){}A(mxResources.get("errorFetchingFolder",null,"Error fetching folder items")+(null!=ra?" ("+ra+")":""));m=!1;t.stop()}},null!=ua)}if(!m){l(".odCatsList").style.display="block";l(".odFilesSec").style.display="block";null!=T&&(T.innerText="",T.style.top="50%");var fa=m=!0,la=0;F=arguments;var oa=setTimeout(function(){m=fa=!1;t.stop();A(mxResources.get("timeout"))},2E4),pa=l(".odFilesList");pa.innerText="";t.spin(pa);switch(W){case "recent":y=-[{name:mxResources.get("recent",null,"Recent"),driveId:W}];var va=p()||{},ta=[],ma;for(ma in va)ta.push(va[ma]);clearTimeout(oa);ea(ta);return;case "shared":var ia="/me/drive/sharedWithMe";y=[{name:mxResources.get("sharedWithMe",null,"Shared With Me"),driveId:W}];break;case "sharepoint":ia="/sites?search=";y=[{name:mxResources.get("sharepointSites",null,"Sharepoint Sites"),driveId:W}];la=1;break;case "site":y.push({name:Z,driveId:W,folderId:X,siteId:Y});ia="/sites/"+Y+"/drives";la=2;break;case "subsite":y.push({name:Z,-driveId:W,folderId:X,siteId:Y});ia="/drives/"+Y+(X?"/items/"+X:"/root")+"/children";break;case "search":W=M;y=[{driveId:W,name:mxResources.get("back",null,"Back")}];ba=encodeURIComponent(ba.replace(/'/g,"\\'"));ia=W?"/drives/"+W+"/root/search(q='"+ba+"')":"/me/drive/root/search(q='"+ba+"')";break;default:null==X?y=[{driveId:W}]:y.push({name:Z,driveId:W,folderId:X}),ia=(W?"/drives/"+W:"/me/drive")+(X?"/items/"+X:"/root")+"/children"}la||(ia+=(0<ia.indexOf("?")?"&":"?")+"select=id,name,description,parentReference,file,createdBy,lastModifiedBy,lastModifiedDateTime,size,folder,remoteItem,@microsoft.graph.downloadUrl");-var qa=[];ha()}}function D(W){Q.className=Q.className.replace("odCatSelected","");Q=W;Q.className+=" odCatSelected"}function U(W){m||(R=null,H("search",null,null,null,W))}var S="";null==f&&(f=x,S='<div style="text-align: center;" class="odPreview"></div>');null==p&&(p=function(){var W=null;try{W=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(X){}return W});null==q&&(q=function(W){if(null!=W){var X=p()||{};delete W["@microsoft.graph.downloadUrl"];X[W.id]=W;localStorage.setItem("mxODPickerRecentList",-JSON.stringify(X))}});S='<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>'+S+(I?'<div id="odBackBtn" class="odLinkBtn">< '+mxUtils.htmlEntities(mxResources.get("back"))+"</div>":"")+(G?'<button id="odSubmitBtn" class="odSubmitBtn">'+-mxUtils.htmlEntities(mxResources.get(J?"select":"open"))+"</button>":"");var V=null!=window.Editor&&null!=Editor.isDarkMode&&Editor.isDarkMode();V=".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 {"++DriveComment.prototype.deleteComment=function(b,f){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,f)};function mxODPicker(b,f,k,d,p,q,u,A,I,H,F,D,c,g){function l(W,X){X=X||document;return X.querySelector(W)}function n(W,X,Y){if(null==W["@microsoft.graph.downloadUrl"])if(null==W.parentReference)Y();else{d(W.id,W.parentReference.driveId,function(fa){n(fa,X,Y)},Y);return}var Z=new XMLHttpRequest;Z.open("GET",W["@microsoft.graph.downloadUrl"]);var aa=W.file?"image/png"==W.file.mimeType:!1;Z.onreadystatechange=function(){if(4==this.readyState){if(200<=this.status&&299>=this.status)try{var fa=Z.responseText;+aa?(fa="data:image/png;base64,"+Editor.base64Encode(fa),fa=Editor.extractGraphModelFromPng(fa)):/\.pdf$/.test(W.name)&&(fa="data:application/pdf;base64,"+Editor.base64Encode(fa),fa=Editor.extractGraphModelFromPdf(fa));var ia=mxUtils.parseXml(fa),ea="mxlibrary"==ia.documentElement.nodeName?ia.documentElement:Editor.extractGraphModel(ia.documentElement);if(null!=ea){X(ea.ownerDocument);return}}catch(ma){}Y()}};(aa||/\.pdf$/.test(W.name))&&Z.overrideMimeType&&Z.overrideMimeType("text/plain; charset=x-user-defined");+Z.send()}function v(){D&&null!=L?z.exportToCanvas(function(W){W=EditorUi.prototype.createImageDataUri(W,null,"png");u(K,W);q(K)},400,null,null,function(W){console.log(W)},600,null,null,null,null,null,L):(u(K,void 0),q(K))}function x(W){function X(Y){U.style.background="transparent";U.innerText="";var Z=document.createElement("div");Z.className="odPreviewStatus";mxUtils.write(Z,Y);U.appendChild(Z);t.stop()}if(null!=U)if(U.style.background="transparent",U.innerText="",null==W||W.folder||/\.drawiolib$/.test(W.name))X(mxResources.get("noPreview"));+else try{null!=W.remoteItem&&(W=W.remoteItem),P=W,t.spin(U),n(W,function(Y){t.stop();if(P==W)if("mxlibrary"==Y.documentElement.nodeName)X(mxResources.get("noPreview"));else{var Z=Y.getElementsByTagName("diagram");L=AspectDialog.prototype.createViewer(U,0==Z.length?Y.documentElement:Z[0],null,"transparent")}},function(){K=null;X(mxResources.get("notADiagramFile"))})}catch(Y){K=null,X(mxResources.get("notADiagramFile"))}}function B(){var W=l(".odFilesBreadcrumb");if(null!=W){W.innerText="";for(var X=+0;X<y.length-1;X++){var Y=document.createElement("span");Y.className="odBCFolder";Y.innerHTML=mxUtils.htmlEntities(y[X].name||mxResources.get("home"));W.appendChild(Y);(function(aa,fa){Y.addEventListener("click",function(){f(null);y=y.slice(0,fa);G(aa.driveId,aa.folderId,aa.siteId,aa.name)})})(y[X],X);var Z=document.createElement("span");Z.innerHTML=" > ";W.appendChild(Z)}null!=y[y.length-1]&&(X=document.createElement("span"),X.innerHTML=mxUtils.htmlEntities(1==y.length?mxResources.get(I?"selectFolder":+"officeSelDiag"):y[y.length-1].name||mxResources.get("home")),W.appendChild(X))}}function C(){if(null!=K&&!m)if("sharepoint"==M)G("site",null,K.id,K.displayName);else if("site"==M)G("subsite",null,K.id,K.name);else{var W=K.folder;K=K.remoteItem?K.remoteItem:K;var X=(K.parentReference?K.parentReference.driveId:null)||M,Y=K.id;W?G(X,Y,null,K.name):v()}}function G(W,X,Y,Z,aa){function fa(va){t.stop();var ya=document.createElement("table");ya.className="odFileListGrid";for(var ra=null,ha=0,Da=0;null!=+va&&Da<va.length;Da++){var oa=va[Da];if(1!=ma||!oa.webUrl||0<oa.webUrl.indexOf("sharepoint.com/sites/")||0>oa.webUrl.indexOf("sharepoint.com/")){var ba=oa.displayName||oa.name,pa=mxUtils.htmlEntities(oa.description||ba);ma&&(oa.folder=2==ma?{isRoot:!0}:!0);var Ba=null!=oa.folder;if(!I||Ba){var xa=document.createElement("tr");xa.className=ha++%2?"odOddRow":"odEvenRow";var ca=document.createElement("td");ca.style.width="36px";var da=document.createElement("img");da.src="/images/"+(Ba?"folder.png":"file.png");+da.className="odFileImg";ca.appendChild(da);xa.appendChild(ca);ca=document.createElement("td");Ba=document.createElement("div");Ba.className="odFileTitle";Ba.innerHTML=mxUtils.htmlEntities(ba);Ba.setAttribute("title",pa);ca.appendChild(Ba);xa.appendChild(ca);ya.appendChild(xa);null==ra&&(ra=xa,ra.className+=" odRowSelected",K=oa,M=W,g||f(K));(function(wa,ka){xa.addEventListener("dblclick",C);xa.addEventListener("click",function(){ra!=ka&&(ra.className=ra.className.replace("odRowSelected",""),ra=ka,+ra.className+=" odRowSelected",K=wa,M=W,g||f(K))})})(oa,xa)}}}0==ha?(va=document.createElement("div"),va.className="odEmptyFolder",va.innerHTML=mxUtils.htmlEntities(mxResources.get("folderEmpty",null,"Folder is empty!")),ua.appendChild(va)):ua.appendChild(ya);B();m=!1}function ia(va){k(va?va:ja,function(ya){if(ea){var ra=ya.value||[];if(g||ma)Array.prototype.push.apply(qa,ra);else{for(var ha=0;ha<ra.length;ha++){var Da=ra[ha],oa=Da.file?Da.file.mimeType:null;(Da.folder||"text/html"==oa||"text/xml"==+oa||"application/xml"==oa||"image/png"==oa||/\.svg$/.test(Da.name)||/\.html$/.test(Da.name)||/\.xml$/.test(Da.name)||/\.png$/.test(Da.name)||/\.drawio$/.test(Da.name)||/\.drawiolib$/.test(Da.name)||/\.pdf$/.test(Da.name))&&qa.push(Da)}qa.sort(function(ba,pa){var Ba=ba.name.toLowerCase(),xa=pa.name.toLowerCase();return ba.folder&&!pa.folder?-1:!ba.folder&&pa.folder?1:Ba<xa?-1:Ba>xa?1:0})}ya["@odata.nextLink"]&&1E3>qa.length?ia(ya["@odata.nextLink"]):(clearTimeout(na),fa(qa))}},function(ya){if(ea){clearTimeout(na);+var ra=null;try{ra=JSON.parse(ya.responseText).error.message}catch(ha){}A(mxResources.get("errorFetchingFolder",null,"Error fetching folder items")+(null!=ra?" ("+ra+")":""));m=!1;t.stop()}},null!=va)}if(!m){l(".odCatsList").style.display="block";l(".odFilesSec").style.display="block";null!=U&&(U.innerText="",U.style.top="50%");var ea=m=!0,ma=0;E=arguments;var na=setTimeout(function(){m=ea=!1;t.stop();A(mxResources.get("timeout"))},2E4),ua=l(".odFilesList");ua.innerText="";t.spin(ua);switch(W){case "recent":y=+[{name:mxResources.get("recent",null,"Recent"),driveId:W}];var ta=p()||{},sa=[],la;for(la in ta)sa.push(ta[la]);clearTimeout(na);fa(sa);return;case "shared":var ja="/me/drive/sharedWithMe";y=[{name:mxResources.get("sharedWithMe",null,"Shared With Me"),driveId:W}];break;case "sharepoint":ja="/sites?search=";y=[{name:mxResources.get("sharepointSites",null,"Sharepoint Sites"),driveId:W}];ma=1;break;case "site":y.push({name:Z,driveId:W,folderId:X,siteId:Y});ja="/sites/"+Y+"/drives";ma=2;break;case "subsite":y.push({name:Z,+driveId:W,folderId:X,siteId:Y});ja="/drives/"+Y+(X?"/items/"+X:"/root")+"/children";break;case "search":W=M;y=[{driveId:W,name:mxResources.get("back",null,"Back")}];aa=encodeURIComponent(aa.replace(/'/g,"\\'"));ja=W?"/drives/"+W+"/root/search(q='"+aa+"')":"/me/drive/root/search(q='"+aa+"')";break;default:null==X?y=[{driveId:W}]:y.push({name:Z,driveId:W,folderId:X}),ja=(W?"/drives/"+W:"/me/drive")+(X?"/items/"+X:"/root")+"/children"}ma||(ja+=(0<ja.indexOf("?")?"&":"?")+"select=id,name,description,parentReference,file,createdBy,lastModifiedBy,lastModifiedDateTime,size,folder,remoteItem,@microsoft.graph.downloadUrl");+var qa=[];ia()}}function N(W){R.className=R.className.replace("odCatSelected","");R=W;R.className+=" odCatSelected"}function J(W){m||(S=null,G("search",null,null,null,W))}var T="";null==f&&(f=x,T='<div style="text-align: center;" class="odPreview"></div>');null==p&&(p=function(){var W=null;try{W=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(X){}return W});null==q&&(q=function(W){if(null!=W){var X=p()||{};delete W["@microsoft.graph.downloadUrl"];X[W.id]=W;localStorage.setItem("mxODPickerRecentList",+JSON.stringify(X))}});T='<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>'+T+(H?'<div id="odBackBtn" class="odLinkBtn">< '+mxUtils.htmlEntities(mxResources.get("back"))+"</div>":"")+(F?'<button id="odSubmitBtn" class="odSubmitBtn">'++mxUtils.htmlEntities(mxResources.get(I?"select":"open"))+"</button>":"");var V=null!=window.Editor&&null!=Editor.isDarkMode&&Editor.isDarkMode();V=".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 {"+(V?"":"\tbackground-color: #eeeeee;")+"}.odEvenRow {"+(V?"":"\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 t=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}),z=new Editor,L=null,K=null,M=null,m=!1,y=[],F=null,N=null;this.getSelectedItem=function(){null!=K&&q(K);return K};if(null==l("#mxODPickerCss")){var O=document.head||document.getElementsByTagName("head")[0],P=document.createElement("style");O.appendChild(P);P.type="text/css";P.id="mxODPickerCss";P.appendChild(document.createTextNode(V))}b.innerHTML=-S;var T=l(".odPreview"),Q=l("#odFiles");b=function(W,X){X=X||document;return X.querySelectorAll(W)}(".odCatListTitle");for(S=0;S<b.length;S++)b[S].addEventListener("click",function(){K=N=null;if(!m)switch(D(this),this.id){case "odFiles":H();break;case "odRecent":H("recent");break;case "odShared":H("shared");break;case "odSharepoint":H("sharepoint")}});var R=null;l("#odSearchBox").addEventListener("keyup",function(W){var X=this;null!=R&&clearTimeout(R);13==W.keyCode?U(X.value):R=setTimeout(function(){U(X.value)},-500)});l("#refreshOD").addEventListener("click",function(){if(null!=F){f(null);var W=y.slice();H.apply(this,F);y=W}});I&&l("#odBackBtn").addEventListener("click",I);G&&l("#odSubmitBtn").addEventListener("click",v);null!=c?(I=c.pop(),"sharepoint"==c[0].driveId&&D(l("#odSharepoint")),y=c,H(I.driveId,I.folderId,I.siteId,I.name)):H()};App=function(b,f,k){EditorUi.call(this,b,f,null!=k?k:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var d=this.getCurrentFile();null!=d&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+d.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=":+var t=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}),z=new Editor,L=null,K=null,M=null,m=!1,y=[],E=null,P=null;this.getSelectedItem=function(){null!=K&&q(K);return K};if(null==l("#mxODPickerCss")){var O=document.head||document.getElementsByTagName("head")[0],Q=document.createElement("style");O.appendChild(Q);Q.type="text/css";Q.id="mxODPickerCss";Q.appendChild(document.createTextNode(V))}b.innerHTML=+T;var U=l(".odPreview"),R=l("#odFiles");b=function(W,X){X=X||document;return X.querySelectorAll(W)}(".odCatListTitle");for(T=0;T<b.length;T++)b[T].addEventListener("click",function(){K=P=null;if(!m)switch(N(this),this.id){case "odFiles":G();break;case "odRecent":G("recent");break;case "odShared":G("shared");break;case "odSharepoint":G("sharepoint")}});var S=null;l("#odSearchBox").addEventListener("keyup",function(W){var X=this;null!=S&&clearTimeout(S);13==W.keyCode?J(X.value):S=setTimeout(function(){J(X.value)},+500)});l("#refreshOD").addEventListener("click",function(){if(null!=E){f(null);var W=y.slice();G.apply(this,E);y=W}});H&&l("#odBackBtn").addEventListener("click",H);F&&l("#odSubmitBtn").addEventListener("click",v);null!=c?(H=c.pop(),"sharepoint"==c[0].driveId&&N(l("#odSharepoint")),y=c,G(H.driveId,H.folderId,H.siteId,H.name)):G()};App=function(b,f,k){EditorUi.call(this,b,f,null!=k?k:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var d=this.getCurrentFile();null!=d&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+d.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(d,p,q){if("1"==urlParams.openInSameWin||navigator.standalone)null!=q&&q();else{var u=null;try{u=window.open(d)}catch(A){}null==u||void 0===u?this.showDialog((new PopupDialog(this,d,p,q)).container,340,140,!0,!0):null!=p&&p()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(d){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(d)});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(d){null!=window.console&&console.log("Plugin Error:",d,App.DrawPlugins[b])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(d){try{d(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=0,this.initializeEmbedMode())}),5E3)}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_M365="m365";App.MODE_GITHUB="github";App.MODE_GITLAB="gitlab";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.MODE_EMBED="embed";App.MODE_ATLAS="atlas";App.DROPBOX_APPKEY=window.DRAWIO_DROPBOX_ID;App.DROPBOX_URL="js/dropbox/Dropbox-sdk.min.js";@@ -14251,27 +14263,27 @@ window.location.hash&&"#G"==window.location.hash.substring(0,2)?mxscript("https:null):window.OneDriveClient=null),"function"===typeof window.TrelloClient&&("1"==urlParams.tr&&isSvgBrowser&&!mxClient.IS_IE11&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL)}):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)))})();App.clearServiceWorker=function(b,f){navigator.serviceWorker.getRegistration().then(function(k){null!=k&&k.unregister().then(function(){null!=b&&(b(),b=null)})})["catch"](function(){null!=f&&f()})};App.isSameDomain=function(b){var f=document.createElement("a");f.href=b;return f.protocol===window.location.protocol||f.host===window.location.host};App.isBuiltInPlugin=function(b){for(var f in App.pluginRegistry)if(App.pluginRegistry[f]==b)return!0;return!1};App.isSimpleThemePreferred=function(){var b=navigator.userAgent||navigator.vendor||window.opera;return 1024>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)||/android/i.test(b)||/iPad|iPhone|iPod/.test(b)&&!window.MSStream||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints};-App.main=function(b,f){try{var k=function(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var G=parseInt(mxSettings.settings.autosaveDelay);!isNaN(G)&&0<G?(DrawioFile.prototype.autosaveDelay=G,EditorUi.debug("Setting autosaveDelay",G)):EditorUi.debug("Invalid autosaveDelay",G)}null!=mxSettings.settings.defaultEdgeLength&&(G=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(G)&&0<G?(Graph.prototype.defaultEdgeLength=G,EditorUi.debug("Using defaultEdgeLength",G)):-EditorUi.debug("Invalid defaultEdgeLength",G))}}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}try{if(null!=Menus.prototype.defaultFonts)for(G=0;G<Menus.prototype.defaultFonts.length;G++){var E=Menus.prototype.defaultFonts[G];"string"!==typeof E&&null!=E.fontFamily&&null!=E.fontUrl&&Graph.addFont(E.fontFamily,E.fontUrl)}mxResources.loadDefaultBundle=!1;d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,-mxLanguage))}catch(c){document.body.innerHTML="",E=document.createElement("pre"),mxUtils.write(E,c.stack),document.body.appendChild(E)}},d=function(G){mxUtils.getAll("1"!=urlParams.dev?[G]:[G,STYLE_PATH+"/default.xml"],function(E){function c(){try{try{null==Editor.currentTheme&&"1"!=urlParams.embed&&(1==urlParams.dev||1==urlParams.test||"test.draw.io"===window.location.hostname||"www.draw.io"===window.location.hostname||"preprod.diagrams.net"===window.location.hostname||"app.diagrams.net"===window.location.hostname||+App.main=function(b,f){try{var k=function(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var F=parseInt(mxSettings.settings.autosaveDelay);!isNaN(F)&&0<F?(DrawioFile.prototype.autosaveDelay=F,EditorUi.debug("Setting autosaveDelay",F)):EditorUi.debug("Invalid autosaveDelay",F)}null!=mxSettings.settings.defaultEdgeLength&&(F=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(F)&&0<F?(Graph.prototype.defaultEdgeLength=F,EditorUi.debug("Using defaultEdgeLength",F)):+EditorUi.debug("Invalid defaultEdgeLength",F))}}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}try{if(null!=Menus.prototype.defaultFonts)for(F=0;F<Menus.prototype.defaultFonts.length;F++){var D=Menus.prototype.defaultFonts[F];"string"!==typeof D&&null!=D.fontFamily&&null!=D.fontUrl&&Graph.addFont(D.fontFamily,D.fontUrl)}mxResources.loadDefaultBundle=!1;d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,+mxLanguage))}catch(c){document.body.innerHTML="",D=document.createElement("pre"),mxUtils.write(D,c.stack),document.body.appendChild(D)}},d=function(F){mxUtils.getAll("1"!=urlParams.dev?[F]:[F,STYLE_PATH+"/default.xml"],function(D){function c(){try{try{null==Editor.currentTheme&&"1"!=urlParams.embed&&(1==urlParams.dev||1==urlParams.test||"test.draw.io"===window.location.hostname||"www.draw.io"===window.location.hostname||"preprod.diagrams.net"===window.location.hostname||"app.diagrams.net"===window.location.hostname||"jgraph.github.io"===window.location.hostname||/drawio-dev\.pages\.dev$/.test(window.location.hostname))&&App.isSimpleThemePreferred()&&(Editor.currentTheme="simple")}catch(B){}"kennedy"!=Editor.currentTheme&&0>mxUtils.indexOf(Editor.themes,Editor.currentTheme)&&(Editor.currentTheme="kennedy");"1"==urlParams.transparent&&(document.body.style.background="transparent");var x=null!=f?f():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,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(x);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,x,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(B){EditorUi.isElectronApp?-(mxLog.show(),mxLog.debug(B.stack)):(EditorUi.logError(B.message,null,null,null,B),window.setTimeout(function(){alert(B.message)},1))}}mxResources.parse(E[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var g=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=g){EditorUi.debug("Setting configuration",JSON.stringify(g));if(null!=g.merge){var l=localStorage.getItem(Editor.configurationKey);if(null!=-l)try{var n=JSON.parse(l),v;for(v in g.merge)n[v]=g.merge[v];g=n}catch(x){window.location.hash="",alert(x)}else g=g.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(g)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(x){window.location.hash="",alert(x)}1<E.length&&(Graph.prototype.defaultThemes["default-style2"]=E[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=-E[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(x){document.body.innerHTML="";var B=document.createElement("pre");mxUtils.write(B,x.stack);document.body.appendChild(B)}))},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(Editor.loadCompatibleCss(),App.isMainCalled=!0,window.onerror=function(G,-E,c,g,l){EditorUi.logError("Global: "+(null!=G?G:""),E,c,g,l,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",G,"\nURL:",E,"\nLine:",c,"\nColumn:",g,"\nError:",l)):console.error("Message:",G,"\nURL:",E,"\nLine:",c,"\nColumn:",g,"\nError:",l);window.setTimeout(function(){alert("Error: "+(null!=G?G:""))},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 p=document.getElementById("geInfo");null!=p&&p.parentNode.removeChild(p)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"!=urlParams.enableSW&&-"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(G){null!=G?(EditorUi.debug("App.main","Updating service worker"),G.update()):!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main","Installing service worker"),navigator.serviceWorker.register("service-worker.js")):-EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(G){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"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 q=-null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var u=JSON.parse(localStorage.getItem(mxSettings.key));null!=u&&(q=u.plugins)}catch(G){}u=urlParams.p;App.initPluginCallback();null!=u&&App.loadPlugins(u.split(";"));if(null!=q&&0<q.length&&"0"!=urlParams.plugins)for(p=0;p<q.length;p++)try{("/"==q[p].charAt(0)&&(q[p]=PLUGINS_BASE_PATH+q[p]),App.isSameDomain(q[p]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(q[p])?null==-App.pluginsLoaded[q[p]]&&(App.pluginsLoaded[q[p]]=!0,App.embedModePluginsCount++,mxscript(q[p])):null!=window.console&&console.log("Unknown plugin:",q[p]):null!=window.console&&console.log("Blocked plugin:",q[p])}catch(G){}}"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 A=window.opener||window.parent,J=function(G){if(G.source==A)try{var E=JSON.parse(G.data);null!=E&&"configure"==E.action&&(mxEvent.removeListener(window,"message",J),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"),k())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,G.data)}};mxEvent.addListener(window,"message",J);A.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(G){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(G.stack)):console.error(G)}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(G){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(G.stack)):console.error(G)}}}k()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}catch(G){document.body.innerHTML="",q=-document.createElement("pre"),mxUtils.write(q,G.stack),document.body.appendChild(q)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;+(mxLog.show(),mxLog.debug(B.stack)):(EditorUi.logError(B.message,null,null,null,B),window.setTimeout(function(){alert(B.message)},1))}}mxResources.parse(D[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var g=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=g){EditorUi.debug("Setting configuration",JSON.stringify(g));if(null!=g.merge){var l=localStorage.getItem(Editor.configurationKey);if(null!=+l)try{var n=JSON.parse(l),v;for(v in g.merge)n[v]=g.merge[v];g=n}catch(x){window.location.hash="",alert(x)}else g=g.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(g)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(x){window.location.hash="",alert(x)}1<D.length&&(Graph.prototype.defaultThemes["default-style2"]=D[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=+D[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(x){document.body.innerHTML="";var B=document.createElement("pre");mxUtils.write(B,x.stack);document.body.appendChild(B)}))},function(D){D=document.getElementById("geStatus");null!=D&&(D.innerHTML="Error loading page. <a>Please try refreshing.</a>",D.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(Editor.loadCompatibleCss(),App.isMainCalled=!0,"1"==urlParams.android&&(mxClient.IS_ANDROID=+!0),window.onerror=function(F,D,c,g,l){EditorUi.logError("Global: "+(null!=F?F:""),D,c,g,l,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",F,"\nURL:",D,"\nLine:",c,"\nColumn:",g,"\nError:",l)):console.error("Message:",F,"\nURL:",D,"\nLine:",c,"\nColumn:",g,"\nError:",l);window.setTimeout(function(){alert("Error: "+(null!=F?F:""))},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 p=document.getElementById("geInfo");null!=p&&p.parentNode.removeChild(p)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=+urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(F){null!=F?(EditorUi.debug("App.main","Updating service worker"),F.update()):!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main",+"Installing service worker"),navigator.serviceWorker.register("service-worker.js")):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(F){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"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 q=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var u=JSON.parse(localStorage.getItem(mxSettings.key));null!=u&&(q=u.plugins)}catch(F){}u=urlParams.p;App.initPluginCallback();null!=u&&App.loadPlugins(u.split(";"));if(null!=q&&0<q.length&&"0"!=urlParams.plugins)for(p=0;p<q.length;p++)try{("/"==q[p].charAt(0)&&(q[p]=PLUGINS_BASE_PATH++q[p]),App.isSameDomain(q[p]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(q[p])?null==App.pluginsLoaded[q[p]]&&(App.pluginsLoaded[q[p]]=!0,App.embedModePluginsCount++,mxscript(q[p])):null!=window.console&&console.log("Unknown plugin:",q[p]):null!=window.console&&console.log("Blocked plugin:",q[p])}catch(F){}}"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 A=window.opener||window.parent,I=function(F){if(F.source==A)try{var D=JSON.parse(F.data);null!=D&&"configure"==D.action&&(mxEvent.removeListener(window,"message",I),Editor.configure(D.config),mxSettings.load(),null!=D.config.darkColor&&+document.body.style.setProperty("--dark-color",D.config.darkColor),D.colorSchemeMeta&&mxmeta("color-scheme","dark light"),k())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,F.data)}};mxEvent.addListener(window,"message",I);A.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(F){null==+window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(F.stack)):console.error(F)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var H=localStorage.getItem(Editor.configurationKey);if(null!=H)try{H=JSON.parse(H),null!=H&&(EditorUi.debug("Using local configuration",H),Editor.configure(H),mxSettings.load())}catch(F){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(F.stack)):console.error(F)}}}k()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}catch(F){document.body.innerHTML=+"",q=document.createElement("pre"),mxUtils.write(q,F.stack),document.body.appendChild(q)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;App.loadPlugins=function(b,f){EditorUi.debug("Loading plugins",b);for(var k=0;k<b.length;k++)if(null!=b[k]&&0<b[k].length)try{if(null!=App.pluginRegistry[b[k]]){var d=PLUGINS_BASE_PATH+App.pluginRegistry[b[k]];null==App.pluginsLoaded[d]&&(App.pluginsLoaded[d]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?f?mxinclude(d):mxscript(d):f?mxinclude(d):mxscript(drawDevUrl+d))}else null!=window.console&&console.log("Unknown plugin:",b[k])}catch(p){null!=window.console&&console.log("Error loading plugin:",b[k],p)}};App.prototype.initializeEmbedMode=function(){"1"==urlParams.embed&&("app.diagrams.net"==window.location.hostname&&this.showBanner("EmbedDeprecationFooter","app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net."),0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments)))};App.prototype.initializeViewerMode=function(){var b=window.opener||window.parent;null!=b&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){b.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")}))};@@ -14311,11 +14323,11 @@ App.prototype.addRecent=function(b,f,k){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");this.unloading=!0;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,k){k=null!=k?k:0;var d=!1;try{var p=!0,q=window.setTimeout(mxUtils.bind(this,function(){p=!1;f(null)}),this.timeout),u=mxUtils.bind(this,function(V){window.clearTimeout(q);p&&f(V)});null==this.thumbImageCache&&(this.thumbImageCache={});var A=this.editor.graph,J=A.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var I=A.getGlobalVariable;A=this.createTemporaryGraph(A.getStylesheet());A.setBackgroundImage=this.editor.graph.setBackgroundImage;-var G=this.pages[0];this.currentPage==G?A.setBackgroundImage(J):null!=G.viewState&&null!=G.viewState&&(J=G.viewState.backgroundImage,A.setBackgroundImage(J));A.getGlobalVariable=function(V){return"page"==V?G.getName():"pagenumber"==V?1:I.apply(this,arguments)};A.getGlobalVariable=I;document.body.appendChild(A.container);A.model.setRoot(G.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{A!=this.editor.graph&&null!=A.container.parentNode&&-A.container.parentNode.removeChild(A.container)}catch(t){V=null}u(V)}),b,this.thumbImageCache,"#ffffff",function(){u()},null,null,null,null,null,null,A,k,null,null,null,"diagram",null),d=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var E=document.createElement("canvas"),c=A.getGraphBounds(),g=A.view.translate,l=A.view.scale;null!=J&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((g.x+J.x)*l,(g.y+J.y)*l,J.width*l,J.height*l)));var n=b/c.width;n=Math.min(1,Math.min(3*b/(4*-c.height),n));var v=Math.floor(c.x),x=Math.floor(c.y);E.setAttribute("width",Math.ceil(n*(c.width+4)));E.setAttribute("height",Math.ceil(n*(c.height+4)));var B=E.getContext("2d");B.scale(n,n);B.translate(-v,-x);var C=A.background;if(null==C||""==C||C==mxConstants.NONE)C="#ffffff";B.save();B.fillStyle=C;B.fillRect(v,x,Math.ceil(c.width+4),Math.ceil(c.height+4));B.restore();if(null!=J){var H=new Image;H.src=J.src;B.drawImage(H,J.x*n,J.y*n,J.width*n,J.height*n)}var D=new mxJsCanvas(E),U=new mxAsyncCanvas(this.thumbImageCache);-D.images=this.thumbImageCache.images;var S=new mxImageExport;S.drawShape=function(V,t){V.shape instanceof mxShape&&V.shape.checkBounds()&&(t.save(),t.translate(.5,.5),V.shape.paint(t),t.translate(-.5,-.5),t.restore())};S.drawText=function(V,t){};S.drawState(A.getView().getState(A.model.root),U);U.finish(mxUtils.bind(this,function(){try{S.drawState(A.getView().getState(A.model.root),D),A!=this.editor.graph&&null!=A.container.parentNode&&A.container.parentNode.removeChild(A.container)}catch(V){E=null}u(E)}));+App.prototype.getThumbnail=function(b,f,k){k=null!=k?k:0;var d=!1;try{var p=!0,q=window.setTimeout(mxUtils.bind(this,function(){p=!1;f(null)}),this.timeout),u=mxUtils.bind(this,function(V){window.clearTimeout(q);p&&f(V)});null==this.thumbImageCache&&(this.thumbImageCache={});var A=this.editor.graph,I=A.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var H=A.getGlobalVariable;A=this.createTemporaryGraph(A.getStylesheet());A.setBackgroundImage=this.editor.graph.setBackgroundImage;+var F=this.pages[0];this.currentPage==F?A.setBackgroundImage(I):null!=F.viewState&&null!=F.viewState&&(I=F.viewState.backgroundImage,A.setBackgroundImage(I));A.getGlobalVariable=function(V){return"page"==V?F.getName():"pagenumber"==V?1:H.apply(this,arguments)};A.getGlobalVariable=H;document.body.appendChild(A.container);A.model.setRoot(F.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{A!=this.editor.graph&&null!=A.container.parentNode&&+A.container.parentNode.removeChild(A.container)}catch(t){V=null}u(V)}),b,this.thumbImageCache,"#ffffff",function(){u()},null,null,null,null,null,null,A,k,null,null,null,"diagram",null),d=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var D=document.createElement("canvas"),c=A.getGraphBounds(),g=A.view.translate,l=A.view.scale;null!=I&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((g.x+I.x)*l,(g.y+I.y)*l,I.width*l,I.height*l)));var n=b/c.width;n=Math.min(1,Math.min(3*b/(4*+c.height),n));var v=Math.floor(c.x),x=Math.floor(c.y);D.setAttribute("width",Math.ceil(n*(c.width+4)));D.setAttribute("height",Math.ceil(n*(c.height+4)));var B=D.getContext("2d");B.scale(n,n);B.translate(-v,-x);var C=A.background;if(null==C||""==C||C==mxConstants.NONE)C="#ffffff";B.save();B.fillStyle=C;B.fillRect(v,x,Math.ceil(c.width+4),Math.ceil(c.height+4));B.restore();if(null!=I){var G=new Image;G.src=I.src;B.drawImage(G,I.x*n,I.y*n,I.width*n,I.height*n)}var N=new mxJsCanvas(D),J=new mxAsyncCanvas(this.thumbImageCache);+N.images=this.thumbImageCache.images;var T=new mxImageExport;T.drawShape=function(V,t){V.shape instanceof mxShape&&V.shape.checkBounds()&&(t.save(),t.translate(.5,.5),V.shape.paint(t),t.translate(-.5,-.5),t.restore())};T.drawText=function(V,t){};T.drawState(A.getView().getState(A.model.root),J);J.finish(mxUtils.bind(this,function(){try{T.drawState(A.getView().getState(A.model.root),N),A!=this.editor.graph&&null!=A.container.parentNode&&A.container.parentNode.removeChild(A.container)}catch(V){D=null}u(D)}));d=!0}}catch(V){d=!1,null!=A&&A!=this.editor.graph&&null!=A.container.parentNode&&A.container.parentNode.removeChild(A.container)}d||window.clearTimeout(q);return d};(function(){var b=EditorUi.prototype.setMode;App.prototype.setMode=function(f,k){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;null==this.updateTitleListener&&(this.updateTitleListener=mxUtils.bind(this,function(){f==App.MODE_GOOGLE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])):f==App.MODE_DROPBOX?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])):f==App.MODE_ONEDRIVE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])):this.appIcon.removeAttribute("title")}),this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTitleListener()})));this.updateTitleListener()}if(k)try{if(isLocalStorage)localStorage.setItem(".mode",f);else if("undefined"!=typeof Storage){var p=new Date;p.setYear(p.getFullYear()+1);document.cookie="MODE="+f+"; expires="+@@ -14331,17 +14343,17 @@ 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(k){null!=f.parentNode&&(f.parentNode.removeChild(f),mxEvent.consume(k))});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(u,A,J,I,G){"ResizeObserver loop limit exceeded"!=u&&(EditorUi.logError("Uncaught: "+(null!=u?u:""),A,J,I,G,null,!0),b.handleError({message:u},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(u){var A=this.getCurrentFile();EditorUi.debug("storage event",[u],-[A]);null!=A&&".draft-alive-check"==u.key&&null!=u.newValue&&null!=A.draftId&&(this.draftAliveCheck=u.newValue,A.saveDraft())}))}catch(u){}var f=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(u){try{var A=this.getDiagramId();if(A!=f){f=A;var J=this.getCurrentFile();null!=J&&J.getHash()==A||this.loadFile(A,!0)}else{var I=this.getHashObject();if(null!=I&&null!=I.pageId&&null!=this.currentPage&&I.pageId!=this.currentPage.getId()){var G=this.getPageById(I.pageId);-null!=G&&this.selectPage(G)}}}catch(E){null!=document.body&&this.handleError(E,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.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(u){this.handleError(u,mxResources.get("errorLoadingFile"))}))}catch(u){this.handleError(u,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 k=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 u=mxUtils.bind(this,function(I){Editor.isPngDataUrl(I)&&(I=Editor.extractGraphModelFromPng(I));var G=urlParams.title;G=null!=G?decodeURIComponent(G):this.defaultFilename;I=new LocalFile(this,-I,G,!0);this.fileLoaded(I);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(I.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),A=window.opener||window.parent;if(A!=window){var J=urlParams.create;null!=J?u(A[decodeURIComponent(J)]):(J=urlParams.data,null!=J?u(decodeURIComponent(J)):this.spinner.spin(document.body,mxResources.get("loading"))&&this.createTimeout(2E3,mxUtils.bind(this,-function(I){this.installMessageHandler(mxUtils.bind(this,function(G,E){E.source==A&&I.clear()&&(this.spinner.stop(),u(G))}))}),mxUtils.bind(this,function(I){this.handleError(I)})))}}else if(null==this.dialog)if("1"==urlParams.demo)J=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=J;else{J=!1;try{J=null!=window.opener&&null!=window.opener.openFile}catch(I){}J?this.spinner.spin(document.body,mxResources.get("loading")):(J=this.getDiagramId(),-!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=J&&0!=J.length||this.editor.isChromelessView()?null!=J&&0<J.length?this.loadFile(J,null,null,mxUtils.bind(this,function(){var I=decodeURIComponent(urlParams.viewbox||"");if(""!=I)try{var G=JSON.parse(I);this.editor.graph.fitWindow(G,G.border)}catch(E){console.error(E)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,+App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(u,A,I,H,F){"ResizeObserver loop limit exceeded"!=u&&(EditorUi.logError("Uncaught: "+(null!=u?u:""),A,I,H,F,null,!0),b.handleError({message:u},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(u){var A=this.getCurrentFile();EditorUi.debug("storage event",[u],+[A]);null!=A&&".draft-alive-check"==u.key&&null!=u.newValue&&null!=A.draftId&&(this.draftAliveCheck=u.newValue,A.saveDraft())}))}catch(u){}var f=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(u){try{var A=this.getDiagramId();if(A!=f){f=A;var I=this.getCurrentFile();null!=I&&I.getHash()==A||this.loadFile(A,!0)}else{var H=this.getHashObject();if(null!=H&&null!=H.pageId&&null!=this.currentPage&&H.pageId!=this.currentPage.getId()){var F=this.getPageById(H.pageId);+null!=F&&this.selectPage(F)}}}catch(D){null!=document.body&&this.handleError(D,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.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(u){this.handleError(u,mxResources.get("errorLoadingFile"))}))}catch(u){this.handleError(u,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 k=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 u=mxUtils.bind(this,function(H){Editor.isPngDataUrl(H)&&(H=Editor.extractGraphModelFromPng(H));var F=urlParams.title;F=null!=F?decodeURIComponent(F):this.defaultFilename;H=new LocalFile(this,+H,F,!0);this.fileLoaded(H);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(H.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),A=window.opener||window.parent;if(A!=window){var I=urlParams.create;null!=I?u(A[decodeURIComponent(I)]):(I=urlParams.data,null!=I?u(decodeURIComponent(I)):this.spinner.spin(document.body,mxResources.get("loading"))&&this.createTimeout(2E3,mxUtils.bind(this,+function(H){this.installMessageHandler(mxUtils.bind(this,function(F,D){D.source==A&&H.clear()&&(this.spinner.stop(),u(F))}))}),mxUtils.bind(this,function(H){this.handleError(H)})))}}else if(null==this.dialog)if("1"==urlParams.demo)I=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=I;else{I=!1;try{I=null!=window.opener&&null!=window.opener.openFile}catch(H){}I?this.spinner.spin(document.body,mxResources.get("loading")):(I=this.getDiagramId(),+!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=I&&0!=I.length||this.editor.isChromelessView()?null!=I&&0<I.length?this.loadFile(I,null,null,mxUtils.bind(this,function(){var H=decodeURIComponent(urlParams.viewbox||"");if(""!=H)try{var F=JSON.parse(H);this.editor.graph.fitWindow(F,F.border)}catch(D){console.error(D)}})):"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||"");null!=window.location.hash&&"#create="==window.location.hash.substring(0,8)&&(d=decodeURIComponent(window.location.hash.substring(8)));null!=urlParams["smart-template"]&&(null==window.location.hash||1>=window.location.hash.length)&&(d=JSON.stringify({type:"generate",data:decodeURIComponent(urlParams["smart-template"])}));if((null==window.location.hash||1>=window.location.hash.length)&&0<d.length&&this.spinner.spin(document.body,-mxResources.get("loading"))){var p=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),q=mxUtils.bind(this,function(u){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,u,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var A=urlParams.title;A=null!=A?decodeURIComponent(A):this.defaultFilename;u=this.getServiceCount(!0);isLocalStorage&&u++;var J=4>=-u?2:6<u?4:3;A=new CreateDialog(this,A,mxUtils.bind(this,function(I,G){if(null==G){this.hideDialog();var E=Editor.useLocalStorage;this.createFile(0<I.length?I:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=E}else this.pickFolder(G,mxUtils.bind(this,function(c){this.createFile(I,this.getFileData(!0),null,G,null,!0,c)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,J,null,null,null,this.editor.fileExtensions);this.showDialog(A.container,420,u>J?-390:280,!0,!1,mxUtils.bind(this,function(I){I&&null==this.getCurrentFile()&&this.showSplash()}));A.init()}});if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))try{if("{"==d.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(d)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=window.opener[d])q(window.opener[d]);else throw Error(mxResources.get("invalidCallFnNotFound",+mxResources.get("loading"))){var p=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),q=mxUtils.bind(this,function(u){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,u,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var A=urlParams.title;A=null!=A?decodeURIComponent(A):this.defaultFilename;u=this.getServiceCount(!0);isLocalStorage&&u++;var I=4>=+u?2:6<u?4:3;A=new CreateDialog(this,A,mxUtils.bind(this,function(H,F){if(null==F){this.hideDialog();var D=Editor.useLocalStorage;this.createFile(0<H.length?H:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=D}else this.pickFolder(F,mxUtils.bind(this,function(c){this.createFile(H,this.getFileData(!0),null,F,null,!0,c)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,I,null,null,null,this.editor.fileExtensions);this.showDialog(A.container,420,u>I?+390:280,!0,!1,mxUtils.bind(this,function(H){H&&null==this.getCurrentFile()&&this.showSplash()}));A.init()}});if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))try{if("{"==d.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(d)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=window.opener[d])q(window.opener[d]);else throw Error(mxResources.get("invalidCallFnNotFound",["window.opener."+d]));}catch(u){this.handleError(u,mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(u){q(u)},mxUtils.bind(this,function(u){this.handleError(u,mxResources.get("errorLoadingFile"),p)}))}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","splash"])),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),k())}}catch(u){this.handleError(u)}};@@ -14351,7 +14363,7 @@ function(q){k(q)},mxUtils.bind(this,function(q){this.handleError(q,mxResources.gApp.prototype.openGenerateDialog=function(b){null==this.chatWindow?(this.chatWindow=new ChatWindow(this,224,104,280,320),this.chatWindow.window.addListener("show",mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("chat"))})),this.chatWindow.window.addListener("hide",function(){this.fireEvent(new mxEventObject("chat"))}),this.chatWindow.window.setVisible(!0),this.fireEvent(new mxEventObject("chat"))):this.chatWindow.window.setVisible(!0);null!=b&&this.chatWindow.generate(b)};App.prototype.openTemplateDialog=function(b){var f=this.editor.graph;f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&(b=new NewDialog(this,null,!1,mxUtils.bind(this,function(k){this.hideDialog();if(null!=k){var d=this.editor.graph.getFreeInsertPoint(!0);f.setSelectionCells(this.importXml(k,Math.max(d.x,20),Math.max(d.y,20),!0,null,null,!0));f.scrollCellToVisible(f.getSelectionCell())}}),null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"),null,null,b),this.showDialog(b.container,620,460,!0,!0,mxUtils.bind(this,function(){this.sidebar.hideTooltip()})),b.init())};App.prototype.loadDraft=function(b,f){this.createFile(this.defaultFilename,b,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var k=this.getCurrentFile();null!=k&&(k.fileChanged(),null!=f&&f())}),0)}),null,null,!0)};-App.prototype.filterDrafts=function(b,f,k){function d(){k(p)}var p=[];try{this.getDatabaseItems(mxUtils.bind(this,function(q){EditorUi.debug("App.filterDrafts",[this],"items",q);for(var u=0;u<q.length;u++)try{var A=q[u].key;if(null!=A&&".draft_"==A.substring(0,7)){var J=JSON.parse(q[u].data);null!=J&&"draft"==J.type&&J.aliveCheck!=f&&(null==b&&null==J.fileObject||null!=J.fileObject&&J.fileObject.path==b)&&(J.key=A,p.push(J))}}catch(I){}d()}),d)}catch(q){d()}};+App.prototype.filterDrafts=function(b,f,k){function d(){k(p)}var p=[];try{this.getDatabaseItems(mxUtils.bind(this,function(q){EditorUi.debug("App.filterDrafts",[this],"items",q);for(var u=0;u<q.length;u++)try{var A=q[u].key;if(null!=A&&".draft_"==A.substring(0,7)){var I=JSON.parse(q[u].data);null!=I&&"draft"==I.type&&I.aliveCheck!=f&&(null==b&&null==I.fileObject||null!=I.fileObject&&I.fileObject.path==b)&&(I.key=A,p.push(I))}}catch(H){}d()}),d)}catch(q){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 k=new Date(f[0].modified);k=new DraftDialog(this,1<f.length?mxResources.get("selectDraft"):mxResources.get("draftFound",[k.toLocaleDateString()+" "+k.toLocaleTimeString()]),1<f.length?null:f[0].data,mxUtils.bind(this,function(d){this.hideDialog();d=""!=d&&null!=f[d]?d:0;this.loadDraft(f[d].data,mxUtils.bind(this,function(){this.removeDatabaseItem(f[d].key)}))}),mxUtils.bind(this,function(d,p){this.removeDatabaseItem(f[""!=d?d:0].key);null!=p&&p()}),null,null,null,1<f.length?f:null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(d){d&&("0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))}));k.init()}else"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(f){}};@@ -14360,89 +14372,89 @@ mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplashApp.prototype.addLanguageMenu=function(b,f,k){var d=null;null!=this.menus.get("language")&&(d=document.createElement("div"),this.setElementTitle(d,"language"),d.className="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!=k?k:"22px",f&&(d.style.direction="rtl",d.style.textAlign="right",d.style.right=null!=k?k:"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="geAdaptiveAsset"),mxEvent.addListener(d,"click",mxUtils.bind(this,function(p){this.editor.graph.popupMenuHandler.hideMenu();var q=new mxPopupMenu(this.menus.get("language").funct);q.smartSeparators=!0;q.showDisabled=!0;q.autoExpand=!0;q.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(q,arguments);q.destroy()});var u=mxUtils.getOffset(d);q.popup(u.x,u.y+d.offsetHeight,null,p);this.setCurrentMenu(q)})),b.appendChild(d));return d};-App.prototype.loadFileSystemEntry=function(b,f,k){k=null!=k?k:mxUtils.bind(this,function(d){this.handleError(d)});try{b.getFile().then(mxUtils.bind(this,function(d){var p=new FileReader;p.onload=mxUtils.bind(this,function(q){var u=mxUtils.bind(this,function(A){try{if(null!=f){var J=q.target.result;"image/png"==d.type&&(J=this.extractGraphModelFromPng(J));f(new LocalFile(this,J,d.name,null,b,d,A))}else this.openFileHandle(q.target.result,d.name,d,!1,b,A)}catch(I){k(I)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,+App.prototype.loadFileSystemEntry=function(b,f,k){k=null!=k?k:mxUtils.bind(this,function(d){this.handleError(d)});try{b.getFile().then(mxUtils.bind(this,function(d){var p=new FileReader;p.onload=mxUtils.bind(this,function(q){var u=mxUtils.bind(this,function(A){try{if(null!=f){var I=q.target.result;"image/png"==d.type&&(I=this.extractGraphModelFromPng(I));f(new LocalFile(this,I,d.name,null,b,d,A))}else this.openFileHandle(q.target.result,d.name,d,!1,b,A)}catch(H){k(H)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,function(A){u("denied"!==A)})):b.createWritable().then(mxUtils.bind(this,function(){u(!0)}),mxUtils.bind(this,function(A){u(!1)}))});p.onerror=k;"image"!==d.type.substring(0,5)&&"application/pdf"!==d.type||"image/svg"===d.type.substring(0,9)?p.readAsText(d):p.readAsDataURL(d)}),k)}catch(d){k(d)}};App.prototype.createFileSystemOptions=function(b){var f=[],k=null;if(null!=b){var d=b.lastIndexOf(".");0<d&&(k=b.substring(d+1))}for(d=0;d<this.editor.diagramFileTypes.length;d++){var p={description:mxResources.get(this.editor.diagramFileTypes[d].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[d].extension+")":""),accept:{}};p.accept[this.editor.diagramFileTypes[d].mimeType]=["."+this.editor.diagramFileTypes[d].extension];this.editor.diagramFileTypes[d].extension==k?f.splice(0,0,p):this.editor.diagramFileTypes[d].extension==k?f.splice(0,0,p):f.push(p)}return{types:f,suggestedName:b}};App.prototype.showSaveFilePicker=function(b,f,k){f=null!=f?f:mxUtils.bind(this,function(d){"AbortError"!=d.name&&this.handleError(d)});k=null!=k?k:this.createFileSystemOptions();window.showSaveFilePicker(k).then(mxUtils.bind(this,function(d){null!=d&&d.getFile().then(mxUtils.bind(this,function(p){b(d,p)}),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(u){null!=u&&0<u.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(u[0])}),mxUtils.bind(this,function(u){"AbortError"!=u.name&&this.handleError(u)}));else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.openFiles(k.files),k.type="",k.type="file",k.value="")}));k.style.display="none";document.body.appendChild(k);this.openFileInputElt=k}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(u,A){StorageFile.listFiles(this,"F",u,A)});window.openBrowserFile=mxUtils.bind(this,function(u,A,J){StorageFile.getFileContent(this,u,A,J)});window.deleteBrowserFile=mxUtils.bind(this,function(u,A,J){StorageFile.deleteFile(this,u,A,J)});var d=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,-function(u,A){var J=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=A.substring(A.length-4)||(A=A.substring(0,A.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,u,A):new LocalFile(this,u,A))}),I=this.getCurrentFile();null!=I&&I.isModified()?this.confirm(mxResources.get("allChangesLost"),null,J,mxResources.get("cancel"),mxResources.get("discardChanges")):J()}));var p=this.dialog,q=p.close;this.dialog.close=mxUtils.bind(this,function(u){Editor.useLocalStorage=+null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(u,A){StorageFile.listFiles(this,"F",u,A)});window.openBrowserFile=mxUtils.bind(this,function(u,A,I){StorageFile.getFileContent(this,u,A,I)});window.deleteBrowserFile=mxUtils.bind(this,function(u,A,I){StorageFile.deleteFile(this,u,A,I)});var d=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,+function(u,A){var I=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=A.substring(A.length-4)||(A=A.substring(0,A.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,u,A):new LocalFile(this,u,A))}),H=this.getCurrentFile();null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):I()}));var p=this.dialog,q=p.close;this.dialog.close=mxUtils.bind(this,function(u){Editor.useLocalStorage=d;q.apply(p,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(u){this.handleError(u)}};App.prototype.pickLibrary=function(b){b=null!=b?b:this.mode;var f=mxUtils.bind(this,function(q){try{this.loadLibrary(q);this.showSidebar();try{this.sidebar.palettes[q.getHash()][0].scrollIntoView({behavior:"smooth"})}catch(u){}}catch(u){this.handleError(u,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 k=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!=k&&k.pickLibrary(mxUtils.bind(this,function(q,u){null!=u?f(u):this.spinner.spin(document.body,mxResources.get("loading"))&&k.getLibrary(q,mxUtils.bind(this,function(A){this.spinner.stop();f(A)}),mxUtils.bind(this,function(A){this.handleError(A,null!=A?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 q=0;q<d.files.length;q++)mxUtils.bind(this,function(u){var A=new FileReader;A.onload=mxUtils.bind(this,function(J){f(new LocalLibrary(this,J.target.result,u.name))});A.readAsText(u)})(d.files[q]);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 q=0;q<d.files.length;q++)mxUtils.bind(this,function(u){var A=new FileReader;A.onload=mxUtils.bind(this,function(I){f(new LocalLibrary(this,I.target.result,u.name))});A.readAsText(u)})(d.files[q]);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(q,u){StorageFile.listFiles(this,"L",q,u)});window.openBrowserFile=mxUtils.bind(this,function(q,u,A){StorageFile.getFileContent(this,q,u,A)});window.deleteBrowserFile=mxUtils.bind(this,function(q,u,A){StorageFile.deleteFile(this,q,u,A)});var p=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(q){this.hideDialog(q)}));window.openFile.setConsumer(mxUtils.bind(this,function(q,u){f(b==App.MODE_BROWSER?new StorageLibrary(this,q,u):new LocalLibrary(this,q,u))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=p;window.openFile=null})}};-App.prototype.saveLibrary=function(b,f,k,d,p,q,u){try{d=null!=d?d:this.mode;p=null!=p?p:!1;q=null!=q?q:!1;var A=this.createLibraryDataFromImages(f),J=mxUtils.bind(this,function(E){this.spinner.stop();null!=u&&u();this.handleError(E,null!=E?mxResources.get("errorSavingFile"):null)});null==k&&d==App.MODE_DEVICE&&(k=new LocalLibrary(this,A,b));if(null==k)this.pickFolder(d,mxUtils.bind(this,function(E){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?-this.drive.insertFile(b,A,E,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),J,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),J,E):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,-A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),J,E):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),J,E):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();-this.hideDialog(!0);this.libraryLoaded(c,f)}),J,E):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),J,E):d==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,A,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,f)}),J):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));-else if(p||this.spinner.spin(document.body,mxResources.get("saving"))){k.setData(A);var I=mxUtils.bind(this,function(){k.save(!0,mxUtils.bind(this,function(E){this.spinner.stop();this.hideDialog(!0);q||this.libraryLoaded(k,f);null!=u&&u()}),J)});if(b!=k.getTitle()){var G=k.getHash();k.rename(b,mxUtils.bind(this,function(E){k.constructor!=LocalLibrary&&G!=k.getHash()&&(mxSettings.removeCustomLibrary(G),mxSettings.addCustomLibrary(k.getHash()));this.removeLibrarySidebar(G);I()}),J)}else I()}}catch(E){this.handleError(E)}};+App.prototype.saveLibrary=function(b,f,k,d,p,q,u){try{d=null!=d?d:this.mode;p=null!=p?p:!1;q=null!=q?q:!1;var A=this.createLibraryDataFromImages(f),I=mxUtils.bind(this,function(D){this.spinner.stop();null!=u&&u();this.handleError(D,null!=D?mxResources.get("errorSavingFile"):null)});null==k&&d==App.MODE_DEVICE&&(k=new LocalLibrary(this,A,b));if(null==k)this.pickFolder(d,mxUtils.bind(this,function(D){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?+this.drive.insertFile(b,A,D,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),I,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),I,D):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,+A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),I,D):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),I,D):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();+this.hideDialog(!0);this.libraryLoaded(c,f)}),I,D):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,f)}),I,D):d==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,A,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,f)}),I):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));+else if(p||this.spinner.spin(document.body,mxResources.get("saving"))){k.setData(A);var H=mxUtils.bind(this,function(){k.save(!0,mxUtils.bind(this,function(D){this.spinner.stop();this.hideDialog(!0);q||this.libraryLoaded(k,f);null!=u&&u()}),I)});if(b!=k.getTitle()){var F=k.getHash();k.rename(b,mxUtils.bind(this,function(D){k.constructor!=LocalLibrary&&F!=k.getHash()&&(mxSettings.removeCustomLibrary(F),mxSettings.addCustomLibrary(k.getHash()));this.removeLibrarySidebar(F);H()}),I)}else H()}}catch(D){this.handleError(D)}};App.prototype.saveFile=function(b,f){var k=this.getCurrentFile(),d=this.mode;if(null!=k){var p=mxUtils.bind(this,function(){EditorUi.enableDrafts&&k.removeDraft();this.getCurrentFile()==k||k.isModified()||(k.getMode()!=App.MODE_DEVICE?this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))})):this.clearStatus());null!=f&&f()});if(b||null==k.getTitle()||null!=k.invalidFileHandle||null==this.mode)if(null!=k&&k.constructor==LocalFile&&-null!=k.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(J,I){k.invalidFileHandle=null;k.fileHandle=J;k.title=I.name;k.desc=I;k.editable=null;this.save(I.name,p)}),null,this.createFileSystemOptions(k.getTitle()));else{var q=null!=k.getTitle()?k.getTitle():this.defaultFilename,u=mxUtils.bind(this,function(J,I,G,E){if(null!=J&&0<J.length)if(/(\.pdf)$/i.test(J))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),-mxUtils.bind(this,function(){G.value=J.split(".").slice(0,-1).join(".");G.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==d&&I==App.MODE_DEVICE)null!=k&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(g,l){k.fileHandle=g;k.mode=App.MODE_DEVICE;k.title=l.name;k.desc=l;this.setMode(App.MODE_DEVICE);this.save(l.name,p)}),mxUtils.bind(this,-function(g){"AbortError"!=g.name&&this.handleError(g)}),this.createFileSystemOptions(J)):(this.setMode(App.MODE_DEVICE),this.save(J,p));else if("download"==I)(new LocalFile(this,null,J)).save();else if("_blank"==I)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(b||d!=I){var c=mxUtils.bind(this,function(g){var l=this.editor.graph,n=l.getSelectionCells(),v=l.getViewState(),-x=this.currentPage;l=this.getCurrentFile();l=null==this.mode||null==l||null==l.mode;this.createFile(J,this.getFileData(/(\.xml)$/i.test(J)||0>J.indexOf(".")||/(\.drawio)$/i.test(J),/(\.svg)$/i.test(J),/(\.html)$/i.test(J)),null,I,p,l,g,null,null,mxUtils.bind(this,function(){this.restoreViewState(x,v,n)}))});null!=E?c(E):this.pickFolder(I,c)}else null!=I&&this.save(J,p)}),A=!mxClient.IS_IOS||!navigator.standalone;q=new SaveDialog(this,q,mxUtils.bind(this,function(J,I,G){u(J.value,I,J,G);this.hideDialog()}),+null!=k.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(I,H){k.invalidFileHandle=null;k.fileHandle=I;k.title=H.name;k.desc=H;k.editable=null;this.save(H.name,p)}),null,this.createFileSystemOptions(k.getTitle()));else{var q=null!=k.getTitle()?k.getTitle():this.defaultFilename,u=mxUtils.bind(this,function(I,H,F,D){if(null!=I&&0<I.length)if(/(\.pdf)$/i.test(I))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),+mxUtils.bind(this,function(){F.value=I.split(".").slice(0,-1).join(".");F.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==d&&H==App.MODE_DEVICE)null!=k&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(g,l){k.fileHandle=g;k.mode=App.MODE_DEVICE;k.title=l.name;k.desc=l;this.setMode(App.MODE_DEVICE);this.save(l.name,p)}),mxUtils.bind(this,+function(g){"AbortError"!=g.name&&this.handleError(g)}),this.createFileSystemOptions(I)):(this.setMode(App.MODE_DEVICE),this.save(I,p));else if("download"==H)(new LocalFile(this,null,I)).save();else if("_blank"==H)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(b||d!=H){var c=mxUtils.bind(this,function(g){var l=this.editor.graph,n=l.getSelectionCells(),v=l.getViewState(),+x=this.currentPage;l=this.getCurrentFile();l=null==this.mode||null==l||null==l.mode;this.createFile(I,this.getFileData(/(\.xml)$/i.test(I)||0>I.indexOf(".")||/(\.drawio)$/i.test(I),/(\.svg)$/i.test(I),/(\.html)$/i.test(I)),null,H,p,l,g,null,null,mxUtils.bind(this,function(){this.restoreViewState(x,v,n)}))});null!=D?c(D):this.pickFolder(H,c)}else null!=H&&this.save(I,p)}),A=!mxClient.IS_IOS||!navigator.standalone;q=new SaveDialog(this,q,mxUtils.bind(this,function(I,H,F){u(I.value,H,I,F);this.hideDialog()}),A?null:["_blank"]);this.showDialog(q.container,420,150,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));q.init()}else this.save(k.getTitle(),p)}};-App.prototype.loadTemplate=function(b,f,k,d,p){var q=!1,u=b,A=null!=d?d:b;d=/\.png$/i.test(A)||/\.pdf$/i.test(A);var J=EditorUi.isVisioFilename(A);this.editor.isCorsEnabledForUrl(u)||(q=d||J,u="t="+(new Date).getTime(),u=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+u+(q?"&base64=1":""));this.editor.loadUrl(u,mxUtils.bind(this,function(I){try{var G=q?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(I):atob(I):I;if(J||this.isVisioData(G))J||(A=p?this.isRemoteVisioData(G)?"raw.vss":"raw.vssx":-this.isRemoteVisioData(G)?"raw.vsd":"raw.vsdx"),this.importVisio(this.base64ToBlob(I.substring(I.indexOf(",")+1)),function(E){f(E)},k,A);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(G,A))this.isExternalDataComms()?this.parseFileData(G,mxUtils.bind(this,function(E){4==E.readyState&&200<=E.status&&299>=E.status&&"<mxGraphModel"==E.responseText.substring(0,13)&&f(E.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k);else if(this.isLucidChartData(G))this.convertLucidChart(G,-mxUtils.bind(this,function(E){f(E)}),mxUtils.bind(this,function(E){k(E)}));else{if(/(\.png)($|\?)/i.test(A)||Editor.isPngData(G))G=Editor.extractGraphModelFromPng(I);f(G)}}catch(E){k(E)}}),k,/(\.png)($|\?)/i.test(A)||J,null,null,q)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};+App.prototype.loadTemplate=function(b,f,k,d,p){var q=!1,u=b,A=null!=d?d:b;d=/\.png$/i.test(A)||/\.pdf$/i.test(A);var I=EditorUi.isVisioFilename(A);this.editor.isCorsEnabledForUrl(u)||(q=d||I,u="t="+(new Date).getTime(),u=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+u+(q?"&base64=1":""));this.editor.loadUrl(u,mxUtils.bind(this,function(H){try{var F=q?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(H):atob(H):H;if(I||this.isVisioData(F))I||(A=p?this.isRemoteVisioData(F)?"raw.vss":"raw.vssx":+this.isRemoteVisioData(F)?"raw.vsd":"raw.vsdx"),this.importVisio(this.base64ToBlob(H.substring(H.indexOf(",")+1)),function(D){f(D)},k,A);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(F,A))this.isExternalDataComms()?this.parseFileData(F,mxUtils.bind(this,function(D){4==D.readyState&&200<=D.status&&299>=D.status&&"<mxGraphModel"==D.responseText.substring(0,13)&&f(D.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k);else if(this.isLucidChartData(F))this.convertLucidChart(F,+mxUtils.bind(this,function(D){f(D)}),mxUtils.bind(this,function(D){k(D)}));else{if(/(\.png)($|\?)/i.test(A)||Editor.isPngData(F))F=Editor.extractGraphModelFromPng(H);f(F)}}catch(D){k(D)}}),k,/(\.png)($|\?)/i.test(A)||I,null,null,q)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"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):b==App.MODE_M365?null!=this.m365:!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 k=f.documentElement.getElementsByTagName("diagram"),d=0;d<k.length;d++){var p=Editor.parseDiagramNode(k[d],!0);null!=p&&(mxUtils.setTextContent(k[d],""),k[d].appendChild(p))}b=mxUtils.getPrettyXml(f.documentElement)}}catch(q){}return b};-App.prototype.createFile=function(b,f,k,d,p,q,u,A,J,I){EditorUi.debug("App.createFile",[this],"title",[b],"data",[f],"libs",[k],"mode",[d]);d=A?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 G=mxUtils.bind(this,function(){this.spinner.stop()}),E=mxUtils.bind(this,function(g){G();null==g&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():-null!=g&&this.handleError(g)});try{var c=mxUtils.bind(this,function(g){G();this.fileCreated(g,k,q,p,J,I)});d==App.MODE_GOOGLE&&null!=this.drive?(null==u&&null!=this.stateArg&&null!=this.stateArg.folderId&&(u=this.stateArg.folderId),this.drive.insertFile(b,f,u,c,E)):d==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,f,c,E,!1,u):d==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,f,c,E,!1,u):d==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,f,c,E,!1,u):d==App.MODE_DROPBOX&&-null!=this.dropbox?this.dropbox.insertFile(b,f,c,E):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,f,c,E,!1,u):d==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,f,c,E,!1,u):d==App.MODE_BROWSER?StorageFile.insertFile(this,b,f,c,E):!A&&d==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(G(),this.showSaveFilePicker(mxUtils.bind(this,function(g,l){var n=new LocalFile(this,f,l.name,null,g,l);n.saveFile(l.name,!1,mxUtils.bind(this,function(){this.fileCreated(n,k,q,p,J,I)}),E,!0)}),-mxUtils.bind(this,function(g){"AbortError"!=g.name&&E(g)}),this.createFileSystemOptions(b))):(G(),this.fileCreated(new LocalFile(this,f,b,null==d),k,q,p,J,I))}catch(g){G(),this.handleError(g)}}};-App.prototype.fileCreated=function(b,f,k,d,p,q){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[f],"replace",[k]);var u=window.location.pathname;null!=f&&0<f.length&&(u+="?libs="+f);null!=p&&0<p.length&&(u+="?clibs="+p);u=this.getUrl(u);b.getMode()!=App.MODE_DEVICE&&(u+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var A=b.getData();A=0<A.length?this.editor.extractGraphModel(mxUtils.parseXml(A).documentElement,!0):null;var J=window.location.protocol+-"//"+window.location.hostname+u,I=A,G=null;null!=A&&/\.svg$/i.test(b.getTitle())&&(G=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(G.container),I=this.decodeNodeIntoGraph(I,G));b.setData(this.createFileData(A,G,b,J));null!=G&&G.container.parentNode.removeChild(G.container);var E=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){E();var g=this.getCurrentFile();null==k&&null!=g&&(k=!g.isModified()&&(null==g.getMode()||EditorUi.isElectronApp));+App.prototype.createFile=function(b,f,k,d,p,q,u,A,I,H){EditorUi.debug("App.createFile",[this],"title",[b],"data",[f],"libs",[k],"mode",[d]);d=A?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 F=mxUtils.bind(this,function(){this.spinner.stop()}),D=mxUtils.bind(this,function(g){F();null==g&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():+null!=g&&this.handleError(g)});try{var c=mxUtils.bind(this,function(g){F();this.fileCreated(g,k,q,p,I,H)});d==App.MODE_GOOGLE&&null!=this.drive?(null==u&&null!=this.stateArg&&null!=this.stateArg.folderId&&(u=this.stateArg.folderId),this.drive.insertFile(b,f,u,c,D)):d==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,f,c,D,!1,u):d==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,f,c,D,!1,u):d==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,f,c,D,!1,u):d==App.MODE_DROPBOX&&+null!=this.dropbox?this.dropbox.insertFile(b,f,c,D):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,f,c,D,!1,u):d==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,f,c,D,!1,u):d==App.MODE_BROWSER?StorageFile.insertFile(this,b,f,c,D):!A&&d==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(F(),this.showSaveFilePicker(mxUtils.bind(this,function(g,l){var n=new LocalFile(this,f,l.name,null,g,l);n.saveFile(l.name,!1,mxUtils.bind(this,function(){this.fileCreated(n,k,q,p,I,H)}),D,!0)}),+mxUtils.bind(this,function(g){"AbortError"!=g.name&&D(g)}),this.createFileSystemOptions(b))):(F(),this.fileCreated(new LocalFile(this,f,b,null==d),k,q,p,I,H))}catch(g){F(),this.handleError(g)}}};+App.prototype.fileCreated=function(b,f,k,d,p,q){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[f],"replace",[k]);var u=window.location.pathname;null!=f&&0<f.length&&(u+="?libs="+f);null!=p&&0<p.length&&(u+="?clibs="+p);u=this.getUrl(u);b.getMode()!=App.MODE_DEVICE&&(u+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var A=b.getData();A=0<A.length?this.editor.extractGraphModel(mxUtils.parseXml(A).documentElement,!0):null;var I=window.location.protocol++"//"+window.location.hostname+u,H=A,F=null;null!=A&&/\.svg$/i.test(b.getTitle())&&(F=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(F.container),H=this.decodeNodeIntoGraph(H,F));b.setData(this.createFileData(A,F,b,I));null!=F&&F.container.parentNode.removeChild(F.container);var D=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){D();var g=this.getCurrentFile();null==k&&null!=g&&(k=!g.isModified()&&(null==g.getMode()||EditorUi.isElectronApp));var l=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,q);k&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=f&&this.sidebar.showEntries(f);if(null!=p){for(var v=[],x=p.split(";"),B=0;B<x.length;B++)v.push(decodeURIComponent(x[B]));this.loadLibraries(v)}null!=d&&d()}),n=mxUtils.bind(this,function(){k||null==g||!g.isModified()?l():this.confirm(mxResources.get("allChangesLost"),null,l,mxResources.get("cancel"),mxResources.get("discardChanges"))});-null==k||k?n():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(u,null,n))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(g){E();null!=g&&"AbortError"==g.name||this.handleError(g)}))}};-App.prototype.loadFile=function(b,f,k,d,p){if("1"==urlParams.openInSameWin||navigator.standalone)f=!0;this.hideDialog();var q=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var J=mxUtils.bind(this,function(v){this.handleError(v,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var x=this.getCurrentFile();window.location.hash=-null!=x?x.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(v){null!=v?(this.fileLoaded(new StorageFile(this,v,b)),null!=d&&d()):J({message:mxResources.get("fileNotFound")})}),J)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var v=this.getCurrentFile();window.location.hash=null!=v?v.getHash():""}));else if(null!=k)this.spinner.stop(),this.fileLoaded(k),-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("create="==b.substring(0,7)){var I=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==I.type){var G=window.opener||window.parent,E=mxUtils.bind(this,function(v){EditorUi.debug("EditorUi.createMessageHandler",-[this],"evt",[v]);if(v.source==G)try{"create"==v.data.action&&null!=v.data.data&&(mxEvent.removeListener(window,"message",E),this.executeCreateObject(v.data.data))}catch(x){c=null}});mxEvent.addListener(window,"message",E);G.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(I)}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));I=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):-this.defaultFilename,!0);I.getHash=function(){return b};this.fileLoaded(I);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(v,x){this.spinner.stop();this.fileLoaded(new EmbedFile(this,v,x));null!=d&&d()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},+null==k||k?n():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(u,null,n))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(g){D();null!=g&&"AbortError"==g.name||this.handleError(g)}))}};+App.prototype.loadFile=function(b,f,k,d,p){if("1"==urlParams.openInSameWin||navigator.standalone)f=!0;this.hideDialog();var q=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var I=mxUtils.bind(this,function(v){this.handleError(v,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var x=this.getCurrentFile();window.location.hash=+null!=x?x.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(v){null!=v?(this.fileLoaded(new StorageFile(this,v,b)),null!=d&&d()):I({message:mxResources.get("fileNotFound")})}),I)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var v=this.getCurrentFile();window.location.hash=null!=v?v.getHash():""}));else if(null!=k)this.spinner.stop(),this.fileLoaded(k),+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("create="==b.substring(0,7)){var H=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==H.type){var F=window.opener||window.parent,D=mxUtils.bind(this,function(v){EditorUi.debug("EditorUi.createMessageHandler",+[this],"evt",[v]);if(v.source==F)try{"create"==v.data.action&&null!=v.data.data&&(mxEvent.removeListener(window,"message",D),this.executeCreateObject(v.data.data))}catch(x){c=null}});mxEvent.addListener(window,"message",D);F.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(H)}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));H=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):+this.defaultFilename,!0);H.getHash=function(){return b};this.fileLoaded(H);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(v,x){this.spinner.stop();this.fileLoaded(new EmbedFile(this,v,x));null!=d&&d()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var g=decodeURIComponent(b.substring(1)),l=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=g.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var v=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var x=g.substring(31,g.lastIndexOf("&ex"));this.loadFile("G"+x,f,null,mxUtils.bind(this,function(){var B=this.getCurrentFile();null!=B&&this.editor.chromeless&&-!this.editor.editable&&(B.getHash=function(){return"G"+x},window.location.hash="#"+B.getHash());null!=d&&d()}));return!0}return!1});!v()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",v);return!0});this.loadTemplate(g,mxUtils.bind(this,function(v){this.spinner.stop();if(null!=v&&0<v.length){var x=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var B=g,C=g.lastIndexOf("."),H=B.lastIndexOf("/");C>H&&0<H&&(B=B.substring(H+1,C),C=g.substring(C),+!this.editor.editable&&(B.getHash=function(){return"G"+x},window.location.hash="#"+B.getHash());null!=d&&d()}));return!0}return!1});!v()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",v);return!0});this.loadTemplate(g,mxUtils.bind(this,function(v){this.spinner.stop();if(null!=v&&0<v.length){var x=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var B=g,C=g.lastIndexOf("."),G=B.lastIndexOf("/");C>G&&0<G&&(B=B.substring(G+1,C),C=g.substring(C),Editor.useCanvasForExport||".png"!=C||(C=".drawio"),".svg"===C||".xml"===C||".html"===C||".png"===C||".drawio"===C)&&(x=B+C)}v=new LocalFile(this,v,null!=urlParams.title?decodeURIComponent(urlParams.title):x,!0);v.getHash=function(){return b};this.fileLoaded(v,!0)?null!=d&&d():l()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else l()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){l()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else{var n=this.getModeForChar(b.charAt(0));mxUtils.bind(this,function(){var v=this.getServiceForName(n);if(null==v)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var B=this.getCurrentFile();-window.location.hash=null!=B?B.getHash():""}));else{var x=b.charAt(0);b=decodeURIComponent(b.substring(1));v.getFile(b,mxUtils.bind(this,function(B){this.spinner.stop();this.fileLoaded(B);var C=this.getCurrentFile();if(null==C)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){C.getHash=function(){return x+b};B="#"+C.getHash();try{var H=this.getHashObject();null==H||mxUtils.isEmptyObject(H)||(B=B+"#"+encodeURIComponent(JSON.stringify(H)))}catch(D){}window.location.replace(B)}else B==-C&&null==B.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var D=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+D+'" class="geStatusAlert">'+D+"</div>")}));null!=d&&d()}),mxUtils.bind(this,function(B){null!=window.console&&null!=B&&console.log("error in loadFile:",b,B);var C=mxUtils.bind(this,function(){var H=this.getCurrentFile();null==H?(window.location.hash="",this.showSplash()):window.location.hash="#"+H.getHash()});null==B||"AbortError"!=B.name?this.handleError(B,+window.location.hash=null!=B?B.getHash():""}));else{var x=b.charAt(0);b=decodeURIComponent(b.substring(1));v.getFile(b,mxUtils.bind(this,function(B){this.spinner.stop();this.fileLoaded(B);var C=this.getCurrentFile();if(null==C)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){C.getHash=function(){return x+b};B="#"+C.getHash();try{var G=this.getHashObject();null==G||mxUtils.isEmptyObject(G)||(B=B+"#"+encodeURIComponent(JSON.stringify(G)))}catch(N){}window.location.replace(B)}else B==+C&&null==B.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var N=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+N+'" class="geStatusAlert">'+N+"</div>")}));null!=d&&d()}),mxUtils.bind(this,function(B){null!=window.console&&null!=B&&console.log("error in loadFile:",b,B);var C=mxUtils.bind(this,function(){var G=this.getCurrentFile();null==G?(window.location.hash="",this.showSplash()):window.location.hash="#"+G.getHash()});null==B||"AbortError"!=B.name?this.handleError(B,null!=B?mxResources.get("errorLoadingFile"):null,C,null,null,"#"+x+b):C()}))}})()}}),u=this.getCurrentFile(),A=mxUtils.bind(this,function(){p||null==u||!u.isModified()?q():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=u&&(window.location.hash=u.getHash())}),q,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==f&&null!=u&&!u.isModified()&&this.isBlankFile()?A():null==u||f?A():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+b,null,A)).container,340,140,!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(k){for(var d=0;d<k.length;d++)""!=k[d]&&0>mxUtils.indexOf(f,k[d])&&f.push(k[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 k=mxUtils.bind(this,function(I,G){G||mxSettings.removeCustomLibrary(I);delete this.loadedLibraries[I]}),d=0,p=[],q=0<b.length&&"L.scratchpad"==b[0]?1:0,u=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var I=b.length-1;0<=I;I--)null!=p[I]&&this.loadLibrary(p[I],I<=q);null!=f&&f()}});if(null!=b)for(var A=0;A<b.length;A++){var J=encodeURIComponent(decodeURIComponent(b[A]));-mxUtils.bind(this,function(I,G){if(null!=I&&0<I.length&&null==this.loadedLibraries[I]&&null==this.sidebar.palettes[I]){this.loadedLibraries[I]=!0;d++;var E=mxUtils.bind(this,function(x){p[G]=x;d--;u()}),c=mxUtils.bind(this,function(x){k(I,x);d--;u()}),g=I.substring(0,1);if("L"==g)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var x=decodeURIComponent(I.substring(1));StorageFile.getFileContent(this,x,mxUtils.bind(this,function(B){".scratchpad"!=x||null!=-B&&"<mxfile"!=B.substring(0,7)||(B=this.emptyLibraryXml);null!=B?E(new StorageLibrary(this,B,x)):c()}),c)}catch(B){c()}}),0);else if("U"==g){var l=decodeURIComponent(I.substring(1));this.isOffline()?c(!0):this.loadTemplate(l,mxUtils.bind(this,function(x){null!=x&&0<x.length?E(new UrlLibrary(this,x,l)):c()}),function(){c()},null,!0)}else if("R"==g){g=decodeURIComponent(I.substring(1));try{g=JSON.parse(g);var n={id:g[0],title:g[1],downloadUrl:g[2]};this.remoteInvoke("getFileContent",[n.downloadUrl],-null,mxUtils.bind(this,function(x){try{E(new RemoteLibrary(this,x,n))}catch(B){c()}}),function(){c()})}catch(x){c()}}else if("S"==g&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(I.substring(1)),function(x){E(x)},c)}catch(x){c()}else{var v=null;"G"==g?null!=this.drive&&null!=this.drive.user&&(v=this.drive):"H"==g?null!=this.gitHub&&null!=this.gitHub.getUser()&&(v=this.gitHub):"T"==g?null!=this.trello&&this.trello.isAuthorized()&&(v=this.trello):"D"==g?null!=this.dropbox&&null!=-this.dropbox.getUser()&&(v=this.dropbox):"W"==g&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(v=this.oneDrive);null!=v?v.getLibrary(decodeURIComponent(I.substring(1)),mxUtils.bind(this,function(x){try{E(x)}catch(B){c()}}),function(x){c()}):c(!0)}}})(J,A)}u()}};+App.prototype.loadLibraries=function(b,f){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var k=mxUtils.bind(this,function(H,F){F||mxSettings.removeCustomLibrary(H);delete this.loadedLibraries[H]}),d=0,p=[],q=0<b.length&&"L.scratchpad"==b[0]?1:0,u=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var H=b.length-1;0<=H;H--)null!=p[H]&&this.loadLibrary(p[H],H<=q);null!=f&&f()}});if(null!=b)for(var A=0;A<b.length;A++){var I=encodeURIComponent(decodeURIComponent(b[A]));+mxUtils.bind(this,function(H,F){if(null!=H&&0<H.length&&null==this.loadedLibraries[H]&&null==this.sidebar.palettes[H]){this.loadedLibraries[H]=!0;d++;var D=mxUtils.bind(this,function(x){p[F]=x;d--;u()}),c=mxUtils.bind(this,function(x){k(H,x);d--;u()}),g=H.substring(0,1);if("L"==g)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var x=decodeURIComponent(H.substring(1));StorageFile.getFileContent(this,x,mxUtils.bind(this,function(B){".scratchpad"!=x||null!=+B&&"<mxfile"!=B.substring(0,7)||(B=this.emptyLibraryXml);null!=B?D(new StorageLibrary(this,B,x)):c()}),c)}catch(B){c()}}),0);else if("U"==g){var l=decodeURIComponent(H.substring(1));this.isOffline()?c(!0):this.loadTemplate(l,mxUtils.bind(this,function(x){null!=x&&0<x.length?D(new UrlLibrary(this,x,l)):c()}),function(){c()},null,!0)}else if("R"==g){g=decodeURIComponent(H.substring(1));try{g=JSON.parse(g);var n={id:g[0],title:g[1],downloadUrl:g[2]};this.remoteInvoke("getFileContent",[n.downloadUrl],+null,mxUtils.bind(this,function(x){try{D(new RemoteLibrary(this,x,n))}catch(B){c()}}),function(){c()})}catch(x){c()}}else if("S"==g&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(H.substring(1)),function(x){D(x)},c)}catch(x){c()}else{var v=null;"G"==g?null!=this.drive&&null!=this.drive.user&&(v=this.drive):"H"==g?null!=this.gitHub&&null!=this.gitHub.getUser()&&(v=this.gitHub):"T"==g?null!=this.trello&&this.trello.isAuthorized()&&(v=this.trello):"D"==g?null!=this.dropbox&&null!=+this.dropbox.getUser()&&(v=this.dropbox):"W"==g&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(v=this.oneDrive);null!=v?v.getLibrary(decodeURIComponent(H.substring(1)),mxUtils.bind(this,function(x){try{D(x)}catch(B){c()}}),function(x){c()}):c(!0)}}})(I,A)}u()}};App.prototype.updateButtonContainer=function(b){if(null!=this.buttonContainer)if(EditorUi.isElectronApp||this.isOffline()||b||(null!=urlParams.notif?this.fetchAndShowNotification(urlParams.notif):"1"!=urlParams.extAuth&&"atlas"!=Editor.currentTheme&&this.fetchAndShowNotification("online",this.mode)),this.isStandaloneApp()||"simple"==Editor.currentTheme&&"1"!=urlParams.embed)this.buttonContainer.style.display="none",null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.sketchMenubarElt&&this.sketchMenubarElt.appendChild(this.notificationBtn);else{this.buttonContainer.style.display="";b=this.getCurrentFile();null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.buttonContainer&&this.buttonContainer.appendChild(this.notificationBtn);"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&(null==this.commentButton&&(this.commentButton=document.createElement("a"),this.setElementTitle(this.commentButton,"comments"),this.commentButton.className="geButton geRoundButton",this.commentButton.style.backgroundImage="url("+Editor.commentImage+")",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),this.buttonContainer.appendChild(this.commentButton)),this.commentButton.style.display=this.commentsSupported()?"":"none");if(null==this.shareButton){this.shareButton=document.createElement("button");this.shareButton.className="geBtn gePrimaryBtn";var f=document.createElement("div");f.className="geButton";f.style.backgroundImage="url("+Editor.groupImage+")";this.shareButton.appendChild(f);this.dependsOnLanguage(mxUtils.bind(this,function(){f.innerHTML="";mxUtils.write(f,mxResources.get("share"));this.shareButton.setAttribute("title",mxResources.get("share"))}));mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,function(){this.actions.get("share").funct()}));this.buttonContainer.appendChild(this.shareButton)}this.shareButton.style.display=null!=b&&"kennedy"==Editor.currentTheme&&"1"!=urlParams.embed?"":"none";-if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=document.createElement("a");this.userButton.className="geButton geRoundButton";var k=document.createElement("img");this.userButton.appendChild(k);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(A){this.toggleUserPanel();var J=this.userButton.getBoundingClientRect(),I=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=J.bottom+"px";this.userPanel.style.right=I-J.right+"px";+if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=document.createElement("a");this.userButton.className="geButton geRoundButton";var k=document.createElement("img");this.userButton.appendChild(k);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(A){this.toggleUserPanel();var I=this.userButton.getBoundingClientRect(),H=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=I.bottom+"px";this.userPanel.style.right=H-I.right+"px";mxEvent.consume(A)}));var d=document.createElement("img");d.style.position="absolute";d.style.width="10px";this.userButton.appendChild(d);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){k=this.userButton.getElementsByTagName("img")[0];d=this.userButton.getElementsByTagName("img")[1];var p=mxResources.get("changeUser"),q=this.getMainUser();null!=q&&null!=q.displayName&&(p=q.displayName);null!=q&&null!=q.pictureUrl?(k.classList.remove("geAdaptiveAsset"),k.src=q.pictureUrl,d.style.top="3px",d.style.right="0"):(k.classList.add("geAdaptiveAsset"),k.src=Editor.userImage,d.style.top="6px",d.style.right="4px");if(null!=b&&b.isRealtimeEnabled()&&b.isRealtimeSupported()){d.style.display="";k=b.getRealtimeError();var u=b.getRealtimeState();p+=" (";1==u?(d.src=Editor.syncImage,p+=mxResources.get("online")):(d.src=Editor.syncProblemImage,p=null!=k&&null!=k.message?p+k.message:p+mxResources.get("disconnected"));p+=")"}else d.style.display="none",d.src=Editor.cloudImage;this.userButton.setAttribute("title",p);this.userButton.style.display="draw.io"!=this.getServiceName()||null==q||"1"==urlParams.embed||this.isStandaloneApp()||null==b?"none":""}}}};-App.prototype.fetchAndShowNotification=function(b,f){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var k=null,d=mxUtils.bind(this,function(p){p=p.filter(function(J){return!J.targets||-1<J.targets.indexOf(b)||null!=f&&-1<J.targets.indexOf(f)});for(var q=b+"NotifReadTS",u=isLocalStorage?parseInt(localStorage.getItem(q)):!0,A=0;A<p.length;A++)p[A].isNew=!u||p[A].timestamp>u;this.showNotification(p,q)});try{isLocalStorage&&(k=JSON.parse(localStorage.getItem(".notifCache")))}catch(p){}null==+App.prototype.fetchAndShowNotification=function(b,f){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var k=null,d=mxUtils.bind(this,function(p){p=p.filter(function(I){return!I.targets||-1<I.targets.indexOf(b)||null!=f&&-1<I.targets.indexOf(f)});for(var q=b+"NotifReadTS",u=isLocalStorage?parseInt(localStorage.getItem(q)):!0,A=0;A<p.length;A++)p[A].isNew=!u||p[A].timestamp>u;this.showNotification(p,q)});try{isLocalStorage&&(k=JSON.parse(localStorage.getItem(".notifCache")))}catch(p){}null==k||k.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(p){if(200<=p.getStatus()&&299>=p.getStatus())try{var q=JSON.parse(p.getText());q.sort(function(u,A){return A.timestamp-u.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:q}));this.fetchingNotif=!1;d(q)}catch(u){}}))):d(k.notifs)}};-App.prototype.showNotification=function(b,f){function k(I){var G=document.querySelector(".geNotification-count");null!=G&&(G.innerHTML=I,G.style.display=0==I?"none":"",G=document.querySelector(".geNotification-bell"),G.style.animation=0==I?"none":"",G.className="geNotification-bell"+(0==I?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==I?"none":"")}var d=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var p=d=0;p<b.length;p++)b[p].isNew&&-d++;if(0==d)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var q=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var I=this.notificationWin.querySelectorAll(".circle.active"),G=0;G<I.length;G++)I[G].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(f,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className=+App.prototype.showNotification=function(b,f){function k(H){var F=document.querySelector(".geNotification-count");null!=F&&(F.innerHTML=H,F.style.display=0==H?"none":"",F=document.querySelector(".geNotification-bell"),F.style.animation=0==H?"none":"",F.className="geNotification-bell"+(0==H?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==H?"none":"")}var d=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var p=d=0;p<b.length;p++)b[p].isNew&&+d++;if(0==d)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var q=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var H=this.notificationWin.querySelectorAll(".circle.active"),F=0;F<H.length;F++)H[F].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";p=document.createElement("span");p.className="geBell-top";d.appendChild(p);p=document.createElement("span");p.className="geBell-middle";d.appendChild(p);p=document.createElement("span");p.className="geBell-bottom";d.appendChild(p);p=document.createElement("span");p.className="geBell-rad";d.appendChild(p);this.notificationBtn.appendChild(d);this.notificationWin=document.createElement("div");this.notificationWin.className="geNotifPanel";this.notificationWin.style.display="none";document.body.appendChild(this.notificationWin);p=document.createElement("div");p.className="header";d=document.createElement("span");d.className="title";d.textContent=mxResources.get("notifications");p.appendChild(d);d=document.createElement("span");d.className="closeBtn";d.textContent="x";p.appendChild(d);this.notificationWin.appendChild(p);-p=document.createElement("div");p.className="notifications clearfix";var u=document.createElement("div");u.setAttribute("id","geNotifList");u.style.position="relative";p.appendChild(u);this.notificationWin.appendChild(p);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 I=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=-I.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=I.right-this.notificationWin.clientWidth+"px";k(0)}else q()}));mxEvent.addListener(d,"click",q)}else this.notificationBtn.style.display="";var A=0,J=document.getElementById("geNotifList");if(null!=J){J.innerHTML='<div class="line"></div>';for(p=0;p<b.length;p++)(function(I,G){G.isNew&&A++;var E=document.createElement("div");E.className="notification";I=I.timeSince(new Date(G.timestamp));null==I&&(I=mxResources.get("lessThanAMinute"));-E.innerHTML='<div class="circle'+(G.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[I],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(G.content)+"</p>";G.link&&mxEvent.addListener(E,"click",function(){window.open(G.link,"notifWin")});J.appendChild(E)})(this,b[p]);k(A)}}};-App.prototype.save=function(b,f){var k=this.getCurrentFile(),d=!0,p=mxUtils.bind(this,function(){d&&(d=!1,k.handleFileSuccess(!0),null!=f&&f())}),q=mxUtils.bind(this,function(u){if(d){d=!1;Editor.addRetryToError(u,mxUtils.bind(this,function(){this.save(b,f)}));if(null!=u&&null!=u.retry){var A=u.retry;u.retry=function(){d=!0;try{k.isModified()?A():p()}catch(J){q(J)}}}k.handleFileError(u,null==u||"AbortError"!=u.name)}});if(null!=k&&this.spinner.spin(document.body,mxResources.get("saving"),q,3*this.timeout))try{this.clearStatus(),+p=document.createElement("div");p.className="notifications clearfix";var u=document.createElement("div");u.setAttribute("id","geNotifList");u.style.position="relative";p.appendChild(u);this.notificationWin.appendChild(p);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 H=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=+H.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=H.right-this.notificationWin.clientWidth+"px";k(0)}else q()}));mxEvent.addListener(d,"click",q)}else this.notificationBtn.style.display="";var A=0,I=document.getElementById("geNotifList");if(null!=I){I.innerHTML='<div class="line"></div>';for(p=0;p<b.length;p++)(function(H,F){F.isNew&&A++;var D=document.createElement("div");D.className="notification";H=H.timeSince(new Date(F.timestamp));null==H&&(H=mxResources.get("lessThanAMinute"));+D.innerHTML='<div class="circle'+(F.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[H],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(F.content)+"</p>";F.link&&mxEvent.addListener(D,"click",function(){window.open(F.link,"notifWin")});I.appendChild(D)})(this,b[p]);k(A)}}};+App.prototype.save=function(b,f){var k=this.getCurrentFile(),d=!0,p=mxUtils.bind(this,function(){d&&(d=!1,k.handleFileSuccess(!0),null!=f&&f())}),q=mxUtils.bind(this,function(u){if(d){d=!1;Editor.addRetryToError(u,mxUtils.bind(this,function(){this.save(b,f)}));if(null!=u&&null!=u.retry){var A=u.retry;u.retry=function(){d=!0;try{k.isModified()?A():p()}catch(I){q(I)}}}k.handleFileError(u,null==u||"AbortError"!=u.name)}});if(null!=k&&this.spinner.spin(document.body,mxResources.get("saving"),q,3*this.timeout))try{this.clearStatus(),this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==k.getTitle()?k.save(!0,p,q):k.saveAs(b,p,q)}catch(u){q(u)}};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_M365?this.m365: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"):b==App.MODE_M365?mxResources.get("m365"):EditorUi.prototype.getTitleForService.apply(this,arguments)};-App.prototype.pickFolder=function(b,f,k,d,p,q){k=null!=k?k:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var u=this.spinner.pause();k&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(A){u();if(A.action==google.picker.Action.PICKED){var J=null;null!=A.docs&&0<A.docs.length&&"folder"==A.docs[0].type&&(J=A.docs[0].id);f(q?A:J)}}),p):k&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(A){u();-if(null!=A&&null!=A.value&&0<A.value.length){var J=OneDriveFile.prototype.getIdOf(A.value[0]);f(q?A:J)}}),d):k&&b==App.MODE_M365&&null!=this.m365?this.m365.pickFolder(mxUtils.bind(this,function(A){u();if(null!=A&&null!=A.value&&0<A.value.length){var J=OneDriveFile.prototype.getIdOf(A.value[0]);f(q?A:J)}}),d):k&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(A){u();f(A)})):k&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(A){u();+App.prototype.pickFolder=function(b,f,k,d,p,q){k=null!=k?k:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var u=this.spinner.pause();k&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(A){u();if(A.action==google.picker.Action.PICKED){var I=null;null!=A.docs&&0<A.docs.length&&"folder"==A.docs[0].type&&(I=A.docs[0].id);f(q?A:I)}}),p):k&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(A){u();+if(null!=A&&null!=A.value&&0<A.value.length){var I=OneDriveFile.prototype.getIdOf(A.value[0]);f(q?A:I)}}),d):k&&b==App.MODE_M365&&null!=this.m365?this.m365.pickFolder(mxUtils.bind(this,function(A){u();if(null!=A&&null!=A.value&&0<A.value.length){var I=OneDriveFile.prototype.getIdOf(A.value[0]);f(q?A:I)}}),d):k&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(A){u();f(A)})):k&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(A){u();f(A)})):k&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(A){u();f(A)})):EditorUi.prototype.pickFolder.apply(this,arguments)};App.prototype.exportFile=function(b,f,k,d,p,q){p==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(f,d?this.base64ToBlob(b,k):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u)})):p==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(f,b,q,mxUtils.bind(this,function(u){this.spinner.stop()}),mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u)}),k,d):p==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(f,d?this.base64ToBlob(b,k):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u)}),!1,q):p==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(f,b,mxUtils.bind(this,@@ -14452,10 +14464,10 @@ function(){localStorage.setItem(f,b)}),null==localStorage.getItem(f)?k():this.coApp.prototype.descriptorChanged=function(){var b=this.getCurrentFile();if(null!=b){if(null!=this.fname){this.fname.innerText="";var f=null!=b.getTitle()?b.getTitle():this.defaultFilename;mxUtils.write(this.fname,f)}f=this.editor.graph;var k=b.isEditable();f.isEnabled()&&!k&&f.reset();f.setEnabled(k);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,k,d){var p=this.spinner.pause();this.showDialog((new AuthDialog(this,b,f,mxUtils.bind(this,function(q){try{null!=k&&k(q,mxUtils.bind(this,function(){this.hideDialog();p()}))}catch(u){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(u.message))}))}}))).container,300,f?180:140,!0,!0,mxUtils.bind(this,function(q){null!=d&&d(q);q&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};-App.prototype.convertFile=function(b,f,k,d,p,q,u,A){var J=f;/\.svg$/i.test(J)||(J=J.substring(0,f.lastIndexOf("."))+d);var I=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(I=!0);if(/\.v(dx|sdx?)$/i.test(f)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var G=new XMLHttpRequest;G.open("GET",b,!0);I||(G.responseType="blob");if(A)for(var E in A)G.setRequestHeader(E,A[E]);G.onload=mxUtils.bind(this,function(){if(200<=-G.status&&299>=G.status){var g=null;I?(g=JSON.parse(G.responseText),g=this.base64ToBlob(g.content,"application/octet-stream")):g=new Blob([G.response],{type:"application/octet-stream"});this.importVisio(g,mxUtils.bind(this,function(l){p(new LocalFile(this,l,J,!0))}),q,f)}else null!=q&&q({message:mxResources.get("errorLoadingFile")})});G.onerror=q;G.send()}else{var c=mxUtils.bind(this,function(g){try{if(/\.pdf$/i.test(f)){var l=Editor.extractGraphModelFromPdf(g);null!=l&&0<l.length&&p(new LocalFile(this,-l,J,!0))}else/\.png$/i.test(f)?(l=this.extractGraphModelFromPng(g),null!=l?p(new LocalFile(this,l,J,!0)):p(new LocalFile(this,g,f,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,b)?this.parseFileData(g,mxUtils.bind(this,function(n){4==n.readyState&&(200<=n.status&&299>=n.status?p(new LocalFile(this,n.responseText,J,!0)):null!=q&&q({message:mxResources.get("errorLoadingFile")}))}),f):p(new LocalFile(this,g,J,!0))}catch(n){null!=q&&q(n)}});k=/\.png$/i.test(f)||/\.jpe?g$/i.test(f)||-/\.pdf$/i.test(f)||null!=k&&"image/"==k.substring(0,6);I?mxUtils.get(b,mxUtils.bind(this,function(g){if(200<=g.getStatus()&&299>=g.getStatus()){if(null!=p){g=JSON.parse(g.getText());var l=g.content;"base64"===g.encoding&&(l=/\.png$/i.test(f)?"data:image/png;base64,"+l:/\.pdf$/i.test(f)?"data:application/pdf;base64,"+l:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(l):atob(l));c(l)}}else null!=q&&q({code:App.ERROR_UNKNOWN})}),function(){null!=q&&q({code:App.ERROR_UNKNOWN})},!1,this.timeout,+App.prototype.convertFile=function(b,f,k,d,p,q,u,A){var I=f;/\.svg$/i.test(I)||(I=I.substring(0,f.lastIndexOf("."))+d);var H=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(H=!0);if(/\.v(dx|sdx?)$/i.test(f)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var F=new XMLHttpRequest;F.open("GET",b,!0);H||(F.responseType="blob");if(A)for(var D in A)F.setRequestHeader(D,A[D]);F.onload=mxUtils.bind(this,function(){if(200<=+F.status&&299>=F.status){var g=null;H?(g=JSON.parse(F.responseText),g=this.base64ToBlob(g.content,"application/octet-stream")):g=new Blob([F.response],{type:"application/octet-stream"});this.importVisio(g,mxUtils.bind(this,function(l){p(new LocalFile(this,l,I,!0))}),q,f)}else null!=q&&q({message:mxResources.get("errorLoadingFile")})});F.onerror=q;F.send()}else{var c=mxUtils.bind(this,function(g){try{if(/\.pdf$/i.test(f)){var l=Editor.extractGraphModelFromPdf(g);null!=l&&0<l.length&&p(new LocalFile(this,+l,I,!0))}else/\.png$/i.test(f)?(l=this.extractGraphModelFromPng(g),null!=l?p(new LocalFile(this,l,I,!0)):p(new LocalFile(this,g,f,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,b)?this.parseFileData(g,mxUtils.bind(this,function(n){4==n.readyState&&(200<=n.status&&299>=n.status?p(new LocalFile(this,n.responseText,I,!0)):null!=q&&q({message:mxResources.get("errorLoadingFile")}))}),f):p(new LocalFile(this,g,I,!0))}catch(n){null!=q&&q(n)}});k=/\.png$/i.test(f)||/\.jpe?g$/i.test(f)||+/\.pdf$/i.test(f)||null!=k&&"image/"==k.substring(0,6);H?mxUtils.get(b,mxUtils.bind(this,function(g){if(200<=g.getStatus()&&299>=g.getStatus()){if(null!=p){g=JSON.parse(g.getText());var l=g.content;"base64"===g.encoding&&(l=/\.png$/i.test(f)?"data:image/png;base64,"+l:/\.pdf$/i.test(f)?"data:application/pdf;base64,"+l:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(l):atob(l));c(l)}}else null!=q&&q({code:App.ERROR_UNKNOWN})}),function(){null!=q&&q({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=q&&q({code:App.ERROR_TIMEOUT,retry:fn})},A):null!=u?u(b,c,q,k):this.editor.loadUrl(b,c,q,k,null,null,null,A)}};App.prototype.updateHeader=function(){if(null!=this.menubar){var b="url("+Editor.logoImage+")";this.appIcon=document.createElement("a");this.appIcon.className="geAppIcon";this.appIcon.style.backgroundImage=b;mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(q){this.appIconClicked(q)}));mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var q=this.getCurrentFile();null!=q&&(q=q.getMode(),q==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):q==App.MODE_DROPBOX?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):q==App.MODE_ONEDRIVE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):q==App.MODE_GITHUB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)",this.appIcon.style.backgroundSize=@@ -14472,16 +14484,16 @@ App.prototype.updateFullscreenState=function(){if(null!=this.fullscreenElement){App.prototype.getMainUser=function(){var b=null;null!=this.drive&&null!=this.drive.getUser()?b=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?b=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?b=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()?b=this.gitHub.getUser():null!=this.gitLab&&null!=this.gitLab.getUser()&&(b=this.gitLab.getUser());return b};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 geInlineDialog";b.style.minWidth="300px";this.userPanel=b;mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(u){mxEvent.isConsumed(u)||this.hideUserPanel()}))}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var f=!1;this.userPanel.innerText="";b=document.createElement("div");b.className="geButton";b.setAttribute("title",-mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var k=this.drive.getUsersList();if(0<k.length){var d=mxUtils.bind(this,function(u,A){var J=this.getCurrentFile();null!=J&&J.constructor==DriveFile?(this.spinner.spin(document.body,A),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,-function(){this.spinner.stop();u()}),2E3)):u()});b=mxUtils.bind(this,function(u){var A=document.createElement("tr"),J=document.createElement("td");J.setAttribute("valig","middle");J.style.height="59px";J.style.width="66px";var I=document.createElement("img");I.setAttribute("width","50");I.setAttribute("height","50");I.setAttribute("border","0");I.setAttribute("src",null!=u.pictureUrl?u.pictureUrl:Editor.userImage);I.style.borderRadius="50%";I.style.margin="4px 8px 0 8px";J.appendChild(I);A.appendChild(J);-J=document.createElement("td");J.setAttribute("valign","middle");J.style.whiteSpace="nowrap";J.style.paddingTop="4px";J.style.maxWidth="0";J.style.overflow="hidden";J.style.textOverflow="ellipsis";mxUtils.write(J,u.displayName+(u.isCurrent&&1<k.length?" ("+mxResources.get("default")+")":""));null!=u.email&&(mxUtils.br(J),I=document.createElement("small"),I.style.color="gray",mxUtils.write(I,u.email),J.appendChild(I));I=document.createElement("div");I.style.marginTop="4px";var G=document.createElement("i");-mxUtils.write(G,mxResources.get("googleDrive"));I.appendChild(G);J.appendChild(I);A.appendChild(J);u.isCurrent?A.setAttribute("title","User ID: "+u.id):(A.setAttribute("title",mxResources.get("login")+" (User ID: "+u.id+")"),A.style.cursor="pointer",A.style.opacity="0.3",mxEvent.addListener(A,"mouseenter",mxUtils.bind(this,function(){A.style.opacity="1"})),mxEvent.addListener(A,"mouseleave",mxUtils.bind(this,function(){A.style.opacity="0.3"})),mxEvent.addListener(A,"click",mxUtils.bind(this,function(E){this.hideUserPanel();-d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(u);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(E)})));return A});f=!0;var p=document.createElement("table");p.style.borderSpacing="0";p.style.fontSize="10pt";p.style.width="100%";p.style.padding="10px";for(var q=0;q<k.length;q++)p.appendChild(b(k[q]));+mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var k=this.drive.getUsersList();if(0<k.length){var d=mxUtils.bind(this,function(u,A){var I=this.getCurrentFile();null!=I&&I.constructor==DriveFile?(this.spinner.spin(document.body,A),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,+function(){this.spinner.stop();u()}),2E3)):u()});b=mxUtils.bind(this,function(u){var A=document.createElement("tr"),I=document.createElement("td");I.setAttribute("valig","middle");I.style.height="59px";I.style.width="66px";var H=document.createElement("img");H.setAttribute("width","50");H.setAttribute("height","50");H.setAttribute("border","0");H.setAttribute("src",null!=u.pictureUrl?u.pictureUrl:Editor.userImage);H.style.borderRadius="50%";H.style.margin="4px 8px 0 8px";I.appendChild(H);A.appendChild(I);+I=document.createElement("td");I.setAttribute("valign","middle");I.style.whiteSpace="nowrap";I.style.paddingTop="4px";I.style.maxWidth="0";I.style.overflow="hidden";I.style.textOverflow="ellipsis";mxUtils.write(I,u.displayName+(u.isCurrent&&1<k.length?" ("+mxResources.get("default")+")":""));null!=u.email&&(mxUtils.br(I),H=document.createElement("small"),H.style.color="gray",mxUtils.write(H,u.email),I.appendChild(H));H=document.createElement("div");H.style.marginTop="4px";var F=document.createElement("i");+mxUtils.write(F,mxResources.get("googleDrive"));H.appendChild(F);I.appendChild(H);A.appendChild(I);u.isCurrent?A.setAttribute("title","User ID: "+u.id):(A.setAttribute("title",mxResources.get("login")+" (User ID: "+u.id+")"),A.style.cursor="pointer",A.style.opacity="0.3",mxEvent.addListener(A,"mouseenter",mxUtils.bind(this,function(){A.style.opacity="1"})),mxEvent.addListener(A,"mouseleave",mxUtils.bind(this,function(){A.style.opacity="0.3"})),mxEvent.addListener(A,"click",mxUtils.bind(this,function(D){this.hideUserPanel();+d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(u);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(D)})));return A});f=!0;var p=document.createElement("table");p.style.borderSpacing="0";p.style.fontSize="10pt";p.style.width="100%";p.style.padding="10px";for(var q=0;q<k.length;q++)p.appendChild(b(k[q]));this.userPanel.appendChild(p);b=document.createElement("div");b.style.textAlign="left";b.style.padding="10px";b.style.whiteSpace="nowrap";b.style.borderTopStyle="solid";b.style.borderTopWidth="1px";p=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"))}))}));p.className="geBtn";p.style.float="right";b.appendChild(p);p=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var u=this.drive.createAuthWin();u.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(A){this.handleError(A)}),!0,u)}),mxResources.get("closingFile")+"...")}));p.className="geBtn";p.style.margin="0px";-b.appendChild(p);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(u,A,J,I){if(null!=u){f&&this.userPanel.appendChild(document.createElement("hr"));f=!0;var G=document.createElement("table");G.style.borderSpacing="0";G.style.fontSize="10pt";G.style.width="100%";G.style.padding="10px";var E=document.createElement("tbody"),c=document.createElement("tr"),g=document.createElement("td");g.setAttribute("valig","top");g.style.width="40px";if(null!=A){var l=document.createElement("img");l.setAttribute("width",-"40");l.setAttribute("height","40");l.setAttribute("border","0");l.setAttribute("src",A);l.style.marginRight="6px";g.appendChild(l)}c.appendChild(g);g=document.createElement("td");g.setAttribute("valign","middle");g.style.whiteSpace="nowrap";g.style.maxWidth="0";g.style.overflow="hidden";g.style.textOverflow="ellipsis";mxUtils.write(g,u.displayName);null!=u.email&&(mxUtils.br(g),A=document.createElement("small"),A.style.color="gray",mxUtils.write(A,u.email),g.appendChild(A));null!=I&&(u=document.createElement("div"),-u.style.marginTop="4px",A=document.createElement("i"),mxUtils.write(A,I),u.appendChild(A),g.appendChild(u));c.appendChild(g);E.appendChild(c);G.appendChild(E);this.userPanel.appendChild(G);u=document.createElement("div");u.style.textAlign="center";u.style.padding="10px";u.style.whiteSpace="nowrap";null!=J&&(J=mxUtils.button(mxResources.get("signOut"),J),J.className="geBtn",u.appendChild(J));this.userPanel.appendChild(u)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",+b.appendChild(p);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(u,A,I,H){if(null!=u){f&&this.userPanel.appendChild(document.createElement("hr"));f=!0;var F=document.createElement("table");F.style.borderSpacing="0";F.style.fontSize="10pt";F.style.width="100%";F.style.padding="10px";var D=document.createElement("tbody"),c=document.createElement("tr"),g=document.createElement("td");g.setAttribute("valig","top");g.style.width="40px";if(null!=A){var l=document.createElement("img");l.setAttribute("width",+"40");l.setAttribute("height","40");l.setAttribute("border","0");l.setAttribute("src",A);l.style.marginRight="6px";g.appendChild(l)}c.appendChild(g);g=document.createElement("td");g.setAttribute("valign","middle");g.style.whiteSpace="nowrap";g.style.maxWidth="0";g.style.overflow="hidden";g.style.textOverflow="ellipsis";mxUtils.write(g,u.displayName);null!=u.email&&(mxUtils.br(g),A=document.createElement("small"),A.style.color="gray",mxUtils.write(A,u.email),g.appendChild(A));null!=H&&(u=document.createElement("div"),+u.style.marginTop="4px",A=document.createElement("i"),mxUtils.write(A,H),u.appendChild(A),g.appendChild(u));c.appendChild(g);D.appendChild(c);F.appendChild(D);this.userPanel.appendChild(F);u=document.createElement("div");u.style.textAlign="center";u.style.padding="10px";u.style.whiteSpace="nowrap";null!=I&&(I=mxUtils.button(mxResources.get("signOut"),I),I.className="geBtn",u.appendChild(I));this.userPanel.appendChild(u)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",mxUtils.bind(this,function(){var u=this.getCurrentFile();if(null!=u&&u.constructor==DropboxFile){var A=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});u.isModified()?this.confirm(mxResources.get("allChangesLost"),null,A,mxResources.get("cancel"),mxResources.get("discardChanges")):A()}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 u=this.getCurrentFile();if(null!=u&&u.constructor==OneDriveFile){var A=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});u.isModified()?this.confirm(mxResources.get("allChangesLost"),null,A,mxResources.get("cancel"),mxResources.get("discardChanges")):A()}else this.oneDrive.logout()}),mxResources.get("oneDrive"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var u=this.getCurrentFile();if(null!=u&&u.constructor==GitHubFile){var A=mxUtils.bind(this,function(){this.gitHub.logout();window.location.hash=""});u.isModified()?this.confirm(mxResources.get("allChangesLost"),null,A,mxResources.get("cancel"),mxResources.get("discardChanges")):A()}else this.gitHub.logout()}),mxResources.get("github"));null!=this.gitLab&&b(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,function(){var u=this.getCurrentFile();if(null!=u&&u.constructor==GitLabFile){var A=mxUtils.bind(this,function(){this.gitLab.logout();window.location.hash=@@ -14492,7 +14504,7 @@ App.prototype.getCurrentUser=function(){var b=null;null!=this.drive&&null!=this.Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.prototype.createHelpLink=function(k){return this.editorUi.createHelpIcon(k)};Menus.prototype.addLinkToItem=function(k,d){null!=k&&k.firstChild.nextSibling.appendChild(this.createHelpLink(d))};Menus.prototype.removeCustomFont=function(k,d){for(var p=0;p<this.customFonts.length;p++)if(this.customFonts[p].name==k&&this.customFonts[p].url==d){this.customFonts.splice(p,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(k,d){for(var p=0;p<this.customFonts.length;p++)if(this.customFonts[p].name==k&&this.customFonts[p].url==d)return!0;for(p=0;p<this.defaultFonts.length;p++){var q=this.defaultFonts[p];if("string"!==typeof q&&q.fontFamily==k&&q.fontUrl==d||"string"===typeof q&&q==k&&null==d)return!0}return!1};Menus.prototype.addCustomFont=function(k,d){null==k||this.containsFont(k,d)||(this.customFonts.push({name:k,url:d}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var f=Menus.prototype.init;Menus.prototype.init=function(){function k(t,z,L){d.editor.isExportToCanvas()?d.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),-"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(K,M,m,y,F,N,O,P,T,Q,R,W,X){var Y=parseInt(K);!isNaN(Y)&&0<Y&&(d.exportImage(Y/100,M&&"png"==t,m,y,F&&"png"==t,O,!P,T,t,R,null,W,X),null!=L&&L(K,M,m,y,F,N,O,P,T,Q,R,W,X))}),!0,z,t,!0):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||d.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(K,M,m,y,F){d.downloadFile(M&&"png"==t?"xmlpng":t,null,null,K,null,null,m,y,F)}),!1,!0)}f.apply(this,arguments);+"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(K,M,m,y,E,P,O,Q,U,R,S,W,X){var Y=parseInt(K);!isNaN(Y)&&0<Y&&(d.exportImage(Y/100,M&&"png"==t,m,y,E&&"png"==t,O,!Q,U,t,S,null,W,X),null!=L&&L(K,M,m,y,E,P,O,Q,U,R,S,W,X))}),!0,z,t,!0):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||d.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(K,M,m,y,E){d.downloadFile(M&&"png"==t?"xmlpng":t,null,null,K,null,null,m,y,E)}),!1,!0)}f.apply(this,arguments);var d=this.editorUi,p=d.editor.graph,q=mxUtils.bind(p,p.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(t){return"file"!=t}));d.actions.addAction("new...",function(){var t=d.isOffline(),z=new NewDialog(d,t,!(d.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));d.showDialog(z.container,t?350:620,t?70:460,!0,!0,function(L){null!=d.sidebar&&d.sidebar.hideTooltip();L&&null==d.getCurrentFile()&&d.showSplash()});z.init()});d.actions.put("insertTemplate",new Action("template...",function(){d.openTemplateDialog()})).isEnabled=q;var u=d.actions.addAction("shareCursor",function(){d.setShareCursorPosition(!d.isShareCursorPosition())});u.setToggleAction(!0);u.setSelectedCallback(function(){return d.isShareCursorPosition()});u=d.actions.addAction("showRemoteCursors",function(){d.setShowRemoteCursors(!d.isShowRemoteCursors())});u.setToggleAction(!0);u.setSelectedCallback(function(){return d.isShowRemoteCursors()});u=d.actions.addAction("points",function(){d.editor.graph.view.setUnit(mxConstants.POINTS)});u.setToggleAction(!0);u.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.POINTS});u=d.actions.addAction("inches",function(){d.editor.graph.view.setUnit(mxConstants.INCHES)});u.setToggleAction(!0);u.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.INCHES});u=d.actions.addAction("millimeters",function(){d.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});u.setToggleAction(!0);u.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.MILLIMETERS});@@ -14503,9 +14515,9 @@ new Action("light",function(t){d.setAndPersistDarkMode(!1)}));u.setToggleAction(d.actions.addAction("properties...",function(){d.getPublicUrl(d.getCurrentFile(),function(t){t=new FilePropertiesDialog(d,t);d.showDialog(t.container,340,200,!0,!0);t.init()})}).isEnabled=q;window.mxFreehand&&(u=d.actions.put("insertFreehand",new Action("freehand",function(){p.isEnabled()&&(null==d.freehandWindow&&(d.freehandWindow=new FreehandWindow(d,document.body.offsetWidth-420,102,180,126,!0)),p.freehand.isDrawing()?p.freehand.stopDrawing():p.freehand.startDrawing(),d.freehandWindow.window.setVisible(p.freehand.isDrawing()))},null,null,"X")),u.isEnabled=function(){return q()},u.setToggleAction(!0),u.setSelectedCallback(function(){return null!=d.freehandWindow&&d.freehandWindow.window.isVisible()}));d.actions.put("exportXml",new Action("formatXml...",function(){var t=document.createElement("div");t.style.whiteSpace="nowrap";var z=null==d.pages||1>=d.pages.length,L=document.createElement("h3");mxUtils.write(L,mxResources.get("formatXml"));L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";t.appendChild(L);var K=d.addCheckbox(t,mxResources.get("selectionOnly"),!1,p.isSelectionEmpty()),M=d.addCheckbox(t,mxResources.get("compressed"),Editor.defaultCompressed),m=d.addCheckbox(t,mxResources.get("allPages"),!z,z);m.style.marginBottom="16px";mxEvent.addListener(K,"change",function(){K.checked?m.setAttribute("disabled","disabled"):m.removeAttribute("disabled")});t=new CustomDialog(d,t,mxUtils.bind(this,function(){d.downloadFile("xml",!M.checked,null,!K.checked,z||!m.checked)}),null,mxResources.get("export"));-d.showDialog(t.container,300,200,!0,!0)}));Editor.enableExportUrl&&d.actions.put("exportUrl",new Action("url...",function(){d.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(t,z,L,K,M,m,y,F,N,O,P,T,Q){y=[];K&&N&&y.push("tags=%7B%7D");t=new EmbedDialog(d,d.createLink(t,z,Q,K,M,m,null,!0,y,null,L,null,T));d.showDialog(t.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));t.init()},null,!0,!0)}));d.actions.put("exportHtml",new Action("formatHtmlEmbedded...",-function(){d.getPublicUrl(d.getCurrentFile(),function(t){d.showHtmlDialog(mxResources.get("export"),null,t,function(z,L,K,M,m,y,F,N,O,P,T,Q){d.createHtml(z,L,K,M,m,y,F,N,O,P,T,mxUtils.bind(this,function(R,W){var X=d.getBaseFilename(F);R='\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>'+R+"\n"+W+"\n</body>\n</html>";d.saveData(X+(".drawio"==X.substring(X.lenth--7)?"":".drawio")+".html","html",R,"text/html")}),Q)})})}));d.actions.put("exportPdf",new Action("formatPdf...",function(){d.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!d.isOffline()&&!d.printPdfExport?mxUtils.bind(this,function(t,z){t=null!=d.pages?d.pages.length:1;var L=null==d.pages||1>=d.pages.length,K=d.getPageIndex(d.currentPage);K=null!=K?K+1:1;d.downloadFile("pdf",null,null,!z.selection,L||!z.allPages&&z.pagesFrom==K&&z.pagesTo==K,!z.crop,z.transparent,z.scale,null,+d.showDialog(t.container,300,200,!0,!0)}));Editor.enableExportUrl&&d.actions.put("exportUrl",new Action("url...",function(){d.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(t,z,L,K,M,m,y,E,P,O,Q,U,R){y=[];K&&P&&y.push("tags=%7B%7D");t=new EmbedDialog(d,d.createLink(t,z,R,K,M,m,null,!0,y,null,L,null,U));d.showDialog(t.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));t.init()},null,!0,!0)}));d.actions.put("exportHtml",new Action("formatHtmlEmbedded...",+function(){d.getPublicUrl(d.getCurrentFile(),function(t){d.showHtmlDialog(mxResources.get("export"),null,t,function(z,L,K,M,m,y,E,P,O,Q,U,R){d.createHtml(z,L,K,M,m,y,E,P,O,Q,U,mxUtils.bind(this,function(S,W){var X=d.getBaseFilename(E);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(X)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+S+"\n"+W+"\n</body>\n</html>";d.saveData(X+(".drawio"==X.substring(X.lenth-+7)?"":".drawio")+".html","html",S,"text/html")}),R)})})}));d.actions.put("exportPdf",new Action("formatPdf...",function(){d.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!d.isOffline()&&!d.printPdfExport?mxUtils.bind(this,function(t,z){t=null!=d.pages?d.pages.length:1;var L=null==d.pages||1>=d.pages.length,K=d.getPageIndex(d.currentPage);K=null!=K?K+1:1;d.downloadFile("pdf",null,null,!z.selection,L||!z.allPages&&z.pagesFrom==K&&z.pagesTo==K,!z.crop,z.transparent,z.scale,null,z.grid,z.includeCopy,z.allPages||z.pagesFrom==K&&z.pagesTo==K?null:{from:Math.max(0,Math.min(t-1,z.pagesFrom-1)),to:Math.max(0,Math.min(t-1,z.pagesTo-1))},z.border,z.fit,z.sheetsAcross,z.sheetsDown,z.shadows)}):null,mxResources.get("export"))}));d.actions.addAction("open...",function(){d.pickFile()});d.actions.addAction("close",function(){function t(){null!=z&&z.removeDraft();d.fileLoaded(new LocalFile(d,d.emptyDiagramXml,null,!0))}var z=d.getCurrentFile();null!=z&&z.isModified()?d.confirm(mxResources.get("allChangesLost"),null,t,mxResources.get("cancel"),mxResources.get("discardChanges")):t()});d.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==p.getSelectionCount()){var t=p.getSelectionCell(),z=p.view.getState(t);null!=z&&null!=z.shape&&null!=z.shape.stencil&&(t=new EditShapeDialog(d,t,mxResources.get("editShape")),d.showDialog(t.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),t.init())}}));d.actions.addAction("revisionHistory...",function(){d.isRevisionHistorySupported()?d.spinner.spin(document.body,mxResources.get("loading"))&&d.getRevisions(mxUtils.bind(this,function(t,z){d.spinner.stop();t=new RevisionDialog(d,t,z);d.showDialog(t.container,640,480,!0,!0);t.init()}),mxUtils.bind(this,function(t){d.handleError(null!=t?t:mxResources.get("notAvailable"))})):d.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});d.actions.addAction("createRevision",function(){d.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");u=d.actions.addAction("synchronize",@@ -14516,66 +14528,66 @@ p.adaptiveColors});u=d.actions.put("simpleAdaptiveColors",new Action("simple",fup.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(t,z){this.addMenuItems(t,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],z)})));isLocalStorage&&(u=d.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());urlParams.splash=mxSettings.getShowStartScreen()?"1":"0";mxSettings.save()}),u.setToggleAction(!0),u.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var A=d.actions.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});A.setToggleAction(!0);A.setSelectedCallback(function(){return A.isEnabled()&&d.editor.autosave});d.actions.addAction("editGeometry...",function(){for(var t=p.getSelectionCells(),z=[],L=0;L<t.length;L++)p.getModel().isVertex(t[L])&&z.push(t[L]);0<z.length&&(t=new EditGeometryDialog(d,z),d.showDialog(t.container,200,270,!0,!0),t.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");d.actions.addAction("copyStyle",function(){if(p.isEnabled()&&1==p.getSelectionCount()){var t=p.getSelectionCell(),z=p.getCellStyle(t,!1);d.copiedStyle={};var L=[],K=[],M;for(M in z)L.push(z[M]),K.push(M);p.copyCellStyles([t],K,L,d.copiedStyle,d.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");d.actions.addAction("pasteStyle",function(){p.isEnabled()&&!p.isSelectionEmpty()&&null!=d.copiedStyle&&p.pasteCellStyles(p.includeDescendants(p.getSelectionCells()),d.copiedStyle,d.copiedStyle,!0)},null,null,Editor.altKey+"+V");-d.actions.put("exportSvg",new Action("formatSvg...",function(){d.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(t,z,L,K,M,m,y,F,N,O,P,T,Q,R){t=parseInt(t);d.lastExportSvgEditable=M;!isNaN(t)&&0<t&&d.exportSvg(t/100,z,L,K,M,m,y,!F,N,O,T,Q,R)}),!0,d.lastExportSvgEditable,"svg",!0)}));d.actions.put("exportPng",new Action("formatPng...",function(){k("png",d.lastExportPngEditable,function(t,z,L,K,M){d.lastExportPngEditable=-M})}));d.actions.put("exportJpg",new Action("formatJpg...",function(){k("jpeg")}));d.actions.put("exportWebp",new Action("formatWebp...",function(){k("webp")}));d.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif",null,"Animated GIF")+"...",function(){d.showAnimatedGifExportDialog()}));u=d.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var t=mxUtils.sortCells(p.model.getTopmostCells(p.getSelectionCells())),z=mxUtils.getXml(0==t.length?d.editor.getGraphXml():-p.encodeCells(t));d.copyImage(t,z)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");u.visible=Editor.enableNativeClipboard&&d.editor.isExportToCanvas();u=d.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var t=mxUtils.sortCells(p.model.getTopmostCells(p.getSelectionCells())),z=mxUtils.getXml(0==t.length?d.editor.getGraphXml():p.encodeCells(t));d.copySvg(t,z)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");u.visible=Editor.enableNativeClipboard&&d.editor.isExportToCanvas();-u=d.actions.put("shadowVisible",new Action("shadow",function(){p.setShadowVisible(!p.shadowVisible)}));u.setToggleAction(!0);u.setSelectedCallback(function(){return p.shadowVisible});d.actions.put("about",new Action("v"+EditorUi.VERSION,function(t,z){mxEvent.isShiftDown(z)&&(EditorUi.isElectronApp||d.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));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("downloadDesktop...",function(){d.openLink("https://get.diagrams.net/")});d.actions.addAction("exportOptionsDisabled...",function(){d.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});d.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||-EditorUi.isElectronApp||navigator.standalone?d.openLink("https://app.diagrams.net/shortcuts.svg"):d.openLink("shortcuts.svg")});d.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?d.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):d.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});u=d.actions.addAction("tags",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(d,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",-mxUtils.bind(this,function(){d.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+K");u.setToggleAction(!0);u.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));(Editor.enableAi||-(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!d.isOffline()&&!EditorUi.isElectronApp&&0<Editor.aiActions.length&&d.isExternalDataComms()&&"draw.io"==d.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(u=d.actions.put("generate",new Action("generate",function(){Editor.enableAi?null!=d.chatWindow?d.chatWindow.window.setVisible(!d.chatWindow.window.isVisible()):d.openGenerateDialog(""):-d.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),u.isEnabled=function(){return q()},u.setToggleAction(!0),u.setSelectedCallback(function(){return null!=d.chatWindow&&d.chatWindow.window.isVisible()}));u=d.actions.addAction("findReplace",mxUtils.bind(this,function(t,z){d.showSearchWindow(p.isEnabled()&&(null==z||!mxEvent.isShiftDown(z)))}),null,null,Editor.ctrlKey+"+F");u=new Action("exportVsdx",function(){var t=-null==d.pages||1>=d.pages.length;if(t)d.exportVisio();else{var z=document.createElement("div");z.style.whiteSpace="nowrap";var L=document.createElement("h3");mxUtils.write(L,mxResources.get("formatVsdx"));L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";z.appendChild(L);var K=d.addCheckbox(z,mxResources.get("allPages"),!t,t);K.style.marginBottom="16px";t=new CustomDialog(d,z,mxUtils.bind(this,function(){d.exportVisio(!K.checked)}),null,mxResources.get("export"));d.showDialog(t.container,-300,130,!0,!0)}});u.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};d.actions.put("exportVsdx",u);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&d.actions.addAction("configuration...",function(){var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.marginRight="8px";t.checked=mxSettings.getShowStartScreen();t.defaultChecked=t.checked;if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||"min"==Editor.currentTheme)){var z=-document.createElement("span");z.style.display="flex";z.style.alignItems="center";z.style.cssFloat="right";z.style.cursor="pointer";z.style.userSelect="none";z.style.marginTop="-3px";z.appendChild(t);mxUtils.write(z,mxResources.get("showStartScreen"));mxEvent.addListener(z,"click",function(K){mxEvent.getSource(K)!=t&&(t.checked=!t.checked)});header=z}z=[[mxResources.get("reset"),function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),d.hideDialog(),-d.alert(mxResources.get("restartForChangeRequired"))}catch(K){d.handleError(K)}})}]];if(!d.isOfflineApp()&&isLocalStorage&&d.mode!=App.MODE_ATLAS){var L=d.actions.get("plugins");null==L||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||z.push([mxResources.get("plugins"),L.funct])}EditorUi.isElectronApp||z.push([mxResources.get("link"),function(K,M){if(0<M.value.length)try{var m=JSON.parse(M.value),y=window.location.protocol+"//"+window.location.host+"/"+d.getSearch()+-"#_CONFIG_"+Graph.compress(JSON.stringify(m)),F=new EmbedDialog(d,y);d.showDialog(F.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));F.init()}catch(N){d.handleError(N)}else d.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=d.getServiceName()&&"1"!=urlParams.embed&&z.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(K){d.handleError(K)}})}]])}]);d.showLocalStorageDialog(mxResources.get("configuration")+":",Editor.configurationKey,z,t.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=t.parentNode&&(mxSettings.setShowStartScreen(t.checked),mxSettings.save())})});(mxClient.IS_CHROMEAPP||isLocalStorage)&&-this.put("language",new Menu(mxUtils.bind(this,function(t,z){var L=mxLanguage;null==urlParams.lang&&isLocalStorage&&(L=mxSettings.settings.language);var K=mxUtils.bind(this,function(m){var y=""==m?mxResources.get("automatic"):mxLanguageMap[m],F=null;""!=y&&(F=t.addItem(y,null,mxUtils.bind(this,function(){d.setAndPersistLanguage(m)}),z),(m==L||""==m&&null==L)&&t.addCheckmark(F,Editor.checkmarkImage));return F});K("");t.addSeparator(z);for(var M in mxLanguageMap)K(M)})));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(t){null==d.adaptiveColorsWindow&&(d.adaptiveColorsWindow=new AdaptiveColorsWindow(d,document.body.offsetWidth-520,80,200,160));d.adaptiveColorsWindow.window.setVisible(!0)}));u=this.get("viewZoom");-var J=u.funct;u.funct=mxUtils.bind(this,function(t,z){J.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(t,["-","outline","fullscreen"],z)});u=this.get("layout");var I=u.funct;u.funct=function(t,z){I.apply(this,arguments);t.addItem(mxResources.get("orgChart"),null,function(){var L=null,K=20,M=20,m=function(){"undefined"!==typeof mxOrgChartLayout&&null!=L&&d.tryAndHandle(mxUtils.bind(this,function(){var R=d.editor.graph,W=new mxOrgChartLayout(R,L,K,-M),X=R.getDefaultParent();1<R.model.getChildCount(R.getSelectionCell())&&(X=R.getSelectionCell());W.execute(X)}))},y=document.createElement("div"),F=document.createElement("div");F.style.marginTop="6px";F.style.display="inline-block";F.style.width="180px";mxUtils.write(F,mxResources.get("orgChartType")+": ");y.appendChild(F);var N=document.createElement("select");N.style.width="160px";N.style.boxSizing="border-box";F=[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 O=0;O<F.length;O++){var P=document.createElement("option");mxUtils.write(P,F[O]);P.value=O;2==O&&P.setAttribute("selected","selected");N.appendChild(P)}mxEvent.addListener(N,"change",function(){L=N.value});y.appendChild(N);F=document.createElement("div");F.style.marginTop="6px";F.style.display="inline-block";F.style.width="180px";mxUtils.write(F,-mxResources.get("parentChildSpacing")+": ");y.appendChild(F);var T=document.createElement("input");T.type="number";T.value=K;T.style.width="160px";T.style.boxSizing="border-box";y.appendChild(T);mxEvent.addListener(T,"change",function(){K=T.value});F=document.createElement("div");F.style.marginTop="6px";F.style.display="inline-block";F.style.width="180px";mxUtils.write(F,mxResources.get("siblingSpacing")+": ");y.appendChild(F);var Q=document.createElement("input");Q.type="number";Q.value=M;Q.style.width=-"160px";Q.style.boxSizing="border-box";y.appendChild(Q);mxEvent.addListener(Q,"change",function(){M=Q.value});F=mxUtils.button(mxResources.get("custom")+"...",function(){var R=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(N.value),parentChildSpacing:parseInt(T.value),siblingSpacing:parseInt(Q.value)}}];d.hideDialog();d.showCustomLayoutDialog(JSON.stringify(R,null,2))});F.className="geBtn";y=new CustomDialog(d,y,function(){null==L&&(L=2);d.loadOrgChartLayouts(m)},null,null,null,F);d.showDialog(y.container,-355,140,!0,!0)},z,null,q());t.addSeparator(z);t.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){d.tryAndHandle(mxUtils.bind(this,function(){var L=new mxParallelEdgeLayout(p);L.checkOverlap=!0;d.prompt(mxResources.get("spacing"),L.spacing,mxUtils.bind(this,function(K){d.tryAndHandle(mxUtils.bind(this,function(){L.spacing=K;d.executeLayout(function(){L.execute(p.getDefaultParent(),p.isSelectionEmpty()?null:p.getSelectionCells())},!1)}))}))}))}),z);t.addSeparator(z);d.menus.addMenuItem(t,-"runLayout",z,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(t,z){if(mxClient.IS_CHROMEAPP||!d.isOffline()&&!navigator.standalone){var L=t.addItem(mxResources.get("search")+":",null,null,z,null,null,!1);L.style.cursor="default";var K=document.createElement("input");K.setAttribute("type","text");K.setAttribute("size","25");K.style.borderWidth="1px";K.style.marginLeft="8px";mxEvent.addListener(K,"keydown",mxUtils.bind(this,function(M){var m=mxUtils.trim(K.value);-13==M.keyCode&&0<m.length?(this.editorUi.searchHelp(m),K.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==M.keyCode&&(K.value="")}));L.firstChild.nextSibling.appendChild(K);mxEvent.addGestureListeners(K,function(M){document.activeElement!=K&&K.focus();mxEvent.consume(M)},function(M){mxEvent.consume(M)},function(M){mxEvent.consume(M)});window.setTimeout(function(){K.focus()},0);EditorUi.isElectronApp?(d.actions.addAction("website...",function(){d.openLink("https://www.drawio.com")}),-d.actions.addAction("check4Updates",function(){d.checkForUpdates()}),d.actions.put("desktopZoomIn",new Action("zoomIn",function(){d.desktopZoomIn()})),d.actions.put("desktopZoomOut",new Action("zoomOut",function(){d.desktopZoomOut()})),d.actions.put("desktopResetZoom",new Action("actualSize",function(){d.desktopResetZoom()})),this.addMenuItems(t,"- keyboardShortcuts quickStart website support -".split(" "),z),"1"!=urlParams.disableUpdate&&this.addMenuItems(t,["check4Updates","-"],z),this.addMenuItems(t,-"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),z)):this.addMenuItems(t,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),z)}else this.addMenuItems(t,["keyboardShortcuts","-","about"],z);"1"==urlParams.test&&(t.addSeparator(z),this.addSubmenu("testDevelop",t,z))})));d.actions.addAction("languageCode...",function(){var t=new FilenameDialog(d,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(z){null!=z&&(Graph.diagramLanguage=-0<z.length?z:null,Graph.translateDiagram=!0,p.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");d.showDialog(t.container,340,80,!0,!0);t.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(t,z){this.addMenuItems(t,["languageCode","-"],z);z=t.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;p.refresh()},z);Graph.translateDiagram||t.addCheckmark(z,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");-mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.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(!p.isSelectionEmpty()){var t=p.cloneCells(p.getSelectionCells()),z=p.getBoundingBoxFromGeometry(t,!0);t=p.moveCells(t,-z.x,-z.y);d.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+z.width+", "+z.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(p.encodeCells(t)))+"'),")}}));d.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function t(y){return null==-y||null==y.boundingBox||!isNaN(y.boundingBox.x)&&!isNaN(y.boundingBox.y)&&!isNaN(y.boundingBox.width)&&!isNaN(y.boundingBox.height)}var z=p.isSelectionEmpty()?p.getGraphBounds():p.getBoundingBox(p.getSelectionCells()),L=p.view.translate,K=p.view.scale;p.insertVertex(p.getDefaultParent(),null,"",z.x/K-L.x,z.y/K-L.y,z.width/K,z.height/K,"fillColor=none;strokeColor=red;");var M=0,m=0;p.view.states.visit(function(y,F){y=!0;t(F.shape)||(console.log("invalid shape",F.cell.id,F.shape),y=!1);t(F.text)||(console.log("invalid text",-F.cell.id,F.text),y=!1);y||M++;m++});console.log("states checked",m,"invalid",M)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var t=null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";t=new TextareaDialog(d,"Paste Data:",t,function(z){if(0<z.length)try{var L=function(F){function N(ba){if(null==Z[ba]){if(Z[ba]=!0,null!=T[ba]){for(;0<T[ba].length;){var ea=T[ba].pop();N(ea)}delete T[ba]}}else mxLog.debug(O+": Visited: "+ba)}var O=F.parentNode.id,-P=F.childNodes;F={};for(var T={},Q=null,R={},W=0;W<P.length;W++){var X=P[W];if(null!=X.id&&0<X.id.length)if(null==F[X.id]){F[X.id]=X.id;var Y=X.getAttribute("parent");null==Y?null!=Q?mxLog.debug(O+": Multiple roots: "+X.id):Q=X.id:(null==T[Y]&&(T[Y]=[]),T[Y].push(X.id))}else R[X.id]=X.id}P=Object.keys(R);0<P.length?(P=O+": "+P.length+" Duplicates: "+P.join(", "),mxLog.debug(P+" (see console)")):mxLog.debug(O+": Checked");var Z={};null==Q?mxLog.debug(O+": No root"):(N(Q),Object.keys(Z).length!=Object.keys(F).length&&-(mxLog.debug(O+": Invalid tree: (see console)"),console.log(O+": Invalid tree",T)))};"<"!=z.charAt(0)&&(z=Graph.decompress(z),mxLog.debug("See console for uncompressed XML"),console.log("xml",z));var K=mxUtils.parseXml(z),M=d.getPagesForNode(K.documentElement,"mxGraphModel");if(null!=M&&0<M.length)try{var m=d.getHashValueForPages(M);mxLog.debug("Checksum: ",m)}catch(F){mxLog.debug("Error: ",F.message)}else mxLog.debug("No pages found for checksum");var y=K.getElementsByTagName("root");for(z=0;z<y.length;z++)L(y[z]);-mxLog.show()}catch(F){d.handleError(F),null!=window.console&&console.error(F)}});d.showDialog(t.container,620,460,!0,!0);t.init()}));var G=null;d.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=d.pages){var t=new TextareaDialog(d,"Diff/Sync:","",function(z){var L=d.getCurrentFile();if(0<z.length&&null!=L)try{var K=JSON.parse(z);L.patch([K],null,!0,!0);d.hideDialog()}catch(M){d.handleError(M)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(z,L){G=d.getPagesForXml(d.getFileData(!0));-t.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(G)}],["Diff",function(z,L){try{t.textarea.value=JSON.stringify(d.diffPages(G,d.pages),null,2)}catch(K){d.handleError(K)}}]]);null==G?(G=d.getPagesForXml(d.getFileData(!0)),t.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(G)):t.textarea.value=JSON.stringify(d.diffPages(G,d.pages),null,2);d.showDialog(t.container,620,460,!0,!0);t.init()}else d.alert("No pages")}));-d.actions.addAction("testChecksum",mxUtils.bind(this,function(){var t=d.getCurrentFile();null!=d.pages&&null!=t?d.spinner.spin(document.body,mxResources.get("loading"))&&t.getLatestVersion(function(z){d.spinner.stop();var L=d.getHashValueForPages(d.pages),K=t.getCurrentRevisionId(),M=d.getHashValueForPages(z.getShadowPages()),m=z.getDescriptorChecksum(z.getDescriptor()),y=z.getCurrentRevisionId();console.log("Local File",[t],"modified",t.isModified(),"checksum",L);console.log("Remote File",[z],"rev",-y==K,"desc",m==M,"checksum",M);d.alert("Checksums "+(M==L?"match":"no not match"))},function(z){console.log("Error getLatestVersion",z);d.handleError(z)}):console.log("Checksum: no file or pages")}));d.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var t=d.getCurrentFile();console.log("editorUi",d,"file",t);if(null!=t&&t.isRealtime()){console.log("Checksum ownPages",d.getHashValueForPages(t.ownPages));console.log("Checksum theirPages",d.getHashValueForPages(t.theirPages));console.log("diff ownPages/theirPages",-d.diffPages(t.ownPages,t.theirPages));var z=t.getShadowPages();null!=z&&(console.log("Checksum shadowPages",d.getHashValueForPages(z)),console.log("diff shadowPages/ownPages",d.diffPages(z,t.ownPages)),console.log("diff ownPages/shadowPages",d.diffPages(t.ownPages,z)),console.log("diff theirPages/shadowPages",d.diffPages(t.theirPages,z)));null!=t.sync&&null!=t.sync.snapshot&&(console.log("Checksum snapshot",d.getHashValueForPages(t.sync.snapshot)),console.log("diff ownPages/snapshot",d.diffPages(t.ownPages,-t.sync.snapshot)),console.log("diff theirPages/snapshot",d.diffPages(t.theirPages,t.sync.snapshot)),null!=d.pages&&console.log("diff snapshot/actualPages",d.diffPages(t.sync.snapshot,d.pages)));null!=d.pages&&(console.log("diff ownPages/actualPages",d.diffPages(t.ownPages,d.pages)),console.log("diff theirPages/actualPages",d.diffPages(t.theirPages,d.pages)))}null!=t&&console.log("Shadow pages",[d.getXmlForPages(t.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 t=d.getCurrentFile();null!=t&&t.isRealtime()&&null!=t.shadowPages&&(console.log("patching actualPages to shadowPages",t.patch([d.diffPages(t.shadowPages,d.pages)])),t.ownPages=d.clonePages(d.pages),t.theirPages=d.clonePages(d.pages),t.shadowPages=d.clonePages(d.pages),null!=t.sync&&(t.sync.snapshot=d.clonePages(d.pages)))}));d.actions.addAction("testOptimize",mxUtils.bind(this,function(){p.model.beginUpdate();-try{var t=p.model.cells,z=0,L=[],K=[],M;for(M in t){var m=t[M],y=p.getCurrentCellStyle(m)[mxConstants.STYLE_IMAGE];null!=y&&"data:"==y.substring(0,5)&&(null==L[y]&&(L[y]=(L[y]||0)+1,z++),K.push(m))}p.setCellStyles(mxConstants.STYLE_IMAGE,null,K);console.log("Removed",z,"image(s) from",K.length,"cell(s): ",[K,L])}finally{p.model.endUpdate()}}));d.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(d,p.getModel())}));d.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var t=-new mxImageExport,z=p.getGraphBounds(),L=p.view.scale,K=mxUtils.createXmlDocument(),M=K.createElement("output");K.appendChild(M);K=new mxXmlCanvas2D(M);K.translate(Math.floor((1-z.x)/L),Math.floor((1-z.y)/L));K.scale(1/L);var m=0,y=K.save;K.save=function(){m++;y.apply(this,arguments)};var F=K.restore;K.restore=function(){m--;F.apply(this,arguments)};var N=t.drawShape;t.drawShape=function(O){mxLog.debug("entering shape",O,m);N.apply(this,arguments);mxLog.debug("leaving shape",O,m)};t.drawState(p.getView().getState(p.model.root),-K);mxLog.show();mxLog.debug(mxUtils.getXml(M));mxLog.debug("stateCounter",m)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var E=null,c=null,g=null,l=null,n=null,v=null,x=null,B=null;d.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=E?(p.view.revalidate=E,E=null):(E=p.view.revalidate,p.view.revalidate=function(){var t=Date.now(),z=E.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",+d.actions.put("exportSvg",new Action("formatSvg...",function(){d.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(t,z,L,K,M,m,y,E,P,O,Q,U,R,S){t=parseInt(t);d.lastExportSvgEditable=M;!isNaN(t)&&0<t&&d.exportSvg(t/100,z,L,K,M,m,y,!E,P,O,U,R,S)}),!0,d.lastExportSvgEditable,"svg",!0)}));d.actions.put("exportPng",new Action("formatPng...",function(){k("png",d.lastExportPngEditable,function(t,z,L,K,M){d.lastExportPngEditable=+M})}));d.actions.put("exportJpg",new Action("formatJpg...",function(){k("jpeg")}));d.actions.put("exportWebp",new Action("formatWebp...",function(){k("webp")}));d.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif",null,"Animated GIF")+"...",function(){d.showAnimatedGifExportDialog()}));u=d.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var t=mxUtils.sortCells(p.model.getTopmostCells(p.getSelectionCells()));d.copyImage(t)}),null,null,Editor.ctrlKey+"+"+Editor.altKey++"+X");u.visible=Editor.enableNativeClipboard&&d.editor.isExportToCanvas();u=d.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var t=mxUtils.sortCells(p.model.getTopmostCells(p.getSelectionCells()));d.copySvg(t)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");u.visible=Editor.enableNativeClipboard&&d.editor.isExportToCanvas();u=d.actions.put("shadowVisible",new Action("shadow",function(){p.setShadowVisible(!p.shadowVisible)}));u.setToggleAction(!0);u.setSelectedCallback(function(){return p.shadowVisible});+d.actions.put("about",new Action("v"+EditorUi.VERSION,function(t,z){mxEvent.isShiftDown(z)&&(EditorUi.isElectronApp||d.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));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("downloadDesktop...",+function(){d.openLink("https://get.diagrams.net/")});d.actions.addAction("exportOptionsDisabled...",function(){d.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});d.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||navigator.standalone?d.openLink("https://app.diagrams.net/shortcuts.svg"):d.openLink("shortcuts.svg")});d.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?+d.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):d.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});u=d.actions.addAction("tags",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(d,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){d.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),+d.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+K");u.setToggleAction(!0);u.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));(Editor.enableAi||(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!d.isOffline()&&!EditorUi.isElectronApp&&0<Editor.aiActions.length&&+d.isExternalDataComms()&&"draw.io"==d.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(u=d.actions.put("generate",new Action("generate",function(){Editor.enableAi?null!=d.chatWindow?d.chatWindow.window.setVisible(!d.chatWindow.window.isVisible()):d.openGenerateDialog(""):d.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),u.isEnabled=function(){return q()},u.setToggleAction(!0),+u.setSelectedCallback(function(){return null!=d.chatWindow&&d.chatWindow.window.isVisible()}));u=d.actions.addAction("findReplace",mxUtils.bind(this,function(t,z){d.showSearchWindow(p.isEnabled()&&(null==z||!mxEvent.isShiftDown(z)))}),null,null,Editor.ctrlKey+"+F");u=new Action("exportVsdx",function(){var t=null==d.pages||1>=d.pages.length;if(t)d.exportVisio();else{var z=document.createElement("div");z.style.whiteSpace="nowrap";var L=document.createElement("h3");mxUtils.write(L,mxResources.get("formatVsdx"));+L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";z.appendChild(L);var K=d.addCheckbox(z,mxResources.get("allPages"),!t,t);K.style.marginBottom="16px";t=new CustomDialog(d,z,mxUtils.bind(this,function(){d.exportVisio(!K.checked)}),null,mxResources.get("export"));d.showDialog(t.container,300,130,!0,!0)}});u.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};d.actions.put("exportVsdx",u);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&d.actions.addAction("configuration...",+function(){var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.marginRight="8px";t.checked=mxSettings.getShowStartScreen();t.defaultChecked=t.checked;if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||"min"==Editor.currentTheme)){var z=document.createElement("span");z.style.display="flex";z.style.alignItems="center";z.style.cssFloat="right";z.style.cursor="pointer";z.style.userSelect="none";z.style.marginTop="-3px";z.appendChild(t);+mxUtils.write(z,mxResources.get("showStartScreen"));mxEvent.addListener(z,"click",function(K){mxEvent.getSource(K)!=t&&(t.checked=!t.checked)});header=z}z=[[mxResources.get("reset"),function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),d.hideDialog(),d.alert(mxResources.get("restartForChangeRequired"))}catch(K){d.handleError(K)}})}]];if(!d.isOfflineApp()&&isLocalStorage&&d.mode!=App.MODE_ATLAS){var L=d.actions.get("plugins");null==L||"sketch"!=+Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||z.push([mxResources.get("plugins"),L.funct])}EditorUi.isElectronApp||z.push([mxResources.get("link"),function(K,M){if(0<M.value.length)try{var m=JSON.parse(M.value),y=window.location.protocol+"//"+window.location.host+"/"+d.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(m)),E=new EmbedDialog(d,y);d.showDialog(E.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));E.init()}catch(P){d.handleError(P)}else d.handleError({message:mxResources.get("invalidInput")})}]);+"atlassian"!=d.getServiceName()&&"1"!=urlParams.embed&&z.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(K){d.handleError(K)}})}]])}]);d.showLocalStorageDialog(mxResources.get("configuration")++":",Editor.configurationKey,z,t.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=t.parentNode&&(mxSettings.setShowStartScreen(t.checked),mxSettings.save())})});(mxClient.IS_CHROMEAPP||isLocalStorage)&&this.put("language",new Menu(mxUtils.bind(this,function(t,z){var L=mxLanguage;null==urlParams.lang&&isLocalStorage&&(L=mxSettings.settings.language);var K=mxUtils.bind(this,function(m){var y=""==m?mxResources.get("automatic"):mxLanguageMap[m],E=null;""!=y&&(E=t.addItem(y,+null,mxUtils.bind(this,function(){d.setAndPersistLanguage(m)}),z),(m==L||""==m&&null==L)&&t.addCheckmark(E,Editor.checkmarkImage));return E});K("");t.addSeparator(z);for(var M in mxLanguageMap)K(M)})));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(t){null==d.adaptiveColorsWindow&&(d.adaptiveColorsWindow=new AdaptiveColorsWindow(d,document.body.offsetWidth-520,80,200,160));d.adaptiveColorsWindow.window.setVisible(!0)}));u=this.get("viewZoom");var I=u.funct;u.funct=mxUtils.bind(this,function(t,z){I.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(t,["-","outline","fullscreen"],z)});u=this.get("layout");var H=u.funct;u.funct=function(t,z){H.apply(this,arguments);+t.addItem(mxResources.get("orgChart"),null,function(){var L=null,K=20,M=20,m=function(){"undefined"!==typeof mxOrgChartLayout&&null!=L&&d.tryAndHandle(mxUtils.bind(this,function(){var S=d.editor.graph,W=new mxOrgChartLayout(S,L,K,M),X=S.getDefaultParent();1<S.model.getChildCount(S.getSelectionCell())&&(X=S.getSelectionCell());W.execute(X)}))},y=document.createElement("div"),E=document.createElement("div");E.style.marginTop="6px";E.style.display="inline-block";E.style.width="180px";mxUtils.write(E,+mxResources.get("orgChartType")+": ");y.appendChild(E);var P=document.createElement("select");P.style.width="160px";P.style.boxSizing="border-box";E=[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 O=0;O<E.length;O++){var Q=document.createElement("option");mxUtils.write(Q,E[O]);Q.value=O;2==O&&Q.setAttribute("selected",+"selected");P.appendChild(Q)}mxEvent.addListener(P,"change",function(){L=P.value});y.appendChild(P);E=document.createElement("div");E.style.marginTop="6px";E.style.display="inline-block";E.style.width="180px";mxUtils.write(E,mxResources.get("parentChildSpacing")+": ");y.appendChild(E);var U=document.createElement("input");U.type="number";U.value=K;U.style.width="160px";U.style.boxSizing="border-box";y.appendChild(U);mxEvent.addListener(U,"change",function(){K=U.value});E=document.createElement("div");+E.style.marginTop="6px";E.style.display="inline-block";E.style.width="180px";mxUtils.write(E,mxResources.get("siblingSpacing")+": ");y.appendChild(E);var R=document.createElement("input");R.type="number";R.value=M;R.style.width="160px";R.style.boxSizing="border-box";y.appendChild(R);mxEvent.addListener(R,"change",function(){M=R.value});E=mxUtils.button(mxResources.get("custom")+"...",function(){var S=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(P.value),parentChildSpacing:parseInt(U.value),+siblingSpacing:parseInt(R.value)}}];d.hideDialog();d.showCustomLayoutDialog(JSON.stringify(S,null,2))});E.className="geBtn";y=new CustomDialog(d,y,function(){null==L&&(L=2);d.loadOrgChartLayouts(m)},null,null,null,E);d.showDialog(y.container,355,140,!0,!0)},z,null,q());t.addSeparator(z);t.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){d.tryAndHandle(mxUtils.bind(this,function(){var L=new mxParallelEdgeLayout(p);L.checkOverlap=!0;d.prompt(mxResources.get("spacing"),L.spacing,+mxUtils.bind(this,function(K){d.tryAndHandle(mxUtils.bind(this,function(){L.spacing=K;d.executeLayout(function(){L.execute(p.getDefaultParent(),p.isSelectionEmpty()?null:p.getSelectionCells())},!1)}))}))}))}),z);t.addSeparator(z);d.menus.addMenuItem(t,"runLayout",z,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(t,z){if(mxClient.IS_CHROMEAPP||!d.isOffline()&&!navigator.standalone){var L=t.addItem(mxResources.get("search")+":",null,null,z,null,null,!1);+L.style.cursor="default";var K=document.createElement("input");K.setAttribute("type","text");K.setAttribute("size","25");K.style.borderWidth="1px";K.style.marginLeft="8px";mxEvent.addListener(K,"keydown",mxUtils.bind(this,function(M){var m=mxUtils.trim(K.value);13==M.keyCode&&0<m.length?(this.editorUi.searchHelp(m),K.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==M.keyCode&&(K.value="")}));L.firstChild.nextSibling.appendChild(K);mxEvent.addGestureListeners(K,+function(M){document.activeElement!=K&&K.focus();mxEvent.consume(M)},function(M){mxEvent.consume(M)},function(M){mxEvent.consume(M)});window.setTimeout(function(){K.focus()},0);EditorUi.isElectronApp?(d.actions.addAction("website...",function(){d.openLink("https://www.drawio.com")}),d.actions.addAction("check4Updates",function(){d.checkForUpdates()}),d.actions.put("desktopZoomIn",new Action("zoomIn",function(){d.desktopZoomIn()})),d.actions.put("desktopZoomOut",new Action("zoomOut",function(){d.desktopZoomOut()})),+d.actions.put("desktopResetZoom",new Action("actualSize",function(){d.desktopResetZoom()})),this.addMenuItems(t,"- keyboardShortcuts quickStart website support -".split(" "),z),"1"!=urlParams.disableUpdate&&this.addMenuItems(t,["check4Updates","-"],z),this.addMenuItems(t,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),z)):this.addMenuItems(t,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),z)}else this.addMenuItems(t,["keyboardShortcuts",+"-","about"],z);"1"==urlParams.test&&(t.addSeparator(z),this.addSubmenu("testDevelop",t,z))})));d.actions.addAction("languageCode...",function(){var t=new FilenameDialog(d,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(z){null!=z&&(Graph.diagramLanguage=0<z.length?z:null,Graph.translateDiagram=!0,p.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");d.showDialog(t.container,340,80,!0,!0);t.init()});this.put("diagramLanguage",+new Menu(mxUtils.bind(this,function(t,z){this.addMenuItems(t,["languageCode","-"],z);z=t.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;p.refresh()},z);Graph.translateDiagram||t.addCheckmark(z,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");+mxResources.parse("testChecksum=Checksum");mxResources.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(!p.isSelectionEmpty()){var t=p.cloneCells(p.getSelectionCells()),+z=p.getBoundingBoxFromGeometry(t,!0);t=p.moveCells(t,-z.x,-z.y);d.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+z.width+", "+z.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(p.encodeCells(t)))+"'),")}}));d.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function t(y){return null==y||null==y.boundingBox||!isNaN(y.boundingBox.x)&&!isNaN(y.boundingBox.y)&&!isNaN(y.boundingBox.width)&&!isNaN(y.boundingBox.height)}var z=p.isSelectionEmpty()?p.getGraphBounds():+p.getBoundingBox(p.getSelectionCells()),L=p.view.translate,K=p.view.scale;p.insertVertex(p.getDefaultParent(),null,"",z.x/K-L.x,z.y/K-L.y,z.width/K,z.height/K,"fillColor=none;strokeColor=red;");var M=0,m=0;p.view.states.visit(function(y,E){y=!0;t(E.shape)||(console.log("invalid shape",E.cell.id,E.shape),y=!1);t(E.text)||(console.log("invalid text",E.cell.id,E.text),y=!1);y||M++;m++});console.log("states checked",m,"invalid",M)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var t=+null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";t=new TextareaDialog(d,"Paste Data:",t,function(z){if(0<z.length)try{var L=function(E){function P(aa){if(null==Z[aa]){if(Z[aa]=!0,null!=U[aa]){for(;0<U[aa].length;){var fa=U[aa].pop();P(fa)}delete U[aa]}}else mxLog.debug(O+": Visited: "+aa)}var O=E.parentNode.id,Q=E.childNodes;E={};for(var U={},R=null,S={},W=0;W<Q.length;W++){var X=Q[W];if(null!=X.id&&0<X.id.length)if(null==E[X.id]){E[X.id]=X.id;var Y=+X.getAttribute("parent");null==Y?null!=R?mxLog.debug(O+": Multiple roots: "+X.id):R=X.id:(null==U[Y]&&(U[Y]=[]),U[Y].push(X.id))}else S[X.id]=X.id}Q=Object.keys(S);0<Q.length?(Q=O+": "+Q.length+" Duplicates: "+Q.join(", "),mxLog.debug(Q+" (see console)")):mxLog.debug(O+": Checked");var Z={};null==R?mxLog.debug(O+": No root"):(P(R),Object.keys(Z).length!=Object.keys(E).length&&(mxLog.debug(O+": Invalid tree: (see console)"),console.log(O+": Invalid tree",U)))};"<"!=z.charAt(0)&&(z=Graph.decompress(z),+mxLog.debug("See console for uncompressed XML"),console.log("xml",z));var K=mxUtils.parseXml(z),M=d.getPagesForNode(K.documentElement,"mxGraphModel");if(null!=M&&0<M.length)try{var m=d.getHashValueForPages(M);mxLog.debug("Checksum: ",m)}catch(E){mxLog.debug("Error: ",E.message)}else mxLog.debug("No pages found for checksum");var y=K.getElementsByTagName("root");for(z=0;z<y.length;z++)L(y[z]);mxLog.show()}catch(E){d.handleError(E),null!=window.console&&console.error(E)}});d.showDialog(t.container,+620,460,!0,!0);t.init()}));var F=null;d.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=d.pages){var t=new TextareaDialog(d,"Diff/Sync:","",function(z){var L=d.getCurrentFile();if(0<z.length&&null!=L)try{var K=JSON.parse(z);L.patch([K],null,!0,!0);d.hideDialog()}catch(M){d.handleError(M)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(z,L){F=d.getPagesForXml(d.getFileData(!0));t.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "++d.getHashValueForPages(F)}],["Diff",function(z,L){try{t.textarea.value=JSON.stringify(d.diffPages(F,d.pages),null,2)}catch(K){d.handleError(K)}}]]);null==F?(F=d.getPagesForXml(d.getFileData(!0)),t.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(F)):t.textarea.value=JSON.stringify(d.diffPages(F,d.pages),null,2);d.showDialog(t.container,620,460,!0,!0);t.init()}else d.alert("No pages")}));d.actions.addAction("testChecksum",mxUtils.bind(this,function(){var t=+d.getCurrentFile();null!=d.pages&&null!=t?d.spinner.spin(document.body,mxResources.get("loading"))&&t.getLatestVersion(function(z){d.spinner.stop();var L=d.getHashValueForPages(d.pages),K=t.getCurrentRevisionId(),M=d.getHashValueForPages(z.getShadowPages()),m=z.getDescriptorChecksum(z.getDescriptor()),y=z.getCurrentRevisionId();console.log("Local File",[t],"modified",t.isModified(),"checksum",L);console.log("Remote File",[z],"rev",y==K,"desc",m==M,"checksum",M);d.alert("Checksums "+(M==L?"match":+"no not match"))},function(z){console.log("Error getLatestVersion",z);d.handleError(z)}):console.log("Checksum: no file or pages")}));d.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var t=d.getCurrentFile();console.log("editorUi",d,"file",t);if(null!=t&&t.isRealtime()){console.log("Checksum ownPages",d.getHashValueForPages(t.ownPages));console.log("Checksum theirPages",d.getHashValueForPages(t.theirPages));console.log("diff ownPages/theirPages",d.diffPages(t.ownPages,t.theirPages));+var z=t.getShadowPages();null!=z&&(console.log("Checksum shadowPages",d.getHashValueForPages(z)),console.log("diff shadowPages/ownPages",d.diffPages(z,t.ownPages)),console.log("diff ownPages/shadowPages",d.diffPages(t.ownPages,z)),console.log("diff theirPages/shadowPages",d.diffPages(t.theirPages,z)));null!=t.sync&&null!=t.sync.snapshot&&(console.log("Checksum snapshot",d.getHashValueForPages(t.sync.snapshot)),console.log("diff ownPages/snapshot",d.diffPages(t.ownPages,t.sync.snapshot)),console.log("diff theirPages/snapshot",+d.diffPages(t.theirPages,t.sync.snapshot)),null!=d.pages&&console.log("diff snapshot/actualPages",d.diffPages(t.sync.snapshot,d.pages)));null!=d.pages&&(console.log("diff ownPages/actualPages",d.diffPages(t.ownPages,d.pages)),console.log("diff theirPages/actualPages",d.diffPages(t.theirPages,d.pages)))}null!=t&&console.log("Shadow pages",[d.getXmlForPages(t.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 t=d.getCurrentFile();null!=t&&t.isRealtime()&&null!=t.shadowPages&&(console.log("patching actualPages to shadowPages",t.patch([d.diffPages(t.shadowPages,d.pages)])),t.ownPages=d.clonePages(d.pages),t.theirPages=d.clonePages(d.pages),t.shadowPages=d.clonePages(d.pages),null!=t.sync&&(t.sync.snapshot=d.clonePages(d.pages)))}));d.actions.addAction("testOptimize",mxUtils.bind(this,function(){p.model.beginUpdate();try{var t=p.model.cells,z=0,L=+[],K=[],M;for(M in t){var m=t[M],y=p.getCurrentCellStyle(m)[mxConstants.STYLE_IMAGE];null!=y&&"data:"==y.substring(0,5)&&(null==L[y]&&(L[y]=(L[y]||0)+1,z++),K.push(m))}p.setCellStyles(mxConstants.STYLE_IMAGE,null,K);console.log("Removed",z,"image(s) from",K.length,"cell(s): ",[K,L])}finally{p.model.endUpdate()}}));d.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(d,p.getModel())}));d.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var t=new mxImageExport,+z=p.getGraphBounds(),L=p.view.scale,K=mxUtils.createXmlDocument(),M=K.createElement("output");K.appendChild(M);K=new mxXmlCanvas2D(M);K.translate(Math.floor((1-z.x)/L),Math.floor((1-z.y)/L));K.scale(1/L);var m=0,y=K.save;K.save=function(){m++;y.apply(this,arguments)};var E=K.restore;K.restore=function(){m--;E.apply(this,arguments)};var P=t.drawShape;t.drawShape=function(O){mxLog.debug("entering shape",O,m);P.apply(this,arguments);mxLog.debug("leaving shape",O,m)};t.drawState(p.getView().getState(p.model.root),+K);mxLog.show();mxLog.debug(mxUtils.getXml(M));mxLog.debug("stateCounter",m)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var D=null,c=null,g=null,l=null,n=null,v=null,x=null,B=null;d.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=D?(p.view.revalidate=D,D=null):(D=p.view.revalidate,p.view.revalidate=function(){var t=Date.now(),z=D.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-t+" ms","args",arguments);return z});null!=c?(d.selectPage=c,c=null):(c=d.selectPage,d.selectPage=function(){var t=Date.now(),z=c.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-t+" ms","args",arguments);return z});null!=g?(d.diffPages=g,g=null):(g=d.diffPages,d.diffPages=function(){var t=Date.now(),z=g.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-t+" ms","args",arguments);return z});null!=l?(d.patchPages=l,l=null):(l=d.patchPages,d.patchPages=function(){var t=Date.now(),z=l.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-t+" ms","args",arguments);return z});null!=n?(d.clonePages=n,n=null):(n=d.clonePages,d.clonePages=function(){var t=Date.now(),z=n.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-t+" ms","args",arguments);return z});null!=x?(d.getHashValueForPages=x,x=null):(x=d.getHashValueForPages,d.getHashValueForPages=function(){var t=Date.now(),z=x.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-t+" ms","args",arguments);return z});null!=B?(d.resolveCrossReferences=B,B=null):(B=d.resolveCrossReferences,d.resolveCrossReferences=function(){var t=Date.now(),z=B.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-t+" ms","args",arguments);return z});-null!=v?(d.getFileData=v,v=null):(v=d.getFileData,d.getFileData=function(){var t=Date.now(),z=v.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-t+" ms","args",arguments);return z});EditorUi.debug("[Performance]",null!=E?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(t,z){this.addMenuItems(t,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),-z);var L=t.addItem(mxResources.get("testPerformance"),null,function(){d.actions.get("testPerformance").funct()},z);null!=E&&t.addCheckmark(L,Editor.checkmarkImage);this.addMenuItems(t,["-","testShowConsole"],z)})))}d.actions.put("shapes",new Action("moreShapes...",function(t){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?+null!=v?(d.getFileData=v,v=null):(v=d.getFileData,d.getFileData=function(){var t=Date.now(),z=v.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-t+" ms","args",arguments);return z});EditorUi.debug("[Performance]",null!=D?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(t,z){this.addMenuItems(t,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),+z);var L=t.addItem(mxResources.get("testPerformance"),null,function(){d.actions.get("testPerformance").funct()},z);null!=D&&t.addCheckmark(L,Editor.checkmarkImage);this.addMenuItems(t,["-","testShowConsole"],z)})))}d.actions.put("shapes",new Action("moreShapes...",function(t){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("shape...",function(t){p.isEnabled()&&(t=new mxCell("",new mxGeometry(0,0,120,120),d.defaultCustomShapeStyle),t.vertex=!0,t=new EditShapeDialog(d,t,mxResources.get("editShape")),d.showDialog(t.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),t.init())})).isEnabled=q;d.isOffline()||("1"!=urlParams.embed&&(d.actions.put("embedNotion",new Action("notion...",function(){var t=document.createElement("div");t.style.position="absolute";t.style.bottom="30px";t.style.textAlign="center";t.style.width="100%";t.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"));t.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(L){d.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");-mxEvent.consume(L)});d.getPublicUrl(d.getCurrentFile(),function(L){d.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",t,L,d.getCurrentFile(),function(K,M,m,y,F,N,O,P,T,Q,R,W){O=["border=0"];T&&O.push("tags=%7B%7D");K=new EmbedDialog(d,d.createLink(K,M,!0,y,F,N,"public"==Q?L:null,null,O,null,m,null,W));d.showDialog(K.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));K.init()},null,!0)})})),d.actions.addAction("microsoftOffice...",-function(){d.openLink("https://office.draw.io")})),d.actions.put("embedHtml",new Action("html...",function(){d.getPublicUrl(d.getCurrentFile(),function(t){d.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",t,function(z,L,K,M,m,y,F,N,O,P,T,Q){d.createHtml(z,L,K,M,m,y,F,N,O,P,T,mxUtils.bind(this,function(R,W){var X=new EmbedDialog(d,"\x3c!-- "+d.editor.appName+" diagram --\x3e\n"+R+"\n"+W+"\n",null,null,function(){try{var Y=window.open();if(null!=Y&&null!=-Y.document){var Z=Y.document;"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(R);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 ea=Y.document.createElement("div");ea.marginLeft="26px";ea.marginTop="26px";mxUtils.write(ea,-mxResources.get("updatingDocument"));var ha=Y.document.createElement("img");ha.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ha.style.marginLeft="6px";ea.appendChild(ha);Y.document.body.insertBefore(ea,Y.document.body.firstChild);window.setTimeout(function(){var fa=document.createElement("script");fa.type="text/javascript";fa.src=/<script.*?src="(.*?)"/.exec(W)[1];Z.body.appendChild(fa);ea.parentNode.removeChild(ea)},20)}}else d.handleError({message:mxResources.get("errorUpdatingPreview")})}catch(fa){d.handleError(fa)}});-d.showDialog(X.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));X.init()}),Q)})})})),d.actions.put("liveImage",new Action("Live image...",function(){var t=d.getCurrentFile();null!=t&&d.getPublicUrl(t,function(z){null!=z?(z=new EmbedDialog(d,'<img src="'+(t.constructor!=DriveFile?z:"https://drive.google.com/uc?id="+t.getId())+'"/>'),d.showDialog(z.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250)),z.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})})),+mxEvent.consume(L)});d.getPublicUrl(d.getCurrentFile(),function(L){d.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",t,L,d.getCurrentFile(),function(K,M,m,y,E,P,O,Q,U,R,S,W){O=["border=0"];U&&O.push("tags=%7B%7D");K=new EmbedDialog(d,d.createLink(K,M,!0,y,E,P,"public"==R?L:null,null,O,null,m,null,W));d.showDialog(K.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));K.init()},null,!0)})})),d.actions.addAction("microsoftOffice...",+function(){d.openLink("https://office.draw.io")})),d.actions.put("embedHtml",new Action("html...",function(){d.getPublicUrl(d.getCurrentFile(),function(t){d.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",t,function(z,L,K,M,m,y,E,P,O,Q,U,R){d.createHtml(z,L,K,M,m,y,E,P,O,Q,U,mxUtils.bind(this,function(S,W){var X=new EmbedDialog(d,"\x3c!-- "+d.editor.appName+" diagram --\x3e\n"+S+"\n"+W+"\n",null,null,function(){try{var Y=window.open();if(null!=Y&&null!=+Y.document){var Z=Y.document;"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(S);var aa=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;aa&&Z.writeln(W);Z.writeln("</body>");Z.writeln("</html>");Z.close();if(!aa){var fa=Y.document.createElement("div");fa.marginLeft="26px";fa.marginTop="26px";mxUtils.write(fa,+mxResources.get("updatingDocument"));var ia=Y.document.createElement("img");ia.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ia.style.marginLeft="6px";fa.appendChild(ia);Y.document.body.insertBefore(fa,Y.document.body.firstChild);window.setTimeout(function(){var ea=document.createElement("script");ea.type="text/javascript";ea.src=/<script.*?src="(.*?)"/.exec(W)[1];Z.body.appendChild(ea);fa.parentNode.removeChild(fa)},20)}}else d.handleError({message:mxResources.get("errorUpdatingPreview")})}catch(ea){d.handleError(ea)}});+d.showDialog(X.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));X.init()}),R)})})})),d.actions.put("liveImage",new Action("Live image...",function(){var t=d.getCurrentFile();null!=t&&d.getPublicUrl(t,function(z){null!=z?(z=new EmbedDialog(d,'<img src="'+(t.constructor!=DriveFile?z:"https://drive.google.com/uc?id="+t.getId())+'"/>'),d.showDialog(z.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250)),z.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})})),d.actions.put("embedImage",new Action("image...",function(){d.showEmbedImageDialog(function(t,z,L,K,M,m){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedImage(t,z,L,K,M,m,function(y){d.spinner.stop();y=new EmbedDialog(d,y);d.showDialog(y.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));y.init()},function(y){d.spinner.stop();d.handleError(y)})},mxResources.get("image"),mxResources.get("retina"),d.editor.isExportToCanvas())})),d.actions.put("embedSvg",new Action("formatSvg...",function(){d.showEmbedImageDialog(function(t,z,L,K,M,m){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedSvg(t,z,L,K,M,m,function(y){d.spinner.stop();y=new EmbedDialog(d,y);d.showDialog(y.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));y.init()},function(y){d.spinner.stop();d.handleError(y)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")})),d.actions.put("embedIframe",new Action("iframe...",function(){d.getPublicUrl(d.getCurrentFile(),-function(t){var z=p.getGraphBounds();d.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,z.height/p.view.scale))+2,null,null,null,t,d.getCurrentFile(),function(L,K,M,m,y,F,N,O,P,T,Q,R){var W=[];P&&W.push("tags=%7B%7D");L=new EmbedDialog(d,'<iframe frameborder="0" style="width:'+N+";height:"+O+';" src="'+d.createLink(L,K,!0,m,y,F,"public"==T?t:null,null,W,null,M,Q,R)+'"'+(Q?' allowtransparency="true"':"")+"></iframe>");d.showDialog(L.container,450,270,!0,!0,null,!1,null,-new mxRectangle(0,0,400,250));L.init()},!0,!0)})})));d.actions.put("publishLink",new Action("link...",function(){d.getPublicUrl(d.getCurrentFile(),function(t){d.showPublishLinkDialog(null,null,null,null,null,null,t,d.getCurrentFile(),function(z,L,K,M,m,y,F,N,O,P,T,Q){F=[];M&&O&&F.push("tags=%7B%7D");z=new EmbedDialog(d,d.createLink(z,L,!0,M,m,y,"public"==P?t:null,null,F,null,K,null,Q));d.showDialog(z.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));z.init()},null,!0)})},null,null,+function(t){var z=p.getGraphBounds();d.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,z.height/p.view.scale))+2,null,null,null,t,d.getCurrentFile(),function(L,K,M,m,y,E,P,O,Q,U,R,S){var W=[];Q&&W.push("tags=%7B%7D");L=new EmbedDialog(d,'<iframe frameborder="0" style="width:'+P+";height:"+O+';" src="'+d.createLink(L,K,!0,m,y,E,"public"==U?t:null,null,W,null,M,R,S)+'"'+(R?' allowtransparency="true"':"")+"></iframe>");d.showDialog(L.container,450,270,!0,!0,null,!1,null,+new mxRectangle(0,0,400,250));L.init()},!0,!0)})})));d.actions.put("publishLink",new Action("link...",function(){d.getPublicUrl(d.getCurrentFile(),function(t){d.showPublishLinkDialog(null,null,null,null,null,null,t,d.getCurrentFile(),function(z,L,K,M,m,y,E,P,O,Q,U,R){E=[];M&&O&&E.push("tags=%7B%7D");z=new EmbedDialog(d,d.createLink(z,L,!0,M,m,y,"public"==Q?t:null,null,E,null,K,null,R));d.showDialog(z.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));z.init()},null,!0)})},null,null,null,!d.isOffline()));if(isLocalStorage||mxClient.IS_CHROMEAPP)u=d.actions.addAction("scratchpad",function(){d.toggleScratchpad()}),u.setToggleAction(!0),u.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")&&(u=d.actions.addAction("highContrast",function(){d.setAndPersistHighContrast(!d.isHighContrast())}),u.setToggleAction(!0),u.setSelectedCallback(function(){return d.isHighContrast()}));u=d.actions.addAction("search",function(){if(null!=d.sidebar){var t=d.sidebar.isEntryVisible("search");d.sidebar.showPalette("search",!t);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!t,mxSettings.save())}});u.label=mxResources.get("searchShapes");u.setToggleAction(!0);u.setSelectedCallback(function(){return null!=d.sidebar&&d.sidebar.isEntryVisible("search")});d.actions.get("clearDefaultStyle").funct=function(t){p.isEnabled()&&(d.clearDefaultStyle(),Editor.sketchMode&&d.setSketchMode(!1))};"1"==urlParams.embed&&(d.actions.get("saveAs").setEnabled(!1),d.actions.get("save").funct=function(t){p.isEditing()&&p.stopEditing();var z="0"!=urlParams.pages||null!=d.pages&&1<d.pages.length?d.getFileData(!0):mxUtils.getXml(d.editor.getGraphXml());if("json"==urlParams.proto){var L=d.createLoadMessage("save");L.xml=z;!0!==t||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(L.exit=!0);z=JSON.stringify(L)}(window.opener||window.parent).postMessage(z,@@ -14583,18 +14595,18 @@ u.setToggleAction(!0),u.setSelectedCallback(function(){return d.isHighContrast()urlParams.embedInline)d.sendEmbeddedSvgExport();else{var t=function(){d.editor.modified=!1;var z="json"==urlParams.proto?JSON.stringify({event:"exit",modified:d.editor.modified}):"";(window.opener||window.parent).postMessage(z,"*")};d.editor.modified?d.confirm(mxResources.get("allChangesLost"),null,t,mxResources.get("cancel"),mxResources.get("discardChanges")):t()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(t,z){d.editor.isExportToCanvas()?(this.addMenuItems(t,["exportPng"],z),Editor.jpgSupported&&this.addMenuItems(t,["exportJpg"],z),Editor.webpSupported&&this.addMenuItems(t,["exportWebp"],z)):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(t,["exportPng","exportJpg"],z);d.editor.isExportToCanvas()&&this.addMenuItems(t,["exportAnimatedGif"],z);this.addMenuItems(t,["exportSvg","-"],z);d.isOffline()||d.printPdfExport?this.addMenuItems(t,["exportPdf"],z):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(t,["exportPdf"],z);!d.vsdxExportEnabled()||mxClient.IS_IE||"undefined"===typeof VsdxExport&&d.isOffline()||this.addMenuItems(t,["exportVsdx"],z);var L=["-","exportHtml","exportXml"];Editor.enableExportUrl&&L.push("exportUrl");this.addMenuItems(t,L,z);d.isOffline()||(t.addSeparator(z),this.addMenuItem(t,"export",z).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=Editor.currentTheme||d.isOffline()||this.addMenuItems(t,["publishLink"],-z);d.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||d.isOffline()||(t.addSeparator(z),d.menus.addSubmenu("embed",t,z))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(t,z){function L(m){m.pickFile(function(y){d.spinner.spin(document.body,mxResources.get("loading"))&&m.getFile(y,function(F){var N="data:image/"==F.getData().substring(0,11)?M(F.getTitle()):"text/xml";/\.svg$/i.test(F.getTitle())&&!d.editor.isDataSvg(F.getData())&&-(F.setData(Editor.createSvgDataUri(F.getData())),N="image/svg+xml");K(F.getData(),N,F.getTitle())},function(F){d.handleError(F,null!=F?mxResources.get("errorLoadingFile"):null)},m==d.drive)},!0)}var K=mxUtils.bind(this,function(m,y,F){var N=p.view,O=p.getGraphBounds(),P=p.snap(Math.ceil(Math.max(0,O.x/N.scale-N.translate.x)+4*p.gridSize)),T=p.snap(Math.ceil(Math.max(0,(O.y+O.height)/N.scale-N.translate.y)+4*p.gridSize));"data:image/"==m.substring(0,11)?d.loadImage(m,mxUtils.bind(this,function(Q){var R=-!0,W=mxUtils.bind(this,function(){d.resizeImage(Q,m,mxUtils.bind(this,function(X,Y,Z){X=R?Math.min(1,Math.min(d.maxImageSize/Y,d.maxImageSize/Z)):1;d.importFile(m,y,P,T,Math.round(Y*X),Math.round(Z*X),F,function(ba){d.spinner.stop();p.setSelectionCells(ba);p.scrollCellToVisible(p.getSelectionCell())})}),R)});m.length>d.resampleThreshold?d.confirmImageResize(function(X){R=X;W()}):W()}),mxUtils.bind(this,function(){d.handleError({message:mxResources.get("cannotOpenFile")})})):d.importFile(m,y,P,T,0,-0,F,function(Q){d.spinner.stop();p.setSelectionCells(Q);p.scrollCellToVisible(p.getSelectionCell())})}),M=mxUtils.bind(this,function(m){var y="text/xml";/\.png$/i.test(m)?y="image/png":/\.jpe?g$/i.test(m)?y="image/jpg":/\.gif$/i.test(m)?y="image/gif":/\.pdf$/i.test(m)&&(y="application/pdf");return y});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=d.drive?t.addItem(mxResources.get("googleDrive")+"...",null,function(){L(d.drive)},z):d.isModeEnabled(App.MODE_GOOGLE)&&t.addItem(mxResources.get("googleDrive")++z);d.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||d.isOffline()||(t.addSeparator(z),d.menus.addSubmenu("embed",t,z))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(t,z){function L(m){m.pickFile(function(y){d.spinner.spin(document.body,mxResources.get("loading"))&&m.getFile(y,function(E){var P="data:image/"==E.getData().substring(0,11)?M(E.getTitle()):"text/xml";/\.svg$/i.test(E.getTitle())&&!d.editor.isDataSvg(E.getData())&&+(E.setData(Editor.createSvgDataUri(E.getData())),P="image/svg+xml");K(E.getData(),P,E.getTitle())},function(E){d.handleError(E,null!=E?mxResources.get("errorLoadingFile"):null)},m==d.drive)},!0)}var K=mxUtils.bind(this,function(m,y,E){var P=p.view,O=p.getGraphBounds(),Q=p.snap(Math.ceil(Math.max(0,O.x/P.scale-P.translate.x)+4*p.gridSize)),U=p.snap(Math.ceil(Math.max(0,(O.y+O.height)/P.scale-P.translate.y)+4*p.gridSize));"data:image/"==m.substring(0,11)?d.loadImage(m,mxUtils.bind(this,function(R){var S=+!0,W=mxUtils.bind(this,function(){d.resizeImage(R,m,mxUtils.bind(this,function(X,Y,Z){X=S?Math.min(1,Math.min(d.maxImageSize/Y,d.maxImageSize/Z)):1;d.importFile(m,y,Q,U,Math.round(Y*X),Math.round(Z*X),E,function(aa){d.spinner.stop();p.setSelectionCells(aa);p.scrollCellToVisible(p.getSelectionCell())})}),S)});m.length>d.resampleThreshold?d.confirmImageResize(function(X){S=X;W()}):W()}),mxUtils.bind(this,function(){d.handleError({message:mxResources.get("cannotOpenFile")})})):d.importFile(m,y,Q,U,0,+0,E,function(R){d.spinner.stop();p.setSelectionCells(R);p.scrollCellToVisible(p.getSelectionCell())})}),M=mxUtils.bind(this,function(m){var y="text/xml";/\.png$/i.test(m)?y="image/png":/\.jpe?g$/i.test(m)?y="image/jpg":/\.gif$/i.test(m)?y="image/gif":/\.pdf$/i.test(m)&&(y="application/pdf");return y});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=d.drive?t.addItem(mxResources.get("googleDrive")+"...",null,function(){L(d.drive)},z):d.isModeEnabled(App.MODE_GOOGLE)&&t.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},z,null,!1));d.isModeReady(App.MODE_ONEDRIVE)?t.addItem(mxResources.get("oneDrive")+"...",null,function(){L(d.oneDrive)},z):d.isModeEnabled(App.MODE_ONEDRIVE)&&t.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},z,null,!1);d.isModeReady(App.MODE_DROPBOX)?t.addItem(mxResources.get("dropbox")+"...",null,function(){L(d.dropbox)},z):d.isModeEnabled(App.MODE_DROPBOX)&&t.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},z,null,!1);t.addSeparator(z);d.isModeReady(App.MODE_GITHUB)&&t.addItem(mxResources.get("github")+"...",null,function(){L(d.gitHub)},z);d.isModeReady(App.MODE_GITLAB)&&t.addItem(mxResources.get("gitlab")+"...",null,function(){L(d.gitLab)},z);d.isModeReady(App.MODE_TRELLO)?t.addItem(mxResources.get("trello")+"...",null,function(){L(d.trello)},z):d.isModeEnabled(App.MODE_TRELLO)&&t.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+-"...)",null,function(){},z,null,!1);t.addSeparator(z);isLocalStorage&&"0"!=urlParams.browser&&t.addItem(mxResources.get("browser")+"...",null,function(){d.importLocalFile(!1)},z);"1"!=urlParams.noDevice&&t.addItem(mxResources.get("device")+"...",null,function(){d.importLocalFile(!0)},z);d.isOffline()||(t.addSeparator(z),t.addItem(mxResources.get("url")+"...",null,function(){var m=new FilenameDialog(d,"",mxResources.get("import"),function(y){if(null!=y&&0<y.length&&d.spinner.spin(document.body,mxResources.get("loading"))){var F=-/(\.png)($|\?)/i.test(y)?"image/png":"text/xml";d.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(y),function(N){K(N,F,y)},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==F)}},mxResources.get("url"));d.showDialog(m.container,300,80,!0,!0);m.init()},z))}))).isEnabled=q;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(t,z){var L=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&+"...)",null,function(){},z,null,!1);t.addSeparator(z);isLocalStorage&&"0"!=urlParams.browser&&t.addItem(mxResources.get("browser")+"...",null,function(){d.importLocalFile(!1)},z);"1"!=urlParams.noDevice&&t.addItem(mxResources.get("device")+"...",null,function(){d.importLocalFile(!0)},z);d.isOffline()||(t.addSeparator(z),t.addItem(mxResources.get("url")+"...",null,function(){var m=new FilenameDialog(d,"",mxResources.get("import"),function(y){if(null!=y&&0<y.length&&d.spinner.spin(document.body,mxResources.get("loading"))){var E=+/(\.png)($|\?)/i.test(y)?"image/png":"text/xml";d.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(y),function(P){K(P,E,y)},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==E)}},mxResources.get("url"));d.showDialog(m.container,300,80,!0,!0);m.init()},z))}))).isEnabled=q;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(t,z){var L=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&(750>L&&this.addSubmenu("viewZoom",t,z,mxResources.get("zoom")),460>L&&d.isPageMenuVisible()&&this.addSubmenu("pages",t,z),320>L&&this.addSubmenu("insert",t,z),360>L&&"1"!=urlParams.embed&&"draw.io"==d.getServiceName()&&this.addSubmenu("share",t,z))})));this.put("appearance",new Menu(mxUtils.bind(this,function(t,z){if(d.isAutoDarkModeSupported()){var L=d.menus.addMenuItem(t,"autoMode",z);null!=L&&L.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+")")}this.addMenuItems(t,["lightMode","darkMode","-"],z);L=d.menus.addMenuItem(t,"highContrast",z);(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&d.menus.addLinkToItem(L,"https://github.com/jgraph/drawio/issues/4296")})));d.actions.addAction("addToScratchpad",function(t){p.isSelectionEmpty()||null==d.addSelectionToScratchpad||d.addSelectionToScratchpad(t)});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(t,z){var L="1"==urlParams.sketch?"sketch":mxSettings.getUi(),K=t.addItem(mxResources.get("automatic"),null,function(){d.setCurrentTheme("")},z),M=t.addItem(mxResources.get("classic"),null,function(){d.setCurrentTheme("kennedy")},z),m=!1;if("kennedy"==L||"dark"==L)t.addCheckmark(M,Editor.checkmarkImage),m=!0;for(var y=0;y<Editor.themes.length;y++)mxUtils.bind(this,function(F){M=t.addItem(mxResources.get("min"==F?"minimal":F),null,function(){d.setCurrentTheme(F)},-z);L==F&&(t.addCheckmark(M,Editor.checkmarkImage),m=!0);"simple"==F&&t.addSeparator(z)})(Editor.themes[y]);m||t.addCheckmark(K,Editor.checkmarkImage)})));u=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var t=this.editorUi.getCurrentFile();if(null!=t)if(t.constructor==LocalFile&&null!=t.fileHandle)d.showSaveFilePicker(mxUtils.bind(d,function(L,K){t.invalidFileHandle=null;t.fileHandle=L;t.title=K.name;t.desc=K;d.save(K.name)}),null,d.createFileSystemOptions(t.getTitle()));+this.put("theme",new Menu(mxUtils.bind(this,function(t,z){var L="1"==urlParams.sketch?"sketch":mxSettings.getUi(),K=t.addItem(mxResources.get("automatic"),null,function(){d.setCurrentTheme("")},z),M=t.addItem(mxResources.get("classic"),null,function(){d.setCurrentTheme("kennedy")},z),m=!1;if("kennedy"==L||"dark"==L)t.addCheckmark(M,Editor.checkmarkImage),m=!0;for(var y=0;y<Editor.themes.length;y++)mxUtils.bind(this,function(E){M=t.addItem(mxResources.get("min"==E?"minimal":E),null,function(){d.setCurrentTheme(E)},+z);L==E&&(t.addCheckmark(M,Editor.checkmarkImage),m=!0);"simple"==E&&t.addSeparator(z)})(Editor.themes[y]);m||t.addCheckmark(K,Editor.checkmarkImage)})));u=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var t=this.editorUi.getCurrentFile();if(null!=t)if(t.constructor==LocalFile&&null!=t.fileHandle)d.showSaveFilePicker(mxUtils.bind(d,function(L,K){t.invalidFileHandle=null;t.fileHandle=L;t.title=K.name;t.desc=K;d.save(K.name)}),null,d.createFileSystemOptions(t.getTitle()));else{var z=null!=t.getTitle()?t.getTitle():this.editorUi.defaultFilename;z=new FilenameDialog(this.editorUi,z,mxResources.get("rename"),mxUtils.bind(this,function(L){null!=L&&0<L.length&&null!=t&&L!=t.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&t.rename(L,mxUtils.bind(this,function(K){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(K){this.editorUi.handleError(K,null!=K?mxResources.get("errorRenamingFile"):null)}))}),t.constructor==DriveFile||t.constructor==StorageFile?mxResources.get("diagramName"):null,function(L){if(null!=L&&0<L.length)return!0;d.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,d.editor.fileExtensions);this.editorUi.showDialog(z.container,340,100,!0,!0);z.init()}}));u.isEnabled=function(){return this.enabled&&q.apply(this,arguments)};u.visible="1"!=urlParams.embed;d.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var t=d.getCurrentFile();if(null!=t){var z=d.getCopyFilename(t);t.constructor==DriveFile?(z=new SaveDialog(d,z,mxUtils.bind(this,function(L,K,M){d.hideDialog();t.copyFile(mxUtils.bind(this,function(m){t.move(M,mxUtils.bind(this,function(y){d.spinner.stop()}),mxUtils.bind(this,function(y){d.handleError(y)}))}),mxUtils.bind(this,function(m){d.handleError(m)}),L.value)}),null,null,null,null,null,null,[App.MODE_GOOGLE],mxResources.get("ok")),d.showDialog(z.container,420,150,!0,!1,mxUtils.bind(this,function(){d.hideDialog()})),@@ -14604,10 +14616,10 @@ if(t.getMode()==App.MODE_GOOGLE||t.getMode()==App.MODE_ONEDRIVE){var z=new SaveDq;this.put("embed",new Menu(mxUtils.bind(this,function(t,z){var L=d.getCurrentFile();null==L||L.getMode()!=App.MODE_GOOGLE&&L.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(L.getTitle())||this.addMenuItems(t,["liveImage","-"],z);this.addMenuItems(t,["embedImage","embedSvg","-","embedHtml"],z);navigator.standalone||d.isOffline()||this.addMenuItems(t,["embedIframe"],z);this.addMenuItems(t,["-","microsoftOffice","-","embedNotion"],z)})));u=function(t){var z=mxResources.get(t)+"...";d.actions.put(t,new Action(z,function(L){if("fromText"==t||"formatSql"==t||"plantUml"==t||"mermaid"==t){var K=new ParseDialog(d,z,t);d.showDialog(K.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280))}else K=new CreateGraphDialog(d,z,t),d.showDialog(K.container,620,420,!0,!1,function(M,m){if(m)return d.confirm(mxResources.get("areYouSure"),function(){d.hideDialog()}),!1;null!=K.graph&&(null!=K.graph.container.parentNode&&K.graph.container.parentNode.removeChild(K.graph.container),K.graph.destroy(),K.graph=null)});K.init()})).isEnabled=q};u("mermaid");u("horizontalFlow");u("verticalFlow");u("horizontalTree");u("verticalTree");u("radialTree");u("organic");u("circle");u("fromText");u("formatSql");("https://plant-aws.diagrams.net"!=window.PLANT_URL||EditorUi.enablePlantUml&&!d.isOffline())&&u("plantUml");var C=function(t){p.getModel().beginUpdate();try{t=p.addCell(t),p.fireEvent(new mxEventObject("cellsInserted","cells",[t])),p.model.isVertex(t)&&p.isAutoSizeCell(t)&&p.updateCellSize(t)}finally{p.getModel().endUpdate()}p.scrollCellToVisible(t);-p.setSelectionCell(t);p.container.focus();p.editAfterInsert&&p.startEditing(t);window.setTimeout(function(){null!=d.hoverIcons&&d.hoverIcons.update(p.view.getState(t))},0);return t},H=function(t,z,L,K,M){t=new mxCell(t,new mxGeometry(0,0,z,L),K);t.vertex=!0;null==M&&(M=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([t],!0)));t.geometry.x=M.x;t.geometry.y=M.y;return C(t)};d.actions.put("insertText",new Action("text",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&p.startEditingAtCell(H("Text",-60,30,p.appendFontSize(Editor.defaultTextStyle,p.vertexFontSize),null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint()))},null,null,"A")).isEnabled=q;d.actions.put("insertRectangle",new Action("rectangle",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&H("",120,60,"whiteSpace=wrap;html=1;",null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint())},null,null,"D")).isEnabled=q;d.actions.put("insertNote",-new Action("note",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&H("",160,160,Editor.defaultNoteStyle,null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint())},null,null,"S")).isEnabled=q;d.actions.put("insertEllipse",new Action("ellipse",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&H("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?-null:p.getInsertPoint())},null,null,"F")).isEnabled=q;d.actions.put("insertRhombus",new Action("rhombus",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&H("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint())},null,null,"R")).isEnabled=q;d.actions.put("insertEdge",new Action("line",function(t){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var z=p.defaultEdgeLength;t=null==t||+p.setSelectionCell(t);p.container.focus();p.editAfterInsert&&p.startEditing(t);window.setTimeout(function(){null!=d.hoverIcons&&d.hoverIcons.update(p.view.getState(t))},0);return t},G=function(t,z,L,K,M){t=new mxCell(t,new mxGeometry(0,0,z,L),K);t.vertex=!0;null==M&&(M=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([t],!0)));t.geometry.x=M.x;t.geometry.y=M.y;return C(t)};d.actions.put("insertText",new Action("text",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&p.startEditingAtCell(G("Text",+60,30,p.appendFontSize(Editor.defaultTextStyle,p.vertexFontSize),null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint()))},null,null,"A")).isEnabled=q;d.actions.put("insertRectangle",new Action("rectangle",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&G("",120,60,"whiteSpace=wrap;html=1;",null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint())},null,null,"D")).isEnabled=q;d.actions.put("insertNote",+new Action("note",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&G("",160,160,Editor.defaultNoteStyle,null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint())},null,null,"S")).isEnabled=q;d.actions.put("insertEllipse",new Action("ellipse",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&G("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?+null:p.getInsertPoint())},null,null,"F")).isEnabled=q;d.actions.put("insertRhombus",new Action("rhombus",function(t){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&G("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint())},null,null,"R")).isEnabled=q;d.actions.put("insertEdge",new Action("line",function(t){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var z=p.defaultEdgeLength;t=null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint();null==t&&(t=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([L],!0)));var L=new mxCell("",new mxGeometry(0,0,z,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");L.geometry.setTerminalPoint(t,!0);L.geometry.setTerminalPoint(new mxPoint(t.x+L.geometry.width,t.y),!1);L.geometry.points=[];L.geometry.relative=!0;L.edge=!0;C(L)}},null,null,"C")).isEnabled=q;d.actions.put("insertPolygon",new Action("polygon...",function(t){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var z=new PolygonDialog(d,null,function(L){L=new mxCell("",new mxGeometry(0,0,80,80),L);L.vertex=!0;var K=null==t||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||!p.isMouseInsertPoint()?null:p.getInsertPoint();null==K&&(K=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([L],!0)));L.geometry.x=K.x;L.geometry.y=K.y;return C(L)});d.showDialog(z.container,680,540,!0,!0,function(){z.destroy()},null,null,new mxRectangle(0,0,740,600));z.init()}})).isEnabled=q;u=d.actions.put("toggleShapes",new Action("shapes",function(){null!=d.sidebarWindow?d.sidebarWindow.window.setVisible(!d.sidebarWindow.window.isVisible()):d.toggleShapesPanel(!d.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+K"));u.setToggleAction(!0);u.setSelectedCallback(mxUtils.bind(this,function(){return null!=d.sidebarWindow&&d.sidebarWindow.window.isVisible()||null==d.sidebarWindow&&0<d.hsplitPosition}));d.actions.put("showShapePicker",new Action(mxResources.get("shapes")+@@ -14641,8 +14653,8 @@ z);"1"!=urlParams.sketch&&this.addMenuItems(t,["-","fullscreen"],z)}})));this.puL.getName())}),z),t.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){d.removePage(L)}),z),1<d.pages.length&&(d.menus.addSubmenu("movePage",t,z,mxResources.get("move")),t.addSeparator(z)),t.addSeparator(z),t.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){d.duplicatePage(L,mxResources.get("copyOf",[L.getName()]))}),z),1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=d.getServiceName()||t.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){d.editor.editAsNew(d.getFileData(!0,null,null,null,!0,!0))}),z)))})));this.put("pages",new Menu(mxUtils.bind(this,function(t,z){var L=d.currentPage;d.editor.graph.isLightboxView()||(t.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{d.insertPage()}catch(M){d.handleError(M)}}),z,null,d.editor.graph.isEnabled()),t.addSeparator(z));if(null!=d.pages){for(var K=0;K<d.pages.length;K++)mxUtils.bind(this,function(M){var m=null;m=d.pages[M]==L&&!d.editor.graph.isLightboxView()&&d.editor.graph.isEnabled()?d.menus.addSubmenu("currentPage",t,z,d.getShortPageName(L)):t.addItem(d.getShortPageName(d.pages[M]),null,mxUtils.bind(this,function(){d.selectPage(d.pages[M])}),z);var y=d.pages[M].getId();m.setAttribute("title",d.pages[M].getName()+" ("+(M+1)+"/"+d.pages.length+")"+(null!=y?" ["+y+"]":""));d.pages[M]==L&&t.addCheckmark(m,Editor.checkmarkImage)})(K);t.addSeparator(z);t.addItem(mxResources.get("deleteAll"),null,mxUtils.bind(this,function(){p.getModel().beginUpdate();-try{for(var M=d.pages.length;0<=M;M--)d.removePage(d.pages[M])}catch(m){d.handleError(m)}finally{p.getModel().endUpdate()}d.actions.get("resetView").funct()}),z,null,d.editor.graph.isEnabled())}})));if(EditorUi.isElectronApp){var D="1"==urlParams.enableSpellCheck;u=d.actions.addAction("spellCheck",function(){d.toggleSpellCheck();D=!D;d.alert(mxResources.get("restartForChangeRequired"))});u.setToggleAction(!0);u.setSelectedCallback(function(){return D});var U="1"==urlParams.enableStoreBkp;u=d.actions.addAction("autoBkp",-function(){d.toggleStoreBkp();U=!U});u.setToggleAction(!0);u.setSelectedCallback(function(){return U});var S="1"==urlParams.isGoogleFontsEnabled;u=d.actions.addAction("googleFonts",function(){d.toggleGoogleFonts();S=!S;d.alert(mxResources.get("restartForChangeRequired"))});u.setToggleAction(!0);u.setSelectedCallback(function(){return S});d.actions.addAction("openDevTools",function(){d.openDevTools()});d.actions.addAction("drafts...",function(){var t=new FilenameDialog(d,EditorUi.draftSaveDelay/1E3++try{for(var M=d.pages.length;0<=M;M--)d.removePage(d.pages[M])}catch(m){d.handleError(m)}finally{p.getModel().endUpdate()}d.actions.get("resetView").funct()}),z,null,d.editor.graph.isEnabled())}})));if(EditorUi.isElectronApp){var N="1"==urlParams.enableSpellCheck;u=d.actions.addAction("spellCheck",function(){d.toggleSpellCheck();N=!N;d.alert(mxResources.get("restartForChangeRequired"))});u.setToggleAction(!0);u.setSelectedCallback(function(){return N});var J="1"==urlParams.enableStoreBkp;u=d.actions.addAction("autoBkp",+function(){d.toggleStoreBkp();J=!J});u.setToggleAction(!0);u.setSelectedCallback(function(){return J});var T="1"==urlParams.isGoogleFontsEnabled;u=d.actions.addAction("googleFonts",function(){d.toggleGoogleFonts();T=!T;d.alert(mxResources.get("restartForChangeRequired"))});u.setToggleAction(!0);u.setSelectedCallback(function(){return T});d.actions.addAction("openDevTools",function(){d.openDevTools()});d.actions.addAction("drafts...",function(){var t=new FilenameDialog(d,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"));d.showDialog(t.container,320,80,!0,!0);t.init()})}var V=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(t,z){if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){null==V||"1"==urlParams.embed&&null!=urlParams.lang||d.menus.addSubmenu("language",t,z);"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||"1"==urlParams.embedInline||d.menus.addSubmenu("appearance",t,z);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&d.mode!=App.MODE_ATLAS&&d.menus.addSubmenu("theme",t,z);t.addSeparator(z);d.menus.addSubmenu("units",t,z);d.menus.addMenuItems(t,"- copyConnect collapseExpand - tooltips animations -".split(" "),z);var L=d.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=L&&L.isRealtimeEnabled()&&L.isRealtimeSupported()&&this.addMenuItems(t,["showRemoteCursors"],z),d.menus.addMenuItems(t,["ruler","-"],z));EditorUi.isElectronApp&&d.menus.addMenuItems(t,"- googleFonts spellCheck autoBkp drafts -".split(" "),z);this.addSubmenu("diagramLanguage",t,z);t.addSeparator(z);d.mode!=App.MODE_ATLAS&&d.menus.addMenuItem(t,"configuration",z);t.addSeparator(z)}else"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",t,z),"1"==urlParams.embed&&"1"!=urlParams.atlas||d.menus.addSubmenu("appearance",@@ -14665,15 +14677,15 @@ d.menus.addMenuItems(t,["revisionHistory"],z);if(null!=L&&null!=d.fileNode&&"1"!["save","-","share"],z),K=this.addMenuItem(t,"synchronize",z),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(K,"https://www.drawio.com/doc/faq/synchronize"),t.addSeparator(z)):this.addMenuItems(t,["new"],z),this.addSubmenu("openFrom",t,z),isLocalStorage&&this.addSubmenu("openRecent",t,z),null!=L&&L.constructor==DriveFile?this.addMenuItems(t,"new - rename makeCopy openFolder moveToFolder".split(" "),z):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==L||L.constructor==LocalFile&&null==L.fileHandle||(t.addSeparator(z),K=this.addMenuItem(t,"synchronize",z),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(K,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(t,["-","save","saveAs","-"],z),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=d.getServiceName()||d.isOfflineApp()||null==L||this.addMenuItems(t,["share","-"],z),null!=L&&L.isRenamable()&&this.addMenuItems(t,["rename"],z),d.isOfflineApp()?this.addMenuItems(t,["upload"],z):(this.addMenuItems(t,["makeCopy"],z),null!=L&&(L.constructor==OneDriveFile&&this.addMenuItems(t,["moveToFolder"],z),null!=L.getFolderUrl()&&d.menus.addMenuItems(t,["openFolder"],z)))),t.addSeparator(z),this.addSubmenu("importFrom",t,z),this.addSubmenu("exportAs",t,z),d.isOffline()||(t.addSeparator(z),this.addSubmenu("embed",t,z),this.addSubmenu("publish",t,z)),t.addSeparator(z),this.addSubmenu("newLibrary",t,z),this.addSubmenu("openLibraryFrom",t,z),d.isRevisionHistorySupported()&&this.addMenuItems(t,-["-","revisionHistory"],z),null!=L&&null!=d.fileNode&&"1"!=urlParams.embedInline&&(K=null!=L.getTitle()?L.getTitle():d.defaultFilename,(L.constructor==DriveFile&&null!=L.sync&&L.sync.isConnected()||!/(\.html)$/i.test(K))&&this.addMenuItems(t,["-","properties"])),this.addMenuItems(t,["-","pageSetup"],z),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(t,["print"],z),this.addMenuItems(t,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(t,z){function L(P){var T=encodeURIComponent(P.name)+-(null==P.url?"":"@"+encodeURIComponent(P.url));if(!M[T]){for(var Q=P.name,R=0;null!=N[Q.toLowerCase()];)Q=P.name+" ("+ ++R+")";null==F[T]&&(O.push({name:P.name,url:P.url,label:Q,title:P.url}),N[Q.toLowerCase()]=P,F[T]=P)}}for(var K=mxUtils.bind(this,function(P,T,Q,R,W){var X=d.editor.graph,Y=this.styleChange(t,null!=R?R:P,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[P,null!=T?encodeURIComponent(T):null,null],null,z,function(){X.setFont(P,T);d.fireEvent(new mxEventObject("styleChanged","keys",-[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[P,null!=T?encodeURIComponent(T):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")})});Q&&(Q=document.createElement("img"),Q.className="geAdaptiveAsset",Q.setAttribute("src",Editor.crossImage),Q.setAttribute("title",mxResources.get("delete")),Q.setAttribute("valign","absmiddle"),-Q.setAttribute("border","0"),Q.style.position="relative",Q.style.top="2px",Q.style.width="14px",Q.style.cursor="default",Q.style.margin="0 3px",Y.firstChild.nextSibling.nextSibling.appendChild(Q),mxEvent.addListener(Q,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Z){this.removeCustomFont(P,T);this.editorUi.hideCurrentMenu();mxEvent.consume(Z)})));Graph.addFont(P,T);Y.firstChild.nextSibling.style.fontFamily=P;W=null!=R?R:P;null!=T&&(W+=" ("+T+")");Y.setAttribute("title",W)}),-M={},m=0;m<this.defaultFonts.length;m++){var y=this.defaultFonts[m];"string"===typeof y?K(y):null!=y.fontFamily&&null!=y.fontUrl&&(M[encodeURIComponent(y.fontFamily)+"@"+encodeURIComponent(y.fontUrl)]=!0,K(y.fontFamily,y.fontUrl))}t.addSeparator(z);var F={},N={},O=[];for(m=0;m<this.customFonts.length;m++)L(this.customFonts[m]);O.sort(function(P,T){return P.label<T.label?-1:P.label>T.label?1:0});if(0<O.length){for(m=0;m<O.length;m++)K(O[m].name,O[m].url,!0,O[m].label);t.addSeparator(z)}t.addItem(mxResources.get("reset"),-null,mxUtils.bind(this,function(){this.customFonts=[];d.fireEvent(new mxEventObject("customFontsChanged"))}),z);t.addSeparator(z);t.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var P=this.editorUi.editor.graph,T=P.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],Q="s",R=null;if(P.isEditing()){var W=P.getSelectedEditingElement();if(null!=W){var X=mxUtils.getCurrentStyle(W);if(null!=X){T=mxUtils.getCssFontFamily(X.fontFamily);X=P.getView().getState(P.cellEditor.getEditingCell());-R=null!=X?X.style.fontSource:null;for(null!=R&&(R=decodeURIComponent(R));null!=W&&W!=P.cellEditor.textarea;){if(W.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=W.getAttribute("data-font-src")){R=W.getAttribute("data-font-src");break}else if(W.getAttribute("face")==T){R=null;break}W=W.parentNode}null!=R&&(Graph.isGoogleFontUrl(R)?(R=null,Q="g"):Q="w")}}}else X=P.getView().getState(P.getSelectionCell()),null!=X&&(T=X.style[mxConstants.STYLE_FONTFAMILY]||T,W=X.style.fontSource,null!=W&&(W=decodeURIComponent(W),-Graph.isGoogleFontUrl(W)?Q="g":(Q="w",R=W)));null!=R&&R.substring(0,PROXY_URL.length)==PROXY_URL&&(R=decodeURIComponent(R.substr((PROXY_URL+"?url=").length)));var Y=null;document.activeElement==P.cellEditor.textarea&&(Y=P.cellEditor.saveSelection());T=new FontDialog(this.editorUi,T,R,Q,mxUtils.bind(this,function(Z,ba,ea){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(T.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);T.init()}),z,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")};+["-","revisionHistory"],z),null!=L&&null!=d.fileNode&&"1"!=urlParams.embedInline&&(K=null!=L.getTitle()?L.getTitle():d.defaultFilename,(L.constructor==DriveFile&&null!=L.sync&&L.sync.isConnected()||!/(\.html)$/i.test(K))&&this.addMenuItems(t,["-","properties"])),this.addMenuItems(t,["-","pageSetup"],z),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(t,["print"],z),this.addMenuItems(t,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(t,z){function L(Q){var U=encodeURIComponent(Q.name)++(null==Q.url?"":"@"+encodeURIComponent(Q.url));if(!M[U]){for(var R=Q.name,S=0;null!=P[R.toLowerCase()];)R=Q.name+" ("+ ++S+")";null==E[U]&&(O.push({name:Q.name,url:Q.url,label:R,title:Q.url}),P[R.toLowerCase()]=Q,E[U]=Q)}}for(var K=mxUtils.bind(this,function(Q,U,R,S,W){var X=d.editor.graph,Y=this.styleChange(t,null!=S?S:Q,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[Q,null!=U?encodeURIComponent(U):null,null],null,z,function(){X.setFont(Q,U);d.fireEvent(new mxEventObject("styleChanged","keys",+[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[Q,null!=U?encodeURIComponent(U):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")})});R&&(R=document.createElement("img"),R.className="geAdaptiveAsset",R.setAttribute("src",Editor.crossImage),R.setAttribute("title",mxResources.get("delete")),R.setAttribute("valign","absmiddle"),+R.setAttribute("border","0"),R.style.position="relative",R.style.top="2px",R.style.width="14px",R.style.cursor="default",R.style.margin="0 3px",Y.firstChild.nextSibling.nextSibling.appendChild(R),mxEvent.addListener(R,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Z){this.removeCustomFont(Q,U);this.editorUi.hideCurrentMenu();mxEvent.consume(Z)})));Graph.addFont(Q,U);Y.firstChild.nextSibling.style.fontFamily=Q;W=null!=S?S:Q;null!=U&&(W+=" ("+U+")");Y.setAttribute("title",W)}),+M={},m=0;m<this.defaultFonts.length;m++){var y=this.defaultFonts[m];"string"===typeof y?K(y):null!=y.fontFamily&&null!=y.fontUrl&&(M[encodeURIComponent(y.fontFamily)+"@"+encodeURIComponent(y.fontUrl)]=!0,K(y.fontFamily,y.fontUrl))}t.addSeparator(z);var E={},P={},O=[];for(m=0;m<this.customFonts.length;m++)L(this.customFonts[m]);O.sort(function(Q,U){return Q.label<U.label?-1:Q.label>U.label?1:0});if(0<O.length){for(m=0;m<O.length;m++)K(O[m].name,O[m].url,!0,O[m].label);t.addSeparator(z)}t.addItem(mxResources.get("reset"),+null,mxUtils.bind(this,function(){this.customFonts=[];d.fireEvent(new mxEventObject("customFontsChanged"))}),z);t.addSeparator(z);t.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var Q=this.editorUi.editor.graph,U=Q.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],R="s",S=null;if(Q.isEditing()){var W=Q.getSelectedEditingElement();if(null!=W){var X=mxUtils.getCurrentStyle(W);if(null!=X){U=mxUtils.getCssFontFamily(X.fontFamily);X=Q.getView().getState(Q.cellEditor.getEditingCell());+S=null!=X?X.style.fontSource:null;for(null!=S&&(S=decodeURIComponent(S));null!=W&&W!=Q.cellEditor.textarea;){if(W.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=W.getAttribute("data-font-src")){S=W.getAttribute("data-font-src");break}else if(W.getAttribute("face")==U){S=null;break}W=W.parentNode}null!=S&&(Graph.isGoogleFontUrl(S)?(S=null,R="g"):R="w")}}}else X=Q.getView().getState(Q.getSelectionCell()),null!=X&&(U=X.style[mxConstants.STYLE_FONTFAMILY]||U,W=X.style.fontSource,null!=W&&(W=decodeURIComponent(W),+Graph.isGoogleFontUrl(W)?R="g":(R="w",S=W)));null!=S&&S.substring(0,PROXY_URL.length)==PROXY_URL&&(S=decodeURIComponent(S.substr((PROXY_URL+"?url=").length)));var Y=null;document.activeElement==Q.cellEditor.textarea&&(Y=Q.cellEditor.saveSelection());U=new FontDialog(this.editorUi,U,S,R,mxUtils.bind(this,function(Z,aa,fa){null!=Y&&(Q.cellEditor.restoreSelection(Y),Y=null);if(null!=Z&&0<Z.length)if(this.addCustomFont(Z,aa),Q.isEditing())Q.setFont(Z,aa);else{Q.getModel().beginUpdate();try{Q.stopEditing(!1),+Q.setCellStyles(mxConstants.STYLE_FONTFAMILY,Z),Q.setCellStyles("fontSource",null!=aa?encodeURIComponent(aa):null),Q.setCellStyles("FType",null)}finally{Q.getModel().endUpdate()}}}));this.editorUi.showDialog(U.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);U.init()}),z,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,k){this.ui=b;this.page=f;this.previous=this.name=k}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,k){this.ui=b;this.oldIndex=f;this.newIndex=k}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,f,k){this.ui=b;this.previousPage=this.page=f;null!=f&&(this.ui.updatePageRoot(f),null!=k&&(f.viewState=k))}@@ -14694,10 +14706,10 @@ function(){var u=k.apply(this,arguments);null!=p.currentPage&&d!=p.currentPage&&this.editor.addListener("pageSelected",mxUtils.bind(this,function(u,A){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(u,A){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};EditorUi.prototype.scrollToPage=function(b,f){var k=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),d=null!=b?b:this.currentPage;null!=k&&null!=this.tabScroller&&this.tabScroller.children.length>k&&null!=this.tabScroller.children[k]&&(d!=this.lastScrollPage||f)&&(this.tabScroller.children[k].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[k].className="geTab gePageTab geActivePage",this.lastScrollPage=d)};EditorUi.prototype.restoreViewState=function(b,f,k){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(k))};-Graph.prototype.createViewState=function(b){var f=b.getAttribute("page"),k=parseFloat(b.getAttribute("pageScale")),d=parseFloat(b.getAttribute("pageWidth")),p=parseFloat(b.getAttribute("pageHeight")),q=b.getAttribute("background"),u=this.parseBackgroundImage(b.getAttribute("backgroundImage")),A=b.getAttribute("extFonts");if(A)try{A=A.split("|").map(function(J){J=J.split("^");return{name:J[0],url:J[1]}})}catch(J){console.log("ExtFonts format error: "+J.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),-gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:function(){var J=b.getAttribute("fold");return null==J||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?Graph.prototype.defaultFoldingEnabled:"0"!=J}(),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=f?"0"!=f:this.defaultPageVisible,background:null!=q&&0<q.length?q:null,backgroundImage:u,pageScale:isNaN(k)?mxGraph.prototype.pageScale:-k,pageFormat:isNaN(d)||isNaN(p)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,d,p),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var J=b.getAttribute("connect");return null==J||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=J}(),arrows:function(){var J=b.getAttribute("arrows");return null==J||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?-Graph.prototype.defaultConnectionArrowsEnabled:"0"!=J}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:A||[]}};+Graph.prototype.createViewState=function(b){var f=b.getAttribute("page"),k=parseFloat(b.getAttribute("pageScale")),d=parseFloat(b.getAttribute("pageWidth")),p=parseFloat(b.getAttribute("pageHeight")),q=b.getAttribute("background"),u=this.parseBackgroundImage(b.getAttribute("backgroundImage")),A=b.getAttribute("extFonts");if(A)try{A=A.split("|").map(function(I){I=I.split("^");return{name:I[0],url:I[1]}})}catch(I){console.log("ExtFonts format error: "+I.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:function(){var I=b.getAttribute("fold");return null==I||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?Graph.prototype.defaultFoldingEnabled:"0"!=I}(),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=f?"0"!=f:this.defaultPageVisible,background:null!=q&&0<q.length?q:null,backgroundImage:u,pageScale:isNaN(k)?mxGraph.prototype.pageScale:+k,pageFormat:isNaN(d)||isNaN(p)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,d,p),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var I=b.getAttribute("connect");return null==I||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=I}(),arrows:function(){var I=b.getAttribute("arrows");return null==I||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?+Graph.prototype.defaultConnectionArrowsEnabled:"0"!=I}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:A||[]}};Graph.prototype.saveViewState=function(b,f,k,d,p){k||(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",null==b||b.foldingEnabled?"1":"0"));f.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);k=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=k&&(f.setAttribute("pageWidth",k.width),f.setAttribute("pageHeight",k.height));null!=b&&(null!=b.background&&f.setAttribute("background",b.background),d=this.getBackgroundImageObject(b.backgroundImage,d,p),null!=d&&f.setAttribute("backgroundImage",JSON.stringify(d)));f.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");f.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?f.removeAttribute("adaptiveColors"):f.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&f.setAttribute("extFonts",b.extFonts.map(function(q){return q.name+"^"+q.url}).join("|"))};@@ -14720,7 +14732,7 @@ EditorUi.prototype.insertPage=function(b,f,k){this.editor.graph.isEnabled()&&(thEditorUi.prototype.createPage=function(b,f,k){f=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),f);f.setName(null!=b?b:this.createPageName());this.initDiagramNode(f,k);return f};EditorUi.prototype.createPageName=function(){for(var b={},f=0;f<this.pages.length;f++){var k=this.pages[f].getName();null!=k&&0<k.length&&(b[k]=k)}f=this.pages.length;do k=mxResources.get("pageWithNumber",[++f]);while(null!=b[k]);return k};EditorUi.prototype.removePage=function(b){try{var f=this.editor.graph,k=mxUtils.indexOf(this.pages,b);if(f.isEnabled()&&0<=k){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);f.model.beginUpdate();try{var d=this.currentPage;d==b&&1<this.pages.length?(k==this.pages.length-1?k--:k++,d=this.pages[k]):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(p){this.handleError(p)}return b};EditorUi.prototype.duplicatePage=function(b,f){var k=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var p=b.node.cloneNode(!1);p.removeAttribute("id");var q={},u=d.createCellLookup([d.model.root]);k=new DiagramPage(p);k.root=d.cloneCell(d.model.root,null,q);var A=new mxGraphModel;A.prefix=Editor.guid()+"-";A.setRoot(k.root);d.updateCustomLinks(d.createCellMapping(q,u),[k.root]);k.viewState=b==this.currentPage?d.getViewState():b.viewState;this.initDiagramNode(k);-k.viewState.scale=1;delete k.viewState.scrollLeft;delete k.viewState.scrollTop;delete k.viewState.currentRoot;delete k.viewState.defaultParent;k.setName(f);k=this.insertPage(k,mxUtils.indexOf(this.pages,b)+1)}}catch(J){this.handleError(J)}return k};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)};+k.viewState.scale=1;delete k.viewState.scrollLeft;delete k.viewState.scrollTop;delete k.viewState.currentRoot;delete k.viewState.defaultParent;k.setName(f);k=this.insertPage(k,mxUtils.indexOf(this.pages,b)+1)}}catch(I){this.handleError(I)}return k};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=[],k=[],d=0;d<b.length;d++)try{k.push(this.clonePage(b[d]))}catch(p){f.push(mxResources.get("pageWithNumber",[d+1])+": "+p.toString())}if(0<f.length){b=Error(f.join("\n"));try{0<k.length&&(b.fallbackFileData=this.getXmlForPages(k))}catch(p){}throw b;}return k};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var f=new DiagramPage(b.node.cloneNode(!0)),k=b==this.currentPage?this.editor.graph.getViewState():b.viewState;f.viewState=mxUtils.clone(k,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(k){null!=k&&0<k.length&&this.editor.graph.model.execute(new RenamePage(this,b,k))}),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))};@@ -14738,166 +14750,166 @@ EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(nEditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,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.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var f=new mxPopupMenu(mxUtils.bind(this,function(p,q){this.menus.get("pages").funct(p,q)}));f.smartSeparators=!0;f.showDisabled=!0;f.autoExpand=!0;f.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(f,arguments);f.destroy()});var k=mxEvent.getClientX(b),d=mxEvent.getClientY(b);f.popup(k,d,null,b);this.setCurrentMenu(f);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,f){var k=this.createTab(),d=b.getName()||mxResources.get("untitled"),p=b.getId();k.setAttribute("title",d+(null!=p?" ("+p+")":"")+" ["+f+"]");f=document.createElement("span");f.style.maxWidth="160px";f.style.textOverflow="ellipsis";f.style.overflow="hidden";mxUtils.write(f,d);k.appendChild(f);this.addTabListeners(b,k);return k};-EditorUi.prototype.addTabListeners=function(b,f){mxEvent.disableContextMenu(f);var k=this.editor.graph;mxEvent.addListener(f,"dblclick",mxUtils.bind(this,function(J){this.renamePage(b);mxEvent.consume(J)}));var d=document.createElement("div");d.style.backgroundImage="url("+Editor.thinExpandImage+")";d.className="geButton";f.appendChild(d);var p=!1,q=!1,u=mxUtils.bind(this,function(J){p=null!=this.currentMenu;q=b==this.currentPage;this.scrollToPage(b);k.isMouseDown||q||this.selectPage(b)}),A=mxUtils.bind(this,-function(J){if(!k.isMouseDown&&(q&&(mxEvent.isTouchEvent(J)||mxEvent.getSource(J)==d)||mxEvent.isPopupTrigger(J))&&(k.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(J)||!p)){var I=new mxPopupMenu(this.createPageMenu(b));I.smartSeparators=!0;I.showDisabled=!0;I.autoExpand=!0;I.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(I,arguments);this.resetCurrentMenu();I.destroy()});var G=mxEvent.getClientX(J),E=mxEvent.getClientY(J);I.popup(G,E,null,J);-this.setCurrentMenu(I,f)}mxEvent.consume(J)});mxEvent.addGestureListeners(d,u,null,A);mxEvent.addGestureListeners(f,u,null,A)};+EditorUi.prototype.addTabListeners=function(b,f){mxEvent.disableContextMenu(f);var k=this.editor.graph;mxEvent.addListener(f,"dblclick",mxUtils.bind(this,function(I){this.renamePage(b);mxEvent.consume(I)}));var d=document.createElement("div");d.style.backgroundImage="url("+Editor.thinExpandImage+")";d.className="geButton";f.appendChild(d);var p=!1,q=!1,u=mxUtils.bind(this,function(I){p=null!=this.currentMenu;q=b==this.currentPage;this.scrollToPage(b);k.isMouseDown||q||this.selectPage(b)}),A=mxUtils.bind(this,+function(I){if(!k.isMouseDown&&(q&&(mxEvent.isTouchEvent(I)||mxEvent.getSource(I)==d)||mxEvent.isPopupTrigger(I))&&(k.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(I)||!p)){var H=new mxPopupMenu(this.createPageMenu(b));H.smartSeparators=!0;H.showDisabled=!0;H.autoExpand=!0;H.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(H,arguments);this.resetCurrentMenu();H.destroy()});var F=mxEvent.getClientX(I),D=mxEvent.getClientY(I);H.popup(F,D,null,I);+this.setCurrentMenu(H,f)}mxEvent.consume(I)});mxEvent.addGestureListeners(d,u,null,A);mxEvent.addGestureListeners(f,u,null,A)};EditorUi.prototype.createPageMenu=function(b,f){return mxUtils.bind(this,function(k,d){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||k.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),d));this.editor.graph.isEnabled()&&(k.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",-[b.getName()]))}),d),k.addSeparator(d),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",k,d,mxResources.get("move")),k.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),d),k.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,f)}),d))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(d,p,q,u,A){p=null!=p?p:!1;null==q&&(q=this.getFoldableCells(this.getSelectionCells(),d));this.stopEditing();this.model.beginUpdate();try{for(var J=q.slice(),I=0;I<q.length;I++)"1"==mxUtils.getValue(this.getCurrentCellStyle(q[I]),"treeFolding","0")&&this.foldTreeCell(d,q[I]);q=J;q=b.apply(this,arguments)}finally{this.model.endUpdate()}return q};Graph.prototype.foldTreeCell=function(d,p){this.model.beginUpdate();try{var q=-[];this.traverse(p,!0,mxUtils.bind(this,function(A,J){var I=null!=J&&this.isTreeEdge(J);I&&q.push(J);A==p||null!=J&&!I||q.push(A);return(null==J||I)&&(A==p||!this.model.isCollapsed(A))}));this.model.setCollapsed(p,d);for(var u=0;u<q.length;u++)this.model.setVisible(q[u],!d)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(d){return!this.isEdgeIgnored(d)};Graph.prototype.getTreeEdges=function(d,p,q,u,A,J){return this.model.filterCells(this.getEdges(d,p,q,u,A,J),mxUtils.bind(this,-function(I){return this.isTreeEdge(I)}))};Graph.prototype.getIncomingTreeEdges=function(d,p){return this.getTreeEdges(d,p,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(d,p){return this.getTreeEdges(d,p,!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(M){return n.isVertex(M)&&q(M)}function p(M){var m=!1;null!=M&&(m="1"==+[b.getName()]))}),d),k.addSeparator(d),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",k,d,mxResources.get("move")),k.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),d),k.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,f)}),d))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(d,p,q,u,A){p=null!=p?p:!1;null==q&&(q=this.getFoldableCells(this.getSelectionCells(),d));this.stopEditing();this.model.beginUpdate();try{for(var I=q.slice(),H=0;H<q.length;H++)"1"==mxUtils.getValue(this.getCurrentCellStyle(q[H]),"treeFolding","0")&&this.foldTreeCell(d,q[H]);q=I;q=b.apply(this,arguments)}finally{this.model.endUpdate()}return q};Graph.prototype.foldTreeCell=function(d,p){this.model.beginUpdate();try{var q=+[];this.traverse(p,!0,mxUtils.bind(this,function(A,I){var H=null!=I&&this.isTreeEdge(I);H&&q.push(I);A==p||null!=I&&!H||q.push(A);return(null==I||H)&&(A==p||!this.model.isCollapsed(A))}));this.model.setCollapsed(p,d);for(var u=0;u<q.length;u++)this.model.setVisible(q[u],!d)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(d){return!this.isEdgeIgnored(d)};Graph.prototype.getTreeEdges=function(d,p,q,u,A,I){return this.model.filterCells(this.getEdges(d,p,q,u,A,I),mxUtils.bind(this,+function(H){return this.isTreeEdge(H)}))};Graph.prototype.getIncomingTreeEdges=function(d,p){return this.getTreeEdges(d,p,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(d,p){return this.getTreeEdges(d,p,!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(M){return n.isVertex(M)&&q(M)}function p(M){var m=!1;null!=M&&(m="1"==l.getCurrentCellStyle(M).treeMoving);return m}function q(M){var m=!1;null!=M&&(M=n.getParent(M),m=l.view.getState(M),m="tree"==(null!=m?m.style:l.getCellStyle(M)).containerType);return m}function u(M){var m=!1;null!=M&&(M=n.getParent(M),m=l.view.getState(M),l.view.getState(M),m=null!=(null!=m?m.style:l.getCellStyle(M)).childLayout);return m}function A(M){M=l.view.getState(M);if(null!=M){var m=l.getIncomingTreeEdges(M.cell);if(0<m.length&&(m=l.view.getState(m[0]),null!=m&&(m=m.absolutePoints,null!=-m&&0<m.length&&(m=m[m.length-1],null!=m)))){if(m.y==M.y&&Math.abs(m.x-M.getCenterX())<M.width/2)return mxConstants.DIRECTION_SOUTH;if(m.y==M.y+M.height&&Math.abs(m.x-M.getCenterX())<M.width/2)return mxConstants.DIRECTION_NORTH;if(m.x>M.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function J(M,m){m=null!=m?m:!0;l.model.beginUpdate();try{var y=l.model.getParent(M),F=l.getIncomingTreeEdges(M),N=l.cloneCells([F[0],M]);l.model.setTerminal(N[0],l.model.getTerminal(F[0],-!0),!0);var O=A(M),P=y.geometry;O==mxConstants.DIRECTION_SOUTH||O==mxConstants.DIRECTION_NORTH?N[1].geometry.x+=m?M.geometry.width+10:-N[1].geometry.width-10:N[1].geometry.y+=m?M.geometry.height+10:-N[1].geometry.height-10;l.view.currentRoot!=y&&(N[1].geometry.x-=P.x,N[1].geometry.y-=P.y);var T=l.view.getState(M),Q=l.view.scale;if(null!=T){var R=mxRectangle.fromRectangle(T);O==mxConstants.DIRECTION_SOUTH||O==mxConstants.DIRECTION_NORTH?R.x+=(m?M.geometry.width+10:-N[1].geometry.width-10)*Q:R.y+=(m?-M.geometry.height+10:-N[1].geometry.height-10)*Q;var W=l.getOutgoingTreeEdges(l.model.getTerminal(F[0],!0));if(null!=W){for(var X=O==mxConstants.DIRECTION_SOUTH||O==mxConstants.DIRECTION_NORTH,Y=P=F=0;Y<W.length;Y++){var Z=l.model.getTerminal(W[Y],!1);if(O==A(Z)){var ba=l.view.getState(Z);Z!=M&&null!=ba&&(X&&m!=ba.getCenterX()<T.getCenterX()||!X&&m!=ba.getCenterY()<T.getCenterY())&&mxUtils.intersects(R,ba)&&(F=10+Math.max(F,(Math.min(R.x+R.width,ba.x+ba.width)-Math.max(R.x,ba.x))/Q),P=10+Math.max(P,-(Math.min(R.y+R.height,ba.y+ba.height)-Math.max(R.y,ba.y))/Q))}}X?P=0:F=0;for(Y=0;Y<W.length;Y++)if(Z=l.model.getTerminal(W[Y],!1),O==A(Z)&&(ba=l.view.getState(Z),Z!=M&&null!=ba&&(X&&m!=ba.getCenterX()<T.getCenterX()||!X&&m!=ba.getCenterY()<T.getCenterY()))){var ea=[];l.traverse(ba.cell,!0,function(ha,fa){var la=null!=fa&&l.isTreeEdge(fa);la&&ea.push(fa);(null==fa||la)&&ea.push(ha);return null==fa||la});l.moveCells(ea,(m?1:-1)*F,(m?1:-1)*P)}}}return l.addCells(N,y)}finally{l.model.endUpdate()}}function I(M){l.model.beginUpdate();-try{var m=A(M),y=l.getIncomingTreeEdges(M),F=l.cloneCells([y[0],M]);l.model.setTerminal(y[0],F[1],!1);l.model.setTerminal(F[0],F[1],!0);l.model.setTerminal(F[0],M,!1);var N=l.model.getParent(M),O=N.geometry,P=[];l.view.currentRoot!=N&&(F[1].geometry.x-=O.x,F[1].geometry.y-=O.y);l.traverse(M,!0,function(R,W){var X=null!=W&&l.isTreeEdge(W);X&&P.push(W);(null==W||X)&&P.push(R);return null==W||X});var T=M.geometry.width+40,Q=M.geometry.height+40;m==mxConstants.DIRECTION_SOUTH?T=0:m==mxConstants.DIRECTION_NORTH?-(T=0,Q=-Q):m==mxConstants.DIRECTION_WEST?(T=-T,Q=0):m==mxConstants.DIRECTION_EAST&&(Q=0);l.moveCells(P,T,Q);return l.addCells(F,N)}finally{l.model.endUpdate()}}function G(M,m){l.model.beginUpdate();try{var y=l.model.getParent(M),F=l.getIncomingTreeEdges(M),N=A(M);0==F.length&&(F=[l.createEdge(y,null,"",null,null,l.createCurrentEdgeStyle())],N=m);var O=l.cloneCells([F[0],M]);l.model.setTerminal(O[0],M,!0);null==l.model.getTerminal(O[0],!1)&&(l.model.setTerminal(O[0],O[1],!1),l.applyNewEdgeStyle(O[1],-[O[0]],N));F=l.getOutgoingTreeEdges(M);var P=y.geometry;m=[];l.view.currentRoot==y&&(P=new mxRectangle);for(var T=0;T<F.length;T++){var Q=l.model.getTerminal(F[T],!1);null!=Q&&m.push(Q)}var R=l.view.getBounds(m),W=l.view.translate,X=l.view.scale;N==mxConstants.DIRECTION_SOUTH?(O[1].geometry.x=null==R?M.geometry.x+(M.geometry.width-O[1].geometry.width)/2:(R.x+R.width)/X-W.x-P.x+10,O[1].geometry.y+=O[1].geometry.height-P.y+40):N==mxConstants.DIRECTION_NORTH?(O[1].geometry.x=null==R?M.geometry.x+(M.geometry.width--O[1].geometry.width)/2:(R.x+R.width)/X-W.x+-P.x+10,O[1].geometry.y-=O[1].geometry.height+P.y+40):(O[1].geometry.x=N==mxConstants.DIRECTION_WEST?O[1].geometry.x-(O[1].geometry.width+P.x+40):O[1].geometry.x+(O[1].geometry.width-P.x+40),O[1].geometry.y=null==R?M.geometry.y+(M.geometry.height-O[1].geometry.height)/2:(R.y+R.height)/X-W.y+-P.y+10);return l.addCells(O,y)}finally{l.model.endUpdate()}}function E(M,m,y){M=l.getOutgoingTreeEdges(M);y=l.view.getState(y);var F=[];if(null!=y&&null!=M){for(var N=-0;N<M.length;N++){var O=l.view.getState(l.model.getTerminal(M[N],!1));null!=O&&(!m&&Math.min(O.x+O.width,y.x+y.width)>=Math.max(O.x,y.x)||m&&Math.min(O.y+O.height,y.y+y.height)>=Math.max(O.y,y.y))&&F.push(O)}F.sort(function(P,T){return m?P.x+P.width-T.x-T.width:P.y+P.height-T.y-T.height})}return F}function c(M,m){var y=A(M),F=m==mxConstants.DIRECTION_EAST||m==mxConstants.DIRECTION_WEST;(y==mxConstants.DIRECTION_EAST||y==mxConstants.DIRECTION_WEST)==F&&y!=m?g.actions.get("selectParent").funct():y==-m?(m=l.getOutgoingTreeEdges(M),null!=m&&0<m.length&&l.setSelectionCell(l.model.getTerminal(m[0],!1))):(y=l.getIncomingTreeEdges(M),null!=y&&0<y.length&&(F=E(l.model.getTerminal(y[0],!0),F,M),M=l.view.getState(M),null!=M&&(M=mxUtils.indexOf(F,M),0<=M&&(M+=m==mxConstants.DIRECTION_NORTH||m==mxConstants.DIRECTION_WEST?-1:1,0<=M&&M<=F.length-1&&l.setSelectionCell(F[M].cell)))))}var g=this,l=g.editor.graph,n=l.getModel(),v=g.menus.createPopupMenu;g.menus.createPopupMenu=function(M,m,y){v.apply(this,arguments);-if(1==l.getSelectionCount()){m=l.getSelectionCell();var F=l.getOutgoingTreeEdges(m);M.addSeparator();0<F.length&&(d(l.getSelectionCell())&&this.addMenuItems(M,["selectChildren"],null,y),this.addMenuItems(M,["selectDescendants"],null,y));d(l.getSelectionCell())?(M.addSeparator(),0<l.getIncomingTreeEdges(m).length&&this.addMenuItems(M,["selectSiblings","selectParent"],null,y)):0<l.model.getEdgeCount(m)&&this.addMenuItems(M,["selectConnections"],null,y)}};g.actions.addAction("selectChildren",function(M){if(l.isEnabled()&&-1==l.getSelectionCount()){var m=l.getSelectionCell();M=mxEvent.isControlDown(M)?null:l.getOutgoingTreeEdges(m);if(null!=M&&0<M.length){m=[];for(var y=0;y<M.length;y++)m.push(l.model.getTerminal(M[y],!1));l.setSelectionCells(m)}else l.setSelectionCells(l.model.getChildren(m))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("selectDescendants",function(M){var m=l.getSelectionCell();if(l.isEnabled()&&null!=m){var y=[];mxEvent.isControlDown(M)||l.traverse(m,!0,function(F,N){var O=-null!=N&&l.isTreeEdge(N);O&&mxEvent.isControlDown(M)&&y.push(N);(null==N||O)&&y.push(F);return null==N||O});if(0==y.length||1==y.length&&y[0]==m)y=l.model.getDescendants(m);l.setSelectionCells(y)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");g.actions.addAction("selectParent",function(M){var m=l.getSelectionCell();l.isEnabled()&&null!=m&&(M=mxEvent.isControlDown(M)?null:l.getIncomingTreeEdges(m),null!=M&&0<M.length?l.setSelectionCell(l.model.getTerminal(M[0],!0)):l.selectParentCell())},null,-null,Editor.altKey+"+"+Editor.shiftKey+"+P");g.actions.addAction("selectSiblings",function(M){if(l.isEnabled()&&1==l.getSelectionCount()){var m=l.getSelectionCell(),y=mxEvent.isControlDown(M)?null:l.getIncomingTreeEdges(m);M=[];if(null!=y&&0<y.length&&(y=l.getOutgoingTreeEdges(l.model.getTerminal(y[0],!0)),null!=y))for(var F=0;F<y.length;F++)M.push(l.model.getTerminal(y[F],!1));0==M.length&&(M=l.model.getChildren(l.model.getParent(m)));l.setSelectionCells(M)}},null,null,Editor.altKey+"+"+Editor.shiftKey+-"+S");var x=l.removeCells;l.removeCells=function(M,m){m=null!=m?m:!0;null==M&&(M=this.getDeletableCells(this.getSelectionCells()));m&&(M=this.getDeletableCells(this.addAllEdges(M)));for(var y=[],F=0;F<M.length;F++){var N=M[F];n.isEdge(N)&&q(N)&&(y.push(N),N=n.getTerminal(N,!1));if(d(N)){var O=[];l.traverse(N,!0,function(P,T){var Q=null!=T&&l.isTreeEdge(T);Q&&O.push(T);(null==T||Q)&&O.push(P);return null==T||Q});0<O.length&&(y=y.concat(O),N=l.getIncomingTreeEdges(M[F]),M=M.concat(N))}else null!=N&&-y.push(M[F])}M=y;return x.apply(this,arguments)};g.hoverIcons.getStateAt=function(M,m,y){return d(M.cell)?null:this.graph.view.getState(this.graph.getCellAt(m,y))};var B=l.duplicateCells;l.duplicateCells=function(M,m){M=null!=M?M:this.getSelectionCells();for(var y=M.slice(0),F=0;F<y.length;F++){var N=l.view.getState(y[F]);if(null!=N&&d(N.cell)){var O=l.getIncomingTreeEdges(N.cell);for(N=0;N<O.length;N++)mxUtils.remove(O[N],M)}}this.model.beginUpdate();try{var P=B.call(this,M,m);if(P.length==M.length)for(F=-0;F<M.length;F++)if(d(M[F])){var T=l.getIncomingTreeEdges(P[F]);O=l.getIncomingTreeEdges(M[F]);if(0==T.length&&0<O.length){var Q=this.cloneCell(O[0]);this.addEdge(Q,l.getDefaultParent(),this.model.getTerminal(O[0],!0),P[F])}}}finally{this.model.endUpdate()}return P};var C=l.moveCells;l.moveCells=function(M,m,y,F,N,O,P){for(var T=null,Q=[],R=0;R<M.length;R++)(p(M[R])||d(M[R]))&&!u(M[R])&&this.isCellCollapsed(M[R])?Q=Q.concat(this.getSubtree(M[R])):Q.push(M[R]);M=mxUtils.removeDuplicates(Q);this.model.beginUpdate();-try{Q=N;var W=this.getCurrentCellStyle(N);if(null!=M&&d(N)&&"1"==mxUtils.getValue(W,"treeFolding","0")){for(R=0;R<M.length;R++)if(d(M[R])||l.model.isEdge(M[R])&&null==l.model.getTerminal(M[R],!0)){N=l.model.getParent(M[R]);break}if(null!=Q&&N!=Q&&null!=this.view.getState(M[0])){var X=l.getIncomingTreeEdges(M[0]);if(0<X.length){var Y=l.view.getState(l.model.getTerminal(X[0],!0));if(null!=Y){var Z=l.view.getState(Q);null!=Z&&(m=(Z.getCenterX()-Y.getCenterX())/l.view.scale,y=(Z.getCenterY()-Y.getCenterY())/-l.view.scale)}}}}T=C.apply(this,arguments);if(null!=T&&null!=M&&T.length==M.length)for(R=0;R<T.length;R++)if(this.model.isEdge(T[R]))d(Q)&&0>mxUtils.indexOf(T,this.model.getTerminal(T[R],!0))&&this.model.setTerminal(T[R],Q,!0);else if(d(M[R])&&(X=l.getIncomingTreeEdges(M[R]),0<X.length))if(!F)d(Q)&&0>mxUtils.indexOf(M,this.model.getTerminal(X[0],!0))&&this.model.setTerminal(X[0],Q,!0);else if(0==l.getIncomingTreeEdges(T[R]).length){W=Q;if(null==W||W==l.model.getParent(M[R]))W=l.model.getTerminal(X[0],-!0);F=this.cloneCell(X[0]);this.addEdge(F,l.getDefaultParent(),W,T[R])}}finally{this.model.endUpdate()}return T};if(null!=g.sidebar){var H=g.sidebar.dropAndConnect;g.sidebar.dropAndConnect=function(M,m,y,F){var N=l.model,O=null;N.beginUpdate();try{if(O=H.apply(this,arguments),d(M))for(var P=0;P<O.length;P++)if(N.isEdge(O[P])&&null==N.getTerminal(O[P],!0)){N.setTerminal(O[P],M,!0);var T=l.getCellGeometry(O[P]);T.points=null;null!=T.getTerminalPoint(!0)&&T.setTerminalPoint(null,!0)}}finally{N.endUpdate()}return O}}var D=-{67:g.actions.get("selectChildren"),88:g.actions.get("selectDescendants"),80:g.actions.get("selectParent"),83:g.actions.get("selectSiblings")},U={67:g.actions.get("copyStyle"),86:g.actions.get("pasteStyle")},S=g.onKeyDown;g.onKeyDown=function(M){try{var m=l.getSelectionCell();if(l.isEnabled()&&!l.isEditing()&&null!=m){var y=mxEvent.isAltDown(M)&&mxEvent.isShiftDown(M)?D[M.keyCode]:mxEvent.isAltDown(M)?U[M.keyCode]:null;null!=y?(y.funct(M),mxEvent.consume(M)):d(m)&&(y=null,0<l.getIncomingTreeEdges(m).length&&-(9==M.which?y=mxEvent.isShiftDown(M)?I(m):G(m):13==M.which&&(y=J(m,!mxEvent.isShiftDown(M)))),null!=y&&0<y.length?(1==y.length&&l.model.isEdge(y[0])?l.setSelectionCell(l.model.getTerminal(y[0],!1)):l.setSelectionCell(y[y.length-1]),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(m)),l.startEditingAtCell(m),mxEvent.consume(M)):37==M.keyCode?(c(m,mxConstants.DIRECTION_WEST),mxEvent.consume(M)):38==M.keyCode?(c(m,mxConstants.DIRECTION_NORTH),mxEvent.consume(M)):39==M.keyCode?(c(m,mxConstants.DIRECTION_EAST),-mxEvent.consume(M)):40==M.keyCode&&(c(m,mxConstants.DIRECTION_SOUTH),mxEvent.consume(M)))}}catch(F){g.handleError(F)}mxEvent.isConsumed(M)||S.apply(this,arguments)};var V=l.connectVertex;l.connectVertex=function(M,m,y,F,N,O,P){var T=l.getIncomingTreeEdges(M);if(d(M)){var Q=A(M),R=Q==mxConstants.DIRECTION_EAST||Q==mxConstants.DIRECTION_WEST,W=m==mxConstants.DIRECTION_EAST||m==mxConstants.DIRECTION_WEST;return Q==m||0==T.length?G(M,m):R==W?I(M):J(M,m!=mxConstants.DIRECTION_NORTH&&m!=mxConstants.DIRECTION_WEST)}return V.apply(this,-arguments)};l.getSubtree=function(M){var m=[M];!p(M)&&!d(M)||u(M)||l.traverse(M,!0,function(y,F){var N=null!=F&&l.isTreeEdge(F);N&&0>mxUtils.indexOf(m,F)&&m.push(F);(null==F||N)&&0>mxUtils.indexOf(m,y)&&m.push(y);return null==F||N});return m};var t=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){t.apply(this,arguments);(p(this.state.cell)||d(this.state.cell))&&!u(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?+m&&0<m.length&&(m=m[m.length-1],null!=m)))){if(m.y==M.y&&Math.abs(m.x-M.getCenterX())<M.width/2)return mxConstants.DIRECTION_SOUTH;if(m.y==M.y+M.height&&Math.abs(m.x-M.getCenterX())<M.width/2)return mxConstants.DIRECTION_NORTH;if(m.x>M.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function I(M,m){m=null!=m?m:!0;l.model.beginUpdate();try{var y=l.model.getParent(M),E=l.getIncomingTreeEdges(M),P=l.cloneCells([E[0],M]);l.model.setTerminal(P[0],l.model.getTerminal(E[0],+!0),!0);var O=A(M),Q=y.geometry;O==mxConstants.DIRECTION_SOUTH||O==mxConstants.DIRECTION_NORTH?P[1].geometry.x+=m?M.geometry.width+10:-P[1].geometry.width-10:P[1].geometry.y+=m?M.geometry.height+10:-P[1].geometry.height-10;l.view.currentRoot!=y&&(P[1].geometry.x-=Q.x,P[1].geometry.y-=Q.y);var U=l.view.getState(M),R=l.view.scale;if(null!=U){var S=mxRectangle.fromRectangle(U);O==mxConstants.DIRECTION_SOUTH||O==mxConstants.DIRECTION_NORTH?S.x+=(m?M.geometry.width+10:-P[1].geometry.width-10)*R:S.y+=(m?+M.geometry.height+10:-P[1].geometry.height-10)*R;var W=l.getOutgoingTreeEdges(l.model.getTerminal(E[0],!0));if(null!=W){for(var X=O==mxConstants.DIRECTION_SOUTH||O==mxConstants.DIRECTION_NORTH,Y=Q=E=0;Y<W.length;Y++){var Z=l.model.getTerminal(W[Y],!1);if(O==A(Z)){var aa=l.view.getState(Z);Z!=M&&null!=aa&&(X&&m!=aa.getCenterX()<U.getCenterX()||!X&&m!=aa.getCenterY()<U.getCenterY())&&mxUtils.intersects(S,aa)&&(E=10+Math.max(E,(Math.min(S.x+S.width,aa.x+aa.width)-Math.max(S.x,aa.x))/R),Q=10+Math.max(Q,+(Math.min(S.y+S.height,aa.y+aa.height)-Math.max(S.y,aa.y))/R))}}X?Q=0:E=0;for(Y=0;Y<W.length;Y++)if(Z=l.model.getTerminal(W[Y],!1),O==A(Z)&&(aa=l.view.getState(Z),Z!=M&&null!=aa&&(X&&m!=aa.getCenterX()<U.getCenterX()||!X&&m!=aa.getCenterY()<U.getCenterY()))){var fa=[];l.traverse(aa.cell,!0,function(ia,ea){var ma=null!=ea&&l.isTreeEdge(ea);ma&&fa.push(ea);(null==ea||ma)&&fa.push(ia);return null==ea||ma});l.moveCells(fa,(m?1:-1)*E,(m?1:-1)*Q)}}}return l.addCells(P,y)}finally{l.model.endUpdate()}}function H(M){l.model.beginUpdate();+try{var m=A(M),y=l.getIncomingTreeEdges(M),E=l.cloneCells([y[0],M]);l.model.setTerminal(y[0],E[1],!1);l.model.setTerminal(E[0],E[1],!0);l.model.setTerminal(E[0],M,!1);var P=l.model.getParent(M),O=P.geometry,Q=[];l.view.currentRoot!=P&&(E[1].geometry.x-=O.x,E[1].geometry.y-=O.y);l.traverse(M,!0,function(S,W){var X=null!=W&&l.isTreeEdge(W);X&&Q.push(W);(null==W||X)&&Q.push(S);return null==W||X});var U=M.geometry.width+40,R=M.geometry.height+40;m==mxConstants.DIRECTION_SOUTH?U=0:m==mxConstants.DIRECTION_NORTH?+(U=0,R=-R):m==mxConstants.DIRECTION_WEST?(U=-U,R=0):m==mxConstants.DIRECTION_EAST&&(R=0);l.moveCells(Q,U,R);return l.addCells(E,P)}finally{l.model.endUpdate()}}function F(M,m){l.model.beginUpdate();try{var y=l.model.getParent(M),E=l.getIncomingTreeEdges(M),P=A(M);0==E.length&&(E=[l.createEdge(y,null,"",null,null,l.createCurrentEdgeStyle())],P=m);var O=l.cloneCells([E[0],M]);l.model.setTerminal(O[0],M,!0);null==l.model.getTerminal(O[0],!1)&&(l.model.setTerminal(O[0],O[1],!1),l.applyNewEdgeStyle(O[1],+[O[0]],P));E=l.getOutgoingTreeEdges(M);var Q=y.geometry;m=[];l.view.currentRoot==y&&(Q=new mxRectangle);for(var U=0;U<E.length;U++){var R=l.model.getTerminal(E[U],!1);null!=R&&m.push(R)}var S=l.view.getBounds(m),W=l.view.translate,X=l.view.scale;P==mxConstants.DIRECTION_SOUTH?(O[1].geometry.x=null==S?M.geometry.x+(M.geometry.width-O[1].geometry.width)/2:(S.x+S.width)/X-W.x-Q.x+10,O[1].geometry.y+=O[1].geometry.height-Q.y+40):P==mxConstants.DIRECTION_NORTH?(O[1].geometry.x=null==S?M.geometry.x+(M.geometry.width-+O[1].geometry.width)/2:(S.x+S.width)/X-W.x+-Q.x+10,O[1].geometry.y-=O[1].geometry.height+Q.y+40):(O[1].geometry.x=P==mxConstants.DIRECTION_WEST?O[1].geometry.x-(O[1].geometry.width+Q.x+40):O[1].geometry.x+(O[1].geometry.width-Q.x+40),O[1].geometry.y=null==S?M.geometry.y+(M.geometry.height-O[1].geometry.height)/2:(S.y+S.height)/X-W.y+-Q.y+10);return l.addCells(O,y)}finally{l.model.endUpdate()}}function D(M,m,y){M=l.getOutgoingTreeEdges(M);y=l.view.getState(y);var E=[];if(null!=y&&null!=M){for(var P=+0;P<M.length;P++){var O=l.view.getState(l.model.getTerminal(M[P],!1));null!=O&&(!m&&Math.min(O.x+O.width,y.x+y.width)>=Math.max(O.x,y.x)||m&&Math.min(O.y+O.height,y.y+y.height)>=Math.max(O.y,y.y))&&E.push(O)}E.sort(function(Q,U){return m?Q.x+Q.width-U.x-U.width:Q.y+Q.height-U.y-U.height})}return E}function c(M,m){var y=A(M),E=m==mxConstants.DIRECTION_EAST||m==mxConstants.DIRECTION_WEST;(y==mxConstants.DIRECTION_EAST||y==mxConstants.DIRECTION_WEST)==E&&y!=m?g.actions.get("selectParent").funct():y==+m?(m=l.getOutgoingTreeEdges(M),null!=m&&0<m.length&&l.setSelectionCell(l.model.getTerminal(m[0],!1))):(y=l.getIncomingTreeEdges(M),null!=y&&0<y.length&&(E=D(l.model.getTerminal(y[0],!0),E,M),M=l.view.getState(M),null!=M&&(M=mxUtils.indexOf(E,M),0<=M&&(M+=m==mxConstants.DIRECTION_NORTH||m==mxConstants.DIRECTION_WEST?-1:1,0<=M&&M<=E.length-1&&l.setSelectionCell(E[M].cell)))))}var g=this,l=g.editor.graph,n=l.getModel(),v=g.menus.createPopupMenu;g.menus.createPopupMenu=function(M,m,y){v.apply(this,arguments);+if(1==l.getSelectionCount()){m=l.getSelectionCell();var E=l.getOutgoingTreeEdges(m);M.addSeparator();0<E.length&&(d(l.getSelectionCell())&&this.addMenuItems(M,["selectChildren"],null,y),this.addMenuItems(M,["selectDescendants"],null,y));d(l.getSelectionCell())?(M.addSeparator(),0<l.getIncomingTreeEdges(m).length&&this.addMenuItems(M,["selectSiblings","selectParent"],null,y)):0<l.model.getEdgeCount(m)&&this.addMenuItems(M,["selectConnections"],null,y)}};g.actions.addAction("selectChildren",function(M){if(l.isEnabled()&&+1==l.getSelectionCount()){var m=l.getSelectionCell();M=mxEvent.isControlDown(M)?null:l.getOutgoingTreeEdges(m);if(null!=M&&0<M.length){m=[];for(var y=0;y<M.length;y++)m.push(l.model.getTerminal(M[y],!1));l.setSelectionCells(m)}else l.setSelectionCells(l.model.getChildren(m))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("selectDescendants",function(M){var m=l.getSelectionCell();if(l.isEnabled()&&null!=m){var y=[];mxEvent.isControlDown(M)||l.traverse(m,!0,function(E,P){var O=+null!=P&&l.isTreeEdge(P);O&&mxEvent.isControlDown(M)&&y.push(P);(null==P||O)&&y.push(E);return null==P||O});if(0==y.length||1==y.length&&y[0]==m)y=l.model.getDescendants(m);l.setSelectionCells(y)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");g.actions.addAction("selectParent",function(M){var m=l.getSelectionCell();l.isEnabled()&&null!=m&&(M=mxEvent.isControlDown(M)?null:l.getIncomingTreeEdges(m),null!=M&&0<M.length?l.setSelectionCell(l.model.getTerminal(M[0],!0)):l.selectParentCell())},null,+null,Editor.altKey+"+"+Editor.shiftKey+"+P");g.actions.addAction("selectSiblings",function(M){if(l.isEnabled()&&1==l.getSelectionCount()){var m=l.getSelectionCell(),y=mxEvent.isControlDown(M)?null:l.getIncomingTreeEdges(m);M=[];if(null!=y&&0<y.length&&(y=l.getOutgoingTreeEdges(l.model.getTerminal(y[0],!0)),null!=y))for(var E=0;E<y.length;E++)M.push(l.model.getTerminal(y[E],!1));0==M.length&&(M=l.model.getChildren(l.model.getParent(m)));l.setSelectionCells(M)}},null,null,Editor.altKey+"+"+Editor.shiftKey++"+S");var x=l.removeCells;l.removeCells=function(M,m){m=null!=m?m:!0;null==M&&(M=this.getDeletableCells(this.getSelectionCells()));m&&(M=this.getDeletableCells(this.addAllEdges(M)));for(var y=[],E=0;E<M.length;E++){var P=M[E];n.isEdge(P)&&q(P)&&(y.push(P),P=n.getTerminal(P,!1));if(d(P)){var O=[];l.traverse(P,!0,function(Q,U){var R=null!=U&&l.isTreeEdge(U);R&&O.push(U);(null==U||R)&&O.push(Q);return null==U||R});0<O.length&&(y=y.concat(O),P=l.getIncomingTreeEdges(M[E]),M=M.concat(P))}else null!=P&&+y.push(M[E])}M=y;return x.apply(this,arguments)};g.hoverIcons.getStateAt=function(M,m,y){return d(M.cell)?null:this.graph.view.getState(this.graph.getCellAt(m,y))};var B=l.duplicateCells;l.duplicateCells=function(M,m){M=null!=M?M:this.getSelectionCells();for(var y=M.slice(0),E=0;E<y.length;E++){var P=l.view.getState(y[E]);if(null!=P&&d(P.cell)){var O=l.getIncomingTreeEdges(P.cell);for(P=0;P<O.length;P++)mxUtils.remove(O[P],M)}}this.model.beginUpdate();try{var Q=B.call(this,M,m);if(Q.length==M.length)for(E=+0;E<M.length;E++)if(d(M[E])){var U=l.getIncomingTreeEdges(Q[E]);O=l.getIncomingTreeEdges(M[E]);if(0==U.length&&0<O.length){var R=this.cloneCell(O[0]);this.addEdge(R,l.getDefaultParent(),this.model.getTerminal(O[0],!0),Q[E])}}}finally{this.model.endUpdate()}return Q};var C=l.moveCells;l.moveCells=function(M,m,y,E,P,O,Q){for(var U=null,R=[],S=0;S<M.length;S++)(p(M[S])||d(M[S]))&&!u(M[S])&&this.isCellCollapsed(M[S])?R=R.concat(this.getSubtree(M[S])):R.push(M[S]);M=mxUtils.removeDuplicates(R);this.model.beginUpdate();+try{R=P;var W=this.getCurrentCellStyle(P);if(null!=M&&d(P)&&"1"==mxUtils.getValue(W,"treeFolding","0")){for(S=0;S<M.length;S++)if(d(M[S])||l.model.isEdge(M[S])&&null==l.model.getTerminal(M[S],!0)){P=l.model.getParent(M[S]);break}if(null!=R&&P!=R&&null!=this.view.getState(M[0])){var X=l.getIncomingTreeEdges(M[0]);if(0<X.length){var Y=l.view.getState(l.model.getTerminal(X[0],!0));if(null!=Y){var Z=l.view.getState(R);null!=Z&&(m=(Z.getCenterX()-Y.getCenterX())/l.view.scale,y=(Z.getCenterY()-Y.getCenterY())/+l.view.scale)}}}}U=C.apply(this,arguments);if(null!=U&&null!=M&&U.length==M.length)for(S=0;S<U.length;S++)if(this.model.isEdge(U[S]))d(R)&&0>mxUtils.indexOf(U,this.model.getTerminal(U[S],!0))&&this.model.setTerminal(U[S],R,!0);else if(d(M[S])&&(X=l.getIncomingTreeEdges(M[S]),0<X.length))if(!E)d(R)&&0>mxUtils.indexOf(M,this.model.getTerminal(X[0],!0))&&this.model.setTerminal(X[0],R,!0);else if(0==l.getIncomingTreeEdges(U[S]).length){W=R;if(null==W||W==l.model.getParent(M[S]))W=l.model.getTerminal(X[0],+!0);E=this.cloneCell(X[0]);this.addEdge(E,l.getDefaultParent(),W,U[S])}}finally{this.model.endUpdate()}return U};if(null!=g.sidebar){var G=g.sidebar.dropAndConnect;g.sidebar.dropAndConnect=function(M,m,y,E){var P=l.model,O=null;P.beginUpdate();try{if(O=G.apply(this,arguments),d(M))for(var Q=0;Q<O.length;Q++)if(P.isEdge(O[Q])&&null==P.getTerminal(O[Q],!0)){P.setTerminal(O[Q],M,!0);var U=l.getCellGeometry(O[Q]);U.points=null;null!=U.getTerminalPoint(!0)&&U.setTerminalPoint(null,!0)}}finally{P.endUpdate()}return O}}var N=+{67:g.actions.get("selectChildren"),88:g.actions.get("selectDescendants"),80:g.actions.get("selectParent"),83:g.actions.get("selectSiblings")},J={67:g.actions.get("copyStyle"),86:g.actions.get("pasteStyle")},T=g.onKeyDown;g.onKeyDown=function(M){try{var m=l.getSelectionCell();if(l.isEnabled()&&!l.isEditing()&&null!=m){var y=mxEvent.isAltDown(M)&&mxEvent.isShiftDown(M)?N[M.keyCode]:mxEvent.isAltDown(M)?J[M.keyCode]:null;null!=y?(y.funct(M),mxEvent.consume(M)):d(m)&&(y=null,0<l.getIncomingTreeEdges(m).length&&+(9==M.which?y=mxEvent.isShiftDown(M)?H(m):F(m):13==M.which&&(y=I(m,!mxEvent.isShiftDown(M)))),null!=y&&0<y.length?(1==y.length&&l.model.isEdge(y[0])?l.setSelectionCell(l.model.getTerminal(y[0],!1)):l.setSelectionCell(y[y.length-1]),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(m)),l.startEditingAtCell(m),mxEvent.consume(M)):37==M.keyCode?(c(m,mxConstants.DIRECTION_WEST),mxEvent.consume(M)):38==M.keyCode?(c(m,mxConstants.DIRECTION_NORTH),mxEvent.consume(M)):39==M.keyCode?(c(m,mxConstants.DIRECTION_EAST),+mxEvent.consume(M)):40==M.keyCode&&(c(m,mxConstants.DIRECTION_SOUTH),mxEvent.consume(M)))}}catch(E){g.handleError(E)}mxEvent.isConsumed(M)||T.apply(this,arguments)};var V=l.connectVertex;l.connectVertex=function(M,m,y,E,P,O,Q){var U=l.getIncomingTreeEdges(M);if(d(M)){var R=A(M),S=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,W=m==mxConstants.DIRECTION_EAST||m==mxConstants.DIRECTION_WEST;return R==m||0==U.length?F(M,m):S==W?H(M):I(M,m!=mxConstants.DIRECTION_NORTH&&m!=mxConstants.DIRECTION_WEST)}return V.apply(this,+arguments)};l.getSubtree=function(M){var m=[M];!p(M)&&!d(M)||u(M)||l.traverse(M,!0,function(y,E){var P=null!=E&&l.isTreeEdge(E);P&&0>mxUtils.indexOf(m,E)&&m.push(E);(null==E||P)&&0>mxUtils.indexOf(m,y)&&m.push(y);return null==E||P});return m};var t=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){t.apply(this,arguments);(p(this.state.cell)||d(this.state.cell))&&!u(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(M){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(M),mxEvent.getClientY(M),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(M);this.graph.isMouseDown=!0;g.hoverIcons.reset();mxEvent.consume(M)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var z=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){z.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 L=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(M){L.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=M?"":"none")};var K=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(M,m){K.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var k=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var d=k.apply(this,arguments),p=this.graph,q=this;return d.concat([this.addEntry("tree container",function(){var u=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");u.vertex=!0;var A=new mxCell("Parent",-new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var J=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');J.vertex=!0;var I=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-I.geometry.relative=!0;I.edge=!0;A.insertEdge(I,!0);J.insertEdge(I,!1);u.insert(I);u.insert(A);u.insert(J);return q.createVertexTemplateFromCells([u],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var u=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");u.vertex=!0;var A=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};');-A.vertex=!0;var J=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};');J.vertex=!0;var I=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-I.geometry.relative=!0;I.edge=!0;A.insertEdge(I,!0);J.insertEdge(I,!1);var G=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};');-G.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),I.style);E.geometry.relative=!0;E.edge=!0;A.insertEdge(E,!0);G.insertEdge(E,!1);var c=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};');-c.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),I.style);g.geometry.relative=!0;g.edge=!0;A.insertEdge(g,!0);c.insertEdge(g,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];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};');-l.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),I.style);n.geometry.relative=!0;n.edge=!0;A.insertEdge(n,!0);l.insertEdge(n,!1);u.insert(I);u.insert(E);u.insert(g);u.insert(n);u.insert(A);u.insert(J);u.insert(G);u.insert(c);u.insert(l);return q.createVertexTemplateFromCells([u],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var u=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;');+new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var I=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');I.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!0);I.insertEdge(H,!1);u.insert(H);u.insert(A);u.insert(I);return q.createVertexTemplateFromCells([u],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var u=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");u.vertex=!0;var A=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};');+A.vertex=!0;var I=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};');I.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!0);I.insertEdge(H,!1);var F=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};');+F.vertex=!0;var D=new mxCell("",new mxGeometry(0,0,0,0),H.style);D.geometry.relative=!0;D.edge=!0;A.insertEdge(D,!0);F.insertEdge(D,!1);var c=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};');+c.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),H.style);g.geometry.relative=!0;g.edge=!0;A.insertEdge(g,!0);c.insertEdge(g,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];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};');+l.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),H.style);n.geometry.relative=!0;n.edge=!0;A.insertEdge(n,!0);l.insertEdge(n,!1);u.insert(H);u.insert(D);u.insert(g);u.insert(n);u.insert(A);u.insert(I);u.insert(F);u.insert(c);u.insert(l);return q.createVertexTemplateFromCells([u],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var u=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;');u.vertex=!0;return q.createVertexTemplateFromCells([u],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var u=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};');u.vertex=!0;var A=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");A.geometry.setTerminalPoint(new mxPoint(-40,40),!0);A.geometry.relative=!0;A.edge=!0;u.insertEdge(A,!1);return q.createVertexTemplateFromCells([u,A],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var u=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};');u.vertex=!0;var A=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");A.geometry.setTerminalPoint(new mxPoint(-40,40),!0);A.geometry.relative=!0;A.edge=!0;u.insertEdge(A,!1);return q.createVertexTemplateFromCells([u,A],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree orgchart organization division",function(){var u=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');u.vertex=!0;var A=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"};');p.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;var J=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"};');J.vertex=!0;var I=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-I.geometry.relative=!0;I.edge=!0;A.insertEdge(I,!0);J.insertEdge(I,!1);var G=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"};');G.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");E.geometry.relative=-!0;E.edge=!0;A.insertEdge(E,!0);G.insertEdge(E,!1);u.insert(I);u.insert(E);u.insert(A);u.insert(J);u.insert(G);return q.createVertexTemplateFromCells([u],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree root",function(){var u=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"};');p.setAttributeForCell(u,"treeRoot","1");u.vertex=!0;return q.createVertexTemplateFromCells([u],+40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');p.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;var I=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"};');I.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!0);I.insertEdge(H,!1);var F=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"};');F.vertex=!0;var D=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");D.geometry.relative=+!0;D.edge=!0;A.insertEdge(D,!0);F.insertEdge(D,!1);u.insert(H);u.insert(D);u.insert(A);u.insert(I);u.insert(F);return q.createVertexTemplateFromCells([u],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree root",function(){var u=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"};');p.setAttributeForCell(u,"treeRoot","1");u.vertex=!0;return q.createVertexTemplateFromCells([u],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree division",function(){var u=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"};');u.vertex=!0;var A=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");A.geometry.setTerminalPoint(new mxPoint(0,0),!0);A.geometry.relative=!0;A.edge=!0;u.insertEdge(A,!1);return q.createVertexTemplateFromCells([u,A],u.geometry.width,u.geometry.height,u.value)}),this.addEntry("tree sub sections",function(){var u=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");u.vertex=!0;var A=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;");-A.geometry.setTerminalPoint(new mxPoint(110,-40),!0);A.geometry.relative=!0;A.edge=!0;u.insertEdge(A,!1);var J=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");J.vertex=!0;var I=new mxCell("",new mxGeometry(0,0,0,0),A.style);I.geometry.setTerminalPoint(new mxPoint(110,-40),!0);I.geometry.relative=!0;I.edge=!0;J.insertEdge(I,!1);return q.createVertexTemplateFromCells([A,I,u,J],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;-EditorUi.initMinimalTheme=function(){function b(I,G){if(EditorUi.windowed){var E=I.editor.graph;E.popupMenuHandler.hideMenu();null==I.formatWindow?(I.formatWindow=new WrapperWindow(I,"",Math.max(10,I.diagramContainer.clientWidth-248),60,240,Math.min(600,E.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";I.createFormat(c).init()}),I.dependsOnLanguage(mxUtils.bind(this,function(){I.formatWindow.window.setTitle(mxResources.get("format"))})),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!=G?G:!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"),G=I.diagramContainer.parentNode,-null!=I.formatElt.parentNode?(I.formatElt.parentNode.removeChild(I.formatElt),G.style.right="0px"):(G.parentNode.appendChild(I.formatElt),G.style.right=I.formatElt.style.width)}function f(I,G){if(EditorUi.windowed){var E=I.editor.graph;E.popupMenuHandler.hideMenu();null==I.sidebarWindow?(I.sidebarWindow=new WrapperWindow(I,"",10,56,Math.min(E.container.clientWidth-10,218)-6,Math.min(E.container.clientHeight-40,650)-6,function(c){I.createShapesPanel(c)}),I.dependsOnLanguage(mxUtils.bind(this,function(){I.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),-I.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){I.sidebarWindow.window.fit()})),I.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),I.sidebarWindow.window.setVisible(!0),isLocalStorage&&I.getLocalData("sidebar",function(c){I.sidebar.showEntries(c,null,!0)}),I.restoreLibraries()):I.sidebarWindow.window.setVisible(null!=G?G:!I.sidebarWindow.window.isVisible())}else null==I.sidebarElt&&(I.sidebarElt=I.createSidebarContainer(),I.createShapesPanel(I.sidebarElt),I.sidebarElt.style.border=-"none",I.sidebarElt.style.width="210px",I.sidebarElt.style.borderRight="1px solid gray"),G=I.diagramContainer.parentNode,null!=I.sidebarElt.parentNode?(I.sidebarElt.parentNode.removeChild(I.sidebarElt),G.style.left="0px"):(G.parentNode.appendChild(I.sidebarElt),G.style.left=I.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var k=0;try{k=window.innerWidth||document.documentElement.clientWidth||-document.body.clientWidth}catch(I){}Menus.prototype.autoPopup=!1;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=+A.geometry.setTerminalPoint(new mxPoint(110,-40),!0);A.geometry.relative=!0;A.edge=!0;u.insertEdge(A,!1);var I=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");I.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),A.style);H.geometry.setTerminalPoint(new mxPoint(110,-40),!0);H.geometry.relative=!0;H.edge=!0;I.insertEdge(H,!1);return q.createVertexTemplateFromCells([A,H,u,I],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+EditorUi.initMinimalTheme=function(){function b(H,F){if(EditorUi.windowed){var D=H.editor.graph;D.popupMenuHandler.hideMenu();null==H.formatWindow?(H.formatWindow=new WrapperWindow(H,"",Math.max(10,H.diagramContainer.clientWidth-248),60,240,Math.min(600,D.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";H.createFormat(c).init()}),H.dependsOnLanguage(mxUtils.bind(this,function(){H.formatWindow.window.setTitle(mxResources.get("format"))})),H.formatWindow.window.addListener(mxEvent.SHOW,+mxUtils.bind(this,function(){H.formatWindow.window.fit()})),H.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):H.formatWindow.window.setVisible(null!=F?F:!H.formatWindow.window.isVisible())}else null==H.formatElt&&(H.formatElt=H.createSidebarContainer(),H.createFormat(H.formatElt).init(),H.formatElt.style.border="none",H.formatElt.style.width="240px",H.formatElt.style.borderLeftWidth="1px",H.formatElt.style.borderLeftStyle="solid",H.formatElt.style.right="0px"),F=H.diagramContainer.parentNode,+null!=H.formatElt.parentNode?(H.formatElt.parentNode.removeChild(H.formatElt),F.style.right="0px"):(F.parentNode.appendChild(H.formatElt),F.style.right=H.formatElt.style.width)}function f(H,F){if(EditorUi.windowed){var D=H.editor.graph;D.popupMenuHandler.hideMenu();null==H.sidebarWindow?(H.sidebarWindow=new WrapperWindow(H,"",10,56,Math.min(D.container.clientWidth-10,218)-6,Math.min(D.container.clientHeight-40,650)-6,function(c){H.createShapesPanel(c)}),H.dependsOnLanguage(mxUtils.bind(this,function(){H.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),+H.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){H.sidebarWindow.window.fit()})),H.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),H.sidebarWindow.window.setVisible(!0),isLocalStorage&&H.getLocalData("sidebar",function(c){H.sidebar.showEntries(c,null,!0)}),H.restoreLibraries()):H.sidebarWindow.window.setVisible(null!=F?F:!H.sidebarWindow.window.isVisible())}else null==H.sidebarElt&&(H.sidebarElt=H.createSidebarContainer(),H.createShapesPanel(H.sidebarElt),H.sidebarElt.style.border=+"none",H.sidebarElt.style.width="210px",H.sidebarElt.style.borderRight="1px solid gray"),F=H.diagramContainer.parentNode,null!=H.sidebarElt.parentNode?(H.sidebarElt.parentNode.removeChild(H.sidebarElt),F.style.left="0px"):(F.parentNode.appendChild(H.sidebarElt),F.style.left=H.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var k=0;try{k=window.innerWidth||document.documentElement.clientWidth||+document.body.clientWidth}catch(H){}Menus.prototype.autoPopup=!1;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;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=-function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var d=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){d.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var p=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(I,G){null!=G.shortcut&&900>k&&!mxClient.IS_IOS?I.firstChild.nextSibling.setAttribute("title",G.shortcut):p.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 q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();q.apply(this,arguments)};var u=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(I){u.apply(this,-arguments);if(I){var G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=G&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=G&&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(){};EditorUi.prototype.installFormatToolbar=-function(I){var G=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%;";G.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,g){0<G.getSelectionCount()?(I.appendChild(E),E.innerHTML="Selected: "+G.getSelectionCount()):null!=E.parentNode&&E.parentNode.removeChild(E)}))};var A=!1;EditorUi.prototype.initFormatWindow=-function(){if(!A&&null!=this.formatWindow){A=!0;var I=this.formatWindow.window.toggleMinimized,G=240;this.formatWindow.window.toggleMinimized=function(){I.apply(this,arguments);this.minimized?(G=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+G-140+"px"):(this.div.style.width=G+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-G+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 J=EditorUi.prototype.init;EditorUi.prototype.init=function(){function I(F,N,O){var P=l.menus.get(F);N=x.addMenu(mxResources.get(F),mxUtils.bind(this,function(){P.funct.apply(this,arguments)}));N.className="geButton";N.setAttribute("title",mxResources.get(F));l.menus.menuCreated(P,N,"geButton");null!=O&&-(N.style.backgroundImage="url("+O+")",N.innerText="");return N}function G(F,N,O,P,T,Q){var R=document.createElement("a");R.className="geButton";v.appendChild(R);null!=Q?R.style.backgroundImage="url("+Q+")":mxUtils.write(R,F);mxEvent.addListener(R,"click",function(W){"disabled"!=R.getAttribute("disabled")&&N(W);mxEvent.consume(W)});mxEvent.preventDefault(R);null!=P&&R.setAttribute("title",P);null!=T&&(F=function(){T.isEnabled()?R.removeAttribute("disabled"):R.setAttribute("disabled","disabled")},T.addListener("stateChanged",-F),n.addListener("enabledChanged",F),F());return R}function E(F,N,O){N=document.createElement("div");N.className="geButtonGroup";for(O=0;O<F.length;O++)null!=F[O]&&N.appendChild(F[O]);v.appendChild(N);return N}function c(){k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var F=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(F=l.buttonContainer.offsetWidth||300);v.innerHTML="";var N=k<1E3+F,O=I("diagram",null,N?Editor.menuImage:null);E([O,G(mxResources.get("shapes"),-l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),N?Editor.shapesImage:null),G(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),N?Editor.formatImage:null)]);O=I("insert",!0,N?U:null);E([O,G(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),N?Editor.trashImage:null)]);n.isEnabled()||O.setAttribute("disabled",-"disabled");M.setAttribute("title",mxResources.get("undo")+" ("+L.shortcut+")");m.setAttribute("title",mxResources.get("redo")+" ("+K.shortcut+")");y.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");k>=411+F&&(E([M,m]),k>=520+F&&E([y,k>=640+F?G("",t.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",t,Editor.zoomInImage):null,k>=640+F?G("",z.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",z,Editor.zoomOutImage):null]));v.appendChild(l.statusContainer);-v.appendChild(l.buttonContainer)}J.apply(this,arguments);var g=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=g&&(g.classList.add("geSimple"),g.classList.add("geMinimal"),g.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=k||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(f(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&+function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var d=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){d.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var p=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(H,F){null!=F.shortcut&&900>k&&!mxClient.IS_IOS?H.firstChild.nextSibling.setAttribute("title",F.shortcut):p.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=+function(H){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=H?H:!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 q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();q.apply(this,arguments)};var u=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(H){u.apply(this,+arguments);if(H){var F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=F&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=F&&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(){};EditorUi.prototype.installFormatToolbar=+function(H){var F=this.editor.graph,D=document.createElement("div");D.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%;";F.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,g){0<F.getSelectionCount()?(H.appendChild(D),D.innerHTML="Selected: "+F.getSelectionCount()):null!=D.parentNode&&D.parentNode.removeChild(D)}))};var A=!1;EditorUi.prototype.initFormatWindow=+function(){if(!A&&null!=this.formatWindow){A=!0;var H=this.formatWindow.window.toggleMinimized,F=240;this.formatWindow.window.toggleMinimized=function(){H.apply(this,arguments);this.minimized?(F=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+F-140+"px"):(this.div.style.width=F+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-F+140)+"px");this.fit()};+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var I=EditorUi.prototype.init;EditorUi.prototype.init=function(){function H(E,P,O){var Q=l.menus.get(E);P=x.addMenu(mxResources.get(E),mxUtils.bind(this,function(){Q.funct.apply(this,arguments)}));P.className="geButton";P.setAttribute("title",mxResources.get(E));l.menus.menuCreated(Q,P,"geButton");null!=O&&+(P.style.backgroundImage="url("+O+")",P.innerText="");return P}function F(E,P,O,Q,U,R){var S=document.createElement("a");S.className="geButton";v.appendChild(S);null!=R?S.style.backgroundImage="url("+R+")":mxUtils.write(S,E);mxEvent.addListener(S,"click",function(W){"disabled"!=S.getAttribute("disabled")&&P(W);mxEvent.consume(W)});mxEvent.preventDefault(S);null!=Q&&S.setAttribute("title",Q);null!=U&&(E=function(){U.isEnabled()?S.removeAttribute("disabled"):S.setAttribute("disabled","disabled")},U.addListener("stateChanged",+E),n.addListener("enabledChanged",E),E());return S}function D(E,P,O){P=document.createElement("div");P.className="geButtonGroup";for(O=0;O<E.length;O++)null!=E[O]&&P.appendChild(E[O]);v.appendChild(P);return P}function c(){k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var E=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(E=l.buttonContainer.offsetWidth||300);v.innerHTML="";var P=k<1E3+E,O=H("diagram",null,P?Editor.menuImage:null);D([O,F(mxResources.get("shapes"),+l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),P?Editor.shapesImage:null),F(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),P?Editor.formatImage:null)]);O=H("insert",!0,P?J:null);D([O,F(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),P?Editor.trashImage:null)]);n.isEnabled()||O.setAttribute("disabled",+"disabled");M.setAttribute("title",mxResources.get("undo")+" ("+L.shortcut+")");m.setAttribute("title",mxResources.get("redo")+" ("+K.shortcut+")");y.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");k>=411+E&&(D([M,m]),k>=520+E&&D([y,k>=640+E?F("",t.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",t,Editor.zoomInImage):null,k>=640+E?F("",z.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",z,Editor.zoomOutImage):null]));v.appendChild(l.statusContainer);+v.appendChild(l.buttonContainer)}I.apply(this,arguments);var g=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=g&&(g.classList.add("geSimple"),g.classList.add("geMinimal"),g.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=k||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")));this.formatEnabled&&EditorUi.windowed&&1E3<=k&&(b(this,!0),this.formatWindow.window.setVisible(!0));var l=this,n=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));var v=document.createElement("div");v.className="geMenubarContainer";var x=new Menubar(l,v),B=l.hideCurrentMenu;l.hideCurrentMenu=function(){B.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var C=l.descriptorChanged;-l.descriptorChanged=function(){C.apply(this,arguments);var F=l.getCurrentFile();if(null!=F&&null!=F.getTitle()){var N=F.getMode();"google"==N?N="googleDrive":"github"==N?N="gitHub":"gitlab"==N?N="gitLab":"onedrive"==N&&(N="oneDrive");N=mxResources.get(N);v.setAttribute("title",F.getTitle()+(null!=N?" ("+N+")":""))}else v.removeAttribute("title")};l.setStatusText(l.editor.getStatus());v.appendChild(l.statusContainer);l.buttonContainer=this.createButtonContainer();v.appendChild(l.buttonContainer);l.menubarContainer=-l.buttonContainer;l.tabContainer=this.createTabContainer();var H=this.createZoomInput(!0),D=l.updateTabContainer;l.updateTabContainer=function(){D.apply(this,arguments);l.tabContainer.appendChild(H)};var U=Editor.addBoxImage;if(null!=l.hoverIcons){var S=l.hoverIcons.update;l.hoverIcons.update=function(){n.freehand.isDrawing()||S.apply(this,arguments)}}if(null!=n.freehand){var V=n.freehand.createStyle;n.freehand.createStyle=function(F){return V.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",-mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var t=l.actions.get("zoomIn"),z=l.actions.get("zoomOut");g=l.actions.get("resetView");var L=l.actions.get("undo"),K=l.actions.get("redo"),M=G("",L.funct,null,"",L,Editor.undoImage),m=G("",K.funct,null,"",K,Editor.redoImage),y=G("",function(F){mxEvent.isAltDown(F)?(l.hideCurrentMenu(),l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(F)},+l.descriptorChanged=function(){C.apply(this,arguments);var E=l.getCurrentFile();if(null!=E&&null!=E.getTitle()){var P=E.getMode();"google"==P?P="googleDrive":"github"==P?P="gitHub":"gitlab"==P?P="gitLab":"onedrive"==P&&(P="oneDrive");P=mxResources.get(P);v.setAttribute("title",E.getTitle()+(null!=P?" ("+P+")":""))}else v.removeAttribute("title")};l.setStatusText(l.editor.getStatus());v.appendChild(l.statusContainer);l.buttonContainer=this.createButtonContainer();v.appendChild(l.buttonContainer);l.menubarContainer=+l.buttonContainer;l.tabContainer=this.createTabContainer();var G=this.createZoomInput(!0),N=l.updateTabContainer;l.updateTabContainer=function(){N.apply(this,arguments);l.tabContainer.appendChild(G)};var J=Editor.addBoxImage;if(null!=l.hoverIcons){var T=l.hoverIcons.update;l.hoverIcons.update=function(){n.freehand.isDrawing()||T.apply(this,arguments)}}if(null!=n.freehand){var V=n.freehand.createStyle;n.freehand.createStyle=function(E){return V.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",+mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var t=l.actions.get("zoomIn"),z=l.actions.get("zoomOut");g=l.actions.get("resetView");var L=l.actions.get("undo"),K=l.actions.get("redo"),M=F("",L.funct,null,"",L,Editor.undoImage),m=F("",K.funct,null,"",K,Editor.redoImage),y=F("",function(E){mxEvent.isAltDown(E)?(l.hideCurrentMenu(),l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(E)},!0,"",g,Editor.zoomFitImage);l.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){f(l,null)});l.container.appendChild(l.tabContainer);l.container.appendChild(v);l.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=k&&b(this,!0);c();l.addListener("lockedChanged",c);l.addListener("languageChanged",c);l.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,"resize",function(){c();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.chatWindow&&l.menus.chatWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit();null!=l.menus.findReplaceWindow&&l.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,p,q,u){var A=p.y,J=p.x,I=!1,G=!1;if(null!=this.states&&null!=d&&null!=p){var E=this,c=new mxCellState,g=this.graph.getView().scale,l=Math.max(2,this.getGuideTolerance()/2);c.x=d.x+J;c.y=d.y+A;c.width=d.width;c.height=d.height;for(var n=[],v=[],x=0;x<this.states.length;x++){var B=this.states[x];B instanceof mxCellState&&(u||!this.graph.isCellSelected(B.cell))&&((c.x>=B.x&&c.x<=B.x+B.width||B.x>=c.x&&B.x<=c.x+c.width)&&(c.y>-B.y+B.height+4||c.y+c.height+4<B.y)?n.push(B):(c.y>=B.y&&c.y<=B.y+B.height||B.y>=c.y&&B.y<=c.y+c.height)&&(c.x>B.x+B.width+4||c.x+c.width+4<B.x)&&v.push(B))}var C=0,H=0,D=B=0,U=0,S=0,V=0,t=0,z=5*g;if(1<n.length){n.push(c);n.sort(function(m,y){return m.y-y.y});var L=!1;x=c==n[0];g=c==n[n.length-1];if(!x&&!g)for(x=1;x<n.length-1;x++)if(c==n[x]){g=n[x-1];x=n[x+1];B=H=D=(x.y-g.y-g.height-c.height)/2;break}for(x=0;x<n.length-1;x++){g=n[x];var K=n[x+1],M=c==g||c==K;K=K.y-g.y-g.height;L|=c==g;if(0==H&&0==-C)H=K,C=1;else if(Math.abs(H-K)<=(M||1==x&&L?l:0))C+=1;else if(1<C&&L){n=n.slice(0,x+1);break}else if(3<=n.length-x&&!L)C=0,B=H=0!=D?D:0,n.splice(0,0==x?1:x),x=-1;else break;0!=B||M||(H=B=K)}3==n.length&&n[1]==c&&(B=0)}if(1<v.length){v.push(c);v.sort(function(m,y){return m.x-y.x});L=!1;x=c==v[0];g=c==v[v.length-1];if(!x&&!g)for(x=1;x<v.length-1;x++)if(c==v[x]){g=v[x-1];x=v[x+1];V=S=t=(x.x-g.x-g.width-c.width)/2;break}for(x=0;x<v.length-1;x++){g=v[x];K=v[x+1];M=c==g||c==K;K=K.x-g.x-g.width;L|=c==g;-if(0==S&&0==U)S=K,U=1;else if(Math.abs(S-K)<=(M||1==x&&L?l:0))U+=1;else if(1<U&&L){v=v.slice(0,x+1);break}else if(3<=v.length-x&&!L)U=0,V=S=0!=t?t:0,v.splice(0,0==x?1:x),x=-1;else break;0!=V||M||(S=V=K)}3==v.length&&v[1]==c&&(V=0)}l=function(m,y,F,N){var O=[];if(N){N=z;var P=0}else N=0,P=z;O.push(new mxPoint(m.x-N,m.y-P));O.push(new mxPoint(m.x+N,m.y+P));O.push(m);O.push(y);O.push(new mxPoint(y.x-N,y.y-P));O.push(new mxPoint(y.x+N,y.y+P));if(null!=F)return F.points=O,F;m=new mxPolyline(O,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);m.dialect=mxConstants.DIALECT_SVG;m.pointerEvents=!1;m.init(E.graph.getView().getOverlayPane());return m};S=function(m,y){if(m&&null!=E.guidesArrHor)for(m=0;m<E.guidesArrHor.length;m++)E.guidesArrHor[m].node.style.visibility="hidden";if(y&&null!=E.guidesArrVer)for(m=0;m<E.guidesArrVer.length;m++)E.guidesArrVer[m].node.style.visibility="hidden"};if(1<U&&U==v.length-1){U=[];t=E.guidesArrHor;I=[];J=0;x=v[0]==c?1:0;L=v[x].y+v[x].height;if(0<V)for(x=0;x<v.length-1;x++)g=-v[x],K=v[x+1],c==g?(J=K.x-g.width-V,I.push(new mxPoint(J+g.width+z,L)),I.push(new mxPoint(K.x-z,L))):c==K?(I.push(new mxPoint(g.x+g.width+z,L)),J=g.x+g.width+V,I.push(new mxPoint(J-z,L))):(I.push(new mxPoint(g.x+g.width+z,L)),I.push(new mxPoint(K.x-z,L)));else g=v[0],x=v[2],J=g.x+g.width+(x.x-g.x-g.width-c.width)/2,I.push(new mxPoint(g.x+g.width+z,L)),I.push(new mxPoint(J-z,L)),I.push(new mxPoint(J+c.width+z,L)),I.push(new mxPoint(x.x-z,L));for(x=0;x<I.length;x+=2)v=I[x],V=I[x+1],v=l(v,V,null!=t?-t[x/2]:null),v.node.style.visibility="visible",v.redraw(),U.push(v);for(x=I.length/2;null!=t&&x<t.length;x++)t[x].destroy();E.guidesArrHor=U;J-=d.x;I=!0}else S(!0);if(1<C&&C==n.length-1){U=[];t=E.guidesArrVer;G=[];A=0;x=n[0]==c?1:0;C=n[x].x+n[x].width;if(0<B)for(x=0;x<n.length-1;x++)g=n[x],K=n[x+1],c==g?(A=K.y-g.height-B,G.push(new mxPoint(C,A+g.height+z)),G.push(new mxPoint(C,K.y-z))):c==K?(G.push(new mxPoint(C,g.y+g.height+z)),A=g.y+g.height+B,G.push(new mxPoint(C,A-z))):(G.push(new mxPoint(C,g.y+-g.height+z)),G.push(new mxPoint(C,K.y-z)));else g=n[0],x=n[2],A=g.y+g.height+(x.y-g.y-g.height-c.height)/2,G.push(new mxPoint(C,g.y+g.height+z)),G.push(new mxPoint(C,A-z)),G.push(new mxPoint(C,A+c.height+z)),G.push(new mxPoint(C,x.y-z));for(x=0;x<G.length;x+=2)v=G[x],V=G[x+1],v=l(v,V,null!=t?t[x/2]:null,!0),v.node.style.visibility="visible",v.redraw(),U.push(v);for(x=G.length/2;null!=t&&x<t.length;x++)t[x].destroy();E.guidesArrVer=U;A-=d.y;G=!0}else S(!1,!0)}if(I||G)return c=new mxPoint(J,A),n=b.call(this,-d,c,q,u),I&&!G?c.y=n.y:G&&!I&&(c.x=n.x),n.y!=c.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),n.x!=c.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),c;S(!0,!0);return b.apply(this,arguments)};var f=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(d){f.call(this,d);var p=this.guidesArrVer,q=this.guidesArrHor;if(null!=p)for(var u=0;u<p.length;u++)p[u].node.style.visibility=d?"visible":"hidden";if(null!=-q)for(u=0;u<q.length;u++)q[u].node.style.visibility=d?"visible":"hidden"};var k=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){k.call(this);var d=this.guidesArrVer,p=this.guidesArrHor;if(null!=d){for(var q=0;q<d.length;q++)d[q].destroy();this.guidesArrVer=null}if(null!=p){for(q=0;q<p.length;q++)p[q].destroy();this.guidesArrHor=null}}})();function mxRuler(b,f,k,d){function p(){var C=b.getDiagramContainerOffset(),H=b.diagramContainer;E.style.top=H.offsetTop-C.y+"px";E.style.left=H.offsetLeft-C.x+"px";E.style.width=(k?0:H.offsetWidth)+J+"px";E.style.height=(k?H.offsetHeight:0)+J+"px"}function q(C,H,D){if(null!=u)return C;var U;return function(){var S=this,V=arguments,t=D&&!U;clearTimeout(U);U=setTimeout(function(){U=null;D||C.apply(S,V)},H);t&&C.apply(S,V)}}var u=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||-window.msRequestAnimationFrame,A=window.cancelAnimationFrame||window.mozCancelAnimationFrame,J=this.RULER_THICKNESS,I=this;this.unit=f;var G=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},E=document.createElement("div");E.className="geRuler";E.style.position="fixed";this.updateStyle=mxUtils.bind(this,-function(){G=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};E.style[k?"borderRight":"borderBottom"]="0.5px solid "+G.strokeClr;E.style.borderLeft="0.5px solid "+G.strokeClr});this.updateStyle();b.diagramContainer.appendChild(E);mxEvent.disableContextMenu(E);this.editorUiRefresh=b.refresh;b.refresh=function(C){I.editorUiRefresh.apply(b,-arguments);p()};p();var c=document.createElement("canvas");c.width=E.offsetWidth;c.height=E.offsetHeight;E.style.overflow="hidden";c.style.position="relative";E.appendChild(c);var g=c.getContext("2d");this.ui=b;var l=b.editor.graph;this.graph=l;this.container=E;this.canvas=c;var n=function(C,H,D,U,S){C=Math.round(C);H=Math.round(H);D=Math.round(D);U=Math.round(U);g.beginPath();g.moveTo(C+.5,H+.5);g.lineTo(D+.5,U+.5);g.stroke();S&&(k?(g.save(),g.translate(C,H),g.rotate(-Math.PI/2),g.fillText(S,0,0),-g.restore()):g.fillText(S,C,H))},v=function(){g.clearRect(0,0,c.width,c.height);g.beginPath();g.lineWidth=.7;g.strokeStyle=G.strokeClr;g.setLineDash([]);g.font="9px Arial";g.textAlign="center";var C=l.view.scale,H=l.view.getBackgroundPageBounds(),D=l.view.translate,U=l.pageVisible;D=U?J+(k?H.y-l.container.scrollTop:H.x-l.container.scrollLeft):J+(k?D.y*C-l.container.scrollTop:D.x*C-l.container.scrollLeft);var S=0;U&&(S=l.getPageLayout(),S=k?S.y*l.pageFormat.height:S.x*l.pageFormat.width);var V;switch(I.unit){case mxConstants.POINTS:var t=-V=10;var z=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:V=10;t=mxConstants.PIXELS_PER_MM;z=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:V=20;t=mxConstants.PIXELS_PER_MM;z=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:V=.5>=C||4<=C?8:16,t=mxConstants.PIXELS_PER_INCH/V,z=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var L=t;2<=C?L=t/(2*Math.floor(C/2)):.5>=C&&(L=t*Math.floor(1/C/2)*(I.unit==mxConstants.MILLIMETERS?2:1));t=null;H=U?Math.min(D+(k?H.height:H.width),k?-c.height:c.width):k?c.height:c.width;if(U)if(g.fillStyle=G.outBkgClr,k){var K=D-J;0<K&&g.fillRect(0,J,J,K);H<c.height&&g.fillRect(0,H,J,c.height)}else K=D-J,0<K&&g.fillRect(J,0,K,J),H<c.width&&g.fillRect(H,0,c.width,J);g.fillStyle=G.fontClr;for(U=U?D:D%(L*C);U<=H;U+=L*C)if(K=Math.round((U-D)/C/L),!(U<J||K==t)){t=K;var M=null;0==K%V&&(M=I.formatText(S+K*L)+"");k?n(J-z[Math.abs(K)%V],U,J,U,M):n(U,J-z[Math.abs(K)%V],U,J,M)}g.lineWidth=1;n(k?0:J,k?J:0,J,J);g.fillStyle=G.cornerClr;g.fillRect(0,0,J,J)},-x=-1,B=function(){null!=u?(null!=A&&A(x),x=u(v)):v()};this.drawRuler=B;this.sizeListener=f=q(function(){var C=l.container;k?(C=C.offsetHeight+J,c.height!=C&&(c.height=C,E.style.height=C+"px",B())):(C=C.offsetWidth+J,c.width!=C&&(c.width=C,E.style.width=C+"px",B()))},10);this.pageListener=function(){B()};this.scrollListener=d=q(function(){var C=k?l.container.scrollTop:l.container.scrollLeft;I.lastScroll!=C&&(I.lastScroll=C,B())},10);this.unitListener=function(C,H){I.setUnit(H.getProperty("unit"))};-l.addListener(mxEvent.SIZE,f);l.container.addEventListener("scroll",d);l.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(C){G=C;E.style.background=G.bkgClr;v()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(C,H,D,U){if(k&&4<C.height||!k&&4<C.width){if(null!=I.guidePart)try{g.putImageData(I.guidePart.imgData1,-I.guidePart.x1,I.guidePart.y1),g.putImageData(I.guidePart.imgData2,I.guidePart.x2,I.guidePart.y2),g.putImageData(I.guidePart.imgData3,I.guidePart.x3,I.guidePart.y3)}catch(N){}var S=I.origGuideMove.apply(this,arguments);try{g.lineWidth=.5;g.strokeStyle=G.guideClr;g.setLineDash([2]);if(k){var V=C.y+S.y+J-this.graph.container.scrollTop;var t=0;var z=V+C.height/2;var L=J/2;var K=V+C.height;var M=0;var m=g.getImageData(t,V-1,J,3);n(t,V,J,V);V--;var y=g.getImageData(L,z-1,J,3);n(L,z,J,z);z--;var F=g.getImageData(M,-K-1,J,3);n(M,K,J,K);K--}else V=0,t=C.x+S.x+J-this.graph.container.scrollLeft,z=J/2,L=t+C.width/2,K=0,M=t+C.width,m=g.getImageData(t-1,V,3,J),n(t,V,t,J),t--,y=g.getImageData(L-1,z,3,J),n(L,z,L,J),L--,F=g.getImageData(M-1,K,3,J),n(M,K,M,J),M--;if(null==I.guidePart||I.guidePart.x1!=t||I.guidePart.y1!=V)I.guidePart={imgData1:m,x1:t,y1:V,imgData2:y,x2:L,y2:z,imgData3:F,x3:M,y3:K}}catch(N){}}else S=I.origGuideMove.apply(this,arguments);return S};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=-function(){var C=I.origGuideDestroy.apply(this,arguments);if(null!=I.guidePart)try{g.putImageData(I.guidePart.imgData1,I.guidePart.x1,I.guidePart.y1),g.putImageData(I.guidePart.imgData2,I.guidePart.x2,I.guidePart.y2),g.putImageData(I.guidePart.imgData3,I.guidePart.x3,I.guidePart.y3),I.guidePart=null}catch(H){}return C}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};+(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,p,q,u){var A=p.y,I=p.x,H=!1,F=!1;if(null!=this.states&&null!=d&&null!=p){var D=this,c=new mxCellState,g=this.graph.getView().scale,l=Math.max(2,this.getGuideTolerance()/2);c.x=d.x+I;c.y=d.y+A;c.width=d.width;c.height=d.height;for(var n=[],v=[],x=0;x<this.states.length;x++){var B=this.states[x];B instanceof mxCellState&&(u||!this.graph.isCellSelected(B.cell))&&((c.x>=B.x&&c.x<=B.x+B.width||B.x>=c.x&&B.x<=c.x+c.width)&&(c.y>+B.y+B.height+4||c.y+c.height+4<B.y)?n.push(B):(c.y>=B.y&&c.y<=B.y+B.height||B.y>=c.y&&B.y<=c.y+c.height)&&(c.x>B.x+B.width+4||c.x+c.width+4<B.x)&&v.push(B))}var C=0,G=0,N=B=0,J=0,T=0,V=0,t=0,z=5*g;if(1<n.length){n.push(c);n.sort(function(m,y){return m.y-y.y});var L=!1;x=c==n[0];g=c==n[n.length-1];if(!x&&!g)for(x=1;x<n.length-1;x++)if(c==n[x]){g=n[x-1];x=n[x+1];B=G=N=(x.y-g.y-g.height-c.height)/2;break}for(x=0;x<n.length-1;x++){g=n[x];var K=n[x+1],M=c==g||c==K;K=K.y-g.y-g.height;L|=c==g;if(0==G&&0==+C)G=K,C=1;else if(Math.abs(G-K)<=(M||1==x&&L?l:0))C+=1;else if(1<C&&L){n=n.slice(0,x+1);break}else if(3<=n.length-x&&!L)C=0,B=G=0!=N?N:0,n.splice(0,0==x?1:x),x=-1;else break;0!=B||M||(G=B=K)}3==n.length&&n[1]==c&&(B=0)}if(1<v.length){v.push(c);v.sort(function(m,y){return m.x-y.x});L=!1;x=c==v[0];g=c==v[v.length-1];if(!x&&!g)for(x=1;x<v.length-1;x++)if(c==v[x]){g=v[x-1];x=v[x+1];V=T=t=(x.x-g.x-g.width-c.width)/2;break}for(x=0;x<v.length-1;x++){g=v[x];K=v[x+1];M=c==g||c==K;K=K.x-g.x-g.width;L|=c==g;+if(0==T&&0==J)T=K,J=1;else if(Math.abs(T-K)<=(M||1==x&&L?l:0))J+=1;else if(1<J&&L){v=v.slice(0,x+1);break}else if(3<=v.length-x&&!L)J=0,V=T=0!=t?t:0,v.splice(0,0==x?1:x),x=-1;else break;0!=V||M||(T=V=K)}3==v.length&&v[1]==c&&(V=0)}l=function(m,y,E,P){var O=[];if(P){P=z;var Q=0}else P=0,Q=z;O.push(new mxPoint(m.x-P,m.y-Q));O.push(new mxPoint(m.x+P,m.y+Q));O.push(m);O.push(y);O.push(new mxPoint(y.x-P,y.y-Q));O.push(new mxPoint(y.x+P,y.y+Q));if(null!=E)return E.points=O,E;m=new mxPolyline(O,mxConstants.GUIDE_COLOR,+mxConstants.GUIDE_STROKEWIDTH);m.dialect=mxConstants.DIALECT_SVG;m.pointerEvents=!1;m.init(D.graph.getView().getOverlayPane());return m};T=function(m,y){if(m&&null!=D.guidesArrHor)for(m=0;m<D.guidesArrHor.length;m++)D.guidesArrHor[m].node.style.visibility="hidden";if(y&&null!=D.guidesArrVer)for(m=0;m<D.guidesArrVer.length;m++)D.guidesArrVer[m].node.style.visibility="hidden"};if(1<J&&J==v.length-1){J=[];t=D.guidesArrHor;H=[];I=0;x=v[0]==c?1:0;L=v[x].y+v[x].height;if(0<V)for(x=0;x<v.length-1;x++)g=+v[x],K=v[x+1],c==g?(I=K.x-g.width-V,H.push(new mxPoint(I+g.width+z,L)),H.push(new mxPoint(K.x-z,L))):c==K?(H.push(new mxPoint(g.x+g.width+z,L)),I=g.x+g.width+V,H.push(new mxPoint(I-z,L))):(H.push(new mxPoint(g.x+g.width+z,L)),H.push(new mxPoint(K.x-z,L)));else g=v[0],x=v[2],I=g.x+g.width+(x.x-g.x-g.width-c.width)/2,H.push(new mxPoint(g.x+g.width+z,L)),H.push(new mxPoint(I-z,L)),H.push(new mxPoint(I+c.width+z,L)),H.push(new mxPoint(x.x-z,L));for(x=0;x<H.length;x+=2)v=H[x],V=H[x+1],v=l(v,V,null!=t?+t[x/2]:null),v.node.style.visibility="visible",v.redraw(),J.push(v);for(x=H.length/2;null!=t&&x<t.length;x++)t[x].destroy();D.guidesArrHor=J;I-=d.x;H=!0}else T(!0);if(1<C&&C==n.length-1){J=[];t=D.guidesArrVer;F=[];A=0;x=n[0]==c?1:0;C=n[x].x+n[x].width;if(0<B)for(x=0;x<n.length-1;x++)g=n[x],K=n[x+1],c==g?(A=K.y-g.height-B,F.push(new mxPoint(C,A+g.height+z)),F.push(new mxPoint(C,K.y-z))):c==K?(F.push(new mxPoint(C,g.y+g.height+z)),A=g.y+g.height+B,F.push(new mxPoint(C,A-z))):(F.push(new mxPoint(C,g.y++g.height+z)),F.push(new mxPoint(C,K.y-z)));else g=n[0],x=n[2],A=g.y+g.height+(x.y-g.y-g.height-c.height)/2,F.push(new mxPoint(C,g.y+g.height+z)),F.push(new mxPoint(C,A-z)),F.push(new mxPoint(C,A+c.height+z)),F.push(new mxPoint(C,x.y-z));for(x=0;x<F.length;x+=2)v=F[x],V=F[x+1],v=l(v,V,null!=t?t[x/2]:null,!0),v.node.style.visibility="visible",v.redraw(),J.push(v);for(x=F.length/2;null!=t&&x<t.length;x++)t[x].destroy();D.guidesArrVer=J;A-=d.y;F=!0}else T(!1,!0)}if(H||F)return c=new mxPoint(I,A),n=b.call(this,+d,c,q,u),H&&!F?c.y=n.y:F&&!H&&(c.x=n.x),n.y!=c.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),n.x!=c.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),c;T(!0,!0);return b.apply(this,arguments)};var f=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(d){f.call(this,d);var p=this.guidesArrVer,q=this.guidesArrHor;if(null!=p)for(var u=0;u<p.length;u++)p[u].node.style.visibility=d?"visible":"hidden";if(null!=+q)for(u=0;u<q.length;u++)q[u].node.style.visibility=d?"visible":"hidden"};var k=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){k.call(this);var d=this.guidesArrVer,p=this.guidesArrHor;if(null!=d){for(var q=0;q<d.length;q++)d[q].destroy();this.guidesArrVer=null}if(null!=p){for(q=0;q<p.length;q++)p[q].destroy();this.guidesArrHor=null}}})();function mxRuler(b,f,k,d){function p(){var C=b.getDiagramContainerOffset(),G=b.diagramContainer;D.style.top=G.offsetTop-C.y+"px";D.style.left=G.offsetLeft-C.x+"px";D.style.width=(k?0:G.offsetWidth)+I+"px";D.style.height=(k?G.offsetHeight:0)+I+"px"}function q(C,G,N){if(null!=u)return C;var J;return function(){var T=this,V=arguments,t=N&&!J;clearTimeout(J);J=setTimeout(function(){J=null;N||C.apply(T,V)},G);t&&C.apply(T,V)}}var u=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||+window.msRequestAnimationFrame,A=window.cancelAnimationFrame||window.mozCancelAnimationFrame,I=this.RULER_THICKNESS,H=this;this.unit=f;var F=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},D=document.createElement("div");D.className="geRuler";D.style.position="fixed";this.updateStyle=mxUtils.bind(this,+function(){F=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};D.style[k?"borderRight":"borderBottom"]="0.5px solid "+F.strokeClr;D.style.borderLeft="0.5px solid "+F.strokeClr});this.updateStyle();b.diagramContainer.appendChild(D);mxEvent.disableContextMenu(D);this.editorUiRefresh=b.refresh;b.refresh=function(C){H.editorUiRefresh.apply(b,+arguments);p()};p();var c=document.createElement("canvas");c.width=D.offsetWidth;c.height=D.offsetHeight;D.style.overflow="hidden";c.style.position="relative";D.appendChild(c);var g=c.getContext("2d");this.ui=b;var l=b.editor.graph;this.graph=l;this.container=D;this.canvas=c;var n=function(C,G,N,J,T){C=Math.round(C);G=Math.round(G);N=Math.round(N);J=Math.round(J);g.beginPath();g.moveTo(C+.5,G+.5);g.lineTo(N+.5,J+.5);g.stroke();T&&(k?(g.save(),g.translate(C,G),g.rotate(-Math.PI/2),g.fillText(T,0,0),+g.restore()):g.fillText(T,C,G))},v=function(){g.clearRect(0,0,c.width,c.height);g.beginPath();g.lineWidth=.7;g.strokeStyle=F.strokeClr;g.setLineDash([]);g.font="9px Arial";g.textAlign="center";var C=l.view.scale,G=l.view.getBackgroundPageBounds(),N=l.view.translate,J=l.pageVisible;N=J?I+(k?G.y-l.container.scrollTop:G.x-l.container.scrollLeft):I+(k?N.y*C-l.container.scrollTop:N.x*C-l.container.scrollLeft);var T=0;J&&(T=l.getPageLayout(),T=k?T.y*l.pageFormat.height:T.x*l.pageFormat.width);var V;switch(H.unit){case mxConstants.POINTS:var t=+V=10;var z=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:V=10;t=mxConstants.PIXELS_PER_MM;z=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:V=20;t=mxConstants.PIXELS_PER_MM;z=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:V=.5>=C||4<=C?8:16,t=mxConstants.PIXELS_PER_INCH/V,z=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var L=t;2<=C?L=t/(2*Math.floor(C/2)):.5>=C&&(L=t*Math.floor(1/C/2)*(H.unit==mxConstants.MILLIMETERS?2:1));t=null;G=J?Math.min(N+(k?G.height:G.width),k?+c.height:c.width):k?c.height:c.width;if(J)if(g.fillStyle=F.outBkgClr,k){var K=N-I;0<K&&g.fillRect(0,I,I,K);G<c.height&&g.fillRect(0,G,I,c.height)}else K=N-I,0<K&&g.fillRect(I,0,K,I),G<c.width&&g.fillRect(G,0,c.width,I);g.fillStyle=F.fontClr;for(J=J?N:N%(L*C);J<=G;J+=L*C)if(K=Math.round((J-N)/C/L),!(J<I||K==t)){t=K;var M=null;0==K%V&&(M=H.formatText(T+K*L)+"");k?n(I-z[Math.abs(K)%V],J,I,J,M):n(J,I-z[Math.abs(K)%V],J,I,M)}g.lineWidth=1;n(k?0:I,k?I:0,I,I);g.fillStyle=F.cornerClr;g.fillRect(0,0,I,I)},+x=-1,B=function(){null!=u?(null!=A&&A(x),x=u(v)):v()};this.drawRuler=B;this.sizeListener=f=q(function(){var C=l.container;k?(C=C.offsetHeight+I,c.height!=C&&(c.height=C,D.style.height=C+"px",B())):(C=C.offsetWidth+I,c.width!=C&&(c.width=C,D.style.width=C+"px",B()))},10);this.pageListener=function(){B()};this.scrollListener=d=q(function(){var C=k?l.container.scrollTop:l.container.scrollLeft;H.lastScroll!=C&&(H.lastScroll=C,B())},10);this.unitListener=function(C,G){H.setUnit(G.getProperty("unit"))};+l.addListener(mxEvent.SIZE,f);l.container.addEventListener("scroll",d);l.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(C){F=C;D.style.background=F.bkgClr;v()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(C,G,N,J){if(k&&4<C.height||!k&&4<C.width){if(null!=H.guidePart)try{g.putImageData(H.guidePart.imgData1,+H.guidePart.x1,H.guidePart.y1),g.putImageData(H.guidePart.imgData2,H.guidePart.x2,H.guidePart.y2),g.putImageData(H.guidePart.imgData3,H.guidePart.x3,H.guidePart.y3)}catch(P){}var T=H.origGuideMove.apply(this,arguments);try{g.lineWidth=.5;g.strokeStyle=F.guideClr;g.setLineDash([2]);if(k){var V=C.y+T.y+I-this.graph.container.scrollTop;var t=0;var z=V+C.height/2;var L=I/2;var K=V+C.height;var M=0;var m=g.getImageData(t,V-1,I,3);n(t,V,I,V);V--;var y=g.getImageData(L,z-1,I,3);n(L,z,I,z);z--;var E=g.getImageData(M,+K-1,I,3);n(M,K,I,K);K--}else V=0,t=C.x+T.x+I-this.graph.container.scrollLeft,z=I/2,L=t+C.width/2,K=0,M=t+C.width,m=g.getImageData(t-1,V,3,I),n(t,V,t,I),t--,y=g.getImageData(L-1,z,3,I),n(L,z,L,I),L--,E=g.getImageData(M-1,K,3,I),n(M,K,M,I),M--;if(null==H.guidePart||H.guidePart.x1!=t||H.guidePart.y1!=V)H.guidePart={imgData1:m,x1:t,y1:V,imgData2:y,x2:L,y2:z,imgData3:E,x3:M,y3:K}}catch(P){}}else T=H.origGuideMove.apply(this,arguments);return T};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=+function(){var C=H.origGuideDestroy.apply(this,arguments);if(null!=H.guidePart)try{g.putImageData(H.guidePart.imgData1,H.guidePart.x1,H.guidePart.y1),g.putImageData(H.guidePart.imgData2,H.guidePart.x2,H.guidePart.y2),g.putImageData(H.guidePart.imgData3,H.guidePart.x3,H.guidePart.y3),H.guidePart=null}catch(G){}return C}}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 k=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return k};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 p=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,-function(q){p=null!=b.currentMenu;mxEvent.consume(q)}),null,mxUtils.bind(this,function(q){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(q)||mxEvent.isPopupTrigger(q))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(q)||!p){var u=new mxPopupMenu(mxUtils.bind(this,function(I,G){b.menus.addMenuItems(I,["points","inches","millimeters","meters"],G)}));u.smartSeparators=!0;u.showDisabled=!0;u.autoExpand=!0;u.hideMenu=mxUtils.bind(this,-function(){mxPopupMenu.prototype.hideMenu.apply(u,arguments);b.resetCurrentMenu();u.destroy()});var A=mxEvent.getClientX(q),J=mxEvent.getClientY(q);u.popup(A,J,null,q);b.setCurrentMenu(u,d)}mxEvent.consume(q)}}))});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 k=mxFreehand.prototype.MILD_SMOOTHING,d=null,p=[],q,u=[],A,J=!1,I=!0,G=!0,E=!0,c=!0,g=[],l=!1,n=!1,v=!1,x="default",B={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},C=!0;this.setClosedPath=function(z){J=z};this.setAutoClose=function(z){I=z};this.setAutoInsert=-function(z){G=z};this.setAutoScroll=function(z){E=z};this.setOpenFill=function(z){c=z};this.setStopClickEnabled=function(z){n=z};this.setSelectInserted=function(z){v=z};this.setSmoothing=function(z){k=z};this.getSmoothing=function(){return k};this.setPerfectFreehandMode=function(z){C=z};this.isPerfectFreehandMode=function(){return C};this.setBrushSize=function(z){B.size=z};this.getBrushSize=function(){return B.size};var H=function(z){l=z;b.getRubberband().setEnabled(!z);b.graphHandler.setSelectEnabled(!z);-b.graphHandler.setMoveEnabled(!z);b.panningHandler.setPinchEnabled(!z);z?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){H(!0)};this.isDrawing=function(){return l};this.isActive=function(){return null!=d};var D=mxUtils.bind(this,function(z){if(d){var L=A.length,K=n&&0<u.length&&null!=A&&2>A.length;K||u.push.apply(u,A);A=[];u.push(null);p.push(d);d=null;(K||G)&&this.stopDrawing();-G&&(!K||2<=L)&&this.startDrawing();mxEvent.consume(z)}}),U=new mxCell;U.edge=!0;this.getStrokeColor=function(z){var L=null!=x?x:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(U),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=L||z||(L=b.shapeForegroundColor);return L};this.setStrokeColor=function(z){x=z};this.createStyle=function(z){var L=";fillColor=none;";C&&(L=";lineShape=1;");L+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+-"="+z+L};this.stopDrawing=function(){if(0<p.length){if(C){for(var z=[],L=0;L<u.length;L++)null!=u[L]&&z.push([u[L].x,u[L].y]);z=PerfectFreehand.getStroke(z,B);u=[];for(L=0;L<z.length;L++)u.push({x:z[L][0],y:z[L][1]});u.push(null)}z=u[0].x;var K=u[0].x,M=u[0].y,m=u[0].y;for(L=1;L<u.length;L++)null!=u[L]&&(z=Math.max(z,u[L].x),K=Math.min(K,u[L].x),M=Math.max(M,u[L].y),m=Math.min(m,u[L].y));z-=K;M-=m;if(0<z&&0<M){var y=100/z,F=100/M;u.map(function(Q){if(null==Q)return Q;Q.x=(Q.x-K)*y;Q.y=(Q.y-m)*F;return Q});-var N='<shape strokewidth="inherit"><foreground>',O=0;for(L=0;L<u.length;L++){var P=u[L];if(null==P){P=!1;O=u[O];var T=u[L-1];!J&&I&&(P=O.x-T.x,T=O.y-T.y,P=Math.sqrt(P*P+T*T)<=b.tolerance);if(J||P)N+='<line x="'+O.x.toFixed(2)+'" y="'+O.y.toFixed(2)+'"/>';N+="</path>"+(c||J||P?"<fillstroke/>":"<stroke/>");O=L+1}else N=L==O?N+('<path><move x="'+P.x.toFixed(2)+'" y="'+P.y.toFixed(2)+'"/>'):N+('<line x="'+P.x.toFixed(2)+'" y="'+P.y.toFixed(2)+'"/>')}N+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){L=-this.createStyle("stencil("+Graph.compress(N)+")");N=b.view.scale;O=b.view.translate;L=new mxCell("",new mxGeometry(K/N-O.x,m/N-O.y,z/N,M/N),L);L.vertex=1;b.model.beginUpdate();try{L=b.addCell(L),b.fireEvent(new mxEventObject("cellsInserted","cells",[L])),b.fireEvent(new mxEventObject("freehandInserted","cell",L))}finally{b.model.endUpdate()}v&&b.setSelectionCells([L])}}for(L=0;L<p.length;L++)p[L].parentNode.removeChild(p[L]);d=null;p=[];u=[]}H(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,+function(q){p=null!=b.currentMenu;mxEvent.consume(q)}),null,mxUtils.bind(this,function(q){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(q)||mxEvent.isPopupTrigger(q))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(q)||!p){var u=new mxPopupMenu(mxUtils.bind(this,function(H,F){b.menus.addMenuItems(H,["points","inches","millimeters","meters"],F)}));u.smartSeparators=!0;u.showDisabled=!0;u.autoExpand=!0;u.hideMenu=mxUtils.bind(this,+function(){mxPopupMenu.prototype.hideMenu.apply(u,arguments);b.resetCurrentMenu();u.destroy()});var A=mxEvent.getClientX(q),I=mxEvent.getClientY(q);u.popup(A,I,null,q);b.setCurrentMenu(u,d)}mxEvent.consume(q)}}))});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 k=mxFreehand.prototype.MILD_SMOOTHING,d=null,p=[],q,u=[],A,I=!1,H=!0,F=!0,D=!0,c=!0,g=[],l=!1,n=!1,v=!1,x="default",B={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},C=!0;this.setClosedPath=function(z){I=z};this.setAutoClose=function(z){H=z};this.setAutoInsert=+function(z){F=z};this.setAutoScroll=function(z){D=z};this.setOpenFill=function(z){c=z};this.setStopClickEnabled=function(z){n=z};this.setSelectInserted=function(z){v=z};this.setSmoothing=function(z){k=z};this.getSmoothing=function(){return k};this.setPerfectFreehandMode=function(z){C=z};this.isPerfectFreehandMode=function(){return C};this.setBrushSize=function(z){B.size=z};this.getBrushSize=function(){return B.size};var G=function(z){l=z;b.getRubberband().setEnabled(!z);b.graphHandler.setSelectEnabled(!z);+b.graphHandler.setMoveEnabled(!z);b.panningHandler.setPinchEnabled(!z);z?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){G(!0)};this.isDrawing=function(){return l};this.isActive=function(){return null!=d};var N=mxUtils.bind(this,function(z){if(d){var L=A.length,K=n&&0<u.length&&null!=A&&2>A.length;K||u.push.apply(u,A);A=[];u.push(null);p.push(d);d=null;(K||F)&&this.stopDrawing();+F&&(!K||2<=L)&&this.startDrawing();mxEvent.consume(z)}}),J=new mxCell;J.edge=!0;this.getStrokeColor=function(z){var L=null!=x?x:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(J),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=L||z||(L=b.shapeForegroundColor);return L};this.setStrokeColor=function(z){x=z};this.createStyle=function(z){var L=";fillColor=none;";C&&(L=";lineShape=1;");L+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE++"="+z+L};this.stopDrawing=function(){if(0<p.length){if(C){for(var z=[],L=0;L<u.length;L++)null!=u[L]&&z.push([u[L].x,u[L].y]);z=PerfectFreehand.getStroke(z,B);u=[];for(L=0;L<z.length;L++)u.push({x:z[L][0],y:z[L][1]});u.push(null)}z=u[0].x;var K=u[0].x,M=u[0].y,m=u[0].y;for(L=1;L<u.length;L++)null!=u[L]&&(z=Math.max(z,u[L].x),K=Math.min(K,u[L].x),M=Math.max(M,u[L].y),m=Math.min(m,u[L].y));z-=K;M-=m;if(0<z&&0<M){var y=100/z,E=100/M;u.map(function(R){if(null==R)return R;R.x=(R.x-K)*y;R.y=(R.y-m)*E;return R});+var P='<shape strokewidth="inherit"><foreground>',O=0;for(L=0;L<u.length;L++){var Q=u[L];if(null==Q){Q=!1;O=u[O];var U=u[L-1];!I&&H&&(Q=O.x-U.x,U=O.y-U.y,Q=Math.sqrt(Q*Q+U*U)<=b.tolerance);if(I||Q)P+='<line x="'+O.x.toFixed(2)+'" y="'+O.y.toFixed(2)+'"/>';P+="</path>"+(c||I||Q?"<fillstroke/>":"<stroke/>");O=L+1}else P=L==O?P+('<path><move x="'+Q.x.toFixed(2)+'" y="'+Q.y.toFixed(2)+'"/>'):P+('<line x="'+Q.x.toFixed(2)+'" y="'+Q.y.toFixed(2)+'"/>')}P+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){L=+this.createStyle("stencil("+Graph.compress(P)+")");P=b.view.scale;O=b.view.translate;L=new mxCell("",new mxGeometry(K/P-O.x,m/P-O.y,z/P,M/P),L);L.vertex=1;b.model.beginUpdate();try{L=b.addCell(L),b.fireEvent(new mxEventObject("cellsInserted","cells",[L])),b.fireEvent(new mxEventObject("freehandInserted","cell",L))}finally{b.model.endUpdate()}v&&b.setSelectionCells([L])}}for(L=0;L<p.length;L++)p[L].parentNode.removeChild(p[L]);d=null;p=[];u=[]}G(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(z,L){l&&L.getProperty("event").consume()}));b.addListener(mxEvent.GESTURE,mxUtils.bind(this,function(z,L){l&&mxEvent.consume(L.getProperty("event"))}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(z,L){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(z=L.getEvent(),l&&!mxEvent.isPopupTrigger(z)&&!mxEvent.isMiddleMouseButton(z)&&!mxEvent.isMultiTouchEvent(z))){var K=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);K=Math.max(1,K*b.view.scale);var M=this.getStrokeColor();-d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("fill",C?M:"none");d.setAttribute("pointer-events","none");d.setAttribute("stroke",M);d.setAttribute("stroke-width",K);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(M=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",M=M.split(" ").map(function(m){return parseFloat(m)*K}).join(" "),d.setAttribute("stroke-dasharray",M));g=[];z=S(z);V(z);q="M"+z.x+" "+z.y;u.push(z);A=[];d.setAttribute("d",C?PerfectFreehand.getSvgPathFromStroke([[z.x,-z.y]],B):q);f.appendChild(d);L.consume()}}),mouseMove:mxUtils.bind(this,function(z,L){if(null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){z=L.getEvent();z=S(z);V(z);var K=t(0);if(K)if(u.push(K),C){var M=[];for(K=0;K<u.length;K++)M.push([u[K].x,u[K].y]);A=[];for(var m=2;m<g.length;m+=2)K=t(m),M.push([K.x,K.y]),A.push(K);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(M,B))}else{q+=" L"+K.x+" "+K.y;M="";A=[];for(m=2;m<g.length;m+=2)K=t(m),M+=" L"+K.x+" "+K.y,A.push(K);d.setAttribute("d",-q+M)}E&&(K=b.view.translate,b.scrollRectToVisible((new mxRectangle(z.x-K.x,z.y-K.y)).grow(20)));L.consume()}}),mouseUp:mxUtils.bind(this,function(z,L){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(D(L.getEvent()),L.consume())})});var S=function(z){return mxUtils.convertPoint(b.container,mxEvent.getClientX(z),mxEvent.getClientY(z))},V=function(z){for(g.push(z);g.length>k;)g.shift()},t=function(z){var L=g.length;if(1===L%2||L>=k){var K=0,M=0,m,y=0;for(m=z;m<L;m++)y++,z=g[m],K+=z.x,-M+=z.y;return{x:K/y,y:M/y}}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,f,k){function d(O,P){try{if(!t){var T=f.file.getCurrentUser();if(V&&null!=T&&null!=T.displayName){var Q={from:H,id:n,type:O,sessionId:f.clientId,userId:T.id,username:T.displayName,data:P,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};Q={bytes:f.objectToString(Q),data:"aes"};Q=JSON.stringify(Q);z&&"cursor"!=O&&EditorUi.debug("P2PCollab: sending to socket server",[Q]);n++;T=!z&&("cursor"==O||"selectionChange"==O);S&&!T&&m("message",Q);if(T)for(p2pId in U)U[p2pId].send(Q)}}}catch(R){null!=-window.console&&console.error(R,O,P)}}function p(O){if(b.shareCursorPosition&&!G.isMouseDown){var P=mxUtils.getOffset(G.container),T=G.view.translate,Q=G.view.scale,R=null!=b.currentPage?b.currentPage.getId():null;d("cursor",{pageId:R,x:Math.round((O.getX()-P.x+G.container.scrollLeft)/Q-T.x),y:Math.round((O.getY()-P.y+G.container.scrollTop)/Q-T.y)})}}function q(O,P){var T=null!=b.currentPage?b.currentPage.getId():null;if(null!=O&&null!=O.cursor&&null!=O.lastCursor)if(null!=O.lastCursor.hide||!b.isShowRemoteCursors()||-null!=O.lastCursor.pageId&&O.lastCursor.pageId!=T)O.cursor.style.display="none";else{T=function(){var Z=Math.max(G.container.scrollLeft,Math.min(G.container.scrollLeft+G.container.clientWidth-O.cursor.clientWidth,W)),ba=Math.max(G.container.scrollTop-22,Math.min(G.container.scrollTop+G.container.clientHeight-O.cursor.clientHeight,X));Y.style.opacity=Z!=W||ba!=X?0:1;O.cursor.style.left=Z+"px";O.cursor.style.top=ba+"px";O.cursor.style.display=""};var Q=G.view.translate,R=G.view.scale,W=(Q.x+O.lastCursor.x)*-R+8,X=(Q.y+O.lastCursor.y)*R-12,Y=O.cursor.getElementsByTagName("img")[0];P?(mxUtils.setPrefixedStyle(O.cursor.style,"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(Y.style,"transition","all 900ms ease-out"),window.setTimeout(T,0)):(mxUtils.setPrefixedStyle(O.cursor.style,"transition",null),mxUtils.setPrefixedStyle(Y.style,"transition",null),T())}}function u(O,P){try{var T=function(){if(null==l[R]){var fa=C[R];null==fa&&(fa=E%g.length,C[R]=fa,E++);var la=g[fa];fa=11<fa?"black":"white";-l[R]={cursor:document.createElement("div"),color:la,selection:{}};x[P]=R;W=l[R].cursor;W.style.pointerEvents="none";W.style.position="absolute";W.style.display="none";W.style.opacity="0.9";var oa=document.createElement("img");mxUtils.setPrefixedStyle(oa.style,"transform","rotate(-45deg)translateX(-14px)");oa.setAttribute("src",Graph.createSvgImage(8,12,'<path d="M 4 0 L 8 12 L 4 10 L 0 12 Z" stroke="'+la+'" fill="'+la+'"/>').src);oa.style.width="10px";W.appendChild(oa);oa=document.createElement("div");-oa.style.backgroundColor=la;oa.style.color=fa;oa.style.fontSize="9pt";oa.style.padding="3px 7px";oa.style.marginTop="8px";oa.style.borderRadius="10px";oa.style.maxWidth="100px";oa.style.overflow="hidden";oa.style.textOverflow="ellipsis";oa.style.whiteSpace="nowrap";mxUtils.write(oa,Q);W.appendChild(oa);b.diagramContainer.appendChild(W)}else W=l[R].cursor;X=l[R].selection};if(!t){O=JSON.parse(O);null!=O.bytes&&(O=f.stringToObject(O.bytes));z&&"cursor"!=O.type&&EditorUi.debug("P2PCollab: msg received",-[O]);if(null!=P){if(O.from==H||v[O.from]>=O.id){EditorUi.debug("P2PCollab: Dropped Message",O,H,v[O.from]);return}v[O.from]=O.id}var Q=O.username?O.username:"Anonymous",R=O.sessionId,W,X;null!=l[R]&&(clearTimeout(l[R].inactiveTO),l[R].inactiveTO=setTimeout(function(){J(null,R)},12E4));var Y=O.data;switch(O.type){case "cursor":T();l[R].lastCursor=Y;q(l[R],!0);break;case "diff":try{O=null!=Y.patch?f.stringToObject(decodeURIComponent(Y.patch)):Y.diff,f.receiveRemoteChanges(O.d)}catch(fa){EditorUi.debug("P2PCollab: Diff msg error",-fa)}break;case "selectionChange":if("0"!=urlParams["remote-selection"]){var Z=null!=b.currentPage?b.currentPage.getId():null;if(null==Z||null!=Y.pageId&&Y.pageId==Z){T();for(T=0;T<Y.removed.length;T++){var ba=Y.removed[T];if(null!=ba){var ea=X[ba];delete X[ba];null!=ea&&ea.destroy()}}for(T=0;T<Y.added.length;T++)if(ba=Y.added[T],null!=ba){var ha=G.model.getCell(ba);null!=ha&&(X[ba]=G.highlightCell(ha,l[R].color,6E4,70,3))}}}break;case "notify":O=null!=Y.data?f.stringToObject(decodeURIComponent(Y.data)):-Y.msg,f.handleMessageData(O.d)}f.file.fireEvent(new mxEventObject("realtimeMessage","message",O))}}catch(fa){null!=window.console&&console.warn(fa,O,P)}}function A(O,P){if(!z&&SimplePeer.WEBRTC_SUPPORT){var T=new SimplePeer({initiator:P,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});T.on("signal",function(Q){m("sendSignal",{to:O,from:H,signal:Q})});T.on("error",function(Q){delete D[O];EditorUi.debug("P2PCollab: p2p socket error",Q);!t&&P&&T.destroyed&&B[O]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",-O),A(O,!0))});T.on("connect",function(){delete D[O];null==U[O]||U[O].destroyed?(U[O]=T,B[O]=!0,EditorUi.debug("P2PCollab: p2p socket connected",O)):(T.noP2PMapDel=!0,T.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",O))});T.on("close",function(){T.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",O),I(x[O]),delete U[O])});T.on("data",u);return D[O]=T}}function J(O,P){I(P||x[O]);null!=O&&(delete x[O],B[O]=!1)}function I(O){var P=l[O];if(null!=P){var T=P.selection,Q;for(Q in T)null!=-T[Q]&&T[Q].destroy();null!=P.cursor&&null!=P.cursor.parentNode&&P.cursor.parentNode.removeChild(P.cursor);clearTimeout(P.inactiveTO);delete l[O]}}var G=b.editor.graph,E=0,c=null,g="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),l={},n=1,v={},x={},B={},C={},H,D={},U={},S=!0,V=!1,t=!1,z="0"!=urlParams["no-p2p"],L=!1,K=0,M=null,m=mxUtils.bind(this,function(O,P){if(!t)try{null!=-c?(c.send(JSON.stringify({action:O,msg:P})),z||EditorUi.debug("P2PCollab: sending to socket server",[O],[P])):this.joinFile(!0)}catch(T){M=T,f.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,T)}});this.sendMessage=d;this.sendDiff=function(O){this.sendMessage("diff",{diff:O})};this.sendNotification=function(O){this.sendMessage("notify",{msg:O})};this.getState=function(){return null!=c?c.readyState:3};this.getLastError=function(){return M};-this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(O,P){},mouseMove:function(O,P){var T,Q=-1;return function(){clearTimeout(T);var R=this,W=arguments,X=function(){T=null;Q=Date.now();O.apply(R,W)};Date.now()-Q>P?X():T=setTimeout(X,P)}}(function(O,P){p(P)},300),mouseUp:function(O,P){p(P)}};G.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||d("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);-var y=mxGraphHandler.prototype.maxCells,F=null,N={};this.selectionChangeListener=function(O,P){var T=function(Q){return null!=Q?Q.id:null};null!=F&&window.clearTimeout(F);F=window.setTimeout(function(){for(var Q=G.getSelectionCount()>y?[]:G.getSelectionCells().map(T),R=null!=b.currentPage?b.currentPage.getId():null,W={},X=[],Y=[],Z=0;Z<Q.length;Z++){var ba=Q[Z];null!=ba&&(W[ba]=!0,null==N[ba]&&Y.push(ba))}for(ba in N)W[ba]||X.push(ba);N=W;d("selectionChange",{pageId:R,removed:X,added:Y})},300)};G.getSelectionModel().addListener(mxEvent.CHANGE,-this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var O in l)q(l[O])});mxEvent.addListener(G.container,"scroll",this.cursorHandler);G.getView().addListener(mxEvent.SCALE,this.cursorHandler);G.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);G.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(O){if(!t)try{L&&-(EditorUi.debug("P2PCollab: joinInProgress on",L),M="busy");L=++K;try{null!=c&&1==c.readyState&&(EditorUi.debug("P2PCollab: force closing socket on",c.joinId),c.close(1E3),c=null)}catch(Q){EditorUi.debug("P2PCollab: closing socket error",Q)}var P=new WebSocket(window.RT_WEBSOCKET_URL+"?id="+k);null==c&&(c=P);P.addEventListener("open",function(Q){c=P;c.joinId=L;L=!1;f.file.fireEvent(new mxEventObject("realtimeStateChanged"));EditorUi.debug("P2PCollab: open socket",c.joinId);Editor.enableRealtimeCache||-window.setTimeout(function(){f.sendJoinMessage()},0);O&&f.scheduleCleanup()});P.addEventListener("message",function(Q){try{z||EditorUi.debug("P2PCollab: msg received",[Q]);var R=JSON.parse(Q.data);z&&"message"!=R.action&&EditorUi.debug("P2PCollab: msg received",[Q]);switch(R.action){case "message":u(R.msg,R.from);break;case "clientsList":var W=R.msg;H=W.cId;V=!0;for(R=0;R<W.list.length;R++)A(W.list[R],!0);break;case "signal":var X=R.msg;if(!z){if(D[X.from])var Y=D[X.from];else Y=A(X.from,!1),S=!0;-Y.signal(X.signal)}break;case "newClient":S=!0;break;case "clientLeft":J(R.msg);break;case "sendSignalFailed":var Z=R.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",Z);delete D[Z.to];B[Z.to]=!1}}catch(ba){null!=window.console&&console.warn(ba,Q)}});var T=!1;P.addEventListener("close",mxUtils.bind(this,function(Q){EditorUi.debug("P2PCollab: WebSocket closed",P.joinId,"reconnecting",Q.code,Q.reason);EditorUi.debug("P2PCollab: closing socket on",P.joinId);t||1E3==Q.code||-K!=P.joinId||(L==K&&(EditorUi.debug("P2PCollab: joinInProgress in close on",P.joinId),L=!1),T||(EditorUi.debug("P2PCollab: calling rejoin on",P.joinId),window.setTimeout(mxUtils.bind(this,function(){T=!0;this.joinFile(!0)}),500)));f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));P.addEventListener("error",mxUtils.bind(this,function(Q){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",Q);EditorUi.debug("P2PCollab: error socket on",P.joinId);t||K!=P.joinId||(L==K&&(EditorUi.debug("P2PCollab: joinInProgress in error on",-P.joinId),L=!1),T||(EditorUi.debug("P2PCollab: calling rejoin on",P.joinId),T=!0,this.joinFile(!0)));f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(Q){M=Q,f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!t){EditorUi.debug("P2PCollab: destroyed");t=!0;for(sessionId in l)I(sessionId);null!=this.mouseListeners&&G.removeMouseListener(this.mouseListeners);null!=this.selectionChangeListener&&-G.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(G.container,"scroll",this.cursorHandler),G.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=c&&1<=c.readyState&&(c.close(1E3),c=null);for(var O in U)null!=U[O]&&U[O].destroy();f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}}+d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("fill",C?M:"none");d.setAttribute("pointer-events","none");d.setAttribute("stroke",M);d.setAttribute("stroke-width",K);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(M=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",M=M.split(" ").map(function(m){return parseFloat(m)*K}).join(" "),d.setAttribute("stroke-dasharray",M));g=[];z=T(z);V(z);q="M"+z.x+" "+z.y;u.push(z);A=[];d.setAttribute("d",C?PerfectFreehand.getSvgPathFromStroke([[z.x,+z.y]],B):q);f.appendChild(d);L.consume()}}),mouseMove:mxUtils.bind(this,function(z,L){if(null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){z=L.getEvent();z=T(z);V(z);var K=t(0);if(K)if(u.push(K),C){var M=[];for(K=0;K<u.length;K++)M.push([u[K].x,u[K].y]);A=[];for(var m=2;m<g.length;m+=2)K=t(m),M.push([K.x,K.y]),A.push(K);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(M,B))}else{q+=" L"+K.x+" "+K.y;M="";A=[];for(m=2;m<g.length;m+=2)K=t(m),M+=" L"+K.x+" "+K.y,A.push(K);d.setAttribute("d",+q+M)}D&&(K=b.view.translate,b.scrollRectToVisible((new mxRectangle(z.x-K.x,z.y-K.y)).grow(20)));L.consume()}}),mouseUp:mxUtils.bind(this,function(z,L){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(N(L.getEvent()),L.consume())})});var T=function(z){return mxUtils.convertPoint(b.container,mxEvent.getClientX(z),mxEvent.getClientY(z))},V=function(z){for(g.push(z);g.length>k;)g.shift()},t=function(z){var L=g.length;if(1===L%2||L>=k){var K=0,M=0,m,y=0;for(m=z;m<L;m++)y++,z=g[m],K+=z.x,+M+=z.y;return{x:K/y,y:M/y}}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,f,k){function d(O,Q){try{if(!t){var U=f.file.getCurrentUser();if(V&&null!=U&&null!=U.displayName){var R={from:G,id:n,type:O,sessionId:f.clientId,userId:U.id,username:U.displayName,data:Q,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};R={bytes:f.objectToString(R),data:"aes"};R=JSON.stringify(R);z&&"cursor"!=O&&EditorUi.debug("P2PCollab: sending to socket server",[R]);n++;U=!z&&("cursor"==O||"selectionChange"==O);T&&!U&&m("message",R);if(U)for(p2pId in J)J[p2pId].send(R)}}}catch(S){null!=+window.console&&console.error(S,O,Q)}}function p(O){if(b.shareCursorPosition&&!F.isMouseDown){var Q=mxUtils.getOffset(F.container),U=F.view.translate,R=F.view.scale,S=null!=b.currentPage?b.currentPage.getId():null;d("cursor",{pageId:S,x:Math.round((O.getX()-Q.x+F.container.scrollLeft)/R-U.x),y:Math.round((O.getY()-Q.y+F.container.scrollTop)/R-U.y)})}}function q(O,Q){var U=null!=b.currentPage?b.currentPage.getId():null;if(null!=O&&null!=O.cursor&&null!=O.lastCursor)if(null!=O.lastCursor.hide||!b.isShowRemoteCursors()||+null!=O.lastCursor.pageId&&O.lastCursor.pageId!=U)O.cursor.style.display="none";else{U=function(){var Z=Math.max(F.container.scrollLeft,Math.min(F.container.scrollLeft+F.container.clientWidth-O.cursor.clientWidth,W)),aa=Math.max(F.container.scrollTop-22,Math.min(F.container.scrollTop+F.container.clientHeight-O.cursor.clientHeight,X));Y.style.opacity=Z!=W||aa!=X?0:1;O.cursor.style.left=Z+"px";O.cursor.style.top=aa+"px";O.cursor.style.display=""};var R=F.view.translate,S=F.view.scale,W=(R.x+O.lastCursor.x)*+S+8,X=(R.y+O.lastCursor.y)*S-12,Y=O.cursor.getElementsByTagName("img")[0];Q?(mxUtils.setPrefixedStyle(O.cursor.style,"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(Y.style,"transition","all 900ms ease-out"),window.setTimeout(U,0)):(mxUtils.setPrefixedStyle(O.cursor.style,"transition",null),mxUtils.setPrefixedStyle(Y.style,"transition",null),U())}}function u(O,Q){try{var U=function(){if(null==l[S]){var ea=C[S];null==ea&&(ea=D%g.length,C[S]=ea,D++);var ma=g[ea];ea=11<ea?"black":"white";+l[S]={cursor:document.createElement("div"),color:ma,selection:{}};x[Q]=S;W=l[S].cursor;W.style.pointerEvents="none";W.style.position="absolute";W.style.display="none";W.style.opacity="0.9";var na=document.createElement("img");mxUtils.setPrefixedStyle(na.style,"transform","rotate(-45deg)translateX(-14px)");na.setAttribute("src",Graph.createSvgImage(8,12,'<path d="M 4 0 L 8 12 L 4 10 L 0 12 Z" stroke="'+ma+'" fill="'+ma+'"/>').src);na.style.width="10px";W.appendChild(na);na=document.createElement("div");+na.style.backgroundColor=ma;na.style.color=ea;na.style.fontSize="9pt";na.style.padding="3px 7px";na.style.marginTop="8px";na.style.borderRadius="10px";na.style.maxWidth="100px";na.style.overflow="hidden";na.style.textOverflow="ellipsis";na.style.whiteSpace="nowrap";mxUtils.write(na,R);W.appendChild(na);b.diagramContainer.appendChild(W)}else W=l[S].cursor;X=l[S].selection};if(!t){O=JSON.parse(O);null!=O.bytes&&(O=f.stringToObject(O.bytes));z&&"cursor"!=O.type&&EditorUi.debug("P2PCollab: msg received",+[O]);if(null!=Q){if(O.from==G||v[O.from]>=O.id){EditorUi.debug("P2PCollab: Dropped Message",O,G,v[O.from]);return}v[O.from]=O.id}var R=O.username?O.username:"Anonymous",S=O.sessionId,W,X;null!=l[S]&&(clearTimeout(l[S].inactiveTO),l[S].inactiveTO=setTimeout(function(){I(null,S)},12E4));var Y=O.data;switch(O.type){case "cursor":U();l[S].lastCursor=Y;q(l[S],!0);break;case "diff":try{O=null!=Y.patch?f.stringToObject(decodeURIComponent(Y.patch)):Y.diff,f.receiveRemoteChanges(O.d)}catch(ea){EditorUi.debug("P2PCollab: Diff msg error",+ea)}break;case "selectionChange":if("0"!=urlParams["remote-selection"]){var Z=null!=b.currentPage?b.currentPage.getId():null;if(null==Z||null!=Y.pageId&&Y.pageId==Z){U();for(U=0;U<Y.removed.length;U++){var aa=Y.removed[U];if(null!=aa){var fa=X[aa];delete X[aa];null!=fa&&fa.destroy()}}for(U=0;U<Y.added.length;U++)if(aa=Y.added[U],null!=aa){var ia=F.model.getCell(aa);null!=ia&&(X[aa]=F.highlightCell(ia,l[S].color,6E4,70,3))}}}break;case "notify":O=null!=Y.data?f.stringToObject(decodeURIComponent(Y.data)):+Y.msg,f.handleMessageData(O.d)}f.file.fireEvent(new mxEventObject("realtimeMessage","message",O))}}catch(ea){null!=window.console&&console.warn(ea,O,Q)}}function A(O,Q){if(!z&&SimplePeer.WEBRTC_SUPPORT){var U=new SimplePeer({initiator:Q,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});U.on("signal",function(R){m("sendSignal",{to:O,from:G,signal:R})});U.on("error",function(R){delete N[O];EditorUi.debug("P2PCollab: p2p socket error",R);!t&&Q&&U.destroyed&&B[O]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",+O),A(O,!0))});U.on("connect",function(){delete N[O];null==J[O]||J[O].destroyed?(J[O]=U,B[O]=!0,EditorUi.debug("P2PCollab: p2p socket connected",O)):(U.noP2PMapDel=!0,U.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",O))});U.on("close",function(){U.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",O),H(x[O]),delete J[O])});U.on("data",u);return N[O]=U}}function I(O,Q){H(Q||x[O]);null!=O&&(delete x[O],B[O]=!1)}function H(O){var Q=l[O];if(null!=Q){var U=Q.selection,R;for(R in U)null!=+U[R]&&U[R].destroy();null!=Q.cursor&&null!=Q.cursor.parentNode&&Q.cursor.parentNode.removeChild(Q.cursor);clearTimeout(Q.inactiveTO);delete l[O]}}var F=b.editor.graph,D=0,c=null,g="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),l={},n=1,v={},x={},B={},C={},G,N={},J={},T=!0,V=!1,t=!1,z="0"!=urlParams["no-p2p"],L=!1,K=0,M=null,m=mxUtils.bind(this,function(O,Q){if(!t)try{null!=+c?(c.send(JSON.stringify({action:O,msg:Q})),z||EditorUi.debug("P2PCollab: sending to socket server",[O],[Q])):this.joinFile(!0)}catch(U){M=U,f.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,U)}});this.sendMessage=d;this.sendDiff=function(O){this.sendMessage("diff",{diff:O})};this.sendNotification=function(O){this.sendMessage("notify",{msg:O})};this.getState=function(){return null!=c?c.readyState:3};this.getLastError=function(){return M};+this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(O,Q){},mouseMove:function(O,Q){var U,R=-1;return function(){clearTimeout(U);var S=this,W=arguments,X=function(){U=null;R=Date.now();O.apply(S,W)};Date.now()-R>Q?X():U=setTimeout(X,Q)}}(function(O,Q){p(Q)},300),mouseUp:function(O,Q){p(Q)}};F.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||d("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);+var y=mxGraphHandler.prototype.maxCells,E=null,P={};this.selectionChangeListener=function(O,Q){var U=function(R){return null!=R?R.id:null};null!=E&&window.clearTimeout(E);E=window.setTimeout(function(){for(var R=F.getSelectionCount()>y?[]:F.getSelectionCells().map(U),S=null!=b.currentPage?b.currentPage.getId():null,W={},X=[],Y=[],Z=0;Z<R.length;Z++){var aa=R[Z];null!=aa&&(W[aa]=!0,null==P[aa]&&Y.push(aa))}for(aa in P)W[aa]||X.push(aa);P=W;d("selectionChange",{pageId:S,removed:X,added:Y})},300)};F.getSelectionModel().addListener(mxEvent.CHANGE,+this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var O in l)q(l[O])});mxEvent.addListener(F.container,"scroll",this.cursorHandler);F.getView().addListener(mxEvent.SCALE,this.cursorHandler);F.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);F.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(O){if(!t)try{L&&+(EditorUi.debug("P2PCollab: joinInProgress on",L),M="busy");L=++K;try{null!=c&&1==c.readyState&&(EditorUi.debug("P2PCollab: force closing socket on",c.joinId),c.close(1E3),c=null)}catch(R){EditorUi.debug("P2PCollab: closing socket error",R)}var Q=new WebSocket(window.RT_WEBSOCKET_URL+"?id="+k);null==c&&(c=Q);Q.addEventListener("open",function(R){c=Q;c.joinId=L;L=!1;f.file.fireEvent(new mxEventObject("realtimeStateChanged"));EditorUi.debug("P2PCollab: open socket",c.joinId);Editor.enableRealtimeCache||+window.setTimeout(function(){f.sendJoinMessage()},0);O&&f.scheduleCleanup()});Q.addEventListener("message",function(R){try{z||EditorUi.debug("P2PCollab: msg received",[R]);var S=JSON.parse(R.data);z&&"message"!=S.action&&EditorUi.debug("P2PCollab: msg received",[R]);switch(S.action){case "message":u(S.msg,S.from);break;case "clientsList":var W=S.msg;G=W.cId;V=!0;for(S=0;S<W.list.length;S++)A(W.list[S],!0);break;case "signal":var X=S.msg;if(!z){if(N[X.from])var Y=N[X.from];else Y=A(X.from,!1),T=!0;+Y.signal(X.signal)}break;case "newClient":T=!0;break;case "clientLeft":I(S.msg);break;case "sendSignalFailed":var Z=S.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",Z);delete N[Z.to];B[Z.to]=!1}}catch(aa){null!=window.console&&console.warn(aa,R)}});var U=!1;Q.addEventListener("close",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket closed",Q.joinId,"reconnecting",R.code,R.reason);EditorUi.debug("P2PCollab: closing socket on",Q.joinId);t||1E3==R.code||+K!=Q.joinId||(L==K&&(EditorUi.debug("P2PCollab: joinInProgress in close on",Q.joinId),L=!1),U||(EditorUi.debug("P2PCollab: calling rejoin on",Q.joinId),window.setTimeout(mxUtils.bind(this,function(){U=!0;this.joinFile(!0)}),500)));f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));Q.addEventListener("error",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",R);EditorUi.debug("P2PCollab: error socket on",Q.joinId);t||K!=Q.joinId||(L==K&&(EditorUi.debug("P2PCollab: joinInProgress in error on",+Q.joinId),L=!1),U||(EditorUi.debug("P2PCollab: calling rejoin on",Q.joinId),U=!0,this.joinFile(!0)));f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(R){M=R,f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!t){EditorUi.debug("P2PCollab: destroyed");t=!0;for(sessionId in l)H(sessionId);null!=this.mouseListeners&&F.removeMouseListener(this.mouseListeners);null!=this.selectionChangeListener&&+F.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(F.container,"scroll",this.cursorHandler),F.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=c&&1<=c.readyState&&(c.close(1E3),c=null);for(var O in J)null!=J[O]&&J[O].destroy();f.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}};Editor.themes.unshift("simple");Editor.themes.push("sketch");Editor.themes.push("atlas");(function(){EditorUi.prototype.switchCssForTheme=function(p){var q=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=q&&("kennedy"==p?q.classList.add("geClassic"):q.classList.remove("geClassic"),"sketch"==p&&q.classList.add("geSketch"),"simple"==p||"sketch"==p?q.classList.add("geSimple"):q.classList.remove("geSimple"))};var b=EditorUi.prototype.createMainMenuForTheme;EditorUi.prototype.createMainMenuForTheme=function(p){if("simple"==p||"sketch"==-p){if(null==this.sketchMainMenuElt){this.sketchMainMenuElt=document.createElement("div");var q=this.createMenu("simple"==p?"view":"diagram","simple"==p?Editor.thinViewImage:Editor.menuImage);this.sketchMainMenuElt.appendChild(q);var u=this.createMenuItem("delete",Editor.trashImage),A=this.createMenuItem("undo",Editor.undoImage),J=this.createMenuItem("redo",Editor.redoImage);this.dependsOnLanguage(mxUtils.bind(this,function(){q.setAttribute("title",mxResources.get("simple"==p?"view":"diagram"));u.setAttribute("title",-mxResources.get("delete"));A.setAttribute("title",mxResources.get("undo"));J.setAttribute("title",mxResources.get("redo"))}));"simple"==p?this.sketchMainMenuElt.className="geToolbarContainer geSimpleMainMenu":(this.container.appendChild(this.sketchMainMenuElt),this.sketchMainMenuElt.className="geToolbarContainer geSketchMainMenu",this.sketchMainMenuElt.appendChild(u),this.sketchMainMenuElt.appendChild(A),this.sketchMainMenuElt.appendChild(J));this.container.appendChild(this.sketchMainMenuElt)}}else b.apply(this,-arguments)};var f=EditorUi.prototype.createFooterMenuForTheme;EditorUi.prototype.createFooterMenuForTheme=function(p){if("simple"==p||"sketch"==p){if(null==this.sketchFooterMenuElt){var q=this.createPageMenuTab(!1,"simple"!=p),u=this.createMenu("pages",Editor.thinNoteImage),A=this.createMenuItem("undo",Editor.thinUndoImage),J=this.createMenuItem("redo",Editor.thinRedoImage),I=this.createMenuItem("delete",Editor.thinDeleteImage),G=this.createMenuItem("zoomOut",Editor.zoomOutImage),E=this.createMenuItem("zoomIn",-Editor.zoomInImage),c=this.createMenuItem("fullscreen",Editor.fullscreenImage),g=this.createMenuItem("exit",Editor.closeImage);this.dependsOnLanguage(mxUtils.bind(this,function(){u.setAttribute("title",mxResources.get("pages"));A.setAttribute("title",mxResources.get("undo"));J.setAttribute("title",mxResources.get("redo"));I.setAttribute("title",mxResources.get("delete"));G.setAttribute("title",mxResources.get("zoomOut"));E.setAttribute("title",mxResources.get("zoomIn"));c.setAttribute("title",mxResources.get("fullscreen"));+p){if(null==this.sketchMainMenuElt){this.sketchMainMenuElt=document.createElement("div");var q=this.createMenu("simple"==p?"view":"diagram","simple"==p?Editor.thinViewImage:Editor.menuImage);this.sketchMainMenuElt.appendChild(q);var u=this.createMenuItem("delete",Editor.trashImage),A=this.createMenuItem("undo",Editor.undoImage),I=this.createMenuItem("redo",Editor.redoImage);this.dependsOnLanguage(mxUtils.bind(this,function(){q.setAttribute("title",mxResources.get("simple"==p?"view":"diagram"));u.setAttribute("title",+mxResources.get("delete"));A.setAttribute("title",mxResources.get("undo"));I.setAttribute("title",mxResources.get("redo"))}));"simple"==p?this.sketchMainMenuElt.className="geToolbarContainer geSimpleMainMenu":(this.container.appendChild(this.sketchMainMenuElt),this.sketchMainMenuElt.className="geToolbarContainer geSketchMainMenu",this.sketchMainMenuElt.appendChild(u),this.sketchMainMenuElt.appendChild(A),this.sketchMainMenuElt.appendChild(I));this.container.appendChild(this.sketchMainMenuElt)}}else b.apply(this,+arguments)};var f=EditorUi.prototype.createFooterMenuForTheme;EditorUi.prototype.createFooterMenuForTheme=function(p){if("simple"==p||"sketch"==p){if(null==this.sketchFooterMenuElt){var q=this.createPageMenuTab(!1,"simple"!=p),u=this.createMenu("pages",Editor.thinNoteImage),A=this.createMenuItem("undo",Editor.thinUndoImage),I=this.createMenuItem("redo",Editor.thinRedoImage),H=this.createMenuItem("delete",Editor.thinDeleteImage),F=this.createMenuItem("zoomOut",Editor.zoomOutImage),D=this.createMenuItem("zoomIn",+Editor.zoomInImage),c=this.createMenuItem("fullscreen",Editor.fullscreenImage),g=this.createMenuItem("exit",Editor.closeImage);this.dependsOnLanguage(mxUtils.bind(this,function(){u.setAttribute("title",mxResources.get("pages"));A.setAttribute("title",mxResources.get("undo"));I.setAttribute("title",mxResources.get("redo"));H.setAttribute("title",mxResources.get("delete"));F.setAttribute("title",mxResources.get("zoomOut"));D.setAttribute("title",mxResources.get("zoomIn"));c.setAttribute("title",mxResources.get("fullscreen"));g.setAttribute("title",mxResources.get("exit"))}));this.sketchFooterMenuElt=document.createElement("div");this.sketchFooterMenuElt.className="geToolbarContainer geFooterToolbar";var l=this.sketchFooterMenuElt;if("simple"!=p){q.className="geButton gePageMenu";q.style.backgroundImage="url("+Editor.arrowDownImage+")";l.appendChild(q);var n=document.createElement("span");q.innerText="";q.appendChild(n);var v=mxUtils.bind(this,function(){n.innerText="";if(null!=this.currentPage){mxUtils.write(n,this.currentPage.getName());-var H=null!=this.pages?this.pages.length:1,D=this.getPageIndex(this.currentPage);D=null!=D?D+1:1;var U=this.currentPage.getId();q.setAttribute("title",this.currentPage.getName()+" ("+D+"/"+H+")"+(null!=U?" ["+U+"]":""))}});this.editor.addListener("pagesPatched",v);this.editor.addListener("pageSelected",v);this.editor.addListener("pageRenamed",v);this.editor.addListener("fileLoaded",v);v();var x=mxUtils.bind(this,function(){q.style.display=this.isPageMenuVisible()?"":"none"});this.addListener("editInlineStart",-mxUtils.bind(this,function(){x();v()}));this.addListener("fileDescriptorChanged",x);this.addListener("pagesVisibleChanged",x);this.editor.addListener("pagesPatched",x);x();l.appendChild(G)}var B=this.createZoomInput("simple"!=p);l.appendChild(B);if("simple"==p){A.style.marginLeft="auto";l.appendChild(u);l.appendChild(A);l.appendChild(J);l.appendChild(I);var C=mxUtils.bind(this,function(){var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,D="1"==urlParams.embed&&-null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;u.style.display=H<480+D?"none":"";B.style.display=H<750+D?"none":"";I.style.display=H<290+D?"none":"";A.style.display=H<360+D?"none":"";J.style.display=H<360+D?"none":""});mxEvent.addListener(window,"resize",C);C()}"simple"!=p&&l.appendChild(E);"1"==urlParams.embedInline&&(l.appendChild(c),C=mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")";this.inlineSizeChanged();+var G=null!=this.pages?this.pages.length:1,N=this.getPageIndex(this.currentPage);N=null!=N?N+1:1;var J=this.currentPage.getId();q.setAttribute("title",this.currentPage.getName()+" ("+N+"/"+G+")"+(null!=J?" ["+J+"]":""))}});this.editor.addListener("pagesPatched",v);this.editor.addListener("pageSelected",v);this.editor.addListener("pageRenamed",v);this.editor.addListener("fileLoaded",v);v();var x=mxUtils.bind(this,function(){q.style.display=this.isPageMenuVisible()?"":"none"});this.addListener("editInlineStart",+mxUtils.bind(this,function(){x();v()}));this.addListener("fileDescriptorChanged",x);this.addListener("pagesVisibleChanged",x);this.editor.addListener("pagesPatched",x);x();l.appendChild(F)}var B=this.createZoomInput("simple"!=p);l.appendChild(B);if("simple"==p){A.style.marginLeft="auto";l.appendChild(u);l.appendChild(A);l.appendChild(I);l.appendChild(H);var C=mxUtils.bind(this,function(){var G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,N="1"==urlParams.embed&&+null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;u.style.display=G<480+N?"none":"";B.style.display=G<750+N?"none":"";H.style.display=G<290+N?"none":"";A.style.display=G<360+N?"none":"";I.style.display=G<360+N?"none":""});mxEvent.addListener(window,"resize",C);C()}"simple"!=p&&l.appendChild(D);"1"==urlParams.embedInline&&(l.appendChild(c),C=mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")";this.inlineSizeChanged();this.editor.graph.refresh();this.fitWindows()}),this.addListener("editInlineStart",mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")"})),this.addListener("inlineFullscreenChanged",C),l.appendChild(g));"simple"==p?(this.sketchFooterMenuElt.style.cssText="position:relative;gap:6px;flex-shrink:0;flex-grow:0.5;",this.sketchMainMenuElt.appendChild(this.sketchFooterMenuElt)):this.container.appendChild(this.sketchFooterMenuElt)}}else f.apply(this,arguments)};var k=EditorUi.prototype.createPickerMenuForTheme;EditorUi.prototype.createPickerMenuForTheme=function(p){if("simple"==p||"sketch"==p){if(null==this.sketchPickerMenuElt){var q=this.editor.graph;this.sketchPickerMenuElt=document.createElement("div");this.sketchPickerMenuElt.className="geToolbarContainer";"sketch"==p&&this.sketchPickerMenuElt.classList.add("geVerticalToolbar");var u=this.sketchPickerMenuElt,A=document.createElement("a");A.className="geButton";A.style.height="18px";A.style.opacity=-"0.4";A.style.backgroundImage="url("+Editor.expandMoreImage+")";A.setAttribute("title",mxResources.get("collapseExpand"));var J=this.createMenuItem("insertFreehand","simple"==p?Editor.thinGestureImage:Editor.freehandImage,!0),I=this.createMenuItem("generate","simple"==p?Editor.thinSparklesImage:Editor.sparklesImage,!0),G=this.createMenu("insert","simple"==p?Editor.thinAddCircleImage:Editor.addBoxImage),E=this.createMenu("table",Editor.thinTableImage),c=G.cloneNode(!0);c.style.backgroundImage="url("+-("simple"==p?Editor.thinShapesImage:Editor.shapesImage)+")";c.setAttribute("title",mxResources.get("shapes"));this.addShapePicker(c,"simple"==p);var g=!1,l=mxUtils.bind(this,function(x){if(x||null!=document.body&&document.body.contains(u)){x=function(D,U,S,V,t,z){null!=U&&D.setAttribute("title",U);u.appendChild(D);"simple"!=p&&null!=V&&null!=D&&null==D.querySelector(".geShortcutKey")&&(U=document.createElement("div"),U.className="geShortcutKey",mxUtils.write(U,V),D.appendChild(U));q.isEnabled()||-"1"==urlParams.embedInline||D.classList.add("mxDisabled");return D};q.isEnabled()||"1"==urlParams.embedInline?(J.classList.remove("mxDisabled"),G.classList.remove("mxDisabled"),E.classList.remove("mxDisabled"),c.classList.remove("mxDisabled")):(J.classList.add("mxDisabled"),G.classList.add("mxDisabled"),E.classList.add("mxDisabled"),c.classList.add("mxDisabled"));u.innerText="";if(!g){var B=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,C="1"==urlParams.embed&&-null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;"simple"==p&&(this.sidebar.graph.cellRenderer.minSvgStrokeWidth=.9);if("simple"!=p||B>=660+C){var H=this.sidebar.createVertexTemplate(q.appendFontSize(Editor.defaultTextStyle,q.vertexFontSize),60,30,"Text",mxResources.get("text")+" (A)",!0,!1,null,"simple"!=p,null,28,28,"simple"==p?Editor.thinTextImage:null,!0);x(H,mxResources.get("text")+" (A)",null,"A",32)}H=this.sidebar.createVertexTemplate("rounded=0;whiteSpace=wrap;html=1;",160,-80,"",mxResources.get("rectangle")+" (D)",!0,!1,null,"simple"!=p,null,28,28,"simple"==p?Editor.thinRectangleImage:null);"simple"==p?(B>=600+C&&x(H,mxResources.get("rectangle")+" (D)",null,"D"),B>=400+C&&this.sketchPickerMenuElt.appendChild(c),B>=460+C&&x(J,mxResources.get("freehand")+" (X)",null,"X"),B>=500+C&&x(I,mxResources.get("generate")),B>=540+C&&this.sketchPickerMenuElt.appendChild(E)):(x(this.sidebar.createVertexTemplate(Editor.defaultNoteStyle,160,160,"",mxResources.get("note")+" (S)",!0,-!1,null,!0,null,28,28),mxResources.get("note")+" (S)",null,"S"),x(H,mxResources.get("rectangle")+" (D)",null,"D"),x(this.sidebar.createVertexTemplate("ellipse;whiteSpace=wrap;html=1;",160,100,"",mxResources.get("ellipse")+" (F)",!0,!1,null,!0,null,28,28),mxResources.get("ellipse")+" (F)",null,"F"),C=new mxCell("",new mxGeometry(0,0,this.editor.graph.defaultEdgeLength+20,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),C.geometry.setTerminalPoint(new mxPoint(0,0),!0),C.geometry.setTerminalPoint(new mxPoint(C.geometry.width,+"0.4";A.style.backgroundImage="url("+Editor.expandMoreImage+")";A.setAttribute("title",mxResources.get("collapseExpand"));var I=this.createMenuItem("insertFreehand","simple"==p?Editor.thinGestureImage:Editor.freehandImage,!0),H=this.createMenuItem("generate","simple"==p?Editor.thinSparklesImage:Editor.sparklesImage,!0),F=this.createMenu("insert","simple"==p?Editor.thinAddCircleImage:Editor.addBoxImage),D=this.createMenu("table",Editor.thinTableImage),c=F.cloneNode(!0);c.style.backgroundImage="url("++("simple"==p?Editor.thinShapesImage:Editor.shapesImage)+")";c.setAttribute("title",mxResources.get("shapes"));this.addShapePicker(c,"simple"==p);var g=!1,l=mxUtils.bind(this,function(x){if(x||null!=document.body&&document.body.contains(u)){x=function(N,J,T,V,t,z){null!=J&&N.setAttribute("title",J);u.appendChild(N);"simple"!=p&&null!=V&&null!=N&&null==N.querySelector(".geShortcutKey")&&(J=document.createElement("div"),J.className="geShortcutKey",mxUtils.write(J,V),N.appendChild(J));q.isEnabled()||+"1"==urlParams.embedInline||N.classList.add("mxDisabled");return N};q.isEnabled()||"1"==urlParams.embedInline?(I.classList.remove("mxDisabled"),F.classList.remove("mxDisabled"),D.classList.remove("mxDisabled"),c.classList.remove("mxDisabled")):(I.classList.add("mxDisabled"),F.classList.add("mxDisabled"),D.classList.add("mxDisabled"),c.classList.add("mxDisabled"));u.innerText="";if(!g){var B=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,C="1"==urlParams.embed&&+null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;"simple"==p&&(this.sidebar.graph.cellRenderer.minSvgStrokeWidth=.9);if("simple"!=p||B>=660+C){var G=this.sidebar.createVertexTemplate(q.appendFontSize(Editor.defaultTextStyle,q.vertexFontSize),60,30,"Text",mxResources.get("text")+" (A)",!0,!1,null,"simple"!=p,null,28,28,"simple"==p?Editor.thinTextImage:null,!0);x(G,mxResources.get("text")+" (A)",null,"A",32)}G=this.sidebar.createVertexTemplate("rounded=0;whiteSpace=wrap;html=1;",160,+80,"",mxResources.get("rectangle")+" (D)",!0,!1,null,"simple"!=p,null,28,28,"simple"==p?Editor.thinRectangleImage:null);"simple"==p?(B>=600+C&&x(G,mxResources.get("rectangle")+" (D)",null,"D"),B>=400+C&&this.sketchPickerMenuElt.appendChild(c),B>=460+C&&x(I,mxResources.get("freehand")+" (X)",null,"X"),B>=500+C&&x(H,mxResources.get("generate")),B>=540+C&&this.sketchPickerMenuElt.appendChild(D)):(x(this.sidebar.createVertexTemplate(Editor.defaultNoteStyle,160,160,"",mxResources.get("note")+" (S)",!0,+!1,null,!0,null,28,28),mxResources.get("note")+" (S)",null,"S"),x(G,mxResources.get("rectangle")+" (D)",null,"D"),x(this.sidebar.createVertexTemplate("ellipse;whiteSpace=wrap;html=1;",160,100,"",mxResources.get("ellipse")+" (F)",!0,!1,null,!0,null,28,28),mxResources.get("ellipse")+" (F)",null,"F"),C=new mxCell("",new mxGeometry(0,0,this.editor.graph.defaultEdgeLength+20,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),C.geometry.setTerminalPoint(new mxPoint(0,0),!0),C.geometry.setTerminalPoint(new mxPoint(C.geometry.width,0),!1),C.geometry.points=[],C.geometry.relative=!0,C.edge=!0,x(this.sidebar.createEdgeTemplateFromCells([C],C.geometry.width,C.geometry.height,mxResources.get("line")+" (C)",!0,null,"simple"!=p,!1,null,28,28),mxResources.get("line")+" (C)",null,"C"),C=C.clone(),C.style="edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;",C.geometry.width=this.editor.graph.defaultEdgeLength+20,C.geometry.setTerminalPoint(new mxPoint(0,20),!0),C.geometry.setTerminalPoint(new mxPoint(C.geometry.width,-20),!1),x(this.sidebar.createEdgeTemplateFromCells([C],C.geometry.width,40,mxResources.get("arrow"),!0,null,!0,!1,null,28,28),mxResources.get("arrow")),x(J,mxResources.get("freehand")+" (X)",null,"X"),x(I,mxResources.get("generate")),this.sketchPickerMenuElt.appendChild(c));("simple"!=p||320<B)&&this.sketchPickerMenuElt.appendChild(G)}"simple"!=p&&"1"!=urlParams.embedInline&&u.appendChild(A);this.sidebar.graph.cellRenderer.minSvgStrokeWidth=this.sidebar.minThumbStrokeWidth}});mxEvent.addListener(A,+20),!1),x(this.sidebar.createEdgeTemplateFromCells([C],C.geometry.width,40,mxResources.get("arrow"),!0,null,!0,!1,null,28,28),mxResources.get("arrow")),x(I,mxResources.get("freehand")+" (X)",null,"X"),x(H,mxResources.get("generate")),this.sketchPickerMenuElt.appendChild(c));("simple"!=p||320<B)&&this.sketchPickerMenuElt.appendChild(F)}"simple"!=p&&"1"!=urlParams.embedInline&&u.appendChild(A);this.sidebar.graph.cellRenderer.minSvgStrokeWidth=this.sidebar.minThumbStrokeWidth}});mxEvent.addListener(A,"click",mxUtils.bind(this,function(){g?(u.classList.remove("geCollapsedToolbar"),A.style.backgroundImage="url("+Editor.expandMoreImage+")",g=!1,l()):(u.innerText="",u.appendChild(A),u.classList.add("geCollapsedToolbar"),A.style.backgroundImage="url("+Editor.expandLessImage+")",g=!0)}));var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,v=null;mxEvent.addListener(window,"resize",function(){var x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;x!=n&&(n=x,null!=v&&window.clearTimeout(v),v=window.setTimeout(function(){v=null;l()},200))});this.editor.addListener("fileLoaded",l);this.addListener("sketchModeChanged",l);this.addListener("currentThemeChanged",l);this.addListener("languageChanged",l);this.addListener("lockedChanged",l);l(!0);"simple"==p?(this.sketchPickerMenuElt.style.cssText="position:relative;white-space:nowrap;user-select:none;display:flex;align-items:center;justify-content:flex-end;flex-grow:1;gap:6px;flex-shrink:0;",this.sketchMainMenuElt.appendChild(this.sketchPickerMenuElt)):this.container.appendChild(this.sketchPickerMenuElt);mxClient.IS_POINTER&&(this.sketchPickerMenuElt.style.touchAction="none")}}else k.apply(this,arguments)};var d=EditorUi.prototype.createMenubarForTheme;EditorUi.prototype.createMenubarForTheme=function(p){if("simple"==p||"sketch"==p){if(null==this.sketchMenubarElt){this.sketchMenubarElt=document.createElement("div");this.sketchMenubarElt.className="geToolbarContainer";if("simple"==p){if(this.sketchMenubarElt.style.cssText="position:relative;"+("1"!=urlParams.embed?"flex-grow:0.5;overflow:visible;":"")+"flex-shrink:0;display:flex;white-space:nowrap;user-select:none;justify-content:flex-end;align-items:center;flex-wrap:nowrap;gap:6px;",null==this.commentElt&&(this.commentElt=this.createMenuItem("comments",Editor.thinCommentImage,!0),this.commentElt.style.backgroundSize="24px"),null==this.shareElt&&"1"!=urlParams.embed&&"draw.io"==this.getServiceName())if(this.shareElt=this.createMenu("share",Editor.thinUserAddImage),this.shareElt.style.backgroundSize=-"24px",this.shareElt.style.flexShrink="0",this.isStandaloneApp())this.shareElt.style.backgroundImage="url("+Editor.thinShareImage+")";else{var q=mxUtils.bind(this,function(){var u=mxResources.get("share"),A=Editor.thinUserAddImage,J=this.getNetworkStatus();null!=J&&(u=u+" ("+J+")",A=Editor.thinUserFlashImage);this.shareElt.style.backgroundImage="url("+A+")";this.shareElt.setAttribute("title",u)});this.addListener("realtimeStateChanged",q);this.editor.addListener("statusChanged",q);mxEvent.addListener(window,+"24px",this.shareElt.style.flexShrink="0",this.isStandaloneApp())this.shareElt.style.backgroundImage="url("+Editor.thinShareImage+")";else{var q=mxUtils.bind(this,function(){var u=mxResources.get("share"),A=Editor.thinUserAddImage,I=this.getNetworkStatus();null!=I&&(u=u+" ("+I+")",A=Editor.thinUserFlashImage);this.shareElt.style.backgroundImage="url("+A+")";this.shareElt.setAttribute("title",u)});this.addListener("realtimeStateChanged",q);this.editor.addListener("statusChanged",q);mxEvent.addListener(window,"offline",q);mxEvent.addListener(window,"online",q);q()}}else this.sketchMenubarElt.style.cssText="position:absolute;right:12px;top:10px;height:44px;border-radius:4px;overflow:hidden;user-select:none;max-width:calc(100% - 170px);box-sizing:border-box;justify-content:flex-end;z-index:1;padding:7px 12px;display:flex;white-space:nowrap;user-select:none;justify-content:flex-end;align-items:center;flex-wrap:nowrap;gap:6px;",this.container.appendChild(this.sketchMenubarElt);"1"!=urlParams.embedInline&&(q=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var u=58>this.sketchPickerMenuElt.offsetTop-this.sketchPickerMenuElt.offsetHeight/2;this.sketchMainMenuElt.style.left=u?"70px":"10px";this.sketchMenubarElt.style.maxWidth=u?"calc(100% - 230px)":"calc(100% - 170px)"}else if("simple"==Editor.currentTheme){u=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var A="1"==urlParams.embed&&null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;null!=this.commentElt&&(this.commentElt.style.display=u>560+A&&this.commentsSupported()?"":"none");null!=this.shareElt&&(this.shareElt.style.display=u>360+A?"":"none");null!=this.overflowMenuElt&&(this.overflowMenuElt.style.display=u<750+A?"":"none")}}),q(),mxEvent.addListener(window,"resize",q),this.editor.addListener("fileLoaded",q));"1"!=urlParams.embed&&"atlassian"!=this.getServiceName()&&this.installStatusMinimizer(this.sketchMenubarElt);this.dependsOnLanguage(mxUtils.bind(this,function(){null!=this.commentElt&&diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.jsindex 1010be49d..e1dd83059 100644--- a/src/main/webapp/js/diagramly/App.js+++ b/src/main/webapp/js/diagramly/App.js@@ -648,6 +648,15 @@ App.main = function(callback, createUi)Editor.loadCompatibleCss();App.isMainCalled = true;++ // Allows forcing Android detection via URL parameter for+ // tablets using Chrome's "Request Desktop Site" mode where+ // the user agent no longer contains "Android"+ if (urlParams['android'] == '1')+ {+ mxClient.IS_ANDROID = true;+ }+// Handles uncaught errors before the app is loadedwindow.onerror = function(message, url, linenumber, colno, err){diff --git a/src/main/webapp/js/diagramly/Editor.js b/src/main/webapp/js/diagramly/Editor.jsindex daf221215..23e3ea7d6 100644--- a/src/main/webapp/js/diagramly/Editor.js+++ b/src/main/webapp/js/diagramly/Editor.js@@ -2530,6 +2530,11 @@Graph.selectParentLayer = config.selectParentLayer}+ if (config.intersectionSelect != null)+ {+ Graph.intersectionSelect = config.intersectionSelect+ }+if (config.autosaveDelay != null){DrawioFile.prototype.autosaveDelay = config.autosaveDelay@@ -2749,6 +2754,12 @@Graph.prototype.defaultEdgeStyle = config.defaultEdgeStyle;}+ // Overrides default shape picker entries+ if (config.shapePicker != null)+ {+ EditorUi.prototype.defaultShapePickerEntries = config.shapePicker.shapes;+ }+// Overrides default page visibleif (config.defaultPageVisible != null){@@ -3853,10 +3864,10 @@forceConvert) ? convertScale : 1;var canvas = document.createElement('canvas');- var ctx = canvas.getContext('2d');- ctx.scale(convertScale, convertScale);canvas.height = img.height * convertScale;canvas.width = img.width * convertScale;+ var ctx = canvas.getContext('2d');+ ctx.scale(convertScale, convertScale);ctx.drawImage(img, 0, 0);callback(canvas.toDataURL());diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.jsindex 5bac98c25..ed61ea38d 100644--- a/src/main/webapp/js/diagramly/EditorUi.js+++ b/src/main/webapp/js/diagramly/EditorUi.js@@ -2481,21 +2481,58 @@filename = basename + '.jpg';}- this.saveRequest(filename, format, mxUtils.bind(this, function(newTitle, base64)+ if (urlParams['embed'] == '1' && urlParams['proto'] == 'json' && this.embedExportProtocol){- try+ var parent = this.embedMessageSource || window.opener || window.parent;++ if (this.spinner.spin(document.body, mxResources.get('exporting'))){- var req = this.createDownloadRequest(newTitle, format, ignoreSelection, base64,+ var req = this.createDownloadRequest(filename, format, ignoreSelection, '1',transparent, currentPage, scale, border, grid, includeXml, pageRange, w, h,!pageVisible, margin, fit, sheetsAcross, sheetsDown, shadows);-- return req;++ req.send(mxUtils.bind(this, function(req)+ {+ this.spinner.stop();++ if (req.getStatus() >= 200 && req.getStatus() <= 299)+ {+ var msg = this.createLoadMessage('export');+ msg.format = format;+ msg.filename = filename;+ msg.data = 'data:application/pdf;base64,' + req.getText();+ msg.xml = this.getFileData(true);+ parent.postMessage(JSON.stringify(msg), '*');+ }+ else+ {+ this.handleError({message: mxResources.get('errorSavingFile')});+ }+ }), mxUtils.bind(this, function()+ {+ this.spinner.stop();+ this.handleError({message: mxResources.get('errorSavingFile')});+ }));}- catch (e)+ }+ else+ {+ this.saveRequest(filename, format, mxUtils.bind(this, function(newTitle, base64){- this.handleError(e);- }- }));+ try+ {+ var req = this.createDownloadRequest(newTitle, format, ignoreSelection, base64,+ transparent, currentPage, scale, border, grid, includeXml, pageRange, w, h,+ !pageVisible, margin, fit, sheetsAcross, sheetsDown, shadows);++ return req;+ }+ catch (e)+ {+ this.handleError(e);+ }+ }));+ }}}catch (e)@@ -5968,6 +6005,19 @@*/EditorUi.prototype.saveData = function(filename, format, data, mime, base64Encoded, defaultMode){+ if (urlParams['embed'] == '1' && urlParams['proto'] == 'json' && this.embedExportProtocol)+ {+ var parent = this.embedMessageSource || window.opener || window.parent;+ var msg = this.createLoadMessage('export');+ msg.format = format;+ msg.filename = filename;+ msg.data = base64Encoded ? 'data:' + mime + ';base64,' + data : data;+ msg.xml = this.getFileData(true);+ parent.postMessage(JSON.stringify(msg), '*');++ return;+ }+if (this.isLocalFileSave()){this.saveLocalFile(data, filename, mime, base64Encoded, format, defaultMode);@@ -8763,6 +8813,11 @@{this.updatePageLinksForCell(mapping, pages[i].root);+ if (pages[i] != this.currentPage)+ {+ pages[i].needsUpdate = true;+ }+if (pages[i].viewState != null && this.updateBackgroundPageLink(mapping, pages[i].viewState.backgroundImage)){@@ -12596,15 +12651,31 @@if (files.length > 0){- if (urlParams['embed'] != '1' && mxEvent.isShiftDown(evt))+ var isBlankNoUndo = this.isBlankFile() && !this.canUndo();+ var isDiagramFile = files.length == 1 && (EditorUi.isVisioFilename(files[0].name) ||+ /(\.drawio)$/i.test(files[0].name) || /(\.xml)$/i.test(files[0].name));++ if (urlParams['embed'] != '1' && isBlankNoUndo &&+ (isDiagramFile || mxEvent.isShiftDown(evt))){- // Closes current file if blank and no undoable changes- if (this.isBlankFile() && !this.canUndo() &&- this.getCurrentFile() != null)+ // Opens file in same window when dropped on blank file+ // Uses noDialogs to prevent fileLoaded(null) from+ // creating a new blank file asynchronously+ this.fileLoaded(null, true);++ // Marks file as changed after loading to trigger draft save+ var fileLoadedListener = mxUtils.bind(this, function(){- this.fileLoaded(null);- }+ this.editor.removeListener(fileLoadedListener);+ var file = this.getCurrentFile();+ if (file != null)+ {+ file.fileChanged();+ }+ });++ this.editor.addListener('fileLoaded', fileLoadedListener);this.openFiles(files, true);}else@@ -12614,7 +12685,7 @@x = null;y = null;}-+this.importFiles(files, x, y, this.maxImageSize, null, null, null,null, mxEvent.isControlDown(evt), null, null,mxEvent.isShiftDown(evt), evt);@@ -15606,7 +15677,7 @@};/**- * Copies the given cells and XML to the clipboard as an embedded image.+ * Copies the given cells to the clipboard as an SVG image.*/EditorUi.prototype.copySvg = function(cells, xml, scale){@@ -15618,7 +15689,12 @@var svgRoot = graph.getSvg(null, scale, null, null, null, null,null, null, null, null, null, null, null,(cells.length > 0) ? cells : null);- svgRoot.setAttribute('content', xml);++ if (xml != null)+ {+ svgRoot.setAttribute('content', xml);+ }+var dataUrl = Editor.createSvgDataUri(mxUtils.getXml(svgRoot));var w = parseInt(svgRoot.getAttribute('width'));var h = parseInt(svgRoot.getAttribute('height'));@@ -15637,7 +15713,7 @@};/**- * Copies the given cells and XML to the clipboard as an embedded image.+ * Copies the given cells to the clipboard as a PNG image.*/EditorUi.prototype.copyImage = function(cells, xml, scale){@@ -15656,11 +15732,11 @@var dataUrl = this.createImageDataUri(canvas, xml, 'png');var w = Math.round(parseInt(svgRoot.getAttribute('width')) / scale);var h = Math.round(parseInt(svgRoot.getAttribute('height')) / scale);-+EditorUi.debug('EditorUi.copyImage', [this],'cells', [cells], 'xml', [xml],'scale', [scale]);-+this.writeImageToClipboard(dataUrl, w, h, 'image/png', null,mxUtils.bind(this, function(){@@ -18074,6 +18150,7 @@var ignoreChange = false;var autosave = false;var lastData = null;+ var embedShadowPages = null;var updateStatus = mxUtils.bind(this, function(sender, eventObject){@@ -18830,6 +18907,10 @@{convertToSketch = data.toSketch;autosave = data.autosave == 1;+ this.embedDiffSync = data.diffSync != null && data.diffSync !== false;+ this.embedDiffSyncPatchOnly = (typeof data.diffSync === 'object' &&+ data.diffSync != null && data.diffSync.patchOnly == true);+ this.embedExportProtocol = data.exportProtocol == true;var sourceMetadata = data.sourceMetadata || null;this.hideDialog();@@ -19103,23 +19184,129 @@else if (data.action == 'merge'){var file = this.getCurrentFile();-+if (file != null){var tmp = extractDiagramXml(data.xml);if (tmp != null && tmp != ''){- file.mergeFile(new LocalFile(this, tmp), function()+ file.mergeFile(new LocalFile(this, tmp), mxUtils.bind(this, function(){+ // Reset shadow after merge when diff sync is enabled+ if (this.embedDiffSync)+ {+ embedShadowPages = this.clonePages(this.pages);+ lastData = getData();+ }+parent.postMessage(JSON.stringify({event: 'merge', message: data}), '*');- }, function(err)+ }), function(err){parent.postMessage(JSON.stringify({event: 'merge', message: data, error: err}), '*');});}}-++ return;+ }+ else if (data.action == 'patch')+ {+ var file = this.getCurrentFile();++ if (file != null && data.patch != null)+ {+ try+ {+ ignoreChange = true;+ file.patch([data.patch]);++ // Update shadow to reflect the patched state+ if (this.embedDiffSync && embedShadowPages != null)+ {+ embedShadowPages = this.applyPatches(+ embedShadowPages, [data.patch]);+ }++ lastData = getData();+ ignoreChange = false;++ // Send acknowledgment with checksum+ var resp = {event: 'patch', message: data};+ var currentChecksum = this.getHashValueForPages(this.pages);+ resp.checksum = currentChecksum;++ if (data.checksum != null && data.checksum != currentChecksum)+ {+ resp.checksumMismatch = true;+ }++ parent.postMessage(JSON.stringify(resp), '*');+ }+ catch (e)+ {+ ignoreChange = false;+ parent.postMessage(JSON.stringify({event: 'patch',+ message: data, error: e.message || e.toString()}), '*');+ }+ }++ return;+ }+ else if (data.action == 'getDiff')+ {+ var msg = {event: 'getDiff', message: data};++ if (this.embedDiffSync && embedShadowPages != null)+ {+ var currentPages = this.clonePages(this.pages);+ msg.patch = this.diffPages(embedShadowPages, currentPages);+ msg.checksum = this.getHashValueForPages(currentPages);+ }+ else+ {+ msg.xml = getData();+ }++ parent.postMessage(JSON.stringify(msg), '*');++ return;+ }+ else if (data.action == 'resetDiff')+ {+ if (this.embedDiffSync)+ {+ if (data.xml != null)+ {+ var tmp = extractDiagramXml(data.xml);+ var file = this.getCurrentFile();++ if (tmp != null && tmp != '' && file != null)+ {+ file.mergeFile(new LocalFile(this, tmp), mxUtils.bind(this, function()+ {+ embedShadowPages = this.clonePages(this.pages);+ lastData = getData();+ parent.postMessage(JSON.stringify({event: 'resetDiff',+ message: data, checksum: this.getHashValueForPages(+ this.pages)}), '*');+ }), function(err)+ {+ parent.postMessage(JSON.stringify({event: 'resetDiff',+ message: data, error: err}), '*');+ });+ }+ }+ else+ {+ embedShadowPages = this.clonePages(this.pages);+ lastData = getData();+ parent.postMessage(JSON.stringify({event: 'resetDiff',+ message: data, checksum: this.getHashValueForPages(+ this.pages)}), '*');+ }+ }+return;}else if (data.action == 'remoteInvokeReady')@@ -19178,21 +19365,55 @@lastData = getData();+ // Initialize shadow pages for diff-based sync+ if (this.embedDiffSync)+ {+ embedShadowPages = this.clonePages(this.pages);+ }+if (autosave && changeListener == null){changeListener = mxUtils.bind(this, function(sender, eventObject){var data = getData();-+if (data != lastData && !ignoreChange){var msg = this.createLoadMessage('autosave');- msg.xml = data;msg.message = message;++ if (this.embedDiffSync && embedShadowPages != null)+ {+ var currentPages = this.clonePages(this.pages);+ var patch = this.diffPages(embedShadowPages, currentPages);++ if (!mxUtils.isEmptyObject(patch))+ {+ msg.patch = patch;+ msg.checksum = this.getHashValueForPages(currentPages);++ if (!this.embedDiffSyncPatchOnly)+ {+ msg.xml = data;+ }+ }+ else+ {+ // No structural changes but data changed+ msg.xml = data;+ }++ embedShadowPages = currentPages;+ }+ else+ {+ msg.xml = data;+ }+var parent = this.embedMessageSource || window.opener || window.parent;parent.postMessage(JSON.stringify(msg), '*');}-+lastData = data;});@@ -19228,6 +19449,12 @@// Attaches XML to responseresp.xml = data;+ // Include checksum when diff sync is enabled+ if (this.embedDiffSync && this.pages != null)+ {+ resp.checksum = this.getHashValueForPages(this.pages);+ }+parent.postMessage(JSON.stringify(resp), '*');}});diff --git a/src/main/webapp/js/diagramly/GraphViewer.js b/src/main/webapp/js/diagramly/GraphViewer.jsindex 39e332323..308573f02 100644--- a/src/main/webapp/js/diagramly/GraphViewer.js+++ b/src/main/webapp/js/diagramly/GraphViewer.js@@ -122,6 +122,16 @@ GraphViewer.prototype.responsive = false;*/GraphViewer.prototype.darkMode = null;+/**+ * Specifies if link icons should be shown on shapes. Default is false.+ */+GraphViewer.prototype.showLinkIcons = false;++/**+ * Specifies if tooltip icons should be shown on shapes. Default is false.+ */+GraphViewer.prototype.showTooltipIcons = false;+/*** Initializes the viewer.*/@@ -149,6 +159,10 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)this.graphConfig['check-visible-state'] : this.checkVisibleState;this.darkMode = (this.graphConfig['dark-mode'] != null) ?this.graphConfig['dark-mode'] : this.darkMode;+ this.showLinkIcons = (this.graphConfig['show-link-icons'] != null) ?+ this.graphConfig['show-link-icons'] : this.showLinkIcons;+ this.showTooltipIcons = (this.graphConfig['show-tooltip-icons'] != null) ?+ this.graphConfig['show-tooltip-icons'] : this.showTooltipIcons;this.toolbarItems = (this.graphConfig.toolbar != null) ?this.graphConfig.toolbar.split(' ') : [];this.zoomEnabled = mxUtils.indexOf(this.toolbarItems, 'zoom') >= 0;@@ -274,6 +288,8 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)this.graph.centerZoom = false;this.graph.autoExtend = false;this.graph.autoScroll = false;+ this.graph.showLinkIcons = this.showLinkIcons;+ this.graph.showTooltipIcons = this.showTooltipIcons;this.graph.setEnabled(false);if (this.graphConfig['toolbar-nohide'] == true)diff --git a/src/main/webapp/js/diagramly/Menus.js b/src/main/webapp/js/diagramly/Menus.jsindex 4655deac6..52ee9dfe6 100644--- a/src/main/webapp/js/diagramly/Menus.js+++ b/src/main/webapp/js/diagramly/Menus.js@@ -784,8 +784,7 @@action = editorUi.actions.addAction('copyAsImage', mxUtils.bind(this, function(){var cells = mxUtils.sortCells(graph.model.getTopmostCells(graph.getSelectionCells()));- var xml = mxUtils.getXml((cells.length == 0) ? editorUi.editor.getGraphXml() : graph.encodeCells(cells));- editorUi.copyImage(cells, xml);+ editorUi.copyImage(cells);}), null, null, Editor.ctrlKey + '+' + Editor.altKey + '+X');action.visible = Editor.enableNativeClipboard && editorUi.editor.isExportToCanvas();@@ -793,8 +792,7 @@action = editorUi.actions.addAction('copyAsSvg', mxUtils.bind(this, function(){var cells = mxUtils.sortCells(graph.model.getTopmostCells(graph.getSelectionCells()));- var xml = mxUtils.getXml((cells.length == 0) ? editorUi.editor.getGraphXml() : graph.encodeCells(cells));- editorUi.copySvg(cells, xml);+ editorUi.copySvg(cells);}), null, null, Editor.ctrlKey + '+' + Editor.altKey + '+' + Editor.shiftKey + '+X');action.visible = Editor.enableNativeClipboard && editorUi.editor.isExportToCanvas();diff --git a/src/main/webapp/js/grapheditor/EditorUi.js b/src/main/webapp/js/grapheditor/EditorUi.jsindex 50a6cd485..f2d7ef61e 100644--- a/src/main/webapp/js/grapheditor/EditorUi.js+++ b/src/main/webapp/js/grapheditor/EditorUi.js@@ -2192,16 +2192,22 @@ EditorUi.prototype.createShapePicker = function(x, y, source, callback, directio// Wrapper needed to catch eventsvar node = document.createElement('a');div.appendChild(node);-- if (style != null && urlParams['sketch'] != '1')- {- this.sidebar.graph.pasteStyle(style, [cell]);- }- else++ var fixed = cell.shapePickerKeepStyle;+ delete cell.shapePickerKeepStyle;++ if (!fixed){- this.sidebar.graph.pasteCellStyles([cell],- graph.currentVertexStyle,- graph.currentEdgeStyle);+ if (style != null && urlParams['sketch'] != '1')+ {+ this.sidebar.graph.pasteStyle(style, [cell]);+ }+ else+ {+ this.sidebar.graph.pasteCellStyles([cell],+ graph.currentVertexStyle,+ graph.currentEdgeStyle);+ }}var geo = cell.geometry;@@ -2215,7 +2221,7 @@ EditorUi.prototype.createShapePicker = function(x, y, source, callback, directioif (geo != null){var temp = this.sidebar.createVertexTemplateFromCells([cell],- geo.width, geo.height, '', true, false, null, false,+ geo.width, geo.height, '', true, false, null, true,mxUtils.bind(this, function(evt){if (!mxEvent.isAltDown(evt) || graph.getSelectionCount() != 1)@@ -2323,6 +2329,11 @@ EditorUi.prototype.createShapePicker = function(x, y, source, callback, directio/*** Creates a temporary graph instance for rendering off-screen content.*/+EditorUi.prototype.defaultShapePickerEntries = null;++/**+ * Creates cells for the shape picker popup.+ */EditorUi.prototype.getCellsForShapePicker = function(cell, hovering, showEdges){var graph = this.editor.graph;@@ -2350,7 +2361,7 @@ EditorUi.prototype.getCellsForShapePicker = function(cell, hovering, showEdges)try{cell = graph.cloneCell(cell);-+if (graph.model.isVertex(cell) && cell.geometry != null){cell.geometry.x = 0;@@ -2362,7 +2373,81 @@ EditorUi.prototype.getCellsForShapePicker = function(cell, hovering, showEdges)cell = null;}}-++ if (this.defaultShapePickerEntries != null)+ {+ var vertices = [];+ var edges = [];++ var createUserObject = function(value)+ {+ if (value != null && typeof value === 'object')+ {+ var doc = mxUtils.createXmlDocument();+ var obj = doc.createElement('UserObject');++ for (var key in value)+ {+ if (value.hasOwnProperty(key))+ {+ obj.setAttribute(key, value[key]);+ }+ }++ if (obj.getAttribute('label') == null)+ {+ obj.setAttribute('label', '');+ }++ return obj;+ }++ return value;+ };++ for (var i = 0; i < this.defaultShapePickerEntries.length; i++)+ {+ var entry = this.defaultShapePickerEntries[i];++ if (entry.style != null)+ {+ var value = createUserObject(entry.value);++ if (entry.edge)+ {+ edges.push(createEdge(entry.style, entry.y, value));+ }+ else+ {+ var vertex = createVertex(entry.style, entry.width,+ entry.height, value);++ if (entry.keepStyle)+ {+ vertex.shapePickerKeepStyle = true;+ }++ vertices.push(vertex);+ }+ }+ }++ // Prepend cloned source cell or use first configured vertex entry+ if (cell != null)+ {+ vertices[0] = cell;+ }++ var cells = vertices;++ if (showEdges)+ {+ cells = cells.concat(edges);+ }++ return cells;+ }+if (cell == null){cell = createVertex(graph.appendFontSize(Editor.defaultTextStyle,@@ -2385,7 +2470,7 @@ EditorUi.prototype.getCellsForShapePicker = function(cell, hovering, showEdges)createVertex('shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;', 80, 60),createVertex('shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;' +'rotatable=0;perimeter=centerPerimeter;snapToPoint=1;', 20, 20)];-+if (showEdges){cells = cells.concat([@@ -2570,6 +2655,16 @@ EditorUi.prototype.installTypingShim = function()shim.setAttribute('autocorrect', 'off');shim.setAttribute('autocapitalize', 'off');shim.setAttribute('spellcheck', 'false');++ // Suppress virtual keyboard on touch devices (Android/iOS tablets).+ // The shim is for capturing keystrokes from physical keyboards and IME;+ // on touch-only devices focusing a textarea triggers the soft keyboard.+ if (mxClient.IS_ANDROID || mxClient.IS_IOS ||+ ('ontouchstart' in document.documentElement && navigator.maxTouchPoints > 1))+ {+ shim.setAttribute('inputmode', 'none');+ }+shim.tabIndex = -1;shim.className = 'mxTypingShim';shim.style.cssText = 'position:absolute;overflow:hidden;resize:none;' +@@ -6607,6 +6702,14 @@ EditorUi.prototype.createKeyHandler = function(editor)var isEventIgnored = keyHandler.isEventIgnored;keyHandler.isEventIgnored = function(evt){+ // Ignores Ctrl+, (188) when not content editing to allow+ // browser default (eg. Cmd+, for Chrome settings on macOS)+ if (evt.keyCode == 188 && this.isControlDown(evt) &&+ !this.graph.cellEditor.isContentEditing())+ {+ return true;+ }+// Handles undo/redo/ctrl+./,/u via action and allows ctrl+b/i// only if editing value is HTML (except for FF and Safari)// 66, 73 are keycodes for editing actions like bold, italic,diff --git a/src/main/webapp/js/grapheditor/Graph.js b/src/main/webapp/js/grapheditor/Graph.jsindex d6477aa76..157eda72e 100644--- a/src/main/webapp/js/grapheditor/Graph.js+++ b/src/main/webapp/js/grapheditor/Graph.js@@ -1216,7 +1216,8 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)// Changes rubberband selection ignore locked cellsthis.selectRegion = function(rect, evt){- var isect = (mxEvent.isAltDown(evt)) ? rect : null;+ var isect = (Graph.intersectionSelect ||+ mxEvent.isAltDown(evt)) ? rect : null;var cells = this.getCells(rect.x, rect.y,rect.width, rect.height, null, null,isect, null, true);@@ -1433,6 +1434,13 @@ Graph.zoomWheel = false;*/Graph.selectParentLayer = false;+/**+ * Specifies if intersection selection should be used for rubberband. Default is false.+ * When true, cells that intersect the rubberband selection rectangle are selected,+ * rather than requiring cells to be fully contained within the rectangle.+ */+Graph.intersectionSelect = false;+/*** Minimum width for table columns.*/@@ -8501,9 +8509,55 @@ InlineToolbar.prototype.updateIcons = function()}};+/**+ * Returns true if the line segment from (x1,y1) to (x2,y2) intersects+ * the axis-aligned rectangle at (rx, ry) with size (rw, rh).+ * Uses the Liang-Barsky clipping algorithm.+ */+InlineToolbar.prototype.segmentIntersectsRect = function(x1, y1, x2, y2, rx, ry, rw, rh)+{+ var dx = x2 - x1;+ var dy = y2 - y1;+ var p = [-dx, dx, -dy, dy];+ var q = [x1 - rx, rx + rw - x1, y1 - ry, ry + rh - y1];+ var tMin = 0;+ var tMax = 1;++ for (var i = 0; i < 4; i++)+ {+ if (p[i] == 0)+ {+ if (q[i] < 0)+ {+ return false;+ }+ }+ else+ {+ var t = q[i] / p[i];++ if (p[i] < 0)+ {+ tMin = Math.max(tMin, t);+ }+ else+ {+ tMax = Math.min(tMax, t);+ }++ if (tMin > tMax)+ {+ return false;+ }+ }+ }++ return true;+};+/*** Repositions the toolbar at the cell midpoint, avoiding overlap with- * edge waypoint handles.+ * edge waypoint handles and edge segments.*/InlineToolbar.prototype.repaint = function(){@@ -8553,6 +8607,25 @@ InlineToolbar.prototype.repaint = function()}}+ // Check intersection with edge segments+ var pts = state.absolutePoints;++ if (pts != null)+ {+ for (var i = 1; i < pts.length; i++)+ {+ if (pts[i] != null && pts[i - 1] != null &&+ this.segmentIntersectsRect(+ pts[i - 1].x, pts[i - 1].y,+ pts[i].x, pts[i].y,+ bounds.x, bounds.y,+ bounds.width, bounds.height))+ {+ return true;+ }+ }+ }+return false;});@@ -8560,15 +8633,41 @@ InlineToolbar.prototype.repaint = function(){// Try below the edge midpoint insteadvar belowY = mid.y + this.offset;+ var found = false;if (!checkOverlap(x, belowY)){y = belowY;+ found = true;}- else++ // Try left/right of the edge midpoint+ if (!found){- // Find nearest non-overlapping position by- // moving further away from the midpoint+ var centerY = mid.y - toolbarHeight / 2;+ var leftX = mid.x - toolbarWidth - this.offset;+ var rightX = mid.x + this.offset;++ if (!checkOverlap(leftX, centerY))+ {+ x = leftX;+ y = centerY;+ found = true;+ }+ else if (!checkOverlap(rightX, centerY))+ {+ x = rightX;+ y = centerY;+ found = true;+ }+ }++ // Find nearest non-overlapping position by+ // moving further away from the midpoint+ if (!found)+ {+ var centerY = mid.y - toolbarHeight / 2;+for (var d = this.offset + minGap; d < 100; d += minGap){if (!checkOverlap(x, mid.y - toolbarHeight - d))@@ -8581,6 +8680,18 @@ InlineToolbar.prototype.repaint = function()y = mid.y + d;break;}+ else if (!checkOverlap(mid.x - toolbarWidth - d, centerY))+ {+ x = mid.x - toolbarWidth - d;+ y = centerY;+ break;+ }+ else if (!checkOverlap(mid.x + d, centerY))+ {+ x = mid.x + d;+ y = centerY;+ break;+ }}}}@@ -15490,27 +15601,29 @@ if (typeof mxVertexHandler !== 'undefined')this.textarea.style.paddingTop = Math.round(spTop) + 'px';this.textarea.style.paddingBottom = Math.round(spBottom) + 'px';- // Use flex layout for vertical alignment — this replaces- // the padding-top computation and works even before the- // textarea is appended to the DOM (unlike innerText-based- // measurement which returns empty for detached elements)- this.textarea.style.display = 'flex';- this.textarea.style.flexDirection = 'column';+ // Use table-cell layout for vertical alignment.+ // flex layout causes different word wrapping than the+ // rendered text (which uses inline-block inside a flex+ // container), so table-cell + vertical-align is used+ // instead to match the rendered text wrapping exactly.+ this.textarea.style.display = 'table-cell';+ this.textarea.style.flexDirection = '';+ this.textarea.style.justifyContent = '';var valign = mxUtils.getValue(sty, mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);if (valign == mxConstants.ALIGN_MIDDLE){- this.textarea.style.justifyContent = 'center';+ this.textarea.style.verticalAlign = 'middle';}else if (valign == mxConstants.ALIGN_BOTTOM){- this.textarea.style.justifyContent = 'flex-end';+ this.textarea.style.verticalAlign = 'bottom';}else{- this.textarea.style.justifyContent = 'flex-start';+ this.textarea.style.verticalAlign = 'top';}// Recompute font size for current text content@@ -15559,6 +15672,7 @@ if (typeof mxVertexHandler !== 'undefined')this.textarea.style.display = '';this.textarea.style.flexDirection = '';this.textarea.style.justifyContent = '';+ this.textarea.style.verticalAlign = '';mxCellEditorResize.apply(this, arguments);}}diff --git a/src/main/webapp/js/integrate.min.js b/src/main/webapp/js/integrate.min.jsindex 3083f6348..e6e2ed060 100644--- a/src/main/webapp/js/integrate.min.js+++ b/src/main/webapp/js/integrate.min.js@@ -69,7 +69,7 @@ b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io"))}})();"1"==urlPa"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:"29.6.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/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"29.6.5",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||@@ -209,7 +209,7 @@ a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;f[],e=0,f=0;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)||null==g.pointerId||d.push(g)}),mxUtils.bind(this,function(g){if(!mxEvent.isMouseEvent(g)&&2==d.length){for(var k=0;k<d.length;k++)if(g.pointerId==d[k].pointerId){d[k]=g;break}g=Math.abs(d[0].clientX-d[1].clientX);k=Math.abs(d[0].clientY-d[1].clientY);var l=Math.abs(g-e),m=Math.abs(k-f);if(l>mxEvent.PINCH_THRESHOLD||m>mxEvent.PINCH_THRESHOLD)a(d[0],l>m?g>e:k>f,!0,d[0].clientX+(d[1].clientX-d[0].clientX)/2,d[0].clientY+(d[1].clientY-d[0].clientY)/2),e=g,f=k}}),mxUtils.bind(this,function(g){d=[];f=e=0}))}mxEvent.addListener(b,"wheel",function(g){null==g&&(g=window.event);g.ctrlKey&&g.preventDefault();(.5<Math.abs(g.deltaX)||.5<Math.abs(g.deltaY))&&a(g,0==g.deltaY?0<-g.deltaX:0<-g.deltaY)})}},disableContextMenu:function(a){mxEvent.addListener(a,"contextmenu",function(b){b.preventDefault&&b.preventDefault();return!1})},getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.type&&0==a.type.indexOf("touch")},isPenEvent:function(a){return null!=a.pointerType?"pen"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_PEN:null!=a.type&&0==a.type.indexOf("pen")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&null!=a.touches&&1<a.touches.length},isMouseEvent:function(a){return!mxClient.IS_ANDROID&&-mxClient.IS_LINUX&&mxClient.IS_GC?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||+mxClient.IS_LINUX&&mxClient.IS_GC&&1>=navigator.maxTouchPoints?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){"touchstart"!=a.type&&"touchmove"!=a.type||null==a.touches||null==a.touches[0]?"touchend"==a.type&&null!=a.changedTouches&&null!=a.changedTouches[0]&&(a=a.changedTouches[0]):a=a.touches[0];return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},preventDefault:function(a){mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(b){b.preventDefault()}))},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CONNECT_HANDLE:-3,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1E5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",DOCK:"dock",UNDOCK:"undock",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",@@ -384,8 +384,8 @@ mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var r=this.createElement("text");r.setAttribute("x",this.format(a));r.setAttribute("y",this.format(b));r.setAttribute("w",this.format(c));r.setAttribute("h",this.format(d));r.setAttribute("str",e);null!=f&&r.setAttribute("align",f);null!=g&&r.setAttribute("valign",g);r.setAttribute("wrap",k?"1":"0");null==l&&(l="");r.setAttribute("format",l);null!=m&&r.setAttribute("overflow",m);null!=n&&r.setAttribute("clip",n?"1":"0");null!=p&&r.setAttribute("rotation",p);null!=q&&r.setAttribute("dir",q);this.root.appendChild(r)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};-function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):b.appendChild(this.defs)),-this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);+function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=this.viewTranslate=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):+b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.cacheOffsetSize=!0;mxSvgCanvas2D.prototype.allowConvertHtmlToSvg=!1;mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&a.setAttribute("style",b)};mxSvgCanvas2D.prototype.getLightDarkColor=function(a){return mxUtils.getLightDarkColor(a,null,null,"simple"==this.adaptiveColors)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};@@ -400,25 +400,25 @@ mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkCok.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement(e==mxConstants.DIRECTION_RADIAL?"radialGradient":"linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%");e=this.createElement("stop");e.setAttribute("offset","0%");e.setAttribute("stop-color",a.light);e.style.stopColor=a.cssText;e.setAttribute("stop-opacity",c);e.style.stopOpacity=c;f.appendChild(e);e=this.createElement("stop");e.setAttribute("offset","100%");e.setAttribute("stop-color",b.light);e.style.stopColor=b.cssText;e.setAttribute("stop-opacity",d);e.style.stopOpacity=d;f.appendChild(e);return f};-mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c){return("mx-pattern-"+a+"-"+b+"-"+c).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};-mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=-this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}return f.getAttribute("id")};-mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;-e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a=.5*a*c;c=this.format(1.5*(10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format((10+a)*c);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};+mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c,d){return("mx-pattern-"+a+"-"+b+"-"+c+"-"+Math.round(100*d)).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};+mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText,d),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=+this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}c=this.viewTranslate;b=null!=c?this.format(c.x*d):0;c=null!=c?this.format(c.y*d):0;f.setAttribute("patternTransform","translate("+b+","+c+")"+("dots"!==a?" rotate(45)":"")+" scale("+d+")");return f.getAttribute("id")};+mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");+d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a*=.5;c=this.format(1.5*(10+a));var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);+e.setAttribute("fill","none");d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format(10+a);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};mxSvgCanvas2D.prototype.addTitle=function(a){if(null!=a&&null!=this.title){var b=this.createElement("title");mxUtils.write(b,this.title);a.appendChild(b)}return a};mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,this.getCurrentStrokeWidth(),c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill",-"url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",+"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -498,7 +498,7 @@ mxShape.prototype.getShadowStyle=function(){var a={dx:mxConstants.SHADOW_OFFSET_a.color),a.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OPACITY,a.opacity));return a};mxShape.prototype.createDropShadow=function(a,b){var c=mxUtils.getLightDarkColor(a.color,a.opacity/100);return"drop-shadow("+Math.round(a.dx*b*100)/100+"px "+Math.round(a.dy*b*100)/100+"px "+Math.round(a.blur*b*100)/100+"px "+c.cssText+")"};mxShape.prototype.updateSvgFilters=function(a){this.node.style.filter=this.isShadowEnabled()?this.createDropShadow(this.getShadowStyle(),a):""};mxShape.prototype.isShadowEnabled=function(){return this.isShadow};mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.beforePaint(a),this.paint(a),this.afterPaint(a),this.destroyCanvas(a))};mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement&&(a=this.createSvgCanvas());null!=a&&this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){},a.image=function(){},a.text=function(){});return a};-mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};+mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;a.viewTranslate=this.viewTranslate;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity="+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var c=this.fill,d=this.gradient,e="0",f={east:0,south:1,west:2,north:3},g=null!=this.direction?f[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+f[this.gradientDirection]-1,4));1==g?(e="1",f=c,c=d,d=f):2==g?(f=c,c=d,d=f):3==g&&(e="1");b+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+c+"', endColorStr='"+d+"', gradientType='"+e+"')"}a.style.filter=b};@@ -520,10 +520,10 @@ mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=nu1,b.length)];l<b.length-2&&0==Math.round(m.x-g.x)&&0==Math.round(m.y-g.y);)m=b[mxUtils.mod(l+2,b.length)],l++;n=m.x-g.x;m=m.y-g.y;p=Math.max(1,Math.sqrt(n*n+m*m));n=g.x+n*Math.min(d,p/2)/p;m=g.y+m*Math.min(d,p/2)/p;a.quadTo(g.x,g.y,n,m);g=new mxPoint(n,m)}else a.lineTo(g.x,g.y);m=g;l++}e?a.close():a.lineTo(k.x,k.y)}};mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,-this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,this.fillStyle);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,-mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,-mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=-1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};+this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,null);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,+this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,+0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=1==mxUtils.getValue(this.style,+mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return!1};mxShape.prototype.getSvgBoundingBox=function(){var a=null;if(null!=this.node&&null!=this.node.ownerSVGElement)try{var b=this.node.getBBox();0<b.width&&0<b.height&&(a=new mxRectangle(b.x,b.y,b.width,b.height),null!=this.stroke&&a.grow(this.strokewidth*this.scale/2))}catch(c){}return a};mxShape.prototype.getShapeBoundingBox=function(){var a=null;if(null!=this.bounds&&(a=this.createBoundingBox(),null!=a)){this.augmentBoundingBox(a);var b=this.getShapeRotation();0!=b&&(a=mxUtils.getBoundingBox(a,b))}return a};mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a};mxShape.prototype.augmentBoundingBox=function(a){if(this.isShadow){var b=this.getShadowStyle();0>b.dx&&(a.x+=b.dx,a.width-=b.dx);0>b.dy&&(a.y+=b.dy,a.height-=b.dy);a.grow(Math.max(b.blur,0)*this.scale*2);a.width+=Math.ceil(Math.max(b.dx,0)*this.scale);a.height+=Math.ceil(Math.max(b.dy,0)*this.scale)}null!=this.stroke&&a.grow(this.strokewidth*this.scale/2)};@@ -1073,7 +1073,7 @@ mxCellRenderer.prototype.rotateLabelBounds=function(a,b,c,d,e){var f=null!=d?d:cvar g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(f==mxConstants.ALIGN_CENTER&&null==k?c.spacingLeft*d+c.spacingRight*d:0));b.height=Math.max(0,b.height-(g==mxConstants.ALIGN_MIDDLE?c.spacingTop*d+c.spacingBottom*d:0))}e=e?0:c.getTextRotation();0!=e&&null!=a&&a.view.graph.model.isVertex(a.cell)&&(c=a.getCenterX(),a=a.getCenterY(),b.x!=c||b.y!=a)&&(e*=Math.PI/180,a=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(e),Math.sin(e),new mxPoint(c,a)),b.x=a.x,b.y=a.y)};mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(g,k){g=k.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var l=g.getCenterX(),m=g.getCenterY();m=mxUtils.getRotatedPoint(new mxPoint(l,m),e,f,new mxPoint(a.getCenterX(),a.getCenterY()));l=m.x;m=m.y;g.x=Math.round(l--g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.redraw()})}};+g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.viewTranslate=a.view.translate,k.redraw()})}};mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+b*d,f=a.y+c*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var k=(a.width-a.height)/2;e+=k;f-=k}0!=g&&(k=mxUtils.toRadians(g),g=Math.cos(k),k=Math.sin(k),f=mxUtils.getRotatedPoint(new mxPoint(e,f),g,k,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};@@ -1082,8 +1082,8 @@ a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSiblinmxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))};mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a),this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a),-null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};-mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};+null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,a.shape.viewTranslate=a.view.translate,(null==c||c)&&this.doRedrawShape(a),e=!0);+return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));@@ -2058,8 +2058,8 @@ var ErrorDialog=function(a,b,e,f,g,d,h,l,t,k,v){t=null!=t?t:!0;var u=document.cr"nowrap";y.style.textOverflow="ellipsis";y.style.overflow="hidden";y.style.flexShrink="0";mxUtils.write(y,b);y.setAttribute("title",b);u.appendChild(y)}b=document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.style.flexGrow="1";b.style.overflowY="auto";"string"===typeof e&&(e=e.replace(/\n/g,"<br/>"));b.innerHTML=Graph.sanitizeHtml(e);u.appendChild(b);e=document.createElement("div");e.style.marginTop="12px";e.style.textAlign="center";null!=d&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();d()}),b.className="geBtn",e.appendChild(b),e.style.textAlign="center");null!=k&&(k=mxUtils.button(k,function(){null!=v&&v()}),k.className="geBtn",e.appendChild(k));var z=mxUtils.button(f,function(){t&&a.hideDialog();null!=g&&g()});z.className="geBtn";e.appendChild(z);null!=h&&(f=mxUtils.button(h,function(){t&&a.hideDialog();null!=l&&l()}),f.className="geBtn gePrimaryBtn",e.appendChild(f));this.init=function(){z.focus()};u.appendChild(e);this.container=u},PrintDialog=function(a,b,e,f){this.create(a,b,e,f)};-PrintDialog.prototype.create=function(a){function b(z){var F=h.checked||k.checked,D=parseInt(u.value)/100;isNaN(D)&&(D=1,u.value="100%");mxClient.IS_SF&&(D*=.75);var G=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,H=1/e.pageScale;if(F){var M=h.checked?1:parseInt(v.value);isNaN(M)||(H=mxUtils.getScaleForPageCount(M,e,G))}var N=M=0;G=mxRectangle.fromRectangle(G);G.width=Math.ceil(G.width*D);G.height=Math.ceil(G.height*D);H*=D;!F&&e.pageVisible?(D=e.getPageLayout(),M-=D.x*G.width,N-=D.y*G.height):-F=!0;F=PrintDialog.createPrintPreview(e,H,G,0,M,N,F);F.open();z&&PrintDialog.printPreview(F)}var e=a.editor.graph,f=document.createElement("table");f.style.width="100%";f.style.height="100%";var g=document.createElement("tbody");var d=document.createElement("tr");var h=document.createElement("input");h.setAttribute("type","checkbox");var l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";l.appendChild(h);var t=document.createElement("span");mxUtils.write(t," "+mxResources.get("fitPage"));+PrintDialog.prototype.create=function(a){function b(z){var E=h.checked||k.checked,D=parseInt(u.value)/100;isNaN(D)&&(D=1,u.value="100%");mxClient.IS_SF&&(D*=.75);var G=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,H=1/e.pageScale;if(E){var M=h.checked?1:parseInt(v.value);isNaN(M)||(H=mxUtils.getScaleForPageCount(M,e,G))}var N=M=0;G=mxRectangle.fromRectangle(G);G.width=Math.ceil(G.width*D);G.height=Math.ceil(G.height*D);H*=D;!E&&e.pageVisible?(D=e.getPageLayout(),M-=D.x*G.width,N-=D.y*G.height):+E=!0;E=PrintDialog.createPrintPreview(e,H,G,0,M,N,E);E.open();z&&PrintDialog.printPreview(E)}var e=a.editor.graph,f=document.createElement("table");f.style.width="100%";f.style.height="100%";var g=document.createElement("tbody");var d=document.createElement("tr");var h=document.createElement("input");h.setAttribute("type","checkbox");var l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";l.appendChild(h);var t=document.createElement("span");mxUtils.write(t," "+mxResources.get("fitPage"));l.appendChild(t);mxEvent.addListener(t,"click",function(z){h.checked=!h.checked;k.checked=!h.checked;mxEvent.consume(z)});mxEvent.addListener(h,"change",function(){k.checked=!h.checked});d.appendChild(l);g.appendChild(d);d=d.cloneNode(!1);var k=document.createElement("input");k.setAttribute("type","checkbox");l=document.createElement("td");l.style.fontSize="10pt";l.appendChild(k);t=document.createElement("span");mxUtils.write(t," "+mxResources.get("posterPrint")+":");l.appendChild(t);mxEvent.addListener(t,"click",function(z){k.checked=!k.checked;h.checked=!k.checked;mxEvent.consume(z)});d.appendChild(l);var v=document.createElement("input");v.setAttribute("value","1");v.setAttribute("type","number");v.setAttribute("min","1");v.setAttribute("size","4");v.setAttribute("disabled","disabled");v.style.width="50px";l=document.createElement("td");l.style.fontSize="10pt";l.appendChild(v);mxUtils.write(l," "+mxResources.get("pages")+" (max)");d.appendChild(l);g.appendChild(d);mxEvent.addListener(k,"change",function(){k.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");h.checked=!k.checked});d=d.cloneNode(!1);l=document.createElement("td");mxUtils.write(l,mxResources.get("pageScale")+":");d.appendChild(l);l=document.createElement("td");var u=document.createElement("input");u.setAttribute("value","100 %");u.setAttribute("size","5");u.style.width="50px";l.appendChild(u);d.appendChild(l);g.appendChild(d);d=document.createElement("tr");l=document.createElement("td");l.colSpan=2;@@ -2071,14 +2071,14 @@ var PageSetupDialog=function(a){function b(){var D=u;null!=D&&null!=D.originalSrvar d=document.createElement("tr");var h=document.createElement("td");h.style.verticalAlign="top";h.style.fontSize="10pt";mxUtils.write(h,mxResources.get("paperSize")+":");d.appendChild(h);h=document.createElement("td");h.style.verticalAlign="top";h.style.fontSize="10pt";var l=PageSetupDialog.addPageFormatPanel(h,"pagesetupdialog",e.pageFormat);d.appendChild(h);g.appendChild(d);d=document.createElement("tr");h=document.createElement("td");mxUtils.write(h,mxResources.get("gridSize")+":");d.appendChild(h);h=document.createElement("td");h.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=e.getGridSize();h.appendChild(t);mxEvent.addListener(t,"change",function(){var D=parseInt(t.value);t.value=Math.max(1,isNaN(D)?e.getGridSize():D)});d.appendChild(h);g.appendChild(d);d=document.createElement("tr");h=document.createElement("td");mxUtils.write(h,mxResources.get("background")+":");d.appendChild(h);h=document.createElement("td");var k=document.createElement("button");k.className="geBtn";k.style.margin="0px";mxUtils.write(k,mxResources.get("change")+"...");var v=document.createElement("div");v.style.display="inline-block";v.style.verticalAlign="middle";v.style.backgroundPosition="center center";v.style.backgroundRepeat="no-repeat";v.style.backgroundSize="contain";v.style.border="1px solid lightGray";v.style.borderRadius="4px";v.style.marginRight="14px";v.style.height="32px";-v.style.width="64px";v.style.cursor="pointer";v.style.padding="4px";var u=e.backgroundImage,y=e.background,z=e.shadowVisible,F=function(D){a.showBackgroundImageDialog(function(G,H,M,N){H||(null!=G&&null!=G.src&&Graph.isPageLink(G.src)&&(G={originalSrc:G.src}),u=G,z=N);y=M;b()},u,y,!0);mxEvent.consume(D)};mxEvent.addListener(k,"click",F);mxEvent.addListener(v,"click",F);b();h.appendChild(v);h.appendChild(k);d.appendChild(h);g.appendChild(d);d=document.createElement("tr");h=document.createElement("td");-h.colSpan=2;h.style.paddingTop="16px";h.setAttribute("align","right");k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&h.appendChild(k);F=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var D=parseInt(t.value);isNaN(D)||e.gridSize===D||e.setGridSize(D);D=new ChangePageSetup(a,y,u,l.get());D.ignoreColor=e.background==y;D.ignoreImage=(null!=e.backgroundImage?e.backgroundImage.src:null)===(null!=u?u.src:null);null!=z&&-(D.shadowVisible=z);e.pageFormat.width==D.previousFormat.width&&e.pageFormat.height==D.previousFormat.height&&D.ignoreColor&&D.ignoreImage&&D.shadowVisible==e.shadowVisible||e.model.execute(D)});F.className="geBtn gePrimaryBtn";h.appendChild(F);a.editor.cancelFirst||h.appendChild(k);d.appendChild(h);g.appendChild(d);f.appendChild(g);this.container=f};+v.style.width="64px";v.style.cursor="pointer";v.style.padding="4px";var u=e.backgroundImage,y=e.background,z=e.shadowVisible,E=function(D){a.showBackgroundImageDialog(function(G,H,M,N){H||(null!=G&&null!=G.src&&Graph.isPageLink(G.src)&&(G={originalSrc:G.src}),u=G,z=N);y=M;b()},u,y,!0);mxEvent.consume(D)};mxEvent.addListener(k,"click",E);mxEvent.addListener(v,"click",E);b();h.appendChild(v);h.appendChild(k);d.appendChild(h);g.appendChild(d);d=document.createElement("tr");h=document.createElement("td");+h.colSpan=2;h.style.paddingTop="16px";h.setAttribute("align","right");k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&h.appendChild(k);E=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var D=parseInt(t.value);isNaN(D)||e.gridSize===D||e.setGridSize(D);D=new ChangePageSetup(a,y,u,l.get());D.ignoreColor=e.background==y;D.ignoreImage=(null!=e.backgroundImage?e.backgroundImage.src:null)===(null!=u?u.src:null);null!=z&&+(D.shadowVisible=z);e.pageFormat.width==D.previousFormat.width&&e.pageFormat.height==D.previousFormat.height&&D.ignoreColor&&D.ignoreImage&&D.shadowVisible==e.shadowVisible||e.model.execute(D)});E.className="geBtn gePrimaryBtn";h.appendChild(E);a.editor.cancelFirst||h.appendChild(k);d.appendChild(h);g.appendChild(d);f.appendChild(g);this.container=f};PageSetupDialog.addPageFormatPanel=function(a,b,e,f){b="format-"+b;var g=document.createElement("input");g.setAttribute("name",b);g.setAttribute("type","radio");g.setAttribute("value","portrait");var d=document.createElement("input");d.setAttribute("name",b);d.setAttribute("type","radio");d.setAttribute("value","landscape");var h=document.createElement("select");h.style.position="relative";h.style.marginBottom="4px";h.style.borderRadius="4px";h.style.borderWidth="1px";h.style.borderStyle="solid";h.style.boxSizing="border-box";h.style.padding="2px";h.style.width="210px";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.marginLeft="4px";l.style.width="210px";l.style.height="24px";g.style.marginRight="6px";l.appendChild(g);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));l.appendChild(b);d.style.marginLeft="10px";d.style.marginRight="6px";l.appendChild(d);var t=document.createElement("span");t.style.width="100px";mxUtils.write(t,mxResources.get("landscape"));l.appendChild(t);var k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.fontSize="12px";k.style.width="210px";k.style.height="24px";var v=document.createElement("input");v.setAttribute("size","6");v.setAttribute("title",mxResources.get("width"));v.style.textAlign="right";k.appendChild(v);mxUtils.write(k," x ");var u=document.createElement("input");u.setAttribute("size","6");u.setAttribute("title",mxResources.get("height"));u.style.textAlign="right";k.appendChild(u);-var y=document.createElement("select");y.style.marginLeft="4px";y.style.boxSizing="border-box";for(var z=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],F=0;F<z.length;F++){var D=document.createElement("option");D.setAttribute("value",z[F].unit);mxUtils.write(D,z[F].label);y.appendChild(D)}y.value=Editor.pageSizeUnit;k.appendChild(y);l.style.display="none";k.style.display=-"none";var G={},H=PageSetupDialog.getFormats();for(F=0;F<H.length;F++)z=H[F],G[z.key]=z,D=document.createElement("option"),D.setAttribute("value",z.key),mxUtils.write(D,z.title),h.appendChild(D);var M=function(){h.value="custom";for(var L=0;L<H.length;L++){var U=H[L];null!=U.format&&("a4"==U.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==U.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&+var y=document.createElement("select");y.style.marginLeft="4px";y.style.boxSizing="border-box";for(var z=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],E=0;E<z.length;E++){var D=document.createElement("option");D.setAttribute("value",z[E].unit);mxUtils.write(D,z[E].label);y.appendChild(D)}y.value=Editor.pageSizeUnit;k.appendChild(y);l.style.display="none";k.style.display=+"none";var G={},H=PageSetupDialog.getFormats();for(E=0;E<H.length;E++)z=H[E],G[z.key]=z,D=document.createElement("option"),D.setAttribute("value",z.key),mxUtils.write(D,z.title),h.appendChild(D);var M=function(){h.value="custom";for(var L=0;L<H.length;L++){var U=H[L];null!=U.format&&("a4"==U.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==U.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==U.format.width&&e.height==U.format.height?(h.value=U.key,g.setAttribute("checked","checked"),g.defaultChecked=!0,g.checked=!0,d.removeAttribute("checked"),d.defaultChecked=!1,d.checked=!1,detected=!0):e.width==U.format.height&&e.height==U.format.width&&(h.value=U.key,g.removeAttribute("checked"),g.defaultChecked=!1,g.checked=!1,d.setAttribute("checked","checked"),d.defaultChecked=!0,detected=d.checked=!0))}"custom"==h.value?(v.value=Editor.toUnit(e.width,y.value),u.value=Editor.toUnit(e.height,y.value),g.setAttribute("checked","checked"),h.value="custom",l.style.display="none",k.style.display=""):(l.style.display="",k.style.display="none")};M();a.appendChild(h);mxUtils.br(a);a.appendChild(l);a.appendChild(k);var N=function(L,U){L=G[h.value];null!=L.format?(v.value=Editor.toUnit(d.checked?L.format.height:L.format.width,y.value),u.value=Editor.toUnit(d.checked?L.format.width:L.format.height,y.value),k.style.display="none",l.style.display=""):(l.style.display="none",k.style.display="");L=parseFloat(v.value);if(isNaN(L)||0>=L)v.value=Editor.toUnit(e.width,y.value);L=parseFloat(u.value);if(isNaN(L)||0>=L)u.value=Editor.toUnit(e.height,y.value);L=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(v.value),y.value)),Math.floor(Editor.fromUnit(parseFloat(u.value),y.value)));U||L.width==e.width&&L.height==e.height||(e=L,null!=f&&f(e))};mxEvent.addListener(b,"click",function(L){g.checked=!0;N(L);mxEvent.consume(L)});mxEvent.addListener(t,"click",function(L){d.checked=@@ -2087,8 +2087,8 @@ Editor.pageSizeUnit=y.value;N(L,!0);mxEvent.consume(L)});N(null,!0);return{set:fPageSetupDialog.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(a,b,e,f,g,d,h,l,t,k,v){t=null!=t?t:!0;var u=document.createElement("div"),y=document.createElement("div");y.style.width="100%";y.style.display="grid";y.style.gap="5px 8px";y.style.gridAutoColumns="auto 1fr";y.style.boxSizing="border-box";y.style.padding="3px";var z=document.createElement("div");z.style.display="inline-flex";z.style.alignItems="center";z.style.justifyContent="flex-end";z.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",g||mxResources.get("filename"));mxUtils.write(F,(g||mxResources.get("filename"))+":");z.appendChild(F);y.appendChild(z);var D=document.createElement("input");D.setAttribute("value",b||"");D.style.flexGrow="1";var G=mxUtils.button(e,function(){if(null==d||d(D.value))t&&a.hideDialog(),f(D.value)});G.className="geBtn gePrimaryBtn";this.init=function(){if(null!=+var FilenameDialog=function(a,b,e,f,g,d,h,l,t,k,v){t=null!=t?t:!0;var u=document.createElement("div"),y=document.createElement("div");y.style.width="100%";y.style.display="grid";y.style.gap="5px 8px";y.style.gridAutoColumns="auto 1fr";y.style.boxSizing="border-box";y.style.padding="3px";var z=document.createElement("div");z.style.display="inline-flex";z.style.alignItems="center";z.style.justifyContent="flex-end";z.style.minWidth="0";var E=document.createElement("div");E.style.display="inline-block";+E.style.textOverflow="ellipsis";E.style.whiteSpace="nowrap";E.style.overflow="hidden";E.style.fontSize="10pt";E.style.padding="2px 0";E.setAttribute("title",g||mxResources.get("filename"));mxUtils.write(E,(g||mxResources.get("filename"))+":");z.appendChild(E);y.appendChild(z);var D=document.createElement("input");D.setAttribute("value",b||"");D.style.flexGrow="1";var G=mxUtils.button(e,function(){if(null==d||d(D.value))t&&a.hideDialog(),f(D.value)});G.className="geBtn gePrimaryBtn";this.init=function(){if(null!=g||null==h)if(null!=v?Editor.selectFilename(D):(D.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?D.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var H=y.parentNode;if(null!=H){var M=null;mxEvent.addListener(H,"dragleave",function(N){null!=M&&(M.style.backgroundColor="",M=null);N.stopPropagation();N.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(N){null==M&&(!mxClient.IS_IE||10<document.documentMode)&&(M=D,M.style.backgroundColor="#ebf2f9");N.stopPropagation();N.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(N){null!=M&&(M.style.backgroundColor="",M=null);0<=mxUtils.indexOf(N.dataTransfer.types,"text/uri-list")&&(D.value=decodeURIComponent(N.dataTransfer.getData("text/uri-list")),G.click());N.stopPropagation();N.preventDefault()}))}}};z=document.createElement("div");z.style.display="inline-flex";z.style.alignItems="center";z.style.gap="4px";z.style.whiteSpace="nowrap";z.appendChild(D);y.appendChild(z);null==g&&null!=h||null==v||null==a.editor.diagramFileTypes||(z=document.createElement("div"),z.style.display="inline-flex",z.style.alignItems="center",z.style.textOverflow="ellipsis",z.style.justifyContent="flex-end",z.style.fontSize="10pt",mxUtils.write(z,mxResources.get("type")+":"),y.appendChild(z),z=document.createElement("div"),z.style.display="inline-flex",z.style.alignItems="center",z.style.whiteSpace="nowrap",y.appendChild(z),b=FilenameDialog.createFileTypes(a,D,a.editor.diagramFileTypes),@@ -2100,15 +2100,15 @@ var WrapperWindow=function(a,b,e,f,g,d,h,l){l=null!=l?l:document.createElement("(function(){mxGraphView.prototype.validateBackgroundPage=function(){var h=this.graph;if(null!=h.container&&!h.transparentBackground){if(h.pageVisible){var l=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var t=h.container.firstChild;null!=t&&t.nodeType!=mxConstants.NODETYPE_ELEMENT;)t=t.nextSibling;null!=t&&(this.backgroundPageShape=this.createBackgroundPageShape(l),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(h.container),t.style.position="absolute",h.container.insertBefore(this.backgroundPageShape.node,t),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(k){h.dblClick(k)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(k){h.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(k))}),mxUtils.bind(this,function(k){null!=h.tooltipHandler&&h.tooltipHandler.isHideOnHover()&&h.tooltipHandler.hide();h.isMouseDown&&!mxEvent.isConsumed(k)&&h.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(k))}),mxUtils.bind(this,function(k){h.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(k))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=l,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};-mxGraphView.prototype.validateBackgroundStyles=function(h,l,t){var k=this.graph;h=null!=h?h:1;var v=mxUtils.getLightDarkColor(null==k.background||k.background==mxConstants.NONE?k.defaultPageBackgroundColor:k.background).cssText,u=mxUtils.getLightDarkColor(k.defaultPageBorderColor).cssText,y=null!=v&&this.gridColor!=v.toLowerCase()?this.gridColor:"#ffffff",z="none",F="";"simple"==k.getAdaptiveColors()&&k.background!=mxConstants.NONE&&null!=k.background&&(v=k.background);if(k.isGridEnabled()||k.gridVisible){F=-10;mxClient.IS_SVG?(z=unescape(encodeURIComponent(this.createSvgGrid(y,h))),z=window.btoa?btoa(z):Base64.encode(z,!0),z="url(data:image/svg+xml;base64,"+z+")",F=k.gridSize*this.scale*this.gridSteps*h):z="url("+this.gridImage+")";var D=y=0;l=null!=l?l-this.translate.x*this.scale:0;t=null!=t?t-this.translate.y*this.scale:0;var G=k.gridSize*this.scale*this.gridSteps,H=l%G;G=t%G;null!=k.view.backgroundPageShape&&(D=this.getBackgroundPageBounds(),y=1+D.x,D=1+D.y);F=-Math.round(F-mxUtils.mod(this.translate.x*-this.scale-y+l,F)+H*h)+"px "+-Math.round(F-mxUtils.mod(this.translate.y*this.scale-D+t,F)+G*h)+"px"}h=k.view.canvas;null!=h.ownerSVGElement&&(h=h.ownerSVGElement);y=!Editor.isDarkMode()&&k.enableDiagramBackground;null!=k.view.backgroundPageShape?(k.view.backgroundPageShape.node.style.backgroundPosition=F,k.view.backgroundPageShape.node.style.backgroundImage=z,k.view.backgroundPageShape.node.style.backgroundColor=v,k.view.backgroundPageShape.node.style.borderColor=u,k.view.backgroundPageShape.node.style.colorScheme=-"none"==k.getAdaptiveColors()?"light":"",h.style.backgroundImage="none",h.style.backgroundColor="",k.container.style.backgroundColor=y?k.diagramBackgroundColor:""):(h.style.backgroundPosition=F,h.style.backgroundImage=z,"1"==urlParams.transparent?k.container.style.background="transparent":!y||null!=k.background&&k.background!=mxConstants.NONE?h.style.backgroundColor=v:(h.style.backgroundColor=k.diagramBackgroundColor,k.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(h,+mxGraphView.prototype.validateBackgroundStyles=function(h,l,t){var k=this.graph;h=null!=h?h:1;var v=mxUtils.getLightDarkColor(null==k.background||k.background==mxConstants.NONE?k.defaultPageBackgroundColor:k.background).cssText,u=mxUtils.getLightDarkColor(k.defaultPageBorderColor).cssText,y=null!=v&&this.gridColor!=v.toLowerCase()?this.gridColor:"#ffffff",z="none",E="";"simple"==k.getAdaptiveColors()&&k.background!=mxConstants.NONE&&null!=k.background&&(v=k.background);if(k.isGridEnabled()||k.gridVisible){E=+10;mxClient.IS_SVG?(z=unescape(encodeURIComponent(this.createSvgGrid(y,h))),z=window.btoa?btoa(z):Base64.encode(z,!0),z="url(data:image/svg+xml;base64,"+z+")",E=k.gridSize*this.scale*this.gridSteps*h):z="url("+this.gridImage+")";var D=y=0;l=null!=l?l-this.translate.x*this.scale:0;t=null!=t?t-this.translate.y*this.scale:0;var G=k.gridSize*this.scale*this.gridSteps,H=l%G;G=t%G;null!=k.view.backgroundPageShape&&(D=this.getBackgroundPageBounds(),y=1+D.x,D=1+D.y);E=-Math.round(E-mxUtils.mod(this.translate.x*+this.scale-y+l,E)+H*h)+"px "+-Math.round(E-mxUtils.mod(this.translate.y*this.scale-D+t,E)+G*h)+"px"}h=k.view.canvas;null!=h.ownerSVGElement&&(h=h.ownerSVGElement);y=!Editor.isDarkMode()&&k.enableDiagramBackground;null!=k.view.backgroundPageShape?(k.view.backgroundPageShape.node.style.backgroundPosition=E,k.view.backgroundPageShape.node.style.backgroundImage=z,k.view.backgroundPageShape.node.style.backgroundColor=v,k.view.backgroundPageShape.node.style.borderColor=u,k.view.backgroundPageShape.node.style.colorScheme=+"none"==k.getAdaptiveColors()?"light":"",h.style.backgroundImage="none",h.style.backgroundColor="",k.container.style.backgroundColor=y?k.diagramBackgroundColor:""):(h.style.backgroundPosition=E,h.style.backgroundImage=z,"1"==urlParams.transparent?k.container.style.background="transparent":!y||null!=k.background&&k.background!=mxConstants.NONE?h.style.backgroundColor=v:(h.style.backgroundColor=k.diagramBackgroundColor,k.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(h,l){for(var t=this.graph.gridSize*this.scale*(null!=l?l:1);t<this.minGridSize;)t*=2;l=this.gridSteps*t;for(var k=[],v=1;v<this.gridSteps;v++){var u=v*t;k.push("M 0 "+u+" L "+l+" "+u+" M "+u+" 0 L "+u+" "+l)}h=mxUtils.getLightDarkColor(h);t="color-scheme: light dark;";mxClient.IS_SF&&(t="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+t+'" width="'+l+'" height="'+l+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+l+'" height="'+l+'" patternUnits="userSpaceOnUse"><path d="'+k.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(h.cssText)+';" stroke="'+h.light+'" opacity="0.2" stroke-width="1"/><path d="M '+l+" 0 L 0 0 0 "+l+'" fill="none" style="stroke:'+mxUtils.htmlEntities(h.cssText)+';" stroke="'+h.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(h,l){a.apply(this,arguments);if(null!=this.shiftPreview1){var t=this.view.canvas;null!=t.ownerSVGElement&&(t=t.ownerSVGElement);var k=this.gridSize*this.view.scale*this.view.gridSteps;k=-Math.round(k-mxUtils.mod(this.view.translate.x*this.view.scale+h,k))+"px "+-Math.round(k-mxUtils.mod(this.view.translate.y*this.view.scale+l,k))+"px";t.style.backgroundPosition=k}};mxGraph.prototype.updatePageBreaks=function(h,l,t){var k=this.view.scale,v=this.view.translate,u=this.pageFormat,y=k*this.pageScale,z=this.view.getBackgroundPageBounds();-l=z.width;t=z.height;var F=new mxRectangle(k*v.x,k*v.y,u.width*y,u.height*y),D=(h=h&&Math.min(F.width,F.height)>this.minPageBreakDist)?Math.ceil(t/F.height)-1:0,G=h?Math.ceil(l/F.width)-1:0,H=z.x+l,M=z.y+t;null==this.horizontalPageBreaks&&0<D&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<G&&(this.verticalPageBreaks=[]);h=mxUtils.bind(this,function(N){if(null!=N){for(var L=N==this.horizontalPageBreaks?D:G,U=0;U<=L;U++){var X=N==this.horizontalPageBreaks?[new mxPoint(Math.round(z.x),-Math.round(z.y+(U+1)*F.height)),new mxPoint(Math.round(H),Math.round(z.y+(U+1)*F.height))]:[new mxPoint(Math.round(z.x+(U+1)*F.width),Math.round(z.y)),new mxPoint(Math.round(z.x+(U+1)*F.width),Math.round(M))];null!=N[U]?(N[U].points=X,N[U].redraw()):(X=new mxPolyline(X,this.pageBreakColor),X.dialect=this.dialect,X.isDashed=this.pageBreakDashed,X.pointerEvents=!1,X.init(this.view.backgroundPane),X.redraw(),N[U]=X)}for(U=L;U<N.length;U++)null!=N[U]&&N[U].destroy();N.splice(L,N.length-L)}});h(this.horizontalPageBreaks);+l=z.width;t=z.height;var E=new mxRectangle(k*v.x,k*v.y,u.width*y,u.height*y),D=(h=h&&Math.min(E.width,E.height)>this.minPageBreakDist)?Math.ceil(t/E.height)-1:0,G=h?Math.ceil(l/E.width)-1:0,H=z.x+l,M=z.y+t;null==this.horizontalPageBreaks&&0<D&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<G&&(this.verticalPageBreaks=[]);h=mxUtils.bind(this,function(N){if(null!=N){for(var L=N==this.horizontalPageBreaks?D:G,U=0;U<=L;U++){var X=N==this.horizontalPageBreaks?[new mxPoint(Math.round(z.x),+Math.round(z.y+(U+1)*E.height)),new mxPoint(Math.round(H),Math.round(z.y+(U+1)*E.height))]:[new mxPoint(Math.round(z.x+(U+1)*E.width),Math.round(z.y)),new mxPoint(Math.round(z.x+(U+1)*E.width),Math.round(M))];null!=N[U]?(N[U].points=X,N[U].redraw()):(X=new mxPolyline(X,this.pageBreakColor),X.dialect=this.dialect,X.isDashed=this.pageBreakDashed,X.pointerEvents=!1,X.init(this.view.backgroundPane),X.redraw(),N[U]=X)}for(U=L;U<N.length;U++)null!=N[U]&&N[U].destroy();N.splice(L,N.length-L)}});h(this.horizontalPageBreaks);h(this.verticalPageBreaks)};var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(h,l,t){for(var k=0;k<l.length;k++){if(this.graph.isTableCell(l[k])||this.graph.isTableRow(l[k]))return!1;if(this.graph.getModel().isVertex(l[k])){var v=this.graph.getCellGeometry(l[k]);if(null!=v&&v.relative)return!1}}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var h=e.apply(this,arguments);h.intersects=mxUtils.bind(this,function(l,t){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(h,arguments)});return h};mxGraphView.prototype.createBackgroundPageShape=function(h){return new mxRectangleShape(h,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var h=this.getGraphBounds(),l=0<h.width?h.x/this.scale-this.translate.x:0,t=0<h.height?h.y/this.scale-this.translate.y:0,k=this.graph.pageFormat,v=this.graph.pageScale,u=k.width*v;k=k.height*v;v=Math.floor(Math.min(0,l)/u);var y=Math.floor(Math.min(0,t)/k);return new mxRectangle(this.scale*(this.translate.x+v*u),this.scale*(this.translate.y+y*k),this.scale*(Math.ceil(Math.max(1,l+h.width/this.scale)/u)-v)*u,this.scale*(Math.ceil(Math.max(1,t+h.height/this.scale)/k)-y)*k)};var f=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(h,l){f.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||@@ -2127,7 +2127,7 @@ if(null!=g.graphHandler){var v=g.graphHandler.start;g.graphHandler.start=functiomxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var u=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(W,ba){return f.isSpaceDown()||u.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(W){if(Editor.passiveScroll){var ba=mxEvent.getSource(W);if(ba!=g.container&&!g.container.contains(ba)&&!g.isEditing())return}16==W.which?this.shiftDown=!0:32!=W.which||g.isEditing()?mxEvent.isConsumed(W)||27!=W.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),g.container.style.cursor="move",g.isEditing()||mxEvent.getSource(W)!=g.container||mxEvent.consume(W))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(W){g.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var y=g.panningHandler.isForcePanningEvent;g.panningHandler.isForcePanningEvent=function(W){return null!=g.freehand&&g.freehand.isActive()?!1:y.apply(this,arguments)||f.isSpaceDown()||mxEvent.isMouseEvent(W.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(W.getEvent()))&&(!mxEvent.isControlDown(W.getEvent())&&mxEvent.isRightMouseButton(W.getEvent())||mxEvent.isMiddleMouseButton(W.getEvent()))};var z=g.cellEditor.isStopEditingEvent;g.cellEditor.isStopEditingEvent=function(W){return z.apply(this,arguments)||13==W.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(W)||mxClient.IS_MAC&&mxEvent.isMetaDown(W)||mxClient.IS_SF&&mxEvent.isShiftDown(W))};-var F=g.isZoomWheelEvent;g.isZoomWheelEvent=function(){return f.isSpaceDown()||F.apply(this,arguments)};var D=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var W=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ba=this.toolbar.container.firstChild;null!=ba;){var K=ba.getAttribute("data-min-width");null!=K&&parseInt(K)>W?ba.style.display="none":ba.style.display="";ba=ba.nextSibling}}),G=!1,H=null,M=null,N=null,L=mxUtils.bind(this,function(){if(null!=this.toolbar&&+var E=g.isZoomWheelEvent;g.isZoomWheelEvent=function(){return f.isSpaceDown()||E.apply(this,arguments)};var D=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var W=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ba=this.toolbar.container.firstChild;null!=ba;){var K=ba.getAttribute("data-min-width");null!=K&&parseInt(K)>W?ba.style.display="none":ba.style.display="";ba=ba.nextSibling}}),G=!1,H=null,M=null,N=null,L=mxUtils.bind(this,function(){if(null!=this.toolbar&&G!=g.cellEditor.isContentEditing()){for(var W=this.toolbar.container.firstChild,ba=[];null!=W;){var K=W.nextSibling;W.parentNode.removeChild(W);ba.push(W);W=K}W=this.toolbar.fontMenu;K=this.toolbar.sizeMenu;if(null==N)this.toolbar.createTextToolbar();else{for(var T=0;T<N.length;T++)this.toolbar.container.appendChild(N[T]);this.toolbar.fontMenu=H;this.toolbar.sizeMenu=M}G=g.cellEditor.isContentEditing();H=W;M=K;N=ba;D()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();L()}));this.addListener("currentThemeChanged",D);mxEvent.addListener(window,"resize",D);D();g.isTouchPopupMenuEnabled=function(){return null==f.dialog};var U=g.cellEditor.startEditing;g.cellEditor.startEditing=function(){U.apply(this,arguments);L();if(g.cellEditor.isContentEditing()){var W=!1,ba=function(){W||(W=!0,window.setTimeout(function(){var K=g.getSelectedEditingElement();null!=K&&(K=mxUtils.getCurrentStyle(K),null!=K&&null!=f.toolbar&&(f.toolbar.setFontName(mxUtils.getCssFontFamily(K.fontFamily)),f.toolbar.setFontSize(parseInt(K.fontSize))));W=!1},0))};mxEvent.addListener(g.cellEditor.textarea,"input",ba);mxEvent.addListener(g.cellEditor.textarea,"touchend",ba);mxEvent.addListener(g.cellEditor.textarea,"mouseup",ba);mxEvent.addListener(g.cellEditor.textarea,"keyup",ba);ba()}};var X=g.cellEditor.stopEditing;g.cellEditor.stopEditing=function(W,ba){try{X.apply(this,arguments),L()}catch(K){f.handleError(K)}};g.container.setAttribute("tabindex","0");g.container.style.cursor="default";if(window.self===@@ -2150,15 +2150,15 @@ mxUtils.bind(e,e.showLinkDialog);a.editLink=e.actions.get("editLink").funct;thisEditorUi.prototype.createSelectionState=function(){for(var a=this.editor.graph,b=a.getSelectionCells(),e=this.initSelectionState(),f=!0,g=0;g<b.length;g++){var d=a.getCurrentCellStyle(b[g]);"0"!=mxUtils.getValue(d,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(e,b[g],b,f),f=!1)}this.updateSelectionStateForTableCells(e);if(Editor.enableCustomProperties){e.customProperties={};a=e.vertices;b=e.edges;for(g=0;g<a.length;g++)this.findCommonProperties(a[g],e.customProperties,0==g,e);for(g=0;g<b.length;g++)this.findCommonProperties(b[g],e.customProperties,0==a.length&&0==g,e)}return e};EditorUi.prototype.findCommonProperties=function(a,b,e,f){f=mxUtils.bind(this,function(k){if(null!=k)if(e)for(var v=0;v<k.length;v++)b[k[v].name]=k[v];else for(var u in b)if(null!=u){var y=!1;for(v=0;v<k.length;v++)if(k[v].name==u&&k[v].type==b[u].type){y=!0;break}y||delete b[u]}});var g=this.editor.graph,d=g.view.getState(a);if(null!=d&&null!=d.shape){if(!d.shape.commonCustomPropAdded){d.shape.commonCustomPropAdded=!0;d.shape.customProperties=d.shape.customProperties||[];if(null!=d.shape&&null!=-d.shape.stencil&&null!=d.shape.stencil.desc){var h=d.shape.stencil,l=[],t=mxUtils.bind(this,function(k){k=h.desc.getElementsByTagName(k);for(var v=[],u=0;u<k.length;u++){var y=k[u].getAttribute("color");if(!mxUtils.isValidColor(y)&&!l[y]&&"fill"!=y&&"stroke"!=y&&"font"!=y){l[y]=!0;var z=k[u].getAttribute("name");z=null!=z?z:Editor.getLabelForStylename(y);var F=k[u].getAttribute("default"),D=h.getDefaultColorValue(k[u],g),G=F;F==mxConstants.NONE&&(F="default");v.push({name:y,type:"color",primary:"false"!=-k[u].getAttribute("primary"),defVal:F,defaultColor:D,undefinedColor:G,dispName:z})}}return v});Array.prototype.push.apply(d.shape.customProperties,t("fillcolor"));Array.prototype.push.apply(d.shape.customProperties,t("strokecolor"));Array.prototype.push.apply(d.shape.customProperties,t("fontcolor"))}d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)}f(d.shape.customProperties)}a=+d.shape.stencil&&null!=d.shape.stencil.desc){var h=d.shape.stencil,l=[],t=mxUtils.bind(this,function(k){k=h.desc.getElementsByTagName(k);for(var v=[],u=0;u<k.length;u++){var y=k[u].getAttribute("color");if(!mxUtils.isValidColor(y)&&!l[y]&&"fill"!=y&&"stroke"!=y&&"font"!=y){l[y]=!0;var z=k[u].getAttribute("name");z=null!=z?z:Editor.getLabelForStylename(y);var E=k[u].getAttribute("default"),D=h.getDefaultColorValue(k[u],g),G=E;E==mxConstants.NONE&&(E="default");v.push({name:y,type:"color",primary:"false"!=+k[u].getAttribute("primary"),defVal:E,defaultColor:D,undefinedColor:G,dispName:z})}}return v});Array.prototype.push.apply(d.shape.customProperties,t("fillcolor"));Array.prototype.push.apply(d.shape.customProperties,t("strokecolor"));Array.prototype.push.apply(d.shape.customProperties,t("fontcolor"))}d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)}f(d.shape.customProperties)}a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(k){}};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(a){if(1<a.cells.length&&a.cell){var b=mxUtils.sortCells(a.cells),e=this.editor.graph.model,f=e.getParent(b[0]),g=e.getParent(f);if(null!=f&&null!=g){for(var d=f.getIndex(b[0]),h=g.getIndex(f),l=null,t=1,k=1,v=0,u=h<g.getChildCount()-1?e.getChildAt(e.getChildAt(g,h+1),d):null;v<b.length-1;){var y=b[++v];null==u||u!=y||null!=l&&t!=l||(l=t,t=0,k++,f=e.getParent(u),u=h+k<g.getChildCount()?e.getChildAt(e.getChildAt(g,h+k),d):null);var z=this.editor.graph.view.getState(y);if(y==e.getChildAt(f,d+t)&&null!=z&&1==mxUtils.getValue(z.style,"colspan",1)&&1==mxUtils.getValue(z.style,"rowspan",1))t++;else break}v==k*t-1&&(a.mergeCell=b[0],a.colspan=t,a.rowspan=k)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};EditorUi.prototype.createTimeout=function(a,b,e){var f=!0,g=null,d=mxUtils.bind(this,function(l){g.clear()&&(f=!1,l=null!=l?l:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(a,b,e)})},null!=e?e(l):this.handleError(l))}),h=window.setTimeout(d,null!=a?a:this.timeout);g={clear:function(){window.clearTimeout(h);return f},isAlive:function(){return f}};null!=b&&this.tryAndHandle(mxUtils.bind(this,function(){b(g)}),d);return g};EditorUi.prototype.tryAndHandle=function(a,b){try{a()}catch(e){null!=b?b(e):this.handleError(e)}};EditorUi.prototype.removeUserDefinedDarkColors=function(a,b,e){var f=this.editor.graph;a=null!=a?a:f.getSelectionCells();var g=Graph.colorStyles,d=document.createElement("div");f.model.beginUpdate();try{for(var h=0;h<a.length;h++)if(f.model.isEdge(a[h])||f.model.isVertex(a[h])){var l=f.getCellStyle(a[h],!1);if(null!=l)for(var t=0;t<g.length;t++)try{var k=l[g[t]];if(mxUtils.isLightDarkColor(k)){var v=mxUtils.getLightDarkColor(k);f.setCellStyles(g[t],v.light,[a[h]])}}catch(y){}b&&f.isHtmlLabel(a[h])&&-"0"!=mxUtils.getValue(l,"html","0")&&(d.innerHTML=Graph.sanitizeHtml(f.getLabel(a[h])),Graph.addLightDarkColors(d,null,null,function(y,z,F){return mxUtils.isLightDarkColor(F)?(F=mxUtils.getLightDarkColor(F),y.style.setProperty(z,F.light),!0):!1})&&f.cellLabelChanged(a[h],d.innerHTML))}if(e&&mxUtils.isLightDarkColor(f.background)){v=mxUtils.getLightDarkColor(f.background);var u=new ChangePageSetup(this,v.light);u.ignoreImage=!0;f.model.execute(u)}}finally{f.model.endUpdate()}return a};+"0"!=mxUtils.getValue(l,"html","0")&&(d.innerHTML=Graph.sanitizeHtml(f.getLabel(a[h])),Graph.addLightDarkColors(d,null,null,function(y,z,E){return mxUtils.isLightDarkColor(E)?(E=mxUtils.getLightDarkColor(E),y.style.setProperty(z,E.light),!0):!1})&&f.cellLabelChanged(a[h],d.innerHTML))}if(e&&mxUtils.isLightDarkColor(f.background)){v=mxUtils.getLightDarkColor(f.background);var u=new ChangePageSetup(this,v.light);u.ignoreImage=!0;f.model.execute(u)}}finally{f.model.endUpdate()}return a};EditorUi.prototype.updateSelectionStateForCell=function(a,b,e,f){e=this.editor.graph;a.cells.push(b);if(e.getModel().isVertex(b)){a.connections=0<e.model.getEdgeCount(b);a.unlocked=a.unlocked&&!e.isCellLocked(b);a.resizable=a.resizable&&e.isCellResizable(b);a.rotatable=a.rotatable&&e.isCellRotatable(b);a.movable=a.movable&&e.isCellMovable(b)&&!e.isTableRow(b)&&!e.isTableCell(b);a.swimlane=a.swimlane||e.isSwimlane(b);a.table=a.table||e.isTable(b);a.cell=a.cell||e.isTableCell(b);a.row=a.row||e.isTableRow(b);a.vertices.push(b);var g=e.getCellGeometry(b);if(null!=g&&(0<g.width?null==a.width?a.width=g.width:a.width!=g.width&&(a.width=""):a.containsLabel=!0,0<g.height?null==a.height?a.height=g.height:a.height!=g.height&&(a.height=""):a.containsLabel=!0,!g.relative||null!=g.offset)){var d=g.relative?g.offset.x:g.x;g=g.relative?g.offset.y:g.y;null==a.x?a.x=d:a.x!=d&&(a.x="");null==a.y?a.y=g:a.y!=g&&(a.y="")}}else e.getModel().isEdge(b)&&(a.edges.push(b),a.connections=!0,a.resizable=!1,a.rotatable=!1,a.movable=!1);d=e.view.getState(b);null!=d&&(a.html=a.html&&e.isHtmlLabel(b),a.autoSize=a.autoSize||e.isAutoSizeState(d),a.glass=a.glass&&e.isGlassState(d),a.rounded=a.rounded&&e.isRoundedState(d),a.lineJumps=a.lineJumps&&e.isLineJumpState(d),a.image=a.image||e.isImageState(d),a.shadow=a.shadow&&e.isShadowState(d),a.fill=a.fill&&e.isFillState(d),a.gradient=a.fill&&e.isGradientState(d),a.stroke=a.stroke&&e.isStrokeState(d),b=mxUtils.getValue(d.style,mxConstants.STYLE_SHAPE,null),a.containsImage=a.containsImage||@@ -2166,31 +2166,33 @@ a.vertices.push(b);var g=e.getCellGeometry(b);if(null!=g&&(0<g.width?null==a.widEditorUi.prototype.installShapePicker=function(){var a=this.editor.graph,b=this;a.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,v){"mouseDown"==v.getProperty("eventName")&&b.hideShapePicker()}));var e=mxUtils.bind(this,function(){b.hideShapePicker(!0)});a.addListener("wheel",e);a.addListener(mxEvent.ESCAPE,e);a.view.addListener(mxEvent.SCALE,e);a.view.addListener(mxEvent.SCALE_AND_TRANSLATE,e);a.getSelectionModel().addListener(mxEvent.CHANGE,e);var f=a.popupMenuHandler.isMenuShowing;a.popupMenuHandler.isMenuShowing=function(){return f.apply(this,arguments)||null!=b.shapePicker||null!=b.currentMenu};var g=a.dblClick;a.dblClick=function(k,v){if(this.isEnabled())if(null!=v||null==b.sidebar||mxEvent.isShiftDown(k)||a.isCellLocked(a.getDefaultParent()))g.apply(this,arguments);else{var u=mxUtils.convertPoint(this.container,mxEvent.getClientX(k),mxEvent.getClientY(k));mxEvent.consume(k);window.setTimeout(mxUtils.bind(this,function(){b.showShapePicker(u.x,u.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,b.hideShapePicker(!0))}));var d=this.hoverIcons.drag;this.hoverIcons.drag=function(){b.hideShapePicker();d.apply(this,arguments)};var h=this.hoverIcons.execute;this.hoverIcons.execute=function(k,v,u){var y=u.getEvent();this.graph.isCloneEvent(y)||mxEvent.isShiftDown(y)?h.apply(this,arguments):this.graph.connectVertex(k.cell,v,this.graph.defaultEdgeLength,y,null,null,mxUtils.bind(this,-function(z,F,D){var G=a.getCompositeParent(k.cell);z=a.getCellGeometry(G);for(u.consume();null!=G&&a.model.isVertex(G)&&null!=z&&z.relative;)cell=G,G=a.model.getParent(cell),z=a.getCellGeometry(G);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=b.showShapePicker(u.getGraphX(),u.getGraphY(),G,mxUtils.bind(this,function(H){D(H);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(H))}),v)}),30)}),mxUtils.bind(this,function(z){this.graph.selectCellsForConnectVertex(z,y,this)}))};-var l=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(k,v){null!=l&&window.clearTimeout(l);l=window.setTimeout(mxUtils.bind(this,function(){var u=v.getProperty("arrow"),y=v.getProperty("direction"),z=v.getProperty("event");u=u.getBoundingClientRect();var F=mxUtils.getOffset(a.container),D=a.container.scrollLeft+u.x-F.x;F=a.container.scrollTop+u.y-F.y;var G=a.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),H=b.showShapePicker(D,F,G,-mxUtils.bind(this,function(M){null!=M&&a.connectVertex(G,y,a.defaultEdgeLength,z,!0,!1,function(N,L,U){U(M);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(M))},function(N){a.selectCellsForConnectVertex(N)},z,this.hoverIcons)}),y,!0);null!=H&&(this.centerShapePicker(H,u,D,F,y),this.hoverIcons.shapePickerHoverDiv=H,mxUtils.setOpacity(H,30),mxEvent.addListener(H,"mouseenter",function(){mxUtils.setOpacity(H,100)}),mxEvent.addListener(H,"mouseleave",function(){b.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));+function(z,E,D){var G=a.getCompositeParent(k.cell);z=a.getCellGeometry(G);for(u.consume();null!=G&&a.model.isVertex(G)&&null!=z&&z.relative;)cell=G,G=a.model.getParent(cell),z=a.getCellGeometry(G);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=b.showShapePicker(u.getGraphX(),u.getGraphY(),G,mxUtils.bind(this,function(H){D(H);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(H))}),v)}),30)}),mxUtils.bind(this,function(z){this.graph.selectCellsForConnectVertex(z,y,this)}))};+var l=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(k,v){null!=l&&window.clearTimeout(l);l=window.setTimeout(mxUtils.bind(this,function(){var u=v.getProperty("arrow"),y=v.getProperty("direction"),z=v.getProperty("event");u=u.getBoundingClientRect();var E=mxUtils.getOffset(a.container),D=a.container.scrollLeft+u.x-E.x;E=a.container.scrollTop+u.y-E.y;var G=a.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),H=b.showShapePicker(D,E,G,+mxUtils.bind(this,function(M){null!=M&&a.connectVertex(G,y,a.defaultEdgeLength,z,!0,!1,function(N,L,U){U(M);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(M))},function(N){a.selectCellsForConnectVertex(N)},z,this.hoverIcons)}),y,!0);null!=H&&(this.centerShapePicker(H,u,D,E,y),this.hoverIcons.shapePickerHoverDiv=H,mxUtils.setOpacity(H,30),mxEvent.addListener(H,"mouseenter",function(){mxUtils.setOpacity(H,100)}),mxEvent.addListener(H,"mouseleave",function(){b.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(k,v){null!=l&&window.clearTimeout(l)}))}var t=!1;a.addMouseListener({mouseDown:mxUtils.bind(this,function(k,v){t=!1}),mouseMove:mxUtils.bind(this,function(k,v){null!=a.connectHandleClickState&&null!=a.connectionHandler&&null!=a.connectionHandler.shape&&(t=!0)}),mouseUp:mxUtils.bind(this,function(k,v){k=a.connectHandleClickState;a.connectHandleClickState=null;if(null!=k&&!t){var u=v.getEvent();if(!a.isCloneEvent(u)&&!mxEvent.isShiftDown(u)){for(var y=-mxConstants.DIRECTION_EAST,z=a.getCompositeParent(k.cell),F=a.getCellGeometry(z);null!=z&&a.model.isVertex(z)&&null!=F&&F.relative;)z=a.model.getParent(z),F=a.getCellGeometry(z);a.connectVertex(k.cell,y,a.defaultEdgeLength,u,null,!0,mxUtils.bind(this,function(D,G,H){v.consume();window.setTimeout(mxUtils.bind(this,function(){b.showShapePicker(v.getGraphX(),v.getGraphY(),z,mxUtils.bind(this,function(M){H(M);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(M))}),y)}),30)}),mxUtils.bind(this,function(D){a.selectCellsForConnectVertex(D,+mxConstants.DIRECTION_EAST,z=a.getCompositeParent(k.cell),E=a.getCellGeometry(z);null!=z&&a.model.isVertex(z)&&null!=E&&E.relative;)z=a.model.getParent(z),E=a.getCellGeometry(z);a.connectVertex(k.cell,y,a.defaultEdgeLength,u,null,!0,mxUtils.bind(this,function(D,G,H){v.consume();window.setTimeout(mxUtils.bind(this,function(){b.showShapePicker(v.getGraphX(),v.getGraphY(),z,mxUtils.bind(this,function(M){H(M);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(M))}),y)}),30)}),mxUtils.bind(this,function(D){a.selectCellsForConnectVertex(D,u)}))}}t=!1})})};EditorUi.prototype.centerShapePicker=function(a,b,e,f,g){if(g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST)a.style.width="40px";var d=a.getBoundingClientRect();g==mxConstants.DIRECTION_NORTH?(e-=d.width/2-10,f-=d.height+6):g==mxConstants.DIRECTION_SOUTH?(e-=d.width/2-10,f+=b.height+6):g==mxConstants.DIRECTION_WEST?(e-=d.width+6,f-=d.height/2-10):g==mxConstants.DIRECTION_EAST&&(e+=b.width+6,f-=d.height/2-10);a.style.left=e+"px";a.style.top=f+"px"};EditorUi.prototype.showShapePicker=function(a,b,e,f,g,d,h,l,t){var k=null;this.editor.graph.freehand.isDrawing()||(l=l||null==e,k=this.createShapePicker(a,b,e,f,g,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(e,d,l),d,h,l,t),null!=k&&(null==this.hoverIcons||d||this.hoverIcons.reset(),a=this.editor.graph,a.popupMenuHandler.hideMenu(),a.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=f,this.shapePicker=k));return k};EditorUi.prototype.createShapePicker=function(a,b,e,f,g,d,h,l,t,k,v){v=null!=v?v:!0;var u=this.editor.graph,y=null;t=null!=t?t:function(D){D=D[0];var G=0,H=0,M=D.geometry;null!=M&&(u.model.isEdge(D)&&(D=M.getTerminalPoint(!1),M=new mxRectangle(0,0,D.x,D.y)),G=M.width/2,H=M.height/2);return new mxPoint(u.snap(Math.round(a/u.view.scale)-u.view.translate.x-G),u.snap(Math.round(b/u.view.scale)-u.view.translate.y-H))};if(null!=h&&0<h.length){var z=this;u=this.editor.graph;y=document.createElement("div");-g=u.view.getState(e);var F=null==e||null!=g&&u.isTransparentState(g)?null:u.copyStyle(e);y.className="geShapePicker";y.setAttribute("title",mxResources.get("sidebarTooltip"));y.style.left=Math.round(a)+"px";y.style.top=Math.round(b)+"px";mxClient.IS_POINTER&&(y.style.touchAction="none");l||mxUtils.setPrefixedStyle(y.style,"transform","translate(-22px,-22px)");u.container.appendChild(y);g=mxUtils.bind(this,function(D){var G=document.createElement("a");y.appendChild(G);null!=F&&"1"!=urlParams.sketch?-this.sidebar.graph.pasteStyle(F,[D]):this.sidebar.graph.pasteCellStyles([D],u.currentVertexStyle,u.currentEdgeStyle);var H=D.geometry;u.model.isEdge(D)&&(H=H.getTerminalPoint(!1),H=new mxRectangle(0,0,H.x,H.y));null!=H&&(H=this.sidebar.createVertexTemplateFromCells([D],H.width,H.height,"",!0,!1,null,!1,mxUtils.bind(this,function(M){if(!mxEvent.isAltDown(M)||1!=u.getSelectionCount()){if(!mxEvent.isShiftDown(M)||null==e&&u.isSelectionEmpty()){var N=u.cloneCell(D);if(null!=f)f(N);else{var L=t([N]);u.model.isEdge(N)?-N.geometry.translate(L.x,L.y):(N.geometry.x=L.x,N.geometry.y=L.y);u.model.beginUpdate();try{u.addCell(N),u.model.isVertex(N)&&u.isAutoSizeCell(N)&&u.updateCellSize(N)}finally{u.model.endUpdate()}u.setSelectionCell(N);u.scrollCellToVisible(N);v&&u.startEditing(N);null!=z.hoverIcons&&z.hoverIcons.update(u.view.getState(N))}}else N=u.getEditableCells(null!=e?[e]:u.getSelectionCells()),u.updateShapes(D,N);null!=d&&d(M);mxEvent.consume(M)}}),25,25,null,null,e),H.style.display="flex",H.style.alignItems=-"center",H.style.justifyContent="center",G.appendChild(H))});for(k=0;k<(l?Math.min(h.length,4):h.length);k++)g(h[k]);h=y.offsetTop+y.clientHeight-(u.container.scrollTop+u.container.offsetHeight);0<h&&(y.style.top=Math.max(u.container.scrollTop+22,b-h)+"px");h=y.offsetLeft+y.clientWidth-(u.container.scrollLeft+u.container.offsetWidth);0<h&&(y.style.left=Math.max(u.container.scrollLeft+22,a-h)+"px")}return y};-EditorUi.prototype.getCellsForShapePicker=function(a,b,e){var f=this.editor.graph,g=mxUtils.bind(this,function(d,h,l,t){return f.createVertex(null,null,t||"",0,0,h||120,l||60,d,!1)});b=mxUtils.bind(this,function(d,h,l){d=new mxCell(l||"",new mxGeometry(0,0,f.defaultEdgeLength+20,0),d);d.geometry.setTerminalPoint(new mxPoint(0,0),!0);d.geometry.setTerminalPoint(new mxPoint(d.geometry.width,null!=h?h:0),!1);d.geometry.points=null!=h?[new mxPoint(d.geometry.width/2,h)]:[];d.geometry.relative=!0;d.edge=-!0;return d});if(null!=a)try{a=f.cloneCell(a),f.model.isVertex(a)&&null!=a.geometry&&(a.geometry.x=0,a.geometry.y=0)}catch(d){a=null}null==a&&(a=g(f.appendFontSize(Editor.defaultTextStyle,f.vertexFontSize),60,30,"Text"));a=[a,g("whiteSpace=wrap;html=1;"),g("ellipse;whiteSpace=wrap;html=1;",80,80),g("rhombus;whiteSpace=wrap;html=1;",80,80),g("rounded=1;whiteSpace=wrap;html=1;"),g("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),g("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",-120,60),g("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),g("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),g("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),g("triangle;whiteSpace=wrap;html=1;",60,80),g("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),g("shape=tape;whiteSpace=wrap;html=1;",120,100),g("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),g("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",-80,60),g("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];e&&(a=a.concat([b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),b("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",-this.editor.graph.defaultEdgeLength/2)]));return a};EditorUi.prototype.isShapePickerVisible=function(a){return null!=this.shapePicker};EditorUi.prototype.hideShapePicker=function(a){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),a||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};-EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};+g=u.view.getState(e);var E=null==e||null!=g&&u.isTransparentState(g)?null:u.copyStyle(e);y.className="geShapePicker";y.setAttribute("title",mxResources.get("sidebarTooltip"));y.style.left=Math.round(a)+"px";y.style.top=Math.round(b)+"px";mxClient.IS_POINTER&&(y.style.touchAction="none");l||mxUtils.setPrefixedStyle(y.style,"transform","translate(-22px,-22px)");u.container.appendChild(y);g=mxUtils.bind(this,function(D){var G=document.createElement("a");y.appendChild(G);var H=D.shapePickerKeepStyle;+delete D.shapePickerKeepStyle;H||(null!=E&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(E,[D]):this.sidebar.graph.pasteCellStyles([D],u.currentVertexStyle,u.currentEdgeStyle));H=D.geometry;u.model.isEdge(D)&&(H=H.getTerminalPoint(!1),H=new mxRectangle(0,0,H.x,H.y));null!=H&&(H=this.sidebar.createVertexTemplateFromCells([D],H.width,H.height,"",!0,!1,null,!0,mxUtils.bind(this,function(M){if(!mxEvent.isAltDown(M)||1!=u.getSelectionCount()){if(!mxEvent.isShiftDown(M)||null==e&&u.isSelectionEmpty()){var N=+u.cloneCell(D);if(null!=f)f(N);else{var L=t([N]);u.model.isEdge(N)?N.geometry.translate(L.x,L.y):(N.geometry.x=L.x,N.geometry.y=L.y);u.model.beginUpdate();try{u.addCell(N),u.model.isVertex(N)&&u.isAutoSizeCell(N)&&u.updateCellSize(N)}finally{u.model.endUpdate()}u.setSelectionCell(N);u.scrollCellToVisible(N);v&&u.startEditing(N);null!=z.hoverIcons&&z.hoverIcons.update(u.view.getState(N))}}else N=u.getEditableCells(null!=e?[e]:u.getSelectionCells()),u.updateShapes(D,N);null!=d&&d(M);mxEvent.consume(M)}}),+25,25,null,null,e),H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="center",G.appendChild(H))});for(k=0;k<(l?Math.min(h.length,4):h.length);k++)g(h[k]);h=y.offsetTop+y.clientHeight-(u.container.scrollTop+u.container.offsetHeight);0<h&&(y.style.top=Math.max(u.container.scrollTop+22,b-h)+"px");h=y.offsetLeft+y.clientWidth-(u.container.scrollLeft+u.container.offsetWidth);0<h&&(y.style.left=Math.max(u.container.scrollLeft+22,a-h)+"px")}return y};+EditorUi.prototype.defaultShapePickerEntries=null;+EditorUi.prototype.getCellsForShapePicker=function(a,b,e){var f=this.editor.graph,g=mxUtils.bind(this,function(u,y,z,E){return f.createVertex(null,null,E||"",0,0,y||120,z||60,u,!1)});b=mxUtils.bind(this,function(u,y,z){u=new mxCell(z||"",new mxGeometry(0,0,f.defaultEdgeLength+20,0),u);u.geometry.setTerminalPoint(new mxPoint(0,0),!0);u.geometry.setTerminalPoint(new mxPoint(u.geometry.width,null!=y?y:0),!1);u.geometry.points=null!=y?[new mxPoint(u.geometry.width/2,y)]:[];u.geometry.relative=!0;u.edge=+!0;return u});if(null!=a)try{a=f.cloneCell(a),f.model.isVertex(a)&&null!=a.geometry&&(a.geometry.x=0,a.geometry.y=0)}catch(u){a=null}if(null!=this.defaultShapePickerEntries){for(var d=[],h=[],l=function(u){if(null!=u&&"object"===typeof u){var y=mxUtils.createXmlDocument().createElement("UserObject"),z;for(z in u)u.hasOwnProperty(z)&&y.setAttribute(z,u[z]);null==y.getAttribute("label")&&y.setAttribute("label","");return y}return u},t=0;t<this.defaultShapePickerEntries.length;t++){var k=this.defaultShapePickerEntries[t];+if(null!=k.style){var v=l(k.value);k.edge?h.push(b(k.style,k.y,v)):(v=g(k.style,k.width,k.height,v),k.keepStyle&&(v.shapePickerKeepStyle=!0),d.push(v))}}null!=a&&(d[0]=a);a=d;e&&(a=a.concat(h));return a}null==a&&(a=g(f.appendFontSize(Editor.defaultTextStyle,f.vertexFontSize),60,30,"Text"));a=[a,g("whiteSpace=wrap;html=1;"),g("ellipse;whiteSpace=wrap;html=1;",80,80),g("rhombus;whiteSpace=wrap;html=1;",80,80),g("rounded=1;whiteSpace=wrap;html=1;"),g("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),+g("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),g("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),g("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),g("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),g("triangle;whiteSpace=wrap;html=1;",60,80),g("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),g("shape=tape;whiteSpace=wrap;html=1;",120,100),g("ellipse;shape=cloud;whiteSpace=wrap;html=1;",+120,80),g("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),g("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];e&&(a=a.concat([b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),+b("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return a};EditorUi.prototype.isShapePickerVisible=function(a){return null!=this.shapePicker};+EditorUi.prototype.hideShapePicker=function(a){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),a||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};EditorUi.prototype.onKeyDown=function(a){var b=this.editor.graph;if(9==a.which&&b.isEnabled()&&!mxEvent.isControlDown(a)){if(b.isEditing())if(mxEvent.isAltDown(a))b.stopEditing(!1);else try{var e=b.cellEditor.isContentEditing()&&b.cellEditor.isTextSelected();if(window.getSelection&&b.cellEditor.isContentEditing()&&!e&&!mxClient.IS_IE&&!mxClient.IS_IE11){var f=window.getSelection(),g=0<f.rangeCount?f.getRangeAt(0).commonAncestorContainer:null;e=null!=g&&("LI"==g.nodeName||null!=g.parentNode&&"LI"==g.parentNode.nodeName)}e?document.execCommand(mxEvent.isShiftDown(a)?"outdent":"indent",!1,null):mxEvent.isShiftDown(a)?b.stopEditing(!1):b.cellEditor.insertTab(b.cellEditor.isContentEditing()?null:4)}catch(d){}else mxEvent.isAltDown(a)?b.selectParentCell():b.selectCell(!mxEvent.isShiftDown(a));mxEvent.consume(a)}};EditorUi.prototype.onKeyPress=function(a){var b=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(a)===this.typingShim||!this.isImmediateEditingEvent(a)||b.isEditing()||b.isSelectionEmpty()||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(null==a.key||1!==a.key.length)&&229!==a.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(a)||(b.escape(),b.cellEditor.editByTyping=!0,b.startEditing())};-EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";this.typingShim=b;var e=!1,f=mxUtils.bind(this,-function(){if(!e&&0<b.value.length){var d=b.value;b.value="";this.hideTypingShim();a.escape();a.cellEditor.editByTyping=!0;a.startEditing(null,d)}});mxEvent.addListener(b,"compositionstart",function(){e=!0});mxEvent.addListener(b,"compositionend",function(){e=!1;f()});mxEvent.addListener(b,"input",function(){f()});mxEvent.addListener(b,"keydown",mxUtils.bind(this,function(d){229!==d.keyCode&&(mxEvent.isControlDown(d)||mxEvent.isMetaDown(d)||(null==d.key||1!==d.key.length||mxEvent.isAltDown(d)?d.preventDefault():-null!=this.keyHandler&&null!=this.keyHandler.getFunction(d)&&d.preventDefault()))}));a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));a.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));a.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));-if(null==a.container.tabIndex||0>a.container.tabIndex)a.container.tabIndex=-1;mxEvent.addListener(a.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var g=a.cellEditor.focusContainer;a.cellEditor.focusContainer=mxUtils.bind(this,function(){a.isSelectionEmpty()||a.isEditing()?g.apply(a.cellEditor):this.updateTypingShim()})};+EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&b.setAttribute("inputmode","none");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";+this.typingShim=b;var e=!1,f=mxUtils.bind(this,function(){if(!e&&0<b.value.length){var d=b.value;b.value="";this.hideTypingShim();a.escape();a.cellEditor.editByTyping=!0;a.startEditing(null,d)}});mxEvent.addListener(b,"compositionstart",function(){e=!0});mxEvent.addListener(b,"compositionend",function(){e=!1;f()});mxEvent.addListener(b,"input",function(){f()});mxEvent.addListener(b,"keydown",mxUtils.bind(this,function(d){229!==d.keyCode&&(mxEvent.isControlDown(d)||mxEvent.isMetaDown(d)||(null==d.key||+1!==d.key.length||mxEvent.isAltDown(d)?d.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(d)&&d.preventDefault()))}));a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));a.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));a.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,+function(){this.updateTypingShim()}),0)}));if(null==a.container.tabIndex||0>a.container.tabIndex)a.container.tabIndex=-1;mxEvent.addListener(a.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var g=a.cellEditor.focusContainer;a.cellEditor.focusContainer=mxUtils.bind(this,function(){a.isSelectionEmpty()||a.isEditing()?g.apply(a.cellEditor):this.updateTypingShim()})};EditorUi.prototype.updateTypingShim=function(){var a=this.editor.graph;a.isEditing()||a.isSelectionEmpty()||!a.isEnabled()||a.isCellLocked(a.getSelectionCell())?this.hideTypingShim():this.showTypingShim()};EditorUi.prototype.showTypingShim=function(){var a=this.editor.graph,b=this.typingShim;if(null!=b&&!a.isEditing()){var e=a.getSelectionCell();e=a.getView().getState(e);null!=e&&(b.style.left=Math.round(e.x)+"px",b.style.top=Math.round(e.y)+"px",b.parentNode!==a.container&&a.container.appendChild(b),b.value="",e=document.activeElement,(null==e||e===document.body||e===a.container||a.container.contains(e))&&b.focus({preventScroll:!0}))}};EditorUi.prototype.hideTypingShim=function(){var a=this.typingShim;null!=a&&null!=a.parentNode&&a.parentNode.removeChild(a)};EditorUi.prototype.isImmediateEditingEvent=function(a){return!0};EditorUi.prototype.updateCssForMarker=function(a,b,e,f,g){e=this.getImageForMarker(f,g,e);a.innerHTML="";null==e?a.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(f=document.createElement("img"),f.setAttribute("src",e),"end"==b&&mxUtils.setPrefixedStyle(f.style,"transform","scaleX(-1)"),a.appendChild(f))};@@ -2203,7 +2205,7 @@ EditorUi.prototype.getImageForEdgeStyle=function(a){var b=Format.orthogonalImagenull)?Format.verticalElbowImage.src:Format.horizontalElbowImage.src:"isometricEdgeStyle"==e&&(b="vertical"==mxUtils.getValue(a,mxConstants.STYLE_ELBOW,null)?Format.verticalIsometricImage.src:Format.horizontalIsometricImage.src);return b};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b=this.actions.get("paste"),e=this.actions.get("pasteHere");b.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(null!=navigator.clipboard||!mxClipboard.isEmpty())&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));e.setEnabled(b.isEnabled())};EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(d){d.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};mxClipboard.copy=function(d){var h=null;if(d.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{h=h||d.getSelectionCells();h=d.getExportableCells(d.model.getTopmostCells(h));for(var l={},t=d.createCellLookup(h),k=d.cloneCells(h,null,l),v=new mxGraphModel,u=v.getChildAt(v.getRoot(),-0),y=0;y<k.length;y++){v.add(u,k[y]);var z=d.view.getState(h[y]);if(null!=z){var F=d.getCellGeometry(k[y]);null!=F&&F.relative&&!v.isEdge(h[y])&&null==t[mxObjectIdentity.get(v.getParent(h[y]))]&&(F.offset=null,F.relative=!1,F.x=z.x/z.view.scale-z.view.translate.x,F.y=z.y/z.view.scale-z.view.translate.y)}}d.updateCustomLinks(d.createCellMapping(l,t),k);mxClipboard.insertCount=1;mxClipboard.setCells(k)}a.updatePasteActionStates();return h};var e=mxClipboard.paste;mxClipboard.paste=function(d){var h=+0),y=0;y<k.length;y++){v.add(u,k[y]);var z=d.view.getState(h[y]);if(null!=z){var E=d.getCellGeometry(k[y]);null!=E&&E.relative&&!v.isEdge(h[y])&&null==t[mxObjectIdentity.get(v.getParent(h[y]))]&&(E.offset=null,E.relative=!1,E.x=z.x/z.view.scale-z.view.translate.x,E.y=z.y/z.view.scale-z.view.translate.y)}}d.updateCustomLinks(d.createCellMapping(l,t),k);mxClipboard.insertCount=1;mxClipboard.setCells(k)}a.updatePasteActionStates();return h};var e=mxClipboard.paste;mxClipboard.paste=function(d){var h=null;d.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):h=e.apply(this,arguments);a.updatePasteActionStates();return h};var f=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){f.apply(this,arguments);a.updatePasteActionStates()};var g=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(d,h){g.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var da=this.graph.getPageLayout(),ia=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+da.x*ia.width),this.scale*(this.translate.y+da.y*ia.height),this.scale*da.width*@@ -2219,8 +2221,8 @@ mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appe": "+this.currentPage.getName());t.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(da-1,this.pages.length)].getName());v.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(da+1,this.pages.length)].getName())}});t.style.paddingLeft="0px";t.style.paddingRight="4px";v.style.paddingLeft="4px";v.style.paddingRight="0px";var y=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(v.style.display="",t.style.display="",k.style.display="inline-block"):(v.style.display="none",t.style.display="none",k.style.display="none");u()});if(null!=this.menus){var z=this.menus.get("pages");null!=z&&mxEvent.addListener(k,"click",mxUtils.bind(this,function(da){var ia=new mxPopupMenu(z.funct);ia.smartSeparators=!0;ia.showDisabled=!0;ia.autoExpand=!0;ia.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(ia,arguments);ia.destroy()});var fa=mxUtils.getOffset(k);ia.popup(fa.x,fa.y+k.offsetHeight,null,da);mxEvent.addListener(ia.div,"mouseleave",mxUtils.bind(this,function(){ia.hideMenu()}))}))}this.editor.addListener("resetGraphView",y);this.editor.addListener("pageSelected",u)}d(mxUtils.bind(this,function(da){this.actions.get("zoomOut").funct();mxEvent.consume(da)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");d(mxUtils.bind(this,function(da){this.actions.get("zoomIn").funct();mxEvent.consume(da)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");d(mxUtils.bind(this,-function(da){this.actions.get("smartFit").funct();mxEvent.consume(da)}),Editor.zoomFitImage,mxResources.get("fit"));var F=null,D=null,G=mxUtils.bind(this,function(da){null!=F&&(window.clearTimeout(F),F=null);null!=D&&(window.clearTimeout(D),D=null);F=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);F=null;D=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";D=null}),600)}),da||200)}),H=mxUtils.bind(this,function(da){null!=-F&&(window.clearTimeout(F),F=null);null!=D&&(window.clearTimeout(D),D=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,da||30)});if("1"==urlParams.layers){this.layersDialog=null;var M=d(mxUtils.bind(this,function(da){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&this.chromelessResize()}),!0);mxEvent.addListener(this.layersDialog,+function(da){this.actions.get("smartFit").funct();mxEvent.consume(da)}),Editor.zoomFitImage,mxResources.get("fit"));var E=null,D=null,G=mxUtils.bind(this,function(da){null!=E&&(window.clearTimeout(E),E=null);null!=D&&(window.clearTimeout(D),D=null);E=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);E=null;D=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";D=null}),600)}),da||200)}),H=mxUtils.bind(this,function(da){null!=+E&&(window.clearTimeout(E),E=null);null!=D&&(window.clearTimeout(D),D=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,da||30)});if("1"==urlParams.layers){this.layersDialog=null;var M=d(mxUtils.bind(this,function(da){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.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 ia=M.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=ia.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));ia=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=ia.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(da)}),Editor.layersImage,mxResources.get("layers")),N=a.getModel();N.addListener(mxEvent.CHANGE,function(){M.style.display=1<N.getChildCount(N.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(d);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||d(mxUtils.bind(this,function(da){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"==this.editor.editButtonLink){var ia=null!=this.currentPage?this.currentPage.getId():@@ -2320,19 +2322,19 @@ EditorUi.prototype.showDataDialog=function(a){null!=a&&"undefined"!==typeof windEditorUi.prototype.showBackgroundImageDialog=function(a,b){a=null!=a?a:mxUtils.bind(this,function(f){f=new ChangePageSetup(this,null,f);f.ignoreColor=!0;this.editor.graph.model.execute(f)});var e=mxUtils.prompt(mxResources.get("backgroundImage"),null!=b?b.src:"");null!=e&&0<e.length?(b=new Image,b.onload=function(){a(new mxImage(e,b.width,b.height),!1)},b.onerror=function(){a(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},b.src=e):a(null)};EditorUi.prototype.setBackgroundImage=function(a){this.editor.graph.setBackgroundImage(a);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(a,b,e){mxUtils.confirm(a)?null!=b&&b():null!=e&&e()};EditorUi.prototype.createOutline=function(a){var b=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){b.update(!1)});return b};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",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};-EditorUi.prototype.createKeyHandler=function(a){function b(u,y,z){if(!f.isSelectionEmpty()&&f.isEnabled()){y=null!=y?y:1;var F=f.getCompositeParents(f.getSelectionCells()),D=0<F.length?F[0]:null;if(null!=D)if(z){f.getModel().beginUpdate();try{for(D=0;D<F.length;D++)if(f.getModel().isVertex(F[D])&&f.isCellResizable(F[D])){var G=f.getCellGeometry(F[D]);null!=G&&(G=G.clone(),37==u?G.width=Math.max(0,G.width-y):38==u?G.height=Math.max(0,G.height-y):39==u?G.width+=y:40==u&&(G.height+=y),f.getModel().setGeometry(F[D],-G))}}finally{f.getModel().endUpdate()}}else{G=f.model.getParent(D);var H=f.getView().scale;z=null;1==f.getSelectionCount()&&f.model.isVertex(D)&&null!=f.layoutManager&&!f.isCellLocked(D)&&(z=f.layoutManager.getLayout(G));if(null!=z&&z.constructor==mxStackLayout)y=G.getIndex(D),37==u||38==u?f.model.add(G,D,Math.max(0,y-1)):(39==u||40==u)&&f.model.add(G,D,Math.min(f.model.getChildCount(G),y+1));else{var M=f.graphHandler;null!=M&&(null==M.first&&M.start(D,0,0,f.getMovableCells(F)),null!=M.first&&(D=-F=0,37==u?F=-y:38==u?D=-y:39==u?F=y:40==u&&(D=y),M.currentDx+=F*H,M.currentDy+=D*H,M.checkPreview(),M.updatePreview()),null!=h&&window.clearTimeout(h),h=window.setTimeout(function(){if(null!=M.first){var N=M.roundLength(M.currentDx/H),L=M.roundLength(M.currentDy/H);M.moveCells(M.cells,N,L);M.reset()}},400))}}}}var e=this,f=this.editor.graph,g=new mxKeyHandler(f),d=g.isEventIgnored;g.isEventIgnored=function(u){return!(mxEvent.isShiftDown(u)&&9==u.keyCode)&&(!this.isControlDown(u)||mxEvent.isShiftDown(u)||-90!=u.keyCode&&89!=u.keyCode&&188!=u.keyCode&&190!=u.keyCode&&85!=u.keyCode&&83!=u.keyCode)&&(66!=u.keyCode&&73!=u.keyCode||!this.isControlDown(u)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=u.keyCode&&107!=u.keyCode||!this.isControlDown(u)&&!mxEvent.isShiftDown(u)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&d.apply(this,arguments)};g.isEnabledForEvent=function(u){return!mxEvent.isConsumed(u)&&this.isGraphEvent(u)&&this.isEnabled()&&-(null==e.dialogs||0==e.dialogs.length)};g.isControlDown=function(u){return mxEvent.isControlDown(u)||mxClient.IS_MAC&&u.metaKey};var h=null,l={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},t=g.getFunction;mxKeyHandler.prototype.getFunction=function(u){if(f.isEnabled()){var y=null;mxEvent.isShiftDown(u)&&this.isControlDown(u)&&mxEvent.isAltDown(u)?y=e.actions.get(e.ctrlAltShiftActions[u.keyCode]):mxEvent.isShiftDown(u)&&mxEvent.isAltDown(u)?-y=e.actions.get(e.altShiftActions[u.keyCode]):this.isControlDown(u)&&mxEvent.isAltDown(u)&&(y=e.actions.get(e.ctrlAltActions[u.keyCode]));if(null!=y)return y.funct;if("/"==u.key&&!this.isControlDown(u)&&!mxEvent.isAltDown(u))return function(){var z=document.getElementById("geOmniSearch");null!=z&&30<z.clientWidth&&z.focus()};if(null!=l[u.keyCode]&&!f.isSelectionEmpty())if(!this.isControlDown(u)&&mxEvent.isShiftDown(u)&&mxEvent.isAltDown(u)){if(f.model.isVertex(f.getSelectionCell()))return function(){var z=-f.connectVertex(f.getSelectionCell(),l[u.keyCode],f.defaultEdgeLength,u,!0);null!=z&&0<z.length&&(1==z.length&&f.model.isEdge(z[0])?f.setSelectionCell(f.model.getTerminal(z[0],!1)):f.setSelectionCell(z[z.length-1]),f.scrollCellToVisible(f.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(f.view.getState(f.getSelectionCell())))}}else return this.isControlDown(u)?function(){b(u.keyCode,mxEvent.isShiftDown(u)?f.gridSize:null,!0)}:function(){b(u.keyCode,mxEvent.isShiftDown(u)?f.gridSize:null)}}return t.apply(this,-arguments)};g.bindAction=mxUtils.bind(this,function(u,y,z,F){var D=this.actions.get(z);null!=D&&(z=function(){D.isEnabled()&&D.funct.apply(this,arguments)},y?F?g.bindControlShiftKey(u,z):g.bindControlKey(u,z):F?g.bindShiftKey(u,z):g.bindKey(u,z))});var k=this,v=g.escape;g.escape=function(u){v.apply(this,arguments)};g.enter=function(){};g.bindControlShiftKey(36,function(){f.exitGroup()});g.bindControlShiftKey(35,function(){f.enterGroup()});g.bindShiftKey(36,function(){f.home()});g.bindKey(35,function(){f.refresh()});-g.bindAction(80,!0,"print");g.bindAction(107,!0,"zoomIn");g.bindAction(109,!0,"zoomOut");g.bindAction(61,!0,"zoomIn");g.bindAction(187,!0,"zoomIn");g.bindAction(222,!0,"zoomIn");g.bindAction(173,!0,"zoomOut");g.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)g.bindAction(79,!0,"outline",!0),g.bindControlKey(36,function(){f.isEnabled()&&f.foldCells(!0)}),g.bindControlKey(35,function(){f.isEnabled()&&f.foldCells(!1)}),g.bindControlKey(13,function(){k.ctrlEnter()}),g.bindAction(8,-!1,"delete"),g.bindAction(8,!0,"deleteAll"),g.bindAction(8,!1,"deleteLabels",!0),g.bindAction(46,!1,"delete"),g.bindAction(46,!0,"deleteAll"),g.bindAction(46,!1,"deleteLabels",!0),g.bindAction(36,!1,"resetView"),g.bindAction(72,!0,"fitWindow",!0),g.bindAction(74,!0,"fitPage"),g.bindAction(74,!0,"fitTwoPages",!0),g.bindAction(48,!0,"customZoom"),g.bindAction(82,!0,"turn"),g.bindAction(82,!0,"clearDefaultStyle",!0),g.bindAction(83,!0,"save"),g.bindAction(83,!0,"saveAs",!0),g.bindAction(65,!0,"selectAll"),-g.bindAction(65,!0,"selectNone",!0),"1"!=urlParams.dev&&g.bindAction(73,!0,"selectVertices",!0),g.bindAction(69,!0,"selectEdges",!0),g.bindAction(69,!0,"editStyle"),g.bindAction(66,!0,"bold"),g.bindAction(66,!0,"toBack",!0),g.bindAction(70,!0,"toFront",!0),g.bindAction(68,!0,"duplicate"),g.bindAction(68,!0,"setAsDefaultStyle",!0),g.bindAction(90,!0,"undo"),g.bindAction(90,!0,"redo",!0),g.bindAction(89,!0,"redo"),g.bindAction(89,!0,"autosize",!0),g.bindAction(88,!0,"cut"),g.bindAction(67,!0,"copy"),-g.bindAction(86,!0,"paste"),g.bindAction(71,!0,"group"),g.bindAction(77,!0,"editData"),g.bindAction(71,!0,"grid",!0),g.bindAction(73,!0,"italic"),g.bindAction(76,!0,"lockUnlock"),g.bindAction(76,!0,"layers",!0),g.bindAction(80,!0,"format",!0),g.bindAction(85,!0,"underline"),g.bindAction(85,!0,"ungroup",!0),g.bindAction(109,!0,"decreaseFontSize",!0),g.bindAction(107,!0,"increaseFontSize",!0),g.bindAction(219,!0,"decreaseFontSize",!0),g.bindAction(221,!0,"increaseFontSize",!0),g.bindAction(190,!0,"superscript"),-g.bindAction(188,!0,"subscript"),g.bindAction(13,!1,"keyPressEnter"),g.bindKey(113,function(){f.isEnabled()&&f.startEditingAtCell()});return g};EditorUi.prototype.createMenuElement=function(a,b,e){var f=document.createElement("a");this.addMenuHandler(f,b,e);mxUtils.write(f,a);f.className="geItem";return f};+EditorUi.prototype.createKeyHandler=function(a){function b(u,y,z){if(!f.isSelectionEmpty()&&f.isEnabled()){y=null!=y?y:1;var E=f.getCompositeParents(f.getSelectionCells()),D=0<E.length?E[0]:null;if(null!=D)if(z){f.getModel().beginUpdate();try{for(D=0;D<E.length;D++)if(f.getModel().isVertex(E[D])&&f.isCellResizable(E[D])){var G=f.getCellGeometry(E[D]);null!=G&&(G=G.clone(),37==u?G.width=Math.max(0,G.width-y):38==u?G.height=Math.max(0,G.height-y):39==u?G.width+=y:40==u&&(G.height+=y),f.getModel().setGeometry(E[D],+G))}}finally{f.getModel().endUpdate()}}else{G=f.model.getParent(D);var H=f.getView().scale;z=null;1==f.getSelectionCount()&&f.model.isVertex(D)&&null!=f.layoutManager&&!f.isCellLocked(D)&&(z=f.layoutManager.getLayout(G));if(null!=z&&z.constructor==mxStackLayout)y=G.getIndex(D),37==u||38==u?f.model.add(G,D,Math.max(0,y-1)):(39==u||40==u)&&f.model.add(G,D,Math.min(f.model.getChildCount(G),y+1));else{var M=f.graphHandler;null!=M&&(null==M.first&&M.start(D,0,0,f.getMovableCells(E)),null!=M.first&&(D=+E=0,37==u?E=-y:38==u?D=-y:39==u?E=y:40==u&&(D=y),M.currentDx+=E*H,M.currentDy+=D*H,M.checkPreview(),M.updatePreview()),null!=h&&window.clearTimeout(h),h=window.setTimeout(function(){if(null!=M.first){var N=M.roundLength(M.currentDx/H),L=M.roundLength(M.currentDy/H);M.moveCells(M.cells,N,L);M.reset()}},400))}}}}var e=this,f=this.editor.graph,g=new mxKeyHandler(f),d=g.isEventIgnored;g.isEventIgnored=function(u){return 188==u.keyCode&&this.isControlDown(u)&&!this.graph.cellEditor.isContentEditing()?+!0:!(mxEvent.isShiftDown(u)&&9==u.keyCode)&&(!this.isControlDown(u)||mxEvent.isShiftDown(u)||90!=u.keyCode&&89!=u.keyCode&&188!=u.keyCode&&190!=u.keyCode&&85!=u.keyCode&&83!=u.keyCode)&&(66!=u.keyCode&&73!=u.keyCode||!this.isControlDown(u)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=u.keyCode&&107!=u.keyCode||!this.isControlDown(u)&&!mxEvent.isShiftDown(u)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&d.apply(this,arguments)};+g.isEnabledForEvent=function(u){return!mxEvent.isConsumed(u)&&this.isGraphEvent(u)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};g.isControlDown=function(u){return mxEvent.isControlDown(u)||mxClient.IS_MAC&&u.metaKey};var h=null,l={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},t=g.getFunction;mxKeyHandler.prototype.getFunction=function(u){if(f.isEnabled()){var y=null;mxEvent.isShiftDown(u)&&this.isControlDown(u)&&+mxEvent.isAltDown(u)?y=e.actions.get(e.ctrlAltShiftActions[u.keyCode]):mxEvent.isShiftDown(u)&&mxEvent.isAltDown(u)?y=e.actions.get(e.altShiftActions[u.keyCode]):this.isControlDown(u)&&mxEvent.isAltDown(u)&&(y=e.actions.get(e.ctrlAltActions[u.keyCode]));if(null!=y)return y.funct;if("/"==u.key&&!this.isControlDown(u)&&!mxEvent.isAltDown(u))return function(){var z=document.getElementById("geOmniSearch");null!=z&&30<z.clientWidth&&z.focus()};if(null!=l[u.keyCode]&&!f.isSelectionEmpty())if(!this.isControlDown(u)&&+mxEvent.isShiftDown(u)&&mxEvent.isAltDown(u)){if(f.model.isVertex(f.getSelectionCell()))return function(){var z=f.connectVertex(f.getSelectionCell(),l[u.keyCode],f.defaultEdgeLength,u,!0);null!=z&&0<z.length&&(1==z.length&&f.model.isEdge(z[0])?f.setSelectionCell(f.model.getTerminal(z[0],!1)):f.setSelectionCell(z[z.length-1]),f.scrollCellToVisible(f.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(f.view.getState(f.getSelectionCell())))}}else return this.isControlDown(u)?function(){b(u.keyCode,+mxEvent.isShiftDown(u)?f.gridSize:null,!0)}:function(){b(u.keyCode,mxEvent.isShiftDown(u)?f.gridSize:null)}}return t.apply(this,arguments)};g.bindAction=mxUtils.bind(this,function(u,y,z,E){var D=this.actions.get(z);null!=D&&(z=function(){D.isEnabled()&&D.funct.apply(this,arguments)},y?E?g.bindControlShiftKey(u,z):g.bindControlKey(u,z):E?g.bindShiftKey(u,z):g.bindKey(u,z))});var k=this,v=g.escape;g.escape=function(u){v.apply(this,arguments)};g.enter=function(){};g.bindControlShiftKey(36,function(){f.exitGroup()});+g.bindControlShiftKey(35,function(){f.enterGroup()});g.bindShiftKey(36,function(){f.home()});g.bindKey(35,function(){f.refresh()});g.bindAction(80,!0,"print");g.bindAction(107,!0,"zoomIn");g.bindAction(109,!0,"zoomOut");g.bindAction(61,!0,"zoomIn");g.bindAction(187,!0,"zoomIn");g.bindAction(222,!0,"zoomIn");g.bindAction(173,!0,"zoomOut");g.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)g.bindAction(79,!0,"outline",!0),g.bindControlKey(36,function(){f.isEnabled()&&f.foldCells(!0)}),+g.bindControlKey(35,function(){f.isEnabled()&&f.foldCells(!1)}),g.bindControlKey(13,function(){k.ctrlEnter()}),g.bindAction(8,!1,"delete"),g.bindAction(8,!0,"deleteAll"),g.bindAction(8,!1,"deleteLabels",!0),g.bindAction(46,!1,"delete"),g.bindAction(46,!0,"deleteAll"),g.bindAction(46,!1,"deleteLabels",!0),g.bindAction(36,!1,"resetView"),g.bindAction(72,!0,"fitWindow",!0),g.bindAction(74,!0,"fitPage"),g.bindAction(74,!0,"fitTwoPages",!0),g.bindAction(48,!0,"customZoom"),g.bindAction(82,!0,"turn"),g.bindAction(82,+!0,"clearDefaultStyle",!0),g.bindAction(83,!0,"save"),g.bindAction(83,!0,"saveAs",!0),g.bindAction(65,!0,"selectAll"),g.bindAction(65,!0,"selectNone",!0),"1"!=urlParams.dev&&g.bindAction(73,!0,"selectVertices",!0),g.bindAction(69,!0,"selectEdges",!0),g.bindAction(69,!0,"editStyle"),g.bindAction(66,!0,"bold"),g.bindAction(66,!0,"toBack",!0),g.bindAction(70,!0,"toFront",!0),g.bindAction(68,!0,"duplicate"),g.bindAction(68,!0,"setAsDefaultStyle",!0),g.bindAction(90,!0,"undo"),g.bindAction(90,!0,"redo",+!0),g.bindAction(89,!0,"redo"),g.bindAction(89,!0,"autosize",!0),g.bindAction(88,!0,"cut"),g.bindAction(67,!0,"copy"),g.bindAction(86,!0,"paste"),g.bindAction(71,!0,"group"),g.bindAction(77,!0,"editData"),g.bindAction(71,!0,"grid",!0),g.bindAction(73,!0,"italic"),g.bindAction(76,!0,"lockUnlock"),g.bindAction(76,!0,"layers",!0),g.bindAction(80,!0,"format",!0),g.bindAction(85,!0,"underline"),g.bindAction(85,!0,"ungroup",!0),g.bindAction(109,!0,"decreaseFontSize",!0),g.bindAction(107,!0,"increaseFontSize",+!0),g.bindAction(219,!0,"decreaseFontSize",!0),g.bindAction(221,!0,"increaseFontSize",!0),g.bindAction(190,!0,"superscript"),g.bindAction(188,!0,"subscript"),g.bindAction(13,!1,"keyPressEnter"),g.bindKey(113,function(){f.isEnabled()&&f.startEditingAtCell()});return g};EditorUi.prototype.createMenuElement=function(a,b,e){var f=document.createElement("a");this.addMenuHandler(f,b,e);mxUtils.write(f,a);f.className="geItem";return f};EditorUi.prototype.addMenuHandler=function(a,b,e,f){if(null!=b){var g=null,d=!0,h=mxUtils.bind(this,function(l){null!=e&&e(l);if(!mxEvent.isConsumed(l)&&d&&(null==a.enabled||a.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var t=new mxPopupMenu(b);t.smartSeparators=!0;t.showDisabled=!0;t.autoExpand=!0;t.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(t,arguments);this.resetCurrentMenu();g=null;t.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();var k=mxUtils.getOffset(a);t.popup(k.x,k.y+a.offsetHeight,null,l);this.setCurrentMenu(t,a);g=t}f||mxEvent.consume(l)});mxEvent.addListener(a,"mousemove",mxUtils.bind(this,function(l){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=a&&null!=this.currentMenuElt){var t=this.currentMenuElt;this.hideCurrentMenu();t.parentNode==a.parentNode&&"INPUT"!=a.nodeName&&h(l)}}));mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(l){!this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=a&&mxEvent.isMouseEvent(l)&&this.hideCurrentMenu();d=null==this.currentMenu;"INPUT"!=mxEvent.getSource(l).nodeName?l.preventDefault():l.stopPropagation()}));mxEvent.addListener(a,"click",mxUtils.bind(this,function(l){h(l);d=!0}));f&&(mxEvent.addListener(a,"focus",mxUtils.bind(this,function(l){h(l);d=!0})),mxEvent.addListener(a,"blur",mxUtils.bind(this,function(l){this.currentMenu==g&&this.hideCurrentMenu()})),mxEvent.addListener(a,"keyup",mxUtils.bind(this,@@ -2388,10 +2390,10 @@ Sidebar.prototype.cloneCell=function(a,b){a=a.clone();null!=b&&(a.value=b);returSidebar.prototype.addSearchPalette=function(a){function b(R,Z){D=Z;R=R.firstChild.nextSibling.nextSibling;Z=document.createElement("span");Z.style.color="gray";Z.innerHTML="Enter";R.appendChild(Z)}function e(){k.setAttribute("src",Editor.magnifyImage);k.setAttribute("title",mxResources.get("search"));G.style.display="none";M=t.value="";V()}var f=this.editorUi,g=f.editor.graph,d=document.createElement("div");d.style.visibility="hidden";this.appendChild(d);var h=document.createElement("div");h.className="geSidebar geSearchSidebar";a||(h.style.display="none");var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";var t=document.createElement("input");t.setAttribute("id","geOmniSearch");t.setAttribute("placeholder",mxResources.get("typeSlashToSearch"));t.setAttribute("type","text");l.appendChild(t);var k=document.createElement("img");k.setAttribute("src",Editor.magnifyImage);k.setAttribute("title",mxResources.get("search"));k.className="geAdaptiveAsset";l.appendChild(k);h.appendChild(l);var v=!1;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(R){v=!1;mxClient.IS_TOUCH||mxEvent.getSource(R)!=t||document.activeElement==t||(t.focus(),mxClient.IS_GC||mxClient.IS_FF?t.select():document.execCommand("selectAll",!1,null),v=!0)}),mxUtils.bind(this,function(R){mxEvent.getSource(R)==t&&v&&mxEvent.consume(R)}),mxUtils.bind(this,function(R){v&&(mxEvent.consume(R),v=!1)}));var u=[],y=mxUtils.bind(this,function(R,Z){f.hideCurrentMenu();-mxUtils.remove(R,u);u.unshift(R);5<u.length&&u.pop();R.funct.apply(this,Z);t.value=null}),z="about deleteAll showBoundingBox createSidebarEntry downloadDesktop toggleGoogleFonts".split(" "),F=mxUtils.bind(this,function(R){var Z=null,W;for(W in f.actions.actions){var ba=0>z.indexOf(W)&&"test"!=W.substring(0,4)?f.actions.get(W):null;if(null!=ba&&ba.isEnabled()&&ba.visible){if(W.toLowerCase()==R)return ba;for(var K=R.toLowerCase().split(" "),T=0,aa=0;aa<K.length;aa++)0==K[aa].length?T++:(0<=W.toLowerCase().indexOf(K[aa])||+mxUtils.remove(R,u);u.unshift(R);5<u.length&&u.pop();R.funct.apply(this,Z);t.value=null}),z="about deleteAll showBoundingBox createSidebarEntry downloadDesktop toggleGoogleFonts".split(" "),E=mxUtils.bind(this,function(R){var Z=null,W;for(W in f.actions.actions){var ba=0>z.indexOf(W)&&"test"!=W.substring(0,4)?f.actions.get(W):null;if(null!=ba&&ba.isEnabled()&&ba.visible){if(W.toLowerCase()==R)return ba;for(var K=R.toLowerCase().split(" "),T=0,aa=0;aa<K.length;aa++)0==K[aa].length?T++:(0<=W.toLowerCase().indexOf(K[aa])||0<=ba.getTitle().toLowerCase().indexOf(K[aa]))&&T++;T==K.length&&(0>u.indexOf(Z)||null!=Z&&!Z.isEnabled())&&(Z=ba)}}return Z}),D=null;f.addMenuHandler(t,mxUtils.bind(this,function(R,Z){function W(oa){if(null!=oa&&oa.visible){var pa=R.addItem(oa.getTitle(),null,function(){y(oa,arguments)},Z,null,oa.isEnabled());oa.toggleAction&&oa.isSelected()&&R.addCheckmark(pa,Editor.checkmarkImage);null!=D||!oa.isEnabled()||0!=t.value.length&&T!=oa||b(pa,function(){y(oa,arguments);g.container.focus()})}}var ba=t.value.toLowerCase();D=null;var K=R.addItem(mxResources.get("searchShapes"),null,mxUtils.bind(this,function(){ha()}),Z);b(K,function(){ha()});R.addItem(mxResources.get("findInDiagram"),null,mxUtils.bind(this,function(){f.hideCurrentMenu();f.showSearchWindow(!0,t.value);t.value=""}),Z);Editor.enableAi&&!f.isOffline()&&f.isOwnGDriveDomain()&&f.isExternalDataComms()&&"draw.io"==f.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&R.addItem(mxResources.get("generate"),-null,mxUtils.bind(this,function(){f.openGenerateDialog(t.value);t.value=""}),Z);!f.isOffline()&&f.isOwnGDriveDomain()&&f.isExternalDataComms()&&R.addItem(mxResources.get("help"),null,mxUtils.bind(this,function(){f.searchHelp(t.value);t.value=""}),Z);R.addSeparator();var T=0<t.value.length?F(ba):null;W(T);for(K=0;K<u.length;K++)u[K]!=T&&W(u[K]);if(0<ba.length&&null!=f.pages)for(R.addSeparator(),K=0;K<f.pages.length&&!function(oa){if(null!=oa.getName()&&0<=oa.getName().toLowerCase().indexOf(ba)){var pa=+null,mxUtils.bind(this,function(){f.openGenerateDialog(t.value);t.value=""}),Z);!f.isOffline()&&f.isOwnGDriveDomain()&&f.isExternalDataComms()&&R.addItem(mxResources.get("help"),null,mxUtils.bind(this,function(){f.searchHelp(t.value);t.value=""}),Z);R.addSeparator();var T=0<t.value.length?E(ba):null;W(T);for(K=0;K<u.length;K++)u[K]!=T&&W(u[K]);if(0<ba.length&&null!=f.pages)for(R.addSeparator(),K=0;K<f.pages.length&&!function(oa){if(null!=oa.getName()&&0<=oa.getName().toLowerCase().indexOf(ba)){var pa=function(){f.selectPage(oa);g.container.focus();t.value=""},da=R.addItem(oa.getName()+" ("+mxResources.get("page")+")",null,pa,Z);null==D&&b(da,pa);return!0}return!1}(f.pages[K]);K++);if(0<ba.length&&null!=f.sidebar&&null!=f.sidebar.entries)for(R.addSeparator(),K=0;K<f.sidebar.entries.length;K++)for(var aa=f.sidebar.entries[K].entries,ka=0;ka<aa.length;ka++)(function(oa){var pa=f.sidebar.getConfigurationById(oa.id),da=oa.title.toLowerCase().split(" ");null!=pa&&0<=mxUtils.indexOf(da,ba)&&(da=function(){var ia=f.sidebar.showPalettes(pa.prefix||"",pa.libs||[pa.id],!0);t.value="";null!=ia&&1<ia.length&&(null==ia[1].firstChild||null!=ia[1].firstChild.firstChild&&"none"!=ia[1].firstChild.style.display||ia[0].click(),ia[0].scrollIntoView({behavior:"smooth"}))},oa=R.addItem(oa.title+" ("+mxResources.get("openLibrary")+")",null,da,Z),null==D&&b(oa,da));return!0})(aa[ka])}),null,!0);var G=document.createElement("div");G.style.display="none";G.style.paddingTop="8px";G.style.alignItems="center";G.style.justifyContent="center";var H=mxUtils.button(mxResources.get("moreResults"),function(){ha()});H.setAttribute("title",mxResources.get("moreResults"));H.className="geBtn gePrimaryBtn";H.style.borderRadius="16px";H.style.padding="8px 12px";G.appendChild(H);h.appendChild(G);var M="",N=!1,L=!1,U=0,X={},S=12,V=mxUtils.bind(this,function(){N=!1;this.currentSearch=null;for(var R=h.firstChild;null!=R;){var Z=R.nextSibling;R!=l&&R!=G&&R.parentNode.removeChild(R);R=Z}});mxEvent.addListener(k,"click",function(){k.getAttribute("src")!=@@ -2513,17 +2515,17 @@ a.width,(e-2*this.thumbBorder)/a.height))/100,this.graph.view.scaleAndTranslate(null!=u?"visible":"hidden";k.style.left=(null!=v?v:this.thumbBorder-1)+"px";k.style.top=k.style.left;k.style.width=b+"px";k.style.height=e+"px";k.style.visibility="";k.style.minWidth="";k.style.minHeight="";this.disablePointerEvents(k);f.appendChild(k);this.sidebarTitles&&null!=g&&0!=h&&(f.style.height=this.thumbHeight+0+this.sidebarTitleSize+8+"px",b=document.createElement("div"),b.style.color=Editor.isDarkMode()?"#A0A0A0":"#303030",b.style.fontSize=this.sidebarTitleSize+"px",b.style.textAlign="center",b.style.whiteSpace="nowrap",b.style.overflow="hidden",b.style.textOverflow="ellipsis",mxClient.IS_IE&&(b.style.height=this.sidebarTitleSize+12+"px"),b.style.paddingTop="4px",mxUtils.write(b,g),f.appendChild(b));return a};Sidebar.prototype.createSection=function(a){return mxUtils.bind(this,function(){var b=document.createElement("div");b.setAttribute("title",a);b.style.textOverflow="ellipsis";b.style.whiteSpace="nowrap";b.style.textAlign="center";b.style.overflow="hidden";b.style.width="100%";b.style.padding="14px 0";mxUtils.write(b,a);return b})};-Sidebar.prototype.createItem=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z,F){l=null!=l?l:!0;k=null!=k?k:this.thumbWidth;v=null!=v?v:this.thumbHeight;var D=F;if(null==D){D=document.createElement("a");var G=2*this.thumbBorder;D.style.width=k+G+"px";D.style.height=v+G+"px"}mxEvent.addListener(D,"click",function(M){mxEvent.consume(M)});var H=new mxRectangle(0,0,g,d);null!=a&&0<a.length?(G=a,a=this.graph.cloneCells(a),this.graph.pasteCellStyles(this.graph.includeDescendants(G),this.initialDefaultVertexStyle,this.initialDefaultEdgeStyle),-null!=u?(D.className="geButton",D.style.backgroundImage="url("+u+")",D.style.backgroundRepeat="no-repeat",D.style.backgroundPosition="center",D.style.backgroundSize="24px 24px"):null==F&&(D.className="geItem",this.createThumb(G,k,v,D,b,e,f,g,d)),1<a.length||a[0].vertex?(f=this.createDragSource(D,this.createDropHandler(a,!0,h,H,y,z),this.createDragPreview(g,d),a,H,y),this.addClickHandler(D,f,a,t,y),f.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):-null!=a[0]&&a[0].edge&&(f=this.createDragSource(D,this.createDropHandler(a,!1,h,H,y,z),this.createDragPreview(g,d),a,H,y),this.addClickHandler(D,f,a,t)),!mxClient.IS_IOS&&l&&mxEvent.addGestureListeners(D,null,mxUtils.bind(this,function(M){mxEvent.isMouseEvent(M)&&this.showTooltip(D,a,H.width,H.height,b,e)}))):null==F&&(D.style.backgroundImage="url("+Editor.svgBrokenImage.src+")",D.setAttribute("title",b));return D};+Sidebar.prototype.createItem=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z,E){l=null!=l?l:!0;k=null!=k?k:this.thumbWidth;v=null!=v?v:this.thumbHeight;var D=E;if(null==D){D=document.createElement("a");var G=2*this.thumbBorder;D.style.width=k+G+"px";D.style.height=v+G+"px"}mxEvent.addListener(D,"click",function(M){mxEvent.consume(M)});var H=new mxRectangle(0,0,g,d);null!=a&&0<a.length?(G=a,a=this.graph.cloneCells(a),this.graph.pasteCellStyles(this.graph.includeDescendants(G),this.initialDefaultVertexStyle,this.initialDefaultEdgeStyle),+null!=u?(D.className="geButton",D.style.backgroundImage="url("+u+")",D.style.backgroundRepeat="no-repeat",D.style.backgroundPosition="center",D.style.backgroundSize="24px 24px"):null==E&&(D.className="geItem",this.createThumb(G,k,v,D,b,e,f,g,d)),1<a.length||a[0].vertex?(f=this.createDragSource(D,this.createDropHandler(a,!0,h,H,y,z),this.createDragPreview(g,d),a,H,y),this.addClickHandler(D,f,a,t,y),f.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):+null!=a[0]&&a[0].edge&&(f=this.createDragSource(D,this.createDropHandler(a,!1,h,H,y,z),this.createDragPreview(g,d),a,H,y),this.addClickHandler(D,f,a,t)),!mxClient.IS_IOS&&l&&mxEvent.addGestureListeners(D,null,mxUtils.bind(this,function(M){mxEvent.isMouseEvent(M)&&this.showTooltip(D,a,H.width,H.height,b,e)}))):null==E&&(D.style.backgroundImage="url("+Editor.svgBrokenImage.src+")",D.setAttribute("title",b));return D};Sidebar.prototype.prepareCellsForInsert=function(a){if(null!=a&&0<a.length)for(var b=this.graph.getModel(),e=0;e<a.length;e++)if(this.prepareCellsForInsert(b.getChildren(a[e])),b.isVertex(a[e])){var f=b.getEdges(a[e]),g=this.graph.getCellStyle(a[e]);null!=f&&0!=f.length||null==g||1!=mxUtils.getValue(g,mxConstants.STYLE_FLIPV,0)&&1!=mxUtils.getValue(g,mxConstants.STYLE_FLIPH,0)&&1!=mxUtils.getValue(g,"stencilFlipH",0)&&1!=mxUtils.getValue(g,"stencilFlipV",0)||this.graph.setCellStyles("legacyAnchorPoints","0",[a[e]])}};Sidebar.prototype.createDropHandler=function(a,b,e,f,g,d){e=null!=e?e:!0;this.prepareCellsForInsert.call(this,a);return mxUtils.bind(this,function(h,l,t,k,v,u){for(u=u?null:mxEvent.isTouchEvent(l)||mxEvent.isPenEvent(l)?document.elementFromPoint(mxEvent.getClientX(l),mxEvent.getClientY(l)):mxEvent.getSource(l);null!=u&&u!=this.container;)u=u.parentNode;if(null==u&&h.isEnabled()){a=h.getImportableCells(a);if(0<a.length){h.stopEditing();u=null==t||mxEvent.isAltDown(l)?!1:h.isValidDropTarget(t,a,l);-var y=null;null==t||u||(t=null);if(!h.isCellLocked(t||h.getDefaultParent())){h.model.beginUpdate();try{k=Math.round(k);v=Math.round(v);if(b&&h.isSplitTarget(t,a,l)){var z=h.view.scale,F=h.view.translate,D=(k+F.x)*z,G=(v+F.y)*z,H=h.cloneCells(a);h.splitEdge(t,H,null,k-f.width/2,v-f.height/2,D,G);y=H}else if(0<a.length&&(y=h.importCells(a,k,v,t),h.model.isVertex(d)&&1==y.length&&h.model.isVertex(y[0]))){var M=h.insertEdge(h.model.getParent(d),null,"",d,y[0],h.createCurrentEdgeStyle());h.applyNewEdgeStyle(d,-[M]);y.push(M);h.connectionHandler.insertBeforeSource&&h.insertEdgeBeforeCell(M,d)}if(null!=h.layoutManager){var N=h.layoutManager.getLayout(t);if(null!=N){z=h.view.scale;F=h.view.translate;D=(k+F.x)*z;G=(v+F.y)*z;for(var L=0;L<y.length;L++)N.moveCell(y[L],D,G)}}!e||null!=l&&mxEvent.isShiftDown(l)||h.fireEvent(new mxEventObject("cellsInserted","cells",y));for(L=0;L<y.length;L++)h.model.isVertex(y[L])&&h.isAutoSizeCell(y[L])&&h.updateCellSize(y[L])}catch(U){this.editorUi.handleError(U)}finally{h.model.endUpdate()}null!=+var y=null;null==t||u||(t=null);if(!h.isCellLocked(t||h.getDefaultParent())){h.model.beginUpdate();try{k=Math.round(k);v=Math.round(v);if(b&&h.isSplitTarget(t,a,l)){var z=h.view.scale,E=h.view.translate,D=(k+E.x)*z,G=(v+E.y)*z,H=h.cloneCells(a);h.splitEdge(t,H,null,k-f.width/2,v-f.height/2,D,G);y=H}else if(0<a.length&&(y=h.importCells(a,k,v,t),h.model.isVertex(d)&&1==y.length&&h.model.isVertex(y[0]))){var M=h.insertEdge(h.model.getParent(d),null,"",d,y[0],h.createCurrentEdgeStyle());h.applyNewEdgeStyle(d,+[M]);y.push(M);h.connectionHandler.insertBeforeSource&&h.insertEdgeBeforeCell(M,d)}if(null!=h.layoutManager){var N=h.layoutManager.getLayout(t);if(null!=N){z=h.view.scale;E=h.view.translate;D=(k+E.x)*z;G=(v+E.y)*z;for(var L=0;L<y.length;L++)N.moveCell(y[L],D,G)}}!e||null!=l&&mxEvent.isShiftDown(l)||h.fireEvent(new mxEventObject("cellsInserted","cells",y));for(L=0;L<y.length;L++)h.model.isVertex(y[L])&&h.isAutoSizeCell(y[L])&&h.updateCellSize(y[L])}catch(U){this.editorUi.handleError(U)}finally{h.model.endUpdate()}null!=y&&0<y.length&&(h.scrollCellToVisible(y[0]),h.setSelectionCells(y));(g||h.editAfterInsert&&null!=l&&mxEvent.isMouseEvent(l)&&null!=y&&1==y.length)&&window.setTimeout(function(){h.startEditing(y[0])},0)}}mxEvent.consume(l)}})};Sidebar.prototype.createDragPreview=function(a,b){var e=document.createElement("div");e.className="geDragPreview";e.style.width=a+"px";e.style.height=b+"px";return e};-Sidebar.prototype.dropAndConnect=function(a,b,e,f,g,d,h){var l=this.editorUi.editor.graph,t=l.model.isEdge(a)||null!=d?d:h;t=this.getDropAndConnectGeometry(a,b[t],e,b);var k=[];if(null!=t){var v=null;l.model.beginUpdate();try{var u=l.getCellGeometry(a),y=l.getCellGeometry(b[f]),z=l.model.getParent(a),F=!0;if(null!=l.layoutManager){var D=l.layoutManager.getLayout(z);null!=D&&D.constructor==mxStackLayout&&(F=!1)}k=l.model.isEdge(a)?null:l.view.getState(z);var G=D=0;if(null!=k){var H=k.origin;D=H.x;-G=H.y}var M=!l.isTableRow(a)&&!l.isTableCell(a)&&(l.model.isEdge(a)||null!=u&&!u.relative&&F),N=l.getCellAt((t.x+D+l.view.translate.x)*l.view.scale,(t.y+G+l.view.translate.y)*l.view.scale,null,null,null,function(ha,R,Z){return!l.isContainer(ha.cell)});if(null!=N&&N!=z)k=l.view.getState(N),null!=k&&(H=k.origin,z=N,M=!0,l.model.isEdge(a)||(t.x-=H.x-D,t.y-=H.y-G));else if(!F||l.isTableRow(a)||l.isTableCell(a))t.x+=D,t.y+=G;D=y.x;G=y.y;l.model.isEdge(b[f])&&(G=D=0);k=b=l.importCells(b,t.x-(M?D:0),t.y-+Sidebar.prototype.dropAndConnect=function(a,b,e,f,g,d,h){var l=this.editorUi.editor.graph,t=l.model.isEdge(a)||null!=d?d:h;t=this.getDropAndConnectGeometry(a,b[t],e,b);var k=[];if(null!=t){var v=null;l.model.beginUpdate();try{var u=l.getCellGeometry(a),y=l.getCellGeometry(b[f]),z=l.model.getParent(a),E=!0;if(null!=l.layoutManager){var D=l.layoutManager.getLayout(z);null!=D&&D.constructor==mxStackLayout&&(E=!1)}k=l.model.isEdge(a)?null:l.view.getState(z);var G=D=0;if(null!=k){var H=k.origin;D=H.x;+G=H.y}var M=!l.isTableRow(a)&&!l.isTableCell(a)&&(l.model.isEdge(a)||null!=u&&!u.relative&&E),N=l.getCellAt((t.x+D+l.view.translate.x)*l.view.scale,(t.y+G+l.view.translate.y)*l.view.scale,null,null,null,function(ha,R,Z){return!l.isContainer(ha.cell)});if(null!=N&&N!=z)k=l.view.getState(N),null!=k&&(H=k.origin,z=N,M=!0,l.model.isEdge(a)||(t.x-=H.x-D,t.y-=H.y-G));else if(!E||l.isTableRow(a)||l.isTableCell(a))t.x+=D,t.y+=G;D=y.x;G=y.y;l.model.isEdge(b[f])&&(G=D=0);k=b=l.importCells(b,t.x-(M?D:0),t.y-(M?G:0),M?z:null);if(l.model.isEdge(a))l.model.setTerminal(a,b[f],e==mxConstants.DIRECTION_NORTH),null!=h&&null!=d&&(l.model.remove(b[h]),l.updateShapes(b[h],[a]));else if(l.model.isEdge(b[f])&&null==d){l.model.setTerminal(b[f],a,!0);var L=l.getCellGeometry(b[f]),U=null!=L?L.getTerminalPoint(!0):null;L.points=null;if(null!=U)for(e=0;e<b.length;e++)if(l.model.isEdge(b[e])&&e!=f){var X=l.getCellGeometry(b[e]),S=null!=X?X.getTerminalPoint(!0):null;null!=S&&S.x==U.x&&S.y==U.y&&l.model.setTerminal(b[e],a,!0)}if(null!=L.getTerminalPoint(!1))L.setTerminalPoint(t.getTerminalPoint(!1),!1);else if(M&&l.model.isVertex(z)){var V=l.view.getState(z);H=V.cell!=l.view.currentRoot?V.origin:new mxPoint(0,0);l.cellsMoved(b,H.x,H.y,null,null,!0)}}else null!=d&&(y=l.getCellGeometry(b[d]),D=t.x-Math.round(y.x),G=t.y-Math.round(y.y),t.x=Math.round(y.x),t.y=Math.round(y.y),l.model.setGeometry(b[f],t),l.cellsMoved(b,D,G,null,null,!0),k=b.slice(),v=1==k.length?k[0]:null,null!=h?l.model.setTerminal(b[h],a,!0):b.push(l.insertEdge(null,null,"",a,b[f],l.createCurrentEdgeStyle())));null!=g&&mxEvent.isShiftDown(g)||l.fireEvent(new mxEventObject("cellsInserted","cells",b))}catch(ha){this.editorUi.handleError(ha)}finally{l.model.endUpdate()}l.editAfterInsert&&null!=g&&mxEvent.isMouseEvent(g)&&null!=v&&window.setTimeout(function(){l.startEditing(v)},0)}null!=h&&1<k.length&&k.splice(h,1);return k};@@ -2534,7 +2536,7 @@ f.width/2+d:e==mxConstants.DIRECTION_SOUTH?f.y=f.y+t.height/2+f.height/2+d:e==mx2):e==mxConstants.DIRECTION_WEST&&(f.x-=t.getCenterX()+t.width/2,f.y-=t.getCenterY()))))));return f};Sidebar.prototype.isDropStyleEnabled=function(a,b){var e=!0;null!=b&&1==a.length&&(a=this.graph.getCellStyle(a[b]),null!=a&&(e=mxUtils.getValue(a,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(a,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE));return e};Sidebar.prototype.isDropStyleTargetIgnored=function(a){return this.graph.isSwimlane(a.cell)||this.graph.isTableCell(a.cell)||this.graph.isTableRow(a.cell)||this.graph.isTable(a.cell)};Sidebar.prototype.disablePointerEvents=function(a){mxUtils.visitNodes(a,mxUtils.bind(this,function(b){b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style&&(b.style.pointerEvents="none",b.removeAttribute("pointer-events"))}))};Sidebar.prototype.createDragSource=function(a,b,e,f,g,d){function h(ja,ua){var ya=mxUtils.createImage(ja.src);ya.style.width=ja.width+"px";ya.style.height=ja.height+"px";null!=ua&&ya.setAttribute("title",ua);mxUtils.setOpacity(ya,ja==this.refreshTarget?30:20);ya.style.position="absolute";ya.style.cursor="crosshair";return ya}function l(ja,ua,ya,Ma){null!=Ma.parentNode&&(mxUtils.contains(ya,ja,ua)?(mxUtils.setOpacity(Ma,100),T=Ma):mxUtils.setOpacity(Ma,Ma==R?30:20));return ya}var t=this.editorUi,k=-t.editor.graph,v=null,u=null,y=this;d=0;for(var z=this.livePreview,F=0;F<f.length&&z;F++)d+=k.model.getDescendants(f[F]).length,z=d<k.graphHandler.maxLivePreview;for(F=0;F<f.length&&(null==u&&k.model.isVertex(f[F])?u=F:null==v&&k.model.isEdge(f[F])&&null==k.model.getTerminal(f[F],!0)&&(v=F),null==u||null==v);F++);var D=this.isDropStyleEnabled(f,u),G=mxUtils.makeDraggable(a,k,mxUtils.bind(this,function(ja,ua,ya,Ma,Oa){null!=this.updateThread&&window.clearTimeout(this.updateThread);if(null!=f&&null!=+t.editor.graph,v=null,u=null,y=this;d=0;for(var z=this.livePreview,E=0;E<f.length&&z;E++)d+=k.model.getDescendants(f[E]).length,z=d<k.graphHandler.maxLivePreview;for(E=0;E<f.length&&(null==u&&k.model.isVertex(f[E])?u=E:null==v&&k.model.isEdge(f[E])&&null==k.model.getTerminal(f[E],!0)&&(v=E),null==u||null==v);E++);var D=this.isDropStyleEnabled(f,u),G=mxUtils.makeDraggable(a,k,mxUtils.bind(this,function(ja,ua,ya,Ma,Oa){null!=this.updateThread&&window.clearTimeout(this.updateThread);if(null!=f&&null!=L&&T==R){var Ka=ja.isCellSelected(L.cell)?ja.getSelectionCells():[L.cell];ja.updateShapes(ja.model.isEdge(L.cell)?f[0]:f[u],Ka,!0);ja.setSelectionCells(Ka)}else null!=f&&null!=T&&null!=M&&T!=R?(Ka=ja.model.isEdge(M.cell)||null==v?u:v,ja.setSelectionCells(this.dropAndConnect(M.cell,f,K,Ka,ua,u,v))):b.apply(this,arguments);null!=this.editorUi.hoverIcons&&this.editorUi.hoverIcons.update(ja.view.getState(ja.getSelectionCell()))}),e,0,0,k.autoscroll,!0,!0);z&&(G.createDragElement=mxUtils.bind(this,function(){return G.createPreviewElement(this.graph)}),G.createPreviewElement=mxUtils.bind(this,function(ja){var ua=document.createElement("a");ua.className="geItem";ua.style.overflow="visible";ja=ja.view.scale;ua.style.width=ja*Math.max(1,g.width)+"px";ua.style.height=ja*Math.max(1,g.height)+"px";mxUtils.setOpacity(ua,50);var ya=k.cloneCells(f);this.graph.pasteCellStyles(k.includeDescendants(ya),k.currentVertexStyle,k.currentEdgeStyle,null,k.pasteEdgeStyle);y.createThumb(ya,ja*Math.max(1,g.width),ja*Math.max(1,g.height),ua,null,null,null,null,null,k.shapeBackgroundColor,0,ja);return ua}));var H=G.mouseDown;G.mouseDown=function(ja){mxEvent.isPopupTrigger(ja)||mxEvent.isMultiTouchEvent(ja)||k.isCellLocked(k.getDefaultParent())||(k.stopEditing(),H.apply(this,arguments))};var M=null,N=null,L=null,U=!1,X=h(this.triangleUp,mxResources.get("connect")),S=h(this.triangleRight,mxResources.get("connect")),V=h(this.triangleDown,mxResources.get("connect")),ha=h(this.triangleLeft,mxResources.get("connect")),R=h(this.refreshTarget,mxResources.get("replace")),Z=null,W=h(this.roundDrop),@@ -2560,7 +2562,7 @@ arguments)};var qa=G.stopDrag;G.stopDrag=function(){qa.apply(this,arguments);forSidebar.prototype.itemClicked=function(a,b,e,f){f=this.editorUi.editor.graph;f.container.focus();if(mxEvent.isAltDown(e)&&1==f.getSelectionCount()){for(var g=b=null,d=0;d<a.length&&(null==g&&f.model.isVertex(a[d])?g=d:null==b&&f.model.isEdge(a[d])&&null==f.model.getTerminal(a[d],!0)&&(b=d),null==g||null==b);d++);d=null==b?g:b;f.setSelectionCells(this.dropAndConnect(f.getSelectionCell(),a,mxEvent.isMetaDown(e)||mxEvent.isControlDown(e)?mxEvent.isShiftDown(e)?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH:mxEvent.isShiftDown(e)?mxConstants.DIRECTION_EAST:mxConstants.DIRECTION_SOUTH,d,e,g,b));f.scrollCellToVisible(f.getSelectionCell())}else mxEvent.isShiftDown(e)&&!f.isSelectionEmpty()?(e=f.getEditableCells(f.getSelectionCells()),f.updateShapes(a[0],e,!0),f.scrollCellToVisible(e)):(a=mxEvent.isAltDown(e)?f.getFreeInsertPoint():f.getCenterInsertPoint(f.getBoundingBoxFromGeometry(a,!0)),b.drop(f,e,null,a.x,a.y,!0))};Sidebar.prototype.addClickHandler=function(a,b,e,f){var g=b.getGraphForEvent,d=b.mouseDown,h=b.mouseMove,l=b.mouseUp,t=this.editorUi.editor.graph.tolerance,k=!1,v=null,u=this,y=null;b.getGraphForEvent=function(z){return k?g.apply(this,arguments):null};b.mouseDown=function(z){d.apply(this,arguments);v=new mxPoint(mxEvent.getClientX(z),mxEvent.getClientY(z));y=a.style.opacity;k=!1;""==y&&(y="1");null!=this.dragElement&&(this.dragElement.style.display="none")};b.mouseMove=function(z){(k=null!=v&&(Math.abs(v.x--mxEvent.getClientX(z))>t||Math.abs(v.y-mxEvent.getClientY(z))>t))&&null!=this.dragElement&&"none"==this.dragElement.style.display&&(this.dragElement.style.display="");h.apply(this,arguments)};b.mouseUp=function(z){try{mxEvent.isPopupTrigger(z)||null!=this.currentGraph||null==this.dragElement||"none"!=this.dragElement.style.display||(null!=f&&f(z),mxEvent.isConsumed(z)||u.itemClicked(e,b,z,a)),l.apply(b,arguments),v=null,u.currentElt=a}catch(F){b.reset(),u.editorUi.handleError(F)}}};+mxEvent.getClientX(z))>t||Math.abs(v.y-mxEvent.getClientY(z))>t))&&null!=this.dragElement&&"none"==this.dragElement.style.display&&(this.dragElement.style.display="");h.apply(this,arguments)};b.mouseUp=function(z){try{mxEvent.isPopupTrigger(z)||null!=this.currentGraph||null==this.dragElement||"none"!=this.dragElement.style.display||(null!=f&&f(z),mxEvent.isConsumed(z)||u.itemClicked(e,b,z,a)),l.apply(b,arguments),v=null,u.currentElt=a}catch(E){b.reset(),u.editorUi.handleError(E)}}};Sidebar.prototype.createVertexTemplateEntry=function(a,b,e,f,g,d,h,l){null!=l&&null!=g&&(l+=" "+g);l=null!=l&&0<l.length?l:null!=g?g.toLowerCase():"";return this.addEntry(l,mxUtils.bind(this,function(){return this.createVertexTemplate(a,b,e,f,g,d,h)}))};Sidebar.prototype.createVertexTemplate=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z){a=[new mxCell(null!=f?f:"",new mxGeometry(0,0,b,e),a)];a[0].vertex=!0;return this.createVertexTemplateFromCells(a,b,e,g,d,h,l,t,k,v,u,y,z)};Sidebar.prototype.createVertexTemplateFromData=function(a,b,e,f,g,d,h,l){var t=null;try{var k=mxUtils.parseXml(Graph.decompress(a)),v=new mxCodec(k),u=new mxGraphModel;v.decode(k.documentElement,u);t=this.graph.cloneCells(u.root.getChildAt(0).children)}catch(y){f=mxResources.get("error")+": "+y.message}return this.createVertexTemplateFromCells(t,b,e,f,g,d,h,l)};Sidebar.prototype.createVertexTemplateFromCells=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z){return this.createItem(a,f,g,d,b,e,h,l,t,k,v,u,y,z)};Sidebar.prototype.createEdgeTemplateEntry=function(a,b,e,f,g,d,h,l,t){h=null!=h&&0<h.length?h:g.toLowerCase();return this.addEntry(h,mxUtils.bind(this,function(){return this.createEdgeTemplate(a,b,e,f,g,d,l,t)}))};@@ -2573,8 +2575,8 @@ Sidebar.prototype.setContentVisible=function(a,b){var e=Editor.transitionDelay;m(mxUtils.setPrefixedStyle(a.style,"transform","scaleY(0)"),window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(a.style,"transform",null);mxUtils.setPrefixedStyle(a.style,"transition",null);a.style.display="none"}),1E3*e))};Sidebar.prototype.removePalette=function(a){var b=this.palettes[a];if(null!=b){this.palettes[a]=null;for(a=0;a<b.length;a++)this.container.removeChild(b[a]);return!0}return!1};Sidebar.prototype.addImagePalette=function(a,b,e,f,g,d,h){for(var l=[],t=0;t<g.length;t++)mxUtils.bind(this,function(k,v,u){if(null==u&&(null==e||"img/lib/clip_art/"!=e.substring(0,17))){u=k.lastIndexOf("/");var y=k.lastIndexOf(".");u=k.substring(0<=u?u+1:0,0<=y?y:k.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;image="+e+k+f,this.defaultImageWidth,this.defaultImageHeight,"",v,null!=v,null,this.filterTags(u)))})(g[t],null!=d?d[t]:null,null!=h?h[g[t]]:null);this.addPaletteFunctions(a,b,!1,l)};Sidebar.prototype.getTagsForStencil=function(a,b,e){a=a.split(".");for(var f=1;f<a.length;f++)a[f]=a[f].replace(/_/g," ");a.push(b.replace(/_/g," "));null!=e&&a.push(e);return a.slice(1,a.length)};-Sidebar.prototype.addStencilPalette=function(a,b,e,f,g,d,h,l,t,k){h=null!=h?h:1;if(this.addStencilsToIndex){var v=[];if(null!=t)for(k=0;k<t.length;k++)v.push(t[k]);mxStencilRegistry.loadStencilSet(e,mxUtils.bind(this,function(u,y,z,F,D){if(null==g||0>mxUtils.indexOf(g,y)){z=this.getTagsForStencil(u,y);var G=null!=l?l[y]:null;null!=G&&z.push(G);v.push(this.createVertexTemplateEntry("shape="+u+y.toLowerCase()+f,Math.round(F*h),Math.round(D*h),"",y.replace(/_/g," "),null,null,this.filterTags(z.join(" "))))}}),-!0,!0);this.addPaletteFunctions(a,b,!1,v)}else this.addPalette(a,b,!1,mxUtils.bind(this,function(u){null==f&&(f="");null!=d&&d.call(this,u);if(null!=t)for(var y=0;y<t.length;y++)t[y](u);mxStencilRegistry.loadStencilSet(e,mxUtils.bind(this,function(z,F,D,G,H){(null==g||0>mxUtils.indexOf(g,F))&&u.appendChild(this.createVertexTemplate("shape="+z+F.toLowerCase()+f,Math.round(G*h),Math.round(H*h),"",F.replace(/_/g," "),!0))}),!0)}))};+Sidebar.prototype.addStencilPalette=function(a,b,e,f,g,d,h,l,t,k){h=null!=h?h:1;if(this.addStencilsToIndex){var v=[];if(null!=t)for(k=0;k<t.length;k++)v.push(t[k]);mxStencilRegistry.loadStencilSet(e,mxUtils.bind(this,function(u,y,z,E,D){if(null==g||0>mxUtils.indexOf(g,y)){z=this.getTagsForStencil(u,y);var G=null!=l?l[y]:null;null!=G&&z.push(G);v.push(this.createVertexTemplateEntry("shape="+u+y.toLowerCase()+f,Math.round(E*h),Math.round(D*h),"",y.replace(/_/g," "),null,null,this.filterTags(z.join(" "))))}}),+!0,!0);this.addPaletteFunctions(a,b,!1,v)}else this.addPalette(a,b,!1,mxUtils.bind(this,function(u){null==f&&(f="");null!=d&&d.call(this,u);if(null!=t)for(var y=0;y<t.length;y++)t[y](u);mxStencilRegistry.loadStencilSet(e,mxUtils.bind(this,function(z,E,D,G,H){(null==g||0>mxUtils.indexOf(g,E))&&u.appendChild(this.createVertexTemplate("shape="+z+E.toLowerCase()+f,Math.round(G*h),Math.round(H*h),"",E.replace(/_/g," "),!0))}),!0)}))};Sidebar.prototype.destroy=function(){null!=this.graph&&(null!=this.graph.container&&null!=this.graph.container.parentNode&&this.graph.container.parentNode.removeChild(this.graph.container),this.graph.destroy(),this.graph=null);null!=this.escapeListener&&(this.editorUi.editor.graph.removeListener(this.escapeListener),this.escapeListener=null);null!=this.refreshListener&&(this.editorUi.removeListener(this.refreshListener),this.refreshListener=null);null!=this.pointerUpHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerUpHandler=null);null!=this.pointerDownHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerDownHandler=null);null!=this.pointerMoveHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerMoveHandler=null);null!=this.pointerOutHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),this.pointerOutHandler=null)};(function(){var a=[["nbsp","160"],["shy","173"]],b=mxUtils.parseXml;mxUtils.parseXml=function(f){for(var g=0;g<a.length;g++)f=f.replace(new RegExp("&"+a[g][0]+";","g"),"&#"+a[g][1]+";");return b(f)};var e=mxUtils.getSizeForString;mxUtils.getSizeForString=function(f,g,d,h){return e(Graph.sanitizeHtml(f),g,d,h)}})();@@ -2605,22 +2607,23 @@ new mxRectangle(aa.x+aa.width-2,aa.y,4,aa.height)))oa="col-resize";for(T=aa;nullT&&(K.lastLabelValue=T,K.lastSanitizedLabelValue=Graph.sanitizeHtml(T),y.innerHTML=K.lastSanitizedLabelValue,Graph.addLightDarkColors(y,null,"simple"==K.view.graph.getAdaptiveColors())&&(K.lastSanitizedLabelValue=y.innerHTML)),T=K.lastSanitizedLabelValue));return T};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(K,T){return!1};this.alternateEdgeStyle="vertical";null==f&&this.loadStylesheet();var z=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var K=z.apply(this,arguments);if(this.graph.pageVisible){var T=[],aa=this.graph.pageFormat,ka=this.graph.pageScale,oa=aa.width*ka;aa=aa.height*ka;ka=this.graph.view.translate;for(var pa=this.graph.view.scale,da=this.graph.getPageLayout(),ia=0;ia<da.width;ia++)T.push(new mxRectangle(((da.x+ia)*oa+ka.x)*pa,(da.y*aa+ka.y)*pa,oa*pa,aa*pa));for(ia=1;ia<da.height;ia++)T.push(new mxRectangle((da.x*oa+ka.x)*pa,((da.y+ia)*aa+ka.y)*pa,oa*pa,aa*pa));K=T.concat(K)}return K};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(K,T){return null==K.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=-function(K){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(K){for(var T=F.apply(this,arguments),aa=new mxDictionary,ka=[],oa=0;oa<T.length;oa++){var pa=this.graph.isTableCell(K)&&this.graph.isTableCell(T[oa])&&this.graph.isCellSelected(T[oa])?this.graph.model.getParent(T[oa]):this.graph.isTableRow(K)&&this.graph.isTableRow(T[oa])&&+function(K){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var E=this.graphHandler.getCells;this.graphHandler.getCells=function(K){for(var T=E.apply(this,arguments),aa=new mxDictionary,ka=[],oa=0;oa<T.length;oa++){var pa=this.graph.isTableCell(K)&&this.graph.isTableCell(T[oa])&&this.graph.isCellSelected(T[oa])?this.graph.model.getParent(T[oa]):this.graph.isTableRow(K)&&this.graph.isTableRow(T[oa])&&this.graph.isCellSelected(T[oa])?T[oa]:this.graph.getCompositeParent(T[oa]);null==pa||aa.get(pa)||(aa.put(pa,!0),ka.push(pa))}return ka};var D=this.graphHandler.start;this.graphHandler.start=function(K,T,aa,ka){var oa=!1;this.graph.isTableCell(K)&&(this.graph.isCellSelected(K)?oa=!0:K=this.graph.model.getParent(K));oa||this.graph.isTableRow(K)&&this.graph.isCellSelected(K)||(K=this.graph.getCompositeParent(K));D.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(K,T){T=this.graph.getCompositeParent(T);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(K,T,aa,ka,oa,pa){var da=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=ka&&this.graph.applyNewEdgeStyle(ka,[da]);return da};var G=new mxRubberband(this);this.getRubberband=function(){return G};var H=(new Date).getTime(),M=0,N=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var K=this.currentState;N.apply(this,arguments);K!=this.currentState?(H=(new Date).getTime(),M=0):M=(new Date).getTime()-H};var L=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(K){return mxEvent.isShiftDown(K.getEvent())&&mxEvent.isAltDown(K.getEvent())?!1:null!=this.currentState&&K.getState()==this.currentState&&2E3<M||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&L.apply(this,arguments)};var U=this.isToggleEvent;this.isToggleEvent=function(K){return U.apply(this,arguments)||mxEvent.isShiftDown(K)};var X=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(X=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=X)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(K){return mxEvent.isMouseEvent(K.getEvent())};var S=this.click;this.click=function(K){var T=null==K.state&&null!=K.sourceState&&this.isCellLocked(this.getLayerForCell(K.sourceState.cell));if(this.isEnabled()&&!T||K.isConsumed())return S.apply(this,arguments);var aa=T?K.sourceState.cell:K.getCell();if(null!=aa){var ka=this.getClickableLinkForCell(aa);null!=ka?this.isCustomLink(ka)?this.customLinkClicked(ka,aa):this.openLink(ka):T&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(K){return K.sourceState};var V=this.tooltipHandler.show;this.tooltipHandler.show=function(){V.apply(this,arguments);if(null!=this.div)for(var K=this.div.getElementsByTagName("a"),T=0;T<K.length;T++)null!=K[T].getAttribute("href")&&null==K[T].getAttribute("target")&&K[T].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(K){return K.sourceState};this.getCursorForMouseEvent=function(K){var T=null==K.state&&null!=K.sourceState&&this.isCellLocked(K.sourceState.cell);return this.getCursorForCell(T?K.sourceState.cell:K.getCell())};var ha=this.getCursorForCell;-this.getCursorForCell=function(K){if(!this.isEnabled()||this.isCellLocked(K)){if(null!=this.getClickableLinkForCell(K))return"pointer";if(this.isCellLocked(K))return"default"}return ha.apply(this,arguments)};this.selectRegion=function(K,T){var aa=mxEvent.isAltDown(T)?K:null;K=this.getCells(K.x,K.y,K.width,K.height,null,null,aa,null,!0);if(this.isToggleEvent(T))for(aa=0;aa<K.length;aa++)this.selectCellForEvent(K[aa],T);else this.selectCellsForEvent(K,T);return K};var R=this.graphHandler.shouldRemoveCellsFromParent;+this.getCursorForCell=function(K){if(!this.isEnabled()||this.isCellLocked(K)){if(null!=this.getClickableLinkForCell(K))return"pointer";if(this.isCellLocked(K))return"default"}return ha.apply(this,arguments)};this.selectRegion=function(K,T){var aa=Graph.intersectionSelect||mxEvent.isAltDown(T)?K:null;K=this.getCells(K.x,K.y,K.width,K.height,null,null,aa,null,!0);if(this.isToggleEvent(T))for(aa=0;aa<K.length;aa++)this.selectCellForEvent(K[aa],T);else this.selectCellsForEvent(K,T);return K};var R=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(K,T,aa){return this.graph.isCellSelected(K)?!1:R.apply(this,arguments)};var Z=this.updateMouseEvent;this.updateMouseEvent=function(K){K=Z.apply(this,arguments);null!=K.state&&this.isCellLocked(this.getLayerForCell(K.getCell()))&&(null==this.getLinkForCell(K.getCell())?K.state=this.view.getState(this.getCellAt(K.getGraphX(),K.getGraphY(),null,null,null,mxUtils.bind(this,function(T,aa,ka){return K.state==T||this.isCellLocked(this.getLayerForCell(T.cell))&&null==this.getLinkForCell(T.cell)}))):K.state=null);return K};var W=this.isCellSelectable;this.isCellSelectable=function(K){return W.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(K))};this.isCellLocked=function(K){for(;null!=K;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(K),"locked","0"))return!0;K=this.model.getParent(K)}return!1};var ba=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(K,T){"mouseDown"==T.getProperty("eventName")&&(K=T.getProperty("event").getState(),ba=null==K||this.isSelectionEmpty()||this.isCellSelected(K.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(K,T){if(!mxEvent.isMultiTouchEvent(T)){K=T.getProperty("event");var aa=T.getProperty("cell");null==aa?(K=mxUtils.convertPoint(this.container,mxEvent.getClientX(K),mxEvent.getClientY(K)),G.start(K.x,K.y)):null!=ba?this.addSelectionCells(ba):1<this.getSelectionCount()&&this.isCellSelected(aa)&&this.removeSelectionCell(aa);ba=null;T.consume()}}));this.connectionHandler.selectCells=function(K,T){this.graph.setSelectionCell(T||K)};this.connectionHandler.constraintHandler.isStateIgnored=function(K,T){var aa=K.view.graph;return T&&(aa.isCellSelected(K.cell)||aa.isTableRow(K.cell)&&aa.selectionCellsHandler.isHandled(aa.model.getParent(K.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var K=this.connectionHandler.constraintHandler;null!=K.currentFocus&&K.isStateIgnored(K.currentFocus,!0)&&(K.currentFocus=null,K.constraints=null,K.destroyIcons());K.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";Graph.colorStyles=[mxConstants.STYLE_FONTCOLOR,mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_IMAGE_BORDER,mxConstants.STYLE_IMAGE_BACKGROUND,mxConstants.STYLE_LABEL_BORDERCOLOR,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];Graph.textStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity labelBorderColor labelBackgroundColor autosize resizable horizontal textDirection autosizeText".split(" ");-Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin".split(" ");Graph.cellStyleGroups=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing","targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"]];+Graph.diagramLanguage=null!=urlParams["diagram-language"]?urlParams["diagram-language"]:mxClient.language;Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;Graph.zoomWheel=!1;Graph.selectParentLayer=!1;Graph.intersectionSelect=!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";Graph.colorStyles=[mxConstants.STYLE_FONTCOLOR,mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_IMAGE_BORDER,mxConstants.STYLE_IMAGE_BACKGROUND,mxConstants.STYLE_LABEL_BORDERCOLOR,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];+Graph.textStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity labelBorderColor labelBackgroundColor autosize resizable horizontal textDirection autosizeText".split(" ");Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin".split(" ");+Graph.cellStyleGroups=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing","targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"]];Graph.cellStyles=mxUtils.addItems(mxUtils.addItems(mxUtils.addItems("rounded shadow glass dashed dashPattern comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification sketchStyle pointerEvents opacity strokeColor strokeWidth align verticalAlign spacingLeft spacingRight spacingTop spacingBottom spacing arcSize absoluteArcSize comicStyle swimlaneFillColor shadowOffsetX shadowOffsetY shadowBlur shadowColor shadowOpacity".split(" "),Graph.textStyles),Graph.edgeStyles),Graph.cellStyleGroups);Graph.layoutNames="mxHierarchicalLayout mxCircleLayout mxCompactTreeLayout mxEdgeLabelLayout mxFastOrganicLayout mxParallelEdgeLayout mxPartitionLayout mxRadialTreeLayout mxStackLayout".split(" ");Graph.backupStyleAttribute="data-mx-given-colors";Graph.newColorPlaceholder="rgba(0, 0, 0, 0)";Graph.newBackgroundPlaceholder="rgb(0, 0, 0)";Graph.defaultAdaptiveColors=window.mxIsElectron||"0"==urlParams.contrast?"simple":"auto";Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveColors?"automatic":Graph.defaultAdaptiveColors};@@ -2631,7 +2634,7 @@ Graph.createSvgNode=function(a,b,e,f,g){var d=mxUtils.createXmlDocument(),h=nulle+"px");h.setAttribute("height",f+"px");h.setAttribute("viewBox",a+" "+b+" "+e+" "+f);d.appendChild(h);return h};Graph.htmlToPng=function(a,b,e,f,g,d){g=null!=g?g:"";d=null!=d?d:Editor.htmlRasterScale;var h=document.createElement("canvas");h.width=b*d;h.height=e*d;var l=document.createElement("img");l.onload=mxUtils.bind(this,function(){try{var k=h.getContext("2d");k.scale(d,d);k.drawImage(l,0,0);f(h.toDataURL())}catch(v){f(null)}});var t=mxUtils.createXmlDocument();t=null!=t.createElementNS?t.createElementNS(mxConstants.NS_SVG,"svg"):t.createElement("svg");a=(new mxSvgCanvas2D(t)).convertHtml(a);l.onerror=function(k){f(null)};l.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+b+'" height="'+e+'">'+(""!=g?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+g+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+a+"</div></foreignObject></svg>")};-Graph.addLightDarkColors=function(a,b,e,f){function g(y,z,F){return null!=f?f(y,z,F):mxUtils.isValidColor(F)?(null==h&&null!=b&&(h={}),null!=h&&(h[z]=y.style.getPropertyValue(z)),F=mxUtils.getLightDarkColor(F,null,null,e),y.style.setProperty(z,F.cssText),!0):!1}for(var d=a.getElementsByTagName("*"),h=null,l=!1,t=0;t<d.length;t++)if(d[t]!=a&&null!=d[t].style){h=null;for(var k=0;k<d[t].style.length;k++){var v=d[t].style.item(k),u=d[t].style.getPropertyValue(v);l=g(d[t],v,u)||l}"FONT"==d[t].nodeName&&+Graph.addLightDarkColors=function(a,b,e,f){function g(y,z,E){return null!=f?f(y,z,E):mxUtils.isValidColor(E)?(null==h&&null!=b&&(h={}),null!=h&&(h[z]=y.style.getPropertyValue(z)),E=mxUtils.getLightDarkColor(E,null,null,e),y.style.setProperty(z,E.cssText),!0):!1}for(var d=a.getElementsByTagName("*"),h=null,l=!1,t=0;t<d.length;t++)if(d[t]!=a&&null!=d[t].style){h=null;for(var k=0;k<d[t].style.length;k++){var v=d[t].style.item(k),u=d[t].style.getPropertyValue(v);l=g(d[t],v,u)||l}"FONT"==d[t].nodeName&&""==d[t].style.getPropertyValue("color")&&(u=d[t].getAttribute("color"),l=g(d[t],"color",u)||l);null!=b&&null!=h&&d[t].setAttribute(b,JSON.stringify(h))}return l};Graph.removeLightDarkColors=function(a,b){a=a.getElementsByTagName("*");for(var e=!1,f=0;f<a.length;f++)try{var g=a[f].getAttribute(b);if(null!=g){a[f].removeAttribute(b);var d=JSON.parse(g),h;for(h in d){var l=d[h];""==l?(a[f].style[h]=null,""==a[f].getAttribute("style")&&a[f].removeAttribute("style")):a[f].style[h]=l;e=!0}}}catch(t){}return e};Graph.getGivenColor=function(a,b){var e=null;if(a.nodeType==mxConstants.NODETYPE_ELEMENT){try{var f=a.getAttribute(Graph.backupStyleAttribute);if(null!=f){var g=JSON.parse(f);null!=g&&null!=g[b]&&("color"==b&&"FONT"==a.nodeName&&""==g[b]&&null!=a.getAttribute("color")?e=a.getAttribute("color"):""!=g[b]&&(e=g[b]))}}catch(d){}null==e&&""!=a.style[b]&&(e=a.style[b])}return e};Graph.setTextColor=function(a,b,e){for(var f=e?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,g=e?"color":"background-color",d=a.getElementsByTagName("*"),h=[],l=0;l<d.length;l++)h.push({node:d[l],value:d[l].style[g]});document.execCommand(e?"forecolor":"backcolor",!1,f);a=a.getElementsByTagName("*");for(l=0;l<a.length;l++){if(l<h.length&&h[l].node==a[l]&&h[l].value!=a[l].style[g]&&""==a[l].style[g])try{if(d=a[l].getAttribute(Graph.backupStyleAttribute),null!=d){var t=JSON.parse(d);t[g]=@@ -2642,16 +2645,16 @@ Graph.arrayBufferToString=function(a){var b="";a=new Uint8Array(a);for(var e=a.bGraph.arrayBufferIndexOfString=function(a,b,e){var f=b.charCodeAt(0),g=1,d=-1;for(e=e||0;e<a.byteLength;e++)if(a[e]==f){d=e;break}for(e=d+1;-1<d&&e<a.byteLength&&e<d+b.length-1;e++){if(a[e]!=b.charCodeAt(g))return Graph.arrayBufferIndexOfString(a,b,d+1);g++}return g==b.length-1?d:-1};Graph.compress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=b?pako.deflate(encodeURIComponent(a)):pako.deflateRaw(encodeURIComponent(a));return btoa(Graph.arrayBufferToString(new Uint8Array(a)))};Graph.decompress=function(a,b,e){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=Graph.stringToArrayBuffer(atob(a));b=decodeURIComponent(b?pako.inflate(a,{to:"string"}):pako.inflateRaw(a,{to:"string"}));return e?b:Graph.zapGremlins(b)};Graph.fadeNodes=function(a,b,e,f,g){g=null!=g?g:1E3;Graph.setTransitionForNodes(a,null);Graph.setOpacityForNodes(a,b);window.setTimeout(function(){Graph.setTransitionForNodes(a,"all "+g+"ms ease-in-out");Graph.setOpacityForNodes(a,e);window.setTimeout(function(){Graph.setTransitionForNodes(a,null);null!=f&&f()},g)},0)};-Graph.exploreFromCell=function(a,b,e){pageSize=null!=e&&null!=e.pageSize?e.pageSize:8;minSize=null!=e&&null!=e.minSize?e.minSize:180;(function(f,g){function d(u){u.view.states.visit(function(y,z){null!=z.shape&&u.model.isEdge(u.model.getParent(z.cell))?z.shape.node.parentNode.appendChild(z.shape.node):null!=z.text&&u.model.isEdge(z.cell)&&z.text.node.parentNode.appendChild(z.text.node)})}function h(u,y){if(u.getModel().isVertex(y)){var z=u.container.offsetWidth/2,F=u.container.offsetHeight/2;u.rootCell=+Graph.exploreFromCell=function(a,b,e){pageSize=null!=e&&null!=e.pageSize?e.pageSize:8;minSize=null!=e&&null!=e.minSize?e.minSize:180;(function(f,g){function d(u){u.view.states.visit(function(y,z){null!=z.shape&&u.model.isEdge(u.model.getParent(z.cell))?z.shape.node.parentNode.appendChild(z.shape.node):null!=z.text&&u.model.isEdge(z.cell)&&z.text.node.parentNode.appendChild(z.text.node)})}function h(u,y){if(u.getModel().isVertex(y)){var z=u.container.offsetWidth/2,E=u.container.offsetHeight/2;u.rootCell=y.referenceCell||y;u.getModel().beginUpdate();try{pageSize=null!=e&&null!=e.pageSize?e.pageSize:8+Math.max(0,Math.floor(Math.min(u.container.offsetWidth-800/120,u.container.offsetHeight-600)/30));for(var D=y.referenceCell||y,G=f.model.getCell(D.sourceCellId),H=f.getEdges(G,null,!0,!0,!1,!0),M=[],N=0;N<H.length;N++)null!=H[N].getTerminal(!0)&&null!=H[N].getTerminal(!1)&&f.isCellVisible(H[N])&&!f.isEdgeIgnored(H[N])&&f.isCellVisible(H[N].getTerminal(!0))&&f.isCellVisible(H[N].getTerminal(!1))&&f.isCellVisible(f.getLayerForCell(H[N]))&&M.push(H[N]);M=H=M;if(null!=y.startIndex||0<pageSize&&H.length>pageSize){var L=y.startIndex||0;M=H.slice(Math.max(0,L),Math.min(H.length,L+pageSize))}M=f.getOpposites(M,G).concat(M);var U=u.cloneCells(M);for(N=0;N<M.length;N++)if(U[N].sourceCellId=M[N].id,u.model.isEdge(U[N]))for(U[N].geometry.x=0,U[N].geometry.y=0,U[N].geometry.points=null,U[N].setStyle(U[N].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),U[N].setTerminal(D,null==U[N].getTerminal(!0)),G=0;G<U[N].getChildCount();G++){var X=U[N].getChildAt(G);null!=X.geometry&&X.geometry.relative&&(X.setStyle(X.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),X.geometry.offset=new mxPoint(0,0),X.geometry.y=0,X.geometry.x=.5>X.geometry.x?-.8:.5<X.geometry.x?.8:0)}if(0<y.startIndex){var S=u.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((y.startIndex||0)/pageSize)+"/"+Math.ceil(H.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");S.referenceCell=D;S.startIndex=Math.max(0,(y.startIndex||0)-pageSize);U.splice(0,0,S)}if(H.length>(y.startIndex||0)+pageSize){var V=u.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((y.startIndex||0)/pageSize)+2)+"/"+Math.ceil(H.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");V.referenceCell=D;V.startIndex=(y.startIndex||0)+pageSize;U.splice(0,0,V)}for(var ha in u.getModel().cells){var R=u.getModel().getCell(ha);R!=u.rootCell&&!u.getModel().isAncestor(u.rootCell,-R)&&u.getModel().isVertex(R)&&u.removeCells([R])}u.addCells(U);var Z=u.getModel().getGeometry(u.rootCell);null!=Z&&(Z=Z.clone(),Z.x=z-Z.width/2,Z.y=F-Z.height/3,u.getModel().setGeometry(u.rootCell,Z));y=[];for(ha in u.getModel().cells)R=u.getModel().getCell(ha),R!=u.rootCell&&u.getModel().isVertex(R)&&u.getModel().getParent(R)==u.getDefaultParent()&&(y.push(R),Z=u.getModel().getGeometry(R),null!=Z&&(Z.x=z-Z.width/2,Z.y=F-Z.height/2));var W=y.length,ba=2*Math.PI/W,K=Math.max(minSize,Math.min(u.container.offsetWidth/+R)&&u.getModel().isVertex(R)&&u.removeCells([R])}u.addCells(U);var Z=u.getModel().getGeometry(u.rootCell);null!=Z&&(Z=Z.clone(),Z.x=z-Z.width/2,Z.y=E-Z.height/3,u.getModel().setGeometry(u.rootCell,Z));y=[];for(ha in u.getModel().cells)R=u.getModel().getCell(ha),R!=u.rootCell&&u.getModel().isVertex(R)&&u.getModel().getParent(R)==u.getDefaultParent()&&(y.push(R),Z=u.getModel().getGeometry(R),null!=Z&&(Z.x=z-Z.width/2,Z.y=E-Z.height/2));var W=y.length,ba=2*Math.PI/W,K=Math.max(minSize,Math.min(u.container.offsetWidth/2-40,u.container.offsetHeight/2-80));for(z=0;z<W;z++)Z=u.getModel().getGeometry(y[z]),null!=Z&&(Z=Z.clone(),Z.x+=K*Math.sin(z*ba),Z.y+=K*Math.cos(z*ba),u.getModel().setGeometry(y[z],Z))}finally{u.getModel().endUpdate()}}}var l=document.createElement("div");l.style.position="absolute";l.style.display="block";l.style.overflow="auto";l.style.width="100%";l.style.height="100%";l.style.left="0px";l.style.top="0px";l.style.zIndex=2;l.style.background=f.background==mxConstants.NONE||null==f.background?"light-dark(#ffffff,"+Editor.darkColor+")":f.background;var t=document.createElement("img");t.setAttribute("src",Editor.closeBlackImage);t.style.position="absolute";t.style.cursor="pointer";t.style.right="10px";t.style.top="10px";l.appendChild(t);var k=document.createElement("div");k.style.position="absolute";k.style.cursor="pointer";k.style.right="38px";k.style.top="14px";k.style.textAlign="right";k.style.verticalAlign="top";mxUtils.write(k,mxResources.get("close"));l.appendChild(k);document.body.appendChild(l);var v=function(u){27==u.keyCode&&t.click()};mxEvent.addListener(document,"keydown",v);(function(u){var y=new Graph(u);y.keepEdgesInBackground=!0;y.isCellResizable=function(){return!1};y.isCellRotatable=function(){return!1};y.getCursorForCell=function(M){return this.model.isVertex(M)?"pointer":null};y.getFoldingImage=function(){return null};var z=function(){mxEvent.removeListener(document,"keydown",v);u.parentNode.removeChild(u);f.scrollCellToVisible(g)};mxEvent.addListener(t,"click",z);mxEvent.addListener(k,-"click",z);y.setEnabled(!1);var F=y.click;y.click=function(M){var N=M.getCell(),L=null!=N?null!=N.referenceCell?N.referenceCell:N:null;null!=N&&0<y.getEdges(L).length?h(y,N):F.apply(this,arguments)};z=y.container.offsetWidth/2;var D=y.container.offsetHeight/3;y.model.beginUpdate();var G=y.importCells([g])[0];G.sourceCellId=g.id;G.geometry.x=z-G.geometry.width/2;G.geometry.y=D-G.geometry.height/2;y.model.endUpdate();var H=!1;y.getModel().addListener(mxEvent.CHANGE,function(M,N){H||(M=N.getProperty("edit").changes,+"click",z);y.setEnabled(!1);var E=y.click;y.click=function(M){var N=M.getCell(),L=null!=N?null!=N.referenceCell?N.referenceCell:N:null;null!=N&&0<y.getEdges(L).length?h(y,N):E.apply(this,arguments)};z=y.container.offsetWidth/2;var D=y.container.offsetHeight/3;y.model.beginUpdate();var G=y.importCells([g])[0];G.sourceCellId=g.id;G.geometry.x=z-G.geometry.width/2;G.geometry.y=D-G.geometry.height/2;y.model.endUpdate();var H=!1;y.getModel().addListener(mxEvent.CHANGE,function(M,N){H||(M=N.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,y.labelsVisible=!1,H=!0,mxEffects.animateChanges(y,M,function(){var L=new mxParallelEdgeLayout(y);L.spacing=60;var U=L.layout;L.layout=function(X){L.spacing=Math.min(60,Math.max(30,60-5*X.length));U.apply(this,arguments)};L.execute(y.getDefaultParent());mxText.prototype.enableBoundingBox=!0;y.labelsVisible=!0;y.tooltipHandler.hide();y.refresh();d(y);H=!1}))});h(y,G)})(l)})(a,b)};Graph.removeKeys=function(a,b){for(var e in a)b(e)&&delete a[e]};Graph.setTransitionForNodes=function(a,b){for(var e=0;e<a.length;e++)mxUtils.setPrefixedStyle(a[e].style,"transition",b)};Graph.setOpacityForNodes=function(a,b){for(var e=0;e<a.length;e++)a[e].style.opacity=b};Graph.removePasteFormatting=function(a,b){for(;null!=a;){null!=a.firstChild&&Graph.removePasteFormatting(a.firstChild,!0);var e=a.nextSibling;if(a.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=a.style){"#000000"==a.style.color&&(a.style.color="");if("SPAN"==a.nodeName&&"Apple-tab-span"==a.className){var f=Graph.createTabNode(4);a.parentNode.replaceChild(f,a);a=f}if("P"==a.nodeName&&"p1"==a.className){for(;null!=a.firstChild;)a.parentNode.insertBefore(a.firstChild,a);null!=e&&"P"==e.nodeName&&"p1"==@@ -2681,13 +2684,13 @@ mxUtils.getValue(h.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCelGraph.prototype.applyNewEdgeStyle=function(h,l,t){h=this.getCellStyle(h).newEdgeStyle;if(null!=h){this.model.beginUpdate();try{var k=JSON.parse(h),v;for(v in k)this.setCellStyles(v,k[v],l),"edgeStyle"==v&&"elbowEdgeStyle"==k[v]&&null!=t&&this.setCellStyles("elbow",t==mxConstants.DIRECTION_SOUTH||t==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",l)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(h){for(var l={},t=0;t<h.length;t++){var k=this.view.getState(h[t]);null!=k&&this.mergeStyle(k.style,l,0==t)}return l};Graph.prototype.mergeStyle=function(h,l,t){if(null!=h){var k={},v;for(v in h){var u=h[v];null!=u&&(k[v]=!0,null==l[v]&&t?l[v]=u:l[v]!=u&&delete l[v])}for(v in l)k[v]||delete l[v]}};Graph.prototype.getStartEditingCell=function(h,l){l=this.getCellStyle(h);l=parseInt(mxUtils.getValue(l,mxConstants.STYLE_STARTSIZE,0));this.isTable(h)&&(!this.isSwimlane(h)||0==l)&&""==this.getLabel(h)&&0<this.model.getChildCount(h)&&(h=this.model.getChildAt(h,0),l=this.getCellStyle(h),l=parseInt(mxUtils.getValue(l,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(h)&&(!this.isSwimlane(h)||0==l)&&""==this.getLabel(h)&&0<this.model.getChildCount(h))for(l=0;l<this.model.getChildCount(h);l++){var t=this.model.getChildAt(h,l);if(this.isCellEditable(t)){h=t;break}}return h};Graph.prototype.copyStyle=function(h){return this.getCellStyle(h,!1)};Graph.prototype.pasteStyle=function(h,l,t,k){null!=h&&(k||(t=null!=t?t:Graph.cellStyles,Graph.removeKeys(h,function(v){return 0>mxUtils.indexOf(t,-v)})),this.updateCellStyles(h,l))};Graph.prototype.copyCellStyles=function(h,l,t,k,v,u,y){var z=!1,F=!1;if(0<h.length)for(var D=0;D<h.length&&(z=this.getModel().isVertex(h[D])||z,!(F=this.getModel().isEdge(h[D])||F)||!z);D++);else F=z=!0;z=z&&!u;F=F&&!y;for(D=0;D<l.length;D++)if(h=0<=mxUtils.indexOf(Graph.textStyles,l[D]),"strokeColor"!=l[D]||null!=t[D]&&"none"!=t[D])if(0<=mxUtils.indexOf(Graph.cellStyles,l[D])||"shape"==l[D])if("shape"!=l[D]&&(z||h)&&(null==t[D]?delete k[l[D]]:k[l[D]]=t[D]),F||h)null==-t[D]?delete v[l[D]]:v[l[D]]=t[D]};Graph.prototype.includeDescendants=function(h){for(var l=[],t=0;t<h.length;t++)l=l.concat(this.model.getDescendants(h[t]));return l};Graph.prototype.pasteCellStyles=function(h,l,t,k,v){l=null!=l?l:this.currentVertexStyle;t=null!=t?t:this.currentEdgeStyle;v=null!=v?v:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var u=0;u<h.length;u++){var y=h[u],z=this.model.getStyle(y),F=!1;null!=y.style&&(pairs=y.style.split(";"),F=F||0<=mxUtils.indexOf(pairs,"text"));if(F)var D=-Graph.textStyles;else if(D=Graph.cellStyles.slice(),!k)for(var G=null!=z?z.split(";"):[],H=0;H<G.length;H++){var M=G[H],N=M.indexOf("=");if(0<=N){var L=M.substring(0,N),U=mxUtils.indexOf(D,L);0<=U&&D.splice(U,1);for(F=0;F<Graph.cellStyleGroups.length;F++){var X=Graph.cellStyleGroups[F];if(0<=mxUtils.indexOf(X,L))for(var S=0;S<X.length;S++){var V=mxUtils.indexOf(D,X[S]);0<=V&&D.splice(V,1)}}}}var ha=this.model.isEdge(y);F=ha?t:l;for(H=0;H<D.length;H++){L=D[H];var R=F[L];null!=R&&("edgeStyle"!=L||v)&&-(ha||!ha&&0>mxUtils.indexOf(Graph.edgeStyles,L))&&(z=mxUtils.setStyle(z,L,R),"fontFamily"==L&&null==F.fontSource&&(z=mxUtils.setStyle(z,"fontSource",null)),ha&&"rounded"==L&&"1"==R&&null==F.curved&&(z=mxUtils.setStyle(z,"curved",null)))}Editor.simpleLabels&&(z=mxUtils.setStyle(mxUtils.setStyle(z,"html",null),"whiteSpace",null));this.model.setStyle(y,z)}}finally{this.model.endUpdate()}return h};Graph.prototype.updateCellStyles=function(h,l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)if(this.model.isVertex(l[t])||+v)})),this.updateCellStyles(h,l))};Graph.prototype.copyCellStyles=function(h,l,t,k,v,u,y){var z=!1,E=!1;if(0<h.length)for(var D=0;D<h.length&&(z=this.getModel().isVertex(h[D])||z,!(E=this.getModel().isEdge(h[D])||E)||!z);D++);else E=z=!0;z=z&&!u;E=E&&!y;for(D=0;D<l.length;D++)if(h=0<=mxUtils.indexOf(Graph.textStyles,l[D]),"strokeColor"!=l[D]||null!=t[D]&&"none"!=t[D])if(0<=mxUtils.indexOf(Graph.cellStyles,l[D])||"shape"==l[D])if("shape"!=l[D]&&(z||h)&&(null==t[D]?delete k[l[D]]:k[l[D]]=t[D]),E||h)null==+t[D]?delete v[l[D]]:v[l[D]]=t[D]};Graph.prototype.includeDescendants=function(h){for(var l=[],t=0;t<h.length;t++)l=l.concat(this.model.getDescendants(h[t]));return l};Graph.prototype.pasteCellStyles=function(h,l,t,k,v){l=null!=l?l:this.currentVertexStyle;t=null!=t?t:this.currentEdgeStyle;v=null!=v?v:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var u=0;u<h.length;u++){var y=h[u],z=this.model.getStyle(y),E=!1;null!=y.style&&(pairs=y.style.split(";"),E=E||0<=mxUtils.indexOf(pairs,"text"));if(E)var D=+Graph.textStyles;else if(D=Graph.cellStyles.slice(),!k)for(var G=null!=z?z.split(";"):[],H=0;H<G.length;H++){var M=G[H],N=M.indexOf("=");if(0<=N){var L=M.substring(0,N),U=mxUtils.indexOf(D,L);0<=U&&D.splice(U,1);for(E=0;E<Graph.cellStyleGroups.length;E++){var X=Graph.cellStyleGroups[E];if(0<=mxUtils.indexOf(X,L))for(var S=0;S<X.length;S++){var V=mxUtils.indexOf(D,X[S]);0<=V&&D.splice(V,1)}}}}var ha=this.model.isEdge(y);E=ha?t:l;for(H=0;H<D.length;H++){L=D[H];var R=E[L];null!=R&&("edgeStyle"!=L||v)&&+(ha||!ha&&0>mxUtils.indexOf(Graph.edgeStyles,L))&&(z=mxUtils.setStyle(z,L,R),"fontFamily"==L&&null==E.fontSource&&(z=mxUtils.setStyle(z,"fontSource",null)),ha&&"rounded"==L&&"1"==R&&null==E.curved&&(z=mxUtils.setStyle(z,"curved",null)))}Editor.simpleLabels&&(z=mxUtils.setStyle(mxUtils.setStyle(z,"html",null),"whiteSpace",null));this.model.setStyle(y,z)}}finally{this.model.endUpdate()}return h};Graph.prototype.updateCellStyles=function(h,l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)if(this.model.isVertex(l[t])||this.model.isEdge(l[t])){var k=this.getCellStyle(l[t],!1),v=k[mxConstants.STYLE_PERIMETER],u=!1;for(z in h){var y=h[z];if(k[z]!=y){if(z==mxConstants.STYLE_SHAPE&&"umlLifeline"==k[z]&&"umlLifeline"!=y){u=!0;var z="participant"}this.setCellStyles(z,y,[l[t]])}}u&&this.setCellStyles(mxConstants.STYLE_PERIMETER,v,[l[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(h,l,t,k,v,u){this.useCssTransforms&&(h=h/this.currentScale-this.currentTranslate.x,l=l/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(h,l,t,k,v,u){k=null!=k?k:!0;v=null!=v?v:!0;null==t&&(t=this.getCurrentRoot(),-null==t&&(t=this.getModel().getRoot()));if(null!=t)for(var y=this.model.getChildCount(t)-1;0<=y;y--){var z=this.model.getChildAt(t,y),F=this.getScaledCellAt(h,l,z,k,v,u);if(null!=F)return F;if(this.isCellVisible(z)&&(v&&this.model.isEdge(z)||k&&this.model.isVertex(z))&&(F=this.view.getState(z),null!=F&&(null==u||!u(F,h,l))&&this.intersects(F,h,l)))return z}return null};Graph.prototype.isRecursiveVertexResize=function(h){return!this.isSwimlane(h.cell)&&0<this.model.getChildCount(h.cell)&&!this.isCellCollapsed(h.cell)&&+null==t&&(t=this.getModel().getRoot()));if(null!=t)for(var y=this.model.getChildCount(t)-1;0<=y;y--){var z=this.model.getChildAt(t,y),E=this.getScaledCellAt(h,l,z,k,v,u);if(null!=E)return E;if(this.isCellVisible(z)&&(v&&this.model.isEdge(z)||k&&this.model.isVertex(z))&&(E=this.view.getState(z),null!=E&&(null==u||!u(E,h,l))&&this.intersects(E,h,l)))return z}return null};Graph.prototype.isRecursiveVertexResize=function(h){return!this.isSwimlane(h.cell)&&0<this.model.getChildCount(h.cell)&&!this.isCellCollapsed(h.cell)&&"1"==mxUtils.getValue(h.style,"recursiveResize","1")&&null==mxUtils.getValue(h.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(h){for(var l=this.getCellGeometry(h);null!=l&&l.relative;)h=this.getModel().getParent(h),l=this.getCellGeometry(h);return h};Graph.prototype.isPart=function(h){return"1"==mxUtils.getValue(this.getCurrentCellStyle(h),"part","0")||this.isTableCell(h)||this.isTableRow(h)};Graph.prototype.getCompositeParents=function(h){for(var l=new mxDictionary,t=[],k=0;k<h.length;k++){var v=this.getCompositeParent(h[k]);this.isTableCell(v)&&(v=this.graph.model.getParent(v));this.isTableRow(v)&&(v=this.graph.model.getParent(v));null==v||l.get(v)||(l.put(v,!0),t.push(v))}return t};Graph.prototype.getReferenceTerminal=function(h){if(null!=h){var l=this.getCellGeometry(h);null!=l&&l.relative&&(h=this.model.getParent(h))}null!=h&&this.model.isEdge(h)&&(h=this.model.getParent(h));null!=h&&(h=this.getCompositeParent(h));return h};Graph.prototype.getCompositeParent=function(h){for(;this.isPart(h);){var l=this.model.getParent(h);if(!this.model.isVertex(l))break;h=l}return h};Graph.prototype.filterSelectionCells=function(h){var l=this.getSelectionCells();if(null!=h){for(var t=[],k=0;k<l.length;k++)h(l[k])||t.push(l[k]);l=t}return l};var a=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(h){if(this.useCssTransforms){var l=this.currentScale,t=this.currentTranslate;h=new mxRectangle((h.x+2*t.x)*l-t.x,(h.y+2*t.y)*l-t.y,h.width*l,h.height*l)}a.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=@@ -2726,8 +2729,8 @@ Graph.prototype.isLabelMovable=function(a){var b=this.getCurrentCellStyle(a);retGraph.prototype.getClickableLinkForCell=function(a){do{var b=this.getLinkForCell(a);if(null!=b)return b;a=this.model.getParent(a)}while(null!=a);return null};Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b};Graph.prototype.formatDate=function(a,b,e){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var f=this.dateFormatCache,g=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g,h=function(H,M){H=String(H);for(M=M||2;H.length<M;)H="0"+H;return H};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||-/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(f.masks[b]||b||f.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var l=e?"getUTC":"get",t=a[l+"Date"](),k=a[l+"Day"](),v=a[l+"Month"](),u=a[l+"FullYear"](),y=a[l+"Hours"](),z=a[l+"Minutes"](),F=a[l+"Seconds"]();l=a[l+"Milliseconds"]();var D=e?0:a.getTimezoneOffset(),G={d:t,dd:h(t),ddd:f.i18n.dayNames[k],dddd:f.i18n.dayNames[k+7],m:v+1,mm:h(v+1),mmm:f.i18n.monthNames[v],mmmm:f.i18n.monthNames[v+-12],yy:String(u).slice(2),yyyy:u,h:y%12||12,hh:h(y%12||12),H:y,HH:h(y),M:z,MM:h(z),s:F,ss:h(F),l:h(l,3),L:h(99<l?Math.round(l/10):l),t:12>y?"a":"p",tt:12>y?"am":"pm",T:12>y?"A":"P",TT:12>y?"AM":"PM",Z:e?"UTC":(String(a).match(g)||[""]).pop().replace(d,""),o:(0<D?"-":"+")+h(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][3<t%10?0:(10!=t%100-t%10)*t%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(H){return H in G?G[H]:H.slice(1,+/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(f.masks[b]||b||f.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var l=e?"getUTC":"get",t=a[l+"Date"](),k=a[l+"Day"](),v=a[l+"Month"](),u=a[l+"FullYear"](),y=a[l+"Hours"](),z=a[l+"Minutes"](),E=a[l+"Seconds"]();l=a[l+"Milliseconds"]();var D=e?0:a.getTimezoneOffset(),G={d:t,dd:h(t),ddd:f.i18n.dayNames[k],dddd:f.i18n.dayNames[k+7],m:v+1,mm:h(v+1),mmm:f.i18n.monthNames[v],mmmm:f.i18n.monthNames[v++12],yy:String(u).slice(2),yyyy:u,h:y%12||12,hh:h(y%12||12),H:y,HH:h(y),M:z,MM:h(z),s:E,ss:h(E),l:h(l,3),L:h(99<l?Math.round(l/10):l),t:12>y?"a":"p",tt:12>y?"am":"pm",T:12>y?"A":"P",TT:12>y?"AM":"PM",Z:e?"UTC":(String(a).match(g)||[""]).pop().replace(d,""),o:(0<D?"-":"+")+h(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][3<t%10?0:(10!=t%100-t%10)*t%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(H){return H in G?G[H]:H.slice(1,H.length-1)})};Graph.prototype.getLayerForCell=function(a){for(;null!=a&&!this.model.isLayer(a);)a=this.model.getParent(a);return a};Graph.prototype.getLayerForCells=function(a){var b=null;if(0<a.length){b=this.getLayerForCell(a[0]);for(var e=1;e<a.length;e++)if(!this.model.isAncestor(b,a[e])){b=null;break}}return b};Graph.prototype.createLayersDialog=function(a,b){var e=document.createElement("div");e.style.position="absolute";for(var f=this.getModel(),g=f.getChildCount(f.root),d=0;d<g;d++)mxUtils.bind(this,function(h){function l(){f.isVisible(h)?(v.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(k,75)):(v.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(k,25))}var t=this.convertValueToString(h)||mxResources.get("background")||"Background",k=document.createElement("div");k.style.overflow="hidden";k.style.textOverflow="ellipsis";k.style.padding="2px";k.style.whiteSpace="nowrap";k.style.cursor="pointer";k.setAttribute("title",mxResources.get(f.isVisible(h)?"hideIt":"show",[t]));var v=document.createElement("img");v.setAttribute("draggable","false");v.setAttribute("align","absmiddle");v.setAttribute("border","0");v.style.position="relative";v.style.width="16px";v.style.padding="0px 6px 0 4px";b&&(v.style.filter="invert(100%)",v.style.top="-2px");k.appendChild(v);mxUtils.write(k,t);e.appendChild(k);@@ -2747,11 +2750,11 @@ Graph.prototype.selectCellsForConnectVertex=function(a,b,e){2==a.length&&this.moGraph.prototype.insertEdgeBeforeCell=function(a,b){for(var e=b;null!=e.parent&&null!=e.geometry&&e.geometry.relative&&e.parent!=a.parent;)e=this.model.getParent(e);null!=e&&null!=e.parent&&e.parent==a.parent&&(b=e.parent.getIndex(e),this.model.add(e.parent,a,b))};Graph.prototype.connectVertex=function(a,b,e,f,g,d,h,l){d=d?d:!1;if(a.geometry.relative&&this.model.isEdge(a.parent))return[];for(;a.geometry.relative&&this.model.isVertex(a.parent);)a=a.parent;var t=this.isCloneConnectSource(a),k=t?a:this.getCompositeParent(a),v=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(k.geometry.x,k.geometry.y);b==mxConstants.DIRECTION_NORTH?(v.x+=k.geometry.width/2,v.y-=e):b==mxConstants.DIRECTION_SOUTH?(v.x+=k.geometry.width/2,v.y+=k.geometry.height+e):(v.x=b==mxConstants.DIRECTION_WEST?v.x-e:v.x+(k.geometry.width+e),v.y+=k.geometry.height/2);var u=this.view.getState(this.model.getParent(a));e=this.view.scale;var y=this.view.translate;k=y.x*e;y=y.y*e;null!=u&&this.model.isVertex(u.cell)&&(k=u.x,y=u.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(v.x+=a.parent.geometry.x,v.y+=a.parent.geometry.y);d=d?null:(new mxRectangle(k+v.x*e,y+v.y*e)).grow(40*e);d=null!=d?-this.getCells(0,0,0,0,null,null,d,null,!0):null;u=this.view.getState(a);var z=null,F=null;if(null!=d){d=d.reverse();for(var D=0;D<d.length;D++)if(!this.isCellLocked(d[D])&&!this.model.isEdge(d[D])&&d[D]!=a)if(!this.model.isAncestor(a,d[D])&&this.isContainer(d[D])&&(null==z||d[D]==this.model.getParent(a)))z=d[D];else if(null==F&&this.isCellConnectable(d[D])&&!this.model.isAncestor(d[D],a)&&!this.isSwimlane(d[D])){var G=this.view.getState(d[D]);null==u||null==G||mxUtils.intersects(u,G)||(F=d[D])}}var H=-!mxEvent.isShiftDown(f)||mxEvent.isControlDown(f)||g;H&&("1"!=urlParams.sketch||g)&&(b==mxConstants.DIRECTION_NORTH?v.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?v.y+=a.geometry.height/2:v.x=b==mxConstants.DIRECTION_WEST?v.x-a.geometry.width/2:v.x+a.geometry.width/2);var M=[],N=F;F=z;g=mxUtils.bind(this,function(L){if(null==h||null!=L||null==F&&t){this.model.beginUpdate();try{if(null==N&&H){var U=this.getAbsoluteParent(null!=L?L:a);U=t?a:this.getCompositeParent(U);N=null!=L?L:this.duplicateCells([U],-!1)[0];null!=L&&this.addCells([N],this.model.getParent(a),null,null,null,!0);var X=this.getCellGeometry(N);null!=X&&(null!=L&&"1"==urlParams.sketch&&(b==mxConstants.DIRECTION_NORTH?v.y-=X.height/2:b==mxConstants.DIRECTION_SOUTH?v.y+=X.height/2:v.x=b==mxConstants.DIRECTION_WEST?v.x-X.width/2:v.x+X.width/2),X.x=v.x-X.width/2,X.y=v.y-X.height/2);null!=z?(this.addCells([N],z,null,null,null,!0),F=null):H&&!t&&this.addCells([N],this.getDefaultParent(),null,null,null,!0)}var S=mxEvent.isControlDown(f)&&-mxEvent.isShiftDown(f)&&H||null==F&&t?null:this.insertEdge(this.model.getParent(a),null,"",a,N,this.createCurrentEdgeStyle());null!=S&&(M.push(S),this.applyNewEdgeStyle(a,[S],b),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(S,a));if(null==F&&null!=N&&null!=a.parent&&t&&b==mxConstants.DIRECTION_WEST){var V=a.parent.getIndex(a);this.model.add(a.parent,N,V)}null==F&&null!=N&&M.push(N);null==N&&null!=S&&S.geometry.setTerminalPoint(v,!1);null!=S&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[S]))}finally{this.model.endUpdate()}}if(null!=l)l(M);else return M});if(null==h||null!=N||!H||null==F&&t)return g(N);h(k+v.x*e,y+v.y*e,g)};+this.getCells(0,0,0,0,null,null,d,null,!0):null;u=this.view.getState(a);var z=null,E=null;if(null!=d){d=d.reverse();for(var D=0;D<d.length;D++)if(!this.isCellLocked(d[D])&&!this.model.isEdge(d[D])&&d[D]!=a)if(!this.model.isAncestor(a,d[D])&&this.isContainer(d[D])&&(null==z||d[D]==this.model.getParent(a)))z=d[D];else if(null==E&&this.isCellConnectable(d[D])&&!this.model.isAncestor(d[D],a)&&!this.isSwimlane(d[D])){var G=this.view.getState(d[D]);null==u||null==G||mxUtils.intersects(u,G)||(E=d[D])}}var H=+!mxEvent.isShiftDown(f)||mxEvent.isControlDown(f)||g;H&&("1"!=urlParams.sketch||g)&&(b==mxConstants.DIRECTION_NORTH?v.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?v.y+=a.geometry.height/2:v.x=b==mxConstants.DIRECTION_WEST?v.x-a.geometry.width/2:v.x+a.geometry.width/2);var M=[],N=E;E=z;g=mxUtils.bind(this,function(L){if(null==h||null!=L||null==E&&t){this.model.beginUpdate();try{if(null==N&&H){var U=this.getAbsoluteParent(null!=L?L:a);U=t?a:this.getCompositeParent(U);N=null!=L?L:this.duplicateCells([U],+!1)[0];null!=L&&this.addCells([N],this.model.getParent(a),null,null,null,!0);var X=this.getCellGeometry(N);null!=X&&(null!=L&&"1"==urlParams.sketch&&(b==mxConstants.DIRECTION_NORTH?v.y-=X.height/2:b==mxConstants.DIRECTION_SOUTH?v.y+=X.height/2:v.x=b==mxConstants.DIRECTION_WEST?v.x-X.width/2:v.x+X.width/2),X.x=v.x-X.width/2,X.y=v.y-X.height/2);null!=z?(this.addCells([N],z,null,null,null,!0),E=null):H&&!t&&this.addCells([N],this.getDefaultParent(),null,null,null,!0)}var S=mxEvent.isControlDown(f)&&+mxEvent.isShiftDown(f)&&H||null==E&&t?null:this.insertEdge(this.model.getParent(a),null,"",a,N,this.createCurrentEdgeStyle());null!=S&&(M.push(S),this.applyNewEdgeStyle(a,[S],b),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(S,a));if(null==E&&null!=N&&null!=a.parent&&t&&b==mxConstants.DIRECTION_WEST){var V=a.parent.getIndex(a);this.model.add(a.parent,N,V)}null==E&&null!=N&&M.push(N);null==N&&null!=S&&S.geometry.setTerminalPoint(v,!1);null!=S&&this.fireEvent(new mxEventObject("cellsInserted",+"cells",[S]))}finally{this.model.endUpdate()}}if(null!=l)l(M);else return M});if(null==h||null!=N||!H||null==E&&t)return g(N);h(k+v.x*e,y+v.y*e,g)};Graph.prototype.getIndexableText=function(a){a=null!=a?a:this.model.getDescendants(this.model.root);for(var b=document.createElement("div"),e=[],f,g=0;g<a.length;g++)if(f=a[g],this.model.isVertex(f)||this.model.isEdge(f))this.isHtmlLabel(f)?(b.innerHTML=Graph.sanitizeHtml(this.getLabel(f)),f=mxUtils.extractTextWithWhitespace([b])):f=this.getLabel(f),f=mxUtils.trim(f.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<f.length&&e.push(f);return e.join(" ")};Graph.prototype.convertValueToString=function(a){var b=this.model.getValue(a);if(null!=b&&"object"==typeof b){var e=null;if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){b=a.getAttribute("placeholder");for(var f=a;null==e&&null!=f;)null!=f.value&&"object"==typeof f.value&&(e=f.hasAttribute(b)?null!=f.getAttribute(b)?f.getAttribute(b):"":null),f=this.model.getParent(f)}else e=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(e=b.getAttribute("label_"+Graph.diagramLanguage)),null==e&&(e=b.getAttribute("label")||"");return e||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a,b){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),b||(a=mxUtils.removeJavascriptProtocol(a)),a):null};@@ -2828,8 +2831,10 @@ InlineToolbar.prototype.getEdgeMidpoint=function(a){a=a.absolutePoints;if(null==2,(f.y+a.y)/2):null};InlineToolbar.prototype.show=function(){this.updateIcons();this.toolbar.style.display="block";this.repaint()};InlineToolbar.prototype.hide=function(){this.toolbar.style.display="none"};InlineToolbar.prototype.supportsCurvedBend=function(a){a=mxUtils.getValue(a,mxConstants.STYLE_SHAPE,null);return null==a||"connector"==a||"filledEdge"==a||"wire"==a||"pipe"==a};InlineToolbar.prototype.updateIcons=function(){if(null!=this.currentState){var a=this.graph.getCurrentCellStyle(this.currentState.cell),b=this.editorUi.getImageForEdgeStyle(a);"arrow"==a[mxConstants.STYLE_SHAPE]&&(b=Format.straightImage.src);this.icon.style.backgroundImage="url("+b+")";b=this.graph.view.getState(this.currentState.cell);b=this.supportsCurvedBend(a)||null!=b&&this.graph.isRoundedState(b);this.bendSep.style.display=b?"inline-block":"none";this.bendIcon.style.display=b?"inline-block":"none";b&&("1"==mxUtils.getValue(a,mxConstants.STYLE_CURVED,null)?this.bendIcon.style.backgroundImage="url("+Format.curvedBendImage.src+")":"1"==mxUtils.getValue(a,mxConstants.STYLE_ROUNDED,null)?this.bendIcon.style.backgroundImage="url("+Format.roundedBendImage.src+")":this.bendIcon.style.backgroundImage="url("+Format.sharpBendImage.src+")")}};-InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var a=this.graph.view.getState(this.currentState.cell);if(null!=a){this.currentState=a;this.updateIcons();var b=this.getEdgeMidpoint(a);if(null!=b){var e="none"!=this.bendIcon.style.display?2*this.iconSize+1:this.iconSize,f=this.iconSize,g=b.x-e/2,d=b.y-f-this.offset;a=this.graph.selectionCellsHandler.getHandler(a.cell);if(null!=a){var h=(a.bends||[]).concat(a.virtualBends||[]);a=mxUtils.bind(this,-function(t,k){t=new mxRectangle(Math.round(t)-8,Math.round(k)-8,e+16,f+16);for(k=0;k<h.length;k++)if(null!=h[k]&&null!=h[k].bounds&&"hidden"!==h[k].node.style.visibility&&mxUtils.intersects(t,h[k].bounds))return!0;return!1});if(a(g,d)){var l=b.y+this.offset;if(a(g,l))for(l=this.offset+8;100>l;l+=8)if(!a(g,b.y-f-l)){d=b.y-f-l;break}else{if(!a(g,b.y+l)){d=b.y+l;break}}else d=l}}this.toolbar.style.left=Math.round(g)+"px";this.toolbar.style.top=Math.round(d)+"px"}}}};+InlineToolbar.prototype.segmentIntersectsRect=function(a,b,e,f,g,d,h,l){e-=a;f-=b;f=[-e,e,-f,f];a=[a-g,g+h-a,b-d,d+l-b];b=0;g=1;for(d=0;4>d;d++)if(0==f[d]){if(0>a[d])return!1}else if(h=a[d]/f[d],0>f[d]?b=Math.max(b,h):g=Math.min(g,h),b>g)return!1;return!0};+InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var a=this.graph.view.getState(this.currentState.cell);if(null!=a){this.currentState=a;this.updateIcons();var b=this.getEdgeMidpoint(a);if(null!=b){var e="none"!=this.bendIcon.style.display?2*this.iconSize+1:this.iconSize,f=this.iconSize,g=b.x-e/2,d=b.y-f-this.offset,h=this.graph.selectionCellsHandler.getHandler(a.cell);if(null!=h){var l=(h.bends||[]).concat(h.virtualBends||[]);h=mxUtils.bind(this,+function(y,z){y=new mxRectangle(Math.round(y)-8,Math.round(z)-8,e+16,f+16);for(z=0;z<l.length;z++)if(null!=l[z]&&null!=l[z].bounds&&"hidden"!==l[z].node.style.visibility&&mxUtils.intersects(y,l[z].bounds))return!0;var E=a.absolutePoints;if(null!=E)for(z=1;z<E.length;z++)if(null!=E[z]&&null!=E[z-1]&&this.segmentIntersectsRect(E[z-1].x,E[z-1].y,E[z].x,E[z].y,y.x,y.y,y.width,y.height))return!0;return!1});if(h(g,d)){var t=b.y+this.offset,k=!1;h(g,t)||(d=t,k=!0);if(!k){t=b.y-f/2;var v=b.x-e-this.offset,+u=b.x+this.offset;h(v,t)?h(u,t)||(g=u,d=t,k=!0):(g=v,d=t,k=!0)}if(!k)for(t=b.y-f/2,k=this.offset+8;100>k;k+=8)if(!h(g,b.y-f-k)){d=b.y-f-k;break}else if(!h(g,b.y+k)){d=b.y+k;break}else if(!h(b.x-e-k,t)){g=b.x-e-k;d=t;break}else if(!h(b.x+k,t)){g=b.x+k;d=t;break}}}this.toolbar.style.left=Math.round(g)+"px";this.toolbar.style.top=Math.round(d)+"px"}}}};InlineToolbar.prototype.showMenu=function(a){var b=this.editorUi;b.hideCurrentMenu();b.showPopupMenu(mxUtils.bind(this,function(e,f){b.menus.addMenu("line",e,f)}),mxEvent.getClientX(a),mxEvent.getClientY(a),a)};InlineToolbar.prototype.showBendMenu=function(a){var b=this.editorUi;b.hideCurrentMenu();b.showPopupMenu(mxUtils.bind(this,function(e,f){var g=b.menus,d=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED];Format.processMenuIcon(g.edgeStyleChange(e,"",d,["0","0"],null,f,!1,Format.sharpBendImage.src)).setAttribute("title",mxResources.get("sharp"));Format.processMenuIcon(g.edgeStyleChange(e,"",d,["1","0"],null,f,!1,Format.roundedBendImage.src)).setAttribute("title",mxResources.get("rounded"));if(null!=this.currentState){var h=this.graph.getCurrentCellStyle(this.currentState.cell);this.supportsCurvedBend(h)&&Format.processMenuIcon(g.edgeStyleChange(e,"",d,["0","1"],null,f,!1,Format.curvedBendImage.src)).setAttribute("title",mxResources.get("curved"))}}),mxEvent.getClientX(a),mxEvent.getClientY(a),a)};@@ -2855,27 +2860,27 @@ TableLayout.prototype.getRowLayout=function(a,b){var e=this.graph.model.getChildTableLayout.prototype.layoutRow=function(a,b,e,f){var g=this.graph.getModel(),d=g.getChildCells(a,!0);a=this.graph.getActualStartSize(a,!0);var h=a.x,l=0;null!=b&&(b=b.slice(),b.splice(0,0,a.x));for(var t=0;t<d.length;t++){var k=this.graph.getCellGeometry(d[t]);null!=k&&(k=k.clone(),k.y=a.y,k.height=e-a.y-a.height,null!=b?(k.x=b[t],k.width=b[t+1]-k.x,t==d.length-1&&t<b.length-2&&(k.width=f-k.x-a.x-a.width)):(k.x=h,h+=k.width,t==d.length-1?k.width=f-a.x-a.width-l:l+=k.width),k.alternateBounds=new mxRectangle(0,0,k.width,k.height),g.setGeometry(d[t],k))}return l};TableLayout.prototype.execute=function(a){if(null!=a){var b=this.graph.getActualStartSize(a,!0),e=this.graph.getCellGeometry(a),f=this.graph.getCellStyle(a),g="1"==mxUtils.getValue(f,"resizeLastRow","0"),d="1"==mxUtils.getValue(f,"resizeLast","0");f="1"==mxUtils.getValue(f,"fixedRows","0");var h=this.graph.getModel(),l=0;h.beginUpdate();try{for(var t=e.height-b.y-b.height,k=e.width-b.x-b.width,v=h.getChildCells(a,!0),u=0;u<v.length;u++)h.setVisible(v[u],!0);var y=this.getSize(v,!1);if(0<t&&0<k&&0<-v.length&&0<y){if(g){var z=this.graph.getCellGeometry(v[v.length-1]);null!=z&&(z=z.clone(),z.height=t-y+z.height,h.setGeometry(v[v.length-1],z))}var F=d?null:this.getRowLayout(v[0],k),D=[],G=b.y;for(u=0;u<v.length;u++)z=this.graph.getCellGeometry(v[u]),null!=z&&(z=z.clone(),z.x=b.x,z.width=k,z.y=Math.round(G),G=g||f?G+z.height:G+z.height/y*t,z.height=Math.round(G)-z.y,h.setGeometry(v[u],z)),l=Math.max(l,this.layoutRow(v[u],F,z.height,k,D));f&&t<y&&(e=e.clone(),e.height=G+b.height,h.setGeometry(a,+v.length&&0<y){if(g){var z=this.graph.getCellGeometry(v[v.length-1]);null!=z&&(z=z.clone(),z.height=t-y+z.height,h.setGeometry(v[v.length-1],z))}var E=d?null:this.getRowLayout(v[0],k),D=[],G=b.y;for(u=0;u<v.length;u++)z=this.graph.getCellGeometry(v[u]),null!=z&&(z=z.clone(),z.x=b.x,z.width=k,z.y=Math.round(G),G=g||f?G+z.height:G+z.height/y*t,z.height=Math.round(G)-z.y,h.setGeometry(v[u],z)),l=Math.max(l,this.layoutRow(v[u],E,z.height,k,D));f&&t<y&&(e=e.clone(),e.height=G+b.height,h.setGeometry(a,e));d&&k<l+Graph.minTableColumnWidth&&(e=e.clone(),e.width=l+b.width+b.x+Graph.minTableColumnWidth,h.setGeometry(a,e));this.graph.visitTableCells(a,mxUtils.bind(this,function(H){h.setVisible(H.cell,H.actual.cell==H.cell);if(H.actual.cell!=H.cell){if(H.actual.row==H.row){var M=null!=H.geo.alternateBounds?H.geo.alternateBounds:H.geo;H.actual.geo.width+=M.width}H.actual.col==H.col&&(M=null!=H.geo.alternateBounds?H.geo.alternateBounds:H.geo,H.actual.geo.height+=M.height)}}))}else for(u=0;u<v.length;u++)h.setVisible(v[u],!1)}finally{h.endUpdate()}}};(function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(u,y){y=null!=y?y:!0;var z=this.getState(u);null!=z&&y&&this.graph.model.isEdge(z.cell)&&null!=z.style&&1!=z.style[mxConstants.STYLE_CURVED]&&!z.invalid&&this.updateLineJumps(z)&&this.graph.cellRenderer.redraw(z,!1,this.isRendering());if(null!=z&&z.invalid){if(this.graph.showLinkIcons){z=-this.graph.getLinkForCell(u);var F=null!=z&&0<z.length,D=!1;if(null!=u.overlays)for(z=0;z<u.overlays.length;z++)if(u.overlays[z].isLinkOverlay){D=!0;break}if(F&&!D)z=this.graph.createLinkOverlay(u),null!=z&&(null==u.overlays&&(u.overlays=[]),u.overlays.push(z));else if(!F&&D){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isLinkOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}else if(null!=u.overlays){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isLinkOverlay&&u.overlays.splice(z,-1);0==u.overlays.length&&(u.overlays=null)}if(this.graph.showTooltipIcons){z=this.graph.convertValueToTooltip(u);F=null!=z&&0<z.length;D=!1;if(null!=u.overlays)for(z=0;z<u.overlays.length;z++)if(u.overlays[z].isTooltipOverlay){D=!0;break}if(F&&!D)z=this.graph.createTooltipOverlay(u),null!=z&&(null==u.overlays&&(u.overlays=[]),u.overlays.push(z));else if(!F&&D){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isTooltipOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}else if(null!=+this.graph.getLinkForCell(u);var E=null!=z&&0<z.length,D=!1;if(null!=u.overlays)for(z=0;z<u.overlays.length;z++)if(u.overlays[z].isLinkOverlay){D=!0;break}if(E&&!D)z=this.graph.createLinkOverlay(u),null!=z&&(null==u.overlays&&(u.overlays=[]),u.overlays.push(z));else if(!E&&D){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isLinkOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}else if(null!=u.overlays){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isLinkOverlay&&u.overlays.splice(z,+1);0==u.overlays.length&&(u.overlays=null)}if(this.graph.showTooltipIcons){z=this.graph.convertValueToTooltip(u);E=null!=z&&0<z.length;D=!1;if(null!=u.overlays)for(z=0;z<u.overlays.length;z++)if(u.overlays[z].isTooltipOverlay){D=!0;break}if(E&&!D)z=this.graph.createTooltipOverlay(u),null!=z&&(null==u.overlays&&(u.overlays=[]),u.overlays.push(z));else if(!E&&D){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isTooltipOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}else if(null!=u.overlays){for(z=u.overlays.length-1;0<=z;z--)u.overlays[z].isTooltipOverlay&&u.overlays.splice(z,1);0==u.overlays.length&&(u.overlays=null)}}z=b.apply(this,arguments);null!=z&&y&&this.graph.model.isEdge(z.cell)&&null!=z.style&&1!=z.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(z);return z};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(u){var y=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=y)for(var z=null,F=0;F<y.length;F++)if("hidden"!=y[F].getAttribute("visibility")){if(!(null!=z&&z!=y[F].getAttribute("d")||null!=u&&0!=--u))return y[F]}else null==z&&(z=y[F].getAttribute("d"));return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,+"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(u){var y=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=y)for(var z=null,E=0;E<y.length;E++)if("hidden"!=y[E].getAttribute("visibility")){if(!(null!=z&&z!=y[E].getAttribute("d")||null!=u&&0!=--u))return y[E]}else null==z&&(z=y[E].getAttribute("d"));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 e=mxShape.prototype.paint;mxShape.prototype.paint=function(u){e.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var f=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(u){u=f.apply(this,arguments);null!=this.state&&(u.adaptiveColors=this.state.view.graph.getAdaptiveColors());return u};var g=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=-function(u,y){return g.apply(this,arguments)||null!=u.routedPoints&&null!=y.routedPoints&&!mxUtils.equalPoints(y.routedPoints,u.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(u){d.apply(this,arguments);this.graph.model.isEdge(u.cell)&&1!=u.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(u)};mxGraphView.prototype.updateLineJumps=function(u){var y=u.absolutePoints;if(Graph.lineJumpsEnabled){var z=null!=u.routedPoints,F=null;if(null!=y&&-null!=this.validEdges&&"none"!==mxUtils.getValue(u.style,"jumpStyle","none")){var D=function(ba,K,T){var aa=new mxPoint(K,T);aa.type=ba;F.push(aa);aa=null!=u.routedPoints?u.routedPoints[F.length-1]:null;return null==aa||aa.type!=ba||aa.x!=K||aa.y!=T},G=.5*this.scale;z=!1;F=[];for(var H=0;H<y.length-1;H++){for(var M=y[H+1],N=y[H],L=[],U=y[H+2];H<y.length-2&&mxUtils.ptSegDistSq(N.x,N.y,U.x,U.y,M.x,M.y)<1*this.scale*this.scale;)M=U,H++,U=y[H+2];z=D(0,N.x,N.y)||z;for(var X=0;X<this.validEdges.length;X++){var S=+function(u,y){return g.apply(this,arguments)||null!=u.routedPoints&&null!=y.routedPoints&&!mxUtils.equalPoints(y.routedPoints,u.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(u){d.apply(this,arguments);this.graph.model.isEdge(u.cell)&&1!=u.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(u)};mxGraphView.prototype.updateLineJumps=function(u){var y=u.absolutePoints;if(Graph.lineJumpsEnabled){var z=null!=u.routedPoints,E=null;if(null!=y&&+null!=this.validEdges&&"none"!==mxUtils.getValue(u.style,"jumpStyle","none")){var D=function(ba,K,T){var aa=new mxPoint(K,T);aa.type=ba;E.push(aa);aa=null!=u.routedPoints?u.routedPoints[E.length-1]:null;return null==aa||aa.type!=ba||aa.x!=K||aa.y!=T},G=.5*this.scale;z=!1;E=[];for(var H=0;H<y.length-1;H++){for(var M=y[H+1],N=y[H],L=[],U=y[H+2];H<y.length-2&&mxUtils.ptSegDistSq(N.x,N.y,U.x,U.y,M.x,M.y)<1*this.scale*this.scale;)M=U,H++,U=y[H+2];z=D(0,N.x,N.y)||z;for(var X=0;X<this.validEdges.length;X++){var S=this.validEdges[X],V=S.absolutePoints;if(null!=V&&mxUtils.intersects(u,S)&&"1"!=S.style.noJump){var ha=null;for(S=0;S<V.length-1;S++){var R=V[S+1],Z=V[S];for(U=V[S+2];S<V.length-2&&mxUtils.ptSegDistSq(Z.x,Z.y,U.x,U.y,R.x,R.y)<1*this.scale*this.scale;)R=U,S++,U=V[S+2];var W=mxUtils.intersection(N.x,N.y,M.x,M.y,Z.x,Z.y,R.x,R.y);if(null!=W&&(Math.abs(W.x-N.x)>G||Math.abs(W.y-N.y)>G)&&(Math.abs(W.x-M.x)>G||Math.abs(W.y-M.y)>G)&&(null==ha||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,ha.x,ha.y)>G||mxUtils.ptLineDist(N.x,-N.y,M.x,M.y,Z.x,Z.y)>G)&&(null==U||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,U.x,U.y)>G||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,R.x,R.y)>G)){U=W.x-N.x;ha=W.y-N.y;W={distSq:U*U+ha*ha,x:W.x,y:W.y};for(U=0;U<L.length;U++)if(L[U].distSq>W.distSq){L.splice(U,0,W);W=null;break}null==W||0!=L.length&&L[L.length-1].x===W.x&&L[L.length-1].y===W.y||L.push(W)}ha=Z}}}for(S=0;S<L.length;S++)z=D(1,L[S].x,L[S].y)||z}W=y[y.length-1];z=D(0,W.x,W.y)||z}u.routedPoints=F;return z}return!1};var h=mxConnector.prototype.paintLine;-mxConnector.prototype.paintLine=function(u,y,z){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)h.apply(this,arguments);else{var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,D=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,G=mxUtils.getValue(this.style,"jumpStyle","none"),H=!0,M=+N.y,M.x,M.y,Z.x,Z.y)>G)&&(null==U||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,U.x,U.y)>G||mxUtils.ptLineDist(N.x,N.y,M.x,M.y,R.x,R.y)>G)){U=W.x-N.x;ha=W.y-N.y;W={distSq:U*U+ha*ha,x:W.x,y:W.y};for(U=0;U<L.length;U++)if(L[U].distSq>W.distSq){L.splice(U,0,W);W=null;break}null==W||0!=L.length&&L[L.length-1].x===W.x&&L[L.length-1].y===W.y||L.push(W)}ha=Z}}}for(S=0;S<L.length;S++)z=D(1,L[S].x,L[S].y)||z}W=y[y.length-1];z=D(0,W.x,W.y)||z}u.routedPoints=E;return z}return!1};var h=mxConnector.prototype.paintLine;+mxConnector.prototype.paintLine=function(u,y,z){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)h.apply(this,arguments);else{var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,D=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,G=mxUtils.getValue(this.style,"jumpStyle","none"),H=!0,M=null,N=null,L=[],U=null;u.begin();for(var X=0;X<this.state.routedPoints.length;X++){var S=this.state.routedPoints[X],V=new mxPoint(S.x/this.scale,S.y/this.scale);0==X?V=y[0]:X==this.state.routedPoints.length-1&&(V=y[y.length-1]);var ha=!1;if(null!=M&&1==S.type){var R=this.state.routedPoints[X+1];S=R.x/this.scale-V.x;R=R.y/this.scale-V.y;S=S*S+R*R;null==U&&(U=new mxPoint(V.x-M.x,V.y-M.y),N=Math.sqrt(U.x*U.x+U.y*U.y),0<N?(U.x=U.x*D/N,U.y=U.y*D/N):U=null);S>D*D&&0<N&&(S=M.x-V.x,R=M.y-V.y,S=S*S+R*R,S>-D*D&&(ha=new mxPoint(V.x-U.x,V.y-U.y),S=new mxPoint(V.x+U.x,V.y+U.y),L.push(ha),this.addPoints(u,L,z,F,!1,null,H),L=0>Math.round(U.x)||0==Math.round(U.x)&&0>=Math.round(U.y)?1:-1,H=!1,"sharp"==G?(u.lineTo(ha.x-U.y*L,ha.y+U.x*L),u.lineTo(S.x-U.y*L,S.y+U.x*L),u.lineTo(S.x,S.y)):"line"==G?(u.moveTo(ha.x+U.y*L,ha.y-U.x*L),u.lineTo(ha.x-U.y*L,ha.y+U.x*L),u.moveTo(S.x-U.y*L,S.y+U.x*L),u.lineTo(S.x+U.y*L,S.y-U.x*L),u.moveTo(S.x,S.y)):"arc"==G?(L*=1.3,u.curveTo(ha.x-U.y*L,ha.y+U.x*L,S.x-U.y*L,S.y+U.x*L,S.x,-S.y)):(u.moveTo(S.x,S.y),H=!0),L=[S],ha=!0))}else U=null;ha||(L.push(V),M=V)}this.addPoints(u,L,z,F,!1,null,H);u.stroke()}};var l=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(u,y,z,F){return null!=y&&"centerPerimeter"==y.style[mxConstants.STYLE_PERIMETER]?new mxPoint(y.getCenterX(),y.getCenterY()):l.apply(this,arguments)};var t=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(u,y,z,F){if(null==-y||null==u||"1"!=y.style.snapToPoint&&"1"!=u.style.snapToPoint)t.apply(this,arguments);else{y=this.getTerminalPort(u,y,F);var D=this.getNextPoint(u,z,F),G=this.graph.isOrthogonal(u),H=mxUtils.toRadians(Number(y.style[mxConstants.STYLE_ROTATION]||"0")),M=new mxPoint(y.getCenterX(),y.getCenterY());if(0!=H){var N=Math.cos(-H),L=Math.sin(-H);D=mxUtils.getRotatedPoint(D,N,L,M)}N=parseFloat(u.style[mxConstants.STYLE_PERIMETER_SPACING]||0);N+=parseFloat(u.style[F?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:-mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);D=this.getPerimeterPoint(y,D,0==H&&G,N);0!=H&&(N=Math.cos(H),L=Math.sin(H),D=mxUtils.getRotatedPoint(D,N,L,M));u.setAbsoluteTerminalPoint(this.snapToAnchorPoint(u,y,z,F,D),F)}};mxGraphView.prototype.snapToAnchorPoint=function(u,y,z,F,D){if(null!=y&&null!=u){u=this.graph.getAllConnectionConstraints(y);F=z=null;if(null!=u)for(var G=0;G<u.length;G++){var H=this.graph.getConnectionPoint(y,u[G]);if(null!=H){var M=(H.x-D.x)*(H.x-D.x)+(H.y-D.y)*(H.y-D.y);if(null==-F||M<F)z=H,F=M}}null!=z&&(D=z)}return D};var k=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(u,y,z){var F=k.apply(this,arguments);"1"==u.getAttribute("placeholders")&&null!=z.state&&(F=z.state.view.graph.replacePlaceholders(z.state.cell,F));return F};var v=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(u){if(null!=u.style&&"undefined"!==typeof pako){var y=mxUtils.getValue(u.style,mxConstants.STYLE_SHAPE,null);if(null!=-y&&"string"===typeof y&&"stencil("==y.substring(0,8))try{var z=y.substring(8,y.length-1),F=mxUtils.parseXml(Graph.decompress(z));return new mxShape(new mxStencil(F.documentElement))}catch(D){null!=window.console&&console.log("Error in shape: "+D)}}return v.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};+D*D&&(ha=new mxPoint(V.x-U.x,V.y-U.y),S=new mxPoint(V.x+U.x,V.y+U.y),L.push(ha),this.addPoints(u,L,z,E,!1,null,H),L=0>Math.round(U.x)||0==Math.round(U.x)&&0>=Math.round(U.y)?1:-1,H=!1,"sharp"==G?(u.lineTo(ha.x-U.y*L,ha.y+U.x*L),u.lineTo(S.x-U.y*L,S.y+U.x*L),u.lineTo(S.x,S.y)):"line"==G?(u.moveTo(ha.x+U.y*L,ha.y-U.x*L),u.lineTo(ha.x-U.y*L,ha.y+U.x*L),u.moveTo(S.x-U.y*L,S.y+U.x*L),u.lineTo(S.x+U.y*L,S.y-U.x*L),u.moveTo(S.x,S.y)):"arc"==G?(L*=1.3,u.curveTo(ha.x-U.y*L,ha.y+U.x*L,S.x-U.y*L,S.y+U.x*L,S.x,+S.y)):(u.moveTo(S.x,S.y),H=!0),L=[S],ha=!0))}else U=null;ha||(L.push(V),M=V)}this.addPoints(u,L,z,E,!1,null,H);u.stroke()}};var l=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(u,y,z,E){return null!=y&&"centerPerimeter"==y.style[mxConstants.STYLE_PERIMETER]?new mxPoint(y.getCenterX(),y.getCenterY()):l.apply(this,arguments)};var t=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(u,y,z,E){if(null==+y||null==u||"1"!=y.style.snapToPoint&&"1"!=u.style.snapToPoint)t.apply(this,arguments);else{y=this.getTerminalPort(u,y,E);var D=this.getNextPoint(u,z,E),G=this.graph.isOrthogonal(u),H=mxUtils.toRadians(Number(y.style[mxConstants.STYLE_ROTATION]||"0")),M=new mxPoint(y.getCenterX(),y.getCenterY());if(0!=H){var N=Math.cos(-H),L=Math.sin(-H);D=mxUtils.getRotatedPoint(D,N,L,M)}N=parseFloat(u.style[mxConstants.STYLE_PERIMETER_SPACING]||0);N+=parseFloat(u.style[E?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:+mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);D=this.getPerimeterPoint(y,D,0==H&&G,N);0!=H&&(N=Math.cos(H),L=Math.sin(H),D=mxUtils.getRotatedPoint(D,N,L,M));u.setAbsoluteTerminalPoint(this.snapToAnchorPoint(u,y,z,E,D),E)}};mxGraphView.prototype.snapToAnchorPoint=function(u,y,z,E,D){if(null!=y&&null!=u){u=this.graph.getAllConnectionConstraints(y);E=z=null;if(null!=u)for(var G=0;G<u.length;G++){var H=this.graph.getConnectionPoint(y,u[G]);if(null!=H){var M=(H.x-D.x)*(H.x-D.x)+(H.y-D.y)*(H.y-D.y);if(null==+E||M<E)z=H,E=M}}null!=z&&(D=z)}return D};var k=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(u,y,z){var E=k.apply(this,arguments);"1"==u.getAttribute("placeholders")&&null!=z.state&&(E=z.state.view.graph.replacePlaceholders(z.state.cell,E));return E};var v=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(u){if(null!=u.style&&"undefined"!==typeof pako){var y=mxUtils.getValue(u.style,mxConstants.STYLE_SHAPE,null);if(null!=+y&&"string"===typeof y&&"stencil("==y.substring(0,8))try{var z=y.substring(8,y.length-1),E=mxUtils.parseXml(Graph.decompress(z));return new mxShape(new mxStencil(E.documentElement))}catch(D){null!=window.console&&console.log("Error in shape: "+D)}}return v.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(a){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[a]};mxStencilRegistry.setFileLoaded=function(a){mxStencilRegistry.filesLoaded[a]=!0};mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var f=0;f<b.length;f++){var g=b[f];if(!mxStencilRegistry.isFileLoaded(g))if(mxStencilRegistry.setFileLoaded(g),".xml"==g.toLowerCase().substring(g.length-4,g.length))mxStencilRegistry.loadStencilSet(g,null);else if(".js"==g.toLowerCase().substring(g.length-3,g.length))try{if(mxStencilRegistry.allowEval){var d=mxUtils.load(g);null!=d&&200<=d.getStatus()&&299>=d.getStatus()&&eval.call(window,d.getText())}}catch(h){null!=window.console&&console.log("error in getStencil:",a,e,b,g,h)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);b=mxStencilRegistry.stencils[a]}}return b};@@ -2889,168 +2894,168 @@ mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#005;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#707070" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'<path d="Z" stroke="#C0C0C0" stroke-width="1" fill="none"/>').src;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(q){return!mxEvent.isAltDown(q)||mxEvent.isShiftDown(q)};var e=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(q){return e.apply(this,arguments)||this.graph.isTableRow(q)||this.graph.isTableCell(q)};var f=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(q){return f.apply(this,arguments)||this.graph.isEdgeIgnored(q)};var g=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(q){return this.graph.isCloneEvent(q)!=g.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var q=new mxEllipse(null,this.highlightColor,this.highlightColor,0);q.opacity=mxConstants.HIGHLIGHT_OPACITY;return q};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor=-"crosshair";mxConnectionHandler.prototype.createEdgeState=function(q){q=this.graph.createCurrentEdgeStyle();q=this.graph.createEdge(null,null,null,null,null,q);q=new mxCellState(this.graph.view,q,this.graph.getCellStyle(q));for(var B in this.graph.currentEdgeStyle)q.style[B]=this.graph.currentEdgeStyle[B];if(null!=this.previous){var C=this.previous.style.newEdgeStyle;if(null!=C)try{var E=JSON.parse(C);for(B in E)q.style[B]=E[B]}catch(J){}}q.style=this.graph.postProcessCellStyle(q.cell,q.style);return q};-var d=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var q=d.apply(this,arguments);q.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return q};mxConnectionHandler.prototype.updatePreview=function(q){};var h=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var q=h.apply(this,arguments),B=q.getCell;q.getCell=mxUtils.bind(this,function(C){var E=B.apply(this,arguments);this.error=null;return E});+"crosshair";mxConnectionHandler.prototype.createEdgeState=function(q){q=this.graph.createCurrentEdgeStyle();q=this.graph.createEdge(null,null,null,null,null,q);q=new mxCellState(this.graph.view,q,this.graph.getCellStyle(q));for(var B in this.graph.currentEdgeStyle)q.style[B]=this.graph.currentEdgeStyle[B];if(null!=this.previous){var C=this.previous.style.newEdgeStyle;if(null!=C)try{var F=JSON.parse(C);for(B in F)q.style[B]=F[B]}catch(J){}}q.style=this.graph.postProcessCellStyle(q.cell,q.style);return q};+var d=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var q=d.apply(this,arguments);q.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return q};mxConnectionHandler.prototype.updatePreview=function(q){};var h=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var q=h.apply(this,arguments),B=q.getCell;q.getCell=mxUtils.bind(this,function(C){var F=B.apply(this,arguments);this.error=null;return F});return q};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var q="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",B="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),C=0;C<B.length;C++)null!=this.currentEdgeStyle[B[C]]&&(q+=B[C]+"="+this.currentEdgeStyle[B[C]]+";");null!=this.currentEdgeStyle.orthogonalLoop?q+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(q+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?q+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(q+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(q+="elbow="+this.currentEdgeStyle.elbow+";");return q=null!=this.currentEdgeStyle.html?q+("html="+this.currentEdgeStyle.html+";"):q+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var q=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=-q&&(new mxCodec(q.ownerDocument)).decode(q,this.getStylesheet())};Graph.prototype.createCellLookup=function(q,B){B=null!=B?B:{};for(var C=0;C<q.length;C++){var E=q[C];B[mxObjectIdentity.get(E)]=E.getId();for(var J=this.model.getChildCount(E),P=0;P<J;P++)this.createCellLookup([this.model.getChildAt(E,P)],B)}return B};Graph.prototype.createCellMapping=function(q,B,C){C=null!=C?C:{};for(var E in q){var J=B[E];null==C[J]&&(C[J]=q[E].getId()||"")}return C};Graph.prototype.importGraphModel=function(q,B,-C,E){B=null!=B?B:0;C=null!=C?C:0;var J=new mxCodec(q.ownerDocument),P=new mxGraphModel;J.decode(q,P);q=[];J={};var Y={},ma=P.getChildren(this.cloneCell(P.root,this.isCloneInvalidEdges(),J));if(null!=ma){var ca=this.createCellLookup([P.root]);ma=ma.slice();this.model.beginUpdate();try{if(1!=ma.length||this.isCellLocked(this.getDefaultParent()))for(P=0;P<ma.length;P++)na=this.model.getChildren(this.moveCells([ma[P]],B,C,!1,this.model.getRoot())[0]),null!=na&&(q=q.concat(na));else{var na=P.getChildren(ma[0]);-null!=na&&(q=this.moveCells(na,B,C,!1,this.getDefaultParent()),Y[P.getChildAt(P.root,0).getId()]=this.getDefaultParent().getId())}if(null!=q&&(this.createCellMapping(J,ca,Y),this.updateCustomLinks(Y,q),E)){this.isGridEnabled()&&(B=this.snap(B),C=this.snap(C));var ta=this.getBoundingBoxFromGeometry(q,!0);null!=ta&&this.moveCells(q,B-ta.x,C-ta.y)}}finally{this.model.endUpdate()}}return q};Graph.prototype.encodeCells=function(q){for(var B={},C=this.cloneCells(q,null,B),E=new mxDictionary,J=0;J<q.length;J++)E.put(q[J],-!0);var P=new mxCodec,Y=new mxGraphModel,ma=Y.getChildAt(Y.getRoot(),0);for(J=0;J<C.length;J++){Y.add(ma,C[J]);var ca=this.view.getState(q[J]);if(null!=ca){var na=this.getCellGeometry(C[J]);null!=na&&na.relative&&!this.model.isEdge(q[J])&&null==E.get(this.model.getParent(q[J]))&&(na.offset=null,na.relative=!1,na.x=ca.x/ca.view.scale-ca.view.translate.x,na.y=ca.y/ca.view.scale-ca.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(B,this.createCellLookup(q)),C);return P.encode(Y)};Graph.prototype.isSwimlane=+q&&(new mxCodec(q.ownerDocument)).decode(q,this.getStylesheet())};Graph.prototype.createCellLookup=function(q,B){B=null!=B?B:{};for(var C=0;C<q.length;C++){var F=q[C];B[mxObjectIdentity.get(F)]=F.getId();for(var J=this.model.getChildCount(F),P=0;P<J;P++)this.createCellLookup([this.model.getChildAt(F,P)],B)}return B};Graph.prototype.createCellMapping=function(q,B,C){C=null!=C?C:{};for(var F in q){var J=B[F];null==C[J]&&(C[J]=q[F].getId()||"")}return C};Graph.prototype.importGraphModel=function(q,B,+C,F){B=null!=B?B:0;C=null!=C?C:0;var J=new mxCodec(q.ownerDocument),P=new mxGraphModel;J.decode(q,P);q=[];J={};var Y={},ma=P.getChildren(this.cloneCell(P.root,this.isCloneInvalidEdges(),J));if(null!=ma){var ca=this.createCellLookup([P.root]);ma=ma.slice();this.model.beginUpdate();try{if(1!=ma.length||this.isCellLocked(this.getDefaultParent()))for(P=0;P<ma.length;P++)na=this.model.getChildren(this.moveCells([ma[P]],B,C,!1,this.model.getRoot())[0]),null!=na&&(q=q.concat(na));else{var na=P.getChildren(ma[0]);+null!=na&&(q=this.moveCells(na,B,C,!1,this.getDefaultParent()),Y[P.getChildAt(P.root,0).getId()]=this.getDefaultParent().getId())}if(null!=q&&(this.createCellMapping(J,ca,Y),this.updateCustomLinks(Y,q),F)){this.isGridEnabled()&&(B=this.snap(B),C=this.snap(C));var ta=this.getBoundingBoxFromGeometry(q,!0);null!=ta&&this.moveCells(q,B-ta.x,C-ta.y)}}finally{this.model.endUpdate()}}return q};Graph.prototype.encodeCells=function(q){for(var B={},C=this.cloneCells(q,null,B),F=new mxDictionary,J=0;J<q.length;J++)F.put(q[J],+!0);var P=new mxCodec,Y=new mxGraphModel,ma=Y.getChildAt(Y.getRoot(),0);for(J=0;J<C.length;J++){Y.add(ma,C[J]);var ca=this.view.getState(q[J]);if(null!=ca){var na=this.getCellGeometry(C[J]);null!=na&&na.relative&&!this.model.isEdge(q[J])&&null==F.get(this.model.getParent(q[J]))&&(na.offset=null,na.relative=!1,na.x=ca.x/ca.view.scale-ca.view.translate.x,na.y=ca.y/ca.view.scale-ca.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(B,this.createCellLookup(q)),C);return P.encode(Y)};Graph.prototype.isSwimlane=function(q,B){var C=null;null==q||this.model.isEdge(q)||this.model.getParent(q)==this.model.getRoot()||(C=this.getCurrentCellStyle(q,B)[mxConstants.STYLE_SHAPE]);return C==mxConstants.SHAPE_SWIMLANE||"table"==C||"tableRow"==C};var l=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(q){return null!=q&&l.apply(this,arguments)?this.isTableCell(q)||this.isTableRow(q)?this.isCellEditable(this.model.getParent(q)):!0:!1};var t=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=-function(q){return null!=q&&t.apply(this,arguments)?this.isTableCell(q)||this.isTableRow(q)?this.isCellMovable(this.model.getParent(q)):!0:!1};var k=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(q){var B=this.model.getParent(q);if(null!=B){var C=this.getCurrentCellStyle(B);if(null!=C.expand)return"0"!=C.expand}return k.apply(this,arguments)&&(null==B||!this.isTable(B))};var v=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(q,B,C,E,J,P,Y,ma){null==ma&&(ma=this.model.getParent(q),-this.isTable(ma)||this.isTableRow(ma))&&(ma=this.getCellAt(P,Y,null,!0,!1));C=null;this.model.beginUpdate();try{var ca=this.getCellGeometry(q);if(null!=ca&&null!=ca.points&&0<ca.points.length&&1==B.length&&this.model.isVertex(B[0])){var na=this.getCellGeometry(B[0]);if(null!=na&&!na.relative){var ta=new mxRectangle(na.x+E,na.y+J,na.width,na.height),Fa=ca.points;na=[];for(var Da=0;Da<Fa.length;Da++)ta.intersectsPoint(Fa[Da].x,Fa[Da].y)||na.push(Fa[Da]);na.length<Fa.length&&(ca=ca.clone(),ca.points=-na,this.model.setGeometry(q,ca))}}C=v.apply(this,[q,B,C,E,J,P,Y,ma]);this.model.setValue(C,"");var Na=this.getChildCells(C,!0);for(Da=0;Da<Na.length;Da++)ca=this.getCellGeometry(Na[Da]),null!=ca&&ca.relative&&0<ca.x&&this.model.remove(Na[Da]);var Ra=this.getChildCells(q,!0);for(Da=0;Da<Ra.length;Da++)ca=this.getCellGeometry(Ra[Da]),null!=ca&&ca.relative&&0>=ca.x&&this.model.remove(Ra[Da]);var Sa=this.model.getTerminal(C,!1);if(null!=Sa){var Aa=this.getCurrentCellStyle(Sa);null!=Aa&&"1"==Aa.snapToPoint&&-(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[q]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[q]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[C]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[C]))}}finally{this.model.endUpdate()}return C};var u=Graph.prototype.selectCell;Graph.prototype.selectCell=function(q,B,C){if(B||C)u.apply(this,arguments);else{var E=this.getSelectionCell(),J=null,P=[],Y=mxUtils.bind(this,function(ma){if(null!=this.view.getState(ma)&&(this.model.isVertex(ma)||-this.model.isEdge(ma)))if(P.push(ma),ma==E)J=P.length-1;else if(q&&null==E&&0<P.length||null!=J&&q&&P.length>J||!q&&0<J)return;for(var ca=0;ca<this.model.getChildCount(ma);ca++)Y(this.model.getChildAt(ma,ca))});Y(this.model.root);0<P.length&&(J=null!=J?mxUtils.mod(J+(q?1:-1),P.length):0,this.setSelectionCell(P[J]))}};Graph.prototype.swapShapes=function(q,B){if(this.model.isVertex(q)&&this.model.isVertex(B)&&2==this.getMovableCells([q,B]).length){var C=this.getCellGeometry(q),E=this.getCellGeometry(B);-if(null!=C&&null!=E){var J=C.clone(),P=E.clone();this.model.beginUpdate();try{J.x=E.getCenterX()-C.width/2,J.y=E.getCenterY()-C.height/2,P.x=C.getCenterX()-E.width/2,P.y=C.getCenterY()-E.height/2,this.model.setGeometry(q,J),this.model.setGeometry(B,P)}finally{this.model.endUpdate()}}}};var y=Graph.prototype.moveCells;Graph.prototype.moveCells=function(q,B,C,E,J,P,Y){Y=null!=Y?Y:{};if(this.isTable(J)){for(var ma=[],ca=0;ca<q.length;ca++)this.isTable(q[ca])?ma=ma.concat(this.model.getChildCells(q[ca],-!0).reverse()):ma.push(q[ca]);q=ma}this.model.beginUpdate();try{ma=[];for(ca=0;ca<q.length;ca++)if(null!=J&&this.isTableRow(q[ca])){var na=this.model.getParent(q[ca]),ta=this.getCellGeometry(q[ca]);this.isTable(na)&&ma.push(na);if(null!=na&&null!=ta&&this.isTable(na)&&this.isTable(J)&&(E||na!=J)){if(!E){var Fa=this.getCellGeometry(na);null!=Fa&&(Fa=Fa.clone(),Fa.height-=ta.height,this.model.setGeometry(na,Fa))}Fa=this.getCellGeometry(J);null!=Fa&&(Fa=Fa.clone(),Fa.height+=ta.height,this.model.setGeometry(J,-Fa));var Da=this.model.getChildCells(J,!0);if(0<Da.length){q[ca]=E?this.cloneCell(q[ca]):q[ca];var Na=this.model.getChildCells(q[ca],!0),Ra=this.model.getChildCells(Da[0],!0),Sa=Ra.length-Na.length;if(0<Sa)for(var Aa=0;Aa<Sa;Aa++){var cb=this.cloneCell(Na[Na.length-1]);null!=cb&&(cb.value="",this.model.add(q[ca],cb))}else if(0>Sa)for(Aa=0;Aa>Sa;Aa--)this.model.remove(Na[Na.length+Aa-1]);Na=this.model.getChildCells(q[ca],!0);for(Aa=0;Aa<Ra.length;Aa++){var Wa=this.getCellGeometry(Ra[Aa]),Qa=this.getCellGeometry(Na[Aa]);-null!=Wa&&null!=Qa&&(Qa=Qa.clone(),Qa.width=Wa.width,this.model.setGeometry(Na[Aa],Qa))}}}}var Ya=y.apply(this,arguments);for(ca=0;ca<ma.length;ca++)!E&&this.model.contains(ma[ca])&&0==this.model.getChildCount(ma[ca])&&this.model.remove(ma[ca]);E&&this.updateCustomLinks(this.createCellMapping(Y,this.createCellLookup(q)),Ya)}finally{this.model.endUpdate()}return Ya};var z=Graph.prototype.removeCells;Graph.prototype.removeCells=function(q,B){var C=[];this.model.beginUpdate();try{for(var E=0;E<q.length;E++)if(this.isTableCell(q[E])){var J=-this.model.getParent(q[E]),P=this.model.getParent(J);1==this.model.getChildCount(J)&&1==this.model.getChildCount(P)?0>mxUtils.indexOf(q,P)&&0>mxUtils.indexOf(C,P)&&C.push(P):this.labelChanged(q[E],"")}else{if(this.isTableRow(q[E])&&(P=this.model.getParent(q[E]),0>mxUtils.indexOf(q,P)&&0>mxUtils.indexOf(C,P))){for(var Y=this.model.getChildCells(P,!0),ma=0,ca=0;ca<Y.length;ca++)0<=mxUtils.indexOf(q,Y[ca])&&ma++;ma==Y.length&&C.push(P)}C.push(q[E])}C=z.apply(this,[C,B])}finally{this.model.endUpdate()}return C};-Graph.prototype.updateCustomLinks=function(q,B,C){C=null!=C?C:new Graph;for(var E=0;E<B.length;E++)null!=B[E]&&C.updateCustomLinksForCell(q,B[E],C)};Graph.prototype.updateCustomLinksForCell=function(q,B){this.doUpdateCustomLinksForCell(q,B);for(var C=this.model.getChildCount(B),E=0;E<C;E++)this.updateCustomLinksForCell(q,this.model.getChildAt(B,E))};Graph.prototype.doUpdateCustomLinksForCell=function(q,B){};Graph.prototype.getAllConnectionConstraints=function(q,B){if(null!=q){B=mxUtils.getValue(q.style,-"points",null);if(null!=B){q=[];try{var C=JSON.parse(B);for(B=0;B<C.length;B++){var E=C[B];q.push(new mxConnectionConstraint(new mxPoint(E[0],E[1]),2<E.length?"0"!=E[2]:!0,null,3<E.length?E[3]:0,4<E.length?E[4]:0))}}catch(P){}return q}if(null!=q.shape&&null!=q.shape.bounds){E=q.shape.direction;B=q.shape.bounds;var J=q.shape.scale;C=B.width/J;B=B.height/J;if(E==mxConstants.DIRECTION_NORTH||E==mxConstants.DIRECTION_SOUTH)E=C,C=B,B=E;B=q.shape.getConstraints(q.style,C,B);if(null!=B)return B;if(null!=+function(q){return null!=q&&t.apply(this,arguments)?this.isTableCell(q)||this.isTableRow(q)?this.isCellMovable(this.model.getParent(q)):!0:!1};var k=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(q){var B=this.model.getParent(q);if(null!=B){var C=this.getCurrentCellStyle(B);if(null!=C.expand)return"0"!=C.expand}return k.apply(this,arguments)&&(null==B||!this.isTable(B))};var v=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(q,B,C,F,J,P,Y,ma){null==ma&&(ma=this.model.getParent(q),+this.isTable(ma)||this.isTableRow(ma))&&(ma=this.getCellAt(P,Y,null,!0,!1));C=null;this.model.beginUpdate();try{var ca=this.getCellGeometry(q);if(null!=ca&&null!=ca.points&&0<ca.points.length&&1==B.length&&this.model.isVertex(B[0])){var na=this.getCellGeometry(B[0]);if(null!=na&&!na.relative){var ta=new mxRectangle(na.x+F,na.y+J,na.width,na.height),Fa=ca.points;na=[];for(var Da=0;Da<Fa.length;Da++)ta.intersectsPoint(Fa[Da].x,Fa[Da].y)||na.push(Fa[Da]);na.length<Fa.length&&(ca=ca.clone(),ca.points=+na,this.model.setGeometry(q,ca))}}C=v.apply(this,[q,B,C,F,J,P,Y,ma]);this.model.setValue(C,"");var Na=this.getChildCells(C,!0);for(Da=0;Da<Na.length;Da++)ca=this.getCellGeometry(Na[Da]),null!=ca&&ca.relative&&0<ca.x&&this.model.remove(Na[Da]);var Ra=this.getChildCells(q,!0);for(Da=0;Da<Ra.length;Da++)ca=this.getCellGeometry(Ra[Da]),null!=ca&&ca.relative&&0>=ca.x&&this.model.remove(Ra[Da]);var Sa=this.model.getTerminal(C,!1);if(null!=Sa){var Aa=this.getCurrentCellStyle(Sa);null!=Aa&&"1"==Aa.snapToPoint&&+(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[q]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[q]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[C]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[C]))}}finally{this.model.endUpdate()}return C};var u=Graph.prototype.selectCell;Graph.prototype.selectCell=function(q,B,C){if(B||C)u.apply(this,arguments);else{var F=this.getSelectionCell(),J=null,P=[],Y=mxUtils.bind(this,function(ma){if(null!=this.view.getState(ma)&&(this.model.isVertex(ma)||+this.model.isEdge(ma)))if(P.push(ma),ma==F)J=P.length-1;else if(q&&null==F&&0<P.length||null!=J&&q&&P.length>J||!q&&0<J)return;for(var ca=0;ca<this.model.getChildCount(ma);ca++)Y(this.model.getChildAt(ma,ca))});Y(this.model.root);0<P.length&&(J=null!=J?mxUtils.mod(J+(q?1:-1),P.length):0,this.setSelectionCell(P[J]))}};Graph.prototype.swapShapes=function(q,B){if(this.model.isVertex(q)&&this.model.isVertex(B)&&2==this.getMovableCells([q,B]).length){var C=this.getCellGeometry(q),F=this.getCellGeometry(B);+if(null!=C&&null!=F){var J=C.clone(),P=F.clone();this.model.beginUpdate();try{J.x=F.getCenterX()-C.width/2,J.y=F.getCenterY()-C.height/2,P.x=C.getCenterX()-F.width/2,P.y=C.getCenterY()-F.height/2,this.model.setGeometry(q,J),this.model.setGeometry(B,P)}finally{this.model.endUpdate()}}}};var y=Graph.prototype.moveCells;Graph.prototype.moveCells=function(q,B,C,F,J,P,Y){Y=null!=Y?Y:{};if(this.isTable(J)){for(var ma=[],ca=0;ca<q.length;ca++)this.isTable(q[ca])?ma=ma.concat(this.model.getChildCells(q[ca],+!0).reverse()):ma.push(q[ca]);q=ma}this.model.beginUpdate();try{ma=[];for(ca=0;ca<q.length;ca++)if(null!=J&&this.isTableRow(q[ca])){var na=this.model.getParent(q[ca]),ta=this.getCellGeometry(q[ca]);this.isTable(na)&&ma.push(na);if(null!=na&&null!=ta&&this.isTable(na)&&this.isTable(J)&&(F||na!=J)){if(!F){var Fa=this.getCellGeometry(na);null!=Fa&&(Fa=Fa.clone(),Fa.height-=ta.height,this.model.setGeometry(na,Fa))}Fa=this.getCellGeometry(J);null!=Fa&&(Fa=Fa.clone(),Fa.height+=ta.height,this.model.setGeometry(J,+Fa));var Da=this.model.getChildCells(J,!0);if(0<Da.length){q[ca]=F?this.cloneCell(q[ca]):q[ca];var Na=this.model.getChildCells(q[ca],!0),Ra=this.model.getChildCells(Da[0],!0),Sa=Ra.length-Na.length;if(0<Sa)for(var Aa=0;Aa<Sa;Aa++){var cb=this.cloneCell(Na[Na.length-1]);null!=cb&&(cb.value="",this.model.add(q[ca],cb))}else if(0>Sa)for(Aa=0;Aa>Sa;Aa--)this.model.remove(Na[Na.length+Aa-1]);Na=this.model.getChildCells(q[ca],!0);for(Aa=0;Aa<Ra.length;Aa++){var Wa=this.getCellGeometry(Ra[Aa]),Qa=this.getCellGeometry(Na[Aa]);+null!=Wa&&null!=Qa&&(Qa=Qa.clone(),Qa.width=Wa.width,this.model.setGeometry(Na[Aa],Qa))}}}}var Ya=y.apply(this,arguments);for(ca=0;ca<ma.length;ca++)!F&&this.model.contains(ma[ca])&&0==this.model.getChildCount(ma[ca])&&this.model.remove(ma[ca]);F&&this.updateCustomLinks(this.createCellMapping(Y,this.createCellLookup(q)),Ya)}finally{this.model.endUpdate()}return Ya};var z=Graph.prototype.removeCells;Graph.prototype.removeCells=function(q,B){var C=[];this.model.beginUpdate();try{for(var F=0;F<q.length;F++)if(this.isTableCell(q[F])){var J=+this.model.getParent(q[F]),P=this.model.getParent(J);1==this.model.getChildCount(J)&&1==this.model.getChildCount(P)?0>mxUtils.indexOf(q,P)&&0>mxUtils.indexOf(C,P)&&C.push(P):this.labelChanged(q[F],"")}else{if(this.isTableRow(q[F])&&(P=this.model.getParent(q[F]),0>mxUtils.indexOf(q,P)&&0>mxUtils.indexOf(C,P))){for(var Y=this.model.getChildCells(P,!0),ma=0,ca=0;ca<Y.length;ca++)0<=mxUtils.indexOf(q,Y[ca])&&ma++;ma==Y.length&&C.push(P)}C.push(q[F])}C=z.apply(this,[C,B])}finally{this.model.endUpdate()}return C};+Graph.prototype.updateCustomLinks=function(q,B,C){C=null!=C?C:new Graph;for(var F=0;F<B.length;F++)null!=B[F]&&C.updateCustomLinksForCell(q,B[F],C)};Graph.prototype.updateCustomLinksForCell=function(q,B){this.doUpdateCustomLinksForCell(q,B);for(var C=this.model.getChildCount(B),F=0;F<C;F++)this.updateCustomLinksForCell(q,this.model.getChildAt(B,F))};Graph.prototype.doUpdateCustomLinksForCell=function(q,B){};Graph.prototype.getAllConnectionConstraints=function(q,B){if(null!=q){B=mxUtils.getValue(q.style,+"points",null);if(null!=B){q=[];try{var C=JSON.parse(B);for(B=0;B<C.length;B++){var F=C[B];q.push(new mxConnectionConstraint(new mxPoint(F[0],F[1]),2<F.length?"0"!=F[2]:!0,null,3<F.length?F[3]:0,4<F.length?F[4]:0))}}catch(P){}return q}if(null!=q.shape&&null!=q.shape.bounds){F=q.shape.direction;B=q.shape.bounds;var J=q.shape.scale;C=B.width/J;B=B.height/J;if(F==mxConstants.DIRECTION_NORTH||F==mxConstants.DIRECTION_SOUTH)F=C,C=B,B=F;B=q.shape.getConstraints(q.style,C,B);if(null!=B)return B;if(null!=q.shape.stencil&&null!=q.shape.stencil.constraints)return q.shape.stencil.constraints;if(null!=q.shape.constraints)return q.shape.constraints}}return null};Graph.prototype.flipEdge=function(q){if(null!=q){var B=this.getCurrentCellStyle(q);B=mxUtils.getValue(B,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,B,[q])}};Graph.prototype.isValidRoot=function(q){for(var B=-this.model.getChildCount(q),C=0,E=0;E<B;E++){var J=this.model.getChildAt(q,E);this.model.isVertex(J)&&(J=this.getCellGeometry(J),null==J||J.relative||C++)}return 0<C||this.isContainer(q)};Graph.prototype.isValidDropTarget=function(q,B,C){for(var E=this.getCurrentCellStyle(q),J=!0,P=!0,Y=0;Y<B.length&&P;Y++)J=J&&this.isTable(B[Y]),P=P&&this.isTableRow(B[Y]);return!this.isCellLocked(q)&&(this.isTargetShape(q,B,C)||("1"!=mxUtils.getValue(E,"part","0")||this.isContainer(q))&&"0"!=mxUtils.getValue(E,"dropTarget",+this.model.getChildCount(q),C=0,F=0;F<B;F++){var J=this.model.getChildAt(q,F);this.model.isVertex(J)&&(J=this.getCellGeometry(J),null==J||J.relative||C++)}return 0<C||this.isContainer(q)};Graph.prototype.isValidDropTarget=function(q,B,C){for(var F=this.getCurrentCellStyle(q),J=!0,P=!0,Y=0;Y<B.length&&P;Y++)J=J&&this.isTable(B[Y]),P=P&&this.isTableRow(B[Y]);return!this.isCellLocked(q)&&(this.isTargetShape(q,B,C)||("1"!=mxUtils.getValue(F,"part","0")||this.isContainer(q))&&"0"!=mxUtils.getValue(F,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(q))&&!this.isTableRow(q)&&(!this.isTable(q)||P||J))};Graph.prototype.createGroupCell=function(){var q=mxGraph.prototype.createGroupCell.apply(this,arguments);q.setStyle("group");return q};Graph.prototype.isExtendParentsOnAdd=function(q){var B=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(B&&null!=q&&null!=this.layoutManager){var C=this.model.getParent(q);null!=C&&(C=this.layoutManager.getLayout(C),-null!=C&&C.constructor==mxStackLayout&&(B=!1))}return B};Graph.prototype.getPreferredSizeForCell=function(q,B,C){C=null!=C?C:this.gridEnabled;var E=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=E&&(E.width+=10,E.height+=4,C&&(E.width=this.snap(E.width),E.height=this.snap(E.height)));return E};Graph.prototype.getAutosizeTextAvailableSpace=function(q,B,C,E){var J=0,P=0;(null!=E&&null!=this.getImage(E)||null!=q[mxConstants.STYLE_IMAGE])&&q[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&+null!=C&&C.constructor==mxStackLayout&&(B=!1))}return B};Graph.prototype.getPreferredSizeForCell=function(q,B,C){C=null!=C?C:this.gridEnabled;var F=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=F&&(F.width+=10,F.height+=4,C&&(F.width=this.snap(F.width),F.height=this.snap(F.height)));return F};Graph.prototype.getAutosizeTextAvailableSpace=function(q,B,C,F){var J=0,P=0;(null!=F&&null!=this.getImage(F)||null!=q[mxConstants.STYLE_IMAGE])&&q[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(q[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(J+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),q[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));J+=2*parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING,2));J+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_LEFT,2));J+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_RIGHT,-2));P+=2*parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING,2));P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_TOP,2));P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_BOTTOM,2));null!=E&&(E=this.getFoldingImage(E),null!=E&&(J+=E.width+8));q=mxUtils.getValue(q,mxConstants.STYLE_HORIZONTAL,!0);J=(q?B:C)-J;B=(q?C:B)-P;return 0>=J||0>=B?null:{availW:J,availH:B}};Graph.prototype.computeAutosizeTextFontSize=function(q,B,C,E,J,P){var Y=1,ma=84,ca=P?B:null,na=null;if(P){for(var ta=-q.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Fa=[],Da=0;Da<ta.length;Da++)0<ta[Da].length&&Fa.push(mxUtils.htmlEntities(ta[Da],!1));0<Fa.length&&(na=Fa.join("<br>"))}for(;Y<ma;)ta=Math.ceil((Y+ma)/2),Fa=mxUtils.getSizeForString(q,ta,E,ca,J),(Fa=P?Fa.height<=C:Fa.width<=B&&Fa.height<=C)&&P&&null!=na&&mxUtils.getSizeForString(na,ta,E,null,J).width>B&&(Fa=!1),Fa?Y=ta:ma=ta-1;return Math.max(6,Y)};Graph.prototype.updateAutosizeTextFontSize=function(q,B){var C=this.view.getState(q);-null==C&&(C=this.view.createState(q));B=B||C.style;var E=this.getCellGeometry(q);if(null!=E&&!this.model.isEdge(q)){var J=this.cellRenderer.getLabelValue(C);null!=J&&0!=J.length&&(C=this.getAutosizeTextAvailableSpace(B,E.width,E.height,C),null!=C&&(this.isHtmlLabel(q)||(J=mxUtils.htmlEntities(J,!1)),J=J.replace(/\n/g,"<br>"),B=this.computeAutosizeTextFontSize(J,C.availW,C.availH,B[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,B[mxConstants.STYLE_FONTSTYLE],"wrap"==B[mxConstants.STYLE_WHITE_SPACE]),-this.setCellStyles(mxConstants.STYLE_FONTSIZE,B,[q])))}};Graph.prototype.cellsResized=function(q,B,C){var E=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=q)for(var J=0;J<q.length;J++)this.model.isVertex(q[J])&&this.isAutosizeTextCell(q[J])&&this.updateAutosizeTextFontSize(q[J]);return E};Graph.prototype.turnShapes=function(q,B){var C=this.getModel(),E=[];C.beginUpdate();try{for(var J=0;J<q.length;J++){var P=q[J];if(C.isEdge(P)){var Y=C.getTerminal(P,!0),ma=C.getTerminal(P,!1);C.setTerminal(P,+2));P+=2*parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING,2));P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_TOP,2));P+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_BOTTOM,2));null!=F&&(F=this.getFoldingImage(F),null!=F&&(J+=F.width+8));q=mxUtils.getValue(q,mxConstants.STYLE_HORIZONTAL,!0);J=(q?B:C)-J;B=(q?C:B)-P;return 0>=J||0>=B?null:{availW:J,availH:B}};Graph.prototype.computeAutosizeTextFontSize=function(q,B,C,F,J,P){var Y=1,ma=84,ca=P?B:null,na=null;if(P){for(var ta=+q.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Fa=[],Da=0;Da<ta.length;Da++)0<ta[Da].length&&Fa.push(mxUtils.htmlEntities(ta[Da],!1));0<Fa.length&&(na=Fa.join("<br>"))}for(;Y<ma;)ta=Math.ceil((Y+ma)/2),Fa=mxUtils.getSizeForString(q,ta,F,ca,J),(Fa=P?Fa.height<=C:Fa.width<=B&&Fa.height<=C)&&P&&null!=na&&mxUtils.getSizeForString(na,ta,F,null,J).width>B&&(Fa=!1),Fa?Y=ta:ma=ta-1;return Math.max(6,Y)};Graph.prototype.updateAutosizeTextFontSize=function(q,B){var C=this.view.getState(q);+null==C&&(C=this.view.createState(q));B=B||C.style;var F=this.getCellGeometry(q);if(null!=F&&!this.model.isEdge(q)){var J=this.cellRenderer.getLabelValue(C);null!=J&&0!=J.length&&(C=this.getAutosizeTextAvailableSpace(B,F.width,F.height,C),null!=C&&(this.isHtmlLabel(q)||(J=mxUtils.htmlEntities(J,!1)),J=J.replace(/\n/g,"<br>"),B=this.computeAutosizeTextFontSize(J,C.availW,C.availH,B[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,B[mxConstants.STYLE_FONTSTYLE],"wrap"==B[mxConstants.STYLE_WHITE_SPACE]),+this.setCellStyles(mxConstants.STYLE_FONTSIZE,B,[q])))}};Graph.prototype.cellsResized=function(q,B,C){var F=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=q)for(var J=0;J<q.length;J++)this.model.isVertex(q[J])&&this.isAutosizeTextCell(q[J])&&this.updateAutosizeTextFontSize(q[J]);return F};Graph.prototype.turnShapes=function(q,B){var C=this.getModel(),F=[];C.beginUpdate();try{for(var J=0;J<q.length;J++){var P=q[J];if(C.isEdge(P)){var Y=C.getTerminal(P,!0),ma=C.getTerminal(P,!1);C.setTerminal(P,ma,!0);C.setTerminal(P,Y,!1);var ca=C.getGeometry(P);if(null!=ca){ca=ca.clone();null!=ca.points&&ca.points.reverse();var na=ca.getTerminalPoint(!0),ta=ca.getTerminalPoint(!1);ca.setTerminalPoint(na,!1);ca.setTerminalPoint(ta,!0);C.setGeometry(P,ca);var Fa=this.view.getState(P),Da=this.view.getState(Y),Na=this.view.getState(ma);if(null!=Fa){var Ra=null!=Da?this.getConnectionConstraint(Fa,Da,!0):null,Sa=null!=Na?this.getConnectionConstraint(Fa,Na,!1):null;this.setConnectionConstraint(P,Y,!0,Sa);this.setConnectionConstraint(P,-ma,!1,Ra);var Aa=mxUtils.getValue(Fa.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Fa.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[P]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Aa,[P])}E.push(P)}}else if(C.isVertex(P)&&(ca=this.getCellGeometry(P),null!=ca)){if(!(this.isTable(P)||this.isTableRow(P)||this.isTableCell(P)||this.isSwimlane(P))){ca=ca.clone();ca.x+=ca.width/2-ca.height/2;ca.y+=ca.height/-2-ca.width/2;var cb=ca.width;ca.width=ca.height;ca.height=cb;C.setGeometry(P,ca)}var Wa=this.view.getState(P);if(null!=Wa){var Qa=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],Ya=mxUtils.getValue(Wa.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,Qa[mxUtils.mod(mxUtils.indexOf(Qa,Ya)+(B?-1:1),Qa.length)],[P])}E.push(P)}}}finally{C.endUpdate()}return E};Graph.prototype.stencilHasPlaceholders=-function(q){if(null!=q&&null!=q.fgNode)for(q=q.fgNode.firstChild;null!=q;){if("text"==q.nodeName&&"1"==q.getAttribute("placeholders"))return!0;q=q.nextSibling}return!1};var F=Graph.prototype.processChange;Graph.prototype.processChange=function(q){if(q instanceof mxGeometryChange&&(this.isTableCell(q.cell)||this.isTableRow(q.cell))&&(null==q.previous&&null!=q.geometry||null!=q.previous&&!q.previous.equals(q.geometry))){var B=q.cell;this.isTableCell(B)&&(B=this.model.getParent(B));this.isTableRow(B)&&-(B=this.model.getParent(B));var C=this.view.getState(B);null!=C&&null!=C.shape&&(this.view.invalidate(B),C.shape.bounds=null)}F.apply(this,arguments);q instanceof mxValueChange&&null!=q.cell&&null!=q.cell.value&&"object"==typeof q.cell.value&&this.invalidateDescendantsWithPlaceholders(q.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(q){q=this.model.getDescendants(q);if(0<q.length)for(var B=0;B<q.length;B++){var C=this.view.getState(q[B]);null!=C&&null!=C.shape&&null!=C.shape.stencil&&+ma,!1,Ra);var Aa=mxUtils.getValue(Fa.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Fa.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[P]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Aa,[P])}F.push(P)}}else if(C.isVertex(P)&&(ca=this.getCellGeometry(P),null!=ca)){if(!(this.isTable(P)||this.isTableRow(P)||this.isTableCell(P)||this.isSwimlane(P))){ca=ca.clone();ca.x+=ca.width/2-ca.height/2;ca.y+=ca.height/+2-ca.width/2;var cb=ca.width;ca.width=ca.height;ca.height=cb;C.setGeometry(P,ca)}var Wa=this.view.getState(P);if(null!=Wa){var Qa=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],Ya=mxUtils.getValue(Wa.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,Qa[mxUtils.mod(mxUtils.indexOf(Qa,Ya)+(B?-1:1),Qa.length)],[P])}F.push(P)}}}finally{C.endUpdate()}return F};Graph.prototype.stencilHasPlaceholders=+function(q){if(null!=q&&null!=q.fgNode)for(q=q.fgNode.firstChild;null!=q;){if("text"==q.nodeName&&"1"==q.getAttribute("placeholders"))return!0;q=q.nextSibling}return!1};var E=Graph.prototype.processChange;Graph.prototype.processChange=function(q){if(q instanceof mxGeometryChange&&(this.isTableCell(q.cell)||this.isTableRow(q.cell))&&(null==q.previous&&null!=q.geometry||null!=q.previous&&!q.previous.equals(q.geometry))){var B=q.cell;this.isTableCell(B)&&(B=this.model.getParent(B));this.isTableRow(B)&&+(B=this.model.getParent(B));var C=this.view.getState(B);null!=C&&null!=C.shape&&(this.view.invalidate(B),C.shape.bounds=null)}E.apply(this,arguments);q instanceof mxValueChange&&null!=q.cell&&null!=q.cell.value&&"object"==typeof q.cell.value&&this.invalidateDescendantsWithPlaceholders(q.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(q){q=this.model.getDescendants(q);if(0<q.length)for(var B=0;B<q.length;B++){var C=this.view.getState(q[B]);null!=C&&null!=C.shape&&null!=C.shape.stencil&&this.stencilHasPlaceholders(C.shape.stencil)?this.removeStateForCell(q[B]):this.isReplacePlaceholders(q[B])&&this.view.invalidate(q[B],!1,!1)}};Graph.prototype.replaceElement=function(q,B){B=q.ownerDocument.createElement(null!=B?B:"span");for(var C=Array.prototype.slice.call(q.attributes);attr=C.pop();)B.setAttribute(attr.nodeName,attr.nodeValue);B.innerHTML=q.innerHTML;q.parentNode.replaceChild(B,q)};Graph.prototype.processElements=function(q,B){if(null!=q){q=q.getElementsByTagName("*");for(var C=-0;C<q.length;C++)null!=q[C]&&B(q[C])}};Graph.prototype.updateLabelElements=function(q,B,C){q=null!=q?q:this.getSelectionCells();for(var E=document.createElement("div"),J=0;J<q.length;J++){var P=this.getCurrentCellStyle(q[J]);if(null!=P&&"1"==P.html&&(P=this.convertValueToString(q[J]),null!=P&&0<P.length)){E.innerHTML=Graph.sanitizeHtml(P);for(var Y=E.getElementsByTagName(null!=C?C:"*"),ma=0;ma<Y.length;ma++)B(Y[ma]);E.innerHTML!=P&&this.cellLabelChanged(q[J],E.innerHTML)}}};Graph.prototype.cellLabelChanged=-function(q,B,C){B=Graph.zapGremlins(B);this.model.beginUpdate();try{if(null!=q.value&&"object"==typeof q.value){if(this.isReplacePlaceholders(q)&&null!=q.getAttribute("placeholder"))for(var E=q.getAttribute("placeholder"),J=q;null!=J;){if(J==this.model.getRoot()||null!=J.value&&"object"==typeof J.value&&J.hasAttribute(E)){this.setAttributeForCell(J,E,B);break}J=this.model.getParent(J)}var P=q.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&P.hasAttribute("label_"+Graph.diagramLanguage)?-P.setAttribute("label_"+Graph.diagramLanguage,B):P.setAttribute("label",B);B=P}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(q)&&this.updateAutosizeTextFontSize(q)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(q){if(null!=q){for(var B=new mxDictionary,C=0;C<q.length;C++)B.put(q[C],!0);var E=[];for(C=0;C<q.length;C++){var J=this.model.getParent(q[C]);null==J||B.get(J)||(B.put(J,!0),E.push(J))}for(C=0;C<E.length;C++)if(J=this.view.getState(E[C]),+0;C<q.length;C++)null!=q[C]&&B(q[C])}};Graph.prototype.updateLabelElements=function(q,B,C){q=null!=q?q:this.getSelectionCells();for(var F=document.createElement("div"),J=0;J<q.length;J++){var P=this.getCurrentCellStyle(q[J]);if(null!=P&&"1"==P.html&&(P=this.convertValueToString(q[J]),null!=P&&0<P.length)){F.innerHTML=Graph.sanitizeHtml(P);for(var Y=F.getElementsByTagName(null!=C?C:"*"),ma=0;ma<Y.length;ma++)B(Y[ma]);F.innerHTML!=P&&this.cellLabelChanged(q[J],F.innerHTML)}}};Graph.prototype.cellLabelChanged=+function(q,B,C){B=Graph.zapGremlins(B);this.model.beginUpdate();try{if(null!=q.value&&"object"==typeof q.value){if(this.isReplacePlaceholders(q)&&null!=q.getAttribute("placeholder"))for(var F=q.getAttribute("placeholder"),J=q;null!=J;){if(J==this.model.getRoot()||null!=J.value&&"object"==typeof J.value&&J.hasAttribute(F)){this.setAttributeForCell(J,F,B);break}J=this.model.getParent(J)}var P=q.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&P.hasAttribute("label_"+Graph.diagramLanguage)?+P.setAttribute("label_"+Graph.diagramLanguage,B):P.setAttribute("label",B);B=P}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(q)&&this.updateAutosizeTextFontSize(q)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(q){if(null!=q){for(var B=new mxDictionary,C=0;C<q.length;C++)B.put(q[C],!0);var F=[];for(C=0;C<q.length;C++){var J=this.model.getParent(q[C]);null==J||B.get(J)||(B.put(J,!0),F.push(J))}for(C=0;C<F.length;C++)if(J=this.view.getState(F[C]),null!=J&&(this.model.isEdge(J.cell)||this.model.isVertex(J.cell))&&this.isCellDeletable(J.cell)&&this.isTransparentState(J)){for(var P=!0,Y=0;Y<this.model.getChildCount(J.cell)&&P;Y++)B.get(this.model.getChildAt(J.cell,Y))||(P=!1);P&&q.push(J.cell)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(q){for(var B=[],C=0;C<q.length;C++)this.isCellDeletable(q[C])&&this.isTransparentState(this.view.getState(q[C]))&&B.push(q[C]);q=B;mxGraph.prototype.removeCellsAfterUngroup.apply(this,-arguments)};Graph.prototype.setLinkForCell=function(q,B){this.setAttributeForCell(q,"link",B)};Graph.prototype.createLinkOverlay=function(q){q=this.getLinkForCell(q);if(null!=q&&0<q.length){q=this.getLinkOverlayTooltip(q);q=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),q,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));q.isLinkOverlay=!0;var B=this;q.addListener(mxEvent.CLICK,function(C,E){B.setSelectionCell(E.getProperty("cell"))});return q}return null};Graph.prototype.getLinkOverlayTooltip=-function(q){return q};Graph.prototype.createTooltipOverlay=function(q){q=this.convertValueToTooltip(q);if(null!=q&&0<q.length){q=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),q,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));q.isTooltipOverlay=!0;var B=this;q.addListener(mxEvent.CLICK,function(C,E){C=E.getProperty("cell");B.isEnabled()&&B.isCellEditable(C)?(B.setSelectionCell(C),B.editTooltip(C)):(E=E.getProperty("event"),C=B.getTooltipForCell(C),null!=C&&0<C.length&&-B.tooltipHandler.show(C,E.clientX,E.clientY))});return q}return null};Graph.prototype.editTooltip=function(q){};Graph.prototype.setTooltipForCell=function(q,B){var C="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(q.value)&&q.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(C="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(q,C,B)};Graph.prototype.getAttributeForCell=function(q,B,C){q=null!=q.value&&"object"===typeof q.value?q.value.getAttribute(B):null;-return null!=q?q:C};Graph.prototype.setAttributeForCell=function(q,B,C){if(null!=q.value&&"object"==typeof q.value)var E=q.value.cloneNode(!0);else E=mxUtils.createXmlDocument().createElement("UserObject"),E.setAttribute("label",q.value||"");null!=C?E.setAttribute(B,C):E.removeAttribute(B);this.model.setValue(q,E)};Graph.prototype.isTargetShape=function(q,B,C){q=mxUtils.getValue(this.getCurrentCellStyle(q),mxConstants.STYLE_SHAPE,"");for(C=0;C<B.length;C++){var E=mxUtils.getValue(this.getCurrentCellStyle(B[C]),-"targetShapes","").split(",");if(0<=mxUtils.indexOf(E,q))return!0}return!1};var D=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(q,B,C,E){if(mxEvent.isAltDown(B))return null;for(var J=0;J<q.length;J++){var P=this.model.getParent(q[J]);if(this.model.isEdge(P)&&0>mxUtils.indexOf(q,P))return null}P=D.apply(this,arguments);var Y=!0;for(J=0;J<q.length&&Y;J++)Y=Y&&this.isTableRow(q[J]);Y&&(this.isTableCell(P)&&(P=this.model.getParent(P)),this.isTableRow(P)&&(P=this.model.getParent(P)),-this.isTable(P)||(P=null));return P};Graph.prototype.click=function(q){mxGraph.prototype.click.call(this,q);this.firstClickState=q.getState();this.firstClickSource=q.getSource()};Graph.prototype.dblClick=function(q,B){this.isEnabled()&&(B=this.insertTextForEvent(q,B),mxGraph.prototype.dblClick.call(this,q,B))};Graph.prototype.insertTextForEvent=function(q,B){var C=mxUtils.convertPoint(this.container,mxEvent.getClientX(q),mxEvent.getClientY(q));if(null!=q&&!this.model.isVertex(B)){var E=this.model.isEdge(B)?-this.view.getState(B):null,J=mxEvent.getSource(q);this.firstClickState!=E||this.firstClickSource!=J||null!=E&&null!=E.text&&null!=E.text.node&&null!=E.text.boundingBox&&(mxUtils.contains(E.text.boundingBox,C.x,C.y)||mxUtils.isAncestorNode(E.text.node,mxEvent.getSource(q)))||(null!=E||this.isCellLocked(this.getDefaultParent()))&&(null==E||this.isCellLocked(E.cell))||!(null!=E||mxClient.IS_SVG&&J==this.view.getCanvas().ownerSVGElement)||(null==E&&(E=this.view.getState(this.getCellAt(C.x,C.y))),B=this.addText(C.x,-C.y,E))}return B};Graph.prototype.getInsertPoint=function(q){q=this.getGridSize();var B=this.container.scrollLeft/this.view.scale-this.view.translate.x,C=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var E=this.getPageLayout(),J=this.getPageSize();B=Math.max(B,E.x*J.width);C=Math.max(C,E.y*J.height)}return new mxPoint(this.snap(B+q),this.snap(C+q))};Graph.prototype.getFreeInsertPoint=function(q){var B=this.view,C=this.getGraphBounds(),E=this.getInsertPoint(q);-q=this.snap(Math.round(Math.max(E.x,C.x/B.scale-B.translate.x+(0==C.width?2*this.gridSize:0))));B=this.snap(Math.round(Math.max(E.y,(C.y+C.height)/B.scale-B.translate.y+2*this.gridSize)));return new mxPoint(q,B)};Graph.prototype.getCenterInsertPoint=function(q){q=null!=q?q:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-q.width/2)),this.snap(Math.round((this.container.scrollTop++arguments)};Graph.prototype.setLinkForCell=function(q,B){this.setAttributeForCell(q,"link",B)};Graph.prototype.createLinkOverlay=function(q){q=this.getLinkForCell(q);if(null!=q&&0<q.length){q=this.getLinkOverlayTooltip(q);q=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),q,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));q.isLinkOverlay=!0;var B=this;q.addListener(mxEvent.CLICK,function(C,F){B.setSelectionCell(F.getProperty("cell"))});return q}return null};Graph.prototype.getLinkOverlayTooltip=+function(q){return q};Graph.prototype.createTooltipOverlay=function(q){q=this.convertValueToTooltip(q);if(null!=q&&0<q.length){q=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),q,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));q.isTooltipOverlay=!0;var B=this;q.addListener(mxEvent.CLICK,function(C,F){C=F.getProperty("cell");B.isEnabled()&&B.isCellEditable(C)?(B.setSelectionCell(C),B.editTooltip(C)):(F=F.getProperty("event"),C=B.getTooltipForCell(C),null!=C&&0<C.length&&+B.tooltipHandler.show(C,F.clientX,F.clientY))});return q}return null};Graph.prototype.editTooltip=function(q){};Graph.prototype.setTooltipForCell=function(q,B){var C="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(q.value)&&q.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(C="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(q,C,B)};Graph.prototype.getAttributeForCell=function(q,B,C){q=null!=q.value&&"object"===typeof q.value?q.value.getAttribute(B):null;+return null!=q?q:C};Graph.prototype.setAttributeForCell=function(q,B,C){if(null!=q.value&&"object"==typeof q.value)var F=q.value.cloneNode(!0);else F=mxUtils.createXmlDocument().createElement("UserObject"),F.setAttribute("label",q.value||"");null!=C?F.setAttribute(B,C):F.removeAttribute(B);this.model.setValue(q,F)};Graph.prototype.isTargetShape=function(q,B,C){q=mxUtils.getValue(this.getCurrentCellStyle(q),mxConstants.STYLE_SHAPE,"");for(C=0;C<B.length;C++){var F=mxUtils.getValue(this.getCurrentCellStyle(B[C]),+"targetShapes","").split(",");if(0<=mxUtils.indexOf(F,q))return!0}return!1};var D=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(q,B,C,F){if(mxEvent.isAltDown(B))return null;for(var J=0;J<q.length;J++){var P=this.model.getParent(q[J]);if(this.model.isEdge(P)&&0>mxUtils.indexOf(q,P))return null}P=D.apply(this,arguments);var Y=!0;for(J=0;J<q.length&&Y;J++)Y=Y&&this.isTableRow(q[J]);Y&&(this.isTableCell(P)&&(P=this.model.getParent(P)),this.isTableRow(P)&&(P=this.model.getParent(P)),+this.isTable(P)||(P=null));return P};Graph.prototype.click=function(q){mxGraph.prototype.click.call(this,q);this.firstClickState=q.getState();this.firstClickSource=q.getSource()};Graph.prototype.dblClick=function(q,B){this.isEnabled()&&(B=this.insertTextForEvent(q,B),mxGraph.prototype.dblClick.call(this,q,B))};Graph.prototype.insertTextForEvent=function(q,B){var C=mxUtils.convertPoint(this.container,mxEvent.getClientX(q),mxEvent.getClientY(q));if(null!=q&&!this.model.isVertex(B)){var F=this.model.isEdge(B)?+this.view.getState(B):null,J=mxEvent.getSource(q);this.firstClickState!=F||this.firstClickSource!=J||null!=F&&null!=F.text&&null!=F.text.node&&null!=F.text.boundingBox&&(mxUtils.contains(F.text.boundingBox,C.x,C.y)||mxUtils.isAncestorNode(F.text.node,mxEvent.getSource(q)))||(null!=F||this.isCellLocked(this.getDefaultParent()))&&(null==F||this.isCellLocked(F.cell))||!(null!=F||mxClient.IS_SVG&&J==this.view.getCanvas().ownerSVGElement)||(null==F&&(F=this.view.getState(this.getCellAt(C.x,C.y))),B=this.addText(C.x,+C.y,F))}return B};Graph.prototype.getInsertPoint=function(q){q=this.getGridSize();var B=this.container.scrollLeft/this.view.scale-this.view.translate.x,C=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var F=this.getPageLayout(),J=this.getPageSize();B=Math.max(B,F.x*J.width);C=Math.max(C,F.y*J.height)}return new mxPoint(this.snap(B+q),this.snap(C+q))};Graph.prototype.getFreeInsertPoint=function(q){var B=this.view,C=this.getGraphBounds(),F=this.getInsertPoint(q);+q=this.snap(Math.round(Math.max(F.x,C.x/B.scale-B.translate.x+(0==C.width?2*this.gridSize:0))));B=this.snap(Math.round(Math.max(F.y,(C.y+C.height)/B.scale-B.translate.y+2*this.gridSize)));return new mxPoint(q,B)};Graph.prototype.getCenterInsertPoint=function(q){q=null!=q?q:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-q.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale-this.view.translate.y-q.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/2/this.view.scale-this.view.translate.x-q.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-q.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(q,B){q=null!=q?q:"";null!=B&&(0<q.length&&";"!=q.charAt(q.length-1)&&(q+=";"),q+="fontSize="+B+";");return q};-Graph.prototype.addText=function(q,B,C){var E=new mxCell;E.value="Text";E.geometry=new mxGeometry(0,0,0,0);E.vertex=!0;if(null!=C&&this.model.isEdge(C.cell)){E.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);E.geometry.relative=!0;E.connectable=!1;var J=this.view.getRelativePoint(C,q,B);E.geometry.x=Math.round(1E4*J.x)/1E4;E.geometry.y=Math.round(J.y);E.geometry.offset=new mxPoint(0,0);J=this.view.getPoint(C,E.geometry);var P=-this.view.scale;E.geometry.offset=new mxPoint(Math.round((q-J.x)/P),Math.round((B-J.y)/P))}else J=this.view.translate,E.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),E.geometry.width=40,E.geometry.height=20,E.geometry.x=Math.round(q/this.view.scale)-J.x-(null!=C?C.origin.x:0),E.geometry.y=Math.round(B/this.view.scale)-J.y-(null!=C?C.origin.y:0),E.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([E],null!=-C?C.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[E])),this.autoSizeCell(E)}finally{this.getModel().endUpdate()}return E};Graph.prototype.addClickHandler=function(q,B,C){var E=mxUtils.bind(this,function(){var ca=this.container.getElementsByTagName("a");if(null!=ca)for(var na=0;na<ca.length;na++){var ta=this.getAbsoluteUrl(ca[na].getAttribute("href"));null!=ta&&(ca[na].setAttribute("rel",this.linkRelation),ca[na].setAttribute("href",ta),null!=B&&mxEvent.addGestureListeners(ca[na],-null,null,B))}});this.model.addListener(mxEvent.CHANGE,E);E();var J=this.container.style.cursor,P=this.getTolerance(),Y=this,ma={currentState:null,currentLink:null,currentTarget:null,highlight:null!=q&&""!=q&&q!=mxConstants.NONE?new mxCellHighlight(Y,q,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ca){var na=ca.sourceState;if(null==na||null==Y.getLinkForCell(na.cell))ca=Y.getCellAt(ca.getGraphX(),ca.getGraphY(),null,null,null,function(ta,Fa,Da){return null==Y.getLinkForCell(ta.cell)}),+Graph.prototype.addText=function(q,B,C){var F=new mxCell;F.value="Text";F.geometry=new mxGeometry(0,0,0,0);F.vertex=!0;if(null!=C&&this.model.isEdge(C.cell)){F.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);F.geometry.relative=!0;F.connectable=!1;var J=this.view.getRelativePoint(C,q,B);F.geometry.x=Math.round(1E4*J.x)/1E4;F.geometry.y=Math.round(J.y);F.geometry.offset=new mxPoint(0,0);J=this.view.getPoint(C,F.geometry);var P=+this.view.scale;F.geometry.offset=new mxPoint(Math.round((q-J.x)/P),Math.round((B-J.y)/P))}else J=this.view.translate,F.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),F.geometry.width=40,F.geometry.height=20,F.geometry.x=Math.round(q/this.view.scale)-J.x-(null!=C?C.origin.x:0),F.geometry.y=Math.round(B/this.view.scale)-J.y-(null!=C?C.origin.y:0),F.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([F],null!=+C?C.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[F])),this.autoSizeCell(F)}finally{this.getModel().endUpdate()}return F};Graph.prototype.addClickHandler=function(q,B,C){var F=mxUtils.bind(this,function(){var ca=this.container.getElementsByTagName("a");if(null!=ca)for(var na=0;na<ca.length;na++){var ta=this.getAbsoluteUrl(ca[na].getAttribute("href"));null!=ta&&(ca[na].setAttribute("rel",this.linkRelation),ca[na].setAttribute("href",ta),null!=B&&mxEvent.addGestureListeners(ca[na],+null,null,B))}});this.model.addListener(mxEvent.CHANGE,F);F();var J=this.container.style.cursor,P=this.getTolerance(),Y=this,ma={currentState:null,currentLink:null,currentTarget:null,highlight:null!=q&&""!=q&&q!=mxConstants.NONE?new mxCellHighlight(Y,q,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ca){var na=ca.sourceState;if(null==na||null==Y.getLinkForCell(na.cell))ca=Y.getCellAt(ca.getGraphX(),ca.getGraphY(),null,null,null,function(ta,Fa,Da){return null==Y.getLinkForCell(ta.cell)}),na=null==na||Y.model.isAncestor(ca,na.cell)?Y.view.getState(ca):null;na!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=na,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(ca,na){this.startX=na.getGraphX();this.startY=na.getGraphY();this.scrollLeft=Y.container.scrollLeft;this.scrollTop=Y.container.scrollTop;null==this.currentLink&&"auto"==Y.container.style.overflow&&(Y.container.style.cursor="move");this.updateCurrentState(na)},mouseMove:function(ca,na){if(Y.isMouseDown)null!=this.currentLink&&(ca=Math.abs(this.startX-na.getGraphX()),na=Math.abs(this.startY-na.getGraphY()),(ca>P||na>P)&&this.clear());else{for(ca=na.getSource();null!=ca&&"a"!=ca.nodeName.toLowerCase();)ca=ca.parentNode;null!=ca?this.clear():(null!=Y.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&Y.tooltipHandler.reset(na,!0,this.currentState),(null==this.currentState||na.getState()!=this.currentState&&null!=na.sourceState||!Y.intersects(this.currentState,na.getGraphX(),na.getGraphY()))&&this.updateCurrentState(na))}},mouseUp:function(ca,na){var ta=na.getSource();for(ca=na.getEvent();null!=ta&&"a"!=ta.nodeName.toLowerCase();)ta=ta.parentNode;null==ta&&Math.abs(this.scrollLeft-Y.container.scrollLeft)<P&&Math.abs(this.scrollTop-Y.container.scrollTop)<P&&(null==na.sourceState||!na.isSource(na.sourceState.control))&&((mxEvent.isLeftMouseButton(ca)||mxEvent.isMiddleMouseButton(ca))&&!mxEvent.isPopupTrigger(ca)||mxEvent.isTouchEvent(ca))&&(null!=this.currentLink?(ta=Y.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&ta||null==B||B(ca,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(ca)||(ca=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(ca)?"_blank":ta?Y.linkTarget:"_top",Y.openLink(this.currentLink,ca),na.consume())):null!=C&&!na.isConsumed()&&Math.abs(this.scrollLeft-Y.container.scrollLeft)<P&&Math.abs(this.scrollTop-Y.container.scrollTop)<P&&Math.abs(this.startX-na.getGraphX())<P&&Math.abs(this.startY-na.getGraphY())<P&&C(na.getEvent()));this.clear()},activate:function(ca){this.currentLink=Y.getAbsoluteUrl(Y.getLinkForCell(ca.cell));null!=this.currentLink&&(this.currentTarget=Y.getLinkTargetForCell(ca.cell),Y.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(ca))},clear:function(){null!=Y.container&&(Y.container.style.cursor=J);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=Y.tooltipHandler&&Y.tooltipHandler.hide()}};-Y.click=function(ca){};Y.addMouseListener(ma);mxEvent.addListener(document,"mouseleave",function(ca){ma.clear()})};Graph.prototype.duplicateCells=function(q,B){q=null!=q?q:this.getSelectionCells();B=null!=B?B:!0;for(var C=0;C<q.length;C++)this.isTableCell(q[C])&&(q[C]=this.model.getParent(q[C]));q=this.model.getTopmostCells(q);var E=this.getModel(),J=this.gridSize,P=[];E.beginUpdate();try{var Y={},ma=this.createCellLookup(q),ca=this.cloneCells(q,!1,Y,!0);for(C=0;C<q.length;C++){var na=E.getParent(q[C]);-if(null!=na){var ta=this.moveCells([ca[C]],J,J,!1)[0];P.push(ta);if(B)E.add(na,ca[C]);else{var Fa=na.getIndex(q[C]);E.add(na,ca[C],Fa+1)}if(this.isTable(na)){var Da=this.getCellGeometry(ca[C]),Na=this.getCellGeometry(na);null!=Da&&null!=Na&&(Na=Na.clone(),Na.height+=Da.height,E.setGeometry(na,Na))}}else P.push(ca[C])}this.updateCustomLinks(this.createCellMapping(Y,ma),ca,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ca))}finally{E.endUpdate()}return P};Graph.prototype.insertImage=-function(q,B,C){if(null!=q&&null!=this.cellEditor.textarea){for(var E=this.cellEditor.textarea.getElementsByTagName("img"),J=[],P=0;P<E.length;P++)J.push(E[P]);document.execCommand("insertimage",!1,q);q=this.cellEditor.textarea.getElementsByTagName("img");if(q.length==J.length+1)for(P=q.length-1;0<=P;P--)if(0==P||q[P]!=J[P-1]){q[P].setAttribute("width",B);q[P].setAttribute("height",C);break}}};Graph.prototype.insertLink=function(q){if(null!=this.cellEditor.textarea)if(0==q.length)document.execCommand("unlink",-!1);else if(mxClient.IS_FF){for(var B=this.cellEditor.textarea.getElementsByTagName("a"),C=[],E=0;E<B.length;E++)C.push(B[E]);document.execCommand("createlink",!1,mxUtils.trim(q));B=this.cellEditor.textarea.getElementsByTagName("a");if(B.length==C.length+1)for(E=B.length-1;0<=E;E--)if(B[E]!=C[E-1]){for(B=B[E].getElementsByTagName("a");0<B.length;){for(C=B[0].parentNode;null!=B[0].firstChild;)C.insertBefore(B[0].firstChild,B[0]);C.removeChild(B[0])}break}}else document.execCommand("createlink",!1,-mxUtils.trim(q))};Graph.prototype.isCellResizable=function(q){var B=mxGraph.prototype.isCellResizable.apply(this,arguments),C=this.getCurrentCellStyle(q);return!this.isTableCell(q)&&!this.isTableRow(q)&&(B||"0"!=mxUtils.getValue(C,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==C[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(q,B,C){null==B&&(B=this.getSelectionCells());if(null!=B&&1<B.length){for(var E=[],J=null,P=null,Y=0,ma=0;ma<B.length;ma++)if(this.getModel().isVertex(B[ma])){var ca=-this.view.getState(B[ma]);if(null!=ca){var na=q?ca.getCenterX():ca.getCenterY();J=null!=J?Math.max(J,na):na;P=null!=P?Math.min(P,na):na;C&&(Y+=q?ca.width:ca.height);E.push(ca)}}if(2<E.length){E.sort(function(Ra,Sa){return q?Ra.x-Sa.x:Ra.y-Sa.y});C&&(Y-=q?E[0].width/2+E[E.length-1].width/2:E[0].height/2+E[E.length-1].height/2);ca=this.view.translate;na=this.view.scale;P=P/na-(q?ca.x:ca.y);J=J/na-(q?ca.x:ca.y);this.getModel().beginUpdate();try{var ta=(J-P-Y)/(E.length-1),Fa=P+(C?q?E[0].width/2:E[0].height/-2:0);for(ma=1;ma<E.length-1;ma++){var Da=this.view.getState(this.model.getParent(E[ma].cell)),Na=this.getCellGeometry(E[ma].cell);Fa+=ta;null!=Na&&null!=Da&&(Na=Na.clone(),q?Na.x=Math.round(Fa-(C?0:Na.width/2))-Da.origin.x:Na.y=Math.round(Fa-(C?0:Na.height/2))-Da.origin.y,this.getModel().setGeometry(E[ma].cell,Na));C&&(Fa+=q?E[ma].width:E[ma].height)}}finally{this.getModel().endUpdate()}}}return B};Graph.prototype.isCloneEvent=function(q){return mxClient.IS_MAC&&mxEvent.isMetaDown(q)||mxEvent.isControlDown(q)};-Graph.prototype.createSvgImageExport=function(q){q=new mxImageExport;q.addCellData=function(C,E,J){E.setAttribute("data-cell-id",C.id);if(J)if(mxUtils.isNode(C.value))for(J=0;J<C.value.attributes.length;J++){var P=C.value.attributes[J];E.setAttribute("data-cell-"+P.name,P.value)}else if("object"===typeof C.value)for(P in C.value)E.setAttribute("data-cell-"+P,C.value[P]);else null!=C.value&&E.setAttribute("data-cell-value",C.value);return E};var B=q.visitStatesRecursive;q.visitStatesRecursive=function(C,-E,J){if(null!=C){var P=E.root,Y=E.root.ownerDocument;E.root=this.addCellData(C.cell,null!=Y.createElementNS?Y.createElementNS(mxConstants.NS_SVG,"g"):Y.createElement("g"),Editor.addSvgMetadata);P.appendChild(E.root);B.apply(this,arguments);E.root=P}};q.getLinkForCellState=mxUtils.bind(this,function(C,E){return this.getLinkForCell(C.cell)});q.getTitleForCellState=mxUtils.bind(this,function(C,E){return Editor.convertHtmlToText(this.convertValueToTooltip(C.cell))});return q};Graph.prototype.parseBackgroundImage=-function(q){var B=null;null!=q&&0<q.length&&(q=JSON.parse(q),B=new mxImage(q.src,q.width,q.height));return B};Graph.prototype.getBackgroundImageObject=function(q){return q};Graph.prototype.getSvg=function(q,B,C,E,J,P,Y,ma,ca,na,ta,Fa,Da,Na,Ra,Sa){var Aa=null;if(null!=Na)for(Aa=new mxDictionary,J=0;J<Na.length;J++)Aa.put(Na[J],!0);Na=this.useCssTransforms;var cb=this.enableFlowAnimation;this.enableFlowAnimation=!1;Na&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{B=null!=-B?B:1;C=null!=C?C:0;P=null!=P?P:!0;Y=null!=Y?Y:!0;na=null!=na?na:!1;ca=null!=ca?ca:this.defaultExportLinkTarget;var Wa="page"==Da?this.view.getBackgroundPageBounds():P&&null==Aa||E||"diagram"==Da?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),Qa=this.backgroundImage,Ya=this.view.translate,bb=this.view.scale;"diagram"==Da&&null!=Qa&&null!=Qa.width&&null!=Qa.height&&(Wa=mxRectangle.fromRectangle(Wa),Wa.add(new mxRectangle((Ya.x+Qa.x)*bb,(Ya.y+Qa.y)*bb,Qa.width*bb,Qa.height*bb)));-if(null==Wa)throw Error(mxResources.get("drawingEmpty"));E=B/bb;var nb=Math.max(1,Math.ceil(Wa.width*E)+2*C)+(na&&0==C?5:0),sb=Math.max(1,Math.ceil(Wa.height*E)+2*C)+(na&&0==C?5:0),ob=mxUtils.getLightDarkColor(q),lb=Graph.createSvgNode(0,0,nb,sb,ob),qb=lb.ownerDocument;if(null!=q){var pb=mxUtils.createElementNs(qb,mxConstants.NS_SVG,"rect");pb.setAttribute("fill",ob.light);pb.style.fill=ob.cssText;pb.setAttribute("width","100%");pb.setAttribute("height","100%");pb.setAttribute("x","0");pb.setAttribute("y",+Y.click=function(ca){};Y.addMouseListener(ma);mxEvent.addListener(document,"mouseleave",function(ca){ma.clear()})};Graph.prototype.duplicateCells=function(q,B){q=null!=q?q:this.getSelectionCells();B=null!=B?B:!0;for(var C=0;C<q.length;C++)this.isTableCell(q[C])&&(q[C]=this.model.getParent(q[C]));q=this.model.getTopmostCells(q);var F=this.getModel(),J=this.gridSize,P=[];F.beginUpdate();try{var Y={},ma=this.createCellLookup(q),ca=this.cloneCells(q,!1,Y,!0);for(C=0;C<q.length;C++){var na=F.getParent(q[C]);+if(null!=na){var ta=this.moveCells([ca[C]],J,J,!1)[0];P.push(ta);if(B)F.add(na,ca[C]);else{var Fa=na.getIndex(q[C]);F.add(na,ca[C],Fa+1)}if(this.isTable(na)){var Da=this.getCellGeometry(ca[C]),Na=this.getCellGeometry(na);null!=Da&&null!=Na&&(Na=Na.clone(),Na.height+=Da.height,F.setGeometry(na,Na))}}else P.push(ca[C])}this.updateCustomLinks(this.createCellMapping(Y,ma),ca,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ca))}finally{F.endUpdate()}return P};Graph.prototype.insertImage=+function(q,B,C){if(null!=q&&null!=this.cellEditor.textarea){for(var F=this.cellEditor.textarea.getElementsByTagName("img"),J=[],P=0;P<F.length;P++)J.push(F[P]);document.execCommand("insertimage",!1,q);q=this.cellEditor.textarea.getElementsByTagName("img");if(q.length==J.length+1)for(P=q.length-1;0<=P;P--)if(0==P||q[P]!=J[P-1]){q[P].setAttribute("width",B);q[P].setAttribute("height",C);break}}};Graph.prototype.insertLink=function(q){if(null!=this.cellEditor.textarea)if(0==q.length)document.execCommand("unlink",+!1);else if(mxClient.IS_FF){for(var B=this.cellEditor.textarea.getElementsByTagName("a"),C=[],F=0;F<B.length;F++)C.push(B[F]);document.execCommand("createlink",!1,mxUtils.trim(q));B=this.cellEditor.textarea.getElementsByTagName("a");if(B.length==C.length+1)for(F=B.length-1;0<=F;F--)if(B[F]!=C[F-1]){for(B=B[F].getElementsByTagName("a");0<B.length;){for(C=B[0].parentNode;null!=B[0].firstChild;)C.insertBefore(B[0].firstChild,B[0]);C.removeChild(B[0])}break}}else document.execCommand("createlink",!1,+mxUtils.trim(q))};Graph.prototype.isCellResizable=function(q){var B=mxGraph.prototype.isCellResizable.apply(this,arguments),C=this.getCurrentCellStyle(q);return!this.isTableCell(q)&&!this.isTableRow(q)&&(B||"0"!=mxUtils.getValue(C,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==C[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(q,B,C){null==B&&(B=this.getSelectionCells());if(null!=B&&1<B.length){for(var F=[],J=null,P=null,Y=0,ma=0;ma<B.length;ma++)if(this.getModel().isVertex(B[ma])){var ca=+this.view.getState(B[ma]);if(null!=ca){var na=q?ca.getCenterX():ca.getCenterY();J=null!=J?Math.max(J,na):na;P=null!=P?Math.min(P,na):na;C&&(Y+=q?ca.width:ca.height);F.push(ca)}}if(2<F.length){F.sort(function(Ra,Sa){return q?Ra.x-Sa.x:Ra.y-Sa.y});C&&(Y-=q?F[0].width/2+F[F.length-1].width/2:F[0].height/2+F[F.length-1].height/2);ca=this.view.translate;na=this.view.scale;P=P/na-(q?ca.x:ca.y);J=J/na-(q?ca.x:ca.y);this.getModel().beginUpdate();try{var ta=(J-P-Y)/(F.length-1),Fa=P+(C?q?F[0].width/2:F[0].height/+2:0);for(ma=1;ma<F.length-1;ma++){var Da=this.view.getState(this.model.getParent(F[ma].cell)),Na=this.getCellGeometry(F[ma].cell);Fa+=ta;null!=Na&&null!=Da&&(Na=Na.clone(),q?Na.x=Math.round(Fa-(C?0:Na.width/2))-Da.origin.x:Na.y=Math.round(Fa-(C?0:Na.height/2))-Da.origin.y,this.getModel().setGeometry(F[ma].cell,Na));C&&(Fa+=q?F[ma].width:F[ma].height)}}finally{this.getModel().endUpdate()}}}return B};Graph.prototype.isCloneEvent=function(q){return mxClient.IS_MAC&&mxEvent.isMetaDown(q)||mxEvent.isControlDown(q)};+Graph.prototype.createSvgImageExport=function(q){q=new mxImageExport;q.addCellData=function(C,F,J){F.setAttribute("data-cell-id",C.id);if(J)if(mxUtils.isNode(C.value))for(J=0;J<C.value.attributes.length;J++){var P=C.value.attributes[J];F.setAttribute("data-cell-"+P.name,P.value)}else if("object"===typeof C.value)for(P in C.value)F.setAttribute("data-cell-"+P,C.value[P]);else null!=C.value&&F.setAttribute("data-cell-value",C.value);return F};var B=q.visitStatesRecursive;q.visitStatesRecursive=function(C,+F,J){if(null!=C){var P=F.root,Y=F.root.ownerDocument;F.root=this.addCellData(C.cell,null!=Y.createElementNS?Y.createElementNS(mxConstants.NS_SVG,"g"):Y.createElement("g"),Editor.addSvgMetadata);P.appendChild(F.root);B.apply(this,arguments);F.root=P}};q.getLinkForCellState=mxUtils.bind(this,function(C,F){return this.getLinkForCell(C.cell)});q.getTitleForCellState=mxUtils.bind(this,function(C,F){return Editor.convertHtmlToText(this.convertValueToTooltip(C.cell))});return q};Graph.prototype.parseBackgroundImage=+function(q){var B=null;null!=q&&0<q.length&&(q=JSON.parse(q),B=new mxImage(q.src,q.width,q.height));return B};Graph.prototype.getBackgroundImageObject=function(q){return q};Graph.prototype.getSvg=function(q,B,C,F,J,P,Y,ma,ca,na,ta,Fa,Da,Na,Ra,Sa){var Aa=null;if(null!=Na)for(Aa=new mxDictionary,J=0;J<Na.length;J++)Aa.put(Na[J],!0);Na=this.useCssTransforms;var cb=this.enableFlowAnimation;this.enableFlowAnimation=!1;Na&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{B=null!=+B?B:1;C=null!=C?C:0;P=null!=P?P:!0;Y=null!=Y?Y:!0;na=null!=na?na:!1;ca=null!=ca?ca:this.defaultExportLinkTarget;var Wa="page"==Da?this.view.getBackgroundPageBounds():P&&null==Aa||F||"diagram"==Da?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),Qa=this.backgroundImage,Ya=this.view.translate,bb=this.view.scale;"diagram"==Da&&null!=Qa&&null!=Qa.width&&null!=Qa.height&&(Wa=mxRectangle.fromRectangle(Wa),Wa.add(new mxRectangle((Ya.x+Qa.x)*bb,(Ya.y+Qa.y)*bb,Qa.width*bb,Qa.height*bb)));+if(null==Wa)throw Error(mxResources.get("drawingEmpty"));F=B/bb;var nb=Math.max(1,Math.ceil(Wa.width*F)+2*C)+(na&&0==C?5:0),sb=Math.max(1,Math.ceil(Wa.height*F)+2*C)+(na&&0==C?5:0),ob=mxUtils.getLightDarkColor(q),lb=Graph.createSvgNode(0,0,nb,sb,ob),qb=lb.ownerDocument;if(null!=q){var pb=mxUtils.createElementNs(qb,mxConstants.NS_SVG,"rect");pb.setAttribute("fill",ob.light);pb.style.fill=ob.cssText;pb.setAttribute("width","100%");pb.setAttribute("height","100%");pb.setAttribute("x","0");pb.setAttribute("y","0");lb.appendChild(pb)}var vb=mxUtils.createElementNs(qb,mxConstants.NS_SVG,"g");lb.appendChild(vb);var fb=this.createSvgCanvas(vb);fb.translate(Math.floor(C/B-Wa.x/bb),Math.floor(C/B-Wa.y/bb));fb.idPrefix="drawio-svg-"+Editor.guid();var Ab=document.createElement("div"),tb=fb.getAlternateText;fb.getAlternateText=function(Za,ub,gb,c,m,p,n,r,w,x,I,A,ea){if(null!=p&&0<this.state.fontSize)try{mxUtils.isNode(p)?p=p.innerText:(Ab.innerHTML=p,p=mxUtils.extractTextWithWhitespace(Ab.childNodes));for(var Q=Math.ceil(2*c/this.state.fontSize),Ca=[],Ua=0,Pa=0;(0==Q||Ua<Q)&&Pa<p.length;){var ra=p.charCodeAt(Pa);if(10==ra||13==ra){if(0<Ua)break}else Ca.push(p.charAt(Pa)),255>ra&&Ua++;Pa++}Ca.length<p.length&&1<p.length-Ca.length&&(p=mxUtils.trim(Ca.join(""))+"...");return p}catch(xa){return tb.apply(this,arguments)}else return tb.apply(this,arguments)};if(null!=Qa&&null!=Qa.width&&null!=Qa.height){q=bb/B;var mb=new mxRectangle((Qa.x+Ya.x)*q,(Qa.y+Ya.y)*q,Qa.width*q,Qa.height*q);mxUtils.intersects(Wa,mb)&&-fb.image(Qa.x+Ya.x,Qa.y+Ya.y,Qa.width,Qa.height,Qa.src,!0)}fb.scale(E);fb.textEnabled=Y;ma=null!=ma?ma:this.createSvgImageExport();var Xa=ma.getLinkForCellState;ma.getLinkForCellState=function(Za,ub){var gb=Za.view.graph.getAbsoluteUrl(Xa.apply(this,arguments));return null==gb||Za.view.graph.isCustomLink(gb)?null:gb};ma.getLinkTargetForCellState=function(Za,ub){return Za.view.graph.getLinkTargetForCell(Za.cell)};var wb=ma.drawCellState,xb=null,yb=mxUtils.bind(this,function(){if(null==xb){xb="ge-flow-animation-"++fb.image(Qa.x+Ya.x,Qa.y+Ya.y,Qa.width,Qa.height,Qa.src,!0)}fb.scale(F);fb.textEnabled=Y;ma=null!=ma?ma:this.createSvgImageExport();var Xa=ma.getLinkForCellState;ma.getLinkForCellState=function(Za,ub){var gb=Za.view.graph.getAbsoluteUrl(Xa.apply(this,arguments));return null==gb||Za.view.graph.isCustomLink(gb)?null:gb};ma.getLinkTargetForCellState=function(Za,ub){return Za.view.graph.getLinkTargetForCell(Za.cell)};var wb=ma.drawCellState,xb=null,yb=mxUtils.bind(this,function(){if(null==xb){xb="ge-flow-animation-"+Editor.guid();var Za=null!=qb.createElementNS?qb.createElementNS(mxConstants.NS_SVG,"style"):qb.createElement("style");Za.innerHTML=this.createFlowAnimationCss(xb);qb.getElementsByTagName("defs")[0].appendChild(Za)}return xb});ma.drawCellState=function(Za,ub){for(var gb=Za.view.graph,c=null!=Aa?Aa.get(Za.cell):gb.isCellSelected(Za.cell),m=gb.model.getParent(Za.cell);!(P&&null==Aa||c)&&null!=m;)c=null!=Aa?Aa.get(m):gb.isCellSelected(m),m=gb.model.getParent(m);if(null!=Za.shape)try{var p=Za.shape.isFlowAnimationEnabled,n=Za.shape.addFlowAnimationToShape;Za.shape.isFlowAnimationEnabled=function(){return cb&&gb.model.isEdge(Za.cell)&&"1"==mxUtils.getValue(Za.style,"flowAnimation","0")};Za.shape.addFlowAnimationToShape=function(){gb.addFlowAnimationToNode(this.getFlowAnimationPath(),Za.style,B,yb())};if(P&&null==Aa||c)gb.view.redrawEnumerationState(Za),wb.apply(this,arguments),this.doDrawShape(Za.secondLabel,ub)}finally{Za.shape.isFlowAnimationEnabled=p,Za.shape.addFlowAnimationToShape=n}};var zb=null!=this.view.currentRoot?-this.view.currentRoot:this.model.root;ma.drawState(this.getView().getState(zb),fb);this.addForeignObjectWarning(fb,lb);Sa?this.disableSvgLinks(lb):this.updateSvgLinks(lb,ca,!0);return lb}finally{this.enableFlowAnimation=cb,Na&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(q,B){if("0"!=urlParams["svg-warning"]&&0<B.getElementsByTagName("foreignObject").length){var C=q.createElement("switch"),E=q.createElement("g");E.setAttribute("requiredFeatures",+this.view.currentRoot:this.model.root;ma.drawState(this.getView().getState(zb),fb);this.addForeignObjectWarning(fb,lb);Sa?this.disableSvgLinks(lb):this.updateSvgLinks(lb,ca,!0);return lb}finally{this.enableFlowAnimation=cb,Na&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(q,B){if("0"!=urlParams["svg-warning"]&&0<B.getElementsByTagName("foreignObject").length){var C=q.createElement("switch"),F=q.createElement("g");F.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var J=q.createElement("a");J.setAttribute("transform","translate(0,-5)");null==J.setAttributeNS||B.ownerDocument!=document&&null==document.documentMode?(J.setAttribute("xlink:href",Graph.foreignObjectWarningLink),J.setAttribute("target","_blank")):(J.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),J.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));q=q.createElement("text");q.setAttribute("text-anchor","middle");-q.setAttribute("font-size","10px");q.setAttribute("x","50%");q.setAttribute("y","100%");mxUtils.write(q,Graph.foreignObjectWarningText);C.appendChild(E);J.appendChild(q);C.appendChild(J);B.appendChild(C)}};Graph.prototype.disableSvgLinks=function(q,B){q=q.getElementsByTagName("a");for(var C=0;C<q.length;C++){var E=q[C].getAttribute("href");null==E&&(E=q[C].getAttribute("xlink:href"));null!=E&&(q[C].style.pointerEvents="none",q[C].setAttribute("href",""));B&&B(q[C])}};Graph.prototype.updateSvgLinks=-function(q,B,C){q=q.getElementsByTagName("a");for(var E=0;E<q.length;E++)if(null==q[E].getAttribute("target")){var J=q[E].getAttribute("href");null==J&&(J=q[E].getAttribute("xlink:href"));null!=J&&(null!=B&&/^https?:\/\//.test(J)?q[E].setAttribute("target",B):C&&this.isCustomLink(J)&&q[E].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(q){q=new mxSvgCanvas2D(q);q.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;q.adaptiveColors=this.getAdaptiveColors();q.pointerEvents=+q.setAttribute("font-size","10px");q.setAttribute("x","50%");q.setAttribute("y","100%");mxUtils.write(q,Graph.foreignObjectWarningText);C.appendChild(F);J.appendChild(q);C.appendChild(J);B.appendChild(C)}};Graph.prototype.disableSvgLinks=function(q,B){q=q.getElementsByTagName("a");for(var C=0;C<q.length;C++){var F=q[C].getAttribute("href");null==F&&(F=q[C].getAttribute("xlink:href"));null!=F&&(q[C].style.pointerEvents="none",q[C].setAttribute("href",""));B&&B(q[C])}};Graph.prototype.updateSvgLinks=+function(q,B,C){q=q.getElementsByTagName("a");for(var F=0;F<q.length;F++)if(null==q[F].getAttribute("target")){var J=q[F].getAttribute("href");null==J&&(J=q[F].getAttribute("xlink:href"));null!=J&&(null!=B&&/^https?:\/\//.test(J)?q[F].setAttribute("target",B):C&&this.isCustomLink(J)&&q[F].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(q){q=new mxSvgCanvas2D(q);q.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;q.adaptiveColors=this.getAdaptiveColors();q.pointerEvents=!0;return q};Graph.prototype.getSelectedElement=function(){var q=null;if(window.getSelection){var B=window.getSelection();B.getRangeAt&&B.rangeCount&&(q=B.getRangeAt(0).commonAncestorContainer)}else document.selection&&(q=document.selection.createRange().parentElement());return q};Graph.prototype.getSelectedEditingElement=function(){var q=null;if(null!=this.cellEditor.textarea)for(q=this.getSelectedElement();null!=q&&q.nodeType!=mxConstants.NODETYPE_ELEMENT;)q=q.parentNode;return q};Graph.prototype.getParentByName=function(q,B,C){for(;null!=q&&q.nodeName!=B;){if(q==C)return null;q=q.parentNode}return q};Graph.prototype.getParentByNames=function(q,B,C){for(;null!=q&&!(0<=mxUtils.indexOf(B,q.nodeName));){if(q==C)return null;q=q.parentNode}return q};Graph.prototype.selectNode=function(q){var B=null;if(window.getSelection){if(B=window.getSelection(),B.getRangeAt&&B.rangeCount){var C=document.createRange();C.selectNode(q);B.removeAllRanges();B.addRange(C)}}else(B=document.selection)&&"Control"!=B.type&&(q=B.createRange(),-q.collapse(!0),C=B.createRange(),C.setEndPoint("StartToStart",q),C.select())};Graph.prototype.flipEdgePoints=function(q,B,C){var E=this.getCellGeometry(q);if(null!=E){E=E.clone();if(null!=E.points)for(var J=0;J<E.points.length;J++)B?E.points[J].x=C+(C-E.points[J].x):E.points[J].y=C+(C-E.points[J].y);J=function(P){null!=P&&(B?P.x=C+(C-P.x):P.y=C+(C-P.y))};J(E.getTerminalPoint(!0));J(E.getTerminalPoint(!1));this.model.setGeometry(q,E)}};Graph.prototype.flipChildren=function(q,B,C){this.model.beginUpdate();-try{for(var E=this.model.getChildCount(q),J=0;J<E;J++){var P=this.model.getChildAt(q,J);if(this.model.isEdge(P))this.flipEdgePoints(P,B,C);else{var Y=this.getCellGeometry(P);null!=Y&&(Y=Y.clone(),B?Y.x=C+(C-Y.x-Y.width):Y.y=C+(C-Y.y-Y.height),this.model.setGeometry(P,Y))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(q,B,C){return null!=q&&1==mxUtils.getValue(q.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(q,B,C):mxGraph.prototype.getConnectionPoint.apply(this,-arguments)};Graph.prototype.getLegacyConnectionPoint=function(q,B,C){C=null!=C?C:!0;var E=null;if(null!=q&&null!=B.point){var J=this.view.getPerimeterBounds(q),P=new mxPoint(J.getCenterX(),J.getCenterY()),Y=q.style[mxConstants.STYLE_DIRECTION],ma=0;null!=Y&&1==mxUtils.getValue(q.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(Y==mxConstants.DIRECTION_NORTH?ma+=270:Y==mxConstants.DIRECTION_WEST?ma+=180:Y==mxConstants.DIRECTION_SOUTH&&(ma+=90),Y!=mxConstants.DIRECTION_NORTH&&Y!=mxConstants.DIRECTION_SOUTH||-J.rotate90());E=this.view.scale;E=new mxPoint(J.x+B.point.x*J.width+B.dx*E,J.y+B.point.y*J.height+B.dy*E);var ca=q.style[mxConstants.STYLE_ROTATION]||0;if(B.perimeter)0!=ma&&(Y=J=0,90==ma?Y=1:180==ma?J=-1:270==ma&&(Y=-1),E=mxUtils.getRotatedPoint(E,J,Y,P)),E=this.view.getPerimeterPoint(q,E,!1);else if(ca+=ma,this.getModel().isVertex(q.cell)){ma=1==q.style[mxConstants.STYLE_FLIPH];B=1==q.style[mxConstants.STYLE_FLIPV];null!=q.shape&&null!=q.shape.stencil&&(ma=1==mxUtils.getValue(q.style,"stencilFlipH",-0)||ma,B=1==mxUtils.getValue(q.style,"stencilFlipV",0)||B);if(Y==mxConstants.DIRECTION_NORTH||Y==mxConstants.DIRECTION_SOUTH)q=ma,ma=B,B=q;ma&&(E.x=2*J.getCenterX()-E.x);B&&(E.y=2*J.getCenterY()-E.y)}0!=ca&&null!=E&&(q=mxUtils.toRadians(ca),J=Math.cos(q),Y=Math.sin(q),E=mxUtils.getRotatedPoint(E,J,Y,P))}C&&null!=E&&(E.x=Math.round(E.x),E.y=Math.round(E.y));return E};Graph.prototype.flipCells=function(q,B){this.model.beginUpdate();try{q=this.model.getTopmostCells(q);for(var C=[],E=0;E<q.length;E++)if(this.model.isEdge(q[E])){var J=-this.view.getState(q[E]);null!=J&&this.flipEdgePoints(q[E],B,(B?J.getCenterX():J.getCenterY())/this.view.scale-(B?J.origin.x:J.origin.y)-(B?this.view.translate.x:this.view.translate.y))}else{var P=this.getCellGeometry(q[E]);null!=P&&this.flipChildren(q[E],B,B?P.getCenterX()-P.x:P.getCenterY()-P.y);C.push(q[E])}this.toggleCellStyles(B?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,C);this.setCellStyles("legacyAnchorPoints","0",C)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(q,-B){var C=null;if(null!=q&&0<q.length){this.model.beginUpdate();try{for(var E=0;E<q.length;E++){var J=this.model.getParent(q[E]);if(this.isTable(J)){var P=this.getCellGeometry(q[E]),Y=this.getCellGeometry(J);null!=P&&null!=Y&&(Y=Y.clone(),Y.height-=P.height,this.model.setGeometry(J,Y))}}var ma=this.selectParentAfterDelete?this.model.getParents(q):null;this.removeCells(q,B)}finally{this.model.endUpdate()}if(null!=ma)for(C=[],E=0;E<ma.length;E++)this.model.contains(ma[E])&&(this.model.isVertex(ma[E])||-this.model.isEdge(ma[E]))&&C.push(ma[E])}return C};Graph.prototype.insertTableColumn=function(q,B){var C=this.getModel();C.beginUpdate();try{var E=q,J=0;if(this.isTableCell(q)){var P=C.getParent(q);E=C.getParent(P);J=mxUtils.indexOf(C.getChildCells(P,!0),q)}else this.isTableRow(q)?E=C.getParent(q):q=C.getChildCells(E,!0)[0],B||(J=C.getChildCells(q,!0).length-1);var Y=C.getChildCells(E,!0),ma=Graph.minTableColumnWidth;for(q=0;q<Y.length;q++){var ca=C.getChildCells(Y[q],!0)[J],na=C.cloneCell(ca,!1);-null==na&&(na=this.createVertex());var ta=this.getCellGeometry(na);na.value=null;na.style=mxUtils.setStyle(mxUtils.setStyle(na.style,"rowspan",null),"colspan",null);if(null!=ta){null!=ta.alternateBounds&&(ta.width=ta.alternateBounds.width,ta.height=ta.alternateBounds.height,ta.alternateBounds=null);ma=ta.width;var Fa=this.getCellGeometry(Y[q]);null!=Fa&&(ta.height=Fa.height)}C.add(Y[q],na,J+(B?0:1))}var Da=this.getCellGeometry(E);null!=Da&&(Da=Da.clone(),Da.width+=ma,C.setGeometry(E,Da))}finally{C.endUpdate()}};-Graph.prototype.deleteLane=function(q){var B=this.getModel();B.beginUpdate();try{var C=null;C="stackLayout"==this.getCurrentCellStyle(q).childLayout?q:B.getParent(q);var E=B.getChildCells(C,!0);0==E.length?B.remove(C):(C==q&&(q=E[E.length-1]),B.remove(q))}finally{B.endUpdate()}};Graph.prototype.insertLane=function(q,B){var C=this.getModel();C.beginUpdate();try{var E=null;if("stackLayout"==this.getCurrentCellStyle(q).childLayout){E=q;var J=C.getChildCells(E,!0);q=J[B?0:J.length-1]}else E=C.getParent(q);-var P=E.getIndex(q);q=C.cloneCell(q,!1);q.value=null;C.add(E,q,P+(B?0:1))}finally{C.endUpdate()}};Graph.prototype.insertTableRow=function(q,B){var C=this.getModel();C.beginUpdate();try{var E=q,J=q;if(this.isTableCell(q))J=C.getParent(q),E=C.getParent(J);else if(this.isTableRow(q))E=C.getParent(q);else{var P=C.getChildCells(E,!0);J=P[B?0:P.length-1]}var Y=C.getChildCells(J,!0),ma=E.getIndex(J);J=C.cloneCell(J,!1);J.value=null;var ca=this.getCellGeometry(J);if(null!=ca){for(P=0;P<Y.length;P++){q=C.cloneCell(Y[P],-!1);q.value=null;q.style=mxUtils.setStyle(mxUtils.setStyle(q.style,"rowspan",null),"colspan",null);var na=this.getCellGeometry(q);null!=na&&(null!=na.alternateBounds&&(na.width=na.alternateBounds.width,na.height=na.alternateBounds.height,na.alternateBounds=null),na.height=ca.height);J.insert(q)}C.add(E,J,ma+(B?0:1));var ta=this.getCellGeometry(E);null!=ta&&(ta=ta.clone(),ta.height+=ca.height,C.setGeometry(E,ta))}}finally{C.endUpdate()}};Graph.prototype.deleteTableColumn=function(q){var B=this.getModel();-B.beginUpdate();try{var C=q,E=q;this.isTableCell(q)&&(E=B.getParent(q));this.isTableRow(E)&&(C=B.getParent(E));var J=B.getChildCells(C,!0);if(0==J.length)B.remove(C);else{this.isTableRow(E)||(E=J[0]);var P=B.getChildCells(E,!0);if(1>=P.length)B.remove(C);else{var Y=P.length-1;this.isTableCell(q)&&(Y=mxUtils.indexOf(P,q));for(E=q=0;E<J.length;E++){var ma=B.getChildCells(J[E],!0)[Y];B.remove(ma);var ca=this.getCellGeometry(ma);null!=ca&&(q=Math.max(q,ca.width))}var na=this.getCellGeometry(C);null!=-na&&(na=na.clone(),na.width-=q,B.setGeometry(C,na))}}}finally{B.endUpdate()}};Graph.prototype.deleteTableRow=function(q){var B=this.getModel();B.beginUpdate();try{var C=q,E=q;this.isTableCell(q)&&(q=E=B.getParent(q));this.isTableRow(q)&&(C=B.getParent(E));var J=B.getChildCells(C,!0);if(1>=J.length)B.remove(C);else{this.isTableRow(E)||(E=J[J.length-1]);B.remove(E);q=0;var P=this.getCellGeometry(E);null!=P&&(q=P.height);var Y=this.getCellGeometry(C);null!=Y&&(Y=Y.clone(),Y.height-=q,B.setGeometry(C,-Y))}}finally{B.endUpdate()}};Graph.prototype.insertRow=function(q,B){for(var C=q.tBodies[0],E=C.rows[0].cells,J=q=0;J<E.length;J++){var P=E[J].getAttribute("colspan");q+=null!=P?parseInt(P):1}B=C.insertRow(B);for(J=0;J<q;J++)mxUtils.br(B.insertCell(-1));return B.cells[0]};Graph.prototype.deleteRow=function(q,B){q.tBodies[0].deleteRow(B)};Graph.prototype.insertColumn=function(q,B){var C=q.tHead;if(null!=C)for(var E=0;E<C.rows.length;E++){var J=document.createElement("th");C.rows[E].appendChild(J);-mxUtils.br(J)}q=q.tBodies[0];for(C=0;C<q.rows.length;C++)E=q.rows[C].insertCell(B),mxUtils.br(E);return q.rows[0].cells[0<=B?B:q.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(q,B){if(0<=B){q=q.tBodies[0].rows;for(var C=0;C<q.length;C++)q[C].cells.length>B&&q[C].deleteCell(B)}};Graph.prototype.pasteHtmlAtCaret=function(q){if(window.getSelection){var B=window.getSelection();if(B.getRangeAt&&B.rangeCount){B=B.getRangeAt(0);B.deleteContents();var C=document.createElement("div");C.innerHTML=-q;q=document.createDocumentFragment();for(var E;E=C.firstChild;)lastNode=q.appendChild(E);B.insertNode(q)}}else(B=document.selection)&&"Control"!=B.type&&B.createRange().pasteHTML(q)};Graph.prototype.createLinkForHint=function(q,B,C){function E(P,Y){P.length>Y&&(P=P.substring(0,Math.round(Y/2))+"..."+P.substring(P.length-Math.round(Y/4)));return P}q=null!=q?q:"javascript:void(0);";if(null==B||0==B.length)B=this.isCustomLink(q)?this.getLinkTitle(q):q;var J=document.createElement("a");J.setAttribute("rel",-this.linkRelation);J.setAttribute("href",this.getAbsoluteUrl(q));J.setAttribute("title",E(this.isCustomLink(q)?this.getLinkTitle(q):q,80));null!=this.linkTarget&&J.setAttribute("target",this.linkTarget);mxUtils.write(J,E(B,40));this.isCustomLink(q)&&mxEvent.addListener(J,"click",mxUtils.bind(this,function(P){this.customLinkClicked(q,C);mxEvent.consume(P)}));return J};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};+q.collapse(!0),C=B.createRange(),C.setEndPoint("StartToStart",q),C.select())};Graph.prototype.flipEdgePoints=function(q,B,C){var F=this.getCellGeometry(q);if(null!=F){F=F.clone();if(null!=F.points)for(var J=0;J<F.points.length;J++)B?F.points[J].x=C+(C-F.points[J].x):F.points[J].y=C+(C-F.points[J].y);J=function(P){null!=P&&(B?P.x=C+(C-P.x):P.y=C+(C-P.y))};J(F.getTerminalPoint(!0));J(F.getTerminalPoint(!1));this.model.setGeometry(q,F)}};Graph.prototype.flipChildren=function(q,B,C){this.model.beginUpdate();+try{for(var F=this.model.getChildCount(q),J=0;J<F;J++){var P=this.model.getChildAt(q,J);if(this.model.isEdge(P))this.flipEdgePoints(P,B,C);else{var Y=this.getCellGeometry(P);null!=Y&&(Y=Y.clone(),B?Y.x=C+(C-Y.x-Y.width):Y.y=C+(C-Y.y-Y.height),this.model.setGeometry(P,Y))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(q,B,C){return null!=q&&1==mxUtils.getValue(q.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(q,B,C):mxGraph.prototype.getConnectionPoint.apply(this,+arguments)};Graph.prototype.getLegacyConnectionPoint=function(q,B,C){C=null!=C?C:!0;var F=null;if(null!=q&&null!=B.point){var J=this.view.getPerimeterBounds(q),P=new mxPoint(J.getCenterX(),J.getCenterY()),Y=q.style[mxConstants.STYLE_DIRECTION],ma=0;null!=Y&&1==mxUtils.getValue(q.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(Y==mxConstants.DIRECTION_NORTH?ma+=270:Y==mxConstants.DIRECTION_WEST?ma+=180:Y==mxConstants.DIRECTION_SOUTH&&(ma+=90),Y!=mxConstants.DIRECTION_NORTH&&Y!=mxConstants.DIRECTION_SOUTH||+J.rotate90());F=this.view.scale;F=new mxPoint(J.x+B.point.x*J.width+B.dx*F,J.y+B.point.y*J.height+B.dy*F);var ca=q.style[mxConstants.STYLE_ROTATION]||0;if(B.perimeter)0!=ma&&(Y=J=0,90==ma?Y=1:180==ma?J=-1:270==ma&&(Y=-1),F=mxUtils.getRotatedPoint(F,J,Y,P)),F=this.view.getPerimeterPoint(q,F,!1);else if(ca+=ma,this.getModel().isVertex(q.cell)){ma=1==q.style[mxConstants.STYLE_FLIPH];B=1==q.style[mxConstants.STYLE_FLIPV];null!=q.shape&&null!=q.shape.stencil&&(ma=1==mxUtils.getValue(q.style,"stencilFlipH",+0)||ma,B=1==mxUtils.getValue(q.style,"stencilFlipV",0)||B);if(Y==mxConstants.DIRECTION_NORTH||Y==mxConstants.DIRECTION_SOUTH)q=ma,ma=B,B=q;ma&&(F.x=2*J.getCenterX()-F.x);B&&(F.y=2*J.getCenterY()-F.y)}0!=ca&&null!=F&&(q=mxUtils.toRadians(ca),J=Math.cos(q),Y=Math.sin(q),F=mxUtils.getRotatedPoint(F,J,Y,P))}C&&null!=F&&(F.x=Math.round(F.x),F.y=Math.round(F.y));return F};Graph.prototype.flipCells=function(q,B){this.model.beginUpdate();try{q=this.model.getTopmostCells(q);for(var C=[],F=0;F<q.length;F++)if(this.model.isEdge(q[F])){var J=+this.view.getState(q[F]);null!=J&&this.flipEdgePoints(q[F],B,(B?J.getCenterX():J.getCenterY())/this.view.scale-(B?J.origin.x:J.origin.y)-(B?this.view.translate.x:this.view.translate.y))}else{var P=this.getCellGeometry(q[F]);null!=P&&this.flipChildren(q[F],B,B?P.getCenterX()-P.x:P.getCenterY()-P.y);C.push(q[F])}this.toggleCellStyles(B?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,C);this.setCellStyles("legacyAnchorPoints","0",C)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(q,+B){var C=null;if(null!=q&&0<q.length){this.model.beginUpdate();try{for(var F=0;F<q.length;F++){var J=this.model.getParent(q[F]);if(this.isTable(J)){var P=this.getCellGeometry(q[F]),Y=this.getCellGeometry(J);null!=P&&null!=Y&&(Y=Y.clone(),Y.height-=P.height,this.model.setGeometry(J,Y))}}var ma=this.selectParentAfterDelete?this.model.getParents(q):null;this.removeCells(q,B)}finally{this.model.endUpdate()}if(null!=ma)for(C=[],F=0;F<ma.length;F++)this.model.contains(ma[F])&&(this.model.isVertex(ma[F])||+this.model.isEdge(ma[F]))&&C.push(ma[F])}return C};Graph.prototype.insertTableColumn=function(q,B){var C=this.getModel();C.beginUpdate();try{var F=q,J=0;if(this.isTableCell(q)){var P=C.getParent(q);F=C.getParent(P);J=mxUtils.indexOf(C.getChildCells(P,!0),q)}else this.isTableRow(q)?F=C.getParent(q):q=C.getChildCells(F,!0)[0],B||(J=C.getChildCells(q,!0).length-1);var Y=C.getChildCells(F,!0),ma=Graph.minTableColumnWidth;for(q=0;q<Y.length;q++){var ca=C.getChildCells(Y[q],!0)[J],na=C.cloneCell(ca,!1);+null==na&&(na=this.createVertex());var ta=this.getCellGeometry(na);na.value=null;na.style=mxUtils.setStyle(mxUtils.setStyle(na.style,"rowspan",null),"colspan",null);if(null!=ta){null!=ta.alternateBounds&&(ta.width=ta.alternateBounds.width,ta.height=ta.alternateBounds.height,ta.alternateBounds=null);ma=ta.width;var Fa=this.getCellGeometry(Y[q]);null!=Fa&&(ta.height=Fa.height)}C.add(Y[q],na,J+(B?0:1))}var Da=this.getCellGeometry(F);null!=Da&&(Da=Da.clone(),Da.width+=ma,C.setGeometry(F,Da))}finally{C.endUpdate()}};+Graph.prototype.deleteLane=function(q){var B=this.getModel();B.beginUpdate();try{var C=null;C="stackLayout"==this.getCurrentCellStyle(q).childLayout?q:B.getParent(q);var F=B.getChildCells(C,!0);0==F.length?B.remove(C):(C==q&&(q=F[F.length-1]),B.remove(q))}finally{B.endUpdate()}};Graph.prototype.insertLane=function(q,B){var C=this.getModel();C.beginUpdate();try{var F=null;if("stackLayout"==this.getCurrentCellStyle(q).childLayout){F=q;var J=C.getChildCells(F,!0);q=J[B?0:J.length-1]}else F=C.getParent(q);+var P=F.getIndex(q);q=C.cloneCell(q,!1);q.value=null;C.add(F,q,P+(B?0:1))}finally{C.endUpdate()}};Graph.prototype.insertTableRow=function(q,B){var C=this.getModel();C.beginUpdate();try{var F=q,J=q;if(this.isTableCell(q))J=C.getParent(q),F=C.getParent(J);else if(this.isTableRow(q))F=C.getParent(q);else{var P=C.getChildCells(F,!0);J=P[B?0:P.length-1]}var Y=C.getChildCells(J,!0),ma=F.getIndex(J);J=C.cloneCell(J,!1);J.value=null;var ca=this.getCellGeometry(J);if(null!=ca){for(P=0;P<Y.length;P++){q=C.cloneCell(Y[P],+!1);q.value=null;q.style=mxUtils.setStyle(mxUtils.setStyle(q.style,"rowspan",null),"colspan",null);var na=this.getCellGeometry(q);null!=na&&(null!=na.alternateBounds&&(na.width=na.alternateBounds.width,na.height=na.alternateBounds.height,na.alternateBounds=null),na.height=ca.height);J.insert(q)}C.add(F,J,ma+(B?0:1));var ta=this.getCellGeometry(F);null!=ta&&(ta=ta.clone(),ta.height+=ca.height,C.setGeometry(F,ta))}}finally{C.endUpdate()}};Graph.prototype.deleteTableColumn=function(q){var B=this.getModel();+B.beginUpdate();try{var C=q,F=q;this.isTableCell(q)&&(F=B.getParent(q));this.isTableRow(F)&&(C=B.getParent(F));var J=B.getChildCells(C,!0);if(0==J.length)B.remove(C);else{this.isTableRow(F)||(F=J[0]);var P=B.getChildCells(F,!0);if(1>=P.length)B.remove(C);else{var Y=P.length-1;this.isTableCell(q)&&(Y=mxUtils.indexOf(P,q));for(F=q=0;F<J.length;F++){var ma=B.getChildCells(J[F],!0)[Y];B.remove(ma);var ca=this.getCellGeometry(ma);null!=ca&&(q=Math.max(q,ca.width))}var na=this.getCellGeometry(C);null!=+na&&(na=na.clone(),na.width-=q,B.setGeometry(C,na))}}}finally{B.endUpdate()}};Graph.prototype.deleteTableRow=function(q){var B=this.getModel();B.beginUpdate();try{var C=q,F=q;this.isTableCell(q)&&(q=F=B.getParent(q));this.isTableRow(q)&&(C=B.getParent(F));var J=B.getChildCells(C,!0);if(1>=J.length)B.remove(C);else{this.isTableRow(F)||(F=J[J.length-1]);B.remove(F);q=0;var P=this.getCellGeometry(F);null!=P&&(q=P.height);var Y=this.getCellGeometry(C);null!=Y&&(Y=Y.clone(),Y.height-=q,B.setGeometry(C,+Y))}}finally{B.endUpdate()}};Graph.prototype.insertRow=function(q,B){for(var C=q.tBodies[0],F=C.rows[0].cells,J=q=0;J<F.length;J++){var P=F[J].getAttribute("colspan");q+=null!=P?parseInt(P):1}B=C.insertRow(B);for(J=0;J<q;J++)mxUtils.br(B.insertCell(-1));return B.cells[0]};Graph.prototype.deleteRow=function(q,B){q.tBodies[0].deleteRow(B)};Graph.prototype.insertColumn=function(q,B){var C=q.tHead;if(null!=C)for(var F=0;F<C.rows.length;F++){var J=document.createElement("th");C.rows[F].appendChild(J);+mxUtils.br(J)}q=q.tBodies[0];for(C=0;C<q.rows.length;C++)F=q.rows[C].insertCell(B),mxUtils.br(F);return q.rows[0].cells[0<=B?B:q.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(q,B){if(0<=B){q=q.tBodies[0].rows;for(var C=0;C<q.length;C++)q[C].cells.length>B&&q[C].deleteCell(B)}};Graph.prototype.pasteHtmlAtCaret=function(q){if(window.getSelection){var B=window.getSelection();if(B.getRangeAt&&B.rangeCount){B=B.getRangeAt(0);B.deleteContents();var C=document.createElement("div");C.innerHTML=+q;q=document.createDocumentFragment();for(var F;F=C.firstChild;)lastNode=q.appendChild(F);B.insertNode(q)}}else(B=document.selection)&&"Control"!=B.type&&B.createRange().pasteHTML(q)};Graph.prototype.createLinkForHint=function(q,B,C){function F(P,Y){P.length>Y&&(P=P.substring(0,Math.round(Y/2))+"..."+P.substring(P.length-Math.round(Y/4)));return P}q=null!=q?q:"javascript:void(0);";if(null==B||0==B.length)B=this.isCustomLink(q)?this.getLinkTitle(q):q;var J=document.createElement("a");J.setAttribute("rel",+this.linkRelation);J.setAttribute("href",this.getAbsoluteUrl(q));J.setAttribute("title",F(this.isCustomLink(q)?this.getLinkTitle(q):q,80));null!=this.linkTarget&&J.setAttribute("target",this.linkTarget);mxUtils.write(J,F(B,40));this.isCustomLink(q)&&mxEvent.addListener(J,"click",mxUtils.bind(this,function(P){this.customLinkClicked(q,C);mxEvent.consume(P)}));return J};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(P,Y){this.popupMenuHandler.hideMenu()});var q=this.updateMouseEvent;this.updateMouseEvent=function(P){P=q.apply(this,arguments);if(mxEvent.isTouchEvent(P.getEvent())&&null==P.getState()){var Y=this.getCellAt(P.graphX,P.graphY);null!=Y&&this.isSwimlane(Y)&&this.hitsSwimlaneContent(Y,P.graphX,P.graphY)||(P.state=this.view.getState(Y),null!=P.state&&null!=P.state.shape&&(this.container.style.cursor=P.state.shape.node.style.cursor))}null==P.getState()&&-this.isEnabled()&&(this.container.style.cursor="default");return P};var B=!1,C=!1,E=!1,J=this.fireMouseEvent;this.fireMouseEvent=function(P,Y,ma){P==mxEvent.MOUSE_DOWN&&(Y=this.updateMouseEvent(Y),B=this.isCellSelected(Y.getCell()),C=this.isSelectionEmpty(),E=this.popupMenuHandler.isMenuShowing());J.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(P,Y){if(null!=this.freehand&&!this.freehand.isDrawing()){var ma=mxEvent.isMouseEvent(Y.getEvent());this.popupMenuHandler.popupTrigger=-!this.isEditing()&&this.isEnabled()&&(null==Y.getState()||!Y.isSource(Y.getState().control))&&(this.popupMenuHandler.popupTrigger||!E&&!ma&&(C&&null==Y.getCell()&&this.isSelectionEmpty()||B&&this.isCellSelected(Y.getCell())));ma=!B||ma?null:mxUtils.bind(this,function(ca){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var na=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(Y.getX()+na.x+1,Y.getY()+na.y+1,ca,Y.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,+this.isEnabled()&&(this.container.style.cursor="default");return P};var B=!1,C=!1,F=!1,J=this.fireMouseEvent;this.fireMouseEvent=function(P,Y,ma){P==mxEvent.MOUSE_DOWN&&(Y=this.updateMouseEvent(Y),B=this.isCellSelected(Y.getCell()),C=this.isSelectionEmpty(),F=this.popupMenuHandler.isMenuShowing());J.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(P,Y){if(null!=this.freehand&&!this.freehand.isDrawing()){var ma=mxEvent.isMouseEvent(Y.getEvent());this.popupMenuHandler.popupTrigger=+!this.isEditing()&&this.isEnabled()&&(null==Y.getState()||!Y.isSource(Y.getState().control))&&(this.popupMenuHandler.popupTrigger||!F&&!ma&&(C&&null==Y.getCell()&&this.isSelectionEmpty()||B&&this.isCellSelected(Y.getCell())));ma=!B||ma?null:mxUtils.bind(this,function(ca){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var na=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(Y.getX()+na.x+1,Y.getY()+na.y+1,ca,Y.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[P,Y,ma])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var q=this.graph.view.getState(this.editingCell);return null!=q&&1==q.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var q="";window.getSelection?q=window.getSelection():document.getSelection?q=document.getSelection():document.selection&&(q=document.selection.createRange().text);return""!=q};mxCellEditor.prototype.insertTab=function(q){var B=this.textarea.ownerDocument.defaultView.getSelection(),C=B.getRangeAt(0);q=Graph.createTabNode(q);C.insertNode(q);C.setStartAfter(q);C.setEndAfter(q);B.removeAllRanges();B.addRange(C)};mxCellEditor.prototype.alignText=function(q,B){var C=this.graph.getView().getState(this.editingCell);if(null!=C){C=mxUtils.getValue(C.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);-var E=null!=C&&"vertical-"==C.substring(0,9),J=null!=B&&mxEvent.isShiftDown(B);if(J||null!=window.getSelection&&null!=window.getSelection().containsNode){var P=!0;this.graph.processElements(this.textarea,function(Y){J||E||window.getSelection().containsNode(Y,!0)?(Y.removeAttribute("align"),Y.style.textAlign=null):P=!1});(P||E)&&this.graph.cellEditor.setAlign(q)}E||document.execCommand("justify"+q.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var q=-window.getSelection();if(q.getRangeAt&&q.rangeCount){for(var B=[],C=0,E=q.rangeCount;C<E;++C)B.push(q.getRangeAt(C));return B}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(q){try{if(q)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var B=0,C=q.length;B<C;++B)sel.addRange(q[B])}else document.selection&&q.select&&q.select()}catch(E){}};var G=mxCellRenderer.prototype.initializeLabel;+var F=null!=C&&"vertical-"==C.substring(0,9),J=null!=B&&mxEvent.isShiftDown(B);if(J||null!=window.getSelection&&null!=window.getSelection().containsNode){var P=!0;this.graph.processElements(this.textarea,function(Y){J||F||window.getSelection().containsNode(Y,!0)?(Y.removeAttribute("align"),Y.style.textAlign=null):P=!1});(P||F)&&this.graph.cellEditor.setAlign(q)}F||document.execCommand("justify"+q.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var q=+window.getSelection();if(q.getRangeAt&&q.rangeCount){for(var B=[],C=0,F=q.rangeCount;C<F;++C)B.push(q.getRangeAt(C));return B}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(q){try{if(q)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var B=0,C=q.length;B<C;++B)sel.addRange(q[B])}else document.selection&&q.select&&q.select()}catch(F){}};var G=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(q){null!=q.text&&(q.text.replaceLinefeeds="0"!=mxUtils.getValue(q.style,"nl2Br","1"));G.apply(this,arguments)};var H=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(q,B){this.isKeepFocusEvent(q)||!mxEvent.isAltDown(q.getEvent())?H.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(q){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var M=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(q,B){q=this.graph.getStartEditingCell(q,B);M.apply(this,arguments);var C=this.graph.view.getState(q);this.textarea.className=null!=C&&1==C.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(q);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=C&&this.graph.isAutosizeTextState(C)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var q=this.graph.view.getState(this.editingCell);if(null!=q){var B=null!=q&&"0"!=mxUtils.getValue(q.style,"nl2Br","1"),C=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);ma=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<ma.length&&"\n"==ma.charAt(ma.length-1)&&(ma=ma.substring(0,-ma.length-1));ma=Graph.sanitizeHtml(B?ma.replace(/\n/g,"<br/>"):ma,!0);this.textarea.className="mxCellEditor geContentEditable";ca=mxUtils.getValue(q.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);B=mxUtils.getValue(q.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var E=mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),J=(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,P=(mxUtils.getValue(q.style,+ma.length-1));ma=Graph.sanitizeHtml(B?ma.replace(/\n/g,"<br/>"):ma,!0);this.textarea.className="mxCellEditor geContentEditable";ca=mxUtils.getValue(q.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);B=mxUtils.getValue(q.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var F=mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),J=(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,P=(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,Y=[];(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&Y.push("underline");(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&Y.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ca*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=-Math.round(ca)+"px";this.textarea.style.textDecoration=Y.join(" ");this.textarea.style.fontWeight=J?"bold":"normal";this.textarea.style.fontStyle=P?"italic":"";this.textarea.style.fontFamily=B;this.textarea.style.textAlign=E;this.textarea.style.padding="0px";this.textarea.innerHTML!=ma&&(this.textarea.innerHTML=ma,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,+Math.round(ca)+"px";this.textarea.style.textDecoration=Y.join(" ");this.textarea.style.fontWeight=J?"bold":"normal";this.textarea.style.fontStyle=P?"italic":"";this.textarea.style.fontFamily=B;this.textarea.style.textAlign=F;this.textarea.style.padding="0px";this.textarea.innerHTML!=ma&&(this.textarea.innerHTML=ma,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 ma=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(ma=mxUtils.replaceTrailingNewlines(ma,"<div><br></div>"));ma=Graph.sanitizeHtml(B?ma.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):ma,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ca=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ca*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ca)+"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!=ma&&(this.textarea.innerHTML=ma);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=C;this.resize()}};var N=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(q,B){if(null!=this.textarea)if(q=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=q){var C=q.view.scale;this.bounds=mxRectangle.fromRectangle(q);if(0==this.bounds.width&&-0==this.bounds.height){this.bounds.width=160*C;this.bounds.height=60*C;var E=null!=q.text?q.text.margin:null;null==E&&(E=mxUtils.getAlignmentAsPoint(mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(q.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=E.x*this.bounds.width;this.bounds.y+=E.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/C)+"px";this.textarea.style.height=Math.round((this.bounds.height-+0==this.bounds.height){this.bounds.width=160*C;this.bounds.height=60*C;var F=null!=q.text?q.text.margin:null;null==F&&(F=mxUtils.getAlignmentAsPoint(mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(q.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=F.x*this.bounds.width;this.bounds.y+=F.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/C)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/C)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/C)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*C);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/C)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*-C);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("+C+","+C+")")}else if(null!=q&&this.graph.isAutosizeTextState(q)){C=q.view.scale;E=q.style;var J=this.graph.getCellGeometry(this.editingCell);if(null!=J){this.bounds=mxRectangle.fromRectangle(q);this.textarea.style.left=Math.round(q.x)+"px";this.textarea.style.top=Math.round(q.y)+"px";var P=this.rotateText&&null!=this.textShape?-this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=P?"rotate("+P+"deg) ":"")+"scale("+C+","+C+")");this.textarea.style.borderWidth="0";this.textarea.style.width=Math.round(J.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(J.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==E[mxConstants.STYLE_WHITE_SPACE]&&-(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var Y=parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING,2));C=Y+parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING_TOP,0));P=Y+parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING_BOTTOM,0));var ma=Y+parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING_LEFT,0));Y+=parseInt(mxUtils.getValue(E,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(ma)+"px";this.textarea.style.paddingRight=-Math.round(Y)+"px";this.textarea.style.paddingTop=Math.round(C)+"px";this.textarea.style.paddingBottom=Math.round(P)+"px";this.textarea.style.display="flex";this.textarea.style.flexDirection="column";C=mxUtils.getValue(E,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.justifyContent=C==mxConstants.ALIGN_MIDDLE?"center":C==mxConstants.ALIGN_BOTTOM?"flex-end":"flex-start";C=this.textarea.innerText;null!=C&&0<C.length&&(J=this.graph.getAutosizeTextAvailableSpace(E,J.width,-J.height,q),null!=J&&(C=mxUtils.htmlEntities(C,!1).replace(/\n/g,"<br>"),E=this.graph.computeAutosizeTextFontSize(C,J.availW,J.availH,E[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,E[mxConstants.STYLE_FONTSTYLE],"wrap"==E[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=E+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?E*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow=-"",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",N.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(q,B){if("0"==mxUtils.getValue(q.style,"html",-"0"))return mxCellEditorGetInitialValue.apply(this,arguments);var C=this.graph.getEditingValue(q.cell,B);"1"==mxUtils.getValue(q.style,"nl2Br","1")&&(C=C.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(C,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(q,B){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(q.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};-mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(q){if("0"==mxUtils.getValue(q.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var B=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(q.style,"nl2Br","1")?(B=B.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<B.length&&("<br/>"==B.substring(B.length-5)||"<br>"==B.substring(B.length--4))&&(B=B.substring(0,B.lastIndexOf("<br"))+"<div><br/></div>")):B=B.replace(/\r\n/g,"").replace(/\n/g,"");return B};var L=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(q){this.codeViewMode&&this.toggleViewMode();L.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(q){}};var U=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(q,B){this.graph.getModel().beginUpdate();-try{U.apply(this,arguments),""==B&&this.graph.isCellDeletable(q.cell)&&0==this.graph.model.getChildCount(q.cell)&&this.graph.isTransparentState(q)&&this.graph.removeCells([q.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getBorderColor=function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BORDERCOLOR,-null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getMinimumSize=function(q){var B=this.graph.getView().scale;return new mxRectangle(0,0,null==q.text?30:q.text.size*B+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(q,B){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(B.getEvent)};mxGraphView.prototype.formatUnitText=function(q){return q?b(q,this.unit):q};mxGraphHandler.prototype.updateHint=-function(q){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var B=this.graph.view.translate,C=this.graph.view.scale;q=this.roundLength((this.bounds.x+this.currentDx)/C-B.x);B=this.roundLength((this.bounds.y+this.currentDy)/C-B.y);C=this.graph.view.unit;this.hint.innerHTML=b(q,C)+", "+b(B,C);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 X=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(q,B){X.apply(this,arguments);var C=this.graph.getCellStyle(q);if(null==C.childLayout){var E=this.graph.model.getParent(q),J=null!=E?this.graph.getCellGeometry(E):null;-if(null!=J&&(C=this.graph.getCellStyle(E),"stackLayout"==C.childLayout)){var P=parseFloat(mxUtils.getValue(C,"stackBorder",mxStackLayout.prototype.border));C="1"==mxUtils.getValue(C,"horizontalStack","1");var Y=this.graph.getActualStartSize(E);J=J.clone();C?J.height=B.height+Y.y+Y.height+2*P:J.width=B.width+Y.x+Y.width+2*P;this.graph.model.setGeometry(E,J)}}};var S=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function q(ma){C.get(ma)||-(C.put(ma,!0),J.push(ma))}for(var B=S.apply(this,arguments),C=new mxDictionary,E=this.graph.model,J=[],P=0;P<B.length;P++){var Y=B[P];this.graph.isTableCell(Y)?q(E.getParent(E.getParent(Y))):this.graph.isTableRow(Y)&&q(E.getParent(Y));q(Y)}return J};var V=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(q){return V.apply(this,arguments)&&!mxEvent.isControlDown(q.getEvent())&&!mxEvent.isShiftDown(q.getEvent())};var ha=mxVertexHandler.prototype.isGhostPreview;-mxVertexHandler.prototype.isGhostPreview=function(){return ha.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 R=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(q){var B=R.apply(this,arguments);B.stroke="#C0C0C0";B.strokewidth=1;return B};var Z=mxEdgeHandler.prototype.createParentHighlightShape;+C);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("+C+","+C+")")}else if(null!=q&&this.graph.isAutosizeTextState(q)){C=q.view.scale;F=q.style;var J=this.graph.getCellGeometry(this.editingCell);if(null!=J){this.bounds=mxRectangle.fromRectangle(q);this.textarea.style.left=Math.round(q.x)+"px";this.textarea.style.top=Math.round(q.y)+"px";var P=this.rotateText&&null!=this.textShape?+this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=P?"rotate("+P+"deg) ":"")+"scale("+C+","+C+")");this.textarea.style.borderWidth="0";this.textarea.style.width=Math.round(J.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(J.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==F[mxConstants.STYLE_WHITE_SPACE]&&+(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var Y=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING,2));C=Y+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_TOP,0));P=Y+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_BOTTOM,0));var ma=Y+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_LEFT,0));Y+=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(ma)+"px";this.textarea.style.paddingRight=+Math.round(Y)+"px";this.textarea.style.paddingTop=Math.round(C)+"px";this.textarea.style.paddingBottom=Math.round(P)+"px";this.textarea.style.display="table-cell";this.textarea.style.flexDirection="";this.textarea.style.justifyContent="";C=mxUtils.getValue(F,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.verticalAlign=C==mxConstants.ALIGN_MIDDLE?"middle":C==mxConstants.ALIGN_BOTTOM?"bottom":"top";C=this.textarea.innerText;null!=C&&0<C.length&&(J=this.graph.getAutosizeTextAvailableSpace(F,+J.width,J.height,q),null!=J&&(C=mxUtils.htmlEntities(C,!1).replace(/\n/g,"<br>"),F=this.graph.computeAutosizeTextFontSize(C,J.availW,J.availH,F[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,F[mxConstants.STYLE_FONTSTYLE],"wrap"==F[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=F+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?F*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",+this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",N.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=+function(q,B){if("0"==mxUtils.getValue(q.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var C=this.graph.getEditingValue(q.cell,B);"1"==mxUtils.getValue(q.style,"nl2Br","1")&&(C=C.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(C,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(q,B){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(q.style,"html","0")&&Graph.addLightDarkColors(this.textarea,+Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(q){if("0"==mxUtils.getValue(q.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var B=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(q.style,"nl2Br","1")?(B=B.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),+0<B.length&&("<br/>"==B.substring(B.length-5)||"<br>"==B.substring(B.length-4))&&(B=B.substring(0,B.lastIndexOf("<br"))+"<div><br/></div>")):B=B.replace(/\r\n/g,"").replace(/\n/g,"");return B};var L=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(q){this.codeViewMode&&this.toggleViewMode();L.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(q){}};var U=mxCellEditor.prototype.applyValue;+mxCellEditor.prototype.applyValue=function(q,B){this.graph.getModel().beginUpdate();try{U.apply(this,arguments),""==B&&this.graph.isCellDeletable(q.cell)&&0==this.graph.model.getChildCount(q.cell)&&this.graph.isTransparentState(q)&&this.graph.removeCells([q.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getBorderColor=+function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getMinimumSize=function(q){var B=this.graph.getView().scale;return new mxRectangle(0,0,null==q.text?30:q.text.size*B+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(q,B){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(B.getEvent)};mxGraphView.prototype.formatUnitText=+function(q){return q?b(q,this.unit):q};mxGraphHandler.prototype.updateHint=function(q){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var B=this.graph.view.translate,C=this.graph.view.scale;q=this.roundLength((this.bounds.x+this.currentDx)/C-B.x);B=this.roundLength((this.bounds.y+this.currentDy)/C-B.y);C=this.graph.view.unit;this.hint.innerHTML=b(q,C)+", "+b(B,C);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 X=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(q,B){X.apply(this,arguments);var C=this.graph.getCellStyle(q);if(null==C.childLayout){var F=this.graph.model.getParent(q),+J=null!=F?this.graph.getCellGeometry(F):null;if(null!=J&&(C=this.graph.getCellStyle(F),"stackLayout"==C.childLayout)){var P=parseFloat(mxUtils.getValue(C,"stackBorder",mxStackLayout.prototype.border));C="1"==mxUtils.getValue(C,"horizontalStack","1");var Y=this.graph.getActualStartSize(F);J=J.clone();C?J.height=B.height+Y.y+Y.height+2*P:J.width=B.width+Y.x+Y.width+2*P;this.graph.model.setGeometry(F,J)}}};var S=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=+function(){function q(ma){C.get(ma)||(C.put(ma,!0),J.push(ma))}for(var B=S.apply(this,arguments),C=new mxDictionary,F=this.graph.model,J=[],P=0;P<B.length;P++){var Y=B[P];this.graph.isTableCell(Y)?q(F.getParent(F.getParent(Y))):this.graph.isTableRow(Y)&&q(F.getParent(Y));q(Y)}return J};var V=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(q){return V.apply(this,arguments)&&!mxEvent.isControlDown(q.getEvent())&&!mxEvent.isShiftDown(q.getEvent())};var ha=+mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return ha.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 R=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(q){var B=R.apply(this,arguments);B.stroke="#C0C0C0";B.strokewidth=1;return B};var Z=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(q){var B=Z.apply(this,arguments);B.stroke="#C0C0C0";B.strokewidth=1;return B};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var q=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+q.x/2,this.bounds.y+this.rotationHandleVSpacing-q.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(q,B){return this.graph.isRecursiveVertexResize(q)&&!mxEvent.isAltDown(B.getEvent())};mxVertexHandler.prototype.isCenteredEvent=function(q,B){return mxEvent.isControlDown(B.getEvent())||mxEvent.isMetaDown(B.getEvent())};var W=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return W.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.isConnectHandleVisible=function(){return Editor.showConnectHandle&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var q=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+q.x/2,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+q.y/2)};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 ba=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return ba.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var K=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(q){return q.tableHandle||K.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var q=0;this.graph.isTableRow(this.state.cell)?q=1:this.graph.isTableCell(this.state.cell)&&(q=2);return q};var T=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return T.apply(this,arguments).grow(-this.getSelectionBorderInset())};-var aa=null,ka=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==aa&&(aa=mxCellRenderer.defaultShapes.tableLine);var q=ka.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var B=function(Ra,Sa,Aa){for(var cb=[],Wa=0;Wa<Ra.length;Wa++){var Qa=Ra[Wa];cb.push(null==Qa?null:new mxPoint((ca+Qa.x+Sa)*P,(na+Qa.y+Aa)*P))}return cb},C=this,E=this.graph,J=E.model,P=E.view.scale,Y=this.state,ma=-this.selectionBorder,ca=this.state.origin.x+E.view.translate.x,na=this.state.origin.y+E.view.translate.y;null==q&&(q=[]);var ta=E.view.getCellStates(J.getChildCells(this.state.cell,!0));if(0<ta.length){var Fa=J.getChildCells(ta[0].cell,!0),Da=E.getTableLines(this.state.cell,!1,!0),Na=E.getTableLines(this.state.cell,!0,!1);for(J=0;J<ta.length;J++)mxUtils.bind(this,function(Ra){var Sa=ta[Ra],Aa=null;if(E.isCellMovable(Sa.cell)){Aa=Ra<ta.length-1?ta[Ra+1]:null;Aa=null!=Aa?E.getCellGeometry(Aa.cell):+var aa=null,ka=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==aa&&(aa=mxCellRenderer.defaultShapes.tableLine);var q=ka.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var B=function(Ra,Sa,Aa){for(var cb=[],Wa=0;Wa<Ra.length;Wa++){var Qa=Ra[Wa];cb.push(null==Qa?null:new mxPoint((ca+Qa.x+Sa)*P,(na+Qa.y+Aa)*P))}return cb},C=this,F=this.graph,J=F.model,P=F.view.scale,Y=this.state,ma=+this.selectionBorder,ca=this.state.origin.x+F.view.translate.x,na=this.state.origin.y+F.view.translate.y;null==q&&(q=[]);var ta=F.view.getCellStates(J.getChildCells(this.state.cell,!0));if(0<ta.length){var Fa=J.getChildCells(ta[0].cell,!0),Da=F.getTableLines(this.state.cell,!1,!0),Na=F.getTableLines(this.state.cell,!0,!1);for(J=0;J<ta.length;J++)mxUtils.bind(this,function(Ra){var Sa=ta[Ra],Aa=null;if(F.isCellMovable(Sa.cell)){Aa=Ra<ta.length-1?ta[Ra+1]:null;Aa=null!=Aa?F.getCellGeometry(Aa.cell):null;var cb=null!=Aa&&null!=Aa.alternateBounds?Aa.alternateBounds:Aa;Aa=null!=Na[Ra]?new aa(Na[Ra],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Aa.isDashed=ma.isDashed;Aa.svgStrokeTolerance++;Aa=new mxHandle(Sa,"row-resize",null,Aa);Aa.tableHandle=!0;var Wa=0;Aa.shape.node.parentNode.insertBefore(Aa.shape.node,Aa.shape.node.parentNode.firstChild);Aa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Wa?mxConstants.NONE:ma.stroke;if(this.shape.constructor==aa)this.shape.line=-B(Na[Ra],0,Wa),this.shape.updateBoundsFromLine();else{var Ya=E.getActualStartSize(Y.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+Wa*P;this.shape.bounds.x=Y.x+(Ra==ta.length-1?0:Ya.x*P);this.shape.bounds.width=Y.width-(Ra==ta.length-1?0:Ya.width+Ya.x+P)}this.shape.redraw()}};var Qa=!1;Aa.setPosition=function(Ya,bb,nb){Wa=Math.max(Graph.minTableRowHeight-Ya.height,bb.y-Ya.y-Ya.height);Qa=mxEvent.isShiftDown(nb.getEvent());null!=cb&&Qa&&(Wa=Math.min(Wa,cb.height--Graph.minTableRowHeight))};Aa.execute=function(Ya){if(0!=Wa)E.setTableRowHeight(this.state.cell,Wa,!Qa);else if(!C.blockDelayedSelection){var bb=E.getCellAt(Ya.getGraphX(),Ya.getGraphY())||Y.cell;E.graphHandler.selectCellForEvent(bb,Ya)}Wa=0};Aa.reset=function(){Wa=0}}q.push(Aa)})(J);for(J=0;J<Fa.length;J++)mxUtils.bind(this,function(Ra){var Sa=E.view.getState(Fa[Ra]),Aa=E.getCellGeometry(Fa[Ra]),cb=null!=Aa.alternateBounds?Aa.alternateBounds:Aa;null==Sa&&(Sa=new mxCellState(E.view,Fa[Ra],E.getCellStyle(Fa[Ra])),-Sa.x=Y.x+Aa.x*P,Sa.y=Y.y+Aa.y*P,Sa.width=cb.width*P,Sa.height=cb.height*P,Sa.updateCachedBounds());Aa=Ra<Fa.length-1?Fa[Ra+1]:null;Aa=null!=Aa?E.getCellGeometry(Aa):null;var Wa=null!=Aa&&null!=Aa.alternateBounds?Aa.alternateBounds:Aa;Aa=null!=Da[Ra]?new aa(Da[Ra],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Aa.isDashed=ma.isDashed;Aa.svgStrokeTolerance++;Sa=new mxHandle(Sa,"col-resize",null,Aa);Sa.tableHandle=!0;var Qa=0;Sa.shape.node.parentNode.insertBefore(Sa.shape.node,-Sa.shape.node.parentNode.firstChild);Sa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Qa?mxConstants.NONE:ma.stroke;if(this.shape.constructor==aa)this.shape.line=B(Da[Ra],Qa,0),this.shape.updateBoundsFromLine();else{var bb=E.getActualStartSize(Y.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(cb.width+Qa)*P;this.shape.bounds.y=Y.y+(Ra==Fa.length-1?0:bb.y*P);this.shape.bounds.height=Y.height-(Ra==Fa.length-1?0:(bb.height+bb.y)*P)}this.shape.redraw()}};var Ya=!1;Sa.setPosition=-function(bb,nb,sb){Qa=Math.max(Graph.minTableColumnWidth-cb.width,nb.x-bb.x-cb.width);Ya=mxEvent.isShiftDown(sb.getEvent());null==Wa||Ya||(Qa=Math.min(Qa,Wa.width-Graph.minTableColumnWidth))};Sa.execute=function(bb){if(0!=Qa)E.setTableColumnWidth(this.state.cell,Qa,Ya);else if(!C.blockDelayedSelection){var nb=E.getCellAt(bb.getGraphX(),bb.getGraphY())||Y.cell;E.graphHandler.selectCellForEvent(nb,bb)}Qa=0};Sa.positionChanged=function(){};Sa.reset=function(){Qa=0};q.push(Sa)})(J)}}return null!=q?q.reverse():+B(Na[Ra],0,Wa),this.shape.updateBoundsFromLine();else{var Ya=F.getActualStartSize(Y.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+Wa*P;this.shape.bounds.x=Y.x+(Ra==ta.length-1?0:Ya.x*P);this.shape.bounds.width=Y.width-(Ra==ta.length-1?0:Ya.width+Ya.x+P)}this.shape.redraw()}};var Qa=!1;Aa.setPosition=function(Ya,bb,nb){Wa=Math.max(Graph.minTableRowHeight-Ya.height,bb.y-Ya.y-Ya.height);Qa=mxEvent.isShiftDown(nb.getEvent());null!=cb&&Qa&&(Wa=Math.min(Wa,cb.height-+Graph.minTableRowHeight))};Aa.execute=function(Ya){if(0!=Wa)F.setTableRowHeight(this.state.cell,Wa,!Qa);else if(!C.blockDelayedSelection){var bb=F.getCellAt(Ya.getGraphX(),Ya.getGraphY())||Y.cell;F.graphHandler.selectCellForEvent(bb,Ya)}Wa=0};Aa.reset=function(){Wa=0}}q.push(Aa)})(J);for(J=0;J<Fa.length;J++)mxUtils.bind(this,function(Ra){var Sa=F.view.getState(Fa[Ra]),Aa=F.getCellGeometry(Fa[Ra]),cb=null!=Aa.alternateBounds?Aa.alternateBounds:Aa;null==Sa&&(Sa=new mxCellState(F.view,Fa[Ra],F.getCellStyle(Fa[Ra])),+Sa.x=Y.x+Aa.x*P,Sa.y=Y.y+Aa.y*P,Sa.width=cb.width*P,Sa.height=cb.height*P,Sa.updateCachedBounds());Aa=Ra<Fa.length-1?Fa[Ra+1]:null;Aa=null!=Aa?F.getCellGeometry(Aa):null;var Wa=null!=Aa&&null!=Aa.alternateBounds?Aa.alternateBounds:Aa;Aa=null!=Da[Ra]?new aa(Da[Ra],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Aa.isDashed=ma.isDashed;Aa.svgStrokeTolerance++;Sa=new mxHandle(Sa,"col-resize",null,Aa);Sa.tableHandle=!0;var Qa=0;Sa.shape.node.parentNode.insertBefore(Sa.shape.node,+Sa.shape.node.parentNode.firstChild);Sa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Qa?mxConstants.NONE:ma.stroke;if(this.shape.constructor==aa)this.shape.line=B(Da[Ra],Qa,0),this.shape.updateBoundsFromLine();else{var bb=F.getActualStartSize(Y.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(cb.width+Qa)*P;this.shape.bounds.y=Y.y+(Ra==Fa.length-1?0:bb.y*P);this.shape.bounds.height=Y.height-(Ra==Fa.length-1?0:(bb.height+bb.y)*P)}this.shape.redraw()}};var Ya=!1;Sa.setPosition=+function(bb,nb,sb){Qa=Math.max(Graph.minTableColumnWidth-cb.width,nb.x-bb.x-cb.width);Ya=mxEvent.isShiftDown(sb.getEvent());null==Wa||Ya||(Qa=Math.min(Qa,Wa.width-Graph.minTableColumnWidth))};Sa.execute=function(bb){if(0!=Qa)F.setTableColumnWidth(this.state.cell,Qa,Ya);else if(!C.blockDelayedSelection){var nb=F.getCellAt(bb.getGraphX(),bb.getGraphY())||Y.cell;F.graphHandler.selectCellForEvent(nb,bb)}Qa=0};Sa.positionChanged=function(){};Sa.reset=function(){Qa=0};q.push(Sa)})(J)}}return null!=q?q.reverse():null};var oa=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(q){oa.apply(this,arguments);if(null!=this.moveHandles)for(var B=0;B<this.moveHandles.length;B++)null!=this.moveHandles[B]&&(this.moveHandles[B].node.style.visibility=q?"":"hidden");if(null!=this.cornerHandles)for(B=0;B<this.cornerHandles.length;B++)this.cornerHandles[B].node.style.visibility=q?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var q=this.isMoveHandlesVisible();q&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():q||null==this.moveHandles||this.destroyMoveHandles();if(q&&null==this.moveHandles){for(q=0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&this.moveHandles[q].parentNode.removeChild(this.moveHandles[q]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var q=-this.graph,B=q.model,C=[],E=0;E<B.getChildCount(this.state.cell);E++)mxUtils.bind(this,function(J){if(null!=J&&B.isVertex(J.cell)&&q.isCellMovable(J.cell)){var P=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);P=new mxImageShape(P,this.rowHandleImage.src);P.rowState=J;P.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;P.init(this.graph.getView().getOverlayPane());P.node.style.cursor="move";mxEvent.addGestureListeners(P.node,+this.graph,B=q.model,C=[],F=0;F<B.getChildCount(this.state.cell);F++)mxUtils.bind(this,function(J){if(null!=J&&B.isVertex(J.cell)&&q.isCellMovable(J.cell)){var P=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);P=new mxImageShape(P,this.rowHandleImage.src);P.rowState=J;P.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;P.init(this.graph.getView().getOverlayPane());P.node.style.cursor="move";mxEvent.addGestureListeners(P.node,mxUtils.bind(this,function(Y){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(Y)&&this.graph.isCellSelected(J.cell)||this.graph.selectCellForEvent(J.cell,Y);mxEvent.isPopupTrigger(Y)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(Y),mxEvent.getClientY(Y),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(Y),this.graph.isMouseDown=!0);mxEvent.consume(Y)}),null,mxUtils.bind(this,-function(Y){mxEvent.isPopupTrigger(Y)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(Y),mxEvent.getClientY(Y),J.cell,Y),mxEvent.consume(Y))}));C.push(P)}else C.push(null)})(this.graph.view.getState(B.getChildAt(this.state.cell,E)));return C};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var q=0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&this.moveHandles[q].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=+function(Y){mxEvent.isPopupTrigger(Y)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(Y),mxEvent.getClientY(Y),J.cell,Y),mxEvent.consume(Y))}));C.push(P)}else C.push(null)})(this.graph.view.getState(B.getChildAt(this.state.cell,F)));return C};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var q=0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&this.moveHandles[q].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var q=0;q<this.cornerHandles.length;q++)null!=this.cornerHandles[q]&&null!=this.cornerHandles[q].node&&null!=this.cornerHandles[q].node.parentNode&&this.cornerHandles[q].node.parentNode.removeChild(this.cornerHandles[q].node);this.cornerHandles=null}};var pa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){pa.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 q=0;4>q;q++){var B=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);B.dialect=mxConstants.DIALECT_SVG;B.init(this.graph.view.getOverlayPane());this.cornerHandles.push(B)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();q=this.graph.getLinkForCell(this.state.cell);B=this.graph.getLinksForState(this.state);this.updateLinkHint(q,B)};var da=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var q=new mxPoint(0,0),B=this.tolerance,C=this.state.style.shape;null==mxCellRenderer.defaultShapes[C]&&mxStencilRegistry.getStencil(C);C=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==-this.state.cell;if(!C&&null!=this.customHandles)for(var E=0;E<this.customHandles.length;E++)if(null!=this.customHandles[E]&&null!=this.customHandles[E].shape&&null!=this.customHandles[E].shape.bounds){var J=this.customHandles[E].shape.bounds,P=J.getCenterX(),Y=J.getCenterY();if(Math.abs(this.state.x-P)<J.width/2||Math.abs(this.state.y-Y)<J.height/2||Math.abs(this.state.x+this.state.width-P)<J.width/2||Math.abs(this.state.y+this.state.height-Y)<J.height/2){C=!0;break}}C&&null!=this.sizers&&0<this.sizers.length&&+this.state.cell;if(!C&&null!=this.customHandles)for(var F=0;F<this.customHandles.length;F++)if(null!=this.customHandles[F]&&null!=this.customHandles[F].shape&&null!=this.customHandles[F].shape.bounds){var J=this.customHandles[F].shape.bounds,P=J.getCenterX(),Y=J.getCenterY();if(Math.abs(this.state.x-P)<J.width/2||Math.abs(this.state.y-Y)<J.height/2||Math.abs(this.state.x+this.state.width-P)<J.width/2||Math.abs(this.state.y+this.state.height-Y)<J.height/2){C=!0;break}}C&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(B/=2,this.graph.isTable(this.state.cell)&&(B+=7),q.x=this.sizers[0].bounds.width+B,q.y=this.sizers[0].bounds.height+B):q=da.apply(this,arguments);return q};mxVertexHandler.prototype.updateHint=function(q){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{q=this.state.view.scale;var B=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/q),B)+" x "+b(this.roundLength(this.bounds.height/q),B)}q=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==q&&(q=this.bounds);this.hint.style.left=q.x+Math.round((q.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=q.y+q.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 ia=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){ia.apply(this,arguments);var q=this.graph.getLinkForCell(this.state.cell),B=this.graph.getLinksForState(this.state);this.updateLinkHint(q,B)};var fa=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(q,B){fa.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 O=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(q,B){O.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(q,B,C){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var E=this.graph.view.translate,J=this.graph.view.scale,P=this.roundLength(B.x/J-E.x);E=this.roundLength(B.y/-J-E.y);var Y=this.graph.view.unit;this.hint.innerHTML=b(P,Y)+", "+b(E,Y);this.hint.style.visibility="visible";null!=C&&(C.view.updateEdgeBounds(C),this.hint.innerHTML+=" ("+(Y==mxConstants.POINTS?Math.round(C.length/J):b(C.length/J,Y))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(C=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*C.x)+"%, "+Math.round(100*+(this.linkHint.style.display="none")};var O=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(q,B){O.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(q,B,C){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var F=this.graph.view.translate,J=this.graph.view.scale,P=this.roundLength(B.x/J-F.x);F=this.roundLength(B.y/+J-F.y);var Y=this.graph.view.unit;this.hint.innerHTML=b(P,Y)+", "+b(F,Y);this.hint.style.visibility="visible";null!=C&&(C.view.updateEdgeBounds(C),this.hint.innerHTML+=" ("+(Y==mxConstants.POINTS?Math.round(C.length/J):b(C.length/J,Y))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(C=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*C.x)+"%, "+Math.round(100*C.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(q.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(q.getGraphY(),B.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=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');@@ -3064,33 +3069,33 @@ mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSiz!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(q){return!mxEvent.isShiftDown(q.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(q){return!mxEvent.isShiftDown(q.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(q){return mxEvent.isMouseEvent(q.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(q){var B=q.getEvent();return null==q.getState()&&!mxEvent.isMouseEvent(B)||mxEvent.isPopupTrigger(B)&&(null==q.getState()||mxEvent.isControlDown(B)||mxEvent.isShiftDown(B))}}else mxPanningHandler.prototype.isPanningTrigger=function(q){var B=q.getEvent();return mxEvent.isLeftMouseButton(B)&&(this.useLeftButtonForPanning&&null==q.getState()||mxEvent.isControlDown(B)&&!mxEvent.isShiftDown(B))||this.usePopupTrigger&&mxEvent.isPopupTrigger(B)};mxRubberband.prototype.isSpaceEvent=function(q){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(q.getEvent())||-mxEvent.isMetaDown(q.getEvent()))&&mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(q,B){if(this.cancelled)this.cancelled=!1,B.consume();else{var C=null!=this.div&&"none"!=this.div.style.display,E=null,J=null,P=q=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(E=this.first.x,J=this.first.y,q=(this.currentX--E)/this.graph.view.scale,P=(this.currentY-J)/this.graph.view.scale,mxEvent.isAltDown(B.getEvent())||(q=this.graph.snap(q),P=this.graph.snap(P),this.graph.isGridEnabled()||(Math.abs(q)<this.graph.tolerance&&(q=0),Math.abs(P)<this.graph.tolerance&&(P=0))));this.reset();if(C){if(this.isSpaceEvent(B)){this.graph.model.beginUpdate();try{var Y=this.graph.getCellsBeyond(E,J,this.graph.getDefaultParent(),!0,!0);for(C=0;C<Y.length;C++)if(this.graph.isCellMovable(Y[C])){var ma=this.graph.view.getState(Y[C]),+mxEvent.isMetaDown(q.getEvent()))&&mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(q,B){if(this.cancelled)this.cancelled=!1,B.consume();else{var C=null!=this.div&&"none"!=this.div.style.display,F=null,J=null,P=q=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(F=this.first.x,J=this.first.y,q=(this.currentX-+F)/this.graph.view.scale,P=(this.currentY-J)/this.graph.view.scale,mxEvent.isAltDown(B.getEvent())||(q=this.graph.snap(q),P=this.graph.snap(P),this.graph.isGridEnabled()||(Math.abs(q)<this.graph.tolerance&&(q=0),Math.abs(P)<this.graph.tolerance&&(P=0))));this.reset();if(C){if(this.isSpaceEvent(B)){this.graph.model.beginUpdate();try{var Y=this.graph.getCellsBeyond(F,J,this.graph.getDefaultParent(),!0,!0);for(C=0;C<Y.length;C++)if(this.graph.isCellMovable(Y[C])){var ma=this.graph.view.getState(Y[C]),ca=this.graph.getCellGeometry(Y[C]);null!=ma&&null!=ca&&(ca=ca.clone(),ca.translate(q,P),this.graph.model.setGeometry(Y[C],ca))}}finally{this.graph.model.endUpdate()}}else Y=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(Y,B.getEvent());B.consume()}}};mxRubberband.prototype.mouseMove=function(q,B){if(!B.isConsumed()&&null!=this.first){var C=mxUtils.getScrollOrigin(this.graph.container);q=mxUtils.getOffset(this.graph.container);C.x-=q.x;C.y-=q.y;q=B.getX()+C.x;C=B.getY()+-C.y;var E=this.first.x-q,J=this.first.y-C,P=this.graph.tolerance;if(null!=this.div||Math.abs(E)>P||Math.abs(J)>P)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(q,C),this.isSpaceEvent(B)?(q=this.x+this.width,C=this.y+this.height,E=this.graph.view.scale,mxEvent.isAltDown(B.getEvent())||(this.width=this.graph.snap(this.width/E)*E,this.height=this.graph.snap(this.height/E)*E,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&+C.y;var F=this.first.x-q,J=this.first.y-C,P=this.graph.tolerance;if(null!=this.div||Math.abs(F)>P||Math.abs(J)>P)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(q,C),this.isSpaceEvent(B)?(q=this.x+this.width,C=this.y+this.height,F=this.graph.view.scale,mxEvent.isAltDown(B.getEvent())||(this.width=this.graph.snap(this.width/F)*F,this.height=this.graph.snap(this.height/F)*F,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=q-this.width),this.y<this.first.y&&(this.y=C-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),B.consume()}};var qa=mxRubberband.prototype.reset;-mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);qa.apply(this,arguments)};var ja=(new Date).getTime(),ua=0,ya=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(q,B,C,E){ya.apply(this,arguments);C!=this.currentTerminalState?(ja=(new Date).getTime(),ua=0):ua=(new Date).getTime()-ja;this.currentTerminalState=C};var Ma=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=-function(q){return mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())?!1:null!=this.currentTerminalState&&q.getState()==this.currentTerminalState&&2E3<ua||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&Ma.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(q,B,C){B=null!=q&&0==q;var E=this.state.getVisibleTerminalState(B);q=null!=q&&null!=this.state.absolutePoints&&(0==q||q>=this.state.absolutePoints.length--1||this.constructor==mxElbowEdgeHandler&&2==q)?this.graph.getConnectionConstraint(this.state,E,B):null;C=null!=(null!=q?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(B),q):null)?C?this.endFixedHandleImage:this.fixedHandleImage:null!=q&&null!=E?C?this.endTerminalHandleImage:this.terminalHandleImage:C?this.endHandleImage:this.handleImage;if(null!=C)return C=new mxImageShape(new mxRectangle(0,0,C.width,C.height),C.src),C.preserveImageAspect=!1,C;C=mxConstants.HANDLE_SIZE;this.preferHtml&&---C;return new mxRectangleShape(new mxRectangle(0,0,C,C),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var Oa=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(q,B,C,E){E=B==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:B==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle:B==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:E;return Oa.apply(this,arguments)};var Ka=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=+mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);qa.apply(this,arguments)};var ja=(new Date).getTime(),ua=0,ya=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(q,B,C,F){ya.apply(this,arguments);C!=this.currentTerminalState?(ja=(new Date).getTime(),ua=0):ua=(new Date).getTime()-ja;this.currentTerminalState=C};var Ma=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=+function(q){return mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())?!1:null!=this.currentTerminalState&&q.getState()==this.currentTerminalState&&2E3<ua||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&Ma.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(q,B,C){B=null!=q&&0==q;var F=this.state.getVisibleTerminalState(B);q=null!=q&&null!=this.state.absolutePoints&&(0==q||q>=this.state.absolutePoints.length-+1||this.constructor==mxElbowEdgeHandler&&2==q)?this.graph.getConnectionConstraint(this.state,F,B):null;C=null!=(null!=q?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(B),q):null)?C?this.endFixedHandleImage:this.fixedHandleImage:null!=q&&null!=F?C?this.endTerminalHandleImage:this.terminalHandleImage:C?this.endHandleImage:this.handleImage;if(null!=C)return C=new mxImageShape(new mxRectangle(0,0,C.width,C.height),C.src),C.preserveImageAspect=!1,C;C=mxConstants.HANDLE_SIZE;this.preferHtml&&+--C;return new mxRectangleShape(new mxRectangle(0,0,C,C),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var Oa=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(q,B,C,F){F=B==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:B==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle:B==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:F;return Oa.apply(this,arguments)};var Ka=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=function(){var q=Ka.apply(this,arguments);null==this.connectShape&&this.isConnectHandleVisible()&&(this.connectShape=this.createSizer("copy",mxEvent.CONNECT_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),q.push(this.connectShape));return q};var La=mxVertexHandler.prototype.destroySizers;mxVertexHandler.prototype.destroySizers=function(){La.apply(this,arguments);this.connectShape=null};var wa=mxVertexHandler.prototype.getHandleForEvent;mxVertexHandler.prototype.getHandleForEvent=function(q){if(null!=this.connectShape&&null!=this.connectShape.node&&"hidden"!=this.connectShape.node.style.visibility){var B=mxEvent.isMouseEvent(q.getEvent())?1:this.tolerance;B=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<B)?new mxRectangle(q.getGraphX()-B,q.getGraphY()-B,2*B,2*B):null;if(q.isSource(this.connectShape)||null!=B&&this.connectShape.intersectsRectangle(B))return mxEvent.CONNECT_HANDLE}return wa.apply(this,arguments)};var Ia=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(q,-B){if(!B.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(B)==mxEvent.CONNECT_HANDLE){var C=B.getGraphX(),E=B.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,C,E);this.graph.isMouseTrigger=mxEvent.isMouseEvent(B.getEvent());this.graph.isMouseDown=!0;C=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=C&&C.setHandlesVisible(!1);-B.consume()}else Ia.apply(this,arguments)};var $a=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(q){if(null!=q&&1==q.length){var B=this.graph.getModel(),C=B.getParent(q[0]),E=this.graph.getCellGeometry(q[0]);if(B.isEdge(C)&&null!=E&&E.relative&&(B=this.graph.view.getState(q[0]),null!=B&&2>B.width&&2>B.height&&null!=B.text&&null!=B.text.boundingBox))return mxRectangle.fromRectangle(B.text.boundingBox)}return $a.apply(this,arguments)};var ab=mxGraphHandler.prototype.getGuideStates;-mxGraphHandler.prototype.getGuideStates=function(){for(var q=ab.apply(this,arguments),B=[],C=0;C<q.length;C++)"1"!=mxUtils.getValue(q[C].style,"part","0")&&B.push(q[C]);return B};var eb=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(q){var B=this.graph.getModel(),C=B.getParent(q.cell),E=this.graph.getCellGeometry(q.cell);return B.isEdge(C)&&null!=E&&E.relative&&2>q.width&&2>q.height&&null!=q.text&&null!=q.text.boundingBox?(B=q.text.unrotatedBoundingBox||-q.text.boundingBox,new mxRectangle(Math.round(B.x),Math.round(B.y),Math.round(B.width),Math.round(B.height))):eb.apply(this,arguments)};var ib=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(q,B){var C=this.graph.getModel(),E=C.getParent(this.state.cell),J=this.graph.getCellGeometry(this.state.cell),P=this.getHandleForEvent(B);(P==mxEvent.ROTATION_HANDLE||P==mxEvent.CONNECT_HANDLE||!C.isEdge(E)||null==J||!J.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&+B){if(!B.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(B)==mxEvent.CONNECT_HANDLE){var C=B.getGraphX(),F=B.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,C,F);this.graph.isMouseTrigger=mxEvent.isMouseEvent(B.getEvent());this.graph.isMouseDown=!0;C=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=C&&C.setHandlesVisible(!1);+B.consume()}else Ia.apply(this,arguments)};var $a=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(q){if(null!=q&&1==q.length){var B=this.graph.getModel(),C=B.getParent(q[0]),F=this.graph.getCellGeometry(q[0]);if(B.isEdge(C)&&null!=F&&F.relative&&(B=this.graph.view.getState(q[0]),null!=B&&2>B.width&&2>B.height&&null!=B.text&&null!=B.text.boundingBox))return mxRectangle.fromRectangle(B.text.boundingBox)}return $a.apply(this,arguments)};var ab=mxGraphHandler.prototype.getGuideStates;+mxGraphHandler.prototype.getGuideStates=function(){for(var q=ab.apply(this,arguments),B=[],C=0;C<q.length;C++)"1"!=mxUtils.getValue(q[C].style,"part","0")&&B.push(q[C]);return B};var eb=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(q){var B=this.graph.getModel(),C=B.getParent(q.cell),F=this.graph.getCellGeometry(q.cell);return B.isEdge(C)&&null!=F&&F.relative&&2>q.width&&2>q.height&&null!=q.text&&null!=q.text.boundingBox?(B=q.text.unrotatedBoundingBox||+q.text.boundingBox,new mxRectangle(Math.round(B.x),Math.round(B.y),Math.round(B.width),Math.round(B.height))):eb.apply(this,arguments)};var ib=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(q,B){var C=this.graph.getModel(),F=C.getParent(this.state.cell),J=this.graph.getCellGeometry(this.state.cell),P=this.getHandleForEvent(B);(P==mxEvent.ROTATION_HANDLE||P==mxEvent.CONNECT_HANDLE||!C.isEdge(F)||null==J||!J.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&ib.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var q=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),B=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&q==mxConstants.NONE&&B==mxConstants.NONE?(q=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,q,[this.state.cell])):-this.state.view.graph.turnShapes([this.state.cell])};var rb=mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(q){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var B=this.graph.view.scale,C=this.state.style,E=this.roundLength(this.bounds.width/B),J=this.roundLength(this.bounds.height/B);B=this.graph.cellRenderer.getLabelValue(this.state);if(null!=B&&0<B.length&&(E=this.graph.getAutosizeTextAvailableSpace(C,E,J,this.state),null!=E)){this.graph.isHtmlLabel(this.state.cell)||-(B=mxUtils.htmlEntities(B,!1));B=B.replace(/\n/g,"<br>");E=this.graph.computeAutosizeTextFontSize(B,E.availW,E.availH,C[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,C[mxConstants.STYLE_FONTSTYLE],"wrap"==C[mxConstants.STYLE_WHITE_SPACE]);B=C[mxConstants.STYLE_FONTSIZE];C[mxConstants.STYLE_FONTSIZE]=E;rb.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]=B;return}}rb.apply(this,arguments)};var jb=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=+this.state.view.graph.turnShapes([this.state.cell])};var rb=mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(q){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var B=this.graph.view.scale,C=this.state.style,F=this.roundLength(this.bounds.width/B),J=this.roundLength(this.bounds.height/B);B=this.graph.cellRenderer.getLabelValue(this.state);if(null!=B&&0<B.length&&(F=this.graph.getAutosizeTextAvailableSpace(C,F,J,this.state),null!=F)){this.graph.isHtmlLabel(this.state.cell)||+(B=mxUtils.htmlEntities(B,!1));B=B.replace(/\n/g,"<br>");F=this.graph.computeAutosizeTextFontSize(B,F.availW,F.availH,C[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,C[mxConstants.STYLE_FONTSTYLE],"wrap"==C[mxConstants.STYLE_WHITE_SPACE]);B=C[mxConstants.STYLE_FONTSIZE];C[mxConstants.STYLE_FONTSIZE]=F;rb.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]=B;return}}rb.apply(this,arguments)};var jb=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(q,B){jb.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var db=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(q,B){db.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(q,B){try{if(null==q&&(null==B||0==B.length))null!=-this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=q||null!=B&&0<B.length){var C=document.createElement("img");C.className="geAdaptiveAsset";C.setAttribute("src",Editor.editImage);C.setAttribute("title",mxResources.get("editLink"));C.setAttribute("width","14");C.setAttribute("height","14");C.style.paddingLeft="8px";C.style.marginLeft="auto";C.style.marginBottom="-1px";C.style.cursor="pointer";var E=C.cloneNode(!0);E.setAttribute("src",Editor.trashImage);-E.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));E.style.paddingLeft="4px";E.style.marginLeft="0";null==this.linkHint&&(this.linkHint=a(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));+this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=q||null!=B&&0<B.length){var C=document.createElement("img");C.className="geAdaptiveAsset";C.setAttribute("src",Editor.editImage);C.setAttribute("title",mxResources.get("editLink"));C.setAttribute("width","14");C.setAttribute("height","14");C.style.paddingLeft="8px";C.style.marginLeft="auto";C.style.marginBottom="-1px";C.style.cursor="pointer";var F=C.cloneNode(!0);F.setAttribute("src",Editor.trashImage);+F.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));F.style.paddingLeft="4px";F.style.marginLeft="0";null==this.linkHint&&(this.linkHint=a(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=q){var J=document.createElement("div");J.style.display="flex";J.style.alignItems="center";J.appendChild(this.graph.createLinkForHint(q,null,this.state.cell));this.linkHint.appendChild(J);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var P=C.cloneNode(!0);J.appendChild(P);mxEvent.addListener(P,"click",mxUtils.bind(this,function(ma){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();-mxEvent.consume(ma)}));var Y=E.cloneNode(!0);J.appendChild(Y);mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ma){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(ma)}))}}if(null!=B)for(J=0;J<B.length;J++)mxUtils.bind(this,function(ma,ca){var na=document.createElement("div");na.style.display="flex";na.style.alignItems="center";na.style.marginTop=null!=q||0<ca?"6px":"0px";na.appendChild(this.graph.createLinkForHint(ma.getAttribute("href"),mxUtils.getTextContent(ma),this.state.cell));+mxEvent.consume(ma)}));var Y=F.cloneNode(!0);J.appendChild(Y);mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ma){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(ma)}))}}if(null!=B)for(J=0;J<B.length;J++)mxUtils.bind(this,function(ma,ca){var na=document.createElement("div");na.style.display="flex";na.style.alignItems="center";na.style.marginTop=null!=q||0<ca?"6px":"0px";na.appendChild(this.graph.createLinkForHint(ma.getAttribute("href"),mxUtils.getTextContent(ma),this.state.cell));var ta=C.cloneNode(!0);na.appendChild(ta);var Fa=mxUtils.bind(this,function(Da){var Na=document.createElement("div");Na.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var Ra=Na.getElementsByTagName("a")[ca];if(null!=Ra){if(null==Da||""==Da){for(Da=Ra.cloneNode(!0).firstChild;null!=Da;)Ra.parentNode.insertBefore(Da.cloneNode(!0),Ra),Da=Da.nextSibling;Ra.parentNode.removeChild(Ra)}else Ra.setAttribute("href",Da);this.graph.labelChanged(this.state.cell,Na.innerHTML)}});mxEvent.addListener(ta,-"click",mxUtils.bind(this,function(Da){this.graph.showLinkDialog(ma.getAttribute("href")||"",mxResources.get("ok"),Fa);mxEvent.consume(Da)}));ta=E.cloneNode(!0);na.appendChild(ta);mxEvent.addListener(ta,"click",mxUtils.bind(this,function(Da){Fa();mxEvent.consume(Da)}));this.linkHint.appendChild(na)})(B[J],J)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(ma){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var kb=mxEdgeHandler.prototype.createConstraintHandler;+"click",mxUtils.bind(this,function(Da){this.graph.showLinkDialog(ma.getAttribute("href")||"",mxResources.get("ok"),Fa);mxEvent.consume(Da)}));ta=F.cloneNode(!0);na.appendChild(ta);mxEvent.addListener(ta,"click",mxUtils.bind(this,function(Da){Fa();mxEvent.consume(Da)}));this.linkHint.appendChild(na)})(B[J],J)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(ma){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var kb=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var q=kb.apply(this,arguments);q.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return q};var hb=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){hb.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var la=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var q=0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&(this.moveHandles[q].bounds.x=Math.round(this.moveHandles[q].rowState.x+this.moveHandles[q].rowState.width-this.moveHandles[q].bounds.width/2),this.moveHandles[q].bounds.y=Math.round(this.moveHandles[q].rowState.y+(this.moveHandles[q].rowState.height-this.moveHandles[q].bounds.height)/2),this.moveHandles[q].redraw());if(null!=this.cornerHandles){q=this.getSelectionBorderInset();var B=this.cornerHandles,C=B[0].bounds.height/2;B[0].bounds.x=this.state.x-B[0].bounds.width/2+q;B[0].bounds.y=this.state.y-C+q;B[0].redraw();B[1].bounds.x=B[0].bounds.x+this.state.width-2*q;B[1].bounds.y=B[0].bounds.y;B[1].redraw();B[2].bounds.x=B[0].bounds.x;B[2].bounds.y=this.state.y+this.state.height-2*q;B[2].redraw();B[3].bounds.x=B[1].bounds.x;B[3].bounds.y=B[2].bounds.y;B[3].redraw();for(q=0;q<this.cornerHandles.length;q++)this.cornerHandles[q].node.style.display=1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&@@ -3133,36 +3138,36 @@ Format.prototype.curved=!1;Format.prototype.init=function(){var a=this.editorUi,b=a.editor,e=b.graph;this.update=mxUtils.bind(this,function(f,g){this.refresh()});e.getSelectionModel().addListener(mxEvent.CHANGE,this.update);e.getModel().addListener(mxEvent.CHANGE,this.update);e.addListener(mxEvent.EDITING_STARTED,this.update);e.addListener(mxEvent.EDITING_STOPPED,this.update);e.getView().addListener("unitChanged",this.update);b.addListener("autosaveChanged",this.update);e.addListener(mxEvent.ROOT,this.update);a.addListener("styleChanged",this.update);a.addListener("lockedChanged",this.update);a.addListener("languageChanged",this.update);a.addListener("formatWidthChanged",this.update);this.refresh()};Format.prototype.clear=function(){this.container.innerText="";if(null!=this.panels)for(var a=0;a<this.panels.length;a++)this.panels[a].destroy();this.panels=[]};Format.prototype.refresh=function(){null!=this.pendingRefresh&&(window.clearTimeout(this.pendingRefresh),this.pendingRefresh=null);this.pendingRefresh=window.setTimeout(mxUtils.bind(this,function(){this.immediateRefresh()}))};-Format.prototype.immediateRefresh=function(){if(0!=this.container.offsetWidth){this.clear();var a=this.editorUi,b=a.editor.graph,e=document.createElement("div");e.className="geFormatContent";var f=document.createElement("div");f.className="geFormatTitle";this.container.appendChild(e);var g=a.getSelectionState(),d=g.containsLabel,h=null,l=null,t=mxUtils.bind(this,function(F,D,G,H){var M=mxUtils.bind(this,function(L,U){h!=F&&(U||(d?this.labelIndex=G:b.isSelectionEmpty()?this.diagramIndex=G:this.currentIndex=-G),null!=h&&h.classList.remove("geActiveFormatTitle"),h=F,h.classList.add("geActiveFormatTitle"),l!=D&&(null!=l&&(l.style.display="none"),l=D,l.style.display=""))});mxEvent.addListener(F,"click",M);var N=d?this.labelIndex:b.isSelectionEmpty()?this.diagramIndex:this.currentIndex;(H&&null==h||G==N)&&M(null,H&&null==h)}),k=0;if(b.isSelectionEmpty()){var v=document.createElement("div");mxUtils.write(v,mxResources.get("diagram"));f.appendChild(v);f.setAttribute("title",mxResources.get("diagram"));e.appendChild(f);+Format.prototype.immediateRefresh=function(){if(0!=this.container.offsetWidth){this.clear();var a=this.editorUi,b=a.editor.graph,e=document.createElement("div");e.className="geFormatContent";var f=document.createElement("div");f.className="geFormatTitle";this.container.appendChild(e);var g=a.getSelectionState(),d=g.containsLabel,h=null,l=null,t=mxUtils.bind(this,function(E,D,G,H){var M=mxUtils.bind(this,function(L,U){h!=E&&(U||(d?this.labelIndex=G:b.isSelectionEmpty()?this.diagramIndex=G:this.currentIndex=+G),null!=h&&h.classList.remove("geActiveFormatTitle"),h=E,h.classList.add("geActiveFormatTitle"),l!=D&&(null!=l&&(l.style.display="none"),l=D,l.style.display=""))});mxEvent.addListener(E,"click",M);var N=d?this.labelIndex:b.isSelectionEmpty()?this.diagramIndex:this.currentIndex;(H&&null==h||G==N)&&M(null,H&&null==h)}),k=0;if(b.isSelectionEmpty()){var v=document.createElement("div");mxUtils.write(v,mxResources.get("diagram"));f.appendChild(v);f.setAttribute("title",mxResources.get("diagram"));e.appendChild(f);g=e.cloneNode(!1);this.panels.push(new DiagramFormatPanel(this,a,g));this.container.appendChild(g);g.style.display="none";var u=f.cloneNode(!1);t(f,g,k++);var y=e.cloneNode(!1);y.style.display="none";v=document.createElement("div");mxUtils.write(v,mxResources.get("style"));u.appendChild(v);u.setAttribute("title",mxResources.get("style"));e.appendChild(u);this.panels.push(new DiagramStylePanel(this,a,y));this.container.appendChild(y);t(u,y,k++,!0)}else if(b.isEditing())v=document.createElement("div"),mxUtils.write(v,mxResources.get("text")),f.appendChild(v),f.setAttribute("title",mxResources.get("text")),e.appendChild(f),y=e.cloneNode(!1),y.style.display="none",this.panels.push(new TextFormatPanel(this,a,y)),this.container.appendChild(y),t(f,y,k++,!0);else{u=f.cloneNode(!1);var z=u.cloneNode(!1);0<g.cells.length&&(v=document.createElement("div"),mxUtils.write(v,mxResources.get("style")),f.appendChild(v),f.setAttribute("title",mxResources.get("style")),e.appendChild(f),y=e.cloneNode(!1),y.style.display="none",this.panels.push(new StyleFormatPanel(this,a,y)),this.container.appendChild(y),t(f,y,k++));v=document.createElement("div");mxUtils.write(v,mxResources.get("text"));u.appendChild(v);u.setAttribute("title",mxResources.get("text"));e.appendChild(u);y=e.cloneNode(!1);y.style.display="none";this.panels.push(new TextFormatPanel(this,a,y));this.container.appendChild(y);v=document.createElement("div");mxUtils.write(v,mxResources.get("arrange"));z.appendChild(v);z.setAttribute("title",mxResources.get("arrange"));e.appendChild(z);f=e.cloneNode(!1);f.style.display="none";this.panels.push(new ArrangePanel(this,a,f));this.container.appendChild(f);0<g.cells.length?t(u,y,k++):u.style.display="none";t(z,f,k++,!0)}e.className="geFormatTitleContainer"}};BaseFormatPanel=function(a,b,e){this.format=a;this.editorUi=b;this.container=e;this.listeners=[]};BaseFormatPanel.prototype.buttonBackgroundColor="transparent";-BaseFormatPanel.prototype.installInputHandler=function(a,b,e,f,g,d,h,l,t){d=null!=d?d:"";l=null!=l?l:!1;var k=this.editorUi,v=k.editor.graph;f=null!=f?f:1;g=null!=g?g:999;var u=null,y=!1,z=null,F=mxUtils.bind(this,function(D){var G=l?parseFloat(a.value):parseInt(a.value);t&&(G=this.fromUnit(G));if(G!=z){z=G;isNaN(G)||b!=mxConstants.STYLE_ROTATION||(G=mxUtils.mod(Math.round(100*G),36E3)/100);G=Math.min(g,Math.max(f,isNaN(G)?e:G));if(v.cellEditor.isContentEditing()&&h)y||(y=!0,null!=u&&(v.cellEditor.restoreSelection(u),+BaseFormatPanel.prototype.installInputHandler=function(a,b,e,f,g,d,h,l,t){d=null!=d?d:"";l=null!=l?l:!1;var k=this.editorUi,v=k.editor.graph;f=null!=f?f:1;g=null!=g?g:999;var u=null,y=!1,z=null,E=mxUtils.bind(this,function(D){var G=l?parseFloat(a.value):parseInt(a.value);t&&(G=this.fromUnit(G));if(G!=z){z=G;isNaN(G)||b!=mxConstants.STYLE_ROTATION||(G=mxUtils.mod(Math.round(100*G),36E3)/100);G=Math.min(g,Math.max(f,isNaN(G)?e:G));if(v.cellEditor.isContentEditing()&&h)y||(y=!0,null!=u&&(v.cellEditor.restoreSelection(u),u=null),h(G),a.value=(t?this.inUnit(G):G)+d,y=!1);else if(G!=mxUtils.getValue(k.getSelectionState().style,b,e)){v.isEditing()&&v.stopEditing(!0);v.getModel().beginUpdate();try{var H=k.getSelectionState().cells;v.setCellStyles(b,G,H);b==mxConstants.STYLE_FONTSIZE&&v.updateLabelElements(H,function(N){N.removeAttribute("size");N.style.fontSize="";""==N.getAttribute("style")&&N.removeAttribute("style")});for(var M=0;M<H.length;M++)0==v.model.getChildCount(H[M])&&v.autoSizeCell(H[M],!1),b!=mxConstants.STYLE_FONTSIZE&&-v.isAutosizeTextCell(H[M])&&v.model.isVertex(H[M])&&v.updateAutosizeTextFontSize(H[M],v.getCurrentCellStyle(H[M],!0));k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",H))}finally{v.getModel().endUpdate()}}a.value=(t?this.inUnit(G):G)+d}mxEvent.consume(D)});h&&v.cellEditor.isContentEditing()&&mxEvent.addGestureListeners(a,mxUtils.bind(this,function(D){document.activeElement==v.cellEditor.textarea&&(u=v.cellEditor.saveSelection())}));mxEvent.addListener(a,"change",F);mxEvent.addListener(a,-"blur",F);return F};BaseFormatPanel.prototype.createPanel=function(){var a=document.createElement("div");a.className="geFormatSection";return a};BaseFormatPanel.prototype.createTitle=function(a){var b=document.createElement("div");b.className="geFormatSectionTitle";b.setAttribute("title",a);mxUtils.write(b,a);return b};+v.isAutosizeTextCell(H[M])&&v.model.isVertex(H[M])&&v.updateAutosizeTextFontSize(H[M],v.getCurrentCellStyle(H[M],!0));k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",H))}finally{v.getModel().endUpdate()}}a.value=(t?this.inUnit(G):G)+d}mxEvent.consume(D)});h&&v.cellEditor.isContentEditing()&&mxEvent.addGestureListeners(a,mxUtils.bind(this,function(D){document.activeElement==v.cellEditor.textarea&&(u=v.cellEditor.saveSelection())}));mxEvent.addListener(a,"change",E);mxEvent.addListener(a,+"blur",E);return E};BaseFormatPanel.prototype.createPanel=function(){var a=document.createElement("div");a.className="geFormatSection";return a};BaseFormatPanel.prototype.createTitle=function(a){var b=document.createElement("div");b.className="geFormatSectionTitle";b.setAttribute("title",a);mxUtils.write(b,a);return b};BaseFormatPanel.prototype.addAction=function(a,b){var e=this.editorUi.actions.get(b);b=null;if(null!=e&&e.isEnabled()){b=mxUtils.button(e.getTitle(),mxUtils.bind(this,function(g){try{e.funct(g,g)}catch(d){this.editorUi.handleError(d)}}));var f=null!=e.shortcut?" ("+e.shortcut+")":"";b.setAttribute("title",e.getTitle()+f);b.style.marginBottom="2px";b.className="geFullWidthElement";a.appendChild(b)}return b};BaseFormatPanel.prototype.addActions=function(a,b){for(var e=null,f=null,g=0,d=0;d<b.length;d++){var h=this.addAction(a,b[d]);null!=h&&(g++,0==mxUtils.mod(g,2)&&(f.style.marginRight="4px",f.style.width="104px",h.style.width="104px",e.parentNode.removeChild(e)),e=mxUtils.br(a),f=h)}return g};-BaseFormatPanel.prototype.createStepper=function(a,b,e,f,g,d,h){function l(y,z,F){""==a.value&&(a.value=null!=d?d:z);z=h?parseFloat(a.value):parseInt(a.value);isNaN(z)||(a.value=z+y,null!=b&&b(F))}e=null!=e?e:1;var t=10*e;f=document.createElement("div");f.className="geBtnStepper";f.style.position="absolute";f.style.left="200px";var k=document.createElement("div");k.style.height="9px";k.style.backgroundImage="url("+Editor.arrowUpImage+")";k.style.width="10px";f.appendChild(k);var v=k.cloneNode(!1);+BaseFormatPanel.prototype.createStepper=function(a,b,e,f,g,d,h){function l(y,z,E){""==a.value&&(a.value=null!=d?d:z);z=h?parseFloat(a.value):parseInt(a.value);isNaN(z)||(a.value=z+y,null!=b&&b(E))}e=null!=e?e:1;var t=10*e;f=document.createElement("div");f.className="geBtnStepper";f.style.position="absolute";f.style.left="200px";var k=document.createElement("div");k.style.height="9px";k.style.backgroundImage="url("+Editor.arrowUpImage+")";k.style.width="10px";f.appendChild(k);var v=k.cloneNode(!1);v.style.backgroundImage="url("+Editor.arrowDownImage+")";f.appendChild(v);mxEvent.addGestureListeners(k,function(y){mxEvent.consume(y)},null,function(y){l(mxEvent.isShiftDown(y)?t:e,"0",y);mxEvent.consume(y)});mxEvent.addGestureListeners(v,function(y){mxEvent.consume(y)},null,function(y){l(-(mxEvent.isShiftDown(y)?t:e),"2",y);mxEvent.consume(y)});if(g){var u=null;mxEvent.addGestureListeners(f,function(y){mxEvent.consume(y)},null,function(y){if(null!=u){try{u.select()}catch(z){}u=null;mxEvent.consume(y)}})}else mxEvent.addListener(f,"click",function(y){mxEvent.consume(y)});return f};BaseFormatPanel.prototype.createOption=function(a,b,e,f,g){var d=document.createElement("div");d.className="geFormatEntry";var h=document.createElement("input");h.setAttribute("type","checkbox");h.setAttribute("title",a);d.appendChild(h);var l=document.createElement("span");l.className="geStyleLabel";l.setAttribute("title",a);mxUtils.write(l,a);d.appendChild(l);var t=!1,k=b(),v=function(u,y){t||(t=!0,u?(h.setAttribute("checked","checked"),h.defaultChecked=!0,h.checked=!0):(h.removeAttribute("checked"),h.defaultChecked=!1,h.checked=!1),k!=u&&(k=u,b()!=k&&e(k,y)),t=!1)};mxEvent.addListener(d,"click",function(u){if("disabled"!=h.getAttribute("disabled")){var y=mxEvent.getSource(u);if(y==d||y==l)h.checked=!h.checked;v(h.checked,u)}});v(k);null!=f&&(f.install(v),this.listeners.push(f));null!=g&&g(d);return d};BaseFormatPanel.prototype.createCellOption=function(a,b,e,f,g,d,h,l,t){var k=this.editorUi,v=k.editor.graph;f=null!=f?"null"==f?null:f:1;g=null!=g?"null"==g?null:g:0;var u=null!=t?v.getCommonStyle(t):k.getSelectionState().style;return this.createOption(a,function(){return mxUtils.getValue(u,b,e)!=g},function(y){l&&v.stopEditing();if(null!=h)h.funct();else{v.getModel().beginUpdate();try{var z=null!=t?t:k.getSelectionState().cells;y=y?f:g;v.setCellStyles(b,y,z);null!=d&&d(z,y);k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[y],"cells",z))}finally{v.getModel().endUpdate()}}},{install:function(y){this.listener=function(){y(mxUtils.getValue(u,b,e)!=g)};v.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){v.getModel().removeListener(this.listener)}})};-BaseFormatPanel.prototype.createColorOption=function(a,b,e,f,g,d,h,l,t,k){function v(S,V){"default"!=S||V||(S=l);"default"!=S&&t&&(S=mxUtils.getLightDarkColor(S),S=k()?S.dark:S.light);return S}var u=null!=k;k=null!=k?k:Editor.isDarkMode;var y=this.editorUi.editor.graph,z=document.createElement("div");z.className="geFormatEntry";var F=document.createElement("input");F.setAttribute("type","checkbox");F.setAttribute("title",a);h||z.appendChild(F);var D=document.createElement("span");mxUtils.write(D,+BaseFormatPanel.prototype.createColorOption=function(a,b,e,f,g,d,h,l,t,k){function v(S,V){"default"!=S||V||(S=l);"default"!=S&&t&&(S=mxUtils.getLightDarkColor(S),S=k()?S.dark:S.light);return S}var u=null!=k;k=null!=k?k:Editor.isDarkMode;var y=this.editorUi.editor.graph,z=document.createElement("div");z.className="geFormatEntry";var E=document.createElement("input");E.setAttribute("type","checkbox");E.setAttribute("title",a);h||z.appendChild(E);var D=document.createElement("span");mxUtils.write(D,a);D.setAttribute("title",a);z.appendChild(D);var G=b(),H=!1,M=null,N=null,L=document.createElement("input");L.setAttribute("type","color");L.style.position="relative";L.style.visibility="hidden";L.style.top="10px";L.style.width="0px";L.style.height="0px";L.style.border="none";mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_TOUCH||(M=document.createElement("img"),M.src=Editor.colorDropperImage,M.className="geColorDropper geAdaptiveAsset",mxEvent.addListener(M,"click",function(S){L.value=v(G);L.click();mxEvent.consume(S)}));var U=null,X=function(S,V){H||(H=!0,null!=d&&d(S),V||(null!=U&&(y.cellEditor.restoreSelection(U),U=null),e(S)),G=b(),S=mxUtils.getLightDarkColor("default"!=G?G:l),V=document.createElement("div"),V.style.width="21px",V.style.height="12px",V.style.margin="2px 18px 2px 3px",V.style.borderWidth="1px",V.style.borderStyle="solid",V.style.backgroundColor=S.cssText,N.innerText="",N.appendChild(V),!t&&mxUtils.isLightDarkColor(G)&&S.light!=S.dark?V.style.background="linear-gradient(to right bottom, "+S.cssText+" 50%, "+mxUtils.invertLightDarkColor(S).cssText+" 50.3%)":t&&u&&(V.style.backgroundColor=k()?S.dark:S.light),null!=M?(V.style.width="21px",V.style.margin="2px 18px 2px 3px",V.appendChild(M)):(V.style.width="36px",V.style.margin="3px"),null!=G&&G!=mxConstants.NONE&&1<G.length&&"string"===typeof G&&(S="#"==G.charAt(0)?G.substring(1).toUpperCase():G,S=ColorDialog.prototype.colorNames[S],null!=S?N.setAttribute("title",S):"default"==G?N.setAttribute("title",mxResources.get("useBlackAndWhite")):-N.setAttribute("title",G)),y.isSpecialColor(G)?F.style.display="none":(F.style.display="",null!=G&&G!=mxConstants.NONE?(F.setAttribute("checked","checked"),F.defaultChecked=!0,F.checked=!0):(F.removeAttribute("checked"),F.defaultChecked=!1,F.checked=!1)),N.style.display=F.checked||h?"":"none",H=!1)};z.appendChild(L);mxEvent.addListener(L,"change",function(){var S=L.value;if(!t){var V=mxUtils.getLightDarkColor(G);k()?V.dark=S:V.light=S;S="light-dark("+V.light+", "+V.dark+")"}X(S)});N=mxUtils.button("",-mxUtils.bind(this,function(S){var V=l;t&&k()&&mxUtils.isLightDarkColor(V)&&(V=mxUtils.getLightDarkColor(l).dark);this.editorUi.pickColor(v(G,!0),function(ha){X(ha)},"default"==f?"default":null,V,t);mxEvent.consume(S)}));N.className="geColorBtn";N.style.display=F.checked||h?"":"none";z.appendChild(N);a=null!=G&&"string"===typeof G&&"#"==G.charAt(0)?G.substring(1).toUpperCase():G;a=ColorDialog.prototype.colorNames[a];null!=a&&N.setAttribute("title",a);h||(mxEvent.addListener(z,"click",function(S){S=-mxEvent.getSource(S);if(S==F||"INPUT"!=S.nodeName)S!=F&&(F.checked=!F.checked),F.checked||null==G||G==mxConstants.NONE||f==mxConstants.NONE||(f=v(G)),X(F.checked?f:mxConstants.NONE)}),mxEvent.addGestureListeners(F,mxUtils.bind(this,function(S){document.activeElement==y.cellEditor.textarea&&(U=y.cellEditor.saveSelection())})),mxEvent.addGestureListeners(z,mxUtils.bind(this,function(S){document.activeElement==y.cellEditor.textarea&&(U=y.cellEditor.saveSelection())})));X(G,!0);null!=g&&g.install(function(){X(G,+N.setAttribute("title",G)),y.isSpecialColor(G)?E.style.display="none":(E.style.display="",null!=G&&G!=mxConstants.NONE?(E.setAttribute("checked","checked"),E.defaultChecked=!0,E.checked=!0):(E.removeAttribute("checked"),E.defaultChecked=!1,E.checked=!1)),N.style.display=E.checked||h?"":"none",H=!1)};z.appendChild(L);mxEvent.addListener(L,"change",function(){var S=L.value;if(!t){var V=mxUtils.getLightDarkColor(G);k()?V.dark=S:V.light=S;S="light-dark("+V.light+", "+V.dark+")"}X(S)});N=mxUtils.button("",+mxUtils.bind(this,function(S){var V=l;t&&k()&&mxUtils.isLightDarkColor(V)&&(V=mxUtils.getLightDarkColor(l).dark);this.editorUi.pickColor(v(G,!0),function(ha){X(ha)},"default"==f?"default":null,V,t);mxEvent.consume(S)}));N.className="geColorBtn";N.style.display=E.checked||h?"":"none";z.appendChild(N);a=null!=G&&"string"===typeof G&&"#"==G.charAt(0)?G.substring(1).toUpperCase():G;a=ColorDialog.prototype.colorNames[a];null!=a&&N.setAttribute("title",a);h||(mxEvent.addListener(z,"click",function(S){S=+mxEvent.getSource(S);if(S==E||"INPUT"!=S.nodeName)S!=E&&(E.checked=!E.checked),E.checked||null==G||G==mxConstants.NONE||f==mxConstants.NONE||(f=v(G)),X(E.checked?f:mxConstants.NONE)}),mxEvent.addGestureListeners(E,mxUtils.bind(this,function(S){document.activeElement==y.cellEditor.textarea&&(U=y.cellEditor.saveSelection())})),mxEvent.addGestureListeners(z,mxUtils.bind(this,function(S){document.activeElement==y.cellEditor.textarea&&(U=y.cellEditor.saveSelection())})));X(G,!0);null!=g&&g.install(function(){X(G,!0)},this.listeners.push(g));return z};-BaseFormatPanel.prototype.createArrayCellColorOption=function(a,b,e,f,g,d,h){var l=this.editorUi,t=l.editor.graph,k=t.getCellStyle(t.getSelectionCell(),!1);k=null!=k?null!=k[b]?k[b]:h:null;for(var v=null!=k?mxUtils.parseColorList(k):[],u=document.createElement("div"),y=0;y<v.length;y++)mxUtils.bind(this,function(z){u.appendChild(this.createColorOption(a+" ("+(z+1)+")",function(){return v[y]},function(F){t.getModel().beginUpdate();try{var D=l.getSelectionState().cells;v[z]=F;var G=v.join(",");t.setCellStyles(b,-G,D);null!=g&&g(F);l.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",D))}finally{t.getModel().endUpdate()}},e||mxConstants.NONE,{install:function(F){this.listener=function(){var D=t.getCellStyle(t.getSelectionCell(),!1);null!=D&&(D=null!=D?null!=D[b]?D[b]:h:null,v=null!=D?mxUtils.parseColorList(D):[],F(v[y],!0))};t.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){t.getModel().removeListener(this.listener)}},f,null,d))})(y);return u};-BaseFormatPanel.prototype.createCellColorOption=function(a,b,e,f,g,d,h,l){function t(){var y=v.getCellStyle(v.getSelectionCell(),!1),z=null!=y?y[b]:null;if("inherit"==z){var F=v.getModel().getParent(v.getSelectionCell());F=v.getCellStyle(F,!1);null!=F&&null!=F[b]&&(z=F[b])}return null!=y?null!=z?z:h:null}var k=this.editorUi,v=k.editor.graph,u=t();return null!=u&&l&&1<mxUtils.parseColorList(u).length?this.createArrayCellColorOption(a,b,e,f,g,d,h):this.createColorOption(a,t,function(y){v.getModel().beginUpdate();+BaseFormatPanel.prototype.createArrayCellColorOption=function(a,b,e,f,g,d,h){var l=this.editorUi,t=l.editor.graph,k=t.getCellStyle(t.getSelectionCell(),!1);k=null!=k?null!=k[b]?k[b]:h:null;for(var v=null!=k?mxUtils.parseColorList(k):[],u=document.createElement("div"),y=0;y<v.length;y++)mxUtils.bind(this,function(z){u.appendChild(this.createColorOption(a+" ("+(z+1)+")",function(){return v[y]},function(E){t.getModel().beginUpdate();try{var D=l.getSelectionState().cells;v[z]=E;var G=v.join(",");t.setCellStyles(b,+G,D);null!=g&&g(E);l.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",D))}finally{t.getModel().endUpdate()}},e||mxConstants.NONE,{install:function(E){this.listener=function(){var D=t.getCellStyle(t.getSelectionCell(),!1);null!=D&&(D=null!=D?null!=D[b]?D[b]:h:null,v=null!=D?mxUtils.parseColorList(D):[],E(v[y],!0))};t.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){t.getModel().removeListener(this.listener)}},f,null,d))})(y);return u};+BaseFormatPanel.prototype.createCellColorOption=function(a,b,e,f,g,d,h,l){function t(){var y=v.getCellStyle(v.getSelectionCell(),!1),z=null!=y?y[b]:null;if("inherit"==z){var E=v.getModel().getParent(v.getSelectionCell());E=v.getCellStyle(E,!1);null!=E&&null!=E[b]&&(z=E[b])}return null!=y?null!=z?z:h:null}var k=this.editorUi,v=k.editor.graph,u=t();return null!=u&&l&&1<mxUtils.parseColorList(u).length?this.createArrayCellColorOption(a,b,e,f,g,d,h):this.createColorOption(a,t,function(y){v.getModel().beginUpdate();try{var z=k.getSelectionState().cells;v.setCellStyles(b,y,z);null!=g&&g(y);k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[y],"cells",z))}finally{v.getModel().endUpdate()}},e||mxConstants.NONE,{install:function(y){this.listener=function(){var z=v.getCellStyle(v.getSelectionCell(),!1);null!=z&&y(null!=z[b]?z[b]:h,!0)};v.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){v.getModel().removeListener(this.listener)}},f,null,d)};BaseFormatPanel.prototype.addArrow=function(a){var b=document.createElement("div");b.className="geAdaptiveAsset geArrow";b.style.backgroundImage="url("+Editor.thinExpandImage+")";a.className="geStyleBtn";a.appendChild(b);return b};BaseFormatPanel.prototype.addUnitInput=function(a,b,e,f,g,d,h,l,t){b=document.createElement("input");b.style.position="absolute";b.style.left=216-e-f+"px";b.style.width=f+"px";a.appendChild(b);f=this.createStepper(b,g,d,l,null,t);f.style.left=216-e+"px";a.appendChild(f);return b};@@ -3199,9 +3204,9 @@ BaseFormatPanel.prototype.getUnit=function(a){var b="";switch(this.editorUi.editBaseFormatPanel.prototype.fromUnit=function(a){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return a;case mxConstants.INCHES:return a*mxConstants.PIXELS_PER_INCH;case mxConstants.MILLIMETERS:return a*mxConstants.PIXELS_PER_MM;case mxConstants.METERS:return a*mxConstants.PIXELS_PER_MM*1E3}};BaseFormatPanel.prototype.isFloatUnit=function(){return this.editorUi.editor.graph.view.unit!=mxConstants.POINTS};BaseFormatPanel.prototype.getUnitStep=function(){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return 1;case mxConstants.INCHES:return.1;case mxConstants.MILLIMETERS:return.5;case mxConstants.METERS:return.001}};ArrangePanel.prototype.addGeometry=function(a){var b=this,e=this.editorUi,f=e.editor.graph,g=f.getModel(),d=e.getSelectionState(),h=this.createPanel();h.style.height="60px";var l=document.createElement("div");l.className="geStyleLabel";l.style.position="absolute";l.style.fontWeight="bold";l.style.marginTop="4px";l.style.maxWidth="50px";mxUtils.write(l,mxResources.get("size"));l.setAttribute("title",mxResources.get("size"));h.appendChild(l);var t=this.addUnitInput(h,this.getUnit(),87,52,function(){z.apply(this,-arguments)},this.getUnitStep(),null,null,this.isFloatUnit());t.setAttribute("title",mxResources.get("width"));var k=this.addUnitInput(h,this.getUnit(),16,52,function(){F.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());k.setAttribute("title",mxResources.get("height"));l=document.createElement("div");l.style.backgroundImage="url("+Editor.autosizeImage+")";l.className="geButton";l.style.margin="0";l.style.width="21px";l.style.height="21px";l.style.left="52px";mxUtils.setOpacity(l,+arguments)},this.getUnitStep(),null,null,this.isFloatUnit());t.setAttribute("title",mxResources.get("width"));var k=this.addUnitInput(h,this.getUnit(),16,52,function(){E.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());k.setAttribute("title",mxResources.get("height"));l=document.createElement("div");l.style.backgroundImage="url("+Editor.autosizeImage+")";l.className="geButton";l.style.margin="0";l.style.width="21px";l.style.height="21px";l.style.left="52px";mxUtils.setOpacity(l,50);l.setAttribute("title",mxResources.get("autosize"));mxEvent.addListener(l,"click",function(){e.actions.get("autosize").funct()});h.appendChild(l);d.row?(t.style.visibility="hidden",t.nextSibling.style.visibility="hidden"):this.addLabel(h,mxResources.get("width"),87,64).style.marginTop="0px";this.addLabel(h,mxResources.get("height"),16,64).style.marginTop="0px";mxUtils.br(h);var v=document.createElement("div");v.className="geFormatEntry";v.style.marginTop="14px";var u=this.createCellOption(mxResources.get("constrainProportions"),-mxConstants.STYLE_ASPECT,null,"fixed","null");u.className="geFullWidthElement";v.appendChild(u);d.cell||d.row?l.style.visibility="hidden":h.appendChild(v);var y=u.getElementsByTagName("input")[0];this.addKeyHandler(t,X);this.addKeyHandler(k,X);var z=this.addGeometryHandler(t,function(R,Z,W){Z=Math.max(1,b.fromUnit(Z));if(f.isTableCell(W))return f.setTableColumnWidth(W,Z-R.width,!0),!0;0<R.width&&(y.checked&&(R.height=Math.round(R.height*Z*100/R.width)/100),R.width=Z)});var F=this.addGeometryHandler(k,+mxConstants.STYLE_ASPECT,null,"fixed","null");u.className="geFullWidthElement";v.appendChild(u);d.cell||d.row?l.style.visibility="hidden":h.appendChild(v);var y=u.getElementsByTagName("input")[0];this.addKeyHandler(t,X);this.addKeyHandler(k,X);var z=this.addGeometryHandler(t,function(R,Z,W){Z=Math.max(1,b.fromUnit(Z));if(f.isTableCell(W))return f.setTableColumnWidth(W,Z-R.width,!0),!0;0<R.width&&(y.checked&&(R.height=Math.round(R.height*Z*100/R.width)/100),R.width=Z)});var E=this.addGeometryHandler(k,function(R,Z,W){Z=Math.max(1,b.fromUnit(Z));f.isTableCell(W)&&(W=g.getParent(W));if(f.isTableRow(W))return f.setTableRowHeight(W,Z-R.height),!0;0<R.height&&(y.checked&&(R.width=Math.round(R.width*Z*100/R.height)/100),R.height=Z)});(d.resizable||d.row||d.cell)&&a.appendChild(h);var D=this.createPanel();D.style.paddingBottom="30px";l=document.createElement("div");l.style.position="absolute";l.style.width="70px";l.style.marginTop="0px";l.style.fontWeight="bold";mxUtils.write(l,mxResources.get("position"));l.setAttribute("title",mxResources.get("position"));D.appendChild(l);var G=this.addUnitInput(D,this.getUnit(),87,52,function(){S.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit()),H=this.addUnitInput(D,this.getUnit(),16,52,function(){V.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());mxUtils.br(D);v=!0;var M=null,N=null;if(d.movable){if(0==d.edges.length&&1==d.vertices.length){var L=f.getCellGeometry(d.vertices[0]);if(null!=L&&L.relative){mxUtils.br(D);l=document.createElement("div");l.style.position="absolute";l.style.width="70px";l.style.marginTop="0px";mxUtils.write(l,mxResources.get("relative"));l.setAttribute("title",mxResources.get("relative"));D.appendChild(l);M=this.addGenericInput(D," %",87,52,function(){return Math.round(1E3*L.x)/10},function(R){R=parseFloat(R);if(!isNaN(R)){g.beginUpdate();try{L=L.clone(),L.x=parseFloat(R)/100,g.setGeometry(d.vertices[0],L)}finally{g.endUpdate()}}});M.setAttribute("title",mxResources.get("relative"));@@ -3220,26 +3225,26 @@ ArrangePanel.prototype.addEdgeGeometry=function(a){var b=this,e=this.editorUi,f=mxUtils.br(d);this.addKeyHandler(l,D);var t=mxUtils.bind(this,function(L){var U=parseInt(l.value);U=Math.min(999,Math.max(1,isNaN(U)?1:U));if(U!=mxUtils.getValue(g.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth)){var X=e.getSelectionState().cells;f.setCellStyles("width",U,X);e.fireEvent(new mxEventObject("styleChanged","keys",["width"],"values",[U],"cells",X))}l.value=U+" pt";mxEvent.consume(L)});mxEvent.addListener(l,"blur",t);mxEvent.addListener(l,"change",t);a.appendChild(d);var k=this.createPanel();k.style.paddingBottom="30px";h=document.createElement("div");h.style.position="absolute";h.style.width="70px";h.style.marginTop="4px";mxUtils.write(h,mxResources.get("linestart"));h.setAttribute("title",mxResources.get("linestart"));k.appendChild(h);var v=this.addUnitInput(k,this.getUnit(),87,52,function(){G.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());v.setAttribute("title",mxResources.get("left"));var u=this.addUnitInput(k,this.getUnit(),16,52,function(){H.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());u.setAttribute("title",mxResources.get("top"));mxUtils.br(k);this.addLabel(k,mxResources.get("left"),87,64);this.addLabel(k,mxResources.get("top"),16,64);a.appendChild(k);this.addKeyHandler(v,D);this.addKeyHandler(u,D);var y=this.createPanel();y.style.paddingBottom="30px";h=document.createElement("div");h.style.position="absolute";h.style.width="70px";h.style.marginTop="4px";mxUtils.write(h,mxResources.get("lineend"));-h.setAttribute("title",mxResources.get("lineend"));y.appendChild(h);var z=this.addUnitInput(y,this.getUnit(),87,52,function(){M.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());z.setAttribute("title",mxResources.get("left"));var F=this.addUnitInput(y,this.getUnit(),16,52,function(){N.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());F.setAttribute("title",mxResources.get("top"));mxUtils.br(y);this.addLabel(y,mxResources.get("left"),87,64);this.addLabel(y,-mxResources.get("top"),16,64);a.appendChild(y);this.addKeyHandler(z,D);this.addKeyHandler(F,D);var D=mxUtils.bind(this,function(L,U,X){g=e.getSelectionState();L=g.cells[0];if("link"==g.style.shape||"flexArrow"==g.style.shape){if(d.style.display="",X||document.activeElement!=l)X=mxUtils.getValue(g.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth),l.value=X+" pt"}else d.style.display="none";1==g.cells.length&&f.model.isEdge(L)?(X=f.model.getGeometry(L),null!=X&&null!=X.sourcePoint&&-null==f.model.getTerminal(L,!0)?(v.value=this.inUnit(X.sourcePoint.x)+" "+this.getUnit(),u.value=this.inUnit(X.sourcePoint.y)+" "+this.getUnit()):k.style.display="none",null!=X&&null!=X.targetPoint&&null==f.model.getTerminal(L,!1)?(z.value=this.inUnit(X.targetPoint.x)+" "+this.getUnit(),F.value=this.inUnit(X.targetPoint.y)+" "+this.getUnit()):y.style.display="none"):(k.style.display="none",y.style.display="none")});var G=this.addEdgeGeometryHandler(v,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.x=-b.fromUnit(U))});var H=this.addEdgeGeometryHandler(u,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.y=b.fromUnit(U))});var M=this.addEdgeGeometryHandler(z,function(L,U){null!=L.targetPoint&&(L.targetPoint.x=b.fromUnit(U))});var N=this.addEdgeGeometryHandler(F,function(L,U){null!=L.targetPoint&&(L.targetPoint.y=b.fromUnit(U))});f.getModel().addListener(mxEvent.CHANGE,D);this.listeners.push({destroy:function(){f.getModel().removeListener(D)}});D()};+h.setAttribute("title",mxResources.get("lineend"));y.appendChild(h);var z=this.addUnitInput(y,this.getUnit(),87,52,function(){M.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());z.setAttribute("title",mxResources.get("left"));var E=this.addUnitInput(y,this.getUnit(),16,52,function(){N.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());E.setAttribute("title",mxResources.get("top"));mxUtils.br(y);this.addLabel(y,mxResources.get("left"),87,64);this.addLabel(y,+mxResources.get("top"),16,64);a.appendChild(y);this.addKeyHandler(z,D);this.addKeyHandler(E,D);var D=mxUtils.bind(this,function(L,U,X){g=e.getSelectionState();L=g.cells[0];if("link"==g.style.shape||"flexArrow"==g.style.shape){if(d.style.display="",X||document.activeElement!=l)X=mxUtils.getValue(g.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth),l.value=X+" pt"}else d.style.display="none";1==g.cells.length&&f.model.isEdge(L)?(X=f.model.getGeometry(L),null!=X&&null!=X.sourcePoint&&+null==f.model.getTerminal(L,!0)?(v.value=this.inUnit(X.sourcePoint.x)+" "+this.getUnit(),u.value=this.inUnit(X.sourcePoint.y)+" "+this.getUnit()):k.style.display="none",null!=X&&null!=X.targetPoint&&null==f.model.getTerminal(L,!1)?(z.value=this.inUnit(X.targetPoint.x)+" "+this.getUnit(),E.value=this.inUnit(X.targetPoint.y)+" "+this.getUnit()):y.style.display="none"):(k.style.display="none",y.style.display="none")});var G=this.addEdgeGeometryHandler(v,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.x=+b.fromUnit(U))});var H=this.addEdgeGeometryHandler(u,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.y=b.fromUnit(U))});var M=this.addEdgeGeometryHandler(z,function(L,U){null!=L.targetPoint&&(L.targetPoint.x=b.fromUnit(U))});var N=this.addEdgeGeometryHandler(E,function(L,U){null!=L.targetPoint&&(L.targetPoint.y=b.fromUnit(U))});f.getModel().addListener(mxEvent.CHANGE,D);this.listeners.push({destroy:function(){f.getModel().removeListener(D)}});D()};TextFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(TextFormatPanel,BaseFormatPanel);TextFormatPanel.prototype.init=function(){this.container.appendChild(this.addFont(this.createPanel()));this.container.appendChild(this.addFontOps(this.createPanel()))};TextFormatPanel.prototype.addFontOps=function(a){0==this.addActions(a,["removeFormat"])&&(a.style.display="none");return a};TextFormatPanel.prototype.addFont=function(a){function b(la){la=null!=la?la.fontSize:null;return null!=la&&"px"==la.substring(la.length-2)?parseFloat(la):mxConstants.DEFAULT_FONTSIZE}function e(la,Ea){if(null!=la&&""!=la.textContent){la.style.lineHeight="";var za=mxUtils.getCurrentStyle(la);parseFloat(za.fontSize)*Ea/100!=parseFloat(za.lineHeight)?la.style.lineHeight=Ea+"%":""==la.getAttribute("style")&&la.removeAttribute("style")}}function f(la,Ea){Ea?la.classList.add("geActiveItem"):la.classList.remove("geActiveItem")}var g=this.editorUi,d=g.editor.graph,h=g.getSelectionState(),l=this.createTitle(mxResources.get("font"));a.appendChild(l);l=this.createPanel();l.className="geFormatEntry";if(d.cellEditor.isContentEditing()){var t=l.cloneNode(),k=g.toolbar.addMenu(g.menus.get("formatBlock"),mxResources.get("style"),null,t);this.addArrow(k);k.style.margin="0px";k.style.position="relative";k.classList.add("geFullWidthElement");a.appendChild(t)}k=l.cloneNode(!1);a.appendChild(k);t=this.createPanel();var v=g.toolbar.addMenu(g.menus.get("fontFamily"),"Helvetica",null,k);this.addArrow(v);v.setAttribute("title",mxResources.get("fontFamily"));v.style.margin="0px";v.style.position="relative";v.classList.add("geFullWidthElement");"inherit"==h.style[mxConstants.STYLE_FONTFAMILY]&&(k.style.display="none");k=l.cloneNode(!1);var u=g.toolbar.addItems(["bold","italic","underline"],k,!0,[Editor.boldImage,Editor.italicImage,Editor.underlineImage]);u[0].setAttribute("title",mxResources.get("bold")+" ("+g.actions.get("bold").shortcut+")");u[1].setAttribute("title",-mxResources.get("italic")+" ("+g.actions.get("italic").shortcut+")");u[2].setAttribute("title",mxResources.get("underline")+" ("+g.actions.get("underline").shortcut+")");var y=g.toolbar.addItems(["vertical"],k,!0,[Editor.verticalTextImage])[0];a.appendChild(k);var z=l.cloneNode(!1),F=function(la){return function(){return la()}},D=g.addButton(Editor.alignLeftImage,mxResources.get("left"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_LEFT,la);g.fireEvent(new mxEventObject("styleChanged",-"keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_LEFT],"cells",h.cells))}:F(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT])),z),G=g.addButton(Editor.alignCenterImage,mxResources.get("center"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_CENTER,la);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_CENTER],"cells",h.cells))}:F(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],-[mxConstants.ALIGN_CENTER])),z),H=g.addButton(Editor.alignRightImage,mxResources.get("right"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_RIGHT,la);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_RIGHT],"cells",h.cells))}:F(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT])),z);d.cellEditor.isContentEditing()&&(U=g.addButton(Editor.strikethroughImage,mxResources.get("strikethrough"),-function(){document.execCommand("strikeThrough",!1,null)},k));var M=g.addButton(Editor.alignTopImage,mxResources.get("top"),F(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP])),z),N=g.addButton(Editor.alignMiddleImage,mxResources.get("middle"),F(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE])),z),L=g.addButton(Editor.alignBottomImage,mxResources.get("bottom"),F(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],+mxResources.get("italic")+" ("+g.actions.get("italic").shortcut+")");u[2].setAttribute("title",mxResources.get("underline")+" ("+g.actions.get("underline").shortcut+")");var y=g.toolbar.addItems(["vertical"],k,!0,[Editor.verticalTextImage])[0];a.appendChild(k);var z=l.cloneNode(!1),E=function(la){return function(){return la()}},D=g.addButton(Editor.alignLeftImage,mxResources.get("left"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_LEFT,la);g.fireEvent(new mxEventObject("styleChanged",+"keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_LEFT],"cells",h.cells))}:E(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT])),z),G=g.addButton(Editor.alignCenterImage,mxResources.get("center"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_CENTER,la);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_CENTER],"cells",h.cells))}:E(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],+[mxConstants.ALIGN_CENTER])),z),H=g.addButton(Editor.alignRightImage,mxResources.get("right"),d.cellEditor.isContentEditing()?function(la){d.cellEditor.alignText(mxConstants.ALIGN_RIGHT,la);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_RIGHT],"cells",h.cells))}:E(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT])),z);d.cellEditor.isContentEditing()&&(U=g.addButton(Editor.strikethroughImage,mxResources.get("strikethrough"),+function(){document.execCommand("strikeThrough",!1,null)},k));var M=g.addButton(Editor.alignTopImage,mxResources.get("top"),E(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP])),z),N=g.addButton(Editor.alignMiddleImage,mxResources.get("middle"),E(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE])),z),L=g.addButton(Editor.alignBottomImage,mxResources.get("bottom"),E(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM])),z);a.appendChild(z);var U,X,S,V;if(d.cellEditor.isContentEditing()){M.style.display="none";N.style.display="none";L.style.display="none";y.style.display="none";var ha=g.addButton(Editor.alignJustifyImage,mxResources.get("block"),function(){document.execCommand("justifyfull",!1,null)},z);ha.style.marginRight="9px";var R=g.addButton(Editor.subscriptImage,mxResources.get("subscript")+" ("+Editor.ctrlKey+"+,)",function(){document.execCommand("subscript",!1,null)},z);R.style.marginLeft=-"10px";var Z=g.addButton(Editor.superscriptImage,mxResources.get("superscript")+" ("+Editor.ctrlKey+"+.)",function(){document.execCommand("superscript",!1,null)},z);R.style.marginLeft="10px";F=z.cloneNode(!1);F.style.paddingTop="4px";z=[g.addButton(Editor.orderedListImage,mxResources.get("numberedList"),function(){document.execCommand("insertorderedlist",!1,null)},F),g.addButton(Editor.unorderedListImage,mxResources.get("bulletedList"),function(){document.execCommand("insertunorderedlist",!1,null)},-F),g.addButton(Editor.indentImage,mxResources.get("increaseIndent"),function(){document.execCommand("indent",!1,null)},F),g.addButton(Editor.outdentImage,mxResources.get("decreaseIndent"),function(){document.execCommand("outdent",!1,null)},F),g.addButton(Editor.removeFormatImage,mxResources.get("removeFormat"),function(){document.execCommand("removeformat",!1,null)},F),g.addButton(Editor.codeImage,mxResources.get("html"),function(){d.cellEditor.toggleViewMode()},F)];z[z.length-2].style.marginLeft=-"10px";a.appendChild(F)}else u[2].style.marginRight="12px",H.style.marginRight="12px";z=l.cloneNode(!1);mxUtils.write(z,mxResources.get("position"));z.setAttribute("title",mxResources.get("position"));var W=document.createElement("select");W.setAttribute("title",mxResources.get("position"));W.style.left="114px";W.style.width="98px";var ba="topLeft top topRight left center right bottomLeft bottom bottomRight".split(" "),K={topLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_RIGHT,+"10px";var Z=g.addButton(Editor.superscriptImage,mxResources.get("superscript")+" ("+Editor.ctrlKey+"+.)",function(){document.execCommand("superscript",!1,null)},z);R.style.marginLeft="10px";E=z.cloneNode(!1);E.style.paddingTop="4px";z=[g.addButton(Editor.orderedListImage,mxResources.get("numberedList"),function(){document.execCommand("insertorderedlist",!1,null)},E),g.addButton(Editor.unorderedListImage,mxResources.get("bulletedList"),function(){document.execCommand("insertunorderedlist",!1,null)},+E),g.addButton(Editor.indentImage,mxResources.get("increaseIndent"),function(){document.execCommand("indent",!1,null)},E),g.addButton(Editor.outdentImage,mxResources.get("decreaseIndent"),function(){document.execCommand("outdent",!1,null)},E),g.addButton(Editor.removeFormatImage,mxResources.get("removeFormat"),function(){document.execCommand("removeformat",!1,null)},E),g.addButton(Editor.codeImage,mxResources.get("html"),function(){d.cellEditor.toggleViewMode()},E)];z[z.length-2].style.marginLeft=+"10px";a.appendChild(E)}else u[2].style.marginRight="12px",H.style.marginRight="12px";z=l.cloneNode(!1);mxUtils.write(z,mxResources.get("position"));z.setAttribute("title",mxResources.get("position"));var W=document.createElement("select");W.setAttribute("title",mxResources.get("position"));W.style.left="114px";W.style.width="98px";var ba="topLeft top topRight left center right bottomLeft bottom bottomRight".split(" "),K={topLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM],top:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM],topRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM],left:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE],center:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE],right:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE,-mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE],bottomLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP],bottom:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP],bottomRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP]};for(F=0;F<ba.length;F++){var T=document.createElement("option");T.setAttribute("value",ba[F]);mxUtils.write(T,mxResources.get(ba[F]));+mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE],bottomLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP],bottom:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP],bottomRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP]};for(E=0;E<ba.length;E++){var T=document.createElement("option");T.setAttribute("value",ba[E]);mxUtils.write(T,mxResources.get(ba[E]));W.appendChild(T)}z.appendChild(W);ba=z.cloneNode(!1);mxUtils.write(ba,mxResources.get("writingDirection"));ba.setAttribute("title",mxResources.get("writingDirection"));var aa=W.cloneNode(!1);aa.setAttribute("title",mxResources.get("writingDirection"));T=["automatic","leftToRight","rightToLeft"];h.html&&(T.push("vertical-leftToRight"),T.push("vertical-rightToLeft"));var ka={automatic:null,leftToRight:mxConstants.TEXT_DIRECTION_LTR,rightToLeft:mxConstants.TEXT_DIRECTION_RTL,"vertical-leftToRight":mxConstants.TEXT_DIRECTION_VERTICAL_LR,-"vertical-rightToLeft":mxConstants.TEXT_DIRECTION_VERTICAL_RL};for(F=0;F<T.length;F++){var oa=document.createElement("option");oa.setAttribute("value",T[F]);"vertical-"==T[F].substring(0,9)?mxUtils.write(oa,mxResources.get("vertical")+" ("+mxResources.get(T[F].substring(9))+")"):mxUtils.write(oa,mxResources.get(T[F]));aa.appendChild(oa)}ba.appendChild(aa);d.isEditing()||(a.appendChild(z),mxEvent.addListener(W,"change",function(la){d.getModel().beginUpdate();try{var Ea=K[W.value];null!=Ea&&(d.setCellStyles(mxConstants.STYLE_LABEL_POSITION,+"vertical-rightToLeft":mxConstants.TEXT_DIRECTION_VERTICAL_RL};for(E=0;E<T.length;E++){var oa=document.createElement("option");oa.setAttribute("value",T[E]);"vertical-"==T[E].substring(0,9)?mxUtils.write(oa,mxResources.get("vertical")+" ("+mxResources.get(T[E].substring(9))+")"):mxUtils.write(oa,mxResources.get(T[E]));aa.appendChild(oa)}ba.appendChild(aa);d.isEditing()||(a.appendChild(z),mxEvent.addListener(W,"change",function(la){d.getModel().beginUpdate();try{var Ea=K[W.value];null!=Ea&&(d.setCellStyles(mxConstants.STYLE_LABEL_POSITION,Ea[0],h.cells),d.setCellStyles(mxConstants.STYLE_VERTICAL_LABEL_POSITION,Ea[1],h.cells),d.setCellStyles(mxConstants.STYLE_ALIGN,Ea[2],h.cells),d.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,Ea[3],h.cells))}finally{d.getModel().endUpdate()}mxEvent.consume(la)}),a.appendChild(ba),mxEvent.addListener(aa,"change",function(la){d.setCellStyles(mxConstants.STYLE_TEXT_DIRECTION,ka[aa.value],h.cells);mxEvent.consume(la)}));var pa=document.createElement("input");pa.style.position="absolute";pa.style.left="146px";pa.style.width="52px";pa.setAttribute("title",mxResources.get("fontSize"));k.appendChild(pa);z=this.installInputHandler(pa,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize,1,999," "+Editor.fontSizeUnit,function(la){if(null!=d.getSelectedEditingElement()){pa.value=la+" "+Editor.fontSizeUnit;document.execCommand("fontSize",!1,"1");for(var Ea=d.cellEditor.textarea.getElementsByTagName("font"),za=0;za<Ea.length;za++)if("1"==Ea[za].getAttribute("size")){Ea[za].removeAttribute("size");Ea[za].style.fontSize="";var Va=mxUtils.getCurrentStyle(Ea[za]);la!=b(Va)?Ea[za].style.fontSize=la+"px":""==Ea[za].getAttribute("style")&&Ea[za].removeAttribute("style")}}},!0);z=this.createStepper(pa,z,1,!0,Menus.prototype.defaultFontSize);z.style.display=pa.style.display;z.style.left="198px";"inherit"==h.style[mxConstants.STYLE_FONTSIZE]&&(pa.style.display="none",z.style.display="none");k.appendChild(z);var da=null,ia=d.shapeBackgroundColor,fa=null,O=d.shapeForegroundColor;k=mxUtils.getLightDarkColor(d.shapeBackgroundColor);@@ -3249,7 +3254,7 @@ ua.style.fontWeight="bold";k=1<=h.vertices.length?d.stylesheet.getDefaultVertexSla},destroy:function(){fa=null}},null,!0,null!=k[mxConstants.STYLE_FONTCOLOR]&&"default"!=k[mxConstants.STYLE_FONTCOLOR]?k[mxConstants.STYLE_FONTCOLOR]:d.shapeForegroundColor):this.createCellColorOption(mxResources.get("fontColor"),mxConstants.STYLE_FONTCOLOR,"default",function(la){ja.style.display=la==mxConstants.NONE?"none":"";ua.style.display=ja.style.display},function(la){la==mxConstants.NONE?d.setCellStyles(mxConstants.STYLE_NOLABEL,"1",h.cells):d.setCellStyles(mxConstants.STYLE_NOLABEL,null,h.cells);d.setCellStyles(mxConstants.STYLE_FONTCOLOR,la,h.cells);d.updateLabelElements(h.cells,function(Ea){Ea.removeAttribute("color");Ea.style.color=null})},d.shapeForegroundColor);"inherit"==h.style[mxConstants.STYLE_FONTCOLOR]&&(k.style.display="none");k.style.fontWeight="bold";t.appendChild(k);t.appendChild(ja);k=this.createCellOption(mxResources.get("shadow"),mxConstants.STYLE_TEXT_SHADOW,0);k.style.width="100%";k.style.fontWeight="bold";Editor.enableShadowOption||(k.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(k,60));d.cellEditor.isContentEditing()||(t.appendChild(ua),t.appendChild(k));a.appendChild(t);t=this.createPanel();t.style.paddingTop="2px";t.style.paddingBottom="4px";z=d.filterSelectionCells(mxUtils.bind(this,function(la){var Ea=d.view.getState(la);return null==Ea||d.getModel().isEdge(la)||d.isAutoSizeState(Ea)}));k=this.createCellOption(mxResources.get("wordWrap"),mxConstants.STYLE_WHITE_SPACE,null,"wrap","null",null,null,!0,z);k.style.fontWeight="bold";0<z.length&&-t.appendChild(k);z=this.createCellOption(mxResources.get("formattedText"),"html",0,null,null,null,g.actions.get("formattedText"));z.style.fontWeight="bold";t.appendChild(z);F=d.view.getState(d.getSelectionCell());(z="1"==mxUtils.getValue(h.style,"html",0))&&(1<d.getSelectionCount()&&"1"==h.style.convertToSvg||1==d.getSelectionCount()&&null!=F&&null!=F.text&&null!=F.text.node&&0==F.text.node.getElementsByTagName("foreignObject").length)&&(k.style.opacity="0.5",k.getElementsByTagName("input")[0].setAttribute("disabled",+t.appendChild(k);z=this.createCellOption(mxResources.get("formattedText"),"html",0,null,null,null,g.actions.get("formattedText"));z.style.fontWeight="bold";t.appendChild(z);E=d.view.getState(d.getSelectionCell());(z="1"==mxUtils.getValue(h.style,"html",0))&&(1<d.getSelectionCount()&&"1"==h.style.convertToSvg||1==d.getSelectionCount()&&null!=E&&null!=E.text&&null!=E.text.node&&0==E.text.node.getElementsByTagName("foreignObject").length)&&(k.style.opacity="0.5",k.getElementsByTagName("input")[0].setAttribute("disabled","disabled"));k=this.createCellOption(mxResources.get("lblToSvg"),"convertToSvg","0");k.style.fontWeight="bold";t.appendChild(k);z||(k.style.opacity="0.5",k.getElementsByTagName("input")[0].setAttribute("disabled","disabled"));z=this.createCellOption(mxResources.get("autosizeText"),"autosizeText","0",null,null,mxUtils.bind(this,function(la,Ea){if(Ea)for(Ea=0;Ea<la.length;Ea++)d.model.isVertex(la[Ea])&&d.updateAutosizeTextFontSize(la[Ea])}));z.style.fontWeight="bold";0<h.vertices.length&&t.appendChild(z);if(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)k.getElementsByTagName("span")[0].style.maxWidth="172px",k.appendChild(g.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/5165"));k=this.createPanel();k.style.height="86px";z=document.createElement("div");z.style.position="absolute";z.style.width="70px";z.style.marginTop="0px";z.style.fontWeight="bold";mxUtils.write(z,mxResources.get("spacing"));z.setAttribute("title",mxResources.get("spacing"));k.appendChild(z);var ya=this.addUnitInput(k,this.getUnit(),87,52,function(){ib.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());ya.setAttribute("title",mxResources.get("top"));var Ma=this.addUnitInput(k,this.getUnit(),16,52,function(){eb.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Ma.setAttribute("title",mxResources.get("global"));mxUtils.br(k);this.addLabel(k,mxResources.get("top"),87,64);this.addLabel(k,mxResources.get("global"),16,64);mxUtils.br(k);mxUtils.br(k);var Oa=@@ -3264,7 +3269,7 @@ t.appendChild(k);l=l.cloneNode(!1);z=[g.addButton(Editor.strokeColorImage,mxResonull});null==za||za==mxConstants.NONE?(Va.removeAttribute("border"),Va.style.border="",Va.style.borderCollapse=""):(Va.setAttribute("border","1"),Va.style.border="1px solid "+za,Va.style.borderCollapse="collapse")})}}),l),g.addButton(Editor.fillColorImage,mxResources.get("backgroundColor"),mxUtils.bind(this,function(la){if(null!=X){var Ea=X.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(za,Va,Ta,q){return"#"+("0"+Number(Va).toString(16)).substr(-2)+("0"+Number(Ta).toString(16)).substr(-2)+("0"+Number(q).toString(16)).substr(-2)});g.pickColor(Ea,function(za){var Va=null==S||null!=la&&mxEvent.isShiftDown(la)?X:S;d.processElements(Va,function(Ta){Ta.style.backgroundColor=null});Va.style.backgroundColor=null==za||za==mxConstants.NONE?"":za})}}),l),g.addButton(Editor.spacingImage,mxResources.get("spacing"),function(){if(null!=X){var la=X.getAttribute("cellPadding")||0;la=new FilenameDialog(g,la,mxResources.get("apply"),mxUtils.bind(this,function(Ea){null!=Ea&&0<Ea.length?X.setAttribute("cellPadding",Ea):X.removeAttribute("cellPadding")}),mxResources.get("spacing"));g.showDialog(la.container,300,80,!0,!0);la.init()}},l),g.addButton(Editor.alignLeftImage,mxResources.get("left"),function(){null!=X&&X.setAttribute("align","left")},l),g.addButton(Editor.alignCenterImage,mxResources.get("center"),function(){null!=X&&X.setAttribute("align","center")},l),g.addButton(Editor.alignRightImage,mxResources.get("right"),function(){null!=X&&X.setAttribute("align",-"right")},l)];z[2].style.marginRight="10px";t.appendChild(l);a.appendChild(t);var $a=t}else a.appendChild(t),a.appendChild(this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_TEXT_OPACITY)),a.appendChild(k);for(F=0;3>F;F++)(function(la){mxEvent.addListener(u[la],"click",function(){f(u[la],""==u[la].style.backgroundImage)})})(F);var ab=mxUtils.bind(this,function(la,Ea,za){h=g.getSelectionState();la=mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0);f(u[0],(la&mxConstants.FONT_BOLD)==+"right")},l)];z[2].style.marginRight="10px";t.appendChild(l);a.appendChild(t);var $a=t}else a.appendChild(t),a.appendChild(this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_TEXT_OPACITY)),a.appendChild(k);for(E=0;3>E;E++)(function(la){mxEvent.addListener(u[la],"click",function(){f(u[la],""==u[la].style.backgroundImage)})})(E);var ab=mxUtils.bind(this,function(la,Ea,za){h=g.getSelectionState();la=mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0);f(u[0],(la&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD);f(u[1],(la&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC);f(u[2],(la&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE);g.toolbar.setMenuText(v,mxUtils.getValue(h.style,mxConstants.STYLE_FONTFAMILY,Menus.prototype.defaultFont));f(y,"0"==mxUtils.getValue(h.style,mxConstants.STYLE_HORIZONTAL,"1"));if(za||document.activeElement!=pa)la=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize)),pa.value=isNaN(la)?"":la+" "+Editor.fontSizeUnit;la=mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);f(D,la==mxConstants.ALIGN_LEFT);f(G,la==mxConstants.ALIGN_CENTER);f(H,la==mxConstants.ALIGN_RIGHT);la=mxUtils.getValue(h.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);f(M,la==mxConstants.ALIGN_TOP);f(N,la==mxConstants.ALIGN_MIDDLE);f(L,la==mxConstants.ALIGN_BOTTOM);la=mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);Ea=mxUtils.getValue(h.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);W.value=la==mxConstants.ALIGN_LEFT&&Ea==mxConstants.ALIGN_TOP?"topLeft":la==mxConstants.ALIGN_CENTER&&Ea==mxConstants.ALIGN_TOP?"top":la==mxConstants.ALIGN_RIGHT&&Ea==mxConstants.ALIGN_TOP?"topRight":la==mxConstants.ALIGN_LEFT&&Ea==mxConstants.ALIGN_BOTTOM?"bottomLeft":la==mxConstants.ALIGN_CENTER&&Ea==mxConstants.ALIGN_BOTTOM?"bottom":la==mxConstants.ALIGN_RIGHT&&Ea==mxConstants.ALIGN_BOTTOM?"bottomRight":la==mxConstants.ALIGN_LEFT?"left":la==mxConstants.ALIGN_RIGHT?"right":@@ -3274,7 +3279,7 @@ mxConstants.STYLE_SPACING,2)),Ma.value=isNaN(la)?"":this.inUnit(la)+" "+this.getmxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var jb=this.installInputHandler(Ka,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var db=this.installInputHandler(Oa,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(pa,ab);this.addKeyHandler(Ma,ab);this.addKeyHandler(ya,ab);this.addKeyHandler(La,ab);this.addKeyHandler(Ka,ab);this.addKeyHandler(Oa,ab);d.getModel().addListener(mxEvent.CHANGE,ab);this.listeners.push({destroy:function(){d.getModel().removeListener(ab)}});ab();if(d.cellEditor.isContentEditing()){var kb=null,hb=!1;l=mxUtils.bind(this,function(){hb||(hb=!0,window.setTimeout(mxUtils.bind(this,function(){var la=d.getSelectedEditingElement();if(null!=la&&null!=d.cellEditor.textarea){var Ea=function(ca,na){if(null!=ca&&null!=na){if(ca==na)return!0;if(ca.length>na.length+1)return ca.substring(ca.length-na.length-1,ca.length)=="-"+na}return!1},za=function(ca){if(null!=d.getParentByName(la,ca,d.cellEditor.textarea))return!0;for(var na=la;null!=na&&1==na.childNodes.length;)if(na=na.childNodes[0],na.nodeName==ca)return!0;return!1},Va=function(ca){for(;null!=ca&&ca!=d.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle(ca).display)return ca;ca=ca.parentNode}return null},Ta=mxUtils.getCurrentStyle(la),q=la==d.cellEditor.textarea||""==la.style.lineHeight?null:la.style.lineHeight,B=la==d.cellEditor.textarea||""==la.style.fontSize?null:b(Ta);if(window.getSelection)for(var C=la.getElementsByTagName("*"),-E=window.getSelection(),J=0;J<C.length&&(!E.containsNode(C[J],!0)||null==C[J].style||(null==B&&""!=C[J].style.fontSize&&(B=parseFloat(C[J].style.fontSize)),null==q&&""!=C[J].style.lineHeight&&(q=C[J].style.lineHeight),null==B||null==q));J++);null==B&&(B=b(Ta));if(null==q)for(C=la;null!=C&&C!=d.cellEditor.textarea.parentNode;){if(null!=C.style&&""!=C.style.lineHeight){q=C.style.lineHeight;break}C=C.parentNode}if(null!=Ta){f(u[0],"bold"==Ta.fontWeight||400<Ta.fontWeight||za("B")||za("STRONG"));f(u[1],+F=window.getSelection(),J=0;J<C.length&&(!F.containsNode(C[J],!0)||null==C[J].style||(null==B&&""!=C[J].style.fontSize&&(B=parseFloat(C[J].style.fontSize)),null==q&&""!=C[J].style.lineHeight&&(q=C[J].style.lineHeight),null==B||null==q));J++);null==B&&(B=b(Ta));if(null==q)for(C=la;null!=C&&C!=d.cellEditor.textarea.parentNode;){if(null!=C.style&&""!=C.style.lineHeight){q=C.style.lineHeight;break}C=C.parentNode}if(null!=Ta){f(u[0],"bold"==Ta.fontWeight||400<Ta.fontWeight||za("B")||za("STRONG"));f(u[1],"italic"==Ta.fontStyle||za("I")||za("EM"));f(u[2],"underline"==Ta.textDecorationLine||za("U"));f(U,"line-through"==Ta.textDecorationLine||za("STRIKE"));f(Z,za("SUP"));f(R,za("SUB"));var P=Va(la);if(null!=P){za=function(ca,na){ma.push({name:ca,dispName:na,type:"string",getValue:function(){return Y[ca]},valueChanged:function(ta,Fa){var Da=P.style,Na=ta;parseInt(Na)==Na&&(Na+="px",null!=Fa&&(Fa.value=Na));Da[ca]=Na;""==ta&&null!=Fa&&(Fa.value=Y[ca])}})};var Y=mxUtils.getCurrentStyle(P),ma=[];za("paddingTop","Padding Top");za("paddingRight","Padding Right");za("paddingLeft","Padding Left");za("paddingBottom","Padding Bottom");za("marginTop","Margin Top");za("marginRight","Margin Right");za("marginLeft","Margin Left");za("marginBottom","Margin Bottom");za=this.createPanel();this.addProperties(za,ma,h,!0);null!=kb?kb.parentNode.replaceChild(za,kb):a.appendChild(za);kb=za}d.cellEditor.isTableSelected()?(f(ha,Ea(Ta.textAlign,"justify")),f(D,Ea(Ta.textAlign,"left")),f(G,Ea(Ta.textAlign,"center")),f(H,Ea(Ta.textAlign,"right"))):(za=d.cellEditor.align||mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),Ea(Ta.textAlign,"justify")?(f(ha,Ea(Ta.textAlign,"justify")),f(D,!1),f(G,!1),f(H,!1)):(f(ha,!1),f(D,za==mxConstants.ALIGN_LEFT),f(G,za==mxConstants.ALIGN_CENTER),f(H,za==mxConstants.ALIGN_RIGHT)));X=d.getParentByName(la,"TABLE",d.cellEditor.textarea);V=null==X?null:d.getParentByName(la,"TR",X);S=null==X?null:d.getParentByNames(la,["TD","TH"],X);$a.style.display=null!=X?"":"none";document.activeElement!=@@ -3285,8 +3290,8 @@ var b=this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_OPAStyleFormatPanel.prototype.getCssRules=function(a){var b=document.implementation.createHTMLDocument(""),e=document.createElement("style");mxUtils.setTextContent(e,a);b.body.appendChild(e);return e.sheet.cssRules};StyleFormatPanel.prototype.addSvgStyles=function(a){var b=this.editorUi.getSelectionState();a.style.paddingTop="6px";a.style.paddingBottom="6px";a.style.fontWeight="bold";a.style.display="none";try{var e=b.style.editableCssRules;if(null!=e){var f=new RegExp(e),g=b.style.image.substring(b.style.image.indexOf(",")+1),d=window.atob?decodeURIComponent(escape(atob(g))):Base64.decode(g,!0),h=mxUtils.parseXml(d);if(null!=h){var l="light"==h.documentElement.style.colorScheme||"0"==mxUtils.getValue(b.style,"darkMode",null),t=""==h.documentElement.style.colorScheme,k=h.getElementsByTagName("style");for(b=0;b<k.length;b++){var v=this.getCssRules(mxUtils.getTextContent(k[b]));for(e=0;e<v.length;e++)this.addSvgRule(a,v[e],h,k[b],v,e,f,l,t)}}}}catch(u){}return a};StyleFormatPanel.prototype.getColorSchemeFromCss=function(a){return(a=a.match(/color-scheme\s*:\s*([^;]+)/i))?a[1].trim():null};-StyleFormatPanel.prototype.addSvgRule=function(a,b,e,f,g,d,h,l,t){var k=this.editorUi,v=k.editor.graph;h.test(b.selectorText)&&(h=mxUtils.bind(this,function(u,y,z,F){var D=mxUtils.trim(u.style.getPropertyValue(y));if(""!=D&&"url("!=D.substring(0,4)){var G=D;"transparent"==G?G=mxConstants.NONE:(D=mxUtils.isLightDarkColor(G))&&F?F=!1:D||F||(G="light-dark("+G+", "+G+")");u=this.createColorOption(z+" "+u.selectorText,function(){return G},mxUtils.bind(this,function(H){g[d].style.setProperty(y,H==mxConstants.NONE?-"transparent":mxUtils.getLightDarkColor(H).cssText);H="";t&&mxUtils.isLightDarkColor(g[d].style[y])&&(e.documentElement.style.colorScheme="light dark");for(var M=0;M<g.length;M++)H+=g[M].cssText+" ";f.textContent=H;H=mxUtils.getXml(e.documentElement);v.setCellStyles(mxConstants.STYLE_IMAGE,"data:image/svg+xml,"+(window.btoa?btoa(unescape(encodeURIComponent(H))):Base64.encode(H,!0)),k.getSelectionState().cells)}),"#ffffff",{install:function(H){},destroy:function(){}},null,null,null,F);a.appendChild(u);+StyleFormatPanel.prototype.addSvgRule=function(a,b,e,f,g,d,h,l,t){var k=this.editorUi,v=k.editor.graph;h.test(b.selectorText)&&(h=mxUtils.bind(this,function(u,y,z,E){var D=mxUtils.trim(u.style.getPropertyValue(y));if(""!=D&&"url("!=D.substring(0,4)){var G=D;"transparent"==G?G=mxConstants.NONE:(D=mxUtils.isLightDarkColor(G))&&E?E=!1:D||E||(G="light-dark("+G+", "+G+")");u=this.createColorOption(z+" "+u.selectorText,function(){return G},mxUtils.bind(this,function(H){g[d].style.setProperty(y,H==mxConstants.NONE?+"transparent":mxUtils.getLightDarkColor(H).cssText);H="";t&&mxUtils.isLightDarkColor(g[d].style[y])&&(e.documentElement.style.colorScheme="light dark");for(var M=0;M<g.length;M++)H+=g[M].cssText+" ";f.textContent=H;H=mxUtils.getXml(e.documentElement);v.setCellStyles(mxConstants.STYLE_IMAGE,"data:image/svg+xml,"+(window.btoa?btoa(unescape(encodeURIComponent(H))):Base64.encode(H,!0)),k.getSelectionState().cells)}),"#ffffff",{install:function(H){},destroy:function(){}},null,null,null,E);a.appendChild(u);a.style.display=""}}),h(b,"fill",mxResources.get("fill"),l),h(b,"stroke",mxResources.get("line"),l),h(b,"stop-color",mxResources.get("gradient"),l))};StyleFormatPanel.prototype.addEditOps=function(a){var b=this.editorUi.getSelectionState();if(1==b.cells.length){var e=document.createElement("select");e.style.position="relative";e.style.marginBottom="2px";e.className="geFullWidthElement";var f="edit copyAsText editLink editShape editImage editData copyData pasteData editConnectionPoints editGeometry editPolygon editTooltip editStyle".split(" "),g=null;if(null!=this.editorUi.sidebar){var d=this.editorUi.sidebar.getKeyStyle(b.cells[0].style);g=this.editorUi.sidebar.getLibsForStyle(d);null!=g||this.editorUi.sidebar.isSearchIndexLoaded()||null==b.style.shape||"mxgraph."!=String(b.style.shape).substring(0,8)||(g=[])}null!=g&&f.push("openLibrary");for(d=0;d<f.length;d++){var h=this.editorUi.actions.get(f[d]);if(null==h||h.enabled){var l=document.createElement("option");l.setAttribute("value",f[d]);var t=mxResources.get(f[d]);mxUtils.write(l,t);null!=h&&null!=h.shortcut&&(t+=" ("+h.shortcut+")");l.setAttribute("title",t);e.appendChild(l)}}1<e.children.length&&(a.appendChild(e),mxEvent.addListener(e,@@ -3295,9 +3300,9 @@ null!=f&&null!=mxUtils.getValue(f.style,mxConstants.STYLE_IMAGE,null)&&(f=mxUtilStyleFormatPanel.prototype.addFill=function(a){function b(){h.innerHTML="";z=1;for(var G=0;G<Editor.fillStyles.length;G++){var H=document.createElement("option");H.setAttribute("value",Editor.fillStyles[G].val);mxUtils.write(H,Editor.fillStyles[G].dispName);h.appendChild(H)}}var e=this.editorUi,f=e.editor.graph,g=e.getSelectionState(),d=document.createElement("select");d.setAttribute("title",mxResources.get("gradient"));d.style.position="absolute";d.style.left="76px";d.style.width="86px";var h=d.cloneNode(!1);h.setAttribute("title",mxResources.get("fill"));mxEvent.addListener(d,"click",function(G){mxEvent.consume(G)});mxEvent.addListener(h,"click",function(G){mxEvent.consume(G)});var l=this.createCellColorOption(mxResources.get("gradient"),mxConstants.STYLE_GRADIENTCOLOR,"default",function(G){d.style.display=null==G||G==mxConstants.NONE?"none":""},function(G){f.updateCellStyles({gradientColor:G},f.getSelectionCells())},f.getDefaultColor(g.style,mxConstants.STYLE_GRADIENTCOLOR,f.shapeForegroundColor,f.shapeBackgroundColor));l.style.fontWeight="bold";var t="image"==g.style.shape?mxConstants.STYLE_IMAGE_BACKGROUND:mxConstants.STYLE_FILLCOLOR,k=this.createCellColorOption(mxResources.get("fill"),t,"default",null,mxUtils.bind(this,function(G){f.setCellStyles(t,G,g.cells)}),f.getDefaultColor(g.style,t,f.shapeBackgroundColor,f.shapeForegroundColor));k.style.fontWeight="bold";var v=mxUtils.getValue(g.style,t,null);l.style.display=null!=v&&v!=mxConstants.NONE&&g.fill&&"image"!=g.style.shape?"":"none";var u=[mxConstants.DIRECTION_NORTH,-mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_RADIAL];for(v=0;v<u.length;v++){var y=document.createElement("option");y.setAttribute("value",u[v]);mxUtils.write(y,mxResources.get(u[v]));d.appendChild(y)}l.appendChild(d);var z;b();g.gradient&&k.appendChild(h);var F=mxUtils.bind(this,function(){g=e.getSelectionState();var G=mxUtils.getValue(g.style,mxConstants.STYLE_GRADIENT_DIRECTION,mxConstants.DIRECTION_SOUTH),H=mxUtils.getValue(g.style,"fillStyle",+mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_RADIAL];for(v=0;v<u.length;v++){var y=document.createElement("option");y.setAttribute("value",u[v]);mxUtils.write(y,mxResources.get(u[v]));d.appendChild(y)}l.appendChild(d);var z;b();g.gradient&&k.appendChild(h);var E=mxUtils.bind(this,function(){g=e.getSelectionState();var G=mxUtils.getValue(g.style,mxConstants.STYLE_GRADIENT_DIRECTION,mxConstants.DIRECTION_SOUTH),H=mxUtils.getValue(g.style,"fillStyle","auto");""==G&&(G=mxConstants.DIRECTION_SOUTH);d.value=G;a.style.display=g.fill?"":"none";G=mxUtils.getValue(g.style,t,null);if(g.fill&&null!=G&&G!=mxConstants.NONE&&"filledEdge"!=g.style.shape){if("1"==g.style.sketch){if(2!=z){h.innerHTML="";z=2;for(G=0;G<Editor.roughFillStyles.length;G++){var M=document.createElement("option");M.setAttribute("value",Editor.roughFillStyles[G].val);mxUtils.write(M,Editor.roughFillStyles[G].dispName);h.appendChild(M)}h.value="auto"}}else 1!=z&&b();h.value=H;h.value||-(H="auto",h.value=H);h.style.display="1"==g.style.sketch||"none"==d.style.display?"":"none";l.style.display=!g.gradient||g.containsImage||"1"==g.style.sketch&&"solid"!=H&&"auto"!=H?"none":""}else h.style.display="none",l.style.display="none"});f.getModel().addListener(mxEvent.CHANGE,F);this.listeners.push({destroy:function(){f.getModel().removeListener(F)}});F();mxEvent.addListener(d,"change",function(G){f.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,d.value,g.cells);e.fireEvent(new mxEventObject("styleChanged",+(H="auto",h.value=H);h.style.display="1"==g.style.sketch||"none"==d.style.display?"":"none";l.style.display=!g.gradient||g.containsImage||"1"==g.style.sketch&&"solid"!=H&&"auto"!=H?"none":""}else h.style.display="none",l.style.display="none"});f.getModel().addListener(mxEvent.CHANGE,E);this.listeners.push({destroy:function(){f.getModel().removeListener(E)}});E();mxEvent.addListener(d,"change",function(G){f.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,d.value,g.cells);e.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_GRADIENT_DIRECTION],"values",[d.value],"cells",g.cells));mxEvent.consume(G)});mxEvent.addListener(h,"change",function(G){f.setCellStyles("fillStyle",h.value,g.cells);e.fireEvent(new mxEventObject("styleChanged","keys",["fillStyle"],"values",[h.value],"cells",g.cells));mxEvent.consume(G)});a.appendChild(k);a.appendChild(l);var D={};k=this.getCustomColors();for(v=0;v<k.length;v++)D[k[v].key]||(D[k[v].key]=!0,a.appendChild(this.createCellColorOption(k[v].title,k[v].key,k[v].defaultValue,null,null,k[v].defaultColorValue,k[v].undefinedColor,!0)));k=mxUtils.bind(this,function(G,H,M){if(null!=G){G=G.split(",");H=null!=H?H.split(","):null;for(var N=0;N<G.length;N++)if(!D[G[N]]){D[G[N]]=!0;var L=null!=H?H[mxUtils.mod(N,H.length)]:null,U=null!=L?L:"default";a.appendChild(this.createCellColorOption(Editor.getLabelForStylename(G[N]),G[N],U,null,null,M,L,!0))}}});k(g.style.fillColorStyles,g.style.defaultFillColors,f.shapeBackgroundColor);k(g.style.strokeColorStyles,g.style.defaultStrokeColors,f.shapeForegroundColor);return a};@@ -3309,15 +3314,15 @@ mxConstants.STYLE_STROKEWIDTH,1)&&(h.setCellStyles(mxConstants.STYLE_STROKEWIDTH"keys",[mxConstants.STYLE_STROKEWIDTH],"values",[qa],"cells",l.cells)));U.value=g.inUnit(qa)+" "+g.getUnit();mxEvent.consume(O)}var g=this,d=this.editorUi,h=d.editor.graph,l=d.getSelectionState(),t=document.createElement("div");t.className="geFormatEntry";l.stroke||(t.style.display="none");var k=document.createElement("select");k.setAttribute("title",mxResources.get("style"));k.style.position="absolute";k.style.left="72px";k.style.width="90px";for(var v=["sharp","rounded","curved"],u=0;u<v.length;u++){var y=document.createElement("option");y.setAttribute("value",v[u]);mxUtils.write(y,mxResources.get(v[u]));k.appendChild(y)}mxEvent.addListener(k,"change",function(O){h.getModel().beginUpdate();try{var qa=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],ja=["0","0"];"rounded"==k.value?ja=["1","0"]:"curved"==k.value&&(ja=["0","1"]);for(var ua=0;ua<qa.length;ua++)h.setCellStyles(qa[ua],ja[ua],l.cells);d.fireEvent(new mxEventObject("styleChanged","keys",qa,"values",ja,"cells",l.cells))}finally{h.getModel().endUpdate()}mxEvent.consume(O)});mxEvent.addListener(k,"click",function(O){mxEvent.consume(O)});var z="image"==l.style.shape?mxConstants.STYLE_IMAGE_BORDER:mxConstants.STYLE_STROKECOLOR;v="image"==l.style.shape?mxResources.get("border"):mxResources.get("line");u=this.createCellColorOption(v,z,"default",null,mxUtils.bind(this,function(O){h.setCellStyles(z,O,l.cells);if(null==O||O==mxConstants.NONE){O=[];for(var qa=0;qa<l.cells.length;qa++)(h.isTableCell(l.cells[qa])||h.isTableRow(l.cells[qa]))&&O.push(l.cells[qa]);0<O.length&&h.setCellStyles(z,-"inherit",O)}}),h.shapeForegroundColor);u.style.fontWeight="bold";u.appendChild(k);var F=t.cloneNode(!1);F.style.position="relative";var D=mxUtils.bind(this,function(O,qa,ja,ua,ya){O=this.editorUi.menus.styleChange(O,"",ua,ya,"");ua=document.createElement("div");this.addDashPattern(ua,ja);O.firstChild.firstChild.className="geStyleMenuItem";O.firstChild.firstChild.style.width=qa+"px";O.firstChild.firstChild.appendChild(ua);return O}),G=[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],H=d.toolbar.addMenu(new Menu(mxUtils.bind(this,+"inherit",O)}}),h.shapeForegroundColor);u.style.fontWeight="bold";u.appendChild(k);var E=t.cloneNode(!1);E.style.position="relative";var D=mxUtils.bind(this,function(O,qa,ja,ua,ya){O=this.editorUi.menus.styleChange(O,"",ua,ya,"");ua=document.createElement("div");this.addDashPattern(ua,ja);O.firstChild.firstChild.className="geStyleMenuItem";O.firstChild.firstChild.style.width=qa+"px";O.firstChild.firstChild.appendChild(ua);return O}),G=[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],H=d.toolbar.addMenu(new Menu(mxUtils.bind(this,function(O){D(O,110,"solid",G,[null,null]).setAttribute("title",mxResources.get("solid"));D(O,110,"dashed",G,["1",null]).setAttribute("title",mxResources.get("dashed")+" (1)");D(O,110,"8 8",G,["1","8 8"]).setAttribute("title",mxResources.get("dashed")+" (2)");D(O,110,"12 12",G,["1","12 12"]).setAttribute("title",mxResources.get("dashed")+" (3)");D(O,110,"8 4 1 4",G,["1","8 4 1 4"]).setAttribute("title",mxResources.get("dashed")+" (4)");D(O,110,"dotted",G,["1","1 1"]).setAttribute("title",mxResources.get("dotted")+-" (1)");D(O,110,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");D(O,110,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");O.addItem("",null,mxUtils.bind(this,function(){d.prompt(mxResources.get("pattern"),mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(qa){d.menus.createStyleChangeFunction(G,["1",qa])()}),!0)})).firstChild.appendChild(b(110))})),"",null,F),M=F.cloneNode(!1),N=d.toolbar.addMenu(new Menu(mxUtils.bind(this,+" (1)");D(O,110,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");D(O,110,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");O.addItem("",null,mxUtils.bind(this,function(){d.prompt(mxResources.get("pattern"),mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(qa){d.menus.createStyleChangeFunction(G,["1",qa])()}),!0)})).firstChild.appendChild(b(110))})),"",null,E),M=E.cloneNode(!1),N=d.toolbar.addMenu(new Menu(mxUtils.bind(this,function(O){var qa=[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,mxConstants.STYLE_DASHED,"width"];Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,[null,null,null,null,null],"",null,null,null,!0,Format.connectionImage.src)).setAttribute("title",mxResources.get("line"));Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["link",null,null,null,null],"",null,null,null,!0,Format.linkEdgeImage.src)).setAttribute("title",mxResources.get("link"));Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["flexArrow",null,null,null,null],"",null,null,null,!0,Format.arrowImage.src)).setAttribute("title",mxResources.get("arrow"));Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["arrow",null,null,null,null],"",null,null,null,!0,Format.simpleArrowImage.src)).setAttribute("title",mxResources.get("simpleArrow"));Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["filledEdge",null,null,null,null],"",null,null,null,!0,Format.filledEdgeImage.src)).setAttribute("title","Filled Edge");Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["pipe",null,null,null,null],"",null,null,null,!0,Format.pipeEdgeImage.src)).setAttribute("title","Pipe");Format.processMenuIcon(this.editorUi.menus.styleChange(O,"",qa,["wire",null,null,"1",null],"",null,null,null,!0,Format.wireEdgeImage.src)).setAttribute("title","Wire")})),"",null,M);N.setAttribute("title",mxResources.get("connection"));y=d.toolbar.addMenu(new Menu(mxUtils.bind(this,function(O){D(O,44,"solid",G,[null,null]).setAttribute("title",mxResources.get("solid"));D(O,44,"dashed",G,["1",null]).setAttribute("title",mxResources.get("dashed")+" (1)");D(O,44,"8 8",G,["1","8 8"]).setAttribute("title",mxResources.get("dashed")+" (2)");D(O,44,"12 12",G,["1","12 12"]).setAttribute("title",mxResources.get("dashed")+" (3)");D(O,44,"8 4 1 4",G,["1","8 4 1 4"]).setAttribute("title",mxResources.get("dashed")+" (4)");D(O,44,"dotted",G,["1","1 1"]).setAttribute("title",mxResources.get("dotted")+-" (1)");D(O,44,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");D(O,44,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");O.addItem("",null,mxUtils.bind(this,function(){d.prompt(mxResources.get("pattern"),mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(qa){d.menus.createStyleChangeFunction(G,["1",qa])()}),!0)})).firstChild.appendChild(b(44))})),"",null,M);v=F.cloneNode(!1);var L=document.createElement("input");-L.style.position="absolute";L.style.width="52px";L.style.left="148px";L.setAttribute("title",mxResources.get("linewidth"));F.appendChild(L);var U=L.cloneNode(!0);U.style.width="56px";U.style.left="144px";M.appendChild(U);var X=this.createStepper(L,e,this.getUnitStep(),null,null,this.isFloatUnit());X.style.display=L.style.display;F.appendChild(X);X=this.createStepper(U,f,this.getUnitStep(),null,null,this.isFloatUnit());X.style.display=U.style.display;M.appendChild(X);mxEvent.addListener(L,"blur",e);+" (1)");D(O,44,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");D(O,44,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");O.addItem("",null,mxUtils.bind(this,function(){d.prompt(mxResources.get("pattern"),mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(qa){d.menus.createStyleChangeFunction(G,["1",qa])()}),!0)})).firstChild.appendChild(b(44))})),"",null,M);v=E.cloneNode(!1);var L=document.createElement("input");+L.style.position="absolute";L.style.width="52px";L.style.left="148px";L.setAttribute("title",mxResources.get("linewidth"));E.appendChild(L);var U=L.cloneNode(!0);U.style.width="56px";U.style.left="144px";M.appendChild(U);var X=this.createStepper(L,e,this.getUnitStep(),null,null,this.isFloatUnit());X.style.display=L.style.display;E.appendChild(X);X=this.createStepper(U,f,this.getUnitStep(),null,null,this.isFloatUnit());X.style.display=U.style.display;M.appendChild(X);mxEvent.addListener(L,"blur",e);mxEvent.addListener(L,"change",e);mxEvent.addListener(U,"blur",f);mxEvent.addListener(U,"change",f);var S=d.toolbar.addMenu(new Menu(mxUtils.bind(this,function(O){"arrow"!=l.style.shape&&(Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],[null,null,null],null,null,!0,Format.straightImage.src)).setAttribute("title",mxResources.get("straight")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["orthogonalEdgeStyle",null,null],null,null,!0,Format.orthogonalImage.src)).setAttribute("title",mxResources.get("orthogonal")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle","vertical",null,null],null,null,!0,Format.verticalElbowImage.src)).setAttribute("title",mxResources.get("horizontal")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle",null,null,null],null,null,!0,Format.horizontalElbowImage.src)).setAttribute("title",mxResources.get("vertical")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["isometricEdgeStyle",null,null,null],@@ -3354,7 +3359,7 @@ null,null,!1,d.getImageForMarker(qa,ja,l.style.shape,l.style.shape)),"scaleX(-1)!1,Format.ERzeroToOneMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERzeroToMany",0],null,null,!1,Format.ERzeroToManyMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_ENDARROW,"endFill"],["doubleBlock",0],null,null,!1,Format.doubleBlockMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_ENDARROW,"endFill"],["doubleBlock",1],null,null,!1,Format.doubleBlockFilledMarkerImage.src),"scaleX(-1)")):Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(O,"",[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,null,!1,Format.blockMarkerImage.src),"scaleX(-1)").setAttribute("title",mxResources.get("block"));O.div.style.width="40px";window.setTimeout(mxUtils.bind(this,function(){null!=O.div&&mxUtils.fit(O.div)}),0)}})),"",null,v);N.style.width="67px";N.style.marginRight="2px";y.style.width="67px";y.style.marginRight="2px";S.style.width="67px";S.style.marginRight="2px";V.style.width="67px";V.style.marginRight="2px";ha.style.width="67px";ha.style.marginRight="2px";this.addArrow(N).appendChild(document.createElement("div"));this.addArrow(S).appendChild(document.createElement("div"));this.addArrow(V);this.addArrow(ha);H.style.width="142px";H=this.addArrow(H);y=this.addArrow(y);var R=document.createElement("div");R.className="gePatternPreview";R.style.width="100px";R.style.borderBottomStyle=-"solid";H.appendChild(R);var Z=document.createElement("div");Z.className="gePatternPreview";Z.style.width="36px";Z.style.borderBottomStyle="solid";y.appendChild(Z);a.appendChild(u);a.appendChild(M);a.appendChild(F);u=F.cloneNode(!1);u.style.display="block";u.style.height="60px";u.style.paddingTop="2px";u.style.overflow="visible";y=document.createElement("div");y.style.position="absolute";y.style.maxWidth="78px";y.style.overflow="hidden";y.style.textOverflow="ellipsis";y.style.marginTop="4px";y.style.fontWeight=+"solid";H.appendChild(R);var Z=document.createElement("div");Z.className="gePatternPreview";Z.style.width="36px";Z.style.borderBottomStyle="solid";y.appendChild(Z);a.appendChild(u);a.appendChild(M);a.appendChild(E);u=E.cloneNode(!1);u.style.display="block";u.style.height="60px";u.style.paddingTop="2px";u.style.overflow="visible";y=document.createElement("div");y.style.position="absolute";y.style.maxWidth="78px";y.style.overflow="hidden";y.style.textOverflow="ellipsis";y.style.marginTop="4px";y.style.fontWeight="normal";mxUtils.write(y,mxResources.get("size"));y.setAttribute("title",mxResources.get("size"));u.appendChild(y);var W=this.addUnitInput(u,this.getUnit(),82,52,function(){oa.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());W.setAttribute("title",mxResources.get("linestart"));var ba=this.addUnitInput(u,this.getUnit(),16,52,function(){da.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());ba.setAttribute("title",mxResources.get("lineend"));mxUtils.br(u);H=document.createElement("div");H.style.height="8px";u.appendChild(H);y=X=y.cloneNode(!1);mxUtils.write(y,mxResources.get("spacing"));y.setAttribute("title",mxResources.get("spacing"));u.appendChild(y);var K=this.addUnitInput(u,this.getUnit(),82,52,function(){pa.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());K.setAttribute("title",mxResources.get("linestart"));var T=this.addUnitInput(u,this.getUnit(),16,52,function(){ia.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());T.setAttribute("title",mxResources.get("lineend"));mxUtils.br(u);this.addLabel(u,mxResources.get("linestart"),82,62).style.fontSize="10px";this.addLabel(u,mxResources.get("lineend"),16,62).style.fontSize="10px";mxUtils.br(u);t=t.cloneNode(!1);t.className="geFormatEntry";y=document.createElement("div");mxUtils.write(y,mxResources.get("perimeter"));y.setAttribute("title",mxResources.get("perimeter"));t.appendChild(y);var aa=this.addUnitInput(t,this.getUnit(),16,52,function(){fa.apply(this,@@ -3362,7 +3367,7 @@ arguments)},this.getUnitStep(),null,null,this.isFloatUnit());aa.setAttribute("timxUtils.bind(this,function(O,qa,ja){function ua(ya,Ma,Oa,Ka){Oa=Oa.getElementsByTagName("div")[0];null!=Oa&&d.updateCssForMarker(Oa,Ka,l.style.shape,ya,Ma);return Oa}l=d.getSelectionState();if(ja||document.activeElement!=L)O=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)),L.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=U)O=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)),U.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();k.style.visibility="connector"==l.style.shape||"filledEdge"==l.style.shape||"wire"==l.style.shape||"pipe"==l.style.shape?"":"hidden";"1"==mxUtils.getValue(l.style,mxConstants.STYLE_CURVED,null)?k.value="curved":"1"==mxUtils.getValue(l.style,mxConstants.STYLE_ROUNDED,null)&&(k.value="rounded");R.style.borderBottom="1px solid black";"1"==mxUtils.getValue(l.style,mxConstants.STYLE_DASHED,null)&&(O=mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,""),2<=String(O).split(" ").length?(R.style.borderBottom="1px solid transparent",this.addDashPattern(R,O)):R.style.borderBottom="1px dashed black");Z.style.backgroundImage=R.style.backgroundImage;Z.style.backgroundPosition=R.style.backgroundPosition;Z.style.backgroundSize=R.style.backgroundSize;Z.style.backgroundRepeat=R.style.backgroundRepeat;Z.style.borderBottom=R.style.borderBottom;O=S.getElementsByTagName("div")[1];null!=O&&(O.style.backgroundImage="url("+d.getImageForEdgeStyle(l.style)+")");O=N.getElementsByTagName("div")[1];null!=O&&(O.style.backgroundImage=-"url("+d.getImageForEdgeShape(l.style)+")");l.edges.length==l.cells.length?(M.style.display="",F.style.display="none"):(M.style.display="none",F.style.display="");Graph.lineJumpsEnabled&&0<l.edges.length&&0==l.vertices.length&&l.lineJumps&&(a.style.borderBottomStyle="none");ua(mxUtils.getValue(l.style,mxConstants.STYLE_STARTARROW,null),mxUtils.getValue(l.style,"startFill","1"),V,"start");ua(mxUtils.getValue(l.style,mxConstants.STYLE_ENDARROW,null),mxUtils.getValue(l.style,"endFill","1"),ha,"end");+"url("+d.getImageForEdgeShape(l.style)+")");l.edges.length==l.cells.length?(M.style.display="",E.style.display="none"):(M.style.display="none",E.style.display="");Graph.lineJumpsEnabled&&0<l.edges.length&&0==l.vertices.length&&l.lineJumps&&(a.style.borderBottomStyle="none");ua(mxUtils.getValue(l.style,mxConstants.STYLE_STARTARROW,null),mxUtils.getValue(l.style,"startFill","1"),V,"start");ua(mxUtils.getValue(l.style,mxConstants.STYLE_ENDARROW,null),mxUtils.getValue(l.style,"endFill","1"),ha,"end");mxUtils.setOpacity(S,"arrow"==l.style.shape?30:100);"connector"!=l.style.shape&&"flexArrow"!=l.style.shape&&"filledEdge"!=l.style.shape&&"wire"!=l.style.shape&&"pipe"!=l.style.shape&&"mxgraph.basic.arc"!=l.style.shape&&(mxUtils.setOpacity(V,30),mxUtils.setOpacity(ha,30));if(ja||document.activeElement!=W)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)),W.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=K)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0)),K.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=ba)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE)),ba.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=K)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING,0)),T.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit();if(ja||document.activeElement!=aa)O=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_PERIMETER_SPACING,0)),aa.value=isNaN(O)?"":this.inUnit(O)+" "+this.getUnit()});var oa=this.installInputHandler(W,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var pa=this.installInputHandler(K,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var da=this.installInputHandler(ba,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999,this.getUnit(" "),null,this.isFloatUnit(),@@ -3373,7 +3378,7 @@ var d=document.createElement("select");d.setAttribute("title",mxResources.get("l"values",[d.value],"cells",f.cells))}finally{e.getModel().endUpdate()}mxEvent.consume(u)});mxEvent.addListener(d,"click",function(u){mxEvent.consume(u)});a.appendChild(d);var t=this.addUnitInput(a,this.getUnit(),16,52,function(){k.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());t.setAttribute("title",mxResources.get("size"));var k=this.installInputHandler(t,"jumpSize",Graph.defaultJumpSize,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var v=mxUtils.bind(this,function(u,y,z){f=b.getSelectionState();d.value=mxUtils.getValue(f.style,"jumpStyle","none");if(z||document.activeElement!=t)u=parseInt(mxUtils.getValue(f.style,"jumpSize",Graph.defaultJumpSize)),t.value=isNaN(u)?"":this.inUnit(u)+" "+this.getUnit()});this.addKeyHandler(t,v);e.getModel().addListener(mxEvent.CHANGE,v);this.listeners.push({destroy:function(){e.getModel().removeListener(v)}});v()}else a.style.display="none";return a};StyleFormatPanel.prototype.addEffects=function(a){var b=this.editorUi,e=b.editor.graph,f=b.getSelectionState(),g=document.createElement("table");g.className="geFullWidthElement";g.style.fontWeight="bold";g.style.tableLayout="fixed";var d=document.createElement("tbody"),h=document.createElement("tr");h.style.padding="0px";var l=document.createElement("td");l.style.padding="0px";l.style.width="50%";l.style.verticalAlign="top";var t=l.cloneNode(!0);t.style.paddingLeft="8px";h.appendChild(l);h.appendChild(t);-d.appendChild(h);g.appendChild(d);a.appendChild(g);var k=l,v=mxUtils.bind(this,function(y,z,F,D){y=this.createCellOption(y,z,F,null,null,D);y.style.alignItems="top";k.appendChild(y);k=k==l?t:l;return y}),u=mxUtils.bind(this,function(y,z,F){f=b.getSelectionState();l.innerText="";t.innerText="";k=l;f.rounded&&v(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);f.swimlane&&v(mxResources.get("divider"),"swimlaneLine",1);v(mxResources.get("sketch"),"sketch",0,function(G,H){e.updateCellStyles({sketch:H?+d.appendChild(h);g.appendChild(d);a.appendChild(g);var k=l,v=mxUtils.bind(this,function(y,z,E,D){y=this.createCellOption(y,z,E,null,null,D);y.style.alignItems="top";k.appendChild(y);k=k==l?t:l;return y}),u=mxUtils.bind(this,function(y,z,E){f=b.getSelectionState();l.innerText="";t.innerText="";k=l;f.rounded&&v(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);f.swimlane&&v(mxResources.get("divider"),"swimlaneLine",1);v(mxResources.get("sketch"),"sketch",0,function(G,H){e.updateCellStyles({sketch:H?"1":null,curveFitting:H?Editor.sketchDefaultCurveFitting:null,jiggle:H?Editor.sketchDefaultJiggle:null},G)});f.glass&&v(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);y=v(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0);Editor.enableShadowOption||(y.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(y,60));0<f.edges.length&&0==f.vertices.length&&v(mxResources.get("flowAnimation",null,"Flow Animation"),"flowAnimation",0);if(null!=f.customProperties)for(var D in f.customProperties)y=f.customProperties[D],null!=y&&"bool"==y.type&&y.primary&&("function"!==typeof y.isVisible||y.isVisible(f,this))&&v(y.dispName,D,y.defVal?"1":"0")});e.getModel().addListener(mxEvent.CHANGE,u);this.listeners.push({destroy:function(){e.getModel().removeListener(u)}});u();return a};StyleFormatPanel.prototype.addStyleOps=function(a){1==this.editorUi.getSelectionState().cells.length&&this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(DiagramStylePanel,BaseFormatPanel);DiagramStylePanel.prototype.init=function(){this.container.appendChild(this.addView(this.createPanel()))};@@ -3395,9 +3400,9 @@ R!=mxConstants.STYLE_STROKECOLOR)t&&f.isEdge(S)&&R==mxConstants.STYLE_FONTCOLOR?u=document.createElement("div");u.style.whiteSpace="normal";a.appendChild(u);null==this.format.cachedStyleEntries&&(this.format.cachedStyleEntries=[]);var y=mxUtils.bind(this,function(U,X,S,V,ha){var R=this.format.cachedStyleEntries[ha];null==R&&(R=document.createElement("div"),R.className="geGraphStylePreview",t||null==V||null==V.background||(R.style.backgroundColor=V.background),v(U,X,S,V,R),mxEvent.addGestureListeners(R,mxUtils.bind(this,function(Z){R.style.opacity=.6}),null,mxUtils.bind(this,function(Z){R.style.opacity="";e.currentVertexStyle=mxUtils.clone(e.defaultVertexStyle);e.currentEdgeStyle=mxUtils.clone(e.defaultEdgeStyle);k(U,e.currentVertexStyle);k(U,e.currentEdgeStyle);k(X,e.currentVertexStyle);k(S,e.currentEdgeStyle);f.beginUpdate();try{var W=d.slice(),ba;for(ba in U)W.push(ba);h(W,V);if(!t){var K=new ChangePageSetup(b,null!=V?V.background:null);K.ignoreImage=!0;f.execute(K);f.execute(new ChangeGridColor(b,null!=V&&null!=V.gridColor?V.gridColor:g))}}finally{f.endUpdate()}})),mxClient.IS_TOUCH||(mxEvent.addListener(R,"mouseenter",mxUtils.bind(this,function(Z){var W=e.getCellStyle;Z=e.background;var ba=e.view.gridColor;t||(e.background=null!=V?V.background:null,e.view.gridColor=null!=V&&null!=V.gridColor?V.gridColor:g);e.getCellStyle=function(K,T){T=null!=T?T:!0;var aa=mxUtils.clone(W.apply(this,arguments)),ka=e.stylesheet.getDefaultVertexStyle(),oa=X;f.isEdge(K)&&(ka=e.stylesheet.getDefaultEdgeStyle(),oa=S);l(aa,d,ka);k(U,aa,K,V);k(oa,aa,K,V);T&&(aa=this.postProcessCellStyle(K,-aa));return aa};e.refresh();e.getCellStyle=W;e.background=Z;e.view.gridColor=ba})),mxEvent.addListener(R,"mouseleave",mxUtils.bind(this,function(Z){e.refresh()}))),this.format.cachedStyleEntries[ha]=R);u.appendChild(R)}),z=Math.ceil(Editor.styles.length/10);this.format.currentStylePage=null!=this.format.currentStylePage?this.format.currentStylePage:0;var F=[],D=mxUtils.bind(this,function(){0<F.length&&(F[this.format.currentStylePage].style.background="#84d7ff");for(var U=10*this.format.currentStylePage;U<-Math.min(10*(this.format.currentStylePage+1),Editor.styles.length);U++){var X=Editor.styles[U];y(X.commonStyle,X.vertexStyle,X.edgeStyle,X.graph,U)}}),G=mxUtils.bind(this,function(U){0<=U&&U<z&&(F[this.format.currentStylePage].style.background="transparent",u.innerText="",this.format.currentStylePage=U,D())});if(1<z){var H=document.createElement("div");H.className="geSwitcher";H.style.width="200px";for(var M=0;M<z;M++){var N=document.createElement("div");N.className="geSwitcherDot";mxUtils.bind(this,-function(U,X){mxEvent.addListener(N,"click",mxUtils.bind(this,function(){G(U)}))})(M,N);H.appendChild(N);F.push(N)}a.appendChild(H);D();if(15>z&&0<F.length){M=document.createElement("div");M.className="geButton";M.style.backgroundImage="url("+Editor.chevronLeftImage+")";var L=M.cloneNode(!1);L.style.backgroundImage="url("+Editor.chevronRightImage+")";H.insertBefore(M,F[0]);H.appendChild(L);mxEvent.addListener(M,"click",mxUtils.bind(this,function(){G(mxUtils.mod(this.format.currentStylePage-1,z))}));+aa));return aa};e.refresh();e.getCellStyle=W;e.background=Z;e.view.gridColor=ba})),mxEvent.addListener(R,"mouseleave",mxUtils.bind(this,function(Z){e.refresh()}))),this.format.cachedStyleEntries[ha]=R);u.appendChild(R)}),z=Math.ceil(Editor.styles.length/10);this.format.currentStylePage=null!=this.format.currentStylePage?this.format.currentStylePage:0;var E=[],D=mxUtils.bind(this,function(){0<E.length&&(E[this.format.currentStylePage].style.background="#84d7ff");for(var U=10*this.format.currentStylePage;U<+Math.min(10*(this.format.currentStylePage+1),Editor.styles.length);U++){var X=Editor.styles[U];y(X.commonStyle,X.vertexStyle,X.edgeStyle,X.graph,U)}}),G=mxUtils.bind(this,function(U){0<=U&&U<z&&(E[this.format.currentStylePage].style.background="transparent",u.innerText="",this.format.currentStylePage=U,D())});if(1<z){var H=document.createElement("div");H.className="geSwitcher";H.style.width="200px";for(var M=0;M<z;M++){var N=document.createElement("div");N.className="geSwitcherDot";mxUtils.bind(this,+function(U,X){mxEvent.addListener(N,"click",mxUtils.bind(this,function(){G(U)}))})(M,N);H.appendChild(N);E.push(N)}a.appendChild(H);D();if(15>z&&0<E.length){M=document.createElement("div");M.className="geButton";M.style.backgroundImage="url("+Editor.chevronLeftImage+")";var L=M.cloneNode(!1);L.style.backgroundImage="url("+Editor.chevronRightImage+")";H.insertBefore(M,E[0]);H.appendChild(L);mxEvent.addListener(M,"click",mxUtils.bind(this,function(){G(mxUtils.mod(this.format.currentStylePage-1,z))}));mxEvent.addListener(L,"click",mxUtils.bind(this,function(){G(mxUtils.mod(this.format.currentStylePage+1,z))}))}}else D();return a};DiagramFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(DiagramFormatPanel,BaseFormatPanel);DiagramFormatPanel.showPageView=!0;DiagramFormatPanel.prototype.showBackgroundImageOption=!0;DiagramFormatPanel.prototype.init=function(){var a=this.editorUi.editor.graph;this.container.appendChild(this.addView(this.createPanel()));a.isEnabled()&&(this.container.appendChild(this.addOptions(this.createPanel())),this.container.appendChild(this.addPaperSize(this.createPanel())),this.container.appendChild(this.addStyleOps(this.createPanel())))};DiagramFormatPanel.prototype.addView=function(a){var b=this.editorUi,e=b.editor.graph;a.appendChild(this.createTitle(mxResources.get("view")));this.addGridOption(a);DiagramFormatPanel.showPageView&&a.appendChild(this.createOption(mxResources.get("pageView"),function(){return e.pageVisible},function(d){b.actions.get("pageView").funct()},{install:function(d){this.listener=function(){d(e.pageVisible)};b.addListener("pageViewChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}}));@@ -3416,12 +3421,12 @@ DiagramFormatPanel.prototype.addDocumentProperties=function(a){a.appendChild(thiDiagramFormatPanel.prototype.addPaperSize=function(a){var b=this.editorUi,e=b.editor.graph;a.appendChild(this.createTitle(mxResources.get("paperSize")));var f=PageSetupDialog.addPageFormatPanel(a,"formatpanel",e.pageFormat,function(d){if(null==e.pageFormat||e.pageFormat.width!=d.width||e.pageFormat.height!=d.height)d=new ChangePageSetup(b,null,null,d),d.ignoreColor=!0,d.ignoreImage=!0,e.model.execute(d)});this.addKeyHandler(f.widthInput,function(){f.set(e.pageFormat)});this.addKeyHandler(f.heightInput,function(){f.set(e.pageFormat)});var g=function(){f.set(e.pageFormat)};b.addListener("pageFormatChanged",g);this.listeners.push({destroy:function(){b.removeListener(g)}});e.getModel().addListener(mxEvent.CHANGE,g);this.listeners.push({destroy:function(){e.getModel().removeListener(g)}});return a};DiagramFormatPanel.prototype.addStyleOps=function(a){this.addActions(a,["editData"]);this.addActions(a,["clearDefaultStyle"]);return a};DiagramFormatPanel.prototype.destroy=function(){BaseFormatPanel.prototype.destroy.apply(this,arguments);this.gridEnabledListener&&(this.editorUi.removeListener(this.gridEnabledListener),this.gridEnabledListener=null)};(function(){function a(c,m,p){mxShape.call(this);this.line=c;this.stroke=m;this.strokewidth=null!=p?p:1;this.updateBoundsFromLine()}function b(){mxSwimlane.call(this)}function e(){mxSwimlane.call(this)}function f(){mxCylinder.call(this)}function g(){mxConnector.call(this)}function d(){mxCylinder.call(this)}function h(){mxActor.call(this)}function l(){mxCylinder.call(this)}function t(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function v(){mxCylinder.call(this)}function u(){mxShape.call(this)}-function y(){mxShape.call(this)}function z(c,m,p,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=p;this.strokewidth=null!=n?n:1}function F(){mxActor.call(this)}function D(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function H(){mxActor.call(this)}function M(){mxActor.call(this)}function N(){mxActor.call(this)}function L(){mxActor.call(this)}function U(){mxActor.call(this)}function X(){mxActor.call(this)}function S(){mxActor.call(this)}function V(c,m){this.canvas=c;this.canvas.setLineJoin("round");+function y(){mxShape.call(this)}function z(c,m,p,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=p;this.strokewidth=null!=n?n:1}function E(){mxActor.call(this)}function D(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function H(){mxActor.call(this)}function M(){mxActor.call(this)}function N(){mxActor.call(this)}function L(){mxActor.call(this)}function U(){mxActor.call(this)}function X(){mxActor.call(this)}function S(){mxActor.call(this)}function V(c,m){this.canvas=c;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=m;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,V.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,V.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,V.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,V.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,V.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,V.prototype.arcTo)}function ha(){mxRectangleShape.call(this)}function R(){mxRectangleShape.call(this)}function Z(){mxActor.call(this)}function W(){mxActor.call(this)}function ba(){mxActor.call(this)}function K(){mxRectangleShape.call(this)}function T(){mxRectangleShape.call(this)}function aa(){mxCylinder.call(this)}function ka(){mxShape.call(this)}function oa(){mxShape.call(this)}function pa(){mxEllipse.call(this)}function da(){mxShape.call(this)}function ia(){mxShape.call(this)}function fa(){mxRectangleShape.call(this)}function O(){mxShape.call(this)}function qa(){mxShape.call(this)}function ja(){mxShape.call(this)}function ua(){mxShape.call(this)}function ya(){mxShape.call(this)}function Ma(){mxCylinder.call(this)}function Oa(){mxCylinder.call(this)}function Ka(){mxRectangleShape.call(this)}function La(){mxDoubleEllipse.call(this)}function wa(){mxDoubleEllipse.call(this)}function Ia(){mxArrowConnector.call(this);this.spacing=0}function $a(){mxArrowConnector.call(this);this.spacing=0}function ab(){mxActor.call(this)}function eb(){mxRectangleShape.call(this)}function ib(){mxActor.call(this)}function rb(){mxActor.call(this)}function jb(){mxActor.call(this)}function db(){mxActor.call(this)}function kb(){mxActor.call(this)}function hb(){mxActor.call(this)}function la(){mxActor.call(this)}function Ea(){mxActor.call(this)}function za(){mxActor.call(this)}function Va(){mxActor.call(this)}function Ta(){mxEllipse.call(this)}-function q(){mxEllipse.call(this)}function B(){mxEllipse.call(this)}function C(){mxRhombus.call(this)}function E(){mxEllipse.call(this)}function J(){mxEllipse.call(this)}function P(){mxEllipse.call(this)}function Y(){mxEllipse.call(this)}function ma(){mxActor.call(this)}function ca(){mxActor.call(this)}function na(){mxActor.call(this)}function ta(c,m,p,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=p;this.strokewidth=null!=n?n:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=+function q(){mxEllipse.call(this)}function B(){mxEllipse.call(this)}function C(){mxRhombus.call(this)}function F(){mxEllipse.call(this)}function J(){mxEllipse.call(this)}function P(){mxEllipse.call(this)}function Y(){mxEllipse.call(this)}function ma(){mxActor.call(this)}function ca(){mxActor.call(this)}function na(){mxActor.call(this)}function ta(c,m,p,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=p;this.strokewidth=null!=n?n:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Fa(){mxConnector.call(this)}function Da(){mxConnector.call(this)}function Na(){mxActor.call(this)}function Ra(c,m,p,n,r,w,x,I,A,ea){x+=A;var Q=n.clone();n.x-=r*(2*x+A);n.y-=w*(2*x+A);r*=x+A;w*=x+A;return function(){c.ellipse(Q.x-r-x,Q.y-w-x,2*x,2*x);ea?c.fillAndStroke():c.stroke()}}mxUtils.extend(a,mxShape);a.prototype.updateBoundsFromLine=function(){var c=null;if(null!=this.line)for(var m=0;m<this.line.length;m++){var p=this.line[m];null!=p&&(p=new mxRectangle(p.x,p.y,this.strokewidth,this.strokewidth),null==c?c=p:c.add(p))}this.bounds=null!=c?c:new mxRectangle};a.prototype.paintVertexShape=function(c,m,p,n,r){this.paintTableLine(c,this.line,0,0)};a.prototype.paintTableLine=function(c,m,p,n){if(null!=m){var r=null;c.begin();for(var w=0;w<m.length;w++){var x=m[w];null!=x&&(null==r?c.moveTo(x.x+p,x.y+n):null!=r&&c.lineTo(x.x+p,x.y+n));r=x}c.end();c.stroke()}};a.prototype.intersectsRectangle=function(c){var m=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var p=null,n=0;n<this.line.length&&!m;n++){var r=this.line[n];null!=r&&null!=p&&(m=mxUtils.rectangleIntersectsSegment(c,p,r));p=r}return m};mxCellRenderer.registerShape("tableLine",a);mxUtils.extend(b,mxSwimlane);b.prototype.getLabelBounds=function(c){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};b.prototype.paintVertexShape=function(c,m,p,n,r){var w=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):@@ -3440,7 +3445,7 @@ c.begin(),c.moveTo(n-w,0),c.lineTo(n-w,w),c.lineTo(n,w),c.close(),c.fill()),c.be15;u.prototype.paintVertexShape=function(c,m,p,n,r){var w=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;w=Math.min(n*Math.tan(w),.5*r);c.translate(m,p);c.begin();c.moveTo(.5*n,0);c.lineTo(n,w);c.lineTo(n,r-w);c.lineTo(.5*n,r);c.lineTo(0,r-w);c.lineTo(0,w);c.close();c.fillAndStroke();c.setShadow(!1);c.begin();c.moveTo(0,w);c.lineTo(.5*n,2*w);c.lineTo(n,w);c.moveTo(.5*n,2*w);c.lineTo(.5*n,r);c.stroke()};mxCellRenderer.registerShape("isoCube2",u);mxUtils.extend(y,mxShape);y.prototype.size=15;y.prototype.paintVertexShape=function(c,m,p,n,r){var w=Math.max(0,Math.min(.5*r,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c.translate(m,p);0==w?(c.rect(0,0,n,r),c.fillAndStroke()):(c.begin(),c.moveTo(0,w),c.arcTo(.5*n,w,0,0,1,.5*n,0),c.arcTo(.5*n,w,0,0,1,n,w),c.lineTo(n,r-w),c.arcTo(.5*n,w,0,0,1,.5*n,r),c.arcTo(.5*n,w,0,0,1,0,r-w),c.close(),c.fillAndStroke(),c.setShadow(!1),c.begin(),c.moveTo(n,w),c.arcTo(.5*n,w,0,0,1,.5*n,2*w),c.arcTo(.5*n,w,0,0,1,0,w),c.stroke())};mxCellRenderer.registerShape("cylinder2",y);mxUtils.extend(z,mxCylinder);z.prototype.size=15;z.prototype.paintVertexShape=function(c,m,p,n,r){var w=Math.max(0,Math.min(.5*r,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),x=mxUtils.getValue(this.style,"lid",!0);c.translate(m,p);0==w?(c.rect(0,0,n,r),c.fillAndStroke()):(c.begin(),x?(c.moveTo(0,w),c.arcTo(.5*n,w,0,0,1,.5*n,0),c.arcTo(.5*n,w,0,0,1,n,w)):(c.moveTo(0,0),c.arcTo(.5*n,w,0,0,0,.5*n,w),c.arcTo(.5*n,w,-0,0,0,n,0)),c.lineTo(n,r-w),c.arcTo(.5*n,w,0,0,1,.5*n,r),c.arcTo(.5*n,w,0,0,1,0,r-w),c.close(),c.fillAndStroke(),c.setShadow(!1),x&&(c.begin(),c.moveTo(n,w),c.arcTo(.5*n,w,0,0,1,.5*n,2*w),c.arcTo(.5*n,w,0,0,1,0,w),c.stroke()))};mxCellRenderer.registerShape("cylinder3",z);mxUtils.extend(F,mxActor);F.prototype.redrawPath=function(c,m,p,n,r){c.moveTo(0,0);c.quadTo(n/2,.5*r,n,0);c.quadTo(.5*n,r/2,n,r);c.quadTo(n/2,.5*r,0,r);c.quadTo(.5*n,r/2,0,0);c.end()};mxCellRenderer.registerShape("switch",F);mxUtils.extend(D,+0,0,0,n,0)),c.lineTo(n,r-w),c.arcTo(.5*n,w,0,0,1,.5*n,r),c.arcTo(.5*n,w,0,0,1,0,r-w),c.close(),c.fillAndStroke(),c.setShadow(!1),x&&(c.begin(),c.moveTo(n,w),c.arcTo(.5*n,w,0,0,1,.5*n,2*w),c.arcTo(.5*n,w,0,0,1,0,w),c.stroke()))};mxCellRenderer.registerShape("cylinder3",z);mxUtils.extend(E,mxActor);E.prototype.redrawPath=function(c,m,p,n,r){c.moveTo(0,0);c.quadTo(n/2,.5*r,n,0);c.quadTo(.5*n,r/2,n,r);c.quadTo(n/2,.5*r,0,r);c.quadTo(.5*n,r/2,0,0);c.end()};mxCellRenderer.registerShape("switch",E);mxUtils.extend(D,mxCylinder);D.prototype.tabWidth=60;D.prototype.tabHeight=20;D.prototype.tabPosition="right";D.prototype.arcSize=.1;D.prototype.isRoundable=function(){return!0};D.prototype.paintVertexShape=function(c,m,p,n,r){c.translate(m,p);m=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));p=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var w=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),x=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1),A=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));I||(A*=Math.min(n,r));A=Math.min(A,.5*n,.5*(r-p));m=Math.max(m,A);m=Math.min(n-A,m);x||(A=0);c.begin();"left"==w?(c.moveTo(Math.max(A,0),p),c.lineTo(Math.max(A,0),0),c.lineTo(m,0),c.lineTo(m,p)):(c.moveTo(n-m,p),c.lineTo(n-m,0),c.lineTo(n-Math.max(A,0),0),c.lineTo(n-Math.max(A,0),p));x?(c.moveTo(0,A+p),c.arcTo(A,A,0,0,1,A,p),c.lineTo(n-A,p),c.arcTo(A,A,0,0,1,n,A+p),c.lineTo(n,r-A),c.arcTo(A,A,0,0,1,n-A,r),c.lineTo(A,r),c.arcTo(A,A,0,0,1,0,r-A)):(c.moveTo(0,p),c.lineTo(n,p),c.lineTo(n,r),c.lineTo(0,r));c.close();c.fillAndStroke();c.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(c.begin(),c.moveTo(n-30,p+20),c.lineTo(n-20,p+10),c.lineTo(n-10,p+20),c.close(),c.stroke())};mxCellRenderer.registerShape("folder",D);D.prototype.getLabelMargins=function(c){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"tabHeight",@@ -3524,8 +3529,8 @@ c.end()};mxCellRenderer.registerShape("or",la);mxUtils.extend(Ea,mxActor);Ea.promxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(m,0),new mxPoint(n-m,0),new mxPoint(n,.8*m),new mxPoint(n,r),new mxPoint(0,r),new mxPoint(0,.8*m)],this.isRounded,p,!0);c.end()};mxCellRenderer.registerShape("loopLimit",za);mxUtils.extend(Va,mxActor);Va.prototype.size=.375;Va.prototype.isRoundable=function(){return!0};Va.prototype.redrawPath=function(c,m,p,n,r){m=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));p=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,r-m),new mxPoint(n/2,r),new mxPoint(0,r-m)],this.isRounded,p,!0);c.end()};mxCellRenderer.registerShape("offPageConnector",Va);mxUtils.extend(Ta,mxEllipse);Ta.prototype.paintVertexShape=function(c,m,p,n,r){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.begin();c.moveTo(m+n/2,p+r);c.lineTo(m+n,p+r);c.end();c.stroke()};mxCellRenderer.registerShape("tapeData",Ta);mxUtils.extend(q,mxEllipse);q.prototype.paintVertexShape=function(c,m,p,n,r){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m,p+r/2);c.lineTo(m+n,p+r/2);c.end();c.stroke();c.begin();c.moveTo(m+n/2,p);c.lineTo(m+n/2,p+r);c.end();c.stroke()};mxCellRenderer.registerShape("orEllipse",q);mxUtils.extend(B,mxEllipse);B.prototype.paintVertexShape=function(c,m,p,n,r){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m+.145*n,p+.145*-r);c.lineTo(m+.855*n,p+.855*r);c.end();c.stroke();c.begin();c.moveTo(m+.855*n,p+.145*r);c.lineTo(m+.145*n,p+.855*r);c.end();c.stroke()};mxCellRenderer.registerShape("sumEllipse",B);mxUtils.extend(C,mxRhombus);C.prototype.paintVertexShape=function(c,m,p,n,r){mxRhombus.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m,p+r/2);c.lineTo(m+n,p+r/2);c.end();c.stroke()};mxCellRenderer.registerShape("sortShape",C);mxUtils.extend(E,mxEllipse);E.prototype.paintVertexShape=-function(c,m,p,n,r){c.begin();c.moveTo(m,p);c.lineTo(m+n,p);c.lineTo(m+n/2,p+r/2);c.close();c.fillAndStroke();c.begin();c.moveTo(m,p+r);c.lineTo(m+n,p+r);c.lineTo(m+n/2,p+r/2);c.close();c.fillAndStroke()};mxCellRenderer.registerShape("collate",E);mxUtils.extend(J,mxEllipse);J.prototype.paintVertexShape=function(c,m,p,n,r){var w=c.state.strokeWidth/2,x=10+2*w,I=p+r-x/2;c.begin();c.moveTo(m,p);c.lineTo(m,p+r);c.moveTo(m+w,I);c.lineTo(m+w+x,I-x/2);c.moveTo(m+w,I);c.lineTo(m+w+x,I+x/2);c.moveTo(m+w,I);+r);c.lineTo(m+.855*n,p+.855*r);c.end();c.stroke();c.begin();c.moveTo(m+.855*n,p+.145*r);c.lineTo(m+.145*n,p+.855*r);c.end();c.stroke()};mxCellRenderer.registerShape("sumEllipse",B);mxUtils.extend(C,mxRhombus);C.prototype.paintVertexShape=function(c,m,p,n,r){mxRhombus.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m,p+r/2);c.lineTo(m+n,p+r/2);c.end();c.stroke()};mxCellRenderer.registerShape("sortShape",C);mxUtils.extend(F,mxEllipse);F.prototype.paintVertexShape=+function(c,m,p,n,r){c.begin();c.moveTo(m,p);c.lineTo(m+n,p);c.lineTo(m+n/2,p+r/2);c.close();c.fillAndStroke();c.begin();c.moveTo(m,p+r);c.lineTo(m+n,p+r);c.lineTo(m+n/2,p+r/2);c.close();c.fillAndStroke()};mxCellRenderer.registerShape("collate",F);mxUtils.extend(J,mxEllipse);J.prototype.paintVertexShape=function(c,m,p,n,r){var w=c.state.strokeWidth/2,x=10+2*w,I=p+r-x/2;c.begin();c.moveTo(m,p);c.lineTo(m,p+r);c.moveTo(m+w,I);c.lineTo(m+w+x,I-x/2);c.moveTo(m+w,I);c.lineTo(m+w+x,I+x/2);c.moveTo(m+w,I);c.lineTo(m+n-w,I);c.moveTo(m+n,p);c.lineTo(m+n,p+r);c.moveTo(m+n-w,I);c.lineTo(m+n-x-w,I-x/2);c.moveTo(m+n-w,I);c.lineTo(m+n-x-w,I+x/2);c.end();c.stroke()};mxCellRenderer.registerShape("dimension",J);mxUtils.extend(P,mxEllipse);P.prototype.drawHidden=!0;P.prototype.paintVertexShape=function(c,m,p,n,r){this.outline||c.setStrokeColor(null);if(null!=this.style){var w=c.pointerEvents,x=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||x||(c.pointerEvents=!1);var I="1"==mxUtils.getValue(this.style,"top","1"),A="1"==mxUtils.getValue(this.style,"left","1"),ea="1"==mxUtils.getValue(this.style,"right","1"),Q="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||x||this.outline||I||ea||Q||A?(c.rect(m,p,n,r),c.fill(),c.pointerEvents=w,c.setStrokeColor(this.stroke),c.setLineCap("square"),c.begin(),c.moveTo(m,p),this.outline||I?c.lineTo(m+n,p):c.moveTo(m+n,p),this.outline||ea?c.lineTo(m+n,p+r):c.moveTo(m+n,p+r),this.outline||Q?c.lineTo(m,p+r):c.moveTo(m,p+r),(this.outline||A)&&c.lineTo(m,p),c.end(),c.stroke(),c.setLineCap("flat")):c.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",P);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(c,m,p,n,r){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();"vertical"==mxUtils.getValue(this.style,"line")?(c.moveTo(m+n/2,p),c.lineTo(m+n/2,p+r)):(c.moveTo(m,p+r/2),c.lineTo(m+n,p+r/2));c.end();c.stroke()};@@ -3664,7 +3669,7 @@ mxRectangleShape.prototype.constraints;Ta.prototype.constraints=mxEllipse.prototnew mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];ka.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];Oa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,-0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];F.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,+0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];E.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];M.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)];W.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,@@ -3687,8 +3692,8 @@ parseFloat(mxUtils.getValue(this.style,"arrowWidth",db.prototype.arrowWidth)))),0),!1,null,x,w));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*x,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n));c.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,w));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*x,w));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,n));return c};fa.prototype.constraints=null;la.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)];Ea.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)];ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()}-Actions.prototype.init=function(){function a(k){d.escape();k=d.deleteCells(d.getDeletableCells(d.getSelectionCells()),k);null!=k&&d.setSelectionCells(k)}function b(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{for(var k=d.getSelectionCells(),v=0;v<k.length;v++)d.cellLabelChanged(k[v],"")}finally{d.getModel().endUpdate()}}}function e(k,v,u,y,z){z.getModel().beginUpdate();try{var F=z.getCellGeometry(k);null!=F&&u&&y&&(u/=y,F=F.clone(),1<u?F.height=F.width/u:F.width=F.height*u,z.getModel().setGeometry(k,-F));z.setCellStyles(mxConstants.STYLE_CLIP_PATH,v,[k]);z.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[k])}finally{z.getModel().endUpdate()}}var f=this.editorUi,g=f.editor,d=g.graph,h=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",function(){d.openLink(f.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";f.openFile()});var l=new Action("smartFit",function(){if(f.chromelessResize)d.isLightboxView()?(1==+Actions.prototype.init=function(){function a(k){d.escape();k=d.deleteCells(d.getDeletableCells(d.getSelectionCells()),k);null!=k&&d.setSelectionCells(k)}function b(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{for(var k=d.getSelectionCells(),v=0;v<k.length;v++)d.cellLabelChanged(k[v],"")}finally{d.getModel().endUpdate()}}}function e(k,v,u,y,z){z.getModel().beginUpdate();try{var E=z.getCellGeometry(k);null!=E&&u&&y&&(u/=y,E=E.clone(),1<u?E.height=E.width/u:E.width=E.height*u,z.getModel().setGeometry(k,+E));z.setCellStyles(mxConstants.STYLE_CLIP_PATH,v,[k]);z.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[k])}finally{z.getModel().endUpdate()}}var f=this.editorUi,g=f.editor,d=g.graph,h=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",function(){d.openLink(f.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";f.openFile()});var l=new Action("smartFit",function(){if(f.chromelessResize)d.isLightboxView()?(1==d.view.scale?f.lightboxFit():d.zoomTo(1),f.chromelessResize(!1)):f.chromelessResize(!0);else{d.popupMenuHandler.hideMenu();var k=d.view.scale,v=d.container.scrollLeft,u=d.container.scrollTop,y=d.view.translate.x,z=d.view.translate.y;f.actions.get("resetView").funct();1E-5>Math.abs(k-d.view.scale)&&5>Math.abs(v-d.container.scrollLeft)&&5>Math.abs(u-d.container.scrollTop)&&y==d.view.translate.x&&z==d.view.translate.y&&f.actions.get("fitWindow").funct()}},null,null,"Enter");l.getTitle=function(){return mxResources.get("fitWindow")+" / "+mxResources.get("resetView")};this.put("smartFit",l);this.addAction("keyPressEnter",function(){d.isSelectionEmpty()?f.actions.get("smartFit").funct():d.isEnabled()&&d.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){f.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(k,v){try{var u=mxUtils.parseXml(k);g.graph.setSelectionCells(g.graph.importGraphModel(u.documentElement))}catch(y){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+y.message)}}));f.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=h;this.addAction("save",function(){f.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=h;this.addAction("saveAs...",function(){f.saveFile(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+S");this.addAction("export...",function(){f.showDialog((new ExportDialog(f)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var k=new EditDiagramDialog(f);f.showDialog(k.container,@@ -3696,8 +3701,8 @@ d.view.scale?f.lightboxFit():d.zoomTo(1),f.chromelessResize(!1)):f.chromelessRes"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var k=null;try{k=f.copyXml(),null!=k&&d.removeCells(k,!1)}catch(v){}try{null==k&&mxClipboard.cut(d)}catch(v){f.handleError(v)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{f.copyXml()}catch(k){}try{mxClipboard.copy(d)}catch(k){f.handleError(k)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){f.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(k){f.pasteFromClipboard(d.popupMenuHandler.getTriggerPoint())});this.addAction("swap",function(){var k=d.getSelectionCells();2==k.length&&d.swapShapes(k[0],k[1])});this.addAction("copySize",function(){var k=d.getSelectionCell();d.isEnabled()&&null!=k&&d.getModel().isVertex(k)&&(k=d.getCellGeometry(k),null!=k&&(f.copiedSize=new mxRectangle(k.x,k.y,k.width,k.height)))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+F");this.addAction("pasteSize",function(){if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=f.copiedSize){d.getModel().beginUpdate();try{for(var k=d.getResizableCells(d.getSelectionCells()),v=0;v<k.length;v++)if(d.getModel().isVertex(k[v])){var u=d.getCellGeometry(k[v]);null!=u&&(u=u.clone(),u.width=f.copiedSize.width,u.height=f.copiedSize.height,d.getModel().setGeometry(k[v],u))}}finally{d.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");this.addAction("copyData",function(){var k=d.getSelectionCell()||d.getModel().getRoot();d.isEnabled()&&null!=k&&(k=k.cloneValue(),null==k||isNaN(k.nodeType)||(f.copiedValue=k))},null,null,Editor.altKey+"+"+Editor.shiftKey+-"+B");this.addAction("copyAsText",function(){var k=d.getSelectionCell();if(d.isEnabled()&&null!=k)try{d.isHtmlLabel(k)?f.writeHtmlToClipboard(d.getLabel(k),mxUtils.bind(this,function(v){f.handleError(v)})):f.writeTextToClipboard(d.getLabel(k),mxUtils.bind(this,function(v){f.handleError(v)}))}catch(v){f.handleError(v)}});this.addAction("pasteData",function(k,v){function u(F,D){var G=y.getValue(F);D=F.cloneValue(D);D.removeAttribute("placeholders");null==G||isNaN(G.nodeType)||D.setAttribute("placeholders",-G.getAttribute("placeholders"));null!=k&&mxEvent.isShiftDown(k)||D.setAttribute("label",d.convertValueToString(F));y.setValue(F,D)}k=null!=v?v:k;var y=d.getModel();if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=f.copiedValue){y.beginUpdate();try{var z=d.getEditableCells(d.getSelectionCells());if(0==z.length)u(y.getRoot(),f.copiedValue);else for(v=0;v<z.length;v++)u(z[v],f.copiedValue)}finally{y.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(k,v){k=+"+B");this.addAction("copyAsText",function(){var k=d.getSelectionCell();if(d.isEnabled()&&null!=k)try{d.isHtmlLabel(k)?f.writeHtmlToClipboard(d.getLabel(k),mxUtils.bind(this,function(v){f.handleError(v)})):f.writeTextToClipboard(d.getLabel(k),mxUtils.bind(this,function(v){f.handleError(v)}))}catch(v){f.handleError(v)}});this.addAction("pasteData",function(k,v){function u(E,D){var G=y.getValue(E);D=E.cloneValue(D);D.removeAttribute("placeholders");null==G||isNaN(G.nodeType)||D.setAttribute("placeholders",+G.getAttribute("placeholders"));null!=k&&mxEvent.isShiftDown(k)||D.setAttribute("label",d.convertValueToString(E));y.setValue(E,D)}k=null!=v?v:k;var y=d.getModel();if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=f.copiedValue){y.beginUpdate();try{var z=d.getEditableCells(d.getSelectionCells());if(0==z.length)u(y.getRoot(),f.copiedValue);else for(v=0;v<z.length;v++)u(z[v],f.copiedValue)}finally{y.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(k,v){k=null!=v?v:k;null!=k&&mxEvent.isShiftDown(k)?b():a(null!=k&&(mxEvent.isControlDown(k)||mxEvent.isMetaDown(k)||mxEvent.isAltDown(k)))},null,null,"Delete");this.addAction("deleteAll",function(){a(!0)});this.addAction("deleteLabels",function(){b()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{d.setSelectionCells(d.duplicateCells()),d.scrollCellToVisible(d.getSelectionCell())}catch(k){f.handleError(k)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var k=f.getSelectionState();if(null!=k.mergeCell){d.getModel().beginUpdate();try{d.setCellStyles("rowspan",k.rowspan,[k.mergeCell]),d.setCellStyles("colspan",k.colspan,[k.mergeCell])}finally{d.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var k=f.getSelectionState();if(0<k.cells.length){d.getModel().beginUpdate();try{d.setCellStyles("rowspan",null,k.cells),d.setCellStyles("colspan",null,k.cells)}finally{d.getModel().endUpdate()}}}));l=new Action("turn",function(k,v){k=null!=v?v:k;d.turnShapes(d.getResizableCells(d.getSelectionCells()),null!=k?mxEvent.isShiftDown(k):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");l.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",l);this.put("selectConnections",new Action("selectEdges",function(k){k=d.getSelectionCell();d.isEnabled()&&null!=k&&d.addSelectionCells(d.getEdges(k))}));this.addAction("selectVertices",function(){d.selectVertices(null,!0)},null,@@ -3712,10 +3717,10 @@ null==u&&(u=k.value.getAttribute("tooltip"));null!=u&&(v=u)}v=new TextareaDialog!0)||"";f.showLinkDialog(v,mxResources.get("ok"),function(u,y,z){d.getModel().beginUpdate();try{d.setLinkForCell(k,0<u.length?u:null),d.setAttributeForCell(k,"linkTarget",z)}finally{d.getModel().endUpdate()}},!0,d.getLinkTargetForCell(k))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+L");this.put("insertImage",new Action("image...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),f.actions.get("image").funct())})).isEnabled=h;this.addAction("editImage...",function(){f.actions.get("image").funct()});this.put("insertLink",new Action("link...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&f.showLinkDialog("",mxResources.get("ok"),function(k,v,u){k=mxUtils.trim(k);if(0<k.length){var y=null,z=d.getLinkTitle(k);null!=v&&0<v.length&&(y=v[0].iconUrl,z=v[0].name||v[0].type,z=z.charAt(0).toUpperCase()+z.substring(1),30<z.length&&(z=z.substring(0,30)+"..."));v=new mxCell(z,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=y?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+y:"spacing=10;"));v.vertex=!0;y=d.getCenterInsertPoint(d.getBoundingBoxFromGeometry([v],!0));v.geometry.x=y.x;v.geometry.y=y.y;d.setAttributeForCell(v,"linkTarget",u);d.setLinkForCell(v,k);d.cellSizeUpdated(v,!0);d.getModel().beginUpdate();try{v=d.addCell(v),d.fireEvent(new mxEventObject("cellsInserted","cells",[v]))}finally{d.getModel().endUpdate()}d.setSelectionCell(v);d.scrollCellToVisible(d.getSelectionCell())}},!0)},null,null,"L")).isEnabled=h;this.addAction("link...",mxUtils.bind(this,function(){if(d.isEnabled())if(d.cellEditor.isContentEditing()){var k=-d.getSelectedElement(),v=d.getParentByName(k,"A",d.cellEditor.textarea),u="";if(null==v&&null!=k&&null!=k.getElementsByTagName)for(var y=k.getElementsByTagName("a"),z=0;z<y.length&&null==v;z++)y[z].textContent==k.textContent&&(v=y[z]);null!=v&&"A"==v.nodeName&&(u=v.getAttribute("href")||"",d.selectNode(v));var F=d.cellEditor.saveSelection();f.showLinkDialog(u,mxResources.get("ok"),mxUtils.bind(this,function(D){d.cellEditor.restoreSelection(F);null!=D&&d.insertLink(D)}))}else d.isSelectionEmpty()?+d.getSelectedElement(),v=d.getParentByName(k,"A",d.cellEditor.textarea),u="";if(null==v&&null!=k&&null!=k.getElementsByTagName)for(var y=k.getElementsByTagName("a"),z=0;z<y.length&&null==v;z++)y[z].textContent==k.textContent&&(v=y[z]);null!=v&&"A"==v.nodeName&&(u=v.getAttribute("href")||"",d.selectNode(v));var E=d.cellEditor.saveSelection();f.showLinkDialog(u,mxResources.get("ok"),mxUtils.bind(this,function(D){d.cellEditor.restoreSelection(E);null!=D&&d.insertLink(D)}))}else d.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=h;this.addAction("autosize",function(){var k=d.getSelectionCells();if(null!=k){d.getModel().beginUpdate();try{for(var v=0;v<k.length;v++){var u=k[v];d.getModel().isVertex(u)&&(d.isAutosizeTextCell(u)&&d.setCellStyles("autosizeText",null,[u]),0<d.getModel().getChildCount(u)?d.updateGroupBounds([u],0,!0):d.updateCellSize(u))}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Y");this.addAction("snapToGrid",function(){d.snapCellsToGrid(d.getSelectionCells(),d.gridSize)});this.addAction("formattedText",function(){d.stopEditing();var k=d.getCommonStyle(d.getSelectionCells());k="1"==mxUtils.getValue(k,"html","0")?null:"1";d.getModel().beginUpdate();try{for(var v=d.getEditableCells(d.getSelectionCells()),u=0;u<v.length;u++){var y=d.getView().getState(v[u]);if(null!=y){var z=mxUtils.getValue(y.style,"html","0");if("1"==z&&null==k)d.removeTextStyleForCell(y.cell),d.setCellStyles("html",k,[v[u]]);else if("0"==-z&&"1"==k){var F=mxUtils.htmlEntities(d.convertValueToString(y.cell),!1);"0"!=mxUtils.getValue(y.style,"nl2Br","1")&&(F=F.replace(/\n/g,"<br/>"));d.cellLabelChanged(y.cell,Graph.sanitizeHtml(F));d.setCellStyles("html",k,[v[u]])}}}f.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=k?k:"0"],"cells",v))}finally{d.getModel().endUpdate()}});this.addAction("wordWrap",function(){var k=d.getView().getState(d.getSelectionCell()),v="wrap";d.stopEditing();null!=k&&"wrap"==k.style[mxConstants.STYLE_WHITE_SPACE]&&+z&&"1"==k){var E=mxUtils.htmlEntities(d.convertValueToString(y.cell),!1);"0"!=mxUtils.getValue(y.style,"nl2Br","1")&&(E=E.replace(/\n/g,"<br/>"));d.cellLabelChanged(y.cell,Graph.sanitizeHtml(E));d.setCellStyles("html",k,[v[u]])}}}f.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=k?k:"0"],"cells",v))}finally{d.getModel().endUpdate()}});this.addAction("wordWrap",function(){var k=d.getView().getState(d.getSelectionCell()),v="wrap";d.stopEditing();null!=k&&"wrap"==k.style[mxConstants.STYLE_WHITE_SPACE]&&(v=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,v)});this.addAction("rotation",function(){var k="0",v=d.getView().getState(d.getSelectionCell());null!=v&&(k=v.style[mxConstants.STYLE_ROTATION]||k);k=new FilenameDialog(f,k,mxResources.get("apply"),function(u){null!=u&&0<u.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,u)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");f.showDialog(k.container,375,80,!0,!0);k.init()});this.addAction("resetView",function(){d.zoomTo(1);f.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(k){d.isFastZoomEnabled()?d.lazyZoom(!0,!0,f.buttonZoomDelay):d.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(k){d.isFastZoomEnabled()?d.lazyZoom(!1,!0,f.buttonZoomDelay):d.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){f.fitDiagramOrPages()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+H");this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible?d.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible?d.fitPages(2):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible?d.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var k=new FilenameDialog(this.editorUi,@@ -3727,7 +3732,7 @@ mxUtils.bind(this,function(){f.setPageVisible(!d.pageVisible)}));l.setToggleActif.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});l=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());f.fireEvent(new mxEventObject("copyConnectChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});l.isEnabled=h;l=this.addAction("autosave",function(){f.editor.setAutosave(!f.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return f.editor.autosave});l.isEnabled=h;l.visible=!1;this.addAction("help",function(){var k="";mxResources.isLanguageSupported(mxClient.language)&&(k="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+k+".html")});var t=!1;l=new Action("about",function(){t||(f.showDialog((new AboutDialog(f)).container,320,280,!0,!0,function(){t=!1}),t=!0)});l.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",l);l=mxUtils.bind(this,function(k,v,u,y){return this.addAction(k,function(){if(null!=u&&d.cellEditor.isContentEditing())u();else{d.stopEditing(!1);d.getModel().beginUpdate();try{var z=d.getEditableCells(d.getSelectionCells());d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,v,z);(v&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(z,function(D){D.style.fontWeight=null;"B"==D.nodeName&&d.replaceElement(D)}):(v&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?-d.updateLabelElements(z,function(D){D.style.fontStyle=null;"I"==D.nodeName&&d.replaceElement(D)}):(v&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(z,function(D){D.style.textDecoration=null;"U"==D.nodeName&&d.replaceElement(D)});for(var F=0;F<z.length;F++)0==d.model.getChildCount(z[F])&&d.autoSizeCell(z[F],!1)}finally{d.getModel().endUpdate()}}},null,null,y)});l("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",+d.updateLabelElements(z,function(D){D.style.fontStyle=null;"I"==D.nodeName&&d.replaceElement(D)}):(v&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(z,function(D){D.style.textDecoration=null;"U"==D.nodeName&&d.replaceElement(D)});for(var E=0;E<z.length;E++)0==d.model.getChildCount(z[E])&&d.autoSizeCell(z[E],!1)}finally{d.getModel().endUpdate()}}},null,null,y)});l("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");l("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){f.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",d.shapeForegroundColor)});this.addAction("strokeColor...",function(){f.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",d.shapeForegroundColor)});this.addAction("fillColor...",function(){f.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",d.shapeBackgroundColor)});this.addAction("gradientColor...",function(){f.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",d.shapeForegroundColor)});this.addAction("backgroundColor...",function(){f.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",d.shapeBackgroundColor)});this.addAction("borderColor...",function(){f.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",d.shapeForegroundColor)});this.addAction("removeFormat",function(){if(d.isEnabled()&&!d.isSelectionEmpty()&&!d.isEditing()){d.getModel().beginUpdate();try{for(var k=d.getSelectionCells(),v=0;v<k.length;v++)d.removeTextStyleForCell(k[v],!0)}finally{d.getModel().endUpdate()}}});this.addAction("vertical",function(){f.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){f.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){d.getModel().beginUpdate();@@ -3743,11 +3748,11 @@ function(){var k=f.actions.get("removeWaypoint");null!=k.handler&&k.handler.remonull,[u]))}}finally{d.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var k=d.getSelectionCells();if(null!=k){k=d.getEditableCells(d.addAllEdges(k));d.getModel().beginUpdate();try{for(var v=0;v<k.length;v++){var u=k[v];if(d.getModel().isEdge(u)){var y=d.getCellGeometry(u);null!=y&&(y=y.clone(),y.points=null,y.x=0,y.y=0,y.offset=null,d.getModel().setGeometry(u,y))}}}finally{d.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");l=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");l=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!d.isSelectionEmpty()){var k=d.getCurrentCellStyle(d.getSelectionCell());k=mxUtils.getValue(k,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);d.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,k-1),d.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");l=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!d.isSelectionEmpty()){var k=d.getCurrentCellStyle(d.getSelectionCell());k=mxUtils.getValue(k,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);d.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,k+1),d.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");-this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var k=mxResources.get("image")+" ("+mxResources.get("url")+"):",v=d.getView().getState(d.getSelectionCell()),u="",y=null;null!=v&&(u=v.style[mxConstants.STYLE_IMAGE]||u,y=v.style[mxConstants.STYLE_CLIP_PATH]||y);var z=d.cellEditor.saveSelection();f.showImageDialog(k,u,function(F,D,G,H,M,N){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(z),d.insertImage(F,D,G);else{var L=d.getSelectionCells();-if(null!=F&&(0<F.length||0<L.length)){var U=null;d.getModel().beginUpdate();try{if(0==L.length){L=[d.insertVertex(d.getDefaultParent(),null,"",0,0,D,G,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var X=d.getCenterInsertPoint(d.getBoundingBoxFromGeometry(L,!0));L[0].geometry.x=X.x;L[0].geometry.y=X.y;null!=H&&e(L[0],H,M,N,d);U=L;d.fireEvent(new mxEventObject("cellsInserted","cells",U))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<F.length?F:null,L);var S=-d.getCurrentCellStyle(L[0]);"image"!=S[mxConstants.STYLE_SHAPE]&&"label"!=S[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",L):0==F.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,L);null==H&&d.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,L);if(null!=D&&null!=G)for(F=0;F<L.length;F++){var V=L[F];if("0"!=d.getCurrentCellStyle(V).expand){var ha=d.getModel().getGeometry(V);null!=ha&&(ha=ha.clone(),ha.width=D,ha.height=G,d.getModel().setGeometry(V,ha))}null!=H&&e(V,H,M,-N,d)}}finally{d.getModel().endUpdate()}null!=U&&(d.setSelectionCells(U),d.scrollCellToVisible(U[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing(),!0,y)}}).isEnabled=h;this.addAction("crop...",function(){var k=d.getSelectionCell();if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&null!=k){var v=d.getCurrentCellStyle(k),u=v[mxConstants.STYLE_IMAGE],y=v[mxConstants.STYLE_SHAPE];u&&"image"==y&&(v=new CropImageDialog(f,u,v[mxConstants.STYLE_CLIP_PATH],function(z,F,D){e(k,-z,F,D,d)}),f.showDialog(v.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=h;l=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(f,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){f.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),+this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var k=mxResources.get("image")+" ("+mxResources.get("url")+"):",v=d.getView().getState(d.getSelectionCell()),u="",y=null;null!=v&&(u=v.style[mxConstants.STYLE_IMAGE]||u,y=v.style[mxConstants.STYLE_CLIP_PATH]||y);var z=d.cellEditor.saveSelection();f.showImageDialog(k,u,function(E,D,G,H,M,N){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(z),d.insertImage(E,D,G);else{var L=d.getSelectionCells();+if(null!=E&&(0<E.length||0<L.length)){var U=null;d.getModel().beginUpdate();try{if(0==L.length){L=[d.insertVertex(d.getDefaultParent(),null,"",0,0,D,G,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var X=d.getCenterInsertPoint(d.getBoundingBoxFromGeometry(L,!0));L[0].geometry.x=X.x;L[0].geometry.y=X.y;null!=H&&e(L[0],H,M,N,d);U=L;d.fireEvent(new mxEventObject("cellsInserted","cells",U))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<E.length?E:null,L);var S=+d.getCurrentCellStyle(L[0]);"image"!=S[mxConstants.STYLE_SHAPE]&&"label"!=S[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",L):0==E.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,L);null==H&&d.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,L);if(null!=D&&null!=G)for(E=0;E<L.length;E++){var V=L[E];if("0"!=d.getCurrentCellStyle(V).expand){var ha=d.getModel().getGeometry(V);null!=ha&&(ha=ha.clone(),ha.width=D,ha.height=G,d.getModel().setGeometry(V,ha))}null!=H&&e(V,H,M,+N,d)}}finally{d.getModel().endUpdate()}null!=U&&(d.setSelectionCells(U),d.scrollCellToVisible(U[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing(),!0,y)}}).isEnabled=h;this.addAction("crop...",function(){var k=d.getSelectionCell();if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&null!=k){var v=d.getCurrentCellStyle(k),u=v[mxConstants.STYLE_IMAGE],y=v[mxConstants.STYLE_SHAPE];u&&"image"==y&&(v=new CropImageDialog(f,u,v[mxConstants.STYLE_CLIP_PATH],function(z,E,D){e(k,+z,E,D,d)}),f.showDialog(v.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=h;l=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(f,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){f.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),f.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+L");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));l=this.addAction("format",mxUtils.bind(this,function(){f.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return f.isFormatPanelVisible()}));l=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(f,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){f.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),f.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var k=d.getSelectionCell();if(d.isEnabled()&&null!=k){var v=d.view.getState(k);if(null!=v&&"mxgraph.basic.polygon"===mxUtils.getValue(v.style,mxConstants.STYLE_SHAPE)){var u=new PolygonDialog(f,@@ -3792,20 +3797,20 @@ u&&0<u.length&&(e.scrollCellToVisible(u[0]),e.setSelectionCells(u))}),b):(l&&(b=b.setAttribute("title",mxResources.get("insertColumnAfter")),b=a.addItem(mxResources.get("deleteColumn"),Editor.removeColumnImage,mxUtils.bind(this,function(){if(null!=f)try{h?e.deleteLane(f):e.deleteTableColumn(f)}catch(k){this.editorUi.handleError(k)}})),b.setAttribute("title",mxResources.get("deleteColumn"))),t&&(b=a.addItem(mxResources.get("insertRowBefore"),Editor.addRowAboveImage,mxUtils.bind(this,function(){try{h?e.insertLane(f,!0):e.insertTableRow(f,!0)}catch(k){this.editorUi.handleError(k)}})),b.setAttribute("title",mxResources.get("insertRowBefore")),b=a.addItem(mxResources.get("insertRowAfter"),Editor.addRowBelowImage,mxUtils.bind(this,function(){try{h?e.insertLane(f,!1):e.insertTableRow(f,!1)}catch(k){this.editorUi.handleError(k)}})),b.setAttribute("title",mxResources.get("insertRowAfter")),b=a.addItem(mxResources.get("deleteRow"),Editor.removeRowImage,mxUtils.bind(this,function(){try{h?e.deleteLane(f):e.deleteTableRow(f)}catch(k){this.editorUi.handleError(k)}})),b.setAttribute("title",mxResources.get("deleteRow")),t=this.editorUi.getSelectionState(),null!=t.mergeCell?this.addMenuItem(a,"mergeCells"):(1<t.style.colspan||1<t.style.rowspan)&&this.addMenuItem(a,"unmergeCells")))};-Menus.prototype.addInsertTableItem=function(a,b,e,f){function g(z){y=d.getParentByName(mxEvent.getSource(z),"TD");var F=!1;if(null!=y){u=d.getParentByName(y,"TR");var D=mxEvent.isMouseEvent(z)?2:4,G=k,H=Math.min(20,u.sectionRowIndex+D);D=Math.min(20,y.cellIndex+D);for(var M=G.rows.length;M<H;M++)for(var N=G.insertRow(M),L=0;L<G.rows[0].cells.length;L++)N.insertCell(-1);for(M=0;M<G.rows.length;M++)for(N=G.rows[M],L=N.cells.length;L<D;L++)N.insertCell(-1);v.innerHTML=y.cellIndex+1+"x"+(u.sectionRowIndex+-1);for(G=0;G<k.rows.length;G++)for(H=k.rows[G],D=0;D<H.cells.length;D++)M=H.cells[D],G==u.sectionRowIndex&&D==y.cellIndex&&(F="blue"==M.style.backgroundColor),M.style.backgroundColor=G<=u.sectionRowIndex&&D<=y.cellIndex?"blue":"transparent"}mxEvent.consume(z);return F}f=null!=f?f:!0;var d=this.editorUi.editor.graph;b=null!=b?b:mxUtils.bind(this,function(z,F,D){if(null!=d.getParentByName(mxEvent.getSource(z),"TD")&&null!=d.cellEditor.textarea){var G=d.cellEditor.textarea.getElementsByTagName("table");-z=[];for(var H=0;H<G.length;H++)z.push(G[H]);d.container.focus();H=d;G=H.pasteHtmlAtCaret;for(var M=["<table>"],N=0;N<F;N++){M.push("<tr>");for(var L=0;L<D;L++)M.push("<td><br></td>");M.push("</tr>")}M.push("</table>");F=M.join("");G.call(H,F);F=d.cellEditor.textarea.getElementsByTagName("table");if(F.length==z.length+1)for(H=F.length-1;0<=H;H--)if(0==H||F[H]!=z[H-1]){d.selectNode(F[H].rows[0].cells[0]);break}}});null==e&&(a.div.classList.add("geToolbarMenu"),a.labels=!1);a=a.addItem("",null,null,+Menus.prototype.addInsertTableItem=function(a,b,e,f){function g(z){y=d.getParentByName(mxEvent.getSource(z),"TD");var E=!1;if(null!=y){u=d.getParentByName(y,"TR");var D=mxEvent.isMouseEvent(z)?2:4,G=k,H=Math.min(20,u.sectionRowIndex+D);D=Math.min(20,y.cellIndex+D);for(var M=G.rows.length;M<H;M++)for(var N=G.insertRow(M),L=0;L<G.rows[0].cells.length;L++)N.insertCell(-1);for(M=0;M<G.rows.length;M++)for(N=G.rows[M],L=N.cells.length;L<D;L++)N.insertCell(-1);v.innerHTML=y.cellIndex+1+"x"+(u.sectionRowIndex++1);for(G=0;G<k.rows.length;G++)for(H=k.rows[G],D=0;D<H.cells.length;D++)M=H.cells[D],G==u.sectionRowIndex&&D==y.cellIndex&&(E="blue"==M.style.backgroundColor),M.style.backgroundColor=G<=u.sectionRowIndex&&D<=y.cellIndex?"blue":"transparent"}mxEvent.consume(z);return E}f=null!=f?f:!0;var d=this.editorUi.editor.graph;b=null!=b?b:mxUtils.bind(this,function(z,E,D){if(null!=d.getParentByName(mxEvent.getSource(z),"TD")&&null!=d.cellEditor.textarea){var G=d.cellEditor.textarea.getElementsByTagName("table");+z=[];for(var H=0;H<G.length;H++)z.push(G[H]);d.container.focus();H=d;G=H.pasteHtmlAtCaret;for(var M=["<table>"],N=0;N<E;N++){M.push("<tr>");for(var L=0;L<D;L++)M.push("<td><br></td>");M.push("</tr>")}M.push("</table>");E=M.join("");G.call(H,E);E=d.cellEditor.textarea.getElementsByTagName("table");if(E.length==z.length+1)for(H=E.length-1;0<=H;H--)if(0==H||E[H]!=z[H-1]){d.selectNode(E[H].rows[0].cells[0]);break}}});null==e&&(a.div.classList.add("geToolbarMenu"),a.labels=!1);a=a.addItem("",null,null,e,null,null,null,!0);a.firstChild.style.fontSize=Menus.prototype.defaultFontSize+"px";e=a.getElementsByTagName("td");1<e.length&&(e[1].style.display="none",e[2].style.display="none");a.firstChild.innerText="";var h=document.createElement("input");h.setAttribute("id","geTitleOption");h.setAttribute("type","checkbox");h.style.verticalAlign="middle";e=document.createElement("label");mxUtils.write(e,mxResources.get("title"));e.setAttribute("for","geTitleOption");e.style.verticalAlign="middle";mxEvent.addGestureListeners(e,null,null,mxUtils.bind(this,function(z){mxEvent.consume(z)}));mxEvent.addGestureListeners(h,null,null,mxUtils.bind(this,function(z){mxEvent.consume(z)}));var l=document.createElement("input");l.setAttribute("id","geContainerOption");l.setAttribute("type","checkbox");l.style.verticalAlign="middle";var t=document.createElement("label");mxUtils.write(t,mxResources.get("container"));t.setAttribute("for","geContainerOption");t.style.verticalAlign="middle";mxEvent.addGestureListeners(t,null,null,mxUtils.bind(this,-function(z){mxEvent.consume(z)}));mxEvent.addGestureListeners(l,null,null,mxUtils.bind(this,function(z){mxEvent.consume(z)}));f&&(a.firstChild.appendChild(h),a.firstChild.appendChild(e),mxUtils.br(a.firstChild),a.firstChild.appendChild(l),a.firstChild.appendChild(t),mxUtils.br(a.firstChild));var k=function(z,F){var D=document.createElement("table");D.className="geInsertTablePicker";D.setAttribute("border","1");D.style.borderCollapse="collapse";D.style.borderStyle="solid";D.style.marginBottom="4px";-D.style.marginTop="8px";D.setAttribute("cellPadding","8");for(var G=0;G<z;G++)for(var H=D.insertRow(G),M=0;M<F;M++)H.insertCell(-1);return D}(5,5);a.firstChild.appendChild(k);var v=document.createElement("div");v.style.textAlign="center";v.style.padding="4px";v.style.width="100%";v.innerHTML="1x1";a.firstChild.appendChild(v);var u=null,y=null;mxEvent.addGestureListeners(k,null,null,mxUtils.bind(this,function(z){var F=g(z);null!=y&&null!=u&&F&&(b(z,u.sectionRowIndex+1,y.cellIndex+1,h.checked,l.checked),+function(z){mxEvent.consume(z)}));mxEvent.addGestureListeners(l,null,null,mxUtils.bind(this,function(z){mxEvent.consume(z)}));f&&(a.firstChild.appendChild(h),a.firstChild.appendChild(e),mxUtils.br(a.firstChild),a.firstChild.appendChild(l),a.firstChild.appendChild(t),mxUtils.br(a.firstChild));var k=function(z,E){var D=document.createElement("table");D.className="geInsertTablePicker";D.setAttribute("border","1");D.style.borderCollapse="collapse";D.style.borderStyle="solid";D.style.marginBottom="4px";+D.style.marginTop="8px";D.setAttribute("cellPadding","8");for(var G=0;G<z;G++)for(var H=D.insertRow(G),M=0;M<E;M++)H.insertCell(-1);return D}(5,5);a.firstChild.appendChild(k);var v=document.createElement("div");v.style.textAlign="center";v.style.padding="4px";v.style.width="100%";v.innerHTML="1x1";a.firstChild.appendChild(v);var u=null,y=null;mxEvent.addGestureListeners(k,null,null,mxUtils.bind(this,function(z){var E=g(z);null!=y&&null!=u&&E&&(b(z,u.sectionRowIndex+1,y.cellIndex+1,h.checked,l.checked),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0))}));mxEvent.addListener(k,"mouseover",g)};-Menus.prototype.edgeStyleChange=function(a,b,e,f,g,d,h,l){return this.showIconOnly(a.addItem(b,l,mxUtils.bind(this,function(){var t=this.editorUi.editor.graph;t.stopEditing(!1);t.getModel().beginUpdate();try{for(var k=t.getSelectionCells(),v=[],u=0;u<k.length;u++){var y=k[u];if(t.getModel().isEdge(y)){if(h){var z=t.getCellGeometry(y);null!=z&&(z=z.clone(),z.points=null,t.getModel().setGeometry(y,z))}for(var F=0;F<e.length;F++)t.setCellStyles(e[F],f[F],[y]);v.push(y)}else if("mxgraph.basic.arc"==mxUtils.getValue(t.getCurrentCellStyle(y),-mxConstants.STYLE_SHAPE)){for(F=0;F<e.length;F++)t.setCellStyles(e[F],f[F],[y]);v.push(y)}}this.editorUi.fireEvent(new mxEventObject("styleChanged","cells",v,"keys",e,"values",f,"force",0==v.length))}finally{t.getModel().endUpdate()}}),d,g))};Menus.prototype.showIconOnly=function(a){var b=a.getElementsByTagName("td");for(i=0;i<b.length;i++)"mxPopupMenuItem"==b[i].getAttribute("class")&&(b[i].style.display="none");return a};+Menus.prototype.edgeStyleChange=function(a,b,e,f,g,d,h,l){return this.showIconOnly(a.addItem(b,l,mxUtils.bind(this,function(){var t=this.editorUi.editor.graph;t.stopEditing(!1);t.getModel().beginUpdate();try{for(var k=t.getSelectionCells(),v=[],u=0;u<k.length;u++){var y=k[u];if(t.getModel().isEdge(y)){if(h){var z=t.getCellGeometry(y);null!=z&&(z=z.clone(),z.points=null,t.getModel().setGeometry(y,z))}for(var E=0;E<e.length;E++)t.setCellStyles(e[E],f[E],[y]);v.push(y)}else if("mxgraph.basic.arc"==mxUtils.getValue(t.getCurrentCellStyle(y),+mxConstants.STYLE_SHAPE)){for(E=0;E<e.length;E++)t.setCellStyles(e[E],f[E],[y]);v.push(y)}}this.editorUi.fireEvent(new mxEventObject("styleChanged","cells",v,"keys",e,"values",f,"force",0==v.length))}finally{t.getModel().endUpdate()}}),d,g))};Menus.prototype.showIconOnly=function(a){var b=a.getElementsByTagName("td");for(i=0;i<b.length;i++)"mxPopupMenuItem"==b[i].getAttribute("class")&&(b[i].style.display="none");return a};Menus.prototype.styleChange=function(a,b,e,f,g,d,h,l,t,k){var v=this.createStyleChangeFunction(e,f);a=a.addItem(b,k,mxUtils.bind(this,function(){var u=this.editorUi.editor.graph;null!=h&&u.cellEditor.isContentEditing()?h():v(l)}),d,g);t&&this.showIconOnly(a);return a};Menus.prototype.createStyleChangeFunction=function(a,b){return mxUtils.bind(this,function(e){var f=this.editorUi.editor.graph;f.stopEditing(!1);f.getModel().beginUpdate();try{for(var g=f.getEditableCells(f.getSelectionCells()),d=!1,h=0;h<a.length;h++)if(f.setCellStyles(a[h],b[h],g),a[h]==mxConstants.STYLE_ALIGN&&f.updateLabelElements(g,function(l){l.removeAttribute("align");l.style.textAlign=null}),a[h]==mxConstants.STYLE_FONTFAMILY||"fontSource"==a[h])d=!0;if(d)for(d=0;d<g.length;d++)0==f.model.getChildCount(g[d])&&f.autoSizeCell(g[d],!1);null!=e&&e();this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",a,"values",b,"cells",g))}finally{f.getModel().endUpdate()}})};-Menus.prototype.promptChange=function(a,b,e,f,g,d,h,l,t,k){return a.addItem(b,null,mxUtils.bind(this,function(){var v=this.editorUi.editor.graph,u=f,y=v.getView().getState(v.getSelectionCell());null!=y&&(u=y.style[g]||u);var z=null!=k?k():!0;u=new FilenameDialog(this.editorUi,u,mxResources.get("apply"),mxUtils.bind(this,function(F){if(null!=F&&0<F.length){if(z){v.getModel().beginUpdate();try{v.stopEditing(!1),v.setCellStyles(g,F)}finally{v.getModel().endUpdate()}}null!=l&&l(F)}}),mxResources.get("enterValue")++Menus.prototype.promptChange=function(a,b,e,f,g,d,h,l,t,k){return a.addItem(b,null,mxUtils.bind(this,function(){var v=this.editorUi.editor.graph,u=f,y=v.getView().getState(v.getSelectionCell());null!=y&&(u=y.style[g]||u);var z=null!=k?k():!0;u=new FilenameDialog(this.editorUi,u,mxResources.get("apply"),mxUtils.bind(this,function(E){if(null!=E&&0<E.length){if(z){v.getModel().beginUpdate();try{v.stopEditing(!1),v.setCellStyles(g,E)}finally{v.getModel().endUpdate()}}null!=l&&l(E)}}),mxResources.get("enterValue")+(0<e.length?" "+e:""),null,null,null,null,function(){null!=l&&null!=k&&l(null)});this.editorUi.showDialog(u.container,300,80,!0,!0);u.init()}),d,t,h)};Menus.prototype.pickColor=function(a,b,e,f,g,d){this.editorUi.tryAndHandle(mxUtils.bind(this,function(){var h=this.editorUi.editor.graph;if(null!=b&&h.cellEditor.isContentEditing()){var l=h.getSelectedEditingElement();null!=l&&null!=h.cellEditor.textarea&&(l=h.getTextColor(l,"forecolor"==b),this.editorUi.pickColor(l,mxUtils.bind(this,function(k){null!=h.cellEditor.textarea&&(Graph.setTextColor(h.cellEditor.textarea,k,"forecolor"==b),this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",["forecolor"==b?mxConstants.STYLE_FONTCOLOR:mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],"values",[k],"cells",[h.cellEditor.getEditingCell()])))}),f,g,d))}else{var t=h.getCellStyle(h.getSelectionCell(),!1);l=mxConstants.NONE;null!=t&&(l=t[a]||l);this.editorUi.pickColor(l,ColorDialog.createApplyFunction(this.editorUi,a),f,g,d)}}))};@@ -3846,9 +3851,9 @@ t.addItem("",Editor.removeFormatImage,mxUtils.bind(this,function(){document.exec!1,null)}))})),null,Editor.plusImage);h.setAttribute("data-min-width",700);this.addSeparator(null,700);var l=this.addMenu(new Menu(mxUtils.bind(this,function(t){var k=b.getSelectedElement(),v=b.getParentByNames(k,["TD","TH"],b.cellEditor.text2),u=b.getParentByName(k,"TR",b.cellEditor.text2);if(null==u)this.editorUi.menus.addInsertTableItem(t);else{var y=b.getParentByName(u,"TABLE",b.cellEditor.text2);k=t.addItem("",Editor.addColumnLeftImage,mxUtils.bind(this,function(){try{b.selectNode(b.insertColumn(y,null!=v?v.cellIndex:0))}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("insertColumnBefore"));k=t.addItem("",Editor.addColumnRightImage,mxUtils.bind(this,function(){try{b.selectNode(b.insertColumn(y,null!=v?v.cellIndex+1:-1))}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("insertColumnAfter"));k=t.addItem("Delete column",Editor.removeColumnImage,mxUtils.bind(this,function(){if(null!=v)try{b.deleteColumn(y,v.cellIndex)}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("deleteColumn"));k=t.addItem("",Editor.addRowAboveImage,mxUtils.bind(this,function(){try{b.selectNode(b.insertRow(y,u.sectionRowIndex))}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("insertRowBefore"));k=t.addItem("",Editor.addRowBelowImage,mxUtils.bind(this,function(){try{b.selectNode(b.insertRow(y,u.sectionRowIndex+1))}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("insertRowAfter"));k=t.addItem("",-Editor.removeRowImage,mxUtils.bind(this,function(){try{b.deleteRow(y,u.sectionRowIndex)}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("deleteRow"));k=t.addItem("",Editor.strokeColorImage,mxUtils.bind(this,function(){var z=y.style.borderColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(F,D,G,H){return"#"+("0"+Number(D).toString(16)).substr(-2)+("0"+Number(G).toString(16)).substr(-2)+("0"+Number(H).toString(16)).substr(-2)});this.editorUi.pickColor(z,-function(F){null==F||F==mxConstants.NONE?(y.removeAttribute("border"),y.style.border="",y.style.borderCollapse=""):(y.setAttribute("border","1"),y.style.border="1px solid "+F,y.style.borderCollapse="collapse")})}));k.setAttribute("title",mxResources.get("borderColor"));k=t.addItem("",Editor.fillColorImage,mxUtils.bind(this,function(){var z=y.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(F,D,G,H){return"#"+("0"+Number(D).toString(16)).substr(-2)+("0"+Number(G).toString(16)).substr(-2)+-("0"+Number(H).toString(16)).substr(-2)});this.editorUi.pickColor(z,function(F){y.style.backgroundColor=null==F||F==mxConstants.NONE?"":F})}));k.setAttribute("title",mxResources.get("backgroundColor"));k=t.addItem("",Editor.spacingImage,mxUtils.bind(this,function(){var z=y.getAttribute("cellPadding")||0;z=new FilenameDialog(this.editorUi,z,mxResources.get("apply"),mxUtils.bind(this,function(F){null!=F&&0<F.length?y.setAttribute("cellPadding",F):y.removeAttribute("cellPadding")}),mxResources.get("spacing"));+Editor.removeRowImage,mxUtils.bind(this,function(){try{b.deleteRow(y,u.sectionRowIndex)}catch(z){this.editorUi.handleError(z)}}));k.setAttribute("title",mxResources.get("deleteRow"));k=t.addItem("",Editor.strokeColorImage,mxUtils.bind(this,function(){var z=y.style.borderColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(E,D,G,H){return"#"+("0"+Number(D).toString(16)).substr(-2)+("0"+Number(G).toString(16)).substr(-2)+("0"+Number(H).toString(16)).substr(-2)});this.editorUi.pickColor(z,+function(E){null==E||E==mxConstants.NONE?(y.removeAttribute("border"),y.style.border="",y.style.borderCollapse=""):(y.setAttribute("border","1"),y.style.border="1px solid "+E,y.style.borderCollapse="collapse")})}));k.setAttribute("title",mxResources.get("borderColor"));k=t.addItem("",Editor.fillColorImage,mxUtils.bind(this,function(){var z=y.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(E,D,G,H){return"#"+("0"+Number(D).toString(16)).substr(-2)+("0"+Number(G).toString(16)).substr(-2)++("0"+Number(H).toString(16)).substr(-2)});this.editorUi.pickColor(z,function(E){y.style.backgroundColor=null==E||E==mxConstants.NONE?"":E})}));k.setAttribute("title",mxResources.get("backgroundColor"));k=t.addItem("",Editor.spacingImage,mxUtils.bind(this,function(){var z=y.getAttribute("cellPadding")||0;z=new FilenameDialog(this.editorUi,z,mxResources.get("apply"),mxUtils.bind(this,function(E){null!=E&&0<E.length?y.setAttribute("cellPadding",E):y.removeAttribute("cellPadding")}),mxResources.get("spacing"));this.editorUi.showDialog(z.container,300,80,!0,!0);z.init()}));k.setAttribute("title",mxResources.get("spacing"));k=t.addItem("",Editor.alignLeftImage,mxUtils.bind(this,function(){y.setAttribute("align","left")}));k.setAttribute("title",mxResources.get("left"));k=t.addItem("",Editor.alignCenterImage,mxUtils.bind(this,function(){y.setAttribute("align","center")}));k.setAttribute("title",mxResources.get("center"));k=t.addItem("",Editor.alignRightImage,mxUtils.bind(this,function(){y.setAttribute("align","right")}));k.setAttribute("title",mxResources.get("right"))}})),null,Editor.tableImage);l.setAttribute("data-min-width",740);this.editorUi.dependsOnLanguage(mxUtils.bind(this,function(){e.innerText=mxResources.get("style");d.setAttribute("title",mxResources.get("format"));e.setAttribute("title",mxResources.get("style"));f.setAttribute("title",mxResources.get("fontFamily"));g.setAttribute("title",mxResources.get("fontSize"));h.setAttribute("title",mxResources.get("insert"));l.setAttribute("title",mxResources.get("table"))}))};Toolbar.prototype.hideMenu=function(){this.editorUi.hideCurrentMenu()};Toolbar.prototype.setMenuText=function(a,b){a.getElementsByTagName("span")[0].innerText=b};Toolbar.prototype.setMenuIcon=function(a,b){a.style.backgroundImage="url("+b+")"};@@ -3859,19 +3864,19 @@ d.setAttribute("title",h)})),g.addListener("stateChanged",a)),a());return d};TooN=H*(1-G);D=H*(1-G*(M%2?D-M:1-(D-M)));switch(M){case 6:case 0:return[H,D,N];case 1:return[D,H,N];case 2:return[N,H,D];case 3:return[N,D,H];case 4:return[D,N,H];case 5:return[H,N,D]}}mxEventSource.call(this);var b=document.createElement("div");b.style.overflow="visible";b.style.position="relative";b.style.top="0px";b.style.left="0px";b.style.width="230px";b.style.height="114px";var e=document.createElement("div");e.style.border="1px solid light-dark(black, white)";e.style.backgroundImage="url("+this.hsImage+")";e.style.position="absolute";e.style.overflow="hidden";e.style.cursor="crosshair";e.style.width="181px";e.style.height="101px";e.style.left="6px";e.style.top="4px";var f=document.createElement("div");f.style.background="url("+this.crossImage+")";f.style.pointerEvents="none";f.style.position="absolute";f.style.width="15px";f.style.height="15px";f.style.left="-8px";f.style.top="-8px";var g=[0,0,1],d=1;e.appendChild(f);b.appendChild(e);sliderBox=document.createElement("div");sliderBox.style.position="absolute";sliderBox.style.cursor="pointer";sliderBox.style.width="38px";sliderBox.style.height="110px";sliderBox.style.left="199px";sliderBox.style.top="4px";var h=document.createElement("div");h.style.border="1px solid light-dark(black, white)";h.style.pointerEvents="none";h.style.overflow="hidden";h.style.position="absolute";h.style.width="16px";h.style.height="101px";h.style.left="9px";h.style.top="0px";var l=!1,t=!1,k=mxUtils.bind(this,function(D){var G=Math.round(100*(1-g[1]));f.style.left=-Math.round(g[0]/6*180)-8+"px";f.style.top=G-8+"px";G=h.childNodes;var H=a(g[0],g[1],1);if(null!=H){for(var M=0;M<G.length;M++)G[M].style.backgroundColor="rgb("+H[0]*(1-M/G.length)*255+", "+H[1]*(1-M/G.length)*255+", "+H[2]*(1-M/G.length)*255+")";F.style.top=Math.round(100*(1-g[2]))-4+"px";G=a(g[0],g[1],g[2]);G="#"+("0"+Math.round(255*G[0]).toString(16)).slice(-2)+("0"+Math.round(255*G[1]).toString(16)).slice(-2)+("0"+Math.round(255*G[2]).toString(16)).slice(-2)+(1>d?("0"+Math.round(255*d).toString(16)).slice(-2):+Math.round(g[0]/6*180)-8+"px";f.style.top=G-8+"px";G=h.childNodes;var H=a(g[0],g[1],1);if(null!=H){for(var M=0;M<G.length;M++)G[M].style.backgroundColor="rgb("+H[0]*(1-M/G.length)*255+", "+H[1]*(1-M/G.length)*255+", "+H[2]*(1-M/G.length)*255+")";E.style.top=Math.round(100*(1-g[2]))-4+"px";G=a(g[0],g[1],g[2]);G="#"+("0"+Math.round(255*G[0]).toString(16)).slice(-2)+("0"+Math.round(255*G[1]).toString(16)).slice(-2)+("0"+Math.round(255*G[2]).toString(16)).slice(-2)+(1>d?("0"+Math.round(255*d).toString(16)).slice(-2):"");1!=D&&this.fireEvent(new mxEventObject("change","color",mxUtils.rgba2hex(G)))}}),v=mxUtils.bind(this,function(D){0==g[2]&&(g[2]=1);l=!0;y(D)}),u=mxUtils.bind(this,function(D){t=!0;y(D)}),y=mxUtils.bind(this,function(D){if(l){var G=e.getBoundingClientRect(),H=mxEvent.getClientX(D)-G.left;D=mxEvent.getClientY(D)-G.top;f.style.left=H-8+"px";f.style.top=D-8+"px";H*=6/180;D=1-D/100;G=void 0;0>H&&(H=0);6<H&&(H=6);0>D&&(D=0);1<D&&(D=1);0>G&&(G=0);1<G&&(G=1);H=a(null==H?g[0]:g[0]=H,null==D?g[1]:g[1]=D,null==G?g[2]:g[2]=G);this.fromString("#"+("0"+Math.floor(255*H[0]).toString(16)).slice(-2)+("0"+Math.floor(255*H[1]).toString(16)).slice(-2)+("0"+Math.floor(255*H[2]).toString(16)).slice(-2)+(1>d?("0"+Math.round(255*d).toString(16)).slice(-2):""))}else t&&(G=sliderBox.getBoundingClientRect(),D=mxEvent.getClientY(D)-G.top,g[2]=Math.max(Math.min(1,1-D/100),0),k())}),z=mxUtils.bind(this,function(){l=t=!1});mxEvent.addGestureListeners(e,v);mxEvent.addGestureListeners(sliderBox,u);mxEvent.addGestureListeners(b,-null,y,z);mxEvent.addListener(b,"mouseleave",z);for(v=0;101>v;v+=4)u=document.createElement("div"),u.style.height="4px",u.style.pointerEvents="none",h.appendChild(u);b.appendChild(h);var F=document.createElement("div");F.style.background="url("+this.arrowImage+")";F.style.position="absolute";F.style.pointerEvents="none";F.style.width="7px";F.style.height="11px";F.style.left="2px";F.style.top="-3px";sliderBox.appendChild(F);sliderBox.appendChild(h);b.appendChild(sliderBox);this.fromString=function(D,+null,y,z);mxEvent.addListener(b,"mouseleave",z);for(v=0;101>v;v+=4)u=document.createElement("div"),u.style.height="4px",u.style.pointerEvents="none",h.appendChild(u);b.appendChild(h);var E=document.createElement("div");E.style.background="url("+this.arrowImage+")";E.style.position="absolute";E.style.pointerEvents="none";E.style.width="7px";E.style.height="11px";E.style.left="2px";E.style.top="-3px";sliderBox.appendChild(E);sliderBox.appendChild(h);b.appendChild(sliderBox);this.fromString=function(D,G){G=null!=G?G:!1;if(null==D||""==D||mxUtils.isVarColor(D)||D==mxConstants.NONE)D="#ffffff",G=!0;D=mxUtils.parseColor(D);var H=D.r/255,M=D.g/255,N=D.b/255,L=Math.min(Math.min(H,M),N);var U=Math.max(Math.max(H,M),N);var X=U-L;0===X?U=[null,0,U]:(H=H===L?3+(N-M)/X:M===L?5+(H-N)/X:1+(M-H)/X,U=[6===H?0:H,X/U,U]);null!=U[0]&&(g[0]=U[0]);0!=U[2]&&(g[1]=U[1]);g[2]=U[2];d=D.a;k(G)};this.fromString("#ffffff");this.div=b};mxUtils.extend(ColorPicker,mxEventSource);ColorPicker.prototype.hsImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAABlCAIAAACEDzXRAAAKQ0lEQVR42u2d23IjKwxFBeRh5v8/9uQlzXlI2gGELoCEm6pxubp6PI69WoV3C20uIQPAH4A/AH/p41/pDcTxP4BPGDtq3vYJGPpv8craeRdo/fyTI8ZhHnodOGgcV/3rnx8QI0SABO2xfAbiCfVR8Wj+CD8jenbRJNyGOxLoAaH1iLu4EUEHAv1+MsQ4zLE4AiIOcpibv4u9OET6+cP4ASnJ1JH4/G60A9km+GbBxLlpKAkADoR2JnaBrvWD/x1GCZn9EYLEHqVfI6Efx0D7E9tDF/rBSJ54l8FqTUse0J+EvxPrdK0fD4aOLXQi7zyGxMaRvvWjjH2U8o9I44OKnf+wyCpHoR/Phk6d/COq8481YrNI3/qR2B+kMl1Fl6J8o/JrU/GEA6HdiB2ha/0YBVx7rFwNHAj9JuIl6EI/qKyJug4Yvg7xA0QEpB8nQe8itoQu9EOT8M3mTsqUSUzykH6cBO1PbA9d91+ShDzV9xrtcgW21IT6L0yfcS90FKCdw+wS6Q9ISWjVfLTVVT2mdiPGGRduFKWm7dBStWlLmI0j/QExdgp7gT5qCu2BLKiLqtc94hI7PB8auQP4KuyIvSJ960fUqXWcd2F48Khr1bHSj2dDp/afmg7tMrFxpG/9mHMFuqrH3spFw0s0Bgr9OAzamdgFutaPpMuqo6WVEXWJdSL14xhof2J76MKfS2yXWGOVB1WXXGOVdxFSx587CXoLsTE0689RH7VW4RMLeKI9wPpzz4XeS2wDzdbXR52AWStjwiSAA6HdiB2h1f6cqT0whzzuzz0LejuxATTy90Xt40v7CzdGRvKS4O/zQ0AiXaRW5x/dv4vS4A/a308LYR5pFquRRvlHIrKWoCj5woCVId4eR/KPNDjURg2tdEC7rSQN5B9DYR70X5YivVxft7AyrOvrD4V2JnaBJurr+qpemLEywlRhT6qvPx16C7ExdK0fSjcj0maAzsqgBt7rfIxGP46B9iT2gi70I842bNj0U4wd/WAG/L5VP3p0W4iNoYv6Oh6eoJmSMW5laIzF8iT1TtgeV9RZoZ7QvdEUzsQu0CP+HOMKDFoZvDFg6s89CNqf2B5a4e8Hts84W0pgeohBtspBXYp8H3Tk/H23MBtHuvbn5mp7dlU9TUkP+XNJMabzHdCIbnuYDSItzZ+bdgUWrAwNPhwInRxw1/wXuYGj+4vo7flboRpjEQ6EjgojYK9/K04NFfNTauEBypXQWQLAfqQoHl9CfvpQ6C3ExtC9/q2YW2u6X1JWzfsYFPKX3L99LrQ/sT10XR+jKh+UN2AxlDOyXfLQaxxf/fkvT4d2JnaBZv258M6h4IFu2Em7/sezoLcQG0Mjfy6xrqLnVBLGWHw1i69WP5LCCn0TNEL3DLNXpCV/n5oo5jAVLY5Em6i8Pwm6uSNuCrNxpNX+nDira20qqyZriv384xhoZ2IX6Lr/wg8eiwpXYGQqPEgjsBrX+er3X46B9ie2h6bX/4i6IfcLS2mIY++7TfoCuLj6hwgN89CwBJ3Gx8rOVsn0kQ48tDS/4X1L8SzMb3BbkGdtwsD05AbP9YOU8xui+uljZei/P/3qx2HQbsSO0Ar/lveHLZYCVK4GeN1P5N+eAb2R2Aya9ueUY+8dlhLtdhWvgfEfz4AeGf9hR2wcaeTPpacvRdzLTx8J/Qq1Ij995PrJ3/mp0p8LO5YyF0s215g/9yxoZ2IXaLo+FiwtgTlvIAznp4+G3khsBk3Pf5mYvqOwMqZnNnw3i9cRDoT2JPaCZuvreskDuXkHxfQMvfbBgdBbiI2hC/3QLCg6lESZZkrfJ7nSj3gWNEMcRkYJsf5L0BXENBl1WV8/aquMLM9/eSJ0UtxZmFGGg4MigZ75ovHnvsOcUX09zRbzjCrU/K/Rev0gT2i2vu4cZrNI1+sH2e49Yb3lRC6e9fSS9ETohjj7hdkx0rQ/57/rxIrhBQdCv494Hlrtz1lo30Qjz1z+cRh02ndTNIMm1j8NxtmePs+76i+/esJHrH/6dGh/YntoRf9l2RtQWgJXzY4bdtbqx0OhnYldoHv7I79jf4+rOGGaRWr14yToLcTG0Ky/v32rjAsdX9S5vgI4ENqT2Asa7Z/9vq0yStiGNNVHkOe/RGmqwBQ0jEDHFpoJ85BLN+jPaRoHGWl2/2yx3msxVRHjZ0Td4GfV/Bf9bCM1dBiBfrHeJ1HR6dKEedDf5yPdBLilp/efC3Ribb1VxlUHGQe8iTb0598+Hdqf2B6a3b9SOerezsoIBWaJ3IBn1fp0j4PeQmwMzc5/idLK3UZWRkmKX2zA4Vc/DoPeSGwGrdvfY24RpKmVjrLuCQdCuxE7Qkv64TZ3Z44dVPrxUOh3EK9C1/lHGpz7ZzpVsYTF7K8Hyj+Ogd5FbAk9uL9H9LIyYg821sjo13gYtD+xPbRU/9Ds/b1sZTTIr5OStMGHA6GdiV2gUf2UmQcfJdUbXOoe6HoN1A0b2uQD4EBosXJqQTwKnXvXAEX+oZlfGaS9ewetDGCLeV1exH4e9Mr+2TDpv2iggYFW+LdBsTbngv/yUroGH0jleEX7MOgtxMbQ7PzKoMuajKyM8pYIiB194HnQzsQu0Gp/LvpulVHylsgK/TgG2p/YHrqXf6T3bJUBhfxFWUDPg95CbAytm/+ycasM9WOxWu0PnTniLWE2iLRi/4Z3bJXRvY76s0+Arl93I3aMNOHPBce2PdSkL7Kpnwe9l9gGutCPoFgkUtytXAGbex0vKCznSOs00o+ToLcQG0N/QErCrG6jrTIynVUDwo896vCzssPrNnAYtD+xPfR9fwmKeu/CVhm5OAn1STPkvhxBW1KXjeP60Y/DoJ2JXaAL/RCPy+PXc80L9d7OV294dVPbC/fb4EDoLcTG0IV+TCDrrIxMHIFg512BWj9OgvYk9oK+9SMoZG55q/JMiGS40/sLjacu28T3MVfd0Aha+u3QJXr+0Q//MBtHutaPQOzh3H0RBoZS5OJ/MjqJ9x2vQb7qgSuvX0StH0+FLptzrvTDh9gl0oV+iAbi2lAsqNmbK3yBAyLNdbRzW8Y6Btqf2B76A2IURE2zZY16KGfZlwqofJSL4feABka+xCNX+ekx0LuILaFr/Zit7s4ZA7y5Qg2sDr/t4zDodxCvQt/6occctDKGriMPzH85D9qN2BG61g/QwcLSVDSGl78C6LePY6A3EptBf0BKcjWWH/GqyJqoxKnMufEVBLJxAJwJ7U9sDH3fX0CxnIB4orMyuilTyRh6g+0bfDgQ2p/YHrrQD+jV6qb/SdRrMit8TRWwyEabxgFwJrQnsQt0rR+LR3VqFNiGHRBv73ge9EZiM+haPyicuRcVmIxzAMTMl9wfi3sGtBuxF3ShH92C29yJTteU+ohbRrZk3Qe9hdgY+tYPnOqanA+mTN33ZGKE06HQbsQu0LV+MF8+94rU5dK8B8/KyJaI+6D9ie2hC/3Q12QnSnYLn5p9P/6d0D7EltAh5wz/Hv8exON/LUjHOuz5CksAAAAASUVORK5CYII=";ColorPicker.prototype.crossImage="data:image/gif;base64,R0lGODlhDwAPAKEBAAAAAP///////////yH5BAEKAAIALAAAAAAPAA8AAAIklB8Qx53b4otSUWcvyiz4/4AeQJbmKY4p1HHapBlwPL/uVRsFADs=";ColorPicker.prototype.arrowImage="data:image/gif;base64,R0lGODlhBwALAKECAAAAAP///6g8eKg8eCH5BAEKAAIALAAAAAAHAAsAAAITTIQYcLnsgGxvijrxqdQq6DRJAQA7";var ColorDialog=function(a,b,e,f,g,d,h){function l(fa){return mxUtils.color2hex("#"+fa).substring(1).toUpperCase()}function t(){W.src="none"==Z.style.display?Editor.arrowRightImage:Editor.arrowDownImage}function k(fa,O){fa||"none"==Z.style.display?(Z.style.display="flex",!1!==O&&V.focus()):Z.style.display="none";t()}function v(fa){""==fa.value&&null!=N&&U?fa.style.background=fa==V?N.dark:N.light:""==fa.value||fa.value==mxConstants.NONE||mxUtils.isVarColor(fa.value)?fa.style.background="transparent":fa.style.background="#"+fa.value;fa.style.color="transparent"==fa.style.background?"light-dark(#000000, #ffffff)":mxUtils.isDarkColor(fa.style.background)?"#ffffff":"#000000"}function u(){v(X);v(V)}function y(fa){U!=fa&&(fa?h&&null!=N?(X.value=N.light.substring(1).toUpperCase(),fa=!1):(X.value="",V.value="",ha.value="automatic",X.setAttribute("placeholder",mxResources.get("useBlackAndWhite")),V.setAttribute("title",mxResources.get("useBlackAndWhite")),X.setAttribute("title",mxResources.get("useBlackAndWhite"))):(""==X.value&&null!=N&&(X.value=N.light.substring(1).toUpperCase()),X.removeAttribute("placeholder"),X.removeAttribute("title"),""==V.value&&null!=N&&(V.style.background=N.dark,fa=mxUtils.getCurrentStyle(V),V.value=mxUtils.rgba2hex(fa.backgroundColor).substring(1).toUpperCase()),V.removeAttribute("placeholder"),V.removeAttribute("title"),fa=!1));U=fa}function z(fa){"#"==fa.value.charAt(0)&&(fa.value=fa.value.substring(1));var O=fa.value,qa=O.toLowerCase();null==g||""!=O&&"automatic"!=qa&&"default"!=qa&&qa!=mxResources.get("default").toLowerCase()&&qa!=mxResources.get("automatic").toLowerCase()||null==N?(fa.value==mxConstants.NONE||mxUtils.isVarColor(fa.value)||(fa.value=l(fa.value),ka.fromString("#"+fa.value)),y(!1),fa!=V||X.value==mxConstants.NONE&&V.value==mxConstants.NONE||(ha.value="custom"),fa==X&&"automatic"==ha.value&&(X.value==mxConstants.NONE?V.value=mxConstants.NONE:mxUtils.isVarColor(X.value)?V.value=X.value:V.value=mxUtils.rgba2hex(mxUtils.getInverseColor("#"+fa.value)).substring(1).toUpperCase()),-u()):T.click()}function F(){var fa=X.value,O=V.value;if(U&&null!=N||(/(^#?[a-zA-Z0-9]*$)/.test(fa)||mxUtils.isVarColor(fa))&&(/(^#?[a-zA-Z0-9]*$)/.test(O)||mxUtils.isVarColor(O))){if(U)fa="default";else if(""==fa&&(fa=mxConstants.NONE),""==O&&(O=mxConstants.NONE),fa==mxConstants.NONE||mxUtils.isVarColor(fa)||"#"==fa.charAt(0)||(fa="#"+l(fa)),O==mxConstants.NONE||mxUtils.isVarColor(O)||"#"==O.charAt(0)||(O="#"+l(O)),fa!=mxConstants.NONE&&O!=mxConstants.NONE||ColorDialog.addRecentColor(mxConstants.NONE,+u()):T.click()}function E(){var fa=X.value,O=V.value;if(U&&null!=N||(/(^#?[a-zA-Z0-9]*$)/.test(fa)||mxUtils.isVarColor(fa))&&(/(^#?[a-zA-Z0-9]*$)/.test(O)||mxUtils.isVarColor(O))){if(U)fa="default";else if(""==fa&&(fa=mxConstants.NONE),""==O&&(O=mxConstants.NONE),fa==mxConstants.NONE||mxUtils.isVarColor(fa)||"#"==fa.charAt(0)||(fa="#"+l(fa)),O==mxConstants.NONE||mxUtils.isVarColor(O)||"#"==O.charAt(0)||(O="#"+l(O)),fa!=mxConstants.NONE&&O!=mxConstants.NONE||ColorDialog.addRecentColor(mxConstants.NONE,12),"automatic"!=ha.value&&O!=mxConstants.NONE?fa==mxConstants.NONE?ColorDialog.addRecentColor(O.substring(1),12):ColorDialog.addRecentColor("light-dark("+fa+","+O+")",12):fa!=mxConstants.NONE&&ColorDialog.addRecentColor(fa.substring(1),12),"none"!=fa||"none"!=O)fa=fa==mxConstants.NONE?"transparent":fa,O=O==mxConstants.NONE?"transparent":O,h||"automatic"==ha.value||(fa="light-dark("+fa+","+O+")");aa(fa);a.hideDialog()}else a.handleError({message:mxResources.get("invalidInput")})}function D(){mxClient.IS_TOUCH||-window.setTimeout(function(){oa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?oa.select():document.execCommand("selectAll",!1,null)},0)}function G(){oa.value!=mxConstants.NONE&&""!=oa.value&&ka.fromString("#"+oa.value,!0)}function H(){var fa=da(0==ColorDialog.recentColors.length?["FFFFFF"]:ColorDialog.recentColors,11,"FFFFFF",!0);fa.style.marginBottom="8px";return fa}function M(fa){13==fa.keyCode&&(z(mxEvent.getSource(fa)),F())}var N=null!=d?mxUtils.getLightDarkColor(d,null,null,+window.setTimeout(function(){oa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?oa.select():document.execCommand("selectAll",!1,null)},0)}function G(){oa.value!=mxConstants.NONE&&""!=oa.value&&ka.fromString("#"+oa.value,!0)}function H(){var fa=da(0==ColorDialog.recentColors.length?["FFFFFF"]:ColorDialog.recentColors,11,"FFFFFF",!0);fa.style.marginBottom="8px";return fa}function M(fa){13==fa.keyCode&&(z(mxEvent.getSource(fa)),E())}var N=null!=d?mxUtils.getLightDarkColor(d,null,null,h):null,L=a.editor.graph;this.editorUi=a;var U=!1;"default"==b||"transparent"==b||b==mxConstants.NONE||mxUtils.isVarColor(b)||mxUtils.isHexColor(b)||mxUtils.isRgbColor(b)||mxUtils.isLightDarkColor(b)||(b=mxUtils.color2hex(b));var X=document.createElement("input");X.style.textOverflow="ellipsis";X.style.margin="0 0 0 4px";X.style.width="100%";d=document.createElement("div");d.style.padding="0 4px";var S=document.createElement("div");S.style.display="flex";S.style.alignItems="center";d.appendChild(S);var V=document.createElement("input");V.style.textOverflow="ellipsis";V.style.margin="0 4px";V.style.maxWidth="70px";V.style.width="100%";var ha=document.createElement("select");ha.style.textOverflow="ellipsis";ha.style.width="100%";var R=document.createElement("option");R.setAttribute("value","automatic");mxUtils.write(R,mxResources.get("automatic"));ha.appendChild(R);R=document.createElement("option");R.setAttribute("value","custom");mxUtils.write(R,mxResources.get("userDefined"));ha.appendChild(R);ha.value=mxUtils.isLightDarkColor(b)?"custom":"automatic";var Z=document.createElement("div");Z.style.padding="0 6px 0 6px";R=document.createElement("img");R.setAttribute("title",mxResources.get("dark"));R.className="geAdaptiveAsset";R.src=Editor.thinDarkImage;R.style.width="20px";Z.appendChild(R);mxEvent.addListener(R,"click",function(){V.focus()});Z.appendChild(V);Z.appendChild(ha);Z.style.display="flex";Z.style.alignItems="center";R=document.createElement("div");R.style.display="flex";R.style.alignItems=@@ -3883,13 +3888,13 @@ var aa=null!=e?e:this.createApplyFunction();this.init=function(){D()};var ka=newfa,z(oa),window.setTimeout(function(){oa.focus()},0))});e=document.createElement("div");e.appendChild(ka.div);var pa=document.createElement("div");pa.style.display="flex";pa.style.flexFlow="row wrap";pa.style.justifyContent="center";pa.style.paddingTop="10px";var da=mxUtils.bind(this,function(fa,O,qa,ja){O=null!=O?O:12;var ua=document.createElement("table");ua.style.borderCollapse="collapse";ua.setAttribute("cellspacing","0");ua.style.marginBottom="20px";ua.style.cellSpacing="0px";ua.style.marginLeft="1px";var ya=document.createElement("tbody");ua.appendChild(ya);for(var Ma=fa.length/O,Oa=0;Oa<Ma;Oa++){for(var Ka=document.createElement("tr"),La=0;La<O;La++)mxUtils.bind(this,function(wa){var Ia=document.createElement("td");Ia.style.border="0px solid black";Ia.style.padding="0px";Ia.style.width="16px";Ia.style.height="16px";null==wa&&(wa=qa);if(null!=wa){Ia.style.borderWidth="1px";if(wa==mxConstants.NONE||null==wa)Ia.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(mxUtils.isLightDarkColor(wa)){var $a=mxUtils.getLightDarkColor(wa);Ia.style.background="linear-gradient(to right bottom, "+$a.cssText+" 50%, "+mxUtils.invertLightDarkColor($a).cssText+" 50.3%)"}else Ia.style.backgroundColor="#"+wa;$a=this.colorNames[String(wa).toUpperCase()];null!=$a&&Ia.setAttribute("title",$a)}Ka.appendChild(Ia);null!=wa&&(Ia.style.cursor="pointer",mxEvent.addListener(Ia,"click",function(){if(wa==mxConstants.NONE){oa==V&&V.value==mxConstants.NONE?X.value=mxConstants.NONE:oa.value=mxConstants.NONE;if(oa==X||oa==V&&-X.value==mxConstants.NONE)ha.value="automatic";z(oa);window.setTimeout(function(){oa.focus()},0)}else if(mxUtils.isLightDarkColor(wa)){k(!0);ha.value="custom";var ab=mxUtils.getLightDarkColor(wa);X.value=ab.light.substring(1).toUpperCase();V.value=ab.dark.substring(1).toUpperCase();z(X);z(V);oa==X?ka.fromString(ab.light):ka.fromString(ab.dark)}else ka.fromString("#"+wa)}),mxEvent.addListener(Ia,"dblclick",F))})(fa[Oa*O+La]);ya.appendChild(Ka)}ja&&(fa=document.createElement("td"),fa.setAttribute("title",+X.value==mxConstants.NONE)ha.value="automatic";z(oa);window.setTimeout(function(){oa.focus()},0)}else if(mxUtils.isLightDarkColor(wa)){k(!0);ha.value="custom";var ab=mxUtils.getLightDarkColor(wa);X.value=ab.light.substring(1).toUpperCase();V.value=ab.dark.substring(1).toUpperCase();z(X);z(V);oa==X?ka.fromString(ab.light):ka.fromString(ab.dark)}else ka.fromString("#"+wa)}),mxEvent.addListener(Ia,"dblclick",E))})(fa[Oa*O+La]);ya.appendChild(Ka)}ja&&(fa=document.createElement("td"),fa.setAttribute("title",mxResources.get("reset")),fa.className="geAdaptiveAsset",fa.style.border="1px solid black",fa.style.padding="0px",fa.style.width="16px",fa.style.height="16px",fa.style.backgroundImage="url('"+Editor.crossImage+"')",fa.style.backgroundPosition="center center",fa.style.backgroundSize="14px 14px",fa.style.backgroundRepeat="no-repeat",fa.style.cursor="pointer",Ka.appendChild(fa),mxEvent.addListener(fa,"click",function(){ColorDialog.resetRecentColors();ua.parentNode.replaceChild(H(),ua)}));pa.appendChild(ua);return ua});h||(d.appendChild(R),!ColorDialog.collapsed||Editor.isDarkMode()&&"auto"==L.getAdaptiveColors()||"automatic"!=ha.value||(Z.style.display="none",t()),R=document.createElement("img"),R.setAttribute("title",mxResources.get("light")),R.className="geAdaptiveAsset",R.src=Editor.thinLightImage,R.style.width="20px",S.appendChild(R),mxEvent.addListener(R,"click",function(){X.focus()}));S.appendChild(X);null!=N&&(T.setAttribute("title",mxResources.get(h?"default":"useBlackAndWhite")),T.style.cursor="pointer",T.style.position="relative",T.style.marginLeft="4px",T.innerText="",L=document.createElement("div"),L.style.display="inline-block",L.style.verticalAlign="middle",L.style.borderStyle="solid",L.style.borderWidth="1px",L.style.marginTop="-2px",L.style.width="12px",L.style.height="12px",h?L.style.backgroundColor=N.light:L.style.backgroundImage="linear-gradient(to right bottom, "+N.cssText+" 50%, "+mxUtils.invertLightDarkColor(N).cssText+" 50.3%)",T.appendChild(L),S.appendChild(T),mxEvent.addListener(T,-"dblclick",F));var ia=document.createElement("input");ia.setAttribute("type","color");ia.style.position="relative";ia.style.visibility="hidden";ia.style.top="10px";ia.style.width="0px";ia.style.height="0px";ia.style.border="none";e.style.whiteSpace="nowrap";S.appendChild(ia);L=mxUtils.button("",function(){document.activeElement==ia?X.focus():(ia.value="#"+X.value,ia.click())});L.style.cursor="pointer";R=document.createElement("img");R.src=Editor.colorDropperImage;R.className="geAdaptiveAsset";R.style.position=+"dblclick",E));var ia=document.createElement("input");ia.setAttribute("type","color");ia.style.position="relative";ia.style.visibility="hidden";ia.style.top="10px";ia.style.width="0px";ia.style.height="0px";ia.style.border="none";e.style.whiteSpace="nowrap";S.appendChild(ia);L=mxUtils.button("",function(){document.activeElement==ia?X.focus():(ia.value="#"+X.value,ia.click())});L.style.cursor="pointer";R=document.createElement("img");R.src=Editor.colorDropperImage;R.className="geAdaptiveAsset";R.style.position="relative";R.style.verticalAlign="middle";R.style.marginTop="-2px";R.style.width="auto";R.style.height="14px";L.appendChild(R);S.appendChild(L);e.appendChild(d);mxEvent.addListener(ia,"change",function(){ka.fromString(ia.value)});h||e.appendChild(Z);H();d=da(this.presetColors);d.style.marginBottom="8px";d=da(this.defaultColors);d.style.marginBottom="16px";e.appendChild(pa);d=document.createElement("div");d.style.display="flex";d.style.whiteSpace="nowrap";d.style.alignItems="center";d.style.justifyContent=-"end";a.isOffline()||d.appendChild(a.createHelpIcon("https://github.com/jgraph/drawio/discussions/4713"));S=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=f&&f()});S.className="geBtn";a.editor.cancelFirst&&d.appendChild(S);L=mxUtils.button(mxResources.get("apply"),F);L.className="geBtn gePrimaryBtn";d.appendChild(L);a.editor.cancelFirst||d.appendChild(S);null!=b&&("default"==b?T.click():(S=mxUtils.getLightDarkColor(b),b==mxConstants.NONE||"transparent"==S.light?X.value=mxConstants.NONE:+"end";a.isOffline()||d.appendChild(a.createHelpIcon("https://github.com/jgraph/drawio/discussions/4713"));S=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=f&&f()});S.className="geBtn";a.editor.cancelFirst&&d.appendChild(S);L=mxUtils.button(mxResources.get("apply"),E);L.className="geBtn gePrimaryBtn";d.appendChild(L);a.editor.cancelFirst||d.appendChild(S);null!=b&&("default"==b?T.click():(S=mxUtils.getLightDarkColor(b),b==mxConstants.NONE||"transparent"==S.light?X.value=mxConstants.NONE:mxUtils.isVarColor(S.light)?X.value=S.light:(mxUtils.isRgbColor(S.light)?S.light=mxUtils.rgba2hex(S.light):mxUtils.isHexColor(S.light)||(S.light="#"+l(S.light)),X.value=S.light.substring(1).toUpperCase()),b==mxConstants.NONE||"transparent"==S.dark?V.value=mxConstants.NONE:mxUtils.isVarColor(S.dark)?V.value=S.dark:(mxUtils.isRgbColor(S.dark)?S.dark=mxUtils.rgba2hex(S.dark):mxUtils.isHexColor(S.dark)||(S.dark="#"+l(S.dark)),V.value=S.dark.substring(1).toUpperCase()),G(),u()));h||!ColorDialog.collapsed||"automatic"!=ha.value||Editor.isDarkMode()||(Z.style.display="none",t());e.appendChild(d);this.picker=ka;this.colorInput=X;mxEvent.addListener(X,"keypress",M);mxEvent.addListener(V,"keypress",M);mxEvent.addListener(e,"keydown",function(fa){27==fa.keyCode&&(a.hideDialog(),null!=f&&f(),mxEvent.consume(fa))});this.container=e};ColorDialog.prototype.presetColors="E6D0DE CDA2BE B5739D E1D5E7 C3ABD0 A680B8 D4E1F5 A9C4EB 7EA6E0 D5E8D4 9AC7BF 67AB9F D5E8D4 B9E0A5 97D077 FFF2CC FFE599 FFD966 FFF4C3 FFCE9F FFB570 F8CECC F19C99 EA6B66".split(" ");ColorDialog.prototype.colorNames={};ColorDialog.prototype.defaultColors="none FFFFFF E6E6E6 CCCCCC B3B3B3 999999 808080 666666 4D4D4D 333333 1A1A1A 000000 FFCCCC FFE6CC FFFFCC E6FFCC CCFFCC CCFFE6 CCFFFF CCE5FF CCCCFF E5CCFF FFCCFF FFCCE6 FF9999 FFCC99 FFFF99 CCFF99 99FF99 99FFCC 99FFFF 99CCFF 9999FF CC99FF FF99FF FF99CC FF6666 FFB366 FFFF66 B3FF66 66FF66 66FFB3 66FFFF 66B2FF 6666FF B266FF FF66FF FF66B3 FF3333 FF9933 FFFF33 99FF33 33FF33 33FF99 33FFFF 3399FF 3333FF 9933FF FF33FF FF3399 FF0000 FF8000 FFFF00 80FF00 00FF00 00FF80 00FFFF 007FFF 0000FF 7F00FF FF00FF FF0080 CC0000 CC6600 CCCC00 66CC00 00CC00 00CC66 00CCCC 0066CC 0000CC 6600CC CC00CC CC0066 990000 994C00 999900 4D9900 009900 00994D 009999 004C99 000099 4C0099 990099 99004D 660000 663300 666600 336600 006600 006633 006666 003366 000066 330066 660066 660033 330000 331A00 333300 1A3300 003300 00331A 003333 001933 000033 190033 330033 33001A".split(" ");@@ -3899,8 +3904,8 @@ var AboutDialog=function(a){var b=document.createElement("div");b.setAttribute(""http://www.jgraph.com/");e.setAttribute("target","_blank");mxUtils.write(e,"www.jgraph.com");b.appendChild(e);mxUtils.br(b);mxUtils.br(b);e=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.className="geBtn gePrimaryBtn";b.appendChild(e);this.container=b},SimpleTextareaDialog=function(a,b,e,f,g){var d=document.createElement("div"),h=document.createElement("textarea");h.style.position="absolute";h.style.left="30px";h.style.right="30px";h.style.top="30px";h.style.bottom="100px";h.style.resize="none";h.setAttribute("wrap","off");h.setAttribute("spellcheck","false");h.setAttribute("autocorrect","off");h.setAttribute("autocomplete","off");h.setAttribute("autocapitalize","off");h.value=null!=b?b:"";d.appendChild(h);b=document.createElement("div");b.style.position="absolute";b.style.bottom="46px";b.style.right="30px";b.style.left="30px";b.style.justifyContent="end";b.style.display="flex";null==g||a.isOffline()||b.appendChild(a.createHelpIcon(g));g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.setAttribute("title","Escape");g.className="geBtn";a.editor.cancelFirst&&b.appendChild(g);var l=mxUtils.button(null!=f?f:mxResources.get("apply"),function(){a.hideDialog();e(h.value)});l.setAttribute("title","Ctrl+Enter");l.className="geBtn gePrimaryBtn";b.appendChild(l);mxEvent.addListener(h,"keydown",function(t){13==t.keyCode&&mxEvent.isControlDown(t)&&l.click()});a.editor.cancelFirst||b.appendChild(g);this.init=function(){h.focus();h.scrollTop=0};d.appendChild(b);-this.container=d},TextareaDialog=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z,F){k=null!=k?k:!1;h=document.createElement("div");h.style.position="absolute";h.style.top="20px";h.style.bottom="20px";h.style.left="20px";h.style.right="20px";l=document.createElement("div");l.style.position="absolute";l.style.left="0px";l.style.right="0px";var D=l.cloneNode(!1),G=l.cloneNode(!1);l.style.top="0px";l.style.height="20px";D.style.top="20px";D.style.bottom="64px";G.style.display="flex";G.style.whiteSpace="nowrap";-G.style.alignItems="center";G.style.justifyContent="end";G.style.bottom="10px";G.style.height="50px";G.style.textAlign="right";G.style.paddingTop="14px";G.style.boxSizing="border-box";mxUtils.write(l,b);h.appendChild(l);h.appendChild(D);h.appendChild(G);null!=F&&l.appendChild(F);var H=document.createElement("textarea");v?H.setAttribute("wrap","off"):H.style.wordBreak="break-all";H.setAttribute("spellcheck","false");H.setAttribute("autocorrect","off");H.setAttribute("autocomplete","off");H.setAttribute("autocapitalize",+this.container=d},TextareaDialog=function(a,b,e,f,g,d,h,l,t,k,v,u,y,z,E){k=null!=k?k:!1;h=document.createElement("div");h.style.position="absolute";h.style.top="20px";h.style.bottom="20px";h.style.left="20px";h.style.right="20px";l=document.createElement("div");l.style.position="absolute";l.style.left="0px";l.style.right="0px";var D=l.cloneNode(!1),G=l.cloneNode(!1);l.style.top="0px";l.style.height="20px";D.style.top="20px";D.style.bottom="64px";G.style.display="flex";G.style.whiteSpace="nowrap";+G.style.alignItems="center";G.style.justifyContent="end";G.style.bottom="10px";G.style.height="50px";G.style.textAlign="right";G.style.paddingTop="14px";G.style.boxSizing="border-box";mxUtils.write(l,b);h.appendChild(l);h.appendChild(D);h.appendChild(G);null!=E&&l.appendChild(E);var H=document.createElement("textarea");v?H.setAttribute("wrap","off"):H.style.wordBreak="break-all";H.setAttribute("spellcheck","false");H.setAttribute("autocorrect","off");H.setAttribute("autocomplete","off");H.setAttribute("autocapitalize","off");mxUtils.write(H,e||"");H.style.resize="none";H.style.outline="none";H.style.position="absolute";H.style.boxSizing="border-box";H.style.top="0px";H.style.left="0px";H.style.height="100%";H.style.width="100%";this.textarea=H;this.init=function(){H.focus();H.scrollTop=0};D.appendChild(H);null==y||a.isOffline()||G.appendChild(a.createHelpIcon(y));if(null!=z)for(b=0;b<z.length;b++)(function(N,L,U){N=mxUtils.button(N,function(X){L(X,H)});null!=U&&N.setAttribute("title",U);N.className="geBtn";G.appendChild(N)})(z[b][0],z[b][1],z[b][2]);d=mxUtils.button(d||mxResources.get("cancel"),function(){a.hideDialog();null!=g&&g()});d.setAttribute("title","Escape");d.className="geBtn";a.editor.cancelFirst&&G.appendChild(d);null!=t&&t(G,H);if(null!=f){var M=mxUtils.button(u||mxResources.get("apply"),function(){k||a.hideDialog();f(H.value)});M.setAttribute("title","Ctrl+Enter");M.className="geBtn gePrimaryBtn";G.appendChild(M);mxEvent.addListener(H,"keydown",function(N){13==N.keyCode&&mxEvent.isControlDown(N)&&M.click()})}a.editor.cancelFirst||G.appendChild(d);this.container=h},EditDiagramDialog=function(a){var b=document.createElement("div");b.style.position="absolute";b.style.inset="10px";var e=document.createElement("textarea");e.setAttribute("wrap","off");e.setAttribute("spellcheck","false");e.setAttribute("autocorrect","off");e.setAttribute("autocomplete","off");e.setAttribute("autocapitalize","off");e.style.overflow="auto";e.style.resize="none";e.style.position="absolute";e.style.top="20px";e.style.bottom="76px";e.style.left="20px";@@ -3908,33 +3913,33 @@ e.style.right="20px";var f=a.getDiagramSnapshot();e.value=mxUtils.getPrettyXml(f!1));var g=document.createElement("div");g.style.display="flex";g.style.whiteSpace="nowrap";g.style.alignItems="center";g.style.justifyContent="end";g.style.position="absolute";g.style.height="36px";g.style.bottom="24px";g.style.left="20px";g.style.right="20px";var d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";a.editor.cancelFirst&&g.appendChild(d);var h=document.createElement("select");h.style.textOverflow="ellipsis";h.style.width="196px";h.className="geBtn";if(a.editor.graph.isEnabled()){var l=document.createElement("option");l.setAttribute("value","apply");mxUtils.write(l,mxResources.get("apply",null,"Update Existing Drawing"));h.appendChild(l)}a.editor.graph.isEnabled()&&(l=document.createElement("option"),l.setAttribute("value","insert"),mxUtils.write(l,mxResources.get("insert")),h.appendChild(l));l=document.createElement("option");l.setAttribute("value","new");mxUtils.write(l,mxResources.get("openInNewWindow"));EditDiagramDialog.showNewWindowOption&&!navigator.standalone&&h.appendChild(l);g.appendChild(h);l=mxUtils.button(mxResources.get("ok"),function(){var t=Graph.zapGremlins(mxUtils.trim(e.value)),k=null;if("new"==h.value)a.hideDialog(),a.editor.editAsNew(t);else if("apply"==h.value)try{var v=mxUtils.parseXml(t).documentElement,u=Editor.extractParserError(v,mxResources.get("unknownError"));u?(EditorUi.debug("EditDiagramDialogParserError",[this],"node",[v],"cause",[u]),k=mxResources.get("invalidInput")+" ("+u+")"):("mxfile"==v.nodeName?a.editor.setGraphXml(v):-a.updateDiagramData(f,v),a.hideDialog())}catch(D){k=D}else if("insert"==h.value){a.editor.graph.model.beginUpdate();try{var y=mxUtils.parseXml(t),z=new mxGraphModel;(new mxCodec(y)).decode(y.documentElement,z);var F=z.getChildren(z.getChildAt(z.getRoot(),0));a.editor.graph.setSelectionCells(a.editor.graph.importCells(F));a.hideDialog()}catch(D){k=D}finally{a.editor.graph.model.endUpdate()}}null!=k&&a.handleError(k)});l.className="geBtn gePrimaryBtn";g.appendChild(l);a.editor.cancelFirst||g.appendChild(d);+a.updateDiagramData(f,v),a.hideDialog())}catch(D){k=D}else if("insert"==h.value){a.editor.graph.model.beginUpdate();try{var y=mxUtils.parseXml(t),z=new mxGraphModel;(new mxCodec(y)).decode(y.documentElement,z);var E=z.getChildren(z.getChildAt(z.getRoot(),0));a.editor.graph.setSelectionCells(a.editor.graph.importCells(E));a.hideDialog()}catch(D){k=D}finally{a.editor.graph.model.endUpdate()}}null!=k&&a.handleError(k)});l.className="geBtn gePrimaryBtn";g.appendChild(l);a.editor.cancelFirst||g.appendChild(d);b.appendChild(g);this.container=b};EditDiagramDialog.showNewWindowOption=!0;-var ExportDialog=function(a){function b(){var S=v.value,V=S.lastIndexOf(".");v.value=0<V?S.substring(0,V+1)+u.value:S+"."+u.value;"xml"===u.value?(y.setAttribute("disabled","true"),z.setAttribute("disabled","true"),F.setAttribute("disabled","true"),L.setAttribute("disabled","true")):(y.removeAttribute("disabled"),z.removeAttribute("disabled"),F.removeAttribute("disabled"),L.removeAttribute("disabled"));"png"===u.value||"svg"===u.value||"pdf"===u.value?M.removeAttribute("disabled"):M.setAttribute("disabled",-"disabled");"png"===u.value||"jpg"===u.value||"pdf"===u.value?N.removeAttribute("disabled"):N.setAttribute("disabled","disabled");"png"===u.value?(D.removeAttribute("disabled"),G.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"))}function e(){z.style.backgroundColor=z.value*F.value>MAX_AREA||0>=z.value?"red":"";F.style.backgroundColor=z.value*F.value>MAX_AREA||0>=F.value?"red":""}var f=a.editor.graph,g=f.getGraphBounds(),d=f.view.scale,h=Math.ceil(g.width/+var ExportDialog=function(a){function b(){var S=v.value,V=S.lastIndexOf(".");v.value=0<V?S.substring(0,V+1)+u.value:S+"."+u.value;"xml"===u.value?(y.setAttribute("disabled","true"),z.setAttribute("disabled","true"),E.setAttribute("disabled","true"),L.setAttribute("disabled","true")):(y.removeAttribute("disabled"),z.removeAttribute("disabled"),E.removeAttribute("disabled"),L.removeAttribute("disabled"));"png"===u.value||"svg"===u.value||"pdf"===u.value?M.removeAttribute("disabled"):M.setAttribute("disabled",+"disabled");"png"===u.value||"jpg"===u.value||"pdf"===u.value?N.removeAttribute("disabled"):N.setAttribute("disabled","disabled");"png"===u.value?(D.removeAttribute("disabled"),G.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"))}function e(){z.style.backgroundColor=z.value*E.value>MAX_AREA||0>=z.value?"red":"";E.style.backgroundColor=z.value*E.value>MAX_AREA||0>=E.value?"red":""}var f=a.editor.graph,g=f.getGraphBounds(),d=f.view.scale,h=Math.ceil(g.width/d),l=Math.ceil(g.height/d);d=document.createElement("table");var t=document.createElement("tbody");d.setAttribute("cellpadding",mxClient.IS_SF?"0":"2");g=document.createElement("tr");var k=document.createElement("td");k.style.fontSize="10pt";k.style.width="100px";mxUtils.write(k,mxResources.get("filename")+":");g.appendChild(k);var v=document.createElement("input");v.setAttribute("value",a.editor.getOrCreateFilename());v.style.width="180px";k=document.createElement("td");k.appendChild(v);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("format")+":");g.appendChild(k);var u=document.createElement("select");u.style.width="180px";k=document.createElement("option");k.setAttribute("value","png");mxUtils.write(k,mxResources.get("formatPng"));u.appendChild(k);k=document.createElement("option");ExportDialog.showGifOption&&(k.setAttribute("value","gif"),mxUtils.write(k,mxResources.get("formatGif")),u.appendChild(k));k=document.createElement("option");k.setAttribute("value","jpg");mxUtils.write(k,mxResources.get("formatJpg"));u.appendChild(k);k=document.createElement("option");k.setAttribute("value","svg");mxUtils.write(k,mxResources.get("formatSvg"));u.appendChild(k);ExportDialog.showXmlOption&&(k=document.createElement("option"),k.setAttribute("value","xml"),mxUtils.write(k,mxResources.get("formatXml")),u.appendChild(k));k=document.createElement("td");k.appendChild(u);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("zoom")+" (%):");g.appendChild(k);var y=document.createElement("input");y.setAttribute("type","number");y.setAttribute("value","100");y.style.width="180px";k=document.createElement("td");k.appendChild(y);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("width")+":");g.appendChild(k);var z=document.createElement("input");-z.setAttribute("value",h);z.style.width="180px";k=document.createElement("td");k.appendChild(z);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("height")+":");g.appendChild(k);var F=document.createElement("input");F.setAttribute("value",l);F.style.width="180px";k=document.createElement("td");k.appendChild(F);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");+z.setAttribute("value",h);z.style.width="180px";k=document.createElement("td");k.appendChild(z);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("height")+":");g.appendChild(k);var E=document.createElement("input");E.setAttribute("value",l);E.style.width="180px";k=document.createElement("td");k.appendChild(E);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("dpi")+":");g.appendChild(k);var D=document.createElement("select");D.style.width="180px";k=document.createElement("option");k.setAttribute("value","100");mxUtils.write(k,"100dpi");D.appendChild(k);k=document.createElement("option");k.setAttribute("value","200");mxUtils.write(k,"200dpi");D.appendChild(k);k=document.createElement("option");k.setAttribute("value","300");mxUtils.write(k,"300dpi");D.appendChild(k);k=document.createElement("option");k.setAttribute("value","400");mxUtils.write(k,"400dpi");D.appendChild(k);k=document.createElement("option");k.setAttribute("value","custom");mxUtils.write(k,mxResources.get("custom"));D.appendChild(k);var G=document.createElement("input");G.style.width="180px";G.style.display="none";G.setAttribute("value","100");G.setAttribute("type","number");G.setAttribute("min","50");G.setAttribute("step","50");var H=!1;mxEvent.addListener(D,"change",function(){"custom"==this.value?(this.style.display="none",G.style.display="",G.focus()):(G.value=this.value,H||(y.value=this.value))});mxEvent.addListener(G,"change",function(){var S=parseInt(G.value);isNaN(S)||0>=S?G.style.backgroundColor="red":(G.style.backgroundColor="",H||(y.value=S))});k=document.createElement("td");k.appendChild(D);k.appendChild(G);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("background")+":");g.appendChild(k);var M=document.createElement("input");M.setAttribute("type","checkbox");M.checked=null==f.background||f.background==mxConstants.NONE;k=document.createElement("td");k.appendChild(M);mxUtils.write(k,mxResources.get("transparent"));g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("grid")+":");g.appendChild(k);var N=document.createElement("input");N.setAttribute("type","checkbox");N.checked=!1;k=document.createElement("td");k.appendChild(N);g.appendChild(k);t.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.style.fontSize="10pt";mxUtils.write(k,mxResources.get("borderWidth")+":");g.appendChild(k);var L=document.createElement("input");L.setAttribute("type","number");L.setAttribute("value",ExportDialog.lastBorderValue);L.style.width="180px";k=document.createElement("td");k.appendChild(L);g.appendChild(k);t.appendChild(g);d.appendChild(t);mxEvent.addListener(u,"change",b);b();mxEvent.addListener(y,"change",-function(){H=!0;var S=Math.max(0,parseFloat(y.value)||100)/100;y.value=parseFloat((100*S).toFixed(2));0<h?(z.value=Math.floor(h*S),F.value=Math.floor(l*S)):(y.value="100",z.value=h,F.value=l);e()});mxEvent.addListener(z,"change",function(){var S=parseInt(z.value)/h;0<S?(y.value=parseFloat((100*S).toFixed(2)),F.value=Math.floor(l*S)):(y.value="100",z.value=h,F.value=l);e()});mxEvent.addListener(F,"change",function(){var S=parseInt(F.value)/l;0<S?(y.value=parseFloat((100*S).toFixed(2)),z.value=Math.floor(h*-S)):(y.value="100",z.value=h,F.value=l);e()});g=document.createElement("tr");k=document.createElement("td");k.setAttribute("align","right");k.style.paddingTop="22px";k.colSpan=2;var U=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(){if(0>=parseInt(y.value))mxUtils.alert(mxResources.get("drawingEmpty"));else{var S=v.value,V=u.value,ha=Math.max(0,parseFloat(y.value)||100)/100,R=Math.max(0,parseInt(L.value)),Z=f.background,W=Math.max(1,parseInt(G.value));if(("svg"==V||"png"==V||+function(){H=!0;var S=Math.max(0,parseFloat(y.value)||100)/100;y.value=parseFloat((100*S).toFixed(2));0<h?(z.value=Math.floor(h*S),E.value=Math.floor(l*S)):(y.value="100",z.value=h,E.value=l);e()});mxEvent.addListener(z,"change",function(){var S=parseInt(z.value)/h;0<S?(y.value=parseFloat((100*S).toFixed(2)),E.value=Math.floor(l*S)):(y.value="100",z.value=h,E.value=l);e()});mxEvent.addListener(E,"change",function(){var S=parseInt(E.value)/l;0<S?(y.value=parseFloat((100*S).toFixed(2)),z.value=Math.floor(h*+S)):(y.value="100",z.value=h,E.value=l);e()});g=document.createElement("tr");k=document.createElement("td");k.setAttribute("align","right");k.style.paddingTop="22px";k.colSpan=2;var U=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(){if(0>=parseInt(y.value))mxUtils.alert(mxResources.get("drawingEmpty"));else{var S=v.value,V=u.value,ha=Math.max(0,parseFloat(y.value)||100)/100,R=Math.max(0,parseInt(L.value)),Z=f.background,W=Math.max(1,parseInt(G.value));if(("svg"==V||"png"==V||"pdf"==V)&&M.checked)Z=null;else if(null==Z||Z==mxConstants.NONE)Z="#ffffff";ExportDialog.lastBorderValue=R;ExportDialog.exportFile(a,S,V,Z,ha,R,W,N.checked)}}));U.className="geBtn gePrimaryBtn";var X=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});X.className="geBtn";a.editor.cancelFirst?(k.appendChild(X),k.appendChild(U)):(k.appendChild(U),k.appendChild(X));g.appendChild(k);t.appendChild(g);d.appendChild(t);this.container=d};ExportDialog.lastBorderValue=0;ExportDialog.showGifOption=!0;ExportDialog.showXmlOption=!0;ExportDialog.exportFile=function(a,b,e,f,g,d,h,l){l=a.editor.graph;if("xml"==e)ExportDialog.saveLocalFile(a,mxUtils.getXml(a.editor.getGraphXml()),b,e);else if("svg"==e)ExportDialog.saveLocalFile(a,mxUtils.getXml(l.getSvg(f,g,d)),b,e);else{var t=l.getGraphBounds(),k=mxUtils.createXmlDocument(),v=k.createElement("output");k.appendChild(v);k=new mxXmlCanvas2D(v);k.translate(Math.floor((d/g-t.x)/l.view.scale),Math.floor((d/g-t.y)/l.view.scale));k.scale(g/l.view.scale);(new mxImageExport).drawState(l.getView().getState(l.model.root),k);v="xml="+encodeURIComponent(mxUtils.getXml(v));k=Math.ceil(t.width*g/l.view.scale+2*d);g=Math.ceil(t.height*g/l.view.scale+2*d);v.length<=MAX_REQUEST_SIZE&&k*g<MAX_AREA?(a.hideDialog(),(new mxXmlRequest(EXPORT_URL,"format="+e+"&filename="+encodeURIComponent(b)+"&bg="+(null!=f?f:"none")+"&w="+k+"&h="+g+"&"+v+"&dpi="+h)).simulate(document,"_blank")):mxUtils.alert(mxResources.get("drawingTooLarge"))}};ExportDialog.saveLocalFile=function(a,b,e,f){b.length<MAX_REQUEST_SIZE?(a.hideDialog(),(new mxXmlRequest(SAVE_URL,"xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(e)+"&format="+f)).simulate(document,"_blank")):(mxUtils.alert(mxResources.get("drawingTooLarge")),mxUtils.popup(xml))};var EditDataDialog=function(a,b,e){function f(){0<L.value.length?U.removeAttribute("disabled"):U.setAttribute("disabled","disabled")}var g=document.createElement("div"),d=e||a.editor.graph,h=d.getModel().getValue(b);if(!mxUtils.isNode(h)){var l=mxUtils.createXmlDocument().createElement("object");l.setAttribute("label",h||"");h=l}var t={};try{var k=mxUtils.getValue(a.editor.graph.getCurrentCellStyle(b),"metaData",null);null!=k&&(t=JSON.parse(k))}catch(S){}var v=new mxForm("properties");v.table.style.width=-"100%";l=h.attributes;var u=[],y=[],z=0,F=null!=EditDataDialog.getDisplayIdForCell?EditDataDialog.getDisplayIdForCell(a,b,e):null,D=function(S,V){var ha=document.createElement("div");ha.style.position="relative";ha.style.display="flex";ha.style.alignItems="center";ha.style.boxSizing="border-box";ha.style.width="100%";var R=document.createElement("a"),Z=mxUtils.createImage(Dialog.prototype.closeImage);Z.style.height="9px";Z.style.fontSize="9px";R.className="geButton";R.setAttribute("title",mxResources.get("delete"));-R.style.marginLeft="8px";R.style.cursor="pointer";R.appendChild(Z);V=function(W){return function(){for(var ba=0,K=0;K<u.length;K++){if(u[K]==W){y[K]=null;v.table.deleteRow(ba+(null!=F?1:0));break}null!=y[K]&&ba++}}}(V);mxEvent.addListener(R,"click",V);V=S.parentNode;ha.appendChild(S);ha.appendChild(R);V.appendChild(ha)};e=function(S,V,ha){u[S]=V;y[S]=v.addTextarea(u[z]+":",ha,2);y[S].style.width="100%";0<ha.indexOf("\n")&&y[S].setAttribute("rows","2");D(y[S],V);null!=t[V]&&0==t[V].editable&&y[S].setAttribute("disabled",-"disabled")};k=[];for(var G=d.getModel().getParent(b)==d.getModel().getRoot(),H=d.getCellStyle(b),M=0;M<l.length;M++)("label"!=l[M].nodeName||"1"==H.metaEdit||Graph.translateDiagram||G)&&"placeholders"!=l[M].nodeName&&k.push({name:l[M].nodeName,value:l[M].nodeValue});k.sort(function(S,V){return"label"==S.name?1:"label"==V.name?-1:S.name<V.name?-1:S.name>V.name?1:0});if(null!=F){l=document.createElement("div");l.style.width="100%";l.style.fontSize="11px";l.style.textAlign="center";mxUtils.write(l,-F);var N=v.addField(mxResources.get("id")+":",l);mxEvent.addListener(l,"dblclick",function(S){S=new FilenameDialog(a,F,mxResources.get("apply"),mxUtils.bind(this,function(V){if(null!=V&&0<V.length&&V!=F)if(d.model.isRoot(b)){var ha=a.getPageById(F);if(null!=ha)if(null==a.getPageById(V)){var R=a.getPageIndex(ha);0<=R&&(a.removePage(ha),ha.node.setAttribute("id",V),F=V,N.innerHTML=mxUtils.htmlEntities(V),a.insertPage(ha,R))}else a.handleError({message:mxResources.get("alreadyExst",[mxResources.get("page")])})}else null==-d.getModel().getCell(V)?(d.getModel().cellRemoved(b),b.setId(V),F=V,N.innerHTML=mxUtils.htmlEntities(V),d.getModel().cellAdded(b)):a.handleError({message:mxResources.get("alreadyExst",[V])})}),mxResources.get("id"));a.showDialog(S.container,300,80,!0,!0);S.init()})}for(M=0;M<k.length;M++)e(z,k[M].name,k[M].value),z++;k=document.createElement("div");k.style.position="absolute";k.style.top="30px";k.style.left="30px";k.style.right="30px";k.style.bottom="80px";k.style.overflowY="auto";k.appendChild(v.table);+"100%";l=h.attributes;var u=[],y=[],z=0,E=null!=EditDataDialog.getDisplayIdForCell?EditDataDialog.getDisplayIdForCell(a,b,e):null,D=function(S,V){var ha=document.createElement("div");ha.style.position="relative";ha.style.display="flex";ha.style.alignItems="center";ha.style.boxSizing="border-box";ha.style.width="100%";var R=document.createElement("a"),Z=mxUtils.createImage(Dialog.prototype.closeImage);Z.style.height="9px";Z.style.fontSize="9px";R.className="geButton";R.setAttribute("title",mxResources.get("delete"));+R.style.marginLeft="8px";R.style.cursor="pointer";R.appendChild(Z);V=function(W){return function(){for(var ba=0,K=0;K<u.length;K++){if(u[K]==W){y[K]=null;v.table.deleteRow(ba+(null!=E?1:0));break}null!=y[K]&&ba++}}}(V);mxEvent.addListener(R,"click",V);V=S.parentNode;ha.appendChild(S);ha.appendChild(R);V.appendChild(ha)};e=function(S,V,ha){u[S]=V;y[S]=v.addTextarea(u[z]+":",ha,2);y[S].style.width="100%";0<ha.indexOf("\n")&&y[S].setAttribute("rows","2");D(y[S],V);null!=t[V]&&0==t[V].editable&&y[S].setAttribute("disabled",+"disabled")};k=[];for(var G=d.getModel().getParent(b)==d.getModel().getRoot(),H=d.getCellStyle(b),M=0;M<l.length;M++)("label"!=l[M].nodeName||"1"==H.metaEdit||Graph.translateDiagram||G)&&"placeholders"!=l[M].nodeName&&k.push({name:l[M].nodeName,value:l[M].nodeValue});k.sort(function(S,V){return"label"==S.name?1:"label"==V.name?-1:S.name<V.name?-1:S.name>V.name?1:0});if(null!=E){l=document.createElement("div");l.style.width="100%";l.style.fontSize="11px";l.style.textAlign="center";mxUtils.write(l,+E);var N=v.addField(mxResources.get("id")+":",l);mxEvent.addListener(l,"dblclick",function(S){S=new FilenameDialog(a,E,mxResources.get("apply"),mxUtils.bind(this,function(V){if(null!=V&&0<V.length&&V!=E)if(d.model.isRoot(b)){var ha=a.getPageById(E);if(null!=ha)if(null==a.getPageById(V)){var R=a.getPageIndex(ha);0<=R&&(a.removePage(ha),ha.node.setAttribute("id",V),E=V,N.innerHTML=mxUtils.htmlEntities(V),a.insertPage(ha,R))}else a.handleError({message:mxResources.get("alreadyExst",[mxResources.get("page")])})}else null==+d.getModel().getCell(V)?(d.getModel().cellRemoved(b),b.setId(V),E=V,N.innerHTML=mxUtils.htmlEntities(V),d.getModel().cellAdded(b)):a.handleError({message:mxResources.get("alreadyExst",[V])})}),mxResources.get("id"));a.showDialog(S.container,300,80,!0,!0);S.init()})}for(M=0;M<k.length;M++)e(z,k[M].name,k[M].value),z++;k=document.createElement("div");k.style.position="absolute";k.style.top="30px";k.style.left="30px";k.style.right="30px";k.style.bottom="80px";k.style.overflowY="auto";k.appendChild(v.table);l=document.createElement("div");l.style.display="flex";l.style.alignItems="center";l.style.boxSizing="border-box";l.style.paddingRight="160px";l.style.whiteSpace="nowrap";l.style.marginTop="6px";l.style.width="100%";var L=document.createElement("input");L.setAttribute("placeholder",mxResources.get("enterPropertyName"));L.setAttribute("type","text");L.setAttribute("size",mxClient.IS_IE||mxClient.IS_IE11?"36":"40");L.style.boxSizing="border-box";L.style.borderWidth="1px";L.style.borderStyle="solid";L.style.marginLeft="2px";L.style.padding="4px";L.style.width="100%";l.appendChild(L);k.appendChild(l);g.appendChild(k);var U=mxUtils.button(mxResources.get("addProperty"),function(){var S=L.value;if(0<S.length&&"label"!=S&&"id"!=S&&"placeholders"!=S&&0>S.indexOf(":"))try{var V=mxUtils.indexOf(u,S);if(0<=V&&null!=y[V])y[V].focus();else{h.cloneNode(!1).setAttribute(S,"");0<=V&&(u.splice(V,1),y.splice(V,1));u.push(S);var ha=v.addTextarea(S+":","",2);ha.style.width="100%";y.push(ha);D(ha,S);ha.focus()}U.setAttribute("disabled","disabled");L.value=""}catch(R){mxUtils.alert(R)}else mxUtils.alert(mxResources.get("invalidName"))});mxEvent.addListener(L,"keypress",function(S){13==S.keyCode&&U.click()});this.init=function(){0<y.length?y[0].focus():L.focus()};U.setAttribute("title",mxResources.get("addProperty"));U.setAttribute("disabled","disabled");U.style.textOverflow="ellipsis";U.style.position="absolute";U.style.overflow="hidden";U.style.width="144px";U.style.right="0px";U.className="geBtn";l.appendChild(U);k=mxUtils.button(mxResources.get("cancel"),@@ -3959,8 +3964,8 @@ T=document.createElement("img");T.className="geAdaptiveAsset";T.style.width="16pya=y,Ma=ya.setCellsVisible,Oa=!0,Ka=0;Ka<ua.length;Ka++)if(!z.isVisible(ua[Ka])){Oa=!1;break}Ma.call(ya,ua,!Oa)}else y.setCellsVisible([aa],!fa);mxEvent.consume(ja)});T=T.cloneNode(!1);var O=y.getCurrentCellStyle(aa);T.setAttribute("title",mxResources.get("lockUnlock"));var qa="1"==mxUtils.getValue(O,"locked","0");qa?(T.setAttribute("src",Editor.lockedImage),mxUtils.setOpacity(T,90),pa.style.color="red"):(T.setAttribute("src",Editor.unlockedImage),mxUtils.setOpacity(T,40));y.isEnabled()&&(T.style.cursor="pointer");mxEvent.addListener(T,"click",function(ja){y.isEnabled()&&(k(mxEvent.isShiftDown(ja)?t(null,!0):[aa],!qa),mxEvent.consume(ja))});oa.appendChild(T);oa.appendChild(ia);pa.appendChild(oa);mxEvent.addListener(pa,"dblclick",function(ja){var ua=mxEvent.getSource(ja).nodeName;"INPUT"!=ua&&"IMG"!=ua&&"true"!=ia.contentEditable&&(d(aa),mxEvent.consume(ja))});y.getDefaultParent()==aa&&(pa.classList.add("geActivePage"),pa.style.fontWeight=y.isEnabled()?"bold":"",N=aa);mxEvent.addListener(pa,"click",function(ja){y.isEnabled()&&"true"!=ia.contentEditable&&mxEvent.getSource(ja)!=da&&(y.setDefaultParent(ka),y.view.setCurrentRoot(null),mxEvent.isShiftDown(ja)&&(y.clearSelection(),y.selectAll(N)),mxEvent.consume(ja))});D.appendChild(pa)}y.isEnabled()?(ha.classList.remove("mxDisabled"),V.classList.remove("mxDisabled"),S.classList.remove("mxDisabled")):(ha.classList.add("mxDisabled"),V.classList.add("mxDisabled"),S.classList.add("mxDisabled"));M=z.getChildCount(z.root);D.innerText="";for(var W=new mxDictionary,-ba=M-1;0<=ba;ba--)mxUtils.bind(this,function(K){Z(ba,y.convertValueToString(K)||mxResources.get("background"),K,K,l(K))})(z.getChildAt(z.root,ba));L=W;v()}var y=a.editor.graph,z=y.getModel(),F=document.createElement("div");F.style.userSelect="none";F.style.height="100%";F.style.marginBottom="10px";F.style.overflow="auto";var D=document.createElement("div");D.style.position="absolute";D.style.overflow="auto";D.style.left="0px";D.style.right="0px";D.style.top="0px";D.style.bottom="32px";F.appendChild(D);-var G=null,H=null;mxEvent.addListener(F,"dragover",function(Z){Z.dataTransfer.dropEffect="move";H=0;Z.stopPropagation();Z.preventDefault()});mxEvent.addListener(F,"drop",function(Z){Z.stopPropagation();Z.preventDefault()});var M=null,N=null,L=new mxDictionary,U=document.createElement("div");U.className="geToolbarContainer geDialogToolbar";var X=document.createElement("a");X.className="geButton";var S=X.cloneNode(!1);S.style.backgroundImage="url("+Editor.plusImage+")";S.setAttribute("title",mxResources.get("addLayer"));+ba=M-1;0<=ba;ba--)mxUtils.bind(this,function(K){Z(ba,y.convertValueToString(K)||mxResources.get("background"),K,K,l(K))})(z.getChildAt(z.root,ba));L=W;v()}var y=a.editor.graph,z=y.getModel(),E=document.createElement("div");E.style.userSelect="none";E.style.height="100%";E.style.marginBottom="10px";E.style.overflow="auto";var D=document.createElement("div");D.style.position="absolute";D.style.overflow="auto";D.style.left="0px";D.style.right="0px";D.style.top="0px";D.style.bottom="32px";E.appendChild(D);+var G=null,H=null;mxEvent.addListener(E,"dragover",function(Z){Z.dataTransfer.dropEffect="move";H=0;Z.stopPropagation();Z.preventDefault()});mxEvent.addListener(E,"drop",function(Z){Z.stopPropagation();Z.preventDefault()});var M=null,N=null,L=new mxDictionary,U=document.createElement("div");U.className="geToolbarContainer geDialogToolbar";var X=document.createElement("a");X.className="geButton";var S=X.cloneNode(!1);S.style.backgroundImage="url("+Editor.plusImage+")";S.setAttribute("title",mxResources.get("addLayer"));mxEvent.addListener(S,"click",function(Z){if(y.isEnabled()){h(!1);z.beginUpdate();try{var W=y.addCell(new mxCell(mxResources.get("untitledLayer")),z.root);y.setDefaultParent(W)}finally{z.endUpdate()}d(W)}mxEvent.consume(Z)});y.isEnabled()||S.classList.add("mxDisabled");U.appendChild(S);var V=X.cloneNode(!1);V.style.backgroundImage="url("+Editor.menuImage+")";U.appendChild(V);mxEvent.addListener(V,"click",function(Z){if(y.isEnabled()){a.editor.graph.popupMenuHandler.hideMenu();var W=t(),ba=z.root.getIndex(N),K=0<W.length&&y.isEnabled(),T=mxResources.get("nothingIsSelected"),aa=y.getLayerForCells(y.getSelectionCells()),ka=y.convertValueToString(N)||mxResources.get("background"),oa=new mxPopupMenu(mxUtils.bind(this,function(ia,fa){var O=ia.addItem(mxResources.get("layers"),null,null,fa);ia.addItem(mxResources.get("selectAll"),null,mxUtils.bind(this,function(){u();h(!0)}),O);ia.addItem(mxResources.get("selectNone"),null,mxUtils.bind(this,function(){u();h(!1)}),O,null,0<W.length).setAttribute("title",0<W.length?mxResources.get("selectNone"):T);ia.addItem(mxResources.get("invertSelection"),null,mxUtils.bind(this,function(){u();h()}),O);ia.addSeparator(O);ia.addItem(mxResources.get("show"),null,mxUtils.bind(this,function(){y.setCellsVisible(W,!0)}),O,null,K).setAttribute("title",0<W.length?mxResources.get("show"):T);ia.addItem(mxResources.get("hide"),null,mxUtils.bind(this,function(){y.setCellsVisible(W,!1)}),O,null,K).setAttribute("title",0<W.length?mxResources.get("hide"):T);ia.addSeparator(O);ia.addItem(mxResources.get("lock"),@@ -3970,8 +3975,8 @@ null,mxUtils.bind(this,function(){d(N)}),O);ia.addItem(mxResources.get("editDataO,null,0<=ba&&ba<M-1),ia.addItem(mxResources.get("sendBackward"),null,mxUtils.bind(this,function(){y.addCell(N,z.root,ba-1)}),O,null,0<ba)));ia.addSeparator(O);ia.addItem(mxResources.get("selectObjectsInLayer"),null,mxUtils.bind(this,function(){y.clearSelection();y.selectAll(N)}),O,null,null!=N.children&&0<N.children.length);var qa=ia.addItem(mxResources.get("moveSelectionTo",[""]),null,null,fa,null,!y.isSelectionEmpty());y.isSelectionEmpty()&&qa.setAttribute("title",mxResources.get("nothingIsSelected"));for(fa=M-1;0<=fa;fa--)mxUtils.bind(this,function(ja){var ua="1"==mxUtils.getValue(y.getCurrentCellStyle(ja),"locked","0"),ya=ia.addItem(y.convertValueToString(ja)||mxResources.get("background"),null,mxUtils.bind(this,function(){ua||y.moveCells(y.getSelectionCells(),0,0,!1,ja)}),qa,null,!ua);ua&&ya.setAttribute("title",mxResources.get("locked"));ja==aa&&ia.addCheckmark(ya,Editor.checkmarkImage)})(z.getChildAt(z.root,fa))}));oa.smartSeparators=!0;oa.showDisabled=!0;oa.autoExpand=!0;oa.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(oa,arguments);oa.destroy()});var pa=mxEvent.getClientX(Z),da=mxEvent.getClientY(Z);oa.popup(pa,da,null,Z);a.setCurrentMenu(oa);mxEvent.consume(Z)}});y.isEnabled()||V.classList.add("mxDisabled");var ha=X.cloneNode(!1);ha.style.backgroundImage="url("+Editor.trashImage+")";ha.setAttribute("title",mxResources.get("delete"));U.appendChild(ha);mxEvent.addListener(ha,"click",function(Z){if(y.isEnabled()){z.beginUpdate();try{var W=z.root.getIndex(N),ba=t();-0==ba.length&&ba.push(N);y.removeCells(ba,!1);0==z.getChildCount(z.root)?(z.add(z.root,new mxCell),y.setDefaultParent(null)):0<W&&W<=z.getChildCount(z.root)?y.setDefaultParent(z.getChildAt(z.root,W-1)):y.setDefaultParent(null)}finally{z.endUpdate()}}mxEvent.consume(Z)});y.isEnabled()||ha.classList.add("mxDisabled");F.appendChild(U);var R=document.createElement("span");R.setAttribute("title",mxResources.get("allSelectedObjectsInThisLayer"));R.innerHTML="•";R.style.padding="0 2px";R.style.fontSize=-"16pt";R.style.order="1";u();z.addListener(mxEvent.CHANGE,u);y.addListener("defaultParentChanged",u);a.addListener("lockedChanged",u);y.selectionModel.addListener(mxEvent.CHANGE,function(){v()});this.window=new mxWindow(mxResources.get("layers"),F,b,e,f,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,170,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.init=function(){D.scrollTop=D.scrollHeight-+0==ba.length&&ba.push(N);y.removeCells(ba,!1);0==z.getChildCount(z.root)?(z.add(z.root,new mxCell),y.setDefaultParent(null)):0<W&&W<=z.getChildCount(z.root)?y.setDefaultParent(z.getChildAt(z.root,W-1)):y.setDefaultParent(null)}finally{z.endUpdate()}}mxEvent.consume(Z)});y.isEnabled()||ha.classList.add("mxDisabled");E.appendChild(U);var R=document.createElement("span");R.setAttribute("title",mxResources.get("allSelectedObjectsInThisLayer"));R.innerHTML="•";R.style.padding="0 2px";R.style.fontSize=+"16pt";R.style.order="1";u();z.addListener(mxEvent.CHANGE,u);y.addListener("defaultParentChanged",u);a.addListener("lockedChanged",u);y.selectionModel.addListener(mxEvent.CHANGE,function(){v()});this.window=new mxWindow(mxResources.get("layers"),E,b,e,f,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,170,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.init=function(){D.scrollTop=D.scrollHeight-D.clientHeight};this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));this.refreshLayers=u;a.installResizeHandler(this,!0)};(function(){Sidebar.prototype.tagIndex="5V1dV+M6sv01rDvngax0oLvveYQEaGaAziE0PW8sxVYSDbblI9uk6V9/VVWS7ST+kB0zL3etbmIn3ltlfZRKUqkU/rpRLN6MmFJym5yM/8QL/Xnw7yLceXQ03fA3JaOTyfjCQCKZehvu66tErCMW6J9E1M4jlJcFTJWIPP1VIKK1ixj/zML4VBRiTMaf9HOKx8G7/lwy71V/ZJEv8Vv8cKea9KW646tU41nk678/4tK7SZVu5FpC9oz/TDPVnkEPJlsn4wVma1lEnVemGByy6q+M+SXkSmaQ6Vv27gJeBDzyOQDMu1ma5FVEEVBEtuokgQhdyZ62Uv/9qWWoYPRltgx4A3U970/hc6BnIuD+kdI+KbGTcelGce6ec4evOBl/k0r8llGKtWBTvulF98xVKjzEvxWXDVS/M8VHF57Hk0TDpzpxJQGScC9TIoX3euXvVV/UcWWpDFkqsCYyfaM/1ly36vGfgVhv0oiasyfh7ypgyaaBaKHl5/nThqb5VeAvZEigXx8k0AolJJUkVjo7jGBOHFOm29Se3FZin6VsyRL42V+2U90z9crTOGAeIEK8Q1UCnMlGxk4CLWb/gsflKt0y/MLnbzyQccgjaIivAjgTT/Gtr4Quf9cXXWRLjRKxyRwvkBko75hHnjisPzUkP/kyESnHtwoAtQ7kkrehL7UyzUAtLrh6E5g7Nnn9iYo2SWW8ZVr1QYsTIW8gE+ll5kHWQlXGdr/Qug1Zl/RDe2O4FL+fWPBaiJSUZGoDT6HRYT3DN9Gdgy4agY3Q59gj+iIOdAOB/MmYYlHKqYp5PMLaFHMVirSSG2XYySnnZrGHNW19JdaZoiYxGV8LbGq+9DKsT0APT3Sk1ldzXaZszQvOpfzlkndUYodytAPDOEuxuocyEqlUmM+Jbm6HevkAq0sAW8+MB9BmQJs+8HQr1Wup3G2zL6uCetJZjXKofV7J+FLnUUWtxZyLTYa20FzpV1GxEgnVdxH4JOgyS0QECr4F3z3nEUHWUQfUjUi/ZUv7tjqTGaCkl0q6Wou0Ef9tdhslUBAn9Xq4GshZkG6gTmx0m8EqvuGoYzb4iwMYdDnVMcpbS2QM3TYB3mM0Sp71/0fuSVPf7lmki1d10DN3LE6x0/CKut+GuddVgGpRyFCtc/sZYS/Cm9FySdUj3sgIPlOZeZvWNAm1o0uTXH81UO3zZEEqQDkwD5q37t+zdAOqNe/RS/aJ6Tdi5purBt73xV930PiLapT8HTTXqz2Kh7JloQ26bIlVOtAl6dIY9uBPMhbeCdgtu/ZLJeEe1XdduTSPrpc6v9+TlIf64jakMpeQ9RumQFVr3YiV3vcb+eZyy9Viw4Ogl1p+nM2xmofSyNSdYgHjnSzA6m26fu+wTKtwYM30S1LXTkxPsYp0qp+nbu8yg271r4xnWM3/hoseBI+8qttygmLlSfLhZtmsS7CZUd1Kds295iT2m4dTh7aH0qLgF2QqGo5qVVdLtHiPvIp2mdDXinvvXtBgGhLRI4/1sJs09z5TqY6sRCNVqlU+2qxPDNuRuxm20MqLmqNOO3CqHRqxEGEclC3jNtATkMOLhFZpOynrH5FAc3UlcKRsbJHvy/9wD8iylUSFJHhrrfmRYBPaZCGDZ2Mu6QXolr3prFf16OdvsxOjqyqUVPXzVEngw+g2Qrur8WehCxWnqu71sE9gv/QWnrSalK00WglxllLFX+VXVaxv1TMae7yFcRrlV2059PNiNr2+wdxh60gmKamJ7trRDvIm4xsecYXqxI7z6sQ5pICWKDHp6jFiEyjpgtLioL1lU6MmSu3VHZm0QtcI1RVNeCPPjIeKHnuZLamxJzHnNIzdyIzsV2+DJm+Y22ZVlPINS35AxuFl1Bo4nQ5IJ7PIfxyW8xzGplLgaG9BGginPqsrUhn55RCZiLoxbRn4v4dAbkYubdBLFkWoRfXYs24CvPz8lGzpNZchT1XDzN8OSEkcF8ZBhnP+1cq2jJgddJORxMmOmMX7w5A96HXzILoS882Mr/IBWqAHTcjxejheKQPvJRo3kWNuP0g0msMlzn6upFoK36/o6A6R34t5fG0RKMGiNdXSwyFVJX4R6mwE9Y+GsodSb1gcv7cCTRUWmCEx1rI2SAbsPvY2+m9QmTl7mCeBdrAdKeMnTGC24X4ylMvU3qWtzY2Yf5/QdB+kwyKPB1i9agqkwEqZJqm+HLULWY27rx0Q72mUWoass8VjGOIQHihN0cRKenQVagMsqEtZ40YXPq4geB2yGWCXNjHdvWUBLwzZJqO0hL+TVEJ2va5urbACZWbCVYXEuLKywZep5bhnERlBRuANDHRa5c1HgwZlFJY2kWnipFFzIUE+znKy+EtINIQLcbvWDo8tdUmlOANNl1A7/85EXGmvHeBG00tYB81LS0AuLBVnVATUY8Ryv9DreSbjX5/Gw7BN6qTSVmRHniapOrKd1UqFa33dmLRcn4eiO68TzJgwXYga5OrAdj+l/P+s/3w5u4BXnkOdFpGwo5wOb+7Cf+7CX/0GtfRfzjCN8YfJX05g2BeQMAv9mxwCtgIWyOwr5L/o7pR+6SJ3Fe/5QLwwr4C6BIv1fKyzpToXHJTbLiG8/GQotrMJyTgA31zp7sYz07uavDfhI0+ET93fNFPKrlqZnmkCBaS85u7Qkeu8E9ciU7jYt/Oin4Cirkdwp8G3qlPh7jTYKupVrjsR5kytjqzkeYIFXRodnI/DcJL3VsvKmexWjgEoQCsdT/N5gLf5grrxeJ6vHTm4gO6UlxdM9fCJr5VdTooZGIdRDXwVSKniAK23gL3Xr/TsPT66RK06s+5MS1xeX2UqEqZDcGRYCDPKrMfWwKV89WhCtCt0umFC9cHJWKCO87lZ93ND0Yx1Ilesax5NH5/A6H4+Kc+ulmZcK+SoYJnx5BWnwRUNUOzoqJMouyS0VN6PSOkRm10jTnAgsGXKVzQTWkNVwXMVcD3cwHzgiccCc+0iwrV+eIB8vYYrzXPHQmiE1ZMQ1dCqZe8YRowhM391K5bkoGWFgTnpJC0cvypov69W1PHZKu61VvUKlrlgOFehv8dRqYiSVFVPrFeh9R+a6FKwUKF/2DYN5EtABZqrc/t6ZBF2b+Aky+I4EDDf0hE76YPlKyXWsFCNdaYrfEHqwDPaoVMBPZl25/OkuXfYh1AuGViPJI2HzBH4syPx50fiP/fFS0ErkVp1KFpUCxjqH1AdWqWlSspDr9t9mp8sRe05lZKcAbbwhWfvXCT5uaMGgh6KpJLW1xfoBw3LaFijA7pLbA/dLBaAHq0vExEoc+vIsCVvS8dsgKfzHs2zF5UcNegfdc9XQw7LtzEBEfnVuw5qsk9o/ZpU+TG0Qy5lmqJsZZKl/bKVR1cmoRI9kMKywhvIGYGrFIq+bi/73BQ0hZ97urenL6JXo5mqakobbtIVV66p/w8gNxay1cYALkHB9QnaBuTxx//OCudewXQalev3OcXoIopkah29PmH7C415oHVru0dODdPkGKapDAJyVt7oUe06YBVuotXIfZ+gJPdtaYfWuto0odAH8LSEDeELJ+eFgmTOYjMjHzutTu3jF0WpG5cTsOdrF/oO4OA7ZEqfB4GIEzsLWN3o6/CT3nipaAhKotcVWg06C0PjypdFnnW8zKDa16wc7zM8ads4WfHympGqW4QkbMBZ9BJqM5HWi99YkIFBog0Hzio7lkrk6FpEIqHNUzdS+rD2lUqc/dJZEPYVaHSDy8bczBP5mZ0nMo6LJDO2Kt7crnZYv2dpIkqO4Lj+UwiaZGA0N9XXHbZnPaKg7UVm+cmsVbpgLwQqTBDlK2QRjYqU9WGg36q1rR4EKSmgVoQS93g0qWbzMLnj/zKeThc2Ny9xdcxvW89tJ4FBZ+TrYS822IEJJ+OfG7MBproKdaU+lm6ha0k6VD5Wkg2Rn63EH5QRvWjn4LGOw95S7TY+lo3TH5bgr0x4r7qHlmhA5xdL8inC2+X+qnIjibHk+hEt7HPJHmiPr5FDKwqa25qJBIaLoGOvda+c0H4n10rRyKPrgymjDoVVMM5x8qynOBbcSwY9gDZTfidm4q9hNigH6Zq7EjwAgaEWn4CdRLdtSHCS1yLr+oE6voukO1CwEDCn2jNsm2CDCNlvtAe2HK3BYr8H2yZ1uJHuZl7so7STbMGZwqkd6+yc2C8a0q/ngU2T1/pvyFPmk83Tn/jK+AeZjy7QxdUCkrSe3NbTqNgL40jzsEOzt6u1D9tkTG81GT/skQ2ayLenp/lHp2H3zgzG+tdOZtsNHX1oJuNi99VAhH9Z9NF0P6/LNDBfboa6fZhgGdkTPhmqg3Eaf+zelGaa70Uruxfjpw7m7dWUBlIMPOJLqqEnlbYw7m/rCMN8W4EIq3yU28lRr/00O6EP07B7pPtJPgO3BzSObqMkNTPyh4nQVpli6C+Kh7umeGXIdYrzyrTE4a54V+7GdziaNakWdy8rutDfP+5Q6uGXHqZnFasiznRQXfSQERvNwMTfZtcLB/4N88lR1Bd6tC6Wmg+3UpO1nNAGReekn+dT/fCb2QYDbrLizeyyPyxWZ8bSBMBkfKP5KJTH8MncwhpdhJEJPjKZR2kWM4anfp4/4AqMtort1M9HJXJkDjXvCa99fDR7j1goZ+Ci5eNlH6zuA1JT24fiScpErMTelfGWWtwxQgHFjjzCtuJuPPlabFdZTK9hY7OU1LD5pjsLmKV+V7LRWsksxq1hcNHhDR5nYFYqnRg0I1Y7DGhmMD12qaM7njEng52y6I//yONAG9BDsy/0hb98H4T2Hv7Q9t5BMyMPDTB4Nn9XzMNV9SGpaZMwKq/cRu6MBdc0PRqMupDoGiLfYQUGNXqIoSzglobh11Ll0aDyYCql7wahxgrlvX5sEk9cZ8huDzRQKtakbzDk+1FCGCwTPmIQ6tuLe/08bRLHSBvMs1uV8of6M2tpff8UM/Pjklg8LY7ij2R0alrmSxLrke4KNjZKlWGvuIKL9jaT+K844epjeCsbzgtnkPNwXuM/X3fC4BwyjB44eY2kUW1gqzKElvowWzyKevTim5hHprYrSXGfbPU290OwgmbZRoHEXmVmBwR7emHQ9K589FG7k96B/hk0nQWuRNKy6Ee92NUl1NrCPFkWodFqXT7dWLX8EYuTjUw/LIFnGWQh/wD6BXjF5f1UsZTtMB/UxgsRVUy8uA9OYDJGlyEbZyNpS1HacBx90z06HU8knhzZ+GJAVIo1Vl/L92CjS6WtHnxx8r5FZ4xmPbZPYWNQQGbmEnRmuZ+BSxs5k2zBqQJpskiklWy1PIuQ4XrcZbGXdyOzpNmGIhLrhZhgucX6peINVyxIRreX0Gvda5tspRgFQCo8FlPjIwyemeTOGHtHJCIiCLF1sTgfj3fTib1jX+DJSDoQaa0feE+++5K/Z4mSnEGL3N11JS8SdE9HeEraqGfFD0fVEJwXKwldJ25PbrDKdG6T+y0F1RlOcDth5Q1LnHvED0S48Kx/2FCEsd33NxRhFplVkqLAB2obiywGV+ucayDaPEbVTg7QOnlfSrsfbDAhf+w3rmPInvWoA13OtB5XbLiyp9hIlxATesgqVVuZanqbKm6MJh1Y9lBCLL9k9Gl8cwW+HVN5dYJRLrKWiYZmurNPX2FH4z9mJNcfpaWJPKJ1YKpu6aZ3cv+m5HAb00cnVoSnzXdi39v8OjrjroXiW7JZiggXhh5ecLu4/2OIdA7Ih+C08S2Hz/Mi1Fqe56VEdMY8L6Zn4/H4j64J+gKCZEl0trLXXWAjGMsGJWQg26I8EcMmW9IrrmlhBZrg+JIlHLZJUsDSTda8UlJHNIXvj2Y5Dm0N7+NY9pee1o2LUIfB7vYSCPXf0b/4OxT2bsD8RsTjfKH/6Z9VXOcwfICpjK3rhMzX9DytZOyWPLfXrWCUPg9NPwImrq4cFDp2bgze3FOyVbYDpm9SprndbD67s+TRiPMDD27nJfk83rKrqZ7X5xQq0q9YDHNhWMhV5/fLowhZv+42gEJbG6qJssvEbZBSVOXSZTsKYuja+uiYEEIglnuoh940Z5eYnsnancUvHRghyGUuRsN2kzpsWYZVmcuVBAd9W77MgSF8cWI9JZs5sAeipm0DrrRhtrqDCGj+YStWogZxgwj9oEfBAkdsCZHMvHQ0uwCj1xdrQQeRMG1SSzqzI4JDRSpiZTWQ8TCDQIm6wsMEi66wv1qClVex6HKgZJe6zcRte5SqGO6zX6dWll1JmiVrIz2g68ZgQnab6IEXIcRmwh3ZYRxAHN5hGCfHMT5dGKlkiVuP1WAvj64TsOvFLGDWJOJAP/lY+rOPooctUXaFcG5CMCa1a0AHPB6LmSeMTZjfdEePpjmWiipzbiI1JJMhSCDb6SkZvNPUfwVnB0LYx541RzxuJ/k8hFT3ptWjI2OJC8b3RVLQnYF/CSf9GYYUlJRr45LCdn5cmnOM+J+nGctEOKfpC22h0DCFPGOcUCZPT0PubViEX01O6XyqRR4tbFvn7ONCdyczP8nnzoqrvnzzLNmUx3kP0PNFsKof4FFvGGqlYWNjR/bvu+xaITXs0W3mplMCaGSq9dDgslfw95VecO/809fRxfT0YkqMuRWRmxYdiWa1RIXZ4s43G5IMY9p07mxL6Mn4UtAY33ZVfdkuC2NpZQ2orngTjbcXfnaxl7EVNqU7WUX1OZLvoBYVfDWmbgulWK24yneHH1cVriJPvce4Kh95HZSwgX8Tx5T8neyLftHFIDycVUHfSFbhqFqHRluMTCF73Rk7urVIY0gLE+jEreOr5DkbiOfzMTy0c16rX25fTSgzM38k16QXl41tRaVVG+mqHQ9Kj2tRjO4N49KlY/vbrXN4V1f3WuAjOGZmozND0lk84L9yZ3zmzFEzTpQwu8YD2B2viUbXWWKDSOkmchQHFhbnzo2qkgRHQ8tEBty9dVYSnR8lzW0QZLBgZ46HuswCmA8R9ltgtcHh8HNJD3RKA4PMUdZbLlFOtrvUhnEyICPSHGYAsR3mR598eOA4RDUx91qTOIbeVNIBkpDJiqcJlB1dnsAJOg2hOSqwoxkt5cC8PixAfV9cX8Gqx8PJzjAM7N5oP9h+T2rYzFYabfWizslupwMJu8s4qIywhoDnZ+gK/DqkqPM94mMlfji1sFJxfTppGJD3YpwMzng2OOP54IyfB2f8cgzjvK6saydCejFOBmc8G5zxfHDGz4MzfunPCEXQt3+YDK4TahiP0Ak1jEfohBrGI3RCDeMROqGG8QidMBlcJ9QwHqETahiP0Ak1jEfohBrGI3RCDWMfnSDjVL6Y+cxIeMnoK67frkNzxEEetjrhb7XHe/VlzX35Z/NSCj73REj+FIdndDml9mfNO0Si1lGgL+nuK5gEjn+Du6vZ3iiMhyK1J7EeLjJ0IJ0MTApUp8xL0fUFY+1PIThD4lH4kcAc0ZZ7fsEUO87W7k3yOaX2XX9x6sksJg8y+L2461euSImrmyKhGTR4ZOeLfsTzjUylzdYYbqqzuZbvRY8OMSAUjkF3l2M7rL3GgfcSMN/nCg7P1gX0PUvjzEbVbDt124lo0ptoAFl6SwF7LF4S3QbMsrY0LjilL47hGt08fS+aQ3tDMPNvaYbHaMjVCm4278rUQudkb2+mtp+2Z3RgWoYf/YJS812Jv/v7mYQmH57QA7rd3d5cFu+VZMFuaksRSzpcr7Lp9ktr8l9M6+y/mNb5x6Y1f5j/18prJ60PLq+dtD64vHbS+uDyAhVlI6M799fdE5h8YAK31gsPt6BVaZt6RsUp69DTk3fr9ROx1h3yS5LHHaarfvARrtguLAODtUQzBeyZU8d6kM5KpOZkDlwuH5J18iGsZwOxPmOw7TcZpG2xuxs4cH33aI5Jd5J0A/u0wKZ8oZC56GjUdHaNAwVZp8aD2xqnlQ7dlXy5uknqlI8rfmfa4p+V00n/cZ2kaqGdDEA7r5a267C7hbLPjMiWvXFYo0Y/ZnPdiBUy+ToCJYpL0l6tk/j+06MLbE6e4m3OCmUMBlbBmIwYySAVIUXwCUXkNy1blzguKWaN4jE6VDljtma3rNJVX2ak5eHgFEcCGB0nG3TrWcrDQ+wrQdSQmIkm0+0tpXzFpGTTidwVMBCtiEwAsXob3RfLWCX4ypxyl0oZVL1mDXTKAh75Jk66e3WYbjBMgC8SL0vqzqOpBO7WH5vDDkAZ6haFYTV80TxG3EGhkULjQpwqMUeO68F4KirOKKgkwXBn/2FvzDVZc9pEc2C+SiA3Pgq6yskW3VGGFYeCeDJ2blwWhh1SQRGzpMmTZIdgizN+NtQNGoLctdpe2WPnJ+N/XIVx+o67L/O4wYoztyZe5jFhh4EpiyoZ6kje0SLH+OEmmkWxpN90tkyJ4zpgyWbHhcM19WsZkH6Ras0i8du55AloXNdaztzYgSmjVSMTb53tH+BUg7xhGZYONOBme6EMCujYxrX+rN3BeYD6xunkoQ3XlnTdTqBDlETN0hSK5ABzV3IzOXRyoYOyyjWjlS7C4Gzl2KFuctjgTfkpR62bf3bRrzgai5lv1GzlwbDVWPlKbkk35kykmnDxNfh7Eyk+b73cNsoi+HsbRY71qHcpDnlyBic7MhgeB3Q5TsmbJMsckqeTLbVSk+tI5EHclWjjK84IzRcv3ASRtGEiPyEv+h/61AUTSdPlpplatvIkMKP6LPiW06Ed6OhY1wfKmLYftpG+gY7Fc4RyhcXwxBznF3yQ2LXoERXmbJgl6LsIFIGoOEPugOC7tnWi/CywOxNXSxuzuPakZB7BoTLnqxhxGxNtsOAVRmUdSnF0fvb2MtDBzKimE2/MA2mNB7qTEI8873ZXiid0El/MsdYrniqHt38sni8oclZHCnqsvxCLcqZV5+t+fnro/r7m5ryWStYNhRnMYvM+Tnm60EOFmFThlPqfZeZcvRe6EzZntaWkS0wsOJ8spTa4HjHk+6Ibt48fQlPMCVXtlFkLkvG2iMbZYpnXMBwMWHzFas7yPYRn2FSxmTraXlU05nQ71NwNh5Uc4uTB2MANp7Sh5+EmdN03vFN026Vw7ud/xJ2r5Q8KdgOHyTIb+oN5bt1bHpGwXf/vNj8HUrMgLTPqDioiQ1eBf7KAoiFR2zLDcwecuIa+t7TluwWGYR+m9rzA4ghBJ5iZsdwJqknTOi4mHXJ0HtARirSFPaHPBXL1KyZjxYJaSwJh5izfLind6Vpr9KPN18QcHuVG8GizwuetHvkllLGJuoi6sGeG/eObVOI3NJkAhoY154U58DxDm/F6suBsH7TdDa8wy2tA3fQ6YlC9NOXTGgF0TuGI+bD1SyTEX3M0aAXOM1NHtJU7n0ZywCkYmwWjBz30PNV21NvJzuSeO0EfLBzLSaFI8HQybXkJbo+4tZ/tLMW0krl0QcGMLniY2CkXc+kC1c9lJPUyS1OcetH6+4SiDIMPmf4dGpT+0lgaIX3TQmvUXIL7tS5MjYlzg7gjwTfSQF3xN9z0aDhTy1PUXKarOmnpnCoJzWDUmgLFgLBZGF0hcDmELWGhtiVWVYyHIcbCnNNabPDKOwolTaRtHq1FxLnabcBlpslwVCMGezrNyo69hvxMhe7NKq2yCuzowiK1zpsqmSSnl5yFGAIM7kBRVJ1H68B2DYvgp5cBwwNf58z3A5yua4hje1NQxjHTqlC3Bed2VIAx6JNYZTRNUNy1A2UYw6GIJmxFftcFSGvDF8JELCgYOq0S75NO7UvgzpwS72R8qv8/ZWop8DTbmR5fknemaluT2kvj5fRFJLLje6ss2UCcubWuqSZOMX53Uj4XDH+0nxTziHBunKMpfIOWCGTtjU0KwgfbJPYIawXWuUKzqHiBn+9NQxjAUFssWiW8m2z0WSihRldm5Q/ElaZpXEz/6FMhmihnSOm+CF/mw3DTbBjZdrj6CLXi3E5041VrkdJWbsdN3SXA6E78nQk8jJVwWuBLIXHTLNl9S9Ec04PI8pHWKvfRbYEEcvuS8CixfoyRS1PbcJa+8F+wBL2m181vTnDqPM0v3FlG1+IX+QKnipndmk/ZksMe4W/ANBlflVJJs2W7StlP4oAHehqJJ3NiUn8MSXwN4xO/eAtQGNcsGjSN/bzqTf4DMn7D4rLAvbO91851AIa6CmB9wgvHx0e30ekd9TiPUo9cwMH+3uBFFLT571cSLcAO8roTkUFVIjoWj5N7XieKjDzA4dPtYd3b+jiPZCB+xaTSDirhaBFZnWFuWhNLdP3Sb/diemM6EMb2ms3QNzgeGsc+dOUKGM1ktsSZMgjAqTjuIn5idqksZYIGnp6A8MItr205EY/N+dkKcxzX0bLo3kLK9I8hiEr5BNFrh+KEfgwopR5JhgOTPkq5+gBK/QFjy4GFftODSX9ILqqJg5X/TGjj1R8yV3cYSdoPqRDXLMCAGUNSBtJGzhgsO/Y4jyg+xbxXE4/UhoiespQF77gOa0e7eWi0s/FkrD9WNG0CW882fBvwlNxvvFfyzRgorU/HptUVBG6zdODOGk83i2jQkJ/09x4uccbM/F6NH7EINuHhNEZktuOlMlO0SkxXYfnHZpoRBlaYybU5t2wpfL9lQyThV1L6NUm34kZThkF9C91FPjq0dLTEeyeea4Zle02yhLzFiaaEfORJyjLFIrtJa9XA0Uow6UZAnjseLcPmbjwh94VHlsZGJvFhyLlaFp2fuFnzDo/N8PQNxE4Sv5tiJNcw3WJ05d/Mzi2K0n03poX0KACac1zyGqKn2QyqF6wS7MV+zr3Ffc5W5pn9sNl7vLq9ZZrziinM8xgi12CwVt16W+ucAf8z04VDZ2xY+BrLXtdGBSPi9wrCaqp7RnE87+gFdANgfrM75R4c7dvjxeDKy9T7IFTkqpPoAXYQiJZlrB3kA4/TjEKfHyvEPMjQ8/9oogUz+xaPZ4rkdhWwV3hy27QQUIXFY31wI1PasqxWgZv0xJ31xJ13xv3QajQbpCI/82OJnMLpHwJG11x3p1i4shPunlAdMbY+mDQ74SadcT/xlUw/yfthJ12wCVtxPGJgw35XmVR1CLBmupkxBU53VCE5e4Jdu6a1N/jU1l1rz5B4AuZARroHljjTAMIHFadYVUBjqegcRrgofTqgIKykRANWm7VhSMLHsnbdtYLhX+yd4fYTuTUr3ZK8TFkk6wIn7BA84rk3y4CZBY38HByV/9CefZZqa1Lfl8YJ/XyCfkewgYfsgze+EV67KWnwCyZouIcpJvqubXp6Dx4JM7UHUTRkQsZPvlpZHKKVgpsUaIrDDQU11B6PcKoPHFdt7I03bXa7mAqW41X3yDo3lSmmJL/vwBFhASlaZ0jsXfm6MfThLpmtsXarWZdaWwJP3MEp9za1p9FUGY8NLHuHwdEZkWHpAMndYxfT4lC6Wk739fkD6OMCDguCJSBoA4IClZL1lcDRBKiPmgie8rc3xdFw+kwjeHIM+OwY8Pkx4M9dwLDLEephqUG/cXOaBJxi241gdIG+4kXW43VXMcosk0FYzgZhOR+E5fMgLF8GYfnan+USwwljIWfLACtK/kQvqslwVGfDUZ0PQTVlefBuPZhz8PpuYJkMwnI2CMv5kSxwXGOqMvSUXAmcQrK3XWhuFO41mYyfKrRZTYG1ki5oNfaSB2hC6bslXXbkMUtOTIXkCwSfOD/vaNHt0ykmoqEaniUbpOlZskEanyYLB3zLcLiXhOpJgh1RuSzNZBias2Fozoeh+TwMzZdhaL52pzEGUM0iQB1kRM61k/HD1QkeK5NuTjntucUb3rj/tprpZ8605QWTue7CtACZEpkVMuFND5kWP3MmIwfedJDpkq3XNBgIMnvlDFVLdMVZ0HaSDRPKa4knt0sAoRsm4wvsLhYye9Oj0RIfhHRISpdp4+kRO8y0lcR7L3nwnGCMOLdFAsNyFfA3490RiFWHF8OdweQFbLdrOSJxvmjOlJkv6jLjZBjmZqunZ7Og8kSzaixkPM4YUa53yfEfsR6TCvKKsRd7//4P";Sidebar.prototype.searchIndexData="7Z1rU+M40Kh/zVbN+wEq98vHkHDbJUxeHGDrfFEpjkh0cKwc2R6G/fVHchKGKMwuRo7Usr21xQyBzUaPW62+qfuP9tkf3bM/Go0ofg2I+POP5kB+t8Rr8kdztPq54Hi9PMWcs5fodCD/QCP2Ev7RPFvGq0D8Sl389QfhMfVxcINnJJiwiMaUiV8ZzVgcs9W7XxgEdCF/ELO1eDWKOXsmj3QeL8VrjbdXhixgXLzyR6NZS/8RP5EfrTEUX182H7Jb23y73Hzb726+pfO3NWw+89t/F9DZBz/qjuRPsxK4IU+xdQK7JS/3gZghcEcXy5IjuF9bX7+lTXBGwjjdAyglYR2DIgZGMaQboeIgdgNMCL2mGQhDHAQsicXhmMwCAoRF245+2LH43wTPgZCwtDV2JMDsjo4iET1DHJbkB2chEAj9zh6EjiGzYUi5nwSYQ6GwvyU6fTMU/kxW6xO6FQVUt49hXxj6VjA0yoohtSJxOIejIVUQHYMgvCXma3Q+X5A5uiJQD09T+vKWxf5SkPDEOnDwtlns49iXkKYhHJU1tfG1dmIBBMW+MJgKQbzXFEBA2FES4JRD14py8AISzgkHHJUxJhBbEtMXhh7xawVDwhAfmqAppgEcdWHHB/NiTtdwINiJX3vil2gkKIA+Sk2JxJRTqIZVx1B4Zk9XoivG6T8sjHFgn4clkdjj8bBdlnUaavDOkGt6j6YJB2pfmQpgbhnI1DdMEJ2GURCA7Mzdyg07o1sQkPJ/dknAieAZ3hk+jXx2OktoMKfhIjo94zj0l+j70xP1yT6NNaNhTPj5DxLG0fa1OY6EDSa+kWt5okHwfo3NTk8s54PVP6X/fEjqi8jx9jufyI8oXmBJHNBQ/E/DkPjx9gOqsNv1fRO2fQA7xfMh6/QnZztuWszPw3lZgLf2gLcPjQAjwC9JSDj10e7dio69v2971Zu2uDOxqnAlSy7Kgr5eU9zkQ5vPCPrx6L7oqDv7/lbv0N8yQtpb4SAQ8h2JDxxFRYe+82F2Gr1lB/qUBMRnq1UiPjq6YklU+KO0Xts/S3uWFMsheTQZVvDNwL8PqViWWOtr4Yk3m/uK5rA08ojEhYCvpYBHabnHWhiP6yXhOIhOr8/GaIxp+MTxqvA6RynJ/CDk/x/PYLjj+EejJkiKr5NfLPN/LjSkaOC1Uke70A+mtb85PogagHowU/aSrq3Yz2Q/oNU9DGiBeSY3eL1ZaaEfiOIFd+pwH8gY+4I+i5aFfyb9/WeS2X0w+Eyoz9l6ycLCH/O9/0zVgXkoxXc1uj1nbK7JEA3m4igRjuAQ83nRn0xH8QFBbxN0x+SP/BI8F5d2DKfblRX6ifT382xNwKe852OxksI/EeWIz575NPhE1gQ/F/+JtPdd+D7kPZKE6JHx5yjGGyLFfjK99r6PAtiR9xLx3e7HhX8uyo45vPUH5rlM8SwgcdEfiHLMtwEbXlPCVzRUy2KL90g6yiMBfKrcF9+XVzYIZI/xgc4JE278Snxb9MfS2S/R+aAsG8xjeSQzdCaLPIt/vCsFwZBDw2UyhuFlGkNBJAh2z2XF5klAotN67fIcXQzZedGfiBqG/IL2eiP49kzGG4o5Po9mvdtC30YkehaL/R80DJIoDRS//XrRn1N3/5RpfmHnGHlOf8vndBEwxqun9FZTCu0pyf+LLKP2XmjsL9Hmf1D0Z9PraFsEJp7NBeXkRdYAe4T/oD7ZPh2xqV688f8U/SEpcczeFyLLJh7S/rMp/EOpO6HVvFdx2qxKdNqo4RmgttsD5XGCg91p8+t/ir49eEN5mbHwaq2ldFbLXH6c75OaizPGjxn/ZQmchwuxCPRtiP0lQaPtzwv/XNSivsw2wY6U3lPYvcvJMMBRhC7ojBM0XMpccvD2MIr+LNRTJnNCJq9nITjQWRKTeWnQK5FlW9vghon1zEvCXKkzameuJ86HuQw+LjhL1qURdjUGmTkhrwN+mcw2xtECx8LNe5WRxtoZjsgUXSWzoqNXjttWZu9OMPpl/1xuEebyGIby9TI8A+Wec3an4XjPYNdYYfumJXsS3cyn7vGeRLUPbNIfD7yy7IG2YgVlNvqP9xQ2nRhKsBMAn8rbG+o4KM1+0G1xdLxn8TC5LctTUPzhlrWzYSW+ntbbjeLfQe/rHsdj8eWrhDvdWk3m2ygpfMcdpd4je6hHh3O3XathHqFv3Xa9WfjgsnqTzKhID3yfRBGaSKqFB71/xSL7BTEt0MPC14hpZ0n0+HpF56vIb/bmRFp8R+PC89UNtWvx9Qao3S6+AddWenFkDqtrQY6ojyacyTOv+BkMJWjywZzXo8rzHarXSmMv9xTWmR1yLdbTQdH51mu61/70AI9Rs1d85azcUcp+YV8L8kPhLTi7FvLfk6LzVV1po3zPzrzCm8iqGt61HzREmBP8LIeFn7GfRSetNNs0q4rPOJ0vCl+v3tVNomghnnrCPi5BxF5t52tUkIcyNzvGIV6Ursy/aTSOPMTF57sfuWgajVwIvsKN5mmDPRou0OYSS9GRW02NDEeja3QhvhSdsl3felj8wHJ/35bLXr2kxVf+NQ3FFR2zcim0ZdSe22AeFj4Qp10Wrw/5PqTxKzr/ueYlGH2ktgqwwDttPFN0ztr9F7U4y1nSfowG/v9LKC++q6IOrTYap9vBHu4+cqFRd3Qv5euilteGpxyH0RPjq7R71a9bxNPzwld3KaPrDIu6dzIe3BU+raIWxpj1X7zxSeEJq+2/zAbxvHs08go/WbRe2+9FmP2ChRbk+7PCFyiqAxXNVtCNSFyKi9OKx5K9G7AWZBafzFnhS5mb+4yNxkVHk2nR8SpGW/aLPVp8vZtB4UOiSqcjs7W2I9lmaszmxc9wt22q4sfRGF3QoAROttKTKPswKB3OMkWF7mi4KDrlerNjUS1fcJY2QJuXp4BcGS5rVkmnXT6Enh6s1wHFoV94Za342Gavtu56qpRGtq1ejrjC4XxJgsIPSVTqyc2WzFxN0tnsRWes1NeZtfGuULPRLDzhusVj8HpYeF9QCWZkn2Gvx7fwwftuzSZf+UlDEiMv5kQOeio67Xptv07U7CWU6+8e8m7Oig5Z7bxjNFVyXfh7VIor0jV6y+d6Mi38jL6DklujZRmC8APa1WaU5HaE1eYO1xOBe7VKQrGaEmQA1UCd4SNwgkbeTdEZd21eJb6eFv4IVPWF0fjQn2ffR0UH3FAawRi1Mf4ihW9O2doX4LrRSyeCb+ErxpXrw9knw+sAvhncopgh8UfRMasFzEYNtxu6WMYvRH5Fg8KfeXa9khsWLjjBcvTXpPCliOpMNqPKYzwofDFtbz913TAqyeNh4fm2bd7gGZ/X68W/zqrdXVwLMZnTMoQqFCOuZ9QLGRMimzmsA1z86paWzXjFmETLyn47OmSxelQvQQ9b7ZlAWphpSNHD4O+iQ27rjpvRgsxmNCAlylkrCT+jBcxjr/DunnKhxGyR1vi+8MpCyYaYjdaP/y68/Kpd240G4W4Hw/JUgfcUx9qoCXdbDSk5Ll9hIuOwDNUWysUzs/qCxBELS9CQUrkOZdRCFpBfGH/elg+tSPHHRylnoFkb7pb8TKJSdPGzrKAl5oacW3KBZ/JC1PnPmITz4mtsu01AN9zbJRBvCJy7JeCsXNrpGE2wfvdjEhSdsJI6MesTfr/16mUYl6Z2wDaan/q+TteBBivhfD/R4h+Cyn1Vs27LjnbaLHHNeOENaqVRlNl7aZPBCNWLTliZSmc2rC8JNwpPeD/QYbZIYyI8b3Tty9UVm7JSy2zWmJucFT59ojTDMJvQngyRx57iF8wLH9xXSrrMTgkVnB/onLCiQ1ZLa43mAiejwk+A2Pkgu4slNaNW8mRc/MvBjX3Chg1jzmLms60fEpShCFQxL8yOqJv8fVF0vmr3cKNBjDsck1VS+HmhVodZ3pE1wSXo86kIstnpt3L0H0HeC439ZXn69Km6w6xcTzzxb9ERW22N4RH+gwpRLjpk5cKU2eqBLeS05wtnZctMmQ3KeSRGU7Yuw4zyet3meeh5hfcElXiR2aF0nneDpoSvaFgGH1Dtvmw0xOxNC9+xT6lrNtsK2Ct+vyI1hG9WfktyT0oZ5Gy2NtF7KH4eymYQY0oC4ssufeIDlyKrumu5ZSVRImnLAc6kBHd66k1FORutw5iKpRdelq1eUJtOUAlavih5P7ORuE1RHJYrLzblTt+iiTHlif9cdMIH2tjsuZdwTgpf2lnv7NfFmb3GOn0oOt9206II35/d9euFr7y3e1HnfnyJPMJp8RMjljlX6b2j8n3ASVD4085qWOihdONIzHoeD5NbmTeVn5hXiZBjw/YKr46tCvPjoGrwclS+117hx/X19gH3jQkwm5NVhHA4R+slC0l0OsSzgKSD3FdFh66UtDSzlyin9P5o1AQ/8XWSEsznKZAgQOn7Ff0hNLUnNB/tIVzg4lcbNTq6lsnR8F8xFq/LsAXUCujsyv9oz+B6Ug4tpBg4X4iXHO0RbNvmDnxZm45K+kB6oB5IGWyj/T4SjeylZUfjn77VyVMJDudaB+zBUAolBPhgvrsoh4+mzBz6QjX80R6BbLBQDvtUewJGTs9gTdg6IKeDcM7ZgoQsidCE8KgEVYX7BSzZL/tOUnJfRz7GPnpkK1x80vt2T72W2fDRRx2WA7Vq3tTbmQNwuqwnQ9lrufig9+2YeitzlEcX9F0ShjRclIF2bz9x3c9cRqTL2qOxnIBWDiWiXAHuZ44TaNOOhVFTEtFu7Bvj2ceL5wa7FLJtDzeXbTF4dCrMn9K1A85e93m3oaXBeTAdo827VLCNwJ7ixa7rSzm4a7eL0ud+xhme+ziKS4JcbTOeObOtj1z2JhGfGe16lZQSvA0dc0kXeEbjnY7ZqZxS8rch+NeDUTlh2xD26wlKbx4vWfhaTurZm2fnQN0bXpeEtnqdJXszUX3c+2UY5eDeV6azWVDkt8PzksAGoMhvSfwUsJeyAFcG02QOHeoD342n2TVsLAt5ZcpV5usE+uRLAtq+Ttm8A7oO0VlCAxm8LTp0pcHgW2sEC9QfabxEHg2oz8KtL1p0+kpHlex9SvXhV9EW08DXuDS468qFmezzx3LgHTMux2SVg7hSfJX9rr8+8Omoyg8Zg/3AKuVtEPcj/kECEi7isqTiAPidj5QL5qWJY6kJicw1nV8nHhE/4TR+PR3KXhcUXQjyLzgo/LiAltK+JXO+2duC02Iuv0Vv71Rw5KqUZ9YreSAvi3w3lJaSmVVKHrAvcUyeCVkXX4MrI4GzX1PPBXeC+bzwpBWLMHNsNg/S19+98pyUSm+dzLer8gB+w4rfo1bp75m9nXUeoG9J/ML4c2mMkpaiuDOHY/OAPrn+uzTqRPUurUj5Nv1QGuZKNZBZZ4f/SEs9U1/nPqRPlMzRZDsFIs0sF988VGacfMUaTynq8JdTTkKxILnOqJzcs98M1+c+EjrGjxl/LQlyJb/5FU9IF/kFDUhUCtg5RLHygF0S0VZof8VW1KV9xaLCd9ZWr4N/xUTU5Xw9mT6URKpzMMh1aY+pz9kLmZVDaUMA/v2qJNIN4ITcvMOm1q0c+Uxl2FL2+tkcoMtGlJz9LIvZrcSxvpJc00bOnuIXzAk6w5Fw8cvBXenHlD11nwN32XQC8zkqg3EIQZ9vqwvLIeBKCKWXuQJLH/h9SOOy6PG2km2zED7Z1BfKeGE57HEAQcLHx8eSyHdnvx+W0Uj4Rm9vMxFp3Oo8XNDi90fVno6zPfF0mAcsKXxpSr2nNIysZVcl2qRHNHomcVx4oW7rTpDUR30xRLs3KThsJWTVym4E6sOmM+FaDpdYfM4ASSlHXjKLXqO4+E3G9Z2eHPCL43KIZ+KzFt7HVFSLDdx3JEgT9ViIOo7xDEeF1zGKZZj9qo8+9an4IRpwjotf9mZfozySGRoGSVSCeLhdwzC9Vk82fSUvZHvDXfO383gpPKlS3Lrv6Hb08LYUdR9AOZoc6IdUcsA9DHAUoRZqlwS6cg88e6vxXKArHT23DSbr9eL3ae5D0DFv/Msh8rpztfNAvu+ZXuAZp35J+B80PrQi85ckJClz9hSXw5xRskTZ+03mgf1afOIgoJvvkRfj4l/RUrMX2bNzeXD3Rrcl0S9t5bKnFd43+JVw1EB3ZMViUhLyqmb/Qnw9N/TNkjAH4aSOL/9GvVqthsZJENNoz4wv+gPQbgyfywOQ3E92ZuSmdrQc+JVZWXasmhR/kOqdUil81ZWyJ/tbg3JEpOYpOnb1nLWj9Cdnf5dEzFWLMnuWKQ/cnInXVys8C8qiXkBEhMt8mloiTle/ztOScFc0jJWD9FcoDE0uH9H4clh47B0A5+gD5XGCA3RTInkHEYPf1KxXCVYL0MsBHEY87JHx5wVnybqifnzqL9smxKcDmVINcdFhK50V39owfB72rm2zDuxLId7hHE0JX9EQF741lzLCrL77sVnod3hOGZqyl+LX4jW7ipRnbr+QB3APp7nT4l/TUMeBtDIHdXPFLS8OFP7UVHRK9qKMPJA/0pMLKocKF5229rC4fGhv36PgsBXtnf36aJ6w0Rmn8xJc/tpvLZK9L3GuzG/YpoUlGqzXAcVh8VNEfd2O57nyn3IcRmvGC38LTG3TZQf7zeAWyZpezoKg+Mb5gb+fOa71Jegc+8+neO2fDiZD5K0wj9H9xEP1Wq120pS1MA8D1Ljfhx8oPDhdLON3Cw/Ik/w2WmOfhoub9LtRva0+IvFR5uzl4+f19lQOMHX2MTUPwyJySR9Skj8Qy8yDT3uLpg0YzQfGrwk03XZKpg6YTP3QE8ufzEadDeVXVO/X2rKgieIAydph8Wvxtk/Yb2dLuwxsuNNUOsgadSdZZdVIubBq1VPxEngqZJ9C1ujX3BQvC1ux0a+7yeqDiNvxWTmqtqywalesPsmq2W+0K1afZdWqWH2SVbdTa4Ln0jFvHwguLfBcPrgmYIBLBzyXj/L3BsD0wYNp1g8j2McHU4evYRofpFOODabXbNU2ofxNWP/ku3DgQnlgbScRilX/LtQPiZ2FU2vgDVC73Wuf/I0Gc7yO6Q/yNrbRBWQWHN6BdyejunXwW9GCg7tl0wDPxp7cNMRWq+j8jg58U9GCCb1lA99c7B32VjDDxgHDqN4/vCZoAk5fHFVwqVjSNAJKBy6UesvOPurX6jW4VBotS7LSl78OlUqnfVjsfWwqAsD8rStfs9aEJDRK2ap5OEPMhffJ0UT8gMS/Sp1QQ+1eCEmMLOjh34JqA+Zkwaf6LacOZIGyYAoOcYyD1yhGLXG8f3yJExIhK1vujVCjJ8zm/S7OIfm45SckaFb23xu0VgXtS9AqQL8H1GnXmifn8BC1lPmrFrWVQNRyAJGFJOJ7RB0HENU/aIdnklEfPKFGw3yY6B2hutBFgOH0zScX3+AoXm+jhp4YR1cTQLjUe+Dmc9S/o9VspLRGJAjg8vpgJJktXq0afF5Wgisf4qrXHMAFSLzqlfLKQqtZSdeHvK7nJIx3Y7XTutCPZuGW3NG7nnio1RYKyiNhJD8wVDYW4lHb8iw08H15LXh7RxUuIgvic0t+JpHMcNfQrjHg225zoD7LGrGG8B2mu0E65z9jEs5BVwdY49RotKYTdHlesfoEq2ZjMhGbsaL1SVrTcUXrs7Ravcn/VrQ+T6vSWp9j1azVO/DCnnDoVPmpf6PTaVV0fkunXcnO7+m0BZ1Jhef3ePqdKVwuVqIBOy738OXGGp+OvHoEnY61XdWRV0ig07FQS7Gh05XNtuq1Ey9gu6olOXM4imgEl5aNq7bvcfUcw9W1iqvlFi0bF9zf0eq7RatRM1++8/3WQ/V2s9beHyY6TKKYrQjf5Q4mAY6fGF/BhWfhTNyyExp/eIO877fn032IFbR/hTYeIG90BR1Zb39olYXC+w2xVru1kbGTQ2ic/aCRQCMbMcAjeCh05svMNgw7H89MhomtoTTabdTNFwRNlq+RbBz8q2lF6x55MeNY7akOScAsOACHoD5Ua4XqNmsQW5E6OxvE1gKMzcImvR96qC2LGcF7AhasDAmn02j17ie7pJ/sTMj9XTN4qKgsaK0NqjSO6hQqC5pKoho2GmjcRJvJznDpWBIkQadW4fkXPC0X6FjbWi0nhMcank6F51/wtNxQPdbwSOlpgMdjwZJ+HJyftOsNuEwsnFaSSadicsik24LLxIJqkUy6zVbVNe4QSreCsg/l4Rw1+oC3jxWVIqC0KyiHUDoVlEMo3XalaT+iUqnaQyq9SlYUKmT2Qbt65NW7NbicbGia33BqQuYESJ46FafT5fr0aoKEA9m+/NX67n2nBECENHtJXE2+iifl4b1GMVkhPx37ex76AYsSDrgcIWsyLyc8XUfw1FtWxCfqtN3gkzW893U81+ETDekZDufoYnQHXe00zMnNhLMbcVQJfXzTadT8bUR4I05g+RhUy+/5dCo+/8qn14bKp9m1zmd0U+/U0GUPDhRd7yIXKM1GjVRUDqh0KiofUllXVA6o9IDLSlYvMy8qsGXFEpV2ReWAShv4wWwBinfTaNYiUFR61nWtgNKGDcWcpOxaCg43lcHoIiA/T+o18e8IDh0bbhGdrU6vz8aoXq/Vag8DdD/xAAHRnF4uFqZBpF2rnTQa8Klk3UV6VLrtFrph/mYvRSwgaIxDvIBclpdV9+oBuhfKBcdogkPyi9FfNK74pHyaDuiZrPPJtYB0HACSNfKtBWT+U3jOcFkYVbdCKuTBDBhH1pyaLo62TKZdPcAFYlR5CCDddiUeWxo/m8LjQeMCFd9p4mg3KxzvcVTS8R5HR0pHEy4OoyftFgdg6TCNA/hmMY2jD/iUNcyiC3lytXEW7UqJ/sLRE1rj7zZcHEY92Z/NfoXj+ZSJrwE5vSUxx9tC2r+bJ40zePd5NQPw39OFagIaTprysvxgOhzsqo6hYVKs1nrG1qK5YepWmP4T07Rfg01J9YGyTk7OD1OtgvMhnG2RpNTZcNFktXPyIbPG3EfT1kkdvOhY5rM77NGYzZMAUK0tiDP/jVPxepzkwufvljzroaOxssX+7vxCU22ufUKbbXUuWwKuOY0IGrdcOOWz5kxyp9R2gVK9ZQNTddb/G5nqlP8PQvDP96zp67zItMCTyVp9qEsmCbcue8eZ+8OGNbJCaHdXfzdt/fznmsuRKRtlhBqtNarX0OXsHBBCy3ppn+C2Spr+Q+aolZL6DcsK4AHAKqL973hSN+Wth2clR4egRjjGQyLN8O39/5m8/78dmdXsAGKlWbaSA6udWqrXpJLaMuo21hWkDyD97+jufUeJSxyTF/wKr6uEfWK7SHfjBHDhi2kLfY8LoMtkAOxzJzIjFveR4HIDF4zpMIkEs5nYhRrycpmwhgac49eK0DtC/+fCe6PUrTcKVGiWN5wmZDiG00QCzgXlBE3roC/LmFfFKZW/G3VYVBogqLSAUYEhKy3Q94ks6ZW/W52SU1nT+Sle0BiL4yc6HWz/Jv5jcSBRztWg15pRGck4/0HCONq+tiPjp0EO8YKwEWM5PfFGQTljccxW735hsP0vY7ZW+aloejUlkHOIZr35+wEZ8fpuXVEObNC3QegvGf+fiswBmSFnUXRyRvCqonNIZ0QjHyqX5uGxZIyLbKxATjYB5QmezwMClVLLovRcpt0nINOxubeuSCA/PVQ0HziVxtBcr9YkCAjYA8smmwlnsOD0FR+q2bAHZ5rwGQ3BqhtjR9Z6jTmOkwiRgKzkqk/HOFwyNc9pDYz0d/fI1LLtqN36/mjUzrcrzAOSx/xnEktXYtueTawU3bJ//gEDrrnPLePpfixsyXrNeIzOpEdHYiCo6qqIQUJ1QxZAMDXaIHfiltMdDaGAUnVWI5syPzIo75lyODvPvnaXC+T0KVmQ6HT49nep2kfEx2ltyzfP5+QlDRyxgM6RtxR2FRTToX6gvjIx/LXkvNAJh4UulshbEzIHA0kVtGxK/hiQJoQ/MSG9BJo8AUSViM8Lxo0BuOHe9BNYoQLIjKSHh3AGIcUuAe4+YTCsVtX2+zdCAK0Ci3LEVmnhPeMROkE0YqdnAXshaeLtAodQAWUUo1+LFMbntfc9B0y/3lOiesB+kqzQJFmtK2T/jQx9e5NZOKFy4MRGVPwexwswGU3gvM7/L/FjONlx4LQmNIpZWMH6FCwZvqpQfQ4Vk0ktcT7CSd+AJxZj/lrB+hSs1JeuWH2KlcyisorVjhVP41QRWnAazoVCPx1uXgEK6IMSzH/js12dgHO5XV9+hIT1zuCqc1CgrjCoaAxkVNerNfbjCtUnUP2JwZ55oDhtjM8K1X+gSt9qiHZvi8bYF69BqY2BiG1MgyDN4CSBWBH9p7IaMsGqzsWvUauOyM9Qq/T+Zzk90BnHcoUVqh2qOafiHU5H8g+gUDJe/kiXkj0x+B6EvBmT0Hnat+sMcJ2QBTDb+KZwiH+QV8YFngCsgjbM51Xakt/FquUxtv12uMSr2Sa7LDPwT/L1aqNJXlcEx+k432QFF0i2IJ0ekE0cXAhIskIbdSyEZpqsZoEUpEpBbzF5a45fKxw7HGmQ+5e8yGqxX9+N2Q8pOzvNU3ZkT4TMJbOL9M9d5glN8QzO1c56raWjgjZL+zoaeS2PcbkOHKDNm4EBo6WbjwAGfRsTsV5AufGmwqhtH9F2jz1g4dVDwWRZlDYnGKj7eCoRQ4JD41jsnuj0TJg48/TsAsKjpXU8XWzXpQGEE/wcLzlLFksgSJo9rT2jjWQY4NVa+OMXAQ4XRHgOyTqAc6uuradR9OkwASeM0hZCMIgoW6hnHEglH+9wiF2zIrI7JongiAgsKOjbiMTCdpELOxG2DHsqir2SO6jzn+tALK3i9B+cZKu7kzsS0SjGIdwwKSxMaRij2om/RSesn/m7xh5AyDS0HIjcuIyS1epV0PkBJm7Ra9sFkwhBCaCwsOxWXbEIjMetsMjWi0sfxXW4uS4EBIdCw7RgXMul+UupQ2QweBNG//YrLAHl/LEdl/iY03fhem7+eh0ioXB8SCUWtpG9wal4bHhw+kR9giay92jFJGVyR+aJD8Zi6do15e6SdZxwAmnP2A5UeCR4OhGKRBavhQt0RwKCI7JJqgBBdJi3bBlmRAMSwtlEdVWnGJcZ8VWc0BvHCAgUu66QF3NMQzASYjlAvqMB63KbZSgPYm1ASNj2lR8oeZGHzWWAowgIE800db5M0LcbOaEEUPmHrejkUpZykp8bv5DL3Fs4J2EERtP2dJSKrFOVHTzflqeNZ8QS6TtP6JqgtAr27b2B8Orr7LL8eZ0HxI859VNYYCBpGnj5Y7qgP2VjRXmsC7WEpsmMRDDlS9VT2Y62/MldYcrXNATHqf+f8xHNYoK0/YDp9P19Jm1qGmy2IFTjAII0vSd2QcNQ6K+K2ReZ/bFpYAkVnfXj8YBdwDbRNPEDsDf8oAlcGrSvYH0OlremvDDdPg3g2rNcoWKzLWTpDkQ4nKMLLquonDDwMw6oy5/aHZkJgwwMH9Wwb9qlk/YGT2VKbj1FpFAdCLTOvkxla5VgGlqjgpYdWrOC9iG0TSZvImPOINV9H9YRubG7YKJST8Z+pulb+bOaLml4ckGDFTr/gdeMA7pApDfkNn9U9ycf6CwgrIBFCu+RJ39r7lIQ2jSzFf0pUV2HJzc0JGh7T3osX4VCqK/lMaZL0ebixVh8blhc9DxpPS5/hQQDasrQtYhC/NcyfjfBMZQ70o2ODRzrZLWOTof4B41fQU3kaTT3NWwmW0cu5MssyNuwnRQIGB9W2S6drjUiYBzUxh6Rrj0iULxPazIi23iA0h9aZQI6JC5xhLZj4WCg6DYsyYQk8W7yGwwaB2WAxg6WS4I5pC3S7u5HE+qmQFwxTv9hYbxVnkBw1NvKFPi6MSBFuk+pw2FCuLzGH4gPDASFGs3tm0KRzmqCtD1Uy6JjngQYu1N1TsztEC+ZrYSbR9MaYDjCUa/tA+lmur+lB0TIBWAS9Z6xjSK7ucKZRNLfb/mWLQ+mgwHedOF+f19bGDtEHrafFRKMutLspd4ytUHQCZrT8L3vDgWJXkx4i6Q2ur7VAvM2M7nC8h7Lue+nEuOjR8YrNvts0ts1bIUXIYFjtAOBI/39ish7Ilevc46ToBKUfSw39P8ldI7+JFCuDwPhckd8uubMT0vtKzR7aDYZ/80g+grNezRpvKBCskMiB1sLzbIJoHzbqBqo9fFfxPOVidbv8WzQvPMLKj4f8HlzDyo6H9CRxl4F5gMwlcb5LZrNmn6k3crWAfbJihSm0XPOpDhbyCyyhLWpVaowfYBpz2DeGocVqA9ApTZiReY0Imuclu1Hp5d8UwPo7V76Q46dJHEcvB9FCYOYXnX/2wqzx5Hf8dqMl36Hq0KzQ7MvQvQJbOMPu3SEy/HqB4D65wGjowSXK0r/RinaXHWYcGkC0Fj+rAKWEZhUV48EjAUOjNuE8BUOxYLRON2RFaYPMckuoAmnSJiYyUyYTBWmDzGJfVYh+ggRC+icPtG0D1jAIgImdAKNjpyNULF5xyadDLvbU6UHI16TjusK+0sakuj0/GfMk3SqMLC4SF2nYYS3WaZw/8fbheZJClaYBByoCQkC4Zn8I18ENHBCjScBACVjt+A2HlRMd0yIFRijCB6m7Xui7Tuib7/uE1XQPg1tVxtcIdsi+yE2Hwmi0zMMpdZImRyUrd3Pw2Y5OhjQt2vvOxT5sAyDcxLI+NCIJ1BqgJXb7xnTRvkiASUqeo00tMEk4fN2Mk569+IsXQkUNprJRl04AorwKWKCpjh8hoJEkZeuUdUylIZLOllKbKWUivhzKCxlwqEWdnZNi8xvAaFvZ4yBiUSrnLLNFTg2p0oLfRLVDVmA7SBdr9lRTuhbGnpNBwVsKvrSv17iCFC3bcVEzDZ6SBfVdjBTdcAdgJHmIeMI2mAvrbaXulAuGPfJ/GTE8VMsyLC0yGoKqGmQcme5n+nOsjadhIfYh3KTXclhWEHRgMnC8LmdttYSnz6AIhrN/ZZBZoMSksYVC+A09OzaDNFc4eBpMxZx29pz84ZA0BzYcd1MYxt04VyHckY86PNmv12IWRfzT+w/C5tt7ojoZGquo8vmr5D5zycsiSGFPtt1i5oGUjtppZlKr2cYhNwtdwQDal6n5gkydZfRJSJrktBZEjwjTxDBCyh2it7sa10qaV474fQfoWFBq9aGWXN2wtkaDRbb4mMYSKwqFFiapGXTnH27eQUpjmQ1vr2pbxxxCubwtcxjc8Igb70kHMpBYzc+sAvlgz5kzLo2gNSHVX0qOcDOFmbrv50Pj7dsxRmOwFxDVDtEWgJTFW/8O5o7xp6ggulb5pJOqYQmO/sxk7pZH3DHSHxyOFeaDo5mC0fSFok0WyCfTj0LaEZUfkDYisYuFik1jhxVDQukLnAQEWBgFCu4Xm9Y4BKwTYsgyFvLvJ+kgAGvks0CApQsrLf2lXCmiVa5gECPNF6iCfafAbWmtUplM3wCWji72dlnYjTrLltBoG9nBFJTPyXfYR5Hau9WPFIe8k9pzz09CRdAwBlRvCJitWBKatVkqlGV8otPau9uzDh5KHsJf8I+QdfhnMpeh3DuFCvGXc8mr/NwU6N9xtPqFjAy1bHpQf2G0aYnVOpGyeHs4kyHQsvqtcff0NoiOtnVkW3Kp8AQa8AjBulKieqANow6oL8BdAdpywEUIO+ZcjgqHKQITZeyQV0grIIoCUBZBTAEiq3AZPj6+2Xz2UYw5wXkIgmCk2kyIwfn2ZBROG0xGjajYjtWEwrmeAchOx5ZUQdkp25adiLx2aJTHFKhiKPTMznwvP7fMJ5oEAxZIING4n/UrKX/iNejmLNnsvtJyNLZpl8EdQD8QK6UeaWHR1q6uA9ppT8ZbFaty6vhCC81n/zBQOijAxsR4o6A9RQr4LCy1gwvVwRsF2z6fezp+LzYAn0PhfcmtKyj1A5rp45PLfE/UXIIgtZbO4XdCXmYHzg6rgvhxqArHPvCf3l1hJsiZR8Uhxwd218kDD9T4wuRV//wBt/ReY0Ziz5RJQ4Dl2KLWRCvW4aE9o/cBGbDtvDIZ+apg6B1UMRlwdb3AhY7Y1Ps9wLpWbApvBA/O6q9rGzGGM8+0ySj4rXhNSXz+Ss6+9TAdhDMOv/ZnudozJ4Ym8vun46Q0pauC7Her2Ia4jB6uwsQEFfMiW7LJjP29EQc1V2dzEejDqkRp6GsP0SPOHYpEGZTuhRmDUeYdTsWmV3gKEbpG7gBS9mUH1RhHROW+IKm3J0YmELrg2thR6T1V0ifnNH1+0GculFdf0eiGCcch7Ezel5tjmdUZ73j5YqOV8pE6rXMUcIvAlsSHMRLH3NyOgjEZwtxOpV+TObUp6Ez21NxiTIHDa/eMGgyDIXsLUlEsSvklPPSHrkoolEqezeyGXco7TTvVfztE33nQJDs6ZppeZE845iGjkADI35DzOdUrHnhTBpOiW1kNnRzJEeQF+OnJzTgxBm91wWyW4c4XiKxOle47YvdR11ITIGTv+BK2qmrWwCUF7URwU+uMOuDYcZXOHbqcFDQZa7Pyw0dFSuLnQl+q/EQa+bI+aujrpdVZOjRoWK9pmYWLy9uF3hFg1c04dgX63BG7HRTe7nhozyK0YA6GiC3B+6ShEQswNGjwd5+3bwPOp8nm/vvjvKzJnfifbg7gfR6TTknMgeG8+XWcISbKm6Zi7tzw8aiNY1x4IzEwdmoO3KuyFxPN+mVF7nr1SoJ6T/p8eDM+QrF278On4iwhFkSoRGNCHa1ct4mwbUQPfExXQEHJXNzLT5gGMkcmAyqu0IPjtil+evAteR1tw4E4F90HhJXQpxgqN0koTt3hRRo1pzYMV6tmPiZK8l9MEou1W1ppxvxQddyfgN3BaFyk8haoHiH8IbOOHbn2i00CbwjPuNzZzQfHHxhvGk1GDhzCVC7aj83eHfXjiADE3+6JQl3KXUNRtZuk5hTlwLsutcC8wL3PfRdEjgwJ8P3JEYTpwIn7Q4QkZssMV9h3xWRazeBiNxk+RqlxpxsoInXrvBTXQlrcndHFlSs3Kk8LJRgpydeQDc4XCSfmpUNAp7a+K5nLRvrMZ+KfesR/oP67tTXQUnyeAlfuNNy66BpjTVu09HIEWZg/Igpc6fbz8EI58z3XPOidh+IYzViSehMXZ2yRa3ZJI9LQgJ/iSlHA18cDRGdBcSZ6pPdhX2gGBuOYrSm/T7G2HQEo9p6w6w0hjhOZGE75s4cINrBlNt0zV+H9Weypu7kxHq6lwB0cY3xWmzHG3cuhfVsC9gYc2e8LeusCPcTZ7ysXdt/e5uRORNF0j4YdVndknWcOFPipW2O6eKaBEnMHIHV0Y2O68Ly5B+u7ER1pKLxneiF7OUpcKdFr/W96CWhM+64dlI5D1iuON0gYLniWls3TiWsVgXrc7CmURLiFXUFl5IfNo7rnuMwccVN7LQsq60H4hAs3Tt+X4a1JmwdkNMzPHt1xnxQ3MR6rZEV1yRdtSYuVwyIrm7yQ5fWcInDRdp5MXaqpkU316vNjYViwYnvEDM1kGpc1i7ICjszp0S7B7surbE7rNSWFW/fm6Tljovd1I1H5AHLlROyqRt31oaVrFauJDTUJuzGYU3InIgVU+zMoagbTNUl5i3Zi0PjXNR6WPPKawvMFf2lBnKM+0OeWG0QOFMgoVa+Zr81rAvsPqQR+ekILjUCbdzwesRiKcJ/vGNs5YwWU9zuL/S0zhWbK7qsp1vMr08tkOO8HMHVtm2NPbKVQ25RS7vRfD68XNmNLWviFeEnEr+enlG2xP9g7krBfr2m+JKZJ2h46cK/TmyIE4cChtrZbW1cS7JKL6s+Erx2FlvmU1IX2wUOgo1t4T+7kmXTbracBzSWxMhbksCdcnLrW/SC4wV1JlDd1a2+18V1hcN5QNAjjZdOdXzU7SKnzY0uluiBBTFeuHOzrWX7INij5oxZqxuRzZWaM8V1ugVQutT+ImSNRs5c/dC+h6XL69aV4nzrJsYtC0+uWUj/SW1aPKdOFaoo4y4zx2f16aHzMHZmXwKQNuStmENRRuvu5q+cLxpyFkUOodMtstZF55o2eyvn/PJsGl1iXkDX6MqlqGNXO6ytzSxmnKA7YdbG6H7tjPvUte0IKNxccaAsajWfktAnp2JFjGNBzxmrQxvZZuUazMZ4ERJX2oB2dS+Q5MCL+sLY8NnalRia9qUbfWa3iR8Q7E6xmX5QIzdkrip/C1L2SMP5SrBwhJg6qN0ksTXjcXQ6WK2XNCbYobSTbumBl65cAxn3l+5081RFLLse08R1hiMyw85syba2EtPlRUPmJ0GJGj9pE2PCI3/BwbMrwHSvd+UALEY3OAl9Rzv9tTNXsusiG+LV2qGrEor12jWuxba8HDVd21Z4PVF3ijJsWxWS14K71LFZ8SezR6+1iYXMnfoVNXeZvVw2F1yu6C/1FnTLvAJLuy7f0CdX4ojaLfu1iQV0NXMoYamdHdflJRO8aCh0fsxfkfdMZU2Go/rsC8nLY9BzRb2psmfe/H/1A4e2qnJ4Ghe2EeUxOqPOdOlU5csCsB8OiZd2NkmXFnsJl4KEc4eAImbGjVoVnKP637xCO/9JuE+jSp99ktcF5eSFMVec84POItnrpLSBRUuXVNnBkLjsxcU5EXNGhym1eHXj2n9HbELdSfbadtIlMzQMCA4dss/2Ja1jfGtessCVCT/q+Afjtqxk5Y5oabcV0ccVzlmAHcGlPTpaF9cVFvr+MqBzd0RMYdbpGGdGn505H7Wn1+QAyyHRUoKwxg/GK8ZlMZT/jKYcU1dKoqxH/q99grbGa4Xs88i8Zxw7hGzftPjKXSVdZsK0YBx5L3S1coibbRvjTxLLeKKjuIybF3/hV+xMpaJtNXZDnwj6UxyYzlxPOgiMGWc2ZjHjM1ni6UowUREz88Urv5A13ETWNK7GJtQPqe9ayzLbVRhbalMs59I7uj07xp3MPWqO7lDzFYx3OFwQvhuu5I602S4tVrg5I2+6s+K0uTH/GTlW1Kg9aSkfaHJIgkvjvOzv0XSsxCzALgW2bZdN3bEXaeO6gks5P+vGcSWhQ0lftWON+S354Agp1Zw1XkzsYRqgM4d2onaXAm1gIY0xf0UjKl6JcODaxFDbroAnPppwoB4oeUkhOcJNe0CaPrdkhpFbxdmKrBnPcXqERPjFTVpt4wEhjwRP6DJJCzSqpHAmck5HHo0nN2UymMxkpwx3dFnHtnfuPVP0Z7JaO8JrV9Bij1dA5g7Jl3pPzngSRfAia6n5HVNmfdvKbIWDjQvlVhsb+7cmvDANAvG5s8Jm3tAQyFZs5s6kIdUFML89BTGh0hhx5yhQu0GYl7KEO3QPQG1hZh7XtkjPnbTmvq2xa8togVjDFWJKVVDmYdw5EHNnQ+p3+tekNSVhSJ3pWWnbqKhCPRlgybi1I6x2sX1rLvijUylx7flB2rTEB4vSZhgVsk8iW+KApKkkh6DZbuos+9JHbln41uWMsTm6xPGScIeoWSuMiom/PB04VPOvuyWnYsEanBz1gvqZvSAdTkO8Ihy7KlPZ20TlwMpRucoej9BiRYIATZabFbpAq6Vr1mvRYqsVdrXRtVnFLlCtE4cSabqjM7RYceZMYtumTJ3/X+K7UjGnRpkzVxpqgZK2ujuDBNX4stHNlzZIdGjeg26bLB1WY2dDpV2j1vqEvbhz8tUtnnxy9DVzBZRSoZq5RkkLlOe5gslmOGFKArKW3owznnJrP071hXRhPrxc8ZabupWo+eBqOoJLmdH81l7ZNK+WK7zqILRX2xFcVnfjvXfmCKaWbjm4DqYHOicMbYKijvBSbIiW0TPxEW+ac4+xL/50xS/s6jad+CoyjsM0T5heAz1tocclEWrMGe9HCdNkPx731q8PcED5DLuSZFWH3fWz+0T541sH2CH7X20flj1OcSyCrngE9dq+C9XOHmo9FkJXvIS+dlLtWARd8Rv0o2jHIuiKK6HdNetoBDuuENzfxV/x9Y+FsOsIQvVaYCt74UreCFezRCD0XfFDtFtU5g4w9JeMu2MP6tYtHomfK9ag9pyqI/FzxhTUrTY+Ej9nDEHtQqKc+Z1R/9V3KCADzQzc8nPnANFtqncsgM6cINp5/iMBdPQIaWfPoR0JoDNniAIQjA50JpawfwhnbyaXO8AkcvUAAXACC3iOHh4N+4eHgOfowdHM3JPpGPBcOTR6+xHorxSS5UxviB0KuyidmqwrPQnPFaWnRk3tb1xJz1WtB0L0XNF62o0jjwHvhvnOzBVU6l+slx/IFt9zMkdXdLF8wa+OYFSb1lnfwxeEc1fgKTLYsR4vkFfCYp64s4mVE8R63veC8eeAPjlz/1A5RKwXEF1id8IFHe3a5iPAc8Vy1q/aPQI8ZwxnaFVrEp4rhjM8yeMsCedIeVs3YKoWjPWc2xXmM7lwF+llb2KfOz0SUJ+t3eleogZgOtYDMG65bx1oRRt/ErJ2xgJUs23WhS+l54oJqN/8JGd6N2LrxkuWRA7VvEDbv+8YuiKHbWgG4ZitydxVEbR/CWmDzxXpA1exMWYx42nVi5sEO9YzIRMs1oGD4BV5yWxF+EKI4yMn7kRVldSIdaCyWRIWUonSXuluUuxb39iez5hD+JRqXvv4CI7RGQlcie33oF3MFADRRF6KcwQguAtd3pK66xtbjwym9JyxCqGVok5x6Ir5osYE29bDqlP8kzoCD5zVMmUvaOBOQFXhZ78iQbyfH7t0DVhpX2vd+dgBdPTosF/YJufMhc7IXxua2bzB54r0dXSnsh4HnzOVHdDusG7weS4XJYCQwZUzClB13CBYMCtn9J96gxXABk78Z3eErw9O+CQ+R6WvBUDzSXzOnL5K9137zm+Kz5XKSnC3WDf4nLm7r9ygtp5I3+BzpQlgF1zINMXnSgNA9eiwfvLeh0RAQncMOzp20H7C6IEsqexe4tSdOAWilfjfDxKcDjinP2Q7/ItA1rRFjvA7mHvyFQ9ErF8LHHtB5zhyJVOu3oL7it2SA7Hbc1d45XDS5sFL7PGlI8h2MmUb2aMjvPKoa86Bl+fMlgTCiyXVlsyIrNqSmXg9EnfsCqW1knG74gwvFnjhTL2dYoYZN1zP3KlxUkXrK16SJis+Ixx5S3cGuO/r+6+1idNjRnASvyIPB+6kUjvWoTH2jAbhXNoWAg91S+aUM9O4SpNNue7Ep8OuTC9XujN8bZSLJrJoSV29JvGlWgc9XAzHaLh053aTWh78pcmHesgSzknov6Lzn/4Sh+4YaIqsGbdnh0kkFuBKJFa10b6STdbCNWIvYRRjyl0lZlzARpyGz2nMnyXi0KSumGk7X8neqTnaJkumLHHm6GxYPjrPA/JDXmt1hFdHNc2M+wLnkfjUDhFTL1J/paIjH2BIngWuUFNOAfP78o3avTOOpmKamd+aCWeOsOopVxSMB7LPf1JnQthKAMO4RXYlzFc/cQVXu2f7iLxiMXEl1qOW+tiBha7DJ8ZXTl1wUZquGz8hr1crKl6ukGVA9kvK3LmNYTvl+x5awxFobdvVUXIIhzPx624Od/U0aUVxml+SIR9HK437X7njrUVtnEQkWblCK4eeFlq0bhmaYC4Di64Qs51V2uJy5qTs5jAGJxdgrpyS1k2LiSSDvj8J8198QmeLyixsTYfOyTzam+vBEpIlPpwjuLq2I2OytMeZZKUiW8ZtMM+p1K7tOzZTKryiGI2xv6TOtKDsWY8nbrFNEu4vceQKN+t7c5qEoTNxWOsJkfu1W2Uqii7Tk6726P8D";@@ -12266,30 +12271,30 @@ DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.sDrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(l){}}return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b,l){this.shadowPages=b;this.shadowVars=void 0!==l?l:null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null};DrawioFile.prototype.getShadowVars=function(){this.getShadowPages();return void 0!==this.shadowVars?this.shadowVars:null};-DrawioFile.prototype.synchronizeFile=function(b,l,p){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[p],"savingFile",this.savingFile);if(this.savingFile)null!=l&&l({message:mxResources.get("busy")});else{var f=!0,x=window.setTimeout(mxUtils.bind(this,function(){f=!1;null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,l)})})}),this.ui.timeout),z=mxUtils.bind(this,function(F){f&&(window.clearTimeout(x),null!=-l&&l(F))}),y=mxUtils.bind(this,function(){return!f});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(F){f&&(window.clearTimeout(x),this.sync.cleanup(b,l,F))}),z,y):this.updateFile(mxUtils.bind(this,function(){f&&(window.clearTimeout(x),null!=b&&b())}),z,y,null,null,p)}};-DrawioFile.prototype.updateFile=function(b,l,p,f,x,z){if(null==p||!p())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",x,"invalidChecksum",this.invalidChecksum,"latestFile",[z]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=l&&l();else{var y=mxUtils.bind(this,function(F){try{null!=p&&p()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[F]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=l&&l():null!=F?this.mergeFile(F,-b,l,f,x):this.reloadFile(b,l))}catch(O){null!=l&&l(O)}});null!=z?y(z):this.getLatestVersion(y,l)}};-DrawioFile.prototype.mergeFile=function(b,l,p,f,x){try{var z=b.getShadowPages();if(null!=z&&0<z.length){var y=this.getShadowPages(),F=[this.ui.diffPages(null!=f?f:y,z)];f=null;try{var O=mxUtils.parseXml(b.initialData).documentElement;null!=O&&"mxfile"==O.nodeName&&(f=O.getAttribute("vars"))}catch(v){}f!=this.getShadowVars()&&(F[0][EditorUi.DIFF_FILE]={vars:f});var K=this.ignorePatches(F);if(K)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",K),null!=l&&l();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var L=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,M=this.ui.patchPages(this.ui.clonePages(y),F[0]),c=this.ui.getHashValueForPages(M,{}),d=this.ui.getHashValueForPages(z,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",z,"patched",M,"patches",F,"changes",L,"checksum",-c,"current",d,"valid",c==d,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",x);if(null!=c&&c!=d)this.checksumError(p,F,null,null,"mergeFile",c,d,b.getCurrentRevisionId());else{this.setShadowPages(z,f);if(null!=this.sync){var k=this.sync.patchRealtime(F,DrawioFile.LAST_WRITE_WINS?L:null,null,x);null==k||mxUtils.isEmptyObject(k)||F.push(k)}this.patch(F,DrawioFile.LAST_WRITE_WINS?L:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());-this.descriptorChanged();null!=l&&l()}}catch(v){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=p&&p(v);try{var m=this.getCurrentUser(),t=null!=m?m.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),t,v)}catch(A){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(v){null!=p&&p(v)}};+DrawioFile.prototype.synchronizeFile=function(b,l,p){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[p],"savingFile",this.savingFile);if(this.savingFile)null!=l&&l({message:mxResources.get("busy")});else{var f=!0,x=window.setTimeout(mxUtils.bind(this,function(){f=!1;null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,l)})})}),this.ui.timeout),z=mxUtils.bind(this,function(E){f&&(window.clearTimeout(x),null!=+l&&l(E))}),y=mxUtils.bind(this,function(){return!f});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(E){f&&(window.clearTimeout(x),this.sync.cleanup(b,l,E))}),z,y):this.updateFile(mxUtils.bind(this,function(){f&&(window.clearTimeout(x),null!=b&&b())}),z,y,null,null,p)}};+DrawioFile.prototype.updateFile=function(b,l,p,f,x,z){if(null==p||!p())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",x,"invalidChecksum",this.invalidChecksum,"latestFile",[z]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=l&&l();else{var y=mxUtils.bind(this,function(E){try{null!=p&&p()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[E]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=l&&l():null!=E?this.mergeFile(E,+b,l,f,x):this.reloadFile(b,l))}catch(R){null!=l&&l(R)}});null!=z?y(z):this.getLatestVersion(y,l)}};+DrawioFile.prototype.mergeFile=function(b,l,p,f,x){try{var z=b.getShadowPages();if(null!=z&&0<z.length){var y=this.getShadowPages(),E=[this.ui.diffPages(null!=f?f:y,z)];f=null;try{var R=mxUtils.parseXml(b.initialData).documentElement;null!=R&&"mxfile"==R.nodeName&&(f=R.getAttribute("vars"))}catch(u){}f!=this.getShadowVars()&&(E[0][EditorUi.DIFF_FILE]={vars:f});var K=this.ignorePatches(E);if(K)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",K),null!=l&&l();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var L=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,O=this.ui.patchPages(this.ui.clonePages(y),E[0]),c=this.ui.getHashValueForPages(O,{}),d=this.ui.getHashValueForPages(z,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",z,"patched",O,"patches",E,"changes",L,"checksum",+c,"current",d,"valid",c==d,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",x);if(null!=c&&c!=d)this.checksumError(p,E,null,null,"mergeFile",c,d,b.getCurrentRevisionId());else{this.setShadowPages(z,f);if(null!=this.sync){var k=this.sync.patchRealtime(E,DrawioFile.LAST_WRITE_WINS?L:null,null,x);null==k||mxUtils.isEmptyObject(k)||E.push(k)}this.patch(E,DrawioFile.LAST_WRITE_WINS?L:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());+this.descriptorChanged();null!=l&&l()}}catch(u){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=p&&p(u);try{var m=this.getCurrentUser(),t=null!=m?m.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),t,u)}catch(A){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(u){null!=p&&p(u)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var l=new mxCodec(mxUtils.createXmlDocument()),p=l.document.createElement("mxfile");if(null!=b)for(var f=0;f<b.length;f++){var x=l.encode(new mxGraphModel(b[f].root));"1"!=urlParams.dev&&(x=this.ui.anonymizeNode(x,!0));x.setAttribute("id",b[f].getId());b[f].viewState&&this.ui.editor.graph.saveViewState(b[f].viewState,x,!0);p.appendChild(x)}return mxUtils.getPrettyXml(p)};DrawioFile.prototype.compressReportData=function(b,l,p){l=null!=l?l:1E4;null!=p&&null!=b&&b.length>p?b=b.substring(0,p)+"[...]":null!=b&&b.length>l&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,l,p,f,x,z,y,F){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var O=this.getCurrentUser(),K=null!=O?O.id:"unknown",L=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",M=JSON.stringify(l).length,c=null;if(null!=l&&1E3>M){b=[];for(p=0;p<l.length;p++)b.push(this.ui.anonymizePatch(l[p]));c=JSON.stringify(b);c=null!=c&&1E3>-c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(d){try{var k=null!=c?"report":"error",m=this.ui.getHashValueForPages(d.getShadowPages()),t="unknown",v="unknown",A="unknown";try{var C=null!=d.initialData&&0<d.initialData.length?mxUtils.parseXml(d.initialData).documentElement:null;null!=C&&(null!=C.getAttribute("version")&&(t=C.getAttribute("version")),null!=C.getAttribute("agent")&&(v=C.getAttribute("agent")),null!=C.getAttribute("type")&&(A=C.getAttribute("type")))}catch(E){}EditorUi.logError("Checksum "+-k+" in "+x,null,this.getMode()+"."+L,"user_"+K+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+M+"-patches_"+l.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=z?"-expected_"+z:"")+(null!=y?"-current_"+y:"")+(null!=F?"-rev_"+this.ui.hashValue(F):"")+(null!=m?"-latest_"+m:"")+"-latestRev_"+this.ui.hashValue(d.getCurrentRevisionId())+("-latestVersion_"+t)+("-latestAgent_"+v)+("-latestType_"+A));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+L,action:x,label:"user_"+-K+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+M+"-patches_"+l.length+"-size_"+this.getSize()})}catch(E){}}),function(){})}catch(d){}};-DrawioFile.prototype.sendErrorReport=function(b,l,p,f){try{var x=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),z=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),F=null!=y?this.ui.hashValue(y.id):"unknown",O=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",K=this.getTitle(),L=K.lastIndexOf(".");y="xml";0<L&&(y=K.substring(L));var M=null!=p?p.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()+" ("+y+")\nUser="+F+O+"\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!=l?"\n\n"+l:-"")+(null!=p?"\n\nError: "+p.message:"")+"\n\nStack:\n"+M+"\n\nShadow:\n"+x+"\n\nData:\n"+z,f)}catch(c){}};-DrawioFile.prototype.reloadFile=function(b,l){try{this.stats.fileReloaded++;var p=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),f=this.ui.editor.graph,x=f.getSelectionCells(),z=f.getViewState(),y=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(F){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[p],"viewState",[z],"latestFile",F);null!=F?(this.ui.replaceFileData(F.getData(),-[p]),this.ui.restoreViewState(y,z,x),this.setDescriptor(F.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 O=this.ui.getCurrentFile();null!=O&&(O.stats=this.stats,O.patch([p]),O.fileChanged());this.ui.restoreViewState(y,z,x);null!=b&&b()}else null!=l&&l(this.ui.fileLoadedError)}),!0))}),l)}catch(F){null!=l&&l(F)}};+DrawioFile.prototype.checksumError=function(b,l,p,f,x,z,y,E){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var R=this.getCurrentUser(),K=null!=R?R.id:"unknown",L=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",O=JSON.stringify(l).length,c=null;if(null!=l&&1E3>O){b=[];for(p=0;p<l.length;p++)b.push(this.ui.anonymizePatch(l[p]));c=JSON.stringify(b);c=null!=c&&1E3>+c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(d){try{var k=null!=c?"report":"error",m=this.ui.getHashValueForPages(d.getShadowPages()),t="unknown",u="unknown",A="unknown";try{var B=null!=d.initialData&&0<d.initialData.length?mxUtils.parseXml(d.initialData).documentElement:null;null!=B&&(null!=B.getAttribute("version")&&(t=B.getAttribute("version")),null!=B.getAttribute("agent")&&(u=B.getAttribute("agent")),null!=B.getAttribute("type")&&(A=B.getAttribute("type")))}catch(D){}EditorUi.logError("Checksum "++k+" in "+x,null,this.getMode()+"."+L,"user_"+K+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+O+"-patches_"+l.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=z?"-expected_"+z:"")+(null!=y?"-current_"+y:"")+(null!=E?"-rev_"+this.ui.hashValue(E):"")+(null!=m?"-latest_"+m:"")+"-latestRev_"+this.ui.hashValue(d.getCurrentRevisionId())+("-latestVersion_"+t)+("-latestAgent_"+u)+("-latestType_"+A));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+L,action:x,label:"user_"++K+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+O+"-patches_"+l.length+"-size_"+this.getSize()})}catch(D){}}),function(){})}catch(d){}};+DrawioFile.prototype.sendErrorReport=function(b,l,p,f){try{var x=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),z=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),E=null!=y?this.ui.hashValue(y.id):"unknown",R=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",K=this.getTitle(),L=K.lastIndexOf(".");y="xml";0<L&&(y=K.substring(L));var O=null!=p?p.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()+" ("+y+")\nUser="+E+R+"\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!=l?"\n\n"+l:+"")+(null!=p?"\n\nError: "+p.message:"")+"\n\nStack:\n"+O+"\n\nShadow:\n"+x+"\n\nData:\n"+z,f)}catch(c){}};+DrawioFile.prototype.reloadFile=function(b,l){try{this.stats.fileReloaded++;var p=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),f=this.ui.editor.graph,x=f.getSelectionCells(),z=f.getViewState(),y=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(E){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[p],"viewState",[z],"latestFile",E);null!=E?(this.ui.replaceFileData(E.getData(),+[p]),this.ui.restoreViewState(y,z,x),this.setDescriptor(E.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 R=this.ui.getCurrentFile();null!=R&&(R.stats=this.stats,R.patch([p]),R.fileChanged());this.ui.restoreViewState(y,z,x);null!=b&&b()}else null!=l&&l(this.ui.fileLoadedError)}),!0))}),l)}catch(E){null!=l&&l(E)}};DrawioFile.prototype.copyFile=function(b,l){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var l=!0;if(null!=b)for(var p=0;p<b.length&&l;p++)l=l&&mxUtils.isEmptyObject(b[p]);return l};-DrawioFile.prototype.patch=function(b,l,p,f){if(null!=b){var x=this.ui.editor.undoManager,z=x.history.slice(),y=x.indexOfNextAdd,F=this.ui.editor.graph;F.container.style.visibility="hidden";var O=this.changeListenerEnabled;this.changeListenerEnabled=p;var K=F.foldingEnabled,L=F.mathEnabled,M=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=F.cellRenderer.redraw;F.cellRenderer.redraw=function(A){A.view.graph.isEditing(A.cell)&&(A.view.graph.scrollCellToVisible(A.cell),-A.view.graph.cellEditor.resize());c.apply(this,arguments)};F.model.beginUpdate();try{if(p){for(var d=this.ui.pages.slice(),k=this.ui.currentPage,m=this.ui.applyPatches(this.ui.pages,b,!0,l,this.isModified()),t=0;t<m.length;t++){var v=mxUtils.indexOf(this.ui.pages,m[t]);0>v?this.ui.insertPage(m[t],Math.min(t,this.ui.pages.length)):this.ui.movePage(v,t)}for(t=0;t<d.length;t++)0>mxUtils.indexOf(m,d[t])&&this.ui.removePage(d[t]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=-this.ui.applyPatches(this.ui.pages,b,!0,l,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);F.checkDefaultParent()}finally{F.container.style.visibility="",F.model.endUpdate(),F.cellRenderer.redraw=c,this.changeListenerEnabled=O,p||(x.history=z,x.indexOfNextAdd=y,x.fireEvent(new mxEventObject(mxEvent.CLEAR))),x=M!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):-null),(z=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&L!=F.mathEnabled?(this.ui.editor.updateGraphComponents(),F.refresh()):x?F.refresh():z&&(K!=F.foldingEnabled?F.view.revalidate():F.view.validate(),F.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!f&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",+DrawioFile.prototype.patch=function(b,l,p,f){if(null!=b){var x=this.ui.editor.undoManager,z=x.history.slice(),y=x.indexOfNextAdd,E=this.ui.editor.graph;E.container.style.visibility="hidden";var R=this.changeListenerEnabled;this.changeListenerEnabled=p;var K=E.foldingEnabled,L=E.mathEnabled,O=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=E.cellRenderer.redraw;E.cellRenderer.redraw=function(A){A.view.graph.isEditing(A.cell)&&(A.view.graph.scrollCellToVisible(A.cell),+A.view.graph.cellEditor.resize());c.apply(this,arguments)};E.model.beginUpdate();try{if(p){for(var d=this.ui.pages.slice(),k=this.ui.currentPage,m=this.ui.applyPatches(this.ui.pages,b,!0,l,this.isModified()),t=0;t<m.length;t++){var u=mxUtils.indexOf(this.ui.pages,m[t]);0>u?this.ui.insertPage(m[t],Math.min(t,this.ui.pages.length)):this.ui.movePage(u,t)}for(t=0;t<d.length;t++)0>mxUtils.indexOf(m,d[t])&&this.ui.removePage(d[t]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=+this.ui.applyPatches(this.ui.pages,b,!0,l,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);E.checkDefaultParent()}finally{E.container.style.visibility="",E.model.endUpdate(),E.cellRenderer.redraw=c,this.changeListenerEnabled=R,p||(x.history=z,x.indexOfNextAdd=y,x.fireEvent(new mxEventObject(mxEvent.CLEAR))),x=O!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):+null),(z=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&L!=E.mathEnabled?(this.ui.editor.updateGraphComponents(),E.refresh()):x?E.refresh():z&&(K!=E.foldingEnabled?E.view.revalidate():E.view.validate(),E.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!f&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",l,"undoable",p)}return b};DrawioFile.prototype.save=function(b,l,p,f,x,z){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",f,"overwrite",x,"manual",z,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!x&&this.invalidChecksum)if(null!=p)p({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=l&&l();else if(null!=p)p({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(y){if(null!=p)p(y);else throw y;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var l=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=l&&(l.viewState=this.ui.editor.graph.getViewState(),l.needsUpdate=!0)}l=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return l};@@ -12340,26 +12345,26 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=newthis.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(l){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(l){this.handleFileError(l)}))):(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 l=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(l,mxUtils.bind(this,function(p){EditorUi.debug("DrawioFile.createSecret",[this],"secret",l,"token",p);b(l,p)}),mxUtils.bind(this,function(){b(l)})):b(l)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};DrawioFile.prototype.fileSaved=function(b,l,p,f,x,z,y){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;z=null!=z?z:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(z),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=p&&p()):this.sync.fileSaved(z,l,p,f,x,y)}catch(K){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=f&&f(K);try{var F=this.getCurrentUser(),O=null!=F?F.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),O,K)}catch(L){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[l],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(K){this.descriptorChanged(),null!=f&&f(K)}};+this.inConflictState=!0;this.descriptorChanged();null!=f&&f(K);try{var E=this.getCurrentUser(),R=null!=E?E.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),R,K)}catch(L){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[l],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(K){this.descriptorChanged(),null!=f&&f(K)}};DrawioFile.prototype.autosave=function(b,l,p,f){null==this.lastAutosave&&(this.lastAutosave=Date.now());var x=Date.now()-this.lastAutosave<l?b:0;this.clearAutosave();var z=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==z&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",z,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var y=this.isAutosaveRevision();-y&&(this.lastAutosaveRevision=(new Date).getTime());this.save(y,mxUtils.bind(this,function(F){this.autosaveCompleted();null!=p&&p(F)}),mxUtils.bind(this,function(F){null!=f&&f(F)}))}else this.isModified()||this.ui.clearStatus(),null!=p&&p(null)}catch(F){null!=f&&f(F)}}),x);this.autosaveThread=z;EditorUi.debug("DrawioFile.autosave",[this],"thread",z,"delay",b,"maxDelay",l,"actualDelay",x,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};+y&&(this.lastAutosaveRevision=(new Date).getTime());this.save(y,mxUtils.bind(this,function(E){this.autosaveCompleted();null!=p&&p(E)}),mxUtils.bind(this,function(E){null!=f&&f(E)}))}else this.isModified()||this.ui.clearStatus(),null!=p&&p(null)}catch(E){null!=f&&f(E)}}),x);this.autosaveThread=z;EditorUi.debug("DrawioFile.autosave",[this],"thread",z,"delay",b,"maxDelay",l,"actualDelay",x,"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"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.close=function(b){try{this.isAutosave()&&this.isModified()&&(this.updateFileData(),this.save(this.isAutosaveRevision(),null,null,b))}catch(l){}this.stats.closed++;this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,l){if(null!=b&&null!=l){var p=b.lastIndexOf(".");b=0<p?b.substring(p):"";p=l.lastIndexOf(".");return b===(0<p?l.substring(p):"")}return b==l};DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.clearAutosave();this.removeListeners();this.stats.destroyed++;null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,l){b([])};DrawioFile.prototype.addComment=function(b,l,p){l(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,l){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,l)};LocalFile=function(b,l,p,f,x,z,y){DrawioFile.call(this,b,l);this.title=p;this.mode=f?null:App.MODE_DEVICE;this.fileHandle=x;this.desc=z;this.editable=y};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,l,p,f,x){this.saveAs(this.title,l,p,f,x)};LocalFile.prototype.saveAs=function(b,l,p,f,x){this.saveFile(b,!1,l,p,null,f,x)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,l){null==this.fileHandle?null!=l&&l({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,l)};-LocalFile.prototype.saveFile=function(b,l,p,f,x,z,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;x||this.updateFileData();var F=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var O=this.getData(),K=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=p&&p()}),L=mxUtils.bind(this,function(M){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var c=mxUtils.bind(this,function(k){this.savingFile=!1;null!=f&&f({error:k})});this.saveDraft(O);this.fileHandle.createWritable().then(mxUtils.bind(this,function(k){this.fileHandle.getFile().then(mxUtils.bind(this,function(m){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[m],"conflict",this.desc.lastModified!=m.lastModified);y||this.desc.lastModified==m.lastModified?k.write(F?this.ui.base64ToBlob(M,"image/png"):M).then(mxUtils.bind(this,function(){k.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){try{var v=this.desc;this.savingFile=!1;this.desc=t;this.fileSaved(O,v,K,c);this.removeDraft()}catch(A){c(A)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(m){this.invalidFileHandle=!0;c(m)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(M,b,F?"image/png":"text/xml",F);else if(M.length<MAX_REQUEST_SIZE){var d=b.lastIndexOf(".");d=0<d?b.substring(d+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(M)+"&filename="+encodeURIComponent(b)+(F?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(M)}));K()}});F?(l=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(M){L(M)}),f,this.ui.getCurrentFile()!=this?O:null,l.scale,l.border)):L(O)};+LocalFile.prototype.saveFile=function(b,l,p,f,x,z,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;x||this.updateFileData();var E=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var R=this.getData(),K=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=p&&p()}),L=mxUtils.bind(this,function(O){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var c=mxUtils.bind(this,function(k){this.savingFile=!1;null!=f&&f({error:k})});this.saveDraft(R);this.fileHandle.createWritable().then(mxUtils.bind(this,function(k){this.fileHandle.getFile().then(mxUtils.bind(this,function(m){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[m],"conflict",this.desc.lastModified!=m.lastModified);y||this.desc.lastModified==m.lastModified?k.write(E?this.ui.base64ToBlob(O,"image/png"):O).then(mxUtils.bind(this,function(){k.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){try{var u=this.desc;this.savingFile=!1;this.desc=t;this.fileSaved(R,u,K,c);this.removeDraft()}catch(A){c(A)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(m){this.invalidFileHandle=!0;c(m)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(O,b,E?"image/png":"text/xml",E);else if(O.length<MAX_REQUEST_SIZE){var d=b.lastIndexOf(".");d=0<d?b.substring(d+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(O)+"&filename="+encodeURIComponent(b)+(E?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(O)}));K()}});E?(l=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(O){L(O)}),f,this.ui.getCurrentFile()!=this?R:null,l.scale,l.border)):L(R)};LocalFile.prototype.rename=function(b,l,p){this.title=b;this.descriptorChanged();null!=l&&l()};LocalLibrary=function(b,l,p){LocalFile.call(this,b,l,p)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,l,p){this.saveFile(b,!1,l,p)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,l,p){DrawioFile.call(this,b,l);this.title=p;this.etag=this.getEtag(l)};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,l){this.getLatestVersionId(b,l)};StorageFile.prototype.getLatestVersionId=function(b,l){StorageFile.getFileContent(this.ui,this.title,mxUtils.bind(this,function(p){b(this.getEtag(p))}),l)};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,l,p){DrawioFile.prototype.save.apply(this,[!1,mxUtils.bind(this,function(){this.saveFile(this.getTitle(),!1,l,p)}),p])};-StorageFile.prototype.saveAs=function(b,l,p){this.rename(b,l,p)};StorageFile.insertFile=function(b,l,p,f,x,z){StorageFile.doInsertFile(null!=z?z:new StorageFile(b,p,l),f,x)};StorageFile.doInsertFile=function(b,l,p){var f=b.getTitle(),x=b.getUi(),z=mxUtils.bind(this,function(y){var F=function(){b.writeFile(f,function(){l(b)},p)};y?x.confirm(mxResources.get("replaceIt",[f]),F,p):F()});StorageFile.getFileContent(x,f,function(y){z(null!=y)},function(){z(!1)})};+StorageFile.prototype.saveAs=function(b,l,p){this.rename(b,l,p)};StorageFile.insertFile=function(b,l,p,f,x,z){StorageFile.doInsertFile(null!=z?z:new StorageFile(b,p,l),f,x)};StorageFile.doInsertFile=function(b,l,p){var f=b.getTitle(),x=b.getUi(),z=mxUtils.bind(this,function(y){var E=function(){b.writeFile(f,function(){l(b)},p)};y?x.confirm(mxResources.get("replaceIt",[f]),E,p):E()});StorageFile.getFileContent(x,f,function(y){z(null!=y)},function(){z(!1)})};StorageFile.getFileContent=function(b,l,p,f){b.getDatabaseItem(l,function(x){p(null!=x?x.data:null)},mxUtils.bind(this,function(){null==b.database?b.getLocalData(l,p):null!=f&&f()}),"files")};StorageFile.getFileInfo=function(b,l,p,f){b.getDatabaseItem(l,function(x){p(x)},mxUtils.bind(this,function(){null==b.database?b.getLocalData(l,function(x){p(null!=x?{title:l}:null)}):null!=f&&f()}),"filesInfo")};-StorageFile.prototype.saveFile=function(b,l,p,f,x){x=null!=x?x:0;if(this.isEditable()){var z=mxUtils.bind(this,function(){this.writeFile(b,p,f)});this.isRenamable()&&"."==b.charAt(0)&&null!=f?f({message:mxResources.get("invalidName")}):this instanceof StorageLibrary?z():StorageFile.getFileInfo(this.ui,b,mxUtils.bind(this,function(y){this.isRenamable()&&this.getTitle()!=b&&null!=y?this.ui.confirm(mxResources.get("replaceIt",[b]),z,f):this.getLatestVersion(mxUtils.bind(this,function(F){EditorUi.debug("StorageFile.saveFile",-[this],"title",b,"data",y,"latestVersion",[F],"descriptor",this.getDescriptor(),"latestVersionDescriptor",F.getDescriptor());F.getDescriptor()!=this.getDescriptor()?this.mergeFile(F,mxUtils.bind(this,function(){x>=this.maxRetries||this.invalidChecksum||this.inConflictState?(this.inConflictState=!0,null!=f&&f()):this.retrySave(mxUtils.bind(this,function(){this.updateFileData();this.saveFile(b,l,p,f,x+1)}))}),f):z()}),f)}),f)}else null!=p&&p();EditorUi.debug("StorageFile.saveFile",[this],"title",b,+StorageFile.prototype.saveFile=function(b,l,p,f,x){x=null!=x?x:0;if(this.isEditable()){var z=mxUtils.bind(this,function(){this.writeFile(b,p,f)});this.isRenamable()&&"."==b.charAt(0)&&null!=f?f({message:mxResources.get("invalidName")}):this instanceof StorageLibrary?z():StorageFile.getFileInfo(this.ui,b,mxUtils.bind(this,function(y){this.isRenamable()&&this.getTitle()!=b&&null!=y?this.ui.confirm(mxResources.get("replaceIt",[b]),z,f):this.getLatestVersion(mxUtils.bind(this,function(E){EditorUi.debug("StorageFile.saveFile",+[this],"title",b,"data",y,"latestVersion",[E],"descriptor",this.getDescriptor(),"latestVersionDescriptor",E.getDescriptor());E.getDescriptor()!=this.getDescriptor()?this.mergeFile(E,mxUtils.bind(this,function(){x>=this.maxRetries||this.invalidChecksum||this.inConflictState?(this.inConflictState=!0,null!=f&&f()):this.retrySave(mxUtils.bind(this,function(){this.updateFileData();this.saveFile(b,l,p,f,x+1)}))}),f):z()}),f)}),f)}else null!=p&&p();EditorUi.debug("StorageFile.saveFile",[this],"title",b,"revision",l,"retry",x)};StorageFile.prototype.retrySave=function(b){var l=300+300*Math.random();window.setTimeout(b,l);EditorUi.debug("StorageFile.retrySave",[this],"delay",l)};StorageFile.prototype.writeFile=function(b,l,p){EditorUi.debug("StorageFile.writeFile",[this],"title",b);this.isRenamable()&&(this.title=b);try{var f=this.getDescriptor(),x=this.getData(),z=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.setDescriptor(this.getEtag(x));this.contentChanged();this.fileSaved(x,f,l,p)});this.setShadowModified(!1);this.ui.setDatabaseItem(null,[{title:this.title,size:x.length,lastModified:Date.now(),type:this.type},{title:this.title,data:x}],z,mxUtils.bind(this,function(){if(null==this.ui.database)try{this.ui.setLocalData(this.title,x,z)}catch(y){null!=p&&p(y)}else null!=p&&p()}),["filesInfo","files"])}catch(y){null!=p&&p(y)}};StorageFile.prototype.rename=function(b,l,p){var f=this.getTitle();f!=b?(EditorUi.debug("StorageFile.rename",[this],"oldTitle",f,"newTitle",b),this.saveFile(b,!1,mxUtils.bind(this,function(){StorageFile.deleteFile(this.ui,f,mxUtils.bind(this,function(){this.ui.removeLocalData(f,l)},p))}),p)):l()};@@ -12370,378 +12375,378 @@ StorageFile.listFiles=function(b,l,p,f){b.getDatabaseItems(function(x){var z=[];StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};StorageLibrary.prototype.isRenamable=function(b,l,p){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(b,l,p){DrawioFile.call(this,b,l);this.title=p;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(b,l,p){RemoteFile.call(this,b,l,p.title);this.libObj=p};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(b,l,p){};RemoteLibrary.prototype.saveAs=function(b,l,p){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,l,p){StorageFile.call(this,b,l,p);b=p;l=b.lastIndexOf("/");0<=l&&(b=b.substring(l+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,l,p){return!1};UrlLibrary.prototype.saveAs=function(b,l,p){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,l,p){DrawioFile.call(this,b,l);this.desc=p||{};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,l,p){function f(M,c,d,k,m,t){function v(){mxEvent.addListener(A,"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);l()})):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);l()}),function(T){b.spinner.stop();b.handleError(T)}):-(b.setMode(d,!0),l())})}F++;++y>p&&(mxUtils.br(O),y=1);var A=document.createElement("a");A.style.overflow="hidden";A.style.display="inline-block";A.className="geBaseButton";A.style.boxSizing="border-box";A.style.fontSize="11px";A.style.position="relative";A.style.margin="4px";A.style.marginTop="8px";A.style.marginBottom="0px";A.style.padding="8px 10px 8px 10px";A.style.width="88px";A.style.height="100px";A.style.whiteSpace="nowrap";A.setAttribute("title",c);var C=document.createElement("div");C.style.textOverflow=-"ellipsis";C.style.overflow="hidden";C.style.position="absolute";C.style.bottom="8px";C.style.left="0px";C.style.right="0px";mxUtils.write(C,c);A.appendChild(C);if(null!=M){var E=document.createElement("img");E.setAttribute("src",M);E.setAttribute("border","0");E.setAttribute("align","absmiddle");E.style.width="60px";E.style.height="60px";E.style.paddingBottom="6px";A.appendChild(E)}else C.style.paddingTop="5px",C.style.whiteSpace="normal",mxClient.IS_IOS?(A.style.padding="0px 10px 20px 10px",A.style.top=-"6px"):mxClient.IS_FF&&(C.style.paddingTop="0px",C.style.marginTop="-2px");if(null!=m)for(M=0;M<m.length;M++)mxUtils.br(C),mxUtils.write(C,m[M]);if(null!=k&&null==b[k]){E.style.visibility="hidden";mxUtils.setOpacity(C,10);var D=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});D.spin(A);var U=window.setTimeout(function(){null==b[k]&&(D.stop(),A.style.display="none")},3E4);b.addListener("clientLoaded",-mxUtils.bind(this,function(T,V){null!=b[k]&&V.getProperty("client")==b[k]&&(window.clearTimeout(U),mxUtils.setOpacity(C,100),E.style.visibility="",D.stop(),v(),"drive"==k&&null!=K.parentNode&&K.parentNode.removeChild(K))}))}else v();O.appendChild(A)}p=null!=p?p:2;var x=document.createElement("div");x.style.textAlign="center";x.style.whiteSpace="nowrap";x.style.paddingTop="0px";x.style.paddingBottom="20px";var z=document.createElement("div");z.style.border="1px solid #d3d3d3";z.style.borderWidth="1px 0px 1px 0px";-z.style.padding="10px 0px 20px 0px";var y=0,F=0,O=document.createElement("div");O.style.paddingTop="2px";z.appendChild(O);var K=document.createElement("p"),L=document.createElement("p");L.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(L,mxResources.get("saveDiagramsTo")+":");x.appendChild(L);x.appendChild(z);y=0;"function"===typeof window.DriveClient&&f(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&+var StorageDialog=function(b,l,p){function f(O,c,d,k,m,t){function u(){mxEvent.addListener(A,"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);l()})):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);l()}),function(U){b.spinner.stop();b.handleError(U)}):+(b.setMode(d,!0),l())})}E++;++y>p&&(mxUtils.br(R),y=1);var A=document.createElement("a");A.style.overflow="hidden";A.style.display="inline-block";A.className="geBaseButton";A.style.boxSizing="border-box";A.style.fontSize="11px";A.style.position="relative";A.style.margin="4px";A.style.marginTop="8px";A.style.marginBottom="0px";A.style.padding="8px 10px 8px 10px";A.style.width="88px";A.style.height="100px";A.style.whiteSpace="nowrap";A.setAttribute("title",c);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,c);A.appendChild(B);if(null!=O){var D=document.createElement("img");D.setAttribute("src",O);D.setAttribute("border","0");D.setAttribute("align","absmiddle");D.style.width="60px";D.style.height="60px";D.style.paddingBottom="6px";A.appendChild(D)}else B.style.paddingTop="5px",B.style.whiteSpace="normal",mxClient.IS_IOS?(A.style.padding="0px 10px 20px 10px",A.style.top=+"6px"):mxClient.IS_FF&&(B.style.paddingTop="0px",B.style.marginTop="-2px");if(null!=m)for(O=0;O<m.length;O++)mxUtils.br(B),mxUtils.write(B,m[O]);if(null!=k&&null==b[k]){D.style.visibility="hidden";mxUtils.setOpacity(B,10);var N=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});N.spin(A);var F=window.setTimeout(function(){null==b[k]&&(N.stop(),A.style.display="none")},3E4);b.addListener("clientLoaded",+mxUtils.bind(this,function(U,V){null!=b[k]&&V.getProperty("client")==b[k]&&(window.clearTimeout(F),mxUtils.setOpacity(B,100),D.style.visibility="",N.stop(),u(),"drive"==k&&null!=K.parentNode&&K.parentNode.removeChild(K))}))}else u();R.appendChild(A)}p=null!=p?p:2;var x=document.createElement("div");x.style.textAlign="center";x.style.whiteSpace="nowrap";x.style.paddingTop="0px";x.style.paddingBottom="20px";var z=document.createElement("div");z.style.border="1px solid #d3d3d3";z.style.borderWidth="1px 0px 1px 0px";+z.style.padding="10px 0px 20px 0px";var y=0,E=0,R=document.createElement("div");R.style.paddingTop="2px";z.appendChild(R);var K=document.createElement("p"),L=document.createElement("p");L.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(L,mxResources.get("saveDiagramsTo")+":");x.appendChild(L);x.appendChild(z);y=0;"function"===typeof window.DriveClient&&f(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&f(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365");"1"!=urlParams.noDevice&&f(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||f(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.OneDriveClient&&f(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");null!=b.gitHub&&f(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=b.gitLab&&f(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");z=document.createElement("span");z.style.position="absolute";z.style.cursor="pointer";z.style.bottom="27px";z.style.color="gray";z.style.userSelect="none";z.style.textAlign="center";z.style.left="50%";mxUtils.setPrefixedStyle(z.style,"transform","translate(-50%,0)");mxUtils.write(z,mxResources.get("decideLater"));x.appendChild(z);mxEvent.addListener(z,-"click",function(){b.hideDialog();var M=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=M});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(K.style.padding="7px",K.style.fontSize="9pt",K.style.marginTop="-14px",K.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="'++"click",function(){b.hideDialog();var O=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=O});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(K.style.padding="7px",K.style.fontSize="9pt",K.style.marginTop="-14px",K.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>",x.appendChild(K))},5E3);this.container=x},SplashDialog=function(b){var l=document.createElement("div");l.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var p=b.addLanguageMenu(l,!1,"28px");null!=p&&(p.style.bottom="24px")}var f=document.createElement("img");f.setAttribute("border","0");f.setAttribute("align","absmiddle");f.style.width="32px";f.style.height="32px";f.style.marginRight="8px";f.style.marginTop="-4px";var x=document.createElement("div");x.style.margin="8px 0px 0px 0px";x.style.padding="18px 0px 24px 0px";p="";b.mode==App.MODE_GOOGLE?(f.src=IMAGE_PATH+"/google-drive-logo.svg",p=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(f.src=IMAGE_PATH+"/dropbox-logo.svg",p=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(f.src=IMAGE_PATH+"/onedrive-logo.svg",p=mxResources.get("oneDrive")):b.mode==App.MODE_M365?(f.src=IMAGE_PATH+"/onedrive-logo.svg",p=mxResources.get("m365")):b.mode==App.MODE_GITHUB?(f.src=IMAGE_PATH+"/github-logo.svg",p=mxResources.get("github")):b.mode==App.MODE_GITLAB?(f.src=IMAGE_PATH+"/gitlab-logo.svg",p=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(f.src=IMAGE_PATH+"/osa_database.png",p=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(f.src=IMAGE_PATH+"/trello-logo.svg",p=mxResources.get("trello")):(f.src=IMAGE_PATH+"/osa_drive-harddisk.png",x.style.paddingBottom="10px",-x.style.paddingTop="30px",p=mxResources.get("device"));var z=document.createElement("button");z.className="geBigButton";z.style.marginBottom="8px";z.style.fontSize="18px";z.style.padding="10px";z.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)x.style.padding="42px 0px 10px 0px",z.style.marginBottom="12px";else{x.style.border="1px solid #d3d3d3";x.style.borderWidth="1px 0px 1px 0px";var y=document.createElement("table"),F=document.createElement("tbody"),O=document.createElement("tr"),-K=document.createElement("td"),L=document.createElement("td");y.setAttribute("align","center");K.appendChild(f);f=document.createElement("div");f.style.fontSize="22px";f.style.paddingBottom="6px";f.style.color="gray";mxUtils.write(f,p);L.style.textAlign="left";L.appendChild(f);O.appendChild(K);O.appendChild(L);F.appendChild(O);y.appendChild(F);l.appendChild(y);p=document.createElement("span");p.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";+x.style.paddingTop="30px",p=mxResources.get("device"));var z=document.createElement("button");z.className="geBigButton";z.style.marginBottom="8px";z.style.fontSize="18px";z.style.padding="10px";z.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)x.style.padding="42px 0px 10px 0px",z.style.marginBottom="12px";else{x.style.border="1px solid #d3d3d3";x.style.borderWidth="1px 0px 1px 0px";var y=document.createElement("table"),E=document.createElement("tbody"),R=document.createElement("tr"),+K=document.createElement("td"),L=document.createElement("td");y.setAttribute("align","center");K.appendChild(f);f=document.createElement("div");f.style.fontSize="22px";f.style.paddingBottom="6px";f.style.color="gray";mxUtils.write(f,p);L.style.textAlign="left";L.appendChild(f);R.appendChild(K);R.appendChild(L);E.appendChild(R);y.appendChild(E);l.appendChild(y);p=document.createElement("span");p.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,0)");mxUtils.write(p,mxResources.get("changeStorage"));mxEvent.addListener(p,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});l.appendChild(p)}mxUtils.write(z,mxResources.get("createNewDiagram"));mxEvent.addListener(z,"click",function(){b.hideDialog();b.actions.get("new").funct()});x.appendChild(z);mxUtils.br(x);z=document.createElement("button");z.className="geBigButton";z.style.marginBottom="22px";z.style.fontSize="18px";z.style.padding="10px";z.style.width="340px";mxUtils.write(z,mxResources.get("openExistingDiagram"));mxEvent.addListener(z,"click",function(){b.actions.get("open").funct()});x.appendChild(z);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(p=function(d){z.style.marginBottom="24px";var k=document.createElement("a");k.style.display="inline-block";k.style.color="gray";k.style.cursor="pointer";k.style.marginTop="6px";mxUtils.write(k,mxResources.get("signOut"));z.style.marginBottom="16px";x.style.paddingBottom="18px";mxEvent.addListener(k,"click",function(){b.confirm(mxResources.get("areYouSure"),-function(){d()})});x.appendChild(k)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var M=b.drive.getUsersList();if(0<M.length){f=document.createElement("span");f.style.marginTop="6px";mxUtils.write(f,mxResources.get("changeUser")+":");z.style.marginBottom="16px";x.style.paddingBottom="18px";x.appendChild(f);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(p=0;p<M.length;p++)y=document.createElement("option"),mxUtils.write(y,M[p].displayName),y.value=p,c.appendChild(y),-y=document.createElement("option"),y.innerHTML=" ",mxUtils.write(y,"<"+M[p].email+">"),y.setAttribute("disabled","disabled"),c.appendChild(y);y=document.createElement("option");mxUtils.write(y,mxResources.get("addAccount"));y.value=M.length;c.appendChild(y);mxEvent.addListener(c,"change",function(){var d=c.value,k=M.length!=d;k&&b.drive.setUser(M[d]);b.drive.authorize(k,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(m){b.handleError(m,null,function(){b.hideDialog();+function(){d()})});x.appendChild(k)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var O=b.drive.getUsersList();if(0<O.length){f=document.createElement("span");f.style.marginTop="6px";mxUtils.write(f,mxResources.get("changeUser")+":");z.style.marginBottom="16px";x.style.paddingBottom="18px";x.appendChild(f);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(p=0;p<O.length;p++)y=document.createElement("option"),mxUtils.write(y,O[p].displayName),y.value=p,c.appendChild(y),+y=document.createElement("option"),y.innerHTML=" ",mxUtils.write(y,"<"+O[p].email+">"),y.setAttribute("disabled","disabled"),c.appendChild(y);y=document.createElement("option");mxUtils.write(y,mxResources.get("addAccount"));y.value=O.length;c.appendChild(y);mxEvent.addListener(c,"change",function(){var d=c.value,k=O.length!=d;k&&b.drive.setUser(O[d]);b.drive.authorize(k,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(m){b.handleError(m,null,function(){b.hideDialog();b.showSplash()})},!0)});x.appendChild(c)}else p(function(){b.drive.logout()})}else b.mode!=App.MODE_ONEDRIVE||null==b.oneDrive||b.oneDrive.noLogout?b.mode==App.MODE_GITHUB&&null!=b.gitHub?p(function(){b.gitHub.logout();b.openLink("https://www.github.com/logout")}):b.mode==App.MODE_GITLAB&&null!=b.gitLab?p(function(){b.gitLab.logout();var d=document.createElement("form");d.setAttribute("method","post");d.setAttribute("action",DRAWIO_GITLAB_URL+"/users/sign_out");d.setAttribute("target","_blank");document.body.appendChild(d);-d.submit();d.parentNode.removeChild(d)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&p(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&p(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):p(function(){b.oneDrive.logout()});l.appendChild(x);this.container=l},EmbedDialog=function(b,l,p,f,x,z,y,F,O){f=document.createElement("div");f.style.height="100%";f.style.display="flex";f.style.flexDirection="column";var K=/^https?:\/\//.test(l)||+d.submit();d.parentNode.removeChild(d)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&p(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&p(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):p(function(){b.oneDrive.logout()});l.appendChild(x);this.container=l},EmbedDialog=function(b,l,p,f,x,z,y,E,R){f=document.createElement("div");f.style.height="100%";f.style.display="flex";f.style.flexDirection="column";var K=/^https?:\/\//.test(l)||/^mailto:\/\//.test(l);y=document.createElement("div");y.style.flexShrink="0";y.style.position="relative";null!=z?mxUtils.write(y,z):mxUtils.write(y,mxResources.get(5E5>l.length?K?"link":"mainEmbedNotice":"preview")+":");z=document.createElement("span");z.style.cssFloat="right";z.style.color="gray";mxUtils.write(z,b.formatFileSize(l.length));y.appendChild(z);f.appendChild(y);var L=document.createElement("textarea");L.setAttribute("autocomplete","off");L.setAttribute("autocorrect","off");L.setAttribute("autocapitalize","off");L.setAttribute("spellcheck","false");L.style.fontFamily="monospace";L.style.wordBreak="break-all";L.style.marginTop="10px";L.style.resize="none";L.style.flex="1";L.style.width="100%";L.style.boxSizing="border-box";L.value=mxResources.get("updatingDocument");f.appendChild(L);this.init=function(){window.setTimeout(function(){5E5>l.length?(L.value=l,L.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null)):(L.setAttribute("readonly",-"true"),L.value=mxResources.get("tooLargeUseDownload"))},0)};z=document.createElement("div");z.style.flexShrink="0";z.style.textAlign="right";z.style.paddingTop="14px";z.style.whiteSpace="nowrap";y=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&K&&(y=mxUtils.button(null!=F?F:mxResources.get(5E5>l.length?"preview":"openInNewWindow"),function(){var c=5E5>l.length?L.value:l;if(null!=x)x(c);else if(K)try{var d=b.openLink(c);null!=d&&(null==p||0<p)&&window.setTimeout(mxUtils.bind(this,+"true"),L.value=mxResources.get("tooLargeUseDownload"))},0)};z=document.createElement("div");z.style.flexShrink="0";z.style.textAlign="right";z.style.paddingTop="14px";z.style.whiteSpace="nowrap";y=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&K&&(y=mxUtils.button(null!=E?E:mxResources.get(5E5>l.length?"preview":"openInNewWindow"),function(){var c=5E5>l.length?L.value:l;if(null!=x)x(c);else if(K)try{var d=b.openLink(c);null!=d&&(null==p||0<p)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=d&&null!=d.location.href&&d.location.href.substring(0,8)!=c.substring(0,8)&&(d.close(),b.handleError({message:mxResources.get("drawingTooLarge")}))}catch(m){}}),p||500)}catch(m){b.handleError({message:m.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"==l.substring(0,7)?l:mxUtils.htmlEntities(l))+-"</body></html>"),k.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),y.className="geBtn",z.appendChild(y));F=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=O?O:"embed.txt","txt",l,"text/plain")});F.className="geBtn";z.appendChild(F);if(!b.isOffline()&&5E5>l.length){F=mxUtils.button("",function(){try{var c="mailto:?subject="+encodeURIComponent(O||b.defaultFilename)+"&body="+encodeURIComponent(L.value);b.openLink(c)}catch(d){b.handleError({message:d.message||-mxResources.get("drawingTooLarge")})}});var M=document.createElement("img");M.className="geAdaptiveAsset";M.setAttribute("src",Editor.mailImage);M.setAttribute("width","18");M.setAttribute("height","18");M.setAttribute("border","0");M.style.marginBottom="5px";F.appendChild(M);F.style.verticalAlign="bottom";F.style.paddingTop="4px";F.style.minWidth="46px";F.className="geBtn";z.appendChild(F)}F=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});z.appendChild(F);M=mxUtils.button(mxResources.get("copy"),-function(){L.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});5E5>l.length?mxClient.IS_SF||null!=document.documentMode?F.className="geBtn gePrimaryBtn":(z.appendChild(M),M.className="geBtn gePrimaryBtn",F.className="geBtn"):null!=y&&(z.appendChild(y),F.className="geBtn",y.className="geBtn gePrimaryBtn");f.appendChild(z);this.container=f};+"</body></html>"),k.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),y.className="geBtn",z.appendChild(y));E=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=R?R:"embed.txt","txt",l,"text/plain")});E.className="geBtn";z.appendChild(E);if(!b.isOffline()&&5E5>l.length){E=mxUtils.button("",function(){try{var c="mailto:?subject="+encodeURIComponent(R||b.defaultFilename)+"&body="+encodeURIComponent(L.value);b.openLink(c)}catch(d){b.handleError({message:d.message||+mxResources.get("drawingTooLarge")})}});var O=document.createElement("img");O.className="geAdaptiveAsset";O.setAttribute("src",Editor.mailImage);O.setAttribute("width","18");O.setAttribute("height","18");O.setAttribute("border","0");O.style.marginBottom="5px";E.appendChild(O);E.style.verticalAlign="bottom";E.style.paddingTop="4px";E.style.minWidth="46px";E.className="geBtn";z.appendChild(E)}E=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});z.appendChild(E);O=mxUtils.button(mxResources.get("copy"),+function(){L.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});5E5>l.length?mxClient.IS_SF||null!=document.documentMode?E.className="geBtn gePrimaryBtn":(z.appendChild(O),O.className="geBtn gePrimaryBtn",E.className="geBtn"):null!=y&&(z.appendChild(y),E.className="geBtn",y.className="geBtn gePrimaryBtn");f.appendChild(z);this.container=f};EmbedDialog.showPreviewOption=!0;var CreateGraphDialog=function(b,l,p){var f=document.createElement("div");f.style.textAlign="right";this.init=function(){var x=document.createElement("div");x.style.position="relative";x.style.border="1px solid gray";x.style.boxSizing="border-box";x.style.width="100%";x.style.height="360px";x.style.overflow="hidden";x.style.marginBottom="16px";mxEvent.disableContextMenu(x);f.appendChild(x);var z=new Graph(x);z.setCellsCloneable(!0);z.setPanning(!0);z.setAllowDanglingEdges(!1);z.connectionHandler.select=-!1;z.view.setTranslate(20,20);z.border=20;z.panningHandler.useLeftButtonForPanning=!0;mxClient.IS_SVG&&null!=z.view.getDrawPane()&&(x=z.view.getDrawPane().ownerSVGElement,null!=x&&(x.style.position="absolute"));var y="curved=1;";z.cellRenderer.installCellOverlayListeners=function(k,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",k))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(t.node,"touchstart",function(v){m.fireEvent(new mxEventObject("pointerdown","event",v,"state",k))})};z.getAllConnectionConstraints=function(){return null};z.connectionHandler.marker.highlight.keepOnTop=!1;z.connectionHandler.createEdgeState=function(k){k=z.createEdge(null,null,null,null,null,y);return new mxCellState(this.graph.view,k,this.graph.getCellStyle(k))};var F=z.getDefaultParent(),O=mxUtils.bind(this,function(k){var m=-new mxCellOverlay(this.connectImage,"Add outgoing");m.cursor="hand";m.addListener(mxEvent.CLICK,function(t,v){z.connectionHandler.reset();z.clearSelection();var A=z.getCellGeometry(k),C;M(function(){C=z.insertVertex(F,null,"Entry",A.x,A.y,80,30,"rounded=1;");O(C);z.view.refresh(C);z.insertEdge(F,null,"",k,C,y)},function(){z.scrollCellToVisible(C)})});m.addListener("pointerdown",function(t,v){t=v.getProperty("event");v=v.getProperty("state");z.popupMenuHandler.hideMenu();z.stopEditing(!1);var A=mxUtils.convertPoint(z.container,-mxEvent.getClientX(t),mxEvent.getClientY(t));z.connectionHandler.start(v,A.x,A.y);z.isMouseDown=!0;z.isMouseTrigger=mxEvent.isMouseEvent(t);mxEvent.consume(t)});z.addCellOverlay(k,m)});z.getModel().beginUpdate();try{var K=z.insertVertex(F,null,"Start",0,0,80,30,"ellipse");O(K)}finally{z.getModel().endUpdate()}if("horizontalTree"==p){var L=new mxCompactTreeLayout(z);L.edgeRouting=!1;L.levelDistance=30;L.sortEdges=!0;y="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==p?(L=new mxCompactTreeLayout(z,-!1),L.edgeRouting=!1,L.levelDistance=30,L.sortEdges=!0,y="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==p?(L=new mxRadialTreeLayout(z,!1),L.edgeRouting=!1,L.levelDistance=80):"verticalFlow"==p?L=new mxHierarchicalLayout(z,mxConstants.DIRECTION_NORTH):"horizontalFlow"==p?L=new mxHierarchicalLayout(z,mxConstants.DIRECTION_WEST):"circle"==p?L=new mxCircleLayout(z):(L=new mxFastOrganicLayout(z,!1),L.forceConstant=80);if(null!=L){var M=function(k,m){z.getModel().beginUpdate();try{null!=k&&k(),-L.execute(z.getDefaultParent(),K)}catch(t){throw t;}finally{k=new mxMorphing(z),k.addListener(mxEvent.DONE,mxUtils.bind(this,function(){z.getModel().endUpdate();null!=m&&m()})),k.startAnimation()}},c=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(k,m,t,v,A){c.apply(this,arguments);M()};z.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);M()};z.connectionHandler.addListener(mxEvent.CONNECT,function(){M()})}x=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),+!1;z.view.setTranslate(20,20);z.border=20;z.panningHandler.useLeftButtonForPanning=!0;mxClient.IS_SVG&&null!=z.view.getDrawPane()&&(x=z.view.getDrawPane().ownerSVGElement,null!=x&&(x.style.position="absolute"));var y="curved=1;";z.cellRenderer.installCellOverlayListeners=function(k,m,t){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(t.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(u){m.fireEvent(new mxEventObject("pointerdown","event",u,+"state",k))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(t.node,"touchstart",function(u){m.fireEvent(new mxEventObject("pointerdown","event",u,"state",k))})};z.getAllConnectionConstraints=function(){return null};z.connectionHandler.marker.highlight.keepOnTop=!1;z.connectionHandler.createEdgeState=function(k){k=z.createEdge(null,null,null,null,null,y);return new mxCellState(this.graph.view,k,this.graph.getCellStyle(k))};var E=z.getDefaultParent(),R=mxUtils.bind(this,function(k){var m=+new mxCellOverlay(this.connectImage,"Add outgoing");m.cursor="hand";m.addListener(mxEvent.CLICK,function(t,u){z.connectionHandler.reset();z.clearSelection();var A=z.getCellGeometry(k),B;O(function(){B=z.insertVertex(E,null,"Entry",A.x,A.y,80,30,"rounded=1;");R(B);z.view.refresh(B);z.insertEdge(E,null,"",k,B,y)},function(){z.scrollCellToVisible(B)})});m.addListener("pointerdown",function(t,u){t=u.getProperty("event");u=u.getProperty("state");z.popupMenuHandler.hideMenu();z.stopEditing(!1);var A=mxUtils.convertPoint(z.container,+mxEvent.getClientX(t),mxEvent.getClientY(t));z.connectionHandler.start(u,A.x,A.y);z.isMouseDown=!0;z.isMouseTrigger=mxEvent.isMouseEvent(t);mxEvent.consume(t)});z.addCellOverlay(k,m)});z.getModel().beginUpdate();try{var K=z.insertVertex(E,null,"Start",0,0,80,30,"ellipse");R(K)}finally{z.getModel().endUpdate()}if("horizontalTree"==p){var L=new mxCompactTreeLayout(z);L.edgeRouting=!1;L.levelDistance=30;L.sortEdges=!0;y="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==p?(L=new mxCompactTreeLayout(z,+!1),L.edgeRouting=!1,L.levelDistance=30,L.sortEdges=!0,y="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==p?(L=new mxRadialTreeLayout(z,!1),L.edgeRouting=!1,L.levelDistance=80):"verticalFlow"==p?L=new mxHierarchicalLayout(z,mxConstants.DIRECTION_NORTH):"horizontalFlow"==p?L=new mxHierarchicalLayout(z,mxConstants.DIRECTION_WEST):"circle"==p?L=new mxCircleLayout(z):(L=new mxFastOrganicLayout(z,!1),L.forceConstant=80);if(null!=L){var O=function(k,m){z.getModel().beginUpdate();try{null!=k&&k(),+L.execute(z.getDefaultParent(),K)}catch(t){throw t;}finally{k=new mxMorphing(z),k.addListener(mxEvent.DONE,mxUtils.bind(this,function(){z.getModel().endUpdate();null!=m&&m()})),k.startAnimation()}},c=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(k,m,t,u,A){c.apply(this,arguments);O()};z.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);O()};z.connectionHandler.addListener(mxEvent.CONNECT,function(){O()})}x=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});x.className="geBtn";b.editor.cancelFirst&&f.appendChild(x);var d=mxUtils.button(mxResources.get("insert"),function(k){z.clearCellOverlays();var m=z.getModel().getChildren(z.getDefaultParent());k=mxEvent.isAltDown(k)?b.editor.graph.getFreeInsertPoint():b.editor.graph.getCenterInsertPoint(z.getBoundingBoxFromGeometry(m,!0));m=b.editor.graph.importCells(m,k.x,k.y);k=b.editor.graph.view;var t=k.getBounds(m);null!=t&&(t.x-=k.translate.x,t.y-=k.translate.y,b.editor.graph.scrollRectToVisible(t),b.editor.graph.setSelectionCells(m));b.hideDialog()});f.appendChild(d);d.className="geBtn gePrimaryBtn";b.editor.cancelFirst||f.appendChild(x);this.graph=z};this.container=f};CreateGraphDialog.prototype.connectImage=new mxImage("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==",26,26);-var BackgroundImageDialog=function(b,l,p,f,x){function z(){null==u||u==mxConstants.NONE?(n.style.display="none",T.checked=!1):(n.style.backgroundColor=u,n.style.display="",T.checked=!0)}var y=b.editor.graph,F=document.createElement("div");F.style.whiteSpace="nowrap";var O=document.createElement("h2");mxUtils.write(O,mxResources.get("background"));O.style.marginTop="0px";F.appendChild(O);var K=null!=p&&null!=p.originalSrc;O=!1;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 M=document.createElement("input");M.style.cssText="margin-right:8px;margin-bottom:8px;";M.setAttribute("value","url");M.setAttribute("type","radio");M.setAttribute("name","geBackgroundImageDialogOption");var c=document.createElement("input");c.setAttribute("type","text");c.style.marginBottom="8px";c.style.width="360px";c.value=K||null==p?"":p.src;var d=document.createElement("select");d.style.width="360px";-if(null!=b.pages)for(var k=0;k<b.pages.length;k++){var m=document.createElement("option");mxUtils.write(m,b.pages[k].getName()||mxResources.get("pageWithNumber",[k+1]));m.setAttribute("value","data:page/id,"+b.pages[k].getId());b.pages[k]==b.currentPage&&m.setAttribute("disabled","disabled");null!=p&&p.originalSrc==m.getAttribute("value")&&(m.setAttribute("selected","selected"),O=!0);d.appendChild(m)}K||null!=b.pages&&1!=b.pages.length||(L.style.display="none",M.style.display="none",d.style.display=-"none");var t=document.createElement("option"),v=!1,A=!1,C=function(H,I){v||null!=H&&A||(M.checked?null!=I&&I(t.selected?null:d.value):""==c.value||b.isOffline()?(D.value="",U.value="",null!=I&&I("")):(c.value=mxUtils.trim(c.value),b.loadImage(c.value,function(g){D.value=g.width;U.value=g.height;null!=I&&I(c.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));D.value="";U.value="";null!=I&&I(null)})))},E=mxUtils.bind(this,function(H){b.importFiles(H,-0,0,b.maxBackgroundSize,function(I,g,q,B,J,Q){c.value=I;C();c.focus()},function(){},function(I){return"image/"==I.type.substring(0,6)},function(I){for(var g=0;g<I.length;g++)I[g]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){K?d.focus():c.focus();mxEvent.addListener(d,"focus",function(){L.removeAttribute("checked");M.setAttribute("checked","checked");M.checked=!0});mxEvent.addListener(c,"focus",function(){M.removeAttribute("checked");L.setAttribute("checked","checked");-L.checked=!0});if(Graph.fileSupport){c.setAttribute("placeholder",mxResources.get("dragImagesHere"));var H=F.parentNode,I=null;mxEvent.addListener(H,"dragleave",function(g){null!=I&&(I.parentNode.removeChild(I),I=null);g.stopPropagation();g.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(g){null==I&&(I=b.highlightElement(H));g.stopPropagation();g.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(g){null!=I&&(I.parentNode.removeChild(I),I=null);-if(0<g.dataTransfer.files.length)E(g.dataTransfer.files);else if(0<=mxUtils.indexOf(g.dataTransfer.types,"text/uri-list")){var q=g.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(q)&&(c.value=decodeURIComponent(q),C())}g.stopPropagation();g.preventDefault()}),!1)}};F.appendChild(L);F.appendChild(c);mxUtils.br(F);k=document.createElement("span");k.style.marginLeft="30px";mxUtils.write(k,mxResources.get("width")+":");F.appendChild(k);var D=document.createElement("input");-D.setAttribute("type","text");D.style.width="60px";D.style.marginLeft="8px";D.style.marginRight="16px";D.value=null==p||K?"":p.width;F.appendChild(D);mxUtils.write(F,mxResources.get("height")+":");var U=document.createElement("input");U.setAttribute("type","text");U.style.width="60px";U.style.marginLeft="8px";U.style.marginRight="16px";U.value=null==p||K?"":p.height;F.appendChild(U);mxUtils.br(F);mxUtils.br(F);mxEvent.addListener(c,"change",C);ImageDialog.filePicked=function(H){H.action==google.picker.Action.PICKED&&-null!=H.docs[0].thumbnails&&(H=H.docs[0].thumbnails[H.docs[0].thumbnails.length-1],null!=H&&(c.value=H.url,C()));c.focus()};F.appendChild(M);F.appendChild(d);mxUtils.br(F);mxUtils.br(F);K?(M.setAttribute("checked","checked"),M.checked=!0):(L.setAttribute("checked","checked"),L.checked=!0);!O&&M.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)}));p=document.createElement("div");p.style.display=x?"inline-flex":"none";p.style.alignItems="center";p.style.cursor="default";p.style.minWidth="40%";p.style.height="20px";var T=document.createElement("input");T.setAttribute("type","checkbox");T.style.margin="0px 10px 0px 4px";T.style.verticalAlign="bottom";T.defaultChecked=f!=mxConstants.NONE&&null!=f;T.checked=T.defaultChecked;p.appendChild(T);mxUtils.write(p,mxResources.get("fillColor"));+var BackgroundImageDialog=function(b,l,p,f,x){function z(){null==v||v==mxConstants.NONE?(n.style.display="none",U.checked=!1):(n.style.backgroundColor=v,n.style.display="",U.checked=!0)}var y=b.editor.graph,E=document.createElement("div");E.style.whiteSpace="nowrap";var R=document.createElement("h2");mxUtils.write(R,mxResources.get("background"));R.style.marginTop="0px";E.appendChild(R);var K=null!=p&&null!=p.originalSrc;R=!1;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 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 c=document.createElement("input");c.setAttribute("type","text");c.style.marginBottom="8px";c.style.width="360px";c.value=K||null==p?"":p.src;var d=document.createElement("select");d.style.width="360px";+if(null!=b.pages)for(var k=0;k<b.pages.length;k++){var m=document.createElement("option");mxUtils.write(m,b.pages[k].getName()||mxResources.get("pageWithNumber",[k+1]));m.setAttribute("value","data:page/id,"+b.pages[k].getId());b.pages[k]==b.currentPage&&m.setAttribute("disabled","disabled");null!=p&&p.originalSrc==m.getAttribute("value")&&(m.setAttribute("selected","selected"),R=!0);d.appendChild(m)}K||null!=b.pages&&1!=b.pages.length||(L.style.display="none",O.style.display="none",d.style.display=+"none");var t=document.createElement("option"),u=!1,A=!1,B=function(H,I){u||null!=H&&A||(O.checked?null!=I&&I(t.selected?null:d.value):""==c.value||b.isOffline()?(N.value="",F.value="",null!=I&&I("")):(c.value=mxUtils.trim(c.value),b.loadImage(c.value,function(g){N.value=g.width;F.value=g.height;null!=I&&I(c.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));N.value="";F.value="";null!=I&&I(null)})))},D=mxUtils.bind(this,function(H){b.importFiles(H,+0,0,b.maxBackgroundSize,function(I,g,q,C,J,M){c.value=I;B();c.focus()},function(){},function(I){return"image/"==I.type.substring(0,6)},function(I){for(var g=0;g<I.length;g++)I[g]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){K?d.focus():c.focus();mxEvent.addListener(d,"focus",function(){L.removeAttribute("checked");O.setAttribute("checked","checked");O.checked=!0});mxEvent.addListener(c,"focus",function(){O.removeAttribute("checked");L.setAttribute("checked","checked");+L.checked=!0});if(Graph.fileSupport){c.setAttribute("placeholder",mxResources.get("dragImagesHere"));var H=E.parentNode,I=null;mxEvent.addListener(H,"dragleave",function(g){null!=I&&(I.parentNode.removeChild(I),I=null);g.stopPropagation();g.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(g){null==I&&(I=b.highlightElement(H));g.stopPropagation();g.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(g){null!=I&&(I.parentNode.removeChild(I),I=null);+if(0<g.dataTransfer.files.length)D(g.dataTransfer.files);else if(0<=mxUtils.indexOf(g.dataTransfer.types,"text/uri-list")){var q=g.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(q)&&(c.value=decodeURIComponent(q),B())}g.stopPropagation();g.preventDefault()}),!1)}};E.appendChild(L);E.appendChild(c);mxUtils.br(E);k=document.createElement("span");k.style.marginLeft="30px";mxUtils.write(k,mxResources.get("width")+":");E.appendChild(k);var N=document.createElement("input");+N.setAttribute("type","text");N.style.width="60px";N.style.marginLeft="8px";N.style.marginRight="16px";N.value=null==p||K?"":p.width;E.appendChild(N);mxUtils.write(E,mxResources.get("height")+":");var F=document.createElement("input");F.setAttribute("type","text");F.style.width="60px";F.style.marginLeft="8px";F.style.marginRight="16px";F.value=null==p||K?"":p.height;E.appendChild(F);mxUtils.br(E);mxUtils.br(E);mxEvent.addListener(c,"change",B);ImageDialog.filePicked=function(H){H.action==google.picker.Action.PICKED&&+null!=H.docs[0].thumbnails&&(H=H.docs[0].thumbnails[H.docs[0].thumbnails.length-1],null!=H&&(c.value=H.url,B()));c.focus()};E.appendChild(O);E.appendChild(d);mxUtils.br(E);mxUtils.br(E);K?(O.setAttribute("checked","checked"),O.checked=!0):(L.setAttribute("checked","checked"),L.checked=!0);!R&&O.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)}));p=document.createElement("div");p.style.display=x?"inline-flex":"none";p.style.alignItems="center";p.style.cursor="default";p.style.minWidth="40%";p.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=f!=mxConstants.NONE&&null!=f;U.checked=U.defaultChecked;p.appendChild(U);mxUtils.write(p,mxResources.get("fillColor"));x=p.cloneNode(!1);var V=document.createElement("input");V.setAttribute("type","checkbox");V.style.margin="0px 10px 0px 30px";V.style.verticalAlign="bottom";V.defaultChecked=y.shadowVisible;V.checked=V.defaultChecked;x.appendChild(V);mxUtils.write(x,mxResources.get("shadow"));mxClient.IS_SVG&&!mxClient.IS_SF||V.setAttribute("disabled","disabled");mxEvent.addListener(x,"click",function(H){mxEvent.getSource(H)!=V&&(V.checked=!V.checked)});var n=document.createElement("button");n.style.width="36px";n.style.height=-"18px";n.style.cursor="pointer";n.style.marginLeft="10px";n.style.backgroundPosition="center center";n.style.backgroundRepeat="no-repeat";n.style.verticalAlign="bottom";n.className="geColorBtn";var u=f;z();mxEvent.addListener(p,"click",function(H){mxEvent.getSource(H)!=T&&(T.checked=!T.checked);u=T.checked?"#ffffff":null;z()});mxEvent.addListener(n,"click",function(H){b.pickColor(u||"none",function(I){u=I;z()});mxEvent.consume(H)});p.appendChild(n);F.appendChild(p);F.appendChild(x);mxUtils.br(F);-f=document.createElement("div");f.style.marginTop="30px";f.style.textAlign="right";y=mxUtils.button(mxResources.get("cancel"),function(){v=!0;b.hideDialog()});y.className="geBtn";b.editor.cancelFirst&&f.appendChild(y);x=mxUtils.button(mxResources.get("reset"),function(){c.value="";D.value="";U.value="";L.checked=!0;u=mxConstants.NONE;z();v=!1});mxEvent.addGestureListeners(x,function(){v=!0});x.className="geBtn";x.width="100";f.appendChild(x);if(Graph.fileSupport){var G=document.createElement("input");-G.setAttribute("multiple","multiple");G.setAttribute("type","file");mxEvent.addListener(G,"change",function(H){null!=G.files&&(E(G.files),G.type="",G.type="file",G.value="")});G.style.display="none";F.appendChild(G);x=mxUtils.button(mxResources.get("open"),function(){G.click()});x.className="geBtn";f.appendChild(x)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();C(null,function(H){l(""!=H&&null!=H?new mxImage(H,D.value,U.value):null,null==H,u,!mxClient.IS_SVG||mxClient.IS_SF?-null:V.checked)})});mxEvent.addGestureListeners(applyBtn,function(){A=!0});applyBtn.className="geBtn gePrimaryBtn";f.appendChild(applyBtn);b.editor.cancelFirst||f.appendChild(y);F.appendChild(f);this.container=F},ParseDialog=function(b,l,p){function f(d,k,m){if("plantUmlPng"==k||"plantUmlSvg"==k||"plantUmlTxt"==k){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var t=function(I,g,q,B,J){var Q=null;v.getModel().beginUpdate();try{Q="txt"==g?b.insertAsPreText(q,z.x,z.y):v.insertVertex(null,-null,null,z.x,z.y,B,J,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(q)+";"),v.setAttributeForCell(Q,"plantUmlData",JSON.stringify({data:I,format:g},null,2))}finally{v.getModel().endUpdate()}null!=Q&&(v.setSelectionCell(Q),v.scrollCellToVisible(Q))},v=b.editor.graph,A="plantUmlTxt"==k?"txt":"plantUmlPng"==k?"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"==+"18px";n.style.cursor="pointer";n.style.marginLeft="10px";n.style.backgroundPosition="center center";n.style.backgroundRepeat="no-repeat";n.style.verticalAlign="bottom";n.className="geColorBtn";var v=f;z();mxEvent.addListener(p,"click",function(H){mxEvent.getSource(H)!=U&&(U.checked=!U.checked);v=U.checked?"#ffffff":null;z()});mxEvent.addListener(n,"click",function(H){b.pickColor(v||"none",function(I){v=I;z()});mxEvent.consume(H)});p.appendChild(n);E.appendChild(p);E.appendChild(x);mxUtils.br(E);+f=document.createElement("div");f.style.marginTop="30px";f.style.textAlign="right";y=mxUtils.button(mxResources.get("cancel"),function(){u=!0;b.hideDialog()});y.className="geBtn";b.editor.cancelFirst&&f.appendChild(y);x=mxUtils.button(mxResources.get("reset"),function(){c.value="";N.value="";F.value="";L.checked=!0;v=mxConstants.NONE;z();u=!1});mxEvent.addGestureListeners(x,function(){u=!0});x.className="geBtn";x.width="100";f.appendChild(x);if(Graph.fileSupport){var G=document.createElement("input");+G.setAttribute("multiple","multiple");G.setAttribute("type","file");mxEvent.addListener(G,"change",function(H){null!=G.files&&(D(G.files),G.type="",G.type="file",G.value="")});G.style.display="none";E.appendChild(G);x=mxUtils.button(mxResources.get("open"),function(){G.click()});x.className="geBtn";f.appendChild(x)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();B(null,function(H){l(""!=H&&null!=H?new mxImage(H,N.value,F.value):null,null==H,v,!mxClient.IS_SVG||mxClient.IS_SF?+null:V.checked)})});mxEvent.addGestureListeners(applyBtn,function(){A=!0});applyBtn.className="geBtn gePrimaryBtn";f.appendChild(applyBtn);b.editor.cancelFirst||f.appendChild(y);E.appendChild(f);this.container=E},ParseDialog=function(b,l,p){function f(d,k,m){if("plantUmlPng"==k||"plantUmlSvg"==k||"plantUmlTxt"==k){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var t=function(I,g,q,C,J){var M=null;u.getModel().beginUpdate();try{M="txt"==g?b.insertAsPreText(q,z.x,z.y):u.insertVertex(null,+null,null,z.x,z.y,C,J,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(q)+";"),u.setAttributeForCell(M,"plantUmlData",JSON.stringify({data:I,format:g},null,2))}finally{u.getModel().endUpdate()}null!=M&&(u.setSelectionCell(M),u.scrollCellToVisible(M))},u=b.editor.graph,A="plantUmlTxt"==k?"txt":"plantUmlPng"==k?"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"==A?window.setTimeout(function(){b.spinner.stop();t(d,A,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",295,212)},200):b.generatePlantUmlImage(d,A,function(I,g,q){b.spinner.stop();t(d,A,I,g,q)},function(I){b.handleError(I)})}}else if("mermaid"==k||"mermaid2drawio"==k)b.spinner.spin(document.body,mxResources.get("inserting"))&&b.parseMermaidDiagram(d,null,mxUtils.bind(this,function(I){b.spinner.stop();var g=b.editor.graph;g.setSelectionCells(b.importXml(I,Math.max(z.x,20),Math.max(z.y,20),!0,null,null,!0));g.scrollCellToVisible(g.getSelectionCell())}),mxUtils.bind(this,function(I){b.handleError(I)}),-null,"mermaid2drawio"==k);else if("table"==k){var C=d.split("\n");k=null;var E=[],D=0,U={};for(m=0;m<C.length;m++){var T=mxUtils.trim(C[m]);if("primary key"==T.substring(0,11).toLowerCase()){var V=T.match(/\((.+)\)/);V&&V[1]&&(U[V[1]]=!0);C.splice(m,1)}else 0<T.toLowerCase().indexOf("primary key")&&(U[T.split(" ")[0]]=!0,C[m]=mxUtils.trim(T.replace(/primary key/i,"")))}for(m=0;m<C.length;m++)if(T=mxUtils.trim(C[m]),"create table"==T.substring(0,12).toLowerCase())T=mxUtils.trim(T.substring(12)),"("==-T.charAt(T.length-1)&&(T=mxUtils.trim(T.substring(0,T.length-1))),k=new mxCell(T,new mxGeometry(D,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),k.vertex=!0,E.push(k),T=b.editor.graph.getPreferredSizeForCell(n),null!=T&&(k.geometry.width=T.width+10);else if(null!=k&&")"==T.charAt(0))D+=k.geometry.width+40,k=null;else if("("!=T&&null!=k){T=T.substring(0,","==T.charAt(T.length-1)?T.length-1:T.length);-V=U[T.split(" ")[0]];var n=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="+(V?"1":"0")+";");n.vertex=!0;var u=new mxCell(V?"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;"+(V?"fontStyle=1;":-""));u.vertex=!0;n.insert(u);T=new mxCell(T,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;"+(V?"fontStyle=5;":""));T.vertex=!0;n.insert(T);T=b.editor.graph.getPreferredSizeForCell(T);null!=T&&k.geometry.width<T.width+30&&(k.geometry.width=Math.min(320,Math.max(k.geometry.width,T.width+30)));k.insert(n,V?0:null);k.geometry.height+=30}0<E.length&&(v=b.editor.graph,v.setSelectionCells(v.importCells(E,-z.x,z.y)),v.scrollCellToVisible(v.getSelectionCell()))}else if("list"==k){if(C=d.split("\n"),0<C.length){v=b.editor.graph;n=null;E=[];for(m=k=0;m<C.length;m++)";"!=C[m].charAt(0)&&(0==C[m].length?n=null:null==n?(n=new mxCell(C[m],new mxGeometry(k,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),n.vertex=!0,E.push(n),T=v.getPreferredSizeForCell(n),null!=T&&n.geometry.width<-T.width+10&&(n.geometry.width=T.width+10),k+=n.geometry.width+40):"--"==C[m]?(T=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;"),T.vertex=!0,n.geometry.height+=T.geometry.height,n.insert(T)):0<C[m].length&&(D=new mxCell(C[m],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;"),-D.vertex=!0,T=v.getPreferredSizeForCell(D),null!=T&&D.geometry.width<T.width&&(D.geometry.width=T.width),n.geometry.width=Math.max(n.geometry.width,D.geometry.width),n.geometry.height+=D.geometry.height,n.insert(D)));if(0<E.length){v.getModel().beginUpdate();try{E=v.importCells(E,z.x,z.y);T=[];for(m=0;m<E.length;m++)T.push(E[m]),T=T.concat(E[m].children);v.fireEvent(new mxEventObject("cellsInserted","cells",T))}finally{v.getModel().endUpdate()}v.setSelectionCells(E);v.scrollCellToVisible(v.getSelectionCell())}}}else{n=-function(I){var g=G[I];null==g&&(g=new mxCell(I,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),g.vertex=!0,G[I]=g,E.push(g));return g};C=d.split("\n");var G={};E=[];for(m=0;m<C.length;m++)if(";"!=C[m].charAt(0)){var H=C[m].split("->");2<=H.length&&(V=n(H[0]),u=n(H[H.length-1]),H=new mxCell(2<H.length?H[1]:"",new mxGeometry),H.edge=!0,H.geometry.relative=!0,V.insertEdge(H,!0),u.insertEdge(H,!1),E.push(H))}if(0<E.length){C=document.createElement("div");C.style.visibility="hidden";document.body.appendChild(C);-v=new Graph(C);v.getModel().beginUpdate();try{E=v.importCells(E);for(m=0;m<E.length;m++)v.getModel().isVertex(E[m])&&(T=v.getPreferredSizeForCell(E[m]),E[m].geometry.width=Math.max(E[m].geometry.width,T.width),E[m].geometry.height=Math.max(E[m].geometry.height,T.height));m=!0;"horizontalFlow"==k||"verticalFlow"==k?((new mxHierarchicalLayout(v,"horizontalFlow"==k?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(v.getDefaultParent(),E),m=!1):"circle"==k?(new mxCircleLayout(v)).execute(v.getDefaultParent()):-(D=new mxFastOrganicLayout(v),D.disableEdgeStyle=!1,D.forceConstant=180,D.execute(v.getDefaultParent()));m&&(U=new mxParallelEdgeLayout(v),U.spacing=30,U.execute(v.getDefaultParent()))}finally{v.getModel().endUpdate()}v.clearCellOverlays();T=[];b.editor.graph.getModel().beginUpdate();try{E=v.getModel().getChildren(v.getDefaultParent()),T=b.editor.graph.importCells(E,z.x,z.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",T))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(T);-b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());v.destroy();C.parentNode.removeChild(C)}}}function x(){return"list"==F.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"==F.value||"mermaid2drawio"==F.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==F.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"==F.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"==F.value||"plantUmlTxt"==F.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 z=b.editor.graph.getFreeInsertPoint();l=document.createElement("div");var y=document.createElement("textarea");y.style.position="absolute";y.style.left="30px";y.style.right="30px";y.style.top="30px";y.style.bottom="100px";y.style.resize="none";y.setAttribute("wrap","off");y.setAttribute("spellcheck","false");y.setAttribute("autocorrect","off");y.setAttribute("autocomplete","off");y.setAttribute("autocapitalize","off");var F=document.createElement("select");-F.className="geBtn";if("formatSql"==p||"mermaid"==p&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())F.style.display="none";var O=document.createElement("option");O.setAttribute("value","list");mxUtils.write(O,mxResources.get("list"));"plantUml"!=p&&"mermaid"!=p&&F.appendChild(O);null!=p&&"fromText"!=p||O.setAttribute("selected","selected");O=document.createElement("option");O.setAttribute("value","table");mxUtils.write(O,mxResources.get("formatSql"));"formatSql"==p&&(F.appendChild(O),-O.setAttribute("selected","selected"));O=document.createElement("option");O.setAttribute("value","mermaid");mxUtils.write(O,mxResources.get("image"));if("mermaid"==p){if("undefined"!==typeof mxMermaidToDrawio){var K=document.createElement("option");K.setAttribute("value","mermaid2drawio");K.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("diagram"));F.appendChild(K)}else F.style.display="none";F.appendChild(O)}O=document.createElement("option");O.setAttribute("value","diagram");-mxUtils.write(O,mxResources.get("diagram"));K=document.createElement("option");K.setAttribute("value","circle");mxUtils.write(K,mxResources.get("circle"));var L=document.createElement("option");L.setAttribute("value","horizontalFlow");mxUtils.write(L,mxResources.get("horizontalFlow"));var M=document.createElement("option");M.setAttribute("value","verticalFlow");mxUtils.write(M,mxResources.get("verticalFlow"));"plantUml"!=p&&"mermaid"!=p&&(F.appendChild(O),F.appendChild(K),F.appendChild(L),F.appendChild(M));-O=document.createElement("option");O.setAttribute("value","plantUmlSvg");mxUtils.write(O,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==p&&O.setAttribute("selected","selected");K=document.createElement("option");K.setAttribute("value","plantUmlPng");mxUtils.write(K,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");L=document.createElement("option");L.setAttribute("value","plantUmlTxt");mxUtils.write(L,mxResources.get("plantUml")+" ("+mxResources.get("text")+-")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==p&&(F.appendChild(O),F.appendChild(K),F.appendChild(L));var c=x();y.value=c;l.appendChild(y);O=document.createElement("div");O.style.position="absolute";O.style.bottom="46px";O.style.right="30px";O.style.left="30px";O.style.justifyContent="end";O.style.display="flex";this.init=function(){y.focus()};Graph.fileSupport&&(y.addEventListener("dragover",function(d){d.stopPropagation();d.preventDefault()},!1),y.addEventListener("drop",+null,"mermaid2drawio"==k);else if("table"==k){var B=d.split("\n");k=null;var D=[],N=0,F={};for(m=0;m<B.length;m++){var U=mxUtils.trim(B[m]);if("primary key"==U.substring(0,11).toLowerCase()){var V=U.match(/\((.+)\)/);V&&V[1]&&(F[V[1]]=!0);B.splice(m,1)}else 0<U.toLowerCase().indexOf("primary key")&&(F[U.split(" ")[0]]=!0,B[m]=mxUtils.trim(U.replace(/primary key/i,"")))}for(m=0;m<B.length;m++)if(U=mxUtils.trim(B[m]),"create table"==U.substring(0,12).toLowerCase())U=mxUtils.trim(U.substring(12)),"("==+U.charAt(U.length-1)&&(U=mxUtils.trim(U.substring(0,U.length-1))),k=new mxCell(U,new mxGeometry(N,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),k.vertex=!0,D.push(k),U=b.editor.graph.getPreferredSizeForCell(n),null!=U&&(k.geometry.width=U.width+10);else if(null!=k&&")"==U.charAt(0))N+=k.geometry.width+40,k=null;else if("("!=U&&null!=k){U=U.substring(0,","==U.charAt(U.length-1)?U.length-1:U.length);+V=F[U.split(" ")[0]];var n=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="+(V?"1":"0")+";");n.vertex=!0;var v=new mxCell(V?"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;"+(V?"fontStyle=1;":+""));v.vertex=!0;n.insert(v);U=new mxCell(U,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;"+(V?"fontStyle=5;":""));U.vertex=!0;n.insert(U);U=b.editor.graph.getPreferredSizeForCell(U);null!=U&&k.geometry.width<U.width+30&&(k.geometry.width=Math.min(320,Math.max(k.geometry.width,U.width+30)));k.insert(n,V?0:null);k.geometry.height+=30}0<D.length&&(u=b.editor.graph,u.setSelectionCells(u.importCells(D,+z.x,z.y)),u.scrollCellToVisible(u.getSelectionCell()))}else if("list"==k){if(B=d.split("\n"),0<B.length){u=b.editor.graph;n=null;D=[];for(m=k=0;m<B.length;m++)";"!=B[m].charAt(0)&&(0==B[m].length?n=null:null==n?(n=new mxCell(B[m],new mxGeometry(k,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),n.vertex=!0,D.push(n),U=u.getPreferredSizeForCell(n),null!=U&&n.geometry.width<+U.width+10&&(n.geometry.width=U.width+10),k+=n.geometry.width+40):"--"==B[m]?(U=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;"),U.vertex=!0,n.geometry.height+=U.geometry.height,n.insert(U)):0<B[m].length&&(N=new mxCell(B[m],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;"),+N.vertex=!0,U=u.getPreferredSizeForCell(N),null!=U&&N.geometry.width<U.width&&(N.geometry.width=U.width),n.geometry.width=Math.max(n.geometry.width,N.geometry.width),n.geometry.height+=N.geometry.height,n.insert(N)));if(0<D.length){u.getModel().beginUpdate();try{D=u.importCells(D,z.x,z.y);U=[];for(m=0;m<D.length;m++)U.push(D[m]),U=U.concat(D[m].children);u.fireEvent(new mxEventObject("cellsInserted","cells",U))}finally{u.getModel().endUpdate()}u.setSelectionCells(D);u.scrollCellToVisible(u.getSelectionCell())}}}else{n=+function(I){var g=G[I];null==g&&(g=new mxCell(I,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),g.vertex=!0,G[I]=g,D.push(g));return g};B=d.split("\n");var G={};D=[];for(m=0;m<B.length;m++)if(";"!=B[m].charAt(0)){var H=B[m].split("->");2<=H.length&&(V=n(H[0]),v=n(H[H.length-1]),H=new mxCell(2<H.length?H[1]:"",new mxGeometry),H.edge=!0,H.geometry.relative=!0,V.insertEdge(H,!0),v.insertEdge(H,!1),D.push(H))}if(0<D.length){B=document.createElement("div");B.style.visibility="hidden";document.body.appendChild(B);+u=new Graph(B);u.getModel().beginUpdate();try{D=u.importCells(D);for(m=0;m<D.length;m++)u.getModel().isVertex(D[m])&&(U=u.getPreferredSizeForCell(D[m]),D[m].geometry.width=Math.max(D[m].geometry.width,U.width),D[m].geometry.height=Math.max(D[m].geometry.height,U.height));m=!0;"horizontalFlow"==k||"verticalFlow"==k?((new mxHierarchicalLayout(u,"horizontalFlow"==k?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(u.getDefaultParent(),D),m=!1):"circle"==k?(new mxCircleLayout(u)).execute(u.getDefaultParent()):+(N=new mxFastOrganicLayout(u),N.disableEdgeStyle=!1,N.forceConstant=180,N.execute(u.getDefaultParent()));m&&(F=new mxParallelEdgeLayout(u),F.spacing=30,F.execute(u.getDefaultParent()))}finally{u.getModel().endUpdate()}u.clearCellOverlays();U=[];b.editor.graph.getModel().beginUpdate();try{D=u.getModel().getChildren(u.getDefaultParent()),U=b.editor.graph.importCells(D,z.x,z.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",U))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(U);+b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());u.destroy();B.parentNode.removeChild(B)}}}function x(){return"list"==E.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"==E.value||"mermaid2drawio"==E.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==E.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"==E.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"==E.value||"plantUmlTxt"==E.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 z=b.editor.graph.getFreeInsertPoint();l=document.createElement("div");var y=document.createElement("textarea");y.style.position="absolute";y.style.left="30px";y.style.right="30px";y.style.top="30px";y.style.bottom="100px";y.style.resize="none";y.setAttribute("wrap","off");y.setAttribute("spellcheck","false");y.setAttribute("autocorrect","off");y.setAttribute("autocomplete","off");y.setAttribute("autocapitalize","off");var E=document.createElement("select");+E.className="geBtn";if("formatSql"==p||"mermaid"==p&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())E.style.display="none";var R=document.createElement("option");R.setAttribute("value","list");mxUtils.write(R,mxResources.get("list"));"plantUml"!=p&&"mermaid"!=p&&E.appendChild(R);null!=p&&"fromText"!=p||R.setAttribute("selected","selected");R=document.createElement("option");R.setAttribute("value","table");mxUtils.write(R,mxResources.get("formatSql"));"formatSql"==p&&(E.appendChild(R),+R.setAttribute("selected","selected"));R=document.createElement("option");R.setAttribute("value","mermaid");mxUtils.write(R,mxResources.get("image"));if("mermaid"==p){if("undefined"!==typeof mxMermaidToDrawio){var K=document.createElement("option");K.setAttribute("value","mermaid2drawio");K.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("diagram"));E.appendChild(K)}else E.style.display="none";E.appendChild(R)}R=document.createElement("option");R.setAttribute("value","diagram");+mxUtils.write(R,mxResources.get("diagram"));K=document.createElement("option");K.setAttribute("value","circle");mxUtils.write(K,mxResources.get("circle"));var L=document.createElement("option");L.setAttribute("value","horizontalFlow");mxUtils.write(L,mxResources.get("horizontalFlow"));var O=document.createElement("option");O.setAttribute("value","verticalFlow");mxUtils.write(O,mxResources.get("verticalFlow"));"plantUml"!=p&&"mermaid"!=p&&(E.appendChild(R),E.appendChild(K),E.appendChild(L),E.appendChild(O));+R=document.createElement("option");R.setAttribute("value","plantUmlSvg");mxUtils.write(R,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==p&&R.setAttribute("selected","selected");K=document.createElement("option");K.setAttribute("value","plantUmlPng");mxUtils.write(K,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");L=document.createElement("option");L.setAttribute("value","plantUmlTxt");mxUtils.write(L,mxResources.get("plantUml")+" ("+mxResources.get("text")++")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==p&&(E.appendChild(R),E.appendChild(K),E.appendChild(L));var c=x();y.value=c;l.appendChild(y);R=document.createElement("div");R.style.position="absolute";R.style.bottom="46px";R.style.right="30px";R.style.left="30px";R.style.justifyContent="end";R.style.display="flex";this.init=function(){y.focus()};Graph.fileSupport&&(y.addEventListener("dragover",function(d){d.stopPropagation();d.preventDefault()},!1),y.addEventListener("drop",function(d){d.stopPropagation();d.preventDefault();if(0<d.dataTransfer.files.length){d=d.dataTransfer.files[0];var k=new FileReader;k.onload=function(m){y.value=m.target.result};k.readAsText(d)}},!1));"plantUml"==p&&"https://plant-aws.diagrams.net"==window.PLANT_URL&&(K=document.createElement("div"),K.style.display="inline-block",K.style.color="#c00",K.style.fontSize="12px",K.style.marginRight="10px",K.style.display="flex",K.style.alignItems="center",K.innerHTML='<a href="https://github.com/jgraph/plantuml-converter/tree/main/plantuml-to-drawio" target="_blank" rel="noopener noreferrer">PlantUML project changes in 2026</a>',-O.appendChild(K));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=p&&"plantUml"!=p||O.appendChild(b.createHelpIcon("mermaid"==p?"https://mermaid.js.org/intro/":"https://plantuml.com/"));O.appendChild(F);mxEvent.addListener(F,"change",function(){var d=x();if(0==y.value.length||y.value==c)c=d,y.value=c});p=mxUtils.button(mxResources.get("close"),function(){y.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});p.className="geBtn";b.editor.cancelFirst&&O.appendChild(p);-K=mxUtils.button(mxResources.get("insert"),function(d){try{b.hideDialog(),f(y.value,F.value,d)}catch(k){b.handleError(k)}});K.className="geBtn gePrimaryBtn";O.appendChild(K);b.editor.cancelFirst||O.appendChild(p);l.appendChild(O);this.container=l},NewDialog=function(b,l,p,f,x,z,y,F,O,K,L,M,c,d,k,m,t,v,A,C){function E(Aa){null!=Aa&&(Ka=Wa=Aa?135:140);Aa=!0;if(null!=fb)for(;R<fb.length&&(Aa||0!=mxUtils.mod(R,30));){var Ha=fb[R++];Ha=G(Ha.url,Ha.libs,Ha.title,Ha.tooltip?Ha.tooltip:Ha.title,Ha.select,-Ha.imgUrl,Ha.info,Ha.onClick,Ha.preview,Ha.noImg,Ha.clibs,Ha.type);Aa&&Ha.click();Aa=!1}}function D(Aa,Ha,Da,Ja,Ea,Ga){if(null!=Aa&&mxUtils.isAncestorNode(document.body,Ja)){Aa=mxUtils.parseXml(Aa);Aa=Editor.parseDiagramNode(Aa.documentElement,null,!0);var Ma=new mxCodec(Aa.ownerDocument),Oa=new mxGraphModel;Ma.decode(Aa,Oa);b.sidebar.createTooltip(Ja,Oa.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!=Ea?mxResources.get(Ea):null,!0,new mxPoint(Ha,Da),!0,function(){fa=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=Ga&&T(Ja,null,null,Ga,infoObj,clibs)},!0,!1)}}function U(){if(ka==Pa&&null==oa&&null!=ib&&null!=db)f&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+db.value+"'")&&(g=!0,b.hideDialog()),ib.click();else if(g&&b.spinner.stop(),sa&&null!=d)p||g||b.hideDialog(),d(sa,Ia,-N.value);else if(f)p||g||b.hideDialog(),f(oa,N.value,Ca,xa);else{var Aa=N.value;if(null!=Aa&&0<Aa.length){var Ha=function(Ja,Ea,Ga){b.createFile(Ga,oa,null!=xa&&0<xa.length?xa:null,Ja,function(){g||b.hideDialog()},null,Ea,null,null!=Z&&0<Z.length?Z:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var Da=new SaveDialog(b,Aa,mxUtils.bind(this,function(Ja,Ea,Ga){Ha(Ea,Ga,Ja.value)}),null,null,null,null,b.mode);b.showDialog(Da.container,420,150,!0,!1);Da.init()}else b.pickFolder(b.mode,function(Ja){Ha(b.mode,-Ja,Aa)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function T(Aa,Ha,Da,Ja,Ea,Ga,Ma){return ka!=Aa?(null!=ka&&(ka.classList.remove("geTemplateSelected"),ka==Pa&&(Xa.style.display="none",$a.style.display="",Qa.style.visibility="hidden",ab.style.visibility=null!=Ba?"visible":"hidden")),Aa==Pa&&(Ha=Ba,null!=Ha?(ab.style.visibility="visible",ab.style.visibility=null!=Ba?"visible":"hidden",Qa.style.visibility="visible"):(Xa.style.display="",Qa.style.visibility="hidden",ab.style.visibility=-"hidden")),X.removeAttribute("disabled"),oa=Ha,xa=Da,Z=Ga,ka=Aa,sa=Ja,Ca=Ma,Ia=Ea,ka.classList.add("geTemplateSelected"),!0):!1}function V(){Xa.style.display="";$a.style.display="none";Qa.style.visibility="hidden";ab.style.visibility="hidden";db.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?db.select():document.execCommand("selectAll",!1,null)}function n(){$a.style.backgroundImage=ob;$a.style.backgroundSize="contain";Xa.style.display="none";$a.style.display="";Qa.style.visibility=-"visible";ab.style.visibility="visible"}function u(Aa){if(!Na){Na=!0;var Ha=mxUtils.trim(db.value);Aa||""==Ha?null!=da&&(db.value=da,n()):($a.style.backgroundImage="url("+Editor.spinImage+")",$a.style.backgroundSize="12px 12px",$a.style.display="",Xa.style.display="none",b.generateOpenAiMermaidDiagram(Ha,function(Da){Na=!1;ka==Pa&&"none"==Xa.style.display&&(ob="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(Da)))+")",Pa.setAttribute("title",Ha),ab.style.display="",Ba=oa=Da,da=Ha,n(),-g&&U())},mxUtils.bind(this,function(Da){Na=!1;ka==Pa&&(Xa.style.display="",$a.style.display="none",Qa.style.visibility="hidden",ab.style.visibility="hidden",b.handleError(Da))}),!0))}}function G(Aa,Ha,Da,Ja,Ea,Ga,Ma,Oa,Va,hb,bb,mb){function Ta(Ya,pb){null==sb?(nb=Ya,nb=/^https?:\/\//.test(nb)?b.editor.isCorsEnabledForUrl(nb)?nb:PROXY_URL+"?url="+encodeURIComponent(nb):TEMPLATE_PATH+"/"+nb,mxUtils.get(nb,mxUtils.bind(this,function(qb){200<=qb.getStatus()&&299>=qb.getStatus()&&(sb=qb.getText());pb(sb,-nb)}))):pb(sb,nb)}function gb(Ya,pb){if(null==Aa||aa||b.sidebar.currentElt==La)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=ba){var qb="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+ba.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+ba.naturalWidth+'" height="'+ba.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";D(qb,mxEvent.getClientX(Ya),-mxEvent.getClientY(Ya),Da,Aa)}else b.sidebar.currentElt=La,aa=!0,Ta(Aa,function(Cb){if(aa&&b.sidebar.currentElt==La)try{D(Cb,mxEvent.getClientX(Ya),mxEvent.getClientY(Ya),La,pb)}catch(Db){b.sidebar.currentElt=null,b.handleError(Db)}aa=!1})}var La=null;if("generative"!=mb||null==Pa){La=document.createElement("div");La.className="geTemplate";var sb=null,nb=Aa;null!=Da?La.setAttribute("title",mxResources.get(Da,null,Da)):null!=Ja&&0<Ja.length&&La.setAttribute("title",Ja)}else La=Pa;var tb=document.createElement("span");-tb.className="geAdaptiveAsset";mxUtils.write(tb,mxResources.get(Da,null,Da));if(null!=Ga){La.style.display="inline-flex";La.style.justifyContent="center";La.style.alignItems="center";Va=document.createElement("img");Va.setAttribute("src",Ga);Va.setAttribute("alt",Ja);Va.style.maxWidth=Ka+"px";Va.style.maxHeight=Wa+"px";ba=Va;var xb=Ga.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");La.appendChild(Va);Va.onerror=function(){this.src!=xb?this.src=xb:(this.src=Editor.errorImage,this.onerror=-null)};mxEvent.addGestureListeners(La,mxUtils.bind(this,function(Ya){T(La,null,null,Aa,Ma,bb)}),null,null);mxEvent.addListener(La,"dblclick",function(Ya){U();mxEvent.consume(Ya)})}else if(!hb&&null!=Aa&&0<Aa.length){var yb=function(Ya){W.spin(ca)&&Ta(Aa,function(pb,qb){W.stop();null!=pb&&(T(La,pb,Ha,null,null,bb,qb),Ya&&U())})};Ga=Va||TEMPLATE_PATH+"/"+Aa.substring(0,Aa.length-4)+".png";Va=$a.cloneNode(!1);Va.style.backgroundImage="url("+Ga+")";Va.style.display="";La.appendChild(Va);null!=Da&&La.appendChild(tb);-mxEvent.addGestureListeners(La,mxUtils.bind(this,function(Ya){yb()}),null,null);mxEvent.addListener(La,"dblclick",function(Ya){yb(!0);mxEvent.consume(Ya)})}else La.appendChild(tb),"generative"==mb&&null==Pa&&(La.appendChild($a),La.appendChild(Xa),La.appendChild(ab),La.appendChild(Qa),Pa=La),Ea&&T(La),null!=Oa?(mxEvent.addGestureListeners(La,null,null,mxUtils.bind(this,function(Ya){T(La,null,null,Aa,Ma)})),mxEvent.addListener(La,"click",Oa)):(mxEvent.addListener(La,"click",function(Ya){T(La,null,null,-Aa,Ma)&&"generative"==mb&&null==Ba&&V()}),mxEvent.addListener(La,"dblclick",function(Ya){"generative"!=mb?U():"none"==Xa.style.display&&V();mxEvent.consume(Ya)}));null!=Aa&&(Ga=Y.cloneNode(!0),La.appendChild(Ga),mxEvent.addGestureListeners(Ga,mxUtils.bind(this,function(Ya){fa=b.sidebar.currentElt==La}),null,null),mxEvent.addListener(Ga,"click",mxUtils.bind(this,function(Ya){fa||gb(Ya,null!=Da?Da:Ja);mxEvent.consume(Ya)})));ca.appendChild(La);return La}function H(){function Aa(Ta,gb){Ta=mxResources.get(Ta,-null,Ta.substring(0,1).toUpperCase()+Ta.substring(1));18<Ta.length&&(Ta=Ta.substring(0,18)+"…");return Ta+(null!=gb?" ("+gb.length+")":"")}function Ha(Ta,gb,La){mxEvent.addListener(gb,"click",function(){Sa!=gb&&(null!=Sa&&(Sa.style.backgroundColor=""),Sa=gb,Sa.style.backgroundColor=y,ca.scrollTop=0,ca.innerText="",R=0,null!=Ra[Ta].content?(ca.appendChild(Ra[Ta].content),oa=Ba,fb=null,null!=Ra[Ta].content.init&&Ra[Ta].content.init()):(fb=La?kb[Ta][La]:Ra[Ta],ea=null,E(!1)))})}lb&&(lb=!1,mxEvent.addListener(ca,-"scroll",function(Ta){ca.scrollTop+ca.clientHeight>=ca.scrollHeight&&(E(),mxEvent.consume(Ta))}));if(0<Za){var Da=document.createElement("div");Da.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Da,mxResources.get("custom"));Fa.appendChild(Da);for(var Ja in Ua){var Ea=document.createElement("div");Da=Ja;var Ga=Ua[Ja];18<Da.length&&(Da=Da.substring(0,18)+"…");Ea.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";-Ea.setAttribute("title",Da+" ("+Ga.length+")");mxUtils.write(Ea,Ea.getAttribute("title"));null!=K&&(Ea.style.padding=K);Fa.appendChild(Ea);(function(Ta,gb){mxEvent.addListener(Ea,"click",function(){Sa!=gb&&(Sa.style.backgroundColor="",Sa=gb,Sa.style.backgroundColor=y,ca.scrollTop=0,ca.innerText="",R=0,fb=Ua[Ta],ea=null,E(!1))})})(Ja,Ea)}Da=document.createElement("div");Da.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Da,"draw.io");Fa.appendChild(Da)}for(Ja in Ra){Da=-Ga=null;if(null!=Ra[Ja].content)Ea=document.createElement(Ma?"ul":"div"),Da=Aa(Ja),Ea.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;",Ea.setAttribute("title",Da),mxUtils.write(Ea,Da),Fa.appendChild(Ea),Da=Ea;else{var Ma=kb[Ja];Da=Ea=document.createElement(Ma?"ul":"div");Ga=Ra[Ja];var Oa=Aa(Ja,Ga);if(null!=Ma){Ga=document.createElement("li");var Va=document.createElement("div");-Va.className="geTempTreeCaret";Va.setAttribute("title",Oa);mxUtils.write(Va,Oa);Da=Va;Ga.appendChild(Va);Oa=document.createElement("ul");Oa.className="geTempTreeNested";Oa.style.visibility="hidden";for(var hb in Ma){var bb=document.createElement("li"),mb=Aa(hb,Ma[hb]);bb.setAttribute("title",mb);mxUtils.write(bb,mb);Ha(Ja,bb,hb);Oa.appendChild(bb)}Ga.appendChild(Oa);Ea.className="geTempTree";Ea.appendChild(Ga);(function(Ta,gb){mxEvent.addListener(gb,"click",function(){Ta.style.visibility="visible";-Ta.classList.toggle("geTempTreeActive");Ta.classList.toggle("geTempTreeNested")&&setTimeout(function(){Ta.style.visibility="hidden"},550);gb.classList.toggle("geTempTreeCaret-down")})})(Oa,Va)}else Ea.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;",Ea.setAttribute("title",Oa),mxUtils.write(Ea,Oa);null!=K&&(Ea.style.padding=K);Fa.appendChild(Ea)}Ha(Ja,Da);null==Sa&&Da.click()}E(!1)}-var I=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);p=null!=p?p:!0;x=null!=x?x:!1;y=null!=y?y:"light-dark(#ebf2f9, "+Editor.darkColor+")";L=null!=L?L:EditorUi.templateFile;var g=!1,q=document.createElement("div");q.style.userSelect="none";q.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";p&&q.appendChild(B);var J=document.createElement("img");J.setAttribute("border","0");J.setAttribute("align","absmiddle");+R.appendChild(K));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=p&&"plantUml"!=p||R.appendChild(b.createHelpIcon("mermaid"==p?"https://mermaid.js.org/intro/":"https://plantuml.com/"));R.appendChild(E);mxEvent.addListener(E,"change",function(){var d=x();if(0==y.value.length||y.value==c)c=d,y.value=c});p=mxUtils.button(mxResources.get("close"),function(){y.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});p.className="geBtn";b.editor.cancelFirst&&R.appendChild(p);+K=mxUtils.button(mxResources.get("insert"),function(d){try{b.hideDialog(),f(y.value,E.value,d)}catch(k){b.handleError(k)}});K.className="geBtn gePrimaryBtn";R.appendChild(K);b.editor.cancelFirst||R.appendChild(p);l.appendChild(R);this.container=l},NewDialog=function(b,l,p,f,x,z,y,E,R,K,L,O,c,d,k,m,t,u,A,B){function D(Ba){null!=Ba&&(Ka=Wa=Ba?135:140);Ba=!0;if(null!=fb)for(;S<fb.length&&(Ba||0!=mxUtils.mod(S,30));){var Ia=fb[S++];Ia=G(Ia.url,Ia.libs,Ia.title,Ia.tooltip?Ia.tooltip:Ia.title,Ia.select,+Ia.imgUrl,Ia.info,Ia.onClick,Ia.preview,Ia.noImg,Ia.clibs,Ia.type);Ba&&Ia.click();Ba=!1}}function N(Ba,Ia,Ea,Ja,Fa,Ha){if(null!=Ba&&mxUtils.isAncestorNode(document.body,Ja)){Ba=mxUtils.parseXml(Ba);Ba=Editor.parseDiagramNode(Ba.documentElement,null,!0);var Ma=new mxCodec(Ba.ownerDocument),Oa=new mxGraphModel;Ma.decode(Ba,Oa);b.sidebar.createTooltip(Ja,Oa.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!=Fa?mxResources.get(Fa):null,!0,new mxPoint(Ia,Ea),!0,function(){ha=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=Ha&&U(Ja,null,null,Ha,infoObj,clibs)},!0,!1)}}function F(){if(pa==Pa&&null==Da&&null!=ib&&null!=db)f&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+db.value+"'")&&(g=!0,b.hideDialog()),ib.click();else if(g&&b.spinner.stop(),ba&&null!=d)p||g||b.hideDialog(),d(ba,Ca,+Q.value);else if(f)p||g||b.hideDialog(),f(Da,Q.value,na,wa);else{var Ba=Q.value;if(null!=Ba&&0<Ba.length){var Ia=function(Ja,Fa,Ha){b.createFile(Ha,Da,null!=wa&&0<wa.length?wa:null,Ja,function(){g||b.hideDialog()},null,Fa,null,null!=ea&&0<ea.length?ea:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var Ea=new SaveDialog(b,Ba,mxUtils.bind(this,function(Ja,Fa,Ha){Ia(Fa,Ha,Ja.value)}),null,null,null,null,b.mode);b.showDialog(Ea.container,420,150,!0,!1);Ea.init()}else b.pickFolder(b.mode,+function(Ja){Ia(b.mode,Ja,Ba)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function U(Ba,Ia,Ea,Ja,Fa,Ha,Ma){return pa!=Ba?(null!=pa&&(pa.classList.remove("geTemplateSelected"),pa==Pa&&(Xa.style.display="none",$a.style.display="",Qa.style.visibility="hidden",ab.style.visibility=null!=za?"visible":"hidden")),Ba==Pa&&(Ia=za,null!=Ia?(ab.style.visibility="visible",ab.style.visibility=null!=za?"visible":"hidden",Qa.style.visibility="visible"):(Xa.style.display="",Qa.style.visibility=+"hidden",ab.style.visibility="hidden")),X.removeAttribute("disabled"),Da=Ia,wa=Ea,ea=Ha,pa=Ba,ba=Ja,na=Ma,Ca=Fa,pa.classList.add("geTemplateSelected"),!0):!1}function V(){Xa.style.display="";$a.style.display="none";Qa.style.visibility="hidden";ab.style.visibility="hidden";db.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?db.select():document.execCommand("selectAll",!1,null)}function n(){$a.style.backgroundImage=ob;$a.style.backgroundSize="contain";Xa.style.display="none";$a.style.display=+"";Qa.style.visibility="visible";ab.style.visibility="visible"}function v(Ba){if(!Na){Na=!0;var Ia=mxUtils.trim(db.value);Ba||""==Ia?null!=ca&&(db.value=ca,n()):($a.style.backgroundImage="url("+Editor.spinImage+")",$a.style.backgroundSize="12px 12px",$a.style.display="",Xa.style.display="none",b.generateOpenAiMermaidDiagram(Ia,function(Ea){Na=!1;pa==Pa&&"none"==Xa.style.display&&(ob="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(Ea)))+")",Pa.setAttribute("title",Ia),ab.style.display=+"",za=Da=Ea,ca=Ia,n(),g&&F())},mxUtils.bind(this,function(Ea){Na=!1;pa==Pa&&(Xa.style.display="",$a.style.display="none",Qa.style.visibility="hidden",ab.style.visibility="hidden",b.handleError(Ea))}),!0))}}function G(Ba,Ia,Ea,Ja,Fa,Ha,Ma,Oa,Va,hb,bb,mb){function Ta(Ya,pb){null==sb?(nb=Ya,nb=/^https?:\/\//.test(nb)?b.editor.isCorsEnabledForUrl(nb)?nb:PROXY_URL+"?url="+encodeURIComponent(nb):TEMPLATE_PATH+"/"+nb,mxUtils.get(nb,mxUtils.bind(this,function(qb){200<=qb.getStatus()&&299>=qb.getStatus()&&+(sb=qb.getText());pb(sb,nb)}))):pb(sb,nb)}function gb(Ya,pb){if(null==Ba||Z||b.sidebar.currentElt==La)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=aa){var qb="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+aa.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+aa.naturalWidth+'" height="'+aa.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";+N(qb,mxEvent.getClientX(Ya),mxEvent.getClientY(Ya),Ea,Ba)}else b.sidebar.currentElt=La,Z=!0,Ta(Ba,function(Cb){if(Z&&b.sidebar.currentElt==La)try{N(Cb,mxEvent.getClientX(Ya),mxEvent.getClientY(Ya),La,pb)}catch(Db){b.sidebar.currentElt=null,b.handleError(Db)}Z=!1})}var La=null;if("generative"!=mb||null==Pa){La=document.createElement("div");La.className="geTemplate";var sb=null,nb=Ba;null!=Ea?La.setAttribute("title",mxResources.get(Ea,null,Ea)):null!=Ja&&0<Ja.length&&La.setAttribute("title",Ja)}else La=+Pa;var tb=document.createElement("span");tb.className="geAdaptiveAsset";mxUtils.write(tb,mxResources.get(Ea,null,Ea));if(null!=Ha){La.style.display="inline-flex";La.style.justifyContent="center";La.style.alignItems="center";Va=document.createElement("img");Va.setAttribute("src",Ha);Va.setAttribute("alt",Ja);Va.style.maxWidth=Ka+"px";Va.style.maxHeight=Wa+"px";aa=Va;var xb=Ha.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");La.appendChild(Va);Va.onerror=function(){this.src!=xb?this.src=+xb:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(La,mxUtils.bind(this,function(Ya){U(La,null,null,Ba,Ma,bb)}),null,null);mxEvent.addListener(La,"dblclick",function(Ya){F();mxEvent.consume(Ya)})}else if(!hb&&null!=Ba&&0<Ba.length){var yb=function(Ya){W.spin(da)&&Ta(Ba,function(pb,qb){W.stop();null!=pb&&(U(La,pb,Ia,null,null,bb,qb),Ya&&F())})};Ha=Va||TEMPLATE_PATH+"/"+Ba.substring(0,Ba.length-4)+".png";Va=$a.cloneNode(!1);Va.style.backgroundImage="url("+Ha+")";Va.style.display=+"";La.appendChild(Va);null!=Ea&&La.appendChild(tb);mxEvent.addGestureListeners(La,mxUtils.bind(this,function(Ya){yb()}),null,null);mxEvent.addListener(La,"dblclick",function(Ya){yb(!0);mxEvent.consume(Ya)})}else La.appendChild(tb),"generative"==mb&&null==Pa&&(La.appendChild($a),La.appendChild(Xa),La.appendChild(ab),La.appendChild(Qa),Pa=La),Fa&&U(La),null!=Oa?(mxEvent.addGestureListeners(La,null,null,mxUtils.bind(this,function(Ya){U(La,null,null,Ba,Ma)})),mxEvent.addListener(La,"click",Oa)):(mxEvent.addListener(La,+"click",function(Ya){U(La,null,null,Ba,Ma)&&"generative"==mb&&null==za&&V()}),mxEvent.addListener(La,"dblclick",function(Ya){"generative"!=mb?F():"none"==Xa.style.display&&V();mxEvent.consume(Ya)}));null!=Ba&&(Ha=Y.cloneNode(!0),La.appendChild(Ha),mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Ya){ha=b.sidebar.currentElt==La}),null,null),mxEvent.addListener(Ha,"click",mxUtils.bind(this,function(Ya){ha||gb(Ya,null!=Ea?Ea:Ja);mxEvent.consume(Ya)})));da.appendChild(La);return La}function H(){function Ba(Ta,+gb){Ta=mxResources.get(Ta,null,Ta.substring(0,1).toUpperCase()+Ta.substring(1));18<Ta.length&&(Ta=Ta.substring(0,18)+"…");return Ta+(null!=gb?" ("+gb.length+")":"")}function Ia(Ta,gb,La){mxEvent.addListener(gb,"click",function(){Sa!=gb&&(null!=Sa&&(Sa.style.backgroundColor=""),Sa=gb,Sa.style.backgroundColor=y,da.scrollTop=0,da.innerText="",S=0,null!=Ra[Ta].content?(da.appendChild(Ra[Ta].content),Da=za,fb=null,null!=Ra[Ta].content.init&&Ra[Ta].content.init()):(fb=La?kb[Ta][La]:Ra[Ta],fa=null,+D(!1)))})}lb&&(lb=!1,mxEvent.addListener(da,"scroll",function(Ta){da.scrollTop+da.clientHeight>=da.scrollHeight&&(D(),mxEvent.consume(Ta))}));if(0<Za){var Ea=document.createElement("div");Ea.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ea,mxResources.get("custom"));Ga.appendChild(Ea);for(var Ja in Ua){var Fa=document.createElement("div");Ea=Ja;var Ha=Ua[Ja];18<Ea.length&&(Ea=Ea.substring(0,18)+"…");Fa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";+Fa.setAttribute("title",Ea+" ("+Ha.length+")");mxUtils.write(Fa,Fa.getAttribute("title"));null!=K&&(Fa.style.padding=K);Ga.appendChild(Fa);(function(Ta,gb){mxEvent.addListener(Fa,"click",function(){Sa!=gb&&(Sa.style.backgroundColor="",Sa=gb,Sa.style.backgroundColor=y,da.scrollTop=0,da.innerText="",S=0,fb=Ua[Ta],fa=null,D(!1))})})(Ja,Fa)}Ea=document.createElement("div");Ea.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ea,"draw.io");Ga.appendChild(Ea)}for(Ja in Ra){Ea=+Ha=null;if(null!=Ra[Ja].content)Fa=document.createElement(Ma?"ul":"div"),Ea=Ba(Ja),Fa.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;",Fa.setAttribute("title",Ea),mxUtils.write(Fa,Ea),Ga.appendChild(Fa),Ea=Fa;else{var Ma=kb[Ja];Ea=Fa=document.createElement(Ma?"ul":"div");Ha=Ra[Ja];var Oa=Ba(Ja,Ha);if(null!=Ma){Ha=document.createElement("li");var Va=document.createElement("div");+Va.className="geTempTreeCaret";Va.setAttribute("title",Oa);mxUtils.write(Va,Oa);Ea=Va;Ha.appendChild(Va);Oa=document.createElement("ul");Oa.className="geTempTreeNested";Oa.style.visibility="hidden";for(var hb in Ma){var bb=document.createElement("li"),mb=Ba(hb,Ma[hb]);bb.setAttribute("title",mb);mxUtils.write(bb,mb);Ia(Ja,bb,hb);Oa.appendChild(bb)}Ha.appendChild(Oa);Fa.className="geTempTree";Fa.appendChild(Ha);(function(Ta,gb){mxEvent.addListener(gb,"click",function(){Ta.style.visibility="visible";+Ta.classList.toggle("geTempTreeActive");Ta.classList.toggle("geTempTreeNested")&&setTimeout(function(){Ta.style.visibility="hidden"},550);gb.classList.toggle("geTempTreeCaret-down")})})(Oa,Va)}else Fa.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;",Fa.setAttribute("title",Oa),mxUtils.write(Fa,Oa);null!=K&&(Fa.style.padding=K);Ga.appendChild(Fa)}Ia(Ja,Ea);null==Sa&&Ea.click()}D(!1)}+var I=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);p=null!=p?p:!0;x=null!=x?x:!1;y=null!=y?y:"light-dark(#ebf2f9, "+Editor.darkColor+")";L=null!=L?L:EditorUi.templateFile;var g=!1,q=document.createElement("div");q.style.userSelect="none";q.style.height="100%";var C=document.createElement("div");C.style.whiteSpace="nowrap";C.style.height="46px";p&&q.appendChild(C);var J=document.createElement("img");J.setAttribute("border","0");J.setAttribute("align","absmiddle");J.style.width="40px";J.style.height="40px";J.style.marginRight="10px";J.style.paddingBottom="4px";J.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_M365?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";l||I||!p||B.appendChild(J);p&&mxUtils.write(B,(I?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var Q=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?Q=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?Q=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?Q=b.oneDrive.extension:b.mode==-App.MODE_GITHUB&&null!=b.gitHub?Q=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?Q=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(Q=b.trello.extension);var N=document.createElement("input");N.setAttribute("value",b.defaultFilename+Q);N.style.marginLeft="10px";N.style.width=l||I?"144px":"244px";this.init=function(){p&&Editor.selectFilename(N);null!=ca.parentNode&&null!=ca.parentNode.parentNode&&mxEvent.addGestureListeners(ca.parentNode.parentNode,mxUtils.bind(this,function(Aa){null!=-b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(p)if(B.appendChild(N),v)N.style.width=l||I?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var S=FilenameDialog.createFileTypes(b,N,b.editor.diagramFileTypes);S.style.marginLeft="6px";S.style.width=l||I?"80px":"180px";B.appendChild(S)}var P=!1,R=0,W=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}),X=mxUtils.button(m||mxResources.get("create"),-function(){X.setAttribute("disabled","disabled");U();X.removeAttribute("disabled")});X.className="geBtn gePrimaryBtn";var Y=document.createElement("img");Y.setAttribute("src",Editor.magnifyImage);Y.setAttribute("title",mxResources.get("preview"));Y.className="geButton geRoundButton";var aa=!1,ba=null,fa=!1;if(M||c){var ia=[],ea=null,ma=null,qa=null,na=function(Aa){X.setAttribute("disabled","disabled");for(var Ha=0;Ha<ia.length;Ha++)ia[Ha].className=Ha==Aa?"geBtn gePrimaryBtn":"geBtn"};P=!0;var ta=-document.createElement("div");ta.style.whiteSpace="nowrap";ta.style.height="30px";q.appendChild(ta);var ra=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Fa.style.display="";ja.style.display="";ca.style.left="160px";na(0);ca.scrollTop=0;ca.innerText="";R=0;ea!=fb&&(fb=ea,Ra=ma,Za=qa,Fa.innerText="",H(),ea=null)});ia.push(ra);ta.appendChild(ra);var la=function(Aa){Fa.style.display="none";ja.style.display="none";ca.style.left="30px";na(Aa?-1:1);null==ea&&(ea=fb);ca.scrollTop=-0;ca.innerText="";W.spin(ca);var Ha=function(Da,Ja,Ea){R=0;W.stop();fb=Da;Ea=Ea||{};var Ga=0,Ma;for(Ma in Ea)Ga+=Ea[Ma].length;if(Ja)ca.innerText=Ja;else if(0==Da.length&&0==Ga)ca.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(ca.innerText="",0<Ga){Fa.style.display="";ca.style.left="160px";Fa.innerText="";Za=0;Ra={"draw.io":Da};for(Ma in Ea)Ra[Ma]=Ea[Ma];H()}else E(!0)};Aa?c(ya.value,Ha):M(Ha)};if(M){var ha=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){la()});-ta.appendChild(ha);ia.push(ha)}if(c){var pa=document.createElement("span");pa.style.marginLeft="10px";pa.innerText=mxResources.get("search")+":";ta.appendChild(pa);var ya=document.createElement("input");ya.style.marginRight="10px";ya.style.marginLeft="10px";ya.style.width="220px";mxEvent.addListener(ya,"keypress",function(Aa){13==Aa.keyCode&&la(!0)});ta.appendChild(ya);var za=mxUtils.button(mxResources.get("search"),function(){la(!0)});za.className="geBtn";ta.appendChild(za)}na(0)}var xa=null,Z=null,-oa=null,ka=null,sa=null,Ca=null,Ia=null,Ba=null,da=null,ca=document.createElement("div");ca.style.border="1px solid #d3d3d3";ca.style.position="absolute";ca.style.left="160px";ca.style.right="34px";var ua=(p?72:40)+(P?30:0);ca.style.top=ua+"px";ca.style.bottom="68px";ca.style.margin="6px 0 0 -1px";ca.style.padding="6px";ca.style.overflow="auto";var ja=document.createElement("div");ja.style.cssText="position:absolute;left:30px;width:128px;top:"+ua+"px;height:22px;margin-top: 6px;white-space: nowrap;";-var wa=document.createElement("input");wa.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";wa.setAttribute("placeholder",mxResources.get("search"));wa.setAttribute("type","text");ja.appendChild(wa);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.outline=-"none";va.style.opacity="0.5";va.style.height="16px";va.style.left="-20px";va.style.top="4px";ja.appendChild(va);mxEvent.addListener(va,"click",function(){va.getAttribute("src")!=Editor.magnifyImage&&(va.setAttribute("src",Editor.magnifyImage),va.setAttribute("title",mxResources.get("search")),wa.value="",null!=eb&&(eb.click(),eb=null));wa.focus()});mxEvent.addListener(wa,"keydown",mxUtils.bind(this,function(Aa){if(13==Aa.keyCode){var Ha=wa.value;if(""==Ha)null!=eb&&(eb.click(),eb=null);else{if(null==-NewDialog.tagsList[L]){var Da={};for(bb in Ra)if(null==Ra[bb].content)for(var Ja=Ra[bb],Ea=0;Ea<Ja.length;Ea++){var Ga=Ja[Ea];if(null!=Ga.tags)for(var Ma=Ga.tags.toLowerCase().split(";"),Oa=0;Oa<Ma.length;Oa++)null==Da[Ma[Oa]]&&(Da[Ma[Oa]]=[]),Da[Ma[Oa]].push(Ga)}NewDialog.tagsList[L]=Da}var Va=Ha.toLowerCase().split(" ");Da=NewDialog.tagsList[L];if(0<Za&&null==Da.__tagsList__){for(bb in Ua)for(Ja=Ua[bb],Ea=0;Ea<Ja.length;Ea++)for(Ga=Ja[Ea],Ma=Ga.title.split(" "),Ma.push(bb),Oa=0;Oa<Ma.length;Oa++){var hb=-Ma[Oa].toLowerCase();null==Da[hb]&&(Da[hb]=[]);Da[hb].push(Ga)}Da.__tagsList__=!0}var bb=[];Ja={};for(Ea=Ma=0;Ea<Va.length;Ea++)if(0<Va[Ea].length){hb=Da[Va[Ea]];var mb={};bb=[];if(null!=hb)for(Oa=0;Oa<hb.length;Oa++)Ga=hb[Oa],0==Ma==(null==Ja[Ga.url])&&(mb[Ga.url]=!0,bb.push(Ga));Ja=mb;Ma++}ca.scrollTop=0;ca.innerText="";R=0;Da=document.createElement("div");Da.style.padding="6px";Da.style.whiteSpace="nowrap";Da.style.overflow="hidden";Da.style.textOverflow="ellipsis";Ga=mxResources.get(0==bb.length?-"noResultsFor":"resultsFor",[Ha]);Da.setAttribute("title",Ga);mxUtils.write(Da,Ga);ca.appendChild(Da);null!=Sa&&null==eb&&(Sa.style.backgroundColor="",eb=Sa,Sa=Da);fb=bb;ea=null;E(!1)}mxEvent.consume(Aa)}}));mxEvent.addListener(wa,"keyup",mxUtils.bind(this,function(Aa){""==wa.value?(va.setAttribute("src",Editor.magnifyImage),va.setAttribute("title",mxResources.get("search"))):(va.setAttribute("src",Editor.crossImage),va.setAttribute("title",mxResources.get("reset")))}));ua+=23;var Fa=document.createElement("div");-Fa.style.cssText="position:absolute;left:30px;width:128px;top:"+ua+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(ca,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var Ka=140,Wa=Ka,Pa=null,ob="url("+Editor.thinSparklesImage+")",Xa=document.createElement("div");Xa.className="geGenerateDiagramForm";Xa.style.position="absolute";Xa.style.width="100%";Xa.style.height="100%";var $a=document.createElement("div");$a.className="geTemplatePreview geAdaptiveAsset";-$a.style.backgroundImage=ob;var db=document.createElement("textarea");db.setAttribute("placeholder",mxResources.get("describeYourDiagram"));db.className="geGenerateDiagramDescription";var ib=document.createElement("button");ib.className="geBtn gePrimaryBtn geGenerateDiagramButton";ib.setAttribute("disabled","disabled");ib.setAttribute("title",mxResources.get("ok"));mxUtils.write(ib,mxResources.get("ok"));var ab=Y.cloneNode(!0);ab.style.display="none";var ub=!1;mxEvent.addGestureListeners(ab,function(Aa){ub=-null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Aa){if(!ub&&null!=Ba){var Ha="<mxfile><diagram>"+Graph.compress(Ba)+"</diagram></mxfile>";D(Ha,mxEvent.getClientX(Aa),mxEvent.getClientY(Aa),Pa,da)}});var Qa=Y.cloneNode(!0);Qa.setAttribute("src",Editor.editImage);Qa.setAttribute("title",mxResources.get("edit"));Qa.style.visibility="hidden";Qa.style.left="0px";var cb=Y.cloneNode(!0);cb.setAttribute("src",Editor.helpImage);cb.setAttribute("title",mxResources.get("help"));-mxEvent.addListener(cb,"click",function(Aa){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Aa)});Xa.appendChild(db);Xa.appendChild(ib);Xa.appendChild(cb);Xa.style.display="none";mxEvent.addListener(Qa,"click",V);mxEvent.addListener(db,"input",function(){""!=db.value?ib.removeAttribute("disabled"):ib.setAttribute("disabled","disabled")});var Na=!1;mxEvent.addListener(ib,"click",function(){u()});mxEvent.addListener(db,"keydown",function(Aa){13!=Aa.keyCode||mxEvent.isShiftDown(Aa)?-27==Aa.keyCode&&(u(!0),mxEvent.consume(Aa)):(u(),mxEvent.consume(Aa))});var Ra={},kb={},Ua={},Za=0,lb=!0,Sa=null,eb=null;Ra.basic=C?[]:[{title:"blankDiagram"}];var fb=Ra.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&Ra.basic.push({title:"generate",type:"generative"});if(!l){var vb=function(){mxUtils.get(rb,function(Aa){if(!zb){zb=!0;Aa=Aa.getXml().documentElement.firstChild;for(var Ha={};null!=Aa;){if("undefined"!==-typeof Aa.getAttribute)if("parsererror"==Aa.nodeName)null!=window.console&&console.log("Parser error in "+L+": "+Aa.textContent);else if("clibs"==Aa.nodeName){for(var Da=Aa.getAttribute("name"),Ja=Aa.getElementsByTagName("add"),Ea=[],Ga=0;Ga<Ja.length;Ga++)Ea.push(encodeURIComponent(mxUtils.getTextContent(Ja[Ga])));null!=Da&&0<Ea.length&&(Ha[Da]=Ea.join(";"))}else if(Ea=Aa.getAttribute("url"),null!=Ea){Ja=Aa.getAttribute("section");Da=Aa.getAttribute("subsection");if(null==Ja&&(Ga=Ea.indexOf("/"),-Ja=Ea.substring(0,Ga),null==Da)){var Ma=Ea.indexOf("/",Ga+1);-1<Ma&&(Da=Ea.substring(Ga+1,Ma))}Ga=Ra[Ja];null==Ga&&(Ga=[],Ra[Ja]=Ga);Ea=Aa.getAttribute("clibs");null!=Ha[Ea]&&(Ea=Ha[Ea]);Ea={url:Aa.getAttribute("url"),libs:Aa.getAttribute("libs"),title:Aa.getAttribute("title"),tooltip:Aa.getAttribute("name")||Aa.getAttribute("url"),preview:Aa.getAttribute("preview"),clibs:Ea,tags:Aa.getAttribute("tags")};Ga.push(Ea);null!=Da&&(Ga=kb[Ja],null==Ga&&(Ga={},kb[Ja]=Ga),Ja=Ga[Da],null==Ja&&(Ja=[],Ga[Da]=-Ja),Ja.push(Ea))}Aa=Aa.nextSibling}W.stop();H()}})};q.appendChild(ja);q.appendChild(Fa);q.appendChild(ca);var zb=!1,rb=L;/^https?:\/\//.test(rb)&&!b.editor.isCorsEnabledForUrl(rb)&&(rb=PROXY_URL+"?url="+encodeURIComponent(rb));W.spin(ca);null!=t?t(function(Aa,Ha){Ua=Aa;qa=Za=Ha;vb()},vb):vb();ma=Ra}mxEvent.addListener(N,"keypress",function(Aa){b.dialog.container.firstChild==q&&13==Aa.keyCode&&U()});var jb=document.createElement("div");jb.style.marginTop=l?"4px":"16px";jb.style.textAlign="right";jb.style.position=-"absolute";jb.style.left="40px";jb.style.bottom="24px";jb.style.right="40px";var wb=mxUtils.button(mxResources.get("cancel"),function(){null!=z&&z();b.hideDialog(!0)});wb.className="geBtn";!b.editor.cancelFirst||x&&null==z||jb.appendChild(wb);if(!(l||"1"==urlParams.embed||x||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Ab=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Aa=new FilenameDialog(b,"",mxResources.get("create"),function(Ha){null!=Ha&&0<Ha.length&&-b.editor.loadUrl(b.editor.getProxiedUrl(Ha),function(Da){oa=Da;xa=null;templateRealURl=Ha;b.hideDialog();U()},function(Da){b.handleError(Da)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Aa.container,300,80,!0,!0);Aa.init()});Ab.className="geBtn";jb.appendChild(Ab)}if(Graph.fileSupport&&k){var Bb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Aa=document.createElement("input");Aa.setAttribute("multiple","multiple");Aa.setAttribute("type","file");-mxEvent.addListener(Aa,"change",function(Ha){b.openFiles(Aa.files,!0);Aa.value=""});Aa.style.display="none";document.body.appendChild(Aa);b.newDlgFileInputElt=Aa}b.newDlgFileInputElt.click()});Bb.className="geBtn";jb.appendChild(Bb)}jb.appendChild(X);b.editor.cancelFirst||null!=f||x&&null==z||jb.appendChild(wb);q.appendChild(jb);this.container=q};NewDialog.tagsList={};-var SaveDialog=function(b,l,p,f,x,z,y,F,O,K,L){function M(g,q,B,J,Q,N){var S=null;if((null==f||0>mxUtils.indexOf(f,g))&&(null==O||g==O)&&(null==K||0<=mxUtils.indexOf(K,g))){Q=null!=Q?Q:b.getTitleForService(g);var P=0<=mxUtils.indexOf(u,g);if(P||null!=b.getServiceForName(g)){S=document.createElement("option");var R="";!P&&b.isOffline(g==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(S.setAttribute("disabled","disabled"),R=" ("+mxResources.get("offline")+")");if("pick"==N)S.innerHTML=mxUtils.htmlEntities(Q)+-" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+R,S.setAttribute("value","pickFolder-"+g),S.setAttribute("title",Q+" - "+mxResources.get("pickFolder")+"...");else{P=g+(null!=B?"-"+B:"");var W=H[P];null!=W&&null!=W.option&&W.option.parentNode.removeChild(W.option);W=null;if(null!=q){"/"==q.charAt(q.length-1)&&(q=q.substring(0,q.length-1));"/"==q.charAt(0)&&(q=q.substring(1));W=q;if(g!=App.MODE_GITHUB&&g==App.MODE_GITLAB){var X=W.lastIndexOf("/");0<=X&&(W=-W.substring(X+1))}40<W.length&&(W=W.substring(0,20)+"..."+W.substring(W.length-20))}S.innerHTML=mxUtils.htmlEntities(Q)+(null!=W?" – "+mxUtils.htmlEntities(W):"")+R;S.setAttribute("title",Q+(null!=q?" ("+q+")":"")+(null!=B&&decodeURIComponent(B)!=q?" ["+B+"]":""));S.setAttribute("value",P);H[P]={option:S,mode:g,path:q,id:B};SaveDialog.lastValue==P&&null==F&&"disabled"==!S.getAttribute("disabled")?J=!0:null==J&&("root"==N?J=null==F&&b.mode==g||null!=g&&g==F:"pickFolder-"==-n.value.substring(0,11)&&(J=!0));J&&S.setAttribute("selected","selected")}n.appendChild(S)}}return S}function c(g){b.pickFolder(g,function(q){var B=null;g==App.MODE_GOOGLE&&null!=q.docs&&0<q.docs.length?B={mode:g,path:q.docs[0].name,id:q.docs[0].id}:g==App.MODE_ONEDRIVE&&null!=q.value&&0<q.value.length?B={mode:g,path:q.value[0].name,id:OneDriveFile.prototype.getIdOf(q.value[0])}:g==App.MODE_M365&&null!=q.value&&0<q.value.length?B={mode:g,path:q.value[0].name,id:OneDriveFile.prototype.getIdOf(q.value[0])}:-(g==App.MODE_GITHUB||g==App.MODE_GITLAB)&&null!=q&&0<q.length&&(B={mode:g,path:decodeURIComponent(q),id:q});null!=B&&(b.addRecent(B,"Folders",5),q=M(B.mode,B.path,B.id,!0),n.innerHTML="",H={},d(),B=n.selectedIndex,n.value=q.value,0>n.selectedIndex&&(n.selectedIndex=B))},!0,!0,!0,!0)}function d(){var g=b.getRecent("Folders"),q=0;if(null!=g&&0<g.length)for(var B=0;B<g.length;B++)null!=M(g[B].mode,g[B].path,g[B].id)&&q++;M(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");M(App.MODE_GOOGLE,-null,null,null,null,"pick");null!=b.oneDrive&&(M(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),M(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.m365&&M(App.MODE_M365,null,null,null,null,"pick");null!=b.dropbox&&M(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);M(App.MODE_GITHUB,null,null,null,null,"pick");M(App.MODE_GITLAB,null,null,null,null,"pick");M(App.MODE_TRELLO);g=!Editor.useLocalStorage||"device"==urlParams.storage||null!=-b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&g&&M(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=f&&0<=mxUtils.indexOf(f,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&M(App.MODE_BROWSER);g&&M("download");Editor.popupsAllowed&&M("_blank",null,null,null,mxResources.get("openInNewWindow"));"pickFolder-"==n.value.substring(0,11)&&(g=document.createElement("option"),g.setAttribute("value",""),g.setAttribute("selected","selected"),mxUtils.write(g,-mxResources.get("pickFolder")+"..."),n.insertBefore(g,n.firstChild));G=n.value}function k(){if("pickFolder-"==n.value.substring(0,11)){var g=n.value.substring(11);n.value=G;c(g)}else if(null!=V&&null!=H[n.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[V.value].extension){g=b.getExtensionForService(H[n.value].mode);var q=T.value;null!=g&&0>l.indexOf(".")&&0>q.indexOf(".")&&(T.value=q+g)}I.innerHTML="";mxUtils.write(I,null!=L?L:mxResources.get("download"==n.value||"_blank"==-n.value||null!=O?"ok":"save"));""==n.value?I.setAttribute("disabled","disabled"):I.removeAttribute("disabled")}var m=document.createElement("div");m.style.display="flex";m.style.flexWrap="wrap";m.style.whiteSpace="nowrap";var t=document.createElement("div");t.style.display="grid";t.style.gap="5px 8px";t.style.gridAutoRows="auto auto 44px";t.style.gridAutoColumns="0fr minmax(0,1fr)";t.style.width="100%";var v=null,A=null;if(null!=x&&null!=z&&"image/"==z.substring(0,6)&&("image/svg"!=z.substring(0,-9)||mxClient.IS_SVG)){t.style.display="inline-grid";t.style.flexBasis="75%";v=document.createElement("div");v.style.display="inline-block";v.style.height="auto";v.style.maxWidth="25%";v.style.margin="auto";var C=document.createElement("img"),E=y?x:btoa(unescape(encodeURIComponent(x))),D="data:"+z+";base64,"+E;C.setAttribute("src",D);C.style.boxSizing="border-box";C.style.maxHeight="50px";C.style.maxWidth="100%";C.style.paddingLeft="10px";v.appendChild(C);"image/png"!=z&&"image/svg+xml"!=z||"function"!==-typeof window.ClipboardItem||null==navigator.clipboard||(A=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(D,null,null,z,mxUtils.bind(this,function(){"copy"==F?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))}),mxUtils.bind(this,function(g){b.handleError(g)}))},null,"geBtn"));Editor.popupsAllowed&&(null==f||0>mxUtils.indexOf(f,"_blank"))?(v.setAttribute("title",mxResources.get("openInNewWindow")),v.style.cursor="pointer",mxEvent.addGestureListeners(v,null,null,-function(g){mxEvent.isPopupTrigger(g)||b.openInNewWindow(x,z,y)})):v.setAttribute("title",mxResources.get("preview"))}E=document.createElement("div");E.style.display="flex";E.style.padding="1px";E.style.alignItems="center";E.style.justifyContent="flex-end";E.style.gridColumn="1";E.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(E,mxResources.get("saveAs")+":");var T=document.createElement("input");T.setAttribute("type","text");T.setAttribute("value",l);T.style.boxSizing="border-box";T.style.width="100%";U.appendChild(T);null==O&&(t.appendChild(E),t.appendChild(U));var V=null;null!=b.editor.diagramFileTypes&&null==z&&null==O&&(E=E.cloneNode(!1),U=U.cloneNode(!1),mxUtils.write(E,mxResources.get("type")+":"),V=FilenameDialog.createFileTypes(b,T,b.editor.diagramFileTypes),V.style.boxSizing="border-box",V.style.width=-"100%",U.appendChild(V),t.appendChild(E),t.appendChild(U));E=E.cloneNode(!1);U=U.cloneNode(!1);mxUtils.write(E,mxResources.get("where")+":");var n=document.createElement("select");n.style.textOverflow="ellipsis";n.style.gridColumn="1";var u=["browser","device","download","_blank"],G=null,H={};C=mxUtils.button(mxResources.get("reset"),function(){T.value=l;T.dispatchEvent(new Event("change"));b.resetRecent("Folders");n.innerHTML="";n.value="";pickFolderOption=null;H={};d()},null,"geBtn");var I=mxUtils.button("",-function(){SaveDialog.lastValue=n.value;var g=H[SaveDialog.lastValue];null!=g&&p(T,g.mode,g.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(T,"keypress",function(g){13==g.keyCode&&("copy"==F&&null!=A?A.click():I.click())});mxEvent.addListener(n,"change",k);d();U.appendChild(n);null!=SaveDialog.lastValue&&null!=H[SaveDialog.lastValue]&&(n.value=SaveDialog.lastValue);k();t.appendChild(E);t.appendChild(U);m.appendChild(t);null!=v&&m.appendChild(v);t=document.createElement("div");t.style.flexBasis=-"100%";t.style.textAlign="right";t.style.marginTop=null!=z?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||t.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));v=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&t.appendChild(v);t.appendChild(C);"copy"==F&&null!=A?(A.className="geBtn gePrimaryBtn",I.className="geBtn",t.appendChild(I),t.appendChild(A)):(null!=A&&t.appendChild(A),t.appendChild(I));b.editor.cancelFirst||-t.appendChild(v);m.appendChild(t);this.init=function(){Editor.selectFilename(T)};this.container=m},CreateDialog=function(b,l,p,f,x,z,y,F,O,K,L,M,c,d,k,m,t){function v(n,u,G,H){function I(){mxEvent.addListener(g,"click",function(){var N=G;if(y){var S=E.value,P=S.lastIndexOf(".");if(0>l.lastIndexOf(".")&&0>P){N=null!=N?N:V.value;var R="";N==App.MODE_GOOGLE?R=b.drive.extension:N==App.MODE_GITHUB?R=b.gitHub.extension:N==App.MODE_GITLAB?R=b.gitLab.extension:N==App.MODE_TRELLO?R=b.trello.extension:N==App.MODE_DROPBOX?-R=b.dropbox.extension:N==App.MODE_ONEDRIVE?R=b.oneDrive.extension:N==App.MODE_DEVICE&&(R=".drawio");0<=P&&(S=S.substring(0,P));E.value=S+R}}A(G)})}var g=document.createElement("a");g.style.overflow="hidden";var q=document.createElement("img");q.src=n;q.setAttribute("border","0");q.setAttribute("align","absmiddle");q.style.width="60px";q.style.height="60px";q.style.paddingBottom="6px";g.style.display="inline-block";g.className="geBaseButton";g.style.position="relative";g.style.margin="4px";g.style.padding=-"8px 8px 10px 8px";g.style.whiteSpace="nowrap";g.appendChild(q);g.style.color="gray";g.style.fontSize="11px";var B=document.createElement("div");g.appendChild(B);mxUtils.write(B,u);if(null!=H&&null==b[H]){q.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(g);var Q=window.setTimeout(function(){null==b[H]&&(J.stop(),g.style.display=-"none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[H]&&(window.clearTimeout(Q),mxUtils.setOpacity(B,100),q.style.visibility="",J.stop(),I())}))}else I();U.appendChild(g);++T==M&&(mxUtils.br(U),T=0)}function A(n){var u=E.value;if(null==n||null!=u&&0<u.length)t&&b.hideDialog(),p(u,n,E)}L="1"==urlParams.noDevice?!1:L;y=null!=y?y:!0;F=null!=F?F:!0;M=null!=M?M:4;t=null!=t?t:!0;z=document.createElement("div");z.style.whiteSpace="nowrap";null==f&&b.addLanguageMenu(z);var C=document.createElement("h2");-mxUtils.write(C,x||mxResources.get("create"));C.style.marginTop="0px";C.style.marginBottom="24px";z.appendChild(C);x=document.createElement("span");mxUtils.write(x,mxResources.get("filename")+":");x.style.maxWidth="106px";x.style.overflow="hidden";x.style.textOverflow="ellipsis";x.style.display="inline-block";z.appendChild(x);var E=document.createElement("input");E.setAttribute("value",l);E.style.width="180px";E.style.marginLeft="10px";E.style.marginBottom="20px";E.style.maxWidth="70%";this.init=-function(){Editor.selectFilename(E)};z.appendChild(E);null!=m&&null!=b.editor.diagramFileTypes&&(m=FilenameDialog.createFileTypes(b,E,b.editor.diagramFileTypes),m.style.marginLeft="6px",m.style.width="90px",z.appendChild(m));m=null;if("1"!=urlParams.noDevice&&null!=c&&null!=d&&"image/"==d.substring(0,6)&&("image/svg"!=d.substring(0,9)||mxClient.IS_SVG)){E.style.width="160px";x=document.createElement("img");var D=k?c:btoa(unescape(encodeURIComponent(c)));x.setAttribute("src","data:"+d+";base64,"+D);-x.style.position="absolute";x.style.top="70px";x.style.right="100px";x.style.maxWidth="120px";x.style.maxHeight="80px";mxUtils.setPrefixedStyle(x.style,"transform","translate(50%,-50%)");z.appendChild(x);mxClient.IS_FF||"image/png"!=d||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(m=mxUtils.button(mxResources.get("copy"),function(n){n=b.base64ToBlob(D,"image/png");n=new ClipboardItem({"image/png":n,"text/html":new Blob(['<img src="data:'+d+";base64,"+D+'">'],{type:"text/html"})});-navigator.clipboard.write([n]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(u){b.handleError(u)}))}),m.style.marginTop="6px",m.className="geBtn");O&&Editor.popupsAllowed&&(x.style.cursor="pointer",mxEvent.addGestureListeners(x,null,null,function(n){mxEvent.isPopupTrigger(n)||A("_blank")}))}mxUtils.br(z);var U=document.createElement("div");U.style.textAlign="center";var T=0;U.style.marginTop="6px";z.appendChild(U);var V=document.createElement("select");-V.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(c,mxResources.get("googleDrive")),V.appendChild(c),v(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(c,mxResources.get("oneDrive")),-V.appendChild(c),b.mode==App.MODE_ONEDRIVE&&c.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),null!=b.m365&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_M365),mxUtils.write(c,mxResources.get("m365")),V.appendChild(c),b.mode==App.MODE_M365&&c.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365")),"function"===typeof window.DropboxClient&&-(c=document.createElement("option"),c.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(c,mxResources.get("dropbox")),V.appendChild(c),b.mode==App.MODE_DROPBOX&&c.setAttribute("selected","selected"),v(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITHUB),mxUtils.write(c,mxResources.get("github")),V.appendChild(c),v(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),-App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITLAB),mxUtils.write(c,mxResources.get("gitlab")),V.appendChild(c),v(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_TRELLO),mxUtils.write(c,mxResources.get("trello")),V.appendChild(c),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)c=document.createElement("option"),c.setAttribute("value",App.MODE_DEVICE),mxUtils.write(c,mxResources.get("device")),V.appendChild(c),b.mode!=App.MODE_DEVICE&&F||c.setAttribute("selected","selected"),L&&v(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);F&&isLocalStorage&&"0"!=urlParams.browser&&(F=document.createElement("option"),F.setAttribute("value",-App.MODE_BROWSER),mxUtils.write(F,mxResources.get("browser")),V.appendChild(F),b.mode==App.MODE_BROWSER&&F.setAttribute("selected","selected"),v(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));F=document.createElement("div");F.style.marginTop="26px";F.style.textAlign="center";null!=K&&(L=mxUtils.button(mxResources.get("help"),function(){b.openLink(K)}),L.className="geBtn",F.appendChild(L));L=mxUtils.button(mxResources.get(null!=f?"close":"cancel"),function(){null!=f?f():-(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});L.className="geBtn";b.editor.cancelFirst&&null==f&&F.appendChild(L);null==f&&(c=mxUtils.button(mxResources.get("decideLater"),function(){A(null)}),c.className="geBtn",F.appendChild(c));O&&Editor.popupsAllowed&&(O=mxUtils.button(mxResources.get("openInNewWindow"),function(){A("_blank")}),O.className="geBtn",F.appendChild(O));CreateDialog.showDownloadButton&&(O=mxUtils.button(mxResources.get("download"),function(){A("download")}),-O.className="geBtn",F.appendChild(O),null!=m&&(O.style.marginTop="6px",F.style.marginTop="6px"));null!=m&&(mxUtils.br(F),F.appendChild(m));b.editor.cancelFirst&&null==f||F.appendChild(L);mxEvent.addListener(E,"keypress",function(n){13==n.keyCode?A(App.MODE_DEVICE):27==n.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});z.appendChild(F);this.container=z};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;-var PopupDialog=function(b,l,p,f,x){x=null!=x?x:!0;var z=document.createElement("div");z.style.textAlign="center";z.style.height="100%";mxUtils.write(z,mxResources.get("fileOpenLocation"));mxUtils.br(z);mxUtils.br(z);var y=mxUtils.button(mxResources.get("openInThisWindow"),function(){x&&b.hideDialog();null!=f&&f()});y.className="geBtn";y.style.marginBottom="8px";y.style.width="280px";z.appendChild(y);mxUtils.br(z);var F=mxUtils.button(mxResources.get("openInNewWindow"),function(){x&&b.hideDialog();-null!=p&&p();b.openLink(l,null,!0)});F.className="geBtn gePrimaryBtn";F.style.width=y.style.width;z.appendChild(F);mxUtils.br(z);mxUtils.br(z);mxUtils.write(z,mxResources.get("allowPopups"));this.container=z},ImageDialog=function(b,l,p,f,x,z,y,F){function O(){0<M.value.length?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");"data:"!=M.value.substring(0,5)?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}z=null!=z?z:!0;var K=b.editor.graph,L=document.createElement("div");-mxUtils.write(L,l);l=document.createElement("div");l.className="geTitle";l.style.backgroundColor="transparent";l.style.borderColor="transparent";l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";l.style.paddingRight="20px";var M=document.createElement("input");M.setAttribute("value",p);M.setAttribute("type","text");M.setAttribute("spellcheck","false");M.setAttribute("autocorrect","off");M.setAttribute("autocomplete","off");M.setAttribute("autocapitalize","off");M.style.marginTop=-"6px";M.style.width=(Graph.fileSupport?460:340)-20+"px";M.style.backgroundImage="url('"+Editor.crossImage+"')";M.style.backgroundRepeat="no-repeat";M.style.backgroundPosition="100% 50%";M.style.paddingRight="14px";p=document.createElement("div");p.setAttribute("title",mxResources.get("reset"));p.style.position="relative";p.style.left="-16px";p.style.width="12px";p.style.height="14px";p.style.cursor="pointer";p.style.display="inline-block";p.style.top="3px";p.style.background="url('"+b.editor.transparentImage+-"')";mxEvent.addListener(p,"click",function(){M.value="";M.focus()});l.appendChild(M);l.appendChild(p);L.appendChild(l);var c=F,d,k,m=function(E,D,U,T){var V="data:"==E.substring(0,5);!b.isOffline()||V&&"undefined"===typeof chrome?0<E.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(E,function(n){b.spinner.stop();b.hideDialog();var u=!1===T?1:null!=D&&null!=U?Math.max(D/n.width,U/n.height):Math.min(1,Math.min(520/n.width,520/n.height));z&&(E=b.convertDataUri(E));f(E,-Math.round(Number(n.width)*u),Math.round(Number(n.height)*u),c,d,k)},function(){b.spinner.stop();f(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),f(E,null,null,c,d,k)):(E=b.convertDataUri(E),D=null==D?120:D,U=null==U?100:U,b.hideDialog(),f(E,D,U,c,d,k))},t=function(E,D){if(null!=E){var U=x?null:K.getModel().getGeometry(K.getSelectionCell());null!=U?m(E,U.width,U.height,D):m(E,null,null,D)}else b.hideDialog(),f(null)};this.init=function(){M.focus();-if(Graph.fileSupport){M.setAttribute("placeholder",mxResources.get("dragImagesHere"));var E=L.parentNode,D=null;mxEvent.addListener(E,"dragleave",function(U){null!=D&&(D.parentNode.removeChild(D),D=null);U.stopPropagation();U.preventDefault()});mxEvent.addListener(E,"dragover",mxUtils.bind(this,function(U){null==D&&(D=b.highlightElement(E));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(E,"drop",mxUtils.bind(this,function(U){null!=D&&(D.parentNode.removeChild(D),D=null);if(0<U.dataTransfer.files.length)b.importFiles(U.dataTransfer.files,-0,0,b.maxImageSize,function(V,n,u,G,H,I,g,q){t(V,q)},function(){},function(V){return"image/"==V.type.substring(0,6)},function(V){for(var n=0;n<V.length;n++)V[n]()},!mxEvent.isControlDown(U),null,null,!0);else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")){var T=U.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(T)&&t(decodeURIComponent(T))}U.stopPropagation();U.preventDefault()}),!1)}};F=document.createElement("div");F.style.marginTop="14px";F.style.textAlign=-"center";p=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});p.className="geBtn";b.editor.cancelFirst&&F.appendChild(p);ImageDialog.filePicked=function(E){E.action==google.picker.Action.PICKED&&null!=E.docs[0].thumbnails&&(E=E.docs[0].thumbnails[E.docs[0].thumbnails.length-1],null!=E&&(M.value=E.url));M.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(E){null!=v.files&&(b.importFiles(v.files,0,0,b.maxImageSize,function(D,U,T,V,n,u){t(D)},function(){},function(D){return"image/"==D.type.substring(0,6)},function(D){for(var U=0;U<D.length;U++)D[U]()},!0),v.type="",v.type="file",v.value="")});v.style.display="none";document.body.appendChild(v);b.imgDlgFileInputElt=v}l=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});l.className="geBtn";F.appendChild(l)}mxEvent.addListener(M,-"keypress",function(E){13==E.keyCode&&t(M.value)});var A=mxUtils.button(mxResources.get("crop"),function(){var E=new CropImageDialog(b,M.value,c,function(D,U,T){c=D;d=U;k=T});b.showDialog(E.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450))});y&&(A.className="geBtn",F.appendChild(A));var C=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=M.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var E=b.editor.createImageUrlConverter().convert(M.value),-D=new Image;D.onload=function(){b.editor.convertImageToDataUri(E,function(U){b.confirmImageResize(function(T){b.resizeImage(D,U,mxUtils.bind(this,function(V,n,u){b.spinner.stop();null!=V&&V.length<b.maxImageBytes?(M.value=V,O()):b.handleError({message:mxResources.get("imageTooBig")})}),T,b.maxImageSize)},D.width>b.maxImageSize||D.height>b.maxImageSize||U.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};D.onerror=function(){b.spinner.stop();-b.handleError({message:mxResources.get("fileNotFound")})};D.src=E}});C.className="geBtn";mxEvent.addListener(M,"change",function(E){c=null;O()});O();F.appendChild(C);y=mxUtils.button(mxResources.get("apply"),function(){t(M.value)});y.className="geBtn gePrimaryBtn";F.appendChild(y);b.editor.cancelFirst||F.appendChild(p);Graph.fileSupport&&(F.style.marginTop="120px",L.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",L.style.backgroundPosition="center 65%",L.style.backgroundRepeat="no-repeat",-y=document.createElement("div"),y.style.position="absolute",y.style.width="420px",y.style.top="58%",y.style.textAlign="center",y.style.fontSize="18px",y.style.color="#a0c3ff",mxUtils.write(y,mxResources.get("dragImagesHere")),L.appendChild(y));L.appendChild(F);this.container=L},LinkDialog=function(b,l,p,f,x,z,y){function F(E,D){var U=document.createElement("option");mxUtils.write(U,mxResources.get(E));U.value=E;A.appendChild(U);C[E]=D}var O=document.createElement("div");O.style.height="100%";mxUtils.write(O,+App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";l||I||!p||C.appendChild(J);p&&mxUtils.write(C,(I?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var 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 Q=document.createElement("input");Q.setAttribute("value",b.defaultFilename+M);Q.style.marginLeft="10px";Q.style.width=l||I?"144px":"244px";this.init=function(){p&&Editor.selectFilename(Q);null!=da.parentNode&&null!=da.parentNode.parentNode&&mxEvent.addGestureListeners(da.parentNode.parentNode,mxUtils.bind(this,function(Ba){null!=+b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(p)if(C.appendChild(Q),u)Q.style.width=l||I?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var T=FilenameDialog.createFileTypes(b,Q,b.editor.diagramFileTypes);T.style.marginLeft="6px";T.style.width=l||I?"80px":"180px";C.appendChild(T)}var P=!1,S=0,W=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}),X=mxUtils.button(m||mxResources.get("create"),+function(){X.setAttribute("disabled","disabled");F();X.removeAttribute("disabled")});X.className="geBtn gePrimaryBtn";var Y=document.createElement("img");Y.setAttribute("src",Editor.magnifyImage);Y.setAttribute("title",mxResources.get("preview"));Y.className="geButton geRoundButton";var Z=!1,aa=null,ha=!1;if(O||c){var ja=[],fa=null,ma=null,sa=null,ta=function(Ba){X.setAttribute("disabled","disabled");for(var Ia=0;Ia<ja.length;Ia++)ja[Ia].className=Ia==Ba?"geBtn gePrimaryBtn":"geBtn"};P=!0;var ra=+document.createElement("div");ra.style.whiteSpace="nowrap";ra.style.height="30px";q.appendChild(ra);var qa=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Ga.style.display="";ka.style.display="";da.style.left="160px";ta(0);da.scrollTop=0;da.innerText="";S=0;fa!=fb&&(fb=fa,Ra=ma,Za=sa,Ga.innerText="",H(),fa=null)});ja.push(qa);ra.appendChild(qa);var la=function(Ba){Ga.style.display="none";ka.style.display="none";da.style.left="30px";ta(Ba?-1:1);null==fa&&(fa=fb);da.scrollTop=+0;da.innerText="";W.spin(da);var Ia=function(Ea,Ja,Fa){S=0;W.stop();fb=Ea;Fa=Fa||{};var Ha=0,Ma;for(Ma in Fa)Ha+=Fa[Ma].length;if(Ja)da.innerText=Ja;else if(0==Ea.length&&0==Ha)da.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(da.innerText="",0<Ha){Ga.style.display="";da.style.left="160px";Ga.innerText="";Za=0;Ra={"draw.io":Ea};for(Ma in Fa)Ra[Ma]=Fa[Ma];H()}else D(!0)};Ba?c(xa.value,Ia):O(Ia)};if(O){var ia=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){la()});+ra.appendChild(ia);ja.push(ia)}if(c){var oa=document.createElement("span");oa.style.marginLeft="10px";oa.innerText=mxResources.get("search")+":";ra.appendChild(oa);var xa=document.createElement("input");xa.style.marginRight="10px";xa.style.marginLeft="10px";xa.style.width="220px";mxEvent.addListener(xa,"keypress",function(Ba){13==Ba.keyCode&&la(!0)});ra.appendChild(xa);var Aa=mxUtils.button(mxResources.get("search"),function(){la(!0)});Aa.className="geBtn";ra.appendChild(Aa)}ta(0)}var wa=null,ea=+null,Da=null,pa=null,ba=null,na=null,Ca=null,za=null,ca=null,da=document.createElement("div");da.style.border="1px solid #d3d3d3";da.style.position="absolute";da.style.left="160px";da.style.right="34px";var ua=(p?72:40)+(P?30:0);da.style.top=ua+"px";da.style.bottom="68px";da.style.margin="6px 0 0 -1px";da.style.padding="6px";da.style.overflow="auto";var ka=document.createElement("div");ka.style.cssText="position:absolute;left:30px;width:128px;top:"+ua+"px;height:22px;margin-top: 6px;white-space: nowrap;";+var ya=document.createElement("input");ya.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";ya.setAttribute("placeholder",mxResources.get("search"));ya.setAttribute("type","text");ka.appendChild(ya);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.outline=+"none";va.style.opacity="0.5";va.style.height="16px";va.style.left="-20px";va.style.top="4px";ka.appendChild(va);mxEvent.addListener(va,"click",function(){va.getAttribute("src")!=Editor.magnifyImage&&(va.setAttribute("src",Editor.magnifyImage),va.setAttribute("title",mxResources.get("search")),ya.value="",null!=eb&&(eb.click(),eb=null));ya.focus()});mxEvent.addListener(ya,"keydown",mxUtils.bind(this,function(Ba){if(13==Ba.keyCode){var Ia=ya.value;if(""==Ia)null!=eb&&(eb.click(),eb=null);else{if(null==+NewDialog.tagsList[L]){var Ea={};for(bb in Ra)if(null==Ra[bb].content)for(var Ja=Ra[bb],Fa=0;Fa<Ja.length;Fa++){var Ha=Ja[Fa];if(null!=Ha.tags)for(var Ma=Ha.tags.toLowerCase().split(";"),Oa=0;Oa<Ma.length;Oa++)null==Ea[Ma[Oa]]&&(Ea[Ma[Oa]]=[]),Ea[Ma[Oa]].push(Ha)}NewDialog.tagsList[L]=Ea}var Va=Ia.toLowerCase().split(" ");Ea=NewDialog.tagsList[L];if(0<Za&&null==Ea.__tagsList__){for(bb in Ua)for(Ja=Ua[bb],Fa=0;Fa<Ja.length;Fa++)for(Ha=Ja[Fa],Ma=Ha.title.split(" "),Ma.push(bb),Oa=0;Oa<Ma.length;Oa++){var hb=+Ma[Oa].toLowerCase();null==Ea[hb]&&(Ea[hb]=[]);Ea[hb].push(Ha)}Ea.__tagsList__=!0}var bb=[];Ja={};for(Fa=Ma=0;Fa<Va.length;Fa++)if(0<Va[Fa].length){hb=Ea[Va[Fa]];var mb={};bb=[];if(null!=hb)for(Oa=0;Oa<hb.length;Oa++)Ha=hb[Oa],0==Ma==(null==Ja[Ha.url])&&(mb[Ha.url]=!0,bb.push(Ha));Ja=mb;Ma++}da.scrollTop=0;da.innerText="";S=0;Ea=document.createElement("div");Ea.style.padding="6px";Ea.style.whiteSpace="nowrap";Ea.style.overflow="hidden";Ea.style.textOverflow="ellipsis";Ha=mxResources.get(0==bb.length?+"noResultsFor":"resultsFor",[Ia]);Ea.setAttribute("title",Ha);mxUtils.write(Ea,Ha);da.appendChild(Ea);null!=Sa&&null==eb&&(Sa.style.backgroundColor="",eb=Sa,Sa=Ea);fb=bb;fa=null;D(!1)}mxEvent.consume(Ba)}}));mxEvent.addListener(ya,"keyup",mxUtils.bind(this,function(Ba){""==ya.value?(va.setAttribute("src",Editor.magnifyImage),va.setAttribute("title",mxResources.get("search"))):(va.setAttribute("src",Editor.crossImage),va.setAttribute("title",mxResources.get("reset")))}));ua+=23;var Ga=document.createElement("div");+Ga.style.cssText="position:absolute;left:30px;width:128px;top:"+ua+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(da,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var Ka=140,Wa=Ka,Pa=null,ob="url("+Editor.thinSparklesImage+")",Xa=document.createElement("div");Xa.className="geGenerateDiagramForm";Xa.style.position="absolute";Xa.style.width="100%";Xa.style.height="100%";var $a=document.createElement("div");$a.className="geTemplatePreview geAdaptiveAsset";+$a.style.backgroundImage=ob;var db=document.createElement("textarea");db.setAttribute("placeholder",mxResources.get("describeYourDiagram"));db.className="geGenerateDiagramDescription";var ib=document.createElement("button");ib.className="geBtn gePrimaryBtn geGenerateDiagramButton";ib.setAttribute("disabled","disabled");ib.setAttribute("title",mxResources.get("ok"));mxUtils.write(ib,mxResources.get("ok"));var ab=Y.cloneNode(!0);ab.style.display="none";var ub=!1;mxEvent.addGestureListeners(ab,function(Ba){ub=+null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Ba){if(!ub&&null!=za){var Ia="<mxfile><diagram>"+Graph.compress(za)+"</diagram></mxfile>";N(Ia,mxEvent.getClientX(Ba),mxEvent.getClientY(Ba),Pa,ca)}});var Qa=Y.cloneNode(!0);Qa.setAttribute("src",Editor.editImage);Qa.setAttribute("title",mxResources.get("edit"));Qa.style.visibility="hidden";Qa.style.left="0px";var cb=Y.cloneNode(!0);cb.setAttribute("src",Editor.helpImage);cb.setAttribute("title",mxResources.get("help"));+mxEvent.addListener(cb,"click",function(Ba){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Ba)});Xa.appendChild(db);Xa.appendChild(ib);Xa.appendChild(cb);Xa.style.display="none";mxEvent.addListener(Qa,"click",V);mxEvent.addListener(db,"input",function(){""!=db.value?ib.removeAttribute("disabled"):ib.setAttribute("disabled","disabled")});var Na=!1;mxEvent.addListener(ib,"click",function(){v()});mxEvent.addListener(db,"keydown",function(Ba){13!=Ba.keyCode||mxEvent.isShiftDown(Ba)?+27==Ba.keyCode&&(v(!0),mxEvent.consume(Ba)):(v(),mxEvent.consume(Ba))});var Ra={},kb={},Ua={},Za=0,lb=!0,Sa=null,eb=null;Ra.basic=B?[]:[{title:"blankDiagram"}];var fb=Ra.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&Ra.basic.push({title:"generate",type:"generative"});if(!l){var vb=function(){mxUtils.get(rb,function(Ba){if(!zb){zb=!0;Ba=Ba.getXml().documentElement.firstChild;for(var Ia={};null!=Ba;){if("undefined"!==+typeof Ba.getAttribute)if("parsererror"==Ba.nodeName)null!=window.console&&console.log("Parser error in "+L+": "+Ba.textContent);else if("clibs"==Ba.nodeName){for(var Ea=Ba.getAttribute("name"),Ja=Ba.getElementsByTagName("add"),Fa=[],Ha=0;Ha<Ja.length;Ha++)Fa.push(encodeURIComponent(mxUtils.getTextContent(Ja[Ha])));null!=Ea&&0<Fa.length&&(Ia[Ea]=Fa.join(";"))}else if(Fa=Ba.getAttribute("url"),null!=Fa){Ja=Ba.getAttribute("section");Ea=Ba.getAttribute("subsection");if(null==Ja&&(Ha=Fa.indexOf("/"),+Ja=Fa.substring(0,Ha),null==Ea)){var Ma=Fa.indexOf("/",Ha+1);-1<Ma&&(Ea=Fa.substring(Ha+1,Ma))}Ha=Ra[Ja];null==Ha&&(Ha=[],Ra[Ja]=Ha);Fa=Ba.getAttribute("clibs");null!=Ia[Fa]&&(Fa=Ia[Fa]);Fa={url:Ba.getAttribute("url"),libs:Ba.getAttribute("libs"),title:Ba.getAttribute("title"),tooltip:Ba.getAttribute("name")||Ba.getAttribute("url"),preview:Ba.getAttribute("preview"),clibs:Fa,tags:Ba.getAttribute("tags")};Ha.push(Fa);null!=Ea&&(Ha=kb[Ja],null==Ha&&(Ha={},kb[Ja]=Ha),Ja=Ha[Ea],null==Ja&&(Ja=[],Ha[Ea]=+Ja),Ja.push(Fa))}Ba=Ba.nextSibling}W.stop();H()}})};q.appendChild(ka);q.appendChild(Ga);q.appendChild(da);var zb=!1,rb=L;/^https?:\/\//.test(rb)&&!b.editor.isCorsEnabledForUrl(rb)&&(rb=PROXY_URL+"?url="+encodeURIComponent(rb));W.spin(da);null!=t?t(function(Ba,Ia){Ua=Ba;sa=Za=Ia;vb()},vb):vb();ma=Ra}mxEvent.addListener(Q,"keypress",function(Ba){b.dialog.container.firstChild==q&&13==Ba.keyCode&&F()});var jb=document.createElement("div");jb.style.marginTop=l?"4px":"16px";jb.style.textAlign="right";jb.style.position=+"absolute";jb.style.left="40px";jb.style.bottom="24px";jb.style.right="40px";var wb=mxUtils.button(mxResources.get("cancel"),function(){null!=z&&z();b.hideDialog(!0)});wb.className="geBtn";!b.editor.cancelFirst||x&&null==z||jb.appendChild(wb);if(!(l||"1"==urlParams.embed||x||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Ab=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Ba=new FilenameDialog(b,"",mxResources.get("create"),function(Ia){null!=Ia&&0<Ia.length&&+b.editor.loadUrl(b.editor.getProxiedUrl(Ia),function(Ea){Da=Ea;wa=null;templateRealURl=Ia;b.hideDialog();F()},function(Ea){b.handleError(Ea)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Ba.container,300,80,!0,!0);Ba.init()});Ab.className="geBtn";jb.appendChild(Ab)}if(Graph.fileSupport&&k){var Bb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Ba=document.createElement("input");Ba.setAttribute("multiple","multiple");Ba.setAttribute("type","file");+mxEvent.addListener(Ba,"change",function(Ia){b.openFiles(Ba.files,!0);Ba.value=""});Ba.style.display="none";document.body.appendChild(Ba);b.newDlgFileInputElt=Ba}b.newDlgFileInputElt.click()});Bb.className="geBtn";jb.appendChild(Bb)}jb.appendChild(X);b.editor.cancelFirst||null!=f||x&&null==z||jb.appendChild(wb);q.appendChild(jb);this.container=q};NewDialog.tagsList={};+var SaveDialog=function(b,l,p,f,x,z,y,E,R,K,L){function O(g,q,C,J,M,Q){var T=null;if((null==f||0>mxUtils.indexOf(f,g))&&(null==R||g==R)&&(null==K||0<=mxUtils.indexOf(K,g))){M=null!=M?M:b.getTitleForService(g);var P=0<=mxUtils.indexOf(v,g);if(P||null!=b.getServiceForName(g)){T=document.createElement("option");var S="";!P&&b.isOffline(g==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(T.setAttribute("disabled","disabled"),S=" ("+mxResources.get("offline")+")");if("pick"==Q)T.innerHTML=mxUtils.htmlEntities(M)++" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+S,T.setAttribute("value","pickFolder-"+g),T.setAttribute("title",M+" - "+mxResources.get("pickFolder")+"...");else{P=g+(null!=C?"-"+C:"");var W=H[P];null!=W&&null!=W.option&&W.option.parentNode.removeChild(W.option);W=null;if(null!=q){"/"==q.charAt(q.length-1)&&(q=q.substring(0,q.length-1));"/"==q.charAt(0)&&(q=q.substring(1));W=q;if(g!=App.MODE_GITHUB&&g==App.MODE_GITLAB){var X=W.lastIndexOf("/");0<=X&&(W=+W.substring(X+1))}40<W.length&&(W=W.substring(0,20)+"..."+W.substring(W.length-20))}T.innerHTML=mxUtils.htmlEntities(M)+(null!=W?" – "+mxUtils.htmlEntities(W):"")+S;T.setAttribute("title",M+(null!=q?" ("+q+")":"")+(null!=C&&decodeURIComponent(C)!=q?" ["+C+"]":""));T.setAttribute("value",P);H[P]={option:T,mode:g,path:q,id:C};SaveDialog.lastValue==P&&null==E&&"disabled"==!T.getAttribute("disabled")?J=!0:null==J&&("root"==Q?J=null==E&&b.mode==g||null!=g&&g==E:"pickFolder-"==+n.value.substring(0,11)&&(J=!0));J&&T.setAttribute("selected","selected")}n.appendChild(T)}}return T}function c(g){b.pickFolder(g,function(q){var C=null;g==App.MODE_GOOGLE&&null!=q.docs&&0<q.docs.length?C={mode:g,path:q.docs[0].name,id:q.docs[0].id}:g==App.MODE_ONEDRIVE&&null!=q.value&&0<q.value.length?C={mode:g,path:q.value[0].name,id:OneDriveFile.prototype.getIdOf(q.value[0])}:g==App.MODE_M365&&null!=q.value&&0<q.value.length?C={mode:g,path:q.value[0].name,id:OneDriveFile.prototype.getIdOf(q.value[0])}:+(g==App.MODE_GITHUB||g==App.MODE_GITLAB)&&null!=q&&0<q.length&&(C={mode:g,path:decodeURIComponent(q),id:q});null!=C&&(b.addRecent(C,"Folders",5),q=O(C.mode,C.path,C.id,!0),n.innerHTML="",H={},d(),C=n.selectedIndex,n.value=q.value,0>n.selectedIndex&&(n.selectedIndex=C))},!0,!0,!0,!0)}function d(){var g=b.getRecent("Folders"),q=0;if(null!=g&&0<g.length)for(var C=0;C<g.length;C++)null!=O(g[C].mode,g[C].path,g[C].id)&&q++;O(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");O(App.MODE_GOOGLE,+null,null,null,null,"pick");null!=b.oneDrive&&(O(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),O(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.m365&&O(App.MODE_M365,null,null,null,null,"pick");null!=b.dropbox&&O(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);O(App.MODE_GITHUB,null,null,null,null,"pick");O(App.MODE_GITLAB,null,null,null,null,"pick");O(App.MODE_TRELLO);g=!Editor.useLocalStorage||"device"==urlParams.storage||null!=+b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&g&&O(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=f&&0<=mxUtils.indexOf(f,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&O(App.MODE_BROWSER);g&&O("download");Editor.popupsAllowed&&O("_blank",null,null,null,mxResources.get("openInNewWindow"));"pickFolder-"==n.value.substring(0,11)&&(g=document.createElement("option"),g.setAttribute("value",""),g.setAttribute("selected","selected"),mxUtils.write(g,+mxResources.get("pickFolder")+"..."),n.insertBefore(g,n.firstChild));G=n.value}function k(){if("pickFolder-"==n.value.substring(0,11)){var g=n.value.substring(11);n.value=G;c(g)}else if(null!=V&&null!=H[n.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[V.value].extension){g=b.getExtensionForService(H[n.value].mode);var q=U.value;null!=g&&0>l.indexOf(".")&&0>q.indexOf(".")&&(U.value=q+g)}I.innerHTML="";mxUtils.write(I,null!=L?L:mxResources.get("download"==n.value||"_blank"==+n.value||null!=R?"ok":"save"));""==n.value?I.setAttribute("disabled","disabled"):I.removeAttribute("disabled")}var m=document.createElement("div");m.style.display="flex";m.style.flexWrap="wrap";m.style.whiteSpace="nowrap";var t=document.createElement("div");t.style.display="grid";t.style.gap="5px 8px";t.style.gridAutoRows="auto auto 44px";t.style.gridAutoColumns="0fr minmax(0,1fr)";t.style.width="100%";var u=null,A=null;if(null!=x&&null!=z&&"image/"==z.substring(0,6)&&("image/svg"!=z.substring(0,+9)||mxClient.IS_SVG)){t.style.display="inline-grid";t.style.flexBasis="75%";u=document.createElement("div");u.style.display="inline-block";u.style.height="auto";u.style.maxWidth="25%";u.style.margin="auto";var B=document.createElement("img"),D=y?x:btoa(unescape(encodeURIComponent(x))),N="data:"+z+";base64,"+D;B.setAttribute("src",N);B.style.boxSizing="border-box";B.style.maxHeight="50px";B.style.maxWidth="100%";B.style.paddingLeft="10px";u.appendChild(B);"image/png"!=z&&"image/svg+xml"!=z||"function"!==+typeof window.ClipboardItem||null==navigator.clipboard||(A=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(N,null,null,z,mxUtils.bind(this,function(){"copy"==E?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))}),mxUtils.bind(this,function(g){b.handleError(g)}))},null,"geBtn"));Editor.popupsAllowed&&(null==f||0>mxUtils.indexOf(f,"_blank"))?(u.setAttribute("title",mxResources.get("openInNewWindow")),u.style.cursor="pointer",mxEvent.addGestureListeners(u,null,null,+function(g){mxEvent.isPopupTrigger(g)||b.openInNewWindow(x,z,y)})):u.setAttribute("title",mxResources.get("preview"))}D=document.createElement("div");D.style.display="flex";D.style.padding="1px";D.style.alignItems="center";D.style.justifyContent="flex-end";D.style.gridColumn="1";D.style.whiteSpace="nowrap";var F=document.createElement("div");F.style.display="grid";F.style.padding="1px";F.style.alignItems="center";F.style.gridColumn="2";F.style.gridAutoColumns="minmax(0,1fr) auto";F.style.gap="6px";+mxUtils.write(D,mxResources.get("saveAs")+":");var U=document.createElement("input");U.setAttribute("type","text");U.setAttribute("value",l);U.style.boxSizing="border-box";U.style.width="100%";F.appendChild(U);null==R&&(t.appendChild(D),t.appendChild(F));var V=null;null!=b.editor.diagramFileTypes&&null==z&&null==R&&(D=D.cloneNode(!1),F=F.cloneNode(!1),mxUtils.write(D,mxResources.get("type")+":"),V=FilenameDialog.createFileTypes(b,U,b.editor.diagramFileTypes),V.style.boxSizing="border-box",V.style.width=+"100%",F.appendChild(V),t.appendChild(D),t.appendChild(F));D=D.cloneNode(!1);F=F.cloneNode(!1);mxUtils.write(D,mxResources.get("where")+":");var n=document.createElement("select");n.style.textOverflow="ellipsis";n.style.gridColumn="1";var v=["browser","device","download","_blank"],G=null,H={};B=mxUtils.button(mxResources.get("reset"),function(){U.value=l;U.dispatchEvent(new Event("change"));b.resetRecent("Folders");n.innerHTML="";n.value="";pickFolderOption=null;H={};d()},null,"geBtn");var I=mxUtils.button("",+function(){SaveDialog.lastValue=n.value;var g=H[SaveDialog.lastValue];null!=g&&p(U,g.mode,g.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(U,"keypress",function(g){13==g.keyCode&&("copy"==E&&null!=A?A.click():I.click())});mxEvent.addListener(n,"change",k);d();F.appendChild(n);null!=SaveDialog.lastValue&&null!=H[SaveDialog.lastValue]&&(n.value=SaveDialog.lastValue);k();t.appendChild(D);t.appendChild(F);m.appendChild(t);null!=u&&m.appendChild(u);t=document.createElement("div");t.style.flexBasis=+"100%";t.style.textAlign="right";t.style.marginTop=null!=z?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||t.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));u=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&t.appendChild(u);t.appendChild(B);"copy"==E&&null!=A?(A.className="geBtn gePrimaryBtn",I.className="geBtn",t.appendChild(I),t.appendChild(A)):(null!=A&&t.appendChild(A),t.appendChild(I));b.editor.cancelFirst||+t.appendChild(u);m.appendChild(t);this.init=function(){Editor.selectFilename(U)};this.container=m},CreateDialog=function(b,l,p,f,x,z,y,E,R,K,L,O,c,d,k,m,t){function u(n,v,G,H){function I(){mxEvent.addListener(g,"click",function(){var Q=G;if(y){var T=D.value,P=T.lastIndexOf(".");if(0>l.lastIndexOf(".")&&0>P){Q=null!=Q?Q:V.value;var S="";Q==App.MODE_GOOGLE?S=b.drive.extension:Q==App.MODE_GITHUB?S=b.gitHub.extension:Q==App.MODE_GITLAB?S=b.gitLab.extension:Q==App.MODE_TRELLO?S=b.trello.extension:Q==App.MODE_DROPBOX?+S=b.dropbox.extension:Q==App.MODE_ONEDRIVE?S=b.oneDrive.extension:Q==App.MODE_DEVICE&&(S=".drawio");0<=P&&(T=T.substring(0,P));D.value=T+S}}A(G)})}var g=document.createElement("a");g.style.overflow="hidden";var q=document.createElement("img");q.src=n;q.setAttribute("border","0");q.setAttribute("align","absmiddle");q.style.width="60px";q.style.height="60px";q.style.paddingBottom="6px";g.style.display="inline-block";g.className="geBaseButton";g.style.position="relative";g.style.margin="4px";g.style.padding=+"8px 8px 10px 8px";g.style.whiteSpace="nowrap";g.appendChild(q);g.style.color="gray";g.style.fontSize="11px";var C=document.createElement("div");g.appendChild(C);mxUtils.write(C,v);if(null!=H&&null==b[H]){q.style.visibility="hidden";mxUtils.setOpacity(C,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(g);var M=window.setTimeout(function(){null==b[H]&&(J.stop(),g.style.display=+"none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[H]&&(window.clearTimeout(M),mxUtils.setOpacity(C,100),q.style.visibility="",J.stop(),I())}))}else I();F.appendChild(g);++U==O&&(mxUtils.br(F),U=0)}function A(n){var v=D.value;if(null==n||null!=v&&0<v.length)t&&b.hideDialog(),p(v,n,D)}L="1"==urlParams.noDevice?!1:L;y=null!=y?y:!0;E=null!=E?E:!0;O=null!=O?O:4;t=null!=t?t:!0;z=document.createElement("div");z.style.whiteSpace="nowrap";null==f&&b.addLanguageMenu(z);var B=document.createElement("h2");+mxUtils.write(B,x||mxResources.get("create"));B.style.marginTop="0px";B.style.marginBottom="24px";z.appendChild(B);x=document.createElement("span");mxUtils.write(x,mxResources.get("filename")+":");x.style.maxWidth="106px";x.style.overflow="hidden";x.style.textOverflow="ellipsis";x.style.display="inline-block";z.appendChild(x);var D=document.createElement("input");D.setAttribute("value",l);D.style.width="180px";D.style.marginLeft="10px";D.style.marginBottom="20px";D.style.maxWidth="70%";this.init=+function(){Editor.selectFilename(D)};z.appendChild(D);null!=m&&null!=b.editor.diagramFileTypes&&(m=FilenameDialog.createFileTypes(b,D,b.editor.diagramFileTypes),m.style.marginLeft="6px",m.style.width="90px",z.appendChild(m));m=null;if("1"!=urlParams.noDevice&&null!=c&&null!=d&&"image/"==d.substring(0,6)&&("image/svg"!=d.substring(0,9)||mxClient.IS_SVG)){D.style.width="160px";x=document.createElement("img");var N=k?c:btoa(unescape(encodeURIComponent(c)));x.setAttribute("src","data:"+d+";base64,"+N);+x.style.position="absolute";x.style.top="70px";x.style.right="100px";x.style.maxWidth="120px";x.style.maxHeight="80px";mxUtils.setPrefixedStyle(x.style,"transform","translate(50%,-50%)");z.appendChild(x);mxClient.IS_FF||"image/png"!=d||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(m=mxUtils.button(mxResources.get("copy"),function(n){n=b.base64ToBlob(N,"image/png");n=new ClipboardItem({"image/png":n,"text/html":new Blob(['<img src="data:'+d+";base64,"+N+'">'],{type:"text/html"})});+navigator.clipboard.write([n]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(v){b.handleError(v)}))}),m.style.marginTop="6px",m.className="geBtn");R&&Editor.popupsAllowed&&(x.style.cursor="pointer",mxEvent.addGestureListeners(x,null,null,function(n){mxEvent.isPopupTrigger(n)||A("_blank")}))}mxUtils.br(z);var F=document.createElement("div");F.style.textAlign="center";var U=0;F.style.marginTop="6px";z.appendChild(F);var V=document.createElement("select");+V.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(c,mxResources.get("googleDrive")),V.appendChild(c),u(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(c,mxResources.get("oneDrive")),+V.appendChild(c),b.mode==App.MODE_ONEDRIVE&&c.setAttribute("selected","selected"),u(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),null!=b.m365&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_M365),mxUtils.write(c,mxResources.get("m365")),V.appendChild(c),b.mode==App.MODE_M365&&c.setAttribute("selected","selected"),u(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365")),"function"===typeof window.DropboxClient&&+(c=document.createElement("option"),c.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(c,mxResources.get("dropbox")),V.appendChild(c),b.mode==App.MODE_DROPBOX&&c.setAttribute("selected","selected"),u(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITHUB),mxUtils.write(c,mxResources.get("github")),V.appendChild(c),u(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),+App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITLAB),mxUtils.write(c,mxResources.get("gitlab")),V.appendChild(c),u(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_TRELLO),mxUtils.write(c,mxResources.get("trello")),V.appendChild(c),u(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,+"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)c=document.createElement("option"),c.setAttribute("value",App.MODE_DEVICE),mxUtils.write(c,mxResources.get("device")),V.appendChild(c),b.mode!=App.MODE_DEVICE&&E||c.setAttribute("selected","selected"),L&&u(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);E&&isLocalStorage&&"0"!=urlParams.browser&&(E=document.createElement("option"),E.setAttribute("value",+App.MODE_BROWSER),mxUtils.write(E,mxResources.get("browser")),V.appendChild(E),b.mode==App.MODE_BROWSER&&E.setAttribute("selected","selected"),u(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));E=document.createElement("div");E.style.marginTop="26px";E.style.textAlign="center";null!=K&&(L=mxUtils.button(mxResources.get("help"),function(){b.openLink(K)}),L.className="geBtn",E.appendChild(L));L=mxUtils.button(mxResources.get(null!=f?"close":"cancel"),function(){null!=f?f():+(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});L.className="geBtn";b.editor.cancelFirst&&null==f&&E.appendChild(L);null==f&&(c=mxUtils.button(mxResources.get("decideLater"),function(){A(null)}),c.className="geBtn",E.appendChild(c));R&&Editor.popupsAllowed&&(R=mxUtils.button(mxResources.get("openInNewWindow"),function(){A("_blank")}),R.className="geBtn",E.appendChild(R));CreateDialog.showDownloadButton&&(R=mxUtils.button(mxResources.get("download"),function(){A("download")}),+R.className="geBtn",E.appendChild(R),null!=m&&(R.style.marginTop="6px",E.style.marginTop="6px"));null!=m&&(mxUtils.br(E),E.appendChild(m));b.editor.cancelFirst&&null==f||E.appendChild(L);mxEvent.addListener(D,"keypress",function(n){13==n.keyCode?A(App.MODE_DEVICE):27==n.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});z.appendChild(E);this.container=z};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;+var PopupDialog=function(b,l,p,f,x){x=null!=x?x:!0;var z=document.createElement("div");z.style.textAlign="center";z.style.height="100%";mxUtils.write(z,mxResources.get("fileOpenLocation"));mxUtils.br(z);mxUtils.br(z);var y=mxUtils.button(mxResources.get("openInThisWindow"),function(){x&&b.hideDialog();null!=f&&f()});y.className="geBtn";y.style.marginBottom="8px";y.style.width="280px";z.appendChild(y);mxUtils.br(z);var E=mxUtils.button(mxResources.get("openInNewWindow"),function(){x&&b.hideDialog();+null!=p&&p();b.openLink(l,null,!0)});E.className="geBtn gePrimaryBtn";E.style.width=y.style.width;z.appendChild(E);mxUtils.br(z);mxUtils.br(z);mxUtils.write(z,mxResources.get("allowPopups"));this.container=z},ImageDialog=function(b,l,p,f,x,z,y,E){function R(){0<O.value.length?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");"data:"!=O.value.substring(0,5)?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}z=null!=z?z:!0;var K=b.editor.graph,L=document.createElement("div");+mxUtils.write(L,l);l=document.createElement("div");l.className="geTitle";l.style.backgroundColor="transparent";l.style.borderColor="transparent";l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";l.style.paddingRight="20px";var O=document.createElement("input");O.setAttribute("value",p);O.setAttribute("type","text");O.setAttribute("spellcheck","false");O.setAttribute("autocorrect","off");O.setAttribute("autocomplete","off");O.setAttribute("autocapitalize","off");O.style.marginTop=+"6px";O.style.width=(Graph.fileSupport?460:340)-20+"px";O.style.backgroundImage="url('"+Editor.crossImage+"')";O.style.backgroundRepeat="no-repeat";O.style.backgroundPosition="100% 50%";O.style.paddingRight="14px";p=document.createElement("div");p.setAttribute("title",mxResources.get("reset"));p.style.position="relative";p.style.left="-16px";p.style.width="12px";p.style.height="14px";p.style.cursor="pointer";p.style.display="inline-block";p.style.top="3px";p.style.background="url('"+b.editor.transparentImage++"')";mxEvent.addListener(p,"click",function(){O.value="";O.focus()});l.appendChild(O);l.appendChild(p);L.appendChild(l);var c=E,d,k,m=function(D,N,F,U){var V="data:"==D.substring(0,5);!b.isOffline()||V&&"undefined"===typeof chrome?0<D.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(D,function(n){b.spinner.stop();b.hideDialog();var v=!1===U?1:null!=N&&null!=F?Math.max(N/n.width,F/n.height):Math.min(1,Math.min(520/n.width,520/n.height));z&&(D=b.convertDataUri(D));f(D,+Math.round(Number(n.width)*v),Math.round(Number(n.height)*v),c,d,k)},function(){b.spinner.stop();f(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),f(D,null,null,c,d,k)):(D=b.convertDataUri(D),N=null==N?120:N,F=null==F?100:F,b.hideDialog(),f(D,N,F,c,d,k))},t=function(D,N){if(null!=D){var F=x?null:K.getModel().getGeometry(K.getSelectionCell());null!=F?m(D,F.width,F.height,N):m(D,null,null,N)}else b.hideDialog(),f(null)};this.init=function(){O.focus();+if(Graph.fileSupport){O.setAttribute("placeholder",mxResources.get("dragImagesHere"));var D=L.parentNode,N=null;mxEvent.addListener(D,"dragleave",function(F){null!=N&&(N.parentNode.removeChild(N),N=null);F.stopPropagation();F.preventDefault()});mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(F){null==N&&(N=b.highlightElement(D));F.stopPropagation();F.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(F){null!=N&&(N.parentNode.removeChild(N),N=null);if(0<F.dataTransfer.files.length)b.importFiles(F.dataTransfer.files,+0,0,b.maxImageSize,function(V,n,v,G,H,I,g,q){t(V,q)},function(){},function(V){return"image/"==V.type.substring(0,6)},function(V){for(var n=0;n<V.length;n++)V[n]()},!mxEvent.isControlDown(F),null,null,!0);else if(0<=mxUtils.indexOf(F.dataTransfer.types,"text/uri-list")){var U=F.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(U)&&t(decodeURIComponent(U))}F.stopPropagation();F.preventDefault()}),!1)}};E=document.createElement("div");E.style.marginTop="14px";E.style.textAlign=+"center";p=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});p.className="geBtn";b.editor.cancelFirst&&E.appendChild(p);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&&(O.value=D.url));O.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var u=document.createElement("input");u.setAttribute("multiple","multiple");u.setAttribute("type",+"file");mxEvent.addListener(u,"change",function(D){null!=u.files&&(b.importFiles(u.files,0,0,b.maxImageSize,function(N,F,U,V,n,v){t(N)},function(){},function(N){return"image/"==N.type.substring(0,6)},function(N){for(var F=0;F<N.length;F++)N[F]()},!0),u.type="",u.type="file",u.value="")});u.style.display="none";document.body.appendChild(u);b.imgDlgFileInputElt=u}l=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});l.className="geBtn";E.appendChild(l)}mxEvent.addListener(O,+"keypress",function(D){13==D.keyCode&&t(O.value)});var A=mxUtils.button(mxResources.get("crop"),function(){var D=new CropImageDialog(b,O.value,c,function(N,F,U){c=N;d=F;k=U});b.showDialog(D.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450))});y&&(A.className="geBtn",E.appendChild(A));var B=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=O.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var D=b.editor.createImageUrlConverter().convert(O.value),+N=new Image;N.onload=function(){b.editor.convertImageToDataUri(D,function(F){b.confirmImageResize(function(U){b.resizeImage(N,F,mxUtils.bind(this,function(V,n,v){b.spinner.stop();null!=V&&V.length<b.maxImageBytes?(O.value=V,R()):b.handleError({message:mxResources.get("imageTooBig")})}),U,b.maxImageSize)},N.width>b.maxImageSize||N.height>b.maxImageSize||F.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};N.onerror=function(){b.spinner.stop();+b.handleError({message:mxResources.get("fileNotFound")})};N.src=D}});B.className="geBtn";mxEvent.addListener(O,"change",function(D){c=null;R()});R();E.appendChild(B);y=mxUtils.button(mxResources.get("apply"),function(){t(O.value)});y.className="geBtn gePrimaryBtn";E.appendChild(y);b.editor.cancelFirst||E.appendChild(p);Graph.fileSupport&&(E.style.marginTop="120px",L.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",L.style.backgroundPosition="center 65%",L.style.backgroundRepeat="no-repeat",+y=document.createElement("div"),y.style.position="absolute",y.style.width="420px",y.style.top="58%",y.style.textAlign="center",y.style.fontSize="18px",y.style.color="#a0c3ff",mxUtils.write(y,mxResources.get("dragImagesHere")),L.appendChild(y));L.appendChild(E);this.container=L},LinkDialog=function(b,l,p,f,x,z,y){function E(D,N){var F=document.createElement("option");mxUtils.write(F,mxResources.get(D));F.value=D;A.appendChild(F);B[D]=N}var R=document.createElement("div");R.style.height="100%";mxUtils.write(R,mxResources.get("editLink")+":");var K=document.createElement("div");K.className="geUrlLinkContainer";K.style.backgroundColor="transparent";K.style.borderColor="transparent";K.style.whiteSpace="nowrap";K.style.textOverflow="clip";K.style.cursor="default";var L=document.createElement("input");L.setAttribute("placeholder",mxResources.get("dragUrlsHere"));L.setAttribute("type","text");L.style.marginTop="6px";L.style.width="414px";L.style.boxSizing="border-box";L.style.backgroundRepeat="no-repeat";L.style.backgroundPosition=-"100% 50%";L.style.paddingRight="16px";L.style.marginBottom="4px";var M=document.createElement("div");M.setAttribute("title",mxResources.get("reset"));M.style.backgroundImage="url("+Editor.crossImage+")";M.className="geAdaptiveAsset";M.style.display="inline-block";M.style.position="relative";M.style.top="3px";M.style.left="-16px";M.style.width="12px";M.style.height="14px";M.style.cursor="pointer";mxEvent.addListener(M,"click",function(){L.value="";L.focus()});var c=document.createElement("input");+"100% 50%";L.style.paddingRight="16px";L.style.marginBottom="4px";var O=document.createElement("div");O.setAttribute("title",mxResources.get("reset"));O.style.backgroundImage="url("+Editor.crossImage+")";O.className="geAdaptiveAsset";O.style.display="inline-block";O.style.position="relative";O.style.top="3px";O.style.left="-16px";O.style.width="12px";O.style.height="14px";O.style.cursor="pointer";mxEvent.addListener(O,"click",function(){L.value="";L.focus()});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 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 k=document.createElement("select");k.style.width="414px";var m=document.createElement("input");m.setAttribute("type","checkbox");m.style.margin=-"0 6p 0 6px";null!=y&&(m.setAttribute("checked","checked"),m.defaultChecked=!0);y=null!=y?y:"_blank";m.setAttribute("title",y);z&&(L.style.width="200px");if(x&&null!=b.pages){null!=l&&Graph.isPageLink(l)?(d.setAttribute("checked","checked"),d.defaultChecked=!0):(L.setAttribute("value",l),c.setAttribute("checked","checked"),c.defaultChecked=!0);K.appendChild(c);K.appendChild(L);K.appendChild(M);z&&(K.appendChild(m),mxUtils.write(K,mxResources.get("openInNewWindow")));mxUtils.br(K);K.appendChild(d);-x=!1;for(z=0;z<b.pages.length;z++)M=document.createElement("option"),mxUtils.write(M,b.pages[z].getName()||mxResources.get("pageWithNumber",[z+1])),M.setAttribute("value","data:page/id,"+b.pages[z].getId()),l==M.getAttribute("value")&&(M.setAttribute("selected","selected"),x=!0),k.appendChild(M);if(!x&&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");k.appendChild(t);mxEvent.addListener(k,"change",function(){null==t.parentNode||t.selected||t.parentNode.removeChild(t)})}K.appendChild(k)}else L.setAttribute("value",l),K.appendChild(L),K.appendChild(M);O.appendChild(K);var v=mxUtils.button(p,function(){b.hideDialog();f(d.checked?"pageNotFound"!==k.value?k.value:l:L.value,LinkDialog.selectedDocs,m.checked?y:null)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=function(){d.checked?k.focus():(L.focus(),mxClient.IS_GC||-mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(k,"focus",function(){c.removeAttribute("checked");d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(L,"focus",function(){d.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});if(Graph.fileSupport){var E=O.parentNode,D=null;mxEvent.addListener(E,"dragleave",function(U){null!=D&&(D.parentNode.removeChild(D),D=null);U.stopPropagation();U.preventDefault()});-mxEvent.addListener(E,"dragover",mxUtils.bind(this,function(U){null==D&&(D=b.highlightElement(E));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(E,"drop",mxUtils.bind(this,function(U){try{null!=D&&(D.parentNode.removeChild(D),D=null),0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")&&(L.value=decodeURIComponent(U.dataTransfer.getData("text/uri-list")),c.setAttribute("checked","checked"),c.checked=!0,v.click())}catch(T){b.handleError(T)}U.stopPropagation();U.preventDefault()}),-!1)}};p=document.createElement("div");p.style.marginTop="16px";p.style.textAlign="right";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));K=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});K.style.verticalAlign="middle";K.className="geBtn";b.editor.cancelFirst&&p.appendChild(K);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(E){if(E.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=E.docs;var D=E.docs[0].url;"application/mxe"==-E.docs[0].mimeType||null!=E.docs[0].mimeType&&"application/vnd.jgraph."==E.docs[0].mimeType.substring(0,23)?D="https://app.diagrams.net/#G"+E.docs[0].id:"application/vnd.google-apps.folder"==E.docs[0].mimeType&&(D="https://drive.google.com/#folders/"+E.docs[0].id);L.value=D;L.focus()}else LinkDialog.selectedDocs=null;L.focus()};var A=document.createElement("select");A.className="geBtn";A.style.position="relative";A.style.top="1px";A.style.maxWidth="120px";var C={};x=document.createElement("option");-mxUtils.write(x,mxResources.get("select")+"...");x.value="";A.appendChild(x);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&F("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 E=b.drive.createLinkPicker();b.linkPicker=E.setCallback(function(D){LinkDialog.filePicked(D)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&-"undefined"!=typeof Dropbox.choose&&F("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(E){L.value=E[0].link;L.focus()}})});null!=b.oneDrive&&F("oneDrive",function(){b.oneDrive.pickFile(function(E,D){null!=D&&null!=D.value&&0<D.value.length&&(L.value=D.value[0].webUrl,L.focus())},!0)});null!=b.gitHub&&F("github",function(){b.gitHub.pickFile(function(E){if(null!=E){E=E.split("/");var D=E[0],U=E[1],T=E[2];E=E.slice(3,E.length).join("/");L.value="https://github.com/"+-D+"/"+U+"/blob/"+T+"/"+E;L.focus()}})});null!=b.gitLab&&F("gitlab",function(){b.gitLab.pickFile(function(E){if(null!=E){E=E.split("/");var D=E[0],U=E[1],T=E[2];E=E.slice(3,E.length).join("/");L.value=DRAWIO_GITLAB_URL+"/"+D+"/"+U+"/blob/"+T+"/"+E;L.focus()}})});1<A.children.length&&(p.appendChild(A),mxEvent.addListener(A,"change",function(E){null!=C[A.value]&&(C[A.value](),A.value="")}));mxEvent.addListener(L,"keypress",function(E){13==E.keyCode&&v.click()});p.appendChild(v);b.editor.cancelFirst||-p.appendChild(K);O.appendChild(p);this.container=O},RevisionDialog=function(b,l,p){var f=document.createElement("div"),x=document.createElement("h3");x.style.marginTop="3px";mxUtils.write(x,mxResources.get("revisionHistory"));f.appendChild(x);x=document.createElement("div");x.style.position="absolute";x.style.overflow="auto";x.style.width="170px";x.style.height="378px";f.appendChild(x);var z=document.createElement("div");z.style.position="absolute";z.style.left="200px";z.style.width="470px";z.style.height=-"376px";z.style.overflow="hidden";z.style.borderWidth="1px";z.style.borderStyle="solid";var y=document.createElement("div");y.style.position="absolute";y.style.display="none";y.style.textAlign="center";y.style.padding="8px";y.style.borderRadius="8px";y.style.left="50%";y.style.top="50%";y.style.whiteSpace="nowrap";y.style.transform="translate(-50%, -50%)";y.style.background="inherit";y.style.border="1px solid";z.appendChild(y);mxEvent.disableContextMenu(z);f.appendChild(z);var F=new Graph(z);F.setTooltips(!1);-F.setEnabled(!1);F.setPanning(!0);F.panningHandler.ignoreCell=!0;F.panningHandler.useLeftButtonForPanning=!0;F.minFitScale=null;F.maxFitScale=null;F.centerZoom=!0;var O=0,K=null,L=0,M=F.getGlobalVariable;F.getGlobalVariable=function(Y){return"page"==Y&&null!=K&&null!=K[L]?K[L].getAttribute("name"):"pagenumber"==Y?L+1:"pagecount"==Y?null!=K?K.length:1:M.apply(this,arguments)};F.getLinkForCell=function(){return null};for(var c=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(),k=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),m={},t=0;t<k.length;t++)m[k[t].getAttribute("id")]=k[t];var v=null,A=null,C=null,E=null,D=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=C&&F.zoomIn()},20);D.setAttribute("disabled","disabled");var U=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),-function(){null!=C&&F.zoomOut()},20);U.setAttribute("disabled","disabled");var T=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=C&&(1==F.view.scale?(F.maxFitScale=8,F.fit(8)):F.zoomActual(),F.center())},20);T.setAttribute("disabled","disabled");var V=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));V.setAttribute("disabled","disabled");var n=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));n.setAttribute("disabled","disabled");-var u=z.cloneNode(!1);u.style.pointerEvent="none";z.parentNode.appendChild(u);var G=new Graph(u);G.setTooltips(!1);G.setEnabled(!1);G.setPanning(!0);G.panningHandler.ignoreCell=!0;G.panningHandler.useLeftButtonForPanning=!0;G.minFitScale=null;G.maxFitScale=null;G.centerZoom=!0;var H=document.createElement("div");H.style.textAlign="left";H.style.color="gray";H.style.backgroundColor="transparent";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.style.whiteSpace="nowrap";H.style.cursor="default";-H.style.height="100%";H.style.display="inline-flex";H.style.alignItems="center";H.style.flexGrow="1";mxEvent.addListener(H,"click",function(){var Y=mxUtils.getTextContent(H);""!=Y&&b.alert(Y)});var I=null;mxEvent.addGestureListeners(V,function(Y){try{var aa=null!=K[O]?m[K[O].getAttribute("id")]:null;mxUtils.setOpacity(V,20);y.innerText="";if(null==aa)y.style.display="inline-block",mxUtils.write(y,mxResources.get("pageNotFound"));else{I=H.innerHTML;H.innerHTML=mxResources.get("current");z.style.display=-"none";u.style.display="";u.style.backgroundColor=z.style.backgroundColor;var ba=Editor.parseDiagramNode(aa);(new mxCodec(ba.ownerDocument)).decode(ba,G.getModel());G.view.scaleAndTranslate(F.view.scale,F.view.translate.x,F.view.translate.y);G.mathEnabled="1"==ba.getAttribute("math");G.setAdaptiveColors(ba.getAttribute("adaptiveColors"));Editor.MathJaxRender&&G.mathEnabled&&Editor.MathJaxRender(G.container)}}catch(fa){y.style.display="inline-block",y.innerText="",mxUtils.write(y,mxResources.get("pageNotFound")+-": "+fa.message)}},null,function(){mxUtils.setOpacity(V,60);y.style.display="none";y.innerText="";"none"==z.style.display&&(z.style.display="",H.innerHTML=I,u.style.display="none")});mxEvent.addListener(n,"click",mxUtils.bind(this,function(Y){if(null!=C){Y=b.getPagesForNode(C.documentElement);var aa=b.diffPages(b.pages,Y);Y=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(aa,null,2),function(ba){try{if(0<ba.length&&b.editor.graph.isEnabled()){var fa=[JSON.parse(ba)];b.confirm(mxResources.get("areYouSure"),-function(){try{d.patch(fa,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ia){b.handleError(ia)}})}else b.hideDialog()}catch(ia){b.handleError(ia)}},null,null,null,null,function(ba,fa){if(null!=aa[EditorUi.DIFF_UPDATE]){var ia=document.createElement("select"),ea=document.createElement("option");mxUtils.write(ea,mxResources.get("allPages"));ea.setAttribute("value","allPages");ia.appendChild(ea);for(var ma in aa[EditorUi.DIFF_UPDATE]){ea=document.createElement("option");var qa=b.getPageById(ma);null!=-qa&&(mxUtils.write(ea,qa.getName()),ea.setAttribute("value","page-"+ma),ia.appendChild(ea))}ia.style.marginRight="8px";ia.style.order="-1";mxEvent.addListener(ia,"change",function(na){na=null;if("allPages"!=ia.value){var ta=ia.value.substring(5);null!=aa[EditorUi.DIFF_UPDATE][ta]&&(na={},na[EditorUi.DIFF_UPDATE]={},na[EditorUi.DIFF_UPDATE][ta]=aa[EditorUi.DIFF_UPDATE][ta])}fa.value=JSON.stringify(null==na?aa:na,null,2)});2<ia.children.length&&ba.appendChild(ia)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?-"merge":"close"));b.showDialog(Y.container,620,460,!0,!0);Y.init()}}));var g=mxUtils.button(mxResources.get("restore"),function(Y){null!=C&&null!=E&&b.confirm(mxResources.get("areYouSure"),function(){null!=p?p(E):b.spinner.spin(document.body,mxResources.get("restoring"))&&(g.setAttribute("disabled","disabled"),d.save(!0,function(aa){b.spinner.stop();g.removeAttribute("disabled");b.replaceFileData(E);b.hideDialog()},function(aa){b.spinner.stop();g.removeAttribute("disabled");b.clearStatus();b.handleError(aa,-null!=aa?mxResources.get("errorSavingFile"):null)}))})});g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");var q=document.createElement("select");q.setAttribute("disabled","disabled");q.style.userSelect="none";q.style.maxWidth="100px";q.style.marginLeft="10px";q.style.display="none";var B=null;mxEvent.addListener(q,"change",function(Y){null!=B&&(B(Y),mxEvent.consume(Y))});var J=mxUtils.button(mxResources.get("open"),function(){null!=C&&(window.openFile=new OpenFile(function(){window.openFile=-null}),window.openFile.setData(mxUtils.getXml(C.documentElement)),b.openLink(b.getUrl(),null,!0))});J.className="geBtn";J.setAttribute("disabled","disabled");var Q=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});Q.className="geBtn";Q.setAttribute("disabled","disabled");null!=p&&(J.style.display="none");k=document.createElement("div");k.style.position="absolute";k.style.top="482px";k.style.right="28px";k.style.left="32px";k.style.justifyContent="end";k.style.display=-"flex";var N=document.createElement("div");N.className="geToolbarContainer";N.style.backgroundColor="transparent";N.style.left="32px";N.style.right="32px";N.style.border="none";N.style.top="442px";var S=null;if(null!=l&&0<l.length){z.style.cursor="move";var P=document.createElement("table");P.style.borderWidth="1px";P.style.borderStyle="solid";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var R=document.createElement("tbody"),W=(new Date).toDateString();null!=-b.currentPage&&null!=b.pages&&(O=mxUtils.indexOf(b.pages,b.currentPage));for(t=l.length-1;0<=t;t--){var X=function(Y){var aa=new Date(Y.modifiedDate),ba=null;if(0<=aa.getTime()){var fa=function(ea){c.stop();y.innerText="";var ma=mxUtils.parseXml(ea),qa=b.editor.extractGraphModel(ma.documentElement,!0);if(null!=qa){var na=function(pa){null!=pa&&(pa=ta(Editor.parseDiagramNode(pa)));return pa},ta=function(pa){var ya=pa.getAttribute("background");if(null==ya||""==ya||ya==mxConstants.NONE)ya=F.defaultPageBackgroundColor;-z.style.backgroundColor=mxUtils.getLightDarkColor(ya);(new mxCodec(pa.ownerDocument)).decode(pa,F.getModel());F.maxFitScale=1;F.fit(8);F.center();F.mathEnabled="1"==pa.getAttribute("math");F.setAdaptiveColors(pa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&F.mathEnabled&&Editor.MathJaxRender(F.container);return pa};q.style.display="none";q.innerText="";C=ma;E=ea;K=parseSelectFunction=null;L=0;if("mxfile"==qa.nodeName){ma=qa.getElementsByTagName("diagram");K=[];for(ea=0;ea<ma.length;ea++)K.push(ma[ea]);-L=Math.min(O,K.length-1);0<K.length&&na(K[L]);if(1<K.length)for(q.removeAttribute("disabled"),q.style.display="",ea=0;ea<K.length;ea++){ma=document.createElement("option");ma.setAttribute("title",ra+" ("+K[ea].getAttribute("id")+")");ma.setAttribute("value",ea);var ra=K[ea].getAttribute("name")||mxResources.get("pageWithNumber",[ea+1]);qa=b.getPageById(K[ea].getAttribute("id"));var la="";if(null!=qa){var ha=new DiagramPage(K[ea]);b.getHashValueForPages([qa])!=b.getHashValueForPages([ha])&&(la=" (M)")}else la=-" (X)";mxUtils.write(ma,ra+la);ea==L&&ma.setAttribute("selected","selected");q.appendChild(ma)}B=function(){try{var pa=parseInt(q.value);L=O=pa;na(K[pa])}catch(ya){q.value=O,b.handleError(ya)}}}else ta(qa);ra=Y.lastModifyingUserName;null!=ra&&20<ra.length&&(ra=ra.substring(0,20)+"...");H.innerText="";mxUtils.write(H,(null!=ra?ra+" ":"")+aa.toLocaleDateString()+" "+aa.toLocaleTimeString());H.setAttribute("title",ba.getAttribute("title"));D.removeAttribute("disabled");U.removeAttribute("disabled");-T.removeAttribute("disabled");V.removeAttribute("disabled");n.removeAttribute("disabled");null!=d&&d.isRestricted()||(b.editor.graph.isEnabled()&&g.removeAttribute("disabled"),J.removeAttribute("disabled"),Q.removeAttribute("disabled"));mxUtils.setOpacity(D,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(T,60);mxUtils.setOpacity(V,60);mxUtils.setOpacity(n,60)}else q.style.display="none",q.innerText="",H.innerText="",y.innerText="",mxUtils.write(H,mxResources.get("errorLoadingFile")),mxUtils.write(y,-mxResources.get("errorLoadingFile"))};ba=document.createElement("tr");ba.style.borderBottomWidth="1px";ba.style.borderBottomStyle="solid";ba.style.fontSize="12px";ba.style.cursor="pointer";var ia=document.createElement("td");ia.style.padding="6px";ia.style.whiteSpace="nowrap";Y==l[l.length-1]?mxUtils.write(ia,mxResources.get("current")):aa.toDateString()===W?mxUtils.write(ia,aa.toLocaleTimeString()):mxUtils.write(ia,aa.toLocaleDateString()+" "+aa.toLocaleTimeString());ba.appendChild(ia);ba.setAttribute("title",-aa.toLocaleDateString()+" "+aa.toLocaleTimeString()+(null!=Y.fileSize?" "+b.formatFileSize(parseInt(Y.fileSize)):"")+(null!=Y.lastModifyingUserName?" "+Y.lastModifyingUserName:""));mxEvent.addListener(ba,"click",function(ea){A!=Y&&(c.stop(),null!=v&&(v.style.backgroundColor=""),A=Y,v=ba,v.style.backgroundColor="light-dark(#ebf2f9, #000000)",E=C=null,H.removeAttribute("title"),H.innerText=mxResources.get("loading")+"...",z.style.backgroundColor=F.defaultPageBackgroundColor,y.innerText="",F.getModel().clear(),-g.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),q.setAttribute("disabled","disabled"),mxUtils.setOpacity(D,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(T,20),mxUtils.setOpacity(V,20),mxUtils.setOpacity(n,20),c.spin(z),Y.getXml(function(ma){if(A==Y)try{fa(ma)}catch(qa){H.innerText=-mxResources.get("error")+": "+qa.message}},function(ma){c.stop();q.style.display="none";q.innerText="";H.innerText="";mxUtils.write(H,mxResources.get("errorLoadingFile"));mxUtils.write(y,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ea))});mxEvent.addListener(ba,"dblclick",function(ea){J.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ea)},!1);R.appendChild(ba)}return ba}(l[t]);null!=X&&t==l.length-1&&(S=X)}P.appendChild(R);-x.appendChild(P)}else null==d||null==b.drive&&d.constructor==window.DriveFile||null==b.dropbox&&d.constructor==window.DropboxFile?(z.style.display="none",N.style.display="none",mxUtils.write(x,mxResources.get("notAvailable"))):(z.style.display="none",N.style.display="none",mxUtils.write(x,mxResources.get("noRevisions")));this.init=function(){null!=S&&S.click()};x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";N.appendChild(H);N.appendChild(V);N.appendChild(U);-N.appendChild(T);N.appendChild(D);N.appendChild(q);N.appendChild(n);b.editor.cancelFirst&&k.appendChild(x);k.appendChild(J);null!=d&&d.constructor==DriveFile&&k.appendChild(Q);k.appendChild(g);b.editor.cancelFirst||k.appendChild(x);f.appendChild(k);f.appendChild(N);this.container=f},DraftDialog=function(b,l,p,f,x,z,y,F,O){var K=document.createElement("div"),L=document.createElement("div");L.style.marginTop="0px";L.style.whiteSpace="nowrap";L.style.overflow="auto";L.style.lineHeight="normal";mxUtils.write(L,-l);K.appendChild(L);var M=document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==M.value?(M.value=M.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var V=this,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){for(n=0;n<O.length;n++)x.apply(V,[n,mxUtils.bind(V,function(){})]);b.hideDialog(!0);u.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(A=mxUtils.parseXml(O[M.value].data),C=b.editor.extractGraphModel(A.documentElement,-!0),E=0,this.init())});if(null!=O){M.style.marginLeft="4px";for(l=0;l<O.length;l++){var d=document.createElement("option");d.setAttribute("value",l);var k=new Date(O[l].created),m=new Date(O[l].modified);mxUtils.write(d,k.toLocaleDateString()+" "+k.toLocaleTimeString()+" - "+(k.toDateString(),m.toDateString(),m.toLocaleDateString())+" "+m.toLocaleTimeString());M.appendChild(d)}d=document.createElement("option");d.setAttribute("value","-1");mxUtils.write(d,mxResources.get("deleteAll"));M.appendChild(d);-L.appendChild(M);mxEvent.addListener(M,"change",c)}null==p&&(p=O[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);K.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 A=mxUtils.parseXml(p),C=b.editor.extractGraphModel(A.documentElement,!0),E=0,D=null,U=v.getGlobalVariable;v.getGlobalVariable=function(V){return"page"==V&&null!=D&&null!=D[E]?D[E].getAttribute("name"):"pagenumber"==V?E+1:"pagecount"==V?null!=D?D.length:1:U.apply(this,arguments)};v.getLinkForCell=function(){return null};p=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){v.zoomIn()},20);L=b.createToolbarButton(Editor.zoomOutImage,-mxResources.get("zoomOut"),function(){v.zoomOut()},20);l=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==v.view.scale?(v.maxFitScale=8,v.fit(8)):v.zoomActual();v.center()},20);y=mxUtils.button(y||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var V=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){x.apply(V,[M.value,mxUtils.bind(V,function(){null!=M.parentNode&&(M.options[M.selectedIndex].parentNode.removeChild(M.options[M.selectedIndex]),-1<M.options.length?(M.value=M.options[0].value,c()):b.hideDialog(!0))})]);n.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});y.className="geBtn";var T=document.createElement("select");T.style.maxWidth="80px";T.style.position="relative";T.style.top="-2px";T.style.verticalAlign="bottom";T.style.marginRight="6px";T.style.display="none";z=mxUtils.button(z||mxResources.get("edit"),function(){f.apply(this,[M.value])});z.className="geBtn gePrimaryBtn";d=document.createElement("div");d.style.position=-"absolute";d.style.bottom="30px";d.style.right="40px";d.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function V(H){if(null!=H){var I=H.getAttribute("background");if(null==I||""==I||I==mxConstants.NONE)I="light-dark(#ffffff, transparent)";t.style.backgroundColor=I;(new mxCodec(H.ownerDocument)).decode(H,v.getModel());-v.maxFitScale=1;v.fit(8);v.center()}return H}function n(H){null!=H&&(H=V(Editor.parseDiagramNode(H)));return H}mxEvent.addListener(T,"change",function(H){E=parseInt(T.value);n(D[E]);mxEvent.consume(H)});if("mxfile"==C.nodeName){var u=C.getElementsByTagName("diagram");D=[];for(var G=0;G<u.length;G++)D.push(u[G]);0<D.length&&n(D[E]);T.innerText="";if(1<D.length)for(T.style.display="",G=0;G<D.length;G++)u=document.createElement("option"),mxUtils.write(u,D[G].getAttribute("name")||mxResources.get("pageWithNumber",-[G+1])),u.setAttribute("value",G),G==E&&u.setAttribute("selected","selected"),T.appendChild(u);else T.style.display="none"}else V(C)};k.appendChild(T);k.appendChild(p);k.appendChild(L);k.appendChild(l);p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});p.className="geBtn";F=null!=F?mxUtils.button(mxResources.get("ignore"),F):null;null!=F&&(F.className="geBtn");b.editor.cancelFirst?(d.appendChild(p),null!=F&&d.appendChild(F),d.appendChild(y),d.appendChild(z)):(d.appendChild(z),-d.appendChild(y),null!=F&&d.appendChild(F),d.appendChild(p));K.appendChild(d);K.appendChild(k);this.container=K},FindWindow=function(b,l,p,f,x,z){function y(B,J,Q){if("object"===typeof J.value&&null!=J.value.attributes){J=J.value.attributes;for(var N=0;N<J.length;N++)if("label"!=J[N].nodeName){var S=mxUtils.trim(J[N].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==B&&0<=S.indexOf(Q)||null!=B&&B.test(S))return!0}}return!1}function F(){d?(I.removeAttribute("disabled"),g.removeAttribute("disabled")):-(I.setAttribute("disabled","disabled"),g.setAttribute("disabled","disabled"));E.value?q.removeAttribute("disabled"):q.setAttribute("disabled","disabled")}function O(B,J,Q){G.innerText="";var N=L.model.getDescendants(L.model.getRoot()),S=E.value.toLowerCase(),P=U.checked?new RegExp(S):null,R=null;m=null;M!=S&&(M=S,c=null,k=!1);var W=null==c;if(0<S.length){if(k){k=!1;for(var X,Y=0;Y<b.pages.length;Y++)if(b.currentPage==b.pages[Y]){X=Y;break}B=(X+1)%b.pages.length;c=null;do k=!1,N=b.pages[B],L=b.createTemporaryGraph(L.getStylesheet()),-b.updatePageRoot(N),L.model.setRoot(N.root),B=(B+1)%b.pages.length;while(!O(!0,J,Q)&&B!=X);c&&(c=null,Q?b.editor.graph.model.execute(new SelectPage(b,N)):b.selectPage(N));k=!1;L=b.editor.graph;return O(!0,J,Q)}for(Y=0;Y<N.length;Y++){X=L.view.getState(N[Y]);J&&(W=W||X==c);if(null!=X&&null!=X.cell.value&&(W||null==R)&&(L.model.isVertex(X.cell)||L.model.isEdge(X.cell))){null!=X.style&&"1"==X.style.html?(V.innerHTML=L.sanitizeHtml(L.getLabel(X.cell)),label=mxUtils.extractTextWithWhitespace([V])):label=-L.getLabel(X.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var aa=0;J&&z&&X==c&&(label=label.substr(t),aa=t);var ba=null==D||""==D.value;if(null==P&&(0<=label.indexOf(S)||ba&&y(P,X.cell,S))||null!=P&&(P.test(label)||ba&&y(P,X.cell,S)))if(z&&(null!=P?(ba=label.match(P),null!=ba&&0<ba.length&&(m=ba[0].toLowerCase(),t=aa+ba.index+m.length)):(m=S,t=aa+label.indexOf(S)+m.length)),W){R=X;break}else null==R&&(R=X)}W=W||X==c}}if(null!=R){if(Y==N.length&&T.checked)return c=-null,k=!0,O(!0,J,Q);c=R;L.scrollCellToVisible(c.cell);L.isEnabled()&&!L.isCellLocked(c.cell)?Q||L.getSelectionCell()==c.cell&&1==L.getSelectionCount()||L.setSelectionCell(c.cell):L.highlightCell(c.cell)}else{if(!B&&T.checked)return k=!0,O(!0,J,Q);L.isEnabled()&&!Q&&L.clearSelection()}d=null!=R;z&&!B&&F();return 0==S.length||null!=R}var K=b.actions.get("findReplace"),L=b.editor.graph,M=null,c=null,d=!1,k=!1,m=null,t=0,v=1,A=document.createElement("div");A.style.userSelect="none";A.style.overflow="hidden";-A.style.padding="10px";A.style.height="100%";var C=z?"260px":"200px",E=document.createElement("input");E.setAttribute("placeholder",mxResources.get("find"));E.setAttribute("type","text");E.style.marginTop="4px";E.style.marginBottom="6px";E.style.width=C;E.style.fontSize="12px";E.style.borderRadius="4px";E.style.padding="6px";A.appendChild(E);mxUtils.br(A);if(z){var D=document.createElement("input");D.setAttribute("placeholder",mxResources.get("replaceWith"));D.setAttribute("type","text");D.style.marginTop=-"4px";D.style.marginBottom="6px";D.style.width=C;D.style.fontSize="12px";D.style.borderRadius="4px";D.style.padding="6px";A.appendChild(D);mxUtils.br(A);mxEvent.addListener(D,"input",F)}var U=document.createElement("input");U.setAttribute("id","geFindWinRegExChck");U.setAttribute("type","checkbox");U.style.marginRight="4px";A.appendChild(U);C=document.createElement("label");C.setAttribute("for","geFindWinRegExChck");A.appendChild(C);mxUtils.write(C,mxResources.get("regularExpression"));A.appendChild(C);-C=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");C.style.position="relative";C.style.marginLeft="6px";A.appendChild(C);mxUtils.br(A);var T=document.createElement("input");T.setAttribute("id","geFindWinAllPagesChck");T.setAttribute("type","checkbox");T.style.marginRight="4px";A.appendChild(T);C=document.createElement("label");C.setAttribute("for","geFindWinAllPagesChck");A.appendChild(C);mxUtils.write(C,mxResources.get("allPages"));A.appendChild(C);var V=document.createElement("div");-mxUtils.br(A);C=document.createElement("div");C.style.left="0px";C.style.right="0px";C.style.marginTop="6px";C.style.padding="0 6px 0 6px";A.appendChild(C);var n=mxUtils.button(mxResources.get("reset"),function(){G.innerText="";E.value="";E.style.backgroundColor="";z&&(D.value="",F());M=c=null;k=!1;E.focus()});n.setAttribute("title",mxResources.get("reset"));n.style.float="none";n.style.width="120px";n.style.marginTop="6px";n.style.marginLeft="8px";n.style.overflow="hidden";n.style.textOverflow="ellipsis";-n.className="geBtn";z||C.appendChild(n);var u=mxUtils.button(mxResources.get("find"),function(){try{E.style.backgroundColor=O()?"":"light-dark(#ffcfcf, #ff0000)"}catch(B){b.handleError(B)}});u.setAttribute("title",mxResources.get("find")+" (Enter)");u.style.float="none";u.style.width="120px";u.style.marginTop="6px";u.style.marginLeft="8px";u.style.overflow="hidden";u.style.textOverflow="ellipsis";u.className="geBtn gePrimaryBtn";C.appendChild(u);var G=document.createElement("div");G.style.marginTop=-"10px";if(z){var H=function(B,J,Q,N,S){if(null==S||"1"!=S.html)return N=B.toLowerCase().indexOf(J,N),0>N?B:B.substr(0,N)+Q+B.substr(N+J.length);var P=B;J=mxUtils.htmlEntities(J,!1,!1,!1);S=[];var R=-1;for(B=B.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<(R=B.indexOf("<",R+1));)S.push(R);R=B.match(/<[^>]*>/g);B=B.replace(/<[^>]*>/g,"");N=B.toLowerCase().indexOf(J,N);if(0>N)return P;P=N+J.length;Q=mxUtils.htmlEntities(Q);B=B.substr(0,-N)+Q+B.substr(P);for(var W=0,X=0;X<S.length;X++){if(S[X]-W<N)B=B.substr(0,S[X])+R[X]+B.substr(S[X]);else{var Y=S[X]-W<P?N+W:S[X]+(Q.length-J.length);B=B.substr(0,Y)+R[X]+B.substr(Y)}W+=R[X].length}return B.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};C.style.textAlign="center";var I=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=m&&null!=c){var B=c.cell,J=L.getLabel(B);L.isCellEditable(B)&&L.model.setValue(B,H(J,m,D.value,-t-m.length,L.getCurrentCellStyle(B)));E.style.backgroundColor=O(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(Q){b.handleError(Q)}});I.setAttribute("title",mxResources.get("replFind"));I.style.float="none";I.style.width="120px";I.style.marginTop="6px";I.style.marginLeft="8px";I.style.overflow="hidden";I.style.textOverflow="ellipsis";I.className="geBtn gePrimaryBtn";I.setAttribute("disabled","disabled");C.appendChild(I);mxUtils.br(C);var g=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=-m&&null!=c){var B=c.cell,J=L.getLabel(B);L.model.setValue(B,H(J,m,D.value,t-m.length,L.getCurrentCellStyle(B)));I.setAttribute("disabled","disabled");g.setAttribute("disabled","disabled")}}catch(Q){b.handleError(Q)}});g.setAttribute("title",mxResources.get("replace"));g.style.float="none";g.style.width="120px";g.style.marginTop="6px";g.style.marginLeft="8px";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");C.appendChild(g);-var q=mxUtils.button(mxResources.get("replaceAll"),function(){G.innerText="";M=null;var B=b.currentPage,J=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;L.getModel().beginUpdate();try{for(var Q=0,N={};O(!1,!0,!0)&&100>Q;){var S=c.cell,P=L.getLabel(S),R=N[S.id];if(R&&R.replAllMrk==v&&R.replAllPos>=t)break;N[S.id]={replAllMrk:v,replAllPos:t};L.isCellEditable(S)&&(L.model.setValue(S,H(P,m,D.value,t-m.length,L.getCurrentCellStyle(S))),Q++)}B!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,-B));mxUtils.write(G,mxResources.get("matchesRepl",[Q]))}catch(W){b.handleError(W)}finally{L.getModel().endUpdate(),b.editor.graph.setSelectionCells(J),b.editor.graph.rendering=!0}v++});q.setAttribute("title",mxResources.get("replaceAll"));q.style.float="none";q.style.width="120px";q.style.marginTop="6px";q.style.marginLeft="8px";q.style.overflow="hidden";q.style.textOverflow="ellipsis";q.className="geBtn gePrimaryBtn";q.setAttribute("disabled","disabled");C.appendChild(q);mxUtils.br(C);C.appendChild(n);-n=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));n.setAttribute("title",mxResources.get("close"));n.style.float="none";n.style.width="120px";n.style.marginTop="6px";n.style.marginLeft="8px";n.style.overflow="hidden";n.style.textOverflow="ellipsis";n.className="geBtn";C.appendChild(n);mxUtils.br(C);C.appendChild(G)}else C.style.display="flex",C.style.alignItems="center",n.style.width="",u.style.width="";mxEvent.addListener(E,"keyup",function(B){if(91==-B.keyCode||93==B.keyCode||17==B.keyCode)mxEvent.consume(B);else if(27==B.keyCode)K.funct();else if(M!=E.value.toLowerCase()||13==B.keyCode)try{E.style.backgroundColor=O()?"":"light-dark(#ffcfcf, #ff0000)"}catch(J){E.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(A,"keydown",function(B){70==B.keyCode&&b.keyHandler.isControlDown(B)&&!mxEvent.isShiftDown(B)&&(K.funct(),mxEvent.consume(B))});this.window=new mxWindow(mxResources.get("find")+(z?"/"+mxResources.get("replace"):-""),A,l,p,f,x,!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()?(E.focus(),mxClient.IS_GC||mxClient.IS_FF?E.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?T.removeAttribute("disabled"):(T.checked=!1,T.setAttribute("disabled","disabled"))):L.container.focus()}));b.installResizeHandler(this,-!1);this.doSearch=function(B){E.focus();E.value=B;u.click()}},FreehandWindow=function(b,l,p,f,x,z){var y=b.editor.graph,F=document.createElement("div");F.style.textAlign="center";F.style.userSelect="none";F.style.overflow="hidden";F.style.height="100%";if(z){var O=function(){var d=y.freehand.getStrokeColor(!0);null!=d&&d!=mxConstants.NONE&&1<d.length&&"string"===typeof d&&("default"==d?d=mxResources.get("useBlackAndWhite"):(d="#"==d.charAt(0)?d.substring(1).toUpperCase():d,d=ColorDialog.prototype.colorNames[d]),-null!=d&&L.setAttribute("title",d))},K=document.createElement("input");K.setAttribute("id","geFreehandBrush");K.setAttribute("type","checkbox");K.checked=y.freehand.isPerfectFreehandMode();K.style.margin="10px 5px 0px 10px";K.style.float="left";F.appendChild(K);y.freehand.setPerfectFreehandMode(K.checked);z=document.createElement("label");z.setAttribute("for","geFreehandBrush");z.style.float="left";z.style.marginTop="10px";F.appendChild(z);mxUtils.write(z,mxResources.get("brush"));F.appendChild(z);-var L=document.createElement("tempDiv");L.style.display="block";L.style.width="100%";L.style.height="100%";L.style.borderRadius="2px";L.style.boxSizing="border-box";L.style.border="1px solid black";L.style.backgroundColor=y.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){L.style.backgroundColor=y.freehand.getStrokeColor()});O();z=mxUtils.button("",mxUtils.bind(this,function(d){b.pickColor(y.freehand.getStrokeColor(!0),function(k){y.freehand.setStrokeColor(k);L.style.backgroundColor=-y.freehand.getStrokeColor();O()},"default");mxEvent.consume(d)}));z.style.position="absolute";z.style.boxSizing="border-box";z.style.padding="2px";z.style.top="8px";z.style.right="8px";z.style.width="28px";z.style.height="18px";z.className="geColorBtn";z.innerText="";z.appendChild(L);F.appendChild(z);z=document.createElement("img");z.setAttribute("title",mxResources.get("settings"));z.setAttribute("src",Editor.gearImage);z.className="geButton";z.style.position="absolute";z.style.boxSizing="border-box";-z.style.padding="2px";z.style.top="8px";z.style.right="38px";z.style.width="18px";z.style.height="18px";z.style.opacity="0.6";F.appendChild(z);mxEvent.addListener(z,"click",mxUtils.bind(this,function(d){d=y.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",d,function(k){!isNaN(k)&&0<k&&20>=k&&y.freehand.setSmoothing(parseInt(k))})}));mxUtils.br(F);var M=document.createElement("input");M.setAttribute("type","range");M.setAttribute("min","2");M.setAttribute("max","30");M.setAttribute("value",-y.freehand.getBrushSize());M.style.width="90%";M.style.visibility="hidden";F.appendChild(M);mxUtils.br(F);z=function(){y.freehand.setPerfectFreehandMode(K.checked);M.style.visibility=K.checked?"visible":"hidden"};mxEvent.addListener(K,"change",z);z();mxEvent.addListener(M,"change",function(){y.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){y.freehand.isDrawing()?y.freehand.stopDrawing():y.freehand.startDrawing()});c.setAttribute("title",-mxResources.get("startDrawing")+" (X)");c.style.width="90%";c.style.marginLeft="0px";c.style.position="relative";c.className="geBtn gePrimaryBtn";F.appendChild(c);this.window=new mxWindow(mxResources.get("freehand"),F,l,p,f,x,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);y.addListener("freehandStateChanged",mxUtils.bind(this,function(){c.innerText="";mxUtils.write(c,mxResources.get(y.freehand.isDrawing()?"stopDrawing":+"0 6p 0 6px";null!=y&&(m.setAttribute("checked","checked"),m.defaultChecked=!0);y=null!=y?y:"_blank";m.setAttribute("title",y);z&&(L.style.width="200px");if(x&&null!=b.pages){null!=l&&Graph.isPageLink(l)?(d.setAttribute("checked","checked"),d.defaultChecked=!0):(L.setAttribute("value",l),c.setAttribute("checked","checked"),c.defaultChecked=!0);K.appendChild(c);K.appendChild(L);K.appendChild(O);z&&(K.appendChild(m),mxUtils.write(K,mxResources.get("openInNewWindow")));mxUtils.br(K);K.appendChild(d);+x=!1;for(z=0;z<b.pages.length;z++)O=document.createElement("option"),mxUtils.write(O,b.pages[z].getName()||mxResources.get("pageWithNumber",[z+1])),O.setAttribute("value","data:page/id,"+b.pages[z].getId()),l==O.getAttribute("value")&&(O.setAttribute("selected","selected"),x=!0),k.appendChild(O);if(!x&&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");k.appendChild(t);mxEvent.addListener(k,"change",function(){null==t.parentNode||t.selected||t.parentNode.removeChild(t)})}K.appendChild(k)}else L.setAttribute("value",l),K.appendChild(L),K.appendChild(O);R.appendChild(K);var u=mxUtils.button(p,function(){b.hideDialog();f(d.checked?"pageNotFound"!==k.value?k.value:l:L.value,LinkDialog.selectedDocs,m.checked?y:null)});u.style.verticalAlign="middle";u.className="geBtn gePrimaryBtn";this.init=function(){d.checked?k.focus():(L.focus(),mxClient.IS_GC||+mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(k,"focus",function(){c.removeAttribute("checked");d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(L,"focus",function(){d.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});if(Graph.fileSupport){var D=R.parentNode,N=null;mxEvent.addListener(D,"dragleave",function(F){null!=N&&(N.parentNode.removeChild(N),N=null);F.stopPropagation();F.preventDefault()});+mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(F){null==N&&(N=b.highlightElement(D));F.stopPropagation();F.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(F){try{null!=N&&(N.parentNode.removeChild(N),N=null),0<=mxUtils.indexOf(F.dataTransfer.types,"text/uri-list")&&(L.value=decodeURIComponent(F.dataTransfer.getData("text/uri-list")),c.setAttribute("checked","checked"),c.checked=!0,u.click())}catch(U){b.handleError(U)}F.stopPropagation();F.preventDefault()}),+!1)}};p=document.createElement("div");p.style.marginTop="16px";p.style.textAlign="right";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));K=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});K.style.verticalAlign="middle";K.className="geBtn";b.editor.cancelFirst&&p.appendChild(K);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(D){if(D.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=D.docs;var N=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)?N="https://app.diagrams.net/#G"+D.docs[0].id:"application/vnd.google-apps.folder"==D.docs[0].mimeType&&(N="https://drive.google.com/#folders/"+D.docs[0].id);L.value=N;L.focus()}else LinkDialog.selectedDocs=null;L.focus()};var A=document.createElement("select");A.className="geBtn";A.style.position="relative";A.style.top="1px";A.style.maxWidth="120px";var B={};x=document.createElement("option");+mxUtils.write(x,mxResources.get("select")+"...");x.value="";A.appendChild(x);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&E("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(N){LinkDialog.filePicked(N)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&+"undefined"!=typeof Dropbox.choose&&E("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(D){L.value=D[0].link;L.focus()}})});null!=b.oneDrive&&E("oneDrive",function(){b.oneDrive.pickFile(function(D,N){null!=N&&null!=N.value&&0<N.value.length&&(L.value=N.value[0].webUrl,L.focus())},!0)});null!=b.gitHub&&E("github",function(){b.gitHub.pickFile(function(D){if(null!=D){D=D.split("/");var N=D[0],F=D[1],U=D[2];D=D.slice(3,D.length).join("/");L.value="https://github.com/"++N+"/"+F+"/blob/"+U+"/"+D;L.focus()}})});null!=b.gitLab&&E("gitlab",function(){b.gitLab.pickFile(function(D){if(null!=D){D=D.split("/");var N=D[0],F=D[1],U=D[2];D=D.slice(3,D.length).join("/");L.value=DRAWIO_GITLAB_URL+"/"+N+"/"+F+"/blob/"+U+"/"+D;L.focus()}})});1<A.children.length&&(p.appendChild(A),mxEvent.addListener(A,"change",function(D){null!=B[A.value]&&(B[A.value](),A.value="")}));mxEvent.addListener(L,"keypress",function(D){13==D.keyCode&&u.click()});p.appendChild(u);b.editor.cancelFirst||+p.appendChild(K);R.appendChild(p);this.container=R},RevisionDialog=function(b,l,p){var f=document.createElement("div"),x=document.createElement("h3");x.style.marginTop="3px";mxUtils.write(x,mxResources.get("revisionHistory"));f.appendChild(x);x=document.createElement("div");x.style.position="absolute";x.style.overflow="auto";x.style.width="170px";x.style.height="378px";f.appendChild(x);var z=document.createElement("div");z.style.position="absolute";z.style.left="200px";z.style.width="470px";z.style.height=+"376px";z.style.overflow="hidden";z.style.borderWidth="1px";z.style.borderStyle="solid";var y=document.createElement("div");y.style.position="absolute";y.style.display="none";y.style.textAlign="center";y.style.padding="8px";y.style.borderRadius="8px";y.style.left="50%";y.style.top="50%";y.style.whiteSpace="nowrap";y.style.transform="translate(-50%, -50%)";y.style.background="inherit";y.style.border="1px solid";z.appendChild(y);mxEvent.disableContextMenu(z);f.appendChild(z);var E=new Graph(z);E.setTooltips(!1);+E.setEnabled(!1);E.setPanning(!0);E.panningHandler.ignoreCell=!0;E.panningHandler.useLeftButtonForPanning=!0;E.minFitScale=null;E.maxFitScale=null;E.centerZoom=!0;var R=0,K=null,L=0,O=E.getGlobalVariable;E.getGlobalVariable=function(Y){return"page"==Y&&null!=K&&null!=K[L]?K[L].getAttribute("name"):"pagenumber"==Y?L+1:"pagecount"==Y?null!=K?K.length:1:O.apply(this,arguments)};E.getLinkForCell=function(){return null};for(var c=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(),k=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),m={},t=0;t<k.length;t++)m[k[t].getAttribute("id")]=k[t];var u=null,A=null,B=null,D=null,N=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=B&&E.zoomIn()},20);N.setAttribute("disabled","disabled");var F=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),+function(){null!=B&&E.zoomOut()},20);F.setAttribute("disabled","disabled");var U=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=B&&(1==E.view.scale?(E.maxFitScale=8,E.fit(8)):E.zoomActual(),E.center())},20);U.setAttribute("disabled","disabled");var V=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));V.setAttribute("disabled","disabled");var n=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));n.setAttribute("disabled","disabled");+var v=z.cloneNode(!1);v.style.pointerEvent="none";z.parentNode.appendChild(v);var G=new Graph(v);G.setTooltips(!1);G.setEnabled(!1);G.setPanning(!0);G.panningHandler.ignoreCell=!0;G.panningHandler.useLeftButtonForPanning=!0;G.minFitScale=null;G.maxFitScale=null;G.centerZoom=!0;var H=document.createElement("div");H.style.textAlign="left";H.style.color="gray";H.style.backgroundColor="transparent";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.style.whiteSpace="nowrap";H.style.cursor="default";+H.style.height="100%";H.style.display="inline-flex";H.style.alignItems="center";H.style.flexGrow="1";mxEvent.addListener(H,"click",function(){var Y=mxUtils.getTextContent(H);""!=Y&&b.alert(Y)});var I=null;mxEvent.addGestureListeners(V,function(Y){try{var Z=null!=K[R]?m[K[R].getAttribute("id")]:null;mxUtils.setOpacity(V,20);y.innerText="";if(null==Z)y.style.display="inline-block",mxUtils.write(y,mxResources.get("pageNotFound"));else{I=H.innerHTML;H.innerHTML=mxResources.get("current");z.style.display=+"none";v.style.display="";v.style.backgroundColor=z.style.backgroundColor;var aa=Editor.parseDiagramNode(Z);(new mxCodec(aa.ownerDocument)).decode(aa,G.getModel());G.view.scaleAndTranslate(E.view.scale,E.view.translate.x,E.view.translate.y);G.mathEnabled="1"==aa.getAttribute("math");G.setAdaptiveColors(aa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&G.mathEnabled&&Editor.MathJaxRender(G.container)}}catch(ha){y.style.display="inline-block",y.innerText="",mxUtils.write(y,mxResources.get("pageNotFound")++": "+ha.message)}},null,function(){mxUtils.setOpacity(V,60);y.style.display="none";y.innerText="";"none"==z.style.display&&(z.style.display="",H.innerHTML=I,v.style.display="none")});mxEvent.addListener(n,"click",mxUtils.bind(this,function(Y){if(null!=B){Y=b.getPagesForNode(B.documentElement);var Z=b.diffPages(b.pages,Y);Y=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(Z,null,2),function(aa){try{if(0<aa.length&&b.editor.graph.isEnabled()){var ha=[JSON.parse(aa)];b.confirm(mxResources.get("areYouSure"),+function(){try{d.patch(ha,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ja){b.handleError(ja)}})}else b.hideDialog()}catch(ja){b.handleError(ja)}},null,null,null,null,function(aa,ha){if(null!=Z[EditorUi.DIFF_UPDATE]){var ja=document.createElement("select"),fa=document.createElement("option");mxUtils.write(fa,mxResources.get("allPages"));fa.setAttribute("value","allPages");ja.appendChild(fa);for(var ma in Z[EditorUi.DIFF_UPDATE]){fa=document.createElement("option");var sa=b.getPageById(ma);null!=+sa&&(mxUtils.write(fa,sa.getName()),fa.setAttribute("value","page-"+ma),ja.appendChild(fa))}ja.style.marginRight="8px";ja.style.order="-1";mxEvent.addListener(ja,"change",function(ta){ta=null;if("allPages"!=ja.value){var ra=ja.value.substring(5);null!=Z[EditorUi.DIFF_UPDATE][ra]&&(ta={},ta[EditorUi.DIFF_UPDATE]={},ta[EditorUi.DIFF_UPDATE][ra]=Z[EditorUi.DIFF_UPDATE][ra])}ha.value=JSON.stringify(null==ta?Z:ta,null,2)});2<ja.children.length&&aa.appendChild(ja)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?+"merge":"close"));b.showDialog(Y.container,620,460,!0,!0);Y.init()}}));var g=mxUtils.button(mxResources.get("restore"),function(Y){null!=B&&null!=D&&b.confirm(mxResources.get("areYouSure"),function(){null!=p?p(D):b.spinner.spin(document.body,mxResources.get("restoring"))&&(g.setAttribute("disabled","disabled"),d.save(!0,function(Z){b.spinner.stop();g.removeAttribute("disabled");b.replaceFileData(D);b.hideDialog()},function(Z){b.spinner.stop();g.removeAttribute("disabled");b.clearStatus();b.handleError(Z,+null!=Z?mxResources.get("errorSavingFile"):null)}))})});g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");var q=document.createElement("select");q.setAttribute("disabled","disabled");q.style.userSelect="none";q.style.maxWidth="100px";q.style.marginLeft="10px";q.style.display="none";var C=null;mxEvent.addListener(q,"change",function(Y){null!=C&&(C(Y),mxEvent.consume(Y))});var J=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))});J.className="geBtn";J.setAttribute("disabled","disabled");var M=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});M.className="geBtn";M.setAttribute("disabled","disabled");null!=p&&(J.style.display="none");k=document.createElement("div");k.style.position="absolute";k.style.top="482px";k.style.right="28px";k.style.left="32px";k.style.justifyContent="end";k.style.display=+"flex";var Q=document.createElement("div");Q.className="geToolbarContainer";Q.style.backgroundColor="transparent";Q.style.left="32px";Q.style.right="32px";Q.style.border="none";Q.style.top="442px";var T=null;if(null!=l&&0<l.length){z.style.cursor="move";var P=document.createElement("table");P.style.borderWidth="1px";P.style.borderStyle="solid";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var S=document.createElement("tbody"),W=(new Date).toDateString();null!=+b.currentPage&&null!=b.pages&&(R=mxUtils.indexOf(b.pages,b.currentPage));for(t=l.length-1;0<=t;t--){var X=function(Y){var Z=new Date(Y.modifiedDate),aa=null;if(0<=Z.getTime()){var ha=function(fa){c.stop();y.innerText="";var ma=mxUtils.parseXml(fa),sa=b.editor.extractGraphModel(ma.documentElement,!0);if(null!=sa){var ta=function(oa){null!=oa&&(oa=ra(Editor.parseDiagramNode(oa)));return oa},ra=function(oa){var xa=oa.getAttribute("background");if(null==xa||""==xa||xa==mxConstants.NONE)xa=E.defaultPageBackgroundColor;+z.style.backgroundColor=mxUtils.getLightDarkColor(xa);(new mxCodec(oa.ownerDocument)).decode(oa,E.getModel());E.maxFitScale=1;E.fit(8);E.center();E.mathEnabled="1"==oa.getAttribute("math");E.setAdaptiveColors(oa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&E.mathEnabled&&Editor.MathJaxRender(E.container);return oa};q.style.display="none";q.innerText="";B=ma;D=fa;K=parseSelectFunction=null;L=0;if("mxfile"==sa.nodeName){ma=sa.getElementsByTagName("diagram");K=[];for(fa=0;fa<ma.length;fa++)K.push(ma[fa]);+L=Math.min(R,K.length-1);0<K.length&&ta(K[L]);if(1<K.length)for(q.removeAttribute("disabled"),q.style.display="",fa=0;fa<K.length;fa++){ma=document.createElement("option");ma.setAttribute("title",qa+" ("+K[fa].getAttribute("id")+")");ma.setAttribute("value",fa);var qa=K[fa].getAttribute("name")||mxResources.get("pageWithNumber",[fa+1]);sa=b.getPageById(K[fa].getAttribute("id"));var la="";if(null!=sa){var ia=new DiagramPage(K[fa]);b.getHashValueForPages([sa])!=b.getHashValueForPages([ia])&&(la=" (M)")}else la=+" (X)";mxUtils.write(ma,qa+la);fa==L&&ma.setAttribute("selected","selected");q.appendChild(ma)}C=function(){try{var oa=parseInt(q.value);L=R=oa;ta(K[oa])}catch(xa){q.value=R,b.handleError(xa)}}}else ra(sa);qa=Y.lastModifyingUserName;null!=qa&&20<qa.length&&(qa=qa.substring(0,20)+"...");H.innerText="";mxUtils.write(H,(null!=qa?qa+" ":"")+Z.toLocaleDateString()+" "+Z.toLocaleTimeString());H.setAttribute("title",aa.getAttribute("title"));N.removeAttribute("disabled");F.removeAttribute("disabled");U.removeAttribute("disabled");+V.removeAttribute("disabled");n.removeAttribute("disabled");null!=d&&d.isRestricted()||(b.editor.graph.isEnabled()&&g.removeAttribute("disabled"),J.removeAttribute("disabled"),M.removeAttribute("disabled"));mxUtils.setOpacity(N,60);mxUtils.setOpacity(F,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(V,60);mxUtils.setOpacity(n,60)}else q.style.display="none",q.innerText="",H.innerText="",y.innerText="",mxUtils.write(H,mxResources.get("errorLoadingFile")),mxUtils.write(y,mxResources.get("errorLoadingFile"))};+aa=document.createElement("tr");aa.style.borderBottomWidth="1px";aa.style.borderBottomStyle="solid";aa.style.fontSize="12px";aa.style.cursor="pointer";var ja=document.createElement("td");ja.style.padding="6px";ja.style.whiteSpace="nowrap";Y==l[l.length-1]?mxUtils.write(ja,mxResources.get("current")):Z.toDateString()===W?mxUtils.write(ja,Z.toLocaleTimeString()):mxUtils.write(ja,Z.toLocaleDateString()+" "+Z.toLocaleTimeString());aa.appendChild(ja);aa.setAttribute("title",Z.toLocaleDateString()+" "++Z.toLocaleTimeString()+(null!=Y.fileSize?" "+b.formatFileSize(parseInt(Y.fileSize)):"")+(null!=Y.lastModifyingUserName?" "+Y.lastModifyingUserName:""));mxEvent.addListener(aa,"click",function(fa){A!=Y&&(c.stop(),null!=u&&(u.style.backgroundColor=""),A=Y,u=aa,u.style.backgroundColor="light-dark(#ebf2f9, #000000)",D=B=null,H.removeAttribute("title"),H.innerText=mxResources.get("loading")+"...",z.style.backgroundColor=E.defaultPageBackgroundColor,y.innerText="",E.getModel().clear(),g.setAttribute("disabled",+"disabled"),N.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),q.setAttribute("disabled","disabled"),mxUtils.setOpacity(N,20),mxUtils.setOpacity(F,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(V,20),mxUtils.setOpacity(n,20),c.spin(z),Y.getXml(function(ma){if(A==Y)try{ha(ma)}catch(sa){H.innerText=mxResources.get("error")++": "+sa.message}},function(ma){c.stop();q.style.display="none";q.innerText="";H.innerText="";mxUtils.write(H,mxResources.get("errorLoadingFile"));mxUtils.write(y,mxResources.get("errorLoadingFile"))}),mxEvent.consume(fa))});mxEvent.addListener(aa,"dblclick",function(fa){J.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(fa)},!1);S.appendChild(aa)}return aa}(l[t]);null!=X&&t==l.length-1&&(T=X)}P.appendChild(S);x.appendChild(P)}else null==+d||null==b.drive&&d.constructor==window.DriveFile||null==b.dropbox&&d.constructor==window.DropboxFile?(z.style.display="none",Q.style.display="none",mxUtils.write(x,mxResources.get("notAvailable"))):(z.style.display="none",Q.style.display="none",mxUtils.write(x,mxResources.get("noRevisions")));this.init=function(){null!=T&&T.click()};x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";Q.appendChild(H);Q.appendChild(V);Q.appendChild(F);Q.appendChild(U);Q.appendChild(N);+Q.appendChild(q);Q.appendChild(n);b.editor.cancelFirst&&k.appendChild(x);k.appendChild(J);null!=d&&d.constructor==DriveFile&&k.appendChild(M);k.appendChild(g);b.editor.cancelFirst||k.appendChild(x);f.appendChild(k);f.appendChild(Q);this.container=f},DraftDialog=function(b,l,p,f,x,z,y,E,R){var K=document.createElement("div"),L=document.createElement("div");L.style.marginTop="0px";L.style.whiteSpace="nowrap";L.style.overflow="auto";L.style.lineHeight="normal";mxUtils.write(L,l);K.appendChild(L);var O=+document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==O.value?(O.value=O.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var V=this,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(v){for(n=0;n<R.length;n++)x.apply(V,[n,mxUtils.bind(V,function(){})]);b.hideDialog(!0);v.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(A=mxUtils.parseXml(R[O.value].data),B=b.editor.extractGraphModel(A.documentElement,!0),D=0,+this.init())});if(null!=R){O.style.marginLeft="4px";for(l=0;l<R.length;l++){var d=document.createElement("option");d.setAttribute("value",l);var k=new Date(R[l].created),m=new Date(R[l].modified);mxUtils.write(d,k.toLocaleDateString()+" "+k.toLocaleTimeString()+" - "+(k.toDateString(),m.toDateString(),m.toLocaleDateString())+" "+m.toLocaleTimeString());O.appendChild(d)}d=document.createElement("option");d.setAttribute("value","-1");mxUtils.write(d,mxResources.get("deleteAll"));O.appendChild(d);L.appendChild(O);+mxEvent.addListener(O,"change",c)}null==p&&(p=R[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);K.appendChild(t);var u=new Graph(t);u.setEnabled(!1);u.setPanning(!0);u.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";u.panningHandler.ignoreCell=!0;u.panningHandler.useLeftButtonForPanning=+!0;u.minFitScale=null;u.maxFitScale=null;u.centerZoom=!0;var A=mxUtils.parseXml(p),B=b.editor.extractGraphModel(A.documentElement,!0),D=0,N=null,F=u.getGlobalVariable;u.getGlobalVariable=function(V){return"page"==V&&null!=N&&null!=N[D]?N[D].getAttribute("name"):"pagenumber"==V?D+1:"pagecount"==V?null!=N?N.length:1:F.apply(this,arguments)};u.getLinkForCell=function(){return null};p=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){u.zoomIn()},20);L=b.createToolbarButton(Editor.zoomOutImage,+mxResources.get("zoomOut"),function(){u.zoomOut()},20);l=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==u.view.scale?(u.maxFitScale=8,u.fit(8)):u.zoomActual();u.center()},20);y=mxUtils.button(y||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var V=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){x.apply(V,[O.value,mxUtils.bind(V,function(){null!=O.parentNode&&(O.options[O.selectedIndex].parentNode.removeChild(O.options[O.selectedIndex]),+1<O.options.length?(O.value=O.options[0].value,c()):b.hideDialog(!0))})]);n.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});y.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";z=mxUtils.button(z||mxResources.get("edit"),function(){f.apply(this,[O.value])});z.className="geBtn gePrimaryBtn";d=document.createElement("div");d.style.position=+"absolute";d.style.bottom="30px";d.style.right="40px";d.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function V(H){if(null!=H){var I=H.getAttribute("background");if(null==I||""==I||I==mxConstants.NONE)I="light-dark(#ffffff, transparent)";t.style.backgroundColor=I;(new mxCodec(H.ownerDocument)).decode(H,u.getModel());+u.maxFitScale=1;u.fit(8);u.center()}return H}function n(H){null!=H&&(H=V(Editor.parseDiagramNode(H)));return H}mxEvent.addListener(U,"change",function(H){D=parseInt(U.value);n(N[D]);mxEvent.consume(H)});if("mxfile"==B.nodeName){var v=B.getElementsByTagName("diagram");N=[];for(var G=0;G<v.length;G++)N.push(v[G]);0<N.length&&n(N[D]);U.innerText="";if(1<N.length)for(U.style.display="",G=0;G<N.length;G++)v=document.createElement("option"),mxUtils.write(v,N[G].getAttribute("name")||mxResources.get("pageWithNumber",+[G+1])),v.setAttribute("value",G),G==D&&v.setAttribute("selected","selected"),U.appendChild(v);else U.style.display="none"}else V(B)};k.appendChild(U);k.appendChild(p);k.appendChild(L);k.appendChild(l);p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});p.className="geBtn";E=null!=E?mxUtils.button(mxResources.get("ignore"),E):null;null!=E&&(E.className="geBtn");b.editor.cancelFirst?(d.appendChild(p),null!=E&&d.appendChild(E),d.appendChild(y),d.appendChild(z)):(d.appendChild(z),+d.appendChild(y),null!=E&&d.appendChild(E),d.appendChild(p));K.appendChild(d);K.appendChild(k);this.container=K},FindWindow=function(b,l,p,f,x,z){function y(C,J,M){if("object"===typeof J.value&&null!=J.value.attributes){J=J.value.attributes;for(var Q=0;Q<J.length;Q++)if("label"!=J[Q].nodeName){var T=mxUtils.trim(J[Q].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==C&&0<=T.indexOf(M)||null!=C&&C.test(T))return!0}}return!1}function E(){d?(I.removeAttribute("disabled"),g.removeAttribute("disabled")):+(I.setAttribute("disabled","disabled"),g.setAttribute("disabled","disabled"));D.value?q.removeAttribute("disabled"):q.setAttribute("disabled","disabled")}function R(C,J,M){G.innerText="";var Q=L.model.getDescendants(L.model.getRoot()),T=D.value.toLowerCase(),P=F.checked?new RegExp(T):null,S=null;m=null;O!=T&&(O=T,c=null,k=!1);var W=null==c;if(0<T.length){if(k){k=!1;for(var X,Y=0;Y<b.pages.length;Y++)if(b.currentPage==b.pages[Y]){X=Y;break}C=(X+1)%b.pages.length;c=null;do k=!1,Q=b.pages[C],L=b.createTemporaryGraph(L.getStylesheet()),+b.updatePageRoot(Q),L.model.setRoot(Q.root),C=(C+1)%b.pages.length;while(!R(!0,J,M)&&C!=X);c&&(c=null,M?b.editor.graph.model.execute(new SelectPage(b,Q)):b.selectPage(Q));k=!1;L=b.editor.graph;return R(!0,J,M)}for(Y=0;Y<Q.length;Y++){X=L.view.getState(Q[Y]);J&&(W=W||X==c);if(null!=X&&null!=X.cell.value&&(W||null==S)&&(L.model.isVertex(X.cell)||L.model.isEdge(X.cell))){null!=X.style&&"1"==X.style.html?(V.innerHTML=L.sanitizeHtml(L.getLabel(X.cell)),label=mxUtils.extractTextWithWhitespace([V])):label=+L.getLabel(X.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Z=0;J&&z&&X==c&&(label=label.substr(t),Z=t);var aa=null==N||""==N.value;if(null==P&&(0<=label.indexOf(T)||aa&&y(P,X.cell,T))||null!=P&&(P.test(label)||aa&&y(P,X.cell,T)))if(z&&(null!=P?(aa=label.match(P),null!=aa&&0<aa.length&&(m=aa[0].toLowerCase(),t=Z+aa.index+m.length)):(m=T,t=Z+label.indexOf(T)+m.length)),W){S=X;break}else null==S&&(S=X)}W=W||X==c}}if(null!=S){if(Y==Q.length&&U.checked)return c=+null,k=!0,R(!0,J,M);c=S;L.scrollCellToVisible(c.cell);L.isEnabled()&&!L.isCellLocked(c.cell)?M||L.getSelectionCell()==c.cell&&1==L.getSelectionCount()||L.setSelectionCell(c.cell):L.highlightCell(c.cell)}else{if(!C&&U.checked)return k=!0,R(!0,J,M);L.isEnabled()&&!M&&L.clearSelection()}d=null!=S;z&&!C&&E();return 0==T.length||null!=S}var K=b.actions.get("findReplace"),L=b.editor.graph,O=null,c=null,d=!1,k=!1,m=null,t=0,u=1,A=document.createElement("div");A.style.userSelect="none";A.style.overflow="hidden";+A.style.padding="10px";A.style.height="100%";var B=z?"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=B;D.style.fontSize="12px";D.style.borderRadius="4px";D.style.padding="6px";A.appendChild(D);mxUtils.br(A);if(z){var N=document.createElement("input");N.setAttribute("placeholder",mxResources.get("replaceWith"));N.setAttribute("type","text");N.style.marginTop=+"4px";N.style.marginBottom="6px";N.style.width=B;N.style.fontSize="12px";N.style.borderRadius="4px";N.style.padding="6px";A.appendChild(N);mxUtils.br(A);mxEvent.addListener(N,"input",E)}var F=document.createElement("input");F.setAttribute("id","geFindWinRegExChck");F.setAttribute("type","checkbox");F.style.marginRight="4px";A.appendChild(F);B=document.createElement("label");B.setAttribute("for","geFindWinRegExChck");A.appendChild(B);mxUtils.write(B,mxResources.get("regularExpression"));A.appendChild(B);+B=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");B.style.position="relative";B.style.marginLeft="6px";A.appendChild(B);mxUtils.br(A);var U=document.createElement("input");U.setAttribute("id","geFindWinAllPagesChck");U.setAttribute("type","checkbox");U.style.marginRight="4px";A.appendChild(U);B=document.createElement("label");B.setAttribute("for","geFindWinAllPagesChck");A.appendChild(B);mxUtils.write(B,mxResources.get("allPages"));A.appendChild(B);var V=document.createElement("div");+mxUtils.br(A);B=document.createElement("div");B.style.left="0px";B.style.right="0px";B.style.marginTop="6px";B.style.padding="0 6px 0 6px";A.appendChild(B);var n=mxUtils.button(mxResources.get("reset"),function(){G.innerText="";D.value="";D.style.backgroundColor="";z&&(N.value="",E());O=c=null;k=!1;D.focus()});n.setAttribute("title",mxResources.get("reset"));n.style.float="none";n.style.width="120px";n.style.marginTop="6px";n.style.marginLeft="8px";n.style.overflow="hidden";n.style.textOverflow="ellipsis";+n.className="geBtn";z||B.appendChild(n);var v=mxUtils.button(mxResources.get("find"),function(){try{D.style.backgroundColor=R()?"":"light-dark(#ffcfcf, #ff0000)"}catch(C){b.handleError(C)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.float="none";v.style.width="120px";v.style.marginTop="6px";v.style.marginLeft="8px";v.style.overflow="hidden";v.style.textOverflow="ellipsis";v.className="geBtn gePrimaryBtn";B.appendChild(v);var G=document.createElement("div");G.style.marginTop=+"10px";if(z){var H=function(C,J,M,Q,T){if(null==T||"1"!=T.html)return Q=C.toLowerCase().indexOf(J,Q),0>Q?C:C.substr(0,Q)+M+C.substr(Q+J.length);var P=C;J=mxUtils.htmlEntities(J,!1,!1,!1);T=[];var S=-1;for(C=C.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=C.indexOf("<",S+1));)T.push(S);S=C.match(/<[^>]*>/g);C=C.replace(/<[^>]*>/g,"");Q=C.toLowerCase().indexOf(J,Q);if(0>Q)return P;P=Q+J.length;M=mxUtils.htmlEntities(M);C=C.substr(0,+Q)+M+C.substr(P);for(var W=0,X=0;X<T.length;X++){if(T[X]-W<Q)C=C.substr(0,T[X])+S[X]+C.substr(T[X]);else{var Y=T[X]-W<P?Q+W:T[X]+(M.length-J.length);C=C.substr(0,Y)+S[X]+C.substr(Y)}W+=S[X].length}return C.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};B.style.textAlign="center";var I=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=m&&null!=c){var C=c.cell,J=L.getLabel(C);L.isCellEditable(C)&&L.model.setValue(C,H(J,m,N.value,+t-m.length,L.getCurrentCellStyle(C)));D.style.backgroundColor=R(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(M){b.handleError(M)}});I.setAttribute("title",mxResources.get("replFind"));I.style.float="none";I.style.width="120px";I.style.marginTop="6px";I.style.marginLeft="8px";I.style.overflow="hidden";I.style.textOverflow="ellipsis";I.className="geBtn gePrimaryBtn";I.setAttribute("disabled","disabled");B.appendChild(I);mxUtils.br(B);var g=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=+m&&null!=c){var C=c.cell,J=L.getLabel(C);L.model.setValue(C,H(J,m,N.value,t-m.length,L.getCurrentCellStyle(C)));I.setAttribute("disabled","disabled");g.setAttribute("disabled","disabled")}}catch(M){b.handleError(M)}});g.setAttribute("title",mxResources.get("replace"));g.style.float="none";g.style.width="120px";g.style.marginTop="6px";g.style.marginLeft="8px";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");B.appendChild(g);+var q=mxUtils.button(mxResources.get("replaceAll"),function(){G.innerText="";O=null;var C=b.currentPage,J=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;L.getModel().beginUpdate();try{for(var M=0,Q={};R(!1,!0,!0)&&100>M;){var T=c.cell,P=L.getLabel(T),S=Q[T.id];if(S&&S.replAllMrk==u&&S.replAllPos>=t)break;Q[T.id]={replAllMrk:u,replAllPos:t};L.isCellEditable(T)&&(L.model.setValue(T,H(P,m,N.value,t-m.length,L.getCurrentCellStyle(T))),M++)}C!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,+C));mxUtils.write(G,mxResources.get("matchesRepl",[M]))}catch(W){b.handleError(W)}finally{L.getModel().endUpdate(),b.editor.graph.setSelectionCells(J),b.editor.graph.rendering=!0}u++});q.setAttribute("title",mxResources.get("replaceAll"));q.style.float="none";q.style.width="120px";q.style.marginTop="6px";q.style.marginLeft="8px";q.style.overflow="hidden";q.style.textOverflow="ellipsis";q.className="geBtn gePrimaryBtn";q.setAttribute("disabled","disabled");B.appendChild(q);mxUtils.br(B);B.appendChild(n);+n=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));n.setAttribute("title",mxResources.get("close"));n.style.float="none";n.style.width="120px";n.style.marginTop="6px";n.style.marginLeft="8px";n.style.overflow="hidden";n.style.textOverflow="ellipsis";n.className="geBtn";B.appendChild(n);mxUtils.br(B);B.appendChild(G)}else B.style.display="flex",B.style.alignItems="center",n.style.width="",v.style.width="";mxEvent.addListener(D,"keyup",function(C){if(91==+C.keyCode||93==C.keyCode||17==C.keyCode)mxEvent.consume(C);else if(27==C.keyCode)K.funct();else if(O!=D.value.toLowerCase()||13==C.keyCode)try{D.style.backgroundColor=R()?"":"light-dark(#ffcfcf, #ff0000)"}catch(J){D.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(A,"keydown",function(C){70==C.keyCode&&b.keyHandler.isControlDown(C)&&!mxEvent.isShiftDown(C)&&(K.funct(),mxEvent.consume(C))});this.window=new mxWindow(mxResources.get("find")+(z?"/"+mxResources.get("replace"):+""),A,l,p,f,x,!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?D.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?U.removeAttribute("disabled"):(U.checked=!1,U.setAttribute("disabled","disabled"))):L.container.focus()}));b.installResizeHandler(this,+!1);this.doSearch=function(C){D.focus();D.value=C;v.click()}},FreehandWindow=function(b,l,p,f,x,z){var y=b.editor.graph,E=document.createElement("div");E.style.textAlign="center";E.style.userSelect="none";E.style.overflow="hidden";E.style.height="100%";if(z){var R=function(){var d=y.freehand.getStrokeColor(!0);null!=d&&d!=mxConstants.NONE&&1<d.length&&"string"===typeof d&&("default"==d?d=mxResources.get("useBlackAndWhite"):(d="#"==d.charAt(0)?d.substring(1).toUpperCase():d,d=ColorDialog.prototype.colorNames[d]),+null!=d&&L.setAttribute("title",d))},K=document.createElement("input");K.setAttribute("id","geFreehandBrush");K.setAttribute("type","checkbox");K.checked=y.freehand.isPerfectFreehandMode();K.style.margin="10px 5px 0px 10px";K.style.float="left";E.appendChild(K);y.freehand.setPerfectFreehandMode(K.checked);z=document.createElement("label");z.setAttribute("for","geFreehandBrush");z.style.float="left";z.style.marginTop="10px";E.appendChild(z);mxUtils.write(z,mxResources.get("brush"));E.appendChild(z);+var L=document.createElement("tempDiv");L.style.display="block";L.style.width="100%";L.style.height="100%";L.style.borderRadius="2px";L.style.boxSizing="border-box";L.style.border="1px solid black";L.style.backgroundColor=y.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){L.style.backgroundColor=y.freehand.getStrokeColor()});R();z=mxUtils.button("",mxUtils.bind(this,function(d){b.pickColor(y.freehand.getStrokeColor(!0),function(k){y.freehand.setStrokeColor(k);L.style.backgroundColor=+y.freehand.getStrokeColor();R()},"default");mxEvent.consume(d)}));z.style.position="absolute";z.style.boxSizing="border-box";z.style.padding="2px";z.style.top="8px";z.style.right="8px";z.style.width="28px";z.style.height="18px";z.className="geColorBtn";z.innerText="";z.appendChild(L);E.appendChild(z);z=document.createElement("img");z.setAttribute("title",mxResources.get("settings"));z.setAttribute("src",Editor.gearImage);z.className="geButton";z.style.position="absolute";z.style.boxSizing="border-box";+z.style.padding="2px";z.style.top="8px";z.style.right="38px";z.style.width="18px";z.style.height="18px";z.style.opacity="0.6";E.appendChild(z);mxEvent.addListener(z,"click",mxUtils.bind(this,function(d){d=y.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",d,function(k){!isNaN(k)&&0<k&&20>=k&&y.freehand.setSmoothing(parseInt(k))})}));mxUtils.br(E);var O=document.createElement("input");O.setAttribute("type","range");O.setAttribute("min","2");O.setAttribute("max","30");O.setAttribute("value",+y.freehand.getBrushSize());O.style.width="90%";O.style.visibility="hidden";E.appendChild(O);mxUtils.br(E);z=function(){y.freehand.setPerfectFreehandMode(K.checked);O.style.visibility=K.checked?"visible":"hidden"};mxEvent.addListener(K,"change",z);z();mxEvent.addListener(O,"change",function(){y.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){y.freehand.isDrawing()?y.freehand.stopDrawing():y.freehand.startDrawing()});c.setAttribute("title",+mxResources.get("startDrawing")+" (X)");c.style.width="90%";c.style.marginLeft="0px";c.style.position="relative";c.className="geBtn gePrimaryBtn";E.appendChild(c);this.window=new mxWindow(mxResources.get("freehand"),E,l,p,f,x,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);y.addListener("freehandStateChanged",mxUtils.bind(this,function(){c.innerText="";mxUtils.write(c,mxResources.get(y.freehand.isDrawing()?"stopDrawing":"startDrawing"));var d=document.createElement("span");d.className="geShortcutKey";d.style.margin="0 2px 4px 0";mxUtils.write(d,"X");c.appendChild(d);c.setAttribute("title",mxResources.get(y.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");c.className="geBtn"+(y.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){y.freehand.isDrawing()&&y.freehand.stopDrawing()}));-b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,l,p,f,x){var z=b.editor.graph,y=document.createElement("div");y.style.userSelect="none";y.style.overflow="hidden";y.style.height="100%";var F=document.createElement("div");F.style.display="flex";F.style.alignItems="center";F.style.justifyContent="center";F.style.paddingTop="20px";var O=document.createElement("input");O.setAttribute("type","checkbox");O.style.marginRight="4px";O.checked=!0;var K=document.createElement("input");K.setAttribute("type",-"checkbox");K.style.marginRight="4px";K.checked=!0;var L=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(z.isSelectionEmpty()?z.getVerticesAndEdges():z.getSelectionCells(),O.checked,K.checked)}));L.setAttribute("title","Convert Colors");L.className="geBtn gePrimaryBtn";F.appendChild(L);y.appendChild(F);F=F.cloneNode(!1);F.appendChild(K);F.style.paddingTop="8px";mxUtils.write(F,mxResources.get("background"));y.appendChild(F);-F=F.cloneNode(!1);F.appendChild(O);F.style.paddingTop="8px";mxUtils.write(F,mxResources.get("labels"));y.appendChild(F);this.window=new mxWindow(mxResources.get("adaptiveColors"),y,l,p,f,x,!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,l,p,f,x){function z(){n||-(u=m.value,G());D.style.display="createPublic"==m.value?"none":""}function y(){n=!0;m.value=u;L.isSelectionEmpty()?(A.setAttribute("disabled","disabled"),"selectionOnly"==m.value&&(m.value="includeCopyOfMyDiagram")):A.removeAttribute("disabled");b.isDiagramEmpty()?(v.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==m.value&&(m.value="help")):v.removeAttribute("disabled");n=!1}function F(H){var I=document.createElement("div");I.style.textAlign="left";I.style.padding="6px";I.style.margin=-"6px 0";mxUtils.write(I,H);c.appendChild(I);return I}function O(H){function I(ra){var la=document.createElement("div");la.style.display="flex";var ha=document.createElement("img");ha.className="geAdaptiveAsset geLibraryButton";ha.setAttribute("src",Editor.refreshImage);ha.setAttribute("title",null!=ra?ra:mxResources.get("tryAgain"));la.appendChild(ha);mxEvent.addListener(ha,"click",ta);return la}function g(ra){var la=document.createElement("div");la.style.whiteSpace="pre-wrap";la.style.overflow="auto";-la.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(ra,!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return la}function q(ra){var la=mxResources.get("error")+": ",ha=document.createElement("div");ha.style.whiteSpace=-"pre-wrap";ra.substring(0,la.length)!=la&&(ra=la+ra);mxUtils.write(ha,ra);ha.appendChild(I());return ha}var B=[],J=F(H);B.push(J);J.style.marginBottom="2px";J.style.marginLeft="40%";J.style.borderRadius="10px";J.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";var Q=document.createElement("div");Q.className="geInlineButtons";Q.style.display="flex";Q.style.justifyContent="end";B.push(Q);var N=document.createElement("img");N.className="geAdaptiveAsset geLibraryButton";N.setAttribute("src",Editor.trashImage);-N.setAttribute("title",mxResources.get("remove"));Q.appendChild(N);mxEvent.addListener(N,"click",mxUtils.bind(this,function(ra){if(mxEvent.isShiftDown(ra))c.innerHTML="";else{for(ra=0;ra<B.length;ra++)null!=B[ra].parentNode&&B[ra].parentNode.removeChild(B[ra]);B=[]}}));N=N.cloneNode();N.setAttribute("src",Editor.copyImage);N.setAttribute("title",mxResources.get("copy"));mxEvent.addListener(N,"click",mxUtils.bind(this,function(){b.writeTextToClipboard(H,mxUtils.bind(this,function(ra){b.handleError(ra)}),-function(){b.alert(mxResources.get("copiedToClipboard"))})}));Q.appendChild(N);N=N.cloneNode();N.setAttribute("src",Editor.editImage);N.setAttribute("title",mxResources.get("edit"));Q.appendChild(N);mxEvent.addListener(N,"click",mxUtils.bind(this,function(){V.value=H;V.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?V.select():document.execCommand("selectAll",!1,null)}));c.appendChild(Q);var S=F("");S.className="geSidebar";S.style.marginTop="2px";var P=mxUtils.bind(this,function(ra){S.innerHTML=-"";S.appendChild(q(ra.message));S.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",ra);null!=window.console&&console.error(ra)}),R=b.currentPage,W=D.value,X=m.value,Y=null;for(Q=0;Q<Editor.aiModels.length;Q++)if(N=Editor.aiModels[Q],N.name==W){Y=N;break}if("createPublic"==X||null!=Y&&null!=Editor.aiConfigs[Y.config]){var aa=null!=Y?Editor.aiConfigs[Y.config]:null,ba=null,fa=Date.now(),ia=null,ea=null;if("includeCopyOfMyDiagram"==-X||"selectionOnly"==X)Q=new mxCodec(mxUtils.createXmlDocument()),"selectionOnly"==X&&(Q.isObjectIgnored=function(ra){return ra.constructor==mxCell&&!L.model.isRoot(ra)&&!L.model.isLayer(ra)&&!L.isCellSelected(ra)&&!L.isAncestorSelected(ra)}),ea=Q.encode(L.getModel()),ea.ownerDocument.appendChild(ea),ia=mxUtils.getXml(ea);var ma=function(ra){var la=null;"prompt"==ra?la=H:"data"==ra&&null!=ea?la=ia:"model"==ra?la=Y.model:"apiKey"==ra?ra=aa.apiKey:"action"==ra&&(ra="selectionOnly"==X||"includeCopyOfMyDiagram"==-X?"update":X);null==la&&(la=Editor.replacePlaceholders(Editor.aiGlobals[ra],ma));return la},qa=function(ra,la){null==la&&(la=new ra.constructor);for(var ha in ra){var pa=ra[ha];la[ha]="object"===typeof pa?qa(pa):"string"===typeof pa?Editor.replacePlaceholders(pa,ma):pa}return la},na=null!=aa?qa(aa.request):null,ta=mxUtils.bind(this,function(){S.innerHTML="";B.push(S);var ra=document.createElement("div");ra.style.display="flex";ra.style.alignItems="center";mxUtils.write(ra,mxResources.get("loading")+-"...");var la=document.createElement("img");la.className="geAdaptiveAsset";la.setAttribute("src",Editor.svgSpinImage);la.style.width="16px";la.style.height="16px";la.style.marginLeft="6px";ra.appendChild(la);S.appendChild(ra);S.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});var ha=mxUtils.bind(this,function(pa,ya){var za=Date.now()-fa;EditorUi.debug("EditorUi.ChatWindow.handleResponse","data",pa,"prompt",[ya],"time",za);var xa=null;if(null!=pa&&1<pa.length&&0<pa[1].length)try{xa=-b.stringToCells(pa[1])}catch(Ca){throw Error(Ca.toString()+"\n\n"+pa[1]);}if(null!=xa&&0<xa.length){var Z=L.getBoundingBoxFromGeometry(xa);b.sidebar.graph.moveCells(xa,-Z.x,-Z.y);var oa=mxUtils.bind(this,function(Ca){null!=b.sidebar&&b.sidebar.hideTooltip();if(null!=ea&&null==ba){var Ia=new mxCodec(ea.ownerDocument);ba=new mxGraphModel;Ia.decode(ea,ba)}L.model.beginUpdate();try{if(null!=ba&&null!=R&&null!=b.getPageIndex(R)){b.selectPage(R);var Ba=mxUtils.parseXml(pa[1]),da=new mxCodec(Ba),ca=new mxGraphModel;-da.decode(Ba.documentElement,ca);var ua=b.diffCells(ba.root,ca.root);b.patchPage(R,ua,null,!0);EditorUi.debug("EditorUi.ChatWindow.handleResponse","sentModel",ba,"receivedModel",ca,"patch",ua)}else{var ja=L.getFreeInsertPoint();L.setSelectionCells(L.importCells(xa,ja.x,ja.y));EditorUi.debug("EditorUi.ChatWindow.handleResponse","cells",L.getSelectionCell())}}finally{L.model.endUpdate()}L.scrollCellToVisible(L.getSelectionCell());mxEvent.consume(Ca)});S.innerHTML="";J=S;0<pa[0].length&&J.appendChild(g(pa[0]));-if(0<pa[1].length){var ka=b.getSvgForXml(pa[1]);ka.style.overflow="visible";ka.style.padding="1px";ka.style.cursor="move";ka.style.width="160px";ka.style.height="auto";ka.style.maxHeight="460px";var sa=document.createElement("a");sa.className="geItem";sa.style.padding="4px";sa.style.borderRadius="10px";sa.appendChild(ka);J.appendChild(sa);b.sidebar.createItem(xa,ya,!0,!0,Z.width,Z.height,!0,!0,oa,null,null,null,null,null,sa);T||"createPublic"==X||1!=urlParams.test||sa.setAttribute("title",W+" ("+-za+" ms)");za=document.createElement("div");za.style.display="flex";Z=document.createElement("img");Z.className="geAdaptiveAsset geLibraryButton";Z.setAttribute("src",Editor.refreshImage);Z.setAttribute("title",mxResources.get("refresh"));za.appendChild(Z);mxEvent.addListener(Z,"click",ta);"draw.io"==b.getServiceName()&&(Z=Z.cloneNode(),Z.setAttribute("src",Editor.shareImage),Z.setAttribute("title",mxResources.get(b.isStandaloneApp()?"export":"openInNewWindow")),za.appendChild(Z),mxEvent.addListener(Z,-"click",mxUtils.bind(this,function(Ca){b.isStandaloneApp()?b.saveData("export.xml","xml",pa[1],"text/xml"):b.editor.editAsNew(pa[1])})));Z=Z.cloneNode();Z.setAttribute("src",Editor.magnifyImage);Z.setAttribute("title",mxResources.get("preview"));za.appendChild(Z);mxEvent.addListener(Z,"click",mxUtils.bind(this,function(Ca){b.sidebar.createTooltip(J,xa,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||-document.body.clientHeight)-120,1200),ya,!0,new mxPoint(mxEvent.getClientX(Ca),mxEvent.getClientY(Ca)),!0,function(){wasVisible=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},!0,!1)}));Z=Z.cloneNode();null!=ea&&null!=R&&null!=b.getPageIndex(R)?(Z.setAttribute("src",Editor.checkImage),Z.setAttribute("title",mxResources.get("apply"))):(Z.setAttribute("src",Editor.plusImage),Z.setAttribute("title",mxResources.get("insert")));za.appendChild(Z);mxEvent.addListener(Z,"click",oa);J.appendChild(za)}0<-pa[2].length&&J.appendChild(g(pa[2]))}else S.innerHTML="",J=S,S.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),null==pa?mxUtils.write(J,mxResources.get("errShowingDiag")):(J.style.whiteSpace="pre-wrap",J.appendChild(g(pa[0])),J.appendChild(g(pa[2])),J.appendChild(I(mxResources.get("refresh"))));J.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});T||"createPublic"==X?b.generateOpenAiMermaidDiagram(H,function(pa){ha(["",pa,""],H)},P,!0):b.createTimeout(b.editor.generateTimeout,-mxUtils.bind(this,function(pa){var ya=mxUtils.bind(this,function(Z){pa.clear();P(Z)}),za=Editor.replacePlaceholders(aa.endpoint,ma),xa=new mxXmlRequest(za,JSON.stringify(na),"POST");xa.setRequestHeaders=mxUtils.bind(this,function(Z,oa){Z.setRequestHeader("Content-Type","application/json");for(var ka in aa.requestHeaders)Z.setRequestHeader(ka,Editor.replacePlaceholders(aa.requestHeaders[ka],ma))});EditorUi.debug("EditorUi.ChatWindow.addMessage send","url",za,"params",na,"aiModel",Y,"config",aa);xa.send(mxUtils.bind(this,-function(Z){if(pa.clear())try{if(200<=Z.getStatus()&&299>=Z.getStatus()){var oa=JSON.parse(Z.getText()),ka=Editor.executeSimpleJsonPath(oa,aa.responsePath),sa=mxUtils.trim(0<ka.length?ka[0]:Z.getText()),Ca=b.extractMermaidDeclaration(sa);EditorUi.debug("EditorUi.ChatWindow.addMessage response","params",na,"response",oa,"text",[sa],"mermaid",[Ca]);null==Ca?ha(Editor.extractGraphModelFromText(sa),H):b.parseMermaidDiagram(Ca,null,mxUtils.bind(this,function(Ba){ha(["",Ba,""],H)}),mxUtils.bind(this,function(Ba){ya(Ba)}),-null,!0)}else{ka="Error: "+Z.getStatus();try{var Ia=JSON.parse(Z.getText());null!=Ia&&null!=Ia.error&&null!=Ia.error.message&&(ka=Ia.error.message)}catch(Ba){}S.innerHTML="";mxUtils.write(S,ka);S.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(Ba){ya(Ba)}}),ya)}),function(pa){S.innerHTML="";S.appendChild(q(pa.message));S.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.addMessage","error",pa)})});ta()}else P({message:mxResources.get("invalidCallFnNotFound",-[W])})}function K(){if(""!=mxUtils.trim(V.value))try{O(V.value),V.value=""}catch(H){EditorUi.debug("EditorUi.ChatWindow.send","error",H)}}var L=b.editor.graph,M=document.createElement("div");M.style.display="flex";M.style.flexDirection="column";M.style.overflow="hidden";M.style.height="100%";M.style.padding="10px 12px 20px 12px";M.style.boxSizing="border-box";mxEvent.addGestureListeners(M,mxUtils.bind(this,function(H){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null);var c=document.createElement("div");-c.style.flexGrow="1";c.style.overflow="auto";c.style.fontSize="12px";c.style.marginRight="-8px";c.style.paddingRight="8px";mxEvent.addListener(c,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});M.appendChild(c);var d=document.createElement("div");d.style.borderRadius="20px";d.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";d.style.padding="8px";d.style.marginTop="8px";var k=document.createElement("div");k.style.display="flex";k.style.gap="6px";k.style.paddingRight="8px";k.style.justifyContent=-"start";var m=document.createElement("select");m.style.borderColor="transparent";m.style.textOverflow="ellipsis";m.style.padding="5px";m.style.minWidth="0";var t=document.createElement("option");"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&0<=mxUtils.indexOf(Editor.aiActions,"createPublic")&&(t.setAttribute("value","createPublic"),mxUtils.write(t,mxResources.get("create")+" ("+mxResources.get("draw.io")+")"),m.appendChild(t));var v=document.createElement("option"),A=document.createElement("option"),-C=document.createElement("option"),E=document.createElement("option");"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&0<=mxUtils.indexOf(Editor.aiActions,"create")&&(C.setAttribute("value","create"),mxUtils.write(C,mxResources.get("create")),m.appendChild(C));0<=mxUtils.indexOf(Editor.aiActions,"update")&&(v.setAttribute("value","includeCopyOfMyDiagram"),mxUtils.write(v,mxResources.get("includeCopyOfMyDiagram")),m.appendChild(v),A.setAttribute("value","selectionOnly"),mxUtils.write(A,-mxResources.get("selectionOnly")),m.appendChild(A));0<=mxUtils.indexOf(Editor.aiActions,"assist")&&(E.setAttribute("value","assist"),mxUtils.write(E,mxResources.get("help")),m.appendChild(E));var D=m.cloneNode(!1);for(C=0;C<Editor.aiModels.length;C++)if(E=Editor.aiModels[C],Editor.aiConfigs[E.config]&&null!=Editor.aiGlobals[Editor.aiConfigs[E.config].apiKey]){var U=document.createElement("option");U.setAttribute("value",E.name);mxUtils.write(U,E.name);D.appendChild(U)}var T=0==D.children.length;C=-document.createElement("div");C.style.whiteSpace="nowrap";C.style.textOverflow="clip";C.style.cursor="default";var V=document.createElement("input");V.setAttribute("type","text");V.style.width="100%";V.style.outline="none";V.style.border="none";V.style.background="transparent";V.style.padding="6px 30px 6px 10px";V.style.boxSizing="border-box";C.appendChild(V);E=document.createElement("img");E.setAttribute("src",Editor.sendImage);E.setAttribute("title",mxResources.get("sendMessage"));E.className="geAdaptiveAsset";-E.style.position="relative";E.style.cursor="pointer";E.style.opacity="0.5";E.style.height="19px";E.style.left="-28px";E.style.top="5px";C.appendChild(E);d.appendChild(C);T||(1!=urlParams.test&&t.parentNode.removeChild(t),k.appendChild(m),1<D.children.length&&k.appendChild(D),d.appendChild(k));0<m.children.length&&(m.value=m.children[0].value);var n=!1,u=m.value,G=function(){V.setAttribute("placeholder",mxResources.get("create"==m.value||"createPublic"==m.value?"describeYourDiagram":"askMeAnything"))};-G();mxEvent.addListener(m,"change",z);z();L.selectionModel.addListener(mxEvent.CHANGE,y);L.getModel().addListener(mxEvent.CHANGE,y);y();M.appendChild(d);mxEvent.addListener(E,"click",K);mxEvent.addListener(V,"keydown",function(H){13!=H.keyCode||mxEvent.isShiftDown(H)||K()});this.generate=mxUtils.bind(this,function(H){V.value=H;K()});this.window=new mxWindow(mxResources.get("generate"),M,l,p,f,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,120,100);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);+b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,l,p,f,x){var z=b.editor.graph,y=document.createElement("div");y.style.userSelect="none";y.style.overflow="hidden";y.style.height="100%";var E=document.createElement("div");E.style.display="flex";E.style.alignItems="center";E.style.justifyContent="center";E.style.paddingTop="20px";var R=document.createElement("input");R.setAttribute("type","checkbox");R.style.marginRight="4px";R.checked=!0;var K=document.createElement("input");K.setAttribute("type",+"checkbox");K.style.marginRight="4px";K.checked=!0;var L=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(z.isSelectionEmpty()?z.getVerticesAndEdges():z.getSelectionCells(),R.checked,K.checked)}));L.setAttribute("title","Convert Colors");L.className="geBtn gePrimaryBtn";E.appendChild(L);y.appendChild(E);E=E.cloneNode(!1);E.appendChild(K);E.style.paddingTop="8px";mxUtils.write(E,mxResources.get("background"));y.appendChild(E);+E=E.cloneNode(!1);E.appendChild(R);E.style.paddingTop="8px";mxUtils.write(E,mxResources.get("labels"));y.appendChild(E);this.window=new mxWindow(mxResources.get("adaptiveColors"),y,l,p,f,x,!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,l,p,f,x){function z(){n||+(v=m.value,G());N.style.display="createPublic"==m.value?"none":""}function y(){n=!0;m.value=v;L.isSelectionEmpty()?(A.setAttribute("disabled","disabled"),"selectionOnly"==m.value&&(m.value="includeCopyOfMyDiagram")):A.removeAttribute("disabled");b.isDiagramEmpty()?(u.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==m.value&&(m.value="help")):u.removeAttribute("disabled");n=!1}function E(H){var I=document.createElement("div");I.style.textAlign="left";I.style.padding="6px";I.style.margin=+"6px 0";mxUtils.write(I,H);c.appendChild(I);return I}function R(H){function I(qa){var la=document.createElement("div");la.style.display="flex";var ia=document.createElement("img");ia.className="geAdaptiveAsset geLibraryButton";ia.setAttribute("src",Editor.refreshImage);ia.setAttribute("title",null!=qa?qa:mxResources.get("tryAgain"));la.appendChild(ia);mxEvent.addListener(ia,"click",ra);return la}function g(qa){var la=document.createElement("div");la.style.whiteSpace="pre-wrap";la.style.overflow="auto";+la.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(qa,!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return la}function q(qa){var la=mxResources.get("error")+": ",ia=document.createElement("div");ia.style.whiteSpace=+"pre-wrap";qa.substring(0,la.length)!=la&&(qa=la+qa);mxUtils.write(ia,qa);ia.appendChild(I());return ia}var C=[],J=E(H);C.push(J);J.style.marginBottom="2px";J.style.marginLeft="40%";J.style.borderRadius="10px";J.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";var M=document.createElement("div");M.className="geInlineButtons";M.style.display="flex";M.style.justifyContent="end";C.push(M);var Q=document.createElement("img");Q.className="geAdaptiveAsset geLibraryButton";Q.setAttribute("src",Editor.trashImage);+Q.setAttribute("title",mxResources.get("remove"));M.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(qa){if(mxEvent.isShiftDown(qa))c.innerHTML="";else{for(qa=0;qa<C.length;qa++)null!=C[qa].parentNode&&C[qa].parentNode.removeChild(C[qa]);C=[]}}));Q=Q.cloneNode();Q.setAttribute("src",Editor.copyImage);Q.setAttribute("title",mxResources.get("copy"));mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){b.writeTextToClipboard(H,mxUtils.bind(this,function(qa){b.handleError(qa)}),+function(){b.alert(mxResources.get("copiedToClipboard"))})}));M.appendChild(Q);Q=Q.cloneNode();Q.setAttribute("src",Editor.editImage);Q.setAttribute("title",mxResources.get("edit"));M.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){V.value=H;V.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?V.select():document.execCommand("selectAll",!1,null)}));c.appendChild(M);var T=E("");T.className="geSidebar";T.style.marginTop="2px";var P=mxUtils.bind(this,function(qa){T.innerHTML=+"";T.appendChild(q(qa.message));T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",qa);null!=window.console&&console.error(qa)}),S=b.currentPage,W=N.value,X=m.value,Y=null;for(M=0;M<Editor.aiModels.length;M++)if(Q=Editor.aiModels[M],Q.name==W){Y=Q;break}if("createPublic"==X||null!=Y&&null!=Editor.aiConfigs[Y.config]){var Z=null!=Y?Editor.aiConfigs[Y.config]:null,aa=null,ha=Date.now(),ja=null,fa=null;if("includeCopyOfMyDiagram"==+X||"selectionOnly"==X)M=new mxCodec(mxUtils.createXmlDocument()),"selectionOnly"==X&&(M.isObjectIgnored=function(qa){return qa.constructor==mxCell&&!L.model.isRoot(qa)&&!L.model.isLayer(qa)&&!L.isCellSelected(qa)&&!L.isAncestorSelected(qa)}),fa=M.encode(L.getModel()),fa.ownerDocument.appendChild(fa),ja=mxUtils.getXml(fa);var ma=function(qa){var la=null;"prompt"==qa?la=H:"data"==qa&&null!=fa?la=ja:"model"==qa?la=Y.model:"apiKey"==qa?qa=Z.apiKey:"action"==qa&&(qa="selectionOnly"==X||"includeCopyOfMyDiagram"==+X?"update":X);null==la&&(la=Editor.replacePlaceholders(Editor.aiGlobals[qa],ma));return la},sa=function(qa,la){null==la&&(la=new qa.constructor);for(var ia in qa){var oa=qa[ia];la[ia]="object"===typeof oa?sa(oa):"string"===typeof oa?Editor.replacePlaceholders(oa,ma):oa}return la},ta=null!=Z?sa(Z.request):null,ra=mxUtils.bind(this,function(){T.innerHTML="";C.push(T);var qa=document.createElement("div");qa.style.display="flex";qa.style.alignItems="center";mxUtils.write(qa,mxResources.get("loading")++"...");var la=document.createElement("img");la.className="geAdaptiveAsset";la.setAttribute("src",Editor.svgSpinImage);la.style.width="16px";la.style.height="16px";la.style.marginLeft="6px";qa.appendChild(la);T.appendChild(qa);T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});var ia=mxUtils.bind(this,function(oa,xa){var Aa=Date.now()-ha;EditorUi.debug("EditorUi.ChatWindow.handleResponse","data",oa,"prompt",[xa],"time",Aa);var wa=null;if(null!=oa&&1<oa.length&&0<oa[1].length)try{wa=+b.stringToCells(oa[1])}catch(na){throw Error(na.toString()+"\n\n"+oa[1]);}if(null!=wa&&0<wa.length){var ea=L.getBoundingBoxFromGeometry(wa);b.sidebar.graph.moveCells(wa,-ea.x,-ea.y);var Da=mxUtils.bind(this,function(na){null!=b.sidebar&&b.sidebar.hideTooltip();if(null!=fa&&null==aa){var Ca=new mxCodec(fa.ownerDocument);aa=new mxGraphModel;Ca.decode(fa,aa)}L.model.beginUpdate();try{if(null!=aa&&null!=S&&null!=b.getPageIndex(S)){b.selectPage(S);var za=mxUtils.parseXml(oa[1]),ca=new mxCodec(za),da=new mxGraphModel;+ca.decode(za.documentElement,da);var ua=b.diffCells(aa.root,da.root);b.patchPage(S,ua,null,!0);EditorUi.debug("EditorUi.ChatWindow.handleResponse","sentModel",aa,"receivedModel",da,"patch",ua)}else{var ka=L.getFreeInsertPoint();L.setSelectionCells(L.importCells(wa,ka.x,ka.y));EditorUi.debug("EditorUi.ChatWindow.handleResponse","cells",L.getSelectionCell())}}finally{L.model.endUpdate()}L.scrollCellToVisible(L.getSelectionCell());mxEvent.consume(na)});T.innerHTML="";J=T;0<oa[0].length&&J.appendChild(g(oa[0]));+if(0<oa[1].length){var pa=b.getSvgForXml(oa[1]);pa.style.overflow="visible";pa.style.padding="1px";pa.style.cursor="move";pa.style.width="160px";pa.style.height="auto";pa.style.maxHeight="460px";var ba=document.createElement("a");ba.className="geItem";ba.style.padding="4px";ba.style.borderRadius="10px";ba.appendChild(pa);J.appendChild(ba);b.sidebar.createItem(wa,xa,!0,!0,ea.width,ea.height,!0,!0,Da,null,null,null,null,null,ba);U||"createPublic"==X||1!=urlParams.test||ba.setAttribute("title",W+" ("++Aa+" ms)");Aa=document.createElement("div");Aa.style.display="flex";ea=document.createElement("img");ea.className="geAdaptiveAsset geLibraryButton";ea.setAttribute("src",Editor.refreshImage);ea.setAttribute("title",mxResources.get("refresh"));Aa.appendChild(ea);mxEvent.addListener(ea,"click",ra);"draw.io"==b.getServiceName()&&(ea=ea.cloneNode(),ea.setAttribute("src",Editor.shareImage),ea.setAttribute("title",mxResources.get(b.isStandaloneApp()?"export":"openInNewWindow")),Aa.appendChild(ea),mxEvent.addListener(ea,+"click",mxUtils.bind(this,function(na){b.isStandaloneApp()?b.saveData("export.xml","xml",oa[1],"text/xml"):b.editor.editAsNew(oa[1])})));ea=ea.cloneNode();ea.setAttribute("src",Editor.magnifyImage);ea.setAttribute("title",mxResources.get("preview"));Aa.appendChild(ea);mxEvent.addListener(ea,"click",mxUtils.bind(this,function(na){b.sidebar.createTooltip(J,wa,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||+document.body.clientHeight)-120,1200),xa,!0,new mxPoint(mxEvent.getClientX(na),mxEvent.getClientY(na)),!0,function(){wasVisible=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},!0,!1)}));ea=ea.cloneNode();null!=fa&&null!=S&&null!=b.getPageIndex(S)?(ea.setAttribute("src",Editor.checkImage),ea.setAttribute("title",mxResources.get("apply"))):(ea.setAttribute("src",Editor.plusImage),ea.setAttribute("title",mxResources.get("insert")));Aa.appendChild(ea);mxEvent.addListener(ea,"click",+Da);J.appendChild(Aa)}0<oa[2].length&&J.appendChild(g(oa[2]))}else T.innerHTML="",J=T,T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}),null==oa?mxUtils.write(J,mxResources.get("errShowingDiag")):(J.style.whiteSpace="pre-wrap",J.appendChild(g(oa[0])),J.appendChild(g(oa[2])),J.appendChild(I(mxResources.get("refresh"))));J.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});U||"createPublic"==X?b.generateOpenAiMermaidDiagram(H,function(oa){ia(["",oa,""],H)},P,!0):b.createTimeout(b.editor.generateTimeout,+mxUtils.bind(this,function(oa){var xa=mxUtils.bind(this,function(ea){oa.clear();P(ea)}),Aa=Editor.replacePlaceholders(Z.endpoint,ma),wa=new mxXmlRequest(Aa,JSON.stringify(ta),"POST");wa.setRequestHeaders=mxUtils.bind(this,function(ea,Da){ea.setRequestHeader("Content-Type","application/json");for(var pa in Z.requestHeaders)ea.setRequestHeader(pa,Editor.replacePlaceholders(Z.requestHeaders[pa],ma))});EditorUi.debug("EditorUi.ChatWindow.addMessage send","url",Aa,"params",ta,"aiModel",Y,"config",Z);wa.send(mxUtils.bind(this,+function(ea){if(oa.clear())try{if(200<=ea.getStatus()&&299>=ea.getStatus()){var Da=JSON.parse(ea.getText()),pa=Editor.executeSimpleJsonPath(Da,Z.responsePath),ba=mxUtils.trim(0<pa.length?pa[0]:ea.getText()),na=b.extractMermaidDeclaration(ba);EditorUi.debug("EditorUi.ChatWindow.addMessage response","params",ta,"response",Da,"text",[ba],"mermaid",[na]);null==na?ia(Editor.extractGraphModelFromText(ba),H):b.parseMermaidDiagram(na,null,mxUtils.bind(this,function(za){ia(["",za,""],H)}),mxUtils.bind(this,+function(za){xa(za)}),null,!0)}else{pa="Error: "+ea.getStatus();try{var Ca=JSON.parse(ea.getText());null!=Ca&&null!=Ca.error&&null!=Ca.error.message&&(pa=Ca.error.message)}catch(za){}T.innerHTML="";mxUtils.write(T,pa);T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(za){xa(za)}}),xa)}),function(oa){T.innerHTML="";T.appendChild(q(oa.message));T.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.addMessage","error",oa)})});ra()}else P({message:mxResources.get("invalidCallFnNotFound",+[W])})}function K(){if(""!=mxUtils.trim(V.value))try{R(V.value),V.value=""}catch(H){EditorUi.debug("EditorUi.ChatWindow.send","error",H)}}var L=b.editor.graph,O=document.createElement("div");O.style.display="flex";O.style.flexDirection="column";O.style.overflow="hidden";O.style.height="100%";O.style.padding="10px 12px 20px 12px";O.style.boxSizing="border-box";mxEvent.addGestureListeners(O,mxUtils.bind(this,function(H){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null);var c=document.createElement("div");+c.style.flexGrow="1";c.style.overflow="auto";c.style.fontSize="12px";c.style.marginRight="-8px";c.style.paddingRight="8px";mxEvent.addListener(c,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});O.appendChild(c);var d=document.createElement("div");d.style.borderRadius="20px";d.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";d.style.padding="8px";d.style.marginTop="8px";var k=document.createElement("div");k.style.display="flex";k.style.gap="6px";k.style.paddingRight="8px";k.style.justifyContent=+"start";var m=document.createElement("select");m.style.borderColor="transparent";m.style.textOverflow="ellipsis";m.style.padding="5px";m.style.minWidth="0";var t=document.createElement("option");"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&0<=mxUtils.indexOf(Editor.aiActions,"createPublic")&&(t.setAttribute("value","createPublic"),mxUtils.write(t,mxResources.get("create")+" ("+mxResources.get("draw.io")+")"),m.appendChild(t));var u=document.createElement("option"),A=document.createElement("option"),+B=document.createElement("option"),D=document.createElement("option");"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&0<=mxUtils.indexOf(Editor.aiActions,"create")&&(B.setAttribute("value","create"),mxUtils.write(B,mxResources.get("create")),m.appendChild(B));0<=mxUtils.indexOf(Editor.aiActions,"update")&&(u.setAttribute("value","includeCopyOfMyDiagram"),mxUtils.write(u,mxResources.get("includeCopyOfMyDiagram")),m.appendChild(u),A.setAttribute("value","selectionOnly"),mxUtils.write(A,+mxResources.get("selectionOnly")),m.appendChild(A));0<=mxUtils.indexOf(Editor.aiActions,"assist")&&(D.setAttribute("value","assist"),mxUtils.write(D,mxResources.get("help")),m.appendChild(D));var N=m.cloneNode(!1);for(B=0;B<Editor.aiModels.length;B++)if(D=Editor.aiModels[B],Editor.aiConfigs[D.config]&&null!=Editor.aiGlobals[Editor.aiConfigs[D.config].apiKey]){var F=document.createElement("option");F.setAttribute("value",D.name);mxUtils.write(F,D.name);N.appendChild(F)}var U=0==N.children.length;B=+document.createElement("div");B.style.whiteSpace="nowrap";B.style.textOverflow="clip";B.style.cursor="default";var V=document.createElement("input");V.setAttribute("type","text");V.style.width="100%";V.style.outline="none";V.style.border="none";V.style.background="transparent";V.style.padding="6px 30px 6px 10px";V.style.boxSizing="border-box";B.appendChild(V);D=document.createElement("img");D.setAttribute("src",Editor.sendImage);D.setAttribute("title",mxResources.get("sendMessage"));D.className="geAdaptiveAsset";+D.style.position="relative";D.style.cursor="pointer";D.style.opacity="0.5";D.style.height="19px";D.style.left="-28px";D.style.top="5px";B.appendChild(D);d.appendChild(B);U||(1!=urlParams.test&&t.parentNode.removeChild(t),k.appendChild(m),1<N.children.length&&k.appendChild(N),d.appendChild(k));0<m.children.length&&(m.value=m.children[0].value);var n=!1,v=m.value,G=function(){V.setAttribute("placeholder",mxResources.get("create"==m.value||"createPublic"==m.value?"describeYourDiagram":"askMeAnything"))};+G();mxEvent.addListener(m,"change",z);z();L.selectionModel.addListener(mxEvent.CHANGE,y);L.getModel().addListener(mxEvent.CHANGE,y);y();O.appendChild(d);mxEvent.addListener(D,"click",K);mxEvent.addListener(V,"keydown",function(H){13!=H.keyCode||mxEvent.isShiftDown(H)||K()});this.generate=mxUtils.bind(this,function(H){V.value=H;K()});this.window=new mxWindow(mxResources.get("generate"),O,l,p,f,x,!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);b.isOffline()||(l=b.createHelpIcon("https://www.drawio.com/doc/faq/configure-ai-options"),l.style.cursor="help",l.style.opacity="0.5",this.window.buttons.insertBefore(l,this.window.buttons.firstChild));this.window.addListener(mxEvent.DESTROY,mxUtils.bind(this,function(){L.getModel().removeListener(y)}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();V.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,-l,p,f,x){var z=b.editor.graph,y=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)y=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var F=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(O,K){if(z.isEnabled()){var L=new FilenameDialog(b,"",mxResources.get("add"),function(M){b.hideDialog();if(null!=M&&0<M.length){M=M.split(" ");for(var c=[],d=[],k=0;k<M.length;k++){var m=mxUtils.trim(M[k]);""!=m&&(d.push(m),0>mxUtils.indexOf(O,-m)&&c.push(m))}z.isSelectionEmpty()?K(O.concat(c)):z.addTagsForCells(z.getSelectionCells(),d)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(L.container,320,80,!0,!0);L.init()}},y);y=F.div;this.window=new mxWindow(mxResources.get("tags"),y,l,p,f,x,!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(){F.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AuthDialog=function(b,l,p,f){var x=document.createElement("div");x.style.textAlign="center";var z=document.createElement("p");z.style.fontSize="16pt";z.style.padding="0px";z.style.margin="0px";z.style.color="gray";mxUtils.write(z,mxResources.get("authorizationRequired"));var y="Unknown",F=document.createElement("img");F.setAttribute("border","0");F.setAttribute("align","absmiddle");F.style.marginRight="10px";-l==b.drive?(y=mxResources.get("googleDrive"),F.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(y=mxResources.get("dropbox"),F.src=IMAGE_PATH+"/dropbox-logo-white.svg"):l==b.oneDrive?(y=mxResources.get("oneDrive"),F.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(y=mxResources.get("github"),F.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(y=mxResources.get("gitlab"),F.src=IMAGE_PATH+"/gitlab-logo.svg",F.style.width="32px"):l==b.trello?(y=mxResources.get("trello"),F.src=-IMAGE_PATH+"/trello-logo-white.svg"):l==b.m365&&(y=mxResources.get("m365"),F.src=IMAGE_PATH+"/onedrive-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[y]));var O=document.createElement("input");O.setAttribute("type","checkbox");y=mxUtils.button(mxResources.get("authorize"),function(){f(O.checked)});y.insertBefore(F,y.firstChild);y.style.marginTop="6px";y.className="geBigButton";y.style.fontSize="18px";y.style.padding="14px";x.appendChild(z);x.appendChild(b);-x.appendChild(y);p&&(p=document.createElement("p"),p.style.marginTop="20px",p.appendChild(O),z=document.createElement("span"),mxUtils.write(z," "+mxResources.get("rememberMe")),p.appendChild(z),x.appendChild(p),O.checked=!0,O.defaultChecked=!0,mxEvent.addListener(z,"click",function(K){O.checked=!O.checked;mxEvent.consume(K)}));this.container=x},MoreShapesDialog=function(b,l,p){p=null!=p?p:b.sidebar.entries;var f=document.createElement("div"),x=[];if(null!=b.sidebar.customEntries)for(var z=0;z<b.sidebar.customEntries.length;z++){for(var y=-b.sidebar.customEntries[z]||{},F={title:b.getResource(y.title),entries:[]},O=0;null!=y.entries&&O<y.entries.length;O++){var K=y.entries[O];F.entries.push({id:K.id,title:b.getResource(K.title),desc:b.getResource(K.desc),image:K.preview})}0<F.entries.length&&x.push(F)}for(z=0;z<p.length;z++)if(null==b.sidebar.enabledLibraries)x.push(p[z]);else{F={title:p[z].title,entries:[]};for(O=0;O<p[z].entries.length;O++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,p[z].entries[O].id)&&F.entries.push(p[z].entries[O]);-0<F.entries.length&&x.push(F)}p=x;if(l){z=mxUtils.bind(this,function(U){for(var T=0;T<U.length;T++)(function(V){var n=k.cloneNode(!1);n.style.fontWeight="bold";n.style.backgroundColor="light-dark(#e5e5e5, #505759)";n.style.padding="6px 0px 6px 20px";mxUtils.write(n,V.title);L.appendChild(n);for(var u=0;u<V.entries.length;u++)(function(G){var H=k.cloneNode(!1);H.style.cursor="pointer";H.style.padding="4px 0px 4px 20px";H.style.whiteSpace="nowrap";H.style.overflow="hidden";H.style.textOverflow="ellipsis";-H.setAttribute("title",G.title+" ("+G.id+")");var I=document.createElement("input");I.setAttribute("type","checkbox");I.checked=b.sidebar.isEntryVisible(G.id);I.defaultChecked=I.checked;H.appendChild(I);mxUtils.write(H," "+G.title);L.appendChild(H);var g=function(q){if(null==q||"INPUT"!=mxEvent.getSource(q).nodeName){M.style.textAlign="center";M.style.padding="0px";M.style.color="";M.innerText="";if(null!=G.desc){var B=document.createElement("pre");B.style.boxSizing="border-box";B.style.fontFamily=-"inherit";B.style.margin="20px";B.style.right="0px";B.style.textAlign="left";mxUtils.write(B,G.desc);M.appendChild(B)}null!=G.imageCallback?G.imageCallback(M):null!=G.image?(B=document.createElement("img"),B.setAttribute("border","0"),B.style.maxWidth="100%",B.setAttribute("src",G.image),M.appendChild(B)):null==G.desc&&(M.style.padding="20px",M.style.color="rgb(179, 179, 179)",mxUtils.write(M,mxResources.get("noPreview")));null!=c&&(c.style.backgroundColor="");c=H;c.style.backgroundColor="light-dark(#ebf2f9, #000000)";-null!=q&&mxEvent.consume(q)}};mxEvent.addListener(H,"click",g);mxEvent.addListener(H,"dblclick",function(q){I.checked=!I.checked;mxEvent.consume(q)});d.push(function(){return I.checked?G.id:null});0==T&&0==u&&g()})(V.entries[u])})(U[T])});O=document.createElement("div");O.className="geDialogTitle";mxUtils.write(O,mxResources.get("shapes"));O.style.position="absolute";O.style.top="0px";O.style.left="0px";O.style.lineHeight="40px";O.style.height="40px";O.style.right="0px";var L=document.createElement("div"),-M=document.createElement("div");L.style.position="absolute";L.style.top="40px";L.style.left="0px";L.style.width="202px";L.style.bottom="60px";L.style.overflow="auto";M.style.position="absolute";M.style.left="202px";M.style.right="0px";M.style.top="40px";M.style.bottom="60px";M.style.overflow="auto";M.style.borderLeftStyle="solid";M.style.borderLeftWidth="1px";M.style.textAlign="center";var c=null,d=[],k=document.createElement("div");k.style.position="relative";k.style.left="0px";k.style.right="0px";-z(p);f.style.padding="30px";f.appendChild(O);f.appendChild(L);f.appendChild(M);p=document.createElement("div");p.className="geDialogFooter";p.style.position="absolute";p.style.paddingRight="16px";p.style.left="0px";p.style.right="0px";p.style.bottom="0px";p.style.height="60px";p.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;p.appendChild(m);z=-document.createElement("span");mxUtils.write(z," "+mxResources.get("labels"));z.style.paddingRight="20px";p.appendChild(z);mxEvent.addListener(z,"click",function(U){m.checked=!m.checked;mxEvent.consume(U)});var t=document.createElement("input");t.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)z=document.createElement("span"),z.style.paddingRight="20px",z.appendChild(t),mxUtils.write(z," "+mxResources.get("rememberThisSetting")),t.style.position="relative",t.style.top="1px",-t.checked=!0,t.defaultChecked=!0,mxEvent.addListener(z,"click",function(U){mxEvent.getSource(U)!=t&&(t.checked=!t.checked,mxEvent.consume(U))}),p.appendChild(z);z=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});z.className="geBtn";O=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var U=[],T=0;T<d.length;T++){var V=d[T].apply(this,arguments);null!=V&&U.push(V)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||-(T=mxUtils.indexOf(U,".scratchpad"),null!=b.scratchpad!=(0<=T&&0<U.splice(T,1).length)&&b.toggleScratchpad(),T=mxUtils.indexOf(U,"search"),mxSettings.settings.search=0<=T&&0<U.splice(T,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),t.checked&&mxSettings.save());b.sidebar.showEntries(U.join(";"),t.checked,!0);b.setSidebarTitles(m.checked,t.checked)});O.className="geBtn gePrimaryBtn"}else{var v=document.createElement("table");z=document.createElement("tbody");f.style.height="100%";-f.style.overflow="auto";O=document.createElement("tr");v.style.width="100%";l=document.createElement("td");x=document.createElement("td");y=document.createElement("td");var A=mxUtils.bind(this,function(U,T,V){var n=document.createElement("input");n.type="checkbox";v.appendChild(n);n.checked=b.sidebar.isEntryVisible(V);var u=document.createElement("span");mxUtils.write(u,T);T=document.createElement("div");T.style.display="block";T.appendChild(n);T.appendChild(u);mxEvent.addListener(u,"click",function(G){n.checked=-!n.checked;mxEvent.consume(G)});U.appendChild(T);return function(){return n.checked?V:null}});O.appendChild(l);O.appendChild(x);O.appendChild(y);z.appendChild(O);v.appendChild(z);d=[];var C=0;for(z=0;z<p.length;z++)for(O=0;O<p[z].entries.length;O++)C++;var E=[l,x,y],D=0;for(z=0;z<p.length;z++)(function(U){for(var T=0;T<U.entries.length;T++){var V=U.entries[T];d.push(A(E[Math.floor(D/(C/3))],V.title,V.id));D++}})(p[z]);f.appendChild(v);p=document.createElement("div");p.style.marginTop="18px";p.style.textAlign=-"center";t=document.createElement("input");isLocalStorage&&(t.setAttribute("type","checkbox"),t.checked=!0,t.defaultChecked=!0,p.appendChild(t),z=document.createElement("span"),mxUtils.write(z," "+mxResources.get("rememberThisSetting")),p.appendChild(z),mxEvent.addListener(z,"click",function(U){t.checked=!t.checked;mxEvent.consume(U)}));f.appendChild(p);z=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});z.className="geBtn";O=mxUtils.button(mxResources.get("apply"),function(){for(var U=-["search"],T=0;T<d.length;T++){var V=d[T].apply(this,arguments);null!=V&&U.push(V)}b.sidebar.showEntries(0<U.length?U.join(";"):"",t.checked);b.hideDialog()});O.className="geBtn gePrimaryBtn";p=document.createElement("div");p.style.marginTop="26px";p.style.textAlign="right"}b.editor.cancelFirst?(p.appendChild(z),p.appendChild(O)):(p.appendChild(O),p.appendChild(z));f.appendChild(p);this.container=f},PluginsDialog=function(b,l,p,f){function x(){O=!0;if(0==F.length)y.innerText=mxResources.get("noPlugins");-else{y.innerText="";for(var d=0;d<F.length;d++){var k=document.createElement("span");k.style.display="flex";k.style.alignItems="center";k.style.whiteSpace="nowrap";var m=document.createElement("img");m.src=Editor.trashImage;m.style.position="relative";m.style.cursor="pointer";m.style.marginRight="4px";m.style.display="inline-block";m.style.width="18px";m.setAttribute("title",mxResources.get("delete"));k.appendChild(m);mxUtils.write(k,F[d]);y.appendChild(k);mxUtils.br(y);mxEvent.addListener(m,"click",-function(t){return function(){b.confirm(mxResources.get("delete")+' "'+F[t]+'"?',function(){null!=p&&p(F[t]);F.splice(t,1);x()})}}(d))}}}var z=document.createElement("div"),y=document.createElement("div");y.style.height="180px";y.style.overflow="auto";var F=mxSettings.getPlugins().slice(),O=!1;z.appendChild(y);x();O=!1;var K=mxUtils.button(mxResources.get("add"),null!=l?function(){l(function(d){d&&0>mxUtils.indexOf(F,d)&&F.push(d);x()})}:function(){var d=document.createElement("div"),k=document.createElement("span");-k.style.marginTop="6px";mxUtils.write(k,mxResources.get("builtinPlugins")+": ");d.appendChild(k);var m=document.createElement("select");m.style.width="150px";for(k=0;k<App.publicPlugin.length;k++){var t=document.createElement("option");mxUtils.write(t,App.publicPlugin[k]);t.value=App.publicPlugin[k];m.appendChild(t)}d.appendChild(m);mxUtils.br(d);mxUtils.br(d);k=mxUtils.button(mxResources.get("custom")+"...",function(){var v=new FilenameDialog(b,"",mxResources.get("add"),function(A){b.hideDialog();-if(null!=A&&0<A.length){A=A.split(";");for(var C=0;C<A.length;C++){var E=A[C],D=App.pluginRegistry[E];null!=D&&(E=D);0<E.length&&0>mxUtils.indexOf(F,E)&&F.push(E)}x()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(v.container,300,80,!0,!0);v.init()});k.className="geBtn";ALLOW_CUSTOM_PLUGINS||(k.style.display="none");d=new CustomDialog(b,d,mxUtils.bind(this,function(){var v=App.pluginRegistry[m.value];0>mxUtils.indexOf(F,v)&&(F.push(v),x())}),null,null,null,k);b.showDialog(d.container,-360,100,!0,!0)});K.className="geBtn";var L=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});L.className="geBtn";var M=mxUtils.button(f?mxResources.get("close"):mxResources.get("apply"),function(){O?(mxSettings.setPlugins(F),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});M.className="geBtn gePrimaryBtn";var c=document.createElement("div");c.style.marginTop="14px";c.style.textAlign="right";b.isOffline()||c.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));-b.editor.cancelFirst?(f||c.appendChild(L),c.appendChild(K),c.appendChild(M)):(c.appendChild(K),c.appendChild(M),f||c.appendChild(L));z.appendChild(c);this.container=z},CropImageDialog=function(b,l,p,f){function x(){null!=d&&(M.style.overflow="hidden",d.maxFitScale=null,d.fit(8),d.center(),M.style.overflow="auto")}function z(S){var P=document.createElement("span");P.style.marginLeft="6px";P.style.fontSize="11px";mxUtils.write(P,S);V.appendChild(P);S=document.createElement("input");S.setAttribute("type",-"text");S.style.cssText="width:46px;margin:0 2px;text-align:right;";V.appendChild(S);return S}function y(){var S=v.geometry;u.value=Math.round(S.x);G.value=Math.round(S.y);H.value=Math.round(S.width);I.value=Math.round(S.height)}function F(){if(null!=d){var S=parseFloat(u.value),P=parseFloat(G.value),R=parseFloat(H.value),W=parseFloat(I.value);if(isFinite(S)&&isFinite(P)&&isFinite(R)&&isFinite(W)&&0<R&&0<W){var X=v.geometry.clone();X.x=S;X.y=P;X.width=R;X.height=W;d.model.setGeometry(v,X);d.model.setStyle(v,-E+O());d.selectAll()}}}function O(){var S=q.checked,P=B.checked,R=v.geometry;0>R.x?(R.width+=R.x,R.x=0):R.x+R.width>A&&(R.width=A-R.x,R.x=Math.min(R.x,A));0>R.y?(R.height+=R.y,R.y=0):R.y+R.height>C&&(R.height=C-R.y,R.y=Math.min(R.y,C));var W=R.x/A*100,X=100-(R.x+R.width)/A*100,Y=100-(R.y+R.height)/C*100;return"inset("+mxUtils.format(R.y/C*100)+"% "+mxUtils.format(X)+"% "+mxUtils.format(Y)+"% "+mxUtils.format(W)+"%"+(S?" round "+t+"%":P?" round 50%":"")+")"}function K(S){null!=d&&(!0!==S&&(d.model.setGeometry(v,-m.clone()),t=5,Q.value=t),d.model.setStyle(v,E+O()),d.selectAll(),y(),J.style.visibility=q.checked?"visible":"hidden")}var L=document.createElement("div");L.style.display="flex";L.style.flexDirection="column";L.style.height="100%";var M=document.createElement("div");M.style.flex="1";M.style.minHeight="0";M.style.overflow="auto";M.style.border="1px solid";L.appendChild(M);var c=l.replace(";base64",""),d=null,k=null,m=null,t=5,v=new mxCell("",new mxGeometry(0,0,1,1),""),A=0,C=0,E="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+-c+";clipPath=",D="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",U="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",T=new Image;T.onload=function(){function S(){d.model.setStyle(v,E+O());y()}A=T.naturalWidth;C=T.naturalHeight;m=new mxGeometry(.15*A,.15*C,.7*A,.7*C);v.geometry=m.clone();d=new Graph(M);d.autoExtend=!1;d.autoScroll=!1;d.setGridEnabled(!1);d.setEnabled(!0);-d.setPanning(!0);d.setConnectable(!1);d.getRubberband().setEnabled(!1);d.graphHandler.allowLivePreview=!1;d.centerZoom=!0;d.background="#ffffff";var P=d.createVertexHandler;d.createVertexHandler=function(){var qa=P.apply(this,arguments);qa.livePreview=!1;return qa};var R=d.isCellSelectable;d.isCellSelectable=function(qa){return qa===v&&R.apply(this,arguments)};k=new mxCell("",new mxGeometry(0,0,A,C),D);k.vertex=!0;d.addCell(k);if(null!=p)try{if("inset"==p.substring(0,5)){var W=v.geometry,X=p.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),-Y=parseFloat(X[0]),aa=parseFloat(X[1]),ba=parseFloat(X[2]),fa=parseFloat(X[3]);isFinite(Y)&&isFinite(aa)&&isFinite(ba)&&isFinite(fa)?(W.x=fa/100*A,W.y=Y/100*C,W.width=(100-aa)/100*A-W.x,W.height=(100-ba)/100*C-W.y,"round"==X[4]?"50%"==X[5]?B.setAttribute("checked","checked"):(t=parseInt(X[5]),Q.value=t,q.setAttribute("checked","checked"),J.style.visibility="visible"):g.setAttribute("checked","checked")):p=null}else p=null}catch(qa){}v.style=E+(p?p:O());v.vertex=!0;d.addCell(v);d.selectAll();d.addListener(mxEvent.CELLS_MOVED,-S);d.addListener(mxEvent.CELLS_RESIZED,S);var ia=d.graphHandler.mouseUp,ea=d.graphHandler.mouseDown;d.graphHandler.mouseUp=function(){ia.apply(this,arguments);null!=k&&d.model.setStyle(k,D)};d.graphHandler.mouseDown=function(){ea.apply(this,arguments);null!=k&&d.model.setStyle(k,U)};d.dblClick=function(){};var ma=d.getSelectionModel().changeSelection;d.getSelectionModel().changeSelection=function(){ma.call(this,[v],[v])};y();x()};T.onerror=function(){T.onload=null;T.src=Editor.errorImage};T.src=l;+l,p,f,x){var z=b.editor.graph,y=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)y=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var E=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(R,K){if(z.isEnabled()){var L=new FilenameDialog(b,"",mxResources.get("add"),function(O){b.hideDialog();if(null!=O&&0<O.length){O=O.split(" ");for(var c=[],d=[],k=0;k<O.length;k++){var m=mxUtils.trim(O[k]);""!=m&&(d.push(m),0>mxUtils.indexOf(R,+m)&&c.push(m))}z.isSelectionEmpty()?K(R.concat(c)):z.addTagsForCells(z.getSelectionCells(),d)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(L.container,320,80,!0,!0);L.init()}},y);y=E.div;this.window=new mxWindow(mxResources.get("tags"),y,l,p,f,x,!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(){E.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AuthDialog=function(b,l,p,f){var x=document.createElement("div");x.style.textAlign="center";var z=document.createElement("p");z.style.fontSize="16pt";z.style.padding="0px";z.style.margin="0px";z.style.color="gray";mxUtils.write(z,mxResources.get("authorizationRequired"));var y="Unknown",E=document.createElement("img");E.setAttribute("border","0");E.setAttribute("align","absmiddle");E.style.marginRight="10px";+l==b.drive?(y=mxResources.get("googleDrive"),E.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(y=mxResources.get("dropbox"),E.src=IMAGE_PATH+"/dropbox-logo-white.svg"):l==b.oneDrive?(y=mxResources.get("oneDrive"),E.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(y=mxResources.get("github"),E.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(y=mxResources.get("gitlab"),E.src=IMAGE_PATH+"/gitlab-logo.svg",E.style.width="32px"):l==b.trello?(y=mxResources.get("trello"),E.src=+IMAGE_PATH+"/trello-logo-white.svg"):l==b.m365&&(y=mxResources.get("m365"),E.src=IMAGE_PATH+"/onedrive-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[y]));var R=document.createElement("input");R.setAttribute("type","checkbox");y=mxUtils.button(mxResources.get("authorize"),function(){f(R.checked)});y.insertBefore(E,y.firstChild);y.style.marginTop="6px";y.className="geBigButton";y.style.fontSize="18px";y.style.padding="14px";x.appendChild(z);x.appendChild(b);+x.appendChild(y);p&&(p=document.createElement("p"),p.style.marginTop="20px",p.appendChild(R),z=document.createElement("span"),mxUtils.write(z," "+mxResources.get("rememberMe")),p.appendChild(z),x.appendChild(p),R.checked=!0,R.defaultChecked=!0,mxEvent.addListener(z,"click",function(K){R.checked=!R.checked;mxEvent.consume(K)}));this.container=x},MoreShapesDialog=function(b,l,p){p=null!=p?p:b.sidebar.entries;var f=document.createElement("div"),x=[];if(null!=b.sidebar.customEntries)for(var z=0;z<b.sidebar.customEntries.length;z++){for(var y=+b.sidebar.customEntries[z]||{},E={title:b.getResource(y.title),entries:[]},R=0;null!=y.entries&&R<y.entries.length;R++){var K=y.entries[R];E.entries.push({id:K.id,title:b.getResource(K.title),desc:b.getResource(K.desc),image:K.preview})}0<E.entries.length&&x.push(E)}for(z=0;z<p.length;z++)if(null==b.sidebar.enabledLibraries)x.push(p[z]);else{E={title:p[z].title,entries:[]};for(R=0;R<p[z].entries.length;R++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,p[z].entries[R].id)&&E.entries.push(p[z].entries[R]);+0<E.entries.length&&x.push(E)}p=x;if(l){z=mxUtils.bind(this,function(F){for(var U=0;U<F.length;U++)(function(V){var n=k.cloneNode(!1);n.style.fontWeight="bold";n.style.backgroundColor="light-dark(#e5e5e5, #505759)";n.style.padding="6px 0px 6px 20px";mxUtils.write(n,V.title);L.appendChild(n);for(var v=0;v<V.entries.length;v++)(function(G){var H=k.cloneNode(!1);H.style.cursor="pointer";H.style.padding="4px 0px 4px 20px";H.style.whiteSpace="nowrap";H.style.overflow="hidden";H.style.textOverflow="ellipsis";+H.setAttribute("title",G.title+" ("+G.id+")");var I=document.createElement("input");I.setAttribute("type","checkbox");I.checked=b.sidebar.isEntryVisible(G.id);I.defaultChecked=I.checked;H.appendChild(I);mxUtils.write(H," "+G.title);L.appendChild(H);var g=function(q){if(null==q||"INPUT"!=mxEvent.getSource(q).nodeName){O.style.textAlign="center";O.style.padding="0px";O.style.color="";O.innerText="";if(null!=G.desc){var C=document.createElement("pre");C.style.boxSizing="border-box";C.style.fontFamily=+"inherit";C.style.margin="20px";C.style.right="0px";C.style.textAlign="left";mxUtils.write(C,G.desc);O.appendChild(C)}null!=G.imageCallback?G.imageCallback(O):null!=G.image?(C=document.createElement("img"),C.setAttribute("border","0"),C.style.maxWidth="100%",C.setAttribute("src",G.image),O.appendChild(C)):null==G.desc&&(O.style.padding="20px",O.style.color="rgb(179, 179, 179)",mxUtils.write(O,mxResources.get("noPreview")));null!=c&&(c.style.backgroundColor="");c=H;c.style.backgroundColor="light-dark(#ebf2f9, #000000)";+null!=q&&mxEvent.consume(q)}};mxEvent.addListener(H,"click",g);mxEvent.addListener(H,"dblclick",function(q){I.checked=!I.checked;mxEvent.consume(q)});d.push(function(){return I.checked?G.id:null});0==U&&0==v&&g()})(V.entries[v])})(F[U])});R=document.createElement("div");R.className="geDialogTitle";mxUtils.write(R,mxResources.get("shapes"));R.style.position="absolute";R.style.top="0px";R.style.left="0px";R.style.lineHeight="40px";R.style.height="40px";R.style.right="0px";var L=document.createElement("div"),+O=document.createElement("div");L.style.position="absolute";L.style.top="40px";L.style.left="0px";L.style.width="202px";L.style.bottom="60px";L.style.overflow="auto";O.style.position="absolute";O.style.left="202px";O.style.right="0px";O.style.top="40px";O.style.bottom="60px";O.style.overflow="auto";O.style.borderLeftStyle="solid";O.style.borderLeftWidth="1px";O.style.textAlign="center";var c=null,d=[],k=document.createElement("div");k.style.position="relative";k.style.left="0px";k.style.right="0px";+z(p);f.style.padding="30px";f.appendChild(R);f.appendChild(L);f.appendChild(O);p=document.createElement("div");p.className="geDialogFooter";p.style.position="absolute";p.style.paddingRight="16px";p.style.left="0px";p.style.right="0px";p.style.bottom="0px";p.style.height="60px";p.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;p.appendChild(m);z=+document.createElement("span");mxUtils.write(z," "+mxResources.get("labels"));z.style.paddingRight="20px";p.appendChild(z);mxEvent.addListener(z,"click",function(F){m.checked=!m.checked;mxEvent.consume(F)});var t=document.createElement("input");t.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)z=document.createElement("span"),z.style.paddingRight="20px",z.appendChild(t),mxUtils.write(z," "+mxResources.get("rememberThisSetting")),t.style.position="relative",t.style.top="1px",+t.checked=!0,t.defaultChecked=!0,mxEvent.addListener(z,"click",function(F){mxEvent.getSource(F)!=t&&(t.checked=!t.checked,mxEvent.consume(F))}),p.appendChild(z);z=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});z.className="geBtn";R=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var F=[],U=0;U<d.length;U++){var V=d[U].apply(this,arguments);null!=V&&F.push(V)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||+(U=mxUtils.indexOf(F,".scratchpad"),null!=b.scratchpad!=(0<=U&&0<F.splice(U,1).length)&&b.toggleScratchpad(),U=mxUtils.indexOf(F,"search"),mxSettings.settings.search=0<=U&&0<F.splice(U,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),t.checked&&mxSettings.save());b.sidebar.showEntries(F.join(";"),t.checked,!0);b.setSidebarTitles(m.checked,t.checked)});R.className="geBtn gePrimaryBtn"}else{var u=document.createElement("table");z=document.createElement("tbody");f.style.height="100%";+f.style.overflow="auto";R=document.createElement("tr");u.style.width="100%";l=document.createElement("td");x=document.createElement("td");y=document.createElement("td");var A=mxUtils.bind(this,function(F,U,V){var n=document.createElement("input");n.type="checkbox";u.appendChild(n);n.checked=b.sidebar.isEntryVisible(V);var v=document.createElement("span");mxUtils.write(v,U);U=document.createElement("div");U.style.display="block";U.appendChild(n);U.appendChild(v);mxEvent.addListener(v,"click",function(G){n.checked=+!n.checked;mxEvent.consume(G)});F.appendChild(U);return function(){return n.checked?V:null}});R.appendChild(l);R.appendChild(x);R.appendChild(y);z.appendChild(R);u.appendChild(z);d=[];var B=0;for(z=0;z<p.length;z++)for(R=0;R<p[z].entries.length;R++)B++;var D=[l,x,y],N=0;for(z=0;z<p.length;z++)(function(F){for(var U=0;U<F.entries.length;U++){var V=F.entries[U];d.push(A(D[Math.floor(N/(B/3))],V.title,V.id));N++}})(p[z]);f.appendChild(u);p=document.createElement("div");p.style.marginTop="18px";p.style.textAlign=+"center";t=document.createElement("input");isLocalStorage&&(t.setAttribute("type","checkbox"),t.checked=!0,t.defaultChecked=!0,p.appendChild(t),z=document.createElement("span"),mxUtils.write(z," "+mxResources.get("rememberThisSetting")),p.appendChild(z),mxEvent.addListener(z,"click",function(F){t.checked=!t.checked;mxEvent.consume(F)}));f.appendChild(p);z=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});z.className="geBtn";R=mxUtils.button(mxResources.get("apply"),function(){for(var F=+["search"],U=0;U<d.length;U++){var V=d[U].apply(this,arguments);null!=V&&F.push(V)}b.sidebar.showEntries(0<F.length?F.join(";"):"",t.checked);b.hideDialog()});R.className="geBtn gePrimaryBtn";p=document.createElement("div");p.style.marginTop="26px";p.style.textAlign="right"}b.editor.cancelFirst?(p.appendChild(z),p.appendChild(R)):(p.appendChild(R),p.appendChild(z));f.appendChild(p);this.container=f},PluginsDialog=function(b,l,p,f){function x(){R=!0;if(0==E.length)y.innerText=mxResources.get("noPlugins");+else{y.innerText="";for(var d=0;d<E.length;d++){var k=document.createElement("span");k.style.display="flex";k.style.alignItems="center";k.style.whiteSpace="nowrap";var m=document.createElement("img");m.src=Editor.trashImage;m.style.position="relative";m.style.cursor="pointer";m.style.marginRight="4px";m.style.display="inline-block";m.style.width="18px";m.setAttribute("title",mxResources.get("delete"));k.appendChild(m);mxUtils.write(k,E[d]);y.appendChild(k);mxUtils.br(y);mxEvent.addListener(m,"click",+function(t){return function(){b.confirm(mxResources.get("delete")+' "'+E[t]+'"?',function(){null!=p&&p(E[t]);E.splice(t,1);x()})}}(d))}}}var z=document.createElement("div"),y=document.createElement("div");y.style.height="180px";y.style.overflow="auto";var E=mxSettings.getPlugins().slice(),R=!1;z.appendChild(y);x();R=!1;var K=mxUtils.button(mxResources.get("add"),null!=l?function(){l(function(d){d&&0>mxUtils.indexOf(E,d)&&E.push(d);x()})}:function(){var d=document.createElement("div"),k=document.createElement("span");+k.style.marginTop="6px";mxUtils.write(k,mxResources.get("builtinPlugins")+": ");d.appendChild(k);var m=document.createElement("select");m.style.width="150px";for(k=0;k<App.publicPlugin.length;k++){var t=document.createElement("option");mxUtils.write(t,App.publicPlugin[k]);t.value=App.publicPlugin[k];m.appendChild(t)}d.appendChild(m);mxUtils.br(d);mxUtils.br(d);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 B=0;B<A.length;B++){var D=A[B],N=App.pluginRegistry[D];null!=N&&(D=N);0<D.length&&0>mxUtils.indexOf(E,D)&&E.push(D)}x()}},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");d=new CustomDialog(b,d,mxUtils.bind(this,function(){var u=App.pluginRegistry[m.value];0>mxUtils.indexOf(E,u)&&(E.push(u),x())}),null,null,null,k);b.showDialog(d.container,+360,100,!0,!0)});K.className="geBtn";var L=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});L.className="geBtn";var O=mxUtils.button(f?mxResources.get("close"):mxResources.get("apply"),function(){R?(mxSettings.setPlugins(E),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});O.className="geBtn gePrimaryBtn";var c=document.createElement("div");c.style.marginTop="14px";c.style.textAlign="right";b.isOffline()||c.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));+b.editor.cancelFirst?(f||c.appendChild(L),c.appendChild(K),c.appendChild(O)):(c.appendChild(K),c.appendChild(O),f||c.appendChild(L));z.appendChild(c);this.container=z},CropImageDialog=function(b,l,p,f){function x(){null!=d&&(O.style.overflow="hidden",d.maxFitScale=null,d.fit(8),d.center(),O.style.overflow="auto")}function z(T){var P=document.createElement("span");P.style.marginLeft="6px";P.style.fontSize="11px";mxUtils.write(P,T);V.appendChild(P);T=document.createElement("input");T.setAttribute("type",+"text");T.style.cssText="width:46px;margin:0 2px;text-align:right;";V.appendChild(T);return T}function y(){var T=u.geometry;v.value=Math.round(T.x);G.value=Math.round(T.y);H.value=Math.round(T.width);I.value=Math.round(T.height)}function E(){if(null!=d){var T=parseFloat(v.value),P=parseFloat(G.value),S=parseFloat(H.value),W=parseFloat(I.value);if(isFinite(T)&&isFinite(P)&&isFinite(S)&&isFinite(W)&&0<S&&0<W){var X=u.geometry.clone();X.x=T;X.y=P;X.width=S;X.height=W;d.model.setGeometry(u,X);d.model.setStyle(u,+D+R());d.selectAll()}}}function R(){var T=q.checked,P=C.checked,S=u.geometry;0>S.x?(S.width+=S.x,S.x=0):S.x+S.width>A&&(S.width=A-S.x,S.x=Math.min(S.x,A));0>S.y?(S.height+=S.y,S.y=0):S.y+S.height>B&&(S.height=B-S.y,S.y=Math.min(S.y,B));var W=S.x/A*100,X=100-(S.x+S.width)/A*100,Y=100-(S.y+S.height)/B*100;return"inset("+mxUtils.format(S.y/B*100)+"% "+mxUtils.format(X)+"% "+mxUtils.format(Y)+"% "+mxUtils.format(W)+"%"+(T?" round "+t+"%":P?" round 50%":"")+")"}function K(T){null!=d&&(!0!==T&&(d.model.setGeometry(u,+m.clone()),t=5,M.value=t),d.model.setStyle(u,D+R()),d.selectAll(),y(),J.style.visibility=q.checked?"visible":"hidden")}var L=document.createElement("div");L.style.display="flex";L.style.flexDirection="column";L.style.height="100%";var O=document.createElement("div");O.style.flex="1";O.style.minHeight="0";O.style.overflow="auto";O.style.border="1px solid";L.appendChild(O);var c=l.replace(";base64",""),d=null,k=null,m=null,t=5,u=new mxCell("",new mxGeometry(0,0,1,1),""),A=0,B=0,D="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="++c+";clipPath=",N="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",F="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",U=new Image;U.onload=function(){function T(){d.model.setStyle(u,D+R());y()}A=U.naturalWidth;B=U.naturalHeight;m=new mxGeometry(.15*A,.15*B,.7*A,.7*B);u.geometry=m.clone();d=new Graph(O);d.autoExtend=!1;d.autoScroll=!1;d.setGridEnabled(!1);d.setEnabled(!0);+d.setPanning(!0);d.setConnectable(!1);d.getRubberband().setEnabled(!1);d.graphHandler.allowLivePreview=!1;d.centerZoom=!0;d.background="#ffffff";var P=d.createVertexHandler;d.createVertexHandler=function(){var sa=P.apply(this,arguments);sa.livePreview=!1;return sa};var S=d.isCellSelectable;d.isCellSelectable=function(sa){return sa===u&&S.apply(this,arguments)};k=new mxCell("",new mxGeometry(0,0,A,B),N);k.vertex=!0;d.addCell(k);if(null!=p)try{if("inset"==p.substring(0,5)){var W=u.geometry,X=p.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),+Y=parseFloat(X[0]),Z=parseFloat(X[1]),aa=parseFloat(X[2]),ha=parseFloat(X[3]);isFinite(Y)&&isFinite(Z)&&isFinite(aa)&&isFinite(ha)?(W.x=ha/100*A,W.y=Y/100*B,W.width=(100-Z)/100*A-W.x,W.height=(100-aa)/100*B-W.y,"round"==X[4]?"50%"==X[5]?C.setAttribute("checked","checked"):(t=parseInt(X[5]),M.value=t,q.setAttribute("checked","checked"),J.style.visibility="visible"):g.setAttribute("checked","checked")):p=null}else p=null}catch(sa){}u.style=D+(p?p:R());u.vertex=!0;d.addCell(u);d.selectAll();d.addListener(mxEvent.CELLS_MOVED,+T);d.addListener(mxEvent.CELLS_RESIZED,T);var ja=d.graphHandler.mouseUp,fa=d.graphHandler.mouseDown;d.graphHandler.mouseUp=function(){ja.apply(this,arguments);null!=k&&d.model.setStyle(k,N)};d.graphHandler.mouseDown=function(){fa.apply(this,arguments);null!=k&&d.model.setStyle(k,F)};d.dblClick=function(){};var ma=d.getSelectionModel().changeSelection;d.getSelectionModel().changeSelection=function(){ma.call(this,[u],[u])};y();x()};U.onerror=function(){U.onload=null;U.src=Editor.errorImage};U.src=l;var V=document.createElement("div");V.style.display="flex";V.style.flexShrink="0";V.style.alignItems="center";V.style.justifyContent="center";V.style.paddingTop="6px";l=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=d&&d.zoomIn()});c=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=d&&d.zoomOut()});var n=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){x()});V.appendChild(l);V.appendChild(c);V.appendChild(n);-var u=z("X"),G=z("Y"),H=z("W"),I=z("H");mxEvent.addListener(u,"change",F);mxEvent.addListener(G,"change",F);mxEvent.addListener(H,"change",F);mxEvent.addListener(I,"change",F);L.appendChild(V);l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.display="flex";l.style.flexShrink="0";l.style.alignItems="center";l.style.justifyContent="center";var g=document.createElement("input");g.setAttribute("type","radio");g.setAttribute("id","croppingRect");g.setAttribute("name","croppingShape");+var v=z("X"),G=z("Y"),H=z("W"),I=z("H");mxEvent.addListener(v,"change",E);mxEvent.addListener(G,"change",E);mxEvent.addListener(H,"change",E);mxEvent.addListener(I,"change",E);L.appendChild(V);l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.display="flex";l.style.flexShrink="0";l.style.alignItems="center";l.style.justifyContent="center";var g=document.createElement("input");g.setAttribute("type","radio");g.setAttribute("id","croppingRect");g.setAttribute("name","croppingShape");g.setAttribute("checked","checked");g.style.margin="5px";l.appendChild(g);c=document.createElement("label");c.setAttribute("for","croppingRect");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rectangle"));l.appendChild(c);var q=document.createElement("input");q.setAttribute("type","radio");q.setAttribute("id","croppingRounded");q.setAttribute("name","croppingShape");q.style.margin="5px";l.appendChild(q);c=document.createElement("label");-c.setAttribute("for","croppingRounded");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rounded"));l.appendChild(c);var B=document.createElement("input");B.setAttribute("type","radio");B.setAttribute("id","croppingEllipse");B.setAttribute("name","croppingShape");B.style.margin="5px";l.appendChild(B);c=document.createElement("label");c.setAttribute("for","croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding=-"3px";mxUtils.write(c,mxResources.get("ellipse"));l.appendChild(c);L.appendChild(l);mxEvent.addListener(g,"change",K);mxEvent.addListener(q,"change",K);mxEvent.addListener(B,"change",K);var J=document.createElement("div");J.style.textAlign="center";J.style.flexShrink="0";J.style.visibility="hidden";var Q=document.createElement("input");Q.setAttribute("type","range");Q.setAttribute("min","1");Q.setAttribute("max","49");Q.setAttribute("value",t);Q.setAttribute("title",mxResources.get("arcSize"));J.appendChild(Q);-L.appendChild(J);mxEvent.addListener(Q,"change",function(){t=this.value;K(!0)});l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});l.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){f(O(),v.geometry.width,v.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";n=mxUtils.button(mxResources.get("reset"),function(){f(null,A,C);b.hideDialog()});n.className="geBtn";var N=document.createElement("div");N.style.flexShrink="0";N.style.marginTop="10px";-N.style.whiteSpace="nowrap";N.style.display="flex";N.style.justifyContent="flex-end";b.editor.cancelFirst?(N.appendChild(l),N.appendChild(n),N.appendChild(c)):(N.appendChild(n),N.appendChild(c),N.appendChild(l));L.appendChild(N);this.container=L},EditGeometryDialog=function(b,l){var p=b.editor.graph,f=1==l.length?p.getCellGeometry(l[0]):null,x=document.createElement("div"),z=document.createElement("table"),y=document.createElement("tbody"),F=document.createElement("tr"),O=document.createElement("td"),-K=document.createElement("td");z.style.paddingLeft="6px";mxUtils.write(O,mxResources.get("relative")+":");var L=document.createElement("input");L.setAttribute("type","checkbox");null!=f&&f.relative&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);this.init=function(){L.focus()};K.appendChild(L);F.appendChild(O);F.appendChild(K);y.appendChild(F);F=document.createElement("tr");O=document.createElement("td");K=document.createElement("td");mxUtils.write(O,mxResources.get("left")+":");var M=-document.createElement("input");M.setAttribute("type","text");M.style.width="100px";M.value=null!=f?f.x:"";K.appendChild(M);F.appendChild(O);F.appendChild(K);y.appendChild(F);F=document.createElement("tr");O=document.createElement("td");K=document.createElement("td");mxUtils.write(O,mxResources.get("top")+":");var c=document.createElement("input");c.setAttribute("type","text");c.style.width="100px";c.value=null!=f?f.y:"";K.appendChild(c);F.appendChild(O);F.appendChild(K);y.appendChild(F);F=document.createElement("tr");-O=document.createElement("td");K=document.createElement("td");mxUtils.write(O,mxResources.get("dx")+":");var d=document.createElement("input");d.setAttribute("type","text");d.style.width="100px";d.value=null!=f&&null!=f.offset?f.offset.x:"";K.appendChild(d);F.appendChild(O);F.appendChild(K);y.appendChild(F);F=document.createElement("tr");O=document.createElement("td");K=document.createElement("td");mxUtils.write(O,mxResources.get("dy")+":");var k=document.createElement("input");k.setAttribute("type",-"text");k.style.width="100px";k.value=null!=f&&null!=f.offset?f.offset.y:"";K.appendChild(k);F.appendChild(O);F.appendChild(K);y.appendChild(F);F=document.createElement("tr");O=document.createElement("td");K=document.createElement("td");mxUtils.write(O,mxResources.get("width")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="100px";m.value=null!=f?f.width:"";K.appendChild(m);F.appendChild(O);F.appendChild(K);y.appendChild(F);F=document.createElement("tr");O=-document.createElement("td");K=document.createElement("td");mxUtils.write(O,mxResources.get("height")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=f?f.height:"";K.appendChild(t);F.appendChild(O);F.appendChild(K);y.appendChild(F);F=document.createElement("tr");O=document.createElement("td");K=document.createElement("td");mxUtils.write(O,mxResources.get("rotation")+":");var v=document.createElement("input");v.setAttribute("type","text");-v.style.width="100px";v.value=1==l.length?mxUtils.getValue(p.getCellStyle(l[0]),mxConstants.STYLE_ROTATION,0):"";K.appendChild(v);F.appendChild(O);F.appendChild(K);y.appendChild(F);z.appendChild(y);x.appendChild(z);f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";var A=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();p.getModel().beginUpdate();try{for(var C=0;C<l.length;C++){var E=p.getCellGeometry(l[C]);null!=E&&(E=E.clone(),p.isCellMovable(l[C])&&-(E.relative=L.checked,0<mxUtils.trim(M.value).length&&(E.x=Number(M.value)),0<mxUtils.trim(c.value).length&&(E.y=Number(c.value)),0<mxUtils.trim(d.value).length&&(null==E.offset&&(E.offset=new mxPoint),E.offset.x=Number(d.value)),0<mxUtils.trim(k.value).length&&(null==E.offset&&(E.offset=new mxPoint),E.offset.y=Number(k.value))),p.isCellResizable(l[C])&&(0<mxUtils.trim(m.value).length&&(E.width=Number(m.value)),0<mxUtils.trim(t.value).length&&(E.height=Number(t.value))),p.getModel().setGeometry(l[C],-E));0<mxUtils.trim(v.value).length&&p.setCellStyles(mxConstants.STYLE_ROTATION,Number(v.value),[l[C]])}}finally{p.getModel().endUpdate()}});A.className="geBtn gePrimaryBtn";mxEvent.addListener(x,"keypress",function(C){13==C.keyCode&&A.click()});z=document.createElement("div");z.style.marginTop="20px";z.style.textAlign="right";b.editor.cancelFirst?(z.appendChild(f),z.appendChild(A)):(z.appendChild(A),z.appendChild(f));x.appendChild(z);this.container=x},LibraryDialog=function(b,l,p,f,x,z,y){function F(n){for(n=-document.elementFromPoint(n.clientX,n.clientY);null!=n&&n.parentNode!=m;)n=n.parentNode;var u=null;if(null!=n){var G=m.firstChild;for(u=0;null!=G&&G!=n;)G=G.nextSibling,u++}return u}function O(n,u,G,H,I,g,q,B,J){try{if(b.spinner.stop(),null==u||"image/"==u.substring(0,6))if(null==n&&null!=q||null==v[n]){var Q=function(){aa.innerText="";aa.style.cursor="pointer";aa.style.whiteSpace="nowrap";aa.style.textOverflow="ellipsis";mxUtils.write(aa,null!=ba.title&&0<ba.title.length?ba.title:mxResources.get("untitled"));-aa.style.color=null==ba.title||0==ba.title.length?"#d0d0d0":""};m.style.backgroundImage="";t.style.display="none";var N=I,S=g;if(I>b.maxImageSize||g>b.maxImageSize){var P=Math.min(1,Math.min(b.maxImageSize/Math.max(1,I)),b.maxImageSize/Math.max(1,g));I*=P;g*=P}N>S?(S=Math.round(100*S/N),N=100):(N=Math.round(100*N/S),S=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!=n){var W=document.createElement("img");W.setAttribute("src",D.convert(n));W.style.width=N+"px";W.style.height=S+"px";W.style.margin="10px";W.style.paddingBottom=Math.floor((100-S)/2)+"px";W.style.paddingLeft=Math.floor((100-N)/2)+"px";R.appendChild(W)}else if(null!=q){var X=b.stringToCells("<"==q.xml.charAt(0)?q.xml:Graph.decompress(q.xml));0<X.length&&(b.sidebar.createThumb(X,100,100,R,null,!0,!1,null,null,c.shapeBackgroundColor),-R.firstChild.style.display="inline-block",R.firstChild.style.cursor="")}var Y=document.createElement("img");Y.setAttribute("src",Editor.closeBlackImage);Y.setAttribute("border","0");Y.setAttribute("title",mxResources.get("delete"));Y.setAttribute("align","top");Y.style.paddingTop="4px";Y.style.position="absolute";Y.style.marginLeft="-12px";Y.style.zIndex="1";Y.style.cursor="pointer";mxEvent.addListener(Y,"dragstart",function(qa){mxEvent.consume(qa)});(function(qa,na,ta){mxEvent.addListener(Y,"click",-function(ra){v[na]=null;for(var la=0;la<M.length;la++)if(null!=M[la].data&&M[la].data==na||null!=M[la].xml&&null!=ta&&M[la].xml==ta.xml){M.splice(la,1);break}R.parentNode.removeChild(qa);0==M.length&&(m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(ra)});mxEvent.addListener(Y,"dblclick",function(ra){mxEvent.consume(ra)})})(R,n,q);R.appendChild(Y);R.style.marginBottom="30px";var aa=document.createElement("div");aa.style.position="absolute";aa.style.boxSizing=-"border-box";aa.style.bottom="-18px";aa.style.left="10px";aa.style.right="10px";aa.style.backgroundColor="light-dark(#ffffff, transparent)";aa.style.overflow="hidden";aa.style.textAlign="center";aa.setAttribute("title",mxResources.get("rename"));var ba=null;null!=n?(ba={data:n,w:I,h:g,title:J},null!=B&&(ba.aspect=B),v[n]=W,M.push(ba)):null!=q&&(q.aspect="fixed",M.push(q),ba=q);mxEvent.addListener(aa,"keydown",function(qa){13==qa.keyCode&&null!=E&&(E(),E=null,mxEvent.consume(qa))});Q();R.appendChild(aa);-mxEvent.addListener(aa,"mousedown",function(qa){"true"!=aa.getAttribute("contentEditable")&&mxEvent.consume(qa)});X=function(qa){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var na=new FilenameDialog(b,ba.title||"",mxResources.get("ok"),function(ta){null!=ta&&(ba.title=ta,Q())},mxResources.get("enterValue"));b.showDialog(na.container,300,80,!0,!0);na.init();mxEvent.consume(qa)}else if("true"!=aa.getAttribute("contentEditable")){null!=E&&(E(),E=null);-if(null==ba.title||0==ba.title.length)aa.innerText="";aa.style.textOverflow="";aa.style.whiteSpace="";aa.style.cursor="text";aa.style.color="";aa.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(aa.style,"user-select","text");aa.focus();document.execCommand("selectAll",!1,null);E=function(){aa.removeAttribute("contentEditable");aa.style.cursor="pointer";ba.title=mxUtils.getTextContent(aa);Q()};mxEvent.consume(qa)}};mxEvent.addListener(aa,"click",X);mxEvent.addListener(R,"dblclick",-X);m.appendChild(R);mxEvent.addListener(R,"dragstart",function(qa){null==E&&(null==n&&null!=q&&(Y.style.visibility="hidden",aa.style.visibility="hidden"),mxClient.IS_FF&&null!=q.xml&&qa.dataTransfer.setData("Text",q.xml),A=F(qa),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);Y.style.visibility="";aa.style.visibility=""},0))});mxEvent.addListener(R,"dragend",function(qa){"hidden"==Y.style.visibility&&-(Y.style.visibility="",aa.style.visibility="");A=null;mxUtils.setOpacity(R,100);mxUtils.setPrefixedStyle(R.style,"transform",null)})}else U||(U=!0,b.handleError({message:mxResources.get("fileExists")}));else{I=!1;try{if(N=mxUtils.parseXml(n),"mxlibrary"==N.documentElement.nodeName){S=JSON.parse(mxUtils.getTextContent(N.documentElement));if(null!=S&&0<S.length)for(var fa=0;fa<S.length;fa++)null!=S[fa].xml?O(null,null,0,0,0,0,S[fa]):O(S[fa].data,null,0,0,S[fa].w,S[fa].h,null,"fixed",S[fa].title);I=-!0}else if("mxfile"==N.documentElement.nodeName){var ia=N.documentElement.getElementsByTagName("diagram");for(fa=0;fa<ia.length;fa++){var ea=Editor.getDiagramNodeXml(ia[fa]);X=b.stringToCells(ea);if(0<X.length){var ma=b.editor.graph.getBoundingBoxFromGeometry(X);null!=ma&&O(null,null,0,0,0,0,{xml:ea,w:ma.width,h:ma.height})}}I=!0}}catch(qa){null!=window.console&&console.error("Error in library dialog: "+qa)}I||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(qa){null!=-window.console&&console.log("Error in library dialog: "+qa)}return null}function K(n){n.dataTransfer.dropEffect=null!=A?"move":"copy";n.stopPropagation();n.preventDefault()}function L(n){n.stopPropagation();n.preventDefault();U=!1;C=F(n);if(null!=A)null!=C&&C<m.children.length?(M.splice(C>A?C-1:C,0,M.splice(A,1)[0]),m.insertBefore(m.children[A],m.children[C])):(M.push(M.splice(A,1)[0]),m.appendChild(m.children[A]));else if(0<n.dataTransfer.files.length)b.importFiles(n.dataTransfer.files,0,0,b.maxImageSize,-T(n));else if(0<=mxUtils.indexOf(n.dataTransfer.types,"text/uri-list")){var u=decodeURIComponent(n.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(u)||/(\.png)($|\?)/i.test(u)||/(\.gif)($|\?)/i.test(u)||/(\.svg)($|\?)/i.test(u))&&b.loadImage(u,function(G){O(u,null,0,0,G.width,G.height);m.scrollTop=m.scrollHeight})}n.stopPropagation();n.preventDefault()}var M=[],c=b.editor.graph;p=document.createElement("div");p.style.height="100%";var d=document.createElement("div");d.style.whiteSpace=-"nowrap";d.style.height="40px";p.appendChild(d);mxUtils.write(d,mxResources.get("filename")+":");null==l&&(l=b.defaultLibraryName+".xml");var k=document.createElement("input");k.setAttribute("value",l);k.style.marginRight="20px";k.style.marginLeft="10px";k.style.width="500px";null==x||x.isRenamable()||k.setAttribute("disabled","true");this.init=function(){if(null==x||x.isRenamable())k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)};-d.appendChild(k);Editor.enableUncompressedLibraries&&(k.style.width="420px",l=document.createElement("input"),l.setAttribute("type","checkbox"),l.style.marginRight="10px",d.appendChild(l),mxUtils.write(d,mxResources.get("compressed")));var m=document.createElement("div");m.style.borderWidth="1px 0px 1px 0px";m.style.borderColor="#d3d3d3";m.style.borderStyle="solid";m.style.marginTop="6px";m.style.overflow="auto";m.style.height="340px";m.style.backgroundPosition="center center";m.style.backgroundRepeat=-"no-repeat";0==M.length&&Graph.fileSupport&&(m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var t=document.createElement("div");t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));p.appendChild(t);var v={},A=null,C=null,E=null;d=function(n){"true"!=mxEvent.getSource(n).getAttribute("contentEditable")&&null!=E&&(E(),E=null,mxEvent.consume(n))};-mxEvent.addListener(m,"mousedown",d);mxEvent.addListener(m,"pointerdown",d);mxEvent.addListener(m,"touchstart",d);var D=new mxUrlConverter,U=!1;if(null!=f)for(d=0;d<f.length;d++)l=f[d],O(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(m,"dragleave",function(n){t.style.cursor="";for(var u=mxEvent.getSource(n);null!=u;){if(u==m||u==t){n.stopPropagation();n.preventDefault();break}u=u.parentNode}});var T=function(n){return function(u,G,H,I,g,q,B,J,Q){null!=Q&&EditorUi.isVisioFilename(Q.name)?-b.importVisio(Q,mxUtils.bind(this,function(N){O(N,G,H,I,g,q,B,"fixed",mxEvent.isAltDown(n)?null:B.substring(0,B.lastIndexOf(".")).replace(/_/g," "))})):null!=Q&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(u,Q.name)?b.isExternalDataComms()?b.parseFile(Q,mxUtils.bind(this,function(N){4==N.readyState&&(b.spinner.stop(),200<=N.status&&299>=N.status&&(O(N.responseText,G,H,I,g,q,B,"fixed",mxEvent.isAltDown(n)?null:B.substring(0,B.lastIndexOf(".")).replace(/_/g," ")),m.scrollTop=m.scrollHeight))})):-(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(O(u,G,H,I,g,q,B,"fixed",mxEvent.isAltDown(n)?null:B.substring(0,B.lastIndexOf(".")).replace(/_/g," ")),m.scrollTop=m.scrollHeight)}};mxEvent.addListener(m,"dragover",K);mxEvent.addListener(m,"drop",L);mxEvent.addListener(t,"dragover",K);mxEvent.addListener(t,"drop",L);p.appendChild(m);f=document.createElement("div");f.style.textAlign="right";f.style.marginTop="20px";d=mxUtils.button(mxResources.get("cancel"),-function(){b.hideDialog(!0)});d.setAttribute("id","btnCancel");d.className="geBtn";b.editor.cancelFirst&&f.appendChild(d);"draw.io"!=b.getServiceName()||null==x||x.constructor!=DriveLibrary&&x.constructor!=GitHubLibrary||(l=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(x,function(n){if(null!=n){var u=b.getSearch("create title mode url drive splash state clibs ui".split(" "));u+=(0==u.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(n);n=new EmbedDialog(b,window.location.protocol+-"//"+window.location.host+"/"+u,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(n.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));n.init()}else x.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(x.getId(),x)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),-l.className="geBtn",f.appendChild(l));l=mxUtils.button(mxResources.get("export"),function(){var n=b.createLibraryDataFromImages(M),u=k.value;/(\.xml)$/i.test(u)||(u+=".xml");b.isLocalFileSave()?b.saveLocalFile(n,u,"text/xml",null,null,null!=y?y:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(u)+"&format=xml&xml="+encodeURIComponent(n))).simulate(document,"_blank")});l.setAttribute("id","btnDownload");l.className="geBtn";f.appendChild(l);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(n){U=!1;b.importFiles(V.files,0,0,b.maxImageSize,function(u,G,H,I,g,q,B,J,Q){null!=V.files&&(T(n)(u,G,H,I,g,q,B,J,Q),V.type="",V.type="file",V.value="")});m.scrollTop=m.scrollHeight});V.style.display="none";document.body.appendChild(V);b.libDlgFileInputElt=V}l=mxUtils.button(mxResources.get("import"),function(){null!=E&&(E(),E=null);b.libDlgFileInputElt.click()});-l.setAttribute("id","btnAddImage");l.className="geBtn";f.appendChild(l)}l=mxUtils.button(mxResources.get("addImages"),function(){null!=E&&(E(),E=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(n,u,G){U=!1;if(null!=n){if("data:image/"==n.substring(0,11)){var H=n.indexOf(",");0<H&&(n=n.substring(0,H)+";base64,"+n.substring(H+1))}O(n,null,0,0,u,G);m.scrollTop=m.scrollHeight}})});l.setAttribute("id","btnAddImageUrl");l.className="geBtn";f.appendChild(l);this.saveBtnClickHandler=function(n,-u,G,H){b.saveLibrary(n,u,G,H)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=E&&(E(),E=null);this.saveBtnClickHandler(k.value,M,x,z)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";f.appendChild(l);b.editor.cancelFirst||f.appendChild(d);p.appendChild(f);this.container=p},EditShapeDialog=function(b,l,p){var f=document.createElement("div");f.style.position="absolute";f.style.left="30px";f.style.right="30px";f.style.top="30px";f.style.bottom="30px";var x=-document.createElement("div");x.style.position="absolute";x.style.top="0px";mxUtils.write(x,p);f.appendChild(x);p=document.createElement("div");p.style.position="absolute";p.style.width="100%";p.style.display="flex";p.style.alignItems="stretch";p.style.top="24px";p.style.bottom="50px";var z=document.createElement("textarea");z.style.outline="none";z.style.resize="horizontal";z.style.width="430px";z.style.maxWidth="calc(100% - 100px)";z.style.flexShrink="0";z.style.borderRadius="4px";z.style.marginRight=-"4px";p.appendChild(z);var y=document.createElement("div");y.style.borderWidth="1px";y.style.borderStyle="solid";y.style.padding="20px";y.style.flexGrow="1";y.style.borderRadius="4px";mxEvent.disableContextMenu(y);p.appendChild(y);var F=new Graph(y);F.setEnabled(!1);var O=b.editor.graph.cloneCell(l);F.addCells([O]);x=F.view.getState(O);var K="";null!=x.shape&&null!=x.shape.stencil&&(K=mxUtils.getPrettyXml(x.shape.stencil.desc));mxUtils.write(z,K||"");f.appendChild(p);p=document.createElement("div");-p.style.position="absolute";p.style.display="flex";p.style.alignItems="center";p.style.justifyContent="end";p.style.bottom="6px";p.style.height="30px";p.style.width="100%";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";b.editor.cancelFirst&&p.appendChild(x);var L=function(c,d,k){var m=z.value,t=mxUtils.parseXml(m);m=mxUtils.getPrettyXml(t.documentElement);-t=t.documentElement.getElementsByTagName("parsererror");if(null!=t&&0<t.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(k&&b.hideDialog(),t=!c.model.contains(d),!k||t||m!=K){m=Graph.compress(m);c.getModel().beginUpdate();try{if(t){var v=b.editor.graph.getFreeInsertPoint();d.geometry.x=v.x;d.geometry.y=v.y;c.addCell(d)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+m+")",[d])}catch(A){throw A;}finally{c.getModel().endUpdate()}t&&-(c.setSelectionCell(d),c.scrollCellToVisible(d))}},M=mxUtils.button(mxResources.get("preview"),function(){L(F,O,!1);F.fit()});M.className="geBtn";p.appendChild(M);M=mxUtils.button(mxResources.get("apply"),function(){L(b.editor.graph,l,!0)});M.className="geBtn gePrimaryBtn";p.appendChild(M);b.editor.cancelFirst||p.appendChild(x);f.appendChild(p);this.init=function(){z.focus();z.scrollTop=0;F.fit();y.style.overflow="auto";F.fit()};this.container=f},CustomDialog=function(b,l,p,f,x,z,y,F,O,K,L,M){var c=-document.createElement("div");c.appendChild(l);var d=document.createElement("div");d.style.marginTop=null!=M?M:"30px";d.style.textAlign="right";null!=y&&d.appendChild(y);b.isOffline()||null==z||d.appendChild(b.createHelpIcon(z));l=mxUtils.button(O||mxResources.get("cancel"),function(){b.hideDialog();null!=f&&f()});l.className="geBtn";F&&(l.style.display="none");b.editor.cancelFirst&&d.appendChild(l);x=mxUtils.button(x||mxResources.get("ok"),mxUtils.bind(this,function(){K||b.hideDialog(null,null,this.container);-if(null!=p){var k=p();if("string"===typeof k){b.showError(mxResources.get("error"),k);return}}K&&b.hideDialog(null,null,this.container)}));d.appendChild(x);x.className="geBtn gePrimaryBtn";b.editor.cancelFirst||d.appendChild(l);if(null!=L)for(F=0;F<L.length;F++)(function(k,m,t){k=mxUtils.button(k,function(v){m(v)});null!=t&&k.setAttribute("title",t);k.className="geBtn";d.appendChild(k)})(L[F][0],L[F][1],L[F][2]);c.appendChild(d);this.cancelBtn=l;this.okButton=x;this.container=c},BtnDialog=function(b,-l,p,f){var x=document.createElement("div");x.style.textAlign="center";var z=document.createElement("p");z.style.fontSize="16pt";z.style.padding="0px";z.style.margin="0px";z.style.color="gray";mxUtils.write(z,mxResources.get("done"));var y="Unknown",F=document.createElement("img");F.setAttribute("border","0");F.setAttribute("align","absmiddle");F.style.marginRight="10px";l==b.drive?(y=mxResources.get("googleDrive"),F.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(y=mxResources.get("dropbox"),-F.src=IMAGE_PATH+"/dropbox-logo-white.svg"):l==b.oneDrive?(y=mxResources.get("oneDrive"),F.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(y=mxResources.get("github"),F.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(y=mxResources.get("gitlab"),F.src=IMAGE_PATH+"/gitlab-logo.svg"):l==b.trello&&(y=mxResources.get("trello"),F.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[y],"You are now authorized in {1}"));p=mxUtils.button(p,-f);p.insertBefore(F,p.firstChild);p.style.marginTop="6px";p.className="geBigButton";p.style.fontSize="18px";p.style.padding="14px";x.appendChild(z);x.appendChild(b);x.appendChild(p);this.container=x},FontDialog=function(b,l,p,f,x){function z(C){this.style.border="";13==C.keyCode&&A.click()}var y=document.createElement("table"),F=document.createElement("tbody");y.style.marginTop="8px";var O=document.createElement("tr");var K=document.createElement("td");K.colSpan=2;K.style.whiteSpace="nowrap";K.style.fontSize=-"10pt";K.style.fontWeight="bold";var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-bottom:8px;";L.setAttribute("value","sysfonts");L.setAttribute("type","radio");L.setAttribute("name","current-fontdialog");L.setAttribute("id","fontdialog-sysfonts");K.appendChild(L);var M=document.createElement("label");M.setAttribute("for","fontdialog-sysfonts");mxUtils.write(M,mxResources.get("sysFonts",null,"System Fonts"));K.appendChild(M);O.appendChild(K);F.appendChild(O);O=document.createElement("tr");-K=document.createElement("td");K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.width="120px";K.style.paddingLeft="15px";mxUtils.write(K,mxResources.get("fontname",null,"Font Name")+":");O.appendChild(K);var c=document.createElement("input");"s"==f&&c.setAttribute("value",l);c.style.marginLeft="4px";c.style.width="250px";c.className="dlg_fontName_s";K=document.createElement("td");K.appendChild(c);O.appendChild(K);F.appendChild(O);O=document.createElement("tr");K=document.createElement("td");-K.colSpan=2;K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.fontWeight="bold";var d=document.createElement("input");d.style.cssText="margin-right:8px;margin-bottom:8px;";d.setAttribute("value","googlefonts");d.setAttribute("type","radio");d.setAttribute("name","current-fontdialog");d.setAttribute("id","fontdialog-googlefonts");K.appendChild(d);M=document.createElement("label");M.setAttribute("for","fontdialog-googlefonts");mxUtils.write(M,mxResources.get("googleFonts",null,"Google Fonts"));-K.appendChild(M);if(!b.isOffline()||EditorUi.isElectronApp)M=b.createHelpIcon("https://fonts.google.com/"),K.appendChild(M);O.appendChild(K);"0"!=urlParams.isGoogleFontsEnabled&&F.appendChild(O);O=document.createElement("tr");K=document.createElement("td");K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.width="120px";K.style.paddingLeft="15px";mxUtils.write(K,mxResources.get("fontname",null,"Font Name")+":");O.appendChild(K);var k=document.createElement("input");"g"==f&&k.setAttribute("value",-l);k.style.marginLeft="4px";k.style.width="250px";k.className="dlg_fontName_g";K=document.createElement("td");K.appendChild(k);O.appendChild(K);"0"!=urlParams.isGoogleFontsEnabled&&F.appendChild(O);O=document.createElement("tr");K=document.createElement("td");K.colSpan=2;K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.fontWeight="bold";var m=document.createElement("input");m.style.cssText="margin-right:8px;margin-bottom:8px;";m.setAttribute("value","webfonts");m.setAttribute("type","radio");-m.setAttribute("name","current-fontdialog");m.setAttribute("id","fontdialog-webfonts");K.appendChild(m);M=document.createElement("label");M.setAttribute("for","fontdialog-webfonts");mxUtils.write(M,mxResources.get("webfonts",null,"Web Fonts"));K.appendChild(M);O.appendChild(K);Editor.enableWebFonts&&F.appendChild(O);O=document.createElement("tr");K=document.createElement("td");K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.width="120px";K.style.paddingLeft="15px";mxUtils.write(K,mxResources.get("fontname",-null,"Font Name")+":");O.appendChild(K);var t=document.createElement("input");"w"==f&&(Editor.enableWebFonts?t.setAttribute("value",l):c.setAttribute("value",l));t.style.marginLeft="4px";t.style.width="250px";t.className="dlg_fontName_w";K=document.createElement("td");K.appendChild(t);O.appendChild(K);Editor.enableWebFonts&&F.appendChild(O);O=document.createElement("tr");K=document.createElement("td");K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.width="120px";K.style.paddingLeft="15px";-mxUtils.write(K,mxResources.get("fontUrl",null,"Font URL")+":");O.appendChild(K);var v=document.createElement("input");v.setAttribute("value",p||"");v.style.marginLeft="4px";v.style.width="250px";v.className="dlg_fontUrl";K=document.createElement("td");K.appendChild(v);O.appendChild(K);Editor.enableWebFonts&&F.appendChild(O);this.init=function(){var C=c;"g"==f?C=k:"w"==f&&Editor.enableWebFonts&&(C=t);C.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?C.select():document.execCommand("selectAll",-!1,null)};O=document.createElement("tr");K=document.createElement("td");K.colSpan=2;K.style.paddingTop="20px";K.style.whiteSpace="nowrap";K.setAttribute("align","right");b.isOffline()||K.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();x()});l.className="geBtn";b.editor.cancelFirst&&K.appendChild(l);var A=mxUtils.button(mxResources.get("apply"),function(){if(L.checked){var C=c.value;var E="s"}else if(d.checked){C=-k.value;var D=Editor.GOOGLE_FONTS+encodeURIComponent(C).replace(/%20/g,"+");E="g"}else m.checked&&(C=t.value,D=v.value,E="w");var U=C;var T=D,V=E,n=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,u=y.querySelector(".dlg_fontName_"+V);null==u||null!=U&&0!=U.length?(u=y.querySelector(".dlg_fontUrl"),null==u||"w"!=V||n.test(T)?U=!0:(u.style.border="1px solid red",U=!1)):(u.style.border="1px solid red",U=!1);U&&(x(C,D,E),b.hideDialog())});A.className="geBtn gePrimaryBtn";-mxEvent.addListener(c,"keypress",z);mxEvent.addListener(k,"keypress",z);mxEvent.addListener(t,"keypress",z);mxEvent.addListener(v,"keypress",z);mxEvent.addListener(c,"focus",function(){L.setAttribute("checked","checked");L.checked=!0});mxEvent.addListener(k,"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});K.appendChild(A);b.editor.cancelFirst||K.appendChild(l);O.appendChild(K);F.appendChild(O);y.appendChild(F);this.container=y};+c.setAttribute("for","croppingRounded");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rounded"));l.appendChild(c);var C=document.createElement("input");C.setAttribute("type","radio");C.setAttribute("id","croppingEllipse");C.setAttribute("name","croppingShape");C.style.margin="5px";l.appendChild(C);c=document.createElement("label");c.setAttribute("for","croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding=+"3px";mxUtils.write(c,mxResources.get("ellipse"));l.appendChild(c);L.appendChild(l);mxEvent.addListener(g,"change",K);mxEvent.addListener(q,"change",K);mxEvent.addListener(C,"change",K);var J=document.createElement("div");J.style.textAlign="center";J.style.flexShrink="0";J.style.visibility="hidden";var M=document.createElement("input");M.setAttribute("type","range");M.setAttribute("min","1");M.setAttribute("max","49");M.setAttribute("value",t);M.setAttribute("title",mxResources.get("arcSize"));J.appendChild(M);+L.appendChild(J);mxEvent.addListener(M,"change",function(){t=this.value;K(!0)});l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});l.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){f(R(),u.geometry.width,u.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";n=mxUtils.button(mxResources.get("reset"),function(){f(null,A,B);b.hideDialog()});n.className="geBtn";var Q=document.createElement("div");Q.style.flexShrink="0";Q.style.marginTop="10px";+Q.style.whiteSpace="nowrap";Q.style.display="flex";Q.style.justifyContent="flex-end";b.editor.cancelFirst?(Q.appendChild(l),Q.appendChild(n),Q.appendChild(c)):(Q.appendChild(n),Q.appendChild(c),Q.appendChild(l));L.appendChild(Q);this.container=L},EditGeometryDialog=function(b,l){var p=b.editor.graph,f=1==l.length?p.getCellGeometry(l[0]):null,x=document.createElement("div"),z=document.createElement("table"),y=document.createElement("tbody"),E=document.createElement("tr"),R=document.createElement("td"),+K=document.createElement("td");z.style.paddingLeft="6px";mxUtils.write(R,mxResources.get("relative")+":");var L=document.createElement("input");L.setAttribute("type","checkbox");null!=f&&f.relative&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);this.init=function(){L.focus()};K.appendChild(L);E.appendChild(R);E.appendChild(K);y.appendChild(E);E=document.createElement("tr");R=document.createElement("td");K=document.createElement("td");mxUtils.write(R,mxResources.get("left")+":");var O=+document.createElement("input");O.setAttribute("type","text");O.style.width="100px";O.value=null!=f?f.x:"";K.appendChild(O);E.appendChild(R);E.appendChild(K);y.appendChild(E);E=document.createElement("tr");R=document.createElement("td");K=document.createElement("td");mxUtils.write(R,mxResources.get("top")+":");var c=document.createElement("input");c.setAttribute("type","text");c.style.width="100px";c.value=null!=f?f.y:"";K.appendChild(c);E.appendChild(R);E.appendChild(K);y.appendChild(E);E=document.createElement("tr");+R=document.createElement("td");K=document.createElement("td");mxUtils.write(R,mxResources.get("dx")+":");var d=document.createElement("input");d.setAttribute("type","text");d.style.width="100px";d.value=null!=f&&null!=f.offset?f.offset.x:"";K.appendChild(d);E.appendChild(R);E.appendChild(K);y.appendChild(E);E=document.createElement("tr");R=document.createElement("td");K=document.createElement("td");mxUtils.write(R,mxResources.get("dy")+":");var k=document.createElement("input");k.setAttribute("type",+"text");k.style.width="100px";k.value=null!=f&&null!=f.offset?f.offset.y:"";K.appendChild(k);E.appendChild(R);E.appendChild(K);y.appendChild(E);E=document.createElement("tr");R=document.createElement("td");K=document.createElement("td");mxUtils.write(R,mxResources.get("width")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="100px";m.value=null!=f?f.width:"";K.appendChild(m);E.appendChild(R);E.appendChild(K);y.appendChild(E);E=document.createElement("tr");R=+document.createElement("td");K=document.createElement("td");mxUtils.write(R,mxResources.get("height")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=f?f.height:"";K.appendChild(t);E.appendChild(R);E.appendChild(K);y.appendChild(E);E=document.createElement("tr");R=document.createElement("td");K=document.createElement("td");mxUtils.write(R,mxResources.get("rotation")+":");var u=document.createElement("input");u.setAttribute("type","text");+u.style.width="100px";u.value=1==l.length?mxUtils.getValue(p.getCellStyle(l[0]),mxConstants.STYLE_ROTATION,0):"";K.appendChild(u);E.appendChild(R);E.appendChild(K);y.appendChild(E);z.appendChild(y);x.appendChild(z);f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";var A=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();p.getModel().beginUpdate();try{for(var B=0;B<l.length;B++){var D=p.getCellGeometry(l[B]);null!=D&&(D=D.clone(),p.isCellMovable(l[B])&&+(D.relative=L.checked,0<mxUtils.trim(O.value).length&&(D.x=Number(O.value)),0<mxUtils.trim(c.value).length&&(D.y=Number(c.value)),0<mxUtils.trim(d.value).length&&(null==D.offset&&(D.offset=new mxPoint),D.offset.x=Number(d.value)),0<mxUtils.trim(k.value).length&&(null==D.offset&&(D.offset=new mxPoint),D.offset.y=Number(k.value))),p.isCellResizable(l[B])&&(0<mxUtils.trim(m.value).length&&(D.width=Number(m.value)),0<mxUtils.trim(t.value).length&&(D.height=Number(t.value))),p.getModel().setGeometry(l[B],+D));0<mxUtils.trim(u.value).length&&p.setCellStyles(mxConstants.STYLE_ROTATION,Number(u.value),[l[B]])}}finally{p.getModel().endUpdate()}});A.className="geBtn gePrimaryBtn";mxEvent.addListener(x,"keypress",function(B){13==B.keyCode&&A.click()});z=document.createElement("div");z.style.marginTop="20px";z.style.textAlign="right";b.editor.cancelFirst?(z.appendChild(f),z.appendChild(A)):(z.appendChild(A),z.appendChild(f));x.appendChild(z);this.container=x},LibraryDialog=function(b,l,p,f,x,z,y){function E(n){for(n=+document.elementFromPoint(n.clientX,n.clientY);null!=n&&n.parentNode!=m;)n=n.parentNode;var v=null;if(null!=n){var G=m.firstChild;for(v=0;null!=G&&G!=n;)G=G.nextSibling,v++}return v}function R(n,v,G,H,I,g,q,C,J){try{if(b.spinner.stop(),null==v||"image/"==v.substring(0,6))if(null==n&&null!=q||null==u[n]){var M=function(){Z.innerText="";Z.style.cursor="pointer";Z.style.whiteSpace="nowrap";Z.style.textOverflow="ellipsis";mxUtils.write(Z,null!=aa.title&&0<aa.title.length?aa.title:mxResources.get("untitled"));+Z.style.color=null==aa.title||0==aa.title.length?"#d0d0d0":""};m.style.backgroundImage="";t.style.display="none";var Q=I,T=g;if(I>b.maxImageSize||g>b.maxImageSize){var P=Math.min(1,Math.min(b.maxImageSize/Math.max(1,I)),b.maxImageSize/Math.max(1,g));I*=P;g*=P}Q>T?(T=Math.round(100*T/Q),Q=100):(Q=Math.round(100*Q/T),T=100);var S=document.createElement("div");S.setAttribute("draggable","true");S.style.display="inline-block";S.style.position="relative";S.style.padding="0 12px";S.style.cursor="move";+mxUtils.setPrefixedStyle(S.style,"transition","transform .1s ease-in-out");if(null!=n){var W=document.createElement("img");W.setAttribute("src",N.convert(n));W.style.width=Q+"px";W.style.height=T+"px";W.style.margin="10px";W.style.paddingBottom=Math.floor((100-T)/2)+"px";W.style.paddingLeft=Math.floor((100-Q)/2)+"px";S.appendChild(W)}else if(null!=q){var X=b.stringToCells("<"==q.xml.charAt(0)?q.xml:Graph.decompress(q.xml));0<X.length&&(b.sidebar.createThumb(X,100,100,S,null,!0,!1,null,null,c.shapeBackgroundColor),+S.firstChild.style.display="inline-block",S.firstChild.style.cursor="")}var Y=document.createElement("img");Y.setAttribute("src",Editor.closeBlackImage);Y.setAttribute("border","0");Y.setAttribute("title",mxResources.get("delete"));Y.setAttribute("align","top");Y.style.paddingTop="4px";Y.style.position="absolute";Y.style.marginLeft="-12px";Y.style.zIndex="1";Y.style.cursor="pointer";mxEvent.addListener(Y,"dragstart",function(sa){mxEvent.consume(sa)});(function(sa,ta,ra){mxEvent.addListener(Y,"click",+function(qa){u[ta]=null;for(var la=0;la<O.length;la++)if(null!=O[la].data&&O[la].data==ta||null!=O[la].xml&&null!=ra&&O[la].xml==ra.xml){O.splice(la,1);break}S.parentNode.removeChild(sa);0==O.length&&(m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(qa)});mxEvent.addListener(Y,"dblclick",function(qa){mxEvent.consume(qa)})})(S,n,q);S.appendChild(Y);S.style.marginBottom="30px";var Z=document.createElement("div");Z.style.position="absolute";Z.style.boxSizing=+"border-box";Z.style.bottom="-18px";Z.style.left="10px";Z.style.right="10px";Z.style.backgroundColor="light-dark(#ffffff, transparent)";Z.style.overflow="hidden";Z.style.textAlign="center";Z.setAttribute("title",mxResources.get("rename"));var aa=null;null!=n?(aa={data:n,w:I,h:g,title:J},null!=C&&(aa.aspect=C),u[n]=W,O.push(aa)):null!=q&&(q.aspect="fixed",O.push(q),aa=q);mxEvent.addListener(Z,"keydown",function(sa){13==sa.keyCode&&null!=D&&(D(),D=null,mxEvent.consume(sa))});M();S.appendChild(Z);mxEvent.addListener(Z,+"mousedown",function(sa){"true"!=Z.getAttribute("contentEditable")&&mxEvent.consume(sa)});X=function(sa){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ta=new FilenameDialog(b,aa.title||"",mxResources.get("ok"),function(ra){null!=ra&&(aa.title=ra,M())},mxResources.get("enterValue"));b.showDialog(ta.container,300,80,!0,!0);ta.init();mxEvent.consume(sa)}else if("true"!=Z.getAttribute("contentEditable")){null!=D&&(D(),D=null);if(null==aa.title||0==aa.title.length)Z.innerText=+"";Z.style.textOverflow="";Z.style.whiteSpace="";Z.style.cursor="text";Z.style.color="";Z.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(Z.style,"user-select","text");Z.focus();document.execCommand("selectAll",!1,null);D=function(){Z.removeAttribute("contentEditable");Z.style.cursor="pointer";aa.title=mxUtils.getTextContent(Z);M()};mxEvent.consume(sa)}};mxEvent.addListener(Z,"click",X);mxEvent.addListener(S,"dblclick",X);m.appendChild(S);mxEvent.addListener(S,"dragstart",function(sa){null==+D&&(null==n&&null!=q&&(Y.style.visibility="hidden",Z.style.visibility="hidden"),mxClient.IS_FF&&null!=q.xml&&sa.dataTransfer.setData("Text",q.xml),A=E(sa),mxClient.IS_GC&&(S.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(S.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(S,30);Y.style.visibility="";Z.style.visibility=""},0))});mxEvent.addListener(S,"dragend",function(sa){"hidden"==Y.style.visibility&&(Y.style.visibility="",Z.style.visibility="");A=null;mxUtils.setOpacity(S,+100);mxUtils.setPrefixedStyle(S.style,"transform",null)})}else F||(F=!0,b.handleError({message:mxResources.get("fileExists")}));else{I=!1;try{if(Q=mxUtils.parseXml(n),"mxlibrary"==Q.documentElement.nodeName){T=JSON.parse(mxUtils.getTextContent(Q.documentElement));if(null!=T&&0<T.length)for(var ha=0;ha<T.length;ha++)null!=T[ha].xml?R(null,null,0,0,0,0,T[ha]):R(T[ha].data,null,0,0,T[ha].w,T[ha].h,null,"fixed",T[ha].title);I=!0}else if("mxfile"==Q.documentElement.nodeName){var ja=Q.documentElement.getElementsByTagName("diagram");+for(ha=0;ha<ja.length;ha++){var fa=Editor.getDiagramNodeXml(ja[ha]);X=b.stringToCells(fa);if(0<X.length){var ma=b.editor.graph.getBoundingBoxFromGeometry(X);null!=ma&&R(null,null,0,0,0,0,{xml:fa,w:ma.width,h:ma.height})}}I=!0}}catch(sa){null!=window.console&&console.error("Error in library dialog: "+sa)}I||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(sa){null!=window.console&&console.log("Error in library dialog: "+sa)}return null}function K(n){n.dataTransfer.dropEffect=+null!=A?"move":"copy";n.stopPropagation();n.preventDefault()}function L(n){n.stopPropagation();n.preventDefault();F=!1;B=E(n);if(null!=A)null!=B&&B<m.children.length?(O.splice(B>A?B-1:B,0,O.splice(A,1)[0]),m.insertBefore(m.children[A],m.children[B])):(O.push(O.splice(A,1)[0]),m.appendChild(m.children[A]));else if(0<n.dataTransfer.files.length)b.importFiles(n.dataTransfer.files,0,0,b.maxImageSize,U(n));else if(0<=mxUtils.indexOf(n.dataTransfer.types,"text/uri-list")){var v=decodeURIComponent(n.dataTransfer.getData("text/uri-list"));+(/(\.jpg)($|\?)/i.test(v)||/(\.png)($|\?)/i.test(v)||/(\.gif)($|\?)/i.test(v)||/(\.svg)($|\?)/i.test(v))&&b.loadImage(v,function(G){R(v,null,0,0,G.width,G.height);m.scrollTop=m.scrollHeight})}n.stopPropagation();n.preventDefault()}var O=[],c=b.editor.graph;p=document.createElement("div");p.style.height="100%";var d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.height="40px";p.appendChild(d);mxUtils.write(d,mxResources.get("filename")+":");null==l&&(l=b.defaultLibraryName+".xml");+var k=document.createElement("input");k.setAttribute("value",l);k.style.marginRight="20px";k.style.marginLeft="10px";k.style.width="500px";null==x||x.isRenamable()||k.setAttribute("disabled","true");this.init=function(){if(null==x||x.isRenamable())k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)};d.appendChild(k);Editor.enableUncompressedLibraries&&(k.style.width="420px",l=document.createElement("input"),l.setAttribute("type",+"checkbox"),l.style.marginRight="10px",d.appendChild(l),mxUtils.write(d,mxResources.get("compressed")));var m=document.createElement("div");m.style.borderWidth="1px 0px 1px 0px";m.style.borderColor="#d3d3d3";m.style.borderStyle="solid";m.style.marginTop="6px";m.style.overflow="auto";m.style.height="340px";m.style.backgroundPosition="center center";m.style.backgroundRepeat="no-repeat";0==O.length&&Graph.fileSupport&&(m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var t=document.createElement("div");+t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));p.appendChild(t);var u={},A=null,B=null,D=null;d=function(n){"true"!=mxEvent.getSource(n).getAttribute("contentEditable")&&null!=D&&(D(),D=null,mxEvent.consume(n))};mxEvent.addListener(m,"mousedown",d);mxEvent.addListener(m,"pointerdown",d);mxEvent.addListener(m,"touchstart",d);var N=new mxUrlConverter,F=+!1;if(null!=f)for(d=0;d<f.length;d++)l=f[d],R(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(m,"dragleave",function(n){t.style.cursor="";for(var v=mxEvent.getSource(n);null!=v;){if(v==m||v==t){n.stopPropagation();n.preventDefault();break}v=v.parentNode}});var U=function(n){return function(v,G,H,I,g,q,C,J,M){null!=M&&EditorUi.isVisioFilename(M.name)?b.importVisio(M,mxUtils.bind(this,function(Q){R(Q,G,H,I,g,q,C,"fixed",mxEvent.isAltDown(n)?null:C.substring(0,C.lastIndexOf(".")).replace(/_/g,+" "))})):null!=M&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(v,M.name)?b.isExternalDataComms()?b.parseFile(M,mxUtils.bind(this,function(Q){4==Q.readyState&&(b.spinner.stop(),200<=Q.status&&299>=Q.status&&(R(Q.responseText,G,H,I,g,q,C,"fixed",mxEvent.isAltDown(n)?null:C.substring(0,C.lastIndexOf(".")).replace(/_/g," ")),m.scrollTop=m.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(R(v,G,H,I,g,q,C,"fixed",mxEvent.isAltDown(n)?null:C.substring(0,+C.lastIndexOf(".")).replace(/_/g," ")),m.scrollTop=m.scrollHeight)}};mxEvent.addListener(m,"dragover",K);mxEvent.addListener(m,"drop",L);mxEvent.addListener(t,"dragover",K);mxEvent.addListener(t,"drop",L);p.appendChild(m);f=document.createElement("div");f.style.textAlign="right";f.style.marginTop="20px";d=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});d.setAttribute("id","btnCancel");d.className="geBtn";b.editor.cancelFirst&&f.appendChild(d);"draw.io"!=b.getServiceName()||+null==x||x.constructor!=DriveLibrary&&x.constructor!=GitHubLibrary||(l=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(x,function(n){if(null!=n){var v=b.getSearch("create title mode url drive splash state clibs ui".split(" "));v+=(0==v.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(n);n=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+v,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(n.container,450,270,!0,!0,null,!1,null,+new mxRectangle(0,0,400,250));n.init()}else x.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(x.getId(),x)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),l.className="geBtn",f.appendChild(l));l=mxUtils.button(mxResources.get("export"),function(){var n=b.createLibraryDataFromImages(O),v=k.value;+/(\.xml)$/i.test(v)||(v+=".xml");b.isLocalFileSave()?b.saveLocalFile(n,v,"text/xml",null,null,null!=y?y:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(v)+"&format=xml&xml="+encodeURIComponent(n))).simulate(document,"_blank")});l.setAttribute("id","btnDownload");l.className="geBtn";f.appendChild(l);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(n){F=!1;b.importFiles(V.files,0,0,b.maxImageSize,function(v,G,H,I,g,q,C,J,M){null!=V.files&&(U(n)(v,G,H,I,g,q,C,J,M),V.type="",V.type="file",V.value="")});m.scrollTop=m.scrollHeight});V.style.display="none";document.body.appendChild(V);b.libDlgFileInputElt=V}l=mxUtils.button(mxResources.get("import"),function(){null!=D&&(D(),D=null);b.libDlgFileInputElt.click()});l.setAttribute("id","btnAddImage");l.className="geBtn";f.appendChild(l)}l=mxUtils.button(mxResources.get("addImages"),+function(){null!=D&&(D(),D=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(n,v,G){F=!1;if(null!=n){if("data:image/"==n.substring(0,11)){var H=n.indexOf(",");0<H&&(n=n.substring(0,H)+";base64,"+n.substring(H+1))}R(n,null,0,0,v,G);m.scrollTop=m.scrollHeight}})});l.setAttribute("id","btnAddImageUrl");l.className="geBtn";f.appendChild(l);this.saveBtnClickHandler=function(n,v,G,H){b.saveLibrary(n,v,G,H)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=D&&+(D(),D=null);this.saveBtnClickHandler(k.value,O,x,z)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";f.appendChild(l);b.editor.cancelFirst||f.appendChild(d);p.appendChild(f);this.container=p},EditShapeDialog=function(b,l,p){var f=document.createElement("div");f.style.position="absolute";f.style.left="30px";f.style.right="30px";f.style.top="30px";f.style.bottom="30px";var x=document.createElement("div");x.style.position="absolute";x.style.top="0px";mxUtils.write(x,p);f.appendChild(x);+p=document.createElement("div");p.style.position="absolute";p.style.width="100%";p.style.display="flex";p.style.alignItems="stretch";p.style.top="24px";p.style.bottom="50px";var z=document.createElement("textarea");z.style.outline="none";z.style.resize="horizontal";z.style.width="430px";z.style.maxWidth="calc(100% - 100px)";z.style.flexShrink="0";z.style.borderRadius="4px";z.style.marginRight="4px";p.appendChild(z);var y=document.createElement("div");y.style.borderWidth="1px";y.style.borderStyle=+"solid";y.style.padding="20px";y.style.flexGrow="1";y.style.borderRadius="4px";mxEvent.disableContextMenu(y);p.appendChild(y);var E=new Graph(y);E.setEnabled(!1);var R=b.editor.graph.cloneCell(l);E.addCells([R]);x=E.view.getState(R);var K="";null!=x.shape&&null!=x.shape.stencil&&(K=mxUtils.getPrettyXml(x.shape.stencil.desc));mxUtils.write(z,K||"");f.appendChild(p);p=document.createElement("div");p.style.position="absolute";p.style.display="flex";p.style.alignItems="center";p.style.justifyContent=+"end";p.style.bottom="6px";p.style.height="30px";p.style.width="100%";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";b.editor.cancelFirst&&p.appendChild(x);var L=function(c,d,k){var m=z.value,t=mxUtils.parseXml(m);m=mxUtils.getPrettyXml(t.documentElement);t=t.documentElement.getElementsByTagName("parsererror");if(null!=t&&0<t.length)b.showError(mxResources.get("error"),+mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(k&&b.hideDialog(),t=!c.model.contains(d),!k||t||m!=K){m=Graph.compress(m);c.getModel().beginUpdate();try{if(t){var u=b.editor.graph.getFreeInsertPoint();d.geometry.x=u.x;d.geometry.y=u.y;c.addCell(d)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+m+")",[d])}catch(A){throw A;}finally{c.getModel().endUpdate()}t&&(c.setSelectionCell(d),c.scrollCellToVisible(d))}},O=mxUtils.button(mxResources.get("preview"),function(){L(E,+R,!1);E.fit()});O.className="geBtn";p.appendChild(O);O=mxUtils.button(mxResources.get("apply"),function(){L(b.editor.graph,l,!0)});O.className="geBtn gePrimaryBtn";p.appendChild(O);b.editor.cancelFirst||p.appendChild(x);f.appendChild(p);this.init=function(){z.focus();z.scrollTop=0;E.fit();y.style.overflow="auto";E.fit()};this.container=f},CustomDialog=function(b,l,p,f,x,z,y,E,R,K,L,O){var c=document.createElement("div");c.appendChild(l);var d=document.createElement("div");d.style.marginTop=null!=+O?O:"30px";d.style.textAlign="right";null!=y&&d.appendChild(y);b.isOffline()||null==z||d.appendChild(b.createHelpIcon(z));l=mxUtils.button(R||mxResources.get("cancel"),function(){b.hideDialog();null!=f&&f()});l.className="geBtn";E&&(l.style.display="none");b.editor.cancelFirst&&d.appendChild(l);x=mxUtils.button(x||mxResources.get("ok"),mxUtils.bind(this,function(){K||b.hideDialog(null,null,this.container);if(null!=p){var k=p();if("string"===typeof k){b.showError(mxResources.get("error"),k);return}}K&&+b.hideDialog(null,null,this.container)}));d.appendChild(x);x.className="geBtn gePrimaryBtn";b.editor.cancelFirst||d.appendChild(l);if(null!=L)for(E=0;E<L.length;E++)(function(k,m,t){k=mxUtils.button(k,function(u){m(u)});null!=t&&k.setAttribute("title",t);k.className="geBtn";d.appendChild(k)})(L[E][0],L[E][1],L[E][2]);c.appendChild(d);this.cancelBtn=l;this.okButton=x;this.container=c},BtnDialog=function(b,l,p,f){var x=document.createElement("div");x.style.textAlign="center";var z=document.createElement("p");+z.style.fontSize="16pt";z.style.padding="0px";z.style.margin="0px";z.style.color="gray";mxUtils.write(z,mxResources.get("done"));var y="Unknown",E=document.createElement("img");E.setAttribute("border","0");E.setAttribute("align","absmiddle");E.style.marginRight="10px";l==b.drive?(y=mxResources.get("googleDrive"),E.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(y=mxResources.get("dropbox"),E.src=IMAGE_PATH+"/dropbox-logo-white.svg"):l==b.oneDrive?(y=mxResources.get("oneDrive"),E.src=+IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(y=mxResources.get("github"),E.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(y=mxResources.get("gitlab"),E.src=IMAGE_PATH+"/gitlab-logo.svg"):l==b.trello&&(y=mxResources.get("trello"),E.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[y],"You are now authorized in {1}"));p=mxUtils.button(p,f);p.insertBefore(E,p.firstChild);p.style.marginTop="6px";p.className="geBigButton";+p.style.fontSize="18px";p.style.padding="14px";x.appendChild(z);x.appendChild(b);x.appendChild(p);this.container=x},FontDialog=function(b,l,p,f,x){function z(B){this.style.border="";13==B.keyCode&&A.click()}var y=document.createElement("table"),E=document.createElement("tbody");y.style.marginTop="8px";var R=document.createElement("tr");var K=document.createElement("td");K.colSpan=2;K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.fontWeight="bold";var L=document.createElement("input");+L.style.cssText="margin-right:8px;margin-bottom:8px;";L.setAttribute("value","sysfonts");L.setAttribute("type","radio");L.setAttribute("name","current-fontdialog");L.setAttribute("id","fontdialog-sysfonts");K.appendChild(L);var O=document.createElement("label");O.setAttribute("for","fontdialog-sysfonts");mxUtils.write(O,mxResources.get("sysFonts",null,"System Fonts"));K.appendChild(O);R.appendChild(K);E.appendChild(R);R=document.createElement("tr");K=document.createElement("td");K.style.whiteSpace=+"nowrap";K.style.fontSize="10pt";K.style.width="120px";K.style.paddingLeft="15px";mxUtils.write(K,mxResources.get("fontname",null,"Font Name")+":");R.appendChild(K);var c=document.createElement("input");"s"==f&&c.setAttribute("value",l);c.style.marginLeft="4px";c.style.width="250px";c.className="dlg_fontName_s";K=document.createElement("td");K.appendChild(c);R.appendChild(K);E.appendChild(R);R=document.createElement("tr");K=document.createElement("td");K.colSpan=2;K.style.whiteSpace="nowrap";K.style.fontSize=+"10pt";K.style.fontWeight="bold";var d=document.createElement("input");d.style.cssText="margin-right:8px;margin-bottom:8px;";d.setAttribute("value","googlefonts");d.setAttribute("type","radio");d.setAttribute("name","current-fontdialog");d.setAttribute("id","fontdialog-googlefonts");K.appendChild(d);O=document.createElement("label");O.setAttribute("for","fontdialog-googlefonts");mxUtils.write(O,mxResources.get("googleFonts",null,"Google Fonts"));K.appendChild(O);if(!b.isOffline()||EditorUi.isElectronApp)O=+b.createHelpIcon("https://fonts.google.com/"),K.appendChild(O);R.appendChild(K);"0"!=urlParams.isGoogleFontsEnabled&&E.appendChild(R);R=document.createElement("tr");K=document.createElement("td");K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.width="120px";K.style.paddingLeft="15px";mxUtils.write(K,mxResources.get("fontname",null,"Font Name")+":");R.appendChild(K);var k=document.createElement("input");"g"==f&&k.setAttribute("value",l);k.style.marginLeft="4px";k.style.width="250px";k.className=+"dlg_fontName_g";K=document.createElement("td");K.appendChild(k);R.appendChild(K);"0"!=urlParams.isGoogleFontsEnabled&&E.appendChild(R);R=document.createElement("tr");K=document.createElement("td");K.colSpan=2;K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.fontWeight="bold";var m=document.createElement("input");m.style.cssText="margin-right:8px;margin-bottom:8px;";m.setAttribute("value","webfonts");m.setAttribute("type","radio");m.setAttribute("name","current-fontdialog");m.setAttribute("id",+"fontdialog-webfonts");K.appendChild(m);O=document.createElement("label");O.setAttribute("for","fontdialog-webfonts");mxUtils.write(O,mxResources.get("webfonts",null,"Web Fonts"));K.appendChild(O);R.appendChild(K);Editor.enableWebFonts&&E.appendChild(R);R=document.createElement("tr");K=document.createElement("td");K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.width="120px";K.style.paddingLeft="15px";mxUtils.write(K,mxResources.get("fontname",null,"Font Name")+":");R.appendChild(K);var t=+document.createElement("input");"w"==f&&(Editor.enableWebFonts?t.setAttribute("value",l):c.setAttribute("value",l));t.style.marginLeft="4px";t.style.width="250px";t.className="dlg_fontName_w";K=document.createElement("td");K.appendChild(t);R.appendChild(K);Editor.enableWebFonts&&E.appendChild(R);R=document.createElement("tr");K=document.createElement("td");K.style.whiteSpace="nowrap";K.style.fontSize="10pt";K.style.width="120px";K.style.paddingLeft="15px";mxUtils.write(K,mxResources.get("fontUrl",+null,"Font URL")+":");R.appendChild(K);var u=document.createElement("input");u.setAttribute("value",p||"");u.style.marginLeft="4px";u.style.width="250px";u.className="dlg_fontUrl";K=document.createElement("td");K.appendChild(u);R.appendChild(K);Editor.enableWebFonts&&E.appendChild(R);this.init=function(){var B=c;"g"==f?B=k:"w"==f&&Editor.enableWebFonts&&(B=t);B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null)};R=document.createElement("tr");+K=document.createElement("td");K.colSpan=2;K.style.paddingTop="20px";K.style.whiteSpace="nowrap";K.setAttribute("align","right");b.isOffline()||K.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();x()});l.className="geBtn";b.editor.cancelFirst&&K.appendChild(l);var A=mxUtils.button(mxResources.get("apply"),function(){if(L.checked){var B=c.value;var D="s"}else if(d.checked){B=k.value;var N=Editor.GOOGLE_FONTS++encodeURIComponent(B).replace(/%20/g,"+");D="g"}else m.checked&&(B=t.value,N=u.value,D="w");var F=B;var U=N,V=D,n=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,v=y.querySelector(".dlg_fontName_"+V);null==v||null!=F&&0!=F.length?(v=y.querySelector(".dlg_fontUrl"),null==v||"w"!=V||n.test(U)?F=!0:(v.style.border="1px solid red",F=!1)):(v.style.border="1px solid red",F=!1);F&&(x(B,N,D),b.hideDialog())});A.className="geBtn gePrimaryBtn";mxEvent.addListener(c,"keypress",+z);mxEvent.addListener(k,"keypress",z);mxEvent.addListener(t,"keypress",z);mxEvent.addListener(u,"keypress",z);mxEvent.addListener(c,"focus",function(){L.setAttribute("checked","checked");L.checked=!0});mxEvent.addListener(k,"focus",function(){d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(t,"focus",function(){m.setAttribute("checked","checked");m.checked=!0});mxEvent.addListener(u,"focus",function(){m.setAttribute("checked","checked");m.checked=!0});K.appendChild(A);b.editor.cancelFirst||+K.appendChild(l);R.appendChild(K);E.appendChild(R);y.appendChild(E);this.container=y};function AspectDialog(b,l,p,f,x){this.aspect={pageId:l||(b.pages?b.pages[0].getId():null),layerIds:p||[]};l=document.createElement("div");var z=document.createElement("h5");z.style.margin="0 0 10px";mxUtils.write(z,mxResources.get("pages"));l.appendChild(z);p=document.createElement("div");p.className="geAspectDlgList";l.appendChild(p);z=document.createElement("h5");z.style.margin="0 0 10px";mxUtils.write(z,mxResources.get("layers"));l.appendChild(z);z=document.createElement("div");z.className="geAspectDlgList";l.appendChild(z);this.pagesContainer=p;this.layersContainer=z;this.ui=b;p=document.createElement("div");p.style.marginTop="16px";p.style.textAlign="center";z=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=x&&x()});z.className="geBtn";b.editor.cancelFirst&&p.appendChild(z);var y=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();f({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));p.appendChild(y);y.className="geBtn gePrimaryBtn";b.editor.cancelFirst||p.appendChild(z);y.setAttribute("disabled","disabled");this.okBtn=y;l.appendChild(p);this.container=l}AspectDialog.prototype.init=function(){var b=this.ui.getFileData(!0);if(this.ui.pages)for(b=0;b<this.ui.pages.length;b++){var l=this.ui.updatePageRoot(this.ui.pages[b]);this.createPageItem(l.getId(),l.getName(),l.node)}else this.createPageItem("1","Page-1",mxUtils.parseXml(b).documentElement)};@@ -12751,77 +12756,77 @@ AspectDialog.prototype.createPageItem=function(b,l,p){var f=document.createElemethis.selectedPage=b;f.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var z=x.model;z=z.getChildCells(z.getRoot());for(var y=0;y<z.length;y++)this.createLayerItem(z[y],b,x,p)});mxEvent.addListener(f,"click",l);this.aspect.pageId==b&&l()};AspectDialog.prototype.createLayerItem=function(b,l,p,f){l=p.convertValueToString(b)||mxResources.get("background")||"Background";var x=document.createElement("div");x.setAttribute("data-layer-id",b.id);x.className="geAspectDlgListItem";x.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(l)+"</div>";this.layersContainer.appendChild(x);this.createViewer(x.childNodes[0],f,b.id);f=mxUtils.bind(this,function(){0<=x.className.indexOf("geAspectDlgListItemSelected")?(x.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(x.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(x,"click",f);-1!=this.aspect.layerIds.indexOf(b.id)&&f()};-var FilePropertiesDialog=function(b,l){function p(E){var D=K;K=function(U,T){try{E(function(){D(U,T)},T)}catch(V){T(V)}}}var f=document.createElement("table"),x=document.createElement("tbody");f.style.width="100%";f.style.height="100%";f.style.tableLayout="fixed";var z=b.getCurrentFile(),y=null!=z&&null!=z.getTitle()?z.getTitle():b.defaultFilename,F=/(\.png)$/i.test(y),O=/(\.svg)$/i.test(y),K=function(E,D){E()},L=null!=z?z.isLocked():!1;var M=document.createElement("tr");var c=document.createElement("td");-c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("locked")+":");M.appendChild(c);var d=document.createElement("input");d.setAttribute("type","checkbox");L&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(d);M.appendChild(c);x.appendChild(M);this.init=function(){d.focus()};p(function(E,D){null!=b.fileNode&&L!=d.checked?window.setTimeout(function(){null!=-z&&z.setLocked(d.checked);E()},0):E()});if(F||O){y=1;F=0;M=b.fileNode;null!=M&&(M.hasAttribute("scale")&&(y=parseFloat(M.getAttribute("scale"))),M.hasAttribute("border")&&(F=parseInt(M.getAttribute("border"))));M=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("zoom")+":");M.appendChild(c);var k=document.createElement("input");k.setAttribute("value",100*y+"%");k.style.boxSizing="border-box";k.style.width=-"100%";c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(k);M.appendChild(c);x.appendChild(M);M=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("borderWidth")+":");M.appendChild(c);var m=document.createElement("input");m.setAttribute("value",F);m.style.boxSizing="border-box";m.style.width="100%";c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(m);M.appendChild(c);-x.appendChild(M);this.init=this.init||function(){k.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)};p(function(E,D){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(k.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(m.value))),null!=z&&z.fileChanged());E()})}else if(!/(\.html)$/i.test(y)&&!/(\.svg)$/i.test(y)){var t=null!=z?z.isCompressed():Editor.defaultCompressed;M=document.createElement("tr");-c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("compressed")+":");M.appendChild(c);var v=document.createElement("input");v.setAttribute("type","checkbox");t&&(v.setAttribute("checked","checked"),v.defaultChecked=!0);c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(v);M.appendChild(c);x.appendChild(M);this.init=this.init||function(){v.focus()};p(function(E,-D){null!=b.fileNode&&t!=v.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",v.checked?"true":"false");null!=z&&(z.compressionChanged(v.checked),z.fileChanged());E()},0):E()})}if(null!=z&&z.isRealtimeOptional()){M=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("realtimeCollaboration")+":");M.appendChild(c);var A=document.createElement("input");-A.setAttribute("type","checkbox");var C=z.isRealtimeEnabled();if(C="disabled"!=b.drive.getCustomProperty(z.desc,"collaboration"))A.setAttribute("checked","checked"),A.defaultChecked=!0;p(function(E,D){A.checked!=C?z.setRealtimeEnabled(A.checked,E,D):E()});this.init=null!=this.init?this.init:function(){A.focus()};c=document.createElement("td");c.style.whiteSpace="nowrap";y=document.createElement("div");y.style.display="flex";y.style.alignItems="center";y.style.justifyContent="start";y.appendChild(A);-y.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));c.appendChild(y);M.appendChild(c);x.appendChild(M)}null!=z&&"draw.io"==b.getServiceName()&&0<z.getSize()&&"1"!=urlParams.embed&&(M=document.createElement("tr"),c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("size")+":"),M.appendChild(c),c=b.formatFileSize(z.getSize()),y=document.createElement("input"),-y.setAttribute("title",c),y.setAttribute("value",c),y.setAttribute("disabled","disabled"),y.style.boxSizing="border-box",y.style.width="100%",c=document.createElement("td"),c.style.whiteSpace="nowrap",c.appendChild(y),M.appendChild(c),x.appendChild(M));null!=l&&(M=document.createElement("tr"),c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("publicDiagramUrl")+":"),M.appendChild(c),-y=document.createElement("a"),y.setAttribute("href",l),y.setAttribute("title",l),y.style.whiteSpace="nowrap",y.style.overflow="hidden",y.style.textOverflow="ellipsis",y.style.display="block",y.style.margin="2px",y.style.fontSize="10pt",mxUtils.write(y,l),mxEvent.addListener(y,"click",function(E){b.openLink(l);mxEvent.consume(E)}),c=document.createElement("td"),c.appendChild(y),M.appendChild(c),x.appendChild(M));null!=z&&null!=z.fileObject&&null!=z.fileObject.path&&(M=document.createElement("tr"),-c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("pathFilename")+":"),M.appendChild(c),y=document.createElement("input"),y.setAttribute("title",z.fileObject.path),y.setAttribute("value",z.fileObject.path),y.setAttribute("disabled","disabled"),y.style.boxSizing="border-box",y.style.width="100%",c=document.createElement("td"),c.appendChild(y),M.appendChild(c),x.appendChild(M));-this.init=null!=this.init?this.init:function(){};y=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&K(function(){b.spinner.stop();b.hideDialog()},function(E){b.spinner.stop();b.handleError(E,mxResources.get("error"))})});y.className="geBtn gePrimaryBtn";M=document.createElement("tr");c=document.createElement("td");c.colSpan=2;c.style.paddingTop="20px";c.style.whiteSpace="nowrap";c.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),-function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&c.appendChild(F);null!=b.fileNode&&(O=mxUtils.button(mxResources.get("editData")+"...",function(){b.hideDialog();var E={};try{var D=b.fileNode.getAttribute("vars");null!=D&&0<D.length&&(E=JSON.parse(D))}catch(V){}D=mxUtils.createXmlDocument().createElement("object");D.setAttribute("label","");for(var U in E)D.setAttribute(U,E[U]);E=b.createTemporaryGraph(b.editor.graph.getStylesheet());var T=new mxCell(D);E.getModel().add(E.getDefaultParent(),-T);E.getModel().addListener(mxEvent.CHANGE,function(V,n){V=n.getProperty("edit").changes;for(n=0;n<V.length;n++)if(V[n]instanceof mxValueChange&&V[n].cell===T){for(var u={},G=V[n].value.attributes,H=0;H<G.length;H++)"label"!=G[H].nodeName&&(u[G[H].nodeName]=G[H].nodeValue);u=JSON.stringify(u);"{}"==u?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",u);b.updateFileVars();b.editor.graph.refresh();u=b.getCurrentFile();null!=u&&u.fileChanged()}});E=new EditDataDialog(b,T,E);b.showDialog(E.container,-480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));E.init()}),O.className="geBtn",c.appendChild(O));c.appendChild(y);b.editor.cancelFirst||c.appendChild(F);M.appendChild(c);x.appendChild(M);f.appendChild(x);this.container=f},ConnectionPointsDialog=function(b,l){function p(){null!=x&&x.destroy()}var f=document.createElement("div");f.style.userSelect="none";f.style.display="flex";f.style.flexDirection="column";f.style.height="100%";var x=null;this.init=function(){function z(H,I,g){var q="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+-b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";H=new mxCell("",new mxGeometry(H,I,6,6),q);H.vertex=!0;H.cp=!0;H.constObj=g;return M.addCell(H)}function y(H){H=M.getSelectionCells();M.deleteCells(H)}function F(){var H=parseInt(V.value)||0;H=0>H?0:100<H?100:H;V.value=H;var I=parseInt(u.value)||0;I=0>I?0:100<I?100:I;u.value=I;var g=parseInt(n.value)||0,q=parseInt(G.value)||0;g=new mxConnectionConstraint(new mxPoint(H/100,I/100),!1,null,g,q);H=M.getConnectionPoint(k,g);I=M.getSelectionCell();-if(null!=I){I.constObj=g;g=I.geometry.clone();q=M.view.scale;var B=M.view.translate;g.x=(H.x-3*q)/q-B.x;g.y=(H.y-3*q)/q-B.y;M.model.setGeometry(I,g)}}function O(H){if(H.constObj)return{x:H.constObj.point.x,y:H.constObj.point.y,dx:H.constObj.dx,dy:H.constObj.dy};var I=0,g=0,q=c.geometry,B=mxUtils.format((H.geometry.x+3-q.x)/q.width);H=mxUtils.format((H.geometry.y+3-q.y)/q.height);0>B?(I=B*q.width,B=0):1<B&&(I=(B-1)*q.width,B=1);0>H?(g=H*q.height,H=0):1<H&&(g=(H-1)*q.height,H=1);return{x:B,y:H,dx:parseInt(I),-dy:parseInt(g)}}function K(H){if(1==M.getSelectionCount()){var I=M.getSelectionCell();H&&(I.constObj=null);H=O(I);V.value=100*H.x;u.value=100*H.y;n.value=H.dx;G.value=H.dy;T.style.visibility=""}else T.style.visibility="hidden"}var L=document.createElement("div");L.style.flex="1";L.style.minHeight="0";L.style.overflow="hidden";L.style.borderStyle="solid";L.style.borderWidth="1px";L.style.boxSizing="border-box";mxEvent.disableContextMenu(L);f.appendChild(L);var M=new Graph(L);M.transparentBackground=-!1;M.autoExtend=!1;M.autoScroll=!1;M.setGridEnabled(!1);M.setEnabled(!0);M.setPanning(!0);M.setConnectable(!1);M.setTooltips(!1);M.minFitScale=null;M.maxFitScale=null;M.centerZoom=!0;M.maxFitScale=2;L=l.geometry;var c=new mxCell(l.value,new mxGeometry(0,0,L.width,L.height),l.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");c.vertex=!0;M.addCell(c);M.dblClick=function(H,I){if(null!=I&&I!=c)M.setSelectionCell(I);else{I=mxUtils.convertPoint(M.container,mxEvent.getClientX(H),-mxEvent.getClientY(H));mxEvent.consume(H);H=M.view.scale;var g=M.view.translate;M.setSelectionCell(z((I.x-3*H)/H-g.x,(I.y-3*H)/H-g.y))}};x=new mxKeyHandler(M);x.bindKey(46,y);x.bindKey(8,y);M.getRubberband().isForceRubberbandEvent=function(H){return 0==H.evt.button&&(null==H.getCell()||H.getCell()==c)};M.panningHandler.isForcePanningEvent=function(H){return 2==H.evt.button};var d=M.isCellSelectable;M.isCellSelectable=function(H){return H==c?!1:d.apply(this,arguments)};M.getLinkForCell=function(){return null};-var k=M.view.getState(c);L=M.getAllConnectionConstraints(k);for(var m=0;null!=L&&m<L.length;m++){var t=M.getConnectionPoint(k,L[m]);z(t.x-3,t.y-3,L[m])}m=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){M.zoomIn()});t=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){M.zoomOut()});var v=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==M.view.scale?(M.maxFitScale=8,M.fit(8)):M.zoomActual();M.center()}),A=function(){b.prompt(mxResources.get("gridSize"),-M.gridSize,function(H){!isNaN(H)&&0<H&&(M.setGridSize(H),M.setGridEnabled(!0),M.refresh())})},C=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(H){mxEvent.isShiftDown(H)?A():(M.setGridEnabled(!M.isGridEnabled()),M.refresh())});mxEvent.addListener(C,"dblclick",A);var E=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),y);mxUtils.setOpacity(E,10);L=document.createElement("div");L.style.display="flex";L.style.flexShrink="0";L.style.alignItems="center";L.style.paddingTop=-"6px";L.appendChild(m);L.appendChild(t);L.appendChild(v);L.appendChild(C);L.appendChild(E);f.appendChild(L);var D=document.createElement("input");D.setAttribute("type","number");D.setAttribute("min","1");D.setAttribute("value","1");D.style.width="45px";D.style.position="relative";D.style.margin="0 4px 0 4px";var U=document.createElement("select");U.style.position="relative";t=["left","right","top","bottom"];for(m=0;m<t.length;m++)v=t[m],C=document.createElement("option"),mxUtils.write(C,mxResources.get(v)),-C.value=v,U.appendChild(C);m=mxUtils.button(mxResources.get("add"),function(){var H=parseInt(D.value);H=1>H?1:100<H?100:H;D.value=H;for(var I=U.value,g=c.geometry,q=[],B=0;B<H;B++){switch(I){case "left":var J=g.x;var Q=g.y+(B+1)*g.height/(H+1);break;case "right":J=g.x+g.width;Q=g.y+(B+1)*g.height/(H+1);break;case "top":J=g.x+(B+1)*g.width/(H+1);Q=g.y;break;case "bottom":J=g.x+(B+1)*g.width/(H+1),Q=g.y+g.height}q.push(z(J-3,Q-3))}M.setSelectionCells(q)});m.style.marginLeft="auto";L.appendChild(m);-L.appendChild(D);L.appendChild(U);var T=document.createElement("div");T.style.flexShrink="0";T.style.margin="4px 0px 8px 0px";T.style.whiteSpace="nowrap";T.style.height="24px";L=document.createElement("span");mxUtils.write(L,mxResources.get("dx"));T.appendChild(L);var V=document.createElement("input");V.setAttribute("type","number");V.setAttribute("min","0");V.setAttribute("max","100");V.style.width="45px";V.style.margin="0 4px 0 4px";T.appendChild(V);mxUtils.write(T,"%");var n=document.createElement("input");-n.setAttribute("type","number");n.style.width="45px";n.style.margin="0 4px 0 4px";T.appendChild(n);mxUtils.write(T,"pt");L=document.createElement("span");mxUtils.write(L,mxResources.get("dy"));L.style.marginLeft="12px";T.appendChild(L);var u=document.createElement("input");u.setAttribute("type","number");u.setAttribute("min","0");u.setAttribute("max","100");u.style.width="45px";u.style.margin="0 4px 0 4px";T.appendChild(u);mxUtils.write(T,"%");var G=document.createElement("input");G.setAttribute("type",-"number");G.style.width="45px";G.style.margin="0 4px 0 4px";T.appendChild(G);mxUtils.write(T,"pt");f.appendChild(T);K();M.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<M.getSelectionCount()?mxUtils.setOpacity(E,60):mxUtils.setOpacity(E,10);K()});M.addListener(mxEvent.CELLS_MOVED,K);mxEvent.addListener(V,"change",F);mxEvent.addListener(u,"change",F);mxEvent.addListener(n,"change",F);mxEvent.addListener(G,"change",F);L=mxUtils.button(mxResources.get("cancel"),function(){p();b.hideDialog()});-L.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){var H=M.model.cells,I=[],g=[],q;for(q in H){var B=H[q];B.cp&&g.push(O(B))}g.sort(function(J,Q){return J.x!=Q.x?J.x-Q.x:J.y!=Q.y?J.y-Q.y:J.dx!=Q.dx?J.dx-Q.dx:J.dy-Q.dy});for(H=0;H<g.length;H++)0<H&&g[H].x==g[H-1].x&&g[H].y==g[H-1].y&&g[H].dx==g[H-1].dx&&g[H].dy==g[H-1].dy||I.push("["+g[H].x+","+g[H].y+",0,"+g[H].dx+","+g[H].dy+"]");b.editor.graph.setCellStyles("points","["+I.join(",")+"]",[l]);p();b.hideDialog()});m.className=-"geBtn gePrimaryBtn";t=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[l]);p();b.hideDialog()});t.className="geBtn";v=document.createElement("div");v.style.flexShrink="0";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(L);v.appendChild(t);v.appendChild(m);b.editor.cancelFirst||v.appendChild(L);f.appendChild(v);-M.fit(8);M.center()};this.destroy=p;this.container=f},PolygonDialog=function(b,l,p){function f(da){var ca=fa.getBoundingClientRect();if(0<ca.width&&0<ca.height){var ua=n+G/2,ja=u+H/2;I=Math.max(.05,Math.min(5,da));G=ca.width*I;H=ca.height*I;n=ua-G/2;u=ja-H/2;x()}}function x(){fa.setAttribute("viewBox",n+" "+u+" "+G+" "+H);var da=ba.getBoundingClientRect();if(!(0>=da.width||0>=da.height)){var ca=da.width-12,ua=Math.max(20,ca*Math.min(1,G/1200)),ja=1200-G;ja=0<ja?(n- -400)/ja:.5;ja=Math.max(0,Math.min(1,-ja));ra.style.width=ua+"px";ra.style.left=ja*(ca-ua)+"px";da=da.height-12;ca=Math.max(20,da*Math.min(1,H/1200));ua=1200-H;ua=0<ua?(u- -400)/ua:.5;ua=Math.max(0,Math.min(1,ua));ha.style.height=ca+"px";ha.style.top=ua*(da-ca)+"px"}}function z(da){return A?20*Math.round(da/20):Math.round(da)}function y(da){var ca=fa.getBoundingClientRect(),ua=u+((null!=da.touches?da.touches[0].clientY:da.clientY)-ca.top)/ca.height*H;return{x:z(n+((null!=da.touches?da.touches[0].clientX:da.clientX)-ca.left)/ca.width*-G),y:z(ua)}}function F(da){var ca=fa.getBoundingClientRect(),ua=n+((null!=da.touches?da.touches[0].clientX:da.clientX)-ca.left)/ca.width*G;da=u+((null!=da.touches?da.touches[0].clientY:da.clientY)-ca.top)/ca.height*H;ca=G/400*9;if(v&&2<m.length&&"Q"===m[0].type){var ja=m[0].cx-ua,wa=m[0].cy-da;if(Math.sqrt(ja*ja+wa*wa)<=ca)return{type:"control",index:0}}for(var va=1;va<m.length;va++)if("Q"===m[va].type&&(ja=m[va].cx-ua,wa=m[va].cy-da,Math.sqrt(ja*ja+wa*wa)<=ca))return{type:"control",index:va};for(va=-0;va<m.length;va++)if(ja=m[va].x-ua,wa=m[va].y-da,Math.sqrt(ja*ja+wa*wa)<=ca)return{type:"vertex",index:va};return null}function O(){C.push(JSON.stringify(m));E=[];M()}function K(){0<C.length&&(E.push(JSON.stringify(m)),m=JSON.parse(C.pop()),t=Math.min(t,m.length-1),c(),M())}function L(){0<E.length&&(C.push(JSON.stringify(m)),m=JSON.parse(E.pop()),t=Math.min(t,m.length-1),c(),M())}function M(){null!=Ia&&(Ia.style.opacity=0<C.length?"1":"0.3",Ia.style.pointerEvents=0<C.length?"":"none");null!=Ba&&-(Ba.style.opacity=0<E.length?"1":"0.3",Ba.style.pointerEvents=0<E.length?"":"none")}function c(){for(var da="",ca=0;ca<m.length;ca++)da=0===ca?da+("M"+m[ca].x+" "+m[ca].y):"Q"===m[ca].type?da+("Q"+m[ca].cx+" "+m[ca].cy+" "+m[ca].x+" "+m[ca].y):da+("L"+m[ca].x+" "+m[ca].y);v&&2<m.length&&("Q"===m[0].type&&(da+="Q"+m[0].cx+" "+m[0].cy+" "+m[0].x+" "+m[0].y),da+="Z");ea.setAttribute("d",da);for(ea.setAttribute("fill",v&&2<m.length?"rgba(66, 133, 244, 0.1)":"none");ma.firstChild;)ma.removeChild(ma.firstChild);-for(ca=1;ca<m.length;ca++)"Q"===m[ca].type&&(da=document.createElementNS("http://www.w3.org/2000/svg","polyline"),da.setAttribute("points",m[ca-1].x+","+m[ca-1].y+" "+m[ca].cx+","+m[ca].cy+" "+m[ca].x+","+m[ca].y),da.setAttribute("fill","none"),da.setAttribute("stroke","#f0a030"),da.setAttribute("stroke-width","1"),da.setAttribute("stroke-dasharray","4,3"),ma.appendChild(da));v&&2<m.length&&"Q"===m[0].type&&(ca=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ca.setAttribute("points",-m[m.length-1].x+","+m[m.length-1].y+" "+m[0].cx+","+m[0].cy+" "+m[0].x+","+m[0].y),ca.setAttribute("fill","none"),ca.setAttribute("stroke","#f0a030"),ca.setAttribute("stroke-width","1"),ca.setAttribute("stroke-dasharray","4,3"),ma.appendChild(ca));for(;qa.firstChild;)qa.removeChild(qa.firstChild);for(ca=0;ca<m.length;ca++)da=document.createElementNS("http://www.w3.org/2000/svg","circle"),da.setAttribute("cx",m[ca].x),da.setAttribute("cy",m[ca].y),da.setAttribute("r",5),da.setAttribute("fill",ca===-t?"#ff4444":"#4285f4"),da.setAttribute("stroke","#fff"),da.setAttribute("stroke-width","1.5"),da.style.cursor="move",qa.appendChild(da);for(;na.firstChild;)na.removeChild(na.firstChild);for(ca=1;ca<m.length;ca++)"Q"===m[ca].type&&(da=document.createElementNS("http://www.w3.org/2000/svg","rect"),da.setAttribute("x",m[ca].cx-5),da.setAttribute("y",m[ca].cy-5),da.setAttribute("width",10),da.setAttribute("height",10),da.setAttribute("fill",ca===t?"#ff8800":"#f0a030"),da.setAttribute("stroke","#fff"),-da.setAttribute("stroke-width","1.5"),da.style.cursor="move",na.appendChild(da));v&&2<m.length&&"Q"===m[0].type&&(ca=document.createElementNS("http://www.w3.org/2000/svg","rect"),ca.setAttribute("x",m[0].cx-5),ca.setAttribute("y",m[0].cy-5),ca.setAttribute("width",10),ca.setAttribute("height",10),ca.setAttribute("fill",0===t?"#ff8800":"#f0a030"),ca.setAttribute("stroke","#fff"),ca.setAttribute("stroke-width","1.5"),ca.style.cursor="move",na.appendChild(ca));d()}function d(){ka.innerHTML="";if(0===-m.length){var da=document.createElement("div");da.style.padding="20px 10px";da.style.textAlign="center";da.style.opacity="0.5";da.style.fontSize="12px";mxUtils.write(da,mxResources.get("clickToAdd"));ka.appendChild(da)}else for(da=0;da<m.length;da++)(function(ca){var ua=document.createElement("div");ua.style.display="flex";ua.style.alignItems="center";ua.style.padding="2px 4px";ua.style.gap="4px";ua.style.borderRadius="3px";ua.style.marginBottom="2px";ua.style.fontSize="12px";ua.setAttribute("draggable",-"true");ua.setAttribute("data-idx",ca);ca===t&&(ua.style.backgroundColor="rgba(66, 133, 244, 0.15)");ua.style.cursor="pointer";mxEvent.addListener(ua,"click",function(){t=ca;c()});var ja=document.createElement("span");ja.innerHTML="☰";ja.style.cursor="grab";ja.style.fontSize="11px";ja.style.opacity="0.4";ja.style.flexShrink="0";ua.appendChild(ja);ja=document.createElement("span");ja.style.minWidth="18px";ja.style.fontWeight="bold";mxUtils.write(ja,ca+1+"");ua.appendChild(ja);ja=document.createElement("input");-ja.type="number";ja.value=Math.round(m[ca].x);ja.style.width="48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="X";mxEvent.addListener(ja,"change",function(){O();m[ca].x=parseInt(this.value)||0;c()});mxEvent.addListener(ja,"click",function(va){va.stopPropagation()});ua.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(m[ca].y);ja.style.width="48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="Y";mxEvent.addListener(ja,"change",-function(){O();m[ca].y=parseInt(this.value)||0;c()});mxEvent.addListener(ja,"click",function(va){va.stopPropagation()});ua.appendChild(ja);if(0<ca||0===ca&&v&&2<m.length){ja=document.createElement("label");ja.style.display="flex";ja.style.alignItems="center";ja.style.cursor="pointer";ja.style.flexShrink="0";ja.title=mxResources.get("curved");var wa=document.createElement("input");wa.type="checkbox";wa.checked="Q"===m[ca].type;wa.style.margin="0";mxEvent.addListener(wa,"click",function(va){va.stopPropagation()});-mxEvent.addListener(wa,"change",function(){O();if("Q"===m[ca].type)m[ca].type="L",delete m[ca].cx,delete m[ca].cy;else{var va=0<ca?m[ca-1]:m[m.length-1];var Fa=m[ca];var Ka=(va.x+Fa.x)/2;var Wa=(va.y+Fa.y)/2;var Pa=Fa.x-va.x,ob=Fa.y-va.y;va=Math.sqrt(Pa*Pa+ob*ob);0!==va&&(Fa=.25*va,Ka=Math.round(Ka+-ob/va*Fa),Wa=Math.round(Wa+Pa/va*Fa));m[ca].type="Q";m[ca].cx=Ka;m[ca].cy=Wa}c()});ja.appendChild(wa);ua.appendChild(ja)}ja=document.createElement("img");ja.setAttribute("src",Editor.trashImage);ja.style.cursor=-"pointer";ja.style.marginLeft="auto";ja.style.width="14px";ja.style.height="14px";ja.style.opacity="0.5";ja.style.flexShrink="0";ja.title=mxResources.get("delete");Editor.isDarkMode()&&(ja.style.filter="invert(1)");mxEvent.addListener(ja,"click",function(va){va.stopPropagation();O();m.splice(ca,1);t>=m.length&&(t=m.length-1);c()});ua.appendChild(ja);mxEvent.addListener(ua,"dragstart",function(va){S=ca;ua.style.opacity="0.4";va.dataTransfer.effectAllowed="move";va.dataTransfer.setData("text/plain",-""+ca);va.stopPropagation()});mxEvent.addListener(ua,"dragover",function(va){va.preventDefault();va.stopPropagation();va.dataTransfer.dropEffect="move";va=parseInt(ua.getAttribute("data-idx"));null!==S&&va!==S&&(ua.style.borderTop=va<S?"2px solid #4285f4":"",ua.style.borderBottom=va>S?"2px solid #4285f4":"")});mxEvent.addListener(ua,"dragleave",function(va){ua.style.borderTop="";ua.style.borderBottom=""});mxEvent.addListener(ua,"drop",function(va){va.preventDefault();va.stopPropagation();ua.style.borderTop=-"";ua.style.borderBottom="";var Fa=parseInt(ua.getAttribute("data-idx"));null!==S&&Fa!==S&&(O(),va=m.splice(S,1)[0],Fa=Fa>S?Fa-1:Fa,m.splice(Fa,0,va),t===S?t=Fa:S<t&&Fa>=t?t--:S>t&&Fa<=t&&t++,c());S=null});mxEvent.addListener(ua,"dragend",function(va){ua.style.opacity="";ua.style.borderTop="";ua.style.borderBottom="";S=null});ka.appendChild(ua)})(da)}var k=b.editor.graph,m=[],t=-1,v=!0,A=!0,C=[],E=[],D=-1,U=null,T=!1,V=!1,n=0,u=0,G=400,H=400,I=1,g=!1,q=0,B=0,J=0,Q=0,N=!1,S=null,P=k.view.getState(l);-if(null!=P)try{var R=JSON.parse(mxUtils.getValue(P.style,"polyCoords","[]")),W=JSON.parse(mxUtils.getValue(P.style,"polyCurves","[]")),X=mxUtils.getValue(P.style,"polyline",0);v=!(1==X||!0===X||"true"===X||"1"===X);for(P=0;P<R.length;P++){var Y={x:Math.round(400*R[P][0]),y:Math.round(400*R[P][1]),type:"L"};0<P&&W.length>P-1&&null!=W[P-1]&&3<=W[P-1].length&&"Q"===W[P-1][0]&&(Y.type="Q",Y.cx=Math.round(400*W[P-1][1]),Y.cy=Math.round(400*W[P-1][2]));m.push(Y)}v&&2<R.length&&W.length>=R.length&&null!=-W[R.length-1]&&3<=W[R.length-1].length&&"Q"===W[R.length-1][0]&&(m[0].type="Q",m[0].cx=Math.round(400*W[R.length-1][1]),m[0].cy=Math.round(400*W[R.length-1][2]))}catch(da){}var aa=document.createElement("div");aa.style.userSelect="none";aa.setAttribute("tabindex","0");aa.style.outline="none";aa.style.position="absolute";aa.style.left="30px";aa.style.right="30px";aa.style.top="30px";aa.style.bottom="30px";R=document.createElement("div");R.style.display="flex";R.style.gap="10px";R.style.position="absolute";-R.style.left="0px";R.style.right="0px";R.style.top="0px";R.style.bottom="40px";aa.appendChild(R);var ba=document.createElement("div");ba.style.border="1px solid";ba.style.borderColor="inherit";ba.style.borderRadius="4px";ba.style.flexGrow="1";ba.style.flexShrink="1";ba.style.minWidth="200px";ba.style.position="relative";ba.style.overflow="hidden";R.appendChild(ba);var fa=document.createElementNS("http://www.w3.org/2000/svg","svg");fa.setAttribute("width","100%");fa.setAttribute("height","100%");fa.setAttribute("viewBox",-"0 0 400 400");fa.style.display="block";fa.style.cursor="crosshair";W=document.createElementNS("http://www.w3.org/2000/svg","defs");Y=document.createElementNS("http://www.w3.org/2000/svg","pattern");P="polygonGrid_"+Date.now();Y.setAttribute("id",P);Y.setAttribute("width",20);Y.setAttribute("height",20);Y.setAttribute("patternUnits","userSpaceOnUse");X=document.createElementNS("http://www.w3.org/2000/svg","path");X.setAttribute("d","M 20 0 L 0 0 0 20");X.setAttribute("fill","none");X.setAttribute("stroke",-"#e0e0e0");X.setAttribute("stroke-width","0.5");Y.appendChild(X);W.appendChild(Y);fa.appendChild(W);var ia=document.createElementNS("http://www.w3.org/2000/svg","rect");ia.setAttribute("x","-5000");ia.setAttribute("y","-5000");ia.setAttribute("width","10000");ia.setAttribute("height","10000");ia.setAttribute("fill","url(#"+P+")");fa.appendChild(ia);var ea=document.createElementNS("http://www.w3.org/2000/svg","path");ea.setAttribute("fill","rgba(66, 133, 244, 0.1)");ea.setAttribute("stroke","#4285f4");-ea.setAttribute("stroke-width","2");fa.appendChild(ea);var ma=document.createElementNS("http://www.w3.org/2000/svg","g");fa.appendChild(ma);var qa=document.createElementNS("http://www.w3.org/2000/svg","g");fa.appendChild(qa);var na=document.createElementNS("http://www.w3.org/2000/svg","g");fa.appendChild(na);ba.appendChild(fa);var ta=document.createElement("div");ta.style.position="absolute";ta.style.bottom="0px";ta.style.left="0px";ta.style.right="12px";ta.style.height="12px";ta.style.backgroundColor=-"rgba(128,128,128,0.08)";var ra=document.createElement("div");ra.style.position="absolute";ra.style.top="2px";ra.style.height="8px";ra.style.borderRadius="4px";ra.style.backgroundColor="rgba(128,128,128,0.35)";ra.style.cursor="pointer";ra.style.minWidth="20px";ta.appendChild(ra);ba.appendChild(ta);var la=document.createElement("div");la.style.position="absolute";la.style.top="0px";la.style.right="0px";la.style.bottom="12px";la.style.width="12px";la.style.backgroundColor="rgba(128,128,128,0.08)";var ha=-document.createElement("div");ha.style.position="absolute";ha.style.left="2px";ha.style.width="8px";ha.style.borderRadius="4px";ha.style.backgroundColor="rgba(128,128,128,0.35)";ha.style.cursor="pointer";ha.style.minHeight="20px";la.appendChild(ha);ba.appendChild(la);var pa=!1,ya=!1,za=0,xa=0;mxEvent.addListener(ra,"mousedown",function(da){pa=!0;za=da.clientX;xa=n;da.preventDefault();da.stopPropagation()});mxEvent.addListener(ha,"mousedown",function(da){ya=!0;za=da.clientY;xa=u;da.preventDefault();-da.stopPropagation()});mxEvent.addListener(ta,"mousedown",function(da){if(da.target===ta){var ca=ta.getBoundingClientRect().width,ua=da.clientX-ta.getBoundingClientRect().left,ja=1200-G;0<ja&&(n=-400+ua/ca*ja,x());da.preventDefault();da.stopPropagation()}});mxEvent.addListener(la,"mousedown",function(da){if(da.target===la){var ca=la.getBoundingClientRect().height,ua=da.clientY-la.getBoundingClientRect().top,ja=1200-H;0<ja&&(u=-400+ua/ca*ja,x());da.preventDefault();da.stopPropagation()}});var Z=function(da){if(pa){var ca=-ba.getBoundingClientRect().width-12,ua=parseFloat(ra.style.width)||20,ja=1200-G;ca>ua&&0<ja&&(n=xa+(da.clientX-za)/(ca-ua)*ja,x());da.preventDefault()}ya&&(ca=ba.getBoundingClientRect().height-12,ua=parseFloat(ha.style.height)||20,ja=1200-H,ca>ua&&0<ja&&(u=xa+(da.clientY-za)/(ca-ua)*ja,x()),da.preventDefault())},oa=function(da){ya=pa=!1};mxEvent.addListener(document,"mousemove",Z);mxEvent.addListener(document,"mouseup",oa);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var da=-fa.getBoundingClientRect();if(0<da.width&&0<da.height){var ca=n+G/2,ua=u+H/2;G=da.width*I;H=da.height*I;n=ca-G/2;u=ua-H/2;x()}})).observe(ba);var ka=document.createElement("div");ka.style.width="200px";ka.style.flexShrink="0";ka.style.overflowY="auto";ka.style.border="1px solid";ka.style.borderColor="inherit";ka.style.borderRadius="4px";ka.style.padding="4px";R.appendChild(ka);mxEvent.addGestureListeners(fa,function(da){if(!N&&1!==da.button&&2!==da.button){var ca=F(da);if(null!=ca)D=ca.index,U=ca.type,-T=!0,V=!1,t=ca.index;else{ca=y(da);O();if(2>m.length)m.push({x:ca.x,y:ca.y,type:"L"}),t=m.length-1;else{for(var ua=Infinity,ja=m.length-1,wa=v?m.length:m.length-1,va=0;va<wa;va++){var Fa=(va+1)%m.length;Fa=mxUtils.ptSegDistSq(m[va].x,m[va].y,m[Fa].x,m[Fa].y,ca.x,ca.y);Fa<ua&&(ua=Fa,ja=va)}m.splice(ja+1,0,{x:ca.x,y:ca.y,type:"L"});t=ja+1}D=t;U="vertex";V=T=!0}c();mxEvent.consume(da)}},function(da){if(T&&0<=D){V||(O(),V=!0);var ca=y(da);"control"===U?(m[D].cx=ca.x,m[D].cy=ca.y):(m[D].x=ca.x,m[D].y=-ca.y);c();mxEvent.consume(da)}},function(da){!N&&1!==da.button&&2!==da.button&&T&&0<=D&&(T=!1,D=-1,U=null,mxEvent.consume(da))});mxEvent.addListener(fa,"wheel",function(da){da.preventDefault();var ca=fa.getBoundingClientRect(),ua=(da.clientX-ca.left)/ca.width,ja=(da.clientY-ca.top)/ca.height,wa=n+ua*G,va=u+ja*H;I=Math.max(.05,Math.min(5,I*(0<da.deltaY?1.15:1/1.15)));G=ca.width*I;H=ca.height*I;n=wa-ua*G;u=va-ja*H;x()});mxEvent.addListener(fa,"contextmenu",function(da){da.preventDefault()});mxEvent.addListener(fa,-"mousedown",function(da){if(1===da.button||2===da.button||0===da.button&&N)g=!0,q=da.clientX,B=da.clientY,J=n,Q=u,fa.style.cursor="grabbing",da.preventDefault()});var sa=function(da){if(g){var ca=fa.getBoundingClientRect();n=J-(da.clientX-q)/ca.width*G;u=Q-(da.clientY-B)/ca.height*H;x();da.preventDefault()}},Ca=function(da){g&&(g=!1,fa.style.cursor=N?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",sa);mxEvent.addListener(document,"mouseup",Ca);R=document.createElement("div");R.style.display=-"flex";R.style.alignItems="center";R.style.gap="6px";R.style.position="absolute";R.style.left="0px";R.style.right="0px";R.style.bottom="0px";R.style.height="34px";var Ia=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),function(){K()});R.appendChild(Ia);var Ba=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){L()});R.appendChild(Ba);W=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){f(I/1.15)});R.appendChild(W);W=b.createToolbarButton(Editor.zoomOutImage,-mxResources.get("zoomOut"),function(){f(1.15*I)});R.appendChild(W);W=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var da=fa.getBoundingClientRect();if(0<da.width&&0<da.height){if(1==I)if(0<m.length){for(var ca=m[0].x,ua=m[0].y,ja=m[0].x,wa=m[0].y,va=1;va<m.length;va++)ca=Math.min(ca,m[va].x),ua=Math.min(ua,m[va].y),ja=Math.max(ja,m[va].x),wa=Math.max(wa,m[va].y),"Q"===m[va].type&&(ca=Math.min(ca,m[va].cx),ua=Math.min(ua,m[va].cy),ja=Math.max(ja,m[va].cx),wa=Math.max(wa,-m[va].cy));ja=ja-ca+40;wa=wa-ua+40;I=1/Math.min(da.width/ja,da.height/wa);G=da.width*I;H=da.height*I;n=ca-20+(ja-G)/2;u=ua-20+(wa-H)/2}else I=1,G=da.width,H=da.height,n=(400-G)/2,u=(400-H)/2;else I=1,G=da.width*I,H=da.height*I,n=(400-G)/2,u=(400-H)/2;x()}});R.appendChild(W);W=mxUtils.button(mxResources.get("deleteAll"),function(){0<m.length&&(O(),m=[],t=-1,c())});W.className="geBtn";W.style.padding="2px 10px";W.style.fontSize="12px";R.appendChild(W);W=document.createElement("span");W.style.flexGrow=-"1";R.appendChild(W);W=document.createElement("label");W.style.display="flex";W.style.alignItems="center";W.style.gap="4px";W.style.fontSize="12px";W.style.cursor="pointer";W.style.whiteSpace="nowrap";Y=document.createElement("input");Y.type="checkbox";Y.checked=A;mxEvent.addListener(Y,"change",function(){A=this.checked;ia.style.display=A?"":"none"});W.appendChild(Y);mxUtils.write(W,mxResources.get("grid"));R.appendChild(W);W=document.createElement("label");W.style.display="flex";W.style.alignItems=-"center";W.style.gap="4px";W.style.fontSize="12px";W.style.cursor="pointer";W.style.whiteSpace="nowrap";Y=document.createElement("input");Y.type="checkbox";Y.checked=v;mxEvent.addListener(Y,"change",function(){v=this.checked;c()});W.appendChild(Y);mxUtils.write(W,mxResources.get("closePath"));R.appendChild(W);W=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});W.className="geBtn";Y=mxUtils.button(mxResources.get("apply"),function(){if(2>m.length)b.showError(mxResources.get("error"),-mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var da=m[0].x,ca=m[0].x,ua=m[0].y,ja=m[0].y,wa=0;wa<m.length;wa++)da=Math.min(da,m[wa].x),ca=Math.max(ca,m[wa].x),ua=Math.min(ua,m[wa].y),ja=Math.max(ja,m[wa].y),"Q"===m[wa].type&&(da=Math.min(da,m[wa].cx),ca=Math.max(ca,m[wa].cx),ua=Math.min(ua,m[wa].cy),ja=Math.max(ja,m[wa].cy));var va=ca-da,Fa=ja-ua,Ka=function(Pa){return 0<va?Math.round((Pa-da)/va*100)/100:.5},Wa=function(Pa){return 0<Fa?Math.round((Pa-ua)/Fa*100)/100:.5};ca=[];ja=-[];for(wa=0;wa<m.length;wa++)ca.push([Ka(m[wa].x),Wa(m[wa].y)]),0<wa&&("Q"===m[wa].type?ja.push(["Q",Ka(m[wa].cx),Wa(m[wa].cy)]):ja.push([]));v&&2<m.length&&"Q"===m[0].type&&ja.push(["Q",Ka(m[0].cx),Wa(m[0].cy)]);if(null!=p)wa="shape=mxgraph.basic.polygon;polyCoords="+JSON.stringify(ca)+";polyCurves="+JSON.stringify(ja)+";polyline="+(v?"0":"1")+";whiteSpace=wrap;html=1;",p(wa);else{wa=k.getCellGeometry(l);null!=wa&&(wa=wa.clone(),0<va&&(wa.x+=da/400*wa.width,wa.width*=va/400),0<Fa&&(wa.y+=ua/400*-wa.height,wa.height*=Fa/400));k.getModel().beginUpdate();try{null!=wa&&k.getModel().setGeometry(l,wa),k.setCellStyles("polyCoords",JSON.stringify(ca),[l]),k.setCellStyles("polyCurves",JSON.stringify(ja),[l]),k.setCellStyles("polyline",v?"0":"1",[l])}finally{k.getModel().endUpdate()}}b.hideDialog()}});Y.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(R.appendChild(W),R.appendChild(Y)):(R.appendChild(Y),R.appendChild(W));aa.appendChild(R);mxEvent.addListener(aa,"keydown",function(da){32===da.keyCode?-(N||(N=!0,fa.style.cursor="grab"),mxEvent.consume(da)):46===da.keyCode||8===da.keyCode?0<=t&&t<m.length&&"INPUT"!==da.target.tagName&&(O(),m.splice(t,1),t>=m.length&&(t=m.length-1),c(),mxEvent.consume(da)):90===da.keyCode&&(da.ctrlKey||da.metaKey)?(da.shiftKey?L():K(),mxEvent.consume(da)):89===da.keyCode&&(da.ctrlKey||da.metaKey)&&(L(),mxEvent.consume(da))});mxEvent.addListener(aa,"keyup",function(da){32===da.keyCode&&(N=!1,g||(fa.style.cursor="crosshair"))});c();M();this.init=function(){aa.focus();-var da=fa.getBoundingClientRect();0<da.width&&0<da.height&&(I=1,G=da.width*I,H=da.height*I,n=(400-G)/2,u=(400-H)/2,x())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Z);mxEvent.removeListener(document,"mouseup",oa);mxEvent.removeListener(document,"mousemove",sa);mxEvent.removeListener(document,"mouseup",Ca)};this.container=aa};(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.thinFormatImage=+var FilePropertiesDialog=function(b,l){function p(D){var N=K;K=function(F,U){try{D(function(){N(F,U)},U)}catch(V){U(V)}}}var f=document.createElement("table"),x=document.createElement("tbody");f.style.width="100%";f.style.height="100%";f.style.tableLayout="fixed";var z=b.getCurrentFile(),y=null!=z&&null!=z.getTitle()?z.getTitle():b.defaultFilename,E=/(\.png)$/i.test(y),R=/(\.svg)$/i.test(y),K=function(D,N){D()},L=null!=z?z.isLocked():!1;var O=document.createElement("tr");var c=document.createElement("td");+c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("locked")+":");O.appendChild(c);var d=document.createElement("input");d.setAttribute("type","checkbox");L&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(d);O.appendChild(c);x.appendChild(O);this.init=function(){d.focus()};p(function(D,N){null!=b.fileNode&&L!=d.checked?window.setTimeout(function(){null!=+z&&z.setLocked(d.checked);D()},0):D()});if(E||R){y=1;E=0;O=b.fileNode;null!=O&&(O.hasAttribute("scale")&&(y=parseFloat(O.getAttribute("scale"))),O.hasAttribute("border")&&(E=parseInt(O.getAttribute("border"))));O=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("zoom")+":");O.appendChild(c);var k=document.createElement("input");k.setAttribute("value",100*y+"%");k.style.boxSizing="border-box";k.style.width=+"100%";c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(k);O.appendChild(c);x.appendChild(O);O=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("borderWidth")+":");O.appendChild(c);var m=document.createElement("input");m.setAttribute("value",E);m.style.boxSizing="border-box";m.style.width="100%";c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(m);O.appendChild(c);+x.appendChild(O);this.init=this.init||function(){k.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)};p(function(D,N){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(k.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(m.value))),null!=z&&z.fileChanged());D()})}else if(!/(\.html)$/i.test(y)&&!/(\.svg)$/i.test(y)){var t=null!=z?z.isCompressed():Editor.defaultCompressed;O=document.createElement("tr");+c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("compressed")+":");O.appendChild(c);var u=document.createElement("input");u.setAttribute("type","checkbox");t&&(u.setAttribute("checked","checked"),u.defaultChecked=!0);c=document.createElement("td");c.style.whiteSpace="nowrap";c.appendChild(u);O.appendChild(c);x.appendChild(O);this.init=this.init||function(){u.focus()};p(function(D,+N){null!=b.fileNode&&t!=u.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",u.checked?"true":"false");null!=z&&(z.compressionChanged(u.checked),z.fileChanged());D()},0):D()})}if(null!=z&&z.isRealtimeOptional()){O=document.createElement("tr");c=document.createElement("td");c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.fontSize="10pt";mxUtils.write(c,mxResources.get("realtimeCollaboration")+":");O.appendChild(c);var A=document.createElement("input");+A.setAttribute("type","checkbox");var B=z.isRealtimeEnabled();if(B="disabled"!=b.drive.getCustomProperty(z.desc,"collaboration"))A.setAttribute("checked","checked"),A.defaultChecked=!0;p(function(D,N){A.checked!=B?z.setRealtimeEnabled(A.checked,D,N):D()});this.init=null!=this.init?this.init:function(){A.focus()};c=document.createElement("td");c.style.whiteSpace="nowrap";y=document.createElement("div");y.style.display="flex";y.style.alignItems="center";y.style.justifyContent="start";y.appendChild(A);+y.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));c.appendChild(y);O.appendChild(c);x.appendChild(O)}null!=z&&"draw.io"==b.getServiceName()&&0<z.getSize()&&"1"!=urlParams.embed&&(O=document.createElement("tr"),c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("size")+":"),O.appendChild(c),c=b.formatFileSize(z.getSize()),y=document.createElement("input"),+y.setAttribute("title",c),y.setAttribute("value",c),y.setAttribute("disabled","disabled"),y.style.boxSizing="border-box",y.style.width="100%",c=document.createElement("td"),c.style.whiteSpace="nowrap",c.appendChild(y),O.appendChild(c),x.appendChild(O));null!=l&&(O=document.createElement("tr"),c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("publicDiagramUrl")+":"),O.appendChild(c),+y=document.createElement("a"),y.setAttribute("href",l),y.setAttribute("title",l),y.style.whiteSpace="nowrap",y.style.overflow="hidden",y.style.textOverflow="ellipsis",y.style.display="block",y.style.margin="2px",y.style.fontSize="10pt",mxUtils.write(y,l),mxEvent.addListener(y,"click",function(D){b.openLink(l);mxEvent.consume(D)}),c=document.createElement("td"),c.appendChild(y),O.appendChild(c),x.appendChild(O));null!=z&&null!=z.fileObject&&null!=z.fileObject.path&&(O=document.createElement("tr"),+c=document.createElement("td"),c.style.whiteSpace="nowrap",c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.fontSize="10pt",mxUtils.write(c,mxResources.get("pathFilename")+":"),O.appendChild(c),y=document.createElement("input"),y.setAttribute("title",z.fileObject.path),y.setAttribute("value",z.fileObject.path),y.setAttribute("disabled","disabled"),y.style.boxSizing="border-box",y.style.width="100%",c=document.createElement("td"),c.appendChild(y),O.appendChild(c),x.appendChild(O));+this.init=null!=this.init?this.init:function(){};y=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&K(function(){b.spinner.stop();b.hideDialog()},function(D){b.spinner.stop();b.handleError(D,mxResources.get("error"))})});y.className="geBtn gePrimaryBtn";O=document.createElement("tr");c=document.createElement("td");c.colSpan=2;c.style.paddingTop="20px";c.style.whiteSpace="nowrap";c.setAttribute("align","right");E=mxUtils.button(mxResources.get("cancel"),+function(){b.hideDialog()});E.className="geBtn";b.editor.cancelFirst&&c.appendChild(E);null!=b.fileNode&&(R=mxUtils.button(mxResources.get("editData")+"...",function(){b.hideDialog();var D={};try{var N=b.fileNode.getAttribute("vars");null!=N&&0<N.length&&(D=JSON.parse(N))}catch(V){}N=mxUtils.createXmlDocument().createElement("object");N.setAttribute("label","");for(var F in D)N.setAttribute(F,D[F]);D=b.createTemporaryGraph(b.editor.graph.getStylesheet());var U=new mxCell(N);D.getModel().add(D.getDefaultParent(),+U);D.getModel().addListener(mxEvent.CHANGE,function(V,n){V=n.getProperty("edit").changes;for(n=0;n<V.length;n++)if(V[n]instanceof mxValueChange&&V[n].cell===U){for(var v={},G=V[n].value.attributes,H=0;H<G.length;H++)"label"!=G[H].nodeName&&(v[G[H].nodeName]=G[H].nodeValue);v=JSON.stringify(v);"{}"==v?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",v);b.updateFileVars();b.editor.graph.refresh();v=b.getCurrentFile();null!=v&&v.fileChanged()}});D=new EditDataDialog(b,U,D);b.showDialog(D.container,+480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));D.init()}),R.className="geBtn",c.appendChild(R));c.appendChild(y);b.editor.cancelFirst||c.appendChild(E);O.appendChild(c);x.appendChild(O);f.appendChild(x);this.container=f},ConnectionPointsDialog=function(b,l){function p(){null!=x&&x.destroy()}var f=document.createElement("div");f.style.userSelect="none";f.style.display="flex";f.style.flexDirection="column";f.style.height="100%";var x=null;this.init=function(){function z(H,I,g){var q="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="++b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";H=new mxCell("",new mxGeometry(H,I,6,6),q);H.vertex=!0;H.cp=!0;H.constObj=g;return O.addCell(H)}function y(H){H=O.getSelectionCells();O.deleteCells(H)}function E(){var H=parseInt(V.value)||0;H=0>H?0:100<H?100:H;V.value=H;var I=parseInt(v.value)||0;I=0>I?0:100<I?100:I;v.value=I;var g=parseInt(n.value)||0,q=parseInt(G.value)||0;g=new mxConnectionConstraint(new mxPoint(H/100,I/100),!1,null,g,q);H=O.getConnectionPoint(k,g);I=O.getSelectionCell();+if(null!=I){I.constObj=g;g=I.geometry.clone();q=O.view.scale;var C=O.view.translate;g.x=(H.x-3*q)/q-C.x;g.y=(H.y-3*q)/q-C.y;O.model.setGeometry(I,g)}}function R(H){if(H.constObj)return{x:H.constObj.point.x,y:H.constObj.point.y,dx:H.constObj.dx,dy:H.constObj.dy};var I=0,g=0,q=c.geometry,C=mxUtils.format((H.geometry.x+3-q.x)/q.width);H=mxUtils.format((H.geometry.y+3-q.y)/q.height);0>C?(I=C*q.width,C=0):1<C&&(I=(C-1)*q.width,C=1);0>H?(g=H*q.height,H=0):1<H&&(g=(H-1)*q.height,H=1);return{x:C,y:H,dx:parseInt(I),+dy:parseInt(g)}}function K(H){if(1==O.getSelectionCount()){var I=O.getSelectionCell();H&&(I.constObj=null);H=R(I);V.value=100*H.x;v.value=100*H.y;n.value=H.dx;G.value=H.dy;U.style.visibility=""}else U.style.visibility="hidden"}var L=document.createElement("div");L.style.flex="1";L.style.minHeight="0";L.style.overflow="hidden";L.style.borderStyle="solid";L.style.borderWidth="1px";L.style.boxSizing="border-box";mxEvent.disableContextMenu(L);f.appendChild(L);var O=new Graph(L);O.transparentBackground=+!1;O.autoExtend=!1;O.autoScroll=!1;O.setGridEnabled(!1);O.setEnabled(!0);O.setPanning(!0);O.setConnectable(!1);O.setTooltips(!1);O.minFitScale=null;O.maxFitScale=null;O.centerZoom=!0;O.maxFitScale=2;L=l.geometry;var c=new mxCell(l.value,new mxGeometry(0,0,L.width,L.height),l.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");c.vertex=!0;O.addCell(c);O.dblClick=function(H,I){if(null!=I&&I!=c)O.setSelectionCell(I);else{I=mxUtils.convertPoint(O.container,mxEvent.getClientX(H),+mxEvent.getClientY(H));mxEvent.consume(H);H=O.view.scale;var g=O.view.translate;O.setSelectionCell(z((I.x-3*H)/H-g.x,(I.y-3*H)/H-g.y))}};x=new mxKeyHandler(O);x.bindKey(46,y);x.bindKey(8,y);O.getRubberband().isForceRubberbandEvent=function(H){return 0==H.evt.button&&(null==H.getCell()||H.getCell()==c)};O.panningHandler.isForcePanningEvent=function(H){return 2==H.evt.button};var d=O.isCellSelectable;O.isCellSelectable=function(H){return H==c?!1:d.apply(this,arguments)};O.getLinkForCell=function(){return null};+var k=O.view.getState(c);L=O.getAllConnectionConstraints(k);for(var m=0;null!=L&&m<L.length;m++){var t=O.getConnectionPoint(k,L[m]);z(t.x-3,t.y-3,L[m])}m=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){O.zoomIn()});t=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){O.zoomOut()});var u=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==O.view.scale?(O.maxFitScale=8,O.fit(8)):O.zoomActual();O.center()}),A=function(){b.prompt(mxResources.get("gridSize"),+O.gridSize,function(H){!isNaN(H)&&0<H&&(O.setGridSize(H),O.setGridEnabled(!0),O.refresh())})},B=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(H){mxEvent.isShiftDown(H)?A():(O.setGridEnabled(!O.isGridEnabled()),O.refresh())});mxEvent.addListener(B,"dblclick",A);var D=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),y);mxUtils.setOpacity(D,10);L=document.createElement("div");L.style.display="flex";L.style.flexShrink="0";L.style.alignItems="center";L.style.paddingTop=+"6px";L.appendChild(m);L.appendChild(t);L.appendChild(u);L.appendChild(B);L.appendChild(D);f.appendChild(L);var N=document.createElement("input");N.setAttribute("type","number");N.setAttribute("min","1");N.setAttribute("value","1");N.style.width="45px";N.style.position="relative";N.style.margin="0 4px 0 4px";var F=document.createElement("select");F.style.position="relative";t=["left","right","top","bottom"];for(m=0;m<t.length;m++)u=t[m],B=document.createElement("option"),mxUtils.write(B,mxResources.get(u)),+B.value=u,F.appendChild(B);m=mxUtils.button(mxResources.get("add"),function(){var H=parseInt(N.value);H=1>H?1:100<H?100:H;N.value=H;for(var I=F.value,g=c.geometry,q=[],C=0;C<H;C++){switch(I){case "left":var J=g.x;var M=g.y+(C+1)*g.height/(H+1);break;case "right":J=g.x+g.width;M=g.y+(C+1)*g.height/(H+1);break;case "top":J=g.x+(C+1)*g.width/(H+1);M=g.y;break;case "bottom":J=g.x+(C+1)*g.width/(H+1),M=g.y+g.height}q.push(z(J-3,M-3))}O.setSelectionCells(q)});m.style.marginLeft="auto";L.appendChild(m);+L.appendChild(N);L.appendChild(F);var U=document.createElement("div");U.style.flexShrink="0";U.style.margin="4px 0px 8px 0px";U.style.whiteSpace="nowrap";U.style.height="24px";L=document.createElement("span");mxUtils.write(L,mxResources.get("dx"));U.appendChild(L);var V=document.createElement("input");V.setAttribute("type","number");V.setAttribute("min","0");V.setAttribute("max","100");V.style.width="45px";V.style.margin="0 4px 0 4px";U.appendChild(V);mxUtils.write(U,"%");var n=document.createElement("input");+n.setAttribute("type","number");n.style.width="45px";n.style.margin="0 4px 0 4px";U.appendChild(n);mxUtils.write(U,"pt");L=document.createElement("span");mxUtils.write(L,mxResources.get("dy"));L.style.marginLeft="12px";U.appendChild(L);var v=document.createElement("input");v.setAttribute("type","number");v.setAttribute("min","0");v.setAttribute("max","100");v.style.width="45px";v.style.margin="0 4px 0 4px";U.appendChild(v);mxUtils.write(U,"%");var G=document.createElement("input");G.setAttribute("type",+"number");G.style.width="45px";G.style.margin="0 4px 0 4px";U.appendChild(G);mxUtils.write(U,"pt");f.appendChild(U);K();O.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<O.getSelectionCount()?mxUtils.setOpacity(D,60):mxUtils.setOpacity(D,10);K()});O.addListener(mxEvent.CELLS_MOVED,K);mxEvent.addListener(V,"change",E);mxEvent.addListener(v,"change",E);mxEvent.addListener(n,"change",E);mxEvent.addListener(G,"change",E);L=mxUtils.button(mxResources.get("cancel"),function(){p();b.hideDialog()});+L.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){var H=O.model.cells,I=[],g=[],q;for(q in H){var C=H[q];C.cp&&g.push(R(C))}g.sort(function(J,M){return J.x!=M.x?J.x-M.x:J.y!=M.y?J.y-M.y:J.dx!=M.dx?J.dx-M.dx:J.dy-M.dy});for(H=0;H<g.length;H++)0<H&&g[H].x==g[H-1].x&&g[H].y==g[H-1].y&&g[H].dx==g[H-1].dx&&g[H].dy==g[H-1].dy||I.push("["+g[H].x+","+g[H].y+",0,"+g[H].dx+","+g[H].dy+"]");b.editor.graph.setCellStyles("points","["+I.join(",")+"]",[l]);p();b.hideDialog()});m.className=+"geBtn gePrimaryBtn";t=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[l]);p();b.hideDialog()});t.className="geBtn";u=document.createElement("div");u.style.flexShrink="0";u.style.marginTop="10px";u.style.textAlign="right";b.isOffline()||u.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&u.appendChild(L);u.appendChild(t);u.appendChild(m);b.editor.cancelFirst||u.appendChild(L);f.appendChild(u);+O.fit(8);O.center()};this.destroy=p;this.container=f},PolygonDialog=function(b,l,p){function f(ca){var da=ha.getBoundingClientRect();if(0<da.width&&0<da.height){var ua=n+G/2,ka=v+H/2;I=Math.max(.05,Math.min(5,ca));G=da.width*I;H=da.height*I;n=ua-G/2;v=ka-H/2;x()}}function x(){ha.setAttribute("viewBox",n+" "+v+" "+G+" "+H);var ca=aa.getBoundingClientRect();if(!(0>=ca.width||0>=ca.height)){var da=ca.width-12,ua=Math.max(20,da*Math.min(1,G/1200)),ka=1200-G;ka=0<ka?(n- -400)/ka:.5;ka=Math.max(0,Math.min(1,+ka));qa.style.width=ua+"px";qa.style.left=ka*(da-ua)+"px";ca=ca.height-12;da=Math.max(20,ca*Math.min(1,H/1200));ua=1200-H;ua=0<ua?(v- -400)/ua:.5;ua=Math.max(0,Math.min(1,ua));ia.style.height=da+"px";ia.style.top=ua*(ca-da)+"px"}}function z(ca){return A?20*Math.round(ca/20):Math.round(ca)}function y(ca){var da=ha.getBoundingClientRect(),ua=v+((null!=ca.touches?ca.touches[0].clientY:ca.clientY)-da.top)/da.height*H;return{x:z(n+((null!=ca.touches?ca.touches[0].clientX:ca.clientX)-da.left)/da.width*+G),y:z(ua)}}function E(ca){var da=ha.getBoundingClientRect(),ua=n+((null!=ca.touches?ca.touches[0].clientX:ca.clientX)-da.left)/da.width*G;ca=v+((null!=ca.touches?ca.touches[0].clientY:ca.clientY)-da.top)/da.height*H;da=G/400*9;if(u&&2<m.length&&"Q"===m[0].type){var ka=m[0].cx-ua,ya=m[0].cy-ca;if(Math.sqrt(ka*ka+ya*ya)<=da)return{type:"control",index:0}}for(var va=1;va<m.length;va++)if("Q"===m[va].type&&(ka=m[va].cx-ua,ya=m[va].cy-ca,Math.sqrt(ka*ka+ya*ya)<=da))return{type:"control",index:va};for(va=+0;va<m.length;va++)if(ka=m[va].x-ua,ya=m[va].y-ca,Math.sqrt(ka*ka+ya*ya)<=da)return{type:"vertex",index:va};return null}function R(){B.push(JSON.stringify(m));D=[];O()}function K(){0<B.length&&(D.push(JSON.stringify(m)),m=JSON.parse(B.pop()),t=Math.min(t,m.length-1),c(),O())}function L(){0<D.length&&(B.push(JSON.stringify(m)),m=JSON.parse(D.pop()),t=Math.min(t,m.length-1),c(),O())}function O(){null!=Ca&&(Ca.style.opacity=0<B.length?"1":"0.3",Ca.style.pointerEvents=0<B.length?"":"none");null!=za&&+(za.style.opacity=0<D.length?"1":"0.3",za.style.pointerEvents=0<D.length?"":"none")}function c(){for(var ca="",da=0;da<m.length;da++)ca=0===da?ca+("M"+m[da].x+" "+m[da].y):"Q"===m[da].type?ca+("Q"+m[da].cx+" "+m[da].cy+" "+m[da].x+" "+m[da].y):ca+("L"+m[da].x+" "+m[da].y);u&&2<m.length&&("Q"===m[0].type&&(ca+="Q"+m[0].cx+" "+m[0].cy+" "+m[0].x+" "+m[0].y),ca+="Z");fa.setAttribute("d",ca);for(fa.setAttribute("fill",u&&2<m.length?"rgba(66, 133, 244, 0.1)":"none");ma.firstChild;)ma.removeChild(ma.firstChild);+for(da=1;da<m.length;da++)"Q"===m[da].type&&(ca=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ca.setAttribute("points",m[da-1].x+","+m[da-1].y+" "+m[da].cx+","+m[da].cy+" "+m[da].x+","+m[da].y),ca.setAttribute("fill","none"),ca.setAttribute("stroke","#f0a030"),ca.setAttribute("stroke-width","1"),ca.setAttribute("stroke-dasharray","4,3"),ma.appendChild(ca));u&&2<m.length&&"Q"===m[0].type&&(da=document.createElementNS("http://www.w3.org/2000/svg","polyline"),da.setAttribute("points",+m[m.length-1].x+","+m[m.length-1].y+" "+m[0].cx+","+m[0].cy+" "+m[0].x+","+m[0].y),da.setAttribute("fill","none"),da.setAttribute("stroke","#f0a030"),da.setAttribute("stroke-width","1"),da.setAttribute("stroke-dasharray","4,3"),ma.appendChild(da));for(;sa.firstChild;)sa.removeChild(sa.firstChild);for(da=0;da<m.length;da++)ca=document.createElementNS("http://www.w3.org/2000/svg","circle"),ca.setAttribute("cx",m[da].x),ca.setAttribute("cy",m[da].y),ca.setAttribute("r",5),ca.setAttribute("fill",da===+t?"#ff4444":"#4285f4"),ca.setAttribute("stroke","#fff"),ca.setAttribute("stroke-width","1.5"),ca.style.cursor="move",sa.appendChild(ca);for(;ta.firstChild;)ta.removeChild(ta.firstChild);for(da=1;da<m.length;da++)"Q"===m[da].type&&(ca=document.createElementNS("http://www.w3.org/2000/svg","rect"),ca.setAttribute("x",m[da].cx-5),ca.setAttribute("y",m[da].cy-5),ca.setAttribute("width",10),ca.setAttribute("height",10),ca.setAttribute("fill",da===t?"#ff8800":"#f0a030"),ca.setAttribute("stroke","#fff"),+ca.setAttribute("stroke-width","1.5"),ca.style.cursor="move",ta.appendChild(ca));u&&2<m.length&&"Q"===m[0].type&&(da=document.createElementNS("http://www.w3.org/2000/svg","rect"),da.setAttribute("x",m[0].cx-5),da.setAttribute("y",m[0].cy-5),da.setAttribute("width",10),da.setAttribute("height",10),da.setAttribute("fill",0===t?"#ff8800":"#f0a030"),da.setAttribute("stroke","#fff"),da.setAttribute("stroke-width","1.5"),da.style.cursor="move",ta.appendChild(da));d()}function d(){pa.innerHTML="";if(0===+m.length){var ca=document.createElement("div");ca.style.padding="20px 10px";ca.style.textAlign="center";ca.style.opacity="0.5";ca.style.fontSize="12px";mxUtils.write(ca,mxResources.get("clickToAdd"));pa.appendChild(ca)}else for(ca=0;ca<m.length;ca++)(function(da){var ua=document.createElement("div");ua.style.display="flex";ua.style.alignItems="center";ua.style.padding="2px 4px";ua.style.gap="4px";ua.style.borderRadius="3px";ua.style.marginBottom="2px";ua.style.fontSize="12px";ua.setAttribute("draggable",+"true");ua.setAttribute("data-idx",da);da===t&&(ua.style.backgroundColor="rgba(66, 133, 244, 0.15)");ua.style.cursor="pointer";mxEvent.addListener(ua,"click",function(){t=da;c()});var ka=document.createElement("span");ka.innerHTML="☰";ka.style.cursor="grab";ka.style.fontSize="11px";ka.style.opacity="0.4";ka.style.flexShrink="0";ua.appendChild(ka);ka=document.createElement("span");ka.style.minWidth="18px";ka.style.fontWeight="bold";mxUtils.write(ka,da+1+"");ua.appendChild(ka);ka=document.createElement("input");+ka.type="number";ka.value=Math.round(m[da].x);ka.style.width="48px";ka.style.fontSize="11px";ka.style.padding="1px 3px";ka.title="X";mxEvent.addListener(ka,"change",function(){R();m[da].x=parseInt(this.value)||0;c()});mxEvent.addListener(ka,"click",function(va){va.stopPropagation()});ua.appendChild(ka);ka=document.createElement("input");ka.type="number";ka.value=Math.round(m[da].y);ka.style.width="48px";ka.style.fontSize="11px";ka.style.padding="1px 3px";ka.title="Y";mxEvent.addListener(ka,"change",+function(){R();m[da].y=parseInt(this.value)||0;c()});mxEvent.addListener(ka,"click",function(va){va.stopPropagation()});ua.appendChild(ka);if(0<da||0===da&&u&&2<m.length){ka=document.createElement("label");ka.style.display="flex";ka.style.alignItems="center";ka.style.cursor="pointer";ka.style.flexShrink="0";ka.title=mxResources.get("curved");var ya=document.createElement("input");ya.type="checkbox";ya.checked="Q"===m[da].type;ya.style.margin="0";mxEvent.addListener(ya,"click",function(va){va.stopPropagation()});+mxEvent.addListener(ya,"change",function(){R();if("Q"===m[da].type)m[da].type="L",delete m[da].cx,delete m[da].cy;else{var va=0<da?m[da-1]:m[m.length-1];var Ga=m[da];var Ka=(va.x+Ga.x)/2;var Wa=(va.y+Ga.y)/2;var Pa=Ga.x-va.x,ob=Ga.y-va.y;va=Math.sqrt(Pa*Pa+ob*ob);0!==va&&(Ga=.25*va,Ka=Math.round(Ka+-ob/va*Ga),Wa=Math.round(Wa+Pa/va*Ga));m[da].type="Q";m[da].cx=Ka;m[da].cy=Wa}c()});ka.appendChild(ya);ua.appendChild(ka)}ka=document.createElement("img");ka.setAttribute("src",Editor.trashImage);ka.style.cursor=+"pointer";ka.style.marginLeft="auto";ka.style.width="14px";ka.style.height="14px";ka.style.opacity="0.5";ka.style.flexShrink="0";ka.title=mxResources.get("delete");Editor.isDarkMode()&&(ka.style.filter="invert(1)");mxEvent.addListener(ka,"click",function(va){va.stopPropagation();R();m.splice(da,1);t>=m.length&&(t=m.length-1);c()});ua.appendChild(ka);mxEvent.addListener(ua,"dragstart",function(va){T=da;ua.style.opacity="0.4";va.dataTransfer.effectAllowed="move";va.dataTransfer.setData("text/plain",+""+da);va.stopPropagation()});mxEvent.addListener(ua,"dragover",function(va){va.preventDefault();va.stopPropagation();va.dataTransfer.dropEffect="move";va=parseInt(ua.getAttribute("data-idx"));null!==T&&va!==T&&(ua.style.borderTop=va<T?"2px solid #4285f4":"",ua.style.borderBottom=va>T?"2px solid #4285f4":"")});mxEvent.addListener(ua,"dragleave",function(va){ua.style.borderTop="";ua.style.borderBottom=""});mxEvent.addListener(ua,"drop",function(va){va.preventDefault();va.stopPropagation();ua.style.borderTop=+"";ua.style.borderBottom="";var Ga=parseInt(ua.getAttribute("data-idx"));null!==T&&Ga!==T&&(R(),va=m.splice(T,1)[0],Ga=Ga>T?Ga-1:Ga,m.splice(Ga,0,va),t===T?t=Ga:T<t&&Ga>=t?t--:T>t&&Ga<=t&&t++,c());T=null});mxEvent.addListener(ua,"dragend",function(va){ua.style.opacity="";ua.style.borderTop="";ua.style.borderBottom="";T=null});pa.appendChild(ua)})(ca)}var k=b.editor.graph,m=[],t=-1,u=!0,A=!0,B=[],D=[],N=-1,F=null,U=!1,V=!1,n=0,v=0,G=400,H=400,I=1,g=!1,q=0,C=0,J=0,M=0,Q=!1,T=null,P=k.view.getState(l);+if(null!=P)try{var S=JSON.parse(mxUtils.getValue(P.style,"polyCoords","[]")),W=JSON.parse(mxUtils.getValue(P.style,"polyCurves","[]")),X=mxUtils.getValue(P.style,"polyline",0);u=!(1==X||!0===X||"true"===X||"1"===X);for(P=0;P<S.length;P++){var Y={x:Math.round(400*S[P][0]),y:Math.round(400*S[P][1]),type:"L"};0<P&&W.length>P-1&&null!=W[P-1]&&3<=W[P-1].length&&"Q"===W[P-1][0]&&(Y.type="Q",Y.cx=Math.round(400*W[P-1][1]),Y.cy=Math.round(400*W[P-1][2]));m.push(Y)}u&&2<S.length&&W.length>=S.length&&null!=+W[S.length-1]&&3<=W[S.length-1].length&&"Q"===W[S.length-1][0]&&(m[0].type="Q",m[0].cx=Math.round(400*W[S.length-1][1]),m[0].cy=Math.round(400*W[S.length-1][2]))}catch(ca){}var Z=document.createElement("div");Z.style.userSelect="none";Z.setAttribute("tabindex","0");Z.style.outline="none";Z.style.position="absolute";Z.style.left="30px";Z.style.right="30px";Z.style.top="30px";Z.style.bottom="30px";S=document.createElement("div");S.style.display="flex";S.style.gap="10px";S.style.position="absolute";+S.style.left="0px";S.style.right="0px";S.style.top="0px";S.style.bottom="40px";Z.appendChild(S);var aa=document.createElement("div");aa.style.border="1px solid";aa.style.borderColor="inherit";aa.style.borderRadius="4px";aa.style.flexGrow="1";aa.style.flexShrink="1";aa.style.minWidth="200px";aa.style.position="relative";aa.style.overflow="hidden";S.appendChild(aa);var ha=document.createElementNS("http://www.w3.org/2000/svg","svg");ha.setAttribute("width","100%");ha.setAttribute("height","100%");ha.setAttribute("viewBox",+"0 0 400 400");ha.style.display="block";ha.style.cursor="crosshair";W=document.createElementNS("http://www.w3.org/2000/svg","defs");Y=document.createElementNS("http://www.w3.org/2000/svg","pattern");P="polygonGrid_"+Date.now();Y.setAttribute("id",P);Y.setAttribute("width",20);Y.setAttribute("height",20);Y.setAttribute("patternUnits","userSpaceOnUse");X=document.createElementNS("http://www.w3.org/2000/svg","path");X.setAttribute("d","M 20 0 L 0 0 0 20");X.setAttribute("fill","none");X.setAttribute("stroke",+"#e0e0e0");X.setAttribute("stroke-width","0.5");Y.appendChild(X);W.appendChild(Y);ha.appendChild(W);var ja=document.createElementNS("http://www.w3.org/2000/svg","rect");ja.setAttribute("x","-5000");ja.setAttribute("y","-5000");ja.setAttribute("width","10000");ja.setAttribute("height","10000");ja.setAttribute("fill","url(#"+P+")");ha.appendChild(ja);var fa=document.createElementNS("http://www.w3.org/2000/svg","path");fa.setAttribute("fill","rgba(66, 133, 244, 0.1)");fa.setAttribute("stroke","#4285f4");+fa.setAttribute("stroke-width","2");ha.appendChild(fa);var ma=document.createElementNS("http://www.w3.org/2000/svg","g");ha.appendChild(ma);var sa=document.createElementNS("http://www.w3.org/2000/svg","g");ha.appendChild(sa);var ta=document.createElementNS("http://www.w3.org/2000/svg","g");ha.appendChild(ta);aa.appendChild(ha);var ra=document.createElement("div");ra.style.position="absolute";ra.style.bottom="0px";ra.style.left="0px";ra.style.right="12px";ra.style.height="12px";ra.style.backgroundColor=+"rgba(128,128,128,0.08)";var qa=document.createElement("div");qa.style.position="absolute";qa.style.top="2px";qa.style.height="8px";qa.style.borderRadius="4px";qa.style.backgroundColor="rgba(128,128,128,0.35)";qa.style.cursor="pointer";qa.style.minWidth="20px";ra.appendChild(qa);aa.appendChild(ra);var la=document.createElement("div");la.style.position="absolute";la.style.top="0px";la.style.right="0px";la.style.bottom="12px";la.style.width="12px";la.style.backgroundColor="rgba(128,128,128,0.08)";var ia=+document.createElement("div");ia.style.position="absolute";ia.style.left="2px";ia.style.width="8px";ia.style.borderRadius="4px";ia.style.backgroundColor="rgba(128,128,128,0.35)";ia.style.cursor="pointer";ia.style.minHeight="20px";la.appendChild(ia);aa.appendChild(la);var oa=!1,xa=!1,Aa=0,wa=0;mxEvent.addListener(qa,"mousedown",function(ca){oa=!0;Aa=ca.clientX;wa=n;ca.preventDefault();ca.stopPropagation()});mxEvent.addListener(ia,"mousedown",function(ca){xa=!0;Aa=ca.clientY;wa=v;ca.preventDefault();+ca.stopPropagation()});mxEvent.addListener(ra,"mousedown",function(ca){if(ca.target===ra){var da=ra.getBoundingClientRect().width,ua=ca.clientX-ra.getBoundingClientRect().left,ka=1200-G;0<ka&&(n=-400+ua/da*ka,x());ca.preventDefault();ca.stopPropagation()}});mxEvent.addListener(la,"mousedown",function(ca){if(ca.target===la){var da=la.getBoundingClientRect().height,ua=ca.clientY-la.getBoundingClientRect().top,ka=1200-H;0<ka&&(v=-400+ua/da*ka,x());ca.preventDefault();ca.stopPropagation()}});var ea=function(ca){if(oa){var da=+aa.getBoundingClientRect().width-12,ua=parseFloat(qa.style.width)||20,ka=1200-G;da>ua&&0<ka&&(n=wa+(ca.clientX-Aa)/(da-ua)*ka,x());ca.preventDefault()}xa&&(da=aa.getBoundingClientRect().height-12,ua=parseFloat(ia.style.height)||20,ka=1200-H,da>ua&&0<ka&&(v=wa+(ca.clientY-Aa)/(da-ua)*ka,x()),ca.preventDefault())},Da=function(ca){xa=oa=!1};mxEvent.addListener(document,"mousemove",ea);mxEvent.addListener(document,"mouseup",Da);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var ca=+ha.getBoundingClientRect();if(0<ca.width&&0<ca.height){var da=n+G/2,ua=v+H/2;G=ca.width*I;H=ca.height*I;n=da-G/2;v=ua-H/2;x()}})).observe(aa);var pa=document.createElement("div");pa.style.width="200px";pa.style.flexShrink="0";pa.style.overflowY="auto";pa.style.border="1px solid";pa.style.borderColor="inherit";pa.style.borderRadius="4px";pa.style.padding="4px";S.appendChild(pa);mxEvent.addGestureListeners(ha,function(ca){if(!Q&&1!==ca.button&&2!==ca.button){var da=E(ca);if(null!=da)N=da.index,F=da.type,+U=!0,V=!1,t=da.index;else{da=y(ca);R();if(2>m.length)m.push({x:da.x,y:da.y,type:"L"}),t=m.length-1;else{for(var ua=Infinity,ka=m.length-1,ya=u?m.length:m.length-1,va=0;va<ya;va++){var Ga=(va+1)%m.length;Ga=mxUtils.ptSegDistSq(m[va].x,m[va].y,m[Ga].x,m[Ga].y,da.x,da.y);Ga<ua&&(ua=Ga,ka=va)}m.splice(ka+1,0,{x:da.x,y:da.y,type:"L"});t=ka+1}N=t;F="vertex";V=U=!0}c();mxEvent.consume(ca)}},function(ca){if(U&&0<=N){V||(R(),V=!0);var da=y(ca);"control"===F?(m[N].cx=da.x,m[N].cy=da.y):(m[N].x=da.x,m[N].y=+da.y);c();mxEvent.consume(ca)}},function(ca){!Q&&1!==ca.button&&2!==ca.button&&U&&0<=N&&(U=!1,N=-1,F=null,mxEvent.consume(ca))});mxEvent.addListener(ha,"wheel",function(ca){ca.preventDefault();var da=ha.getBoundingClientRect(),ua=(ca.clientX-da.left)/da.width,ka=(ca.clientY-da.top)/da.height,ya=n+ua*G,va=v+ka*H;I=Math.max(.05,Math.min(5,I*(0<ca.deltaY?1.15:1/1.15)));G=da.width*I;H=da.height*I;n=ya-ua*G;v=va-ka*H;x()});mxEvent.addListener(ha,"contextmenu",function(ca){ca.preventDefault()});mxEvent.addListener(ha,+"mousedown",function(ca){if(1===ca.button||2===ca.button||0===ca.button&&Q)g=!0,q=ca.clientX,C=ca.clientY,J=n,M=v,ha.style.cursor="grabbing",ca.preventDefault()});var ba=function(ca){if(g){var da=ha.getBoundingClientRect();n=J-(ca.clientX-q)/da.width*G;v=M-(ca.clientY-C)/da.height*H;x();ca.preventDefault()}},na=function(ca){g&&(g=!1,ha.style.cursor=Q?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",ba);mxEvent.addListener(document,"mouseup",na);S=document.createElement("div");S.style.display=+"flex";S.style.alignItems="center";S.style.gap="6px";S.style.position="absolute";S.style.left="0px";S.style.right="0px";S.style.bottom="0px";S.style.height="34px";var Ca=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),function(){K()});S.appendChild(Ca);var za=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){L()});S.appendChild(za);W=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){f(I/1.15)});S.appendChild(W);W=b.createToolbarButton(Editor.zoomOutImage,+mxResources.get("zoomOut"),function(){f(1.15*I)});S.appendChild(W);W=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var ca=ha.getBoundingClientRect();if(0<ca.width&&0<ca.height){if(1==I)if(0<m.length){for(var da=m[0].x,ua=m[0].y,ka=m[0].x,ya=m[0].y,va=1;va<m.length;va++)da=Math.min(da,m[va].x),ua=Math.min(ua,m[va].y),ka=Math.max(ka,m[va].x),ya=Math.max(ya,m[va].y),"Q"===m[va].type&&(da=Math.min(da,m[va].cx),ua=Math.min(ua,m[va].cy),ka=Math.max(ka,m[va].cx),ya=Math.max(ya,+m[va].cy));ka=ka-da+40;ya=ya-ua+40;I=1/Math.min(ca.width/ka,ca.height/ya);G=ca.width*I;H=ca.height*I;n=da-20+(ka-G)/2;v=ua-20+(ya-H)/2}else I=1,G=ca.width,H=ca.height,n=(400-G)/2,v=(400-H)/2;else I=1,G=ca.width*I,H=ca.height*I,n=(400-G)/2,v=(400-H)/2;x()}});S.appendChild(W);W=mxUtils.button(mxResources.get("deleteAll"),function(){0<m.length&&(R(),m=[],t=-1,c())});W.className="geBtn";W.style.padding="2px 10px";W.style.fontSize="12px";S.appendChild(W);W=document.createElement("span");W.style.flexGrow=+"1";S.appendChild(W);W=document.createElement("label");W.style.display="flex";W.style.alignItems="center";W.style.gap="4px";W.style.fontSize="12px";W.style.cursor="pointer";W.style.whiteSpace="nowrap";Y=document.createElement("input");Y.type="checkbox";Y.checked=A;mxEvent.addListener(Y,"change",function(){A=this.checked;ja.style.display=A?"":"none"});W.appendChild(Y);mxUtils.write(W,mxResources.get("grid"));S.appendChild(W);W=document.createElement("label");W.style.display="flex";W.style.alignItems=+"center";W.style.gap="4px";W.style.fontSize="12px";W.style.cursor="pointer";W.style.whiteSpace="nowrap";Y=document.createElement("input");Y.type="checkbox";Y.checked=u;mxEvent.addListener(Y,"change",function(){u=this.checked;c()});W.appendChild(Y);mxUtils.write(W,mxResources.get("closePath"));S.appendChild(W);W=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});W.className="geBtn";Y=mxUtils.button(mxResources.get("apply"),function(){if(2>m.length)b.showError(mxResources.get("error"),+mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var ca=m[0].x,da=m[0].x,ua=m[0].y,ka=m[0].y,ya=0;ya<m.length;ya++)ca=Math.min(ca,m[ya].x),da=Math.max(da,m[ya].x),ua=Math.min(ua,m[ya].y),ka=Math.max(ka,m[ya].y),"Q"===m[ya].type&&(ca=Math.min(ca,m[ya].cx),da=Math.max(da,m[ya].cx),ua=Math.min(ua,m[ya].cy),ka=Math.max(ka,m[ya].cy));var va=da-ca,Ga=ka-ua,Ka=function(Pa){return 0<va?Math.round((Pa-ca)/va*100)/100:.5},Wa=function(Pa){return 0<Ga?Math.round((Pa-ua)/Ga*100)/100:.5};da=[];ka=+[];for(ya=0;ya<m.length;ya++)da.push([Ka(m[ya].x),Wa(m[ya].y)]),0<ya&&("Q"===m[ya].type?ka.push(["Q",Ka(m[ya].cx),Wa(m[ya].cy)]):ka.push([]));u&&2<m.length&&"Q"===m[0].type&&ka.push(["Q",Ka(m[0].cx),Wa(m[0].cy)]);if(null!=p)ya="shape=mxgraph.basic.polygon;polyCoords="+JSON.stringify(da)+";polyCurves="+JSON.stringify(ka)+";polyline="+(u?"0":"1")+";whiteSpace=wrap;html=1;",p(ya);else{ya=k.getCellGeometry(l);null!=ya&&(ya=ya.clone(),0<va&&(ya.x+=ca/400*ya.width,ya.width*=va/400),0<Ga&&(ya.y+=ua/400*+ya.height,ya.height*=Ga/400));k.getModel().beginUpdate();try{null!=ya&&k.getModel().setGeometry(l,ya),k.setCellStyles("polyCoords",JSON.stringify(da),[l]),k.setCellStyles("polyCurves",JSON.stringify(ka),[l]),k.setCellStyles("polyline",u?"0":"1",[l])}finally{k.getModel().endUpdate()}}b.hideDialog()}});Y.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(S.appendChild(W),S.appendChild(Y)):(S.appendChild(Y),S.appendChild(W));Z.appendChild(S);mxEvent.addListener(Z,"keydown",function(ca){32===ca.keyCode?+(Q||(Q=!0,ha.style.cursor="grab"),mxEvent.consume(ca)):46===ca.keyCode||8===ca.keyCode?0<=t&&t<m.length&&"INPUT"!==ca.target.tagName&&(R(),m.splice(t,1),t>=m.length&&(t=m.length-1),c(),mxEvent.consume(ca)):90===ca.keyCode&&(ca.ctrlKey||ca.metaKey)?(ca.shiftKey?L():K(),mxEvent.consume(ca)):89===ca.keyCode&&(ca.ctrlKey||ca.metaKey)&&(L(),mxEvent.consume(ca))});mxEvent.addListener(Z,"keyup",function(ca){32===ca.keyCode&&(Q=!1,g||(ha.style.cursor="crosshair"))});c();O();this.init=function(){Z.focus();+var ca=ha.getBoundingClientRect();0<ca.width&&0<ca.height&&(I=1,G=ca.width*I,H=ca.height*I,n=(400-G)/2,v=(400-H)/2,x())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",ea);mxEvent.removeListener(document,"mouseup",Da);mxEvent.removeListener(document,"mousemove",ba);mxEvent.removeListener(document,"mouseup",na)};this.container=Z};(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.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";Editor.thinShapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI5Ljc1IDI5Ljc1Wm0tMTMgNS40NXEuNC4wNS43NS4wNUgxOS4wNXY0LjY1cTAgLjI1LjE3NS40MjV0LjQyNS4xNzVIMzkuOXEuMjUgMCAuNDI1LS4xNzV0LjE3NS0uNDI1VjE5LjY1cTAtLjI1LS4xNzUtLjQyNXQtLjQyNS0uMTc1aC00LjY1VjE3LjVxMC0uMzUtLjA1LS43NWg0LjdxMS4xNSAwIDIgLjg3NS44NS44NzUuODUgMi4wMjVWMzkuOXEwIDEuMTUtLjg1IDItLjg1Ljg1LTIgLjg1SDE5LjY1cS0xLjE1IDAtMi4wMjUtLjg1dC0uODc1LTJabTEuNS0zLjk1cS01LjQ1IDAtOS4yMjUtMy44LTMuNzc1LTMuOC0zLjc3NS05LjIgMC01LjQ1IDMuNzc1LTkuMjI1UTEyLjggNS4yNSAxOC4yNSA1LjI1cTUuNCAwIDkuMiAzLjc3NSAzLjggMy43NzUgMy44IDkuMjI1IDAgNS40LTMuOCA5LjItMy44IDMuOC05LjIgMy44Wm0tLjA1LTIuM3E0LjQ1IDAgNy42LTMuMTI1IDMuMTUtMy4xMjUgMy4xNS03LjU3NXQtMy4xMjUtNy42UTIyLjcgNy41IDE4LjI1IDcuNXQtNy42IDMuMTI1UTcuNSAxMy43NSA3LjUgMTguMnQzLjEyNSA3LjZxMy4xMjUgMy4xNSA3LjU3NSAzLjE1Wm0uMDUtMTAuN1oiLz48L3N2Zz4=";@@ -12876,7 +12881,7 @@ update:"You are a helpful assistant that helps with the following draw.io diagraendpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",messages:[{role:"assistant",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.6 Opus",model:"claude-opus-4-6",config:"claude"},{name:"Claude 4.6 Sonnet",model:"claude-sonnet-4-6",config:"claude"},{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(g,q){return{name:q,dispName:g,-type:"bool",defVal:!1,isVisible:function(B,J){return 1==B.vertices.length?(J=J.editorUi.editor.graph.model,B=J.getParent(B.vertices[0]),J.isEdge(B)||J.isVertex(B)):!1},getValue:function(B,J){return"inherit"==mxUtils.getValue(B.style,q)},valueChanged:function(B,J,Q,N){J=N.editorUi.editor.graph;"1"==B?J.setCellStyles(q,"inherit",Q.vertices):J.setCellStyles(q,null,Q.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(g){g.refresh()}},{name:"enumerateValue",+type:"bool",defVal:!1,isVisible:function(C,J){return 1==C.vertices.length?(J=J.editorUi.editor.graph.model,C=J.getParent(C.vertices[0]),J.isEdge(C)||J.isVertex(C)):!1},getValue:function(C,J){return"inherit"==mxUtils.getValue(C.style,q)},valueChanged:function(C,J,M,Q){J=Q.editorUi.editor.graph;"1"==C?J.setCellStyles(q,"inherit",M.vertices):J.setCellStyles(q,null,M.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(g){g.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(g,q){return"1"==mxUtils.getValue(g.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(g,q){return"1"!=mxUtils.getValue(g.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(g,q){return"1"==mxUtils.getValue(g.style,"comic","0")||"1"==mxUtils.getValue(g.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(g,q){return"1"==mxUtils.getValue(g.style,"sketch","1"==urlParams.rough?"1":"0")&&0<g.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(g,q){return"1"==mxUtils.getValue(g.style,"sketch","1"==urlParams.rough?"1":"0")&&0<g.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(g,q){return"1"==mxUtils.getValue(g.style,"sketch","1"==urlParams.rough?"1":"0")&&0<g.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(g,q){return"1"==mxUtils.getValue(g.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(g,q){return"1"==mxUtils.getValue(g.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(g,q){return"1"==mxUtils.getValue(g.style,"sketch",@@ -12900,266 +12905,267 @@ 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,q){return q.editorUi.editor.graph.isCellConnectable(0<g.vertices.length&&0==g.edges.length?g.vertices[0]:null)},isVisible:function(g,q){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,q){g=0<g.vertices.length&&0==g.edges.length?g.vertices[0]:null;q=q.editorUi.editor.graph;return null!=g&&q.isSwimlane(g)},isVisible:function(g,q){return 0<g.vertices.length&&0==-g.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(g,q){g=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;q=q.editorUi.editor.graph;return null!=g&&(q.isSwimlane(g)||0<q.model.getChildCount(g))},isVisible:function(g,q){return 1==g.vertices.length&&0==g.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(g,q){var B=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;q=q.editorUi.editor.graph;return null!=-B&&(q.isContainer(B)&&"0"!=g.style.collapsible||!q.isContainer(B)&&"1"==g.style.collapsible)},isVisible:function(g,q){return 1==g.vertices.length&&0==g.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(g,q){return 1==g.vertices.length&&0==g.edges.length&&!q.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",+g.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(g,q){g=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;q=q.editorUi.editor.graph;return null!=g&&(q.isSwimlane(g)||0<q.model.getChildCount(g))},isVisible:function(g,q){return 1==g.vertices.length&&0==g.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(g,q){var C=1==g.vertices.length&&0==g.edges.length?g.vertices[0]:null;q=q.editorUi.editor.graph;return null!=+C&&(q.isContainer(C)&&"0"!=g.style.collapsible||!q.isContainer(C)&&"1"==g.style.collapsible)},isVisible:function(g,q){return 1==g.vertices.length&&0==g.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(g,q){return 1==g.vertices.length&&0==g.edges.length&&!q.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,q){q=q.editorUi.editor.graph.model;return 0<g.vertices.length?q.isVertex(q.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,q){g=0<g.vertices.length?q.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,q){return 0<g.vertices.length&&q.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,q){var B=mxUtils.getValue(g.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||q.editorUi.editor.graph.isSwimlane(g.vertices[0])||null==B||B==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,q){var C=mxUtils.getValue(g.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||q.editorUi.editor.graph.isSwimlane(g.vertices[0])||null==C||C==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,q){return 0<g.vertices.length&&q.editorUi.editor.graph.isContainer(g.vertices[0])}},{name:"expandToFront",dispName:"Expand to Front",type:"bool",defVal:!1,isVisible:function(g,q){return 0<g.vertices.length&&q.editorUi.editor.graph.isContainer(g.vertices[0])}},Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].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://app.diagrams.net,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://app.diagrams.net,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://app.diagrams.net,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://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.canvasSupported=!1;(function(){try{var g=document.createElement("canvas");Editor.canvasSupported=!(!g.getContext||!g.getContext("2d"))}catch(q){}})();Editor.useCanvasForExport=!1;(function(){try{var g=document.createElement("canvas"),q=new Image;q.onload=function(){try{g.getContext("2d").drawImage(q,0,0);var B=g.toDataURL("image/png");Editor.useCanvasForExport=null!=B&&6<B.length}catch(J){}};q.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(B){}})();-Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var g=document.createElement("canvas");g.width=g.height=1;var q=g.toDataURL("image/jpeg");Editor.jpgSupported=null!==q.match("image/jpeg");q=g.toDataURL("image/webp");Editor.webpSupported=null!==q.match("image/webp")}catch(B){}})();Editor.loadCompatibleCss=function(g){mxUtils.lightDarkColorSupported||mxUtils.get(g||"styles/grapheditor.css",mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus()){var B=document.createElement("style");-B.type="text/css";var J=B.appendChild,Q=document,N=Q.createTextNode;q=q.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(q=q.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(S){}J.call(B,N.call(Q,q));document.head.appendChild(B)}}))};Editor.replacePlaceholders=function(g,-q){var B=[];if(null!=g&&null!=q){for(var J=RegExp("{([^{}\"'=;]+)}","g"),Q,N=0;Q=J.exec(g);){var S=Q[0];if(2<S.length){var P=q(S.substring(1,S.length-1)),R=S;null!=P&&(R=P);B.push(g.substring(N,Q.index)+R);N=Q.index+S.length}}B.push(g.substring(N))}return B.join("")};Editor.executeSimpleJsonPath=function(g,q){q=q.replace(/^\$\.?/,"").split(".");q=$jscomp.makeIterator(q);for(var B=q.next();!B.done;B=q.next()){var J=B.value;if(!g)return[];if(B=J.match(/([^\[]+)\[(\d+)\]/))if(J=B[1],B=parseInt(B[2]),-g=g[J],Array.isArray(g)&&B<g.length)g=g[B];else return[];else g=g[J]}return void 0!==g?[g]:[]};Editor.createRoughCanvas=function(g){var q=rough.canvas({getContext:function(){return g}});q.draw=function(B){var J=B.sets||[];B=B.options||this.getDefaultOptions();for(var Q=0;Q<J.length;Q++){var N=J[Q];switch(N.type){case "path":null!=B.stroke&&this._drawToContext(g,N,B);break;case "fillPath":this._drawToContext(g,N,B);break;case "fillSketch":this.fillSketch(g,N,B)}}};q.fillSketch=function(B,J,Q){var N=-g.state.strokeColor,S=g.state.strokeWidth,P=g.state.strokeAlpha,R=g.state.dashed,W=Q.fillWeight;0>W&&(W=Q.strokeWidth/2);g.setStrokeAlpha(g.state.fillAlpha);g.setStrokeColor(Q.fill||"");g.setStrokeWidth(W);g.setDashed(!1);this._drawToContext(B,J,Q);g.setDashed(R);g.setStrokeWidth(S);g.setStrokeColor(N);g.setStrokeAlpha(P)};q._drawToContext=function(B,J,Q){B.begin();for(var N=0;N<J.ops.length;N++){var S=J.ops[N],P=S.data;switch(S.op){case "move":B.moveTo(P[0],P[1]);break;case "bcurveTo":B.curveTo(P[0],-P[1],P[2],P[3],P[4],P[5]);break;case "lineTo":B.lineTo(P[0],P[1])}}B.end();"fillPath"===J.type&&Q.filled?B.fill():B.stroke()};return q};(function(){function g(N,S,P){this.canvas=N;this.rc=S;this.shape=P;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,+Editor.canvasSupported=!1;(function(){try{var g=document.createElement("canvas");Editor.canvasSupported=!(!g.getContext||!g.getContext("2d"))}catch(q){}})();Editor.useCanvasForExport=!1;(function(){try{var g=document.createElement("canvas"),q=new Image;q.onload=function(){try{g.getContext("2d").drawImage(q,0,0);var C=g.toDataURL("image/png");Editor.useCanvasForExport=null!=C&&6<C.length}catch(J){}};q.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(C){}})();+Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var g=document.createElement("canvas");g.width=g.height=1;var q=g.toDataURL("image/jpeg");Editor.jpgSupported=null!==q.match("image/jpeg");q=g.toDataURL("image/webp");Editor.webpSupported=null!==q.match("image/webp")}catch(C){}})();Editor.loadCompatibleCss=function(g){mxUtils.lightDarkColorSupported||mxUtils.get(g||"styles/grapheditor.css",mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus()){var C=document.createElement("style");+C.type="text/css";var J=C.appendChild,M=document,Q=M.createTextNode;q=q.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(q=q.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(T){}J.call(C,Q.call(M,q));document.head.appendChild(C)}}))};Editor.replacePlaceholders=function(g,+q){var C=[];if(null!=g&&null!=q){for(var J=RegExp("{([^{}\"'=;]+)}","g"),M,Q=0;M=J.exec(g);){var T=M[0];if(2<T.length){var P=q(T.substring(1,T.length-1)),S=T;null!=P&&(S=P);C.push(g.substring(Q,M.index)+S);Q=M.index+T.length}}C.push(g.substring(Q))}return C.join("")};Editor.executeSimpleJsonPath=function(g,q){q=q.replace(/^\$\.?/,"").split(".");q=$jscomp.makeIterator(q);for(var C=q.next();!C.done;C=q.next()){var J=C.value;if(!g)return[];if(C=J.match(/([^\[]+)\[(\d+)\]/))if(J=C[1],C=parseInt(C[2]),+g=g[J],Array.isArray(g)&&C<g.length)g=g[C];else return[];else g=g[J]}return void 0!==g?[g]:[]};Editor.createRoughCanvas=function(g){var q=rough.canvas({getContext:function(){return g}});q.draw=function(C){var J=C.sets||[];C=C.options||this.getDefaultOptions();for(var M=0;M<J.length;M++){var Q=J[M];switch(Q.type){case "path":null!=C.stroke&&this._drawToContext(g,Q,C);break;case "fillPath":this._drawToContext(g,Q,C);break;case "fillSketch":this.fillSketch(g,Q,C)}}};q.fillSketch=function(C,J,M){var Q=+g.state.strokeColor,T=g.state.strokeWidth,P=g.state.strokeAlpha,S=g.state.dashed,W=M.fillWeight;0>W&&(W=M.strokeWidth/2);g.setStrokeAlpha(g.state.fillAlpha);g.setStrokeColor(M.fill||"");g.setStrokeWidth(W);g.setDashed(!1);this._drawToContext(C,J,M);g.setDashed(S);g.setStrokeWidth(T);g.setStrokeColor(Q);g.setStrokeAlpha(P)};q._drawToContext=function(C,J,M){C.begin();for(var Q=0;Q<J.ops.length;Q++){var T=J.ops[Q],P=T.data;switch(T.op){case "move":C.moveTo(P[0],P[1]);break;case "bcurveTo":C.curveTo(P[0],+P[1],P[2],P[3],P[4],P[5]);break;case "lineTo":C.lineTo(P[0],P[1])}}C.end();"fillPath"===J.type&&M.filled?C.fill():C.stroke()};return q};(function(){function g(Q,T,P){this.canvas=Q;this.rc=T;this.shape=P;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(N,S){var P=1;if(null!=this.shape.state){var R=this.shape.state.cell.id;if(null!=R)for(var W=0;W<R.length;W++)P=(P<<5)-P+R.charCodeAt(W)<<0}P={strokeWidth:this.canvas.state.strokeWidth,seed:P,preserveVertices:!0};R=this.rc.getDefaultOptions();P.stroke=-N?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;N=null;(P.filled=S)?(P.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,N=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):P.fill="";P.bowing=mxUtils.getValue(this.shape.style,"bowing",R.bowing);P.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",R.hachureAngle);P.curveFitting=mxUtils.getValue(this.shape.style,-"curveFitting",R.curveFitting);P.roughness=mxUtils.getValue(this.shape.style,"jiggle",R.roughness);P.simplification=mxUtils.getValue(this.shape.style,"simplification",R.simplification);P.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",R.disableMultiStroke);P.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",R.disableMultiStrokeFill);S=mxUtils.getValue(this.shape.style,"hachureGap",-1);P.hachureGap="auto"==S?-1:S;P.dashGap=mxUtils.getValue(this.shape.style,-"dashGap",S);P.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",S);P.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",S);S=mxUtils.getValue(this.shape.style,"fillWeight",-1);P.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!=P.fill&&(null!=N||0<=mxUtils.indexOf(S,mxUtils.hex2rgb(P.fill)))?"solid":R.fillStyle);P.fillStyle=S;return P};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 N=2;N<arguments.length;N+=2)this.lastX=arguments[N-1],this.lastY=arguments[N],-this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};g.prototype.lineTo=function(N,S){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,N,S),this.lastX=N,this.lastY=S)};g.prototype.moveTo=function(N,S){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,N,S),this.lastX=N,this.lastY=S,this.firstX=N,this.firstY=S)};g.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,-arguments):this.addOp(this.closeOp)};g.prototype.quadTo=function(N,S,P,R){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,N,S,P,R),this.lastX=P,this.lastY=R)};g.prototype.curveTo=function(N,S,P,R,W,X){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,N,S,P,R,W,X),this.lastX=W,this.lastY=X)};g.prototype.arcTo=function(N,S,P,R,W,X,Y){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var aa=mxUtils.arcToCurves(this.lastX,-this.lastY,N,S,P,R,W,X,Y);if(null!=aa)for(var ba=0;ba<aa.length;ba+=6)this.curveTo(aa[ba],aa[ba+1],aa[ba+2],aa[ba+3],aa[ba+4],aa[ba+5]);this.lastX=X;this.lastY=Y}};g.prototype.rect=function(N,S,P,R){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(N,S,P,R,this.getStyle(!0,!0)))};g.prototype.ellipse=function(N,S,P,R){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(N+-P/2,S+R/2,P,R,this.getStyle(!0,!0)))};g.prototype.roundrect=function(N,S,P,R,W,X){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(N+W,S),this.lineTo(N+P-W,S),this.quadTo(N+P,S,N+P,S+X),this.lineTo(N+P,S+R-X),this.quadTo(N+P,S+R,N+P-W,S+R),this.lineTo(N+W,S+R),this.quadTo(N,S+R,N,S+R-X),this.lineTo(N,S+X),this.quadTo(N,S,N+W,S))};g.prototype.drawPath=function(N){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),N)}catch(P){}this.passThrough=-!1}else if(null!=this.nextShape){for(var S in N)this.nextShape.options[S]=N[S];N.stroke!=mxConstants.NONE&&null!=N.stroke||delete this.nextShape.options.stroke;N.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.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(Q,T){var P=1;if(null!=this.shape.state){var S=this.shape.state.cell.id;if(null!=S)for(var W=0;W<S.length;W++)P=(P<<5)-P+S.charCodeAt(W)<<0}P={strokeWidth:this.canvas.state.strokeWidth,seed:P,preserveVertices:!0};S=this.rc.getDefaultOptions();P.stroke=+Q?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;Q=null;(P.filled=T)?(P.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,Q=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):P.fill="";P.bowing=mxUtils.getValue(this.shape.style,"bowing",S.bowing);P.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",S.hachureAngle);P.curveFitting=mxUtils.getValue(this.shape.style,+"curveFitting",S.curveFitting);P.roughness=mxUtils.getValue(this.shape.style,"jiggle",S.roughness);P.simplification=mxUtils.getValue(this.shape.style,"simplification",S.simplification);P.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",S.disableMultiStroke);P.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",S.disableMultiStrokeFill);T=mxUtils.getValue(this.shape.style,"hachureGap",-1);P.hachureGap="auto"==T?-1:T;P.dashGap=mxUtils.getValue(this.shape.style,+"dashGap",T);P.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",T);P.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",T);T=mxUtils.getValue(this.shape.style,"fillWeight",-1);P.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!=P.fill&&(null!=Q||0<=mxUtils.indexOf(T,mxUtils.hex2rgb(P.fill)))?"solid":S.fillStyle);P.fillStyle=T;return P};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 Q=2;Q<arguments.length;Q+=2)this.lastX=arguments[Q-1],this.lastY=arguments[Q],+this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};g.prototype.lineTo=function(Q,T){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,Q,T),this.lastX=Q,this.lastY=T)};g.prototype.moveTo=function(Q,T){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,Q,T),this.lastX=Q,this.lastY=T,this.firstX=Q,this.firstY=T)};g.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,+arguments):this.addOp(this.closeOp)};g.prototype.quadTo=function(Q,T,P,S){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,Q,T,P,S),this.lastX=P,this.lastY=S)};g.prototype.curveTo=function(Q,T,P,S,W,X){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,Q,T,P,S,W,X),this.lastX=W,this.lastY=X)};g.prototype.arcTo=function(Q,T,P,S,W,X,Y){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var Z=mxUtils.arcToCurves(this.lastX,+this.lastY,Q,T,P,S,W,X,Y);if(null!=Z)for(var aa=0;aa<Z.length;aa+=6)this.curveTo(Z[aa],Z[aa+1],Z[aa+2],Z[aa+3],Z[aa+4],Z[aa+5]);this.lastX=X;this.lastY=Y}};g.prototype.rect=function(Q,T,P,S){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(Q,T,P,S,this.getStyle(!0,!0)))};g.prototype.ellipse=function(Q,T,P,S){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(Q++P/2,T+S/2,P,S,this.getStyle(!0,!0)))};g.prototype.roundrect=function(Q,T,P,S,W,X){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(Q+W,T),this.lineTo(Q+P-W,T),this.quadTo(Q+P,T,Q+P,T+X),this.lineTo(Q+P,T+S-X),this.quadTo(Q+P,T+S,Q+P-W,T+S),this.lineTo(Q+W,T+S),this.quadTo(Q,T+S,Q,T+S-X),this.lineTo(Q,T+X),this.quadTo(Q,T,Q+W,T))};g.prototype.drawPath=function(Q){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),Q)}catch(P){}this.passThrough=+!1}else if(null!=this.nextShape){for(var T in Q)this.nextShape.options[T]=Q[T];Q.stroke!=mxConstants.NONE&&null!=Q.stroke||delete this.nextShape.options.stroke;Q.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(N){return new g(N,Editor.createRoughCanvas(N),this)};var q=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(N){return this.outline||-null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?q.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(N):this.createRoughCanvas(N)};var B=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(N,S,P,R,W){null!=N.handJiggle&&N.handJiggle.passThrough||B.apply(this,arguments)};var J=mxShape.prototype.paint;mxShape.prototype.paint=function(N){var S=N.addTolerance,P=!0;null!=this.style&&(P="1"==mxUtils.getValue(this.style,-mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=N.handJiggle&&N.handJiggle.constructor==g&&!this.outline){N.save();var R=this.fill,W=this.stroke;this.stroke=this.fill=null;var X=this.configurePointerEvents,Y=N.setStrokeColor;N.setStrokeColor=function(){};var aa=N.setFillColor;N.setFillColor=function(){};P||null==R||(this.configurePointerEvents=function(){});N.handJiggle.passThrough=!0;J.apply(this,arguments);N.handJiggle.passThrough=!1;N.setFillColor=aa;N.setStrokeColor=Y;this.configurePointerEvents=-X;this.stroke=W;this.fill=R;N.restore();P&&null!=R&&(N.addTolerance=function(){})}J.apply(this,arguments);N.addTolerance=S};var Q=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(N,S,P,R,W,X){null!=N.handJiggle&&N.handJiggle.constructor==g?(N.handJiggle.passThrough=!0,Q.apply(this,arguments),N.handJiggle.passThrough=!1):Q.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,q,B){if(null!=g&&"undefined"!==typeof pako){var J=g.ownerDocument.getElementsByTagName("div"),Q=[];if(null!=J&&0<J.length)for(var N=0;N<J.length;N++)if("mxgraph"==J[N].getAttribute("class")){Q.push(J[N]);break}0<Q.length&&(J=Q[0].getAttribute("data-mxgraph"),null!=J?(Q=JSON.parse(J),null!=Q&&null!=Q.xml&&(g=-mxUtils.parseXml(Q.xml),g=g.documentElement)):(Q=Q[0].getElementsByTagName("div"),0<Q.length&&(J=mxUtils.getTextContent(Q[0]),J=Graph.decompress(J,null,B),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||q||(Q=null,"diagram"==g.nodeName?Q=g:"mxfile"==g.nodeName&&(J=g.getElementsByTagName("diagram"),0<J.length&&(Q=J[Math.max(0,Math.min(J.length-1,urlParams.page||0))])),null!=Q&&(g=Editor.parseDiagramNode(Q,B)));null==g||"mxGraphModel"==g.nodeName||q&&"mxfile"==g.nodeName||(g=null);return g};Editor.parseDiagramNode=function(g,q,B){Editor.validateDiagramNode(g);var J=mxUtils.trim(mxUtils.getTextContent(g)),Q=null;0<J.length?(q=Graph.decompress(J,null,q),null!=q&&0<q.length&&(Q=mxUtils.parseXml(q).documentElement)):-(g=mxUtils.getChildNodes(g),0<g.length&&(Q=g[0],B&&(Q=Editor.parseDiagramNode(Q,q,!1)),q=mxUtils.createXmlDocument(),q.appendChild(q.importNode(Q,!0)),Q=q.documentElement));return Q};Editor.getDiagramNodeXml=function(g){Editor.validateDiagramNode(g);var q=mxUtils.getNodeValue(g),B=null;0<q.length?B=Graph.decompress(q):(g=g.getElementsByTagName("mxGraphModel"),null!=g&&0<g.length&&(B=mxUtils.getXml(g[0])));return B};Editor.validateDiagramNode=function(g){if(0==mxUtils.trim(mxUtils.getTextContent(g)).length&&-0==mxUtils.getChildNodes(g).length){var q=new mxCodec,B=new mxGraphModel;g.appendChild(q.encode(B))}return g};Editor.extractGraphModelFromPdf=function(g){var q=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 B=g.indexOf("EmbeddedFile");if(-1<B){var J=g.indexOf("stream",B)+9;if(0<g.substring(B,J).indexOf("application#2Fvnd.jgraph.mxfile")){var Q=g.indexOf("endstream",J-1);return pako.inflateRaw(Graph.stringToArrayBuffer(g.substring(J,-Q)),{to:"string"})}}for(B=g.indexOf("/ObjStm");0<B;){J=g.indexOf("stream",B)+9;Q=g.indexOf("endstream",J-1);J=pako.inflateRaw(Graph.stringToArrayBuffer(g.substring(J,Q)),{to:"string"});Q=J.indexOf("/Subject <");if(0<Q){B=J.substring(Q+14,J.indexOf(">",Q));if(null!=B){q=B;B=[];for(J=0;J<q.length;J+=2)Q=q.substr(J,2),"00"!=Q&&B.push(String.fromCharCode(parseInt(Q,16)));q=B.join("")}break}B=g.indexOf("/ObjStm",B+1)}}if(null==q&&"%PDF-1.4"==g.substring(0,8)){B="";Q=J=0;for(var N=[],S=null;Q<g.length;){var P=-g.charCodeAt(Q);Q+=1;10!=P&&(B+=String.fromCharCode(P));P=="/Subject (%3Cmxfile".charCodeAt(J)?J++:J=0;if(19==J){var R=g.indexOf("%3C%2Fmxfile%3E",Q)+15;Q-=9;if(R>Q){q=g.substring(Q,R);break}}10==P&&("endobj"==B?S=null:"obj"==B.substring(B.length-3,B.length)||"xref"==B||"trailer"==B?(S=[],N[B.split(" ")[0]]=S):null!=S&&S.push(B),B="")}}null==q&&null!=N&&(q=Editor.extractGraphModelFromXref(N));null!=q&&(q=decodeURIComponent(q.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return q};Editor.extractGraphModelFromXref=-function(g){var q=g.trailer,B=null;null!=q&&(q=/.* \/Info (\d+) (\d+) R/g.exec(q.join("\n")),null!=q&&0<q.length&&(q=g[q[1]],null!=q&&(q=/.* \/Subject (\d+) (\d+) R/g.exec(q.join("\n")),null!=q&&0<q.length&&(g=g[q[1]],null!=g&&(g=g.join("\n"),B=g.substring(1,g.length-1))))));return B};Editor.extractParserError=function(g,q){var B=null;g=null!=g?g.getElementsByTagName("parsererror"):null;null!=g&&0<g.length&&(B=q||mxResources.get("invalidChars"),q=g[0].getElementsByTagName("div"),0<q.length&&(B=mxUtils.getTextContent(q[0])));-return null!=B?mxUtils.trim(B):B};Editor.addRetryToError=function(g,q){null!=g&&(g=null!=g.error?g.error:g,null==g.retry&&(g.retry=q))};Editor.mermaidToDrawio=function(g,q,B){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(g,q,B)};Editor.configure=function(g){if(null!=g){Editor.config=g;Editor.configVersion=g.version;g.debug&&(urlParams.test="1");g.passiveScroll&&(Editor.passiveScroll=!0);g.noResizers&&(Editor.noResizers=!0);g.preserveViewState&&(Editor.preserveViewState=!0);g.useInternalClipboard&&+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(Q){return new g(Q,Editor.createRoughCanvas(Q),this)};var q=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(Q){return this.outline||+null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?q.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(Q):this.createRoughCanvas(Q)};var C=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(Q,T,P,S,W){null!=Q.handJiggle&&Q.handJiggle.passThrough||C.apply(this,arguments)};var J=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){var T=Q.addTolerance,P=!0;null!=this.style&&(P="1"==mxUtils.getValue(this.style,+mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=Q.handJiggle&&Q.handJiggle.constructor==g&&!this.outline){Q.save();var S=this.fill,W=this.stroke;this.stroke=this.fill=null;var X=this.configurePointerEvents,Y=Q.setStrokeColor;Q.setStrokeColor=function(){};var Z=Q.setFillColor;Q.setFillColor=function(){};P||null==S||(this.configurePointerEvents=function(){});Q.handJiggle.passThrough=!0;J.apply(this,arguments);Q.handJiggle.passThrough=!1;Q.setFillColor=Z;Q.setStrokeColor=Y;this.configurePointerEvents=+X;this.stroke=W;this.fill=S;Q.restore();P&&null!=S&&(Q.addTolerance=function(){})}J.apply(this,arguments);Q.addTolerance=T};var M=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(Q,T,P,S,W,X){null!=Q.handJiggle&&Q.handJiggle.constructor==g?(Q.handJiggle.passThrough=!0,M.apply(this,arguments),Q.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,q,C){if(null!=g&&"undefined"!==typeof pako){var J=g.ownerDocument.getElementsByTagName("div"),M=[];if(null!=J&&0<J.length)for(var Q=0;Q<J.length;Q++)if("mxgraph"==J[Q].getAttribute("class")){M.push(J[Q]);break}0<M.length&&(J=M[0].getAttribute("data-mxgraph"),null!=J?(M=JSON.parse(J),null!=M&&null!=M.xml&&(g=+mxUtils.parseXml(M.xml),g=g.documentElement)):(M=M[0].getElementsByTagName("div"),0<M.length&&(J=mxUtils.getTextContent(M[0]),J=Graph.decompress(J,null,C),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||q||(M=null,"diagram"==g.nodeName?M=g:"mxfile"==g.nodeName&&(J=g.getElementsByTagName("diagram"),0<J.length&&(M=J[Math.max(0,Math.min(J.length-1,urlParams.page||0))])),null!=M&&(g=Editor.parseDiagramNode(M,C)));null==g||"mxGraphModel"==g.nodeName||q&&"mxfile"==g.nodeName||(g=null);return g};Editor.parseDiagramNode=function(g,q,C){Editor.validateDiagramNode(g);var J=mxUtils.trim(mxUtils.getTextContent(g)),M=null;0<J.length?(q=Graph.decompress(J,null,q),null!=q&&0<q.length&&(M=mxUtils.parseXml(q).documentElement)):+(g=mxUtils.getChildNodes(g),0<g.length&&(M=g[0],C&&(M=Editor.parseDiagramNode(M,q,!1)),q=mxUtils.createXmlDocument(),q.appendChild(q.importNode(M,!0)),M=q.documentElement));return M};Editor.getDiagramNodeXml=function(g){Editor.validateDiagramNode(g);var q=mxUtils.getNodeValue(g),C=null;0<q.length?C=Graph.decompress(q):(g=g.getElementsByTagName("mxGraphModel"),null!=g&&0<g.length&&(C=mxUtils.getXml(g[0])));return C};Editor.validateDiagramNode=function(g){if(0==mxUtils.trim(mxUtils.getTextContent(g)).length&&+0==mxUtils.getChildNodes(g).length){var q=new mxCodec,C=new mxGraphModel;g.appendChild(q.encode(C))}return g};Editor.extractGraphModelFromPdf=function(g){var q=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 C=g.indexOf("EmbeddedFile");if(-1<C){var J=g.indexOf("stream",C)+9;if(0<g.substring(C,J).indexOf("application#2Fvnd.jgraph.mxfile")){var M=g.indexOf("endstream",J-1);return pako.inflateRaw(Graph.stringToArrayBuffer(g.substring(J,+M)),{to:"string"})}}for(C=g.indexOf("/ObjStm");0<C;){J=g.indexOf("stream",C)+9;M=g.indexOf("endstream",J-1);J=pako.inflateRaw(Graph.stringToArrayBuffer(g.substring(J,M)),{to:"string"});M=J.indexOf("/Subject <");if(0<M){C=J.substring(M+14,J.indexOf(">",M));if(null!=C){q=C;C=[];for(J=0;J<q.length;J+=2)M=q.substr(J,2),"00"!=M&&C.push(String.fromCharCode(parseInt(M,16)));q=C.join("")}break}C=g.indexOf("/ObjStm",C+1)}}if(null==q&&"%PDF-1.4"==g.substring(0,8)){C="";M=J=0;for(var Q=[],T=null;M<g.length;){var P=+g.charCodeAt(M);M+=1;10!=P&&(C+=String.fromCharCode(P));P=="/Subject (%3Cmxfile".charCodeAt(J)?J++:J=0;if(19==J){var S=g.indexOf("%3C%2Fmxfile%3E",M)+15;M-=9;if(S>M){q=g.substring(M,S);break}}10==P&&("endobj"==C?T=null:"obj"==C.substring(C.length-3,C.length)||"xref"==C||"trailer"==C?(T=[],Q[C.split(" ")[0]]=T):null!=T&&T.push(C),C="")}}null==q&&null!=Q&&(q=Editor.extractGraphModelFromXref(Q));null!=q&&(q=decodeURIComponent(q.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return q};Editor.extractGraphModelFromXref=+function(g){var q=g.trailer,C=null;null!=q&&(q=/.* \/Info (\d+) (\d+) R/g.exec(q.join("\n")),null!=q&&0<q.length&&(q=g[q[1]],null!=q&&(q=/.* \/Subject (\d+) (\d+) R/g.exec(q.join("\n")),null!=q&&0<q.length&&(g=g[q[1]],null!=g&&(g=g.join("\n"),C=g.substring(1,g.length-1))))));return C};Editor.extractParserError=function(g,q){var C=null;g=null!=g?g.getElementsByTagName("parsererror"):null;null!=g&&0<g.length&&(C=q||mxResources.get("invalidChars"),q=g[0].getElementsByTagName("div"),0<q.length&&(C=mxUtils.getTextContent(q[0])));+return null!=C?mxUtils.trim(C):C};Editor.addRetryToError=function(g,q){null!=g&&(g=null!=g.error?g.error:g,null==g.retry&&(g.retry=q))};Editor.mermaidToDrawio=function(g,q,C){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(g,q,C)};Editor.configure=function(g){if(null!=g){Editor.config=g;Editor.configVersion=g.version;g.debug&&(urlParams.test="1");g.passiveScroll&&(Editor.passiveScroll=!0);g.noResizers&&(Editor.noResizers=!0);g.preserveViewState&&(Editor.preserveViewState=!0);g.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=g.useInternalClipboard);if(null!=g.customCss){var q=document.createElement("style");q.type="text/css";q.appendChild(document.createTextNode(g.customCss));document.head.appendChild(q)}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.pasteAtMousePointer&&(Editor.pasteAtMousePointer=g.pasteAtMousePointer);null!=g.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=g.fitDiagramOnLoad);null!=g.fitDiagramOnPage&&(Editor.fitDiagramOnPage=g.fitDiagramOnPage);-null!=g.showLinkIcons&&(Editor.showLinkIcons=g.showLinkIcons);null!=g.showTooltipIcons&&(Editor.showTooltipIcons=g.showTooltipIcons);null!=g.showConnectHandle&&(Editor.showConnectHandle=g.showConnectHandle);null!=g.enableInlineToolbar&&(Editor.enableInlineToolbar=g.enableInlineToolbar);null!=g.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=g.oneDriveInlinePicker);null!=g.enableNativeClipboard&&(Editor.enableNativeClipboard=g.enableNativeClipboard);null!=g.enableExportUrl&&(Editor.enableExportUrl=-g.enableExportUrl);null!=g.defaultAdaptiveColors?Graph.defaultAdaptiveColors=g.defaultAdaptiveColors:0==g.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=g.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=g.enableLightDarkColors);null!=g.darkColor&&(Editor.darkColor=g.darkColor);null!=g.darkColorVar&&(Editor.darkColorVar=g.darkColorVar);Graph.prototype.defaultPageBackgroundColor="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){q=document.createElement("style");q.setAttribute("type","text/css");q.appendChild(document.createTextNode(g.css));var B=document.getElementsByTagName("script")[0];B.parentNode.insertBefore(q,B)}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.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=g.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=g.defaultConnectionArrowsEnabled);null!=g.defaultConnectable&&(Graph.prototype.defaultConnectable=-g.defaultConnectable);null!=g.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=g.defaultFoldingEnabled);null!=g.zoomWheel&&(Graph.zoomWheel=g.zoomWheel);null!=g.zoomFactor&&(q=parseFloat(g.zoomFactor),!isNaN(q)&&1<q?Graph.prototype.zoomFactor=q:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=g.defaultGridSize&&(q=parseInt(g.defaultGridSize),!isNaN(q)&&0<q?mxGraph.prototype.gridSize=q:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));-null!=g.gridSteps&&(q=parseInt(g.gridSteps),!isNaN(q)&&0<q?mxGraphView.prototype.gridSteps=q:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=g.pageFormat&&(q=parseInt(g.pageFormat.width),B=parseInt(g.pageFormat.height),!isNaN(q)&&0<q&&!isNaN(B)&&0<B?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,q,B),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&&(q=parseInt(g.sidebarTitleSize),!isNaN(q)&&0<q?Sidebar.prototype.sidebarTitleSize=q: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&&(q=parseInt(g.autosaveDelay),!isNaN(q)&&0<q?DrawioFile.prototype.autosaveDelay=q: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.removeImageMetadata&&(Editor.removeImageMetadata=g.removeImageMetadata);null!=g.defaultTextStyle&&(Editor.defaultTextStyle=-g.defaultTextStyle);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.enableWindowDocking&&(Editor.enableWindowDocking=g.enableWindowDocking);null!=g.compact&&(EditorUi.prototype.defaultCompact=g.compact);null!=g.noAutoFocus&&(EditorUi.prototype.noAutoFocus=g.noAutoFocus);if(null!=g.hideMenuItems)if(Array.isArray(g.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},q=0;q<g.hideMenuItems.length;q++)Menus.prototype.hiddenMenuItems[g.hideMenuItems[q]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");-if(null!=g.hideMenus)if(Array.isArray(g.hideMenus)){var J={};for(q=0;q<g.hideMenus.length;q++)J[g.hideMenus[q]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(Q){return!J[Q]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=g.enableAi&&(Editor.enableAi=g.enableAi);null!=g.enableChatGpt&&(Editor.enableAi=g.enableChatGpt);null!=g.gptApiKey&&(Editor.aiGlobals.gptApiKey=g.gptApiKey);null!=g.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=-g.geminiApiKey);null!=g.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=g.claudeApiKey);null!=g.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=g.gptUrl);null!=g.aiActions&&(Editor.aiActions=g.aiActions);null!=g.aiGlobals&&(Editor.aiGlobals=g.aiGlobals);null!=g.aiConfigs&&(Editor.aiConfigs=g.aiConfigs);null!=g.aiModels&&(Editor.aiModels=g.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=-function(g){if(null!=g){Editor.prototype.fontCss=g;var q=document.getElementsByTagName("script")[0];if(null!=q&&null!=q.parentNode){var B=document.createElement("style");B.setAttribute("type","text/css");B.appendChild(document.createTextNode(g));q.parentNode.insertBefore(B,q);g=g.split("url(");for(B=1;B<g.length;B++){var J=g[B].indexOf(")");J=Editor.trimCssUrl(g[B].substring(0,J));var Q=document.createElement("link");Q.setAttribute("rel","preload");Q.setAttribute("href",J);Q.setAttribute("as","font");-Q.setAttribute("crossorigin","");q.parentNode.insertBefore(Q,q)}}}};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 q=[],B=0;B<g;B++)q.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*-Editor.GUID_ALPHABET.length)));return q.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.generateTimeout=6E4;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 q=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(q)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[g],"cause",[q]),Error(mxResources.get("notADiagramFile")+" ("+q+")");if("mxGraphModel"==g.nodeName){q=g.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=q&&""!=q)q!=this.graph.currentStyle&&(B=null!=this.graph.themes?this.graph.themes[q]:mxUtils.load(STYLE_PATH+"/"+q+".xml").getDocumentElement(),null!=B&&(J=new mxCodec(B.ownerDocument),-J.decode(B,this.graph.getStylesheet())));else{var B=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=B){var J=new mxCodec(B.ownerDocument);J.decode(B,this.graph.getStylesheet())}}this.graph.currentStyle=q;this.graph.mathEnabled="1"==urlParams.math||"1"==g.getAttribute("math");this.graph.setAdaptiveColors(g.getAttribute("adaptiveColors"));q=g.getAttribute("backgroundImage");null!=q?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(q)):-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(q=g.getAttribute("extFonts"))try{for(q=q.split("|").map(function(Q){Q=Q.split("^");return{name:Q[0],url:Q[1]}}),B=0;B<q.length;B++)this.graph.addExtFont(q[B].name,q[B].url)}catch(Q){console.log("ExtFonts format error: "+Q.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 l=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(g,q){g=null!=g?g:!0;var B=l.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&B.setAttribute("style",this.graph.currentStyle);var J=this.graph.getBackgroundImageObject(this.graph.backgroundImage,-q);null!=J&&B.setAttribute("backgroundImage",JSON.stringify(J));B.setAttribute("math",this.graph.mathEnabled?"1":"0");B.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?B.setAttribute("adaptiveColors",this.graph.adaptiveColors):B.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(J=this.graph.extFonts.map(function(Q){return Q.name+"^"+Q.url}),B.setAttribute("extFonts",J.join("|")));return B};Editor.prototype.isDataSvg=-function(g){try{var q=mxUtils.parseXml(g).documentElement.getAttribute("content");if(null!=q&&(null!=q&&"<"!=q.charAt(0)&&"%"!=q.charAt(0)&&(q=unescape(window.atob?atob(q):Base64.decode(cont,q))),null!=q&&"%"==q.charAt(0)&&(q=decodeURIComponent(q)),null!=q&&0<q.length)){var B=mxUtils.parseXml(q).documentElement;return"mxfile"==B.nodeName||"mxGraphModel"==B.nodeName}}catch(J){}return!1};Editor.prototype.extractGraphModel=function(g,q,B){return Editor.extractGraphModel.apply(this,arguments)};var p=-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();p.apply(this,arguments)};var f=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){f.apply(this,arguments);this.graph.useCssTransforms=-!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(g,q){if("undefined"===typeof window.MathJax){var B=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]),B()):J!=S&&Editor.mathJaxQueue.push(S)}catch(P){MathJax.typesetClear([S]),-null!=P.retry?(J=S,P.retry.then(function(){MathJax.typesetPromise([S]).then(B)["catch"](function(R){console.log("Error in MathJax.typesetPromise: "+R.toString());B()})})["catch"](function(R){console.log("Error in MathJax.retry: "+R.toString());B()})):null!=window.console&&console.log("Error in MathJax.typeset: "+P.toString())}};window.MathJax=null!=q?q:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg",-"input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},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 Q=Editor.prototype.init;Editor.prototype.init=function(){Q.apply(this,arguments);-var S=mxUtils.bind(this,function(P,R){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)};q=document.getElementsByTagName("script");if(null!=q&&0<q.length){var N=document.createElement("script");N.setAttribute("type","text/javascript");N.setAttribute("src",g);q[0].parentNode.appendChild(N)}}};Editor.prototype.csvToArray=function(g){if(0<g.length){var q="",B=[""],J=-0,Q=!0,N;g=$jscomp.makeIterator(g);for(N=g.next();!N.done;N=g.next())N=N.value,'"'===N?(Q&&N===q&&(B[J]+=N),Q=!Q):","===N&&Q?N=B[++J]="":B[J]+=N,q=N;return B}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 q=EditorUi.isVisioFilename(g);q=/\.png$/i.test(g)||/\.pdf$/i.test(g)||q;var B="t="+(new Date).getTime();g=PROXY_URL+"?url="+encodeURIComponent(g)+"&"+-B+(q?"&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 q=g.convert,B=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||B.crossOriginImages&&B.isCorsEnabledForUrl(J)?"chrome-extension://"!=J.substring(0,19)&&(J=q.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,q,B,J,Q){try{var N=!0,S=window.setTimeout(mxUtils.bind(this,function(){N=!1;q(g)}),this.timeout),P=mxUtils.bind(this,function(){null!=J?this.convertImageToDataUri(g,q,B,J,!0):q(g)});if(/(\.svg)$/i.test(g)&&!Q)mxUtils.get(g,mxUtils.bind(this,function(W){window.clearTimeout(S);N&&(200>W.getStatus()||299<W.getStatus()?P():q(Editor.createSvgDataUri(W.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(S);-N&&P()}));else{var R=new Image;this.crossOriginImages&&(R.crossOrigin="anonymous");R.onload=function(){window.clearTimeout(S);if(N)try{J=null!=J&&Q?J:1;var W=document.createElement("canvas"),X=W.getContext("2d");X.scale(J,J);W.height=R.height*J;W.width=R.width*J;X.drawImage(R,0,0);q(W.toDataURL())}catch(Y){q(g)}};R.onerror=function(){window.clearTimeout(S);N&&(null!=B?B():q(g))};R.src=g}}catch(W){null!=B?B():q(g)}};Editor.prototype.convertImages=function(g,q,B,J){function Q(){0<N.length?N.shift()():-q(g)}null==J&&(J=this.createImageUrlConverter());var N=[],S=B||{};B=mxUtils.bind(this,function(P,R){P=g.getElementsByTagName(P);for(var W=0;W<P.length;W++)mxUtils.bind(this,function(X){N.push(mxUtils.bind(this,function(){try{if(null!=X){var Y=J.convert(X.getAttribute(R));if(null!=Y&&"data:"!=Y.substring(0,5)){var aa=S[Y];null==aa?this.convertImageToDataUri(Y,function(ba){null!=ba&&(S[Y]=ba,X.setAttribute(R,ba));Q()},null,Editor.svgRasterScale):(X.setAttribute(R,aa),Q())}else null!=Y&&X.setAttribute(R,-Y),Q()}}catch(ba){Q()}}))})(P[W])});B("image","xlink:href");B("img","src");Q()};Editor.base64Encode=function(g){for(var q="",B=0,J=g.length,Q,N,S;B<J;){Q=g.charCodeAt(B++)&255;if(B==J){q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Q>>2);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&3)<<4);q+="==";break}N=g.charCodeAt(B++);if(B==J){q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Q>>2);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&-3)<<4|(N&240)>>4);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((N&15)<<2);q+="=";break}S=g.charCodeAt(B++);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Q>>2);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&3)<<4|(N&240)>>4);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((N&15)<<2|(S&192)>>6);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(S&63)}return q};-Editor.prototype.loadUrl=function(g,q,B,J,Q,N,S,P){try{var R=!S&&(J||/(\.png)($|\?)/i.test(g)||/(\.jpe?g)($|\?)/i.test(g)||/(\.gif)($|\?)/i.test(g)||/(\.pdf)($|\?)/i.test(g));Q=null!=Q?Q:!0;var W=mxUtils.bind(this,function(){mxUtils.get(g,mxUtils.bind(this,function(X){200<=X.getStatus()&&299>=X.getStatus()?null!=q&&(X=X.getText(),R&&(N=null!=N?N:"data:image/png;base64,",X=N+Editor.base64Encode(X)),q(X)):null!=B&&(0==X.getStatus()?B({message:mxResources.get("accessDenied")},X):404==X.getStatus()?B({message:mxResources.get("fileNotFound"),-code:X.getStatus()},X):B({message:this.getErrorMessage(X)},X))}),function(X){null!=B&&B({message:mxResources.get("error")+" "+X.getStatus()})},R,this.timeout,function(){Q&&null!=B&&B({code:App.ERROR_TIMEOUT,retry:W})},P)});W()}catch(X){null!=B&&B(X)}};Editor.prototype.getErrorMessage=function(g){var q=mxResources.get("error")+" "+g.getStatus();try{var B=g.getText(),J=JSON.parse(B);null!=J&&null!=J.error&&null!=J.error.message&&(q=J.error.message+" ("+q+")")}catch(Q){}return q};Editor.prototype.absoluteCssFonts=-function(g){var q=null;if(null!=g){var B=g.split("url(");if(0<B.length){q=[B[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 Q=null;null!=J&&0<J.length&&(Q=J[0].getAttribute("href"));for(var N=1;N<B.length;N++)if(J=B[N].indexOf(")"),0<J){var S=Editor.trimCssUrl(B[N].substring(0,J));this.graph.isRelativeUrl(S)&&(S=null!=Q?Q+S:window.location.protocol+"//"+window.location.hostname+("/"==S.charAt(0)?"":g)+S);-q.push('url("'+S+'"'+B[N].substring(J))}else q.push(B[N])}else q=[g]}return null!=q?q.join(""):null};Editor.prototype.mapFontUrl=function(g,q,B){/^https?:\/\//.test(q)&&!this.isCorsEnabledForUrl(q)&&(q=PROXY_URL+"?url="+encodeURIComponent(q));B(g,q)};Editor.prototype.embedCssFonts=function(g,q){var B=g.split("url("),J=0;null==this.cachedFonts&&(this.cachedFonts={});var Q=mxUtils.bind(this,function(){if(0==J){for(var R=[B[0]],W=1;W<B.length;W++){var X=B[W].indexOf(")");R.push('url("');R.push(this.cachedFonts[Editor.trimCssUrl(B[W].substring(0,-X))]);R.push('"'+B[W].substring(X))}q(R.join(""))}});if(0<B.length){for(g=1;g<B.length;g++){var N=B[g].indexOf(")"),S=null,P=B[g].indexOf("format(",N);0<P&&(S=Editor.trimCssUrl(B[g].substring(P+7,B[g].indexOf(")",P))));mxUtils.bind(this,function(R){if(null==this.cachedFonts[R]){this.cachedFonts[R]=R;J++;var W="application/x-font-ttf";if("svg"==S||/(\.svg)($|\?)/i.test(R))W="image/svg+xml";else if("otf"==S||"embedded-opentype"==S||/(\.otf)($|\?)/i.test(R))W="application/x-font-opentype";else if("woff"==-S||/(\.woff)($|\?)/i.test(R))W="application/font-woff";else if("woff2"==S||/(\.woff2)($|\?)/i.test(R))W="application/font-woff2";else if("eot"==S||/(\.eot)($|\?)/i.test(R))W="application/vnd.ms-fontobject";else if("sfnt"==S||/(\.sfnt)($|\?)/i.test(R))W="application/font-sfnt";this.mapFontUrl(W,R,mxUtils.bind(this,function(X,Y){this.loadUrl(Y,mxUtils.bind(this,function(aa){this.cachedFonts[R]=aa;J--;Q()}),mxUtils.bind(this,function(aa){J--;Q()}),!0,null,"data:"+X+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(B[g].substring(0,-N)),S)}Q()}else q(g)};Editor.prototype.loadFonts=function(g){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(q){this.resolvedFontCss=q;null!=g&&g()})):null!=g&&g()};Editor.prototype.createGoogleFontCache=function(){var g={},q;for(q in Graph.fontMapping)Graph.isCssFontUrl(q)&&(g[q]=Graph.fontMapping[q]);return g};Editor.prototype.embedExtFonts=function(g){var q=this.graph.getCustomFonts();if(0<q.length){var B=[],J=0;null==this.cachedGoogleFonts&&-(this.cachedGoogleFonts=this.createGoogleFontCache());for(var Q=mxUtils.bind(this,function(){0==J&&this.embedCssFonts(B.join(""),g)}),N=0;N<q.length;N++)mxUtils.bind(this,function(S,P){Graph.isCssFontUrl(P)?null==this.cachedGoogleFonts[P]?(J++,this.loadUrl(Graph.rewriteGoogleFontUrl(P),mxUtils.bind(this,function(R){this.cachedGoogleFonts[P]=R;B.push(R+"\n");J--;Q()}),mxUtils.bind(this,function(R){J--;B.push("@import url("+P+");\n");Q()}))):B.push(this.cachedGoogleFonts[P]+"\n"):B.push('@font-face {font-family: "'+-S+'";src: url("'+P+'")}\n')})(q[N].name,q[N].url);Q()}else g()};Editor.prototype.addMathCss=function(g){g=g.getElementsByTagName("defs");if(null!=g&&0<g.length)for(var q=document.getElementsByTagName("style"),B=0;B<q.length;B++){var J=mxUtils.getTextContent(q[B]);0>J.indexOf("mxPageSelector")&&0<J.indexOf("MathJax")&&g[0].appendChild(q[B].cloneNode(!0))}};Editor.prototype.addFontCss=function(g,q){q=null!=q?q:this.absoluteCssFonts(this.fontCss);if(null!=q){var B=mxUtils.getSvgDefs(g),J=q.split("\n");-q=[];for(var Q=[],N=0;N<J.length;N++)"@import"==J[N].substring(0,7)?q.push(J[N]):Q.push(J[N]);g=g.ownerDocument;g=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"style"):g.createElement("style");g.setAttribute("type","text/css");0<q.length&&(mxUtils.setTextContent(g,q.join("\n")),B.appendChild(g));0<Q.length&&(g=g.cloneNode(!1),mxUtils.setTextContent(g,Q.join("\n")),B.appendChild(g))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};-Editor.prototype.getMaxCanvasScale=function(g,q,B){var J=mxClient.IS_FF?8192:16384;return Math.min(B,Math.min(J/g,J/q))};Editor.prototype.exportToCanvas=function(g,q,B,J,Q,N,S,P,R,W,X,Y,aa,ba,fa,ia,ea,ma){try{N=null!=N?N:!0;S=null!=S?S:!0;Y=null!=Y?Y:this.graph;aa=null!=aa?aa:0;var qa=R?null:Y.background;qa==mxConstants.NONE&&(qa=null);null==qa&&(qa=J);null==qa&&0==R&&(qa="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(Y.getSvg(null,null,aa,ba,null,S,null,null,null,W,null,ia,ea,ma),-mxUtils.bind(this,function(na){try{na.style.setProperty("-webkit-font-smoothing","antialiased");na.style.setProperty("-moz-osx-font-smoothing","grayscale");var ta=new Image;ta.onload=mxUtils.bind(this,function(){try{var la=function(){mxClient.IS_SF?window.setTimeout(function(){za.drawImage(ta,0,0);g(ha,na)},0):(za.drawImage(ta,0,0),g(ha,na))},ha=document.createElement("canvas"),pa=parseInt(na.getAttribute("width")),ya=parseInt(na.getAttribute("height"));P=null!=P?P:1;null!=q&&(P=N?Math.min(1,Math.min(3*-q/(4*ya),q/pa)):q/pa);P=this.getMaxCanvasScale(pa,ya,P);pa=Math.ceil(P*pa);ya=Math.ceil(P*ya);ha.setAttribute("width",pa);ha.setAttribute("height",ya);var za=ha.getContext("2d");if(null!=qa){var xa=mxUtils.getLightDarkColor(qa);za.beginPath();za.rect(0,0,pa,ya);za.fillStyle="dark"==ia&&"none"!=Y.getAdaptiveColors()?xa.dark:xa.light;za.fill()}1!=P&&za.scale(P,P);if(fa){var Z=Y.view,oa=Z.scale;Z.scale=1;var ka=btoa(unescape(encodeURIComponent(Z.createSvgGrid(Z.gridColor))));Z.scale=oa;ka="data:image/svg+xml;base64,"+-ka;var sa=Y.gridSize*Z.gridSteps*P,Ca=Y.getGraphBounds(),Ia=Z.translate.x*oa,Ba=Z.translate.y*oa,da=Ia+(Ca.x-Ia)/oa-aa,ca=Ba+(Ca.y-Ba)/oa-aa,ua=new Image;ua.onload=function(){try{for(var ja=-Math.round(sa-mxUtils.mod((Ia-da)*P,sa)),wa=-Math.round(sa-mxUtils.mod((Ba-ca)*P,sa));ja<pa;ja+=sa)for(var va=wa;va<ya;va+=sa)za.drawImage(ua,ja/P,va/P);la()}catch(Fa){null!=Q&&Q(Fa)}};ua.onerror=function(ja){null!=Q&&Q(ja)};ua.src=ka}else la()}catch(ja){null!=Q&&Q(ja)}});ta.onerror=function(la){null!=Q&&Q(la)};-W&&this.graph.addSvgShadow(na);this.graph.mathEnabled&&this.addMathCss(na);var ra=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(na,this.resolvedFontCss),ta.src=Editor.createSvgDataUri(mxUtils.getXml(na))}catch(la){null!=Q&&Q(la)}});this.embedExtFonts(mxUtils.bind(this,function(la){try{null!=la&&this.addFontCss(na,la),this.loadFonts(ra)}catch(ha){null!=Q&&Q(ha)}}))}catch(la){null!=Q&&Q(la)}}),B,X)}catch(na){null!=Q&&Q(na)}};Editor.crcTable=[];for(var x=0;256>x;x++)for(var z=-x,y=0;8>y;y++)z=1==(z&1)?3988292384^z>>>1:z>>>1,Editor.crcTable[x]=z;Editor.updateCRC=function(g,q,B,J){for(var Q=0;Q<J;Q++)g=Editor.crcTable[(g^q.charCodeAt(B+Q))&255]^g>>>8;return g};Editor.crc32=function(g){for(var q=-1,B=0;B<g.length;B++)q=q>>>8^Editor.crcTable[(q^g.charCodeAt(B))&255];return(q^-1)>>>0};Editor.writeGraphModelToPng=function(g,q,B,J,Q){function N(X,Y){var aa=R;R+=Y;return X.substring(aa,R)}function S(X){X=N(X,4);return X.charCodeAt(3)+(X.charCodeAt(2)<<8)+(X.charCodeAt(1)<<16)+-(X.charCodeAt(0)<<24)}function P(X){return String.fromCharCode(X>>24&255,X>>16&255,X>>8&255,X&255)}g=g.substring(g.indexOf(",")+1);g=window.atob?atob(g):Base64.decode(g,!0);var R=0;if(N(g,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=Q&&Q();else if(N(g,4),"IHDR"!=N(g,4))null!=Q&&Q();else{N(g,17);Q=g.substring(0,R);do{var W=S(g);if("IDAT"==N(g,4)){Q=g.substring(0,R-8);"pHYs"==q&&"dpi"==B?(B=Math.round(J/.0254),B=P(B)+P(B)+String.fromCharCode(1)):B=B+String.fromCharCode(0)+-("zTXt"==q?String.fromCharCode(0):"")+J;J=4294967295;J=Editor.updateCRC(J,q,0,4);J=Editor.updateCRC(J,B,0,B.length);Q+=P(B.length)+q+B+P(J^4294967295);Q+=g.substring(R-8,g.length);break}Q+=g.substring(R-8,R-4+W);N(g,W);N(g,4)}while(W);return"data:image/png;base64,"+(window.btoa?btoa(Q):Base64.encode(Q,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var F=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(g,q){F.apply(this,-arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var O=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){O.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(g,q,B){var J=null;if(null!=B)return null;null!=g.editor.graph.getModel().getParent(q)?J=q.getId():null!=g.currentPage&&(J=g.currentPage.getId());return J});-if(null!=window.StyleFormatPanel){var K=Format.prototype.init;Format.prototype.init=function(){K.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var L=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?L.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(g){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||-"min"==Editor.currentTheme};var M=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(g){g=M.apply(this,arguments);var q=this.editorUi,B=q.editor.graph;if(B.isEnabled()){var J=q.getCurrentFile();null!=J&&J.isAutosaveOptional()&&g.appendChild(this.createOption(mxResources.get("autosave"),function(){return q.editor.autosave},function(N){q.editor.setAutosave(N);q.editor.autosave&&J.isModified()&&J.fileChanged()},{install:function(N){this.listener=function(){N(q.editor.autosave)};-q.editor.addListener("autosaveChanged",this.listener)},destroy:function(){q.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&B.isEnabled()&&"undefined"!==typeof MathJax){var Q=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return B.mathEnabled},function(N){q.actions.get("mathematicalTypesetting").funct()},{install:function(N){this.listener=function(){N(B.mathEnabled)};q.addListener("mathEnabledChanged",this.listener)},destroy:function(){q.removeListener(this.listener)}});-g.appendChild(Q);(!q.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&Q.appendChild(q.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}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.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];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",type:"float",min:0,defVal:20,isVisible:function(g){return"1"==mxUtils.getValue(g.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,isVisible:function(g){return"0"==mxUtils.getValue(g.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(g){return"1"==mxUtils.getValue(g.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];-mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",-dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",-min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",-type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",-dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},-{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);-mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",-type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",-type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",-type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=-[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,-max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",-defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=-[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",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;var c=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()));c.apply(this,arguments);null!=g.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),g.customProperties,g))};var d=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(g){var q=-this.editorUi.getSelectionState();1==q.cells.length?this.addActions(g,["copyStyle","pasteStyle"]):1<=q.cells.length&&this.addActions(g,["pasteStyle","pasteData"]);d.apply(this,arguments);return g};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(g,q,B,J){function Q(za,xa,Z,oa,ka){if(null!=Z.valueChanged)Z.valueChanged(xa,ka,B,Y);else{aa.getModel().beginUpdate();try{ka=[];var sa=[];if(null!=Z.index){for(var Ca=[],Ia=Z.parentRow.nextSibling;Ia&&Ia.getAttribute("data-pName")==-za;)Ca.push(Ia.getAttribute("data-pValue")),Ia=Ia.nextSibling;Z.index<Ca.length?null!=oa?Ca.splice(oa,1):Ca[Z.index]=xa:Ca.push(xa);null!=Z.size&&Ca.length>Z.size&&(Ca=Ca.slice(0,Z.size));xa=Ca.join(",");null!=Z.countProperty&&(aa.setCellStyles(Z.countProperty,Ca.length,aa.getSelectionCells()),ka.push(Z.countProperty),sa.push(Ca.length))}aa.setCellStyles(za,xa,aa.getSelectionCells());ka.push(za);sa.push(xa);if(null!=Z.dependentProps)for(za=0;za<Z.dependentProps.length;za++){var Ba=Z.dependentPropsDefVal[za],-da=Z.dependentPropsVals[za];if(da.length>xa)da=da.slice(0,xa);else for(var ca=da.length;ca<xa;ca++)da.push(Ba);da=da.join(",");aa.setCellStyles(Z.dependentProps[za],da,aa.getSelectionCells());ka.push(Z.dependentProps[za]);sa.push(da)}if("function"==typeof Z.onChange)Z.onChange(aa,xa);Y.editorUi.fireEvent(new mxEventObject("styleChanged","keys",ka,"values",sa,"cells",aa.getSelectionCells()))}finally{aa.getModel().endUpdate()}}}function N(za,xa){xa.style.left="0px";xa.style.top="0px";xa.style.position=-"relative";xa.style.right="0px";xa.style.bottom="0px";xa.style.width="100%";xa.style.maxWidth="100%";xa.style.maxHeight="100%";xa.style.textAlign="left"}function S(za,xa,Z){function oa(sa){if(null==sa||sa==mxConstants.NONE)ka.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==sa)ka.style.background="";else{var Ca=mxUtils.getLightDarkColor(sa);mxUtils.isLightDarkColor(sa)&&Ca.light!=Ca.dark?ka.style.background="linear-gradient(to right bottom, "+Ca.cssText+" 50%, "+mxUtils.invertLightDarkColor(Ca).cssText+-" 50.3%)":ka.style.background=sa}}var ka=document.createElement("div");ka.style.width="32px";ka.style.height="8px";ka.style.margin="2px";ka.style.borderStyle="solid";ka.style.borderWidth="1px";oa(xa);btn=mxUtils.button("",mxUtils.bind(Y,function(sa){this.editorUi.pickColor(xa,function(Ca){Q(za,Ca,Z);oa(Ca)});mxEvent.consume(sa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(ka);return btn}function P(za,-xa,Z,oa,ka,sa,Ca){null!=xa&&(xa=xa.split(","),ba.push({name:za,values:xa,type:Z,defVal:oa,countProperty:ka,parentRow:sa,isDeletable:!0,flipBkg:Ca}));btn=mxUtils.button("+",mxUtils.bind(Y,function(Ia){for(var Ba=sa,da=0;null!=Ba.nextSibling;)if(Ba.nextSibling.getAttribute("data-pName")==za)Ba=Ba.nextSibling,da++;else break;var ca={type:Z,parentRow:sa,index:da,isDeletable:!0,defVal:oa,countProperty:ka};da=X(za,"",ca,0==da%2,Ca);Q(za,oa,ca);Ba.parentNode.insertBefore(da,Ba.nextSibling);mxEvent.consume(Ia)}));-btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function R(za,xa,Z,oa,ka,sa,Ca){if(0<ka){var Ia=Array(ka);xa=null!=xa?xa.split(","):[];for(var Ba=0;Ba<ka;Ba++)Ia[Ba]=null!=xa[Ba]?xa[Ba]:null!=oa?oa:"";ba.push({name:za,values:Ia,type:Z,defVal:oa,parentRow:sa,flipBkg:Ca,size:ka})}return document.createElement("div")}function W(za,xa,Z){var oa=document.createElement("input");oa.type="checkbox";oa.checked="1"==xa;mxEvent.addListener(oa,"change",function(){Q(za,oa.checked?-"1":"0",Z,null,oa)});return oa}function X(za,xa,Z,oa,ka){var sa=Z.dispName,Ca=Z.type,Ia=document.createElement("tr");Ia.className="gePropRow"+(ka?"Dark":"")+(oa?"Alt":"")+" gePropNonHeaderRow";Ia.setAttribute("data-pName",za);Ia.setAttribute("data-pValue",xa);oa=!1;null!=Z.index&&(Ia.setAttribute("data-index",Z.index),sa=(null!=sa?sa:"")+"["+Z.index+"]",oa=!0);var Ba=document.createElement("td");Ba.className="gePropRowCell";sa=mxResources.get(sa,null,sa);mxUtils.write(Ba,sa);Ba.setAttribute("title",-sa);oa&&(Ba.style.textAlign="right");Ia.appendChild(Ba);Ba=document.createElement("td");Ba.className="gePropRowCell";Ba.setAttribute("title",null!=xa?decodeURIComponent(xa):mxResources.get("none"));mxEvent.addListener(Ba,"click",mxUtils.bind(Y,function(ja){!mxUtils.isAncestorNode(Ia,document.activeElement)&&mxUtils.isAncestorNode(Ia.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ja))}));if("color"==-Ca)Ba.appendChild(S(za,xa,Z));else if("bool"==Ca||"boolean"==Ca)Ba.appendChild(W(za,xa,Z));else if("enum"==Ca){var da=Z.enumList;Ba.innerHTML="";var ca=document.createElement("div");ca.className="gePropValue";Ba.appendChild(ca);for(ka=0;ka<da.length;ka++)if(sa=da[ka],sa.val==xa){mxUtils.write(ca,mxResources.get(sa.dispName,null,sa.dispName));break}mxEvent.addListener(Ba,"click",mxUtils.bind(Y,function(ja){var wa=mxEvent.getSource(ja);if(!(wa!=Ba&&wa!=ca||mxEvent.isConsumed(ja))){ca.innerHTML="";var va=-document.createElement("select"),Fa=null;N(Ba,va);for(ja=0;ja<da.length;ja++){wa=da[ja];var Ka=document.createElement("option");Ka.value=mxUtils.htmlEntities(wa.val);mxUtils.write(Ka,mxResources.get(wa.dispName,null,wa.dispName));va.appendChild(Ka);null==wa.val&&(Ka.value="null",Fa=Ka)}va.value=null==xa&&null!=Fa?"null":xa;ca.appendChild(va);mxEvent.addListener(va,"change",function(){var Wa=mxUtils.htmlEntities(va.value);if(va[va.selectedIndex]==Fa||"null"==Wa.value)Wa=null;Q(za,Wa,Z)});va.focus();-mxEvent.addListener(va,"blur",function(){ca.innerHTML="";for(var Wa=0;Wa<da.length;Wa++){var Pa=da[Wa];if(Pa.val==va.value){mxUtils.write(ca,mxResources.get(Pa.dispName,null,Pa.dispName));break}}})}}))}else if("dynamicArr"==Ca)Ba.appendChild(P(za,xa,Z.subType,Z.subDefVal,Z.countProperty,Ia,ka));else if("staticArr"==Ca)Ba.appendChild(R(za,xa,Z.subType,Z.subDefVal,Z.size,Ia,ka));else if("readOnly"==Ca)ka=document.createElement("input"),ka.setAttribute("readonly",""),ka.value=xa,ka.style.borderWidth=-"0px","id"==za||"shape"==za?(Ia.firstChild.innerHTML="",Ia.firstChild.setAttribute("colspan","2"),ka.style.flexGrow="1",ka.style.marginLeft="4px",ka.style.textAlign="id"==za?"center":"left",ka.setAttribute("title",xa),sa=document.createElement("div"),mxUtils.write(sa,mxResources.get(za)+":"),sa.style.display="inline-flex",sa.style.alignItems="center",sa.style.width="100%",sa.appendChild(ka),Ia.firstChild.appendChild(sa)):(ka.style.width="96px",Ba.appendChild(ka));else{Ba.innerHTML="";var ua=document.createElement("div");-ua.className="gePropValue";Ba.appendChild(ua);ua.innerHTML=mxUtils.htmlEntities(decodeURIComponent(xa));mxEvent.addListener(Ba,"click",mxUtils.bind(Y,function(ja){function wa(){var Ka=Fa.value;Ka=0==Ka.length&&"string"!=Ca&&"numbers"!=Ca?0:Ka;Z.allowAuto&&(null!=Ka.trim&&"auto"==Ka.trim().toLowerCase()?(Ka="auto",Ca="string"):(Ka=parseFloat(Ka),Ka=isNaN(Ka)?0:Ka));null!=Z.min&&Ka<Z.min?Ka=Z.min:null!=Z.max&&Ka>Z.max&&(Ka=Z.max);var Wa=null;try{Wa="numbers"==Ca?Ka.match(/\d+/g).map(Number).join(" "):-encodeURIComponent(("int"==Ca?parseInt(Ka):Ka)+"")}catch(Pa){}Q(za,Wa,Z,null,Fa)}var va=mxEvent.getSource(ja);if(!(va!=Ba&&va!=ua||mxEvent.isConsumed(ja))){ua.innerHTML="";var Fa=document.createElement("input");N(ua,Fa);Fa.value=decodeURIComponent(xa);Fa.className="gePropEditor";"int"!=Ca&&"float"!=Ca||Z.allowAuto||(Fa.type="number",Fa.step="int"==Ca?"1":"any",null!=Z.min&&(Fa.min=parseFloat(Z.min)),null!=Z.max&&(Fa.max=parseFloat(Z.max)));ua.appendChild(Fa);mxEvent.addListener(Fa,"keypress",function(Ka){13==-Ka.keyCode&&wa()});Fa.focus();mxEvent.addListener(Fa,"blur",function(){wa()})}}))}Z.isDeletable&&(ka=mxUtils.button("-",mxUtils.bind(Y,function(ja){Q(za,"",Z,Z.index);mxEvent.consume(ja)})),ka.style.height="16px",ka.style.width="25px",ka.style.float="right",ka.className="geColorBtn",Ba.appendChild(ka));Ia.appendChild(Ba);return Ia}var Y=this,aa=this.editorUi.editor.graph,ba=[],fa=document.createElement("table");fa.className="geProperties geFullWidthElement";var ia=document.createElement("tr");ia.className=-"gePropHeader";var ea=document.createElement("th");ea.className="gePropHeaderCell";ea.style.paddingLeft="16px";ea.style.backgroundRepeat="no-repeat";ea.style.backgroundPosition="-2px 50%";ea.style.backgroundSize="20px";mxUtils.write(ea,mxResources.get("property"));ia.style.cursor="pointer";var ma=function(){var za=fa.querySelectorAll(".gePropNonHeaderRow");if(Y.editorUi.propertiesCollapsed){ea.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var xa="none";for(var Z=g.childNodes.length-1;0<=-Z;Z--)try{var oa=g.childNodes[Z],ka=oa.nodeName.toUpperCase();"INPUT"!=ka&&"SELECT"!=ka||g.removeChild(oa)}catch(sa){}}else ea.style.backgroundImage="url('"+Editor.arrowDownImage+"')",xa="";for(Z=0;Z<za.length;Z++)za[Z].style.display=xa};mxEvent.addListener(ia,"click",function(){Y.editorUi.propertiesCollapsed=!Y.editorUi.propertiesCollapsed;ma()});ia.appendChild(ea);var qa=document.createElement("th");qa.className="gePropHeaderCell";qa.style.paddingLeft="4px";mxUtils.write(qa,mxResources.get("value"));-ia.appendChild(qa);fa.appendChild(ia);var na=qa=!1;ia=null;1==B.vertices.length&&0==B.edges.length?ia=B.vertices[0].id:0==B.vertices.length&&1==B.edges.length&&(ia=B.edges[0].id);null==ia||J||(fa.appendChild(X("id",mxUtils.htmlEntities(ia),{dispName:"id",type:"readOnly"},!0,!1)),null!=B.style&&null!=B.style.shape&&fa.appendChild(X("shape",mxUtils.htmlEntities(B.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var ta in q)if(J=q[ta],("function"!=typeof J.isVisible||J.isVisible(B,this))&&-!J.primary){var ra=null!=J.getValue?J.getValue(B,this):null!=B.style[ta]?mxUtils.htmlEntities(B.style[ta]+""):null!=J.getDefaultValue?J.getDefaultValue(B,this):J.defVal;if("separator"==J.type)na=!na;else{if("staticArr"==J.type)J.size=parseInt(B.style[J.sizeProperty]||q[J.sizeProperty].defVal)||0;else if(null!=J.dependentProps){var la=J.dependentProps,ha=[],pa=[];for(ia=0;ia<la.length;ia++)if(null!=q[la[ia]]){var ya=B.style[la[ia]];pa.push(q[la[ia]].subDefVal);ha.push(null!=ya?ya.split(","):[])}J.dependentPropsDefVal=-pa;J.dependentPropsVals=ha}fa.appendChild(X(ta,ra,J,qa,na));qa=!qa}}for(ia=0;ia<ba.length;ia++)for(J=ba[ia],q=J.parentRow,ta=0;ta<J.values.length;ta++)qa=X(J.name,J.values[ta],{type:J.type,parentRow:J.parentRow,isDeletable:J.isDeletable,index:ta,defVal:J.defVal,countProperty:J.countProperty,size:J.size},0==ta%2,J.flipBkg),q.parentNode.insertBefore(qa,q.nextSibling),q=qa;g.appendChild(fa);ma();return g};StyleFormatPanel.prototype.addStyles=function(g){if(null!=this.defaultColorSchemes){var q=this.editorUi,-B=q.editor.graph,J=document.createElement("div");J.style.padding="6px 20px 0 24px";g.appendChild(J);var Q=document.createElement("div");Q.className="geSwitcher";Q.style.padding="4px 18px 6px 0px";for(var N=[],S=0;S<this.defaultColorSchemes.length;S++){var P=document.createElement("div");P.className="geSwitcherDot";mxUtils.bind(this,function(aa){mxEvent.addListener(P,"click",mxUtils.bind(this,function(){R(aa)}))})(S);N.push(P);Q.appendChild(P)}var R=mxUtils.bind(this,function(aa){null!=N[aa]&&(null!=-this.format.currentScheme&&null!=N[this.format.currentScheme]&&(N[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=aa,W(this.defaultColorSchemes[this.format.currentScheme]),N[this.format.currentScheme].style.background="#84d7ff")}),W=mxUtils.bind(this,function(aa){var ba=mxUtils.clone(B.defaultVertexStyle);ba[mxConstants.STYLE_STROKECOLOR]=null!=ba[mxConstants.STYLE_STROKECOLOR]?ba[mxConstants.STYLE_STROKECOLOR]:"default";ba[mxConstants.STYLE_FILLCOLOR]=null!=ba[mxConstants.STYLE_FILLCOLOR]?-ba[mxConstants.STYLE_FILLCOLOR]:"default";ba[mxConstants.STYLE_FONTCOLOR]=null!=ba[mxConstants.STYLE_FONTCOLOR]?ba[mxConstants.STYLE_FONTCOLOR]:"default";B.replaceDefaultColors(new mxCell,ba);var fa=mxUtils.bind(this,function(ea){var ma=mxUtils.button("",mxUtils.bind(this,function(ta){B.getModel().beginUpdate();try{for(var ra=q.getSelectionState().cells,la=0;la<ra.length;la++){var ha=B.getModel().getStyle(ra[la]);null!=ea?(mxEvent.isShiftDown(ta)||(ha=""==ea.fill||null==ea.fill?mxUtils.setStyle(ha,-mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ha,mxConstants.STYLE_FILLCOLOR,ea.fill),ha=""==ea.gradient||null==ea.gradient?mxUtils.setStyle(ha,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ha,mxConstants.STYLE_GRADIENTCOLOR,ea.gradient),mxEvent.isControlDown(ta)||mxClient.IS_MAC&&mxEvent.isMetaDown(ta)||!B.getModel().isVertex(ra[la])||(ha=""==ea.font||null==ea.font?mxUtils.setStyle(ha,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ha,mxConstants.STYLE_FONTCOLOR,ea.font))),mxEvent.isAltDown(ta)||-(ha=""==ea.stroke||null==ea.fill?mxUtils.setStyle(ha,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ha,mxConstants.STYLE_STROKECOLOR,ea.stroke))):(ha=mxUtils.setStyle(ha,mxConstants.STYLE_FILLCOLOR,null),ha=mxUtils.setStyle(ha,mxConstants.STYLE_STROKECOLOR,null),ha=mxUtils.setStyle(ha,mxConstants.STYLE_GRADIENTCOLOR,null),B.getModel().isVertex(ra[la])&&(ha=mxUtils.setStyle(ha,mxConstants.STYLE_FONTCOLOR,null)));B.getModel().setStyle(ra[la],ha)}}finally{B.getModel().endUpdate()}}));ma.className=-"geStyleButton";ma.style.width="36px";ma.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ma.style.margin="0px 6px 6px 0px";if(null!=ea){var qa="1px solid";null!=ea.border&&(qa=ea.border);if(null!=ea.gradient)ma.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(ea.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(ea.gradient).cssText+" 100%)";else if(ea.fill==mxConstants.NONE)ma.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==ea.fill||""==ea.fill)ma.style.backgroundColor=-mxUtils.getLightDarkColor(mxUtils.getValue(ba,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var na=mxUtils.getLightDarkColor(ea.fill);ma.style.backgroundImage="linear-gradient(to right bottom, "+na.cssText+" 50%, "+na.light+" 50.3%)"}null==ea.stroke||ea.stroke==mxConstants.NONE?ma.style.border=qa+" transparent":""==ea.stroke?ma.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ba,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(na=mxUtils.getLightDarkColor(ea.stroke),ma.style.border=-qa+" "+na.cssText,ma.style.borderRightColor=na.light,ma.style.borderBottomColor=ma.style.borderRightColor);null!=ea.title&&ma.setAttribute("title",ea.title)}else qa=mxUtils.getValue(ba,mxConstants.STYLE_FILLCOLOR,"#ffffff"),na=mxUtils.getValue(ba,mxConstants.STYLE_STROKECOLOR,"#000000"),ma.style.backgroundColor=qa,ma.style.border="1px solid "+na;ma.style.borderRadius="0";J.appendChild(ma);null!=ea&&null!=ea.gradient&&(qa=ma.cloneNode(!1),qa.style.backgroundImage="linear-gradient(light-dark(transparent, "+-mxUtils.getLightDarkColor(ea.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(ea.gradient).light+") 100%)",qa.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",qa.style.backgroundColor="transparent",J.appendChild(qa),qa.style.marginLeft="-42px",mxEvent.addListener(qa,"click",function(){ma.click()}))});J.innerText="";if(null!=aa)for(var ia=0;ia<aa.length;ia++)0<ia&&0==mxUtils.mod(ia,4)&&mxUtils.br(J),fa(aa[ia])});null==this.format.currentScheme?R(Math.min(N.length-1,Editor.isDarkMode()?-1:"1"==urlParams.sketch?5:0)):R(this.format.currentScheme);S=10>=this.defaultColorSchemes.length?43:23;var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:0px;bottom:"+S+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(X,"click",mxUtils.bind(this,function(){R(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var Y=document.createElement("div");Y.className="geButton";Y.style.cssText="position:absolute;left:186px;bottom:"+-S+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(g.appendChild(X),g.appendChild(Y));mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){R(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));W(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&g.appendChild(Q)}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,q){var B=Graph.fontMapping[q];null==B&&Graph.isCssFontUrl(q)?(g=document.createElement("link"),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("charset","UTF-8"),g.setAttribute("href",Graph.rewriteGoogleFontUrl(q))):(null==B&&(B='@font-face {\nfont-family: "'+g+'";\nsrc: url("'+q+'");\n}'),g=document.createElement("style"),mxUtils.write(g,B));return g};Graph.addRecentCustomFont=function(g,q){};Graph.addFont=-function(g,q,B,J){if(null!=g&&0<g.length&&null!=q&&0<q.length){J=null!=J?J:Graph.customFontElements;var Q=g.toLowerCase();if("helvetica"!=Q&&"arial"!=g&&"sans-serif"!=Q){var N=J[Q];null!=N&&N.url!=q&&(N.elt.parentNode.removeChild(N.elt),N=null);null==N?(N=q,"http:"==q.substring(0,5)&&(N=PROXY_URL+"?url="+encodeURIComponent(q)),N={name:g,url:q,elt:Graph.createFontElement(g,N)},J[Q]=N,q=J==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=B&&("link"==N.elt.nodeName.toLowerCase()?-(N.elt.onload=B,N.elt.onerror=B):B()),null!=q&&q.appendChild(N.elt)):null!=B&&B()}else null!=B&&B()}else null!=B&&B();return g};Graph.getFontUrl=function(g,q){g=Graph.customFontElements[g.toLowerCase()];null!=g&&(q=g.url);return q};Graph.processFontAttributes=function(g){g=g.getElementsByTagName("*");for(var q=0;q<g.length;q++){var B=g[q].getAttribute("data-font-src");if(null!=B){var J="FONT"==g[q].nodeName?g[q].getAttribute("face"):g[q].style.fontFamily;null!=J&&Graph.addFont(J,B)}}};Graph.processFontStyle=-function(g){if(null!=g){var q=mxUtils.getValue(g,"fontSource",null);if(null!=q){var B=mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,null);if(null!=B)try{Graph.addFont(B,decodeURIComponent(q))}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.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity=-"0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var k=Graph.prototype.init;Graph.prototype.init=function(){function g(Q){q=Q}k.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var q=null;mxEvent.addListener(this.container,"mouseenter",g);mxEvent.addListener(this.container,"mousemove",g);mxEvent.addListener(this.container,"mouseleave",function(Q){q=null});-this.isMouseInsertPoint=function(){return null!=q};var B=this.getInsertPoint;this.getInsertPoint=function(Q){return null==q||Q?B.apply(this,arguments):this.getPointForEvent(q)};var J=this.layoutManager.getLayout;this.layoutManager.getLayout=function(Q){var N=this.graph.getCellStyle(Q);if(null!=N&&"rack"==N.childLayout){var S=new mxStackLayout(this.graph,!1);S.gridSize=null!=N.rackUnitSize?parseFloat(N.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;S.marginLeft=N.marginLeft||-0;S.marginRight=N.marginRight||0;S.marginTop=N.marginTop||0;S.marginBottom=N.marginBottom||0;S.allowGaps=N.allowGaps||0;S.horizontal="1"==mxUtils.getValue(N,"horizontalRack","0");S.resizeParent=!1;S.fill=!0;return S}return J.apply(this,arguments)};this.updateGlobalUrlVariables()};var m=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(g,q){return Graph.processFontStyle(m.apply(this,arguments))};var t=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=-function(g,q,B,J,Q,N,S,P,R,W,X,Y){t.apply(this,arguments);Graph.processFontAttributes(Y)};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(g,q,B,J){function Q(){for(var ia=P.getSelectionCells(),ea=[],ma=0;ma<ia.length;ma++)P.isCellVisible(ia[ma])&&ea.push(ia[ma]);P.setSelectionCells(ea)}function N(ia){P.setHiddenTags(ia?[]:R.slice());-Q();P.refresh()}function S(ia,ea){X.innerText="";if(0<ia.length){var ma=document.createElement("table");ma.setAttribute("cellpadding","2");ma.style.boxSizing="border-box";ma.style.tableLayout="fixed";ma.style.width="100%";var qa=document.createElement("tbody");if(null!=ia&&0<ia.length)for(var na=0;na<ia.length;na++)(function(ta){function ra(){var xa=P.getCellsForTags([ta],null,null,!0);P.isEnabled()?P.setSelectionCells(xa):P.highlightCells(xa,null,null,70)}var la=0>mxUtils.indexOf(P.hiddenTags,ta),-ha=document.createElement("tr"),pa=document.createElement("td");pa.style.align="center";pa.style.width="16px";var ya=document.createElement("img");ya.setAttribute("src",la?Editor.visibleImage:Editor.hiddenImage);ya.setAttribute("title",mxResources.get(la?"hideIt":"show",[ta]));mxUtils.setOpacity(ya,la?75:25);ya.className="geAdaptiveAsset";ya.style.verticalAlign="middle";ya.style.cursor="pointer";ya.style.width="16px";if(q||Editor.isDarkMode())ya.style.filter="invert(100%)";pa.appendChild(ya);mxEvent.addListener(ya,-"click",function(xa){mxEvent.isShiftDown(xa)?N(0<=mxUtils.indexOf(P.hiddenTags,ta)):(P.toggleHiddenTag(ta),Q(),P.refresh());mxEvent.consume(xa)});ha.appendChild(pa);pa=document.createElement("td");pa.style.align="center";pa.style.width="16px";ya=document.createElement("img");ya.setAttribute("src",Editor.selectImage);ya.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(ya,la?75:25);ya.className="geAdaptiveAsset";ya.style.verticalAlign="middle";ya.style.cursor="pointer";ya.style.width=-"16px";if(q||Editor.isDarkMode())ya.style.filter="invert(100%)";mxEvent.addListener(ya,"click",function(xa){N(!0);ra();mxEvent.consume(xa)});pa.appendChild(ya);ha.appendChild(pa);pa=document.createElement("td");pa.style.overflow="hidden";pa.style.whiteSpace="nowrap";pa.style.textOverflow="ellipsis";pa.style.verticalAlign="middle";pa.style.cursor="pointer";pa.setAttribute("title",ta);a=document.createElement("a");mxUtils.write(a,ta);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,-la?100:40);pa.appendChild(a);mxEvent.addListener(pa,"click",function(xa){if(mxEvent.isShiftDown(xa))N(!0),ra();else if(la&&0<P.hiddenTags.length)N(!0);else{var Z=R.slice(),oa=mxUtils.indexOf(Z,ta);Z.splice(oa,1);P.setHiddenTags(Z);Q();P.refresh()}mxEvent.consume(xa)});ha.appendChild(pa);if(P.isEnabled()){pa=document.createElement("td");pa.style.verticalAlign="middle";pa.style.textAlign="center";pa.style.width="18px";if(null==ea){pa.style.align="center";pa.style.width="16px";ya=document.createElement("img");-ya.setAttribute("src",Editor.trashImage);ya.setAttribute("title",mxResources.get("removeIt",[ta]));mxUtils.setOpacity(ya,la?75:25);ya.className="geAdaptiveAsset";ya.style.verticalAlign="middle";ya.style.cursor="pointer";ya.style.width="16px";if(q||Editor.isDarkMode())ya.style.filter="invert(100%)";mxEvent.addListener(ya,"click",function(xa){var Z=mxUtils.indexOf(R,ta);0<=Z&&R.splice(Z,1);P.removeTagsForCells(P.model.getDescendants(P.model.getRoot()),[ta]);P.refresh();mxEvent.consume(xa)});pa.appendChild(ya)}else{var za=-document.createElement("input");za.setAttribute("type","checkbox");za.style.margin="0px";za.defaultChecked=null!=ea&&0<=mxUtils.indexOf(ea,ta);za.checked=za.defaultChecked;za.style.background="transparent";za.setAttribute("title",mxResources.get(za.defaultChecked?"removeIt":"add",[ta]));mxEvent.addListener(za,"change",function(xa){za.checked?P.addTagsForCells(P.getSelectionCells(),[ta]):P.removeTagsForCells(P.getSelectionCells(),[ta]);mxEvent.consume(xa)});pa.appendChild(za)}ha.appendChild(pa)}qa.appendChild(ha)})(ia[na]);-ma.appendChild(qa);X.appendChild(ma)}}var P=this,R=P.hiddenTags.slice(),W=document.createElement("div");W.style.userSelect="none";W.style.overflow="hidden";W.style.padding="10px";W.style.height="100%";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.userSelect="none";X.style.overflow="auto";X.style.padding="3px";X.style.left="0px";X.style.right="0px";X.style.top="0px";X.style.bottom="0px";W.appendChild(X);P.addListener(mxEvent.ROOT,function(){R=-P.hiddenTags.slice()});var Y=mxUtils.bind(this,function(ia,ea){if(g()){ia=P.getAllTags();for(ea=0;ea<ia.length;ea++)0>mxUtils.indexOf(R,ia[ea])&&R.push(ia[ea]);R.sort();P.isSelectionEmpty()?S(R):S(R,P.getCommonTagsForCells(P.getSelectionCells()))}});P.selectionModel.addListener(mxEvent.CHANGE,Y);P.model.addListener(mxEvent.CHANGE,Y);P.addListener(mxEvent.REFRESH,Y);var aa=document.createElement("div");aa.className="geToolbarContainer geDialogToolbar";aa.style.position="absolute";aa.style.display=-"flex";aa.style.bottom="0px";aa.style.left="0px";aa.style.right="0px";aa.style.height="32px";aa.style.overflow="hidden";aa.style.padding="3px 4px 4px 4px";aa.style.borderWidth="1px 0px 0px 0px";aa.style.borderStyle="solid";aa.style.whiteSpace="nowrap";if(P.isEnabled()){X.style.bottom="32px";var ba=document.createElement("a");ba.className="geButton";var fa=ba.cloneNode(!1);fa.style.backgroundImage="url("+Editor.visibleImage+")";fa.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(fa,-"click",function(ia){P.setHiddenTags([]);mxEvent.isShiftDown(ia)||(R=P.hiddenTags.slice());Q();P.refresh();mxEvent.consume(ia)});aa.appendChild(fa);null!=B&&(ba=ba.cloneNode(!1),ba.style.backgroundImage="url("+Editor.plusImage+")",ba.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ba,"click",function(ia){B(R,function(ea){R=ea;Y()});mxEvent.consume(ia)}),aa.appendChild(ba));W.appendChild(aa)}null!=J&&aa.appendChild(J);return{div:W,refresh:Y}};Graph.prototype.getCustomFonts=function(){var g=-this.extFonts;g=null!=g?g.slice():[];for(var q in Graph.customFontElements){var B=Graph.customFontElements[q];g.push({name:B.name,url:B.url})}return g};Graph.prototype.setFont=function(g,q){Graph.addFont(g,q);var B=Editor.guid();document.execCommand("fontname",!1,B);for(var J=this.cellEditor.textarea.getElementsByTagName("font"),Q=!1,N=0;N<J.length;N++)J[N].getAttribute("face")==B&&(Q=!0,J[N].setAttribute("face",g),null!=q?J[N].setAttribute("data-font-src",q):J[N].removeAttribute("data-font-src"));-Q||document.execCommand("fontname",!1,g)};var A=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return A.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 q in g)this.globalVars[q]=g[q]}catch(B){null!=-window.console&&console.log("Error in vars URL parameter: "+B)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var C=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(g){var q=C.apply(this,arguments);null==q&&null!=this.globalVars&&(q=this.globalVars[g]);return q};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 E=Graph.prototype.getSvg;Graph.prototype.getSvg=function(g,q,B,J,Q,N,S,P,R,W,X,Y,aa,ba,fa,ia){var ea=E.apply(this,arguments);if(null!=Y){var ma=ea.getAttribute("style");null==ma&&(ma="");Y="auto"==Y||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":Y;ea.setAttribute("style",ma+(" color-scheme: "+Y+";"))}var qa=this.getCustomFonts();if(X&&0<qa.length){var na=ea.ownerDocument;ma=null!=na.createElementNS?-na.createElementNS(mxConstants.NS_SVG,"style"):na.createElement("style");null!=na.setAttributeNS?ma.setAttributeNS("type","text/css"):ma.setAttribute("type","text/css");for(var ta="",ra="",la=0;la<qa.length;la++){var ha=qa[la].name,pa=qa[la].url;Graph.isCssFontUrl(pa)?ta+="@import url("+Graph.rewriteGoogleFontUrl(pa)+");\n":ra+='@font-face {\nfont-family: "'+ha+'";\nsrc: url("'+pa+'");\n}\n'}ma.appendChild(na.createTextNode(ta+ra));ea.getElementsByTagName("defs")[0].appendChild(ma)}Editor.replaceSvgDataUris&&-null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ea);this.mathEnabled&&(document.body.appendChild(ea),Editor.MathJaxRender(ea),ea.parentNode.removeChild(ea),ma=ea.ownerDocument.getElementById("MJX-SVG-styles"),null!=ma&&ea.getElementsByTagName("defs")[0].appendChild(ma.cloneNode(!0)));return ea};var D=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(g){D.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 U=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){U.apply(this,arguments);this.enumerationState=0};var T=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(g){null!=g.shape&&this.redrawEnumerationState(g);return T.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 q="1"==mxUtils.getValue(g.style,"enumerate",0);q&&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)):q||null==g.secondLabel||(g.secondLabel.destroy(),g.secondLabel=null);q=g.secondLabel;if(null!=q){var B=g.view.scale,J=this.createEnumerationValue(g);g=this.graph.model.isVertex(g.cell)?new mxRectangle(g.x+g.width-4*B,g.y+4*B,0,0):mxRectangle.fromPoint(g.view.getPoint(g));q.bounds.equals(g)&&q.value==J&&q.scale==B||(q.bounds=g,q.value=J,q.scale=B,q.redraw())}};var V=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();-V.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var n=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){n.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(g,q){"data:action/json,"==g.substring(0,17)&&(g=JSON.parse(g.substring(17)),null!=g.actions&&-this.executeCustomActions(g.actions,null,q))};Graph.prototype.executeCustomActions=function(g,q,B){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,Q=0,N=0,S=mxUtils.bind(this,function(){J||(J=!0,this.model.beginUpdate())}),P=mxUtils.bind(this,-function(){J&&(J=!1,this.model.endUpdate())}),R=mxUtils.bind(this,function(){0<Q&&Q--;0==Q&&W()}),W=mxUtils.bind(this,function(){if(N<g.length){var X=this.stoppingCustomActions,Y=g[N++],aa=[];if(null!=Y.open)if(P(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,B))return}else this.openLink(Y.open);null==Y.wait||X||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;R()}),Q++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,-""!=Y.wait?parseInt(Y.wait):1E3),P());null!=Y.opacity&&null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),Y.opacity.value);null!=Y.fadeIn&&(Q++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,R,X?0:Y.fadeIn.delay));null!=Y.fadeOut&&(Q++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,R,X?0:Y.fadeOut.delay));null!=Y.wipeIn&&(aa=aa.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,-!0),!0)));null!=Y.wipeOut&&(aa=aa.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,!0),!1)));null!=Y.toggle&&(S(),this.toggleCells(this.getCellsForAction(Y.toggle,!0)));if(null!=Y.show){S();var ba=this.getCellsForAction(Y.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ba),1);this.setCellsVisible(ba,!0)}null!=Y.hide&&(S(),ba=this.getCellsForAction(Y.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ba),0),this.setCellsVisible(ba,!1));null!=Y.toggleStyle&&null!=Y.toggleStyle.key&&-(S(),this.toggleCellStyles(Y.toggleStyle.key,null!=Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:"0",this.getCellsForAction(Y.toggleStyle,!0)));null!=Y.style&&null!=Y.style.key&&(S(),this.setCellStyles(Y.style.key,Y.style.value,this.getCellsForAction(Y.style,!0)));ba=[];null!=Y.select&&this.isEnabled()&&(ba=this.getCellsForAction(Y.select),this.setSelectionCells(ba));null!=Y.highlight&&(ba=this.getCellsForAction(Y.highlight),this.highlightCells(ba,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));-null!=Y.scroll&&(ba=this.getCellsForAction(Y.scroll));null!=Y.viewbox&&this.fitWindow(Y.viewbox,Y.viewbox.border);0<ba.length&&this.scrollCellToVisible(ba[0]);null!=B&&null!=Y.explore&&Graph.exploreFromCell(this,B,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle){var fa=Y.tags.toggle;0==fa.length&&(fa=this.getAllTags());for(ba=0;ba<fa.length;ba++)this.toggleHiddenTag(fa[ba])}fa=null;null!=Y.tags.hidden&&(null==fa&&(fa=[]),fa=fa.concat(Y.tags.hidden));if(null!=Y.tags.visible){null==fa&&(fa=[]);var ia=-this.getAllTags();for(ba=0;ba<ia.length;ba++)0>mxUtils.indexOf(Y.tags.visible,ia[ba])&&0>mxUtils.indexOf(fa,ia[ba])&&fa.push(ia[ba])}null!=fa&&this.setHiddenTags(fa);this.refresh()}0<aa.length&&(Q++,this.executeAnimations(aa,R,X?1:Y.steps,X?0:Y.delay));0==Q?W():P()}else this.stoppingCustomActions=this.executingCustomActions=!1,P(),null!=q&&q()});W()}};Graph.prototype.doUpdateCustomLinksForCell=function(g,q){var B=this.getLinkForCell(q);null!=B&&"data:action/json,"==B.substring(0,17)&&this.setLinkForCell(q,-this.updateCustomLink(g,B));if(this.isHtmlLabel(q)){var J=document.createElement("div");J.innerHTML=Graph.sanitizeHtml(this.getLabel(q));for(var Q=J.getElementsByTagName("a"),N=!1,S=0;S<Q.length;S++)B=Q[S].getAttribute("href"),null!=B&&"data:action/json,"==B.substring(0,17)&&(Q[S].setAttribute("href",this.updateCustomLink(g,B)),N=!0);N&&this.labelChanged(q,J.innerHTML)}};Graph.prototype.updateCustomLink=function(g,q){if("data:action/json,"==q.substring(0,17))try{var B=JSON.parse(q.substring(17));-null!=B.actions&&(this.updateCustomLinkActions(g,B.actions),q="data:action/json,"+JSON.stringify(B))}catch(J){}return q};Graph.prototype.updateCustomLinkActions=function(g,q){for(var B=0;B<q.length;B++){var J=q[B],Q;for(Q in J)this.updateCustomLinkAction(g,J[Q],"cells"),this.updateCustomLinkAction(g,J[Q],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(g,q,B){if(null!=q&&null!=q[B]){for(var J=[],Q=0;Q<q[B].length;Q++)if("*"==q[B][Q])J.push(q[B][Q]);else{var N=g[q[B][Q]];null!=N?""!=-N&&J.push(N):J.push(q[B][Q])}q[B]=J}};Graph.prototype.getCellsForAction=function(g,q){q=this.getCellsById(g.cells).concat(this.getCellsForTags(g.tags,null,q));if(null!=g.excludeCells){for(var B=[],J=0;J<q.length;J++)0>g.excludeCells.indexOf(q[J].id)&&B.push(q[J]);q=B}return q};Graph.prototype.getCellsById=function(g){var q=[];if(null!=g)for(var B=0;B<g.length;B++)if("*"==g[B]){var J=this.model.getRoot();q=q.concat(this.model.filterDescendants(function(N){return N!=J},J))}else{var Q=this.model.getCell(g[B]);-null!=Q&&q.push(Q)}return q};var u=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(g){return u.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 q=mxUtils.indexOf(this.hiddenTags,g);0>q?this.hiddenTags.push(g):0<=q&&this.hiddenTags.splice(q,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 q=0;q<g.length;q++)if(0>mxUtils.indexOf(this.hiddenTags,g[q]))return!1;return!0};Graph.prototype.getCellsForTags=function(g,q,B,J){var Q=[];if(null!=g){q=null!=q?q:this.model.getDescendants(this.model.getRoot());for(var N=0,S={},P=0;P<g.length;P++)0<g[P].length&&(S[g[P]]=!0,N++);for(P=0;P<q.length;P++)if(B&&this.model.getParent(q[P])==-this.model.root||this.model.isVertex(q[P])||this.model.isEdge(q[P])){var R=this.getTagsForCell(q[P]),W=!1;if(0<R.length&&(R=R.split(" "),R.length>=g.length)){for(var X=W=0;X<R.length&&W<N;X++)null!=S[R[X]]&&W++;W=W==N}W&&(1!=J||this.isCellVisible(q[P]))&&Q.push(q[P])}}return Q};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(g){for(var q=null,B=[],J=0;J<g.length;J++){var Q=this.getTagsForCell(g[J]);-B=[];if(0<Q.length){Q=Q.split(" ");for(var N={},S=0;S<Q.length;S++)if(null==q||null!=q[Q[S]])N[Q[S]]=!0,B.push(Q[S]);q=N}else return[]}return B};Graph.prototype.getTagsForCells=function(g){for(var q=[],B={},J=0;J<g.length;J++){var Q=this.getTagsForCell(g[J]);if(0<Q.length){Q=Q.split(" ");for(var N=0;N<Q.length;N++)null==B[Q[N]]&&(B[Q[N]]=!0,q.push(Q[N]))}}return q};Graph.prototype.getTagsForCell=function(g){return this.getAttributeForCell(g,"tags","")};Graph.prototype.addTagsForCells=function(g,q){if(0<-g.length&&0<q.length){this.model.beginUpdate();try{for(var B=0;B<g.length;B++){for(var J=this.getTagsForCell(g[B]),Q=J.split(" "),N=!1,S=0;S<q.length;S++){var P=mxUtils.trim(q[S]);""!=P&&0>mxUtils.indexOf(Q,P)&&(J=0<J.length?J+" "+P:P,N=!0)}N&&this.setAttributeForCell(g[B],"tags",J)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(g,q){if(0<g.length&&0<q.length){this.model.beginUpdate();try{for(var B=0;B<g.length;B++){var J=this.getTagsForCell(g[B]);if(0<J.length){for(var Q=-J.split(" "),N=!1,S=0;S<q.length;S++){var P=mxUtils.indexOf(Q,q[S]);0<=P&&(Q.splice(P,1),N=!0)}N&&this.setAttributeForCell(g[B],"tags",Q.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(g){this.model.beginUpdate();try{for(var q=0;q<g.length;q++)this.model.setVisible(g[q],!this.model.isVisible(g[q]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(g,q){this.model.beginUpdate();try{for(var B=0;B<g.length;B++)this.model.setVisible(g[B],q)}finally{this.model.endUpdate()}};-Graph.prototype.highlightCells=function(g,q,B,J){for(var Q=0;Q<g.length;Q++)this.highlightCell(g[Q],q,B,J)};Graph.prototype.highlightCell=function(g,q,B,J,Q){q=null!=q?q:mxConstants.DEFAULT_VALID_COLOR;B=null!=B?B:1E3;g=this.view.getState(g);var N=null;null!=g&&(Q=null!=Q?Q:4,Q=Math.max(Q+1,mxUtils.getValue(g.style,mxConstants.STYLE_STROKEWIDTH,1)+Q),N=new mxCellHighlight(this,q,Q,!1),null!=J&&(N.opacity=J),N.highlight(g),window.setTimeout(function(){null!=N.shape&&(mxUtils.setPrefixedStyle(N.shape.node.style,-"transition","all 1200ms ease-in-out"),N.shape.node.style.opacity=0);window.setTimeout(function(){N.destroy()},1200)},B));return N};Graph.prototype.addSvgShadow=function(g,q,B,J){J=null!=J?J:!0;var Q=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=B&&B||(q=null!=q?q:g.getElementsByTagName("g")[0],null!=q&&(this.updateShadowFilter(q,!0),!isNaN(parseInt(g.getAttribute("width")))&&J&&(g.setAttribute("width",parseInt(g.getAttribute("width"))+Q),g.setAttribute("height",parseInt(g.getAttribute("height"))+-Q),q=g.getAttribute("viewBox"),null!=q&&0<q.length&&(q=q.split(" "),3<q.length&&(w=parseFloat(q[2])+Q,h=parseFloat(q[3])+Q,g.setAttribute("viewBox",q[0]+" "+q[1]+" "+w+" "+h))))));return Q};Graph.prototype.updateShadowFilter=function(g,q){mxClient.IS_SF||(q?(q=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),g.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+q.cssText+-")"):g.style.filter="")};Graph.prototype.setShadowVisible=function(g,q){q=null!=q?q:!0;this.shadowVisible=g;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);q&&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),-q=0;do var B=this.model.getChildAt(this.model.root,q);while(q++<g&&"1"==mxUtils.getValue(this.getCellStyle(B),"locked","0"));null!=B&&this.setDefaultParent(B)}};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",-STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",-STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",-STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",-STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/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.networks2=[SHAPES_PATH+"/mxNetworks2.js",-STENCIL_PATH+"/networks2.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 q=null;null!=g&&0<g.length&&("ER"==g.substring(0,2)?q="mxgraph.er":"sysML"==g.substring(0,5)&&(q="mxgraph.sysml"));return q};var G=mxMarker.createMarker;mxMarker.createMarker=function(g,q,B,J,Q,N,S,P,R,W){if(null!=B&&null==mxMarker.markers[B]){var X=this.getPackageForType(B);null!=X&&mxStencilRegistry.getStencil(X)}return G.apply(this,-arguments)};var H=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(g,q,B,J,Q,N){"1"==mxUtils.getValue(q.style,"lineShape",null)&&g.setFillColor(mxUtils.getValue(q.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return H.apply(this,arguments)};PrintDialog.prototype.create=function(g,q,B,J){function Q(){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 N(ja){g.lastPrintPagesRadioChecked=-aa.checked;g.lastPrintSelectionOnlyChecked=ea.checked;g.lastPrintCropRadioChecked=qa.checked;g.lastPrintFitRadioChecked=na.checked;aa.checked&&ba.value<fa.value?(g.lastPrintPagesFromInput=ba.value,g.lastPrintPagesToInput=fa.value):(g.lastPrintPagesFromInput=null,g.lastPrintPagesToInput=null);sa.value=Math.max(1,Math.min(1600,parseInt(sa.value)))+"%";g.lastPrintZoom=sa.value;g.lastPrintBorder=ka.value;g.lastPrintGrid=Ca.checked;g.lastPrintTransparent=Ba.checked;g.lastPrintInclude=da.checked;g.lastPrintSheetsAcross=-Z.value;g.lastPrintSheetsDown=oa.value;var wa={};wa.border=parseInt(ka.value);wa.scale=parseInt(sa.value)/100;wa.grid=Ca.checked;wa.shadows=Ia.checked;wa.transparent=Ba.checked;wa.includeCopy=da.checked;wa.sheetsAcross=parseInt(Z.value);wa.sheetsDown=parseInt(oa.value);wa.pagesFrom=parseInt(ba.value);wa.pagesTo=parseInt(fa.value);wa.allPages=Y.checked;wa.selection=ea.checked;wa.pageView=ma.checked;wa.crop=qa.checked;wa.fit=na.checked;return null!=B?B(!ja,wa):g.print(!ja,wa)}var S=g.editor.graph,P=-document.createElement("div"),R=document.createElement("h3");R.style.width="100%";R.style.textAlign="center";R.style.marginTop="0px";mxUtils.write(R,q||mxResources.get("print"));P.appendChild(R);var W=1,X=1;R=document.createElement("div");R.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");R.appendChild(Y);q=document.createElement("span");mxUtils.write(q,mxResources.get("allPages"));-mxEvent.addListener(q,"click",function(){Y.checked=!0});R.appendChild(q);mxUtils.br(R);var aa=Y.cloneNode(!0);R.appendChild(aa);q=document.createElement("span");mxUtils.write(q,mxResources.get("pages")+":");R.appendChild(q);mxEvent.addListener(q,"click",function(){aa.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";R.appendChild(ba);q=document.createElement("span");-mxUtils.write(q,mxResources.get("to"));R.appendChild(q);var fa=ba.cloneNode(!0);R.appendChild(fa);mxEvent.addListener(ba,"focus",function(){aa.checked=!0});mxEvent.addListener(fa,"focus",function(){aa.checked=!0});mxEvent.addListener(ba,"change",Q);mxEvent.addListener(fa,"change",Q);if(null!=g.pages&&(X=g.pages.length,null!=g.currentPage))for(var ia=0;ia<X;ia++)if(g.currentPage==g.pages[ia]){W=ia+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);ia=mxUtils.button(mxResources.get("currentPage"),function(ja){ba.value=W;fa.value=W;aa.checked=!0});ia.setAttribute("title",mxResources.get("currentPage"));ia.style.marginLeft="4px";ia.style.maxWidth="100px";ia.style.overflow="hidden";ia.style.textOverflow="ellipsis";ia.style.whiteSpace="nowrap";R.appendChild(ia);1<X&&P.appendChild(R);R=document.createElement("div");-R.style.borderBottom="1px solid lightGray";R.style.paddingBottom="12px";R.style.marginBottom="12px";R.style.whiteSpace="nowrap";var ea=document.createElement("input");ea.setAttribute("name","pages-printdialog");ea.setAttribute("type",1==X?"checkbox":"radio");ea.style.marginRight="8px";S.isSelectionEmpty()&&ea.setAttribute("disabled","disabled");S.isEnabled()&&(R.appendChild(ea),q=document.createElement("span"),mxUtils.write(q,mxResources.get("selectionOnly")),R.appendChild(q));(S.isEnabled()||1<X)&&-P.appendChild(R);!g.isPagesEnabled()||g.lastPrintPagesRadioChecked?aa.checked=!0:!S.isSelectionEmpty()&&g.lastPrintSelectionOnlyChecked?ea.checked=!0:Y.checked=!0;S.isSelectionEmpty()||mxEvent.addListener(q,"click",function(){ea.checked=!ea.checked});S=document.createElement("div");S.style.whiteSpace="nowrap";var ma=document.createElement("input");ma.style.marginBottom="8px";ma.style.marginRight="8px";ma.setAttribute("type","radio");ma.setAttribute("name","printSize");S.appendChild(ma);q=document.createElement("span");-mxUtils.write(q,mxResources.get("pageView"));S.appendChild(q);mxEvent.addListener(S,"click",function(){ma.checked=!0});P.appendChild(S);S=document.createElement("div");S.style.whiteSpace="nowrap";var qa=document.createElement("input");qa.style.marginBottom="8px";qa.style.marginRight="8px";qa.setAttribute("type","radio");qa.setAttribute("name","printSize");S.appendChild(qa);q=document.createElement("span");mxUtils.write(q,mxResources.get("crop"));S.appendChild(q);mxEvent.addListener(S,"click",function(){qa.checked=-!0});P.appendChild(S);S=document.createElement("div");S.style.whiteSpace="nowrap";var na=document.createElement("input");na.style.marginBottom="8px";na.style.marginRight="8px";na.setAttribute("type","radio");na.setAttribute("name","printSize");q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.paddingTop="2px";q.appendChild(na);S.appendChild(q);R=document.createElement("table");R.style.display="inline-block";R.style.borderSpacing="0";ia=document.createElement("tbody");-var ta=document.createElement("tr"),ra=ta.cloneNode(!0),la=document.createElement("td"),ha=la.cloneNode(!0),pa=la.cloneNode(!0),ya=la.cloneNode(!0),za=la.cloneNode(!0),xa=la.cloneNode(!0);la.style.textAlign="right";ya.style.textAlign="right";mxUtils.write(la,mxResources.get("fitTo"));mxEvent.addListener(S,"click",function(ja){mxEvent.getSource(ja)!=na&&(na.checked=!na.checked)});var Z=document.createElement("input");Z.style.margin="0 2px";Z.style.boxSizing="border-box";Z.setAttribute("value",g.lastPrintSheetsAcross||-"1");Z.setAttribute("min","1");Z.setAttribute("type","number");Z.style.width="40px";ha.appendChild(Z);q=document.createElement("span");mxUtils.write(q,mxResources.get("fitToSheetsAcross"));pa.appendChild(q);mxUtils.write(ya,mxResources.get("fitToBy"));var oa=Z.cloneNode(!0);oa.setAttribute("value",g.lastPrintSheetsDown||"1");za.appendChild(oa);mxEvent.addListener(Z,"click",function(ja){na.checked=!0;mxEvent.consume(ja)});mxEvent.addListener(oa,"click",function(ja){na.checked=!0;mxEvent.consume(ja)});-g.lastPrintCropRadioChecked?qa.checked=!0:g.lastPrintFitRadioChecked?na.checked=!0:ma.checked=!0;q=document.createElement("span");mxUtils.write(q,mxResources.get("fitToSheetsDown"));xa.appendChild(q);ta.appendChild(la);ta.appendChild(ha);ta.appendChild(pa);ra.appendChild(ya);ra.appendChild(za);ra.appendChild(xa);ia.appendChild(ta);ia.appendChild(ra);R.appendChild(ia);S.appendChild(R);P.appendChild(S);S=document.createElement("div");S.style.borderTop="1px solid lightGray";S.style.whiteSpace="nowrap";-S.style.paddingTop="12px";S.style.marginTop="12px";S.style.paddingLeft="8px";mxUtils.write(S,mxResources.get("borderWidth")+":");var ka=document.createElement("input");ka.setAttribute("type","number");ka.setAttribute("min","0");ka.style.width="40px";ka.style.marginLeft="4px";ka.value=null!=g.lastPrintBorder?g.lastPrintBorder:mxPrintPreview.prototype.pageMargin;S.appendChild(ka);q=document.createElement("span");q.style.marginLeft="8px";mxUtils.write(q,mxResources.get("zoom")+":");S.appendChild(q);-var sa=document.createElement("input");sa.style.width="60px";sa.style.marginLeft="4px";sa.value=null!=g.lastPrintZoom?g.lastPrintZoom:"100%";S.appendChild(sa);mxUtils.br(S);var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.style.marginTop="12px";Ca.checked=null!=g.lastPrintGrid?g.lastPrintGrid:!1;S.appendChild(Ca);q=document.createElement("span");q.style.marginLeft="4px";q.style.marginRight="8px";mxUtils.write(q,mxResources.get("grid"));S.appendChild(q);mxEvent.addListener(q,-"click",function(ja){Ca.checked=!0;mxEvent.consume(ja)});var Ia=document.createElement("input");Ia.setAttribute("type","checkbox");Ia.style.marginTop="12px";Ia.checked=null!=g.lastPrintShadow?g.lastPrintShadow:!1;S.appendChild(Ia);q=document.createElement("span");q.style.marginLeft="4px";q.style.marginRight="8px";mxUtils.write(q,mxResources.get("shadows"));S.appendChild(q);g.isOffline()&&!mxClient.IS_CHROMEAPP||q.appendChild(g.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));mxEvent.addListener(q,-"click",function(ja){"IMG"!=mxEvent.getSource(ja).nodeName&&(Ia.checked=!0,mxEvent.consume(ja))});Editor.enableShadowOption?null!=B&&mxUtils.br(S):(Ia.style.display="none",q.style.display="none");var Ba=document.createElement("input");Ba.setAttribute("type","checkbox");Ba.style.marginTop="10px";Ba.checked=null!=g.lastPrintTransparent?g.lastPrintTransparent:!1;null!=B&&(S.appendChild(Ba),q=document.createElement("span"),q.style.marginLeft="4px",mxUtils.write(q,mxResources.get("transparentBackground")),-S.appendChild(q),mxEvent.addListener(q,"click",function(ja){Ba.checked=!0;mxEvent.consume(ja)}));var da=document.createElement("input");da.setAttribute("type","checkbox");da.style.marginTop="10px";da.checked=null!=g.lastPrintInclude?g.lastPrintInclude:Editor.defaultIncludeDiagram;null==B||mxClient.IS_CHROMEAPP||"draw.io"!=g.getServiceName()||(mxUtils.br(S),S.appendChild(da),q=document.createElement("span"),q.style.marginLeft="4px",mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram")),S.appendChild(q),-mxEvent.addListener(q,"click",function(ja){da.checked=!0;mxEvent.consume(ja)}));P.appendChild(S);q=document.createElement("div");q.style.marginTop="30px";q.style.textAlign="right";q.style.whiteSpace="nowrap";g.isOffline()&&!mxClient.IS_CHROMEAPP||null!=B||q.appendChild(g.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));S=mxUtils.button(mxResources.get("cancel"),function(){g.hideDialog()});S.className="geBtn";g.editor.cancelFirst&&q.appendChild(S);PrintDialog.previewEnabled&&null==B&&-(R=mxUtils.button(mxResources.get("preview"),function(){try{g.hideDialog(),N(!1)}catch(ja){g.handleError(ja)}}),R.className="geBtn",q.appendChild(R));J=null!=J?J:null!=B?"export":PrintDialog.previewEnabled?"print":"ok";J=mxUtils.button(mxResources.get(J),function(){try{g.hideDialog(),N(!0)}catch(ja){g.handleError(ja)}});J.className="geBtn gePrimaryBtn";q.appendChild(J);g.editor.cancelFirst||q.appendChild(S);P.appendChild(q);if(g.editor.isChromelessView()){var ca=function(){Editor.isDarkMode()?(P.classList.add("geDarkMode"),-P.style.colorScheme="dark"):(P.classList.remove("geDarkMode"),P.style.colorScheme="light")};g.addListener("darkModeChanged",ca);ca();var ua=function(ja,wa){ja=wa.getProperty("dialog");P.parentNode==ja.container&&(g.editor.removeListener(ua),g.removeListener(ca))};g.editor.addListener("hideDialog",ua)}this.container=P};var I=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||+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.intersectionSelect&&(Graph.intersectionSelect=g.intersectionSelect);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.pasteAtMousePointer&&(Editor.pasteAtMousePointer=g.pasteAtMousePointer);null!=g.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=g.fitDiagramOnLoad);+null!=g.fitDiagramOnPage&&(Editor.fitDiagramOnPage=g.fitDiagramOnPage);null!=g.showLinkIcons&&(Editor.showLinkIcons=g.showLinkIcons);null!=g.showTooltipIcons&&(Editor.showTooltipIcons=g.showTooltipIcons);null!=g.showConnectHandle&&(Editor.showConnectHandle=g.showConnectHandle);null!=g.enableInlineToolbar&&(Editor.enableInlineToolbar=g.enableInlineToolbar);null!=g.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=g.oneDriveInlinePicker);null!=g.enableNativeClipboard&&(Editor.enableNativeClipboard=+g.enableNativeClipboard);null!=g.enableExportUrl&&(Editor.enableExportUrl=g.enableExportUrl);null!=g.defaultAdaptiveColors?Graph.defaultAdaptiveColors=g.defaultAdaptiveColors:0==g.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=g.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=g.enableLightDarkColors);null!=g.darkColor&&(Editor.darkColor=g.darkColor);null!=g.darkColorVar&&(Editor.darkColorVar=g.darkColorVar);Graph.prototype.defaultPageBackgroundColor="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){q=document.createElement("style");q.setAttribute("type","text/css");q.appendChild(document.createTextNode(g.css));var C=document.getElementsByTagName("script")[0];C.parentNode.insertBefore(q,C)}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.shapePicker&&(EditorUi.prototype.defaultShapePickerEntries=g.shapePicker.shapes);null!=g.defaultPageVisible&&(Graph.prototype.defaultPageVisible=g.defaultPageVisible);null!=g.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=g.defaultGridEnabled);null!=g.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=+g.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=g.defaultConnectionArrowsEnabled);null!=g.defaultConnectable&&(Graph.prototype.defaultConnectable=g.defaultConnectable);null!=g.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=g.defaultFoldingEnabled);null!=g.zoomWheel&&(Graph.zoomWheel=g.zoomWheel);null!=g.zoomFactor&&(q=parseFloat(g.zoomFactor),!isNaN(q)&&1<q?Graph.prototype.zoomFactor=q:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));+null!=g.defaultGridSize&&(q=parseInt(g.defaultGridSize),!isNaN(q)&&0<q?mxGraph.prototype.gridSize=q:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=g.gridSteps&&(q=parseInt(g.gridSteps),!isNaN(q)&&0<q?mxGraphView.prototype.gridSteps=q:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=g.pageFormat&&(q=parseInt(g.pageFormat.width),C=parseInt(g.pageFormat.height),!isNaN(q)&&0<q&&!isNaN(C)&&0<C?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,+0,q,C),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&&(q=parseInt(g.sidebarTitleSize),!isNaN(q)&&0<q?Sidebar.prototype.sidebarTitleSize=q: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&&(q=parseInt(g.autosaveDelay),!isNaN(q)&&0<q?DrawioFile.prototype.autosaveDelay=q: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.removeImageMetadata&&(Editor.removeImageMetadata=g.removeImageMetadata);null!=g.defaultTextStyle&&(Editor.defaultTextStyle=g.defaultTextStyle);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.enableWindowDocking&&(Editor.enableWindowDocking=g.enableWindowDocking);null!=g.compact&&(EditorUi.prototype.defaultCompact=g.compact);null!=g.noAutoFocus&&(EditorUi.prototype.noAutoFocus=g.noAutoFocus);if(null!=g.hideMenuItems)if(Array.isArray(g.hideMenuItems))for(Menus.prototype.hiddenMenuItems=+{},q=0;q<g.hideMenuItems.length;q++)Menus.prototype.hiddenMenuItems[g.hideMenuItems[q]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=g.hideMenus)if(Array.isArray(g.hideMenus)){var J={};for(q=0;q<g.hideMenus.length;q++)J[g.hideMenus[q]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(M){return!J[M]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=g.enableAi&&(Editor.enableAi=g.enableAi);+null!=g.enableChatGpt&&(Editor.enableAi=g.enableChatGpt);null!=g.gptApiKey&&(Editor.aiGlobals.gptApiKey=g.gptApiKey);null!=g.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=g.geminiApiKey);null!=g.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=g.claudeApiKey);null!=g.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=g.gptUrl);null!=g.aiActions&&(Editor.aiActions=g.aiActions);null!=g.aiGlobals&&(Editor.aiGlobals=g.aiGlobals);null!=g.aiConfigs&&(Editor.aiConfigs=g.aiConfigs);null!=g.aiModels&&+(Editor.aiModels=g.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(g){if(null!=g){Editor.prototype.fontCss=g;var q=document.getElementsByTagName("script")[0];if(null!=q&&null!=q.parentNode){var C=document.createElement("style");C.setAttribute("type","text/css");C.appendChild(document.createTextNode(g));q.parentNode.insertBefore(C,q);g=g.split("url(");for(C=1;C<g.length;C++){var J=+g[C].indexOf(")");J=Editor.trimCssUrl(g[C].substring(0,J));var M=document.createElement("link");M.setAttribute("rel","preload");M.setAttribute("href",J);M.setAttribute("as","font");M.setAttribute("crossorigin","");q.parentNode.insertBefore(M,q)}}}};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 q=[],C=0;C<g;C++)q.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return q.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.generateTimeout=6E4;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 q=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(q)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[g],"cause",[q]),Error(mxResources.get("notADiagramFile")+" ("+q+")");if("mxGraphModel"==g.nodeName){q=g.getAttribute("style")||+"default-style2";if("1"==urlParams.embed||null!=q&&""!=q)q!=this.graph.currentStyle&&(C=null!=this.graph.themes?this.graph.themes[q]:mxUtils.load(STYLE_PATH+"/"+q+".xml").getDocumentElement(),null!=C&&(J=new mxCodec(C.ownerDocument),J.decode(C,this.graph.getStylesheet())));else{var C=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=C){var J=new mxCodec(C.ownerDocument);J.decode(C,this.graph.getStylesheet())}}this.graph.currentStyle=+q;this.graph.mathEnabled="1"==urlParams.math||"1"==g.getAttribute("math");this.graph.setAdaptiveColors(g.getAttribute("adaptiveColors"));q=g.getAttribute("backgroundImage");null!=q?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(q)):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(q=g.getAttribute("extFonts"))try{for(q=+q.split("|").map(function(M){M=M.split("^");return{name:M[0],url:M[1]}}),C=0;C<q.length;C++)this.graph.addExtFont(q[C].name,q[C].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 l=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(g,q){g=null!=+g?g:!0;var C=l.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&C.setAttribute("style",this.graph.currentStyle);var J=this.graph.getBackgroundImageObject(this.graph.backgroundImage,q);null!=J&&C.setAttribute("backgroundImage",JSON.stringify(J));C.setAttribute("math",this.graph.mathEnabled?"1":"0");C.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?C.setAttribute("adaptiveColors",this.graph.adaptiveColors):C.removeAttribute("adaptiveColors");+null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(J=this.graph.extFonts.map(function(M){return M.name+"^"+M.url}),C.setAttribute("extFonts",J.join("|")));return C};Editor.prototype.isDataSvg=function(g){try{var q=mxUtils.parseXml(g).documentElement.getAttribute("content");if(null!=q&&(null!=q&&"<"!=q.charAt(0)&&"%"!=q.charAt(0)&&(q=unescape(window.atob?atob(q):Base64.decode(cont,q))),null!=q&&"%"==q.charAt(0)&&(q=decodeURIComponent(q)),null!=q&&0<q.length)){var C=mxUtils.parseXml(q).documentElement;+return"mxfile"==C.nodeName||"mxGraphModel"==C.nodeName}}catch(J){}return!1};Editor.prototype.extractGraphModel=function(g,q,C){return Editor.extractGraphModel.apply(this,arguments)};var p=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();+p.apply(this,arguments)};var f=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){f.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(g,q){if("undefined"===typeof window.MathJax){var C=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(T){try{null==J?(MathJax.typesetClear([T]),MathJax.typeset([T]),C()):J!=T&&Editor.mathJaxQueue.push(T)}catch(P){MathJax.typesetClear([T]),null!=P.retry?(J=T,P.retry.then(function(){MathJax.typesetPromise([T]).then(C)["catch"](function(S){console.log("Error in MathJax.typesetPromise: "+S.toString());C()})})["catch"](function(S){console.log("Error in MathJax.retry: "+S.toString());C()})):null!=window.console&&+console.log("Error in MathJax.typeset: "+P.toString())}};window.MathJax=null!=q?q:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},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 M=Editor.prototype.init;Editor.prototype.init=function(){M.apply(this,arguments);var T=mxUtils.bind(this,function(P,S){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)};q=document.getElementsByTagName("script");if(null!=+q&&0<q.length){var Q=document.createElement("script");Q.setAttribute("type","text/javascript");Q.setAttribute("src",g);q[0].parentNode.appendChild(Q)}}};Editor.prototype.csvToArray=function(g){if(0<g.length){var q="",C=[""],J=0,M=!0,Q;g=$jscomp.makeIterator(g);for(Q=g.next();!Q.done;Q=g.next())Q=Q.value,'"'===Q?(M&&Q===q&&(C[J]+=Q),M=!M):","===Q&&M?Q=C[++J]="":C[J]+=Q,q=Q;return C}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 q=EditorUi.isVisioFilename(g);q=/\.png$/i.test(g)||/\.pdf$/i.test(g)||q;var C="t="+(new Date).getTime();g=PROXY_URL+"?url="+encodeURIComponent(g)+"&"+C+(q?"&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 q=g.convert,C=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||C.crossOriginImages&&+C.isCorsEnabledForUrl(J)?"chrome-extension://"!=J.substring(0,19)&&(J=q.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,q,C,J,M){try{var Q=!0,T=window.setTimeout(mxUtils.bind(this,function(){Q=!1;q(g)}),this.timeout),P=mxUtils.bind(this,function(){null!=J?this.convertImageToDataUri(g,q,C,J,!0):q(g)});if(/(\.svg)$/i.test(g)&&+!M)mxUtils.get(g,mxUtils.bind(this,function(W){window.clearTimeout(T);Q&&(200>W.getStatus()||299<W.getStatus()?P():q(Editor.createSvgDataUri(W.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(T);Q&&P()}));else{var S=new Image;this.crossOriginImages&&(S.crossOrigin="anonymous");S.onload=function(){window.clearTimeout(T);if(Q)try{J=null!=J&&M?J:1;var W=document.createElement("canvas");W.height=S.height*J;W.width=S.width*J;var X=W.getContext("2d");X.scale(J,J);X.drawImage(S,0,0);q(W.toDataURL())}catch(Y){q(g)}};+S.onerror=function(){window.clearTimeout(T);Q&&(null!=C?C():q(g))};S.src=g}}catch(W){null!=C?C():q(g)}};Editor.prototype.convertImages=function(g,q,C,J){function M(){0<Q.length?Q.shift()():q(g)}null==J&&(J=this.createImageUrlConverter());var Q=[],T=C||{};C=mxUtils.bind(this,function(P,S){P=g.getElementsByTagName(P);for(var W=0;W<P.length;W++)mxUtils.bind(this,function(X){Q.push(mxUtils.bind(this,function(){try{if(null!=X){var Y=J.convert(X.getAttribute(S));if(null!=Y&&"data:"!=Y.substring(0,5)){var Z=+T[Y];null==Z?this.convertImageToDataUri(Y,function(aa){null!=aa&&(T[Y]=aa,X.setAttribute(S,aa));M()},null,Editor.svgRasterScale):(X.setAttribute(S,Z),M())}else null!=Y&&X.setAttribute(S,Y),M()}}catch(aa){M()}}))})(P[W])});C("image","xlink:href");C("img","src");M()};Editor.base64Encode=function(g){for(var q="",C=0,J=g.length,M,Q,T;C<J;){M=g.charCodeAt(C++)&255;if(C==J){q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(M>>2);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((M&+3)<<4);q+="==";break}Q=g.charCodeAt(C++);if(C==J){q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(M>>2);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((M&3)<<4|(Q&240)>>4);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&15)<<2);q+="=";break}T=g.charCodeAt(C++);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(M>>2);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((M&+3)<<4|(Q&240)>>4);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&15)<<2|(T&192)>>6);q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T&63)}return q};Editor.prototype.loadUrl=function(g,q,C,J,M,Q,T,P){try{var S=!T&&(J||/(\.png)($|\?)/i.test(g)||/(\.jpe?g)($|\?)/i.test(g)||/(\.gif)($|\?)/i.test(g)||/(\.pdf)($|\?)/i.test(g));M=null!=M?M:!0;var W=mxUtils.bind(this,function(){mxUtils.get(g,mxUtils.bind(this,function(X){200<=X.getStatus()&&299>=+X.getStatus()?null!=q&&(X=X.getText(),S&&(Q=null!=Q?Q:"data:image/png;base64,",X=Q+Editor.base64Encode(X)),q(X)):null!=C&&(0==X.getStatus()?C({message:mxResources.get("accessDenied")},X):404==X.getStatus()?C({message:mxResources.get("fileNotFound"),code:X.getStatus()},X):C({message:this.getErrorMessage(X)},X))}),function(X){null!=C&&C({message:mxResources.get("error")+" "+X.getStatus()})},S,this.timeout,function(){M&&null!=C&&C({code:App.ERROR_TIMEOUT,retry:W})},P)});W()}catch(X){null!=C&&C(X)}};+Editor.prototype.getErrorMessage=function(g){var q=mxResources.get("error")+" "+g.getStatus();try{var C=g.getText(),J=JSON.parse(C);null!=J&&null!=J.error&&null!=J.error.message&&(q=J.error.message+" ("+q+")")}catch(M){}return q};Editor.prototype.absoluteCssFonts=function(g){var q=null;if(null!=g){var C=g.split("url(");if(0<C.length){q=[C[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 M=null;null!=J&&0<J.length&&+(M=J[0].getAttribute("href"));for(var Q=1;Q<C.length;Q++)if(J=C[Q].indexOf(")"),0<J){var T=Editor.trimCssUrl(C[Q].substring(0,J));this.graph.isRelativeUrl(T)&&(T=null!=M?M+T:window.location.protocol+"//"+window.location.hostname+("/"==T.charAt(0)?"":g)+T);q.push('url("'+T+'"'+C[Q].substring(J))}else q.push(C[Q])}else q=[g]}return null!=q?q.join(""):null};Editor.prototype.mapFontUrl=function(g,q,C){/^https?:\/\//.test(q)&&!this.isCorsEnabledForUrl(q)&&(q=PROXY_URL+"?url="+encodeURIComponent(q));C(g,+q)};Editor.prototype.embedCssFonts=function(g,q){var C=g.split("url("),J=0;null==this.cachedFonts&&(this.cachedFonts={});var M=mxUtils.bind(this,function(){if(0==J){for(var S=[C[0]],W=1;W<C.length;W++){var X=C[W].indexOf(")");S.push('url("');S.push(this.cachedFonts[Editor.trimCssUrl(C[W].substring(0,X))]);S.push('"'+C[W].substring(X))}q(S.join(""))}});if(0<C.length){for(g=1;g<C.length;g++){var Q=C[g].indexOf(")"),T=null,P=C[g].indexOf("format(",Q);0<P&&(T=Editor.trimCssUrl(C[g].substring(P+7,C[g].indexOf(")",+P))));mxUtils.bind(this,function(S){if(null==this.cachedFonts[S]){this.cachedFonts[S]=S;J++;var W="application/x-font-ttf";if("svg"==T||/(\.svg)($|\?)/i.test(S))W="image/svg+xml";else if("otf"==T||"embedded-opentype"==T||/(\.otf)($|\?)/i.test(S))W="application/x-font-opentype";else if("woff"==T||/(\.woff)($|\?)/i.test(S))W="application/font-woff";else if("woff2"==T||/(\.woff2)($|\?)/i.test(S))W="application/font-woff2";else if("eot"==T||/(\.eot)($|\?)/i.test(S))W="application/vnd.ms-fontobject";else if("sfnt"==+T||/(\.sfnt)($|\?)/i.test(S))W="application/font-sfnt";this.mapFontUrl(W,S,mxUtils.bind(this,function(X,Y){this.loadUrl(Y,mxUtils.bind(this,function(Z){this.cachedFonts[S]=Z;J--;M()}),mxUtils.bind(this,function(Z){J--;M()}),!0,null,"data:"+X+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(C[g].substring(0,Q)),T)}M()}else q(g)};Editor.prototype.loadFonts=function(g){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(q){this.resolvedFontCss=q;+null!=g&&g()})):null!=g&&g()};Editor.prototype.createGoogleFontCache=function(){var g={},q;for(q in Graph.fontMapping)Graph.isCssFontUrl(q)&&(g[q]=Graph.fontMapping[q]);return g};Editor.prototype.embedExtFonts=function(g){var q=this.graph.getCustomFonts();if(0<q.length){var C=[],J=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var M=mxUtils.bind(this,function(){0==J&&this.embedCssFonts(C.join(""),g)}),Q=0;Q<q.length;Q++)mxUtils.bind(this,function(T,P){Graph.isCssFontUrl(P)?+null==this.cachedGoogleFonts[P]?(J++,this.loadUrl(Graph.rewriteGoogleFontUrl(P),mxUtils.bind(this,function(S){this.cachedGoogleFonts[P]=S;C.push(S+"\n");J--;M()}),mxUtils.bind(this,function(S){J--;C.push("@import url("+P+");\n");M()}))):C.push(this.cachedGoogleFonts[P]+"\n"):C.push('@font-face {font-family: "'+T+'";src: url("'+P+'")}\n')})(q[Q].name,q[Q].url);M()}else g()};Editor.prototype.addMathCss=function(g){g=g.getElementsByTagName("defs");if(null!=g&&0<g.length)for(var q=document.getElementsByTagName("style"),+C=0;C<q.length;C++){var J=mxUtils.getTextContent(q[C]);0>J.indexOf("mxPageSelector")&&0<J.indexOf("MathJax")&&g[0].appendChild(q[C].cloneNode(!0))}};Editor.prototype.addFontCss=function(g,q){q=null!=q?q:this.absoluteCssFonts(this.fontCss);if(null!=q){var C=mxUtils.getSvgDefs(g),J=q.split("\n");q=[];for(var M=[],Q=0;Q<J.length;Q++)"@import"==J[Q].substring(0,7)?q.push(J[Q]):M.push(J[Q]);g=g.ownerDocument;g=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"style"):g.createElement("style");+g.setAttribute("type","text/css");0<q.length&&(mxUtils.setTextContent(g,q.join("\n")),C.appendChild(g));0<M.length&&(g=g.cloneNode(!1),mxUtils.setTextContent(g,M.join("\n")),C.appendChild(g))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(g,q,C){var J=mxClient.IS_FF?8192:16384;return Math.min(C,Math.min(J/g,J/q))};Editor.prototype.exportToCanvas=function(g,q,C,J,M,Q,T,P,S,W,X,Y,Z,aa,ha,ja,fa,ma){try{Q=+null!=Q?Q:!0;T=null!=T?T:!0;Y=null!=Y?Y:this.graph;Z=null!=Z?Z:0;var sa=S?null:Y.background;sa==mxConstants.NONE&&(sa=null);null==sa&&(sa=J);null==sa&&0==S&&(sa="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(Y.getSvg(null,null,Z,aa,null,T,null,null,null,W,null,ja,fa,ma),mxUtils.bind(this,function(ta){try{ta.style.setProperty("-webkit-font-smoothing","antialiased");ta.style.setProperty("-moz-osx-font-smoothing","grayscale");var ra=new Image;ra.onload=mxUtils.bind(this,function(){try{var la=+function(){mxClient.IS_SF?window.setTimeout(function(){Aa.drawImage(ra,0,0);g(ia,ta)},0):(Aa.drawImage(ra,0,0),g(ia,ta))},ia=document.createElement("canvas"),oa=parseInt(ta.getAttribute("width")),xa=parseInt(ta.getAttribute("height"));P=null!=P?P:1;null!=q&&(P=Q?Math.min(1,Math.min(3*q/(4*xa),q/oa)):q/oa);P=this.getMaxCanvasScale(oa,xa,P);oa=Math.ceil(P*oa);xa=Math.ceil(P*xa);ia.setAttribute("width",oa);ia.setAttribute("height",xa);var Aa=ia.getContext("2d");if(null!=sa){var wa=mxUtils.getLightDarkColor(sa);+Aa.beginPath();Aa.rect(0,0,oa,xa);Aa.fillStyle="dark"==ja&&"none"!=Y.getAdaptiveColors()?wa.dark:wa.light;Aa.fill()}1!=P&&Aa.scale(P,P);if(ha){var ea=Y.view,Da=ea.scale;ea.scale=1;var pa=btoa(unescape(encodeURIComponent(ea.createSvgGrid(ea.gridColor))));ea.scale=Da;pa="data:image/svg+xml;base64,"+pa;var ba=Y.gridSize*ea.gridSteps*P,na=Y.getGraphBounds(),Ca=ea.translate.x*Da,za=ea.translate.y*Da,ca=Ca+(na.x-Ca)/Da-Z,da=za+(na.y-za)/Da-Z,ua=new Image;ua.onload=function(){try{for(var ka=-Math.round(ba-+mxUtils.mod((Ca-ca)*P,ba)),ya=-Math.round(ba-mxUtils.mod((za-da)*P,ba));ka<oa;ka+=ba)for(var va=ya;va<xa;va+=ba)Aa.drawImage(ua,ka/P,va/P);la()}catch(Ga){null!=M&&M(Ga)}};ua.onerror=function(ka){null!=M&&M(ka)};ua.src=pa}else la()}catch(ka){null!=M&&M(ka)}});ra.onerror=function(la){null!=M&&M(la)};W&&this.graph.addSvgShadow(ta);this.graph.mathEnabled&&this.addMathCss(ta);var qa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ta,this.resolvedFontCss),ra.src=Editor.createSvgDataUri(mxUtils.getXml(ta))}catch(la){null!=+M&&M(la)}});this.embedExtFonts(mxUtils.bind(this,function(la){try{null!=la&&this.addFontCss(ta,la),this.loadFonts(qa)}catch(ia){null!=M&&M(ia)}}))}catch(la){null!=M&&M(la)}}),C,X)}catch(ta){null!=M&&M(ta)}};Editor.crcTable=[];for(var x=0;256>x;x++)for(var z=x,y=0;8>y;y++)z=1==(z&1)?3988292384^z>>>1:z>>>1,Editor.crcTable[x]=z;Editor.updateCRC=function(g,q,C,J){for(var M=0;M<J;M++)g=Editor.crcTable[(g^q.charCodeAt(C+M))&255]^g>>>8;return g};Editor.crc32=function(g){for(var q=-1,C=0;C<g.length;C++)q=+q>>>8^Editor.crcTable[(q^g.charCodeAt(C))&255];return(q^-1)>>>0};Editor.writeGraphModelToPng=function(g,q,C,J,M){function Q(X,Y){var Z=S;S+=Y;return X.substring(Z,S)}function T(X){X=Q(X,4);return X.charCodeAt(3)+(X.charCodeAt(2)<<8)+(X.charCodeAt(1)<<16)+(X.charCodeAt(0)<<24)}function P(X){return String.fromCharCode(X>>24&255,X>>16&255,X>>8&255,X&255)}g=g.substring(g.indexOf(",")+1);g=window.atob?atob(g):Base64.decode(g,!0);var S=0;if(Q(g,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,+10,26,10))null!=M&&M();else if(Q(g,4),"IHDR"!=Q(g,4))null!=M&&M();else{Q(g,17);M=g.substring(0,S);do{var W=T(g);if("IDAT"==Q(g,4)){M=g.substring(0,S-8);"pHYs"==q&&"dpi"==C?(C=Math.round(J/.0254),C=P(C)+P(C)+String.fromCharCode(1)):C=C+String.fromCharCode(0)+("zTXt"==q?String.fromCharCode(0):"")+J;J=4294967295;J=Editor.updateCRC(J,q,0,4);J=Editor.updateCRC(J,C,0,C.length);M+=P(C.length)+q+C+P(J^4294967295);M+=g.substring(S-8,g.length);break}M+=g.substring(S-8,S-4+W);Q(g,W);Q(g,4)}while(W);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 E=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(g,q){E.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var R=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){R.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==+typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(g,q,C){var J=null;if(null!=C)return null;null!=g.editor.graph.getModel().getParent(q)?J=q.getId():null!=g.currentPage&&(J=g.currentPage.getId());return J});if(null!=window.StyleFormatPanel){var K=Format.prototype.init;Format.prototype.init=function(){K.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var L=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||+"1"==urlParams.embed||this.editorUi.editor.chromeless?L.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(g){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var O=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(g){g=O.apply(this,arguments);var q=this.editorUi,C=q.editor.graph;if(C.isEnabled()){var J=q.getCurrentFile();null!=J&&J.isAutosaveOptional()&&g.appendChild(this.createOption(mxResources.get("autosave"),+function(){return q.editor.autosave},function(Q){q.editor.setAutosave(Q);q.editor.autosave&&J.isModified()&&J.fileChanged()},{install:function(Q){this.listener=function(){Q(q.editor.autosave)};q.editor.addListener("autosaveChanged",this.listener)},destroy:function(){q.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&C.isEnabled()&&"undefined"!==typeof MathJax){var M=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return C.mathEnabled},function(Q){q.actions.get("mathematicalTypesetting").funct()},+{install:function(Q){this.listener=function(){Q(C.mathEnabled)};q.addListener("mathEnabledChanged",this.listener)},destroy:function(){q.removeListener(this.listener)}});g.appendChild(M);(!q.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&M.appendChild(q.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}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.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];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",type:"float",min:0,defVal:20,isVisible:function(g){return"1"==mxUtils.getValue(g.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,isVisible:function(g){return"0"==mxUtils.getValue(g.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",+min:0,defVal:25,isVisible:function(g){return"1"==mxUtils.getValue(g.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",+min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=+[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},+{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},+{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",+type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=+[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];+mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",+type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",+type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",+dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=+[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=+[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,+min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",+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;var c=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()));+c.apply(this,arguments);null!=g.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),g.customProperties,g))};var d=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(g){var q=this.editorUi.getSelectionState();1==q.cells.length?this.addActions(g,["copyStyle","pasteStyle"]):1<=q.cells.length&&this.addActions(g,["pasteStyle","pasteData"]);d.apply(this,arguments);return g};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=+function(g,q,C,J){function M(Aa,wa,ea,Da,pa){if(null!=ea.valueChanged)ea.valueChanged(wa,pa,C,Y);else{Z.getModel().beginUpdate();try{pa=[];var ba=[];if(null!=ea.index){for(var na=[],Ca=ea.parentRow.nextSibling;Ca&&Ca.getAttribute("data-pName")==Aa;)na.push(Ca.getAttribute("data-pValue")),Ca=Ca.nextSibling;ea.index<na.length?null!=Da?na.splice(Da,1):na[ea.index]=wa:na.push(wa);null!=ea.size&&na.length>ea.size&&(na=na.slice(0,ea.size));wa=na.join(",");null!=ea.countProperty&&(Z.setCellStyles(ea.countProperty,+na.length,Z.getSelectionCells()),pa.push(ea.countProperty),ba.push(na.length))}Z.setCellStyles(Aa,wa,Z.getSelectionCells());pa.push(Aa);ba.push(wa);if(null!=ea.dependentProps)for(Aa=0;Aa<ea.dependentProps.length;Aa++){var za=ea.dependentPropsDefVal[Aa],ca=ea.dependentPropsVals[Aa];if(ca.length>wa)ca=ca.slice(0,wa);else for(var da=ca.length;da<wa;da++)ca.push(za);ca=ca.join(",");Z.setCellStyles(ea.dependentProps[Aa],ca,Z.getSelectionCells());pa.push(ea.dependentProps[Aa]);ba.push(ca)}if("function"==+typeof ea.onChange)ea.onChange(Z,wa);Y.editorUi.fireEvent(new mxEventObject("styleChanged","keys",pa,"values",ba,"cells",Z.getSelectionCells()))}finally{Z.getModel().endUpdate()}}}function Q(Aa,wa){wa.style.left="0px";wa.style.top="0px";wa.style.position="relative";wa.style.right="0px";wa.style.bottom="0px";wa.style.width="100%";wa.style.maxWidth="100%";wa.style.maxHeight="100%";wa.style.textAlign="left"}function T(Aa,wa,ea){function Da(ba){if(null==ba||ba==mxConstants.NONE)pa.style.background="url('"++Dialog.prototype.noColorImage+"')";else if("default"==ba)pa.style.background="";else{var na=mxUtils.getLightDarkColor(ba);mxUtils.isLightDarkColor(ba)&&na.light!=na.dark?pa.style.background="linear-gradient(to right bottom, "+na.cssText+" 50%, "+mxUtils.invertLightDarkColor(na).cssText+" 50.3%)":pa.style.background=ba}}var pa=document.createElement("div");pa.style.width="32px";pa.style.height="8px";pa.style.margin="2px";pa.style.borderStyle="solid";pa.style.borderWidth="1px";Da(wa);btn=mxUtils.button("",+mxUtils.bind(Y,function(ba){this.editorUi.pickColor(wa,function(na){M(Aa,na,ea);Da(na)});mxEvent.consume(ba)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(pa);return btn}function P(Aa,wa,ea,Da,pa,ba,na){null!=wa&&(wa=wa.split(","),aa.push({name:Aa,values:wa,type:ea,defVal:Da,countProperty:pa,parentRow:ba,isDeletable:!0,flipBkg:na}));btn=mxUtils.button("+",mxUtils.bind(Y,function(Ca){for(var za=ba,ca=+0;null!=za.nextSibling;)if(za.nextSibling.getAttribute("data-pName")==Aa)za=za.nextSibling,ca++;else break;var da={type:ea,parentRow:ba,index:ca,isDeletable:!0,defVal:Da,countProperty:pa};ca=X(Aa,"",da,0==ca%2,na);M(Aa,Da,da);za.parentNode.insertBefore(ca,za.nextSibling);mxEvent.consume(Ca)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function S(Aa,wa,ea,Da,pa,ba,na){if(0<pa){var Ca=Array(pa);wa=null!=wa?wa.split(","):[];for(var za=0;za<pa;za++)Ca[za]=null!=+wa[za]?wa[za]:null!=Da?Da:"";aa.push({name:Aa,values:Ca,type:ea,defVal:Da,parentRow:ba,flipBkg:na,size:pa})}return document.createElement("div")}function W(Aa,wa,ea){var Da=document.createElement("input");Da.type="checkbox";Da.checked="1"==wa;mxEvent.addListener(Da,"change",function(){M(Aa,Da.checked?"1":"0",ea,null,Da)});return Da}function X(Aa,wa,ea,Da,pa){var ba=ea.dispName,na=ea.type,Ca=document.createElement("tr");Ca.className="gePropRow"+(pa?"Dark":"")+(Da?"Alt":"")+" gePropNonHeaderRow";Ca.setAttribute("data-pName",+Aa);Ca.setAttribute("data-pValue",wa);Da=!1;null!=ea.index&&(Ca.setAttribute("data-index",ea.index),ba=(null!=ba?ba:"")+"["+ea.index+"]",Da=!0);var za=document.createElement("td");za.className="gePropRowCell";ba=mxResources.get(ba,null,ba);mxUtils.write(za,ba);za.setAttribute("title",ba);Da&&(za.style.textAlign="right");Ca.appendChild(za);za=document.createElement("td");za.className="gePropRowCell";za.setAttribute("title",null!=wa?decodeURIComponent(wa):mxResources.get("none"));mxEvent.addListener(za,+"click",mxUtils.bind(Y,function(ka){!mxUtils.isAncestorNode(Ca,document.activeElement)&&mxUtils.isAncestorNode(Ca.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ka))}));if("color"==na)za.appendChild(T(Aa,wa,ea));else if("bool"==na||"boolean"==na)za.appendChild(W(Aa,wa,ea));else if("enum"==na){var ca=ea.enumList;za.innerHTML="";var da=document.createElement("div");da.className="gePropValue";za.appendChild(da);+for(pa=0;pa<ca.length;pa++)if(ba=ca[pa],ba.val==wa){mxUtils.write(da,mxResources.get(ba.dispName,null,ba.dispName));break}mxEvent.addListener(za,"click",mxUtils.bind(Y,function(ka){var ya=mxEvent.getSource(ka);if(!(ya!=za&&ya!=da||mxEvent.isConsumed(ka))){da.innerHTML="";var va=document.createElement("select"),Ga=null;Q(za,va);for(ka=0;ka<ca.length;ka++){ya=ca[ka];var Ka=document.createElement("option");Ka.value=mxUtils.htmlEntities(ya.val);mxUtils.write(Ka,mxResources.get(ya.dispName,null,ya.dispName));+va.appendChild(Ka);null==ya.val&&(Ka.value="null",Ga=Ka)}va.value=null==wa&&null!=Ga?"null":wa;da.appendChild(va);mxEvent.addListener(va,"change",function(){var Wa=mxUtils.htmlEntities(va.value);if(va[va.selectedIndex]==Ga||"null"==Wa.value)Wa=null;M(Aa,Wa,ea)});va.focus();mxEvent.addListener(va,"blur",function(){da.innerHTML="";for(var Wa=0;Wa<ca.length;Wa++){var Pa=ca[Wa];if(Pa.val==va.value){mxUtils.write(da,mxResources.get(Pa.dispName,null,Pa.dispName));break}}})}}))}else if("dynamicArr"==na)za.appendChild(P(Aa,+wa,ea.subType,ea.subDefVal,ea.countProperty,Ca,pa));else if("staticArr"==na)za.appendChild(S(Aa,wa,ea.subType,ea.subDefVal,ea.size,Ca,pa));else if("readOnly"==na)pa=document.createElement("input"),pa.setAttribute("readonly",""),pa.value=wa,pa.style.borderWidth="0px","id"==Aa||"shape"==Aa?(Ca.firstChild.innerHTML="",Ca.firstChild.setAttribute("colspan","2"),pa.style.flexGrow="1",pa.style.marginLeft="4px",pa.style.textAlign="id"==Aa?"center":"left",pa.setAttribute("title",wa),ba=document.createElement("div"),+mxUtils.write(ba,mxResources.get(Aa)+":"),ba.style.display="inline-flex",ba.style.alignItems="center",ba.style.width="100%",ba.appendChild(pa),Ca.firstChild.appendChild(ba)):(pa.style.width="96px",za.appendChild(pa));else{za.innerHTML="";var ua=document.createElement("div");ua.className="gePropValue";za.appendChild(ua);ua.innerHTML=mxUtils.htmlEntities(decodeURIComponent(wa));mxEvent.addListener(za,"click",mxUtils.bind(Y,function(ka){function ya(){var Ka=Ga.value;Ka=0==Ka.length&&"string"!=na&&"numbers"!=+na?0:Ka;ea.allowAuto&&(null!=Ka.trim&&"auto"==Ka.trim().toLowerCase()?(Ka="auto",na="string"):(Ka=parseFloat(Ka),Ka=isNaN(Ka)?0:Ka));null!=ea.min&&Ka<ea.min?Ka=ea.min:null!=ea.max&&Ka>ea.max&&(Ka=ea.max);var Wa=null;try{Wa="numbers"==na?Ka.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==na?parseInt(Ka):Ka)+"")}catch(Pa){}M(Aa,Wa,ea,null,Ga)}var va=mxEvent.getSource(ka);if(!(va!=za&&va!=ua||mxEvent.isConsumed(ka))){ua.innerHTML="";var Ga=document.createElement("input");Q(ua,Ga);Ga.value=+decodeURIComponent(wa);Ga.className="gePropEditor";"int"!=na&&"float"!=na||ea.allowAuto||(Ga.type="number",Ga.step="int"==na?"1":"any",null!=ea.min&&(Ga.min=parseFloat(ea.min)),null!=ea.max&&(Ga.max=parseFloat(ea.max)));ua.appendChild(Ga);mxEvent.addListener(Ga,"keypress",function(Ka){13==Ka.keyCode&&ya()});Ga.focus();mxEvent.addListener(Ga,"blur",function(){ya()})}}))}ea.isDeletable&&(pa=mxUtils.button("-",mxUtils.bind(Y,function(ka){M(Aa,"",ea,ea.index);mxEvent.consume(ka)})),pa.style.height="16px",+pa.style.width="25px",pa.style.float="right",pa.className="geColorBtn",za.appendChild(pa));Ca.appendChild(za);return Ca}var Y=this,Z=this.editorUi.editor.graph,aa=[],ha=document.createElement("table");ha.className="geProperties geFullWidthElement";var ja=document.createElement("tr");ja.className="gePropHeader";var fa=document.createElement("th");fa.className="gePropHeaderCell";fa.style.paddingLeft="16px";fa.style.backgroundRepeat="no-repeat";fa.style.backgroundPosition="-2px 50%";fa.style.backgroundSize=+"20px";mxUtils.write(fa,mxResources.get("property"));ja.style.cursor="pointer";var ma=function(){var Aa=ha.querySelectorAll(".gePropNonHeaderRow");if(Y.editorUi.propertiesCollapsed){fa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var wa="none";for(var ea=g.childNodes.length-1;0<=ea;ea--)try{var Da=g.childNodes[ea],pa=Da.nodeName.toUpperCase();"INPUT"!=pa&&"SELECT"!=pa||g.removeChild(Da)}catch(ba){}}else fa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",wa="";for(ea=0;ea<Aa.length;ea++)Aa[ea].style.display=+wa};mxEvent.addListener(ja,"click",function(){Y.editorUi.propertiesCollapsed=!Y.editorUi.propertiesCollapsed;ma()});ja.appendChild(fa);var sa=document.createElement("th");sa.className="gePropHeaderCell";sa.style.paddingLeft="4px";mxUtils.write(sa,mxResources.get("value"));ja.appendChild(sa);ha.appendChild(ja);var ta=sa=!1;ja=null;1==C.vertices.length&&0==C.edges.length?ja=C.vertices[0].id:0==C.vertices.length&&1==C.edges.length&&(ja=C.edges[0].id);null==ja||J||(ha.appendChild(X("id",mxUtils.htmlEntities(ja),+{dispName:"id",type:"readOnly"},!0,!1)),null!=C.style&&null!=C.style.shape&&ha.appendChild(X("shape",mxUtils.htmlEntities(C.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var ra in q)if(J=q[ra],("function"!=typeof J.isVisible||J.isVisible(C,this))&&!J.primary){var qa=null!=J.getValue?J.getValue(C,this):null!=C.style[ra]?mxUtils.htmlEntities(C.style[ra]+""):null!=J.getDefaultValue?J.getDefaultValue(C,this):J.defVal;if("separator"==J.type)ta=!ta;else{if("staticArr"==J.type)J.size=parseInt(C.style[J.sizeProperty]||+q[J.sizeProperty].defVal)||0;else if(null!=J.dependentProps){var la=J.dependentProps,ia=[],oa=[];for(ja=0;ja<la.length;ja++)if(null!=q[la[ja]]){var xa=C.style[la[ja]];oa.push(q[la[ja]].subDefVal);ia.push(null!=xa?xa.split(","):[])}J.dependentPropsDefVal=oa;J.dependentPropsVals=ia}ha.appendChild(X(ra,qa,J,sa,ta));sa=!sa}}for(ja=0;ja<aa.length;ja++)for(J=aa[ja],q=J.parentRow,ra=0;ra<J.values.length;ra++)sa=X(J.name,J.values[ra],{type:J.type,parentRow:J.parentRow,isDeletable:J.isDeletable,index:ra,defVal:J.defVal,+countProperty:J.countProperty,size:J.size},0==ra%2,J.flipBkg),q.parentNode.insertBefore(sa,q.nextSibling),q=sa;g.appendChild(ha);ma();return g};StyleFormatPanel.prototype.addStyles=function(g){if(null!=this.defaultColorSchemes){var q=this.editorUi,C=q.editor.graph,J=document.createElement("div");J.style.padding="6px 20px 0 24px";g.appendChild(J);var M=document.createElement("div");M.className="geSwitcher";M.style.padding="4px 18px 6px 0px";for(var Q=[],T=0;T<this.defaultColorSchemes.length;T++){var P=+document.createElement("div");P.className="geSwitcherDot";mxUtils.bind(this,function(Z){mxEvent.addListener(P,"click",mxUtils.bind(this,function(){S(Z)}))})(T);Q.push(P);M.appendChild(P)}var S=mxUtils.bind(this,function(Z){null!=Q[Z]&&(null!=this.format.currentScheme&&null!=Q[this.format.currentScheme]&&(Q[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Z,W(this.defaultColorSchemes[this.format.currentScheme]),Q[this.format.currentScheme].style.background="#84d7ff")}),+W=mxUtils.bind(this,function(Z){var aa=mxUtils.clone(C.defaultVertexStyle);aa[mxConstants.STYLE_STROKECOLOR]=null!=aa[mxConstants.STYLE_STROKECOLOR]?aa[mxConstants.STYLE_STROKECOLOR]:"default";aa[mxConstants.STYLE_FILLCOLOR]=null!=aa[mxConstants.STYLE_FILLCOLOR]?aa[mxConstants.STYLE_FILLCOLOR]:"default";aa[mxConstants.STYLE_FONTCOLOR]=null!=aa[mxConstants.STYLE_FONTCOLOR]?aa[mxConstants.STYLE_FONTCOLOR]:"default";C.replaceDefaultColors(new mxCell,aa);var ha=mxUtils.bind(this,function(fa){var ma=mxUtils.button("",+mxUtils.bind(this,function(ra){C.getModel().beginUpdate();try{for(var qa=q.getSelectionState().cells,la=0;la<qa.length;la++){var ia=C.getModel().getStyle(qa[la]);null!=fa?(mxEvent.isShiftDown(ra)||(ia=""==fa.fill||null==fa.fill?mxUtils.setStyle(ia,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ia,mxConstants.STYLE_FILLCOLOR,fa.fill),ia=""==fa.gradient||null==fa.gradient?mxUtils.setStyle(ia,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ia,mxConstants.STYLE_GRADIENTCOLOR,fa.gradient),mxEvent.isControlDown(ra)||+mxClient.IS_MAC&&mxEvent.isMetaDown(ra)||!C.getModel().isVertex(qa[la])||(ia=""==fa.font||null==fa.font?mxUtils.setStyle(ia,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ia,mxConstants.STYLE_FONTCOLOR,fa.font))),mxEvent.isAltDown(ra)||(ia=""==fa.stroke||null==fa.fill?mxUtils.setStyle(ia,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ia,mxConstants.STYLE_STROKECOLOR,fa.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),C.getModel().isVertex(qa[la])&&(ia=mxUtils.setStyle(ia,mxConstants.STYLE_FONTCOLOR,null)));C.getModel().setStyle(qa[la],ia)}}finally{C.getModel().endUpdate()}}));ma.className="geStyleButton";ma.style.width="36px";ma.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ma.style.margin="0px 6px 6px 0px";if(null!=fa){var sa="1px solid";null!=fa.border&&(sa=fa.border);if(null!=fa.gradient)ma.style.backgroundImage="linear-gradient("++mxUtils.getLightDarkColor(fa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(fa.gradient).cssText+" 100%)";else if(fa.fill==mxConstants.NONE)ma.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==fa.fill||""==fa.fill)ma.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(aa,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ta=mxUtils.getLightDarkColor(fa.fill);ma.style.backgroundImage="linear-gradient(to right bottom, "+ta.cssText+" 50%, "+ta.light+" 50.3%)"}null==+fa.stroke||fa.stroke==mxConstants.NONE?ma.style.border=sa+" transparent":""==fa.stroke?ma.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(aa,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ta=mxUtils.getLightDarkColor(fa.stroke),ma.style.border=sa+" "+ta.cssText,ma.style.borderRightColor=ta.light,ma.style.borderBottomColor=ma.style.borderRightColor);null!=fa.title&&ma.setAttribute("title",fa.title)}else sa=mxUtils.getValue(aa,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ta=mxUtils.getValue(aa,+mxConstants.STYLE_STROKECOLOR,"#000000"),ma.style.backgroundColor=sa,ma.style.border="1px solid "+ta;ma.style.borderRadius="0";J.appendChild(ma);null!=fa&&null!=fa.gradient&&(sa=ma.cloneNode(!1),sa.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(fa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(fa.gradient).light+") 100%)",sa.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",sa.style.backgroundColor="transparent",J.appendChild(sa),+sa.style.marginLeft="-42px",mxEvent.addListener(sa,"click",function(){ma.click()}))});J.innerText="";if(null!=Z)for(var ja=0;ja<Z.length;ja++)0<ja&&0==mxUtils.mod(ja,4)&&mxUtils.br(J),ha(Z[ja])});null==this.format.currentScheme?S(Math.min(Q.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):S(this.format.currentScheme);T=10>=this.defaultColorSchemes.length?43:23;var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:0px;bottom:"+T+"px;width:20px;background-image:url("++Editor.chevronLeftImage+");";mxEvent.addListener(X,"click",mxUtils.bind(this,function(){S(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var Y=document.createElement("div");Y.className="geButton";Y.style.cssText="position:absolute;left:186px;bottom:"+T+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(g.appendChild(X),g.appendChild(Y));mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){S(mxUtils.mod(this.format.currentScheme++1,this.defaultColorSchemes.length))}));W(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&g.appendChild(M)}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,q){var C=Graph.fontMapping[q];null==C&&Graph.isCssFontUrl(q)?(g=document.createElement("link"),g.setAttribute("rel","stylesheet"),+g.setAttribute("type","text/css"),g.setAttribute("charset","UTF-8"),g.setAttribute("href",Graph.rewriteGoogleFontUrl(q))):(null==C&&(C='@font-face {\nfont-family: "'+g+'";\nsrc: url("'+q+'");\n}'),g=document.createElement("style"),mxUtils.write(g,C));return g};Graph.addRecentCustomFont=function(g,q){};Graph.addFont=function(g,q,C,J){if(null!=g&&0<g.length&&null!=q&&0<q.length){J=null!=J?J:Graph.customFontElements;var M=g.toLowerCase();if("helvetica"!=M&&"arial"!=g&&"sans-serif"!=M){var Q=J[M];null!=+Q&&Q.url!=q&&(Q.elt.parentNode.removeChild(Q.elt),Q=null);null==Q?(Q=q,"http:"==q.substring(0,5)&&(Q=PROXY_URL+"?url="+encodeURIComponent(q)),Q={name:g,url:q,elt:Graph.createFontElement(g,Q)},J[M]=Q,q=J==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=C&&("link"==Q.elt.nodeName.toLowerCase()?(Q.elt.onload=C,Q.elt.onerror=C):C()),null!=q&&q.appendChild(Q.elt)):null!=C&&C()}else null!=C&&C()}else null!=C&&C();return g};Graph.getFontUrl=function(g,q){g=Graph.customFontElements[g.toLowerCase()];+null!=g&&(q=g.url);return q};Graph.processFontAttributes=function(g){g=g.getElementsByTagName("*");for(var q=0;q<g.length;q++){var C=g[q].getAttribute("data-font-src");if(null!=C){var J="FONT"==g[q].nodeName?g[q].getAttribute("face"):g[q].style.fontFamily;null!=J&&Graph.addFont(J,C)}}};Graph.processFontStyle=function(g){if(null!=g){var q=mxUtils.getValue(g,"fontSource",null);if(null!=q){var C=mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,null);if(null!=C)try{Graph.addFont(C,decodeURIComponent(q))}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.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var k=Graph.prototype.init;Graph.prototype.init=function(){function g(M){q=+M}k.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var q=null;mxEvent.addListener(this.container,"mouseenter",g);mxEvent.addListener(this.container,"mousemove",g);mxEvent.addListener(this.container,"mouseleave",function(M){q=null});this.isMouseInsertPoint=function(){return null!=q};var C=this.getInsertPoint;this.getInsertPoint=function(M){return null==q||M?C.apply(this,arguments):this.getPointForEvent(q)};var J=this.layoutManager.getLayout;this.layoutManager.getLayout=+function(M){var Q=this.graph.getCellStyle(M);if(null!=Q&&"rack"==Q.childLayout){var T=new mxStackLayout(this.graph,!1);T.gridSize=null!=Q.rackUnitSize?parseFloat(Q.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;T.marginLeft=Q.marginLeft||0;T.marginRight=Q.marginRight||0;T.marginTop=Q.marginTop||0;T.marginBottom=Q.marginBottom||0;T.allowGaps=Q.allowGaps||0;T.horizontal="1"==mxUtils.getValue(Q,"horizontalRack","0");T.resizeParent=!1;T.fill=!0;return T}return J.apply(this,+arguments)};this.updateGlobalUrlVariables()};var m=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(g,q){return Graph.processFontStyle(m.apply(this,arguments))};var t=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(g,q,C,J,M,Q,T,P,S,W,X,Y){t.apply(this,arguments);Graph.processFontAttributes(Y)};var u=mxText.prototype.redraw;mxText.prototype.redraw=function(){u.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&+Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(g,q,C,J){function M(){for(var ja=P.getSelectionCells(),fa=[],ma=0;ma<ja.length;ma++)P.isCellVisible(ja[ma])&&fa.push(ja[ma]);P.setSelectionCells(fa)}function Q(ja){P.setHiddenTags(ja?[]:S.slice());M();P.refresh()}function T(ja,fa){X.innerText="";if(0<ja.length){var ma=document.createElement("table");ma.setAttribute("cellpadding","2");ma.style.boxSizing="border-box";ma.style.tableLayout="fixed";ma.style.width="100%";+var sa=document.createElement("tbody");if(null!=ja&&0<ja.length)for(var ta=0;ta<ja.length;ta++)(function(ra){function qa(){var wa=P.getCellsForTags([ra],null,null,!0);P.isEnabled()?P.setSelectionCells(wa):P.highlightCells(wa,null,null,70)}var la=0>mxUtils.indexOf(P.hiddenTags,ra),ia=document.createElement("tr"),oa=document.createElement("td");oa.style.align="center";oa.style.width="16px";var xa=document.createElement("img");xa.setAttribute("src",la?Editor.visibleImage:Editor.hiddenImage);xa.setAttribute("title",+mxResources.get(la?"hideIt":"show",[ra]));mxUtils.setOpacity(xa,la?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor="pointer";xa.style.width="16px";if(q||Editor.isDarkMode())xa.style.filter="invert(100%)";oa.appendChild(xa);mxEvent.addListener(xa,"click",function(wa){mxEvent.isShiftDown(wa)?Q(0<=mxUtils.indexOf(P.hiddenTags,ra)):(P.toggleHiddenTag(ra),M(),P.refresh());mxEvent.consume(wa)});ia.appendChild(oa);oa=document.createElement("td");oa.style.align="center";+oa.style.width="16px";xa=document.createElement("img");xa.setAttribute("src",Editor.selectImage);xa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(xa,la?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor="pointer";xa.style.width="16px";if(q||Editor.isDarkMode())xa.style.filter="invert(100%)";mxEvent.addListener(xa,"click",function(wa){Q(!0);qa();mxEvent.consume(wa)});oa.appendChild(xa);ia.appendChild(oa);oa=document.createElement("td");oa.style.overflow=+"hidden";oa.style.whiteSpace="nowrap";oa.style.textOverflow="ellipsis";oa.style.verticalAlign="middle";oa.style.cursor="pointer";oa.setAttribute("title",ra);a=document.createElement("a");mxUtils.write(a,ra);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,la?100:40);oa.appendChild(a);mxEvent.addListener(oa,"click",function(wa){if(mxEvent.isShiftDown(wa))Q(!0),qa();else if(la&&0<P.hiddenTags.length)Q(!0);else{var ea=S.slice(),Da=mxUtils.indexOf(ea,ra);ea.splice(Da,1);+P.setHiddenTags(ea);M();P.refresh()}mxEvent.consume(wa)});ia.appendChild(oa);if(P.isEnabled()){oa=document.createElement("td");oa.style.verticalAlign="middle";oa.style.textAlign="center";oa.style.width="18px";if(null==fa){oa.style.align="center";oa.style.width="16px";xa=document.createElement("img");xa.setAttribute("src",Editor.trashImage);xa.setAttribute("title",mxResources.get("removeIt",[ra]));mxUtils.setOpacity(xa,la?75:25);xa.className="geAdaptiveAsset";xa.style.verticalAlign="middle";xa.style.cursor=+"pointer";xa.style.width="16px";if(q||Editor.isDarkMode())xa.style.filter="invert(100%)";mxEvent.addListener(xa,"click",function(wa){var ea=mxUtils.indexOf(S,ra);0<=ea&&S.splice(ea,1);P.removeTagsForCells(P.model.getDescendants(P.model.getRoot()),[ra]);P.refresh();mxEvent.consume(wa)});oa.appendChild(xa)}else{var Aa=document.createElement("input");Aa.setAttribute("type","checkbox");Aa.style.margin="0px";Aa.defaultChecked=null!=fa&&0<=mxUtils.indexOf(fa,ra);Aa.checked=Aa.defaultChecked;Aa.style.background=+"transparent";Aa.setAttribute("title",mxResources.get(Aa.defaultChecked?"removeIt":"add",[ra]));mxEvent.addListener(Aa,"change",function(wa){Aa.checked?P.addTagsForCells(P.getSelectionCells(),[ra]):P.removeTagsForCells(P.getSelectionCells(),[ra]);mxEvent.consume(wa)});oa.appendChild(Aa)}ia.appendChild(oa)}sa.appendChild(ia)})(ja[ta]);ma.appendChild(sa);X.appendChild(ma)}}var P=this,S=P.hiddenTags.slice(),W=document.createElement("div");W.style.userSelect="none";W.style.overflow="hidden";W.style.padding=+"10px";W.style.height="100%";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.userSelect="none";X.style.overflow="auto";X.style.padding="3px";X.style.left="0px";X.style.right="0px";X.style.top="0px";X.style.bottom="0px";W.appendChild(X);P.addListener(mxEvent.ROOT,function(){S=P.hiddenTags.slice()});var Y=mxUtils.bind(this,function(ja,fa){if(g()){ja=P.getAllTags();for(fa=0;fa<ja.length;fa++)0>mxUtils.indexOf(S,ja[fa])&&S.push(ja[fa]);S.sort();P.isSelectionEmpty()?+T(S):T(S,P.getCommonTagsForCells(P.getSelectionCells()))}});P.selectionModel.addListener(mxEvent.CHANGE,Y);P.model.addListener(mxEvent.CHANGE,Y);P.addListener(mxEvent.REFRESH,Y);var Z=document.createElement("div");Z.className="geToolbarContainer geDialogToolbar";Z.style.position="absolute";Z.style.display="flex";Z.style.bottom="0px";Z.style.left="0px";Z.style.right="0px";Z.style.height="32px";Z.style.overflow="hidden";Z.style.padding="3px 4px 4px 4px";Z.style.borderWidth="1px 0px 0px 0px";Z.style.borderStyle=+"solid";Z.style.whiteSpace="nowrap";if(P.isEnabled()){X.style.bottom="32px";var aa=document.createElement("a");aa.className="geButton";var ha=aa.cloneNode(!1);ha.style.backgroundImage="url("+Editor.visibleImage+")";ha.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ha,"click",function(ja){P.setHiddenTags([]);mxEvent.isShiftDown(ja)||(S=P.hiddenTags.slice());M();P.refresh();mxEvent.consume(ja)});Z.appendChild(ha);null!=C&&(aa=aa.cloneNode(!1),aa.style.backgroundImage="url("+Editor.plusImage++")",aa.setAttribute("title",mxResources.get("add")),mxEvent.addListener(aa,"click",function(ja){C(S,function(fa){S=fa;Y()});mxEvent.consume(ja)}),Z.appendChild(aa));W.appendChild(Z)}null!=J&&Z.appendChild(J);return{div:W,refresh:Y}};Graph.prototype.getCustomFonts=function(){var g=this.extFonts;g=null!=g?g.slice():[];for(var q in Graph.customFontElements){var C=Graph.customFontElements[q];g.push({name:C.name,url:C.url})}return g};Graph.prototype.setFont=function(g,q){Graph.addFont(g,q);var C=Editor.guid();+document.execCommand("fontname",!1,C);for(var J=this.cellEditor.textarea.getElementsByTagName("font"),M=!1,Q=0;Q<J.length;Q++)J[Q].getAttribute("face")==C&&(M=!0,J[Q].setAttribute("face",g),null!=q?J[Q].setAttribute("data-font-src",q):J[Q].removeAttribute("data-font-src"));M||document.execCommand("fontname",!1,g)};var A=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return A.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 q in g)this.globalVars[q]=g[q]}catch(C){null!=window.console&&console.log("Error in vars URL parameter: "+C)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var B=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=+function(g){var q=B.apply(this,arguments);null==q&&null!=this.globalVars&&(q=this.globalVars[g]);return q};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,q,C,J,M,Q,T,P,S,W,X,Y,Z,aa,ha,ja){var fa=D.apply(this,arguments);+if(null!=Y){var ma=fa.getAttribute("style");null==ma&&(ma="");Y="auto"==Y||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":Y;fa.setAttribute("style",ma+(" color-scheme: "+Y+";"))}var sa=this.getCustomFonts();if(X&&0<sa.length){var ta=fa.ownerDocument;ma=null!=ta.createElementNS?ta.createElementNS(mxConstants.NS_SVG,"style"):ta.createElement("style");null!=ta.setAttributeNS?ma.setAttributeNS("type","text/css"):ma.setAttribute("type","text/css");for(var ra="",+qa="",la=0;la<sa.length;la++){var ia=sa[la].name,oa=sa[la].url;Graph.isCssFontUrl(oa)?ra+="@import url("+Graph.rewriteGoogleFontUrl(oa)+");\n":qa+='@font-face {\nfont-family: "'+ia+'";\nsrc: url("'+oa+'");\n}\n'}ma.appendChild(ta.createTextNode(ra+qa));fa.getElementsByTagName("defs")[0].appendChild(ma)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(fa);this.mathEnabled&&(document.body.appendChild(fa),Editor.MathJaxRender(fa),+fa.parentNode.removeChild(fa),ma=fa.ownerDocument.getElementById("MJX-SVG-styles"),null!=ma&&fa.getElementsByTagName("defs")[0].appendChild(ma.cloneNode(!0)));return fa};var N=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(g){N.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 F=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=+function(){F.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 q="1"==mxUtils.getValue(g.style,"enumerate",0);q&&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)):q||null==g.secondLabel||(g.secondLabel.destroy(),g.secondLabel=null);q=g.secondLabel;if(null!=q){var C=g.view.scale,+J=this.createEnumerationValue(g);g=this.graph.model.isVertex(g.cell)?new mxRectangle(g.x+g.width-4*C,g.y+4*C,0,0):mxRectangle.fromPoint(g.view.getPoint(g));q.bounds.equals(g)&&q.value==J&&q.scale==C||(q.bounds=g,q.value=J,q.scale=C,q.redraw())}};var V=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();V.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),+this.view.validateBackgroundImage())};var n=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){n.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(g,q){"data:action/json,"==g.substring(0,17)&&(g=JSON.parse(g.substring(17)),null!=g.actions&&this.executeCustomActions(g.actions,null,q))};Graph.prototype.executeCustomActions=function(g,q,C){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,M=0,Q=0,T=mxUtils.bind(this,function(){J||(J=!0,this.model.beginUpdate())}),P=mxUtils.bind(this,function(){J&&(J=!1,this.model.endUpdate())}),S=mxUtils.bind(this,function(){0<M&&M--;0==M&&W()}),W=mxUtils.bind(this,function(){if(Q<g.length){var X=this.stoppingCustomActions,Y=g[Q++],+Z=[];if(null!=Y.open)if(P(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,C))return}else this.openLink(Y.open);null==Y.wait||X||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;S()}),M++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),P());null!=Y.opacity&&null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),+Y.opacity.value);null!=Y.fadeIn&&(M++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,S,X?0:Y.fadeIn.delay));null!=Y.fadeOut&&(M++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,S,X?0:Y.fadeOut.delay));null!=Y.wipeIn&&(Z=Z.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(Z=Z.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,!0),!1)));null!=Y.toggle&&(T(),this.toggleCells(this.getCellsForAction(Y.toggle,+!0)));if(null!=Y.show){T();var aa=this.getCellsForAction(Y.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(aa),1);this.setCellsVisible(aa,!0)}null!=Y.hide&&(T(),aa=this.getCellsForAction(Y.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),0),this.setCellsVisible(aa,!1));null!=Y.toggleStyle&&null!=Y.toggleStyle.key&&(T(),this.toggleCellStyles(Y.toggleStyle.key,null!=Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:"0",this.getCellsForAction(Y.toggleStyle,!0)));null!=Y.style&&+null!=Y.style.key&&(T(),this.setCellStyles(Y.style.key,Y.style.value,this.getCellsForAction(Y.style,!0)));aa=[];null!=Y.select&&this.isEnabled()&&(aa=this.getCellsForAction(Y.select),this.setSelectionCells(aa));null!=Y.highlight&&(aa=this.getCellsForAction(Y.highlight),this.highlightCells(aa,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(aa=this.getCellsForAction(Y.scroll));null!=Y.viewbox&&this.fitWindow(Y.viewbox,Y.viewbox.border);0<aa.length&&this.scrollCellToVisible(aa[0]);+null!=C&&null!=Y.explore&&Graph.exploreFromCell(this,C,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle){var ha=Y.tags.toggle;0==ha.length&&(ha=this.getAllTags());for(aa=0;aa<ha.length;aa++)this.toggleHiddenTag(ha[aa])}ha=null;null!=Y.tags.hidden&&(null==ha&&(ha=[]),ha=ha.concat(Y.tags.hidden));if(null!=Y.tags.visible){null==ha&&(ha=[]);var ja=this.getAllTags();for(aa=0;aa<ja.length;aa++)0>mxUtils.indexOf(Y.tags.visible,ja[aa])&&0>mxUtils.indexOf(ha,ja[aa])&&ha.push(ja[aa])}null!=ha&&this.setHiddenTags(ha);+this.refresh()}0<Z.length&&(M++,this.executeAnimations(Z,S,X?1:Y.steps,X?0:Y.delay));0==M?W():P()}else this.stoppingCustomActions=this.executingCustomActions=!1,P(),null!=q&&q()});W()}};Graph.prototype.doUpdateCustomLinksForCell=function(g,q){var C=this.getLinkForCell(q);null!=C&&"data:action/json,"==C.substring(0,17)&&this.setLinkForCell(q,this.updateCustomLink(g,C));if(this.isHtmlLabel(q)){var J=document.createElement("div");J.innerHTML=Graph.sanitizeHtml(this.getLabel(q));for(var M=J.getElementsByTagName("a"),+Q=!1,T=0;T<M.length;T++)C=M[T].getAttribute("href"),null!=C&&"data:action/json,"==C.substring(0,17)&&(M[T].setAttribute("href",this.updateCustomLink(g,C)),Q=!0);Q&&this.labelChanged(q,J.innerHTML)}};Graph.prototype.updateCustomLink=function(g,q){if("data:action/json,"==q.substring(0,17))try{var C=JSON.parse(q.substring(17));null!=C.actions&&(this.updateCustomLinkActions(g,C.actions),q="data:action/json,"+JSON.stringify(C))}catch(J){}return q};Graph.prototype.updateCustomLinkActions=function(g,q){for(var C=+0;C<q.length;C++){var J=q[C],M;for(M in J)this.updateCustomLinkAction(g,J[M],"cells"),this.updateCustomLinkAction(g,J[M],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(g,q,C){if(null!=q&&null!=q[C]){for(var J=[],M=0;M<q[C].length;M++)if("*"==q[C][M])J.push(q[C][M]);else{var Q=g[q[C][M]];null!=Q?""!=Q&&J.push(Q):J.push(q[C][M])}q[C]=J}};Graph.prototype.getCellsForAction=function(g,q){q=this.getCellsById(g.cells).concat(this.getCellsForTags(g.tags,null,q));if(null!=g.excludeCells){for(var C=+[],J=0;J<q.length;J++)0>g.excludeCells.indexOf(q[J].id)&&C.push(q[J]);q=C}return q};Graph.prototype.getCellsById=function(g){var q=[];if(null!=g)for(var C=0;C<g.length;C++)if("*"==g[C]){var J=this.model.getRoot();q=q.concat(this.model.filterDescendants(function(Q){return Q!=J},J))}else{var M=this.model.getCell(g[C]);null!=M&&q.push(M)}return q};var v=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(g){return v.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 q=mxUtils.indexOf(this.hiddenTags,g);0>q?this.hiddenTags.push(g):0<=q&&this.hiddenTags.splice(q,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 q=0;q<g.length;q++)if(0>+mxUtils.indexOf(this.hiddenTags,g[q]))return!1;return!0};Graph.prototype.getCellsForTags=function(g,q,C,J){var M=[];if(null!=g){q=null!=q?q:this.model.getDescendants(this.model.getRoot());for(var Q=0,T={},P=0;P<g.length;P++)0<g[P].length&&(T[g[P]]=!0,Q++);for(P=0;P<q.length;P++)if(C&&this.model.getParent(q[P])==this.model.root||this.model.isVertex(q[P])||this.model.isEdge(q[P])){var S=this.getTagsForCell(q[P]),W=!1;if(0<S.length&&(S=S.split(" "),S.length>=g.length)){for(var X=W=0;X<S.length&&W<Q;X++)null!=+T[S[X]]&&W++;W=W==Q}W&&(1!=J||this.isCellVisible(q[P]))&&M.push(q[P])}}return M};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(g){for(var q=null,C=[],J=0;J<g.length;J++){var M=this.getTagsForCell(g[J]);C=[];if(0<M.length){M=M.split(" ");for(var Q={},T=0;T<M.length;T++)if(null==q||null!=q[M[T]])Q[M[T]]=!0,C.push(M[T]);q=Q}else return[]}return C};Graph.prototype.getTagsForCells=function(g){for(var q=+[],C={},J=0;J<g.length;J++){var M=this.getTagsForCell(g[J]);if(0<M.length){M=M.split(" ");for(var Q=0;Q<M.length;Q++)null==C[M[Q]]&&(C[M[Q]]=!0,q.push(M[Q]))}}return q};Graph.prototype.getTagsForCell=function(g){return this.getAttributeForCell(g,"tags","")};Graph.prototype.addTagsForCells=function(g,q){if(0<g.length&&0<q.length){this.model.beginUpdate();try{for(var C=0;C<g.length;C++){for(var J=this.getTagsForCell(g[C]),M=J.split(" "),Q=!1,T=0;T<q.length;T++){var P=mxUtils.trim(q[T]);""!=P&&0>mxUtils.indexOf(M,+P)&&(J=0<J.length?J+" "+P:P,Q=!0)}Q&&this.setAttributeForCell(g[C],"tags",J)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(g,q){if(0<g.length&&0<q.length){this.model.beginUpdate();try{for(var C=0;C<g.length;C++){var J=this.getTagsForCell(g[C]);if(0<J.length){for(var M=J.split(" "),Q=!1,T=0;T<q.length;T++){var P=mxUtils.indexOf(M,q[T]);0<=P&&(M.splice(P,1),Q=!0)}Q&&this.setAttributeForCell(g[C],"tags",M.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=+function(g){this.model.beginUpdate();try{for(var q=0;q<g.length;q++)this.model.setVisible(g[q],!this.model.isVisible(g[q]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(g,q){this.model.beginUpdate();try{for(var C=0;C<g.length;C++)this.model.setVisible(g[C],q)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(g,q,C,J){for(var M=0;M<g.length;M++)this.highlightCell(g[M],q,C,J)};Graph.prototype.highlightCell=function(g,q,C,J,M){q=null!=q?q:mxConstants.DEFAULT_VALID_COLOR;+C=null!=C?C:1E3;g=this.view.getState(g);var Q=null;null!=g&&(M=null!=M?M:4,M=Math.max(M+1,mxUtils.getValue(g.style,mxConstants.STYLE_STROKEWIDTH,1)+M),Q=new mxCellHighlight(this,q,M,!1),null!=J&&(Q.opacity=J),Q.highlight(g),window.setTimeout(function(){null!=Q.shape&&(mxUtils.setPrefixedStyle(Q.shape.node.style,"transition","all 1200ms ease-in-out"),Q.shape.node.style.opacity=0);window.setTimeout(function(){Q.destroy()},1200)},C));return Q};Graph.prototype.addSvgShadow=function(g,q,C,J){J=null!=J?+J:!0;var M=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=C&&C||(q=null!=q?q:g.getElementsByTagName("g")[0],null!=q&&(this.updateShadowFilter(q,!0),!isNaN(parseInt(g.getAttribute("width")))&&J&&(g.setAttribute("width",parseInt(g.getAttribute("width"))+M),g.setAttribute("height",parseInt(g.getAttribute("height"))+M),q=g.getAttribute("viewBox"),null!=q&&0<q.length&&(q=q.split(" "),3<q.length&&(w=parseFloat(q[2])+M,h=parseFloat(q[3])+M,g.setAttribute("viewBox",q[0]+" "+q[1]+" "+w+" "+h))))));+return M};Graph.prototype.updateShadowFilter=function(g,q){mxClient.IS_SF||(q?(q=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),g.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+q.cssText+")"):g.style.filter="")};Graph.prototype.setShadowVisible=function(g,q){q=null!=q?q:!0;this.shadowVisible=g;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);+q&&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),q=0;do var C=this.model.getChildAt(this.model.root,q);while(q++<g&&"1"==mxUtils.getValue(this.getCellStyle(C),"locked","0"));null!=C&&this.setDefaultParent(C)}};+mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/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",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",+STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];+mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=+[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",+STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=+[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/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.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.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 q=null;null!=g&&0<g.length&&("ER"==g.substring(0,2)?q="mxgraph.er":"sysML"==g.substring(0,5)&&(q="mxgraph.sysml"));return q};var G=mxMarker.createMarker;mxMarker.createMarker=function(g,q,C,J,M,Q,T,P,S,W){if(null!=C&&null==mxMarker.markers[C]){var X=this.getPackageForType(C);null!=X&&mxStencilRegistry.getStencil(X)}return G.apply(this,arguments)};var H=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(g,q,C,J,M,Q){"1"==mxUtils.getValue(q.style,"lineShape",null)&&+g.setFillColor(mxUtils.getValue(q.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return H.apply(this,arguments)};PrintDialog.prototype.create=function(g,q,C,J){function M(){ha.value=Math.max(1,Math.min(X,Math.max(parseInt(ha.value),parseInt(aa.value))));aa.value=Math.max(1,Math.min(X,Math.min(parseInt(ha.value),parseInt(aa.value))))}function Q(ka){g.lastPrintPagesRadioChecked=Z.checked;g.lastPrintSelectionOnlyChecked=fa.checked;g.lastPrintCropRadioChecked=sa.checked;g.lastPrintFitRadioChecked=+ta.checked;Z.checked&&aa.value<ha.value?(g.lastPrintPagesFromInput=aa.value,g.lastPrintPagesToInput=ha.value):(g.lastPrintPagesFromInput=null,g.lastPrintPagesToInput=null);ba.value=Math.max(1,Math.min(1600,parseInt(ba.value)))+"%";g.lastPrintZoom=ba.value;g.lastPrintBorder=pa.value;g.lastPrintGrid=na.checked;g.lastPrintTransparent=za.checked;g.lastPrintInclude=ca.checked;g.lastPrintSheetsAcross=ea.value;g.lastPrintSheetsDown=Da.value;var ya={};ya.border=parseInt(pa.value);ya.scale=parseInt(ba.value)/+100;ya.grid=na.checked;ya.shadows=Ca.checked;ya.transparent=za.checked;ya.includeCopy=ca.checked;ya.sheetsAcross=parseInt(ea.value);ya.sheetsDown=parseInt(Da.value);ya.pagesFrom=parseInt(aa.value);ya.pagesTo=parseInt(ha.value);ya.allPages=Y.checked;ya.selection=fa.checked;ya.pageView=ma.checked;ya.crop=sa.checked;ya.fit=ta.checked;return null!=C?C(!ka,ya):g.print(!ka,ya)}var T=g.editor.graph,P=document.createElement("div"),S=document.createElement("h3");S.style.width="100%";S.style.textAlign="center";+S.style.marginTop="0px";mxUtils.write(S,q||mxResources.get("print"));P.appendChild(S);var W=1,X=1;S=document.createElement("div");S.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");S.appendChild(Y);q=document.createElement("span");mxUtils.write(q,mxResources.get("allPages"));mxEvent.addListener(q,"click",function(){Y.checked=!0});S.appendChild(q);mxUtils.br(S);+var Z=Y.cloneNode(!0);S.appendChild(Z);q=document.createElement("span");mxUtils.write(q,mxResources.get("pages")+":");S.appendChild(q);mxEvent.addListener(q,"click",function(){Z.checked=!0});var aa=document.createElement("input");aa.style.margin="0 4px";aa.setAttribute("value","1");aa.setAttribute("type","number");aa.setAttribute("min","1");aa.style.width="40px";S.appendChild(aa);q=document.createElement("span");mxUtils.write(q,mxResources.get("to"));S.appendChild(q);var ha=aa.cloneNode(!0);S.appendChild(ha);+mxEvent.addListener(aa,"focus",function(){Z.checked=!0});mxEvent.addListener(ha,"focus",function(){Z.checked=!0});mxEvent.addListener(aa,"change",M);mxEvent.addListener(ha,"change",M);if(null!=g.pages&&(X=g.pages.length,null!=g.currentPage))for(var ja=0;ja<X;ja++)if(g.currentPage==g.pages[ja]){W=ja+1;break}null!=g.lastPrintPagesFromInput&&null!=g.lastPrintPagesToInput?(aa.value=Math.min(X,Math.max(1,g.lastPrintPagesFromInput)),ha.value=Math.min(X,Math.max(1,g.lastPrintPagesToInput))):(aa.value=W,+ha.value=W);aa.setAttribute("max",X);ha.setAttribute("max",X);ja=mxUtils.button(mxResources.get("currentPage"),function(ka){aa.value=W;ha.value=W;Z.checked=!0});ja.setAttribute("title",mxResources.get("currentPage"));ja.style.marginLeft="4px";ja.style.maxWidth="100px";ja.style.overflow="hidden";ja.style.textOverflow="ellipsis";ja.style.whiteSpace="nowrap";S.appendChild(ja);1<X&&P.appendChild(S);S=document.createElement("div");S.style.borderBottom="1px solid lightGray";S.style.paddingBottom="12px";+S.style.marginBottom="12px";S.style.whiteSpace="nowrap";var fa=document.createElement("input");fa.setAttribute("name","pages-printdialog");fa.setAttribute("type",1==X?"checkbox":"radio");fa.style.marginRight="8px";T.isSelectionEmpty()&&fa.setAttribute("disabled","disabled");T.isEnabled()&&(S.appendChild(fa),q=document.createElement("span"),mxUtils.write(q,mxResources.get("selectionOnly")),S.appendChild(q));(T.isEnabled()||1<X)&&P.appendChild(S);!g.isPagesEnabled()||g.lastPrintPagesRadioChecked?Z.checked=+!0:!T.isSelectionEmpty()&&g.lastPrintSelectionOnlyChecked?fa.checked=!0:Y.checked=!0;T.isSelectionEmpty()||mxEvent.addListener(q,"click",function(){fa.checked=!fa.checked});T=document.createElement("div");T.style.whiteSpace="nowrap";var ma=document.createElement("input");ma.style.marginBottom="8px";ma.style.marginRight="8px";ma.setAttribute("type","radio");ma.setAttribute("name","printSize");T.appendChild(ma);q=document.createElement("span");mxUtils.write(q,mxResources.get("pageView"));T.appendChild(q);+mxEvent.addListener(T,"click",function(){ma.checked=!0});P.appendChild(T);T=document.createElement("div");T.style.whiteSpace="nowrap";var sa=document.createElement("input");sa.style.marginBottom="8px";sa.style.marginRight="8px";sa.setAttribute("type","radio");sa.setAttribute("name","printSize");T.appendChild(sa);q=document.createElement("span");mxUtils.write(q,mxResources.get("crop"));T.appendChild(q);mxEvent.addListener(T,"click",function(){sa.checked=!0});P.appendChild(T);T=document.createElement("div");+T.style.whiteSpace="nowrap";var ta=document.createElement("input");ta.style.marginBottom="8px";ta.style.marginRight="8px";ta.setAttribute("type","radio");ta.setAttribute("name","printSize");q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.paddingTop="2px";q.appendChild(ta);T.appendChild(q);S=document.createElement("table");S.style.display="inline-block";S.style.borderSpacing="0";ja=document.createElement("tbody");var ra=document.createElement("tr"),+qa=ra.cloneNode(!0),la=document.createElement("td"),ia=la.cloneNode(!0),oa=la.cloneNode(!0),xa=la.cloneNode(!0),Aa=la.cloneNode(!0),wa=la.cloneNode(!0);la.style.textAlign="right";xa.style.textAlign="right";mxUtils.write(la,mxResources.get("fitTo"));mxEvent.addListener(T,"click",function(ka){mxEvent.getSource(ka)!=ta&&(ta.checked=!ta.checked)});var ea=document.createElement("input");ea.style.margin="0 2px";ea.style.boxSizing="border-box";ea.setAttribute("value",g.lastPrintSheetsAcross||"1");ea.setAttribute("min",+"1");ea.setAttribute("type","number");ea.style.width="40px";ia.appendChild(ea);q=document.createElement("span");mxUtils.write(q,mxResources.get("fitToSheetsAcross"));oa.appendChild(q);mxUtils.write(xa,mxResources.get("fitToBy"));var Da=ea.cloneNode(!0);Da.setAttribute("value",g.lastPrintSheetsDown||"1");Aa.appendChild(Da);mxEvent.addListener(ea,"click",function(ka){ta.checked=!0;mxEvent.consume(ka)});mxEvent.addListener(Da,"click",function(ka){ta.checked=!0;mxEvent.consume(ka)});g.lastPrintCropRadioChecked?+sa.checked=!0:g.lastPrintFitRadioChecked?ta.checked=!0:ma.checked=!0;q=document.createElement("span");mxUtils.write(q,mxResources.get("fitToSheetsDown"));wa.appendChild(q);ra.appendChild(la);ra.appendChild(ia);ra.appendChild(oa);qa.appendChild(xa);qa.appendChild(Aa);qa.appendChild(wa);ja.appendChild(ra);ja.appendChild(qa);S.appendChild(ja);T.appendChild(S);P.appendChild(T);T=document.createElement("div");T.style.borderTop="1px solid lightGray";T.style.whiteSpace="nowrap";T.style.paddingTop="12px";+T.style.marginTop="12px";T.style.paddingLeft="8px";mxUtils.write(T,mxResources.get("borderWidth")+":");var pa=document.createElement("input");pa.setAttribute("type","number");pa.setAttribute("min","0");pa.style.width="40px";pa.style.marginLeft="4px";pa.value=null!=g.lastPrintBorder?g.lastPrintBorder:mxPrintPreview.prototype.pageMargin;T.appendChild(pa);q=document.createElement("span");q.style.marginLeft="8px";mxUtils.write(q,mxResources.get("zoom")+":");T.appendChild(q);var ba=document.createElement("input");+ba.style.width="60px";ba.style.marginLeft="4px";ba.value=null!=g.lastPrintZoom?g.lastPrintZoom:"100%";T.appendChild(ba);mxUtils.br(T);var na=document.createElement("input");na.setAttribute("type","checkbox");na.style.marginTop="12px";na.checked=null!=g.lastPrintGrid?g.lastPrintGrid:!1;T.appendChild(na);q=document.createElement("span");q.style.marginLeft="4px";q.style.marginRight="8px";mxUtils.write(q,mxResources.get("grid"));T.appendChild(q);mxEvent.addListener(q,"click",function(ka){na.checked=!0;+mxEvent.consume(ka)});var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.style.marginTop="12px";Ca.checked=null!=g.lastPrintShadow?g.lastPrintShadow:!1;T.appendChild(Ca);q=document.createElement("span");q.style.marginLeft="4px";q.style.marginRight="8px";mxUtils.write(q,mxResources.get("shadows"));T.appendChild(q);g.isOffline()&&!mxClient.IS_CHROMEAPP||q.appendChild(g.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));mxEvent.addListener(q,"click",function(ka){"IMG"!=+mxEvent.getSource(ka).nodeName&&(Ca.checked=!0,mxEvent.consume(ka))});Editor.enableShadowOption?null!=C&&mxUtils.br(T):(Ca.style.display="none",q.style.display="none");var za=document.createElement("input");za.setAttribute("type","checkbox");za.style.marginTop="10px";za.checked=null!=g.lastPrintTransparent?g.lastPrintTransparent:!1;null!=C&&(T.appendChild(za),q=document.createElement("span"),q.style.marginLeft="4px",mxUtils.write(q,mxResources.get("transparentBackground")),T.appendChild(q),mxEvent.addListener(q,+"click",function(ka){za.checked=!0;mxEvent.consume(ka)}));var ca=document.createElement("input");ca.setAttribute("type","checkbox");ca.style.marginTop="10px";ca.checked=null!=g.lastPrintInclude?g.lastPrintInclude:Editor.defaultIncludeDiagram;null==C||mxClient.IS_CHROMEAPP||"draw.io"!=g.getServiceName()||(mxUtils.br(T),T.appendChild(ca),q=document.createElement("span"),q.style.marginLeft="4px",mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram")),T.appendChild(q),mxEvent.addListener(q,"click",+function(ka){ca.checked=!0;mxEvent.consume(ka)}));P.appendChild(T);q=document.createElement("div");q.style.marginTop="30px";q.style.textAlign="right";q.style.whiteSpace="nowrap";g.isOffline()&&!mxClient.IS_CHROMEAPP||null!=C||q.appendChild(g.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));T=mxUtils.button(mxResources.get("cancel"),function(){g.hideDialog()});T.className="geBtn";g.editor.cancelFirst&&q.appendChild(T);PrintDialog.previewEnabled&&null==C&&(S=mxUtils.button(mxResources.get("preview"),+function(){try{g.hideDialog(),Q(!1)}catch(ka){g.handleError(ka)}}),S.className="geBtn",q.appendChild(S));J=null!=J?J:null!=C?"export":PrintDialog.previewEnabled?"print":"ok";J=mxUtils.button(mxResources.get(J),function(){try{g.hideDialog(),Q(!0)}catch(ka){g.handleError(ka)}});J.className="geBtn gePrimaryBtn";q.appendChild(J);g.editor.cancelFirst||q.appendChild(T);P.appendChild(q);if(g.editor.isChromelessView()){var da=function(){Editor.isDarkMode()?(P.classList.add("geDarkMode"),P.style.colorScheme=+"dark"):(P.classList.remove("geDarkMode"),P.style.colorScheme="light")};g.addListener("darkModeChanged",da);da();var ua=function(ka,ya){ka=ya.getProperty("dialog");P.parentNode==ka.container&&(g.editor.removeListener(ua),g.removeListener(da))};g.editor.addListener("hideDialog",ua)}this.container=P};var I=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 I.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)}})();(function(){EditorUi.VERSION="29.6.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)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&+this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.6.5";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)||/.*\.cdn\.prod\.atlassian-dev\.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||"1"==urlParams.dev;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,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:{useWidth:1E3,useMaxWidth:!0,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,d,k,m,t,v,A){if(null!=c){t=null!=t?t:Error(c);t.stack=null!=t.stack?t.stack:"";v=null!=v?v: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>t.stack.indexOf("extension:")&&0>t.stack.indexOf("<anonymous>:")&&0>t.stack.indexOf("/math4/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+v+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=m?":colno:"+encodeURIComponent(m):-"")+(""!=t.stack?"&stack="+encodeURIComponent(t.stack):""))}catch(C){}try{A||null==window.console||console.error(v,c,d,k,m,t)}catch(C){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var d=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=d+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,d){if("1"==+topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(c,d,k,m,t,u,A){if(null!=c){t=null!=t?t:Error(c);t.stack=null!=t.stack?t.stack:"";u=null!=u?u: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>t.stack.indexOf("extension:")&&0>t.stack.indexOf("<anonymous>:")&&0>t.stack.indexOf("/math4/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+u+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=m?":colno:"+encodeURIComponent(m):+"")+(""!=t.stack?"&stack="+encodeURIComponent(t.stack):""))}catch(B){}try{A||null==window.console||console.error(u,c,d,k,m,t)}catch(B){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var d=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=d+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,d){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{d=null!=d?d:5E4,c.length>d&&(c=c.substring(0,d)+"\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()],d=0;d<arguments.length;d++)c.push(arguments[d]);mxClient.IS_IOS?(mxLog.show(),mxLog.debug(c.join(" "))):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 d=[],k=0;k<c.length;k++)d.push(c[k]);for(k=0;k<d.length;k++)EditorUi.replaceSvgImage(d[k])};EditorUi.replaceSvgImage=function(c){try{var d=null;d=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var k=EditorUi.getSvgSubtree(d);-if(null!=k&&"svg"==k.nodeName){var m=k.getAttribute("width"),t=k.getAttribute("height");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";0<m&&0<t&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+m+" "+t);var v=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");v.appendChild(k);c.hasAttribute("transform")&&v.setAttribute("transform",-c.getAttribute("transform"));c.parentNode.replaceChild(v,c)}}catch(A){}};EditorUi.getSvgSubtree=function(c){var d=Graph.getSvgFromDataUri(c);c=null;if(null!=d){c=Graph.sanitizeNode(mxUtils.parseXml(d).documentElement);d=c.getElementsByTagName("style");if(0<d.length){var k="svg-image-"+Editor.guid();c.setAttribute("id",k);for(var m=document.implementation.createHTMLDocument(""),t=document.createElement("style"),v=0;v<d.length;v++){t.textContent=d[v].textContent;m.body.appendChild(t);for(var A="",C=-0;C<t.sheet.cssRules.length;C++){var E=t.sheet.cssRules[C];if(null!=E.selectorText){for(var D=E.selectorText.split(","),U=0;U<D.length;U++)D[U]="#"+k+" "+D[U];E.selectorText=D.join(",")}A+=E.cssText+"\n"}d[v].textContent=A}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");d=c.getElementsByTagName("*");for(k=0;k<d.length;k++)d[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+if(null!=k&&"svg"==k.nodeName){var m=k.getAttribute("width"),t=k.getAttribute("height");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";0<m&&0<t&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+m+" "+t);var u=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");u.appendChild(k);c.hasAttribute("transform")&&u.setAttribute("transform",+c.getAttribute("transform"));c.parentNode.replaceChild(u,c)}}catch(A){}};EditorUi.getSvgSubtree=function(c){var d=Graph.getSvgFromDataUri(c);c=null;if(null!=d){c=Graph.sanitizeNode(mxUtils.parseXml(d).documentElement);d=c.getElementsByTagName("style");if(0<d.length){var k="svg-image-"+Editor.guid();c.setAttribute("id",k);for(var m=document.implementation.createHTMLDocument(""),t=document.createElement("style"),u=0;u<d.length;u++){t.textContent=d[u].textContent;m.body.appendChild(t);for(var A="",B=+0;B<t.sheet.cssRules.length;B++){var D=t.sheet.cssRules[B];if(null!=D.selectorText){for(var N=D.selectorText.split(","),F=0;F<N.length;F++)N[F]="#"+k+" "+N[F];D.selectorText=N.join(",")}A+=D.cssText+"\n"}d[u].textContent=A}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");d=c.getElementsByTagName("*");for(k=0;k<d.length;k++)d[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.sidebarEnabled="0"!=urlParams.sidebar;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedMessageSource=null;EditorUi.prototype.defaultCompact=!1;EditorUi.prototype.noAutoFocus=!1;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;EditorUi.prototype.createButtonContainer=function(){var c=document.createElement("div");c.className="geButtonContainer";return c};EditorUi.prototype.openLink=@@ -13167,522 +13173,528 @@ function(c,d,k){return this.editor.graph.openLink(c,d,k)};EditorUi.prototype.shoc;this.fireEvent(new mxEventObject("shareCursorPositionChanged"))};EditorUi.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 d=this.editor.graph;d.mathEnabled=c;null!=d.view.backgroundImage&&(d.view.backgroundImage.destroy(),d.view.backgroundImage=null);this.editor.updateGraphComponents();d.refresh();d.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,d,k){var m=null==c||null==d;k=null!=k?k:24;var t=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}),v=this.timeout,A=t.spin,C=null,E=null,D=mxUtils.bind(this,function(V){null!=V&&V()}),U=this;t.spin=function(V,n,u,G){G=null!=G?G:v;var H=!1;if(!this.active){var I=Date.now();null!=u&&(C=window.setTimeout(function(){t.stop();C=null;u({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:E})},G));m&&(d=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||-0)/2,c=document.body.clientWidth/2-2);V==document.body&&"1"==urlParams.embedInline&&(V=U.diagramContainer,c=V.scrollLeft+V.clientWidth/2,d=V.scrollTop+V.clientHeight/2);A.call(this,V);"1"==urlParams.embedInline&&null!=t.el&&(t.el.style.marginTop=V.scrollTop+"px",t.el.style.marginLeft=V.scrollLeft+"px");this.active=!0;null!=n&&(H=document.createElement("div"),H.className="geSpinnerStatus",H.setAttribute("title",n),V==document.body?(H.style.left=Math.max(0,c)+"px",H.style.top=Math.max(0,d+66)+"px"):-(H.style.left="50%",H.style.top="50%",H.style.marginTop="70px"),"..."!=n.substring(n.length-3,n.length)&&"!"!=n.charAt(n.length-1)&&(n+="..."),H.innerText=n,V.appendChild(H),t.status=H);this.pause=mxUtils.bind(this,function(){var g=D;this.active&&(G=Math.max(0,G-(Date.now()-I)),g=mxUtils.bind(this,function(q){this.spin(V,n,u,G);if(null!=q)try{q(),E=mxUtils.bind(this,function(){this.spin(V,n,u,G);try{q()}catch(B){null!=u&&u(B)}})}catch(B){null!=u&&u(B)}}));this.stop();return g});H=!0}return H};var T=-t.stop;t.stop=function(){T.call(this);this.active&&(this.active=!1,null!=C&&(window.clearTimeout(C),C=null),null!=t.status&&null!=t.status.parentNode&&t.status.parentNode.removeChild(t.status),t.status=null)};t.pause=function(){return D};return t};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var d=mxUtils.parseXml(c),k=this.editor.extractGraphModel(d.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}}catch(m){}return!1};+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=t.spin,B=null,D=null,N=mxUtils.bind(this,function(V){null!=V&&V()}),F=this;t.spin=function(V,n,v,G){G=null!=G?G:u;var H=!1;if(!this.active){var I=Date.now();null!=v&&(B=window.setTimeout(function(){t.stop();B=null;v({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:D})},G));m&&(d=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||+0)/2,c=document.body.clientWidth/2-2);V==document.body&&"1"==urlParams.embedInline&&(V=F.diagramContainer,c=V.scrollLeft+V.clientWidth/2,d=V.scrollTop+V.clientHeight/2);A.call(this,V);"1"==urlParams.embedInline&&null!=t.el&&(t.el.style.marginTop=V.scrollTop+"px",t.el.style.marginLeft=V.scrollLeft+"px");this.active=!0;null!=n&&(H=document.createElement("div"),H.className="geSpinnerStatus",H.setAttribute("title",n),V==document.body?(H.style.left=Math.max(0,c)+"px",H.style.top=Math.max(0,d+66)+"px"):+(H.style.left="50%",H.style.top="50%",H.style.marginTop="70px"),"..."!=n.substring(n.length-3,n.length)&&"!"!=n.charAt(n.length-1)&&(n+="..."),H.innerText=n,V.appendChild(H),t.status=H);this.pause=mxUtils.bind(this,function(){var g=N;this.active&&(G=Math.max(0,G-(Date.now()-I)),g=mxUtils.bind(this,function(q){this.spin(V,n,v,G);if(null!=q)try{q(),D=mxUtils.bind(this,function(){this.spin(V,n,v,G);try{q()}catch(C){null!=v&&v(C)}})}catch(C){null!=v&&v(C)}}));this.stop();return g});H=!0}return H};var U=+t.stop;t.stop=function(){U.call(this);this.active&&(this.active=!1,null!=B&&(window.clearTimeout(B),B=null),null!=t.status&&null!=t.status.parentNode&&t.status.parentNode.removeChild(t.status),t.status=null)};t.pause=function(){return N};return t};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var d=mxUtils.parseXml(c),k=this.editor.extractGraphModel(d.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}}catch(m){}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 d=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=-d.getFunction,m=this.editor.graph,t=this;d.getFunction=function(v){if(m.isSelectionEmpty()&&null!=t.pages&&0<t.pages.length){var A=t.getSelectedPageIndex();if(mxEvent.isShiftDown(v)){if(37==v.keyCode)return function(){0<A&&t.movePage(A,A-1)};if(38==v.keyCode)return function(){0<A&&t.movePage(A,0)};if(39==v.keyCode)return function(){A<t.pages.length-1&&t.movePage(A,A+1)};if(40==v.keyCode)return function(){A<t.pages.length-1&&t.movePage(A,t.pages.length-1)}}else if(mxEvent.isControlDown(v)||mxClient.IS_MAC&&-mxEvent.isMetaDown(v)){if(37==v.keyCode)return function(){0<A&&t.selectNextPage(!1)};if(38==v.keyCode)return function(){0<A&&t.selectPage(t.pages[0])};if(39==v.keyCode)return function(){A<t.pages.length-1&&t.selectNextPage(!0)};if(40==v.keyCode)return function(){A<t.pages.length-1&&t.selectPage(t.pages[t.pages.length-1])}}}return!(65<=v.keyCode&&90>=v.keyCode)||m.isSelectionEmpty()||mxEvent.isAltDown(v)||mxEvent.isShiftDown(v)||mxEvent.isControlDown(v)||mxClient.IS_MAC&&mxEvent.isMetaDown(v)?k.apply(this,-arguments):null}}return d};var l=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var d=l.apply(this,arguments);if(null==d)try{var k=c.indexOf("<mxfile ");if(0<=k){var m=c.lastIndexOf("</mxfile>");m>k&&(d=c.substring(k,m+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var t=mxUtils.parseXml(c),v=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);-d=null!=v?mxUtils.getXml(v):""}}catch(A){}return d};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var d=c.indexOf('<meta charset="utf-8">');0<=d&&(c=c.slice(0,d)+'<meta charset="utf-8"/>'+c.slice(d+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,d){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",d);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 m=null!=this.pages?this.pages.slice():null,t=c.getElementsByTagName("diagram");if(1<t.length||1==t.length&&t[0].hasAttribute("name")){this.fileNode=c;k.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var v=t.length-1;0<=v;v--){var A=this.updatePageRoot(new DiagramPage(t[v]));null==A.getName()&&A.setName(mxResources.get("pageWithNumber",[v+1]));k.model.execute(new ChangePage(this,-A,0==v?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!=-m)for(v=0;v<m.length;v++)k.model.execute(new ChangePage(this,m[v],null));var C=this.getCurrentFile();null!=C&&C.fileReplaced(d)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,d,k,m,t,v,A,C,E,D,U,T,V){d=null!=d?d:this.editor.graph;t=null!=t?t:!1;E=null!=E?E:!0;D=null!=D?D:this.defaultCompact;U=null!=U?U:!Editor.defaultCompressed;var n=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var u="_blank";else n=u=m;if(null==c)return"";var G=c;if("mxfile"!=-G.nodeName.toLowerCase()){if(U){var H=c.ownerDocument.createElement("diagram");H.setAttribute("name",mxResources.get("pageWithNumber",[1]));H.setAttribute("id",Editor.guid());H.appendChild(c)}else{H=Graph.zapGremlins(mxUtils.getXml(c));G=Graph.compress(H);if(Graph.decompress(G)!=H)return H;H=c.ownerDocument.createElement("diagram");H.setAttribute("name",mxResources.get("pageWithNumber",[1]));H.setAttribute("id",Editor.guid());mxUtils.setTextContent(H,G)}G=c.ownerDocument.createElement("mxfile");G.appendChild(H)}D?+d.getFunction,m=this.editor.graph,t=this;d.getFunction=function(u){if(m.isSelectionEmpty()&&null!=t.pages&&0<t.pages.length){var A=t.getSelectedPageIndex();if(mxEvent.isShiftDown(u)){if(37==u.keyCode)return function(){0<A&&t.movePage(A,A-1)};if(38==u.keyCode)return function(){0<A&&t.movePage(A,0)};if(39==u.keyCode)return function(){A<t.pages.length-1&&t.movePage(A,A+1)};if(40==u.keyCode)return function(){A<t.pages.length-1&&t.movePage(A,t.pages.length-1)}}else if(mxEvent.isControlDown(u)||mxClient.IS_MAC&&+mxEvent.isMetaDown(u)){if(37==u.keyCode)return function(){0<A&&t.selectNextPage(!1)};if(38==u.keyCode)return function(){0<A&&t.selectPage(t.pages[0])};if(39==u.keyCode)return function(){A<t.pages.length-1&&t.selectNextPage(!0)};if(40==u.keyCode)return function(){A<t.pages.length-1&&t.selectPage(t.pages[t.pages.length-1])}}}return!(65<=u.keyCode&&90>=u.keyCode)||m.isSelectionEmpty()||mxEvent.isAltDown(u)||mxEvent.isShiftDown(u)||mxEvent.isControlDown(u)||mxClient.IS_MAC&&mxEvent.isMetaDown(u)?k.apply(this,+arguments):null}}return d};var l=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var d=l.apply(this,arguments);if(null==d)try{var k=c.indexOf("<mxfile ");if(0<=k){var m=c.lastIndexOf("</mxfile>");m>k&&(d=c.substring(k,m+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var t=mxUtils.parseXml(c),u=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);+d=null!=u?mxUtils.getXml(u):""}}catch(A){}return d};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var d=c.indexOf('<meta charset="utf-8">');0<=d&&(c=c.slice(0,d)+'<meta charset="utf-8"/>'+c.slice(d+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,d){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",d);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 m=null!=this.pages?this.pages.slice():null,t=c.getElementsByTagName("diagram");if(1<t.length||1==t.length&&t[0].hasAttribute("name")){this.fileNode=c;k.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var u=t.length-1;0<=u;u--){var A=this.updatePageRoot(new DiagramPage(t[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!=+m)for(u=0;u<m.length;u++)k.model.execute(new ChangePage(this,m[u],null));var B=this.getCurrentFile();null!=B&&B.fileReplaced(d)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,d,k,m,t,u,A,B,D,N,F,U,V){d=null!=d?d:this.editor.graph;t=null!=t?t:!1;D=null!=D?D:!0;N=null!=N?N:this.defaultCompact;F=null!=F?F:!Editor.defaultCompressed;var n=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var v="_blank";else n=v=m;if(null==c)return"";var G=c;if("mxfile"!=+G.nodeName.toLowerCase()){if(F){var H=c.ownerDocument.createElement("diagram");H.setAttribute("name",mxResources.get("pageWithNumber",[1]));H.setAttribute("id",Editor.guid());H.appendChild(c)}else{H=Graph.zapGremlins(mxUtils.getXml(c));G=Graph.compress(H);if(Graph.decompress(G)!=H)return H;H=c.ownerDocument.createElement("diagram");H.setAttribute("name",mxResources.get("pageWithNumber",[1]));H.setAttribute("id",Editor.guid());mxUtils.setTextContent(H,G)}G=c.ownerDocument.createElement("mxfile");G.appendChild(H)}N?(G=G.cloneNode(!0),G.removeAttribute("modified"),G.removeAttribute("host"),G.removeAttribute("agent"),G.removeAttribute("etag"),G.removeAttribute("userAgent"),G.removeAttribute("version"),G.removeAttribute("editor"),G.removeAttribute("type")):(G.removeAttribute("userAgent"),G.removeAttribute("modified"),G.removeAttribute("version"),G.removeAttribute("editor"),G.removeAttribute("pages"),G.removeAttribute("type"),G.removeAttribute("etag"),mxClient.IS_CHROMEAPP?G.setAttribute("host","Chrome"):EditorUi.isElectronApp?-G.setAttribute("host","Electron"):G.setAttribute("host",window.location.hostname),G.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),G.setAttribute("version",EditorUi.VERSION),1<G.getElementsByTagName("diagram").length&&null!=this.pages&&G.setAttribute("pages",this.pages.length));null!=T&&(G=G.cloneNode(!0),G.setAttribute("scale",T));null!=V&&(G=G.cloneNode(!0),G.setAttribute("border",V));c=U?mxUtils.getPrettyXml(G):mxUtils.getXml(G);if(!v&&!t&&(A||null!=k&&-/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(G),d,null!=k?k.getTitle():null,u,n);else if(v||!t&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(m=null),k=this.getSvgFileProperties(G),c=this.getEmbeddedSvg(c,d,m,null,C,E,n,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,d,k,m){c=null!=c?c:!0;d=null!=d?d:!1;k=null!=k?k:!Editor.defaultCompressed;var t=this.editor.getGraphXml(c,-m);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(E){var D=E.getElementsByTagName("mxGraphModel"),U=0<D.length?D[0]:null;D=E;null==U&&k?(U=mxUtils.getNodeValue(E),0<U.length&&(U=Graph.decompress(U),null!=U&&0<U.length&&(D=E.cloneNode(!1),D.appendChild(mxUtils.parseXml(U).documentElement)))):null==U||k?D=E.cloneNode(!0):(D=E.cloneNode(!1),mxUtils.setTextContent(D,Graph.compressNode(U)));t.appendChild(D)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(t),-t=this.fileNode.cloneNode(!1),d)c(this.currentPage.node);else for(d=0;d<this.pages.length;d++){var v=this.pages[d],A=v.node;if(v!=this.currentPage)if(v.needsUpdate){var C=new mxCodec(mxUtils.createXmlDocument());C=C.encode(new mxGraphModel(v.root));this.editor.graph.saveViewState(v.viewState,C,null,m);EditorUi.removeChildNodes(A);A.appendChild(C);delete v.needsUpdate}else m&&(this.updatePageRoot(v),null!=v.viewState.backgroundImage&&null!=v.viewState.backgroundImage.originalSrc&&(C=new mxCodec(mxUtils.createXmlDocument()),-C=C.encode(new mxGraphModel(v.root)),this.editor.graph.saveViewState(v.viewState,C,null,m,v),A=A.cloneNode(!1),A.appendChild(C)));c(A)}return t};EditorUi.prototype.anonymizeString=function(c,d){for(var k=[],m=0;m<c.length;m++){var t=c.charAt(m);0<=EditorUi.ignoredAnonymizedChars.indexOf(t)?k.push(t):isNaN(parseInt(t))?t.toLowerCase()!=t?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):t.toUpperCase()!=t?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(t)?k.push(" "):-k.push("?"):k.push(d?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var d=0;d<c[EditorUi.DIFF_INSERT].length;d++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][d].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][d].data=mxUtils.getXml(k)}catch(v){c[EditorUi.DIFF_INSERT][d].data=v.message}if(null!=-c[EditorUi.DIFF_UPDATE]){for(var m in c[EditorUi.DIFF_UPDATE]){var t=c[EditorUi.DIFF_UPDATE][m];null!=t.name&&(t.name=this.anonymizeString(t.name));null!=t.cells&&(d=mxUtils.bind(this,function(v){var A=t.cells[v];if(null!=A){for(var C in A)null!=A[C].value&&(A[C].value="["+A[C].value.length+"]"),null!=A[C].xmlValue&&(A[C].xmlValue="["+A[C].xmlValue.length+"]"),null!=A[C].style&&(A[C].style="["+A[C].style.length+"]"),mxUtils.isEmptyObject(A[C])&&delete A[C];mxUtils.isEmptyObject(A)&&delete t.cells[v]}}),+G.setAttribute("host","Electron"):G.setAttribute("host",window.location.hostname),G.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),G.setAttribute("version",EditorUi.VERSION),1<G.getElementsByTagName("diagram").length&&null!=this.pages&&G.setAttribute("pages",this.pages.length));null!=U&&(G=G.cloneNode(!0),G.setAttribute("scale",U));null!=V&&(G=G.cloneNode(!0),G.setAttribute("border",V));c=F?mxUtils.getPrettyXml(G):mxUtils.getXml(G);if(!u&&!t&&(A||null!=k&&+/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(G),d,null!=k?k.getTitle():null,v,n);else if(u||!t&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(m=null),k=this.getSvgFileProperties(G),c=this.getEmbeddedSvg(c,d,m,null,B,D,n,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,d,k,m){c=null!=c?c:!0;d=null!=d?d:!1;k=null!=k?k:!Editor.defaultCompressed;var t=this.editor.getGraphXml(c,+m);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(D){var N=D.getElementsByTagName("mxGraphModel"),F=0<N.length?N[0]:null;N=D;null==F&&k?(F=mxUtils.getNodeValue(D),0<F.length&&(F=Graph.decompress(F),null!=F&&0<F.length&&(N=D.cloneNode(!1),N.appendChild(mxUtils.parseXml(F).documentElement)))):null==F||k?N=D.cloneNode(!0):(N=D.cloneNode(!1),mxUtils.setTextContent(N,Graph.compressNode(F)));t.appendChild(N)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(t),+t=this.fileNode.cloneNode(!1),d)c(this.currentPage.node);else for(d=0;d<this.pages.length;d++){var u=this.pages[d],A=u.node;if(u!=this.currentPage)if(u.needsUpdate){var B=new mxCodec(mxUtils.createXmlDocument());B=B.encode(new mxGraphModel(u.root));this.editor.graph.saveViewState(u.viewState,B,null,m);EditorUi.removeChildNodes(A);A.appendChild(B);delete u.needsUpdate}else m&&(this.updatePageRoot(u),null!=u.viewState.backgroundImage&&null!=u.viewState.backgroundImage.originalSrc&&(B=new mxCodec(mxUtils.createXmlDocument()),+B=B.encode(new mxGraphModel(u.root)),this.editor.graph.saveViewState(u.viewState,B,null,m,u),A=A.cloneNode(!1),A.appendChild(B)));c(A)}return t};EditorUi.prototype.anonymizeString=function(c,d){for(var k=[],m=0;m<c.length;m++){var t=c.charAt(m);0<=EditorUi.ignoredAnonymizedChars.indexOf(t)?k.push(t):isNaN(parseInt(t))?t.toLowerCase()!=t?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):t.toUpperCase()!=t?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(t)?k.push(" "):+k.push("?"):k.push(d?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var d=0;d<c[EditorUi.DIFF_INSERT].length;d++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][d].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][d].data=mxUtils.getXml(k)}catch(u){c[EditorUi.DIFF_INSERT][d].data=u.message}if(null!=+c[EditorUi.DIFF_UPDATE]){for(var m in c[EditorUi.DIFF_UPDATE]){var t=c[EditorUi.DIFF_UPDATE][m];null!=t.name&&(t.name=this.anonymizeString(t.name));null!=t.cells&&(d=mxUtils.bind(this,function(u){var A=t.cells[u];if(null!=A){for(var B in A)null!=A[B].value&&(A[B].value="["+A[B].value.length+"]"),null!=A[B].xmlValue&&(A[B].xmlValue="["+A[B].xmlValue.length+"]"),null!=A[B].style&&(A[B].style="["+A[B].style.length+"]"),mxUtils.isEmptyObject(A[B])&&delete A[B];mxUtils.isEmptyObject(A)&&delete t.cells[u]}}),d(EditorUi.DIFF_INSERT),d(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(t.cells)&&delete t.cells);mxUtils.isEmptyObject(t)&&delete c[EditorUi.DIFF_UPDATE][m]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,d){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,d));if(null!=c.childNodes)for(k=0;k<c.childNodes.length;k++)this.anonymizeAttributes(c.childNodes[k],d)};EditorUi.prototype.anonymizeNode=function(c,d){d=c.getElementsByTagName("mxCell");for(var k=0;k<d.length;k++)null!=d[k].getAttribute("value")&&d[k].setAttribute("value","["+d[k].getAttribute("value").length+"]"),null!=d[k].getAttribute("xmlValue")&&d[k].setAttribute("xmlValue","["+d[k].getAttribute("xmlValue").length+"]"),null!=d[k].getAttribute("style")&&d[k].setAttribute("style","["+d[k].getAttribute("style").length+"]"),null!=d[k].parentNode&&"root"!=d[k].parentNode.nodeName&&null!=d[k].parentNode.parentNode&&(d[k].setAttribute("id",d[k].parentNode.getAttribute("id")),d[k].parentNode.parentNode.replaceChild(d[k],d[k].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var d=this.getCurrentFile();null!=d&&(d.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&d.invalidChecksum?d.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(d.clearAutosave(),-this.clearStatus(),c?d.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();d.handleFileError(k,!0)})):d.synchronizeFile(mxUtils.bind(this,function(){d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){d.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,d,k,m,t,v,A,C,E,D,U,T,V){t=null!=t?t:!0;v=null!=v?v:!1;D=null!=D?D:!Editor.defaultCompressed;var n=-this.editor.graph;if((d||!c&&null!=E&&/(\.svg)$/i.test(E.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var u=n.getGlobalVariable;n=this.createTemporaryGraph(n.getStylesheet());n.setBackgroundImage=this.editor.graph.setBackgroundImage;n.background=this.editor.graph.background;var G=null!=this.pages?this.pages[0]:null;null==G||this.currentPage==G?n.setBackgroundImage(this.editor.graph.backgroundImage):null!=G.viewState&&null!=G.viewState&&n.setBackgroundImage(G.viewState.backgroundImage);-n.getGlobalVariable=function(H){return"page"==H&&null!=G?G.getName():"pagenumber"==H?1:u.apply(this,arguments)};document.body.appendChild(n.container);null!=G&&n.model.setRoot(G.root)}A=null!=A?A:this.getXmlFileData(t,v,D,U);E=null!=E?E:this.getCurrentFile();c=this.createFileData(A,n,E,window.location.href,c,d,k,m,t,C,D,T,V);n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);return c};EditorUi.prototype.getHtml=function(c,d,k,m,t,v){v=null!=v?v:!0;var A=null,C=EditorUi.drawHost+-"/js/embed-static.min.js";if(null!=d){A=v?d.getGraphBounds():d.getBoundingBox(d.getSelectionCells());var E=d.view.scale;v=Math.floor(A.x/E-d.view.translate.x);E=Math.floor(A.y/E-d.view.translate.y);A=d.background;null==t&&(d=this.getBasenames().join(";"),0<d.length&&(C=EditorUi.drawHost+"/embed.js?s="+d));c.setAttribute("x0",v);c.setAttribute("y0",E)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),+this.clearStatus(),c?d.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();d.handleFileError(k,!0)})):d.synchronizeFile(mxUtils.bind(this,function(){d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){d.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,d,k,m,t,u,A,B,D,N,F,U,V){t=null!=t?t:!0;u=null!=u?u:!1;N=null!=N?N:!Editor.defaultCompressed;var n=+this.editor.graph;if((d||!c&&null!=D&&/(\.svg)$/i.test(D.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var v=n.getGlobalVariable;n=this.createTemporaryGraph(n.getStylesheet());n.setBackgroundImage=this.editor.graph.setBackgroundImage;n.background=this.editor.graph.background;var G=null!=this.pages?this.pages[0]:null;null==G||this.currentPage==G?n.setBackgroundImage(this.editor.graph.backgroundImage):null!=G.viewState&&null!=G.viewState&&n.setBackgroundImage(G.viewState.backgroundImage);+n.getGlobalVariable=function(H){return"page"==H&&null!=G?G.getName():"pagenumber"==H?1:v.apply(this,arguments)};document.body.appendChild(n.container);null!=G&&n.model.setRoot(G.root)}A=null!=A?A:this.getXmlFileData(t,u,N,F);D=null!=D?D:this.getCurrentFile();c=this.createFileData(A,n,D,window.location.href,c,d,k,m,t,B,N,U,V);n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);return c};EditorUi.prototype.getHtml=function(c,d,k,m,t,u){u=null!=u?u:!0;var A=null,B=EditorUi.drawHost++"/js/embed-static.min.js";if(null!=d){A=u?d.getGraphBounds():d.getBoundingBox(d.getSelectionCells());var D=d.view.scale;u=Math.floor(A.x/D-d.view.translate.x);D=Math.floor(A.y/D-d.view.translate.y);A=d.background;null==t&&(d=this.getBasenames().join(";"),0<d.length&&(B=EditorUi.drawHost+"/embed.js?s="+d));c.setAttribute("x0",u);c.setAttribute("y0",D)}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!=m&&c.setAttribute("edit",m));null!=t&&(t=t.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";m=Graph.compress(c);Graph.decompress(m)!=c&&(m=encodeURIComponent(c));return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+-(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&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;">'+m+"</div>\n</div>\n"+(null==t?'<script type="text/javascript" src="'+C+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'++(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&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;">'+m+"</div>\n</div>\n"+(null==t?'<script type="text/javascript" src="'+B+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,d,k,m,t){d=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=t&&(t=t.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==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\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==t?'<script type="text/javascript" src="'+d+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.updateFileVars=function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(d){}};EditorUi.prototype.setFileData=function(c,d){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;d=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=Editor.extractParserError(d,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[d],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=d?this.editor.extractGraphModel(d,!0):null;null!=c&&(d=c);if(null!=d&&"mxfile"==d.nodeName&&(c=d.getElementsByTagName("diagram"),k={},0<c.length)){var m=-this.getHashObject(),t=null;this.fileNode=d;this.editor.graph.defaultExportLinkTarget=d.getAttribute("linkTarget");this.pages=[];for(var v=0;v<c.length;v++){null==c[v].getAttribute("id")&&c[v].setAttribute("id",v);d=new DiagramPage(c[v]);null==d.getName()&&d.setName(mxResources.get("pageWithNumber",[v+1]));this.pages.push(d);if(null==m.pageId&&null!=urlParams["page-id"]&&d.getId()==urlParams["page-id"]||null!=m.pageId&&d.getId()==m.pageId)t=d;if(null==k[d.getId()])k[d.getId()]=d;else throw Error(d.getId()++this.getHashObject(),t=null;this.fileNode=d;this.editor.graph.defaultExportLinkTarget=d.getAttribute("linkTarget");this.pages=[];for(var u=0;u<c.length;u++){null==c[u].getAttribute("id")&&c[u].setAttribute("id",u);d=new DiagramPage(c[u]);null==d.getName()&&d.setName(mxResources.get("pageWithNumber",[u+1]));this.pages.push(d);if(null==m.pageId&&null!=urlParams["page-id"]&&d.getId()==urlParams["page-id"]||null!=m.pageId&&d.getId()==m.pageId)t=d;if(null==k[d.getId()])k[d.getId()]=d;else throw Error(d.getId()+": Duplicate page ID");}this.currentPage=null!=t?t:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];d=this.currentPage.node}null==this.fileNode&&null!=d&&(this.fileNode=d.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(d.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(d);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(" ");d={};for(v=0;v<A.length;v++)d[A[v]]=!0;var C=this.editor.graph.getModel(),E=C.getChildren(C.root);for(v=0;v<E.length;v++){var D=E[v];C.setVisible(D,d[D.id]||!1)}}catch(U){}};EditorUi.prototype.fileStats=function(c,d){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var k=d.getElementsByTagName("diagram");d=-{};d.modified=c.getLastModifiedDate();d.fileMode=c.getMode();d.fileSize=c.getSize();d.fileHash=c.getHash();d.pages=k.length;d.redundantStencils=0;d.redundantImages=0;d.redundantSize=0;d.stencils=0;d.images=0;for(var m=d.cells=0;m<k.length;m++){var t=k[m].getElementsByTagName("mxCell");d.cells+=t.length;for(var v={},A=0;A<t.length;A++){var C=t[A].getAttribute("style");if(null!=C)for(var E=C.split(";"),D=0;D<E.length;D++){var U=E[D];if(U.startsWith("image=data:")||U.startsWith("shape=stencil("))null==-v[U]?v[U]=1:v[U]++}}for(var T in v){var V=v[T];T.startsWith("shape=stencil(")?d.stencils+=V:d.images+=V;1<V&&(d.redundantSize+=T.length*(V-1),T.startsWith("shape=stencil(")?d.redundantStencils+=V-1:d.redundantImages+=V-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(d)})}}catch(n){}};EditorUi.prototype.getBaseFilename=function(c){var d=this.getCurrentFile();d=null!=d&&null!=d.getTitle()?d.getTitle():this.defaultFilename;-if(/(\.xml)$/i.test(d)||/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));/(\.drawio)$/i.test(d)&&(d=d.substring(0,d.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(c,d,k,m,t,v,A,C,E,D,U,T,V,n,u,G,H){try{m=null!=m?m:this.editor.graph.isSelectionEmpty();-var I=this.getBaseFilename(!t),g=I+("xml"==c||"pdf"==c&&U?".drawio":"")+"."+c;if("xml"==c){var q=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,m,t,null,null,null,d);this.saveData(g,c,q,"text/xml")}else if("html"==c)q=this.getHtml2(this.getFileData(!0),this.editor.graph,I),this.saveData(g,c,q,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?g=I+".png":"jpeg"==c&&(g=I+".jpg"),this.saveRequest(g,c,mxUtils.bind(this,function(S,-P){try{return this.createDownloadRequest(S,c,m,P,A,t,C,E,D,U,T,void 0,void 0,!v,V,n,u,G,H)}catch(R){this.handleError(R)}}));else{var B=null,J=mxUtils.bind(this,function(S){S.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",S,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(B)}))});if("svg"==c){var Q=this.editor.graph.background;if(A||Q==mxConstants.NONE)Q=null;var N=this.editor.graph.getSvg(Q,null,null,-null,null,m);k&&this.editor.graph.addSvgShadow(N);this.editor.convertImages(N,mxUtils.bind(this,mxUtils.bind(this,function(S){this.spinner.stop();J(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(S))})))}else g=I+".svg",B=this.getFileData(!1,!0,null,mxUtils.bind(this,function(S){this.spinner.stop();J(S)}),m)}}catch(S){this.handleError(S)}};EditorUi.prototype.createDownloadRequest=function(c,d,k,m,t,v,A,C,E,D,U,T,V,n,u,G,H,I,g){c=this.downloadRequestBuilder(c,d,k,m,t,v,A,C,E,D,U,T,V,-n,u,G,H,I,g);d="";for(var q in c)k=c[q],null!=k&&(d+=q+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,d)};EditorUi.prototype.downloadRequestBuilder=function(c,d,k,m,t,v,A,C,E,D,U,T,V,n,u,G,H,I,g){var q=this.editor.graph,B=q.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==v?!1:"xmlpng"!=d,null,null,null,!Editor.defaultCompressed,"pdf"==d);var J=null,Q=null,N=null;if(!EditorUi.isElectronApp&&(B.width*B.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};-D=D?"1":"0";"pdf"==d&&(null!=U?(J=U.from,Q=U.to):0==v&&(N="1"));"xmlpng"==d&&(D="1",d="png");if(("xmlpng"==d||"svg"==d)&&null!=this.pages&&null!=this.currentPage)for(v=0;v<this.pages.length;v++)if(this.pages[v]==this.currentPage){J=v;break}v=q.background;"png"!=d&&"pdf"!=d&&"svg"!=d||!t?t||null!=v&&v!=mxConstants.NONE||(v="#ffffff"):v=mxConstants.NONE;t={globalVars:q.getExportVariables()};null!=U&&null!=U.from&&(t.globalVars.pagenumber=U.from+1);E&&(t.grid={size:q.gridSize,steps:q.view.gridSteps,-color:Editor.isDarkMode()&&"pdf"==d?mxGraphView.prototype.defaultGridColor:q.view.gridColor});Graph.translateDiagram&&(t.diagramLanguage=Graph.diagramLanguage);return{format:d,from:J,to:Q,allPages:N,bg:null!=v?v:mxConstants.NONE,base64:m,embedXml:D,xml:k,filename:null!=c?c:"",extras:JSON.stringify(t),scale:A,border:C,pageMargin:u,w:T&&isFinite(T)?T:null,h:V&&isFinite(V)?V:null,crop:null!=n&&n?"1":"0",fit:null!=G&&G?"1":"0",shadows:null!=g&&g?"1":"0",sheetsAcross:H,sheetsDown:I}};EditorUi.prototype.setMode=-function(c,d){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 d=c.indexOf("#");0<=d&&(c=c.substring(0,d))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,d={};if(null!=c&&0<c.length){var k=c.lastIndexOf("#");if(0<k){c=decodeURIComponent(c.substring(k+1));try{d=JSON.parse(c)}catch(m){}}}return d};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 d=window.location.hash;if(null==d||""==d)d="#";var k=d.lastIndexOf("#");0<k&&(d=d.substring(0,k));try{null==c||mxUtils.isEmptyObject(c)||(d=d+"#"+encodeURIComponent(JSON.stringify(c)))}catch(m){}0<k&&0<d.lastIndexOf("#")?window.location.hash=d:window.location.replace(d)}};-EditorUi.prototype.loadDescriptor=function(c,d,k){var m=window.location.hash,t=mxUtils.bind(this,function(A){var C=null!=c.data?c.data:"";null!=A&&0<A.length&&(0<C.length&&(C+="\n"),C+=A);A=new LocalFile(this,"csv"!=c.format&&0<C.length?C:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);A.getHash=function(){return m};this.fileLoaded(A);"csv"==c.format&&this.importCsv(C,mxUtils.bind(this,function(V){this.editor.undoManager.clear();this.editor.setModified(!1);-this.clearStatus()}));if(null!=c.update){var E=null!=c.interval?parseInt(c.interval):6E4,D=null,U=mxUtils.bind(this,function(){var V=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(n){V===this.currentPage&&(200<=n.getStatus()&&300>=n.getStatus()?(this.updateDiagram(n.getText()),T()):this.handleError({message:mxResources.get("error")+" "+n.getStatus()}))}),mxUtils.bind(this,function(n){this.handleError(n)}))}),T=-mxUtils.bind(this,function(){window.clearTimeout(D);D=window.setTimeout(U,E)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){T();U()}));T();U()}null!=d&&d()});if(null!=c.url&&0<c.url.length){var v=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(v,mxUtils.bind(this,function(A){t(A)}),mxUtils.bind(this,function(A){null!=k&&k(A)}))}else t("")};EditorUi.prototype.updateDiagram=function(c){function d(q){var B=new mxCellOverlay(q.image||t.warningImage,q.tooltip,q.align,q.valign,-q.offset);B.addListener(mxEvent.CLICK,function(J,Q){m.alert(q.tooltip)});return B}var k=null,m=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var t=this.editor.graph,v=t.getModel();v.beginUpdate();var A=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var C=v.getCell(c.getAttribute("id"));if(null!=C){try{var E=c.getAttribute("value");if(null!=E){var D=mxUtils.parseXml(E).documentElement;if(null!=D)if("1"==D.getAttribute("replace-value"))v.setValue(C,-D);else for(var U=D.attributes,T=0;T<U.length;T++)t.setAttributeForCell(C,U[T].nodeName,0<U[T].nodeValue.length?U[T].nodeValue:null)}}catch(q){null!=window.console&&console.log("Error in value for "+C.id+": "+q)}try{var V=c.getAttribute("style");null!=V&&t.model.setStyle(C,V)}catch(q){null!=window.console&&console.log("Error in style for "+C.id+": "+q)}try{var n=c.getAttribute("icon");if(null!=n){var u=0<n.length?JSON.parse(n):null;null!=u&&u.append||t.removeCellOverlays(C);null!=u&&t.addCellOverlay(C,-d(u))}}catch(q){null!=window.console&&console.log("Error in icon for "+C.id+": "+q)}try{var G=c.getAttribute("geometry");if(null!=G){G=JSON.parse(G);var H=t.getCellGeometry(C);if(null!=H){H=H.clone();for(key in G){var I=parseFloat(G[key]);"dx"==key?H.x+=I:"dy"==key?H.y+=I:"dw"==key?H.width+=I:"dh"==key?H.height+=I:H[key]=parseFloat(G[key])}t.model.setGeometry(C,H)}}}catch(q){null!=window.console&&console.log("Error in icon for "+C.id+": "+q)}}}else if("model"==c.nodeName){for(var g=c.firstChild;null!=-g&&g.nodeType!=mxConstants.NODETYPE_ELEMENT;)g=g.nextSibling;null!=g&&(new mxCodec(c.firstChild)).decode(g,v)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(t.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))t.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{v.endUpdate()}null!=-A&&this.chromelessResize&&this.chromelessResize(!0,A)}return k};EditorUi.prototype.getCopyFilename=function(c,d){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var m=k.lastIndexOf(".");0<=m&&(c=k.substring(m),k=k.substring(0,m));if(d){d=k;var t=new Date;k=t.getFullYear();m=t.getMonth()+1;var v=t.getDate(),A=t.getHours(),C=t.getMinutes();t=t.getSeconds();k=d+(" "+(k+"-"+m+"-"+v+"-"+A+"-"+C+"-"+t))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=-function(c,d){try{null!=c&&d&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,d,k){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[d]);var m=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var t=!1;this.hideDialog();null!=m&&(m.removeListener(this.descriptorChangedListener),this.logIfModified(m,!0),m.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var v=mxUtils.bind(this,-function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=m&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!d&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();d||("0"!=urlParams.splash?this.showSplash():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=-c)try{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.clearStatus():this.updateStatus(mxUtils.bind(this,function(){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||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));t=!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.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+A})}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(C){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(C){}}catch(C){this.fileLoadedError=C;if(null!=c)try{c.close()}catch(E){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=m?this.fileLoaded(m)||v():v()});d?c():(null!=C.fallbackFileData&&-(C.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var E=new LocalFile(this,C.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(E)})}),this.handleError(C,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else v();return t};EditorUi.prototype.getHashValueForPages=function(c,d){var k=0,m=new mxGraphModel,t=new mxCodec;null!=d&&(d.byteCount=0,d.attrCount=0,d.eltCount=0,d.nodeCount=0);for(var v=0;v<c.length;v++){this.updatePageRoot(c[v]);-var A=c[v].node.cloneNode(!1);A.removeAttribute("name");m.root=c[v].root;var C=t.encode(m);this.editor.graph.saveViewState(c[v].viewState,C,!0);C.removeAttribute("pageWidth");C.removeAttribute("pageHeight");A.appendChild(C);null!=d&&(d.eltCount+=A.getElementsByTagName("*").length,d.nodeCount+=A.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(A,function(E,D,U,T){return!T||"mxGeometry"!=E.nodeName&&"mxPoint"!=E.nodeName||"x"!=D&&"y"!=D&&"width"!=D&&"height"!=D?T&&"mxCell"==E.nodeName&&-"previous"==D?null:U:Math.round(U)},d)<<0}return k};EditorUi.prototype.hashValue=function(c,d,k){var m=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(m^=this.hashValue(c.nodeName,d,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var t=0;t<c.attributes.length;t++){var v=c.attributes[t].name,A=null!=d?d(c,v,c.attributes[t].value,!0):c.attributes[t].value;null!=A&&(m^=this.hashValue(v,-d,k)+this.hashValue(A,d,k))}}if(null!=c.childNodes)for(t=0;t<c.childNodes.length;t++)m=(m<<5)-m+this.hashValue(c.childNodes[t],d,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);d=0;null!=k&&(k.byteCount+=c.length);for(t=0;t<c.length;t++)d=(d<<5)-d+c.charCodeAt(t)<<0;m^=d}return m};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,d,k,m,t,v,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){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var d=0;d<c.length;d++)null!=c[d].xml&&"<"!=c[d].xml.charAt(0)&&-(c[d].xml=mxUtils.trim(Graph.decompress(c[d].xml)));d=mxUtils.createXmlDocument();var k=d.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(c,null,2));d.appendChild(k);return mxUtils.getXml(d,"\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 d=this.sidebar.palettes[c];-if(null!=d){for(var k=0;k<d.length;k++)d[k].parentNode.removeChild(d[k]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,d){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!d){null==c&&(d=this.sidebar.palettes["L.scratchpad"],null==d&&(d=this.sidebar.palettes.search),null!=d&&(c=d[d.length-1].nextSibling));c=null!=c?c:k.firstChild.nextSibling.nextSibling;d=k.lastChild;var m=d.previousSibling;k.insertBefore(d,c);k.insertBefore(m,-d)}};EditorUi.prototype.loadLibrary=function(c,d){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var m=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,m,k.documentElement.getAttribute("title"),d,k.documentElement.getAttribute("tags"))}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.showSearchWindow=function(c,d){var k=c?"findReplace":"find",m=k+"Window";if(null==this[m]){var t="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,v=c?t?330:300:240;this[m]=new FindWindow(this,document.body.offsetWidth-(v+20),100,v,c?t?304:288:180,c);this[m].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[m].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});-this[m].window.setVisible(!0)}else null==d&&this[m].window.setVisible(!this[m].window.isVisible());null!=d&&(this[m].doSearch(d),this[m].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,d,k,m,t){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var v=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var A=0;A<this.openLibraries.length;A++)if(this.openLibraries[A].file.getHash()==-c.getHash()){mxUtils.remove(this.openLibraries[A],this.openLibraries);break}v={file:c,images:d,title:k,expand:m};this.openLibraries.push(v)}else this.scratchpad=c;A=this.sidebar.palettes[c.getHash()];A=null!=A?A[A.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var C=null,E=mxUtils.bind(this,function(g,q){0==g.length&&c.isEditable()?(null==C&&(C=document.createElement("div"),C.className="geDropTarget",mxUtils.write(C,mxResources.get("dragElementsHere"))),q.appendChild(C)):this.addLibraryEntries(g,-q)});null!=this.sidebar&&null!=d&&this.sidebar.addEntries(d,t);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var D=this.sidebar.addPalette(c.getHash(),k,null!=m?m:!0,mxUtils.bind(this,function(g){E(d,g)}));null!=v&&(v.div=D);this.repositionLibrary(A,"L.scratchpad"!=c.getHash());m=D.parentNode.previousSibling;k=m.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&m.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var U=document.createElement("div");-U.style.backgroundColor="inherit";m.style.position="relative";var T=document.createElement("img");T.className="geLibraryButton";T.setAttribute("src",Editor.crossImage);T.setAttribute("title",mxResources.get("close"));var V=null;if(".scratchpad"!=c.title||this.closableScratchpad)U.appendChild(T),mxEvent.addListener(T,"click",mxUtils.bind(this,function(g){if(!mxEvent.isConsumed(g)){var q=mxUtils.bind(this,function(){null!=v&&mxUtils.remove(v,this.openLibraries);this.closeLibrary(c)});null!=V?this.confirm(mxResources.get("allChangesLost"),-null,q,mxResources.get("cancel"),mxResources.get("discardChanges")):q();mxEvent.consume(g)}}));if(c.isEditable()){var n=this.editor.graph,u=null;k=mxUtils.bind(this,function(g){this.showLibraryDialog(c.getTitle(),D,d,c,c.getMode());mxEvent.consume(g)});var G=mxUtils.bind(this,function(g){c.setModified(!0);c.isAutosave()?(null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u),u=T.cloneNode(!1),u.setAttribute("src",Editor.spinImage),u.setAttribute("title",mxResources.get("saving")),u.style.cursor=-"default",u.style.marginRight="2px",u.style.marginTop="-2px",U.insertBefore(u,U.firstChild),this.saveLibrary(c.getTitle(),d,c,c.getMode(),!0,!0,function(){null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u)})):null==V&&(V=T.cloneNode(!1),V.setAttribute("src",Editor.saveImage),V.setAttribute("title",mxResources.get("save")),U.insertBefore(V,U.firstChild),mxEvent.addListener(V,"click",mxUtils.bind(this,function(q){this.saveLibrary(c.getTitle(),d,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==-V||c.isModified()||(V.parentNode.removeChild(V),V=null)});mxEvent.consume(q)})))}),H=mxUtils.bind(this,function(g,q,B,J){g=n.cloneCells(mxUtils.sortCells(n.model.getTopmostCells(g)));for(var Q=0;Q<g.length;Q++){var N=n.getCellGeometry(g[Q]);null!=N&&N.translate(-q.x,-q.y)}D.appendChild(this.sidebar.createVertexTemplateFromCells(g,q.width,q.height,J||"",!0,null,!1));g=mxUtils.getXml(this.editor.graph.encodeCells(g));Editor.defaultCompressed&&(g=Graph.compress(g));q={xml:g,w:q.width,h:q.height};null!=-J&&(q.title=J);d.push(q);G(B);null!=C&&null!=C.parentNode&&0<d.length&&(C.parentNode.removeChild(C),C=null)}),I=mxUtils.bind(this,function(g){if(n.isSelectionEmpty())n.getRubberband().isActive()?(n.getRubberband().execute(g),n.getRubberband().reset()):null!=g&&mxEvent.getSource(g).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var q=n.getSelectionCells(),B=n.view.getBounds(q);if(null!=B&&0<B.width&&0<-B.height){var J=n.view.scale;B.x/=J;B.y/=J;B.width/=J;B.height/=J;B.x-=n.view.translate.x;B.y-=n.view.translate.y;H(q,B)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(g)});mxEvent.addGestureListeners(D,function(){},mxUtils.bind(this,function(g){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler.first&&(n.graphHandler.suspend(),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="hidden"),D.style.backgroundColor=-"light-dark(#fefefe, #000000)",D.style.cursor="copy",n.panningManager.stop(),n.autoScroll=!1,mxEvent.consume(g))}),mxUtils.bind(this,function(g){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler&&(D.style.backgroundColor="",D.style.cursor="default",this.sidebar.showTooltips=!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,I(g),mxEvent.consume(g))}));mxEvent.addListener(D,"mouseleave",mxUtils.bind(this,function(g){n.isMouseDown&&null!=n.graphHandler.first&&-(n.graphHandler.resume(),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="visible"),D.style.backgroundColor="",D.style.cursor="",n.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(g){D.style.backgroundColor="light-dark(#fefefe, #000000)";g.dataTransfer.dropEffect="copy";D.style.cursor="copy";this.sidebar.hideTooltip();g.stopPropagation();g.preventDefault()})),mxEvent.addListener(D,"drop",mxUtils.bind(this,function(g){D.style.cursor=-"";D.style.backgroundColor="";0<g.dataTransfer.files.length&&this.importFiles(g.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(q,B,J,Q,N,S,P,R,W){if(null!=q&&"image/"==B.substring(0,6))q="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(q),q=[new mxCell("",new mxGeometry(0,0,N,S),q)],q[0].vertex=!0,H(q,new mxRectangle(0,0,N,S),g,mxEvent.isAltDown(g)?null:P.substring(0,P.lastIndexOf(".")).replace(/_/g," ")),null!=-C&&null!=C.parentNode&&0<d.length&&(C.parentNode.removeChild(C),C=null);else{var X=!1,Y=mxUtils.bind(this,function(aa,ba){null!=aa&&"application/pdf"==ba&&(ba=Editor.extractGraphModelFromPdf(aa),null!=ba&&0<ba.length&&(aa=ba));if(null!=aa)if(aa=mxUtils.parseXml(aa),"mxlibrary"==aa.documentElement.nodeName)try{var fa=JSON.parse(mxUtils.getTextContent(aa.documentElement));E(fa,D);d=d.concat(fa);G(g);this.spinner.stop();X=!0}catch(qa){}else if("mxfile"==aa.documentElement.nodeName)try{var ia=aa.documentElement.getElementsByTagName("diagram");-for(fa=0;fa<ia.length;fa++){var ea=this.stringToCells(Editor.getDiagramNodeXml(ia[fa])),ma=this.editor.graph.getBoundingBoxFromGeometry(ea);null!=ma&&H(ea,new mxRectangle(0,0,ma.width,ma.height),g)}X=!0}catch(qa){null!=window.console&&console.log("error in drop handler:",qa)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=C&&null!=C.parentNode&&0<d.length&&(C.parentNode.removeChild(C),C=null)});null!=W&&null!=P&&EditorUi.isVisioFilename(P)?this.importVisio(W,-function(aa){Y(aa,"text/xml")},null,P):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(q,P)&&null!=W?this.isExternalDataComms()?this.parseFile(W,mxUtils.bind(this,function(aa){4==aa.readyState&&(this.spinner.stop(),200<=aa.status&&299>=aa.status?Y(aa.responseText,"text/xml"):this.handleError({message:mxResources.get(413==aa.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):-Y(q,B)}}));g.stopPropagation();g.preventDefault()})),mxEvent.addListener(D,"dragleave",function(g){D.style.cursor="";D.style.backgroundColor="";g.stopPropagation();g.preventDefault()}));T=T.cloneNode(!1);T.setAttribute("src",Editor.editImage);T.setAttribute("title",mxResources.get("edit"));U.insertBefore(T,U.firstChild);mxEvent.addListener(T,"click",k);k=T.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));U.insertBefore(k,U.firstChild);mxEvent.addListener(k,-"click",I);".scratchpad"==c.title&&(this.addSelectionToScratchpad=I);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),k.className="geLibraryButton",U.insertBefore(k,U.firstChild))}m.appendChild(U);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,d){for(var k=0;k<c.length;k++)try{var m=c[k],t=m.data;if(null!=t){t="data:"==t.substring(0,5)?this.convertDataUri(t):-t;var v="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==m.aspect&&(v+="aspect=fixed;");v=v+"image="+t+";";null!=m.style&&(v+=m.style);d.appendChild(this.sidebar.createVertexTemplate(v,m.w,m.h,"",m.title||"",!1,null,!0))}else if(null!=m.xml){var A=this.stringToCells("<"==m.xml.charAt(0)?m.xml:Graph.decompress(m.xml)),C=0==A.length?mxResources.get("drawingEmpty"):null!=m.title?m.title:"";d.appendChild(this.sidebar.createVertexTemplateFromCells(A,m.w,m.h,C,!0,null,-!0))}}catch(E){C=null!=E.message?mxResources.get("error")+": "+E.message:String(E),v=this.sidebar.createVertexTemplateFromCells(null,m.w,m.h,C,!0,null,!0),d.appendChild(v)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=-".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,d,k,m,t,v,A){c=new ImageDialog(this,c,d,k,m,t,v,A);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,d,k,m,t,v){var A=localStorage.getItem(d);c=new TextareaDialog(this,c,null!=A?JSON.stringify(JSON.parse(A),null,2):"",mxUtils.bind(this,function(C){if(null!=C)try{if(null!=v&&v(C),C==A)this.hideDialog();else{if(0<C.length){var E=-JSON.parse(C);localStorage.setItem(d,JSON.stringify(E))}else localStorage.removeItem(d);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(D){this.handleError(D)}}),null,mxResources.get("close"),null,null,null,!0,null,null,t,k,m);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,280));c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,d,k,m){c=null!=c?c:mxUtils.bind(this,function(t,v,A,C){v||(t=new ChangePageSetup(this,-m?A:null,t),t.ignoreColor=!m,null!=C&&m&&(t.shadowVisible=C),this.editor.graph.model.execute(t))});c=new BackgroundImageDialog(this,c,d,k,m);this.showDialog(c.container,400,m?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,d,k,m,t){c=new LibraryDialog(this,c,d,k,m,t);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(v){v&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var p=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=-function(c){var d=p.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&d.refresh()}));return d};EditorUi.prototype.handleError=function(c,d,k,m,t,v,A){var C=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},E=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(V){}if(null!=E||null!=d){A=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var D=mxResources.get("ok"),U=null;d=null!=d?d:mxResources.get("error");if(null!=E){null!=E.retry&&(D=mxResources.get("cancel"),U=function(){C();E.retry()});if(404==E.code||404==E.status||403==E.code){A=403==E.code?null!=E.message?mxUtils.htmlEntities(E.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),-!1):null!=t?t:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var T=null!=t?null:null!=v?v:window.location.hash;if(null!=T&&("#G"==T.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==T.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==E.code||404==E.status)){T="#U"==T.substring(0,2)?T.substring(45,T.lastIndexOf("%26ex")):T.substring(2);this.showError(d,A,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+T);null!=m&&m()}),U,mxResources.get("changeUser"),mxUtils.bind(this,function(){function V(){H.innerText="";for(var I=0;I<n.length;I++){var g=document.createElement("option");mxUtils.write(g,n[I].displayName);g.value=I;H.appendChild(g);g=document.createElement("option");-g.innerHTML=" ";mxUtils.write(g,"<"+n[I].email+">");g.setAttribute("disabled","disabled");H.appendChild(g)}g=document.createElement("option");mxUtils.write(g,mxResources.get("addAccount"));g.value=n.length;H.appendChild(g)}var n=this.drive.getUsersList(),u=document.createElement("div"),G=document.createElement("div");G.style.marginBottom="6px";mxUtils.write(G,mxResources.get("changeUser")+": ");u.appendChild(G);var H=document.createElement("select");H.style.width="100%";V();mxEvent.addListener(H,-"change",mxUtils.bind(this,function(){var I=H.value,g=n.length!=I;g&&this.drive.setUser(n[I]);this.drive.authorize(g,mxUtils.bind(this,function(){g||(n=this.drive.getUsersList(),V())}),mxUtils.bind(this,function(q){this.handleError(q)}),!0)}));u.appendChild(H);u=new CustomDialog(this,u,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(u.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),-520,150);return}}null!=E.message?A=""==E.message&&null!=E.name?mxUtils.htmlEntities(E.name,!1):mxUtils.htmlEntities(E.message,!1):null!=E.response&&null!=E.response.error?A=mxUtils.htmlEntities(E.response.error,!1):"undefined"!==typeof window.App&&(E.code==App.ERROR_TIMEOUT?A=mxUtils.htmlEntities(mxResources.get("timeout"),!1):E.code==App.ERROR_BUSY?A=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof E&&0<E.length&&(A=mxUtils.htmlEntities(E,!1)))}t=c=null;null!=E&&null!=E.helpLink?-(c=mxResources.get("help"),t=mxUtils.bind(this,function(){return this.editor.graph.openLink(E.helpLink)})):null!=E&&null!=E.ownerEmail?(c=mxResources.get("contactOwner"),A+=mxUtils.htmlEntities(" ("+c+": "+E.ownerEmail+")",!1),t=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(E.ownerEmail))})):null!=E&&null!=E.alternateAction&&(c=E.alternateAction.label,t=E.alternateAction.funct);this.showError(d,A,D,k,U,null,null,c,t,null,null,null,m?k:null)}else null!=k&&k()};EditorUi.prototype.alert=-function(c,d,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),d);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,d,k,m,t,v){c=null!=c?c:"";var A=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},C=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){A();null!=d&&d()},function(){A();null!=k&&k()},m,t,null,null,null,null,C);this.showDialog(c.container,340,46+C,!0,v);c.init()};EditorUi.prototype.showBanner=-function(c,d,k,m,t,v,A,C,E){v=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){A=null!=A?A:"translate(-50%,120%)";C=null!=C?C:"translate(-50%,0%)";var D=document.createElement("div");D.className="geBtn gePrimaryBtn geBanner"+(t?" geSmallBanner":"");D.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(D.style,"transform",A);mxUtils.setPrefixedStyle(D.style,"transition","all 1000ms ease");null!=E&&mxUtils.setPrefixedStyle(D.style,-"transform-origin",E);E=E=document.createElement("img");E.setAttribute("src",Editor.crossImage);E.setAttribute("title",mxResources.get(m?"doNotShowAgain":"close"));E.setAttribute("border","0");t||(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;",D.appendChild(v),E.style.cssText=(t?"right:6px;top:9px;":"right:10px;top:12px;")+-"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",D.appendChild(E));mxUtils.write(D,d);document.body.appendChild(D);this.bannerShowing=!0;t&&(E.className="geLibraryButton",D.appendChild(E));d=document.createElement("div");d.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var U=document.createElement("input");U.setAttribute("type","checkbox");U.setAttribute("id","geDoNotShowAgainCheckbox");-U.style.marginRight="6px";if(!m){d.appendChild(U);var T=document.createElement("label");T.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(T,mxResources.get("doNotShowAgain"));d.appendChild(T);D.style.paddingBottom=t?"16px":"30px";D.appendChild(d)}var V=mxUtils.bind(this,function(){null!=D.parentNode&&(D.parentNode.removeChild(D),this.bannerShowing=!1,U.checked||m)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});-null!=E&&mxEvent.addListener(E,"click",mxUtils.bind(this,function(u){mxEvent.consume(u);V()}));var n=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(D.style,"transform",A);window.setTimeout(mxUtils.bind(this,function(){V()}),1E3)});mxEvent.addListener(D,"click",mxUtils.bind(this,function(u){var G=mxEvent.getSource(u);G!=U&&G!=T?(null!=k&&k(),V(),mxEvent.consume(u)):n()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(D.style,"transform",C)}),500);window.setTimeout(n,-t?5E3:3E4);v=!0}return v};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,d,k,m){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=d&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(d))),0<m&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",m));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=-function(c,d,k,m,t){var v="jpeg"==k?"jpg":k;m=this.getBaseFilename(m)+(null!=d?".drawio":"")+"."+v;c=this.createImageDataUri(c,d,k,t);this.saveData(m,v,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatAnimatedGif",null,"Animated GIF"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";-c.appendChild(d);mxUtils.write(c,mxResources.get("speed",null,"Speed")+":");var k=document.createElement("select");k.style.marginLeft="4px";k.style.width="80px";var m=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(d=0;d<m.length;d++){var t=document.createElement("option");mxUtils.write(t,m[d].label);t.setAttribute("value",m[d].value);15==m[d].value&&t.setAttribute("selected","selected");-k.appendChild(t)}c.appendChild(k);mxUtils.br(c);d=document.createElement("div");d.style.marginTop="10px";mxUtils.write(d,mxResources.get("zoom")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="60px";v.style.marginLeft="4px";v.value="100%";d.appendChild(v);c.appendChild(d);d=document.createElement("div");d.style.marginTop="10px";mxUtils.write(d,mxResources.get("borderWidth",null,"Border Width")+":");var A=document.createElement("input");A.setAttribute("type",-"text");A.style.width="60px";A.style.marginLeft="4px";A.value="0";d.appendChild(A);c.appendChild(d);m=document.createElement("div");m.style.marginTop="10px";mxUtils.write(m,mxResources.get("loops",null,"Loops")+":");var C=document.createElement("select");C.style.marginLeft="4px";C.style.width="80px";var E=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(d=0;d<E.length;d++)t=document.createElement("option"),mxUtils.write(t,-E[d].label),t.setAttribute("value",E[d].value),0==E[d].value&&t.setAttribute("selected","selected"),C.appendChild(t);m.appendChild(C);c.appendChild(m);var D=this.addCheckbox(c,mxResources.get("transparentBackground",null,"Transparent Background"),!1);c=new CustomDialog(this,c,mxUtils.bind(this,function(){var U=parseInt(v.value);if(isNaN(U)||0>=U)U=100;this.exportAnimatedGif({fps:parseInt(k.value),scale:U/100,border:parseInt(A.value)||0,repeat:parseInt(C.value),transparent:D.checked,background:D.checked?-null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"#ffffff"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,300,260,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(d){this.spinner.stop();if(null!=d){var k=-this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(d,k);else{var m=document.createElement("a");m.href=URL.createObjectURL(d);m.download=k;document.body.appendChild(m);m.click();setTimeout(function(){document.body.removeChild(m);URL.revokeObjectURL(m.href)},0)}}}),mxUtils.bind(this,function(d){this.spinner.stop();this.handleError(d)}))}catch(d){this.spinner.stop(),this.handleError(d)}};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,d){c=new TextareaDialog(this,c,d,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,d,k,m,t,v){"text/xml"!=-k||/(\.drawio)$/i.test(d)||/(\.xml)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.html)$/i.test(d)||(d=d+"."+(null!=v?v:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=m?this.base64ToBlob(c,k):new Blob([c],{type:k}),navigator.msSaveOrOpenBlob(c,d);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,d),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=-k.substring(0,6)?this.showTextDialog(d+":",c):this.openInNewWindow(c,k,m);else{var A=document.createElement("a");v=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof A.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var C=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);v=65==(C?parseInt(C[2],10):!1)?!1:v}if(v||this.isOffline()){A.href=URL.createObjectURL(m?this.base64ToBlob(c,k):new Blob([c],{type:k}));v?A.download=d:A.setAttribute("target",-"_blank");document.body.appendChild(A);try{window.setTimeout(function(){URL.revokeObjectURL(A.href)},2E4),A.click(),A.parentNode.removeChild(A)}catch(E){}}else this.createEchoRequest(c,d,k,m,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,d,k,m,t,v){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=k?"&mime="+k:"")+(null!=t?"&format="+t:"")+(null!=v?"&base64="+v:"")+(null!=d?"&filename="+encodeURIComponent(d):"")+(m?"&binary=1":""))};EditorUi.prototype.saveLocalFile=-function(c,d,k,m,t,v,A,C,E){v=null!=v?v:!1;A=null!=A?A:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);var D=mxUtils.bind(this,function(T,V,n,u){try{if("_blank"==V)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,m);else if(null!=k&&"text/html"==k.substring(0,9)){var G=new EmbedDialog(this,c);this.showDialog(G.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));G.init()}else{var H=window.open("about:blank");null==H?mxUtils.popup(c,!0):(H.document.write("<pre>"+mxUtils.htmlEntities(c,-!1)+"</pre>"),H.document.close())}else if(V==App.MODE_DEVICE||"download"==V)this.doSaveLocalFile(c,T,k,m,null,C);else if(null!=T&&0<T.length){var I=mxUtils.bind(this,function(g){try{this.exportFile(c,T,k,m,V,g)}catch(q){this.handleError(q)}});null!=u?I(u):this.pickFolder(V,I)}}catch(g){this.handleError(g)}});t=[];v||t.push(App.MODE_BROWSER);A||t.push("_blank");var U=new SaveDialog(this,d,mxUtils.bind(this,function(T,V,n){D(T.value,V,T,n);this.hideDialog(null,null,U.container)}),t,c,k,m,E);this.showDialog(U.container,-420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));U.init()};EditorUi.prototype.openInNewWindow=function(c,d,k){var m=window.open("about:blank");if(null==m||null==m.document)mxUtils.popup(c,!0);else{var t="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==d){var v=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=v&&(t="background: "+v+";")}t='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+t+'">';"image/svg+xml"!=-d||mxClient.IS_SVG?"image/svg+xml"!=d||k?(v=k?c:btoa(unescape(encodeURIComponent(c))),m.document.write(t+'<img style="max-width:100%;" src="data:'+d+";base64,"+v+'"/></body></html>')):m.document.write(t+c+"</body></html>"):m.document.write(t+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");m.document.close()}};var f=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 d=c(mxUtils.bind(this,function(m){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.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=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),-this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var t=d.getBoundingClientRect();this.tagsDialog.style.left=t.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";t=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=-t.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(m)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var m=this.editor.graph.getAllTags();d.style.display=0<m.length?"":"none"}))}f.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),-this.layersDialog=null)}));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.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()&&"1"!=urlParams.noExport){this.exportDialog=null;var k=c(mxUtils.bind(this,function(m){var t=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",-t);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)t.apply(this);else{this.exportDialog=document.createElement("div");var v=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=v.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";v=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=v.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",t);this.editor.exportToCanvas(mxUtils.bind(this,function(C){A.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var E=this.createImageDataUri(C,null,"png");C=document.createElement("img");-C.style.maxWidth="140px";C.style.maxHeight="140px";C.style.cursor="pointer";C.style.backgroundColor="white";C.setAttribute("title",mxResources.get("openInNewWindow"));C.setAttribute("border","0");C.setAttribute("src",E);this.exportDialog.appendChild(C);mxEvent.addListener(C,"click",mxUtils.bind(this,function(){this.openInNewWindow(E.substring(E.indexOf(",")+1),"image/png",!0);t.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(C){A.stop();null!=this.exportDialog&&-null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(C)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(m)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,d,k,m,t,v){this.isLocalFileSave()?this.saveLocalFile(k,c,m,t,d,v):this.saveRequest(c,d,mxUtils.bind(this,function(A,C){return this.createEchoRequest(k,A,m,t,d,C)}),k,t,m)};EditorUi.prototype.saveRequest=-function(c,d,k,m,t,v,A){A=null!=A?A:!mxClient.IS_IOS||!navigator.standalone;var C=mxUtils.bind(this,function(D,U,T,V){if("_blank"==U||null!=D&&0<D.length){var n=k("_blank"==U?null:D,U==App.MODE_DEVICE||"download"==U||null==U||"_blank"==U?"0":"1");null!=n&&(U==App.MODE_DEVICE||"download"==U||"_blank"==U?n.simulate(document,"_blank"):(T=mxUtils.bind(this,function(u){v=null!=v?v:"pdf"==d?"application/pdf":"image/"+d;if(null!=m)try{this.exportFile(m,D,v,!0,U,u)}catch(G){this.handleError(G)}else this.spinner.spin(document.body,-mxResources.get("saving"))&&n.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=n.getStatus()&&299>=n.getStatus())try{this.exportFile(n.getText(),D,v,!0,U,u)}catch(G){this.handleError(G)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(G){this.spinner.stop();this.handleError(G)}))}),null!=V?T(V):this.pickFolder(U,T)))}});t=[App.MODE_BROWSER];A||t.push("_blank");var E=new SaveDialog(this,c,mxUtils.bind(this,function(D,U,T){C(D.value,U,D,T);-this.hideDialog(null,null,E.container)}),t,null,"application/pdf");this.showDialog(E.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));E.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,d,k,m,t,v){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=-function(c,d,k){d(null)};EditorUi.prototype.exportSvg=function(c,d,k,m,t,v,A,C,E,D,U,T,V,n){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(Y){Editor.addRetryToError(Y,mxUtils.bind(this,function(){this.exportSvg(c,d,k,m,t,v,A,C,E,D,U,T,V,n)}));this.handleError(Y)})))try{var u=this.editor.graph.isSelectionEmpty();k=null!=k?k:u;var G=d?null:this.editor.graph.background;G==mxConstants.NONE&&(G=null);null==G&&0==d&&(G=this.editor.graph.shapeBackgroundColor);-var H=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var I=mxUtils.lightDarkColorSupported,g=mxUtils.preferDarkColor;if("light"==U||"dark"==U)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==U;var q=Graph.addFont,B={};Graph.addFont=function(Y,aa,ba,fa){q.call(this,Y,aa,ba,B)};var J=this.editor.graph.createSvgImageExport(t),Q=J.drawCellState;J.drawCellState=function(Y,aa){null!=Y&&Graph.processFontStyle(Y.style);-Q.apply(this,arguments)};var N=this.editor.graph.getSvg(G,c,A,C,null,k,null,J,"blank"==D?"_blank":"self"==D?"_top":null,null,!V,U,T);mxUtils.lightDarkColorSupported=I;mxUtils.preferDarkColor=g;this.editor.graph.addForeignObjectWarning=H;m&&this.editor.graph.addSvgShadow(N);var S=this.getBaseFilename()+(t?".drawio":"")+".svg";n=null!=n?n:mxUtils.bind(this,function(Y){this.isLocalFileSave()||Y.length<=MAX_REQUEST_SIZE?this.saveData(S,"svg",Y,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Y)}))});var P=mxUtils.bind(this,function(Y){this.spinner.stop();t&&Y.setAttribute("content",this.getFileData(!0,null,null,null,k,E,null,null,null,null,null,c,A));n(Graph.xmlDeclaration+"\n"+(t?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(Y))});this.editor.graph.mathEnabled&&this.editor.addMathCss(N);var R=mxUtils.bind(this,function(Y){Editor.replaceSvgDataUris&&v&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&-V?this.replaceAlternateContent(Y,U,P):P(Y)}),W=Graph.customFontElements;Graph.customFontElements=B;var X=mxUtils.bind(this,function(Y){Graph.customFontElements=W;Graph.addFont=q;v&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(Y,R,this.thumbImageCache)):R(Y)});V?this.embedFonts(N,X):(this.editor.addFontCss(N),X(N))}catch(Y){this.handleError(Y)}};EditorUi.prototype.replaceAlternateContent=function(c,d,k){function m(T,V,n,-u,G){var H=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");H.setAttribute("x",V);H.setAttribute("y",n+.5);H.setAttribute("width",u.width);H.setAttribute("height",u.height);null==H.setAttributeNS?H.setAttribute("xlink:href",G):H.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",G);T.replaceChild(H,T.lastChild);C()}function t(){if(A<U.length)U[A++](t)}var v="";d=c.getElementsByTagName("style");for(var A=0;A<d.length;A++)v+=d[A].innerHTML;d=c.getElementsByTagName("switch");counter=-d.length;var C=mxUtils.bind(this,function(){counter--;0==counter&&k(c)}),E={},D={},U=[];for(A=0;A<d.length;A++)mxUtils.bind(this,function(T){var V=T.getElementsByTagName("div");if(0<V.length)try{var n=V[0].cloneNode(!0),u=parseInt(n.style.marginLeft),G=parseInt(n.style.paddingTop),H=n.getElementsByTagName("div")[1],I=V=!1,g=n.style.alignItems,q=n.style.justifyContent;if(null!=n.style.writingMode){var B=n.style.writingMode;I="vertical-"==B.substring(0,9);V="-rl"==B.substring(B.length-3)}var J=!I&&-"1px"==n.style.width||I&&"1px"==n.style.height;if(!I&&"1px"==n.style.height||I&&"1px"==n.style.width)n.style.alignItems=I&&V?"unsafe flex-end":"unsafe flex-start";J&&(n.style.justifyContent="unsafe flex-start");n.style.paddingTop="";n.style.marginLeft="";var Q=n.outerHTML,N=E[Q];null==N&&(n.style.position="absolute",n.style.visibility="hidden",document.body.appendChild(n),B=1,B="1px"==n.style.width?H.offsetWidth:parseInt(n.style.width),J=1,J="1px"==n.style.height?H.offsetHeight:parseInt(n.style.height),-document.body.removeChild(n),N=new mxRectangle(u,G,B,J),E[Q]=N);"1px"==n.style.height&&("unsafe center"==g?G-=N.height/2:"unsafe flex-end"==g&&(G-=N.height));if("1px"==n.style.width)if(!I&&"unsafe center"==q||I&&"unsafe center"==g)u-=N.width/2;else if(!I&&"unsafe flex-end"==q||I&&(!V&&"unsafe flex-end"==g||V&&"unsafe flex-start"==g))u-=N.width;N=new mxRectangle(u,G,N.width,N.height+parseInt(H.style.fontSize)/4);U.push(mxUtils.bind(this,function(S){var P=D[Q];null==P?Graph.htmlToPng(Q,N.width,N.height,-mxUtils.bind(this,function(R){m(T,u,G,N,R);D[Q]=R;S()}),v):(m(T,u,G,N,P),S())}))}catch(S){C()}else C()})(d[A]);0==counter&&k(c);A=0;t()};EditorUi.prototype.addRadiobox=function(c,d,k,m,t,v,A){return this.addCheckbox(c,k,m,t,v,A,!0,d)};EditorUi.prototype.addCheckbox=function(c,d,k,m,t,v,A,C){v=null!=v?v:!0;var E=document.createElement("input");E.style.marginRight="8px";E.style.marginTop="16px";E.setAttribute("type",A?"radio":"checkbox");A="geCheckbox-"+Editor.guid();E.id=A;null!=C&&E.setAttribute("name",-C);k&&(E.setAttribute("checked","checked"),E.defaultChecked=!0);m&&E.setAttribute("disabled","disabled");v&&(c.appendChild(E),k=document.createElement("label"),mxUtils.write(k,d),k.setAttribute("for",A),c.appendChild(k),t||mxUtils.br(c));return E};EditorUi.prototype.addEditButton=function(c,d){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var m=this.getCurrentFile(),t="";null!=m&&m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER&&(t=window.location.href);-var v=document.createElement("select");v.style.maxWidth="200px";v.style.width="auto";v.style.marginLeft="8px";v.style.marginRight="10px";v.className="geBtn";m=document.createElement("option");m.setAttribute("value","blank");mxUtils.write(m,mxResources.get("makeCopy"));v.appendChild(m);var A=document.createElement("option");A.setAttribute("value","custom");mxUtils.write(A,mxResources.get("custom")+"...");v.appendChild(A);c.appendChild(v);mxEvent.addListener(v,"change",mxUtils.bind(this,function(){if("custom"==-v.value){var C=new FilenameDialog(this,t,mxResources.get("ok"),function(E){null!=E?(t=E,A.setAttribute("title",E)):(v.value="blank",A.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){v.value="blank"});this.showDialog(C.container,300,80,!0,!1);C.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==d||d.checked)?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?-"blank"===v.value?"_blank":t:null},getEditInput:function(){return k},getEditSelect:function(){return v}}};EditorUi.prototype.addLinkSection=function(c,d){function k(){var C=document.createElement("div");C.style.width="100%";C.style.height="100%";C.style.boxSizing="border-box";null!=v&&v!=mxConstants.NONE?(C.style.border="1px solid black",C.style.backgroundColor=v):(C.style.backgroundPosition="center center",C.style.backgroundRepeat="no-repeat",C.style.backgroundImage="url('"+Dialog.prototype.closeImage+-"')");A.innerText="";A.appendChild(C)}mxUtils.write(c,mxResources.get("links")+":");var m=document.createElement("select");m.style.width="100px";m.style.padding="0px";m.style.marginLeft="8px";m.style.marginRight="10px";m.className="geBtn";var t=document.createElement("option");t.setAttribute("value","auto");mxUtils.write(t,mxResources.get("automatic"));m.appendChild(t);t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("openInNewWindow"));m.appendChild(t);-t=document.createElement("option");t.setAttribute("value","self");mxUtils.write(t,mxResources.get("openInThisWindow"));m.appendChild(t);d&&(d=document.createElement("option"),d.setAttribute("value","frame"),mxUtils.write(d,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),m.appendChild(d));c.appendChild(m);mxUtils.write(c,mxResources.get("borderColor")+":");var v="#0000ff",A=null;A=mxUtils.button("",mxUtils.bind(this,function(C){this.pickColor(v||"none",function(E){v=E;k()});-mxEvent.consume(C)}));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 v},getTarget:function(){return m.value},focus:function(){m.focus()}}};EditorUi.prototype.createUrlParameters=function(c,d,k,m,t,v){v=null!=v?v:[];k&&(v.push("lightbox=1"),-"auto"!=c&&v.push("target="+c),null!=d&&d!=mxConstants.NONE&&v.push("highlight="+("#"==d.charAt(0)?d.substring(1):d)),null!=m&&0<m.length&&v.push("edit="+encodeURIComponent(m)),t&&v.push("layers=1"),this.editor.graph.foldingEnabled&&v.push("nav=1"));return v};EditorUi.prototype.createLink=function(c,d,k,m,t,v,A,C,E,D,U,T,V){var n=this.getCurrentFile();E=this.createUrlParameters(c,d,m,t,v,E);c=!0;null!=A?k="#U"+encodeURIComponent(A):C||null==n||""==n.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="#"+n.getHash(),c=!1);c&&null!=n&&null!=n.getTitle()&&n.getTitle()!=this.defaultFilename&&E.push("title="+encodeURIComponent(n.getTitle()));D&&1<k.length&&(E.push("open="+k.substring(1)),k="");U&&null!=this.currentPage&&E.push("page-id="+this.currentPage.getId());T&&E.push("transparent=1");null!=V&&E.push("dark="+V);return(m&&(null!=A||null!=n&&n.getMode()!=App.MODE_GITHUB&&n.getMode()!=App.MODE_GITLAB)?-EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<E.length?"?"+E.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,d,k,m,t,v,A,C,E,D,U,T,V){this.getBasenames();var n={};""!=t&&t!=mxConstants.NONE&&(n.highlight=t);"auto"!==m&&(n.target=m);D||(n.lightbox=!1);n.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(n.zoom=k/100);k=[];A&&(k.push("pages"),-n.resize=!0,null!=this.pages&&null!=this.currentPage&&(n.page=mxUtils.indexOf(this.pages,this.currentPage)));d&&(k.push("zoom"),n.resize=!0);C&&k.push("layers");E&&k.push("tags");null!=V&&(n["dark-mode"]=V);0<k.length&&(D&&k.push("lightbox"),n.toolbar=k.join(" "));null!=U&&0<U.length&&(n.edit=U);null!=c?n.url=c:n.xml=this.getFileData(!0,null,null,null,null,!A);d='<div class="mxgraph" style="'+(v?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(n))+-'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";T(d,'<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,d,k,m){var t=document.createElement("div");t.style.whiteSpace=-"nowrap";var v=document.createElement("h3");mxUtils.write(v,mxResources.get("html"));v.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";t.appendChild(v);var A=document.createElement("div");A.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var C=document.createElement("input");C.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";C.setAttribute("value","url");C.setAttribute("type","radio");C.setAttribute("name","type-embedhtmldialog");-v=C.cloneNode(!0);v.setAttribute("value","copy");A.appendChild(v);var E=document.createElement("span");mxUtils.write(E,mxResources.get("includeCopyOfMyDiagram"));A.appendChild(E);mxUtils.br(A);A.appendChild(C);E=document.createElement("span");mxUtils.write(E,mxResources.get("publicDiagramUrl"));A.appendChild(E);var D=this.getCurrentFile();null==k&&null!=D&&D.constructor==window.DriveFile&&(E=document.createElement("a"),E.style.paddingLeft="12px",E.style.color="gray",E.style.cursor="pointer",mxUtils.write(E,-mxResources.get("share")),A.appendChild(E),mxEvent.addListener(E,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(D.getId(),D)})));v.setAttribute("checked","checked");null==k&&C.setAttribute("disabled","disabled");t.appendChild(A);A=380;var U=this.addLinkSection(t),T=document.createElement("select");T.style.maxWidth="260px";T.style.marginLeft="8px";T.style.marginTop="16px";E=document.createElement("option");E.setAttribute("value","light");mxUtils.write(E,mxResources.get("light"));-T.appendChild(E);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,mxResources.get("dark"));T.appendChild(E);E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));E.setAttribute("selected","selected");T.appendChild(E);E.setAttribute("selected","selected");mxUtils.write(t,mxResources.get("appearance")+":");t.appendChild(T);mxUtils.br(t);A+=26;var V=this.addCheckbox(t,mxResources.get("zoom"),!0,null,!0);mxUtils.write(t,-":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value="100%";t.appendChild(n);var u=this.addCheckbox(t,mxResources.get("fit"),!0);E=null!=this.pages&&1<this.pages.length;var G=G=this.addCheckbox(t,mxResources.get("allPages"),E,!E),H=this.addCheckbox(t,mxResources.get("layers"),!0),I=this.addCheckbox(t,mxResources.get("tags"),!0),g=this.addCheckbox(t,mxResources.get("lightbox"),-!0),q=null;if(EditorUi.enableHtmlEditOption){q=this.addEditButton(t,g);var B=q.getEditInput();B.style.marginBottom="16px";A+=50;mxEvent.addListener(g,"change",function(){g.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&g.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,t,mxUtils.bind(this,function(){m(C.checked?k:null,V.checked,n.value,U.getTarget(),U.getColor(),u.checked,G.checked,-H.checked,I.checked,g.checked,null!=q?q.getLink():null,null!=T?T.value:null)}),null,c,d);this.showDialog(c.container,340,A,!0,!0);v.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,d,k,m,t,v,A,C,E,D,U,T){var V=document.createElement("div");V.style.whiteSpace="nowrap";var n=document.createElement("h3");mxUtils.write(n,c||mxResources.get("publish"));n.style.width="100%";n.style.textAlign="center";n.style.marginTop="2px";n.style.marginBottom="20px";V.appendChild(n);var u=document.createElement("select");-c=30;u.className="geBtn";u.style.marginBottom="8px";u.style.marginLeft="0px";u.style.width="100%";u.style.boxSizing="border-box";if(null==C||""==C.getHash())t=null!=t?t:"https://www.drawio.com/doc/faq/publish-diagram-as-link",n=document.createElement("option"),mxUtils.write(n,mxResources.get("makeCopy")),n.setAttribute("value","copy"),u.appendChild(n);n=document.createElement("option");mxUtils.write(n,mxResources.get("authorizationRequired"));n.setAttribute("value","auth");u.appendChild(n);null!=-C&&""!=C.getHash()||n.setAttribute("disabled","disabled");C=document.createElement("option");C.setAttribute("value","public");u.appendChild(C);null!=A?(mxUtils.write(C,mxResources.get("publicDiagramUrl")),C.setAttribute("title",A),u.value="public"):(mxUtils.write(C,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),C.setAttribute("disabled","disabled"));V.appendChild(u);mxUtils.br(V);u.focus();var G=null,H=null;if(null!=d||null!=k)c+=30,mxUtils.write(V,mxResources.get("width")+-":"),G=document.createElement("input"),G.setAttribute("type","text"),G.style.marginRight="16px",G.style.width="50px",G.style.marginLeft="6px",G.style.marginRight="16px",G.style.marginBottom="10px",G.value="100%",V.appendChild(G),mxUtils.write(V,mxResources.get("height")+":"),H=document.createElement("input"),H.setAttribute("type","text"),H.style.width="50px",H.style.marginLeft="6px",H.style.marginBottom="10px",H.value=k+"px",V.appendChild(H),mxUtils.br(V);var I=this.addLinkSection(V,m),g=D?this.addCheckbox(V,-mxResources.get("transparentBackground"),!1):null;null!=g&&(c+=20);var q=document.createElement("select");q.className="geBtn";q.style.marginTop="8px";d=document.createElement("option");mxUtils.write(d,mxResources.get("allPages"));d.setAttribute("value","allPages");q.appendChild(d);d=document.createElement("option");mxUtils.write(d,mxResources.get("currentPage"));d.setAttribute("value","currentPage");q.appendChild(d);var B=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&-(c+=30,d=null!=this.currentPage?this.currentPage.getName():"",16<d.length&&(d=d.substring(0,16)+"..."),T&&(mxUtils.write(V,mxResources.get("pages")+":"),V.appendChild(q),mxUtils.br(V),c+=30),B=this.addCheckbox(V,mxResources.get("selectedPage")+": "+d));var J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft="8px";J.style.marginTop="16px";T=document.createElement("option");T.setAttribute("value","0");mxUtils.write(T,mxResources.get("light"));J.appendChild(T);T=document.createElement("option");-T.setAttribute("value","1");mxUtils.write(T,mxResources.get("dark"));J.appendChild(T);T=document.createElement("option");T.setAttribute("value","auto");mxUtils.write(T,mxResources.get("automatic"));T.setAttribute("selected","selected");J.appendChild(T);U&&(mxUtils.write(V,mxResources.get("appearance")+":"),V.appendChild(J),mxUtils.br(V),c+=30);var Q=this.addCheckbox(V,mxResources.get("lightbox"),!0,null,null,!m),N=this.addEditButton(V,Q),S=N.getEditInput();m&&(S.style.marginLeft=Q.style.marginLeft,-Q.style.display="none",c-=20);var P=this.addCheckbox(V,mxResources.get("layers"),!0);P.style.marginLeft=S.style.marginLeft;P.style.marginTop="8px";var R=this.addCheckbox(V,mxResources.get("tags"),!0);R.style.marginLeft=S.style.marginLeft;R.style.marginBottom="16px";R.style.marginTop="16px";mxEvent.addListener(Q,"change",function(){Q.checked?(P.removeAttribute("disabled"),S.removeAttribute("disabled"),R.removeAttribute("disabled")):(P.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),-R.setAttribute("disabled","disabled"));S.checked&&Q.checked?N.getEditSelect().removeAttribute("disabled"):N.getEditSelect().setAttribute("disabled","disabled")});m=new CustomDialog(this,V,mxUtils.bind(this,function(){E(I.getTarget(),I.getColor(),null==B?!1:B.checked,Q.checked,N.getLink(),P.checked,null!=G?G.value:null,null!=H?H.value:null,R.checked,u.value,null!=g?g.checked:!1,J.value,"allPages"==q.value)}),null,mxResources.get("create"),t,v);this.showDialog(m.container,340,296+c,!0,!0);null!=G?(G.focus(),-mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)):null==u.parentNode;I.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,d,k,m,t){var v=document.createElement("div");v.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:"+(t?"10":"4")+"px";v.appendChild(A);if(t){mxUtils.write(v,mxResources.get("zoom")+-":");var C=document.createElement("input");C.setAttribute("type","text");C.style.marginRight="16px";C.style.width="60px";C.style.marginLeft="4px";C.style.marginRight="12px";C.value=this.lastExportZoom||"100%";v.appendChild(C);mxUtils.write(v,mxResources.get("borderWidth")+":");var E=document.createElement("input");E.setAttribute("type","text");E.style.marginRight="16px";E.style.width="60px";E.style.marginLeft="4px";E.value=this.lastExportBorder||"0";v.appendChild(E);mxUtils.br(v)}var D=this.addCheckbox(v,-mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),U=m?null:this.addCheckbox(v,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);A=this.editor.graph;var T=m?null:this.addCheckbox(v,mxResources.get("transparentBackground"),A.background==mxConstants.NONE||null==A.background);null!=T&&(T.style.marginBottom="16px");c=new CustomDialog(this,v,mxUtils.bind(this,function(){var V=parseInt(C.value)/100||1,n=parseInt(E.value)||0;k(!D.checked,null!=U?U.checked:!1,-null!=T?T.checked:!1,V,n)}),null,c,d);this.showDialog(c.container,300,(t?25:0)+(m?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,d,k,m,t,v,A,C,E){A=null!=A?A:Editor.defaultIncludeDiagram;var D=document.createElement("div");D.style.whiteSpace="nowrap";var U=this.editor.graph,T="jpeg"==C||"webp"==C?220:320,V=document.createElement("h3");mxUtils.write(V,c);V.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";D.appendChild(V);mxUtils.write(D,mxResources.get("zoom")+-":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";D.appendChild(n);mxUtils.write(D,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";D.appendChild(u);mxUtils.br(D);var G=this.addCheckbox(D,-mxResources.get("selectionOnly"),!1,U.isSelectionEmpty()),H=document.createElement("input");H.style.marginTop="16px";H.style.marginRight="8px";H.style.marginLeft="24px";H.setAttribute("disabled","disabled");H.setAttribute("type","checkbox");var I=document.createElement("select");I.style.marginTop="16px";I.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(V=0;V<c.length;V++)if(!U.isSelectionEmpty()||"selectionOnly"!=c[V]){var g=document.createElement("option");mxUtils.write(g,mxResources.get(c[V]));-g.setAttribute("value",c[V]);I.appendChild(g)}E?(mxUtils.write(D,mxResources.get("size")+":"),D.appendChild(I),mxUtils.br(D),T+=26,mxEvent.addListener(I,"change",function(){"selectionOnly"==I.value&&(G.checked=!0)})):v&&(D.appendChild(H),mxUtils.write(D,mxResources.get("crop")),mxUtils.br(D),T+=30,mxEvent.addListener(G,"change",function(){G.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")}));U.isSelectionEmpty()?E&&(G.style.display="none",G.nextSibling.style.display="none",-G.nextSibling.nextSibling.style.display="none",T-=30):(I.value="diagram",H.setAttribute("checked","checked"),H.defaultChecked=!0,mxEvent.addListener(G,"change",function(){I.value=G.checked?"selectionOnly":"diagram"}));var q=this.addCheckbox(D,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=C&&"webp"!=C),B=document.createElement("select");B.style.maxWidth="260px";B.style.marginLeft="8px";B.style.marginTop="16px";v=document.createElement("option");v.setAttribute("value","light");mxUtils.write(v,-mxResources.get("light"));B.appendChild(v);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,mxResources.get("dark"));B.appendChild(E);"svg"==C&&mxUtils.lightDarkColorSupported?(v=document.createElement("option"),v.setAttribute("value","auto"),mxUtils.write(v,mxResources.get("automatic")),v.setAttribute("selected","selected"),B.appendChild(v)):Editor.isDarkMode()?E.setAttribute("selected","selected"):v.setAttribute("selected","selected");mxUtils.write(D,mxResources.get("appearance")+-":");D.appendChild(B);mxUtils.br(D);T+=26;var J=this.addCheckbox(D,mxResources.get("shadow"),U.shadowVisible),Q=null;if("png"==C||"jpeg"==C||"webp"==C)Q=this.addCheckbox(D,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),T+=30;U=null!=this.pages?this.pages.length:1;var N=this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram")+(1<U?":":""),A,null,null,"jpeg"!=C&&"webp"!=C),S=document.createElement("select");S.style.maxWidth="260px";S.style.marginLeft="28px";"png"==C||-"svg"==C?(A=function(){N.checked?S.removeAttribute("disabled"):S.setAttribute("disabled","disabled")},v=document.createElement("option"),v.setAttribute("value","allPages"),mxUtils.write(v,mxResources.get("allPages")),S.appendChild(v),v=document.createElement("option"),v.setAttribute("value","currentPage"),mxUtils.write(v,mxResources.get("currentPage")),S.appendChild(v),1<U?(N.style.marginBottom="12px",S.style.marginBottom="16px",D.appendChild(S),mxUtils.br(D),T+=20):N.style.marginBottom="16px",null!=-this.lastEmbedInclude&&(S.value=this.lastEmbedInclude),mxEvent.addListener(N,"change",A),A()):N.style.marginBottom="16px";var P=document.createElement("input");P.style.marginBottom="16px";P.style.marginRight="8px";P.setAttribute("type","checkbox");P.id="geCheckbox-"+Editor.guid();var R=document.createElement("input");R.style.marginBottom="16px";R.style.marginRight="8px";R.setAttribute("type","checkbox");R.id="geCheckbox-"+Editor.guid();d&&(P.checked=null!=this.lastEmbedImages?this.lastEmbedImages:-!0,D.appendChild(P),A=document.createElement("label"),mxUtils.write(A,mxResources.get("embedImages")),A.setAttribute("for",P.id),D.appendChild(A),mxUtils.br(D),R.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,D.appendChild(R),A=document.createElement("label"),mxUtils.write(A,mxResources.get("embedFonts")),A.setAttribute("for",R.id),D.appendChild(A),mxUtils.br(D),T+=50);var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";v=document.createElement("option");-v.setAttribute("value","auto");mxUtils.write(v,mxResources.get("automatic"));W.appendChild(v);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"==C&&(mxUtils.write(D,-mxResources.get("links")+":"),D.appendChild(W),D.appendChild(A),mxUtils.br(D),mxUtils.br(D),T+=50);k=new CustomDialog(this,D,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=n.value;this.lastEmbedImages=P.checked;this.lastEmbedFonts=R.checked;this.lastEmbedInclude=S.value;t(n.value,q.checked,!G.checked,J.checked,N.checked,P.checked&&d,u.value,H.checked,("png"==C||"svg"==C)&&"currentPage"==S.value,W.value,null!=Q?Q.checked:null,null!=B?B.value:null,I.value,R.checked)}),-null,k,m);this.showDialog(k.container,340,T,!0,!0,null,null,null,null,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,d,k,m,t){var v=document.createElement("div");v.style.whiteSpace="nowrap";var A=this.editor.graph;if(null!=d){var C=document.createElement("h3");mxUtils.write(C,d);C.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";v.appendChild(C)}var E=-this.addCheckbox(v,mxResources.get("fit"),!0),D=this.addCheckbox(v,mxResources.get("shadow"),A.shadowVisible&&m,!m),U=this.addCheckbox(v,k),T=this.addCheckbox(v,mxResources.get("lightbox"),!0),V=this.addEditButton(v,T),n=V.getEditInput(),u=1<A.model.getChildCount(A.model.getRoot()),G=this.addCheckbox(v,mxResources.get("layers"),u,!u);G.style.marginLeft=n.style.marginLeft;G.style.marginBottom="12px";G.style.marginTop="8px";mxEvent.addListener(T,"change",function(){T.checked?(u&&G.removeAttribute("disabled"),-n.removeAttribute("disabled")):(G.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled"));n.checked&&T.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled","disabled")});d=new CustomDialog(this,v,mxUtils.bind(this,function(){c(E.checked,D.checked,U.checked,T.checked,V.getLink(),G.checked)}),null,mxResources.get("embed"),t);this.showDialog(d.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,d,k,m,t,v,A,C){function E(n){var u=-" ",G="";m&&(u=" 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:"")+(t?"&edit=_blank":"")+(v?"&layers=1":"")+"');}})(this);\"",G+="cursor:pointer;");c&&(G+="max-width:100%;");var H=-"";k&&(H=' width="'+Math.round(D.width)+'" height="'+Math.round(D.height)+'"');A('<img src="'+n+'"'+H+(""!=G?' style="'+G+'"':"")+u+"/>")}var D=this.editor.graph.getGraphBounds(),U=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(n){var u=m?this.getFileData(!0):null;n=this.createImageDataUri(n,u,"png");E(n)}),null,null,null,mxUtils.bind(this,function(n){C({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,d,null,null,-Editor.defaultBorder);else if(d=this.getFileData(!0),D.width*D.height<=MAX_AREA&&d.length<=MAX_REQUEST_SIZE){var T="";k&&(T="&w="+Math.round(2*D.width)+"&h="+Math.round(2*D.height));var V=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(m?"1":"0")+T+"&xml="+encodeURIComponent(d));V.send(mxUtils.bind(this,function(){200<=V.getStatus()&&299>=V.getStatus()?E("data:image/png;base64,"+V.getText()):C({message:mxResources.get("unknownError")})}))}else C({message:mxResources.get("drawingTooLarge")})};-EditorUi.prototype.createEmbedSvg=function(c,d,k,m,t,v,A){var C=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),E=C.getElementsByTagName("a");if(null!=E)for(var D=0;D<E.length;D++){var U=E[D].getAttribute("href");null!=U&&"#"==U.charAt(0)&&"_blank"==E[D].getAttribute("target")&&E[D].removeAttribute("target")}m&&C.setAttribute("content",this.getFileData(!0));d&&this.editor.graph.addSvgShadow(C);if(k){var T=" ",V="";m&&(T="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"+(t?"&edit=_blank":"")+(v?"&layers=1":"")+"');}})(this);\"",V+="cursor:pointer;");c&&(V+="max-width:100%;");this.editor.convertImages(C,mxUtils.bind(this,function(n){A('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(n))+'"'+(""!=V?' style="'+V+'"':"")+T+"/>")}))}else V="",m&&(d=this.getSelectedPageIndex(),C.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=d?"&page="+d:"")+(t?"&edit=_blank":"")+(v?"&layers=1":"")+"');}}})(this);"),V+="cursor:pointer;"),c&&(c=parseInt(C.getAttribute("width")),t=parseInt(C.getAttribute("height")),C.setAttribute("viewBox","-0.5 -0.5 "+c+" "+t),V+="max-width:100%;max-height:"+t+"px;",C.removeAttribute("height")),""!=V&&C.setAttribute("style",V),this.editor.addFontCss(C),this.editor.graph.mathEnabled&&this.editor.addMathCss(C),A(mxUtils.getXml(C))};EditorUi.prototype.timeSince=function(c){c=+this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var A=decodeURIComponent(urlParams["layer-ids"]).split(" ");d={};for(u=0;u<A.length;u++)d[A[u]]=!0;var B=this.editor.graph.getModel(),D=B.getChildren(B.root);for(u=0;u<D.length;u++){var N=D[u];B.setVisible(N,d[N.id]||!1)}}catch(F){}};EditorUi.prototype.fileStats=function(c,d){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var k=d.getElementsByTagName("diagram");d=+{};d.modified=c.getLastModifiedDate();d.fileMode=c.getMode();d.fileSize=c.getSize();d.fileHash=c.getHash();d.pages=k.length;d.redundantStencils=0;d.redundantImages=0;d.redundantSize=0;d.stencils=0;d.images=0;for(var m=d.cells=0;m<k.length;m++){var t=k[m].getElementsByTagName("mxCell");d.cells+=t.length;for(var u={},A=0;A<t.length;A++){var B=t[A].getAttribute("style");if(null!=B)for(var D=B.split(";"),N=0;N<D.length;N++){var F=D[N];if(F.startsWith("image=data:")||F.startsWith("shape=stencil("))null==+u[F]?u[F]=1:u[F]++}}for(var U in u){var V=u[U];U.startsWith("shape=stencil(")?d.stencils+=V:d.images+=V;1<V&&(d.redundantSize+=U.length*(V-1),U.startsWith("shape=stencil(")?d.redundantStencils+=V-1:d.redundantImages+=V-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(d)})}}catch(n){}};EditorUi.prototype.getBaseFilename=function(c){var d=this.getCurrentFile();d=null!=d&&null!=d.getTitle()?d.getTitle():this.defaultFilename;+if(/(\.xml)$/i.test(d)||/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));/(\.drawio)$/i.test(d)&&(d=d.substring(0,d.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(c,d,k,m,t,u,A,B,D,N,F,U,V,n,v,G,H){try{m=null!=m?m:this.editor.graph.isSelectionEmpty();+var I=this.getBaseFilename(!t),g=I+("xml"==c||"pdf"==c&&F?".drawio":"")+"."+c;if("xml"==c){var q=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,m,t,null,null,null,d);this.saveData(g,c,q,"text/xml")}else if("html"==c)q=this.getHtml2(this.getFileData(!0),this.editor.graph,I),this.saveData(g,c,q,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?g=I+".png":"jpeg"==c&&(g=I+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&+this.embedExportProtocol){var C=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(g,c,m,"1",A,t,B,D,N,F,U,void 0,void 0,!u,V,n,v,G,H).send(mxUtils.bind(this,function(P){this.spinner.stop();if(200<=P.getStatus()&&299>=P.getStatus()){var S=this.createLoadMessage("export");S.format=c;S.filename=g;S.data="data:application/pdf;base64,"+P.getText();S.xml=this.getFileData(!0);C.postMessage(JSON.stringify(S),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),+mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(g,c,mxUtils.bind(this,function(P,S){try{return this.createDownloadRequest(P,c,m,S,A,t,B,D,N,F,U,void 0,void 0,!u,V,n,v,G,H)}catch(W){this.handleError(W)}}));else{var J=null,M=mxUtils.bind(this,function(P){P.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,+function(){mxUtils.popup(J)}))});if("svg"==c){var Q=this.editor.graph.background;if(A||Q==mxConstants.NONE)Q=null;var T=this.editor.graph.getSvg(Q,null,null,null,null,m);k&&this.editor.graph.addSvgShadow(T);this.editor.convertImages(T,mxUtils.bind(this,mxUtils.bind(this,function(P){this.spinner.stop();M(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(P))})))}else g=I+".svg",J=this.getFileData(!1,!0,null,mxUtils.bind(this,function(P){this.spinner.stop();M(P)}),m)}}catch(P){this.handleError(P)}};+EditorUi.prototype.createDownloadRequest=function(c,d,k,m,t,u,A,B,D,N,F,U,V,n,v,G,H,I,g){c=this.downloadRequestBuilder(c,d,k,m,t,u,A,B,D,N,F,U,V,n,v,G,H,I,g);d="";for(var q in c)k=c[q],null!=k&&(d+=q+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,d)};EditorUi.prototype.downloadRequestBuilder=function(c,d,k,m,t,u,A,B,D,N,F,U,V,n,v,G,H,I,g){var q=this.editor.graph,C=q.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==u?!1:"xmlpng"!=d,null,null,null,!Editor.defaultCompressed,+"pdf"==d);var J=null,M=null,Q=null;if(!EditorUi.isElectronApp&&(C.width*C.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};N=N?"1":"0";"pdf"==d&&(null!=F?(J=F.from,M=F.to):0==u&&(Q="1"));"xmlpng"==d&&(N="1",d="png");if(("xmlpng"==d||"svg"==d)&&null!=this.pages&&null!=this.currentPage)for(u=0;u<this.pages.length;u++)if(this.pages[u]==this.currentPage){J=u;break}u=q.background;"png"!=d&&"pdf"!=d&&"svg"!=d||!t?t||null!=u&&u!=mxConstants.NONE||(u="#ffffff"):+u=mxConstants.NONE;t={globalVars:q.getExportVariables()};null!=F&&null!=F.from&&(t.globalVars.pagenumber=F.from+1);D&&(t.grid={size:q.gridSize,steps:q.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==d?mxGraphView.prototype.defaultGridColor:q.view.gridColor});Graph.translateDiagram&&(t.diagramLanguage=Graph.diagramLanguage);return{format:d,from:J,to:M,allPages:Q,bg:null!=u?u:mxConstants.NONE,base64:m,embedXml:N,xml:k,filename:null!=c?c:"",extras:JSON.stringify(t),scale:A,border:B,pageMargin:v,w:U&&+isFinite(U)?U:null,h:V&&isFinite(V)?V:null,crop:null!=n&&n?"1":"0",fit:null!=G&&G?"1":"0",shadows:null!=g&&g?"1":"0",sheetsAcross:H,sheetsDown:I}};EditorUi.prototype.setMode=function(c,d){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 d=c.indexOf("#");0<=d&&(c=c.substring(0,d))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,d={};if(null!=c&&0<c.length){var k=c.lastIndexOf("#");+if(0<k){c=decodeURIComponent(c.substring(k+1));try{d=JSON.parse(c)}catch(m){}}}return d};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 d=window.location.hash;if(null==d||""==d)d="#";var k=d.lastIndexOf("#");0<k&&(d=d.substring(0,+k));try{null==c||mxUtils.isEmptyObject(c)||(d=d+"#"+encodeURIComponent(JSON.stringify(c)))}catch(m){}0<k&&0<d.lastIndexOf("#")?window.location.hash=d:window.location.replace(d)}};EditorUi.prototype.loadDescriptor=function(c,d,k){var m=window.location.hash,t=mxUtils.bind(this,function(A){var B=null!=c.data?c.data:"";null!=A&&0<A.length&&(0<B.length&&(B+="\n"),B+=A);A=new LocalFile(this,"csv"!=c.format&&0<B.length?B:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,+!0);A.getHash=function(){return m};this.fileLoaded(A);"csv"==c.format&&this.importCsv(B,mxUtils.bind(this,function(V){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var D=null!=c.interval?parseInt(c.interval):6E4,N=null,F=mxUtils.bind(this,function(){var V=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(n){V===this.currentPage&&(200<=n.getStatus()&&300>=n.getStatus()?+(this.updateDiagram(n.getText()),U()):this.handleError({message:mxResources.get("error")+" "+n.getStatus()}))}),mxUtils.bind(this,function(n){this.handleError(n)}))}),U=mxUtils.bind(this,function(){window.clearTimeout(N);N=window.setTimeout(F,D)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){U();F()}));U();F()}null!=d&&d()});if(null!=c.url&&0<c.url.length){var u=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(u,mxUtils.bind(this,function(A){t(A)}),mxUtils.bind(this,function(A){null!=+k&&k(A)}))}else t("")};EditorUi.prototype.updateDiagram=function(c){function d(q){var C=new mxCellOverlay(q.image||t.warningImage,q.tooltip,q.align,q.valign,q.offset);C.addListener(mxEvent.CLICK,function(J,M){m.alert(q.tooltip)});return C}var k=null,m=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var t=this.editor.graph,u=t.getModel();u.beginUpdate();var A=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var B=u.getCell(c.getAttribute("id"));+if(null!=B){try{var D=c.getAttribute("value");if(null!=D){var N=mxUtils.parseXml(D).documentElement;if(null!=N)if("1"==N.getAttribute("replace-value"))u.setValue(B,N);else for(var F=N.attributes,U=0;U<F.length;U++)t.setAttributeForCell(B,F[U].nodeName,0<F[U].nodeValue.length?F[U].nodeValue:null)}}catch(q){null!=window.console&&console.log("Error in value for "+B.id+": "+q)}try{var V=c.getAttribute("style");null!=V&&t.model.setStyle(B,V)}catch(q){null!=window.console&&console.log("Error in style for "++B.id+": "+q)}try{var n=c.getAttribute("icon");if(null!=n){var v=0<n.length?JSON.parse(n):null;null!=v&&v.append||t.removeCellOverlays(B);null!=v&&t.addCellOverlay(B,d(v))}}catch(q){null!=window.console&&console.log("Error in icon for "+B.id+": "+q)}try{var G=c.getAttribute("geometry");if(null!=G){G=JSON.parse(G);var H=t.getCellGeometry(B);if(null!=H){H=H.clone();for(key in G){var I=parseFloat(G[key]);"dx"==key?H.x+=I:"dy"==key?H.y+=I:"dw"==key?H.width+=I:"dh"==key?H.height+=I:H[key]=parseFloat(G[key])}t.model.setGeometry(B,+H)}}}catch(q){null!=window.console&&console.log("Error in icon for "+B.id+": "+q)}}}else if("model"==c.nodeName){for(var g=c.firstChild;null!=g&&g.nodeType!=mxConstants.NODETYPE_ELEMENT;)g=g.nextSibling;null!=g&&(new mxCodec(c.firstChild)).decode(g,u)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(t.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))t.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,d){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var m=k.lastIndexOf(".");0<=m&&(c=k.substring(m),k=k.substring(0,m));if(d){d=k;var t=new Date;k=t.getFullYear();m=t.getMonth()+1;var u=t.getDate(),A=t.getHours(),B=t.getMinutes();t=t.getSeconds();+k=d+(" "+(k+"-"+m+"-"+u+"-"+A+"-"+B+"-"+t))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=function(c,d){try{null!=c&&d&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,d,k){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[d]);var m=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var t=!1;this.hideDialog();null!=m&&(m.removeListener(this.descriptorChangedListener),this.logIfModified(m,+!0),m.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var u=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=m&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!d&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();d||("0"!=urlParams.splash?this.showSplash():+this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=c)try{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.clearStatus():this.updateStatus(mxUtils.bind(this,function(){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||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&+this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));t=!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.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+A})}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(B){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(B){}}catch(B){this.fileLoadedError=B;if(null!=c)try{c.close()}catch(D){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,+mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=m?this.fileLoaded(m)||u():u()});d?c():(null!=B.fallbackFileData&&(B.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var D=new LocalFile(this,B.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(D)})}),this.handleError(B,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else u();return t};EditorUi.prototype.getHashValueForPages=function(c,d){var k=+0,m=new mxGraphModel,t=new mxCodec;null!=d&&(d.byteCount=0,d.attrCount=0,d.eltCount=0,d.nodeCount=0);for(var u=0;u<c.length;u++){this.updatePageRoot(c[u]);var A=c[u].node.cloneNode(!1);A.removeAttribute("name");m.root=c[u].root;var B=t.encode(m);this.editor.graph.saveViewState(c[u].viewState,B,!0);B.removeAttribute("pageWidth");B.removeAttribute("pageHeight");A.appendChild(B);null!=d&&(d.eltCount+=A.getElementsByTagName("*").length,d.nodeCount+=A.getElementsByTagName("mxCell").length);k=(k<<5)-k++this.hashValue(A,function(D,N,F,U){return!U||"mxGeometry"!=D.nodeName&&"mxPoint"!=D.nodeName||"x"!=N&&"y"!=N&&"width"!=N&&"height"!=N?U&&"mxCell"==D.nodeName&&"previous"==N?null:F:Math.round(F)},d)<<0}return k};EditorUi.prototype.hashValue=function(c,d,k){var m=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(m^=this.hashValue(c.nodeName,d,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);+for(var t=0;t<c.attributes.length;t++){var u=c.attributes[t].name,A=null!=d?d(c,u,c.attributes[t].value,!0):c.attributes[t].value;null!=A&&(m^=this.hashValue(u,d,k)+this.hashValue(A,d,k))}}if(null!=c.childNodes)for(t=0;t<c.childNodes.length;t++)m=(m<<5)-m+this.hashValue(c.childNodes[t],d,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);d=0;null!=k&&(k.byteCount+=c.length);for(t=0;t<c.length;t++)d=(d<<5)-d+c.charCodeAt(t)<<0;m^=d}return m};EditorUi.prototype.descriptorChanged=function(){};+EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,d,k,m,t,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){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):+this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var d=0;d<c.length;d++)null!=c[d].xml&&"<"!=c[d].xml.charAt(0)&&(c[d].xml=mxUtils.trim(Graph.decompress(c[d].xml)));d=mxUtils.createXmlDocument();var k=d.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(c,null,2));d.appendChild(k);return mxUtils.getXml(d,"\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 d=this.sidebar.palettes[c];if(null!=d){for(var k=0;k<d.length;k++)d[k].parentNode.removeChild(d[k]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,d){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!d){null==c&&(d=this.sidebar.palettes["L.scratchpad"],+null==d&&(d=this.sidebar.palettes.search),null!=d&&(c=d[d.length-1].nextSibling));c=null!=c?c:k.firstChild.nextSibling.nextSibling;d=k.lastChild;var m=d.previousSibling;k.insertBefore(d,c);k.insertBefore(m,d)}};EditorUi.prototype.loadLibrary=function(c,d){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var m=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,m,k.documentElement.getAttribute("title"),d,k.documentElement.getAttribute("tags"))}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.showSearchWindow=function(c,d){var k=c?"findReplace":"find",m=k+"Window";if(null==this[m]){var t="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,u=c?t?330:300:240;this[m]=new FindWindow(this,document.body.offsetWidth-(u+20),100,u,c?t?304:288:+180,c);this[m].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[m].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});this[m].window.setVisible(!0)}else null==d&&this[m].window.setVisible(!this[m].window.isVisible());null!=d&&(this[m].doSearch(d),this[m].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,d,k,m,t){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var u=null;if(c.constructor!=+StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var A=0;A<this.openLibraries.length;A++)if(this.openLibraries[A].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[A],this.openLibraries);break}u={file:c,images:d,title:k,expand:m};this.openLibraries.push(u)}else this.scratchpad=c;A=this.sidebar.palettes[c.getHash()];A=null!=A?A[A.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var B=null,D=mxUtils.bind(this,function(g,q){0==+g.length&&c.isEditable()?(null==B&&(B=document.createElement("div"),B.className="geDropTarget",mxUtils.write(B,mxResources.get("dragElementsHere"))),q.appendChild(B)):this.addLibraryEntries(g,q)});null!=this.sidebar&&null!=d&&this.sidebar.addEntries(d,t);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var N=this.sidebar.addPalette(c.getHash(),k,null!=m?m:!0,mxUtils.bind(this,function(g){D(d,g)}));null!=u&&(u.div=N);this.repositionLibrary(A,"L.scratchpad"!=+c.getHash());m=N.parentNode.previousSibling;k=m.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&m.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var F=document.createElement("div");F.style.backgroundColor="inherit";m.style.position="relative";var U=document.createElement("img");U.className="geLibraryButton";U.setAttribute("src",Editor.crossImage);U.setAttribute("title",mxResources.get("close"));var V=null;if(".scratchpad"!=c.title||this.closableScratchpad)F.appendChild(U),+mxEvent.addListener(U,"click",mxUtils.bind(this,function(g){if(!mxEvent.isConsumed(g)){var q=mxUtils.bind(this,function(){null!=u&&mxUtils.remove(u,this.openLibraries);this.closeLibrary(c)});null!=V?this.confirm(mxResources.get("allChangesLost"),null,q,mxResources.get("cancel"),mxResources.get("discardChanges")):q();mxEvent.consume(g)}}));if(c.isEditable()){var n=this.editor.graph,v=null;k=mxUtils.bind(this,function(g){this.showLibraryDialog(c.getTitle(),N,d,c,c.getMode());mxEvent.consume(g)});var G=+mxUtils.bind(this,function(g){c.setModified(!0);c.isAutosave()?(null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v),v=U.cloneNode(!1),v.setAttribute("src",Editor.spinImage),v.setAttribute("title",mxResources.get("saving")),v.style.cursor="default",v.style.marginRight="2px",v.style.marginTop="-2px",F.insertBefore(v,F.firstChild),this.saveLibrary(c.getTitle(),d,c,c.getMode(),!0,!0,function(){null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v)})):null==V&&(V=U.cloneNode(!1),V.setAttribute("src",+Editor.saveImage),V.setAttribute("title",mxResources.get("save")),F.insertBefore(V,F.firstChild),mxEvent.addListener(V,"click",mxUtils.bind(this,function(q){this.saveLibrary(c.getTitle(),d,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==V||c.isModified()||(V.parentNode.removeChild(V),V=null)});mxEvent.consume(q)})))}),H=mxUtils.bind(this,function(g,q,C,J){g=n.cloneCells(mxUtils.sortCells(n.model.getTopmostCells(g)));for(var M=0;M<g.length;M++){var Q=n.getCellGeometry(g[M]);null!=Q&&+Q.translate(-q.x,-q.y)}N.appendChild(this.sidebar.createVertexTemplateFromCells(g,q.width,q.height,J||"",!0,null,!1));g=mxUtils.getXml(this.editor.graph.encodeCells(g));Editor.defaultCompressed&&(g=Graph.compress(g));q={xml:g,w:q.width,h:q.height};null!=J&&(q.title=J);d.push(q);G(C);null!=B&&null!=B.parentNode&&0<d.length&&(B.parentNode.removeChild(B),B=null)}),I=mxUtils.bind(this,function(g){if(n.isSelectionEmpty())n.getRubberband().isActive()?(n.getRubberband().execute(g),n.getRubberband().reset()):+null!=g&&mxEvent.getSource(g).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var q=n.getSelectionCells(),C=n.view.getBounds(q);if(null!=C&&0<C.width&&0<C.height){var J=n.view.scale;C.x/=J;C.y/=J;C.width/=J;C.height/=J;C.x-=n.view.translate.x;C.y-=n.view.translate.y;H(q,C)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(g)});mxEvent.addGestureListeners(N,+function(){},mxUtils.bind(this,function(g){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler.first&&(n.graphHandler.suspend(),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="hidden"),N.style.backgroundColor="light-dark(#fefefe, #000000)",N.style.cursor="copy",n.panningManager.stop(),n.autoScroll=!1,mxEvent.consume(g))}),mxUtils.bind(this,function(g){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler&&(N.style.backgroundColor="",N.style.cursor="default",this.sidebar.showTooltips=+!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,I(g),mxEvent.consume(g))}));mxEvent.addListener(N,"mouseleave",mxUtils.bind(this,function(g){n.isMouseDown&&null!=n.graphHandler.first&&(n.graphHandler.resume(),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="visible"),N.style.backgroundColor="",N.style.cursor="",n.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(N,"dragover",mxUtils.bind(this,function(g){N.style.backgroundColor="light-dark(#fefefe, #000000)";+g.dataTransfer.dropEffect="copy";N.style.cursor="copy";this.sidebar.hideTooltip();g.stopPropagation();g.preventDefault()})),mxEvent.addListener(N,"drop",mxUtils.bind(this,function(g){N.style.cursor="";N.style.backgroundColor="";0<g.dataTransfer.files.length&&this.importFiles(g.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(q,C,J,M,Q,T,P,S,W){if(null!=q&&"image/"==C.substring(0,6))q="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="++this.convertDataUri(q),q=[new mxCell("",new mxGeometry(0,0,Q,T),q)],q[0].vertex=!0,H(q,new mxRectangle(0,0,Q,T),g,mxEvent.isAltDown(g)?null:P.substring(0,P.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<d.length&&(B.parentNode.removeChild(B),B=null);else{var X=!1,Y=mxUtils.bind(this,function(Z,aa){null!=Z&&"application/pdf"==aa&&(aa=Editor.extractGraphModelFromPdf(Z),null!=aa&&0<aa.length&&(Z=aa));if(null!=Z)if(Z=mxUtils.parseXml(Z),"mxlibrary"==Z.documentElement.nodeName)try{var ha=+JSON.parse(mxUtils.getTextContent(Z.documentElement));D(ha,N);d=d.concat(ha);G(g);this.spinner.stop();X=!0}catch(sa){}else if("mxfile"==Z.documentElement.nodeName)try{var ja=Z.documentElement.getElementsByTagName("diagram");for(ha=0;ha<ja.length;ha++){var fa=this.stringToCells(Editor.getDiagramNodeXml(ja[ha])),ma=this.editor.graph.getBoundingBoxFromGeometry(fa);null!=ma&&H(fa,new mxRectangle(0,0,ma.width,ma.height),g)}X=!0}catch(sa){null!=window.console&&console.log("error in drop handler:",sa)}X||+(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<d.length&&(B.parentNode.removeChild(B),B=null)});null!=W&&null!=P&&EditorUi.isVisioFilename(P)?this.importVisio(W,function(Z){Y(Z,"text/xml")},null,P):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(q,P)&&null!=W?this.isExternalDataComms()?this.parseFile(W,mxUtils.bind(this,function(Z){4==Z.readyState&&(this.spinner.stop(),200<=Z.status&&299>=Z.status?Y(Z.responseText,"text/xml"):+this.handleError({message:mxResources.get(413==Z.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):Y(q,C)}}));g.stopPropagation();g.preventDefault()})),mxEvent.addListener(N,"dragleave",function(g){N.style.cursor="";N.style.backgroundColor="";g.stopPropagation();g.preventDefault()}));U=U.cloneNode(!1);U.setAttribute("src",Editor.editImage);U.setAttribute("title",+mxResources.get("edit"));F.insertBefore(U,F.firstChild);mxEvent.addListener(U,"click",k);k=U.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));F.insertBefore(k,F.firstChild);mxEvent.addListener(k,"click",I);".scratchpad"==c.title&&(this.addSelectionToScratchpad=I);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),k.className="geLibraryButton",F.insertBefore(k,F.firstChild))}m.appendChild(F);+this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,d){for(var k=0;k<c.length;k++)try{var m=c[k],t=m.data;if(null!=t){t="data:"==t.substring(0,5)?this.convertDataUri(t):t;var u="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==m.aspect&&(u+="aspect=fixed;");u=u+"image="+t+";";null!=m.style&&(u+=m.style);d.appendChild(this.sidebar.createVertexTemplate(u,m.w,m.h,"",m.title||"",!1,null,!0))}else if(null!=m.xml){var A=+this.stringToCells("<"==m.xml.charAt(0)?m.xml:Graph.decompress(m.xml)),B=0==A.length?mxResources.get("drawingEmpty"):null!=m.title?m.title:"";d.appendChild(this.sidebar.createVertexTemplateFromCells(A,m.w,m.h,B,!0,null,!0))}}catch(D){B=null!=D.message?mxResources.get("error")+": "+D.message:String(D),u=this.sidebar.createVertexTemplateFromCells(null,m.w,m.h,B,!0,null,!0),d.appendChild(u)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&+(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,d,k,m,t,u,A){c=new ImageDialog(this,c,d,k,m,t,u,A);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,+d,k,m,t,u){var A=localStorage.getItem(d);c=new TextareaDialog(this,c,null!=A?JSON.stringify(JSON.parse(A),null,2):"",mxUtils.bind(this,function(B){if(null!=B)try{if(null!=u&&u(B),B==A)this.hideDialog();else{if(0<B.length){var D=JSON.parse(B);localStorage.setItem(d,JSON.stringify(D))}else localStorage.removeItem(d);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(N){this.handleError(N)}}),null,mxResources.get("close"),null,null,null,!0,null,null,t,k,m);this.showDialog(c.container,+660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,280));c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,d,k,m){c=null!=c?c:mxUtils.bind(this,function(t,u,A,B){u||(t=new ChangePageSetup(this,m?A:null,t),t.ignoreColor=!m,null!=B&&m&&(t.shadowVisible=B),this.editor.graph.model.execute(t))});c=new BackgroundImageDialog(this,c,d,k,m);this.showDialog(c.container,400,m?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,d,k,m,t){c=new LibraryDialog(this,+c,d,k,m,t);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 p=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var d=p.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&d.refresh()}));return d};EditorUi.prototype.handleError=function(c,d,k,m,t,u,A){var B=null!=this.spinner&&+null!=this.spinner.pause?this.spinner.pause():function(){},D=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(V){}if(null!=D||null!=d){A=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var N=mxResources.get("ok"),F=null;+d=null!=d?d:mxResources.get("error");if(null!=D){null!=D.retry&&(N=mxResources.get("cancel"),F=function(){B();D.retry()});if(404==D.code||404==D.status||403==D.code){A=403==D.code?null!=D.message?mxUtils.htmlEntities(D.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=t?t:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var U=null!=t?null:null!=u?u:window.location.hash;if(null!=U&&+("#G"==U.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==U.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==D.code||404==D.status)){U="#U"==U.substring(0,2)?U.substring(45,U.lastIndexOf("%26ex")):U.substring(2);this.showError(d,A,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="++U);null!=m&&m()}),F,mxResources.get("changeUser"),mxUtils.bind(this,function(){function V(){H.innerText="";for(var I=0;I<n.length;I++){var g=document.createElement("option");mxUtils.write(g,n[I].displayName);g.value=I;H.appendChild(g);g=document.createElement("option");g.innerHTML=" ";mxUtils.write(g,"<"+n[I].email+">");g.setAttribute("disabled","disabled");H.appendChild(g)}g=document.createElement("option");mxUtils.write(g,mxResources.get("addAccount"));g.value=n.length;H.appendChild(g)}+var n=this.drive.getUsersList(),v=document.createElement("div"),G=document.createElement("div");G.style.marginBottom="6px";mxUtils.write(G,mxResources.get("changeUser")+": ");v.appendChild(G);var H=document.createElement("select");H.style.width="100%";V();mxEvent.addListener(H,"change",mxUtils.bind(this,function(){var I=H.value,g=n.length!=I;g&&this.drive.setUser(n[I]);this.drive.authorize(g,mxUtils.bind(this,function(){g||(n=this.drive.getUsersList(),V())}),mxUtils.bind(this,function(q){this.handleError(q)}),+!0)}));v.appendChild(H);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!=D.message?A=""==D.message&&null!=D.name?mxUtils.htmlEntities(D.name,!1):mxUtils.htmlEntities(D.message,!1):null!=D.response&&null!=D.response.error?A=mxUtils.htmlEntities(D.response.error,!1):"undefined"!==typeof window.App&&+(D.code==App.ERROR_TIMEOUT?A=mxUtils.htmlEntities(mxResources.get("timeout"),!1):D.code==App.ERROR_BUSY?A=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof D&&0<D.length&&(A=mxUtils.htmlEntities(D,!1)))}t=c=null;null!=D&&null!=D.helpLink?(c=mxResources.get("help"),t=mxUtils.bind(this,function(){return this.editor.graph.openLink(D.helpLink)})):null!=D&&null!=D.ownerEmail?(c=mxResources.get("contactOwner"),A+=mxUtils.htmlEntities(" ("+c+": "+D.ownerEmail+")",!1),t=mxUtils.bind(this,+function(){return this.openLink("mailto:"+mxUtils.htmlEntities(D.ownerEmail))})):null!=D&&null!=D.alternateAction&&(c=D.alternateAction.label,t=D.alternateAction.funct);this.showError(d,A,N,k,F,null,null,c,t,null,null,null,m?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,d,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),d);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,d,k,m,t,u){c=null!=c?c:"";var A=null!=this.spinner&&null!=this.spinner.pause?+this.spinner.pause():function(){},B=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){A();null!=d&&d()},function(){A();null!=k&&k()},m,t,null,null,null,null,B);this.showDialog(c.container,340,46+B,!0,u);c.init()};EditorUi.prototype.showBanner=function(c,d,k,m,t,u,A,B,D){u=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){A=null!=A?A:"translate(-50%,120%)";B=null!=B?B:"translate(-50%,0%)";+var N=document.createElement("div");N.className="geBtn gePrimaryBtn geBanner"+(t?" geSmallBanner":"");N.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(N.style,"transform",A);mxUtils.setPrefixedStyle(N.style,"transition","all 1000ms ease");null!=D&&mxUtils.setPrefixedStyle(N.style,"transform-origin",D);D=D=document.createElement("img");D.setAttribute("src",Editor.crossImage);D.setAttribute("title",mxResources.get(m?"doNotShowAgain":"close"));D.setAttribute("border","0");t||(u=document.createElement("img"),+u.setAttribute("src",IMAGE_PATH+"/logo.png"),u.setAttribute("border","0"),u.setAttribute("align","absmiddle"),u.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",N.appendChild(u),D.style.cssText=(t?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",N.appendChild(D));mxUtils.write(N,d);document.body.appendChild(N);this.bannerShowing=!0;t&&(D.className="geLibraryButton",N.appendChild(D));d=+document.createElement("div");d.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var F=document.createElement("input");F.setAttribute("type","checkbox");F.setAttribute("id","geDoNotShowAgainCheckbox");F.style.marginRight="6px";if(!m){d.appendChild(F);var U=document.createElement("label");U.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(U,mxResources.get("doNotShowAgain"));d.appendChild(U);N.style.paddingBottom=+t?"16px":"30px";N.appendChild(d)}var V=mxUtils.bind(this,function(){null!=N.parentNode&&(N.parentNode.removeChild(N),this.bannerShowing=!1,F.checked||m)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=D&&mxEvent.addListener(D,"click",mxUtils.bind(this,function(v){mxEvent.consume(v);V()}));var n=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(N.style,"transform",A);window.setTimeout(mxUtils.bind(this,+function(){V()}),1E3)});mxEvent.addListener(N,"click",mxUtils.bind(this,function(v){var G=mxEvent.getSource(v);G!=F&&G!=U?(null!=k&&k(),V(),mxEvent.consume(v)):n()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(N.style,"transform",B)}),500);window.setTimeout(n,t?5E3:3E4);u=!0}return u};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=+function(c,d,k,m){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=d&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(d))),0<m&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",m));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,d,k,m,t){var u="jpeg"==k?"jpg":k;m=this.getBaseFilename(m)+(null!=d?".drawio":"")+"."+u;c=this.createImageDataUri(c,d,k,t);this.saveData(m,u,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.showAnimatedGifExportDialog=+function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatAnimatedGif",null,"Animated GIF"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(d);mxUtils.write(c,mxResources.get("speed",null,"Speed")+":");var k=document.createElement("select");k.style.marginLeft="4px";k.style.width="80px";var m=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",+null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(d=0;d<m.length;d++){var t=document.createElement("option");mxUtils.write(t,m[d].label);t.setAttribute("value",m[d].value);15==m[d].value&&t.setAttribute("selected","selected");k.appendChild(t)}c.appendChild(k);mxUtils.br(c);d=document.createElement("div");d.style.marginTop="10px";mxUtils.write(d,mxResources.get("zoom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="60px";u.style.marginLeft=+"4px";u.value="100%";d.appendChild(u);c.appendChild(d);d=document.createElement("div");d.style.marginTop="10px";mxUtils.write(d,mxResources.get("borderWidth",null,"Border Width")+":");var A=document.createElement("input");A.setAttribute("type","text");A.style.width="60px";A.style.marginLeft="4px";A.value="0";d.appendChild(A);c.appendChild(d);m=document.createElement("div");m.style.marginTop="10px";mxUtils.write(m,mxResources.get("loops",null,"Loops")+":");var B=document.createElement("select");B.style.marginLeft=+"4px";B.style.width="80px";var D=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(d=0;d<D.length;d++)t=document.createElement("option"),mxUtils.write(t,D[d].label),t.setAttribute("value",D[d].value),0==D[d].value&&t.setAttribute("selected","selected"),B.appendChild(t);m.appendChild(B);c.appendChild(m);var N=this.addCheckbox(c,mxResources.get("transparentBackground",null,"Transparent Background"),!1);c=new CustomDialog(this,+c,mxUtils.bind(this,function(){var F=parseInt(u.value);if(isNaN(F)||0>=F)F=100;this.exportAnimatedGif({fps:parseInt(k.value),scale:F/100,border:parseInt(A.value)||0,repeat:parseInt(B.value),transparent:N.checked,background:N.checked?null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"#ffffff"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,300,260,!0,!0,null,null,null,+null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(d){this.spinner.stop();if(null!=d){var k=this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(d,k);else{var m=document.createElement("a");m.href=URL.createObjectURL(d);m.download=k;document.body.appendChild(m);m.click();setTimeout(function(){document.body.removeChild(m);+URL.revokeObjectURL(m.href)},0)}}}),mxUtils.bind(this,function(d){this.spinner.stop();this.handleError(d)}))}catch(d){this.spinner.stop(),this.handleError(d)}};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,d){c=new TextareaDialog(this,+c,d,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,d,k,m,t,u){"text/xml"!=k||/(\.drawio)$/i.test(d)||/(\.xml)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.html)$/i.test(d)||(d=d+"."+(null!=u?u:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=m?this.base64ToBlob(c,k):new Blob([c],{type:k}),navigator.msSaveOrOpenBlob(c,d);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,d),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(d+":",c):this.openInNewWindow(c,k,m);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 B=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);+u=65==(B?parseInt(B[2],10):!1)?!1:u}if(u||this.isOffline()){A.href=URL.createObjectURL(m?this.base64ToBlob(c,k):new Blob([c],{type:k}));u?A.download=d:A.setAttribute("target","_blank");document.body.appendChild(A);try{window.setTimeout(function(){URL.revokeObjectURL(A.href)},2E4),A.click(),A.parentNode.removeChild(A)}catch(D){}}else this.createEchoRequest(c,d,k,m,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,d,k,m,t,u){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,+c+(null!=k?"&mime="+k:"")+(null!=t?"&format="+t:"")+(null!=u?"&base64="+u:"")+(null!=d?"&filename="+encodeURIComponent(d):"")+(m?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,d,k,m,t,u,A,B,D){u=null!=u?u:!1;A=null!=A?A:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);var N=mxUtils.bind(this,function(U,V,n,v){try{if("_blank"==V)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,m);else if(null!=k&&"text/html"==k.substring(0,9)){var G=new EmbedDialog(this,c);this.showDialog(G.container,+450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));G.init()}else{var H=window.open("about:blank");null==H?mxUtils.popup(c,!0):(H.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),H.document.close())}else if(V==App.MODE_DEVICE||"download"==V)this.doSaveLocalFile(c,U,k,m,null,B);else if(null!=U&&0<U.length){var I=mxUtils.bind(this,function(g){try{this.exportFile(c,U,k,m,V,g)}catch(q){this.handleError(q)}});null!=v?I(v):this.pickFolder(V,I)}}catch(g){this.handleError(g)}});t=[];u||t.push(App.MODE_BROWSER);+A||t.push("_blank");var F=new SaveDialog(this,d,mxUtils.bind(this,function(U,V,n){N(U.value,V,U,n);this.hideDialog(null,null,F.container)}),t,c,k,m,D);this.showDialog(F.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));F.init()};EditorUi.prototype.openInNewWindow=function(c,d,k){var m=window.open("about:blank");if(null==m||null==m.document)mxUtils.popup(c,!0);else{var t="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==d){var u=mxUtils.parseXml(c).documentElement.style.backgroundColor;+""!=u&&(t="background: "+u+";")}t='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+t+'">';"image/svg+xml"!=d||mxClient.IS_SVG?"image/svg+xml"!=d||k?(u=k?c:btoa(unescape(encodeURIComponent(c))),m.document.write(t+'<img style="max-width:100%;" src="data:'+d+";base64,"+u+'"/></body></html>')):m.document.write(t+c+"</body></html>"):m.document.write(t+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");m.document.close()}};var f=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 d=c(mxUtils.bind(this,function(m){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.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=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor=+"#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var t=d.getBoundingClientRect();this.tagsDialog.style.left=t.left+"px";+this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";t=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=t.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(m)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var m=this.editor.graph.getAllTags();+d.style.display=0<m.length?"":"none"}))}f.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));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.editor.isExportToCanvas()&&+this.isChromelessImageExportEnabled()&&"1"!=urlParams.noExport){this.exportDialog=null;var k=c(mxUtils.bind(this,function(m){var t=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",t);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)t.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",t);this.editor.exportToCanvas(mxUtils.bind(this,function(B){A.stop();this.exportDialog.style.width=+"auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var D=this.createImageDataUri(B,null,"png");B=document.createElement("img");B.style.maxWidth="140px";B.style.maxHeight="140px";B.style.cursor="pointer";B.style.backgroundColor="white";B.setAttribute("title",mxResources.get("openInNewWindow"));B.setAttribute("border","0");B.setAttribute("src",D);this.exportDialog.appendChild(B);mxEvent.addListener(B,"click",mxUtils.bind(this,function(){this.openInNewWindow(D.substring(D.indexOf(",")++1),"image/png",!0);t.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(B){A.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(B)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(m)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,d,k,m,t,u){if("1"==urlParams.embed&&"json"==urlParams.proto&&+this.embedExportProtocol){u=this.embedMessageSource||window.opener||window.parent;var A=this.createLoadMessage("export");A.format=d;A.filename=c;A.data=t?"data:"+m+";base64,"+k:k;A.xml=this.getFileData(!0);u.postMessage(JSON.stringify(A),"*")}else this.isLocalFileSave()?this.saveLocalFile(k,c,m,t,d,u):this.saveRequest(c,d,mxUtils.bind(this,function(B,D){return this.createEchoRequest(k,B,m,t,d,D)}),k,t,m)};EditorUi.prototype.saveRequest=function(c,d,k,m,t,u,A){A=null!=A?A:!mxClient.IS_IOS||!navigator.standalone;+var B=mxUtils.bind(this,function(N,F,U,V){if("_blank"==F||null!=N&&0<N.length){var n=k("_blank"==F?null:N,F==App.MODE_DEVICE||"download"==F||null==F||"_blank"==F?"0":"1");null!=n&&(F==App.MODE_DEVICE||"download"==F||"_blank"==F?n.simulate(document,"_blank"):(U=mxUtils.bind(this,function(v){u=null!=u?u:"pdf"==d?"application/pdf":"image/"+d;if(null!=m)try{this.exportFile(m,N,u,!0,F,v)}catch(G){this.handleError(G)}else this.spinner.spin(document.body,mxResources.get("saving"))&&n.send(mxUtils.bind(this,+function(){this.spinner.stop();if(200<=n.getStatus()&&299>=n.getStatus())try{this.exportFile(n.getText(),N,u,!0,F,v)}catch(G){this.handleError(G)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(G){this.spinner.stop();this.handleError(G)}))}),null!=V?U(V):this.pickFolder(F,U)))}});t=[App.MODE_BROWSER];A||t.push("_blank");var D=new SaveDialog(this,c,mxUtils.bind(this,function(N,F,U){B(N.value,F,N,U);this.hideDialog(null,null,D.container)}),t,null,"application/pdf");+this.showDialog(D.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));D.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,d,k,m,t,u){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,d,k){d(null)};EditorUi.prototype.exportSvg=+function(c,d,k,m,t,u,A,B,D,N,F,U,V,n){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(Y){Editor.addRetryToError(Y,mxUtils.bind(this,function(){this.exportSvg(c,d,k,m,t,u,A,B,D,N,F,U,V,n)}));this.handleError(Y)})))try{var v=this.editor.graph.isSelectionEmpty();k=null!=k?k:v;var G=d?null:this.editor.graph.background;G==mxConstants.NONE&&(G=null);null==G&&0==d&&(G=this.editor.graph.shapeBackgroundColor);var H=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var I=mxUtils.lightDarkColorSupported,g=mxUtils.preferDarkColor;if("light"==F||"dark"==F)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==F;var q=Graph.addFont,C={};Graph.addFont=function(Y,Z,aa,ha){q.call(this,Y,Z,aa,C)};var J=this.editor.graph.createSvgImageExport(t),M=J.drawCellState;J.drawCellState=function(Y,Z){null!=Y&&Graph.processFontStyle(Y.style);M.apply(this,arguments)};var Q=this.editor.graph.getSvg(G,c,A,B,null,+k,null,J,"blank"==N?"_blank":"self"==N?"_top":null,null,!V,F,U);mxUtils.lightDarkColorSupported=I;mxUtils.preferDarkColor=g;this.editor.graph.addForeignObjectWarning=H;m&&this.editor.graph.addSvgShadow(Q);var T=this.getBaseFilename()+(t?".drawio":"")+".svg";n=null!=n?n:mxUtils.bind(this,function(Y){this.isLocalFileSave()||Y.length<=MAX_REQUEST_SIZE?this.saveData(T,"svg",Y,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Y)}))});+var P=mxUtils.bind(this,function(Y){this.spinner.stop();t&&Y.setAttribute("content",this.getFileData(!0,null,null,null,k,D,null,null,null,null,null,c,A));n(Graph.xmlDeclaration+"\n"+(t?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(Y))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Q);var S=mxUtils.bind(this,function(Y){Editor.replaceSvgDataUris&&u&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&V?this.replaceAlternateContent(Y,F,P):P(Y)}),W=Graph.customFontElements;+Graph.customFontElements=C;var X=mxUtils.bind(this,function(Y){Graph.customFontElements=W;Graph.addFont=q;u&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(Y,S,this.thumbImageCache)):S(Y)});V?this.embedFonts(Q,X):(this.editor.addFontCss(Q),X(Q))}catch(Y){this.handleError(Y)}};EditorUi.prototype.replaceAlternateContent=function(c,d,k){function m(U,V,n,v,G){var H=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");+H.setAttribute("x",V);H.setAttribute("y",n+.5);H.setAttribute("width",v.width);H.setAttribute("height",v.height);null==H.setAttributeNS?H.setAttribute("xlink:href",G):H.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",G);U.replaceChild(H,U.lastChild);B()}function t(){if(A<F.length)F[A++](t)}var u="";d=c.getElementsByTagName("style");for(var A=0;A<d.length;A++)u+=d[A].innerHTML;d=c.getElementsByTagName("switch");counter=d.length;var B=mxUtils.bind(this,function(){counter--;0==counter&&k(c)}),D={},+N={},F=[];for(A=0;A<d.length;A++)mxUtils.bind(this,function(U){var V=U.getElementsByTagName("div");if(0<V.length)try{var n=V[0].cloneNode(!0),v=parseInt(n.style.marginLeft),G=parseInt(n.style.paddingTop),H=n.getElementsByTagName("div")[1],I=V=!1,g=n.style.alignItems,q=n.style.justifyContent;if(null!=n.style.writingMode){var C=n.style.writingMode;I="vertical-"==C.substring(0,9);V="-rl"==C.substring(C.length-3)}var J=!I&&"1px"==n.style.width||I&&"1px"==n.style.height;if(!I&&"1px"==n.style.height||I&&+"1px"==n.style.width)n.style.alignItems=I&&V?"unsafe flex-end":"unsafe flex-start";J&&(n.style.justifyContent="unsafe flex-start");n.style.paddingTop="";n.style.marginLeft="";var M=n.outerHTML,Q=D[M];null==Q&&(n.style.position="absolute",n.style.visibility="hidden",document.body.appendChild(n),C=1,C="1px"==n.style.width?H.offsetWidth:parseInt(n.style.width),J=1,J="1px"==n.style.height?H.offsetHeight:parseInt(n.style.height),document.body.removeChild(n),Q=new mxRectangle(v,G,C,J),D[M]=Q);"1px"==n.style.height&&+("unsafe center"==g?G-=Q.height/2:"unsafe flex-end"==g&&(G-=Q.height));if("1px"==n.style.width)if(!I&&"unsafe center"==q||I&&"unsafe center"==g)v-=Q.width/2;else if(!I&&"unsafe flex-end"==q||I&&(!V&&"unsafe flex-end"==g||V&&"unsafe flex-start"==g))v-=Q.width;Q=new mxRectangle(v,G,Q.width,Q.height+parseInt(H.style.fontSize)/4);F.push(mxUtils.bind(this,function(T){var P=N[M];null==P?Graph.htmlToPng(M,Q.width,Q.height,mxUtils.bind(this,function(S){m(U,v,G,Q,S);N[M]=S;T()}),u):(m(U,v,G,Q,P),T())}))}catch(T){B()}else B()})(d[A]);+0==counter&&k(c);A=0;t()};EditorUi.prototype.addRadiobox=function(c,d,k,m,t,u,A){return this.addCheckbox(c,k,m,t,u,A,!0,d)};EditorUi.prototype.addCheckbox=function(c,d,k,m,t,u,A,B){u=null!=u?u:!0;var D=document.createElement("input");D.style.marginRight="8px";D.style.marginTop="16px";D.setAttribute("type",A?"radio":"checkbox");A="geCheckbox-"+Editor.guid();D.id=A;null!=B&&D.setAttribute("name",B);k&&(D.setAttribute("checked","checked"),D.defaultChecked=!0);m&&D.setAttribute("disabled","disabled");+u&&(c.appendChild(D),k=document.createElement("label"),mxUtils.write(k,d),k.setAttribute("for",A),c.appendChild(k),t||mxUtils.br(c));return D};EditorUi.prototype.addEditButton=function(c,d){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var m=this.getCurrentFile(),t="";null!=m&&m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER&&(t=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";m=document.createElement("option");m.setAttribute("value","blank");mxUtils.write(m,mxResources.get("makeCopy"));u.appendChild(m);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 B=new FilenameDialog(this,t,mxResources.get("ok"),function(D){null!=D?(t=D,A.setAttribute("title",+D)):(u.value="blank",A.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){u.value="blank"});this.showDialog(B.container,300,80,!0,!1);B.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==d||d.checked)?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?"blank"===u.value?"_blank":t:null},getEditInput:function(){return k},getEditSelect:function(){return u}}};+EditorUi.prototype.addLinkSection=function(c,d){function k(){var B=document.createElement("div");B.style.width="100%";B.style.height="100%";B.style.boxSizing="border-box";null!=u&&u!=mxConstants.NONE?(B.style.border="1px solid black",B.style.backgroundColor=u):(B.style.backgroundPosition="center center",B.style.backgroundRepeat="no-repeat",B.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");A.innerText="";A.appendChild(B)}mxUtils.write(c,mxResources.get("links")+":");var m=document.createElement("select");+m.style.width="100px";m.style.padding="0px";m.style.marginLeft="8px";m.style.marginRight="10px";m.className="geBtn";var t=document.createElement("option");t.setAttribute("value","auto");mxUtils.write(t,mxResources.get("automatic"));m.appendChild(t);t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("openInNewWindow"));m.appendChild(t);t=document.createElement("option");t.setAttribute("value","self");mxUtils.write(t,mxResources.get("openInThisWindow"));+m.appendChild(t);d&&(d=document.createElement("option"),d.setAttribute("value","frame"),mxUtils.write(d,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),m.appendChild(d));c.appendChild(m);mxUtils.write(c,mxResources.get("borderColor")+":");var u="#0000ff",A=null;A=mxUtils.button("",mxUtils.bind(this,function(B){this.pickColor(u||"none",function(D){u=D;k()});mxEvent.consume(B)}));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 m.value},focus:function(){m.focus()}}};EditorUi.prototype.createUrlParameters=function(c,d,k,m,t,u){u=null!=u?u:[];k&&(u.push("lightbox=1"),"auto"!=c&&u.push("target="+c),null!=d&&d!=mxConstants.NONE&&u.push("highlight="+("#"==d.charAt(0)?d.substring(1):+d)),null!=m&&0<m.length&&u.push("edit="+encodeURIComponent(m)),t&&u.push("layers=1"),this.editor.graph.foldingEnabled&&u.push("nav=1"));return u};EditorUi.prototype.createLink=function(c,d,k,m,t,u,A,B,D,N,F,U,V){var n=this.getCurrentFile();D=this.createUrlParameters(c,d,m,t,u,D);c=!0;null!=A?k="#U"+encodeURIComponent(A):B||null==n||""==n.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=+"#"+n.getHash(),c=!1);c&&null!=n&&null!=n.getTitle()&&n.getTitle()!=this.defaultFilename&&D.push("title="+encodeURIComponent(n.getTitle()));N&&1<k.length&&(D.push("open="+k.substring(1)),k="");F&&null!=this.currentPage&&D.push("page-id="+this.currentPage.getId());U&&D.push("transparent=1");null!=V&&D.push("dark="+V);return(m&&(null!=A||null!=n&&n.getMode()!=App.MODE_GITHUB&&n.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?+EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<D.length?"?"+D.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,d,k,m,t,u,A,B,D,N,F,U,V){this.getBasenames();var n={};""!=t&&t!=mxConstants.NONE&&(n.highlight=t);"auto"!==m&&(n.target=m);N||(n.lightbox=!1);n.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(n.zoom=k/100);k=[];A&&(k.push("pages"),n.resize=!0,null!=this.pages&&null!=this.currentPage&&(n.page=mxUtils.indexOf(this.pages,this.currentPage)));d&&(k.push("zoom"),+n.resize=!0);B&&k.push("layers");D&&k.push("tags");null!=V&&(n["dark-mode"]=V);0<k.length&&(N&&k.push("lightbox"),n.toolbar=k.join(" "));null!=F&&0<F.length&&(n.edit=F);null!=c?n.url=c:n.xml=this.getFileData(!0,null,null,null,null,!A);d='<div class="mxgraph" style="'+(u?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(n))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";U(d,'<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,d,k,m){var t=document.createElement("div");t.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";+t.appendChild(u);var A=document.createElement("div");A.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var B=document.createElement("input");B.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";B.setAttribute("value","url");B.setAttribute("type","radio");B.setAttribute("name","type-embedhtmldialog");u=B.cloneNode(!0);u.setAttribute("value","copy");A.appendChild(u);var D=document.createElement("span");mxUtils.write(D,mxResources.get("includeCopyOfMyDiagram"));+A.appendChild(D);mxUtils.br(A);A.appendChild(B);D=document.createElement("span");mxUtils.write(D,mxResources.get("publicDiagramUrl"));A.appendChild(D);var N=this.getCurrentFile();null==k&&null!=N&&N.constructor==window.DriveFile&&(D=document.createElement("a"),D.style.paddingLeft="12px",D.style.color="gray",D.style.cursor="pointer",mxUtils.write(D,mxResources.get("share")),A.appendChild(D),mxEvent.addListener(D,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(N.getId(),+N)})));u.setAttribute("checked","checked");null==k&&B.setAttribute("disabled","disabled");t.appendChild(A);A=380;var F=this.addLinkSection(t),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginTop="16px";D=document.createElement("option");D.setAttribute("value","light");mxUtils.write(D,mxResources.get("light"));U.appendChild(D);D=document.createElement("option");D.setAttribute("value","dark");mxUtils.write(D,mxResources.get("dark"));U.appendChild(D);+D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));D.setAttribute("selected","selected");U.appendChild(D);D.setAttribute("selected","selected");mxUtils.write(t,mxResources.get("appearance")+":");t.appendChild(U);mxUtils.br(t);A+=26;var V=this.addCheckbox(t,mxResources.get("zoom"),!0,null,!0);mxUtils.write(t,":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft=+"4px";n.style.marginRight="12px";n.value="100%";t.appendChild(n);var v=this.addCheckbox(t,mxResources.get("fit"),!0);D=null!=this.pages&&1<this.pages.length;var G=G=this.addCheckbox(t,mxResources.get("allPages"),D,!D),H=this.addCheckbox(t,mxResources.get("layers"),!0),I=this.addCheckbox(t,mxResources.get("tags"),!0),g=this.addCheckbox(t,mxResources.get("lightbox"),!0),q=null;if(EditorUi.enableHtmlEditOption){q=this.addEditButton(t,g);var C=q.getEditInput();C.style.marginBottom="16px";A+=50;mxEvent.addListener(g,+"change",function(){g.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled");C.checked&&g.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,t,mxUtils.bind(this,function(){m(B.checked?k:null,V.checked,n.value,F.getTarget(),F.getColor(),v.checked,G.checked,H.checked,I.checked,g.checked,null!=q?q.getLink():null,null!=U?U.value:null)}),null,c,d);this.showDialog(c.container,340,A,!0,!0);u.focus()};+EditorUi.prototype.showPublishLinkDialog=function(c,d,k,m,t,u,A,B,D,N,F,U){var V=document.createElement("div");V.style.whiteSpace="nowrap";var n=document.createElement("h3");mxUtils.write(n,c||mxResources.get("publish"));n.style.width="100%";n.style.textAlign="center";n.style.marginTop="2px";n.style.marginBottom="20px";V.appendChild(n);var v=document.createElement("select");c=30;v.className="geBtn";v.style.marginBottom="8px";v.style.marginLeft="0px";v.style.width="100%";v.style.boxSizing="border-box";+if(null==B||""==B.getHash())t=null!=t?t:"https://www.drawio.com/doc/faq/publish-diagram-as-link",n=document.createElement("option"),mxUtils.write(n,mxResources.get("makeCopy")),n.setAttribute("value","copy"),v.appendChild(n);n=document.createElement("option");mxUtils.write(n,mxResources.get("authorizationRequired"));n.setAttribute("value","auth");v.appendChild(n);null!=B&&""!=B.getHash()||n.setAttribute("disabled","disabled");B=document.createElement("option");B.setAttribute("value","public");v.appendChild(B);+null!=A?(mxUtils.write(B,mxResources.get("publicDiagramUrl")),B.setAttribute("title",A),v.value="public"):(mxUtils.write(B,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),B.setAttribute("disabled","disabled"));V.appendChild(v);mxUtils.br(V);v.focus();var G=null,H=null;if(null!=d||null!=k)c+=30,mxUtils.write(V,mxResources.get("width")+":"),G=document.createElement("input"),G.setAttribute("type","text"),G.style.marginRight="16px",G.style.width="50px",G.style.marginLeft=+"6px",G.style.marginRight="16px",G.style.marginBottom="10px",G.value="100%",V.appendChild(G),mxUtils.write(V,mxResources.get("height")+":"),H=document.createElement("input"),H.setAttribute("type","text"),H.style.width="50px",H.style.marginLeft="6px",H.style.marginBottom="10px",H.value=k+"px",V.appendChild(H),mxUtils.br(V);var I=this.addLinkSection(V,m),g=N?this.addCheckbox(V,mxResources.get("transparentBackground"),!1):null;null!=g&&(c+=20);var q=document.createElement("select");q.className="geBtn";+q.style.marginTop="8px";d=document.createElement("option");mxUtils.write(d,mxResources.get("allPages"));d.setAttribute("value","allPages");q.appendChild(d);d=document.createElement("option");mxUtils.write(d,mxResources.get("currentPage"));d.setAttribute("value","currentPage");q.appendChild(d);var C=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,d=null!=this.currentPage?this.currentPage.getName():"",16<d.length&&(d=d.substring(0,16)+"..."),U&&(mxUtils.write(V,+mxResources.get("pages")+":"),V.appendChild(q),mxUtils.br(V),c+=30),C=this.addCheckbox(V,mxResources.get("selectedPage")+": "+d));var J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft="8px";J.style.marginTop="16px";U=document.createElement("option");U.setAttribute("value","0");mxUtils.write(U,mxResources.get("light"));J.appendChild(U);U=document.createElement("option");U.setAttribute("value","1");mxUtils.write(U,mxResources.get("dark"));J.appendChild(U);U=document.createElement("option");+U.setAttribute("value","auto");mxUtils.write(U,mxResources.get("automatic"));U.setAttribute("selected","selected");J.appendChild(U);F&&(mxUtils.write(V,mxResources.get("appearance")+":"),V.appendChild(J),mxUtils.br(V),c+=30);var M=this.addCheckbox(V,mxResources.get("lightbox"),!0,null,null,!m),Q=this.addEditButton(V,M),T=Q.getEditInput();m&&(T.style.marginLeft=M.style.marginLeft,M.style.display="none",c-=20);var P=this.addCheckbox(V,mxResources.get("layers"),!0);P.style.marginLeft=T.style.marginLeft;+P.style.marginTop="8px";var S=this.addCheckbox(V,mxResources.get("tags"),!0);S.style.marginLeft=T.style.marginLeft;S.style.marginBottom="16px";S.style.marginTop="16px";mxEvent.addListener(M,"change",function(){M.checked?(P.removeAttribute("disabled"),T.removeAttribute("disabled"),S.removeAttribute("disabled")):(P.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"));T.checked&&M.checked?Q.getEditSelect().removeAttribute("disabled"):Q.getEditSelect().setAttribute("disabled",+"disabled")});m=new CustomDialog(this,V,mxUtils.bind(this,function(){D(I.getTarget(),I.getColor(),null==C?!1:C.checked,M.checked,Q.getLink(),P.checked,null!=G?G.value:null,null!=H?H.value:null,S.checked,v.value,null!=g?g.checked:!1,J.value,"allPages"==q.value)}),null,mxResources.get("create"),t,u);this.showDialog(m.container,340,296+c,!0,!0);null!=G?(G.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)):null==v.parentNode;I.focus()};+EditorUi.prototype.showRemoteExportDialog=function(c,d,k,m,t){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:"+(t?"10":"4")+"px";u.appendChild(A);if(t){mxUtils.write(u,mxResources.get("zoom")+":");var B=document.createElement("input");B.setAttribute("type","text");B.style.marginRight="16px";B.style.width="60px";B.style.marginLeft=+"4px";B.style.marginRight="12px";B.value=this.lastExportZoom||"100%";u.appendChild(B);mxUtils.write(u,mxResources.get("borderWidth")+":");var D=document.createElement("input");D.setAttribute("type","text");D.style.marginRight="16px";D.style.width="60px";D.style.marginLeft="4px";D.value=this.lastExportBorder||"0";u.appendChild(D);mxUtils.br(u)}var N=this.addCheckbox(u,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),F=m?null:this.addCheckbox(u,mxResources.get("includeCopyOfMyDiagram"),+Editor.defaultIncludeDiagram);A=this.editor.graph;var U=m?null:this.addCheckbox(u,mxResources.get("transparentBackground"),A.background==mxConstants.NONE||null==A.background);null!=U&&(U.style.marginBottom="16px");c=new CustomDialog(this,u,mxUtils.bind(this,function(){var V=parseInt(B.value)/100||1,n=parseInt(D.value)||0;k(!N.checked,null!=F?F.checked:!1,null!=U?U.checked:!1,V,n)}),null,c,d);this.showDialog(c.container,300,(t?25:0)+(m?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,+d,k,m,t,u,A,B,D){A=null!=A?A:Editor.defaultIncludeDiagram;var N=document.createElement("div");N.style.whiteSpace="nowrap";var F=this.editor.graph,U="jpeg"==B||"webp"==B?220:320,V=document.createElement("h3");mxUtils.write(V,c);V.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";N.appendChild(V);mxUtils.write(N,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft=+"4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";N.appendChild(n);mxUtils.write(N,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";N.appendChild(v);mxUtils.br(N);var G=this.addCheckbox(N,mxResources.get("selectionOnly"),!1,F.isSelectionEmpty()),H=document.createElement("input");H.style.marginTop="16px";H.style.marginRight=+"8px";H.style.marginLeft="24px";H.setAttribute("disabled","disabled");H.setAttribute("type","checkbox");var I=document.createElement("select");I.style.marginTop="16px";I.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(V=0;V<c.length;V++)if(!F.isSelectionEmpty()||"selectionOnly"!=c[V]){var g=document.createElement("option");mxUtils.write(g,mxResources.get(c[V]));g.setAttribute("value",c[V]);I.appendChild(g)}D?(mxUtils.write(N,mxResources.get("size")+":"),N.appendChild(I),mxUtils.br(N),+U+=26,mxEvent.addListener(I,"change",function(){"selectionOnly"==I.value&&(G.checked=!0)})):u&&(N.appendChild(H),mxUtils.write(N,mxResources.get("crop")),mxUtils.br(N),U+=30,mxEvent.addListener(G,"change",function(){G.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")}));F.isSelectionEmpty()?D&&(G.style.display="none",G.nextSibling.style.display="none",G.nextSibling.nextSibling.style.display="none",U-=30):(I.value="diagram",H.setAttribute("checked","checked"),H.defaultChecked=+!0,mxEvent.addListener(G,"change",function(){I.value=G.checked?"selectionOnly":"diagram"}));var q=this.addCheckbox(N,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=B&&"webp"!=B),C=document.createElement("select");C.style.maxWidth="260px";C.style.marginLeft="8px";C.style.marginTop="16px";u=document.createElement("option");u.setAttribute("value","light");mxUtils.write(u,mxResources.get("light"));C.appendChild(u);D=document.createElement("option");D.setAttribute("value","dark");mxUtils.write(D,+mxResources.get("dark"));C.appendChild(D);"svg"==B&&mxUtils.lightDarkColorSupported?(u=document.createElement("option"),u.setAttribute("value","auto"),mxUtils.write(u,mxResources.get("automatic")),u.setAttribute("selected","selected"),C.appendChild(u)):Editor.isDarkMode()?D.setAttribute("selected","selected"):u.setAttribute("selected","selected");mxUtils.write(N,mxResources.get("appearance")+":");N.appendChild(C);mxUtils.br(N);U+=26;var J=this.addCheckbox(N,mxResources.get("shadow"),F.shadowVisible),+M=null;if("png"==B||"jpeg"==B||"webp"==B)M=this.addCheckbox(N,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),U+=30;F=null!=this.pages?this.pages.length:1;var Q=this.addCheckbox(N,mxResources.get("includeCopyOfMyDiagram")+(1<F?":":""),A,null,null,"jpeg"!=B&&"webp"!=B),T=document.createElement("select");T.style.maxWidth="260px";T.style.marginLeft="28px";"png"==B||"svg"==B?(A=function(){Q.checked?T.removeAttribute("disabled"):T.setAttribute("disabled","disabled")},u=document.createElement("option"),+u.setAttribute("value","allPages"),mxUtils.write(u,mxResources.get("allPages")),T.appendChild(u),u=document.createElement("option"),u.setAttribute("value","currentPage"),mxUtils.write(u,mxResources.get("currentPage")),T.appendChild(u),1<F?(Q.style.marginBottom="12px",T.style.marginBottom="16px",N.appendChild(T),mxUtils.br(N),U+=20):Q.style.marginBottom="16px",null!=this.lastEmbedInclude&&(T.value=this.lastEmbedInclude),mxEvent.addListener(Q,"change",A),A()):Q.style.marginBottom="16px";var P=document.createElement("input");+P.style.marginBottom="16px";P.style.marginRight="8px";P.setAttribute("type","checkbox");P.id="geCheckbox-"+Editor.guid();var S=document.createElement("input");S.style.marginBottom="16px";S.style.marginRight="8px";S.setAttribute("type","checkbox");S.id="geCheckbox-"+Editor.guid();d&&(P.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,N.appendChild(P),A=document.createElement("label"),mxUtils.write(A,mxResources.get("embedImages")),A.setAttribute("for",P.id),N.appendChild(A),mxUtils.br(N),+S.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,N.appendChild(S),A=document.createElement("label"),mxUtils.write(A,mxResources.get("embedFonts")),A.setAttribute("for",S.id),N.appendChild(A),mxUtils.br(N),U+=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"==B&&(mxUtils.write(N,mxResources.get("links")+":"),N.appendChild(W),N.appendChild(A),mxUtils.br(N),mxUtils.br(N),U+=50);k=new CustomDialog(this,N,mxUtils.bind(this,function(){this.lastExportBorder=+v.value;this.lastExportZoom=n.value;this.lastEmbedImages=P.checked;this.lastEmbedFonts=S.checked;this.lastEmbedInclude=T.value;t(n.value,q.checked,!G.checked,J.checked,Q.checked,P.checked&&d,v.value,H.checked,("png"==B||"svg"==B)&&"currentPage"==T.value,W.value,null!=M?M.checked:null,null!=C?C.value:null,I.value,S.checked)}),null,k,m);this.showDialog(k.container,340,U,!0,!0,null,null,null,null,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",+!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,d,k,m,t){var u=document.createElement("div");u.style.whiteSpace="nowrap";var A=this.editor.graph;if(null!=d){var B=document.createElement("h3");mxUtils.write(B,d);B.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";u.appendChild(B)}var D=this.addCheckbox(u,mxResources.get("fit"),!0),N=this.addCheckbox(u,mxResources.get("shadow"),A.shadowVisible&&m,!m),F=this.addCheckbox(u,k),U=this.addCheckbox(u,mxResources.get("lightbox"),+!0),V=this.addEditButton(u,U),n=V.getEditInput(),v=1<A.model.getChildCount(A.model.getRoot()),G=this.addCheckbox(u,mxResources.get("layers"),v,!v);G.style.marginLeft=n.style.marginLeft;G.style.marginBottom="12px";G.style.marginTop="8px";mxEvent.addListener(U,"change",function(){U.checked?(v&&G.removeAttribute("disabled"),n.removeAttribute("disabled")):(G.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled"));n.checked&&U.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled",+"disabled")});d=new CustomDialog(this,u,mxUtils.bind(this,function(){c(D.checked,N.checked,F.checked,U.checked,V.getLink(),G.checked)}),null,mxResources.get("embed"),t);this.showDialog(d.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,d,k,m,t,u,A,B){function D(n){var v=" ",G="";m&&(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!=F?"&page="+F:"")+(t?"&edit=_blank":"")+(u?"&layers=1":"")+"');}})(this);\"",G+="cursor:pointer;");c&&(G+="max-width:100%;");var H="";k&&(H=' width="'+Math.round(N.width)+'" height="'+Math.round(N.height)+'"');A('<img src="'+n+'"'+H+(""!=G?' style="'+G+'"':"")+v+"/>")}var N=this.editor.graph.getGraphBounds(),F=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(n){var v=m?this.getFileData(!0):+null;n=this.createImageDataUri(n,v,"png");D(n)}),null,null,null,mxUtils.bind(this,function(n){B({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,d,null,null,Editor.defaultBorder);else if(d=this.getFileData(!0),N.width*N.height<=MAX_AREA&&d.length<=MAX_REQUEST_SIZE){var U="";k&&(U="&w="+Math.round(2*N.width)+"&h="+Math.round(2*N.height));var V=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(m?"1":"0")+U+"&xml="+encodeURIComponent(d));V.send(mxUtils.bind(this,function(){200<=+V.getStatus()&&299>=V.getStatus()?D("data:image/png;base64,"+V.getText()):B({message:mxResources.get("unknownError")})}))}else B({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,d,k,m,t,u,A){var B=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),D=B.getElementsByTagName("a");if(null!=D)for(var N=0;N<D.length;N++){var F=D[N].getAttribute("href");null!=F&&"#"==F.charAt(0)&&"_blank"==D[N].getAttribute("target")&&D[N].removeAttribute("target")}m&&+B.setAttribute("content",this.getFileData(!0));d&&this.editor.graph.addSvgShadow(B);if(k){var U=" ",V="";m&&(U="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"+(t?"&edit=_blank":"")+(u?"&layers=1":+"")+"');}})(this);\"",V+="cursor:pointer;");c&&(V+="max-width:100%;");this.editor.convertImages(B,mxUtils.bind(this,function(n){A('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(n))+'"'+(""!=V?' style="'+V+'"':"")+U+"/>")}))}else V="",m&&(d=this.getSelectedPageIndex(),B.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!=d?"&page="+d:"")+(t?"&edit=_blank":"")+(u?"&layers=1":"")+"');}}})(this);"),V+="cursor:pointer;"),c&&(c=parseInt(B.getAttribute("width")),t=parseInt(B.getAttribute("height")),B.setAttribute("viewBox","-0.5 -0.5 "+c+" "+t),V+="max-width:100%;max-height:"+t+"px;",B.removeAttribute("height")),""!=V&&B.setAttribute("style",V),this.editor.addFontCss(B),this.editor.graph.mathEnabled&&this.editor.addMathCss(B),A(mxUtils.getXml(B))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var d=Math.floor(c/31536E3);if(1<d)return d+" "+mxResources.get("years");d=Math.floor(c/2592E3);if(1<d)return d+" "+mxResources.get("months");d=Math.floor(c/86400);if(1<d)return d+" "+mxResources.get("days");d=Math.floor(c/3600);if(1<d)return d+" "+mxResources.get("hours");d=Math.floor(c/60);return 1<d?d+" "+mxResources.get("minutes"):1==d?d+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,d){if(null!=c){var k=null;if("diagram"==c.nodeName)k=-c;else if("mxfile"==c.nodeName){var m=c.getElementsByTagName("diagram");if(0<m.length){k=m[0];var t=d.getGlobalVariable;d.getGlobalVariable=function(v){return"page"==v?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==v?1:t.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}m=this.editor.graph;try{this.editor.graph=d,this.editor.setGraphXml(c)}catch(v){}finally{this.editor.graph=m}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};-EditorUi.prototype.getPngFileProperties=function(c){var d=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var m=parseFloat(c.getAttribute("scale"));!isNaN(m)&&0<m&&(d=m)}c.hasAttribute("border")&&(m=parseInt(c.getAttribute("border")),!isNaN(m)&&0<m&&(k=m))}return{scale:d,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,d,k,m,t){try{var v=this.editor.graph,A=null;if(null!=k&&0<k.length)v=this.createTemporaryGraph(v.getStylesheet()),document.body.appendChild(v.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,-!0),v),A=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){v=this.createTemporaryGraph(v.getStylesheet());var C=v.getGlobalVariable;v.setBackgroundImage=this.editor.graph.setBackgroundImage;var E=this.pages[0];this.currentPage==E?v.setBackgroundImage(this.editor.graph.backgroundImage):null!=E.viewState&&null!=E.viewState&&v.setBackgroundImage(E.viewState.backgroundImage);v.getGlobalVariable=function(D){return"page"==D?E.getName():"pagenumber"==D?1:C.apply(this,arguments)};document.body.appendChild(v.container);-v.model.setRoot(E.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(D){try{null==A&&(A=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var U=D.toDataURL("image/png");U=Editor.writeGraphModelToPng(U,"tEXt","mxfile",encodeURIComponent(A));c(U.substring(U.lastIndexOf(",")+1));v!=this.editor.graph&&v.container.parentNode.removeChild(v.container)}catch(T){null!=d&&d(T)}}),null,null,null,mxUtils.bind(this,function(D){null!=d&&d(D)}),null,null,m,null,v.shadowVisible,null,v,t,null,-null,null,"diagram",null)}catch(D){null!=d&&d(D)}};EditorUi.prototype.getEmbeddedSvg=function(c,d,k,m,t,v,A,C,E,D,U,T,V){C=null!=C?C:!0;U=null!=U?U:0;A=null!=E?E:d.background;A==mxConstants.NONE&&(A=null);null==A&&"none"==d.getAdaptiveColors()&&(A="#ffffff");E=this.editor.graph.createSvgImageExport(null!=c);v=d.getSvg(A,D,U,null,null,v,null,E,null,d.shadowVisible||T,null,V,"diagram");(d.shadowVisible||T)&&d.addSvgShadow(v,null,null,0==U);null!=c&&v.setAttribute("content",c);null!=k&&v.setAttribute("resource",-k);var n=mxUtils.bind(this,function(u){u=(m?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(u);null!=t&&t(u);return u});d.mathEnabled&&this.editor.addMathCss(v);if(null!=t)this.embedFonts(v,mxUtils.bind(this,function(u){C?this.editor.convertImages(u,mxUtils.bind(this,function(G){n(G)})):n(u)}));else return n(v)};EditorUi.prototype.embedFonts=function(c,d){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),d(c)}catch(m){d(c)}}))}catch(k){d(c)}}))};EditorUi.prototype.exportImage=function(c,d,k,m,t,v,A,C,E,D,U,T,V){E=null!=E?E:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(u){Editor.addRetryToError(u,mxUtils.bind(this,function(){this.exportImage(c,d,k,m,t,v,A,C,E,D,U,T,V)}));this.handleError(u)}))){var n=this.editor.graph.isSelectionEmpty();-k=null!=k?k:n;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(u){this.spinner.stop();try{this.saveCanvas(u,t?this.getFileData(!0,null,null,null,k,C,null,null,null,null,null,c,v):null,E,null==this.pages||0==this.pages.length,U)}catch(G){this.handleError(G)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u)}),null,k,c||1,d,m,null,null,v,A,D,T,V)}catch(u){this.spinner.stop(),this.handleError(u)}}};-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 d=0;d<this.pages.length;d++)c[this.pages[d].getId()]=this.pages[d].getId();return c};EditorUi.prototype.importXml=function(c,d,k,m,t,v,A){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[d],"dy",[k],"crop",[m],"noErrorHandling",[t],"addNewPage",[v],"applyDefaultStyles",[A]);d=null!=d?d:0;k=null!=k?k:-0;var C=[];try{if(null!=c&&0<c.length){var E=null!=this.pages?this.pages.length:0,D=this.isDiagramEmpty(),U=this.currentPage,T=this.editor.graph;T.model.beginUpdate();try{var V=mxUtils.parseXml(c);c={};var n=this.editor.extractGraphModel(V.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var u=n.getElementsByTagName("diagram");if(0<u.length){V=[];var G=0;if(1==u.length&&!v){if(null!=this.currentPage&&(c[u[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var H=-u[0].getAttribute("name");null!=H&&""!=H&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,H))}n=Editor.parseDiagramNode(u[0]);m=!1;G=1}for(;G<u.length;G++){var I=u[G].getAttribute("id");u[G].removeAttribute("id");var g=this.updatePageRoot(new DiagramPage(u[G]));c[I]=u[G].getAttribute("id");var q=this.pages.length;null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[q+1]));T.model.execute(new ChangePage(this,g,g,q,0<G));V.push(g)}this.updatePageLinks(c,V)}}if(null!=n&&-"mxGraphModel"===n.nodeName){C=T.importGraphModel(n,d,k,m);if(null!=C)for(this.addLocalPagesToMapping(c),G=0;G<C.length;G++)this.updatePageLinksForCell(c,C[G]);var B=T.parseBackgroundImage(n.getAttribute("backgroundImage"));if(null!=B&&null!=B.originalSrc&&this.updateBackgroundPageLink(c,B)){var J=new ChangePageSetup(this,null,B);J.ignoreColor=!0;T.model.execute(J)}}A&&T.pasteCellStyles(T.includeDescendants(C),T.defaultVertexStyle,T.defaultEdgeStyle);!v&&U!=this.currentPage&&null!=this.pages&&1<this.pages.length&&-D&&1==E&&this.removePage(U)}finally{T.model.endUpdate()}}}catch(Q){if(t)throw Q;this.handleError(Q)}return C};EditorUi.prototype.updatePageLinks=function(c,d){for(var k=0;k<d.length;k++)this.updatePageLinksForCell(c,d[k].root),null!=d[k].viewState&&this.updateBackgroundPageLink(c,d[k].viewState.backgroundImage)&&(d[k]==this.currentPage&&this.editor.graph.setViewState(d[k].viewState,!0),d[k].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,d){var k=!1;try{if(null!=d&&Graph.isPageLink(d.originalSrc)){var m=-c[d.originalSrc.substring(d.originalSrc.indexOf(",")+1)];null!=m&&(d.originalSrc="data:page/id,"+m,k=!0)}}catch(t){}return k};EditorUi.prototype.updatePageLinksForCell=function(c,d){var k=document.createElement("div"),m=this.editor.graph,t=m.getLinkForCell(d);null!=t&&m.setLinkForCell(d,this.updatePageLink(c,t));if(m.isHtmlLabel(d)){k.innerHTML=Graph.sanitizeHtml(m.getLabel(d));for(var v=k.getElementsByTagName("a"),A=!1,C=0;C<v.length;C++)t=v[C].getAttribute("href"),null!=t&&(v[C].setAttribute("href",-this.updatePageLink(c,t)),A=!0);A&&m.labelChanged(d,k.innerHTML)}for(C=0;C<m.model.getChildCount(d);C++)this.updatePageLinksForCell(c,m.model.getChildAt(d,C))};EditorUi.prototype.updatePageLink=function(c,d){if(Graph.isPageLink(d)){var k=c[d.substring(d.indexOf(",")+1)];d=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==d.substring(0,17))try{var m=JSON.parse(d.substring(17));if(null!=m.actions){for(var t=0;t<m.actions.length;t++){var v=m.actions[t];if(null!=v.open&&Graph.isPageLink(v.open)){var A=-v.open.substring(v.open.indexOf(",")+1);k=c[A];null!=k?v.open="data:page/id,"+k:null==this.getPageById(A)&&delete v.open}}d="data:action/json,"+JSON.stringify(m)}}catch(C){}return d};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,d,k,m,t){var v=mxUtils.bind(this,function(A){this.loadingExtensions=!1;null!=k?k(A):this.handleError(A)});this.createTimeout(null,mxUtils.bind(this,function(A){m=-null!=m?m:c.name;var C=mxUtils.bind(this,function(D){A.clear()&&v(D)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var D=this.isRemoteVisioFormat(m);try{var U=m.lastIndexOf(".");if(0<=U&&U<m.length)m.substring(U+1).toUpperCase();else{var T=m.lastIndexOf("/");0<=T&&T<m.length&&(m=m.substring(T+1))}}catch(n){}if(D)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(m)?C({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):C({message:"draw.io"!=-this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{D=new FormData;D.append("file1",c,m);var V=new XMLHttpRequest;V.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(m)?"?stencil=1":""));V.responseType="blob";this.addRemoteServiceSecurityCheck(V);null!=t&&V.setRequestHeader("x-convert-custom",t);V.onreadystatechange=mxUtils.bind(this,function(){if(4==V.readyState&&A.clear())if(200<=V.status&&299>=V.status)try{var n=V.response;if("text/xml"==-n.type){var u=new FileReader;u.onload=mxUtils.bind(this,function(G){try{d(G.target.result)}catch(H){C({message:mxResources.get("errorLoadingFile")})}});u.readAsText(n)}else this.doImportVisio(n,d,C,m)}catch(G){C(G)}else try{""==V.responseType||"text"==V.responseType?C({message:V.responseText}):(u=new FileReader,u.onload=function(){try{C({message:JSON.parse(u.result).Message})}catch(G){null!=u.result&&0<u.result.length?C({message:u.result}):C(G)}},u.readAsText(V.response))}catch(G){C({})}});V.send(D)}else if(A.clear())try{this.doImportVisio(c,-d,C,m)}catch(n){C(n)}}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,C))}),v)};EditorUi.prototype.importGraphML=function(c,d,k){var m=mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var v=mxUtils.bind(this,function(C){t.clear()&&-m(C)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,d,m)}catch(C){v(C)}else v({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,v))}),m)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var d=-mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var m=mxUtils.bind(this,function(v){k.clear()&&d(v)}),t=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||m({message:mxResources.get("unknownError")})}catch(v){m(v)}else m({message:mxResources.get("serviceUnavailableOrBlocked")})});-"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(t,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,m))}),d):d({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,d,k){var m=mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var v=mxUtils.bind(this,function(C){t.clear()&&-m(C)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if("undefined"!==typeof window.LucidImporter)try{var C=JSON.parse(c);d(LucidImporter.importState(C));try{if(null!=window.console&&"1"==urlParams.test){var E=[(new Date).toISOString(),"convertLucidChart",C];null!=C.state&&E.push(JSON.parse(C.state));if(null!=C.svgThumbs)for(var D=0;D<C.svgThumbs.length;D++)E.push(Editor.createSvgDataUri(C.svgThumbs[D]));null!=C.thumb&&E.push(C.thumb);console.log.apply(console,E)}}catch(U){}}catch(U){null!=-window.console&&console.error(U),v(U)}else v({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,v)},null,null,null,v)},null,null,null,v)},null,null,null,v)},null,null,null,v):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",A,null,null,null,v))}),m)};EditorUi.prototype.createMermaidXml=function(c,d,k,m,t,v){var A=new Graph(document.createElement("div"));k=A.insertVertex(null,null,null,0,0,m,t,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");A.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,config:d},null,2));null!=v&&A.setAttributeForCell(k,-"templatePrompt",v);c=(new mxCodec).encode(A.getModel());return mxUtils.getXml(c)};EditorUi.prototype.getSvgForXml=function(c){var d=null,k=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(k.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,k.getModel()),d=k.getSvg(null,null,null,null,null,null,null,null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(k.container)}return d};EditorUi.prototype.generateOpenAiMermaidDiagram=-function(c,d,k,m,t){var v=0,A=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(C){var E="";if(null!=this.drive&&null!=this.drive.getUser()){var D=this.drive.getUser();null!=D.email&&0<D.email.indexOf("@")&&(E=D.email.substring(D.email.indexOf("@")+1))}var U={prompt:c,driveDomain:E,options:null!=t?t:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",m,"data",[U],"url",["https://www.draw.io/generate/v3"]);var T=Date.now();-E=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(U),"POST");var V=mxUtils.bind(this,function(u){C.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[U],"error",[u],"time",Date.now()-T+" ms"),k(u))}),n=mxUtils.bind(this,function(u){3>v++?C.clear()&&A():V(u)});E.send(mxUtils.bind(this,function(u){if(C.isAlive())if(200<=u.getStatus()&&299>=u.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var H=u.getText();try{H=JSON.parse(H),result=H.result}catch(I){result=-H}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[U],"response",[H],"time",Date.now()-T+" ms");m?"<"==result.charAt(0)?C.clear()&&(H=Editor.extractGraphModelFromText(result),d(null!=H&&3==H.length?H[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(I){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&d(I)}),V)}),V,n,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(I,g,q){this.tryAndHandle(mxUtils.bind(this,function(){C.clear()&&-d(result,I,g,q)}),V)}),V,n)}),V,!0);else{var G={message:mxResources.get("error")+" "+u.getStatus()};try{G=JSON.parse(u.getText()),null!=G.error&&(G.message=G.error)}catch(H){}V(G)}}),V)}),k)});A()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var d=c.split("```");d=1<d.length?d:c.split("<pre>");d=1<d.length?d:c.split("~~~");d=1<d.length?d:c.split("(Begins)");for(var k=mxUtils.trim(1>=d.length?c:d[1]),m=k.split("\n"),t=0;t<-m.length&&("mermaid"==m[t]||0==m[t].trim().length||"%%"==m[t].substring(0,2));)t++;k=[];for(var v=t;v<m.length;v++){var A=mxUtils.trim(m[v]);if("%%"!=A.substring(0,2)&&"classDef "!=A.substring(0,9))k.push(m[v]);else if("mermaid"==A)break}m=k;k=mxUtils.trim(m.join("\n"));v=1<m.length?m[0]:null;null!=v&&(A=v.indexOf("-"),0<A&&v.substring(0,A));v=m[0].split(" ")[0].replace(/:$/,"");A=v.indexOf("-");0<A&&(v=v.substring(0,A));EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[k],"type",-[v],"startLine",t,"lines",m,"tokens",d);0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,v)&&(k=null);return k};EditorUi.prototype.isSupportedMermaidDiagramType=function(c){return"graph"==c||"flowchart"==c||"sequencediagram"==c||"classdiagram"==c||"statediagram-v2"==c||"statediagram"==c||"erdiagram"==c||"requirementdiagram"==c||"gitgraph"==c||"mindmap"==c||"journey"==c};EditorUi.prototype.getMermaidDiagramType=function(c){c=c.split("\n");for(var d=0;d<c.length&&(0==c[d].trim().length||"%%"==c[d].substring(0,-2));)d++;if("---"==c[d].trim()){do d++;while(d<c.length&&"---"!=c[d].trim());d++}c=c[d].trim().toLowerCase();d=c.indexOf(" ");return c.substring(0,0<d?d:c.length)};EditorUi.prototype.parseMermaidDiagram=function(c,d,k,m,t,v){var A=!1;v&&"undefined"!==typeof mxMermaidToDrawio&&this.isSupportedMermaidDiagramType(this.getMermaidDiagramType(c))&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(C){A||C==this.emptyDiagramXml||(A=!0,k(C))}));this.generateMermaidImage(c,d,mxUtils.bind(this,function(C,-E,D){A||(A=!0,k(this.createMermaidXml(c,d,C,E,D)))}),m,t)};EditorUi.prototype.loadMermaid=function(c,d){var k=mxUtils.bind(this,function(t){this.loadingMermaid=!1;d(t)}),m=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(t){k(t)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(m,0):(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",m,null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",m,-null,null,null,k))};EditorUi.prototype.mermaidSvgToDataUri=function(c,d,k,m){try{c=c.replace(/xlink:href/g,"href").replace(/<br>/g,"<br/>");var t=mxUtils.parseXml(c).getElementsByTagName("svg");if(0<t.length&&"error"!=t[0].getAttribute("aria-roledescription")){var v=parseFloat(t[0].getAttribute("width")),A=parseFloat(t[0].getAttribute("height"));if(isNaN(v)||isNaN(A))try{var C=t[0].getAttribute("viewBox").split(/\s+/);v=parseFloat(C[2]);A=parseFloat(C[3])}catch(E){v=v||100,A=A||100}d(this.convertDataUri(Editor.createSvgDataUri(c)),-v,A)}else null!=m?m():k({message:mxResources.get("invalidInput")})}catch(E){k(E)}};EditorUi.prototype.getMermaidConfig=function(c,d){d=null!=d?d:mxUtils.clone(EditorUi.defaultMermaidConfig);d.securityLevel="strict";d.startOnLoad=!1;d.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&d.flowchart&&0<=c.indexOf("$$")&&(d.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(d.theme="dark");return d};EditorUi.prototype.generateMermaidImage=function(c,d,k,m,t){var v=mxUtils.bind(this,-function(A){null!=m?m(A):this.handleError(A)});this.loadMermaid(mxUtils.bind(this,function(){try{mermaid.mermaidAPI.initialize(this.getMermaidConfig(c,d)),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(mxUtils.bind(this,function(A){this.mermaidSvgToDataUri(A.svg,k,m,t)})).catch(mxUtils.bind(this,function(A){this.removeMermaidErrors();A=Error(A.toString()+"\n\n"+c);"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();null!=t?t(A):v(A)}))}catch(A){v(A)}}),-v)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),d=0;d<c.length;d++)null!=c[d].parentNode&&c[d].parentNode.removeChild(c[d])};EditorUi.prototype.generatePlantUmlImage=function(c,d,k,m){function t(C,E,D){c1=C>>2;c2=(C&3)<<4|E>>4;c3=(E&15)<<2|D>>6;c4=D&63;r="";r+=v(c1&63);r+=v(c2&63);r+=v(c3&63);return r+=v(c4&63)}function v(C){if(10>C)return String.fromCharCode(48+C);C-=10;if(26>C)return String.fromCharCode(65+C);C-=26;if(26>-C)return String.fromCharCode(97+C);C-=26;return 0==C?"-":1==C?"_":"?"}var A=new XMLHttpRequest;A.open("GET",("txt"==d?PLANT_URL+"/txt/":"png"==d?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(C){r="";for(i=0;i<C.length;i+=3)r=i+2==C.length?r+t(C.charCodeAt(i),C.charCodeAt(i+1),0):i+1==C.length?r+t(C.charCodeAt(i),0,0):r+t(C.charCodeAt(i),C.charCodeAt(i+1),C.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=d&&(A.responseType="blob");A.onload=function(C){if(200<=this.status&&-300>this.status)if("txt"==d)k(this.response);else{var E=new FileReader;E.readAsDataURL(this.response);E.onloadend=function(D){var U=new Image;U.onload=function(){try{var T=U.width,V=U.height;if(0==T&&0==V){var n=E.result,u=n.indexOf(","),G=decodeURIComponent(escape(atob(n.substring(u+1)))),H=mxUtils.parseXml(G).getElementsByTagName("svg");0<H.length&&(T=parseFloat(H[0].getAttribute("width")),V=parseFloat(H[0].getAttribute("height")))}k(E.result,T,V)}catch(I){m(I)}};U.src=E.result};E.onerror=function(D){m(D)}}else m(C)};-A.onerror=function(C){m(C)};A.send()};EditorUi.prototype.insertAsPreText=function(c,d,k){var m=this.editor.graph,t=null;m.getModel().beginUpdate();try{t=m.insertVertex(null,null,"<pre>"+c+"</pre>",d,k,1,1,"text;html=1;align=left;verticalAlign=top;"),m.updateCellSize(t,!0)}finally{m.getModel().endUpdate()}return t};EditorUi.prototype.insertTextAt=function(c,d,k,m,t,v,A,C){v=null!=v?v:!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(V){4==V.readyState&&200<=V.status&&299>=V.status&&this.editor.graph.setSelectionCells(this.insertTextAt(V.responseText,d,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(t||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var E=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var D=Editor.extractGraphModelFromPdf(c);if(null!=-D&&0<D.length)return this.importXml(D,d,k,v,!0,C)}if(Editor.isPngDataUrl(c)&&(D=Editor.extractGraphModelFromPng(c),null!=D&&0<D.length))return this.importXml(D,d,k,v,!0,C);if("data:image/svg+xml;"==c.substring(0,19))try{D=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(D=c.substring(c.indexOf(",")+1),D=window.atob&&!mxClient.IS_SF?atob(D):Base64.decode(D,!0)):D=decodeURIComponent(c.substring(c.indexOf(",")+1));var U=this.importXml(D,d,k,v,!0,C);if(0<U.length)return U}catch(V){}this.loadImage(c,-mxUtils.bind(this,function(V){if("data:"==c.substring(0,5))this.resizeImage(V,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(G,H,I){E.setSelectionCell(E.insertVertex(null,null,"",E.snap(d),E.snap(k),H,I,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(G)+";"))}),A,this.maxImageSize);else{var n=Math.min(1,Math.min(this.maxImageSize/V.width,this.maxImageSize/V.height)),-u=Math.round(V.width*n);V=Math.round(V.height*n);E.setSelectionCell(E.insertVertex(null,null,"",E.snap(d),E.snap(k),u,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var V=null;E.getModel().beginUpdate();try{V=E.insertVertex(E.getDefaultParent(),null,c,E.snap(d),E.snap(k),1,1,"text;"+(m?"html=1;":"")),E.updateCellSize(V),E.fireEvent(new mxEventObject("textInserted","cells",[V]))}finally{E.getModel().endUpdate()}E.setSelectionCell(V)}))}else{c=-Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,d,k,v,null,C);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(V){this.editor.graph.setSelectionCells(this.importXml(V,d,k,v,null,C))}),mxUtils.bind(this,function(V){this.handleError(V)}));else{E=this.editor.graph;t=null;E.getModel().beginUpdate();try{t=E.insertVertex(E.getDefaultParent(),null,"",E.snap(d),E.snap(k),1,1,"text;whiteSpace=wrap;"+(m?"html=1;":""));E.fireEvent(new mxEventObject("textInserted",-"cells",[t]));m&&(c=E.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");t.value=c;E.updateCellSize(t);if(0<this.maxTextWidth&&t.geometry.width>this.maxTextWidth){var T=E.getPreferredSizeForCell(t,this.maxTextWidth);t.geometry.width=T.width;t.geometry.height=T.height}Graph.isLink(t.value)&&E.setLinkForCell(t,t.value);t.geometry.width+=E.gridSize;t.geometry.height+=E.gridSize}finally{E.getModel().endUpdate()}return[t]}}return[]};EditorUi.prototype.formatFileSize=+c;else if("mxfile"==c.nodeName){var m=c.getElementsByTagName("diagram");if(0<m.length){k=m[0];var t=d.getGlobalVariable;d.getGlobalVariable=function(u){return"page"==u?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==u?1:t.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}m=this.editor.graph;try{this.editor.graph=d,this.editor.setGraphXml(c)}catch(u){}finally{this.editor.graph=m}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};+EditorUi.prototype.getPngFileProperties=function(c){var d=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var m=parseFloat(c.getAttribute("scale"));!isNaN(m)&&0<m&&(d=m)}c.hasAttribute("border")&&(m=parseInt(c.getAttribute("border")),!isNaN(m)&&0<m&&(k=m))}return{scale:d,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,d,k,m,t){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 B=u.getGlobalVariable;u.setBackgroundImage=this.editor.graph.setBackgroundImage;var D=this.pages[0];this.currentPage==D?u.setBackgroundImage(this.editor.graph.backgroundImage):null!=D.viewState&&null!=D.viewState&&u.setBackgroundImage(D.viewState.backgroundImage);u.getGlobalVariable=function(N){return"page"==N?D.getName():"pagenumber"==N?1:B.apply(this,arguments)};document.body.appendChild(u.container);+u.model.setRoot(D.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(N){try{null==A&&(A=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var F=N.toDataURL("image/png");F=Editor.writeGraphModelToPng(F,"tEXt","mxfile",encodeURIComponent(A));c(F.substring(F.lastIndexOf(",")+1));u!=this.editor.graph&&u.container.parentNode.removeChild(u.container)}catch(U){null!=d&&d(U)}}),null,null,null,mxUtils.bind(this,function(N){null!=d&&d(N)}),null,null,m,null,u.shadowVisible,null,u,t,null,+null,null,"diagram",null)}catch(N){null!=d&&d(N)}};EditorUi.prototype.getEmbeddedSvg=function(c,d,k,m,t,u,A,B,D,N,F,U,V){B=null!=B?B:!0;F=null!=F?F:0;A=null!=D?D:d.background;A==mxConstants.NONE&&(A=null);null==A&&"none"==d.getAdaptiveColors()&&(A="#ffffff");D=this.editor.graph.createSvgImageExport(null!=c);u=d.getSvg(A,N,F,null,null,u,null,D,null,d.shadowVisible||U,null,V,"diagram");(d.shadowVisible||U)&&d.addSvgShadow(u,null,null,0==F);null!=c&&u.setAttribute("content",c);null!=k&&u.setAttribute("resource",+k);var n=mxUtils.bind(this,function(v){v=(m?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(v);null!=t&&t(v);return v});d.mathEnabled&&this.editor.addMathCss(u);if(null!=t)this.embedFonts(u,mxUtils.bind(this,function(v){B?this.editor.convertImages(v,mxUtils.bind(this,function(G){n(G)})):n(v)}));else return n(u)};EditorUi.prototype.embedFonts=function(c,d){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),d(c)}catch(m){d(c)}}))}catch(k){d(c)}}))};EditorUi.prototype.exportImage=function(c,d,k,m,t,u,A,B,D,N,F,U,V){D=null!=D?D:"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,d,k,m,t,u,A,B,D,N,F,U,V)}));this.handleError(v)}))){var n=this.editor.graph.isSelectionEmpty();+k=null!=k?k:n;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(v){this.spinner.stop();try{this.saveCanvas(v,t?this.getFileData(!0,null,null,null,k,B,null,null,null,null,null,c,u):null,D,null==this.pages||0==this.pages.length,F)}catch(G){this.handleError(G)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v)}),null,k,c||1,d,m,null,null,u,A,N,U,V)}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 d=0;d<this.pages.length;d++)c[this.pages[d].getId()]=this.pages[d].getId();return c};EditorUi.prototype.importXml=function(c,d,k,m,t,u,A){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[d],"dy",[k],"crop",[m],"noErrorHandling",[t],"addNewPage",[u],"applyDefaultStyles",[A]);d=null!=d?d:0;k=null!=k?k:+0;var B=[];try{if(null!=c&&0<c.length){var D=null!=this.pages?this.pages.length:0,N=this.isDiagramEmpty(),F=this.currentPage,U=this.editor.graph;U.model.beginUpdate();try{var V=mxUtils.parseXml(c);c={};var n=this.editor.extractGraphModel(V.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var v=n.getElementsByTagName("diagram");if(0<v.length){V=[];var G=0;if(1==v.length&&!u){if(null!=this.currentPage&&(c[v[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var H=+v[0].getAttribute("name");null!=H&&""!=H&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,H))}n=Editor.parseDiagramNode(v[0]);m=!1;G=1}for(;G<v.length;G++){var I=v[G].getAttribute("id");v[G].removeAttribute("id");var g=this.updatePageRoot(new DiagramPage(v[G]));c[I]=v[G].getAttribute("id");var q=this.pages.length;null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[q+1]));U.model.execute(new ChangePage(this,g,g,q,0<G));V.push(g)}this.updatePageLinks(c,V)}}if(null!=n&&+"mxGraphModel"===n.nodeName){B=U.importGraphModel(n,d,k,m);if(null!=B)for(this.addLocalPagesToMapping(c),G=0;G<B.length;G++)this.updatePageLinksForCell(c,B[G]);var C=U.parseBackgroundImage(n.getAttribute("backgroundImage"));if(null!=C&&null!=C.originalSrc&&this.updateBackgroundPageLink(c,C)){var J=new ChangePageSetup(this,null,C);J.ignoreColor=!0;U.model.execute(J)}}A&&U.pasteCellStyles(U.includeDescendants(B),U.defaultVertexStyle,U.defaultEdgeStyle);!u&&F!=this.currentPage&&null!=this.pages&&1<this.pages.length&&+N&&1==D&&this.removePage(F)}finally{U.model.endUpdate()}}}catch(M){if(t)throw M;this.handleError(M)}return B};EditorUi.prototype.updatePageLinks=function(c,d){for(var k=0;k<d.length;k++)this.updatePageLinksForCell(c,d[k].root),d[k]!=this.currentPage&&(d[k].needsUpdate=!0),null!=d[k].viewState&&this.updateBackgroundPageLink(c,d[k].viewState.backgroundImage)&&(d[k]==this.currentPage&&this.editor.graph.setViewState(d[k].viewState,!0),d[k].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=+function(c,d){var k=!1;try{if(null!=d&&Graph.isPageLink(d.originalSrc)){var m=c[d.originalSrc.substring(d.originalSrc.indexOf(",")+1)];null!=m&&(d.originalSrc="data:page/id,"+m,k=!0)}}catch(t){}return k};EditorUi.prototype.updatePageLinksForCell=function(c,d){var k=document.createElement("div"),m=this.editor.graph,t=m.getLinkForCell(d);null!=t&&m.setLinkForCell(d,this.updatePageLink(c,t));if(m.isHtmlLabel(d)){k.innerHTML=Graph.sanitizeHtml(m.getLabel(d));for(var u=k.getElementsByTagName("a"),A=!1,+B=0;B<u.length;B++)t=u[B].getAttribute("href"),null!=t&&(u[B].setAttribute("href",this.updatePageLink(c,t)),A=!0);A&&m.labelChanged(d,k.innerHTML)}for(B=0;B<m.model.getChildCount(d);B++)this.updatePageLinksForCell(c,m.model.getChildAt(d,B))};EditorUi.prototype.updatePageLink=function(c,d){if(Graph.isPageLink(d)){var k=c[d.substring(d.indexOf(",")+1)];d=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==d.substring(0,17))try{var m=JSON.parse(d.substring(17));if(null!=m.actions){for(var t=+0;t<m.actions.length;t++){var u=m.actions[t];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}}d="data:action/json,"+JSON.stringify(m)}}catch(B){}return d};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,d,k,m,t){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){m=null!=m?m:c.name;var B=mxUtils.bind(this,function(N){A.clear()&&u(N)}),D=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var N=this.isRemoteVisioFormat(m);try{var F=m.lastIndexOf(".");if(0<=F&&F<m.length)m.substring(F+1).toUpperCase();else{var U=m.lastIndexOf("/");0<=U&&U<m.length&&(m=m.substring(U+1))}}catch(n){}if(N)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(m)?+B({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):B({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{N=new FormData;N.append("file1",c,m);var V=new XMLHttpRequest;V.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(m)?"?stencil=1":""));V.responseType="blob";this.addRemoteServiceSecurityCheck(V);null!=t&&V.setRequestHeader("x-convert-custom",t);V.onreadystatechange=mxUtils.bind(this,function(){if(4==V.readyState&&+A.clear())if(200<=V.status&&299>=V.status)try{var n=V.response;if("text/xml"==n.type){var v=new FileReader;v.onload=mxUtils.bind(this,function(G){try{d(G.target.result)}catch(H){B({message:mxResources.get("errorLoadingFile")})}});v.readAsText(n)}else this.doImportVisio(n,d,B,m)}catch(G){B(G)}else try{""==V.responseType||"text"==V.responseType?B({message:V.responseText}):(v=new FileReader,v.onload=function(){try{B({message:JSON.parse(v.result).Message})}catch(G){null!=v.result&&0<v.result.length?B({message:v.result}):+B(G)}},v.readAsText(V.response))}catch(G){B({})}});V.send(N)}else if(A.clear())try{this.doImportVisio(c,d,B,m)}catch(n){B(n)}}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?D():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",D,null,null,null,B))}),u)};EditorUi.prototype.importGraphML=function(c,d,k){var m=mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});+this.createTimeout(null,mxUtils.bind(this,function(t){var u=mxUtils.bind(this,function(B){t.clear()&&m(B)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,d,m)}catch(B){u(B)}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))}),m)};EditorUi.prototype.exportVisio=+function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var d=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var m=mxUtils.bind(this,function(u){k.clear()&&d(u)}),t=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||m({message:mxResources.get("unknownError")})}catch(u){m(u)}else m({message:mxResources.get("serviceUnavailableOrBlocked")})});+"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(t,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,m))}),d):d({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,d,k){var m=mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var u=mxUtils.bind(this,function(B){t.clear()&&+m(B)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if("undefined"!==typeof window.LucidImporter)try{var B=JSON.parse(c);d(LucidImporter.importState(B));try{if(null!=window.console&&"1"==urlParams.test){var D=[(new Date).toISOString(),"convertLucidChart",B];null!=B.state&&D.push(JSON.parse(B.state));if(null!=B.svgThumbs)for(var N=0;N<B.svgThumbs.length;N++)D.push(Editor.createSvgDataUri(B.svgThumbs[N]));null!=B.thumb&&D.push(B.thumb);console.log.apply(console,D)}}catch(F){}}catch(F){null!=+window.console&&console.error(F),u(F)}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))}),m)};EditorUi.prototype.createMermaidXml=function(c,d,k,m,t,u){var A=new Graph(document.createElement("div"));k=A.insertVertex(null,null,null,0,0,m,t,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");A.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,config:d},null,2));null!=u&&A.setAttributeForCell(k,+"templatePrompt",u);c=(new mxCodec).encode(A.getModel());return mxUtils.getXml(c)};EditorUi.prototype.getSvgForXml=function(c){var d=null,k=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(k.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,k.getModel()),d=k.getSvg(null,null,null,null,null,null,null,null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(k.container)}return d};EditorUi.prototype.generateOpenAiMermaidDiagram=+function(c,d,k,m,t){var u=0,A=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(B){var D="";if(null!=this.drive&&null!=this.drive.getUser()){var N=this.drive.getUser();null!=N.email&&0<N.email.indexOf("@")&&(D=N.email.substring(N.email.indexOf("@")+1))}var F={prompt:c,driveDomain:D,options:null!=t?t:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",m,"data",[F],"url",["https://www.draw.io/generate/v3"]);var U=Date.now();+D=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(F),"POST");var V=mxUtils.bind(this,function(v){B.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[F],"error",[v],"time",Date.now()-U+" ms"),k(v))}),n=mxUtils.bind(this,function(v){3>u++?B.clear()&&A():V(v)});D.send(mxUtils.bind(this,function(v){if(B.isAlive())if(200<=v.getStatus()&&299>=v.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var H=v.getText();try{H=JSON.parse(H),result=H.result}catch(I){result=+H}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[F],"response",[H],"time",Date.now()-U+" ms");m?"<"==result.charAt(0)?B.clear()&&(H=Editor.extractGraphModelFromText(result),d(null!=H&&3==H.length?H[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(I){this.tryAndHandle(mxUtils.bind(this,function(){B.clear()&&d(I)}),V)}),V,n,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(I,g,q){this.tryAndHandle(mxUtils.bind(this,function(){B.clear()&&+d(result,I,g,q)}),V)}),V,n)}),V,!0);else{var G={message:mxResources.get("error")+" "+v.getStatus()};try{G=JSON.parse(v.getText()),null!=G.error&&(G.message=G.error)}catch(H){}V(G)}}),V)}),k)});A()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var d=c.split("```");d=1<d.length?d:c.split("<pre>");d=1<d.length?d:c.split("~~~");d=1<d.length?d:c.split("(Begins)");for(var k=mxUtils.trim(1>=d.length?c:d[1]),m=k.split("\n"),t=0;t<+m.length&&("mermaid"==m[t]||0==m[t].trim().length||"%%"==m[t].substring(0,2));)t++;k=[];for(var u=t;u<m.length;u++){var A=mxUtils.trim(m[u]);if("%%"!=A.substring(0,2)&&"classDef "!=A.substring(0,9))k.push(m[u]);else if("mermaid"==A)break}m=k;k=mxUtils.trim(m.join("\n"));u=1<m.length?m[0]:null;null!=u&&(A=u.indexOf("-"),0<A&&u.substring(0,A));u=m[0].split(" ")[0].replace(/:$/,"");A=u.indexOf("-");0<A&&(u=u.substring(0,A));EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[k],"type",+[u],"startLine",t,"lines",m,"tokens",d);0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,u)&&(k=null);return k};EditorUi.prototype.isSupportedMermaidDiagramType=function(c){return"graph"==c||"flowchart"==c||"sequencediagram"==c||"classdiagram"==c||"statediagram-v2"==c||"statediagram"==c||"erdiagram"==c||"requirementdiagram"==c||"gitgraph"==c||"mindmap"==c||"journey"==c};EditorUi.prototype.getMermaidDiagramType=function(c){c=c.split("\n");for(var d=0;d<c.length&&(0==c[d].trim().length||"%%"==c[d].substring(0,+2));)d++;if("---"==c[d].trim()){do d++;while(d<c.length&&"---"!=c[d].trim());d++}c=c[d].trim().toLowerCase();d=c.indexOf(" ");return c.substring(0,0<d?d:c.length)};EditorUi.prototype.parseMermaidDiagram=function(c,d,k,m,t,u){var A=!1;u&&"undefined"!==typeof mxMermaidToDrawio&&this.isSupportedMermaidDiagramType(this.getMermaidDiagramType(c))&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(B){A||B==this.emptyDiagramXml||(A=!0,k(B))}));this.generateMermaidImage(c,d,mxUtils.bind(this,function(B,+D,N){A||(A=!0,k(this.createMermaidXml(c,d,B,D,N)))}),m,t)};EditorUi.prototype.loadMermaid=function(c,d){var k=mxUtils.bind(this,function(t){this.loadingMermaid=!1;d(t)}),m=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(t){k(t)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(m,0):(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",m,null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",m,+null,null,null,k))};EditorUi.prototype.mermaidSvgToDataUri=function(c,d,k,m){try{c=c.replace(/xlink:href/g,"href").replace(/<br>/g,"<br/>");var t=mxUtils.parseXml(c).getElementsByTagName("svg");if(0<t.length&&"error"!=t[0].getAttribute("aria-roledescription")){var u=parseFloat(t[0].getAttribute("width")),A=parseFloat(t[0].getAttribute("height"));if(isNaN(u)||isNaN(A))try{var B=t[0].getAttribute("viewBox").split(/\s+/);u=parseFloat(B[2]);A=parseFloat(B[3])}catch(D){u=u||100,A=A||100}d(this.convertDataUri(Editor.createSvgDataUri(c)),+u,A)}else null!=m?m():k({message:mxResources.get("invalidInput")})}catch(D){k(D)}};EditorUi.prototype.getMermaidConfig=function(c,d){d=null!=d?d:mxUtils.clone(EditorUi.defaultMermaidConfig);d.securityLevel="strict";d.startOnLoad=!1;d.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&d.flowchart&&0<=c.indexOf("$$")&&(d.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(d.theme="dark");return d};EditorUi.prototype.generateMermaidImage=function(c,d,k,m,t){var u=mxUtils.bind(this,+function(A){null!=m?m(A):this.handleError(A)});this.loadMermaid(mxUtils.bind(this,function(){try{mermaid.mermaidAPI.initialize(this.getMermaidConfig(c,d)),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(mxUtils.bind(this,function(A){this.mermaidSvgToDataUri(A.svg,k,m,t)})).catch(mxUtils.bind(this,function(A){this.removeMermaidErrors();A=Error(A.toString()+"\n\n"+c);"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();null!=t?t(A):u(A)}))}catch(A){u(A)}}),+u)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),d=0;d<c.length;d++)null!=c[d].parentNode&&c[d].parentNode.removeChild(c[d])};EditorUi.prototype.generatePlantUmlImage=function(c,d,k,m){function t(B,D,N){c1=B>>2;c2=(B&3)<<4|D>>4;c3=(D&15)<<2|N>>6;c4=N&63;r="";r+=u(c1&63);r+=u(c2&63);r+=u(c3&63);return r+=u(c4&63)}function u(B){if(10>B)return String.fromCharCode(48+B);B-=10;if(26>B)return String.fromCharCode(65+B);B-=26;if(26>+B)return String.fromCharCode(97+B);B-=26;return 0==B?"-":1==B?"_":"?"}var A=new XMLHttpRequest;A.open("GET",("txt"==d?PLANT_URL+"/txt/":"png"==d?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(B){r="";for(i=0;i<B.length;i+=3)r=i+2==B.length?r+t(B.charCodeAt(i),B.charCodeAt(i+1),0):i+1==B.length?r+t(B.charCodeAt(i),0,0):r+t(B.charCodeAt(i),B.charCodeAt(i+1),B.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=d&&(A.responseType="blob");A.onload=function(B){if(200<=this.status&&+300>this.status)if("txt"==d)k(this.response);else{var D=new FileReader;D.readAsDataURL(this.response);D.onloadend=function(N){var F=new Image;F.onload=function(){try{var U=F.width,V=F.height;if(0==U&&0==V){var n=D.result,v=n.indexOf(","),G=decodeURIComponent(escape(atob(n.substring(v+1)))),H=mxUtils.parseXml(G).getElementsByTagName("svg");0<H.length&&(U=parseFloat(H[0].getAttribute("width")),V=parseFloat(H[0].getAttribute("height")))}k(D.result,U,V)}catch(I){m(I)}};F.src=D.result};D.onerror=function(N){m(N)}}else m(B)};+A.onerror=function(B){m(B)};A.send()};EditorUi.prototype.insertAsPreText=function(c,d,k){var m=this.editor.graph,t=null;m.getModel().beginUpdate();try{t=m.insertVertex(null,null,"<pre>"+c+"</pre>",d,k,1,1,"text;html=1;align=left;verticalAlign=top;"),m.updateCellSize(t,!0)}finally{m.getModel().endUpdate()}return t};EditorUi.prototype.insertTextAt=function(c,d,k,m,t,u,A,B){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(V){4==V.readyState&&200<=V.status&&299>=V.status&&this.editor.graph.setSelectionCells(this.insertTextAt(V.responseText,d,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(t||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var D=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var N=Editor.extractGraphModelFromPdf(c);if(null!=+N&&0<N.length)return this.importXml(N,d,k,u,!0,B)}if(Editor.isPngDataUrl(c)&&(N=Editor.extractGraphModelFromPng(c),null!=N&&0<N.length))return this.importXml(N,d,k,u,!0,B);if("data:image/svg+xml;"==c.substring(0,19))try{N=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(N=c.substring(c.indexOf(",")+1),N=window.atob&&!mxClient.IS_SF?atob(N):Base64.decode(N,!0)):N=decodeURIComponent(c.substring(c.indexOf(",")+1));var F=this.importXml(N,d,k,u,!0,B);if(0<F.length)return F}catch(V){}this.loadImage(c,+mxUtils.bind(this,function(V){if("data:"==c.substring(0,5))this.resizeImage(V,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(G,H,I){D.setSelectionCell(D.insertVertex(null,null,"",D.snap(d),D.snap(k),H,I,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(G)+";"))}),A,this.maxImageSize);else{var n=Math.min(1,Math.min(this.maxImageSize/V.width,this.maxImageSize/V.height)),+v=Math.round(V.width*n);V=Math.round(V.height*n);D.setSelectionCell(D.insertVertex(null,null,"",D.snap(d),D.snap(k),v,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var V=null;D.getModel().beginUpdate();try{V=D.insertVertex(D.getDefaultParent(),null,c,D.snap(d),D.snap(k),1,1,"text;"+(m?"html=1;":"")),D.updateCellSize(V),D.fireEvent(new mxEventObject("textInserted","cells",[V]))}finally{D.getModel().endUpdate()}D.setSelectionCell(V)}))}else{c=+Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,d,k,u,null,B);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(V){this.editor.graph.setSelectionCells(this.importXml(V,d,k,u,null,B))}),mxUtils.bind(this,function(V){this.handleError(V)}));else{D=this.editor.graph;t=null;D.getModel().beginUpdate();try{t=D.insertVertex(D.getDefaultParent(),null,"",D.snap(d),D.snap(k),1,1,"text;whiteSpace=wrap;"+(m?"html=1;":""));D.fireEvent(new mxEventObject("textInserted",+"cells",[t]));m&&(c=D.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");t.value=c;D.updateCellSize(t);if(0<this.maxTextWidth&&t.geometry.width>this.maxTextWidth){var U=D.getPreferredSizeForCell(t,this.maxTextWidth);t.geometry.width=U.width;t.geometry.height=U.height}Graph.isLink(t.value)&&D.setLinkForCell(t,t.value);t.geometry.width+=D.gridSize;t.geometry.height+=D.gridSize}finally{D.getModel().endUpdate()}return[t]}}return[]};EditorUi.prototype.formatFileSize=function(c){var d=-1;do c/=1024,d++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[d]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var d=c.indexOf(";");0<d&&(c=c.substring(0,d)+c.substring(c.indexOf(",",d+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,d){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,d){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,C){StorageFile.listFiles(this,"F",A,C)});window.openBrowserFile=mxUtils.bind(this,function(A,C,E){StorageFile.getFileContent(this,A,C,E)});window.deleteBrowserFile=mxUtils.bind(this,function(A,C,E){StorageFile.deleteFile(this,A,C,E)});if(!d){var m=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,C){null!=C&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(C)?(A=new Blob([A],{type:"application/octet-stream"}),this.importVisio(A,mxUtils.bind(this,function(E){this.importXml(E,0,0,!0)}),null,C)):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(!d){var t=this.dialog,v=t.close;this.dialog.close=mxUtils.bind(this,function(A){Editor.useLocalStorage=-m;v.apply(t,arguments);A&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,d,k){var m=this,t=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(v){if(mxUtils.isEmptyObject(v.files))k();else{var A=0,C,E=!1;v.forEach(function(D,U){D=U.name.toLowerCase();"diagram/diagram.xml"==D?(E=!0,U.async("string").then(function(T){0==T.indexOf("<mxfile ")?d(T):k()})):0==D.indexOf("versions/")&&-(D=parseInt(D.substr(9)),D>A&&(A=D,C=U))});0<A?C.async("string").then(function(D){(new XMLHttpRequest).upload&&m.isRemoteFileFormat(D,c.name)?m.isOffline()?m.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):m.parseFileData(D,mxUtils.bind(this,function(U){4==U.readyState&&(200<=U.status&&299>=U.status?d(U.responseText):k())}),c.name):k()}):E||k()}},function(v){k(v)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?t():(this.loadingExtensions=!0,-mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,k))};EditorUi.prototype.importFile=function(c,d,k,m,t,v,A,C,E,D,U,T){D=null!=D?D:!0;var V=!1,n=null,u=mxUtils.bind(this,function(G){var H=null;null!=G&&"<mxlibrary"==G.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,G,A)),this.showSidebar()):H=this.importXml(G,k,m,D,null,null!=T?mxEvent.isControlDown(T):null);null!=C&&C(H)});"image"==d.substring(0,5)?(E=!1,"image/png"==d.substring(0,9)&&(U=U?null:this.extractGraphModelFromPng(c),-null!=U&&0<U.length&&(n=this.importXml(U,k,m,D,null,null!=T?mxEvent.isControlDown(T):null),E=!0)),E||(E=this.editor.graph,U=c.indexOf(";"),0<U&&(c=c.substring(0,U)+c.substring(c.indexOf(",",U+1))),D&&E.isGridEnabled()&&(k=E.snap(k),m=E.snap(m)),U="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==d.substring(0,9)&&(U+="editableCssRules=.*;"),n=[E.insertVertex(null,null,"",k,m,t,v,U+"image="+c+";")])):/(\.*<graphml )/.test(c)?-(V=!0,this.importGraphML(c,u)):null!=E&&null!=A&&EditorUi.isVisioFilename(A)?(V=!0,this.importVisio(E,u)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,A)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(V=!0,d=mxUtils.bind(this,function(G){4==G.readyState&&(200<=G.status&&299>=G.status?u(G.responseText):null!=C&&(C(null),this.showError(mxResources.get("error"),413==G.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),-null!=c?this.parseFileData(c,d,A):this.parseFile(E,d,A)):0==c.indexOf("PK")&&null!=E?(V=!0,this.importZipFile(E,u,mxUtils.bind(this,function(){n=this.insertTextAt(this.validateFileData(c),k,m,!0,null,D);C(n)}))):/(\.v(sd|dx))($|\?)/i.test(A)||/(\.vs(s|x))($|\?)/i.test(A)||(n=this.insertTextAt(this.validateFileData(c),k,m,!0,null,D,null,null!=T?mxEvent.isControlDown(T):null));V||null==C||C(n);return n};EditorUi.prototype.importFiles=function(c,d,k,m,t,v,A,C,E,D,U,T,V){m=null!=m?m:this.maxImageSize;-D=null!=D?D:this.maxImageBytes;var n=null!=d&&null!=k,u=!0;d=null!=d?d:0;k=null!=k?k:0;var G=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var H=U||this.resampleThreshold,I=0;I<c.length;I++)if("image/svg"!==c[I].type.substring(0,9)&&"image/"===c[I].type.substring(0,6)&&c[I].size>H){G=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[d],"y",[k],"maxSize",[m],"maxBytes",[D],"resampleThreshold",[this.resampleThreshold],"largeImages",[G],"crop",[n],"resizeImages",[u],"ignoreEmbeddedXml",-[T],"evt",[V]);var g=mxUtils.bind(this,function(){var q=this.editor.graph,B=q.gridSize;t=null!=t?t:mxUtils.bind(this,function(W,X,Y,aa,ba,fa,ia,ea,ma){try{if(null!=W&&"<mxlibrary"==W.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,W,ia)),this.showSidebar(),null;this.isCompatibleString(W)&&1==c.length&&null!=V&&"drop"==V.type&&this.isBlankFile()&&!this.canUndo()&&(n=!1,aa=Y=0);return this.importFile(W,X,Y,aa,ba,fa,ia,ea,ma,n,T,V)}catch(qa){return this.handleError(qa),-null}});v=null!=v?v:mxUtils.bind(this,function(W){q.setSelectionCells(W)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var J=this.currentPage,Q=c.length,N=Q,S=[],P=mxUtils.bind(this,function(W,X){S[W]=X;if(0==--N){this.spinner.stop();if(null!=C)C(S);else{var Y=[];q.getModel().beginUpdate();try{for(W=0;W<S.length;W++){var aa=S[W]();null!=aa&&(Y=Y.concat(aa))}}finally{q.getModel().endUpdate()}}J!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),-0);v(Y)}}),R=0;R<Q;R++)mxUtils.bind(this,function(W){var X=c[W];if(null!=X){var Y=new FileReader;Y.onload=mxUtils.bind(this,function(aa){if(null==A||A(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var ba=Graph.clipSvgDataUri(aa.target.result),fa=ba.indexOf(","),ia=decodeURIComponent(escape(atob(ba.substring(fa+1)))),ea=mxUtils.parseXml(ia),ma=ea.getElementsByTagName("svg");if(0<ma.length){var qa=ma[0],na=T?null:qa.getAttribute("content");null!=na&&"<"!=na.charAt(0)&&-"%"!=na.charAt(0)&&(na=unescape(window.atob?atob(na):Base64.decode(na,!0)));null!=na&&"%"==na.charAt(0)&&(na=decodeURIComponent(na));null==na||"<mxfile "!==na.substring(0,8)&&"<mxGraphModel>"!==na.substring(0,14)&&"<mxGraphModel "!==na.substring(0,14)?P(W,mxUtils.bind(this,function(){try{if(null!=ea){var la=ea.getElementsByTagName("svg");if(0<la.length){var ha=la[0],pa=ha.getAttribute("width"),ya=ha.getAttribute("height");pa=null!=pa&&"%"!=pa.charAt(pa.length-1)?parseFloat(pa):NaN;ya=null!=ya&&"%"!=-ya.charAt(ya.length-1)?parseFloat(ya):NaN;var za=ha.getAttribute("viewBox");if(null==za||0==za.length)ha.setAttribute("viewBox","0 0 "+pa+" "+ya);else if(isNaN(pa)||isNaN(ya)){var xa=za.split(" ");3<xa.length&&(pa=parseFloat(xa[2]),ya=parseFloat(xa[3]))}ba=Editor.createSvgDataUri(mxUtils.getXml(ha));var Z=Math.min(1,Math.min(m/Math.max(1,pa)),m/Math.max(1,ya)),oa=t(ba,X.type,d+W*B,k+W*B,Math.max(1,Math.round(pa*Z)),Math.max(1,Math.round(ya*Z)),X.name);if(null!=oa&&(isNaN(pa)||isNaN(ya))){var ka=new Image;-ka.onload=mxUtils.bind(this,function(){pa=Math.max(1,ka.width);ya=Math.max(1,ka.height);oa[0].geometry.width=pa;oa[0].geometry.height=ya;ha.setAttribute("viewBox","0 0 "+pa+" "+ya);ba=Editor.createSvgDataUri(mxUtils.getXml(ha));var sa=ba.indexOf(";");0<sa&&(ba=ba.substring(0,sa)+ba.substring(ba.indexOf(",",sa+1)));q.setCellStyles("image",ba,[oa[0]])});ka.src=Editor.createSvgDataUri(mxUtils.getXml(ha))}return oa}}}catch(sa){}return null})):P(W,mxUtils.bind(this,function(){return t(na,"text/xml",d+-W*B,k+W*B,0,0,X.name)}))}else P(W,mxUtils.bind(this,function(){return null}))}else{fa=!1;if("image/png"==X.type){var ta=T?null:this.extractGraphModelFromPng(aa.target.result);if(null!=ta&&0<ta.length){var ra=new Image;ra.src=aa.target.result;P(W,mxUtils.bind(this,function(){return t(ta,"text/xml",d+W*B,k+W*B,ra.width,ra.height,X.name)}));fa=!0}}fa||(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(aa.target.result,mxUtils.bind(this,function(la){this.resizeImage(la,Editor.stripImageMetadata(aa.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(ha,pa,ya){P(W,mxUtils.bind(this,function(){if(null!=ha&&ha.length<D){var za=u&&this.isResampleImageSize(X.size,U)?Math.min(1,Math.min(m/pa,m/ya)):1;return t(ha,X.type,d+W*B,k+W*B,Math.round(pa*-za),Math.round(ya*za),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),u,m,U,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ba=aa.target.result,t(ba,X.type,d+W*B,k+W*B,240,160,X.name,function(la){P(W,function(){return la})},X)}catch(la){P(W,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(la,X)}else P(W,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?-t(null,X.type,d+W*B,k+W*B,240,160,X.name,function(aa){P(W,function(){return aa})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?Y.readAsDataURL(X):Y.readAsText(X)}})(R)});if(G){G=[];for(I=0;I<c.length;I++)G.push(c[I]);c=G;this.confirmImageResize(function(q){u=q;g()},E)}else g()};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,d){d=null!=d?d:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},m=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,t=function(v,A){if(v||d)mxSettings.setResizeImages(v?A:null),mxSettings.save();k();c(A)};null==m||d?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(v){t(v,!0)},function(v){t(v,!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(A,B){StorageFile.listFiles(this,"F",A,B)});window.openBrowserFile=mxUtils.bind(this,function(A,B,D){StorageFile.getFileContent(this,A,B,D)});window.deleteBrowserFile=mxUtils.bind(this,function(A,B,D){StorageFile.deleteFile(this,A,B,D)});if(!d){var m=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,B){null!=B&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(B)?(A=new Blob([A],{type:"application/octet-stream"}),this.importVisio(A,mxUtils.bind(this,function(D){this.importXml(D,0,0,!0)}),null,B)):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(!d){var t=this.dialog,u=t.close;this.dialog.close=mxUtils.bind(this,function(A){Editor.useLocalStorage=+m;u.apply(t,arguments);A&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,d,k){var m=this,t=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,B,D=!1;u.forEach(function(N,F){N=F.name.toLowerCase();"diagram/diagram.xml"==N?(D=!0,F.async("string").then(function(U){0==U.indexOf("<mxfile ")?d(U):k()})):0==N.indexOf("versions/")&&+(N=parseInt(N.substr(9)),N>A&&(A=N,B=F))});0<A?B.async("string").then(function(N){(new XMLHttpRequest).upload&&m.isRemoteFileFormat(N,c.name)?m.isOffline()?m.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):m.parseFileData(N,mxUtils.bind(this,function(F){4==F.readyState&&(200<=F.status&&299>=F.status?d(F.responseText):k())}),c.name):k()}):D||k()}},function(u){k(u)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?t():(this.loadingExtensions=!0,+mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,k))};EditorUi.prototype.importFile=function(c,d,k,m,t,u,A,B,D,N,F,U){N=null!=N?N:!0;var V=!1,n=null,v=mxUtils.bind(this,function(G){var H=null;null!=G&&"<mxlibrary"==G.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,G,A)),this.showSidebar()):H=this.importXml(G,k,m,N,null,null!=U?mxEvent.isControlDown(U):null);null!=B&&B(H)});"image"==d.substring(0,5)?(D=!1,"image/png"==d.substring(0,9)&&(F=F?null:this.extractGraphModelFromPng(c),+null!=F&&0<F.length&&(n=this.importXml(F,k,m,N,null,null!=U?mxEvent.isControlDown(U):null),D=!0)),D||(D=this.editor.graph,F=c.indexOf(";"),0<F&&(c=c.substring(0,F)+c.substring(c.indexOf(",",F+1))),N&&D.isGridEnabled()&&(k=D.snap(k),m=D.snap(m)),F="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==d.substring(0,9)&&(F+="editableCssRules=.*;"),n=[D.insertVertex(null,null,"",k,m,t,u,F+"image="+c+";")])):/(\.*<graphml )/.test(c)?+(V=!0,this.importGraphML(c,v)):null!=D&&null!=A&&EditorUi.isVisioFilename(A)?(V=!0,this.importVisio(D,v)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,A)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(V=!0,d=mxUtils.bind(this,function(G){4==G.readyState&&(200<=G.status&&299>=G.status?v(G.responseText):null!=B&&(B(null),this.showError(mxResources.get("error"),413==G.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),+null!=c?this.parseFileData(c,d,A):this.parseFile(D,d,A)):0==c.indexOf("PK")&&null!=D?(V=!0,this.importZipFile(D,v,mxUtils.bind(this,function(){n=this.insertTextAt(this.validateFileData(c),k,m,!0,null,N);B(n)}))):/(\.v(sd|dx))($|\?)/i.test(A)||/(\.vs(s|x))($|\?)/i.test(A)||(n=this.insertTextAt(this.validateFileData(c),k,m,!0,null,N,null,null!=U?mxEvent.isControlDown(U):null));V||null==B||B(n);return n};EditorUi.prototype.importFiles=function(c,d,k,m,t,u,A,B,D,N,F,U,V){m=null!=m?m:this.maxImageSize;+N=null!=N?N:this.maxImageBytes;var n=null!=d&&null!=k,v=!0;d=null!=d?d:0;k=null!=k?k:0;var G=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var H=F||this.resampleThreshold,I=0;I<c.length;I++)if("image/svg"!==c[I].type.substring(0,9)&&"image/"===c[I].type.substring(0,6)&&c[I].size>H){G=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[d],"y",[k],"maxSize",[m],"maxBytes",[N],"resampleThreshold",[this.resampleThreshold],"largeImages",[G],"crop",[n],"resizeImages",[v],"ignoreEmbeddedXml",+[U],"evt",[V]);var g=mxUtils.bind(this,function(){var q=this.editor.graph,C=q.gridSize;t=null!=t?t:mxUtils.bind(this,function(W,X,Y,Z,aa,ha,ja,fa,ma){try{if(null!=W&&"<mxlibrary"==W.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,W,ja)),this.showSidebar(),null;this.isCompatibleString(W)&&1==c.length&&null!=V&&"drop"==V.type&&this.isBlankFile()&&!this.canUndo()&&(n=!1,Z=Y=0);return this.importFile(W,X,Y,Z,aa,ha,ja,fa,ma,n,U,V)}catch(sa){return this.handleError(sa),+null}});u=null!=u?u:mxUtils.bind(this,function(W){q.setSelectionCells(W)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var J=this.currentPage,M=c.length,Q=M,T=[],P=mxUtils.bind(this,function(W,X){T[W]=X;if(0==--Q){this.spinner.stop();if(null!=B)B(T);else{var Y=[];q.getModel().beginUpdate();try{for(W=0;W<T.length;W++){var Z=T[W]();null!=Z&&(Y=Y.concat(Z))}}finally{q.getModel().endUpdate()}}J!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),+0);u(Y)}}),S=0;S<M;S++)mxUtils.bind(this,function(W){var X=c[W];if(null!=X){var Y=new FileReader;Y.onload=mxUtils.bind(this,function(Z){if(null==A||A(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var aa=Graph.clipSvgDataUri(Z.target.result),ha=aa.indexOf(","),ja=decodeURIComponent(escape(atob(aa.substring(ha+1)))),fa=mxUtils.parseXml(ja),ma=fa.getElementsByTagName("svg");if(0<ma.length){var sa=ma[0],ta=U?null:sa.getAttribute("content");null!=ta&&"<"!=ta.charAt(0)&&+"%"!=ta.charAt(0)&&(ta=unescape(window.atob?atob(ta):Base64.decode(ta,!0)));null!=ta&&"%"==ta.charAt(0)&&(ta=decodeURIComponent(ta));null==ta||"<mxfile "!==ta.substring(0,8)&&"<mxGraphModel>"!==ta.substring(0,14)&&"<mxGraphModel "!==ta.substring(0,14)?P(W,mxUtils.bind(this,function(){try{if(null!=fa){var la=fa.getElementsByTagName("svg");if(0<la.length){var ia=la[0],oa=ia.getAttribute("width"),xa=ia.getAttribute("height");oa=null!=oa&&"%"!=oa.charAt(oa.length-1)?parseFloat(oa):NaN;xa=null!=xa&&"%"!=+xa.charAt(xa.length-1)?parseFloat(xa):NaN;var Aa=ia.getAttribute("viewBox");if(null==Aa||0==Aa.length)ia.setAttribute("viewBox","0 0 "+oa+" "+xa);else if(isNaN(oa)||isNaN(xa)){var wa=Aa.split(" ");3<wa.length&&(oa=parseFloat(wa[2]),xa=parseFloat(wa[3]))}aa=Editor.createSvgDataUri(mxUtils.getXml(ia));var ea=Math.min(1,Math.min(m/Math.max(1,oa)),m/Math.max(1,xa)),Da=t(aa,X.type,d+W*C,k+W*C,Math.max(1,Math.round(oa*ea)),Math.max(1,Math.round(xa*ea)),X.name);if(null!=Da&&(isNaN(oa)||isNaN(xa))){var pa=+new Image;pa.onload=mxUtils.bind(this,function(){oa=Math.max(1,pa.width);xa=Math.max(1,pa.height);Da[0].geometry.width=oa;Da[0].geometry.height=xa;ia.setAttribute("viewBox","0 0 "+oa+" "+xa);aa=Editor.createSvgDataUri(mxUtils.getXml(ia));var ba=aa.indexOf(";");0<ba&&(aa=aa.substring(0,ba)+aa.substring(aa.indexOf(",",ba+1)));q.setCellStyles("image",aa,[Da[0]])});pa.src=Editor.createSvgDataUri(mxUtils.getXml(ia))}return Da}}}catch(ba){}return null})):P(W,mxUtils.bind(this,function(){return t(ta,"text/xml",+d+W*C,k+W*C,0,0,X.name)}))}else P(W,mxUtils.bind(this,function(){return null}))}else{ha=!1;if("image/png"==X.type){var ra=U?null:this.extractGraphModelFromPng(Z.target.result);if(null!=ra&&0<ra.length){var qa=new Image;qa.src=Z.target.result;P(W,mxUtils.bind(this,function(){return t(ra,"text/xml",d+W*C,k+W*C,qa.width,qa.height,X.name)}));ha=!0}}ha||(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(Z.target.result,mxUtils.bind(this,function(la){this.resizeImage(la,Editor.stripImageMetadata(Z.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(ia,oa,xa){P(W,mxUtils.bind(this,function(){if(null!=ia&&ia.length<N){var Aa=v&&this.isResampleImageSize(X.size,F)?Math.min(1,Math.min(m/oa,m/xa)):1;return t(ia,X.type,d+W*C,k+W*C,Math.round(oa*Aa),+Math.round(xa*Aa),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),v,m,F,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else aa=Z.target.result,t(aa,X.type,d+W*C,k+W*C,240,160,X.name,function(la){P(W,function(){return la})},X)}catch(la){P(W,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(la,X)}else P(W,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?+t(null,X.type,d+W*C,k+W*C,240,160,X.name,function(Z){P(W,function(){return Z})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?Y.readAsDataURL(X):Y.readAsText(X)}})(S)});if(G){G=[];for(I=0;I<c.length;I++)G.push(c[I]);c=G;this.confirmImageResize(function(q){v=q;g()},D)}else g()};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,d){d=null!=d?d:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},m=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,t=function(u,A){if(u||d)mxSettings.setResizeImages(u?A:null),mxSettings.save();k();c(A)};null==m||d?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(u){t(u,!0)},function(u){t(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):t(!1,m)};EditorUi.prototype.parseFile=function(c,d,k){k=null!=k?k:c.name;var m=new FileReader;m.onload=mxUtils.bind(this,function(){this.parseFileData(m.result,d,k)});m.readAsText(c)};EditorUi.prototype.parseFileData=function(c,d,k){var m=new XMLHttpRequest;m.open("POST",OPEN_URL);m.setRequestHeader("Content-Type","application/x-www-form-urlencoded");-m.onreadystatechange=function(){d(m)};m.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(t){}};EditorUi.prototype.isResampleImageSize=function(c,d){d=null!=d?d:this.resampleThreshold;return c>d};EditorUi.prototype.resizeImage=function(c,d,k,m,t,v,A){t=null!=t?t:this.maxImageSize;var C=Math.max(1,c.width),E=Math.max(1,c.height),D=d;if(m&&this.isResampleImageSize(null!=A?A:d.length,-v))try{var U=Math.max(C/t,E/t);if(1<U){var T=Math.round(C/U),V=Math.round(E/U),n=document.createElement("canvas");n.width=T;n.height=V;n.getContext("2d").drawImage(c,0,0,T,V);var u=n.toDataURL();if(u.length<d.length){var G=document.createElement("canvas");G.width=T;G.height=V;var H=G.toDataURL();u!==H&&(d=u,C=T,E=V)}}}catch(I){}m&&D!=d&&t>this.maxImageSize/2&&d.length>this.maxImageBytes?this.resizeImage(c,d,k,m,t/1.5,v,A):k(d,C,E)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};+m.onreadystatechange=function(){d(m)};m.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(t){}};EditorUi.prototype.isResampleImageSize=function(c,d){d=null!=d?d:this.resampleThreshold;return c>d};EditorUi.prototype.resizeImage=function(c,d,k,m,t,u,A){t=null!=t?t:this.maxImageSize;var B=Math.max(1,c.width),D=Math.max(1,c.height),N=d;if(m&&this.isResampleImageSize(null!=A?A:d.length,+u))try{var F=Math.max(B/t,D/t);if(1<F){var U=Math.round(B/F),V=Math.round(D/F),n=document.createElement("canvas");n.width=U;n.height=V;n.getContext("2d").drawImage(c,0,0,U,V);var v=n.toDataURL();if(v.length<d.length){var G=document.createElement("canvas");G.width=U;G.height=V;var H=G.toDataURL();v!==H&&(d=v,B=U,D=V)}}}catch(I){}m&&N!=d&&t>this.maxImageSize/2&&d.length>this.maxImageBytes?this.resizeImage(c,d,k,m,t/1.5,u,A):k(d,B,D)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,d,k){try{var m=new Image;m.onload=function(){m.width=0<m.width?m.width:120;m.height=0<m.height?m.height:120;d(m)};null!=k&&(m.onerror=k);m.src=c}catch(t){if(null!=k)k(t);else throw t;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var x=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);x.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var z=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=-mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,d=this.editor.graph,k=d.isEnabled;d.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};d.showLinkIcons=Editor.showLinkIcons;d.showTooltipIcons=Editor.showTooltipIcons;var m=this;d.editTooltip=function(P){null!=P&&m.actions.get("editTooltip").funct()};d.getLinkOverlayTooltip=function(P){if(Graph.isPageLink(P)&&null!=m.pages){var R=P.substring(P.indexOf(",")+1);R=m.getPageById(R);if(null!=R)return R.getName()||mxResources.get("pageWithNumber",-[mxUtils.indexOf(m.pages,R)+1])}return P};Graph.touchStyle&&(d.panningHandler.isPanningTrigger=function(P){var R=P.getEvent();return null==P.getState()&&!mxEvent.isMouseEvent(R)&&!d.freehand.isDrawing()||mxEvent.isPopupTrigger(R)&&(null==P.getState()||mxEvent.isControlDown(R)||mxEvent.isShiftDown(R))});d.cellEditor.editPlantUmlData=function(P,R,W){var X=JSON.parse(W);R=new SimpleTextareaDialog(c,X.data,function(Y){null!=Y&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(Y,-X.format,function(aa,ba,fa){c.spinner.stop();d.getModel().beginUpdate();try{if("txt"==X.format)d.labelChanged(P,"<pre>"+aa+"</pre>"),d.updateCellSize(P,!0);else{d.setCellStyles("image",c.convertDataUri(aa),[P]);var ia=d.model.getGeometry(P);null!=ia&&(ia=ia.clone(),ia.width=ba,ia.height=fa,d.cellsResized([P],[ia],!1))}d.setAttributeForCell(P,"plantUmlData",JSON.stringify({data:Y,format:X.format}))}finally{d.getModel().endUpdate()}},function(aa){c.handleError(aa)})});c.showDialog(R.container,640,420,-!0,!0,null,null,null,new mxRectangle(0,0,320,280));R.init()};d.cellEditor.editMermaidData=function(P,R,W){var X=JSON.parse(W);R=new SimpleTextareaDialog(c,X.data,function(Y){null!=Y&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(Y,X.config,function(aa,ba,fa){c.spinner.stop();d.getModel().beginUpdate();try{d.setCellStyles("image",aa,[P]);var ia=d.model.getGeometry(P);null!=ia&&(ia=ia.clone(),ia.width=Math.max(ia.width,ba),ia.height=Math.max(ia.height,fa),d.cellsResized([P],-[ia],!1));d.setAttributeForCell(P,"mermaidData",JSON.stringify({data:Y,config:X.config},null,2))}finally{d.getModel().endUpdate()}},function(aa){c.handleError(aa)})});c.showDialog(R.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));R.init()};var t=d.cellEditor.startEditing;d.cellEditor.startEditing=function(P,R){try{var W=this.graph.getAttributeForCell(P,"plantUmlData");if(null!=W)this.editPlantUmlData(P,R,W);else if(W=this.graph.getAttributeForCell(P,"mermaidData"),null!=W&&window.isMermaidEnabled)this.editMermaidData(P,-R,W);else{var X=d.getCellStyle(P);"1"==mxUtils.getValue(X,"metaEdit","0")?c.showDataDialog(P):t.apply(this,arguments)}}catch(Y){c.handleError(Y)}};d.getLinkTitle=function(P){return c.getLinkTitle(P)};d.customLinkClicked=function(P,R){var W=!1;try{var X=this.getGraphBounds();c.handleCustomLink(P,R);W=!0;c.chromelessResize&&!X.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(R))}catch(Y){c.handleError(Y)}return W};var v=d.parseBackgroundImage;d.parseBackgroundImage=function(P){var R=-v.apply(this,arguments);null!=R&&null!=R.src&&Graph.isPageLink(R.src)&&(R={originalSrc:R.src});return R};var A=d.setBackgroundImage;d.setBackgroundImage=function(P){null!=P&&null!=P.originalSrc&&(P=c.createImageForPageLink(P.originalSrc,c.currentPage,this));A.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){d.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){d.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",-mxUtils.bind(this,function(P,R){P=null!=d.backgroundImage?d.backgroundImage.originalSrc:null;if(null!=P){var W=P.indexOf(",");if(0<W)for(P=P.substring(W+1),R=R.getProperty("patches"),W=0;W<R.length;W++)if(null!=R[W][EditorUi.DIFF_UPDATE]&&null!=R[W][EditorUi.DIFF_UPDATE][P]||null!=R[W][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(R[W][EditorUi.DIFF_REMOVE],P)){d.refreshBackgroundImage();break}}}));var C=d.getBackgroundImageObject;d.getBackgroundImageObject=function(P,R,W){var X=C.apply(this,arguments);-null!=X&&null!=X.originalSrc&&(X=R?c.createImageForPageLink(X.originalSrc,W,null,!0):{src:X.originalSrc});return X};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 E=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(P){P=-null!=P?P:"";"1"==urlParams.dev&&(P+=(0<P.length?"&":"?")+"dev=1");"1"==urlParams.test&&(P+=(0<P.length?"&":"?")+"test=1");return E.apply(this,arguments)};var D=d.addClickHandler;d.addClickHandler=function(P,R,W){var X=R;R=function(Y,aa,ba){if(null==aa){var fa=mxEvent.getSource(Y);"a"==fa.nodeName.toLowerCase()&&(aa=fa.getAttribute("href"))}null!=aa&&d.isCustomLink(aa)&&(mxEvent.isTouchEvent(Y)||!mxEvent.isPopupTrigger(Y))&&d.customLinkClicked(aa,ba)&&mxEvent.consume(Y);null!=X&&X(Y,aa,ba)};D.call(this,-P,R,W)};z.apply(this,arguments);this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var U=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(P,R,W){d.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(P,["zoomIn","zoomOut","-"],null,W);if(Editor.passiveScroll&&null!=W){var X=mxUtils.convertPoint(d.container,mxEvent.getClientX(W),mxEvent.getClientY(W));d._contextMenuPoint=new mxPoint(d.snap(X.x/d.view.scale-d.view.translate.x),-d.snap(X.y/d.view.scale-d.view.translate.y));d._contextMenuScreenPoint=mxUtils.convertPoint(d.container,mxEvent.getClientX(W),mxEvent.getClientY(W))}d.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",P,null),P.addSeparator());U.apply(this,arguments);d.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(P,["-","addToScratchpad"],null,W);d.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(P,["-","exitGroup","home"],null,W)};-var T=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(P,R,W){if(c.editor.graph.isSelectionEmpty())T.apply(this,arguments),c.menus.addMenuItems(P,["copyAsImage","copyAsSvg"],null,W);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(P,R,W):this.addPopupMenuArrangeItems(P,R,W),this.addMenuItems(P,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,W),Editor.passiveScroll&&(1==d.getSelectionCount()?this.addMenuItems(P,["-","copyStyle","pasteStyle"],null,-W):this.addMenuItems(P,["-","pasteStyle"],null,W)),this.addMenuItems(P,["-"],null,W),this.isShowCellEditItems()||this.addPopupDeleteItem(P,R,W),this.addMenuItems(P,["lockUnlock","-"],null,W),!this.isShowStyleItems()){if(1==d.getSelectionCount()&&!d.isCellLocked(R)&&d.isCellEditable(R)&&(this.addSubmenu("editCell",P,null,mxResources.get("edit")),P.addSeparator(),d.getModel().isEdge(R))){this.addSubmenu("line",P);var X=d.getModel().getGeometry(R);null!=X&&null!=X.points&&0<X.points.length&&this.addMenuItems(P,+mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,d=this.editor.graph,k=d.isEnabled;d.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};d.showLinkIcons=Editor.showLinkIcons;d.showTooltipIcons=Editor.showTooltipIcons;var m=this;d.editTooltip=function(P){null!=P&&m.actions.get("editTooltip").funct()};d.getLinkOverlayTooltip=function(P){if(Graph.isPageLink(P)&&null!=m.pages){var S=P.substring(P.indexOf(",")+1);S=m.getPageById(S);if(null!=S)return S.getName()||mxResources.get("pageWithNumber",+[mxUtils.indexOf(m.pages,S)+1])}return P};Graph.touchStyle&&(d.panningHandler.isPanningTrigger=function(P){var S=P.getEvent();return null==P.getState()&&!mxEvent.isMouseEvent(S)&&!d.freehand.isDrawing()||mxEvent.isPopupTrigger(S)&&(null==P.getState()||mxEvent.isControlDown(S)||mxEvent.isShiftDown(S))});d.cellEditor.editPlantUmlData=function(P,S,W){var X=JSON.parse(W);S=new SimpleTextareaDialog(c,X.data,function(Y){null!=Y&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(Y,+X.format,function(Z,aa,ha){c.spinner.stop();d.getModel().beginUpdate();try{if("txt"==X.format)d.labelChanged(P,"<pre>"+Z+"</pre>"),d.updateCellSize(P,!0);else{d.setCellStyles("image",c.convertDataUri(Z),[P]);var ja=d.model.getGeometry(P);null!=ja&&(ja=ja.clone(),ja.width=aa,ja.height=ha,d.cellsResized([P],[ja],!1))}d.setAttributeForCell(P,"plantUmlData",JSON.stringify({data:Y,format:X.format}))}finally{d.getModel().endUpdate()}},function(Z){c.handleError(Z)})});c.showDialog(S.container,640,420,!0,+!0,null,null,null,new mxRectangle(0,0,320,280));S.init()};d.cellEditor.editMermaidData=function(P,S,W){var X=JSON.parse(W);S=new SimpleTextareaDialog(c,X.data,function(Y){null!=Y&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(Y,X.config,function(Z,aa,ha){c.spinner.stop();d.getModel().beginUpdate();try{d.setCellStyles("image",Z,[P]);var ja=d.model.getGeometry(P);null!=ja&&(ja=ja.clone(),ja.width=Math.max(ja.width,aa),ja.height=Math.max(ja.height,ha),d.cellsResized([P],+[ja],!1));d.setAttributeForCell(P,"mermaidData",JSON.stringify({data:Y,config:X.config},null,2))}finally{d.getModel().endUpdate()}},function(Z){c.handleError(Z)})});c.showDialog(S.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));S.init()};var t=d.cellEditor.startEditing;d.cellEditor.startEditing=function(P,S){try{var W=this.graph.getAttributeForCell(P,"plantUmlData");if(null!=W)this.editPlantUmlData(P,S,W);else if(W=this.graph.getAttributeForCell(P,"mermaidData"),null!=W&&window.isMermaidEnabled)this.editMermaidData(P,+S,W);else{var X=d.getCellStyle(P);"1"==mxUtils.getValue(X,"metaEdit","0")?c.showDataDialog(P):t.apply(this,arguments)}}catch(Y){c.handleError(Y)}};d.getLinkTitle=function(P){return c.getLinkTitle(P)};d.customLinkClicked=function(P,S){var W=!1;try{var X=this.getGraphBounds();c.handleCustomLink(P,S);W=!0;c.chromelessResize&&!X.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(S))}catch(Y){c.handleError(Y)}return W};var u=d.parseBackgroundImage;d.parseBackgroundImage=function(P){var S=+u.apply(this,arguments);null!=S&&null!=S.src&&Graph.isPageLink(S.src)&&(S={originalSrc:S.src});return S};var A=d.setBackgroundImage;d.setBackgroundImage=function(P){null!=P&&null!=P.originalSrc&&(P=c.createImageForPageLink(P.originalSrc,c.currentPage,this));A.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){d.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){d.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",+mxUtils.bind(this,function(P,S){P=null!=d.backgroundImage?d.backgroundImage.originalSrc:null;if(null!=P){var W=P.indexOf(",");if(0<W)for(P=P.substring(W+1),S=S.getProperty("patches"),W=0;W<S.length;W++)if(null!=S[W][EditorUi.DIFF_UPDATE]&&null!=S[W][EditorUi.DIFF_UPDATE][P]||null!=S[W][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(S[W][EditorUi.DIFF_REMOVE],P)){d.refreshBackgroundImage();break}}}));var B=d.getBackgroundImageObject;d.getBackgroundImageObject=function(P,S,W){var X=B.apply(this,arguments);+null!=X&&null!=X.originalSrc&&(X=S?c.createImageForPageLink(X.originalSrc,W,null,!0):{src:X.originalSrc});return X};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");"1"==urlParams.test&&(P+=(0<P.length?"&":"?")+"test=1");return D.apply(this,arguments)};var N=d.addClickHandler;d.addClickHandler=function(P,S,W){var X=S;S=function(Y,Z,aa){if(null==Z){var ha=mxEvent.getSource(Y);"a"==ha.nodeName.toLowerCase()&&(Z=ha.getAttribute("href"))}null!=Z&&d.isCustomLink(Z)&&(mxEvent.isTouchEvent(Y)||!mxEvent.isPopupTrigger(Y))&&d.customLinkClicked(Z,aa)&&mxEvent.consume(Y);null!=X&&X(Y,Z,aa)};N.call(this,+P,S,W)};z.apply(this,arguments);this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var F=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(P,S,W){d.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(P,["zoomIn","zoomOut","-"],null,W);if(Editor.passiveScroll&&null!=W){var X=mxUtils.convertPoint(d.container,mxEvent.getClientX(W),mxEvent.getClientY(W));d._contextMenuPoint=new mxPoint(d.snap(X.x/d.view.scale-d.view.translate.x),+d.snap(X.y/d.view.scale-d.view.translate.y));d._contextMenuScreenPoint=mxUtils.convertPoint(d.container,mxEvent.getClientX(W),mxEvent.getClientY(W))}d.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",P,null),P.addSeparator());F.apply(this,arguments);d.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(P,["-","addToScratchpad"],null,W);d.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(P,["-","exitGroup","home"],null,W)};+var U=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(P,S,W){if(c.editor.graph.isSelectionEmpty())U.apply(this,arguments),c.menus.addMenuItems(P,["copyAsImage","copyAsSvg"],null,W);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(P,S,W):this.addPopupMenuArrangeItems(P,S,W),this.addMenuItems(P,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,W),Editor.passiveScroll&&(1==d.getSelectionCount()?this.addMenuItems(P,["-","copyStyle","pasteStyle"],null,+W):this.addMenuItems(P,["-","pasteStyle"],null,W)),this.addMenuItems(P,["-"],null,W),this.isShowCellEditItems()||this.addPopupDeleteItem(P,S,W),this.addMenuItems(P,["lockUnlock","-"],null,W),!this.isShowStyleItems()){if(1==d.getSelectionCount()&&!d.isCellLocked(S)&&d.isCellEditable(S)&&(this.addSubmenu("editCell",P,null,mxResources.get("edit")),P.addSeparator(),d.getModel().isEdge(S))){this.addSubmenu("line",P);var X=d.getModel().getGeometry(S);null!=X&&null!=X.points&&0<X.points.length&&this.addMenuItems(P,["clearWaypoints"],null,W)}1==d.getSelectionCount()&&this.addMenuItems(P,["enterGroup"],null,W);X=c.getSelectionState();null!=X.mergeCell?this.addMenuItem(P,"mergeCells"):(1<X.style.colspan||1<X.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}if(Editor.passiveScroll){var V=d.getCenterInsertPoint;d.getCenterInsertPoint=function(P){if(null!=this._contextMenuPoint){var R=this._contextMenuPoint;P=null!=P?P:new mxRectangle;return new mxPoint(d.snap(R.x-(P.width||0)/2),d.snap(R.y-(P.height||0)/2))}return V.apply(this,arguments)};var n=d.popupMenuHandler.hideMenu;d.popupMenuHandler.hideMenu=function(){n.apply(this,arguments);window.setTimeout(function(){d._contextMenuPoint=null;d._contextMenuScreenPoint=-null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var u=d.getExportVariables;d.getExportVariables=function(){var P=u.apply(this,arguments),R=c.getCurrentFile();null!=R&&(P.filename=R.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var W in c.fileVars)null==P[W]&&(P[W]=c.fileVars[W]);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 G=d.getGlobalVariable;d.getGlobalVariable=function(P){var R=c.getCurrentFile();if("filename"==P&&null!=R)return R.getTitle();if("page"==P&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==P)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==P)return null!=c.pages?c.pages.length:1;R=G.apply(this,arguments);null==R&&(c.updateFileVars(),-null!=c.fileVars&&(R=c.fileVars[P]));return R};var H=null,I=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var P=this.getCurrentFile(),R=null!=P&&null!=P.getTitle()?P.getTitle():this.defaultFilename;H!=R&&P==I&&(d.invalidateDescendantsWithPlaceholders(d.model.getRoot()),d.view.validate());H=R;I=P}));var g=d.labelLinkClicked;d.labelLinkClicked=function(P,R,W){var X=R.getAttribute("href");if(null==X||!d.isCustomLink(X)||!mxEvent.isTouchEvent(W)&&mxEvent.isPopupTrigger(W))g.apply(this,-arguments);else{if(!d.isEnabled()||null!=P&&d.isCellLocked(P.cell))d.customLinkClicked(X),d.getRubberband().reset();mxEvent.consume(W)}};this.editor.getOrCreateFilename=function(){var P=c.defaultFilename,R=c.getCurrentFile();null!=R&&(P=null!=R.getTitle()?R.getTitle():P);return P};var q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,+this.menus.isShowCellEditItems=this.menus.isShowStyleItems}if(Editor.passiveScroll){var V=d.getCenterInsertPoint;d.getCenterInsertPoint=function(P){if(null!=this._contextMenuPoint){var S=this._contextMenuPoint;P=null!=P?P:new mxRectangle;return new mxPoint(d.snap(S.x-(P.width||0)/2),d.snap(S.y-(P.height||0)/2))}return V.apply(this,arguments)};var n=d.popupMenuHandler.hideMenu;d.popupMenuHandler.hideMenu=function(){n.apply(this,arguments);window.setTimeout(function(){d._contextMenuPoint=null;d._contextMenuScreenPoint=+null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var v=d.getExportVariables;d.getExportVariables=function(){var P=v.apply(this,arguments),S=c.getCurrentFile();null!=S&&(P.filename=S.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var W in c.fileVars)null==P[W]&&(P[W]=c.fileVars[W]);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 G=d.getGlobalVariable;d.getGlobalVariable=function(P){var S=c.getCurrentFile();if("filename"==P&&null!=S)return S.getTitle();if("page"==P&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==P)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==P)return null!=c.pages?c.pages.length:1;S=G.apply(this,arguments);null==S&&(c.updateFileVars(),+null!=c.fileVars&&(S=c.fileVars[P]));return S};var H=null,I=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var P=this.getCurrentFile(),S=null!=P&&null!=P.getTitle()?P.getTitle():this.defaultFilename;H!=S&&P==I&&(d.invalidateDescendantsWithPlaceholders(d.model.getRoot()),d.view.validate());H=S;I=P}));var g=d.labelLinkClicked;d.labelLinkClicked=function(P,S,W){var X=S.getAttribute("href");if(null==X||!d.isCustomLink(X)||!mxEvent.isTouchEvent(W)&&mxEvent.isPopupTrigger(W))g.apply(this,+arguments);else{if(!d.isEnabled()||null!=P&&d.isCellLocked(P.cell))d.customLinkClicked(X),d.getRubberband().reset();mxEvent.consume(W)}};this.editor.getOrCreateFilename=function(){var P=c.defaultFilename,S=c.getCurrentFile();null!=S&&(P=null!=S.getTitle()?S.getTitle():P);return P};var q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.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&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||d.addListener(mxEvent.ESCAPE,function(P,R){null!=R&&d.isEnabled()&&!d.isEditing()&&null!=R.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),-this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&d.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(P){var R=d.cellEditor.text2,W=null;null!=R&&(mxEvent.addListener(R,"dragleave",function(X){null!=W&&(W.parentNode.removeChild(W),W=null);X.stopPropagation();X.preventDefault()}),mxEvent.addListener(R,"dragover",mxUtils.bind(this,function(X){null==W&&(W=this.highlightElement(R));-X.stopPropagation();X.preventDefault()})),mxEvent.addListener(R,"drop",mxUtils.bind(this,function(X){null!=W&&(W.parentNode.removeChild(W),W=null);if(0<X.dataTransfer.files.length)this.importFiles(X.dataTransfer.files,0,0,this.maxImageSize,function(aa,ba,fa,ia,ea,ma){d.insertImage(aa,ea,ma)},function(){},function(aa){return"image/"==aa.type.substring(0,6)},function(aa){for(var ba=0;ba<aa.length;ba++)aa[ba]()},mxEvent.isControlDown(X));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")){var Y=-X.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Y)?this.loadImage(decodeURIComponent(Y),mxUtils.bind(this,function(aa){var ba=Math.max(1,aa.width);aa=Math.max(1,aa.height);var fa=this.maxImageSize;fa=Math.min(1,Math.min(fa/Math.max(1,ba)),fa/Math.max(1,aa));d.insertImage(decodeURIComponent(Y),ba*fa,aa*fa)})):document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")?document.execCommand("insertHTML",-!1,X.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"));X.stopPropagation();X.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var B=mxSettings.getUnit();q.setUnit(B);Editor.pageSizeUnit=B==mxConstants.METERS?mxConstants.MILLIMETERS:B;q.addListener("unitChanged",function(P,R){P=R.getProperty("unit");mxSettings.setUnit(P);mxSettings.save();Editor.pageSizeUnit=+!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||d.addListener(mxEvent.ESCAPE,function(P,S){null!=S&&d.isEnabled()&&!d.isEditing()&&null!=S.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),+this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&d.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(P){var S=d.cellEditor.text2,W=null;null!=S&&(mxEvent.addListener(S,"dragleave",function(X){null!=W&&(W.parentNode.removeChild(W),W=null);X.stopPropagation();X.preventDefault()}),mxEvent.addListener(S,"dragover",mxUtils.bind(this,function(X){null==W&&(W=this.highlightElement(S));+X.stopPropagation();X.preventDefault()})),mxEvent.addListener(S,"drop",mxUtils.bind(this,function(X){null!=W&&(W.parentNode.removeChild(W),W=null);if(0<X.dataTransfer.files.length)this.importFiles(X.dataTransfer.files,0,0,this.maxImageSize,function(Z,aa,ha,ja,fa,ma){d.insertImage(Z,fa,ma)},function(){},function(Z){return"image/"==Z.type.substring(0,6)},function(Z){for(var aa=0;aa<Z.length;aa++)Z[aa]()},mxEvent.isControlDown(X));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")){var Y=+X.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Y)?this.loadImage(decodeURIComponent(Y),mxUtils.bind(this,function(Z){var aa=Math.max(1,Z.width);Z=Math.max(1,Z.height);var ha=this.maxImageSize;ha=Math.min(1,Math.min(ha/Math.max(1,aa)),ha/Math.max(1,Z));d.insertImage(decodeURIComponent(Y),aa*ha,Z*ha)})):document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")?document.execCommand("insertHTML",+!1,X.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"));X.stopPropagation();X.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var C=mxSettings.getUnit();q.setUnit(C);Editor.pageSizeUnit=C==mxConstants.METERS?mxConstants.MILLIMETERS:C;q.addListener("unitChanged",function(P,S){P=S.getProperty("unit");mxSettings.setUnit(P);mxSettings.save();Editor.pageSizeUnit=P==mxConstants.METERS?mxConstants.MILLIMETERS:P});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=document.getElementById("geFooter");null!=q&&(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)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(P,R){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 J=this.isSelectionAllowed;this.isSelectionAllowed=function(P){return mxEvent.getSource(P)==this.styleInput?!0:J.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var Q=null;mxEvent.addListener(d.container,"dragleave",function(P){d.isEnabled()&&-(null!=Q&&(Q.parentNode.removeChild(Q),Q=null),P.stopPropagation(),P.preventDefault())});mxEvent.addListener(d.container,"dragover",mxUtils.bind(this,function(P){null==Q&&(Q=this.highlightElement(d.container));null!=this.sidebar&&this.sidebar.hideTooltip();P.stopPropagation();P.preventDefault()}));mxEvent.addListener(d.container,"drop",mxUtils.bind(this,function(P){null!=Q&&(Q.parentNode.removeChild(Q),Q=null);if(d.isEnabled()){var R=mxUtils.convertPoint(d.container,mxEvent.getClientX(P),mxEvent.getClientY(P)),-W=P.dataTransfer.files,X=d.view.translate,Y=d.view.scale,aa=R.x/Y-X.x,ba=R.y/Y-X.y;if(0<W.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(P)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(W,!0)):(mxEvent.isAltDown(P)&&(ba=aa=null),this.importFiles(W,aa,ba,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(P),null,null,mxEvent.isShiftDown(P),P));else{mxEvent.isAltDown(P)&&(ba=aa=0);var fa=0<=mxUtils.indexOf(P.dataTransfer.types,"text/uri-list")?-P.dataTransfer.getData("text/uri-list"):null;R=this.extractGraphModelFromEvent(P,null!=this.pages);if(null!=R)d.setSelectionCells(this.importXml(R,aa,ba,!0));else if(0<=mxUtils.indexOf(P.dataTransfer.types,"text/html")){var ia=P.dataTransfer.getData("text/html");R=document.createElement("div");R.innerHTML=Graph.sanitizeHtml(ia);var ea=null;W=R.getElementsByTagName("img");null!=W&&1==W.length?(ia=W[0].getAttribute("src"),null==ia&&(ia=W[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ia)||-(ea=!0)):(W=R.getElementsByTagName("a"),null!=W&&1==W.length?ia=W[0].getAttribute("href"):(R=R.getElementsByTagName("pre"),null!=R&&1==R.length&&(ia=mxUtils.getTextContent(R[0]))));var ma=!0,qa=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(ia,aa,ba,!0,ea,null,ma,mxEvent.isControlDown(P)))});ea&&null!=ia&&ia.length>this.resampleThreshold?this.confirmImageResize(function(na){ma=na;qa()},mxEvent.isControlDown(P)):qa()}else null!=fa&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(fa)?this.loadImage(decodeURIComponent(fa),-mxUtils.bind(this,function(na){var ta=Math.max(1,na.width);na=Math.max(1,na.height);var ra=this.maxImageSize;ra=Math.min(1,Math.min(ra/Math.max(1,ta)),ra/Math.max(1,na));d.setSelectionCell(d.insertVertex(null,null,"",aa,ba,ta*ra,na*ra,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+fa+";"))}),mxUtils.bind(this,function(na){d.setSelectionCells(this.insertTextAt(fa,aa,ba,!0))})):0<=mxUtils.indexOf(P.dataTransfer.types,"text/plain")&&-d.setSelectionCells(this.insertTextAt(P.dataTransfer.getData("text/plain"),aa,ba,!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(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",-function(){mxClient.IS_SF&&d.view.validateBackground()});d.addListener("enabledChanged",mxUtils.bind(this,function(){d.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var P=parseInt(this.div.offsetLeft),R=parseInt(this.div.offsetWidth),W=c.embedViewport.x+c.embedViewport.width,X=parseInt(this.div.offsetTop),Y=parseInt(this.div.offsetHeight),aa=c.embedViewport.y+c.embedViewport.height;-this.div.style.left=Math.max(c.embedViewport.x,Math.min(P,W-R))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(X,aa-Y))+"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"}};var N=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(P,R){N.call(this,P,R);c.hideCurrentMenu()};var S=mxWindow.prototype.setSize;mxWindow.prototype.setSize=-function(P,R){S.call(this,P,R);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(B=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,B<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&B<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=B)),this.fireEvent(new mxEventObject("themeInitialized"));-"kennedy"==q&&(B=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,B<Editor.smallScreenWidth&&(this.formatWidth=0),B<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=B)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&-(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(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);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(P,R){d.enableFlowAnimation=Editor.enableAnimations;d.refresh()}));d.enableFlowAnimation=Editor.enableAnimations;-screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=d&&c<d?-this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<d&&c>=d&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));d=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=d&&c<d?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<d&&c>=d&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);-null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,d=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,m=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(D),mxEvent.getClientY(D)),this.sendEmbeddedSvgExport())}));-document.body.style.cursor="text";var t=document.createElement("div");t.style.position="absolute";t.style.width="10px";t.style.height="10px";t.style.borderRadius="5px";t.style.border="1px solid gray";t.style.background="#ffffff";t.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(t);this.bottomResizer=t;var v=null,A=null,C=null,E=null;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(D){E=parseInt(this.diagramContainer.style.height);A=mxEvent.getClientY(D);m.popupMenuHandler.hideMenu();-mxEvent.consume(D)}));t=t.cloneNode(!1);t.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(t);this.rightResizer=t;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(D){C=parseInt(this.diagramContainer.style.width);v=mxEvent.getClientX(D);m.popupMenuHandler.hideMenu();mxEvent.consume(D)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(D){var U=!1;null!=v&&(this.diagramContainer.style.width=Math.max(20,C+mxEvent.getClientX(D)-v)+"px",U=!0);null!=-A&&(this.diagramContainer.style.height=Math.max(20,E+mxEvent.getClientY(D)-A)+"px",U=!0);U&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(D){null==v&&null==A||mxEvent.consume(D);A=v=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";d.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(D){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(D){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border=-"";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";d.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var d=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 m=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(v){var A=mxEvent.getSource(v);null==d.container||!d.isEnabled()||d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==A.nodeName||"TEXTAREA"==A.nodeName&&A!==this.typingShim||"true"==A.contentEditable||224!=v.keyCode&&(mxClient.IS_MAC||-17!=v.keyCode)&&(!mxClient.IS_MAC||91!=v.keyCode&&93!=v.keyCode)||m||(k.style.left=d.container.scrollLeft+10+"px",k.style.top=d.container.scrollTop+10+"px",v=d.container.scrollLeft,A=d.container.scrollTop,d.container.appendChild(k),m=!0,k.focus(),document.execCommand("selectAll",!1,null),d.container.scrollLeft=v,d.container.scrollTop=A)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(v){var A=v.keyCode;window.setTimeout(mxUtils.bind(this,function(){!m||224!=A&&17!=A&&91!=A&&93!=-A||(m=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(v){if(d.isEnabled())try{mxClipboard.copy(d),this.copyCells(k),c()}catch(A){this.handleError(A)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(v){if(d.isEnabled())try{mxClipboard.copy(d),this.copyCells(k,!0),c()}catch(A){this.handleError(A)}}));mxEvent.addListener(k,"paste",-mxUtils.bind(this,function(v){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=v.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(v,k,!0,!0)),!mxEvent.isConsumed(v)){var A=d.container.scrollLeft,C=d.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{d.container.scrollLeft=A,d.container.scrollTop=C,Graph.removePasteFormatting(k.firstChild),this.pasteCells(v,k,!1,!0)}catch(E){this.handleError(E)}}),0)}}catch(E){this.handleError(E)}}),-!0);var t=this.isSelectionAllowed;this.isSelectionAllowed=function(v){return mxEvent.getSource(v)==k?!0:t.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,d){mxSettings.setUi(c);(d=this.doSetCurrentTheme(c)||d)||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,d){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":-"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||d)d=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(d);return k};EditorUi.prototype.saveScrollState=function(c){var d=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,-m=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,m-=this.embedViewport.y):(k+=this.embedViewport.x,m+=this.embedViewport.y));d={x:k,y:m,tx:d.x,ty:d.y};c&&(d.boundingRect=this.diagramContainer.getBoundingClientRect());return d};EditorUi.prototype.restoreScrollState=function(c){var d=this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var m=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x--m.x;c.y-=c.boundingRect.y-m.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*d;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*d};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var d=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||d||-(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var m=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;d=null!=m&&null!=m.getAttribute("class");if(!d&&null!=m){m=m.getAttribute("title");var t=this.getCurrentFile();t=null!=t?t.savingStatusKey:DrawioFile.prototype.savingStatusKey;m==mxResources.get(t)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+-mxUtils.htmlEntities(mxResources.get(t))+'..."src="'+Editor.tailSpin+'"></div>',d=!0)}this.statusContainer.style.display="none";m=32>=c.clientWidth;c.style.visibility=m&&""==this.editor.getStatus()?"hidden":"";if(m||d)this.statusContainer.style.display="",d=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",k);k()};-EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,-this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),d=0;d<c.length;d++)null!=c[d]&&c[d].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),d=0;d<c.length;d++)null!=c[d]&&c[d].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),-this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&-(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),-this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,d,k){var m=this.threshold,t=c<=m;c=c+k.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-m;var v=d<=m;d=d+k.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||-document.body.clientHeight)-m;return t&&v?"top-left":c&&v?"top-right":t&&d?"bottom-left":c&&d?"bottom-right":t?"left":c?"right":v?"top":d?"bottom":null},dock:function(c,d){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,t=parseInt(c.div.style.width),v=parseInt(c.div.style.height),A=c.getX(),C=c.getY();c.dockState=d;c.div.classList.add("mxWindowDocked");var E=0<=d.indexOf("right"),-D=0<=d.indexOf("bottom");0<=d.indexOf("left")?A=0:0<=d.indexOf("right")&&(A=k-t);0<=d.indexOf("top")?C=0:0<=d.indexOf("bottom")&&(C=m-v);E||(E=A+t/2>k/2);D||(D=C+v/2>m/2);c._dockAnchorRight=E;c._dockAnchorBottom=D;c._dockOffsetX=E?k-A-t:A;c._dockOffsetY=D?m-C-v:C;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",d))},undock:function(c){var d=c.dockState;if(null!=d){for(var k=0;k<this.windows.length;k++)if(this.windows[k]===c){this.windows.splice(k,1);break}c.div.classList.remove("mxWindowDocked");-c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",d))}},pinToEdge:function(c){var d=c.dockState;if(null!=d){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,t=parseInt(c.div.style.width),v=parseInt(c.div.style.height);var A=c._dockAnchorRight?k-t-(c._dockOffsetX||0):-c._dockOffsetX||0;var C=c._dockAnchorBottom?m-v-(c._dockOffsetY||0):c._dockOffsetY||0;0<=d.indexOf("left")?A=0:0<=d.indexOf("right")&&(A=k-t);0<=d.indexOf("top")?C=0:0<=d.indexOf("bottom")&&(C=m-v);A=Math.max(0,Math.min(A,k-t));C=Math.max(0,Math.min(C,m-v));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,A,C);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,d){null==this.previewElement&&(this.previewElement=-document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,t=this.previewElement,v=d.div.offsetWidth,A=d.div.offsetHeight,C=d.getX();d=d.getY();0<=c.indexOf("left")?C=0:0<=c.indexOf("right")&&(C=k-v);0<=c.indexOf("top")?d=0:0<=c.indexOf("bottom")&&(d=m-A);C=Math.max(0,-Math.min(C,k-v));d=Math.max(0,Math.min(d,m-A));t.style.display="block";t.style.left=C+"px";t.style.top=d+"px";t.style.width=v+"px";t.style.height=A+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var d=0;d<this.windows.length;d++)if(this.windows[d]===c){this.windows.splice(d,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),-this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var F=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,d,k){F.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var m=c.window;null==this.dockManager&&this.createDockManager();var t=this.dockManager,v=!1,A=null,C=m.setLocation;m.setLocation=-function(U,T){(null==this.dockState||this._undocking||this._relayouting)&&C.call(this,U,T)};var E=m.setSize;m.setSize=function(U,T){null==this.dockState&&E.call(this,U,T)};m.addListener(mxEvent.MOVE_START,function(U,T){v=!0;A=null;null!=m.dockState&&(m._undocking=!0,t.undock(m),m._undocking=!1)});m.addListener(mxEvent.MOVE,function(U,T){v&&(U=t.getDockZone(m.getX(),m.getY(),m.div),U!=A&&(A=U,null!=U?t.showPreview(U,m):t.hidePreview()))});m.addListener(mxEvent.MOVE_END,function(U,T){v=!1;t.hidePreview();-null!=A&&t.dock(m,A);A=null});m.addListener(mxEvent.NORMALIZE,function(U,T){null!=m.dockState&&t.pinToEdge(m)});m.addListener(mxEvent.MAXIMIZE,function(U,T){null!=m.dockState&&(m._undocking=!0,t.undock(m),m._undocking=!1)});m.addListener(mxEvent.SHOW,function(U,T){null!=m.dockState&&t.pinToEdge(m)});var D=c.destroy;c.destroy=function(){t.removeWindow(m);D.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var d=this.editor.graph;d.defaultEdgeLength=Graph.prototype.defaultEdgeLength;-d.defaultGridEnabled=Graph.prototype.defaultGridEnabled;d.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)d.defaultEdgeLength=120;null==urlParams.grid&&(d.defaultGridEnabled=!1);null==urlParams.pv&&(d.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=-function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var d=this.getCurrentFile();null!=d&&(d.invalidChecksum?c=mxResources.get("error")+-": "+mxResources.get("checksum"):null==d.sync||d.sync.enabled&&d.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==d.sync||d.sync.isConnected()?d.isRealtimeEnabled()&&d.isRealtimeSupported()&&1<d.getRealtimeState()&&(c=d.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=-function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};-EditorUi.prototype.createMenu=function(c,d,k,m){k=null!=k?k:"geButton";var t=this.menus.get(c);m=this.menubar.addMenu(mxResources.get(c),t.funct,null,m);m.className=k;m.setAttribute("title",mxResources.get(c));this.menus.menuCreated(t,m,k);null!=d&&(m.style.backgroundImage="url("+d+")",m.innerText="");return m};EditorUi.prototype.addButton=function(c,d,k,m){c=this.createToolbarButton(c,d,k);m=null!=m?m:this.container;m.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,d,k){var m=-document.createElement("a");m.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(m.style.backgroundImage="url("+c+")");null!=d&&m.setAttribute("title",d);null!=k&&mxEvent.addListener(m,"click",function(t){"disabled"!=m.getAttribute("disabled")&&k(t);mxEvent.consume(t)});mxEvent.preventDefault(m);return m};EditorUi.prototype.createMenuItem=function(c,d,k){var m=this.actions.get(c),t=null!=m?m.funct:null,v=this.createToolbarButton(d,mxResources.get(c)+(null!=m&&null!=m.shortcut?" ("+m.shortcut+-")":""),t);null==m||k||(c=function(){m.isEnabled()?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),m.addListener("stateChanged",c),c());return v};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,d=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),k="1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=-new WrapperWindow(this,mxResources.get("format"),d,60,240,k,mxUtils.bind(this,function(v){v.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var m=this.formatWindow.window.toggleMinimized,t=240;this.formatWindow.window.toggleMinimized=function(){m.apply(this,arguments);this.minimized?(t=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width=-"140px",this.div.style.left=parseInt(this.div.style.left)+t-140+"px"):(this.div.style.width=t+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-t+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(v){mxEvent.getSource(v)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,-80);"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var v=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,A=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>v||690>A)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var O=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=-function(c){var d=this.formatWindow;null!=d?d.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):O.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,d){if(this.isShapesPanelVisible()!=c){var k=EditorUi.prototype.hsplitPosition;0==k&&(k=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var m=this.hsplitPosition,t=mxUtils.bind(this,function(){this.hsplitPosition=v;this.refresh();d||(this.diagramContainer.scrollLeft-=m-this.hsplitPosition)}),v=c?k:0,A=-Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==v?"translateX(0)":"translateX(-100%)");0!=v&&t();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==v?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+A+"s 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==v&&t();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*A)}),0)}};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)};EditorUi.prototype.createShapesPanel=function(c){var d=mxUtils.bind(this,function(A,C){var E=this.menus.get(A);A=this.createMenuElement(C,mxUtils.bind(this,function(){E.funct.apply(this,arguments)}));A.setAttribute("title",C);A.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";A.className="geButton";c.parentNode.appendChild(A);return A});if(Editor.enableCustomLibraries&&("1"!=-urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))d=document.createElement("div"),d.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",d.className="geButton",d.style.left="0px",d.style.right="50%",mxUtils.write(d,mxResources.get("newLibrary")),c.appendChild(d),mxEvent.addListener(d,"click",this.actions.get("newLibrary").funct),d=d.cloneNode(!1),d.style.left="50%",d.style.right="0px",mxUtils.write(d,mxResources.get("openLibrary")),-c.appendChild(d),mxEvent.addListener(d,"click",this.actions.get("openLibrary").funct);else{var k=d("newLibrary","");k.style.left="0px";k.style.right="50%";var m=document.createElement("span");k.appendChild(m);var t=d("openLibraryFrom","");t.style.borderLeftWidth="1px";t.style.left="50%";t.style.right="0px";var v=document.createElement("span");t.appendChild(v);this.dependsOnLanguage(mxUtils.bind(this,function(){m.innerHTML="";mxUtils.write(m,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));-v.innerHTML="";mxUtils.write(v,mxResources.get("openLibraryFrom"));t.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),d="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),k="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=-new WrapperWindow(this,mxResources.get("shapes"),k&&"1"!=urlParams.embedInline?66:10,k&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-d)/2):56,c-6,d-6,mxUtils.bind(this,function(m){this.createShapesPanel(m)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=-function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var d=c;"auto"==c&&(d=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(d);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=-function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,d){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(d))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();-this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var d=-document.getElementById("high-contrast-stylesheet");if(null!=d&&window.matchMedia){var k=window.matchMedia("(forced-colors: active)").matches,m=d.getAttribute("media");(m="all"==m||"not all"!=m&&k)&&!c?d.setAttribute("media",k?"not all":"(forced-colors: active)"):!m&&c&&d.setAttribute("media",k?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var d=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);-mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-d.x;this.diagramContainer.scrollTop+=c.x-d.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||-Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),-null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,d){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&d&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),-this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,d=this.sketchMainMenuElt,-k=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)d.style.left="10px",d.style.top="10px",k.style.left="10px",k.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left=-"0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var m=this.diagramContainer.getAttribute("data-bounds");if(null!=m){this.diagramContainer.removeAttribute("data-bounds");var t=m.split(" ");m=mxUtils.getDocumentSize();this.diagramContainer.style.top=t[0];this.diagramContainer.style.left=t[1];var v=parseInt(t[2]);t=parseInt(t[3]);v=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,-v):v,m.width-80);t=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,t):t,m.height-80);this.diagramContainer.style.width=v+"px";this.diagramContainer.style.height=t+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}d.style.left=this.diagramContainer.offsetLeft+"px";d.style.top=this.diagramContainer.offsetTop--d.offsetHeight-4+"px";k.style.display="";k.style.left=this.diagramContainer.offsetLeft-k.offsetWidth-4+"px";k.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=d.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight--this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;m="1"==urlParams.embedInline&&-Editor.passiveScroll;d.style.visibility=m?"hidden":"";c.style.visibility=m?"hidden":"";k.style.display=m?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&-null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle=-"none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing=-"8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch=-"1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=-mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var d=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var k=c.indexOf(",");0<k&&(d=this.getPageById(c.substring(k+1)),d=null!=d?d.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(d=this.getCustomLinkTitle(c));return d};EditorUi.prototype.getCustomLinkTitle=function(c){var d=mxResources.get("action");-if("data:action/json,"==c.substring(0,17))try{var k=JSON.parse(c.substring(17));null!=k&&null!=k.title&&(d=k.title)}catch(m){}return d};EditorUi.prototype.handleCustomLink=function(c,d){if(Graph.isPageLink(c))if(d=c.indexOf(","),c=this.getPageById(c.substring(d+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,d)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=-mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(d){d.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(d){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",-mxUtils.bind(this,function(d,k){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(d,k){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",-mxUtils.bind(this,function(d,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(d,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(d,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(d,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.writeImageToClipboard=function(c,d,k,m,t,v){m=null!=m?m:"image/png";var A=null==d||null==k?'<img src="'+c+'">':'<img src="'+c+'" width="'+d+'" height="'+k+'">',C={"text/html":new Blob([A],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(m)&&(C[m]=this.base64ToBlob(c.substring(c.indexOf(",")+1),m));var E=new ClipboardItem(C);navigator.clipboard.write([E]).then(t)["catch"](v);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",-[c],"w",d,"h",k,"type",m,"html",[A],"data",[C],"item",[E])};EditorUi.prototype.writeHtmlToClipboard=function(c,d){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](d)};EditorUi.prototype.writeTextToClipboard=function(c,d,k){navigator.clipboard.writeText(c)["catch"](d).then(function(){null!=k&&k()})};EditorUi.prototype.copySvg=function(c,d,k){try{if(null!=navigator.clipboard&&-"function"===typeof window.ClipboardItem){var m=this.editor.graph.getSvg(null,k,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);m.setAttribute("content",d);var t=Editor.createSvgDataUri(mxUtils.getXml(m)),v=parseInt(m.getAttribute("width")),A=parseInt(m.getAttribute("height"));this.writeImageToClipboard(t,v,A,"image/svg+xml",null,mxUtils.bind(this,function(C){this.handleError(C)}))}}catch(C){this.handleError(C)}};EditorUi.prototype.copyImage=function(c,d,k){try{k=null!=k?-k:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(m,t){try{this.spinner.stop();var v=this.createImageDataUri(m,d,"png"),A=Math.round(parseInt(t.getAttribute("width"))/k),C=Math.round(parseInt(t.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[d],"scale",[k]);this.writeImageToClipboard(v,A,C,"image/png",null,mxUtils.bind(this,-function(){if(this.isLocalFileSave()){var E=this.getBaseFilename(!1)+(null!=d?".drawio":"")+".png";this.saveLocalFile(v.substring(v.lastIndexOf(",")+1),E,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(E){this.handleError(E)}}),null,null,null,mxUtils.bind(this,function(m){this.spinner.stop();this.handleError(m)}),null,null,k,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(m){this.handleError(m)}};-EditorUi.prototype.copyCells=function(c,d){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var m=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),t=mxUtils.getXml(k.encodeCells(m));mxUtils.setTextContent(c,encodeURIComponent(t));d?(k.removeCells(m,!1),k.lastPasteXml=null):(k.lastPasteXml=t,k.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeClipboard){var d=this.editor.graph;-d.isSelectionEmpty()||(c=mxUtils.sortCells(d.getExportableCells(d.model.getTopmostCells(d.getSelectionCells()))),d=mxUtils.getXml(d.encodeCells(c)),navigator.clipboard.writeText(d))}return c};EditorUi.prototype.pasteXml=function(c,d,k,m,t,v){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[d],"compat",[k],"evt",[m],"html",[t],"pt",[v]);t=null!=t?t:!0;var A=this.editor.graph,C=null!=v?v:Editor.pasteAtMousePointer&&A.isMouseInsertPoint()?A.getInsertPoint():null;v=null;A.lastPasteXml==-c?null==C&&A.pasteCounter++:(A.lastPasteXml=c,A.pasteCounter=0);var E=A.pasteCounter*A.gridSize;if(k||this.isCompatibleString(c)){A.model.beginUpdate();try{if(v=this.importXml(c,E,E),null!=C){var D=A.getBoundingBoxFromGeometry(v,!0);if(null!=D){var U=Math.round(A.snap(C.x)),T=Math.round(A.snap(C.y));A.cellsMoved(v,U-D.x,T-D.y)}}}finally{A.model.endUpdate()}A.setSelectionCells(v)}else if(d&&1==A.getSelectionCount()){d=A.getStartEditingCell(A.getSelectionCell(),m);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&-"image"==A.getCurrentCellStyle(d)[mxConstants.STYLE_SHAPE])A.setCellStyles(mxConstants.STYLE_IMAGE,c,[d]);else{A.model.beginUpdate();try{A.labelChanged(d,c),Graph.isLink(c)&&A.setLinkForCell(d,c)}finally{A.model.endUpdate()}}A.setSelectionCell(d)}else C=null!=C?C:A.getInsertPoint(),A.isMouseInsertPoint()&&(E=0,A.lastPasteXml==c&&0<A.pasteCounter&&A.pasteCounter--),v=this.insertTextAt(c,C.x+E,C.y+E,t),A.setSelectionCells(v);A.isSelectionEmpty()||(A.scrollCellToVisible(A.getSelectionCell()),null!=this.hoverIcons&&-this.hoverIcons.update(A.view.getState(A.getSelectionCell())));return v};EditorUi.prototype.pasteCells=function(c,d,k,m){if(!mxEvent.isConsumed(c)){var t=c.clipboardData,v=this.editor.graph,A=!1,C=d;if(k&&null!=t&&t.getData){var E=t.getData("text/plain"),D=!1;if(null!=E&&0<E.length&&"%3CmxGraphModel%3E"==E.substring(0,18))try{var U=decodeURIComponent(E);this.isCompatibleString(U)&&(D=!0,E=U)}catch(I){}D=D?null:t.getData("text/html");null!=D&&0<D.length?(C=this.parseHtmlData(D),A="text/plain"!=C.getAttribute("data-type")):-null!=E&&0<E.length&&(C=document.createElement("div"),mxUtils.setTextContent(C,D))}E=C.getElementsByTagName("span");if(null!=E&&0<E.length&&"application/vnd.lucid.chart.objects"===E[0].getAttribute("data-lucid-type"))k=E[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(I){var g=this.editor.graph;g.lastPasteXml==I?g.pasteCounter++:(g.lastPasteXml=I,g.pasteCounter=0);var q=g.pasteCounter*g.gridSize;g.setSelectionCells(this.importXml(I,q,-q));g.scrollCellToVisible(g.getSelectionCell())}),mxUtils.bind(this,function(I){this.handleError(I)})),mxEvent.consume(c));else{var T=!1,V="";V=A?null!=C.textContent&&"<mxfile"==C.textContent.substring(0,7)&&"</mxfile>"==C.textContent.substring(C.textContent.length-9)||"<mxGraphModel"==C.textContent.substring(0,13)&&"</mxGraphModel>"==C.textContent.substring(C.textContent.length-15)?C.textContent.replace(/\u00a0/g," "):C.innerHTML:mxUtils.trim(null==C.innerText?mxUtils.getTextContent(C):C.innerText);-try{var n=V.lastIndexOf("%3E");0<=n&&n<V.length-3&&(V=V.substring(0,n+3))}catch(I){}try{E=C.getElementsByTagName("span"),(U=null!=E&&0<E.length?mxUtils.trim(decodeURIComponent(E[0].textContent)):decodeURIComponent(V))&&(this.isCompatibleString(U)||0==U.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(T=!0,V=U)}catch(I){}U=null;try{if(!T&&""==C.textContent)for(n=0;n<t.items.length;n++){var u=t.items[n];if("file"===u.kind){U=u.getAsFile();break}}}catch(I){}EditorUi.debug("EditorUi.pasteCells",-[this],"evt",[c],"realElt",[d.outerHTML],"elt",[C.outerHTML],"useEvent",k,"pasteAsLabel",m,"xml",[V],"compat",T,"asHtml",A,"data",t,"items",[t.items.length],"files",[t.files.length],"types",[JSON.stringify(t.types)],"blob",[U]);try{if(T||null==U)if(null!=V&&0<V.length){if(0==V.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var H=mxUtils.bind(this,function(){try{V=(new MiroImporter).importMiroJson(JSON.parse(V)),this.pasteXml(V,m,T,c)}catch(I){console.log("Miro import error:",I)}});-"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",H):H()}else this.pasteXml(V,m,T,c,A);mxEvent.consume(c)}else k||(v.lastPasteXml=null,v.pasteCounter=0);else{var G=v.getInsertPoint();this.importFiles([U],G.x,G.y,this.maxImageSize);mxEvent.consume(c)}}catch(I){this.handleError(I)}}}d.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var d=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&d.isMouseInsertPoint()&&(c=d.getInsertPoint());if(d.isEnabled()&&-!d.isCellLocked(d.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,m,t,v,A){if(null!=k){d.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{d.getModel().endUpdate()}}else k=null!=m?m:null!=t?t:v,null!=k?(c=null!=c?c:d.getInsertPoint(),this.importFiles([k],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(k){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var d=-this.editor.graph;d.getModel().beginUpdate();try{d.moveCellsTo(mxClipboard.paste(d),c)}finally{d.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(d){for(var k=null!=d.clipboardData?d.clipboardData:d.originalEvent.clipboardData,m=!1,t=null,v=0;v<k.types.length;v++)if("text/"===k.types[v].substring(0,5)){m=!0;break}for(v=0;v<k.items.length;v++){var A=k.items[v];if("file"===A.kind){t=-A.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[d],"data",[k],"items",[k.items.length],"files",[k.files.length],"types",[JSON.stringify(k.types)],"containsText",m,"file",[t],"editing",c.isEditing());var C=mxUtils.bind(this,function(){try{if(!m&&null!=t){if(c.isEditing())this.importFiles([t],0,0,this.maxImageSize,function(D,U,T,V,n,u){c.insertImage(D,n,u)},function(){},function(D){return"image/"==D.type.substring(0,6)},function(D){for(var U=0;U<D.length;U++)D[U]()});-else{var E=this.editor.graph.getInsertPoint();this.importFiles([t],E.x,E.y,this.maxImageSize)}mxEvent.consume(d)}}catch(D){}});if(!mxEvent.isConsumed(d)&&!m)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(E){this.readTypeFromClipboardData(E,"image/svg+xml",mxUtils.bind(this,function(D){if(null!=D){D=new Blob([D],{type:"image/svg+xml"});var U=this.editor.graph.getInsertPoint();this.importFiles([D],U.x,U.y,this.maxImageSize)}else C()}),"image")}))["catch"](C);-else C()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(d){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",d,"types",null!=d&&0<d.length?[JSON.stringify(d[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(d,mxUtils.bind(this,function(k,m){null!=k?c(k):this.readGraphModelFromImageClipboardData(d,mxUtils.bind(this,function(t,v,A){null!=t?c(t):this.readTypeFromClipboardData(d,"text/plain",mxUtils.bind(this,-function(C){c(C,v,A,m,d)}))}))}))}catch(k){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,d){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(k){var m=null,t=null;try{var v=this.parseHtmlData(k);if(null!=v){m="text/plain"!=v.getAttribute("data-type")?v.innerHTML:mxUtils.trim(null==v.innerText?mxUtils.getTextContent(v):v.innerText);try{var A=m.lastIndexOf("%3E");0<=A&&A<m.length-3&&(m=m.substring(0,A+3))}catch(D){}try{null==-m&&(k=null,""==v.textContent&&1==v.children.length&&"IMG"==v.firstChild.nodeName&&(k=v.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?t=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&(t=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(D){}try{var C=v.getElementsByTagName("span"),E=null!=C&&0<C.length?mxUtils.trim(decodeURIComponent(C[0].textContent)):decodeURIComponent(m);-this.isCompatibleString(E)&&(m=E)}catch(D){}}}catch(D){}d(this.isCompatibleString(m)?m:null,t)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,d){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,m){var t=null;try{null!=k&&(t=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(v){}this.isCompatibleString(t)?d(t):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(v,A){t=Editor.extractGraphModelFromPng("data:image/png;base64,"+-v);this.isCompatibleString(t)?d(t):d(null,m,A)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,d,k){var m=!1;if(null!=c&&0<c.length)for(var t=0;t<c.length&&!m;t++)(function(v){0<=mxUtils.indexOf(v.types,d)&&(m=!0,v.getType(d).then(mxUtils.bind(this,function(A){if("image/png"==d)A.arrayBuffer().then(function(C){k(btoa(Graph.arrayBufferToString(C)),A)})["catch"](function(){k(null)});else A.text().then(mxUtils.bind(this,function(C){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],-"data",[c],"type",[d],"result",[C]);k(C,A)}))["catch"](function(){k(null)})}))["catch"](function(){k(null)}))})(c[t]);m||k()};EditorUi.prototype.parseHtmlData=function(c){var d=null;if(null!=c&&0<c.length){var k="<meta "==c.substring(0,6);d=document.createElement("div");d.innerHTML=(k?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;k=d.getElementsByTagName("style");if(null!=k)for(;0<k.length;)k[0].parentNode.removeChild(k[0]);if(null!=d.firstChild&&d.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&+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)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(P,S){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 J=this.isSelectionAllowed;this.isSelectionAllowed=function(P){return mxEvent.getSource(P)==this.styleInput?!0:J.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var M=null;mxEvent.addListener(d.container,"dragleave",function(P){d.isEnabled()&&+(null!=M&&(M.parentNode.removeChild(M),M=null),P.stopPropagation(),P.preventDefault())});mxEvent.addListener(d.container,"dragover",mxUtils.bind(this,function(P){null==M&&(M=this.highlightElement(d.container));null!=this.sidebar&&this.sidebar.hideTooltip();P.stopPropagation();P.preventDefault()}));mxEvent.addListener(d.container,"drop",mxUtils.bind(this,function(P){null!=M&&(M.parentNode.removeChild(M),M=null);if(d.isEnabled()){var S=mxUtils.convertPoint(d.container,mxEvent.getClientX(P),mxEvent.getClientY(P)),+W=P.dataTransfer.files,X=d.view.translate,Y=d.view.scale,Z=S.x/Y-X.x,aa=S.y/Y-X.y;if(0<W.length)if(S=this.isBlankFile()&&!this.canUndo(),X=1==W.length&&(EditorUi.isVisioFilename(W[0].name)||/(\.drawio)$/i.test(W[0].name)||/(\.xml)$/i.test(W[0].name)),"1"!=urlParams.embed&&S&&(X||mxEvent.isShiftDown(P))){this.fileLoaded(null,!0);var ha=mxUtils.bind(this,function(){this.editor.removeListener(ha);var ra=this.getCurrentFile();null!=ra&&ra.fileChanged()});this.editor.addListener("fileLoaded",ha);this.openFiles(W,+!0)}else mxEvent.isAltDown(P)&&(aa=Z=null),this.importFiles(W,Z,aa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(P),null,null,mxEvent.isShiftDown(P),P);else{mxEvent.isAltDown(P)&&(aa=Z=0);var ja=0<=mxUtils.indexOf(P.dataTransfer.types,"text/uri-list")?P.dataTransfer.getData("text/uri-list"):null;W=this.extractGraphModelFromEvent(P,null!=this.pages);if(null!=W)d.setSelectionCells(this.importXml(W,Z,aa,!0));else if(0<=mxUtils.indexOf(P.dataTransfer.types,"text/html")){var fa=P.dataTransfer.getData("text/html");+W=document.createElement("div");W.innerHTML=Graph.sanitizeHtml(fa);var ma=null;S=W.getElementsByTagName("img");null!=S&&1==S.length?(fa=S[0].getAttribute("src"),null==fa&&(fa=S[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(fa)||(ma=!0)):(S=W.getElementsByTagName("a"),null!=S&&1==S.length?fa=S[0].getAttribute("href"):(W=W.getElementsByTagName("pre"),null!=W&&1==W.length&&(fa=mxUtils.getTextContent(W[0]))));var sa=!0,ta=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(fa,+Z,aa,!0,ma,null,sa,mxEvent.isControlDown(P)))});ma&&null!=fa&&fa.length>this.resampleThreshold?this.confirmImageResize(function(ra){sa=ra;ta()},mxEvent.isControlDown(P)):ta()}else null!=ja&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ja)?this.loadImage(decodeURIComponent(ja),mxUtils.bind(this,function(ra){var qa=Math.max(1,ra.width);ra=Math.max(1,ra.height);var la=this.maxImageSize;la=Math.min(1,Math.min(la/Math.max(1,qa)),la/Math.max(1,ra));d.setSelectionCell(d.insertVertex(null,null,"",Z,aa,qa*la,ra*+la,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ja+";"))}),mxUtils.bind(this,function(ra){d.setSelectionCells(this.insertTextAt(ja,Z,aa,!0))})):0<=mxUtils.indexOf(P.dataTransfer.types,"text/plain")&&d.setSelectionCells(this.insertTextAt(P.dataTransfer.getData("text/plain"),Z,aa,!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(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&d.view.validateBackground()});d.addListener("enabledChanged",mxUtils.bind(this,function(){d.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||+null==c.embedViewport)mxUtils.fit(this.div);else{var P=parseInt(this.div.offsetLeft),S=parseInt(this.div.offsetWidth),W=c.embedViewport.x+c.embedViewport.width,X=parseInt(this.div.offsetTop),Y=parseInt(this.div.offsetHeight),Z=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(P,W-S))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(X,Z-Y))+"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"}};var Q=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(P,S){Q.call(this,P,S);c.hideCurrentMenu()};var T=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(P,S){T.call(this,P,S);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(C=window.innerWidth||+document.documentElement.clientWidth||document.body.clientWidth,C<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&C<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=C)),this.fireEvent(new mxEventObject("themeInitialized"));"kennedy"==q&&(C=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,C<Editor.smallScreenWidth&&(this.formatWidth=0),C<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=C)}q=+!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(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);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&+this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(P,S){d.enableFlowAnimation=Editor.enableAnimations;d.refresh()}));d.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var y=EditorUi.prototype.windowResized;+EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=d&&c<d?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<d&&c>=d&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));d=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&+this.lastWindowWidth>=d&&c<d?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<d&&c>=d&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,d=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,m=this.editor.graph;k.style.transform=+"";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(N){mxEvent.getSource(N)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(N),mxEvent.getClientY(N)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var t=document.createElement("div");t.style.position="absolute";t.style.width="10px";t.style.height="10px";t.style.borderRadius="5px";t.style.border="1px solid gray";t.style.background="#ffffff";t.style.cursor=+"row-resize";this.diagramContainer.parentNode.appendChild(t);this.bottomResizer=t;var u=null,A=null,B=null,D=null;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(N){D=parseInt(this.diagramContainer.style.height);A=mxEvent.getClientY(N);m.popupMenuHandler.hideMenu();mxEvent.consume(N)}));t=t.cloneNode(!1);t.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(t);this.rightResizer=t;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(N){B=parseInt(this.diagramContainer.style.width);+u=mxEvent.getClientX(N);m.popupMenuHandler.hideMenu();mxEvent.consume(N)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(N){var F=!1;null!=u&&(this.diagramContainer.style.width=Math.max(20,B+mxEvent.getClientX(N)-u)+"px",F=!0);null!=A&&(this.diagramContainer.style.height=Math.max(20,D+mxEvent.getClientY(N)-A)+"px",F=!0);F&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),+"*"),this.inlineSizeChanged(),this.refresh())}),function(N){null==u&&null==A||mxEvent.consume(N);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";d.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(N){this.inlineSizeChanged();+Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(N){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";d.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=+function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var d=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 m=!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==d.container||!d.isEnabled()||d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==A.nodeName||"TEXTAREA"==A.nodeName&&A!==this.typingShim||"true"==A.contentEditable||224!=u.keyCode&&(mxClient.IS_MAC||17!=u.keyCode)&&(!mxClient.IS_MAC||91!=u.keyCode&&93!=u.keyCode)||m||(k.style.left=d.container.scrollLeft+10+"px",k.style.top=d.container.scrollTop+10+"px",u=d.container.scrollLeft,A=d.container.scrollTop,d.container.appendChild(k),m=!0,k.focus(),document.execCommand("selectAll",!1,null),d.container.scrollLeft=+u,d.container.scrollTop=A)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(u){var A=u.keyCode;window.setTimeout(mxUtils.bind(this,function(){!m||224!=A&&17!=A&&91!=A&&93!=A||(m=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(u){if(d.isEnabled())try{mxClipboard.copy(d),this.copyCells(k),c()}catch(A){this.handleError(A)}}));+mxEvent.addListener(k,"cut",mxUtils.bind(this,function(u){if(d.isEnabled())try{mxClipboard.copy(d),this.copyCells(k,!0),c()}catch(A){this.handleError(A)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(u){if(d.isEnabled()&&!d.isCellLocked(d.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=d.container.scrollLeft,B=d.container.scrollTop;window.setTimeout(mxUtils.bind(this,+function(){try{d.container.scrollLeft=A,d.container.scrollTop=B,Graph.removePasteFormatting(k.firstChild),this.pasteCells(u,k,!1,!0)}catch(D){this.handleError(D)}}),0)}}catch(D){this.handleError(D)}}),!0);var t=this.isSelectionAllowed;this.isSelectionAllowed=function(u){return mxEvent.getSource(u)==k?!0:t.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,d){mxSettings.setUi(c);(d=this.doSetCurrentTheme(c)||d)||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,d){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||d)d=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),+this.restoreScrollState(d);return k};EditorUi.prototype.saveScrollState=function(c){var d=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,m=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,m-=this.embedViewport.y):(k+=this.embedViewport.x,m+=this.embedViewport.y));d={x:k,y:m,tx:d.x,ty:d.y};c&&(d.boundingRect=this.diagramContainer.getBoundingClientRect());return d};EditorUi.prototype.restoreScrollState=function(c){var d=+this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var m=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-m.x;c.y-=c.boundingRect.y-m.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*d;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*d};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var d=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&+(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||d||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var m=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;d=null!=m&&null!=m.getAttribute("class");if(!d&&null!=m){m=m.getAttribute("title");var t=this.getCurrentFile();+t=null!=t?t.savingStatusKey:DrawioFile.prototype.savingStatusKey;m==mxResources.get(t)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(t))+'..."src="'+Editor.tailSpin+'"></div>',d=!0)}this.statusContainer.style.display="none";m=32>=c.clientWidth;c.style.visibility=m&&""==this.editor.getStatus()?"hidden":"";if(m||d)this.statusContainer.style.display="",d=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=+0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",k);k()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=+function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),d=0;d<c.length;d++)null!=c[d]&&c[d].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),d=0;d<+c.length;d++)null!=c[d]&&c[d].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=+null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=+null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,d,k){var m=this.threshold,t=c<=m;c=c+k.offsetWidth>=(window.innerWidth||+document.documentElement.clientWidth||document.body.clientWidth)-m;var u=d<=m;d=d+k.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-m;return t&&u?"top-left":c&&u?"top-right":t&&d?"bottom-left":c&&d?"bottom-right":t?"left":c?"right":u?"top":d?"bottom":null},dock:function(c,d){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,+t=parseInt(c.div.style.width),u=parseInt(c.div.style.height),A=c.getX(),B=c.getY();c.dockState=d;c.div.classList.add("mxWindowDocked");var D=0<=d.indexOf("right"),N=0<=d.indexOf("bottom");0<=d.indexOf("left")?A=0:0<=d.indexOf("right")&&(A=k-t);0<=d.indexOf("top")?B=0:0<=d.indexOf("bottom")&&(B=m-u);D||(D=A+t/2>k/2);N||(N=B+u/2>m/2);c._dockAnchorRight=D;c._dockAnchorBottom=N;c._dockOffsetX=D?k-A-t:A;c._dockOffsetY=N?m-B-u:B;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,+"side",d))},undock:function(c){var d=c.dockState;if(null!=d){for(var k=0;k<this.windows.length;k++)if(this.windows[k]===c){this.windows.splice(k,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",d))}},pinToEdge:function(c){var d=c.dockState;if(null!=d){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=+window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,t=parseInt(c.div.style.width),u=parseInt(c.div.style.height);var A=c._dockAnchorRight?k-t-(c._dockOffsetX||0):c._dockOffsetX||0;var B=c._dockAnchorBottom?m-u-(c._dockOffsetY||0):c._dockOffsetY||0;0<=d.indexOf("left")?A=0:0<=d.indexOf("right")&&(A=k-t);0<=d.indexOf("top")?B=0:0<=d.indexOf("bottom")&&(B=m-u);A=Math.max(0,Math.min(A,k-t));B=Math.max(0,Math.min(B,m-u));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,+A,B);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,d){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,t=this.previewElement,+u=d.div.offsetWidth,A=d.div.offsetHeight,B=d.getX();d=d.getY();0<=c.indexOf("left")?B=0:0<=c.indexOf("right")&&(B=k-u);0<=c.indexOf("top")?d=0:0<=c.indexOf("bottom")&&(d=m-A);B=Math.max(0,Math.min(B,k-u));d=Math.max(0,Math.min(d,m-A));t.style.display="block";t.style.left=B+"px";t.style.top=d+"px";t.style.width=u+"px";t.style.height=A+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var d=0;d<this.windows.length;d++)if(this.windows[d]===+c){this.windows.splice(d,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var E=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,d,k){E.apply(this,arguments);+if(EditorUi.windowed&&Editor.enableWindowDocking){var m=c.window;null==this.dockManager&&this.createDockManager();var t=this.dockManager,u=!1,A=null,B=m.setLocation;m.setLocation=function(F,U){(null==this.dockState||this._undocking||this._relayouting)&&B.call(this,F,U)};var D=m.setSize;m.setSize=function(F,U){null==this.dockState&&D.call(this,F,U)};m.addListener(mxEvent.MOVE_START,function(F,U){u=!0;A=null;null!=m.dockState&&(m._undocking=!0,t.undock(m),m._undocking=!1)});m.addListener(mxEvent.MOVE,+function(F,U){u&&(F=t.getDockZone(m.getX(),m.getY(),m.div),F!=A&&(A=F,null!=F?t.showPreview(F,m):t.hidePreview()))});m.addListener(mxEvent.MOVE_END,function(F,U){u=!1;t.hidePreview();null!=A&&t.dock(m,A);A=null});m.addListener(mxEvent.NORMALIZE,function(F,U){null!=m.dockState&&t.pinToEdge(m)});m.addListener(mxEvent.MAXIMIZE,function(F,U){null!=m.dockState&&(m._undocking=!0,t.undock(m),m._undocking=!1)});m.addListener(mxEvent.SHOW,function(F,U){null!=m.dockState&&t.pinToEdge(m)});var N=c.destroy;c.destroy=+function(){t.removeWindow(m);N.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var d=this.editor.graph;d.defaultEdgeLength=Graph.prototype.defaultEdgeLength;d.defaultGridEnabled=Graph.prototype.defaultGridEnabled;d.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)d.defaultEdgeLength=+120;null==urlParams.grid&&(d.defaultGridEnabled=!1);null==urlParams.pv&&(d.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=+function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var d=this.getCurrentFile();null!=d&&(d.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==d.sync||d.sync.enabled&&d.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==d.sync||d.sync.isConnected()?d.isRealtimeEnabled()&&d.isRealtimeSupported()&&1<d.getRealtimeState()&&(c=d.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:+mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);+null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,d,k,m){k=null!=k?k:"geButton";var t=this.menus.get(c);m=this.menubar.addMenu(mxResources.get(c),t.funct,null,m);m.className=k;m.setAttribute("title",mxResources.get(c));this.menus.menuCreated(t,m,k);null!=d&&(m.style.backgroundImage="url("+d+")",m.innerText="");return m};EditorUi.prototype.addButton=function(c,d,+k,m){c=this.createToolbarButton(c,d,k);m=null!=m?m:this.container;m.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,d,k){var m=document.createElement("a");m.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(m.style.backgroundImage="url("+c+")");null!=d&&m.setAttribute("title",d);null!=k&&mxEvent.addListener(m,"click",function(t){"disabled"!=m.getAttribute("disabled")&&k(t);mxEvent.consume(t)});mxEvent.preventDefault(m);return m};EditorUi.prototype.createMenuItem=+function(c,d,k){var m=this.actions.get(c),t=null!=m?m.funct:null,u=this.createToolbarButton(d,mxResources.get(c)+(null!=m&&null!=m.shortcut?" ("+m.shortcut+")":""),t);null==m||k||(c=function(){m.isEnabled()?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),m.addListener("stateChanged",c),c());return u};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,d=Math.max(10,this.diagramContainer.parentNode.clientWidth-+256),k="1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),d,60,240,k,mxUtils.bind(this,function(u){u.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var m=this.formatWindow.window.toggleMinimized,t=240;this.formatWindow.window.toggleMinimized=+function(){m.apply(this,arguments);this.minimized?(t=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+t-140+"px"):(this.div.style.width=t+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-t+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(u){mxEvent.getSource(u)==this.formatWindow.window.title&&+this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var u=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,A=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>u||690>A)&&this.formatWindow.window.toggleMinimized()}),+0)):this.formatWindow.window.setVisible(!1)}};var R=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var d=this.formatWindow;null!=d?d.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):R.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,d){if(this.isShapesPanelVisible()!=c){var k=EditorUi.prototype.hsplitPosition;0==k&&(k=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var m=this.hsplitPosition,t=mxUtils.bind(this,+function(){this.hsplitPosition=u;this.refresh();d||(this.diagramContainer.scrollLeft-=m-this.hsplitPosition)}),u=c?k:0,A=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==u?"translateX(0)":"translateX(-100%)");0!=u&&t();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==u?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+A+"s 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==u&&t();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*A)}),0)}};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)};EditorUi.prototype.createShapesPanel=function(c){var d=mxUtils.bind(this,function(A,B){var D=this.menus.get(A);A=this.createMenuElement(B,mxUtils.bind(this,function(){D.funct.apply(this,arguments)}));A.setAttribute("title",B);A.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";+A.className="geButton";c.parentNode.appendChild(A);return A});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))d=document.createElement("div"),d.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",d.className="geButton",d.style.left="0px",d.style.right="50%",mxUtils.write(d,mxResources.get("newLibrary")),c.appendChild(d),mxEvent.addListener(d,"click",this.actions.get("newLibrary").funct),+d=d.cloneNode(!1),d.style.left="50%",d.style.right="0px",mxUtils.write(d,mxResources.get("openLibrary")),c.appendChild(d),mxEvent.addListener(d,"click",this.actions.get("openLibrary").funct);else{var k=d("newLibrary","");k.style.left="0px";k.style.right="50%";var m=document.createElement("span");k.appendChild(m);var t=d("openLibraryFrom","");t.style.borderLeftWidth="1px";t.style.left="50%";t.style.right="0px";var u=document.createElement("span");t.appendChild(u);this.dependsOnLanguage(mxUtils.bind(this,+function(){m.innerHTML="";mxUtils.write(m,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));u.innerHTML="";mxUtils.write(u,mxResources.get("openLibraryFrom"));t.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),d="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,+650),k="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),k&&"1"!=urlParams.embedInline?66:10,k&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-d)/2):56,c-6,d-6,mxUtils.bind(this,function(m){this.createShapesPanel(m)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,+0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var d=c;"auto"==c&&(d=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(d);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==+urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,d){this.dependsOnLanguage(mxUtils.bind(this,+function(){c.setAttribute("title",mxResources.get(d))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&+window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var d=document.getElementById("high-contrast-stylesheet");if(null!=d&&window.matchMedia){var k=window.matchMedia("(forced-colors: active)").matches,m=d.getAttribute("media");(m="all"==m||"not all"!=m&&k)&&!c?d.setAttribute("media",k?"not all":"(forced-colors: active)"):!m&&c&&d.setAttribute("media",k?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};+EditorUi.prototype.setRulerVisible=function(c){var d=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-d.x;this.diagramContainer.scrollTop+=c.x-d.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=+window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),+c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,d){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=+c,Editor.isSettingsEnabled()&&d&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=+function(){var c=this.sketchFooterMenuElt,d=this.sketchMainMenuElt,k=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)d.style.left="10px",d.style.top="10px",k.style.left="10px",k.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),+this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var m=this.diagramContainer.getAttribute("data-bounds");if(null!=m){this.diagramContainer.removeAttribute("data-bounds");var t=m.split(" ");m=mxUtils.getDocumentSize();this.diagramContainer.style.top=t[0];this.diagramContainer.style.left=t[1];var u=parseInt(t[2]);+t=parseInt(t[3]);u=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,u):u,m.width-80);t=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,t):t,m.height-80);this.diagramContainer.style.width=u+"px";this.diagramContainer.style.height=t+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}d.style.left=+this.diagramContainer.offsetLeft+"px";d.style.top=this.diagramContainer.offsetTop-d.offsetHeight-4+"px";k.style.display="";k.style.left=this.diagramContainer.offsetLeft-k.offsetWidth-4+"px";k.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=d.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/+2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":+"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;m="1"==urlParams.embedInline&&Editor.passiveScroll;d.style.visibility=m?"hidden":"";c.style.visibility=m?"hidden":"";k.style.display=m?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=+mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||+null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize=+"14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=+Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==+Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var d=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var k=c.indexOf(",");0<k&&(d=this.getPageById(c.substring(k+1)),d=null!=d?d.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,+5)&&(d=this.getCustomLinkTitle(c));return d};EditorUi.prototype.getCustomLinkTitle=function(c){var d=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var k=JSON.parse(c.substring(17));null!=k&&null!=k.title&&(d=k.title)}catch(m){}return d};EditorUi.prototype.handleCustomLink=function(c,d){if(Graph.isPageLink(c))if(d=c.indexOf(","),c=this.getPageById(c.substring(d+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,+d)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(d){d.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(d){}this.fireEvent(new mxEventObject("styleChanged",+"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(d,k){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(d,k){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));+c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(d,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(d,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(d,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(d,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.writeImageToClipboard=function(c,d,k,m,t,u){m=null!=m?m:"image/png";var A=null==d||null==k?'<img src="'+c+'">':'<img src="'+c+'" width="'+d+'" height="'+k+'">',B={"text/html":new Blob([A],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(m)&&(B[m]=this.base64ToBlob(c.substring(c.indexOf(",")+1),m));var D=new ClipboardItem(B);+navigator.clipboard.write([D]).then(t)["catch"](u);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",d,"h",k,"type",m,"html",[A],"data",[B],"item",[D])};EditorUi.prototype.writeHtmlToClipboard=function(c,d){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](d)};EditorUi.prototype.writeTextToClipboard=function(c,d,k){navigator.clipboard.writeText(c)["catch"](d).then(function(){null!=+k&&k()})};EditorUi.prototype.copySvg=function(c,d,k){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var m=this.editor.graph.getSvg(null,k,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);null!=d&&m.setAttribute("content",d);var t=Editor.createSvgDataUri(mxUtils.getXml(m)),u=parseInt(m.getAttribute("width")),A=parseInt(m.getAttribute("height"));this.writeImageToClipboard(t,u,A,"image/svg+xml",null,mxUtils.bind(this,function(B){this.handleError(B)}))}}catch(B){this.handleError(B)}};+EditorUi.prototype.copyImage=function(c,d,k){try{k=null!=k?k:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(m,t){try{this.spinner.stop();var u=this.createImageDataUri(m,d,"png"),A=Math.round(parseInt(t.getAttribute("width"))/k),B=Math.round(parseInt(t.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[d],"scale",[k]);this.writeImageToClipboard(u,+A,B,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var D=this.getBaseFilename(!1)+(null!=d?".drawio":"")+".png";this.saveLocalFile(u.substring(u.lastIndexOf(",")+1),D,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(D){this.handleError(D)}}),null,null,null,mxUtils.bind(this,function(m){this.spinner.stop();this.handleError(m)}),null,null,k,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(m){this.handleError(m)}};EditorUi.prototype.copyCells=function(c,d){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var m=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),t=mxUtils.getXml(k.encodeCells(m));mxUtils.setTextContent(c,encodeURIComponent(t));d?(k.removeCells(m,!1),k.lastPasteXml=null):(k.lastPasteXml=t,k.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=+null;if(Editor.enableNativeClipboard){var d=this.editor.graph;d.isSelectionEmpty()||(c=mxUtils.sortCells(d.getExportableCells(d.model.getTopmostCells(d.getSelectionCells()))),d=mxUtils.getXml(d.encodeCells(c)),navigator.clipboard.writeText(d))}return c};EditorUi.prototype.pasteXml=function(c,d,k,m,t,u){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[d],"compat",[k],"evt",[m],"html",[t],"pt",[u]);t=null!=t?t:!0;var A=this.editor.graph,B=null!=u?u:Editor.pasteAtMousePointer&&A.isMouseInsertPoint()?+A.getInsertPoint():null;u=null;A.lastPasteXml==c?null==B&&A.pasteCounter++:(A.lastPasteXml=c,A.pasteCounter=0);var D=A.pasteCounter*A.gridSize;if(k||this.isCompatibleString(c)){A.model.beginUpdate();try{if(u=this.importXml(c,D,D),null!=B){var N=A.getBoundingBoxFromGeometry(u,!0);if(null!=N){var F=Math.round(A.snap(B.x)),U=Math.round(A.snap(B.y));A.cellsMoved(u,F-N.x,U-N.y)}}}finally{A.model.endUpdate()}A.setSelectionCells(u)}else if(d&&1==A.getSelectionCount()){d=A.getStartEditingCell(A.getSelectionCell(),+m);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==A.getCurrentCellStyle(d)[mxConstants.STYLE_SHAPE])A.setCellStyles(mxConstants.STYLE_IMAGE,c,[d]);else{A.model.beginUpdate();try{A.labelChanged(d,c),Graph.isLink(c)&&A.setLinkForCell(d,c)}finally{A.model.endUpdate()}}A.setSelectionCell(d)}else B=null!=B?B:A.getInsertPoint(),A.isMouseInsertPoint()&&(D=0,A.lastPasteXml==c&&0<A.pasteCounter&&A.pasteCounter--),u=this.insertTextAt(c,B.x+D,B.y+D,t),A.setSelectionCells(u);A.isSelectionEmpty()||(A.scrollCellToVisible(A.getSelectionCell()),+null!=this.hoverIcons&&this.hoverIcons.update(A.view.getState(A.getSelectionCell())));return u};EditorUi.prototype.pasteCells=function(c,d,k,m){if(!mxEvent.isConsumed(c)){var t=c.clipboardData,u=this.editor.graph,A=!1,B=d;if(k&&null!=t&&t.getData){var D=t.getData("text/plain"),N=!1;if(null!=D&&0<D.length&&"%3CmxGraphModel%3E"==D.substring(0,18))try{var F=decodeURIComponent(D);this.isCompatibleString(F)&&(N=!0,D=F)}catch(I){}N=N?null:t.getData("text/html");null!=N&&0<N.length?(B=this.parseHtmlData(N),+A="text/plain"!=B.getAttribute("data-type")):null!=D&&0<D.length&&(B=document.createElement("div"),mxUtils.setTextContent(B,N))}D=B.getElementsByTagName("span");if(null!=D&&0<D.length&&"application/vnd.lucid.chart.objects"===D[0].getAttribute("data-lucid-type"))k=D[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(I){var g=this.editor.graph;g.lastPasteXml==I?g.pasteCounter++:(g.lastPasteXml=I,g.pasteCounter=0);var q=g.pasteCounter*g.gridSize;+g.setSelectionCells(this.importXml(I,q,q));g.scrollCellToVisible(g.getSelectionCell())}),mxUtils.bind(this,function(I){this.handleError(I)})),mxEvent.consume(c));else{var U=!1,V="";V=A?null!=B.textContent&&"<mxfile"==B.textContent.substring(0,7)&&"</mxfile>"==B.textContent.substring(B.textContent.length-9)||"<mxGraphModel"==B.textContent.substring(0,13)&&"</mxGraphModel>"==B.textContent.substring(B.textContent.length-15)?B.textContent.replace(/\u00a0/g," "):B.innerHTML:mxUtils.trim(null==B.innerText?+mxUtils.getTextContent(B):B.innerText);try{var n=V.lastIndexOf("%3E");0<=n&&n<V.length-3&&(V=V.substring(0,n+3))}catch(I){}try{D=B.getElementsByTagName("span"),(F=null!=D&&0<D.length?mxUtils.trim(decodeURIComponent(D[0].textContent)):decodeURIComponent(V))&&(this.isCompatibleString(F)||0==F.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(U=!0,V=F)}catch(I){}F=null;try{if(!U&&""==B.textContent)for(n=0;n<t.items.length;n++){var v=t.items[n];if("file"===v.kind){F=v.getAsFile();break}}}catch(I){}EditorUi.debug("EditorUi.pasteCells",+[this],"evt",[c],"realElt",[d.outerHTML],"elt",[B.outerHTML],"useEvent",k,"pasteAsLabel",m,"xml",[V],"compat",U,"asHtml",A,"data",t,"items",[t.items.length],"files",[t.files.length],"types",[JSON.stringify(t.types)],"blob",[F]);try{if(U||null==F)if(null!=V&&0<V.length){if(0==V.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var H=mxUtils.bind(this,function(){try{V=(new MiroImporter).importMiroJson(JSON.parse(V)),this.pasteXml(V,m,U,c)}catch(I){console.log("Miro import error:",I)}});+"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",H):H()}else this.pasteXml(V,m,U,c,A);mxEvent.consume(c)}else k||(u.lastPasteXml=null,u.pasteCounter=0);else{var G=u.getInsertPoint();this.importFiles([F],G.x,G.y,this.maxImageSize);mxEvent.consume(c)}}catch(I){this.handleError(I)}}}d.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var d=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&d.isMouseInsertPoint()&&(c=d.getInsertPoint());if(d.isEnabled()&&+!d.isCellLocked(d.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,m,t,u,A){if(null!=k){d.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{d.getModel().endUpdate()}}else k=null!=m?m:null!=t?t:u,null!=k?(c=null!=c?c:d.getInsertPoint(),this.importFiles([k],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(k){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var d=+this.editor.graph;d.getModel().beginUpdate();try{d.moveCellsTo(mxClipboard.paste(d),c)}finally{d.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(d){for(var k=null!=d.clipboardData?d.clipboardData:d.originalEvent.clipboardData,m=!1,t=null,u=0;u<k.types.length;u++)if("text/"===k.types[u].substring(0,5)){m=!0;break}for(u=0;u<k.items.length;u++){var A=k.items[u];if("file"===A.kind){t=+A.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[d],"data",[k],"items",[k.items.length],"files",[k.files.length],"types",[JSON.stringify(k.types)],"containsText",m,"file",[t],"editing",c.isEditing());var B=mxUtils.bind(this,function(){try{if(!m&&null!=t){if(c.isEditing())this.importFiles([t],0,0,this.maxImageSize,function(N,F,U,V,n,v){c.insertImage(N,n,v)},function(){},function(N){return"image/"==N.type.substring(0,6)},function(N){for(var F=0;F<N.length;F++)N[F]()});+else{var D=this.editor.graph.getInsertPoint();this.importFiles([t],D.x,D.y,this.maxImageSize)}mxEvent.consume(d)}}catch(N){}});if(!mxEvent.isConsumed(d)&&!m)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(D){this.readTypeFromClipboardData(D,"image/svg+xml",mxUtils.bind(this,function(N){if(null!=N){N=new Blob([N],{type:"image/svg+xml"});var F=this.editor.graph.getInsertPoint();this.importFiles([N],F.x,F.y,this.maxImageSize)}else B()}),"image")}))["catch"](B);+else B()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(d){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",d,"types",null!=d&&0<d.length?[JSON.stringify(d[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(d,mxUtils.bind(this,function(k,m){null!=k?c(k):this.readGraphModelFromImageClipboardData(d,mxUtils.bind(this,function(t,u,A){null!=t?c(t):this.readTypeFromClipboardData(d,"text/plain",mxUtils.bind(this,+function(B){c(B,u,A,m,d)}))}))}))}catch(k){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,d){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(k){var m=null,t=null;try{var u=this.parseHtmlData(k);if(null!=u){m="text/plain"!=u.getAttribute("data-type")?u.innerHTML:mxUtils.trim(null==u.innerText?mxUtils.getTextContent(u):u.innerText);try{var A=m.lastIndexOf("%3E");0<=A&&A<m.length-3&&(m=m.substring(0,A+3))}catch(N){}try{null==+m&&(k=null,""==u.textContent&&1==u.children.length&&"IMG"==u.firstChild.nodeName&&(k=u.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?t=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&(t=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(N){}try{var B=u.getElementsByTagName("span"),D=null!=B&&0<B.length?mxUtils.trim(decodeURIComponent(B[0].textContent)):decodeURIComponent(m);+this.isCompatibleString(D)&&(m=D)}catch(N){}}}catch(N){}d(this.isCompatibleString(m)?m:null,t)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,d){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,m){var t=null;try{null!=k&&(t=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(u){}this.isCompatibleString(t)?d(t):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(u,A){t=Editor.extractGraphModelFromPng("data:image/png;base64,"++u);this.isCompatibleString(t)?d(t):d(null,m,A)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,d,k){var m=!1;if(null!=c&&0<c.length)for(var t=0;t<c.length&&!m;t++)(function(u){0<=mxUtils.indexOf(u.types,d)&&(m=!0,u.getType(d).then(mxUtils.bind(this,function(A){if("image/png"==d)A.arrayBuffer().then(function(B){k(btoa(Graph.arrayBufferToString(B)),A)})["catch"](function(){k(null)});else A.text().then(mxUtils.bind(this,function(B){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],+"data",[c],"type",[d],"result",[B]);k(B,A)}))["catch"](function(){k(null)})}))["catch"](function(){k(null)}))})(c[t]);m||k()};EditorUi.prototype.parseHtmlData=function(c){var d=null;if(null!=c&&0<c.length){var k="<meta "==c.substring(0,6);d=document.createElement("div");d.innerHTML=(k?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;k=d.getElementsByTagName("style");if(null!=k)for(;0<k.length;)k[0].parentNode.removeChild(k[0]);if(null!=d.firstChild&&d.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=d.firstChild.nextSibling&&d.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==d.firstChild.nodeName&&"A"==d.firstChild.nextSibling.nodeName&&null==d.firstChild.nextSibling.nextSibling){var m=null==d.firstChild.nextSibling.innerText?mxUtils.getTextContent(d.firstChild.nextSibling):d.firstChild.nextSibling.innerText;m==d.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(d,m),asHtml=!1)}if(""==d.textContent&&(k=d.getElementsByTagName("img"),1==k.length&&-(m=k[0].getAttribute("src"),k=null,null!=m))){if(Editor.isPngDataUrl(m)){var t=Editor.extractGraphModelFromPng(m);null!=t&&0<t.length&&(k=t)}else if("data:image/svg+xml;base64,"==m.substring(0,26)){img=this.base64ToBlob(m.substring(m.indexOf(",")+1),"image/svg+xml");m=Graph.getSvgFromDataUri(m);try{t=mxUtils.parseXml(m).documentElement.getAttribute("content"),this.isCompatibleString(t)&&(k=t)}catch(v){}}null!=k&&(mxUtils.setTextContent(d,k),asHtml=!1)}asHtml?Graph.removePasteFormatting(d):d.setAttribute("data-type",+(m=k[0].getAttribute("src"),k=null,null!=m))){if(Editor.isPngDataUrl(m)){var t=Editor.extractGraphModelFromPng(m);null!=t&&0<t.length&&(k=t)}else if("data:image/svg+xml;base64,"==m.substring(0,26)){img=this.base64ToBlob(m.substring(m.indexOf(",")+1),"image/svg+xml");m=Graph.getSvgFromDataUri(m);try{t=mxUtils.parseXml(m).documentElement.getAttribute("content"),this.isCompatibleString(t)&&(k=t)}catch(u){}}null!=k&&(mxUtils.setTextContent(d,k),asHtml=!1)}asHtml?Graph.removePasteFormatting(d):d.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[d],"asHtml",asHtml);return d};EditorUi.prototype.showPrintDialog=function(c,d,k){var m=330;this.editor.graph.isEnabled()&&(m+=40);null!=this.pages&&1<this.pages.length&&(m+=40,this.editor.graph.isEnabled()||(m+=10));null==d||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(m+=20);this.showDialog((new PrintDialog(this,c,d,k)).container,320,m,!0,!0)};EditorUi.prototype.print=function(c,d){var k=this.editor,m=k.graph,-t=this.getPageIndex(this.currentPage),v=null!=t?t+1:1,A=mxUtils.bind(this,function(I,g,q,B){var J=I.useCssTransforms,Q=I.currentTranslate,N=I.currentScale,S=I.view.translate,P=I.view.scale;I.useCssTransforms&&(I.useCssTransforms=!1,I.currentTranslate=new mxPoint(0,0),I.currentScale=1,I.view.translate=new mxPoint(0,0),I.view.scale=1);var R=I.getGraphBounds(),W=0,X=0,Y=mxRectangle.fromRectangle(I.pageFormat),aa=d.fit||d.crop||!I.pageVisible,ba=d.scale;Y.width=Math.ceil(Y.width*I.pageScale);Y.height=-Math.ceil(Y.height*I.pageScale);var fa=1;if(d.fit){fa=d.sheetsAcross;var ia=d.sheetsDown;isNaN(ba)||(Y.width=Math.ceil(Y.width*ba),Y.height=Math.ceil(Y.height*ba));fa=Math.min(Y.height*ia/(R.height/I.view.scale),Y.width*fa/(R.width/I.view.scale))}else fa=isNaN(ba)?1:ba;fa*=1;!aa&&I.pageVisible?(ba=I.getPageLayout(),W-=ba.x*Y.width,X-=ba.y*Y.height):aa=!0;d.crop&&(d.selection&&(R=m.getBoundingBox(m.getSelectionCells())),Y.width=(R.width+1)*fa/I.view.scale,Y.height=(R.height+1)*fa/I.view.scale);Y.width=-Math.ceil(1*Y.width);Y.height=Math.ceil(1*Y.height);B=null!=B?"page/id,"+B:null;if(null==g){g=PrintDialog.createPrintPreview(I,fa,null,0,W,X,aa);g.title=this.getBaseFilename(!0);g.pageSelector=!1;g.mathEnabled=!1;W=d.border;isNaN(W)||(g.pageMargin=W);d.selection&&(g.isCellVisible=function(na){return I.isCellSelected(na)});var ea=g.writeHead;g.writeHead=function(na,ta){ta=null!=ta?ta:"";d.shadows||(ta+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(ta+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");-null!=k.fontCss&&(ta+=k.fontCss);ea.apply(this,arguments);for(var ra=I.getCustomFonts(),la=0;la<ra.length;la++){var ha=ra[la].name,pa=ra[la].url;Graph.isCssFontUrl(pa)?na.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(pa))+'" charset="UTF-8" type="text/css">'):(na.writeln('<style type="text/css">'),na.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ha)+'";\nsrc: url("'+mxUtils.htmlEntities(pa)+'");\n}'),na.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ma=-g.drawBackgroundImage;g.drawBackgroundImage=function(na){ma.apply(this,arguments);null!=na.node&&(EditorUi.embedSvgImages(na.node),m.disableSvgLinks(na.node,function(ta){ta.setAttribute("href","javascript:void(0)")}))}}var qa=g.addGraphFragment;g.addGraphFragment=function(na,ta,ra,la,ha,pa){qa.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ha.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var ya=ha.getElementsByTagName("svg"),za=0;za<ya.length;za++)I.addSvgShadow(ya[za])};-d.grid&&(g.gridSize=I.gridSize,g.gridSteps=I.view.gridSteps,g.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:I.view.gridColor);g.open(null,null,q,!0,B,Y,d.selection?I.getSelectionCells():null)}else{R=I.background;if(null==R||""==R||R==mxConstants.NONE)R="#ffffff";g.backgroundColor=R;g.autoOrigin=aa;d.grid&&(g.gridSize=I.gridSize,g.gridSteps=I.view.gridSteps,g.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:I.view.gridColor);g.appendGraph(I,fa,W,X,q,!0,B,-Y,d.selection?I.getSelectionCells():null);q=I.getCustomFonts();if(null!=g.wnd)for(Y=0;Y<q.length;Y++)W=q[Y].name,X=q[Y].url,Graph.isCssFontUrl(X)?g.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(g.wnd.document.writeln('<style type="text/css">'),g.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(W)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),g.wnd.document.writeln("</style>"))}J&&(I.useCssTransforms=-J,I.currentTranslate=Q,I.currentScale=N,I.view.translate=S,I.view.scale=P);return g}),C=d.pagesFrom,E=d.pagesTo,D=!d.allPages;t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,d);else{D&&(D=d.selection||C==v&&E==v);if(!D&&null!=this.pages&&this.pages.length){D=0;v=this.pages.length-1;d.allPages||(D=parseInt(C)-1,v=parseInt(E)-1);for(var U=D;U<=v;U++){var T=this.pages[U];C=T==this.currentPage?m:null;if(null==C){C=this.createTemporaryGraph(m.stylesheet);C.shapeForegroundColor=m.shapeForegroundColor;-C.shapeBackgroundColor=m.shapeBackgroundColor;E=!0;var V=D=!1,n=null,u=null;null==T.viewState&&null==T.root&&this.updatePageRoot(T);null!=T.viewState&&(E=T.viewState.pageVisible,D=T.viewState.mathEnabled,V=T.viewState.shadowVisible,n=T.viewState.background,u=T.viewState.backgroundImage,C.pageFormat=T.viewState.pageFormat,C.gridSize=T.viewState.gridSize);null!=u&&null!=u.originalSrc&&(u=this.createImageForPageLink(u.originalSrc,T));C.background=n;C.backgroundImage=null!=u?new mxImage(u.src,u.width,-u.height,u.x,u.y):null;C.pageVisible=E;C.mathEnabled=D;C.shadowVisible=V;var G=C.getGraphBounds;C.getGraphBounds=function(){var I=G.apply(this,arguments),g=this.backgroundImage;if(null!=g&&null!=g.width&&null!=g.height){var q=this.view.translate,B=this.view.scale;I=mxRectangle.fromRectangle(I);I.add(new mxRectangle((q.x+g.x)*B,(q.y+g.y)*B,g.width*B,g.height*B))}return I};var H=C.getGlobalVariable;C.getGlobalVariable=function(I){return"page"==I?T.getName():"pagenumber"==I?U+1:"pagecount"==I?null!=-this.pages?this.pages.length:1:H.apply(this,arguments)};document.body.appendChild(C.container);this.updatePageRoot(T);C.model.setRoot(T.root)}t=A(C,t,U!=v,T.getId());C!=m&&C.container.parentNode.removeChild(C.container)}}else t=A(m);null==t||null==t.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(A=t.wnd.document,c||(t.wnd.IMMEDIATE_PRINT=!0),A.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),t.closeDocument(),Graph.rewritePageLinks(t.wnd.document,+t=this.getPageIndex(this.currentPage),u=null!=t?t+1:1,A=mxUtils.bind(this,function(I,g,q,C){var J=I.useCssTransforms,M=I.currentTranslate,Q=I.currentScale,T=I.view.translate,P=I.view.scale;I.useCssTransforms&&(I.useCssTransforms=!1,I.currentTranslate=new mxPoint(0,0),I.currentScale=1,I.view.translate=new mxPoint(0,0),I.view.scale=1);var S=I.getGraphBounds(),W=0,X=0,Y=mxRectangle.fromRectangle(I.pageFormat),Z=d.fit||d.crop||!I.pageVisible,aa=d.scale;Y.width=Math.ceil(Y.width*I.pageScale);Y.height=+Math.ceil(Y.height*I.pageScale);var ha=1;if(d.fit){ha=d.sheetsAcross;var ja=d.sheetsDown;isNaN(aa)||(Y.width=Math.ceil(Y.width*aa),Y.height=Math.ceil(Y.height*aa));ha=Math.min(Y.height*ja/(S.height/I.view.scale),Y.width*ha/(S.width/I.view.scale))}else ha=isNaN(aa)?1:aa;ha*=1;!Z&&I.pageVisible?(aa=I.getPageLayout(),W-=aa.x*Y.width,X-=aa.y*Y.height):Z=!0;d.crop&&(d.selection&&(S=m.getBoundingBox(m.getSelectionCells())),Y.width=(S.width+1)*ha/I.view.scale,Y.height=(S.height+1)*ha/I.view.scale);Y.width=+Math.ceil(1*Y.width);Y.height=Math.ceil(1*Y.height);C=null!=C?"page/id,"+C:null;if(null==g){g=PrintDialog.createPrintPreview(I,ha,null,0,W,X,Z);g.title=this.getBaseFilename(!0);g.pageSelector=!1;g.mathEnabled=!1;W=d.border;isNaN(W)||(g.pageMargin=W);d.selection&&(g.isCellVisible=function(ta){return I.isCellSelected(ta)});var fa=g.writeHead;g.writeHead=function(ta,ra){ra=null!=ra?ra:"";d.shadows||(ra+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(ra+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");+null!=k.fontCss&&(ra+=k.fontCss);fa.apply(this,arguments);for(var qa=I.getCustomFonts(),la=0;la<qa.length;la++){var ia=qa[la].name,oa=qa[la].url;Graph.isCssFontUrl(oa)?ta.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(oa))+'" charset="UTF-8" type="text/css">'):(ta.writeln('<style type="text/css">'),ta.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ia)+'";\nsrc: url("'+mxUtils.htmlEntities(oa)+'");\n}'),ta.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ma=+g.drawBackgroundImage;g.drawBackgroundImage=function(ta){ma.apply(this,arguments);null!=ta.node&&(EditorUi.embedSvgImages(ta.node),m.disableSvgLinks(ta.node,function(ra){ra.setAttribute("href","javascript:void(0)")}))}}var sa=g.addGraphFragment;g.addGraphFragment=function(ta,ra,qa,la,ia,oa){sa.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ia.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var xa=ia.getElementsByTagName("svg"),Aa=0;Aa<xa.length;Aa++)I.addSvgShadow(xa[Aa])};+d.grid&&(g.gridSize=I.gridSize,g.gridSteps=I.view.gridSteps,g.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:I.view.gridColor);g.open(null,null,q,!0,C,Y,d.selection?I.getSelectionCells():null)}else{S=I.background;if(null==S||""==S||S==mxConstants.NONE)S="#ffffff";g.backgroundColor=S;g.autoOrigin=Z;d.grid&&(g.gridSize=I.gridSize,g.gridSteps=I.view.gridSteps,g.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:I.view.gridColor);g.appendGraph(I,ha,W,X,q,!0,C,Y,+d.selection?I.getSelectionCells():null);q=I.getCustomFonts();if(null!=g.wnd)for(Y=0;Y<q.length;Y++)W=q[Y].name,X=q[Y].url,Graph.isCssFontUrl(X)?g.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(g.wnd.document.writeln('<style type="text/css">'),g.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(W)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),g.wnd.document.writeln("</style>"))}J&&(I.useCssTransforms=J,+I.currentTranslate=M,I.currentScale=Q,I.view.translate=T,I.view.scale=P);return g}),B=d.pagesFrom,D=d.pagesTo,N=!d.allPages;t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,d);else{N&&(N=d.selection||B==u&&D==u);if(!N&&null!=this.pages&&this.pages.length){N=0;u=this.pages.length-1;d.allPages||(N=parseInt(B)-1,u=parseInt(D)-1);for(var F=N;F<=u;F++){var U=this.pages[F];B=U==this.currentPage?m:null;if(null==B){B=this.createTemporaryGraph(m.stylesheet);B.shapeForegroundColor=m.shapeForegroundColor;+B.shapeBackgroundColor=m.shapeBackgroundColor;D=!0;var V=N=!1,n=null,v=null;null==U.viewState&&null==U.root&&this.updatePageRoot(U);null!=U.viewState&&(D=U.viewState.pageVisible,N=U.viewState.mathEnabled,V=U.viewState.shadowVisible,n=U.viewState.background,v=U.viewState.backgroundImage,B.pageFormat=U.viewState.pageFormat,B.gridSize=U.viewState.gridSize);null!=v&&null!=v.originalSrc&&(v=this.createImageForPageLink(v.originalSrc,U));B.background=n;B.backgroundImage=null!=v?new mxImage(v.src,v.width,+v.height,v.x,v.y):null;B.pageVisible=D;B.mathEnabled=N;B.shadowVisible=V;var G=B.getGraphBounds;B.getGraphBounds=function(){var I=G.apply(this,arguments),g=this.backgroundImage;if(null!=g&&null!=g.width&&null!=g.height){var q=this.view.translate,C=this.view.scale;I=mxRectangle.fromRectangle(I);I.add(new mxRectangle((q.x+g.x)*C,(q.y+g.y)*C,g.width*C,g.height*C))}return I};var H=B.getGlobalVariable;B.getGlobalVariable=function(I){return"page"==I?U.getName():"pagenumber"==I?F+1:"pagecount"==I?null!=+this.pages?this.pages.length:1:H.apply(this,arguments)};document.body.appendChild(B.container);this.updatePageRoot(U);B.model.setRoot(U.root)}t=A(B,t,F!=u,U.getId());B!=m&&B.container.parentNode.removeChild(B.container)}}else t=A(m);null==t||null==t.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(A=t.wnd.document,c||(t.wnd.IMMEDIATE_PRINT=!0),A.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),t.closeDocument(),Graph.rewritePageLinks(t.wnd.document,!0),t.mathEnabled||c||PrintDialog.printPreview(t));return t}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var d=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(m){null!=d&&(d.parentNode.removeChild(d),d=null);m.stopPropagation();m.preventDefault()}),mxEvent.addListener(c[k],"dragover",mxUtils.bind(this,function(m){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==d&&(d=this.highlightElement());m.stopPropagation();m.preventDefault()})),-mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(m){null!=d&&(d.parentNode.removeChild(d),d=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<m.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(m.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(m)&&!mxEvent.isShiftDown(m)):this.openFiles(m.dataTransfer.files,!0);else{var t=this.extractGraphModelFromEvent(m);if(null==t){var v=null!=m.dataTransfer?m.dataTransfer:-m.clipboardData;null!=v&&(10==document.documentMode||11==document.documentMode?t=v.getData("Text"):(t=null,t=0<=mxUtils.indexOf(v.types,"text/uri-list")?m.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(v.types,"text/html")?v.getData("text/html"):null,null!=t&&0<t.length?(v=document.createElement("div"),v.innerHTML=Graph.sanitizeHtml(t),v=v.getElementsByTagName("img"),0<v.length&&(t=v[0].getAttribute("src"))):0<=mxUtils.indexOf(v.types,"text/plain")&&(t=v.getData("text/plain"))),null!=t&&+mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(m){null!=d&&(d.parentNode.removeChild(d),d=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<m.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(m.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(m)&&!mxEvent.isShiftDown(m)):this.openFiles(m.dataTransfer.files,!0);else{var t=this.extractGraphModelFromEvent(m);if(null==t){var u=null!=m.dataTransfer?m.dataTransfer:+m.clipboardData;null!=u&&(10==document.documentMode||11==document.documentMode?t=u.getData("Text"):(t=null,t=0<=mxUtils.indexOf(u.types,"text/uri-list")?m.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(u.types,"text/html")?u.getData("text/html"):null,null!=t&&0<t.length?(u=document.createElement("div"),u.innerHTML=Graph.sanitizeHtml(t),u=u.getElementsByTagName("img"),0<u.length&&(t=u[0].getAttribute("src"))):0<=mxUtils.indexOf(u.types,"text/plain")&&(t=u.getData("text/plain"))),null!=t&&(Editor.isPngDataUrl(t)?(t=Editor.extractGraphModelFromPng(t),null!=t&&0<t.length&&this.openLocalFile(t,null,!0)):this.isRemoteFileFormat(t)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(t))).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(t)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(t):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(t)))))}else this.openLocalFile(t,null,!0)}m.stopPropagation();m.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var d=0,k=0;if(null==c){var m=document.body;var t=document.documentElement;var v=(m.clientWidth||-t.clientWidth)-3;m=Math.max(m.clientHeight||0,t.clientHeight)-3}else m=c.getBoundingClientRect(),d=m.top,k=m.left,v=m.width,m=m.height;t=document.createElement("div");t.style.zIndex=mxPopupMenu.prototype.zIndex+2;t.style.border="3px dotted rgb(254, 137, 12)";t.style.pointerEvents="none";t.style.position="absolute";t.style.top=d+"px";t.style.left=k+"px";t.style.width=Math.max(0,v-3)+"px";t.style.height=Math.max(0,m-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(t):-document.body.appendChild(t);return t};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var d=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=d){var k=new mxCodec(d.ownerDocument),m=new mxGraphModel;k.decode(d,m);d=m.getChildAt(m.getRoot(),0);for(k=0;k<m.getChildCount(d);k++)c.push(m.getChildAt(d,k))}return c};EditorUi.prototype.openFileHandle=function(c,d,k,m,t,v){if(null!=d&&0<d.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(d)||/(\.pdf)$/i.test(d))d=d.substring(0,-d.length-4),/(\.drawio)$/i.test(d)||(d+=".drawio");var A=mxUtils.bind(this,function(E){d=0<=d.lastIndexOf(".")?d.substring(0,d.lastIndexOf("."))+".drawio":d+".drawio";if("<mxlibrary"==E.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,E,d)),this.showSidebar()}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(E,d,m)});if(EditorUi.isVisioFilename(d))this.importVisio(k,-mxUtils.bind(this,function(E){this.spinner.stop();A(E)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(E){this.spinner.stop();A(E)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,d))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(E){4==E.readyState&&(this.spinner.stop(),200<=E.status&&299>=E.status?A(E.responseText):this.handleError({message:mxResources.get(413==-E.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(d)&&(d=d.substring(0,d.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(E){this.spinner.stop();this.openLocalFile(E,d,m)}),mxUtils.bind(this,function(E){this.spinner.stop();this.handleError(E)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,-this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(E){this.spinner.stop();A(E)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,d,m)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var C=Editor.extractGraphModelFromPdf(c);null!=-C&&(t=null,m=!0,c=C)}this.spinner.stop();this.openLocalFile(c,d,m,t,null!=t?k:null,v)}}};EditorUi.prototype.openFiles=function(c,d){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=0;k<c.length;k++)mxUtils.bind(this,function(m){var t=new FileReader;t.onload=mxUtils.bind(this,function(v){try{this.openFileHandle(v.target.result,m.name,m,d)}catch(A){this.handleError(A)}});t.onerror=mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v);window.openFile=null});"image"!==-m.type.substring(0,5)&&"application/pdf"!==m.type||"image/svg"===m.type.substring(0,9)?t.readAsText(m):t.readAsDataURL(m)})(c[k])};EditorUi.prototype.openLocalFile=function(c,d,k,m,t,v){var A=this.getCurrentFile(),C=mxUtils.bind(this,function(){window.openFile=null;if(null==d&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var E=mxUtils.parseXml(c);null!=E&&(this.editor.setGraphXml(E.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,d||this.defaultFilename,-k,m,t,v))});if(null!=c&&0<c.length)null==A||!A.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)?C():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)&&null!=A&&A.isModified()?this.confirm(mxResources.get("allChangesLost"),null,C,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,d),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=A&&A.isModified()?-this.confirm(mxResources.get("allChangesLost"),null,C,mxResources.get("cancel"),mxResources.get("discardChanges")):C()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var d=0;d<this.pages.length;d++)this.updatePageRoot(this.pages[d]),this.addBasenamesForCell(this.pages[d].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);d=[];for(var k in c)d.push(k);return d};EditorUi.prototype.addBasenamesForCell=-function(c,d){function k(A){if(null!=A){var C=A.lastIndexOf(".");0<C&&(A=A.substring(C+1,A.length));null==d[A]&&(d[A]=!0)}}var m=this.editor.graph,t=m.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(t[mxConstants.STYLE_SHAPE]));m.model.isEdge(c)&&(k(mxMarker.getPackageForType(t[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(t[mxConstants.STYLE_ENDARROW])));t=m.model.getChildCount(c);for(var v=0;v<t;v++)this.addBasenamesForCell(m.model.getChildAt(c,v),d)};EditorUi.prototype.setGraphEnabled=+mxResources.get("unknownError"))})):/^https?:\/\//.test(t)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(t):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(t)))))}else this.openLocalFile(t,null,!0)}m.stopPropagation();m.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var d=0,k=0;if(null==c){var m=document.body;var t=document.documentElement;var u=(m.clientWidth||+t.clientWidth)-3;m=Math.max(m.clientHeight||0,t.clientHeight)-3}else m=c.getBoundingClientRect(),d=m.top,k=m.left,u=m.width,m=m.height;t=document.createElement("div");t.style.zIndex=mxPopupMenu.prototype.zIndex+2;t.style.border="3px dotted rgb(254, 137, 12)";t.style.pointerEvents="none";t.style.position="absolute";t.style.top=d+"px";t.style.left=k+"px";t.style.width=Math.max(0,u-3)+"px";t.style.height=Math.max(0,m-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(t):+document.body.appendChild(t);return t};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var d=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=d){var k=new mxCodec(d.ownerDocument),m=new mxGraphModel;k.decode(d,m);d=m.getChildAt(m.getRoot(),0);for(k=0;k<m.getChildCount(d);k++)c.push(m.getChildAt(d,k))}return c};EditorUi.prototype.openFileHandle=function(c,d,k,m,t,u){if(null!=d&&0<d.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(d)||/(\.pdf)$/i.test(d))d=d.substring(0,+d.length-4),/(\.drawio)$/i.test(d)||(d+=".drawio");var A=mxUtils.bind(this,function(D){d=0<=d.lastIndexOf(".")?d.substring(0,d.lastIndexOf("."))+".drawio":d+".drawio";if("<mxlibrary"==D.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,D,d)),this.showSidebar()}catch(N){this.handleError(N,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(D,d,m)});if(EditorUi.isVisioFilename(d))this.importVisio(k,+mxUtils.bind(this,function(D){this.spinner.stop();A(D)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(D){this.spinner.stop();A(D)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,d))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(D){4==D.readyState&&(this.spinner.stop(),200<=D.status&&299>=D.status?A(D.responseText):this.handleError({message:mxResources.get(413==+D.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(d)&&(d=d.substring(0,d.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(D){this.spinner.stop();this.openLocalFile(D,d,m)}),mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,+this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(D){this.spinner.stop();A(D)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,d,m)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var B=Editor.extractGraphModelFromPdf(c);null!=+B&&(t=null,m=!0,c=B)}this.spinner.stop();this.openLocalFile(c,d,m,t,null!=t?k:null,u)}}};EditorUi.prototype.openFiles=function(c,d){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=0;k<c.length;k++)mxUtils.bind(this,function(m){var t=new FileReader;t.onload=mxUtils.bind(this,function(u){try{this.openFileHandle(u.target.result,m.name,m,d)}catch(A){this.handleError(A)}});t.onerror=mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u);window.openFile=null});"image"!==+m.type.substring(0,5)&&"application/pdf"!==m.type||"image/svg"===m.type.substring(0,9)?t.readAsText(m):t.readAsDataURL(m)})(c[k])};EditorUi.prototype.openLocalFile=function(c,d,k,m,t,u){var A=this.getCurrentFile(),B=mxUtils.bind(this,function(){window.openFile=null;if(null==d&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var D=mxUtils.parseXml(c);null!=D&&(this.editor.setGraphXml(D.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,d||this.defaultFilename,+k,m,t,u))});if(null!=c&&0<c.length)null==A||!A.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)?B():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)&&null!=A&&A.isModified()?this.confirm(mxResources.get("allChangesLost"),null,B,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,d),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=A&&A.isModified()?+this.confirm(mxResources.get("allChangesLost"),null,B,mxResources.get("cancel"),mxResources.get("discardChanges")):B()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var d=0;d<this.pages.length;d++)this.updatePageRoot(this.pages[d]),this.addBasenamesForCell(this.pages[d].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);d=[];for(var k in c)d.push(k);return d};EditorUi.prototype.addBasenamesForCell=+function(c,d){function k(A){if(null!=A){var B=A.lastIndexOf(".");0<B&&(A=A.substring(B+1,A.length));null==d[A]&&(d[A]=!0)}}var m=this.editor.graph,t=m.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(t[mxConstants.STYLE_SHAPE]));m.model.isEdge(c)&&(k(mxMarker.getPackageForType(t[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(t[mxConstants.STYLE_ENDARROW])));t=m.model.getChildCount(c);for(var u=0;u<t;u++)this.addBasenamesForCell(m.model.getChildAt(c,u),d)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||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(d,k,m,t){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==d||0==d.length)d=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,d,{}));this.mode=App.MODE_EMBED;this.setFileData(d);Editor.fitDiagramOnLoad&&-this.initialFitDiagram();if(t)try{var v=this.editor.graph;v.setGridEnabled(!1);v.pageVisible=!1;var A=v.model.cells,C;for(C in A){var E=A[C];null!=E&&null!=E.style&&(E.style+=";sketch=1;"+(-1==E.style.indexOf("fontFamily=")||-1<E.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(D){console.log(D)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():+this.initialFitDiagram();if(t)try{var u=this.editor.graph;u.setGridEnabled(!1);u.pageVisible=!1;var A=u.model.cells,B;for(B in A){var D=A[B];null!=D&&null!=D.style&&(D.style+=";sketch=1;"+(-1==D.style.indexOf("fontFamily=")||-1<D.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(N){console.log(N)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=m?m:!1;this.updateUi();window.self===window.top||this.noAutoFocus||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,d){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(k){this.spinner.stop();d(k)})):d(null)};EditorUi.prototype.createLoadMessage=function(c){var d=this.editor.graph,k=d.getGraphBounds(),m=d.view.scale,t=d.view.translate;return{event:c,pageVisible:d.pageVisible,translate:t,bounds:k,currentPage:this.getSelectedPageIndex(),scale:m,page:d.view.getBackgroundPageBounds(),modelBounds:{x:k.x/m-t.x,y:k.y/m-t.y,width:k.width/m,height:k.height/m},containerSize:{width:d.container.clientWidth,height:d.container.clientHeight,offsetWidth:d.container.offsetWidth,offsetHeight:d.container.offsetHeight}}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var d=this.editor.graph;d.isEditing()&&d.stopEditing(!d.isInvokesStopCellEditing());var k=this.embedMessageSource||window.opener||window.parent;if(this.editor.modified){var m=d.background;if(null==m||m==mxConstants.NONE)m=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),d,null,!0,mxUtils.bind(this,function(t){k.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(t)}),"*")}),null,null,!0,m,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,d.model.clear(),-this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(t){c||this.handleError(t)}};EditorUi.prototype.installMessageHandler=function(c){var d=null,k=!1,m=!1,t=null,v=mxUtils.bind(this,function(E,D){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):-this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,v);mxEvent.addListener(window,"message",mxUtils.bind(this,function(E){if(E.source==(this.embedMessageSource||window.opener||window.parent)){var D=E.data,U=null,T=mxUtils.bind(this,function(Z){if(null!=Z&&"function"===typeof Z.charAt&&"<"!=Z.charAt(0))try{Editor.isPngDataUrl(Z)?Z=Editor.extractGraphModelFromPng(Z):"data:image/svg+xml;base64,"==Z.substring(0,26)?Z=atob(Z.substring(26)):"data:image/svg+xml;utf8,"==Z.substring(0,-24)&&(Z=Z.substring(24)),null!=Z&&(""==Z.trim()?Z=null:"%"==Z.charAt(0)?Z=decodeURIComponent(Z):"<"!=Z.charAt(0)&&(Z=Graph.decompress(Z)))}catch(oa){}return Z});if("json"==urlParams.proto){var V=!1;try{D=JSON.parse(D),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[E],"data",[D])}catch(Z){D=null}try{var n=D;if(null==D)return;if("dialog"==D.action){this.showError(null!=D.titleKey?mxResources.get(D.titleKey):D.title,null!=D.messageKey?mxResources.get(D.messageKey):mxUtils.htmlEntities(D.message),-null!=D.buttonKey?mxResources.get(D.buttonKey):D.button);null!=D.modified&&(this.editor.modified=D.modified);return}if("layout"==D.action){this.executeLayouts(this.editor.graph.createLayouts(D.layouts));return}if("prompt"==D.action){this.spinner.stop();var u=new FilenameDialog(this,D.defaultValue||"",null!=D.okKey?mxResources.get(D.okKey):D.ok,function(Z){null!=Z?A.postMessage(JSON.stringify({event:"prompt",value:Z,message:D}),"*"):A.postMessage(JSON.stringify({event:"prompt-cancel",message:D}),"*")},-null!=D.titleKey?mxResources.get(D.titleKey):D.title,null,null,null,null,function(){A.postMessage(JSON.stringify({event:"prompt-cancel",message:D}),"*")});this.showDialog(u.container,300,80,!0,!1);u.init();return}if("draft"==D.action){var G=T(D.xml);this.spinner.stop();u=new DraftDialog(this,mxResources.get("draftFound",[D.name||this.defaultFilename]),G,mxUtils.bind(this,function(){this.hideDialog();A.postMessage(JSON.stringify({event:"draft",result:"edit",message:D}),"*")}),mxUtils.bind(this,function(){this.hideDialog();-A.postMessage(JSON.stringify({event:"draft",result:"discard",message:D}),"*")}),D.editKey?mxResources.get(D.editKey):null,D.discardKey?mxResources.get(D.discardKey):null,D.ignore?mxUtils.bind(this,function(){this.hideDialog();A.postMessage(JSON.stringify({event:"draft",result:"ignore",message:D}),"*")}):null);this.showDialog(u.container,640,480,!0,!1,mxUtils.bind(this,function(Z){Z&&this.actions.get("exit").funct()}));try{u.init()}catch(Z){A.postMessage(JSON.stringify({event:"draft",error:Z.toString(),-message:D}),"*")}return}if("template"==D.action){this.spinner.stop();var H=1==D.enableRecent,I=1==D.enableSearch,g=1==D.enableCustomTemp;u=new NewDialog(this,!1,D.templatesOnly?!1:null!=D.callback,mxUtils.bind(this,function(Z,oa,ka,sa){Z=Z||this.emptyDiagramXml;null!=D.callback?A.postMessage(JSON.stringify({event:"template",xml:Z,blank:Z==this.emptyDiagramXml,name:oa,tempUrl:ka,libs:sa,builtIn:!0,message:D}),"*"):(c(Z,E,Z!=this.emptyDiagramXml,D.toSketch),this.editor.modified||this.clearStatus())}),-null,null,null,null,null,null,null,H?mxUtils.bind(this,function(Z){this.remoteInvoke("getRecentDiagrams",[null],null,Z,function(){Z(null,"Network Error!")})}):null,I?mxUtils.bind(this,function(Z,oa){this.remoteInvoke("searchDiagrams",[Z,null],null,oa,function(){oa(null,"Network Error!")})}):null,mxUtils.bind(this,function(Z,oa,ka){A.postMessage(JSON.stringify({event:"template",docUrl:Z,info:oa,name:ka}),"*")}),null,null,g?mxUtils.bind(this,function(Z){this.remoteInvoke("getCustomTemplates",null,null,-Z,function(){Z({},0)})}):null,1==D.withoutType,null,D.templatesOnly);this.showDialog(u.container,620,460,!0,!1,mxUtils.bind(this,function(Z){null!=this.sidebar&&this.sidebar.hideTooltip();Z&&!D.noExitOnCancel&&this.actions.get("exit").funct()}));u.init();return}if("textContent"==D.action){var q=this.getDiagramTextContent();A.postMessage(JSON.stringify({event:"textContent",data:q,message:D}),"*");return}if("status"==D.action){this.updateStatus(mxUtils.bind(this,function(){null!=D.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(D.messageKey))):-null!=D.message&&this.editor.setStatus(mxUtils.htmlEntities(D.message))}));null!=D.modified&&(this.editor.modified=D.modified);return}if("spinner"==D.action){var B=null!=D.messageKey?mxResources.get(D.messageKey):D.message;null==D.show||D.show?this.spinner.spin(document.body,B):this.spinner.stop();return}if("exit"==D.action){this.actions.get("exit").funct();return}if("viewport"==D.action){if(null!=D.viewport){var J=this.editor.graph,Q=J.view.translate.x,N=J.view.translate.y;this.embedViewport=D.viewport;-J.refresh();this.diagramContainer.scrollTop-=(N-J.view.translate.y)*J.view.scale;this.diagramContainer.scrollLeft-=(Q-J.view.translate.x)*J.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==D.action){var S=this.actions.get(D.actionName);null!=S&&S.funct();return}if("resetEditor"==D.action){J=this.editor.graph;J.isEditing()&&J.stopEditing(!1);this.hideCurrentMenu();J.popupMenuHandler.hideMenu();J.clearSelection();return}if("fit"==D.action){J=this.editor.graph;-var P=J.maxFitScale;J.maxFitScale=null!=D.maxScale?D.maxScale:1;J.fit(null!=D.border?D.border:16,null,null,null,null,!0);J.maxFitScale=P;B=this.createLoadMessage("fit");B.message=D;A.postMessage(JSON.stringify(B),"*");return}if("fullscreenChanged"==D.action){u=null;try{var R=this.diagramContainer.getAttribute("data-scrollState");null!=R&&(this.diagramContainer.removeAttribute("data-scrollState"),u=JSON.parse(R))}catch(Z){}Editor.inlineFullscreen=D.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));-null!=u&&this.restoreScrollState(u);return}if("snapshot"==D.action){this.sendEmbeddedSvgExport(!0);return}if("export"==D.action){if("png"==D.format||"xmlpng"==D.format){if(null==D.spin&&null==D.spinKey||this.spinner.spin(document.body,null!=D.spinKey?mxResources.get(D.spinKey):D.spin)){var W=null!=D.xml?D.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);J=this.editor.graph;var X=mxUtils.bind(this,function(Z,oa){if(D.withSvg)D.withSvg=!1,this.getEmbeddedSvg(W,this.editor.graph,null,!0,function(sa){X(Z,-sa)},null,null,D.embedImages,this.editor.graph.background,D.scale,D.border,D.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ka=this.createLoadMessage("export");ka.format=D.format;ka.message=n;ka.data=Z;ka.svg=oa;ka.xml=W;A.postMessage(JSON.stringify(ka),"*")}}),Y=mxUtils.bind(this,function(Z){null==Z&&(Z=Editor.blankImage);"xmlpng"==D.format&&(Z=Editor.writeGraphModelToPng(Z,"tEXt","mxfile",encodeURIComponent(W)));J!=this.editor.graph&&J.container.parentNode.removeChild(J.container);-X(Z)}),aa=D.pageId||(null!=this.pages?D.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ba=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=aa){var Z=J.getGlobalVariable;J=this.createTemporaryGraph(J.getStylesheet());for(var oa,ka=0;ka<this.pages.length;ka++)if(this.pages[ka].getId()==aa){oa=this.updatePageRoot(this.pages[ka]);break}null==oa&&(oa=this.currentPage);J.getGlobalVariable=function(Ba){return"page"==Ba?oa.getName():-"pagenumber"==Ba?1:Z.apply(this,arguments)};document.body.appendChild(J.container);J.model.setRoot(oa.root)}if(null!=D.layerIds){var sa=J.model,Ca=sa.getChildCells(sa.getRoot()),Ia={};for(ka=0;ka<D.layerIds.length;ka++)Ia[D.layerIds[ka]]=!0;for(ka=0;ka<Ca.length;ka++)sa.setVisible(Ca[ka],Ia[Ca[ka].id]||!1)}ka=null;D.keepTheme&&(ka=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Ba){Y(Ba.toDataURL("image/png"))}),D.width,null,D.background,mxUtils.bind(this,-function(){Y(null)}),null,null,D.scale,D.transparent,D.shadow,null,J,D.border,null,D.grid,ka,D.size)});null!=D.xml&&0<D.xml.length&&(k=!0,this.setFileData(W),k=!1);ba()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==D.format?"1":"0")+(null!=aa?"&pageId="+aa:"")+(null!=D.layerIds&&0<D.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:D.layerIds})):"")+(null!=D.scale?"&scale="+D.scale:"")+"&base64=1&xml="+encodeURIComponent(W))).send(mxUtils.bind(this,function(Z){200<=-Z.getStatus()&&299>=Z.getStatus()?X("data:image/png;base64,"+Z.getText()):Y(null)}),mxUtils.bind(this,function(){Y(null)}))}}else if(ba=mxUtils.bind(this,function(){var Z=this.createLoadMessage("export");Z.message=D;if("html2"==D.format||"html"==D.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var oa=this.getXmlFileData();Z.xml=mxUtils.getXml(oa);Z.data=this.getFileData(null,null,!0,null,null,null,oa);Z.format=D.format}else if("html"==D.format)oa=this.editor.getGraphXml(),-Z.data=this.getHtml(oa,this.editor.graph),Z.xml=mxUtils.getXml(oa),Z.format=D.format;else{if("xml"==D.format)Z.xml=this.getFileData(!0),Z.format=D.format,A.postMessage(JSON.stringify(Z),"*");else{mxSvgCanvas2D.prototype.foAltText=null;oa=null!=D.background?D.background:this.editor.graph.background;oa==mxConstants.NONE&&(oa=null);Z.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);Z.format="svg";var ka=mxUtils.bind(this,function(Ca){this.editor.graph.setEnabled(!0);this.spinner.stop();-Z.data=D.asText?Ca:Editor.createSvgDataUri(Ca);A.postMessage(JSON.stringify(Z),"*")}),sa="auto";D.keepTheme&&(sa=Editor.isDarkMode()?"dark":"light");null!=D.theme&&(sa=D.theme);if("xmlsvg"==D.format){if(null==D.spin&&null==D.spinKey||this.spinner.spin(document.body,null!=D.spinKey?mxResources.get(D.spinKey):D.spin)){sa=null;if(this.isAutoDarkMode()||Editor.isDarkMode())sa="auto";null!=D.theme&&(sa=D.theme);this.getEmbeddedSvg(Z.xml,this.editor.graph,null,!0,ka,null,null,D.embedImages,oa,D.scale,D.border,-D.shadow,sa)}}else if(null==D.spin&&null==D.spinKey||this.spinner.spin(document.body,null!=D.spinKey?mxResources.get(D.spinKey):D.spin))this.editor.graph.setEnabled(!1),oa=this.editor.graph.getSvg(oa,D.scale,D.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||D.shadow,null,sa),(this.editor.graph.shadowVisible||D.shadow)&&this.editor.graph.addSvgShadow(oa),this.embedFonts(oa,mxUtils.bind(this,function(Ca){D.embedImages||null==D.embedImages?this.editor.convertImages(Ca,mxUtils.bind(this,-function(Ia){ka(mxUtils.getXml(Ia))})):ka(mxUtils.getXml(Ca))}))}return}A.postMessage(JSON.stringify(Z),"*")}),null!=D.xml&&0<D.xml.length){if(this.editor.graph.mathEnabled){var fa=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){fa.apply(this,arguments);ba()}}k=!0;this.setFileData(D.xml);k=!1;this.editor.graph.mathEnabled||ba()}else ba();return}if("load"==D.action){V=D.toSketch;m=1==D.autosave;var ia=D.sourceMetadata||null;this.hideDialog();null!=D.modified&&null==urlParams.modified&&(urlParams.modified=-D.modified);null!=D.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=D.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+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=D.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=-D.noSaveBtn);if(null!=D.rough){var ea=Editor.sketchMode;this.doSetSketchMode(D.rough);ea!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=D.dark&&this.setDarkMode(D.dark);null!=D.border&&(this.embedExportBorder=D.border);null!=D.theme&&(this.embedExportTheme=D.theme);null!=D.background&&(this.embedExportBackground=D.background);null!=D.viewport&&(this.embedViewport=D.viewport);this.embedExitPoint=null;if(null!=D.scale){var ma=D.scale,qa=null!=D.scaleBorder?D.scaleBorder:-this.embedExportBorder||0,na=null!=D.border?D.border:0;U=mxUtils.bind(this,function(){var Z=this.editor.graph,oa=Z.getGraphBounds();if(0<oa.width&&0<oa.height){var ka=Z.view.scale;Z.view.scaleAndTranslate(ma,Z.view.translate.x+na-oa.x/ka+qa/ma,Z.view.translate.y+na-oa.y/ka+qa/ma)}})}else if(null!=D.fit){var ta=null!=D.border?D.border:0,ra=D.maxFitScale||1;U=mxUtils.bind(this,function(){var Z=this.editor.graph,oa=Z.maxFitScale;Z.maxFitScale=ra;Z.fit(ta,null,null,null,null,!0);Z.maxFitScale=oa})}if(null!=-D.rect){na=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,D.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,D.rect.top)+"px";this.minInlineWidth=D.minWidth;this.minInlineHeight=D.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var la=D.maxFitScale,ha=D.rect.width+2*na,pa=D.rect.height+2*na;U=mxUtils.bind(this,function(){var Z=mxUtils.getDocumentSize();ha=Math.min(null!=this.minInlineWidth?-Math.max(this.minInlineWidth,ha):ha,Z.width-80);Z=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,pa):pa,Z.height-80);this.diagramContainer.style.width=ha+"px";this.diagramContainer.style.height=Z+"px";var oa=this.editor.graph;Z=oa.maxFitScale;oa.maxFitScale=la;oa.fit(2*na,null,null,null,null,null,pa);this.setPageVisible(!1);if(null!=this.minInlineWidth&&oa.getGraphBounds().width<this.minInlineWidth){var ka=oa.container.scrollTop;this.resetScrollbars();oa.container.scrollTop=ka}oa.maxFitScale=-Z;oa.container.scrollTop-=na;oa.container.scrollLeft-=na;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[D]));oa.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=oa.container.style.top);var sa=oa.getGraphBounds();oa.container.clientWidth>sa.width+2*na&&(oa.container.scrollLeft=sa.x+(sa.width+na-oa.container.clientWidth)/2)}),10)})}null!=-D.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=D.noExitBtn);null!=D.title&&null!=this.buttonContainer&&this.setEmbedTitle(D.title);try{D.libs&&this.sidebar.showEntries(D.libs)}catch(Z){}if(null!=D.xmlpng)D=this.extractGraphModelFromPng(D.xmlpng);else if(null!=D.descriptor){if(D=D.descriptor,"mermaid"==D.format){window.isMermaidEnabled?this.parseMermaidDiagram(D.data,null,mxUtils.bind(this,function(Z){c(Z,E,null,V);Z=this.createLoadMessage("load");Z.xml=this.getFileData(!0,null,null,-null,null,null,null,null,null,!0);Z.message=n;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Z),"*");if(null!=ia&&null!=ia.key&&null!=ia.value){Z=this.editor.graph;var oa=Z.getModel().getRoot();if(null!=oa){Z.getModel().beginUpdate();try{Z.setAttributeForCell(oa,ia.key,ia.value)}finally{Z.getModel().endUpdate()}}}}),mxUtils.bind(this,function(Z){this.handleError(Z)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));-return}}else D=D.xml}else{if("merge"==D.action){var ya=this.getCurrentFile();null!=ya&&(G=T(D.xml),null!=G&&""!=G&&ya.mergeFile(new LocalFile(this,G),function(){A.postMessage(JSON.stringify({event:"merge",message:D}),"*")},function(Z){A.postMessage(JSON.stringify({event:"merge",message:D,error:Z}),"*")}))}else"remoteInvokeReady"==D.action?this.handleRemoteInvokeReady(A):"remoteInvoke"==D.action?this.handleRemoteInvoke(D,E.origin):"remoteInvokeResponse"==D.action?this.handleRemoteInvokeResponse(D):-A.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(D)}),"*");return}}catch(Z){this.handleError(Z)}}var za=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),xa=mxUtils.bind(this,function(Z,oa){k=!0;try{c(Z,oa,null,V)}catch(ka){this.handleError(ka)}k=!1;null!=urlParams.modified&&this.clearStatus();t=za();m&&null==d&&(d=mxUtils.bind(this,function(ka,sa){ka=za();ka==t||k||-(sa=this.createLoadMessage("autosave"),sa.xml=ka,sa.message=n,(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(sa),"*"));t=ka}),this.editor.graph.model.addListener(mxEvent.CHANGE,d),this.editor.graph.addListener("gridSizeChanged",d),this.editor.graph.addListener("shadowVisibleChanged",d),this.addListener("pageFormatChanged",d),this.addListener("pageScaleChanged",d),this.addListener("backgroundColorChanged",d),this.addListener("backgroundImageChanged",d),this.addListener("foldingEnabledChanged",-d),this.addListener("mathEnabledChanged",d),this.addListener("gridEnabledChanged",d),this.addListener("guidesEnabledChanged",d),this.addListener("pageViewChanged",d));null!=U&&U();if("1"==urlParams.returnbounds||"json"==urlParams.proto)oa=this.createLoadMessage("load"),oa.xml=Z,A.postMessage(JSON.stringify(oa),"*")});null!=D&&"function"===typeof D.substring&&"data:application/vnd.visio;base64,"==D.substring(0,34)?(T="0M8R4KGxGuE"==D.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(D.substring(D.indexOf(",")+-1)),function(Z){xa(Z,E)},mxUtils.bind(this,function(Z){this.handleError(Z)}),T)):null!=D&&"function"===typeof D.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(D,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(D,mxUtils.bind(this,function(Z){4==Z.readyState&&(200<=Z.status&&299>=Z.status&&"<mxGraphModel"==Z.responseText.substring(0,13)?xa(Z.responseText,E):this.handleError({message:413==Z.status?mxResources.get("diagramTooLarge"):-mxResources.get("unknownError")}))}),""):null!=D&&"function"===typeof D.substring&&this.isLucidChartData(D)?this.convertLucidChart(D,mxUtils.bind(this,function(Z){xa(Z)}),mxUtils.bind(this,function(Z){this.handleError(Z)})):null==D||"object"!==typeof D||null==D.format||null==D.data&&null==D.url?(D=T(D),xa(D,E)):this.loadDescriptor(D,mxUtils.bind(this,function(Z){xa(za(),E)}),mxUtils.bind(this,function(Z){this.handleError(Z,mxResources.get("errorLoadingFile"))}))}}));var A=this.embedMessageSource||-window.opener||window.parent;v="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";A.postMessage(v,"*");if("json"==urlParams.proto){var C=this.editor.graph.openLink;this.editor.graph.openLink=function(E,D,U){C.apply(this,arguments);A.postMessage(JSON.stringify({event:"openLink",href:E,target:D,allowOpener:U}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,d,k,m){var t=document.createElement("button");t.className="geEmbedBtn geBtn";t.setAttribute("title",c+(null!=-k?" ("+k+")":""));mxUtils.write(t,c);m&&t.classList.add("gePrimaryBtn");mxEvent.addListener(t,"click",d);return t};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,-function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,-Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==+this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(t){c||this.handleError(t)}};EditorUi.prototype.installMessageHandler=function(c){var d=null,k=!1,m=!1,t=null,u=null,A=mxUtils.bind(this,function(N,F){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):+this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,A);mxEvent.addListener(window,"message",mxUtils.bind(this,function(N){if(N.source==(this.embedMessageSource||window.opener||window.parent)){var F=N.data,U=null,V=mxUtils.bind(this,function(ba){if(null!=ba&&"function"===typeof ba.charAt&&"<"!=ba.charAt(0))try{Editor.isPngDataUrl(ba)?ba=Editor.extractGraphModelFromPng(ba):"data:image/svg+xml;base64,"==ba.substring(0,26)?ba=atob(ba.substring(26)):"data:image/svg+xml;utf8,"==ba.substring(0,+24)&&(ba=ba.substring(24)),null!=ba&&(""==ba.trim()?ba=null:"%"==ba.charAt(0)?ba=decodeURIComponent(ba):"<"!=ba.charAt(0)&&(ba=Graph.decompress(ba)))}catch(na){}return ba});if("json"==urlParams.proto){var n=!1;try{F=JSON.parse(F),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[N],"data",[F])}catch(ba){F=null}try{var v=F;if(null==F)return;if("dialog"==F.action){this.showError(null!=F.titleKey?mxResources.get(F.titleKey):F.title,null!=F.messageKey?mxResources.get(F.messageKey):mxUtils.htmlEntities(F.message),+null!=F.buttonKey?mxResources.get(F.buttonKey):F.button);null!=F.modified&&(this.editor.modified=F.modified);return}if("layout"==F.action){this.executeLayouts(this.editor.graph.createLayouts(F.layouts));return}if("prompt"==F.action){this.spinner.stop();var G=new FilenameDialog(this,F.defaultValue||"",null!=F.okKey?mxResources.get(F.okKey):F.ok,function(ba){null!=ba?B.postMessage(JSON.stringify({event:"prompt",value:ba,message:F}),"*"):B.postMessage(JSON.stringify({event:"prompt-cancel",message:F}),+"*")},null!=F.titleKey?mxResources.get(F.titleKey):F.title,null,null,null,null,function(){B.postMessage(JSON.stringify({event:"prompt-cancel",message:F}),"*")});this.showDialog(G.container,300,80,!0,!1);G.init();return}if("draft"==F.action){var H=V(F.xml);this.spinner.stop();G=new DraftDialog(this,mxResources.get("draftFound",[F.name||this.defaultFilename]),H,mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"edit",message:F}),"*")}),mxUtils.bind(this,+function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"discard",message:F}),"*")}),F.editKey?mxResources.get(F.editKey):null,F.discardKey?mxResources.get(F.discardKey):null,F.ignore?mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"ignore",message:F}),"*")}):null);this.showDialog(G.container,640,480,!0,!1,mxUtils.bind(this,function(ba){ba&&this.actions.get("exit").funct()}));try{G.init()}catch(ba){B.postMessage(JSON.stringify({event:"draft",+error:ba.toString(),message:F}),"*")}return}if("template"==F.action){this.spinner.stop();var I=1==F.enableRecent,g=1==F.enableSearch,q=1==F.enableCustomTemp;G=new NewDialog(this,!1,F.templatesOnly?!1:null!=F.callback,mxUtils.bind(this,function(ba,na,Ca,za){ba=ba||this.emptyDiagramXml;null!=F.callback?B.postMessage(JSON.stringify({event:"template",xml:ba,blank:ba==this.emptyDiagramXml,name:na,tempUrl:Ca,libs:za,builtIn:!0,message:F}),"*"):(c(ba,N,ba!=this.emptyDiagramXml,F.toSketch),this.editor.modified||+this.clearStatus())}),null,null,null,null,null,null,null,I?mxUtils.bind(this,function(ba){this.remoteInvoke("getRecentDiagrams",[null],null,ba,function(){ba(null,"Network Error!")})}):null,g?mxUtils.bind(this,function(ba,na){this.remoteInvoke("searchDiagrams",[ba,null],null,na,function(){na(null,"Network Error!")})}):null,mxUtils.bind(this,function(ba,na,Ca){B.postMessage(JSON.stringify({event:"template",docUrl:ba,info:na,name:Ca}),"*")}),null,null,q?mxUtils.bind(this,function(ba){this.remoteInvoke("getCustomTemplates",+null,null,ba,function(){ba({},0)})}):null,1==F.withoutType,null,F.templatesOnly);this.showDialog(G.container,620,460,!0,!1,mxUtils.bind(this,function(ba){null!=this.sidebar&&this.sidebar.hideTooltip();ba&&!F.noExitOnCancel&&this.actions.get("exit").funct()}));G.init();return}if("textContent"==F.action){var C=this.getDiagramTextContent();B.postMessage(JSON.stringify({event:"textContent",data:C,message:F}),"*");return}if("status"==F.action){this.updateStatus(mxUtils.bind(this,function(){null!=F.messageKey?+this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(F.messageKey))):null!=F.message&&this.editor.setStatus(mxUtils.htmlEntities(F.message))}));null!=F.modified&&(this.editor.modified=F.modified);return}if("spinner"==F.action){var J=null!=F.messageKey?mxResources.get(F.messageKey):F.message;null==F.show||F.show?this.spinner.spin(document.body,J):this.spinner.stop();return}if("exit"==F.action){this.actions.get("exit").funct();return}if("viewport"==F.action){if(null!=F.viewport){var M=this.editor.graph,+Q=M.view.translate.x,T=M.view.translate.y;this.embedViewport=F.viewport;M.refresh();this.diagramContainer.scrollTop-=(T-M.view.translate.y)*M.view.scale;this.diagramContainer.scrollLeft-=(Q-M.view.translate.x)*M.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==F.action){var P=this.actions.get(F.actionName);null!=P&&P.funct();return}if("resetEditor"==F.action){M=this.editor.graph;M.isEditing()&&M.stopEditing(!1);this.hideCurrentMenu();M.popupMenuHandler.hideMenu();+M.clearSelection();return}if("fit"==F.action){M=this.editor.graph;var S=M.maxFitScale;M.maxFitScale=null!=F.maxScale?F.maxScale:1;M.fit(null!=F.border?F.border:16,null,null,null,null,!0);M.maxFitScale=S;J=this.createLoadMessage("fit");J.message=F;B.postMessage(JSON.stringify(J),"*");return}if("fullscreenChanged"==F.action){var W=null;try{var X=this.diagramContainer.getAttribute("data-scrollState");null!=X&&(this.diagramContainer.removeAttribute("data-scrollState"),W=JSON.parse(X))}catch(ba){}Editor.inlineFullscreen=+F.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=W&&this.restoreScrollState(W);return}if("snapshot"==F.action){this.sendEmbeddedSvgExport(!0);return}if("export"==F.action){if("png"==F.format||"xmlpng"==F.format){if(null==F.spin&&null==F.spinKey||this.spinner.spin(document.body,null!=F.spinKey?mxResources.get(F.spinKey):F.spin)){var Y=null!=F.xml?F.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);M=this.editor.graph;var Z=mxUtils.bind(this,function(ba,na){if(F.withSvg)F.withSvg=+!1,this.getEmbeddedSvg(Y,this.editor.graph,null,!0,function(za){Z(ba,za)},null,null,F.embedImages,this.editor.graph.background,F.scale,F.border,F.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ca=this.createLoadMessage("export");Ca.format=F.format;Ca.message=v;Ca.data=ba;Ca.svg=na;Ca.xml=Y;B.postMessage(JSON.stringify(Ca),"*")}}),aa=mxUtils.bind(this,function(ba){null==ba&&(ba=Editor.blankImage);"xmlpng"==F.format&&(ba=Editor.writeGraphModelToPng(ba,"tEXt","mxfile",encodeURIComponent(Y)));+M!=this.editor.graph&&M.container.parentNode.removeChild(M.container);Z(ba)}),ha=F.pageId||(null!=this.pages?F.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ja=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=ha){var ba=M.getGlobalVariable;M=this.createTemporaryGraph(M.getStylesheet());for(var na,Ca=0;Ca<this.pages.length;Ca++)if(this.pages[Ca].getId()==ha){na=this.updatePageRoot(this.pages[Ca]);break}null==na&&(na=+this.currentPage);M.getGlobalVariable=function(ua){return"page"==ua?na.getName():"pagenumber"==ua?1:ba.apply(this,arguments)};document.body.appendChild(M.container);M.model.setRoot(na.root)}if(null!=F.layerIds){var za=M.model,ca=za.getChildCells(za.getRoot()),da={};for(Ca=0;Ca<F.layerIds.length;Ca++)da[F.layerIds[Ca]]=!0;for(Ca=0;Ca<ca.length;Ca++)za.setVisible(ca[Ca],da[ca[Ca].id]||!1)}Ca=null;F.keepTheme&&(Ca=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(ua){aa(ua.toDataURL("image/png"))}),+F.width,null,F.background,mxUtils.bind(this,function(){aa(null)}),null,null,F.scale,F.transparent,F.shadow,null,M,F.border,null,F.grid,Ca,F.size)});null!=F.xml&&0<F.xml.length&&(k=!0,this.setFileData(Y),k=!1);ja()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==F.format?"1":"0")+(null!=ha?"&pageId="+ha:"")+(null!=F.layerIds&&0<F.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:F.layerIds})):"")+(null!=F.scale?"&scale="+F.scale:"")+"&base64=1&xml="+encodeURIComponent(Y))).send(mxUtils.bind(this,+function(ba){200<=ba.getStatus()&&299>=ba.getStatus()?Z("data:image/png;base64,"+ba.getText()):aa(null)}),mxUtils.bind(this,function(){aa(null)}))}}else if(ja=mxUtils.bind(this,function(){var ba=this.createLoadMessage("export");ba.message=F;if("html2"==F.format||"html"==F.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var na=this.getXmlFileData();ba.xml=mxUtils.getXml(na);ba.data=this.getFileData(null,null,!0,null,null,null,na);ba.format=F.format}else if("html"==F.format)na=+this.editor.getGraphXml(),ba.data=this.getHtml(na,this.editor.graph),ba.xml=mxUtils.getXml(na),ba.format=F.format;else{if("xml"==F.format)ba.xml=this.getFileData(!0),ba.format=F.format,B.postMessage(JSON.stringify(ba),"*");else{mxSvgCanvas2D.prototype.foAltText=null;na=null!=F.background?F.background:this.editor.graph.background;na==mxConstants.NONE&&(na=null);ba.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ba.format="svg";var Ca=mxUtils.bind(this,function(ca){this.editor.graph.setEnabled(!0);+this.spinner.stop();ba.data=F.asText?ca:Editor.createSvgDataUri(ca);B.postMessage(JSON.stringify(ba),"*")}),za="auto";F.keepTheme&&(za=Editor.isDarkMode()?"dark":"light");null!=F.theme&&(za=F.theme);if("xmlsvg"==F.format){if(null==F.spin&&null==F.spinKey||this.spinner.spin(document.body,null!=F.spinKey?mxResources.get(F.spinKey):F.spin)){za=null;if(this.isAutoDarkMode()||Editor.isDarkMode())za="auto";null!=F.theme&&(za=F.theme);this.getEmbeddedSvg(ba.xml,this.editor.graph,null,!0,Ca,null,null,F.embedImages,+na,F.scale,F.border,F.shadow,za)}}else if(null==F.spin&&null==F.spinKey||this.spinner.spin(document.body,null!=F.spinKey?mxResources.get(F.spinKey):F.spin))this.editor.graph.setEnabled(!1),na=this.editor.graph.getSvg(na,F.scale,F.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||F.shadow,null,za),(this.editor.graph.shadowVisible||F.shadow)&&this.editor.graph.addSvgShadow(na),this.embedFonts(na,mxUtils.bind(this,function(ca){F.embedImages||null==F.embedImages?this.editor.convertImages(ca,+mxUtils.bind(this,function(da){Ca(mxUtils.getXml(da))})):Ca(mxUtils.getXml(ca))}))}return}B.postMessage(JSON.stringify(ba),"*")}),null!=F.xml&&0<F.xml.length){if(this.editor.graph.mathEnabled){var fa=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){fa.apply(this,arguments);ja()}}k=!0;this.setFileData(F.xml);k=!1;this.editor.graph.mathEnabled||ja()}else ja();return}if("load"==F.action){n=F.toSketch;m=1==F.autosave;this.embedDiffSync=null!=F.diffSync&&!1!==F.diffSync;this.embedDiffSyncPatchOnly=+"object"===typeof F.diffSync&&null!=F.diffSync&&1==F.diffSync.patchOnly;this.embedExportProtocol=1==F.exportProtocol;var ma=F.sourceMetadata||null;this.hideDialog();null!=F.modified&&null==urlParams.modified&&(urlParams.modified=F.modified);null!=F.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=F.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+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=F.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=F.noSaveBtn);if(null!=F.rough){var sa=Editor.sketchMode;this.doSetSketchMode(F.rough);sa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=F.dark&&this.setDarkMode(F.dark);null!=F.border&&(this.embedExportBorder=F.border);null!=F.theme&&(this.embedExportTheme=+F.theme);null!=F.background&&(this.embedExportBackground=F.background);null!=F.viewport&&(this.embedViewport=F.viewport);this.embedExitPoint=null;if(null!=F.scale){var ta=F.scale,ra=null!=F.scaleBorder?F.scaleBorder:this.embedExportBorder||0,qa=null!=F.border?F.border:0;U=mxUtils.bind(this,function(){var ba=this.editor.graph,na=ba.getGraphBounds();if(0<na.width&&0<na.height){var Ca=ba.view.scale;ba.view.scaleAndTranslate(ta,ba.view.translate.x+qa-na.x/Ca+ra/ta,ba.view.translate.y+qa-na.y/Ca+ra/ta)}})}else if(null!=+F.fit){var la=null!=F.border?F.border:0,ia=F.maxFitScale||1;U=mxUtils.bind(this,function(){var ba=this.editor.graph,na=ba.maxFitScale;ba.maxFitScale=ia;ba.fit(la,null,null,null,null,!0);ba.maxFitScale=na})}if(null!=F.rect){qa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,F.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,F.rect.top)+"px";this.minInlineWidth=F.minWidth;this.minInlineHeight=F.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom=+"";this.diagramContainer.style.right="";var oa=F.maxFitScale,xa=F.rect.width+2*qa,Aa=F.rect.height+2*qa;U=mxUtils.bind(this,function(){var ba=mxUtils.getDocumentSize();xa=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,xa):xa,ba.width-80);ba=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Aa):Aa,ba.height-80);this.diagramContainer.style.width=xa+"px";this.diagramContainer.style.height=ba+"px";var na=this.editor.graph;ba=na.maxFitScale;na.maxFitScale=oa;na.fit(2*qa,+null,null,null,null,null,Aa);this.setPageVisible(!1);if(null!=this.minInlineWidth&&na.getGraphBounds().width<this.minInlineWidth){var Ca=na.container.scrollTop;this.resetScrollbars();na.container.scrollTop=Ca}na.maxFitScale=ba;na.container.scrollTop-=qa;na.container.scrollLeft-=qa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[F]));na.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&+(this.formatWindow.window.div.style.top=na.container.style.top);var za=na.getGraphBounds();na.container.clientWidth>za.width+2*qa&&(na.container.scrollLeft=za.x+(za.width+qa-na.container.clientWidth)/2)}),10)})}null!=F.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=F.noExitBtn);null!=F.title&&null!=this.buttonContainer&&this.setEmbedTitle(F.title);try{F.libs&&this.sidebar.showEntries(F.libs)}catch(ba){}if(null!=F.xmlpng)F=this.extractGraphModelFromPng(F.xmlpng);else if(null!=F.descriptor){if(F=+F.descriptor,"mermaid"==F.format){window.isMermaidEnabled?this.parseMermaidDiagram(F.data,null,mxUtils.bind(this,function(ba){c(ba,N,null,n);ba=this.createLoadMessage("load");ba.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);ba.message=v;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ba),"*");if(null!=ma&&null!=ma.key&&null!=ma.value){ba=this.editor.graph;var na=ba.getModel().getRoot();if(null!=na){ba.getModel().beginUpdate();try{ba.setAttributeForCell(na,+ma.key,ma.value)}finally{ba.getModel().endUpdate()}}}}),mxUtils.bind(this,function(ba){this.handleError(ba)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else F=F.xml}else{if("merge"==F.action){var wa=this.getCurrentFile();null!=wa&&(H=V(F.xml),null!=H&&""!=H&&wa.mergeFile(new LocalFile(this,H),mxUtils.bind(this,function(){this.embedDiffSync&&(u=this.clonePages(this.pages),t=Da());B.postMessage(JSON.stringify({event:"merge",+message:F}),"*")}),function(ba){B.postMessage(JSON.stringify({event:"merge",message:F,error:ba}),"*")}))}else if("patch"==F.action){if(wa=this.getCurrentFile(),null!=wa&&null!=F.patch)try{k=!0,wa.patch([F.patch]),this.embedDiffSync&&null!=u&&(u=this.applyPatches(u,[F.patch])),t=Da(),k=!1,X={event:"patch",message:F},W=this.getHashValueForPages(this.pages),X.checksum=W,null!=F.checksum&&F.checksum!=W&&(X.checksumMismatch=!0),B.postMessage(JSON.stringify(X),"*")}catch(ba){k=!1,B.postMessage(JSON.stringify({event:"patch",+message:F,error:ba.message||ba.toString()}),"*")}}else if("getDiff"==F.action){J={event:"getDiff",message:F};if(this.embedDiffSync&&null!=u){var ea=this.clonePages(this.pages);J.patch=this.diffPages(u,ea);J.checksum=this.getHashValueForPages(ea)}else J.xml=Da();B.postMessage(JSON.stringify(J),"*")}else"resetDiff"==F.action?this.embedDiffSync&&(null!=F.xml?(H=V(F.xml),wa=this.getCurrentFile(),null!=H&&""!=H&&null!=wa&&wa.mergeFile(new LocalFile(this,H),mxUtils.bind(this,function(){u=this.clonePages(this.pages);+t=Da();B.postMessage(JSON.stringify({event:"resetDiff",message:F,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ba){B.postMessage(JSON.stringify({event:"resetDiff",message:F,error:ba}),"*")})):(u=this.clonePages(this.pages),t=Da(),B.postMessage(JSON.stringify({event:"resetDiff",message:F,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==F.action?this.handleRemoteInvokeReady(B):"remoteInvoke"==F.action?this.handleRemoteInvoke(F,N.origin):"remoteInvokeResponse"==+F.action?this.handleRemoteInvokeResponse(F):B.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(F)}),"*");return}}catch(ba){this.handleError(ba)}}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())}),pa=mxUtils.bind(this,function(ba,na){k=!0;try{c(ba,na,null,n)}catch(Ca){this.handleError(Ca)}k=!1;null!=urlParams.modified&&this.clearStatus();t=Da();this.embedDiffSync&&+(u=this.clonePages(this.pages));m&&null==d&&(d=mxUtils.bind(this,function(Ca,za){Ca=Da();if(Ca!=t&&!k){za=this.createLoadMessage("autosave");za.message=v;if(this.embedDiffSync&&null!=u){var ca=this.clonePages(this.pages),da=this.diffPages(u,ca);mxUtils.isEmptyObject(da)?za.xml=Ca:(za.patch=da,za.checksum=this.getHashValueForPages(ca),this.embedDiffSyncPatchOnly||(za.xml=Ca));u=ca}else za.xml=Ca;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(za),"*")}t=Ca}),this.editor.graph.model.addListener(mxEvent.CHANGE,+d),this.editor.graph.addListener("gridSizeChanged",d),this.editor.graph.addListener("shadowVisibleChanged",d),this.addListener("pageFormatChanged",d),this.addListener("pageScaleChanged",d),this.addListener("backgroundColorChanged",d),this.addListener("backgroundImageChanged",d),this.addListener("foldingEnabledChanged",d),this.addListener("mathEnabledChanged",d),this.addListener("gridEnabledChanged",d),this.addListener("guidesEnabledChanged",d),this.addListener("pageViewChanged",d));null!=U&&U();if("1"==+urlParams.returnbounds||"json"==urlParams.proto)na=this.createLoadMessage("load"),na.xml=ba,this.embedDiffSync&&null!=this.pages&&(na.checksum=this.getHashValueForPages(this.pages)),B.postMessage(JSON.stringify(na),"*")});null!=F&&"function"===typeof F.substring&&"data:application/vnd.visio;base64,"==F.substring(0,34)?(V="0M8R4KGxGuE"==F.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(F.substring(F.indexOf(",")+1)),function(ba){pa(ba,N)},mxUtils.bind(this,function(ba){this.handleError(ba)}),+V)):null!=F&&"function"===typeof F.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(F,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(F,mxUtils.bind(this,function(ba){4==ba.readyState&&(200<=ba.status&&299>=ba.status&&"<mxGraphModel"==ba.responseText.substring(0,13)?pa(ba.responseText,N):this.handleError({message:413==ba.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=F&&"function"===+typeof F.substring&&this.isLucidChartData(F)?this.convertLucidChart(F,mxUtils.bind(this,function(ba){pa(ba)}),mxUtils.bind(this,function(ba){this.handleError(ba)})):null==F||"object"!==typeof F||null==F.format||null==F.data&&null==F.url?(F=V(F),pa(F,N)):this.loadDescriptor(F,mxUtils.bind(this,function(ba){pa(Da(),N)}),mxUtils.bind(this,function(ba){this.handleError(ba,mxResources.get("errorLoadingFile"))}))}}));var B=this.embedMessageSource||window.opener||window.parent;A="json"==urlParams.proto?+JSON.stringify({event:"init"}):urlParams.ready||"ready";B.postMessage(A,"*");if("json"==urlParams.proto){var D=this.editor.graph.openLink;this.editor.graph.openLink=function(N,F,U){D.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",href:N,target:F,allowOpener:U}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,d,k,m){var t=document.createElement("button");t.className="geEmbedBtn geBtn";t.setAttribute("title",c+(null!=k?" ("+k+")":""));mxUtils.write(t,c);m&&t.classList.add("gePrimaryBtn");+mxEvent.addListener(t,"click",d);return t};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&+this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey++"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};-EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var d=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var m=JSON.parse(k);this.executeLayouts(this.editor.graph.createLayouts(m));this.customLayoutConfig=m;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(k,m){var t=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var v=-m.value;m.value=JSON.stringify(JSON.parse(v));m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));m.value=v}catch(A){this.handleError(A)}}));t.setAttribute("title","copy");t.className="geBtn";k.appendChild(t)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(d.container,620,460,!0,!0);d.init()}))};EditorUi.prototype.loadOrgChartLayouts=-function(c,d){this.createTimeout(null,mxUtils.bind(this,function(k){var m=mxUtils.bind(this,function(){this.loadingOrgChart=!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),t=mxUtils.bind(this,function(v){this.loadingOrgChart=!1;k.clear()&&this.handleError(v)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))m();else if(d||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",+EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var d=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var m=JSON.parse(k);this.executeLayouts(this.editor.graph.createLayouts(m));this.customLayoutConfig=m;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(k,m){var t=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var u=+m.value;m.value=JSON.stringify(JSON.parse(u));m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));m.value=u}catch(A){this.handleError(A)}}));t.setAttribute("title","copy");t.className="geBtn";k.appendChild(t)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(d.container,620,460,!0,!0);d.init()}))};EditorUi.prototype.loadOrgChartLayouts=+function(c,d){this.createTimeout(null,mxUtils.bind(this,function(k){var m=mxUtils.bind(this,function(){this.loadingOrgChart=!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),t=mxUtils.bind(this,function(u){this.loadingOrgChart=!1;k.clear()&&this.handleError(u)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))m();else if(d||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(c,d,k,m){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,d,k)}),m)};EditorUi.prototype.doImportCsv=function(c,-d,k){try{var m=c.split("\n"),t=[],v=[],A=[],C={};if(0<m.length){var E={};k=null!=k?k:this.editor.graph;var D=null,U=null,T=null,V=null,n=null,u=null,G=null,H="whiteSpace=wrap;html=1;",I=null,g=null,q="",B="auto",J="auto",Q=!1,N=null,S=null,P=40,R=40,W=100,X=0,Y=mxUtils.bind(this,function(){null!=d?d(ja):(k.setSelectionCells(ja),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),aa=k.getFreeInsertPoint(),-ba=aa.x,fa=aa.y;aa=fa;var ia=null,ea="auto";g=null;for(var ma=[],qa=null,na=null,ta=0;ta<m.length&&"#"==m[ta].charAt(0);){c=m[ta].replace(/\r$/,"");for(ta++;ta<m.length&&"\\"==c.charAt(c.length-1)&&"#"==m[ta].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(m[ta].substring(1)),ta++;if("#"!=c.charAt(1)){var ra=c.indexOf(":");if(0<ra){var la=mxUtils.trim(c.substring(1,ra)),ha=mxUtils.trim(c.substring(ra+1));"label"==la?ia=Graph.sanitizeHtml(ha):"labelname"==la&&0<ha.length&&"-"!=ha?n=ha:"labels"==-la&&0<ha.length&&"-"!=ha?G=JSON.parse(ha):"style"==la?U=ha:"parentstyle"==la?H=ha:"unknownStyle"==la&&"-"!=ha?u=ha:"stylename"==la&&0<ha.length&&"-"!=ha?V=ha:"styles"==la&&0<ha.length&&"-"!=ha?T=JSON.parse(ha):"vars"==la&&0<ha.length&&"-"!=ha?D=JSON.parse(ha):"identity"==la&&0<ha.length&&"-"!=ha?I=ha:"parent"==la&&0<ha.length&&"-"!=ha?g=ha:"namespace"==la&&0<ha.length&&"-"!=ha?q=ha:"width"==la?B=ha:"height"==la?J=ha:"collapsed"==la&&"-"!=ha?Q="true"==ha:"left"==la&&0<ha.length?N=ha:"top"==la&&0<ha.length?-S=ha:"ignore"==la?na=ha.split(","):"connect"==la?ma.push(JSON.parse(ha)):"link"==la?qa=ha:"padding"==la?X=parseFloat(ha):"edgespacing"==la?P=parseFloat(ha):"nodespacing"==la?R=parseFloat(ha):"levelspacing"==la?W=parseFloat(ha):"layout"==la&&(ea=ha)}}}if(null==m[ta])throw Error(mxResources.get("invalidOrMissingFile"));var pa=this.editor.csvToArray(m[ta].replace(/\r$/,""));ra=c=null;la=[];for(ha=0;ha<pa.length;ha++)I==pa[ha]&&(c=ha),g==pa[ha]&&(ra=ha),la.push(mxUtils.trim(pa[ha]).replace(/[^a-z0-9]+/ig,-"_").replace(/^\d+/,"").replace(/_+$/,""));null==ia&&(ia="%"+la[0]+"%");if(null!=ma)for(var ya=0;ya<ma.length;ya++)null==E[ma[ya].to]&&(E[ma[ya].to]={});I=[];for(ha=ta+1;ha<m.length;ha++){var za=this.editor.csvToArray(m[ha].replace(/\r$/,""));if(null==za){var xa=40<m[ha].length?m[ha].substring(0,40)+"...":m[ha];throw Error(xa+" ("+ha+"):\n"+mxResources.get("containsValidationErrors"));}0<za.length&&I.push(za)}k.model.beginUpdate();try{for(ha=0;ha<I.length;ha++){za=I[ha];var Z=null,oa=null!=c?q+za[c]:-null;m=!1;null!=oa&&(Z=k.model.getCell(oa),m=null==Z||0<=mxUtils.indexOf(t,Z));var ka=new mxCell(ia,new mxGeometry(ba,aa,0,0),U||"whiteSpace=wrap;html=1;");ka.collapsed=Q;ka.vertex=!0;ka.id=oa;null==Z||m||k.model.setCollapsed(Z,Q);for(var sa=0;sa<za.length;sa++)k.setAttributeForCell(ka,la[sa],za[sa]),null==Z||m||k.setAttributeForCell(Z,la[sa],za[sa]);if(null!=n&&null!=G){var Ca=G[ka.getAttribute(n)];null!=Ca&&(k.labelChanged(ka,Ca),null==Z||m||k.cellLabelChanged(Z,Ca))}if(null!=V&&null!=T){var Ia=-T[ka.getAttribute(V)];null!=Ia&&(ka.style=Ia)}k.setAttributeForCell(ka,"placeholders","1");ka.style=k.replacePlaceholders(ka,ka.style,D);null==Z||m?k.fireEvent(new mxEventObject("cellsInserted","cells",[ka])):(k.model.setStyle(Z,ka.style),0>mxUtils.indexOf(A,Z)&&A.push(Z),k.fireEvent(new mxEventObject("cellsInserted","cells",[Z])));m=null!=Z;Z=ka;if(!m)for(ya=0;ya<ma.length;ya++)E[ma[ya].to][Z.getAttribute(ma[ya].to)]=Z;null!=qa&&"link"!=qa&&(k.setLinkForCell(Z,Z.getAttribute(qa)),k.setAttributeForCell(Z,-qa,null));var Ba=k.getPreferredSizeForCell(Z);g=null!=ra?k.model.getCell(q+za[ra]):null;if(Z.vertex){xa=null!=g?0:ba;ta=null!=g?0:fa;null!=N&&null!=Z.getAttribute(N)&&(Z.geometry.x=xa+parseFloat(Z.getAttribute(N)));null!=S&&null!=Z.getAttribute(S)&&(Z.geometry.y=ta+parseFloat(Z.getAttribute(S)));var da="@"==B.charAt(0)?Z.getAttribute(B.substring(1)):null;Z.geometry.width=null!=da&&"auto"!=da?parseFloat(Z.getAttribute(B.substring(1))):"auto"==B||"auto"==da?Ba.width+X:parseFloat(B);var ca="@"==J.charAt(0)?-Z.getAttribute(J.substring(1)):null;Z.geometry.height=null!=ca&&"auto"!=ca&&"width"!=J?parseFloat(ca):"auto"==J||"auto"==ca?Ba.height+X:"width"==J?Z.geometry.width:parseFloat(J);aa+=Z.geometry.height+R}m?(null==C[oa]&&(C[oa]=[]),C[oa].push(Z)):(t.push(Z),null!=g?(g.style=k.replacePlaceholders(g,H,D),k.addCell(Z,g),v.push(g)):A.push(k.addCell(Z)))}for(ha=0;ha<v.length;ha++)da="@"==B.charAt(0)?v[ha].getAttribute(B.substring(1)):null,ca="@"==J.charAt(0)?v[ha].getAttribute(J.substring(1)):null,"auto"!=-B&&"auto"!=da||"auto"!=J&&"auto"!=ca||k.updateGroupBounds([v[ha]],X,!0);var ua=A.slice(),ja=A.slice();for(ya=0;ya<ma.length;ya++){var wa=ma[ya];for(ha=0;ha<t.length;ha++){Z=t[ha];var va=mxUtils.bind(this,function(Qa,cb,Na){var Ra=cb.getAttribute(Na.from);if(null!=Ra&&""!=Ra){Ra=Ra.split(",");for(var kb=0;kb<Ra.length;kb++){var Ua=E[Na.to][Ra[kb]];if(null==Ua&&null!=u){Ua=new mxCell(Ra[kb],new mxGeometry(ba,fa,0,0),u);Ua.style=k.replacePlaceholders(cb,Ua.style,D);var Za=k.getPreferredSizeForCell(Ua);-Ua.geometry.width=Za.width+X;Ua.geometry.height=Za.height+X;E[Na.to][Ra[kb]]=Ua;Ua.vertex=!0;Ua.id=Ra[kb];A.push(k.addCell(Ua))}if(null!=Ua){Za=Na.label;null!=Na.fromlabel&&(Za=(cb.getAttribute(Na.fromlabel)||"")+(Za||""));null!=Na.sourcelabel&&(Za=k.replacePlaceholders(cb,Na.sourcelabel,D)+(Za||""));null!=Na.tolabel&&(Za=(Za||"")+(Ua.getAttribute(Na.tolabel)||""));null!=Na.targetlabel&&(Za=(Za||"")+k.replacePlaceholders(Ua,Na.targetlabel,D));var lb="target"==Na.placeholders==!Na.invert?Ua:Qa;lb=-null!=Na.style?k.replacePlaceholders(lb,Na.style,D):k.createCurrentEdgeStyle();Za=k.insertEdge(null,null,Za||"",Na.invert?Ua:Qa,Na.invert?Qa:Ua,lb);if(null!=Na.labels)for(lb=0;lb<Na.labels.length;lb++){var Sa=Na.labels[lb],eb=new mxCell(Sa.label||lb,new mxGeometry(null!=Sa.x?Sa.x:0,null!=Sa.y?Sa.y:0,0,0),"resizable=0;html=1;");eb.vertex=!0;eb.connectable=!1;eb.geometry.relative=!0;null!=Sa.placeholders&&(eb.value=k.replacePlaceholders("target"==Sa.placeholders==!Na.invert?Ua:Qa,eb.value,D));if(null!=-Sa.dx||null!=Sa.dy)eb.geometry.offset=new mxPoint(null!=Sa.dx?Sa.dx:0,null!=Sa.dy?Sa.dy:0);Za.insert(eb)}if(null!=Na.data)for(var fb in Na.data)k.setAttributeForCell(Za,fb,Na.data[fb]);ja.push(Za);mxUtils.remove(Na.invert?Qa:Ua,ua)}}}});va(Z,Z,wa);if(null!=C[Z.id])for(sa=0;sa<C[Z.id].length;sa++)va(Z,C[Z.id][sa],wa)}}if(null!=na)for(ha=0;ha<t.length;ha++)for(Z=t[ha],sa=0;sa<na.length;sa++)k.setAttributeForCell(Z,mxUtils.trim(na[sa]),null);if(0<A.length){var Fa=new mxParallelEdgeLayout(k);Fa.spacing=-P;Fa.checkOverlap=!0;var Ka=function(){0<Fa.spacing&&Fa.execute(k.getDefaultParent());for(var Qa=0;Qa<A.length;Qa++){var cb=k.getCellGeometry(A[Qa]);cb.x=Math.round(k.snap(cb.x));cb.y=Math.round(k.snap(cb.y));"auto"==B&&(cb.width=Math.round(k.snap(cb.width)));"auto"==J&&(cb.height=Math.round(k.snap(cb.height)))}};if("["==ea.charAt(0)){var Wa=Y;k.view.validate();this.executeLayouts(k.createLayouts(JSON.parse(ea)),function(){Ka();Wa()});Y=null}else if("circle"==ea){var Pa=new mxCircleLayout(k);Pa.disableEdgeStyle=-!1;Pa.resetEdges=!1;var ob=Pa.isVertexIgnored;Pa.isVertexIgnored=function(Qa){return ob.apply(this,arguments)||0>mxUtils.indexOf(A,Qa)};this.executeLayout(function(){Pa.execute(k.getDefaultParent());Ka()},!0,Y);Y=null}else if("horizontaltree"==ea||"verticaltree"==ea||"auto"==ea&&ja.length==2*A.length-1&&1==ua.length){k.view.validate();var Xa=new mxCompactTreeLayout(k,"horizontaltree"==ea);Xa.levelDistance=R;Xa.edgeRouting=!1;Xa.resetEdges=!1;Xa.sortEdges=!0;this.executeLayout(function(){Xa.execute(k.getDefaultParent(),-0<ua.length?ua[0]:null)},!0,Y);Y=null}else if("horizontalflow"==ea||"verticalflow"==ea||"auto"==ea&&1==ua.length){k.view.validate();var $a=new mxHierarchicalLayout(k,"horizontalflow"==ea?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);$a.intraCellSpacing=R;$a.parallelEdgeSpacing=P;$a.interRankCellSpacing=W;$a.disableEdgeStyle=!1;this.executeLayout(function(){$a.execute(k.getDefaultParent(),ja);k.moveCells(ja,ba,fa)},!0,Y);Y=null}else if("orgchart"==ea){k.view.validate();var db=new mxOrgChartLayout(k,-2,W,R),ib=db.isVertexIgnored;db.isVertexIgnored=function(Qa){return ib.apply(this,arguments)||0>mxUtils.indexOf(A,Qa)};this.executeLayout(function(){db.execute(k.getDefaultParent());Ka()},!0,Y);Y=null}else if("organic"==ea||"auto"==ea&&ja.length>A.length){k.view.validate();var ab=new mxFastOrganicLayout(k);ab.forceConstant=3*R;ab.disableEdgeStyle=!1;ab.resetEdges=!1;var ub=ab.isVertexIgnored;ab.isVertexIgnored=function(Qa){return ub.apply(this,arguments)||0>mxUtils.indexOf(A,Qa)};this.executeLayout(function(){ab.execute(k.getDefaultParent());+d,k){try{var m=c.split("\n"),t=[],u=[],A=[],B={};if(0<m.length){var D={};k=null!=k?k:this.editor.graph;var N=null,F=null,U=null,V=null,n=null,v=null,G=null,H="whiteSpace=wrap;html=1;",I=null,g=null,q="",C="auto",J="auto",M=!1,Q=null,T=null,P=40,S=40,W=100,X=0,Y=mxUtils.bind(this,function(){null!=d?d(ka):(k.setSelectionCells(ka),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=k.getFreeInsertPoint(),+aa=Z.x,ha=Z.y;Z=ha;var ja=null,fa="auto";g=null;for(var ma=[],sa=null,ta=null,ra=0;ra<m.length&&"#"==m[ra].charAt(0);){c=m[ra].replace(/\r$/,"");for(ra++;ra<m.length&&"\\"==c.charAt(c.length-1)&&"#"==m[ra].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(m[ra].substring(1)),ra++;if("#"!=c.charAt(1)){var qa=c.indexOf(":");if(0<qa){var la=mxUtils.trim(c.substring(1,qa)),ia=mxUtils.trim(c.substring(qa+1));"label"==la?ja=Graph.sanitizeHtml(ia):"labelname"==la&&0<ia.length&&"-"!=ia?n=ia:"labels"==la&&+0<ia.length&&"-"!=ia?G=JSON.parse(ia):"style"==la?F=ia:"parentstyle"==la?H=ia:"unknownStyle"==la&&"-"!=ia?v=ia:"stylename"==la&&0<ia.length&&"-"!=ia?V=ia:"styles"==la&&0<ia.length&&"-"!=ia?U=JSON.parse(ia):"vars"==la&&0<ia.length&&"-"!=ia?N=JSON.parse(ia):"identity"==la&&0<ia.length&&"-"!=ia?I=ia:"parent"==la&&0<ia.length&&"-"!=ia?g=ia:"namespace"==la&&0<ia.length&&"-"!=ia?q=ia:"width"==la?C=ia:"height"==la?J=ia:"collapsed"==la&&"-"!=ia?M="true"==ia:"left"==la&&0<ia.length?Q=ia:"top"==la&&0<ia.length?+T=ia:"ignore"==la?ta=ia.split(","):"connect"==la?ma.push(JSON.parse(ia)):"link"==la?sa=ia:"padding"==la?X=parseFloat(ia):"edgespacing"==la?P=parseFloat(ia):"nodespacing"==la?S=parseFloat(ia):"levelspacing"==la?W=parseFloat(ia):"layout"==la&&(fa=ia)}}}if(null==m[ra])throw Error(mxResources.get("invalidOrMissingFile"));var oa=this.editor.csvToArray(m[ra].replace(/\r$/,""));qa=c=null;la=[];for(ia=0;ia<oa.length;ia++)I==oa[ia]&&(c=ia),g==oa[ia]&&(qa=ia),la.push(mxUtils.trim(oa[ia]).replace(/[^a-z0-9]+/ig,+"_").replace(/^\d+/,"").replace(/_+$/,""));null==ja&&(ja="%"+la[0]+"%");if(null!=ma)for(var xa=0;xa<ma.length;xa++)null==D[ma[xa].to]&&(D[ma[xa].to]={});I=[];for(ia=ra+1;ia<m.length;ia++){var Aa=this.editor.csvToArray(m[ia].replace(/\r$/,""));if(null==Aa){var wa=40<m[ia].length?m[ia].substring(0,40)+"...":m[ia];throw Error(wa+" ("+ia+"):\n"+mxResources.get("containsValidationErrors"));}0<Aa.length&&I.push(Aa)}k.model.beginUpdate();try{for(ia=0;ia<I.length;ia++){Aa=I[ia];var ea=null,Da=null!=c?q+Aa[c]:+null;m=!1;null!=Da&&(ea=k.model.getCell(Da),m=null==ea||0<=mxUtils.indexOf(t,ea));var pa=new mxCell(ja,new mxGeometry(aa,Z,0,0),F||"whiteSpace=wrap;html=1;");pa.collapsed=M;pa.vertex=!0;pa.id=Da;null==ea||m||k.model.setCollapsed(ea,M);for(var ba=0;ba<Aa.length;ba++)k.setAttributeForCell(pa,la[ba],Aa[ba]),null==ea||m||k.setAttributeForCell(ea,la[ba],Aa[ba]);if(null!=n&&null!=G){var na=G[pa.getAttribute(n)];null!=na&&(k.labelChanged(pa,na),null==ea||m||k.cellLabelChanged(ea,na))}if(null!=V&&null!=U){var Ca=+U[pa.getAttribute(V)];null!=Ca&&(pa.style=Ca)}k.setAttributeForCell(pa,"placeholders","1");pa.style=k.replacePlaceholders(pa,pa.style,N);null==ea||m?k.fireEvent(new mxEventObject("cellsInserted","cells",[pa])):(k.model.setStyle(ea,pa.style),0>mxUtils.indexOf(A,ea)&&A.push(ea),k.fireEvent(new mxEventObject("cellsInserted","cells",[ea])));m=null!=ea;ea=pa;if(!m)for(xa=0;xa<ma.length;xa++)D[ma[xa].to][ea.getAttribute(ma[xa].to)]=ea;null!=sa&&"link"!=sa&&(k.setLinkForCell(ea,ea.getAttribute(sa)),k.setAttributeForCell(ea,+sa,null));var za=k.getPreferredSizeForCell(ea);g=null!=qa?k.model.getCell(q+Aa[qa]):null;if(ea.vertex){wa=null!=g?0:aa;ra=null!=g?0:ha;null!=Q&&null!=ea.getAttribute(Q)&&(ea.geometry.x=wa+parseFloat(ea.getAttribute(Q)));null!=T&&null!=ea.getAttribute(T)&&(ea.geometry.y=ra+parseFloat(ea.getAttribute(T)));var ca="@"==C.charAt(0)?ea.getAttribute(C.substring(1)):null;ea.geometry.width=null!=ca&&"auto"!=ca?parseFloat(ea.getAttribute(C.substring(1))):"auto"==C||"auto"==ca?za.width+X:parseFloat(C);var da=+"@"==J.charAt(0)?ea.getAttribute(J.substring(1)):null;ea.geometry.height=null!=da&&"auto"!=da&&"width"!=J?parseFloat(da):"auto"==J||"auto"==da?za.height+X:"width"==J?ea.geometry.width:parseFloat(J);Z+=ea.geometry.height+S}m?(null==B[Da]&&(B[Da]=[]),B[Da].push(ea)):(t.push(ea),null!=g?(g.style=k.replacePlaceholders(g,H,N),k.addCell(ea,g),u.push(g)):A.push(k.addCell(ea)))}for(ia=0;ia<u.length;ia++)ca="@"==C.charAt(0)?u[ia].getAttribute(C.substring(1)):null,da="@"==J.charAt(0)?u[ia].getAttribute(J.substring(1)):+null,"auto"!=C&&"auto"!=ca||"auto"!=J&&"auto"!=da||k.updateGroupBounds([u[ia]],X,!0);var ua=A.slice(),ka=A.slice();for(xa=0;xa<ma.length;xa++){var ya=ma[xa];for(ia=0;ia<t.length;ia++){ea=t[ia];var va=mxUtils.bind(this,function(Qa,cb,Na){var Ra=cb.getAttribute(Na.from);if(null!=Ra&&""!=Ra){Ra=Ra.split(",");for(var kb=0;kb<Ra.length;kb++){var Ua=D[Na.to][Ra[kb]];if(null==Ua&&null!=v){Ua=new mxCell(Ra[kb],new mxGeometry(aa,ha,0,0),v);Ua.style=k.replacePlaceholders(cb,Ua.style,N);var Za=k.getPreferredSizeForCell(Ua);+Ua.geometry.width=Za.width+X;Ua.geometry.height=Za.height+X;D[Na.to][Ra[kb]]=Ua;Ua.vertex=!0;Ua.id=Ra[kb];A.push(k.addCell(Ua))}if(null!=Ua){Za=Na.label;null!=Na.fromlabel&&(Za=(cb.getAttribute(Na.fromlabel)||"")+(Za||""));null!=Na.sourcelabel&&(Za=k.replacePlaceholders(cb,Na.sourcelabel,N)+(Za||""));null!=Na.tolabel&&(Za=(Za||"")+(Ua.getAttribute(Na.tolabel)||""));null!=Na.targetlabel&&(Za=(Za||"")+k.replacePlaceholders(Ua,Na.targetlabel,N));var lb="target"==Na.placeholders==!Na.invert?Ua:Qa;lb=+null!=Na.style?k.replacePlaceholders(lb,Na.style,N):k.createCurrentEdgeStyle();Za=k.insertEdge(null,null,Za||"",Na.invert?Ua:Qa,Na.invert?Qa:Ua,lb);if(null!=Na.labels)for(lb=0;lb<Na.labels.length;lb++){var Sa=Na.labels[lb],eb=new mxCell(Sa.label||lb,new mxGeometry(null!=Sa.x?Sa.x:0,null!=Sa.y?Sa.y:0,0,0),"resizable=0;html=1;");eb.vertex=!0;eb.connectable=!1;eb.geometry.relative=!0;null!=Sa.placeholders&&(eb.value=k.replacePlaceholders("target"==Sa.placeholders==!Na.invert?Ua:Qa,eb.value,N));if(null!=+Sa.dx||null!=Sa.dy)eb.geometry.offset=new mxPoint(null!=Sa.dx?Sa.dx:0,null!=Sa.dy?Sa.dy:0);Za.insert(eb)}if(null!=Na.data)for(var fb in Na.data)k.setAttributeForCell(Za,fb,Na.data[fb]);ka.push(Za);mxUtils.remove(Na.invert?Qa:Ua,ua)}}}});va(ea,ea,ya);if(null!=B[ea.id])for(ba=0;ba<B[ea.id].length;ba++)va(ea,B[ea.id][ba],ya)}}if(null!=ta)for(ia=0;ia<t.length;ia++)for(ea=t[ia],ba=0;ba<ta.length;ba++)k.setAttributeForCell(ea,mxUtils.trim(ta[ba]),null);if(0<A.length){var Ga=new mxParallelEdgeLayout(k);+Ga.spacing=P;Ga.checkOverlap=!0;var Ka=function(){0<Ga.spacing&&Ga.execute(k.getDefaultParent());for(var Qa=0;Qa<A.length;Qa++){var cb=k.getCellGeometry(A[Qa]);cb.x=Math.round(k.snap(cb.x));cb.y=Math.round(k.snap(cb.y));"auto"==C&&(cb.width=Math.round(k.snap(cb.width)));"auto"==J&&(cb.height=Math.round(k.snap(cb.height)))}};if("["==fa.charAt(0)){var Wa=Y;k.view.validate();this.executeLayouts(k.createLayouts(JSON.parse(fa)),function(){Ka();Wa()});Y=null}else if("circle"==fa){var Pa=new mxCircleLayout(k);+Pa.disableEdgeStyle=!1;Pa.resetEdges=!1;var ob=Pa.isVertexIgnored;Pa.isVertexIgnored=function(Qa){return ob.apply(this,arguments)||0>mxUtils.indexOf(A,Qa)};this.executeLayout(function(){Pa.execute(k.getDefaultParent());Ka()},!0,Y);Y=null}else if("horizontaltree"==fa||"verticaltree"==fa||"auto"==fa&&ka.length==2*A.length-1&&1==ua.length){k.view.validate();var Xa=new mxCompactTreeLayout(k,"horizontaltree"==fa);Xa.levelDistance=S;Xa.edgeRouting=!1;Xa.resetEdges=!1;Xa.sortEdges=!0;this.executeLayout(function(){Xa.execute(k.getDefaultParent(),+0<ua.length?ua[0]:null)},!0,Y);Y=null}else if("horizontalflow"==fa||"verticalflow"==fa||"auto"==fa&&1==ua.length){k.view.validate();var $a=new mxHierarchicalLayout(k,"horizontalflow"==fa?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);$a.intraCellSpacing=S;$a.parallelEdgeSpacing=P;$a.interRankCellSpacing=W;$a.disableEdgeStyle=!1;this.executeLayout(function(){$a.execute(k.getDefaultParent(),ka);k.moveCells(ka,aa,ha)},!0,Y);Y=null}else if("orgchart"==fa){k.view.validate();var db=new mxOrgChartLayout(k,+2,W,S),ib=db.isVertexIgnored;db.isVertexIgnored=function(Qa){return ib.apply(this,arguments)||0>mxUtils.indexOf(A,Qa)};this.executeLayout(function(){db.execute(k.getDefaultParent());Ka()},!0,Y);Y=null}else if("organic"==fa||"auto"==fa&&ka.length>A.length){k.view.validate();var ab=new mxFastOrganicLayout(k);ab.forceConstant=3*S;ab.disableEdgeStyle=!1;ab.resetEdges=!1;var ub=ab.isVertexIgnored;ab.isVertexIgnored=function(Qa){return ub.apply(this,arguments)||0>mxUtils.indexOf(A,Qa)};this.executeLayout(function(){ab.execute(k.getDefaultParent());Ka()},!0,Y);Y=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=Y&&Y()}}catch(Qa){this.handleError(Qa)}};EditorUi.prototype.getSearch=function(c){var d="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",m;for(m in urlParams)0>mxUtils.indexOf(c,m)&&null!=urlParams[m]&&(d+=k+m+"="+urlParams[m],k="&")}else d=window.location.search;return d};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var d=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(" "),m;for(m in urlParams)0>mxUtils.indexOf(k,m)&&(c=0==d?c+"?":c+"&",null!=urlParams[m]&&(c+=m+"="+urlParams[m],d++))}return c};EditorUi.prototype.showLinkDialog=function(c,d,k,m,t){c=new LinkDialog(this,c,d,k,!0,m,t);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var d=1;null==this.drive&&"function"!==typeof window.DriveClient||d++;null==this.dropbox&&"function"!==typeof window.DropboxClient||d++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||d++;null!=this.m365&&d++;null!=this.gitHub&&d++;null!=this.gitLab&&d++;c&&isLocalStorage&&"1"==urlParams.browser&&d++;return d};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),d=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(d);@@ -13694,85 +13706,85 @@ t);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosavek.image&&0<k.cells.length);this.actions.get("crop").setEnabled(m&&k.image&&0<k.cells.length);this.actions.get("pageSetup").setEnabled(m);this.actions.get("shadowVisible").setEnabled(m);this.actions.get("connectionArrows").setEnabled(m);this.actions.get("connectionPoints").setEnabled(m);this.actions.get("copyStyle").setEnabled(m&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&m&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length);this.actions.get("addToScratchpad").setEnabled(0<k.cells.length);this.actions.get("createShape").setEnabled(m);this.actions.get("createRevision").setEnabled(m);this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(m&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=d&&d.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=d);this.actions.get("properties").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());-d=this.actions.get("findReplace");d.setEnabled("none"!=this.diagramContainer.style.display);d.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(m&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var M=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);M.apply(this,arguments)};-null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,d,k,m,t,v,A,C){var E=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(d,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(d,"svg",mxUtils.getXml(E.getSvg(m,t,v)),"image/svg+xml");else{var D=c.getFileData(!0,null,null,null,null,!0),U=E.getGraphBounds(),T=Math.floor(U.width*t/E.view.scale),V=Math.floor(U.height*t/E.view.scale);-if(D.length<=MAX_REQUEST_SIZE&&T*V<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var n={globalVars:E.getExportVariables()};C&&(n.grid={size:E.gridSize,steps:E.view.gridSteps,color:E.view.gridColor});c.saveRequest(d,k,function(u,G){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(G||"0")+(null!=u?"&filename="+encodeURIComponent(u):"")+"&extras="+encodeURIComponent(JSON.stringify(n))+(0<A?"&dpi="+A:"")+"&bg="+(null!=m?m:"none")+"&w="+T+"&h="+V+"&border="+-v+"&xml="+encodeURIComponent(D))})}else"png"==k?c.exportImage(t,null==m||"none"==m,!0,!1,!1,v,!0,!1,null,C,A):c.exportImage(t,!1,!0,!1,!1,v,!0,!1,"jpeg",C);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,d="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var m=c;this.currentPage!=this.pages[k]&&(m=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),+d=this.actions.get("findReplace");d.setEnabled("none"!=this.diagramContainer.style.display);d.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(m&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var O=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);O.apply(this,arguments)};+null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,d,k,m,t,u,A,B){var D=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(d,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(d,"svg",mxUtils.getXml(D.getSvg(m,t,u)),"image/svg+xml");else{var N=c.getFileData(!0,null,null,null,null,!0),F=D.getGraphBounds(),U=Math.floor(F.width*t/D.view.scale),V=Math.floor(F.height*t/D.view.scale);+if(N.length<=MAX_REQUEST_SIZE&&U*V<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var n={globalVars:D.getExportVariables()};B&&(n.grid={size:D.gridSize,steps:D.view.gridSteps,color:D.view.gridColor});c.saveRequest(d,k,function(v,G){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(G||"0")+(null!=v?"&filename="+encodeURIComponent(v):"")+"&extras="+encodeURIComponent(JSON.stringify(n))+(0<A?"&dpi="+A:"")+"&bg="+(null!=m?m:"none")+"&w="+U+"&h="+V+"&border="++u+"&xml="+encodeURIComponent(N))})}else"png"==k?c.exportImage(t,null==m||"none"==m,!0,!1,!1,u,!0,!1,null,B,A):c.exportImage(t,!1,!0,!1,!1,u,!0,!1,"jpeg",B);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,d="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var m=c;this.currentPage!=this.pages[k]&&(m=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),m.model.setRoot(this.pages[k].root));d+=this.pages[k].getName()+" "+m.getIndexableText()+" "}else d=c.getIndexableText();this.editor.graph.setEnabled(!0);return d};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var d={},k=document.createElement("div");k.style.whiteSpace="nowrap";var m=document.createElement("h3");mxUtils.write(m,mxUtils.htmlEntities(c));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(m);var t=document.createElement("div");t.style.cssText=-"border:1px solid lightGray;overflow: auto;height:300px";t.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var v={};try{var A=mxSettings.getCustomLibraries();for(c=0;c<A.length;c++){var C=A[c];if("R"==C.substring(0,1)){var E=JSON.parse(decodeURIComponent(C.substring(1)));v[E[0]]={id:E[0],title:E[1],downloadUrl:E[2]}}}}catch(D){}this.remoteInvoke("getCustomLibraries",null,null,function(D){t.innerText="";if(0==D.length)t.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+-mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var U=0;U<D.length;U++){var T=D[U];v[T.id]&&(d[T.id]=T);var V=this.addCheckbox(t,T.title,v[T.id]);(function(n,u){mxEvent.addListener(u,"change",function(){this.checked?d[n.id]=n:delete d[n.id]})})(T,V)}},mxUtils.bind(this,function(D){t.innerText="";var U=document.createElement("div");U.style.padding="8px";U.style.textAlign="center";mxUtils.write(U,mxResources.get("error")+": ");mxUtils.write(U,null!=D&&null!=D.message?D.message:-mxResources.get("unknownError"));t.appendChild(U)}));k.appendChild(t);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var D=0,U;for(U in d)null==v[U]&&(D++,mxUtils.bind(this,function(T){this.remoteInvoke("getFileContent",[T.downloadUrl],null,mxUtils.bind(this,function(V){D--;0==D&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,V,T)),this.showSidebar()}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}}),-mxUtils.bind(this,function(){D--;0==D&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(d[U]));for(U in v)d[U]||this.closeLibrary(new RemoteLibrary(this,null,v[U]));0==D&&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"]},+"border:1px solid lightGray;overflow: auto;height:300px";t.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 B=A[c];if("R"==B.substring(0,1)){var D=JSON.parse(decodeURIComponent(B.substring(1)));u[D[0]]={id:D[0],title:D[1],downloadUrl:D[2]}}}}catch(N){}this.remoteInvoke("getCustomLibraries",null,null,function(N){t.innerText="";if(0==N.length)t.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'++mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var F=0;F<N.length;F++){var U=N[F];u[U.id]&&(d[U.id]=U);var V=this.addCheckbox(t,U.title,u[U.id]);(function(n,v){mxEvent.addListener(v,"change",function(){this.checked?d[n.id]=n:delete d[n.id]})})(U,V)}},mxUtils.bind(this,function(N){t.innerText="";var F=document.createElement("div");F.style.padding="8px";F.style.textAlign="center";mxUtils.write(F,mxResources.get("error")+": ");mxUtils.write(F,null!=N&&null!=N.message?N.message:+mxResources.get("unknownError"));t.appendChild(F)}));k.appendChild(t);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var N=0,F;for(F in d)null==u[F]&&(N++,mxUtils.bind(this,function(U){this.remoteInvoke("getFileContent",[U.downloadUrl],null,mxUtils.bind(this,function(V){N--;0==N&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,V,U)),this.showSidebar()}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}}),+mxUtils.bind(this,function(){N--;0==N&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(d[F]));for(F in u)d[F]||this.closeLibrary(new RemoteLibrary(this,null,u[F]));0==N&&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 d=0;d<this.remoteInvokeQueue.length;d++)c.postMessage(this.remoteInvokeQueue[d],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var d=c.msgMarkers,k=this.remoteInvokeCallbacks[d.callbackId];-if(null==k)throw Error("No callback for "+(null!=d?d.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[d.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,d,k,m,t){var v=!0,A=window.setTimeout(mxUtils.bind(this,function(){v=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),C=mxUtils.bind(this,function(){window.clearTimeout(A);v&&m.apply(this,arguments)}),E=mxUtils.bind(this,-function(){window.clearTimeout(A);v&&t.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:C,error:E});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:d,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,d){var k=mxUtils.bind(this,function(D,U){var T={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=U?-T.error={errResp:U}:null!=D&&(T.resp=D);this.remoteWin.postMessage(JSON.stringify(T),"*")});try{var m=c.funtionName,t=this.remoteInvokableFns[m];if(null!=t&&"function"===typeof this[m]){if(t.allowedDomains){for(var v=!1,A=0;A<t.allowedDomains.length;A++)if(d=="https://"+t.allowedDomains[A]){v=!0;break}if(!v){k(null,"Invalid Call: "+m+" is not allowed.");return}}var C=c.functionArgs;Array.isArray(C)||(C=[]);if(t.isAsync)C.push(function(){k(Array.prototype.slice.apply(arguments))}),C.push(function(D){k(null,-D||"Unkown Error")}),this[m].apply(this,C);else{var E=this[m].apply(this,C);k([E])}}else k(null,"Invalid Call: "+m+" is not found.")}catch(D){k(null,"Invalid Call: An error occurred, "+D.message)}};EditorUi.prototype.openDatabase=function(c,d){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var m=k.open("database",2);m.onupgradeneeded=function(t){try{var v=m.result;1>t.oldVersion&&v.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&-(v.createObjectStore("files",{keyPath:"title"}),v.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(A){null!=d&&d(A)}};m.onsuccess=mxUtils.bind(this,function(t){try{var v=m.result;this.database=v;EditorUi.migrateStorageFiles&&(StorageFile.migrate(v),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)&&"1"==urlParams.forceMigration){var C=document.createElement("iframe");C.style.display="none";C.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(C);var E=!0,D=!1,U,T=0,V=mxUtils.bind(this,function(){D=!0;this.setDatabaseItem(".drawioMigrated3",!0);C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),n=mxUtils.bind(this,function(){T++;u()}),-u=mxUtils.bind(this,function(){try{if(T>=U.length)V();else{var H=U[T];StorageFile.getFileContent(this,H,mxUtils.bind(this,function(I){null==I||".scratchpad"==H&&I==this.emptyLibraryXml?C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[H]}),"*"):n()}),n)}}catch(I){console.log(I)}}),G=mxUtils.bind(this,function(H){try{this.setDatabaseItem(null,[{title:H.title,size:H.data.length,lastModified:Date.now(),type:H.isLib?"L":"F"},{title:H.title,-data:H.data}],n,n,["filesInfo","files"])}catch(I){console.log(I)}});A=mxUtils.bind(this,function(H){try{if(H.source==C.contentWindow){var I={};try{I=JSON.parse(H.data)}catch(g){}"init"==I.event?(C.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=I.event||D||(E?null!=I.resp&&0<I.resp.length&&null!=I.resp[0]?(U=I.resp[0],E=!1,u()):V():null!=-I.resp&&0<I.resp.length&&null!=I.resp[0]?G(I.resp[0]):n())}}catch(g){console.log(g)}});window.addEventListener("message",A)}})));c(v);v.onversionchange=function(){v.close()}}catch(A){null!=d?d(A):null!=window.console&&console.warn(A)}});m.onerror=d;m.onblocked=function(){}}catch(t){null!=d?d(t):null!=window.console&&console.error(t)}else null!=d&&d(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,d,k,m,t){this.openDatabase(mxUtils.bind(this,function(v){try{t=-t||"objects";Array.isArray(t)||(t=[t],c=[c],d=[d]);var A=v.transaction(t,"readwrite");A.oncomplete=k;A.onerror=m;for(v=0;v<t.length;v++)A.objectStore(t[v]).put(null!=c&&null!=c[v]?{key:c[v],data:d[v]}:d[v])}catch(C){null!=m&&m(C)}}),m)};EditorUi.prototype.removeDatabaseItem=function(c,d,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";Array.isArray(m)||(m=[m],c=[c]);var v=t.transaction(m,"readwrite");v.oncomplete=d;v.onerror=k;for(t=0;t<m.length;t++)v.objectStore(m[t]).delete(c[t])}catch(A){null!=-k&&k(A)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,d,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";var v=t.transaction([m],"readonly").objectStore(m).get(c);v.onsuccess=function(){d(v.result)};v.onerror=k}catch(A){null!=k&&k(A)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,d,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),v=[];t.onsuccess=function(A){null==-A.target.result?c(v):(v.push(A.target.result.value),A.target.result.continue())};t.onerror=d}catch(A){null!=d&&d(A)}}),d)};EditorUi.prototype.getDatabaseItemKeys=function(c,d,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).getAllKeys();t.onsuccess=function(){c(t.result)};t.onerror=d}catch(v){null!=d&&d(v)}}),d)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};+if(null==k)throw Error("No callback for "+(null!=d?d.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[d.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,d,k,m,t){var u=!0,A=window.setTimeout(mxUtils.bind(this,function(){u=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),B=mxUtils.bind(this,function(){window.clearTimeout(A);u&&m.apply(this,arguments)}),D=mxUtils.bind(this,+function(){window.clearTimeout(A);u&&t.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:B,error:D});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:d,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,d){var k=mxUtils.bind(this,function(N,F){var U={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=F?+U.error={errResp:F}:null!=N&&(U.resp=N);this.remoteWin.postMessage(JSON.stringify(U),"*")});try{var m=c.funtionName,t=this.remoteInvokableFns[m];if(null!=t&&"function"===typeof this[m]){if(t.allowedDomains){for(var u=!1,A=0;A<t.allowedDomains.length;A++)if(d=="https://"+t.allowedDomains[A]){u=!0;break}if(!u){k(null,"Invalid Call: "+m+" is not allowed.");return}}var B=c.functionArgs;Array.isArray(B)||(B=[]);if(t.isAsync)B.push(function(){k(Array.prototype.slice.apply(arguments))}),B.push(function(N){k(null,+N||"Unkown Error")}),this[m].apply(this,B);else{var D=this[m].apply(this,B);k([D])}}else k(null,"Invalid Call: "+m+" is not found.")}catch(N){k(null,"Invalid Call: An error occurred, "+N.message)}};EditorUi.prototype.openDatabase=function(c,d){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var m=k.open("database",2);m.onupgradeneeded=function(t){try{var u=m.result;1>t.oldVersion&&u.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&+(u.createObjectStore("files",{keyPath:"title"}),u.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(A){null!=d&&d(A)}};m.onsuccess=mxUtils.bind(this,function(t){try{var u=m.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)&&"1"==urlParams.forceMigration){var B=document.createElement("iframe");B.style.display="none";B.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(B);var D=!0,N=!1,F,U=0,V=mxUtils.bind(this,function(){N=!0;this.setDatabaseItem(".drawioMigrated3",!0);B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),n=mxUtils.bind(this,function(){U++;v()}),+v=mxUtils.bind(this,function(){try{if(U>=F.length)V();else{var H=F[U];StorageFile.getFileContent(this,H,mxUtils.bind(this,function(I){null==I||".scratchpad"==H&&I==this.emptyLibraryXml?B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[H]}),"*"):n()}),n)}}catch(I){console.log(I)}}),G=mxUtils.bind(this,function(H){try{this.setDatabaseItem(null,[{title:H.title,size:H.data.length,lastModified:Date.now(),type:H.isLib?"L":"F"},{title:H.title,+data:H.data}],n,n,["filesInfo","files"])}catch(I){console.log(I)}});A=mxUtils.bind(this,function(H){try{if(H.source==B.contentWindow){var I={};try{I=JSON.parse(H.data)}catch(g){}"init"==I.event?(B.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=I.event||N||(D?null!=I.resp&&0<I.resp.length&&null!=I.resp[0]?(F=I.resp[0],D=!1,v()):V():null!=+I.resp&&0<I.resp.length&&null!=I.resp[0]?G(I.resp[0]):n())}}catch(g){console.log(g)}});window.addEventListener("message",A)}})));c(u);u.onversionchange=function(){u.close()}}catch(A){null!=d?d(A):null!=window.console&&console.warn(A)}});m.onerror=d;m.onblocked=function(){}}catch(t){null!=d?d(t):null!=window.console&&console.error(t)}else null!=d&&d(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,d,k,m,t){this.openDatabase(mxUtils.bind(this,function(u){try{t=+t||"objects";Array.isArray(t)||(t=[t],c=[c],d=[d]);var A=u.transaction(t,"readwrite");A.oncomplete=k;A.onerror=m;for(u=0;u<t.length;u++)A.objectStore(t[u]).put(null!=c&&null!=c[u]?{key:c[u],data:d[u]}:d[u])}catch(B){null!=m&&m(B)}}),m)};EditorUi.prototype.removeDatabaseItem=function(c,d,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";Array.isArray(m)||(m=[m],c=[c]);var u=t.transaction(m,"readwrite");u.oncomplete=d;u.onerror=k;for(t=0;t<m.length;t++)u.objectStore(m[t]).delete(c[t])}catch(A){null!=+k&&k(A)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,d,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";var u=t.transaction([m],"readonly").objectStore(m).get(c);u.onsuccess=function(){d(u.result)};u.onerror=k}catch(A){null!=k&&k(A)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,d,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),u=[];t.onsuccess=function(A){null==+A.target.result?c(u):(u.push(A.target.result.value),A.target.result.continue())};t.onerror=d}catch(A){null!=d&&d(A)}}),d)};EditorUi.prototype.getDatabaseItemKeys=function(c,d,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).getAllKeys();t.onsuccess=function(){c(t.result)};t.onerror=d}catch(u){null!=d&&d(u)}}),d)};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,d){var k=this.getCurrentFile();null!=k?k.getComments(c,d):c([])};EditorUi.prototype.addComment=function(c,d,k){var m=this.getCurrentFile();null!=m?m.addComment(c,d,k):d(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,d){var k=this.getCurrentFile();return null!=k?k.newComment(c,d):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,d)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,d){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,d):d({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.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=-function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,d,k,m,t,v,A,C){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,d,k,m,t,v,A,C)};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,d){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,d)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,d,k,m,t,v,A,C,E,D,U,T,V,n,u,G){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,d,k,m,t,v,A,C,E,D,U,T,V,n,u,G)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");+function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,d,k,m,t,u,A,B){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,d,k,m,t,u,A,B)};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,d){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,d)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,d,k,m,t,u,A,B,D,N,F,U,V,n,v,G){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,d,k,m,t,u,A,B,D,N,F,U,V,n,v,G)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,d,k,m){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,d,k,m)};EditorUi.prototype.convertImageToDataUri=function(c,d){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,d)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,d,k,m){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,d,k,m)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,d,k,m,t){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,d,k,m,t)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],d=0;d<localStorage.length;d++){var k=localStorage.key(d),m=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<m.length){var t="<mxfile "===m.substring(0,8)||"<?xml"===m.substring(0,5)||"\x3c!--[if IE]>"===m.substring(0,12);m="<mxlibrary>"===m.substring(0,11);(t||m)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var d=localStorage.getItem(c);return{title:c,data:d,isLib:"<mxlibrary>"===d.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,l,p,f,x,z){function y(){for(var u=A.getElementsByTagName("div"),G=0,H=0;H<u.length;H++)"none"!=u[H].style.display&&u[H].parentNode==A&&G++;C.style.display=0==G?"block":"none"}function F(u,G,H,I){function g(){G.removeChild(J);G.removeChild(Q);B.style.display="block";q.style.display="block"}m={div:G,comment:u,saveCallback:H,deleteOnCancel:I};var q=G.querySelector(".geCommentTxt"),B=G.querySelector(".geCommentActionsList"),J=document.createElement("textarea");J.className=-"geCommentEditTxtArea";J.style.minHeight=q.offsetHeight+"px";J.value=u.content;G.insertBefore(J,q);var Q=document.createElement("div");Q.className="geCommentEditBtns";var N=mxUtils.button(mxResources.get("cancel"),function(){I?(G.parentNode.removeChild(G),y()):g();m=null});N.className="geCommentEditBtn";Q.appendChild(N);var S=mxUtils.button(mxResources.get("save"),function(){q.innerText="";u.content=J.value;mxUtils.write(q,u.content);g();H(u);m=null});mxEvent.addListener(J,"keydown",mxUtils.bind(this,-function(P){mxEvent.isConsumed(P)||((mxEvent.isControlDown(P)||mxClient.IS_MAC&&mxEvent.isMetaDown(P))&&13==P.keyCode?(S.click(),mxEvent.consume(P)):27==P.keyCode&&(N.click(),mxEvent.consume(P)))}));S.focus();S.className="geCommentEditBtn gePrimaryBtn";Q.appendChild(S);G.insertBefore(Q,q);B.style.display="none";q.style.display="none";J.focus()}function O(u,G){G.innerText="";u=new Date(u.modifiedDate);var H=b.timeSince(u);null==H&&(H=mxResources.get("lessThanAMinute"));mxUtils.write(G,mxResources.get("timeAgo",-[H],"{1} ago"));G.setAttribute("title",u.toLocaleDateString()+" "+u.toLocaleTimeString())}function K(u){var G=document.createElement("img");G.className="geCommentBusyImg";G.src=IMAGE_PATH+"/spin.gif";u.appendChild(G);u.busyImg=G}function L(u){u.style.border="1px solid red";u.busyImg.parentNode==u&&u.removeChild(u.busyImg)}function M(u){u.style.border="";u.busyImg.parentNode==u&&u.removeChild(u.busyImg)}function c(u,G,H,I,g){function q(W,X,Y){var aa=document.createElement("li");aa.className="geCommentAction";-var ba=document.createElement("a");ba.className="geCommentActionLnk";mxUtils.write(ba,W);aa.appendChild(ba);mxEvent.addListener(ba,"click",function(fa){X(fa,u);fa.preventDefault();mxEvent.consume(fa)});R.appendChild(aa);Y&&(aa.style.display="none")}function B(){function W(aa){X.push(Y);if(null!=aa.replies)for(var ba=0;ba<aa.replies.length;ba++)Y=Y.nextSibling,W(aa.replies[ba])}var X=[],Y=Q;W(u);return{pdiv:Y,replies:X}}function J(W,X,Y,aa,ba){function fa(){K(qa);u.addReply(ma,function(na){ma.id=na;-u.replies.push(ma);M(qa);Y&&Y()},function(na){ia();L(qa);b.handleError(na,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},aa,ba)}function ia(){F(ma,qa,function(na){fa()},!0)}var ea=B().pdiv,ma=b.newComment(W,b.getCurrentUser());ma.pCommentId=u.id;null==u.replies&&(u.replies=[]);var qa=c(ma,u.replies,ea,I+1);X?ia():fa()}if(g||!u.isResolved){C.style.display="none";var Q=document.createElement("div");Q.className="geCommentContainer";Q.setAttribute("data-commentId",u.id);Q.style.marginLeft=-20*I+5+"px";u.isResolved&&(t.style.opacity="0.7");var N=document.createElement("div");N.className="geCommentHeader";var S=document.createElement("img");S.className="geCommentUserImg";S.src=null!=u.user&&null!=u.user.pictureUrl?u.user.pictureUrl:Editor.userImage;N.appendChild(S);S=document.createElement("div");S.className="geCommentHeaderTxt";N.appendChild(S);var P=document.createElement("div");P.className="geCommentUsername";mxUtils.write(P,null!=u.user?u.user.displayName:mxResources.get("unknownUser"));-S.appendChild(P);P=document.createElement("div");P.className="geCommentDate";P.setAttribute("data-commentId",u.id);O(u,P);S.appendChild(P);Q.appendChild(N);N=document.createElement("div");N.className="geCommentTxt";mxUtils.write(N,u.content||"");Q.appendChild(N);u.isLocked&&(Q.style.opacity="0.5");N=document.createElement("div");N.className="geCommentActions";var R=document.createElement("ul");R.className="geCommentActionsList";N.appendChild(R);d||u.isLocked||0!=I&&!k||q(mxResources.get("reply"),-function(){J("",!0)},u.isResolved);S=b.getCurrentUser();null==S||null==u.user||S.id!=u.user.id||d||u.isLocked||(q(mxResources.get("edit"),function(){function W(){F(u,Q,function(){K(Q);u.editComment(u.content,function(){M(Q)},function(X){L(Q);W();b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}W()},u.isResolved),q(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){K(Q);u.deleteComment(function(W){if(!0===W){W=Q.querySelector(".geCommentTxt");-W.innerText="";mxUtils.write(W,mxResources.get("msgDeleted"));var X=Q.querySelectorAll(".geCommentAction");for(W=0;W<X.length;W++)X[W].parentNode.removeChild(X[W]);M(Q);Q.style.opacity="0.5"}else{X=B(u).replies;for(W=0;W<X.length;W++)A.removeChild(X[W]);for(W=0;W<G.length;W++)if(G[W]==u){G.splice(W,1);break}C.style.display=0==A.getElementsByTagName("div").length?"block":"none"}},function(W){L(Q);b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},u.isResolved));-d||u.isLocked||0!=I||q(u.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(W){function X(){var Y=W.target;Y.innerText="";u.isResolved=!u.isResolved;mxUtils.write(Y,u.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var aa=u.isResolved?"none":"",ba=B(u).replies,fa="light-dark("+(u.isResolved?"ghostWhite":"white")+", transparent)",ia=0;ia<ba.length;ia++){ba[ia].style.backgroundColor=fa;for(var ea=ba[ia].querySelectorAll(".geCommentAction"),ma=0;ma<ea.length;ma++)ea[ma]!=-Y.parentNode&&(ea[ma].style.display=aa);T||(ba[ia].style.display="none")}y()}u.isResolved?J(mxResources.get("reOpened")+": ",!0,X,!1,!0):J(mxResources.get("markedAsResolved"),!1,X,!0)});Q.appendChild(N);null!=H?A.insertBefore(Q,H.nextSibling):A.appendChild(Q);for(H=0;null!=u.replies&&H<u.replies.length;H++)N=u.replies[H],N.isResolved=u.isResolved,c(N,u.replies,null,I+1,g);null!=m&&(m.comment.id==u.id?(g=u.content,u.content=m.comment.content,F(u,Q,m.saveCallback,m.deleteOnCancel),u.content=g):null==-m.comment.id&&m.comment.pCommentId==u.id&&(A.appendChild(m.div),F(m.comment,m.div,m.saveCallback,m.deleteOnCancel)));return Q}}var d=!b.canComment(),k=b.canReplyToReplies(),m=null,t=document.createElement("div");t.className="geCommentsWin";var v=EditorUi.compactUi?"26px":"30px",A=document.createElement("div");A.className="geCommentsList";A.style.bottom=parseInt(v)+7+"px";t.appendChild(A);var C=document.createElement("span");C.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(C,-mxResources.get("noCommentsFound"));var E=document.createElement("div");E.className="geToolbarContainer geCommentsToolbar";E.style.height=v;E.style.padding="3px 4px 4px 4px";v=document.createElement("a");v.className="geButton";if(!d){var D=v.cloneNode();D.style.backgroundImage="url("+Editor.plusImage+")";D.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(D,"click",function(u){function G(){F(H,I,function(g){K(I);b.addComment(g,function(q){g.id=q;V.push(g);M(I)},function(q){L(I);-G();b.handleError(q,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var H=b.newComment("",b.getCurrentUser()),I=c(H,V,null,0);G();u.preventDefault();mxEvent.consume(u)});E.appendChild(D)}var U=v.cloneNode();U.style.backgroundImage="url("+Editor.checkImage+")";U.setAttribute("title",mxResources.get("showResolved"));var T=!1;mxEvent.addListener(U,"click",function(u){(T=!T)?U.classList.add("geActiveItem"):U.classList.remove("geActiveItem");n();u.preventDefault();mxEvent.consume(u)});-E.appendChild(U);b.commentsRefreshNeeded()&&(D=v.cloneNode(),D.style.backgroundImage="url("+Editor.refreshImage+")",D.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(D,"click",function(u){n();u.preventDefault();mxEvent.consume(u)}),E.appendChild(D));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(u){z();u.preventDefault();mxEvent.consume(u)}),E.appendChild(v));t.appendChild(E);var V=[],n=mxUtils.bind(this,function(){this.hasError=!1;if(null!=m)try{m.div=m.div.cloneNode(!0);var u=m.div.querySelector(".geCommentEditTxtArea"),G=m.div.querySelector(".geCommentEditBtns");m.comment.content=u.value;u.parentNode.removeChild(u);G.parentNode.removeChild(G)}catch(H){b.handleError(H)}A.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+-mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";k=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(H){function I(g){if(null!=g){g.sort(function(B,J){return new Date(B.modifiedDate)-new Date(J.modifiedDate)});for(var q=0;q<g.length;q++)I(g[q].replies)}}H.sort(function(g,q){return new Date(g.modifiedDate)-new Date(q.modifiedDate)});A.innerText="";A.appendChild(C);C.style.display="block";V=H;for(H=0;H<V.length;H++)I(V[H].replies),c(V[H],V,null,0,T);null!=m&&null==m.comment.id&&-null==m.comment.pCommentId&&(A.appendChild(m.div),F(m.comment,m.div,m.saveCallback,m.deleteOnCancel))},mxUtils.bind(this,function(H){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(H&&H.message?": "+H.message:""));this.hasError=!0})):A.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});n();this.refreshComments=n;E=mxUtils.bind(this,function(){function u(q){var B=H[q.id];if(null!=B)for(O(q,B),B=0;null!=q.replies&&B<q.replies.length;B++)u(q.replies[B])}if(this.window.isVisible()){for(var G=-A.querySelectorAll(".geCommentDate"),H={},I=0;I<G.length;I++){var g=G[I];H[g.getAttribute("data-commentId")]=g}for(I=0;I<V.length;I++)u(V[I])}});setInterval(E,6E4);this.refreshCommentsTime=E;this.window=new mxWindow(mxResources.get("comments"),t,l,p,f,x,!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,l,p,f,x,z,y,F,O,K,L){var M=document.createElement("div");M.style.textAlign="center";L=null!=L?L:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=L+"px";c.style.lineHeight="1.2em";mxUtils.write(c,l);M.appendChild(c);null!=K&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",l=document.createElement("img"),l.setAttribute("src",K),c.appendChild(l),-M.appendChild(c));K=document.createElement("div");K.style.textAlign="center";K.style.whiteSpace="nowrap";var d=document.createElement("input");d.setAttribute("type","checkbox");z=mxUtils.button(z||mxResources.get("cancel"),function(){b.hideDialog();null!=f&&f(d.checked)});z.className="geBtn";null!=F&&(z.innerHTML=F+"<br>"+z.innerHTML,z.style.display="inline-block",z.style.paddingBottom="8px",z.style.paddingTop="8px",z.style.height="auto",z.style.width="40%");b.editor.cancelFirst&&K.appendChild(z);-var k=mxUtils.button(x||mxResources.get("ok"),function(){b.hideDialog();null!=p&&p(d.checked)});K.appendChild(k);null!=y?(k.innerHTML=y+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height="auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||K.appendChild(z);M.appendChild(K);O?(K.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom=-"0px",c.appendChild(d),x=document.createElement("span"),mxUtils.write(x," "+mxResources.get("rememberThisSetting")),c.appendChild(x),M.appendChild(c),mxEvent.addListener(x,"click",function(m){d.checked=!d.checked;mxEvent.consume(m)})):K.style.marginTop="12px";this.init=function(){k.focus()};this.container=M},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};+var CommentsWindow=function(b,l,p,f,x,z){function y(){for(var v=A.getElementsByTagName("div"),G=0,H=0;H<v.length;H++)"none"!=v[H].style.display&&v[H].parentNode==A&&G++;B.style.display=0==G?"block":"none"}function E(v,G,H,I){function g(){G.removeChild(J);G.removeChild(M);C.style.display="block";q.style.display="block"}m={div:G,comment:v,saveCallback:H,deleteOnCancel:I};var q=G.querySelector(".geCommentTxt"),C=G.querySelector(".geCommentActionsList"),J=document.createElement("textarea");J.className=+"geCommentEditTxtArea";J.style.minHeight=q.offsetHeight+"px";J.value=v.content;G.insertBefore(J,q);var M=document.createElement("div");M.className="geCommentEditBtns";var Q=mxUtils.button(mxResources.get("cancel"),function(){I?(G.parentNode.removeChild(G),y()):g();m=null});Q.className="geCommentEditBtn";M.appendChild(Q);var T=mxUtils.button(mxResources.get("save"),function(){q.innerText="";v.content=J.value;mxUtils.write(q,v.content);g();H(v);m=null});mxEvent.addListener(J,"keydown",mxUtils.bind(this,+function(P){mxEvent.isConsumed(P)||((mxEvent.isControlDown(P)||mxClient.IS_MAC&&mxEvent.isMetaDown(P))&&13==P.keyCode?(T.click(),mxEvent.consume(P)):27==P.keyCode&&(Q.click(),mxEvent.consume(P)))}));T.focus();T.className="geCommentEditBtn gePrimaryBtn";M.appendChild(T);G.insertBefore(M,q);C.style.display="none";q.style.display="none";J.focus()}function R(v,G){G.innerText="";v=new Date(v.modifiedDate);var H=b.timeSince(v);null==H&&(H=mxResources.get("lessThanAMinute"));mxUtils.write(G,mxResources.get("timeAgo",+[H],"{1} ago"));G.setAttribute("title",v.toLocaleDateString()+" "+v.toLocaleTimeString())}function K(v){var G=document.createElement("img");G.className="geCommentBusyImg";G.src=IMAGE_PATH+"/spin.gif";v.appendChild(G);v.busyImg=G}function L(v){v.style.border="1px solid red";v.busyImg.parentNode==v&&v.removeChild(v.busyImg)}function O(v){v.style.border="";v.busyImg.parentNode==v&&v.removeChild(v.busyImg)}function c(v,G,H,I,g){function q(W,X,Y){var Z=document.createElement("li");Z.className="geCommentAction";+var aa=document.createElement("a");aa.className="geCommentActionLnk";mxUtils.write(aa,W);Z.appendChild(aa);mxEvent.addListener(aa,"click",function(ha){X(ha,v);ha.preventDefault();mxEvent.consume(ha)});S.appendChild(Z);Y&&(Z.style.display="none")}function C(){function W(Z){X.push(Y);if(null!=Z.replies)for(var aa=0;aa<Z.replies.length;aa++)Y=Y.nextSibling,W(Z.replies[aa])}var X=[],Y=M;W(v);return{pdiv:Y,replies:X}}function J(W,X,Y,Z,aa){function ha(){K(sa);v.addReply(ma,function(ta){ma.id=ta;v.replies.push(ma);+O(sa);Y&&Y()},function(ta){ja();L(sa);b.handleError(ta,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,aa)}function ja(){E(ma,sa,function(ta){ha()},!0)}var fa=C().pdiv,ma=b.newComment(W,b.getCurrentUser());ma.pCommentId=v.id;null==v.replies&&(v.replies=[]);var sa=c(ma,v.replies,fa,I+1);X?ja():ha()}if(g||!v.isResolved){B.style.display="none";var M=document.createElement("div");M.className="geCommentContainer";M.setAttribute("data-commentId",v.id);M.style.marginLeft=20*I++5+"px";v.isResolved&&(t.style.opacity="0.7");var Q=document.createElement("div");Q.className="geCommentHeader";var T=document.createElement("img");T.className="geCommentUserImg";T.src=null!=v.user&&null!=v.user.pictureUrl?v.user.pictureUrl:Editor.userImage;Q.appendChild(T);T=document.createElement("div");T.className="geCommentHeaderTxt";Q.appendChild(T);var P=document.createElement("div");P.className="geCommentUsername";mxUtils.write(P,null!=v.user?v.user.displayName:mxResources.get("unknownUser"));+T.appendChild(P);P=document.createElement("div");P.className="geCommentDate";P.setAttribute("data-commentId",v.id);R(v,P);T.appendChild(P);M.appendChild(Q);Q=document.createElement("div");Q.className="geCommentTxt";mxUtils.write(Q,v.content||"");M.appendChild(Q);v.isLocked&&(M.style.opacity="0.5");Q=document.createElement("div");Q.className="geCommentActions";var S=document.createElement("ul");S.className="geCommentActionsList";Q.appendChild(S);d||v.isLocked||0!=I&&!k||q(mxResources.get("reply"),+function(){J("",!0)},v.isResolved);T=b.getCurrentUser();null==T||null==v.user||T.id!=v.user.id||d||v.isLocked||(q(mxResources.get("edit"),function(){function W(){E(v,M,function(){K(M);v.editComment(v.content,function(){O(M)},function(X){L(M);W();b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}W()},v.isResolved),q(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){K(M);v.deleteComment(function(W){if(!0===W){W=M.querySelector(".geCommentTxt");+W.innerText="";mxUtils.write(W,mxResources.get("msgDeleted"));var X=M.querySelectorAll(".geCommentAction");for(W=0;W<X.length;W++)X[W].parentNode.removeChild(X[W]);O(M);M.style.opacity="0.5"}else{X=C(v).replies;for(W=0;W<X.length;W++)A.removeChild(X[W]);for(W=0;W<G.length;W++)if(G[W]==v){G.splice(W,1);break}B.style.display=0==A.getElementsByTagName("div").length?"block":"none"}},function(W){L(M);b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},v.isResolved));+d||v.isLocked||0!=I||q(v.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(W){function X(){var Y=W.target;Y.innerText="";v.isResolved=!v.isResolved;mxUtils.write(Y,v.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Z=v.isResolved?"none":"",aa=C(v).replies,ha="light-dark("+(v.isResolved?"ghostWhite":"white")+", transparent)",ja=0;ja<aa.length;ja++){aa[ja].style.backgroundColor=ha;for(var fa=aa[ja].querySelectorAll(".geCommentAction"),ma=0;ma<fa.length;ma++)fa[ma]!=+Y.parentNode&&(fa[ma].style.display=Z);U||(aa[ja].style.display="none")}y()}v.isResolved?J(mxResources.get("reOpened")+": ",!0,X,!1,!0):J(mxResources.get("markedAsResolved"),!1,X,!0)});M.appendChild(Q);null!=H?A.insertBefore(M,H.nextSibling):A.appendChild(M);for(H=0;null!=v.replies&&H<v.replies.length;H++)Q=v.replies[H],Q.isResolved=v.isResolved,c(Q,v.replies,null,I+1,g);null!=m&&(m.comment.id==v.id?(g=v.content,v.content=m.comment.content,E(v,M,m.saveCallback,m.deleteOnCancel),v.content=g):null==+m.comment.id&&m.comment.pCommentId==v.id&&(A.appendChild(m.div),E(m.comment,m.div,m.saveCallback,m.deleteOnCancel)));return M}}var d=!b.canComment(),k=b.canReplyToReplies(),m=null,t=document.createElement("div");t.className="geCommentsWin";var u=EditorUi.compactUi?"26px":"30px",A=document.createElement("div");A.className="geCommentsList";A.style.bottom=parseInt(u)+7+"px";t.appendChild(A);var B=document.createElement("span");B.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(B,+mxResources.get("noCommentsFound"));var D=document.createElement("div");D.className="geToolbarContainer geCommentsToolbar";D.style.height=u;D.style.padding="3px 4px 4px 4px";u=document.createElement("a");u.className="geButton";if(!d){var N=u.cloneNode();N.style.backgroundImage="url("+Editor.plusImage+")";N.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(N,"click",function(v){function G(){E(H,I,function(g){K(I);b.addComment(g,function(q){g.id=q;V.push(g);O(I)},function(q){L(I);+G();b.handleError(q,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var H=b.newComment("",b.getCurrentUser()),I=c(H,V,null,0);G();v.preventDefault();mxEvent.consume(v)});D.appendChild(N)}var F=u.cloneNode();F.style.backgroundImage="url("+Editor.checkImage+")";F.setAttribute("title",mxResources.get("showResolved"));var U=!1;mxEvent.addListener(F,"click",function(v){(U=!U)?F.classList.add("geActiveItem"):F.classList.remove("geActiveItem");n();v.preventDefault();mxEvent.consume(v)});+D.appendChild(F);b.commentsRefreshNeeded()&&(N=u.cloneNode(),N.style.backgroundImage="url("+Editor.refreshImage+")",N.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(N,"click",function(v){n();v.preventDefault();mxEvent.consume(v)}),D.appendChild(N));b.commentsSaveNeeded()&&(u=u.cloneNode(),u.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',u.setAttribute("title",mxResources.get("save")),u.className="geButton geAdaptiveAsset",mxEvent.addListener(u,+"click",function(v){z();v.preventDefault();mxEvent.consume(v)}),D.appendChild(u));t.appendChild(D);var V=[],n=mxUtils.bind(this,function(){this.hasError=!1;if(null!=m)try{m.div=m.div.cloneNode(!0);var v=m.div.querySelector(".geCommentEditTxtArea"),G=m.div.querySelector(".geCommentEditBtns");m.comment.content=v.value;v.parentNode.removeChild(v);G.parentNode.removeChild(G)}catch(H){b.handleError(H)}A.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '++mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";k=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(H){function I(g){if(null!=g){g.sort(function(C,J){return new Date(C.modifiedDate)-new Date(J.modifiedDate)});for(var q=0;q<g.length;q++)I(g[q].replies)}}H.sort(function(g,q){return new Date(g.modifiedDate)-new Date(q.modifiedDate)});A.innerText="";A.appendChild(B);B.style.display="block";V=H;for(H=0;H<V.length;H++)I(V[H].replies),c(V[H],V,null,0,U);null!=m&&null==m.comment.id&&+null==m.comment.pCommentId&&(A.appendChild(m.div),E(m.comment,m.div,m.saveCallback,m.deleteOnCancel))},mxUtils.bind(this,function(H){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(H&&H.message?": "+H.message:""));this.hasError=!0})):A.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});n();this.refreshComments=n;D=mxUtils.bind(this,function(){function v(q){var C=H[q.id];if(null!=C)for(R(q,C),C=0;null!=q.replies&&C<q.replies.length;C++)v(q.replies[C])}if(this.window.isVisible()){for(var G=+A.querySelectorAll(".geCommentDate"),H={},I=0;I<G.length;I++){var g=G[I];H[g.getAttribute("data-commentId")]=g}for(I=0;I<V.length;I++)v(V[I])}});setInterval(D,6E4);this.refreshCommentsTime=D;this.window=new mxWindow(mxResources.get("comments"),t,l,p,f,x,!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,l,p,f,x,z,y,E,R,K,L){var O=document.createElement("div");O.style.textAlign="center";L=null!=L?L:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=L+"px";c.style.lineHeight="1.2em";mxUtils.write(c,l);O.appendChild(c);null!=K&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",l=document.createElement("img"),l.setAttribute("src",K),c.appendChild(l),+O.appendChild(c));K=document.createElement("div");K.style.textAlign="center";K.style.whiteSpace="nowrap";var d=document.createElement("input");d.setAttribute("type","checkbox");z=mxUtils.button(z||mxResources.get("cancel"),function(){b.hideDialog();null!=f&&f(d.checked)});z.className="geBtn";null!=E&&(z.innerHTML=E+"<br>"+z.innerHTML,z.style.display="inline-block",z.style.paddingBottom="8px",z.style.paddingTop="8px",z.style.height="auto",z.style.width="40%");b.editor.cancelFirst&&K.appendChild(z);+var k=mxUtils.button(x||mxResources.get("ok"),function(){b.hideDialog();null!=p&&p(d.checked)});K.appendChild(k);null!=y?(k.innerHTML=y+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height="auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||K.appendChild(z);O.appendChild(K);R?(K.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom=+"0px",c.appendChild(d),x=document.createElement("span"),mxUtils.write(x," "+mxResources.get("rememberThisSetting")),c.appendChild(x),O.appendChild(c),mxEvent.addListener(x,"click",function(m){d.checked=!d.checked;mxEvent.consume(m)})):K.style.marginTop="12px";this.init=function(){k.focus()};this.container=O},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.DIFF_FILE="f";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,l,p,f,x){if(null!=l)for(var z=0;z<l.length;z++)null!=l[z]&&(b=this.patchPages(b,l[z],p,f,x));return b};EditorUi.prototype.patchFileNode=function(b){var l=!1;if(null!=this.fileNode&&null!=b)for(var p=0;p<b.length;p++)if(null!=b[p]&&null!=b[p][EditorUi.DIFF_FILE])for(var f in b[p][EditorUi.DIFF_FILE])l=b[p][EditorUi.DIFF_FILE][f],null!=l?this.fileNode.setAttribute(f,l):this.fileNode.removeAttribute(f),l=!0;return l};-EditorUi.prototype.patchPages=function(b,l,p,f,x){var z={},y=[],F={},O={},K={},L={};if(null!=f&&null!=f[EditorUi.DIFF_UPDATE])for(var M in f[EditorUi.DIFF_UPDATE])z[M]=f[EditorUi.DIFF_UPDATE][M];if(null!=l[EditorUi.DIFF_REMOVE])for(f=0;f<l[EditorUi.DIFF_REMOVE].length;f++)O[l[EditorUi.DIFF_REMOVE][f]]=!0;if(null!=l[EditorUi.DIFF_INSERT])for(f=0;f<l[EditorUi.DIFF_INSERT].length;f++)F[l[EditorUi.DIFF_INSERT][f].previous]=l[EditorUi.DIFF_INSERT][f];if(null!=l[EditorUi.DIFF_UPDATE])for(M in l[EditorUi.DIFF_UPDATE])f=-l[EditorUi.DIFF_UPDATE][M],null!=f.previous&&(L[f.previous]=M);if(null!=b){var c="";for(f=0;f<b.length;f++){var d=b[f].getId();K[d]=b[f];null!=L[c]||O[d]||null!=l[EditorUi.DIFF_UPDATE]&&null!=l[EditorUi.DIFF_UPDATE][d]&&null!=l[EditorUi.DIFF_UPDATE][d].previous||(L[c]=d);c=d}}var k={},m=mxUtils.bind(this,function(v){var A=null!=v?v.getId():"";if(null!=v&&!k[A]){k[A]=!0;y.push(v);var C=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][A]:null;null!=C&&(this.updatePageRoot(v),null!=C.name&&v.setName(C.name),-null!=C.view&&this.patchViewState(v,C.view),null!=C.cells&&this.patchPage(v,C.cells,z[v.getId()],x),!p||null==C.cells&&null==C.view||(v.needsUpdate=!0))}v=L[A];null!=v&&(delete L[A],m(K[v]));v=F[A];null!=v&&(delete F[A],t(v))}),t=mxUtils.bind(this,function(v){v=mxUtils.parseXml(v.data).documentElement;v=new DiagramPage(v);this.updatePageRoot(v);var A=K[v.getId()];null==A?m(v):(this.patchPage(A,this.diffPages([A],[v]),z[A.getId()],x),p&&(A.needsUpdate=!0))});m();for(M in L)m(K[L[M]]),delete L[M];for(M in F)t(F[M]),-delete F[M];return y};EditorUi.prototype.patchViewState=function(b,l){if(null!=b.viewState&&null!=l){b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var p in l)try{this.patchViewStateProperty(b,l,p)}catch(f){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,l,p){b.viewState[p]=JSON.parse(l[p])};-EditorUi.prototype.createParentLookup=function(b,l){function p(K){var L=f[K];null==L&&(L={inserted:[],moved:{}},f[K]=L);return L}var f={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++){var z=l[EditorUi.DIFF_INSERT][x],y=null!=z.parent?z.parent:"",F=null!=z.previous?z.previous:"";p(y).inserted[F]=z}if(null!=l[EditorUi.DIFF_UPDATE])for(var O in l[EditorUi.DIFF_UPDATE])z=l[EditorUi.DIFF_UPDATE][O],null!=z.previous&&(y=z.parent,null==y&&(x=b.getCell(O),null!=x&&(x=-b.getParent(x),null!=x&&(y=x.getId()))),null!=y&&(p(y).moved[z.previous]=O));return f};-EditorUi.prototype.patchPage=function(b,l,p,f){var x=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),z=this.createParentLookup(x,l);x.beginUpdate();try{var y=x.updateEdgeParent,F=new mxDictionary,O=[];x.updateEdgeParent=function(t,v){!F.get(t)&&f&&(F.put(t,!0),O.push(t))};var K=z[""],L=null!=K&&null!=K.inserted?K.inserted[""]:null,M=null;null!=L&&(M=this.getCellForJson(L));if(null==M){var c=null!=K&&null!=K.moved?K.moved[""]:null;null!=c&&(M=x.getCell(c))}null!=M&&(x.setRoot(M),-b.root=M,EditorUi.debug("EditorUi.patchPage: Root changed",M.id));this.patchCellRecursive(b,x,x.root,z,l);if(null!=l[EditorUi.DIFF_REMOVE])for(var d=0;d<l[EditorUi.DIFF_REMOVE].length;d++){c=l[EditorUi.DIFF_REMOVE][d];var k=x.getCell(c);null!=k&&x.remove(k)}if(null!=l[EditorUi.DIFF_UPDATE]){var m=null!=p&&null!=p.cells?p.cells[EditorUi.DIFF_UPDATE]:null;for(c in l[EditorUi.DIFF_UPDATE])k=x.getCell(c),null!=k?this.patchCell(x,k,l[EditorUi.DIFF_UPDATE][c],null!=m?m[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",-c,"diff",[l[EditorUi.DIFF_UPDATE][c]])}if(null!=l[EditorUi.DIFF_INSERT])for(d=0;d<l[EditorUi.DIFF_INSERT].length;d++)L=l[EditorUi.DIFF_INSERT][d],k=x.getCell(L.id),null!=k&&(x.setTerminal(k,x.getCell(L.source),!0),x.setTerminal(k,x.getCell(L.target),!1));x.updateEdgeParent=y;if(f&&0<O.length)for(d=0;d<O.length;d++)x.contains(O[d])&&x.updateEdgeParent(O[d])}finally{x.endUpdate()}};-EditorUi.prototype.patchCellRecursive=function(b,l,p,f,x){if(null!=p){var z=f[p.getId()],y=null!=z&&null!=z.inserted?z.inserted:{};z=null!=z&&null!=z.moved?z.moved:{};for(var F=0,O=l.getChildCount(p),K="",L=0;L<O;L++){var M=l.getChildAt(p,L).getId();null==z[K]&&(null==x[EditorUi.DIFF_UPDATE]||null==x[EditorUi.DIFF_UPDATE][M]||null==x[EditorUi.DIFF_UPDATE][M].previous&&null==x[EditorUi.DIFF_UPDATE][M].parent)&&(z[K]=M);K=M}O=mxUtils.bind(this,function(c,d){var k=null!=c?c.getId():"";null==k&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",-"cell",c);null!=c&&d&&(d=l.getCell(k),null!=d&&d!=c&&(c=null));null!=c&&(l.getChildAt(p,F)!=c&&l.add(p,c,F),this.patchCellRecursive(b,l,c,f,x),F++);return k});for(K=[null];0<K.length;)if(L=K.shift(),L=O(null!=L?L.child:null,null!=L?L.insert:!1),M=z[L],null!=M&&(delete z[L],K.push({child:l.getCell(M)})),M=y[L],null!=M&&(delete y[L],K.push({child:this.getCellForJson(M),insert:!0})),0==K.length){for(L in z)K.push({child:l.getCell(z[L])}),delete z[L];for(L in y)K.push({child:this.getCellForJson(y[L]),+EditorUi.prototype.patchPages=function(b,l,p,f,x){var z={},y=[],E={},R={},K={},L={};if(null!=f&&null!=f[EditorUi.DIFF_UPDATE])for(var O in f[EditorUi.DIFF_UPDATE])z[O]=f[EditorUi.DIFF_UPDATE][O];if(null!=l[EditorUi.DIFF_REMOVE])for(f=0;f<l[EditorUi.DIFF_REMOVE].length;f++)R[l[EditorUi.DIFF_REMOVE][f]]=!0;if(null!=l[EditorUi.DIFF_INSERT])for(f=0;f<l[EditorUi.DIFF_INSERT].length;f++)E[l[EditorUi.DIFF_INSERT][f].previous]=l[EditorUi.DIFF_INSERT][f];if(null!=l[EditorUi.DIFF_UPDATE])for(O in l[EditorUi.DIFF_UPDATE])f=+l[EditorUi.DIFF_UPDATE][O],null!=f.previous&&(L[f.previous]=O);if(null!=b){var c="";for(f=0;f<b.length;f++){var d=b[f].getId();K[d]=b[f];null!=L[c]||R[d]||null!=l[EditorUi.DIFF_UPDATE]&&null!=l[EditorUi.DIFF_UPDATE][d]&&null!=l[EditorUi.DIFF_UPDATE][d].previous||(L[c]=d);c=d}}var k={},m=mxUtils.bind(this,function(u){var A=null!=u?u.getId():"";if(null!=u&&!k[A]){k[A]=!0;y.push(u);var B=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][A]:null;null!=B&&(this.updatePageRoot(u),null!=B.name&&u.setName(B.name),+null!=B.view&&this.patchViewState(u,B.view),null!=B.cells&&this.patchPage(u,B.cells,z[u.getId()],x),!p||null==B.cells&&null==B.view||(u.needsUpdate=!0))}u=L[A];null!=u&&(delete L[A],m(K[u]));u=E[A];null!=u&&(delete E[A],t(u))}),t=mxUtils.bind(this,function(u){u=mxUtils.parseXml(u.data).documentElement;u=new DiagramPage(u);this.updatePageRoot(u);var A=K[u.getId()];null==A?m(u):(this.patchPage(A,this.diffPages([A],[u]),z[A.getId()],x),p&&(A.needsUpdate=!0))});m();for(O in L)m(K[L[O]]),delete L[O];for(O in E)t(E[O]),+delete E[O];return y};EditorUi.prototype.patchViewState=function(b,l){if(null!=b.viewState&&null!=l){b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var p in l)try{this.patchViewStateProperty(b,l,p)}catch(f){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,l,p){b.viewState[p]=JSON.parse(l[p])};+EditorUi.prototype.createParentLookup=function(b,l){function p(K){var L=f[K];null==L&&(L={inserted:[],moved:{}},f[K]=L);return L}var f={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++){var z=l[EditorUi.DIFF_INSERT][x],y=null!=z.parent?z.parent:"",E=null!=z.previous?z.previous:"";p(y).inserted[E]=z}if(null!=l[EditorUi.DIFF_UPDATE])for(var R in l[EditorUi.DIFF_UPDATE])z=l[EditorUi.DIFF_UPDATE][R],null!=z.previous&&(y=z.parent,null==y&&(x=b.getCell(R),null!=x&&(x=+b.getParent(x),null!=x&&(y=x.getId()))),null!=y&&(p(y).moved[z.previous]=R));return f};+EditorUi.prototype.patchPage=function(b,l,p,f){var x=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),z=this.createParentLookup(x,l);x.beginUpdate();try{var y=x.updateEdgeParent,E=new mxDictionary,R=[];x.updateEdgeParent=function(t,u){!E.get(t)&&f&&(E.put(t,!0),R.push(t))};var K=z[""],L=null!=K&&null!=K.inserted?K.inserted[""]:null,O=null;null!=L&&(O=this.getCellForJson(L));if(null==O){var c=null!=K&&null!=K.moved?K.moved[""]:null;null!=c&&(O=x.getCell(c))}null!=O&&(x.setRoot(O),+b.root=O,EditorUi.debug("EditorUi.patchPage: Root changed",O.id));this.patchCellRecursive(b,x,x.root,z,l);if(null!=l[EditorUi.DIFF_REMOVE])for(var d=0;d<l[EditorUi.DIFF_REMOVE].length;d++){c=l[EditorUi.DIFF_REMOVE][d];var k=x.getCell(c);null!=k&&x.remove(k)}if(null!=l[EditorUi.DIFF_UPDATE]){var m=null!=p&&null!=p.cells?p.cells[EditorUi.DIFF_UPDATE]:null;for(c in l[EditorUi.DIFF_UPDATE])k=x.getCell(c),null!=k?this.patchCell(x,k,l[EditorUi.DIFF_UPDATE][c],null!=m?m[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",+c,"diff",[l[EditorUi.DIFF_UPDATE][c]])}if(null!=l[EditorUi.DIFF_INSERT])for(d=0;d<l[EditorUi.DIFF_INSERT].length;d++)L=l[EditorUi.DIFF_INSERT][d],k=x.getCell(L.id),null!=k&&(x.setTerminal(k,x.getCell(L.source),!0),x.setTerminal(k,x.getCell(L.target),!1));x.updateEdgeParent=y;if(f&&0<R.length)for(d=0;d<R.length;d++)x.contains(R[d])&&x.updateEdgeParent(R[d])}finally{x.endUpdate()}};+EditorUi.prototype.patchCellRecursive=function(b,l,p,f,x){if(null!=p){var z=f[p.getId()],y=null!=z&&null!=z.inserted?z.inserted:{};z=null!=z&&null!=z.moved?z.moved:{};for(var E=0,R=l.getChildCount(p),K="",L=0;L<R;L++){var O=l.getChildAt(p,L).getId();null==z[K]&&(null==x[EditorUi.DIFF_UPDATE]||null==x[EditorUi.DIFF_UPDATE][O]||null==x[EditorUi.DIFF_UPDATE][O].previous&&null==x[EditorUi.DIFF_UPDATE][O].parent)&&(z[K]=O);K=O}R=mxUtils.bind(this,function(c,d){var k=null!=c?c.getId():"";null==k&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",+"cell",c);null!=c&&d&&(d=l.getCell(k),null!=d&&d!=c&&(c=null));null!=c&&(l.getChildAt(p,E)!=c&&l.add(p,c,E),this.patchCellRecursive(b,l,c,f,x),E++);return k});for(K=[null];0<K.length;)if(L=K.shift(),L=R(null!=L?L.child:null,null!=L?L.insert:!1),O=z[L],null!=O&&(delete z[L],K.push({child:l.getCell(O)})),O=y[L],null!=O&&(delete y[L],K.push({child:this.getCellForJson(O),insert:!0})),0==K.length){for(L in z)K.push({child:l.getCell(z[L])}),delete z[L];for(L in y)K.push({child:this.getCellForJson(y[L]),insert:!0}),delete y[L]}}};EditorUi.prototype.patchCell=function(b,l,p,f){if(null!=l&&null!=p){if(null==f||null==f.xmlValue&&(null==f.value||""==f.value))"value"in p?b.setValue(l,p.value):null!=p.xmlValue&&b.setValue(l,mxUtils.parseXml(p.xmlValue).documentElement);null!=f&&null!=f.style||null==p.style||b.setStyle(l,p.style);null!=p.visible&&b.setVisible(l,1==p.visible);null!=p.collapsed&&b.setCollapsed(l,1==p.collapsed);null!=p.vertex&&(l.vertex=1==p.vertex);null!=p.edge&&(l.edge=1==p.edge);null!=p.connectable&&(l.connectable=1==p.connectable);null!=p.geometry&&b.setGeometry(l,this.codec.decode(mxUtils.parseXml(p.geometry).documentElement));null!=p.source&&b.setTerminal(l,b.getCell(p.source),!0);null!=p.target&&b.setTerminal(l,b.getCell(p.target),!1);for(var x in p)this.cellProperties[x]||(l[x]=p[x])}};EditorUi.prototype.getXmlForPages=function(b){b=this.getNodeForPages(b);var l=null;null!=b&&(l=mxUtils.getXml(b));return l};EditorUi.prototype.getNodeForPages=function(b){var l=null;if(null!=this.fileNode&&null!=b){l=this.fileNode.cloneNode(!1);for(var p=0;p<b.length;p++){var f=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[p].root));this.editor.graph.saveViewState(b[p].viewState,f);var x=b[p].node.cloneNode(!1);x.appendChild(f);l.appendChild(x)}}return l};EditorUi.prototype.getPagesForXml=function(b){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement)};EditorUi.prototype.getPagesForNode=function(b,l){var p=this.editor.extractGraphModel(b,!0,!0);null!=p&&(b=p);l=b.getElementsByTagName(l||"diagram");p=[];if(0<l.length)for(b=0;b<l.length;b++){var f=new DiagramPage(l[b]);this.updatePageRoot(f,!0);p.push(f)}else"mxGraphModel"==b.nodeName&&(f=new DiagramPage(b.ownerDocument.createElement("diagram")),f.setName(mxResources.get("pageWithNumber",[1])),f.node.appendChild(b.cloneNode(!0)),p.push(f));return p};-EditorUi.prototype.diffPages=function(b,l){var p=[],f=[],x={},z={},y={},F=null;if(null!=b&&null!=l){for(var O=0;O<l.length;O++)z[l[O].getId()]={page:l[O],prev:F},F=l[O];F=null;for(O=0;O<b.length;O++){var K=b[O].getId();l=z[K];if(null==l)f.push(K);else{this.updatePageRoot(b[O]);this.updatePageRoot(l.page);var L=this.diffCells(b[O].root,l.page.root),M={};mxUtils.isEmptyObject(L)||(M.cells=L);L=this.diffViewState(b[O],l.page);mxUtils.isEmptyObject(L)||(M.view=L);if((null!=l.prev?null==F:null!=F)||null!=-F&&null!=l.prev&&F.getId()!=l.prev.getId())M.previous=null!=l.prev?l.prev.getId():"";null!=l.page.getName()&&b[O].getName()!=l.page.getName()&&(M.name=l.page.getName());mxUtils.isEmptyObject(M)||(y[K]=M)}delete z[b[O].getId()];F=b[O]}for(K in z)l=z[K],p.push({id:l.page.getId(),data:mxUtils.getXml(l.page.node),previous:null!=l.prev?l.prev.getId():""});mxUtils.isEmptyObject(y)||(x[EditorUi.DIFF_UPDATE]=y);0<f.length&&(x[EditorUi.DIFF_REMOVE]=f);0<p.length&&(x[EditorUi.DIFF_INSERT]=p)}return x};+EditorUi.prototype.diffPages=function(b,l){var p=[],f=[],x={},z={},y={},E=null;if(null!=b&&null!=l){for(var R=0;R<l.length;R++)z[l[R].getId()]={page:l[R],prev:E},E=l[R];E=null;for(R=0;R<b.length;R++){var K=b[R].getId();l=z[K];if(null==l)f.push(K);else{this.updatePageRoot(b[R]);this.updatePageRoot(l.page);var L=this.diffCells(b[R].root,l.page.root),O={};mxUtils.isEmptyObject(L)||(O.cells=L);L=this.diffViewState(b[R],l.page);mxUtils.isEmptyObject(L)||(O.view=L);if((null!=l.prev?null==E:null!=E)||null!=+E&&null!=l.prev&&E.getId()!=l.prev.getId())O.previous=null!=l.prev?l.prev.getId():"";null!=l.page.getName()&&b[R].getName()!=l.page.getName()&&(O.name=l.page.getName());mxUtils.isEmptyObject(O)||(y[K]=O)}delete z[b[R].getId()];E=b[R]}for(K in z)l=z[K],p.push({id:l.page.getId(),data:mxUtils.getXml(l.page.node),previous:null!=l.prev?l.prev.getId():""});mxUtils.isEmptyObject(y)||(x[EditorUi.DIFF_UPDATE]=y);0<f.length&&(x[EditorUi.DIFF_REMOVE]=f);0<p.length&&(x[EditorUi.DIFF_INSERT]=p)}return x};EditorUi.prototype.createCellLookup=function(b,l,p){p=null!=p?p:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):p[b.getId()]={cell:b,prev:l};var f=b.getChildCount();l=null;for(var x=0;x<f;x++){var z=b.getChildAt(x);this.createCellLookup(z,l,p);l=z}return p};EditorUi.prototype.diffCellRecursive=function(b,l,p,f,x){f=null!=f?f:{};var z=p[b.getId()];delete p[b.getId()];if(null==z)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):x.push(b.getId());else{var y=this.diffCell(b,z.cell);if(null!=y.parent||(null!=z.prev?null==l:null!=l)||null!=l&&null!=z.prev&&l.getId()!=z.prev.getId())y.previous=null!=z.prev?z.prev.getId():"";mxUtils.isEmptyObject(y)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",-b,"diff",y):f[b.getId()]=y)}z=b.getChildCount();l=null;for(y=0;y<z;y++){var F=b.getChildAt(y);this.diffCellRecursive(F,l,p,f,x);l=F}return f};+b,"diff",y):f[b.getId()]=y)}z=b.getChildCount();l=null;for(y=0;y<z;y++){var E=b.getChildAt(y);this.diffCellRecursive(E,l,p,f,x);l=E}return f};EditorUi.prototype.diffCells=function(b,l){var p={},f=[],x=this.createCellLookup(l);l.id==b.id?(l=[],b=this.diffCellRecursive(b,null,x,null,l),mxUtils.isEmptyObject(b)||(p[EditorUi.DIFF_UPDATE]=b),0<l.length&&(p[EditorUi.DIFF_REMOVE]=l)):EditorUi.debug("EditorUi.diffCells: Root changed",l.id);for(var z in x)b=x[z],f.push(this.getJsonForCell(b.cell,b.prev));0<f.length&&(p[EditorUi.DIFF_INSERT]=f);return p};EditorUi.prototype.diffViewState=function(b,l){var p=b.viewState,f=l.viewState,x={};b==this.currentPage&&(p=this.editor.graph.getViewState());l==this.currentPage&&(f=this.editor.graph.getViewState());if(null!=p&&null!=f)for(var z in this.viewStateProperties)this.diffViewStateProperty(p,f,z,x);return x};EditorUi.prototype.diffViewStateProperty=function(b,l,p,f){b=JSON.stringify(this.getViewStateProperty(b,p));l=JSON.stringify(this.getViewStateProperty(l,p));b!=l&&(f[p]=l)};EditorUi.prototype.getViewStateProperty=function(b,l){b=b[l];"backgroundImage"==l&&null!=b&&null!=b.originalSrc?b={originalSrc:b.originalSrc}:"extFonts"==l&&null==b&&(b=[]);return b};@@ -13785,7 +13797,7 @@ l.value:null);b.style!=l.style&&(f.style=l.style);b.visible!=l.visible&&(f.visibtypeof l[z]||b[z]==l[z]||(f[z]=void 0===l[z]?null:l[z]);return f};EditorUi.prototype.resolveCrossReferences=function(b,l){var p={};mxUtils.isEmptyObject(l)||(this.adoptTheirPages(b,l,p),this.adoptTheirCells(b,l,p));EditorUi.debug("EditorUi.resolveCrossReferences",[this],"ownDiff",b,"theirDiff",l,"resolve",p);return p};EditorUi.prototype.adoptTheirPages=function(b,l,p){var f={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++)f[l[EditorUi.DIFF_INSERT][x].id]=l[EditorUi.DIFF_INSERT][x];for(var z in b[EditorUi.DIFF_UPDATE])null!=f[z]&&(null==p[EditorUi.DIFF_INSERT]&&(p[EditorUi.DIFF_INSERT]=[]),null==p[EditorUi.DIFF_UPDATE]&&(p[EditorUi.DIFF_UPDATE]={}),p[EditorUi.DIFF_INSERT].push(f[z]),p[EditorUi.DIFF_UPDATE][z]=b[EditorUi.DIFF_UPDATE][z],delete b[EditorUi.DIFF_UPDATE][z])};EditorUi.prototype.adoptTheirCells=function(b,l,p){for(var f in b[EditorUi.DIFF_UPDATE]){var x=b[EditorUi.DIFF_UPDATE][f];null!=x.cells&&this.adoptTheirCellsFromPage(x,l,f,p)}};-EditorUi.prototype.adoptTheirCellsFromPage=function(b,l,p,f){var x=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][p]:null;if(null!=x&&null!=x.cells&&null!=x.cells[EditorUi.DIFF_INSERT]){l=x.cells[EditorUi.DIFF_UPDATE];for(var z={},y=0;y<x.cells[EditorUi.DIFF_INSERT].length;y++){var F=x.cells[EditorUi.DIFF_INSERT][y];z[F.id]=F}x={cells:{}};x.cells[EditorUi.DIFF_INSERT]=[];x.cells[EditorUi.DIFF_UPDATE]={};x.inserted={};this.resolveOwnInsertedCells(b.cells[EditorUi.DIFF_INSERT],z,x);this.resolveOwnUpdatedCells(b.cells[EditorUi.DIFF_UPDATE],+EditorUi.prototype.adoptTheirCellsFromPage=function(b,l,p,f){var x=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][p]:null;if(null!=x&&null!=x.cells&&null!=x.cells[EditorUi.DIFF_INSERT]){l=x.cells[EditorUi.DIFF_UPDATE];for(var z={},y=0;y<x.cells[EditorUi.DIFF_INSERT].length;y++){var E=x.cells[EditorUi.DIFF_INSERT][y];z[E.id]=E}x={cells:{}};x.cells[EditorUi.DIFF_INSERT]=[];x.cells[EditorUi.DIFF_UPDATE]={};x.inserted={};this.resolveOwnInsertedCells(b.cells[EditorUi.DIFF_INSERT],z,x);this.resolveOwnUpdatedCells(b.cells[EditorUi.DIFF_UPDATE],z,l,x);null==f[EditorUi.DIFF_UPDATE]&&(f[EditorUi.DIFF_UPDATE]={});delete x.inserted;f[EditorUi.DIFF_UPDATE][p]=x}};EditorUi.prototype.resolveOwnInsertedCells=function(b,l,p){if(null!=b)for(var f=0;f<b.length;f++){var x=b[f];null!=x&&(this.adoptParentCell(x.id,null,l,p),this.adoptTerminalCell(x.id,x,l,!0,p),this.adoptTerminalCell(x.id,x,l,!1,p))}};EditorUi.prototype.resolveOwnUpdatedCells=function(b,l,p,f){if(null!=b)for(var x in b){var z=l[x];null!=z?(f.inserted[x]||(f.cells[EditorUi.DIFF_INSERT].push(z),f.inserted[x]=!0),f.cells[EditorUi.DIFF_UPDATE][x]=b[x]):null!=p&&(z=p[x],null!=z&&(this.adoptParentCell(x,z,l,f),this.adoptTerminalCell(x,z,l,!0,f,x),this.adoptTerminalCell(x,z,l,!1,f,x)))}};EditorUi.prototype.adoptParentCell=function(b,l,p,f){var x=p[b],z=null!=l?l.parent:null!=x?x.parent:null;null!=z&&this.adoptParentCell(z,null,p,f);null!=x?f.inserted[b]||(f.cells[EditorUi.DIFF_INSERT].push(x),f.inserted[b]=!0):null!=l&&(null==f.cells[EditorUi.DIFF_UPDATE][b]&&(f.cells[EditorUi.DIFF_UPDATE][b]={}),f.cells[EditorUi.DIFF_UPDATE][b]=l)};@@ -13840,7 +13852,7 @@ DrawioFileSync.prototype.receiveRemoteChanges=function(b){this.file.ignorePatchel=f}}this.receivedData=null}),this.syncReceiveMessageDelay)):this.receivedData.push(b))};DrawioFileSync.prototype.scheduleCleanup=function(b){var l=Math.min(15,Math.floor(this.file.getSize()/5E6));l=0==b?0:this.cleanupDelay+1E3*l;var p=this.cleanupThread;if(1!=b||null!=this.cleanupThread)window.clearTimeout(this.cleanupThread),this.cleanupThread=window.setTimeout(mxUtils.bind(this,function(){this.cleanup(null,mxUtils.bind(this,function(f){this.file.handleFileError(f)}))}),l);EditorUi.debug("DrawioFileSync.scheduleCleanup",[this],"lazy",b,"delay",l,"prev",p,"thread",this.cleanupThread)};DrawioFileSync.prototype.cleanup=function(b,l,p){var f=this.cleanupThread;window.clearTimeout(this.cleanupThread);this.cleanupThread=null;if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()&&!this.file.isModified()){var x=[this.ui.diffPages(this.ui.pages,this.file.ownPages)];this.file.theirPages=this.ui.clonePages(this.file.ownPages);"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.cleanup",[this],"thread",f,"patches",x,"checkFile",p,"checksum",this.ui.getHashValueForPages(this.ui.pages));-this.file.ignorePatches(x)||this.file.patch(x);p?this.file.getLatestVersion(mxUtils.bind(this,function(z){try{if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()){var y=z.getShadowPages();x=[this.ui.diffPages(this.ui.pages,y),this.ui.diffPages(y,this.file.ownPages)];this.file.ignorePatches(x)||this.file.patch(x);EditorUi.debug("DrawioFileSync.cleanup",[this],"newFile",z,"patches",x)}null!=b&&b()}catch(F){null!=l&&l(F)}}),l):(document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||+this.file.ignorePatches(x)||this.file.patch(x);p?this.file.getLatestVersion(mxUtils.bind(this,function(z){try{if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()){var y=z.getShadowPages();x=[this.ui.diffPages(this.ui.pages,y),this.ui.diffPages(y,this.file.ownPages)];this.file.ignorePatches(x)||this.file.patch(x);EditorUi.debug("DrawioFileSync.cleanup",[this],"newFile",z,"patches",x)}null!=b&&b()}catch(E){null!=l&&l(E)}}),l):(document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||this.testChecksum(),null!=b&&b())}else null!=b&&(b(),EditorUi.debug("DrawioFileSync.cleanup",[this],"checkFile",p,"modified",this.file.isModified()))};DrawioFileSync.prototype.testChecksum=function(){var b=this.ui.getHashValueForPages(this.ui.pages),l=this.file.getCurrentRevisionId();this.file.getLatestVersion(mxUtils.bind(this,function(p){if(!document.hidden){var f=this.ui.getHashValueForPages(p.getShadowPages()),x=p.getDescriptorChecksum(p.getDescriptor()),z=p.getCurrentRevisionId();EditorUi.debug("DrawioFileSync.testChecksum","local",[this.file],"modified",this.file.isModified(),"inConflictState",this.file.inConflictState,"autosaveThread",this.file.autosaveThread,"savingFile",this.file.savingFile,"localFileWasChanged",this.localFileWasChanged,"remoteFileChanged",this.remoteFileChanged,"cleanup",this.cleanupThread,"checksum",b);EditorUi.debug("DrawioFileSync.testChecksum","remote",[p],"rev",z==l,"desc",x==f,"checksum",f);f!=b?(EditorUi.debug("DrawioFileSync.testChecksum",[this],"checksums do not match"),this.ui.alert("Checksums do not match")):EditorUi.debug("DrawioFileSync.testChecksum",[this],"checksums match")}}),mxUtils.bind(this,function(p){EditorUi.debug("DrawioFileSync.testChecksum",@@ -13851,10 +13863,10 @@ DrawioFileSync.prototype.patchRealtime=function(b,l,p,f){var x=null;if(this.fileDrawioFileSync.prototype.sendLocalChanges=function(){try{if(this.file.isRealtime()&&this.localFileWasChanged){var b=this.ui.clonePages(this.ui.pages),l=this.ui.diffPages(this.snapshot,b),p=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;p!=this.snapshotVars&&(l[EditorUi.DIFF_FILE]={vars:p});this.snapshotVars=p;this.file.ownPages=this.ui.patchPages(this.file.ownPages,l,!0);this.snapshot=b;var f=this.ui.resolveCrossReferences(l,this.ui.diffPages(this.file.ownPages,this.ui.pages));this.file.ownPages=this.ui.patchPages(this.file.ownPages,f,!0);this.isRealtimeActive()&&this.doSendLocalChanges([f,l])}this.localFileWasChanged=!1}catch(x){b=this.file.getCurrentUser(),b=null!=b?b.id:"unknown",EditorUi.logError("Error in sendLocalChanges",null,this.file.getMode()+"."+this.file.getId(),b,x)}};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,l,p,f,x,z,y){try{this.file.stats.merged++;this.lastModified=new Date;var F=this.file.getDescriptorRevisionId(p);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var O=this.ui.clonePages(this.file.getShadowPages()),K=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(O,this.ui.pages):null,L=this.file.isRealtime()?this.ui.diffPages(O,this.file.ownPages):null;O=this.ui.applyPatches(O,b);var M=null==l?null:this.ui.getHashValueForPages(O);-EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",K,"pending",L,"checksum",l,"current",M,"valid",l==M,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",F,"etag",this.file.getDescriptorEtag(p),"immediate",y);if(null!=l&&l!=M){this.reload(mxUtils.bind(this,function(){null!=f&&f()}),mxUtils.bind(this,function(){null!=x&&x()}),z,null,y);return}var c=this.file.getShadowVars();for(l=0;l<b.length;l++)null!=b[l]&&null!=b[l][EditorUi.DIFF_FILE]&&-void 0!==b[l][EditorUi.DIFF_FILE].vars&&(c=b[l][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(O,c);if(null==this.patchRealtime(b,null,L,y))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?K:null);else{var d=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var k=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;d!=k&&(this.ui.editor.graph.refresh(),this.snapshotVars=k)}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),-p);null!=f&&f(!0)}catch(v){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=x&&x(v);try{var m=this.file.getCurrentUser(),t=null!=m?m.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),t,v)}catch(A){}}};+DrawioFileSync.prototype.merge=function(b,l,p,f,x,z,y){try{this.file.stats.merged++;this.lastModified=new Date;var E=this.file.getDescriptorRevisionId(p);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var R=this.ui.clonePages(this.file.getShadowPages()),K=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(R,this.ui.pages):null,L=this.file.isRealtime()?this.ui.diffPages(R,this.file.ownPages):null;R=this.ui.applyPatches(R,b);var O=null==l?null:this.ui.getHashValueForPages(R);+EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",K,"pending",L,"checksum",l,"current",O,"valid",l==O,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",E,"etag",this.file.getDescriptorEtag(p),"immediate",y);if(null!=l&&l!=O){this.reload(mxUtils.bind(this,function(){null!=f&&f()}),mxUtils.bind(this,function(){null!=x&&x()}),z,null,y);return}var c=this.file.getShadowVars();for(l=0;l<b.length;l++)null!=b[l]&&null!=b[l][EditorUi.DIFF_FILE]&&+void 0!==b[l][EditorUi.DIFF_FILE].vars&&(c=b[l][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(R,c);if(null==this.patchRealtime(b,null,L,y))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?K:null);else{var d=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var k=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;d!=k&&(this.ui.editor.graph.refresh(),this.snapshotVars=k)}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),+p);null!=f&&f(!0)}catch(u){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=x&&x(u);try{var m=this.file.getCurrentUser(),t=null!=m?m.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),t,u)}catch(A){}}};DrawioFileSync.prototype.fileChanged=function(b,l,p,f,x){var z=window.setTimeout(mxUtils.bind(this,function(){null!=p&&p()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",f,"immediate",x,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(y){null!=p&&p()||(this.isValidState()?this.catchup(y,b,l,p,x):null!=l&&l())}),l)):null!=l&&l())}),f?this.cacheReadyDelay:0);return this.notifyThread=z};DrawioFileSync.prototype.fastForward=function(b){this.file.patchDescriptor(this.file.getDescriptor(),b);this.file.setShadowPages(this.ui.clonePages(this.ui.pages));this.file.theirPages=this.ui.clonePages(this.ui.pages);var l=this.file.ownPages;this.file.ownPages=this.ui.clonePages(this.ui.pages);for(var p=0;p<this.file.ownPages.length;p++)null!=l[p]&&this.ui.getHashValueForPages([this.file.ownPages[p]])!=this.ui.getHashValueForPages([l[p]])&&(this.file.ownPages[p].needsUpdate=!0);this.snapshotVars=null!=@@ -13862,19 +13874,19 @@ this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;l=this.cleanupThreadDrawioFileSync.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,l,p,f,x){if(null!=b&&(null==f||!f())){var z=this.file.getCurrentRevisionId(),y=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",z,"to",y,"immediate",x,"valid",this.isValidState());if(z==y)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!=l&&l(!0);else if(this.isValidState()){var F=this.file.getDescriptorChecksum(b),O=this.file.getDescriptorSecret(b);if(null!=F&&F==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=l&&l(!0);else if(Editor.enableRealtimeCache&&null!=O&&"1"!=urlParams.lockdown){var K=0,L=!1,M=mxUtils.bind(this,function(){if(null==f||!f())if(z!=this.file.getCurrentRevisionId())null!=l&&-l(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;this.reload(l,p,f,null,x)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(z)+"&to="+encodeURIComponent(y)+(null!=O?"&secret="+encodeURIComponent(O):""),mxUtils.bind(this,function(k){this.file.stats.bytesReceived+=k.getText().length;window.clearTimeout(d);if(c&&(null==f||!f()))if(z!=this.file.getCurrentRevisionId())null!=-l&&l(!0);else if(this.isValidState()){var m=null,t=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[k],"status",k.getStatus(),"cacheReadyRetryCount",K,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=k.getStatus()&&299>=k.getStatus()&&0<k.getText().length)try{var v=JSON.parse(k.getText());if(null!=v&&0<v.length)for(var A=0;A<v.length;A++){var C=this.stringToObject(v[A]);if(C.v>DrawioFileSync.PROTOCOL){L=!0;t=[];break}else if(C.v===DrawioFileSync.PROTOCOL&&null!=C.d)m=C.d.checksum,-t.push(C.d.patch);else{L=!0;t=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[v],"status",L?"failed":"ok","temp",t,"checksum",m)}catch(E){t=[],null!=window.console&&"1"==urlParams.test&&console.log(E)}try{0<t.length?(this.file.stats.cacheHits++,this.merge(t,m,b,l,p,f,x)):K<=this.maxCacheReadyRetries-1&&!L&&401!=k.getStatus()&&503!=k.getStatus()&&410!=k.getStatus()?(K++,this.file.stats.cacheMiss++,window.setTimeout(M,(K+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,-this.reload(l,p,f,null,x))}catch(E){null!=p&&p(E)}}else null!=p&&p()}),p)}else null!=p&&p()});window.setTimeout(M,this.cacheReadyDelay)}else this.reload(l,p,f,null,x)}else null!=p&&p()}};DrawioFileSync.prototype.reload=function(b,l,p,f,x){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",x);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(z){null!=l&&l(z)}),p,f,x)};+document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=l&&l(!0);else if(this.isValidState()){var E=this.file.getDescriptorChecksum(b),R=this.file.getDescriptorSecret(b);if(null!=E&&E==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=l&&l(!0);else if(Editor.enableRealtimeCache&&null!=R&&"1"!=urlParams.lockdown){var K=0,L=!1,O=mxUtils.bind(this,function(){if(null==f||!f())if(z!=this.file.getCurrentRevisionId())null!=l&&+l(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;this.reload(l,p,f,null,x)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(z)+"&to="+encodeURIComponent(y)+(null!=R?"&secret="+encodeURIComponent(R):""),mxUtils.bind(this,function(k){this.file.stats.bytesReceived+=k.getText().length;window.clearTimeout(d);if(c&&(null==f||!f()))if(z!=this.file.getCurrentRevisionId())null!=+l&&l(!0);else if(this.isValidState()){var m=null,t=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[k],"status",k.getStatus(),"cacheReadyRetryCount",K,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=k.getStatus()&&299>=k.getStatus()&&0<k.getText().length)try{var u=JSON.parse(k.getText());if(null!=u&&0<u.length)for(var A=0;A<u.length;A++){var B=this.stringToObject(u[A]);if(B.v>DrawioFileSync.PROTOCOL){L=!0;t=[];break}else if(B.v===DrawioFileSync.PROTOCOL&&null!=B.d)m=B.d.checksum,+t.push(B.d.patch);else{L=!0;t=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[u],"status",L?"failed":"ok","temp",t,"checksum",m)}catch(D){t=[],null!=window.console&&"1"==urlParams.test&&console.log(D)}try{0<t.length?(this.file.stats.cacheHits++,this.merge(t,m,b,l,p,f,x)):K<=this.maxCacheReadyRetries-1&&!L&&401!=k.getStatus()&&503!=k.getStatus()&&410!=k.getStatus()?(K++,this.file.stats.cacheMiss++,window.setTimeout(O,(K+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,+this.reload(l,p,f,null,x))}catch(D){null!=p&&p(D)}}else null!=p&&p()}),p)}else null!=p&&p()});window.setTimeout(O,this.cacheReadyDelay)}else this.reload(l,p,f,null,x)}else null!=p&&p()}};DrawioFileSync.prototype.reload=function(b,l,p,f,x){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",x);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(z){null!=l&&l(z)}),p,f,x)};DrawioFileSync.prototype.descriptorChanged=function(b){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var l=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),p=this.file.getCurrentRevisionId(),f=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(b)+"&to="+encodeURIComponent(p)+"&msg="+encodeURIComponent(l)+"&data="+encodeURIComponent(f));this.file.stats.bytesSent+=f.length;this.file.stats.msgSent++;EditorUi.debug("DrawioFileSync.descriptorChanged",[this],"from",b,"to",p)}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,l,p){var f=!0,x=window.setTimeout(mxUtils.bind(this,function(){f=!1;p({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(z){window.clearTimeout(x);f&&(200<=z.getStatus()&&299>=z.getStatus()?l(z.getText()):p({code:z.getStatus(),message:"Token Error "+z.getStatus()}))}),p)};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,l,p,f,x,z){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 y=this.file.getDescriptorSecret(this.file.getDescriptor()),F=this.createMessage({m:this.lastModified.getTime()}),O=this.file.getDescriptorRevisionId(l),K=this.file.getCurrentRevisionId();if(null!=y&&null!=x&&-"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var L=this.ui.diffPages(this.file.getShadowPages(),b),M=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=M&&(L[EditorUi.DIFF_FILE]={vars:c});l=this.file.getDescriptorSecret(l);z=null!=z?z:this.ui.getHashValueForPages(b);M=this.objectToString(this.createMessage({patch:L,checksum:z}));this.file.stats.bytesSent+=M.length;this.file.stats.msgSent++;var d=!0,k=window.setTimeout(mxUtils.bind(this,function(){d=-!1;f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(O)+"&to="+encodeURIComponent(K)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(F)))+(null!=y?"&secret="+encodeURIComponent(y):"")+(null!=l?"&last-secret="+encodeURIComponent(l):"")+(M.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(M):"")+(null!=x?"&token="+encodeURIComponent(x):""),mxUtils.bind(this,-function(m){window.clearTimeout(k);d&&(200<=m.getStatus()&&299>=m.getStatus()?(Editor.p2pSyncNotify&&this.notify(F),null!=p&&p()):f({message:mxResources.get("realtimeCollaboration")+(0!=m.getStatus()?": "+m.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",O,"to",K,"etag",this.file.getCurrentEtag(),"diff",L,M.length,"bytes","msg",F,"checksum",z)}else this.notify(F),null!=p&&p(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",O,"to",K,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);+DrawioFileSync.prototype.fileSaved=function(b,l,p,f,x,z){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 y=this.file.getDescriptorSecret(this.file.getDescriptor()),E=this.createMessage({m:this.lastModified.getTime()}),R=this.file.getDescriptorRevisionId(l),K=this.file.getCurrentRevisionId();if(null!=y&&null!=x&&+"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var L=this.ui.diffPages(this.file.getShadowPages(),b),O=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=O&&(L[EditorUi.DIFF_FILE]={vars:c});l=this.file.getDescriptorSecret(l);z=null!=z?z:this.ui.getHashValueForPages(b);O=this.objectToString(this.createMessage({patch:L,checksum:z}));this.file.stats.bytesSent+=O.length;this.file.stats.msgSent++;var d=!0,k=window.setTimeout(mxUtils.bind(this,function(){d=+!1;f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(R)+"&to="+encodeURIComponent(K)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(E)))+(null!=y?"&secret="+encodeURIComponent(y):"")+(null!=l?"&last-secret="+encodeURIComponent(l):"")+(O.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(O):"")+(null!=x?"&token="+encodeURIComponent(x):""),mxUtils.bind(this,+function(m){window.clearTimeout(k);d&&(200<=m.getStatus()&&299>=m.getStatus()?(Editor.p2pSyncNotify&&this.notify(E),null!=p&&p()):f({message:mxResources.get("realtimeCollaboration")+(0!=m.getStatus()?": "+m.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",R,"to",K,"etag",this.file.getCurrentEtag(),"diff",L,O.length,"bytes","msg",E,"checksum",z)}else this.notify(E),null!=p&&p(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",R,"to",K,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);this.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;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,l,p){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,l,p):this.fileChanged(l,p)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=p&&p({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(),@@ -13882,14 +13894,14 @@ this.polling=null);this.updateOnlineState();this.updateStatus()};DrawioFileSync.prototype.destroy=function(){if(null!=this.channelId){var b=this.file.getCurrentUser(),l={a:"leave"};null!=b&&(l.name=encodeURIComponent(b.displayName),l.uid=b.id);this.notify(this.createMessage(l))}this.stop();null!=this.onlineListener&&(mxEvent.removeListener(window,"offline",this.onlineListener),mxEvent.removeListener(window,"online",this.onlineListener),this.onlineListener=null);null!=this.autosaveListener&&(this.ui.editor.removeListener(this.autosaveListener),this.autosaveListener=null);null!=this.visibleListener&&(mxEvent.removeListener(document,"visibilitychange",this.visibleListener),this.visibleListener=null);null!=this.activityListener&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.activityListener),mxEvent.removeListener(document,"keypress",this.activityListener),mxEvent.removeListener(window,"focus",this.activityListener),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.removeListener(document,"touchstart",this.activityListener),mxEvent.removeListener(document,"touchmove",this.activityListener)),this.activityListener=null);null!=this.p2pCollab&&this.p2pCollab.destroy()};App=function(b,l,p){EditorUi.call(this,b,l,null!=p?p:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var f=this.getCurrentFile();null!=f&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+f.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(f,x,z){if("1"==urlParams.openInSameWin||navigator.standalone)null!=z&&z();else{var y=null;try{y=window.open(f)}catch(F){}null==y||void 0===y?this.showDialog((new PopupDialog(this,f,x,z)).container,340,140,!0,!0):null!=x&&x()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(f){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(f)});this.editor.chromeless&&+(new Image).src=mxGraph.prototype.warningImage.src;window.geOpenWindow=mxUtils.bind(this,function(f,x,z){if("1"==urlParams.openInSameWin||navigator.standalone)null!=z&&z();else{var y=null;try{y=window.open(f)}catch(E){}null==y||void 0===y?this.showDialog((new PopupDialog(this,f,x,z)).container,340,140,!0,!0):null!=x&&x()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(f){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(f)});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(f){null!=window.console&&console.log("Plugin Error:",f,App.DrawPlugins[b])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(f){try{f(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=0,this.initializeEmbedMode())}),5E3)}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_M365="m365";App.MODE_GITHUB="github";App.MODE_GITLAB="gitlab";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.MODE_EMBED="embed";App.MODE_ATLAS="atlas";App.DROPBOX_APPKEY=window.DRAWIO_DROPBOX_ID;App.DROPBOX_URL="js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":"js/onedrive/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="js/jquery/jquery-3.6.0.min.js";App.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";App.PUSHER_URL=window.PUSHER_URL||"https://js.pusher.com/7.0.3/pusher.min.js";App.SIMPLE_PEER_URL="js/simplepeer/simplepeer9.10.0.min.js";App.GOOGLE_APIS="drive-share";App.startTime=new Date;App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"plugins/explore.js",ex:"plugins/explore.js",ac:"plugins/connect.js",acj:"plugins/connectJira.js",ac148:"plugins/cConf-1-4-8.js",ac148cmnt:"plugins/cConf-comments.js",nxtcld:"plugins/nextcloud.js",monday:"plugins/monday.js",tips:"plugins/tooltips.js",svgdata:"plugins/svgdata.js",number:"plugins/number.js",sql:"plugins/sql.js",props:"plugins/props.js",text:"plugins/text.js",anim:"plugins/animation.js",update:"plugins/update.js",trees:"plugins/trees/trees.js","import":"plugins/import.js",replay:"plugins/replay.js",anon:"plugins/anonymize.js",tr:"plugins/trello.js",f5:"plugins/rackF5.js",webcola:"plugins/webcola/webcola.js",rnd:"plugins/random.js",page:"plugins/page.js",gd:"plugins/googledrive.js",tags:"plugins/tags.js"};App.publicPlugin="ex tips svgdata number sql props text anim update trees replay anon webcola tags".split(" ");-App.loadScripts=function(b,l,p){for(var f=b.length,x=!1,z=0;z<b.length;z++)mxscript(b[z],function(){0!=--f||x||null==l||l()},null,null,null,function(y,F){x=!0;null!=p&&p(Error(y));console.error("Error loading script",y,F,F.stack)})};+App.loadScripts=function(b,l,p){for(var f=b.length,x=!1,z=0;z<b.length;z++)mxscript(b[z],function(){0!=--f||x||null==l||l()},null,null,null,function(y,E){x=!0;null!=p&&p(Error(y));console.error("Error loading script",y,E,E.stack)})};App.getStoredMode=function(){var b=null;null==b&&isLocalStorage&&(b=localStorage.getItem(".mode"));if(null==b&&"undefined"!=typeof Storage)try{for(var l=document.cookie.split(";"),p=0;p<l.length;p++){var f=mxUtils.trim(l[p]);if("MODE="==f.substring(0,5)){b=f.substring(5);break}}if(null!=b&&isLocalStorage){var x=new Date;x.setYear(x.getFullYear()-1);document.cookie="MODE=; expires="+x.toUTCString();localStorage.setItem(".mode",b)}}catch(z){}return b};(function(){mxClient.IS_CHROMEAPP||("1"!=urlParams.offline&&("db.draw.io"==window.location.hostname&&null==urlParams.mode&&(urlParams.mode="dropbox"),App.mode=urlParams.mode),null==App.mode&&"1"!=urlParams.embed&&(App.mode=App.getStoredMode()),null!=window.mxscript&&"1"!=urlParams.embed&&("function"===typeof window.DriveClient&&("0"!=urlParams.gapi&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_GOOGLE||null!=urlParams.state&&""==window.location.hash||null!=window.location.hash&&"#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js"):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"===typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==window.location.hash.substring(0,@@ -13898,26 +13910,26 @@ null):window.OneDriveClient=null),"function"===typeof window.TrelloClient&&("1"=App.clearServiceWorker=function(b,l){navigator.serviceWorker.getRegistration().then(function(p){null!=p&&p.unregister().then(function(){null!=b&&(b(),b=null)})})["catch"](function(){null!=l&&l()})};App.isSameDomain=function(b){var l=document.createElement("a");l.href=b;return l.protocol===window.location.protocol||l.host===window.location.host};App.isBuiltInPlugin=function(b){for(var l in App.pluginRegistry)if(App.pluginRegistry[l]==b)return!0;return!1};App.isSimpleThemePreferred=function(){var b=navigator.userAgent||navigator.vendor||window.opera;return 1024>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)||/android/i.test(b)||/iPad|iPhone|iPod/.test(b)&&!window.MSStream||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints};App.main=function(b,l){try{var p=function(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var L=parseInt(mxSettings.settings.autosaveDelay);!isNaN(L)&&0<L?(DrawioFile.prototype.autosaveDelay=L,EditorUi.debug("Setting autosaveDelay",L)):EditorUi.debug("Invalid autosaveDelay",L)}null!=mxSettings.settings.defaultEdgeLength&&(L=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(L)&&0<L?(Graph.prototype.defaultEdgeLength=L,EditorUi.debug("Using defaultEdgeLength",L)):-EditorUi.debug("Invalid defaultEdgeLength",L))}}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}try{if(null!=Menus.prototype.defaultFonts)for(L=0;L<Menus.prototype.defaultFonts.length;L++){var M=Menus.prototype.defaultFonts[L];"string"!==typeof M&&null!=M.fontFamily&&null!=M.fontUrl&&Graph.addFont(M.fontFamily,M.fontUrl)}mxResources.loadDefaultBundle=!1;f(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,-mxLanguage))}catch(c){document.body.innerHTML="",M=document.createElement("pre"),mxUtils.write(M,c.stack),document.body.appendChild(M)}},f=function(L){mxUtils.getAll("1"!=urlParams.dev?[L]:[L,STYLE_PATH+"/default.xml"],function(M){function c(){try{try{null==Editor.currentTheme&&"1"!=urlParams.embed&&(1==urlParams.dev||1==urlParams.test||"test.draw.io"===window.location.hostname||"www.draw.io"===window.location.hostname||"preprod.diagrams.net"===window.location.hostname||"app.diagrams.net"===window.location.hostname||-"jgraph.github.io"===window.location.hostname||/drawio-dev\.pages\.dev$/.test(window.location.hostname))&&App.isSimpleThemePreferred()&&(Editor.currentTheme="simple")}catch(A){}"kennedy"!=Editor.currentTheme&&0>mxUtils.indexOf(Editor.themes,Editor.currentTheme)&&(Editor.currentTheme="kennedy");"1"==urlParams.transparent&&(document.body.style.background="transparent");var v=null!=l?l():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));null!=window.mxscript&&+EditorUi.debug("Invalid defaultEdgeLength",L))}}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}try{if(null!=Menus.prototype.defaultFonts)for(L=0;L<Menus.prototype.defaultFonts.length;L++){var O=Menus.prototype.defaultFonts[L];"string"!==typeof O&&null!=O.fontFamily&&null!=O.fontUrl&&Graph.addFont(O.fontFamily,O.fontUrl)}mxResources.loadDefaultBundle=!1;f(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,+mxLanguage))}catch(c){document.body.innerHTML="",O=document.createElement("pre"),mxUtils.write(O,c.stack),document.body.appendChild(O)}},f=function(L){mxUtils.getAll("1"!=urlParams.dev?[L]:[L,STYLE_PATH+"/default.xml"],function(O){function c(){try{try{null==Editor.currentTheme&&"1"!=urlParams.embed&&(1==urlParams.dev||1==urlParams.test||"test.draw.io"===window.location.hostname||"www.draw.io"===window.location.hostname||"preprod.diagrams.net"===window.location.hostname||"app.diagrams.net"===window.location.hostname||+"jgraph.github.io"===window.location.hostname||/drawio-dev\.pages\.dev$/.test(window.location.hostname))&&App.isSimpleThemePreferred()&&(Editor.currentTheme="simple")}catch(A){}"kennedy"!=Editor.currentTheme&&0>mxUtils.indexOf(Editor.themes,Editor.currentTheme)&&(Editor.currentTheme="kennedy");"1"==urlParams.transparent&&(document.body.style.background="transparent");var u=null!=l?l():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,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(v);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,v,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(A){EditorUi.isElectronApp?-(mxLog.show(),mxLog.debug(A.stack)):(EditorUi.logError(A.message,null,null,null,A),window.setTimeout(function(){alert(A.message)},1))}}mxResources.parse(M[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var d=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=d){EditorUi.debug("Setting configuration",JSON.stringify(d));if(null!=d.merge){var k=localStorage.getItem(Editor.configurationKey);if(null!=-k)try{var m=JSON.parse(k),t;for(t in d.merge)m[t]=d.merge[t];d=m}catch(v){window.location.hash="",alert(v)}else d=d.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(d)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(v){window.location.hash="",alert(v)}1<M.length&&(Graph.prototype.defaultThemes["default-style2"]=M[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=-M[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(v){document.body.innerHTML="";var A=document.createElement("pre");mxUtils.write(A,v.stack);document.body.appendChild(A)}))},function(M){M=document.getElementById("geStatus");null!=M&&(M.innerHTML="Error loading page. <a>Please try refreshing.</a>",M.getElementsByTagName("a")[0].onclick=function(){mxLanguage=-"en";f(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(Editor.loadCompatibleCss(),App.isMainCalled=!0,window.onerror=function(L,-M,c,d,k){EditorUi.logError("Global: "+(null!=L?L:""),M,c,d,k,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",L,"\nURL:",M,"\nLine:",c,"\nColumn:",d,"\nError:",k)):console.error("Message:",L,"\nURL:",M,"\nLine:",c,"\nColumn:",d,"\nError:",k);window.setTimeout(function(){alert("Error: "+(null!=L?L:""))},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 x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"!=urlParams.enableSW&&-"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(L){null!=L?(EditorUi.debug("App.main","Updating service worker"),L.update()):!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main","Installing service worker"),navigator.serviceWorker.register("service-worker.js")):-EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(L){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"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 z=-null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var y=JSON.parse(localStorage.getItem(mxSettings.key));null!=y&&(z=y.plugins)}catch(L){}y=urlParams.p;App.initPluginCallback();null!=y&&App.loadPlugins(y.split(";"));if(null!=z&&0<z.length&&"0"!=urlParams.plugins)for(x=0;x<z.length;x++)try{("/"==z[x].charAt(0)&&(z[x]=PLUGINS_BASE_PATH+z[x]),App.isSameDomain(z[x]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(z[x])?null==-App.pluginsLoaded[z[x]]&&(App.pluginsLoaded[z[x]]=!0,App.embedModePluginsCount++,mxscript(z[x])):null!=window.console&&console.log("Unknown plugin:",z[x]):null!=window.console&&console.log("Blocked plugin:",z[x])}catch(L){}}"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 F=window.opener||window.parent,O=function(L){if(L.source==F)try{var M=JSON.parse(L.data);null!=M&&"configure"==M.action&&(mxEvent.removeListener(window,"message",O),Editor.configure(M.config),mxSettings.load(),null!=M.config.darkColor&&document.body.style.setProperty("--dark-color",M.config.darkColor),M.colorSchemeMeta&&mxmeta("color-scheme",-"dark light"),p())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,L.data)}};mxEvent.addListener(window,"message",O);F.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(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}if(isLocalStorage&&-null!=localStorage&&"1"!=urlParams.embed){var K=localStorage.getItem(Editor.configurationKey);if(null!=K)try{K=JSON.parse(K),null!=K&&(EditorUi.debug("Using local configuration",K),Editor.configure(K),mxSettings.load())}catch(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}}}p()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}catch(L){document.body.innerHTML="",z=-document.createElement("pre"),mxUtils.write(z,L.stack),document.body.appendChild(z)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;+"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(u);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,u,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(A){EditorUi.isElectronApp?+(mxLog.show(),mxLog.debug(A.stack)):(EditorUi.logError(A.message,null,null,null,A),window.setTimeout(function(){alert(A.message)},1))}}mxResources.parse(O[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var d=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=d){EditorUi.debug("Setting configuration",JSON.stringify(d));if(null!=d.merge){var k=localStorage.getItem(Editor.configurationKey);if(null!=+k)try{var m=JSON.parse(k),t;for(t in d.merge)m[t]=d.merge[t];d=m}catch(u){window.location.hash="",alert(u)}else d=d.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(d)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(u){window.location.hash="",alert(u)}1<O.length&&(Graph.prototype.defaultThemes["default-style2"]=O[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=+O[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(u){document.body.innerHTML="";var A=document.createElement("pre");mxUtils.write(A,u.stack);document.body.appendChild(A)}))},function(O){O=document.getElementById("geStatus");null!=O&&(O.innerHTML="Error loading page. <a>Please try refreshing.</a>",O.getElementsByTagName("a")[0].onclick=function(){mxLanguage=+"en";f(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(Editor.loadCompatibleCss(),App.isMainCalled=!0,"1"==urlParams.android&&(mxClient.IS_ANDROID=+!0),window.onerror=function(L,O,c,d,k){EditorUi.logError("Global: "+(null!=L?L:""),O,c,d,k,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",L,"\nURL:",O,"\nLine:",c,"\nColumn:",d,"\nError:",k)):console.error("Message:",L,"\nURL:",O,"\nLine:",c,"\nColumn:",d,"\nError:",k);window.setTimeout(function(){alert("Error: "+(null!=L?L:""))},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 x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=+urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(L){null!=L?(EditorUi.debug("App.main","Updating service worker"),L.update()):!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main",+"Installing service worker"),navigator.serviceWorker.register("service-worker.js")):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(L){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"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 z=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var y=JSON.parse(localStorage.getItem(mxSettings.key));null!=y&&(z=y.plugins)}catch(L){}y=urlParams.p;App.initPluginCallback();null!=y&&App.loadPlugins(y.split(";"));if(null!=z&&0<z.length&&"0"!=urlParams.plugins)for(x=0;x<z.length;x++)try{("/"==z[x].charAt(0)&&(z[x]=PLUGINS_BASE_PATH++z[x]),App.isSameDomain(z[x]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(z[x])?null==App.pluginsLoaded[z[x]]&&(App.pluginsLoaded[z[x]]=!0,App.embedModePluginsCount++,mxscript(z[x])):null!=window.console&&console.log("Unknown plugin:",z[x]):null!=window.console&&console.log("Blocked plugin:",z[x])}catch(L){}}"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 E=window.opener||window.parent,R=function(L){if(L.source==E)try{var O=JSON.parse(L.data);null!=O&&"configure"==O.action&&(mxEvent.removeListener(window,"message",R),Editor.configure(O.config),mxSettings.load(),null!=O.config.darkColor&&+document.body.style.setProperty("--dark-color",O.config.darkColor),O.colorSchemeMeta&&mxmeta("color-scheme","dark light"),p())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,L.data)}};mxEvent.addListener(window,"message",R);E.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(L){null==+window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var K=localStorage.getItem(Editor.configurationKey);if(null!=K)try{K=JSON.parse(K),null!=K&&(EditorUi.debug("Using local configuration",K),Editor.configure(K),mxSettings.load())}catch(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}}}p()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}catch(L){document.body.innerHTML=+"",z=document.createElement("pre"),mxUtils.write(z,L.stack),document.body.appendChild(z)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;App.loadPlugins=function(b,l){EditorUi.debug("Loading plugins",b);for(var p=0;p<b.length;p++)if(null!=b[p]&&0<b[p].length)try{if(null!=App.pluginRegistry[b[p]]){var f=PLUGINS_BASE_PATH+App.pluginRegistry[b[p]];null==App.pluginsLoaded[f]&&(App.pluginsLoaded[f]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?l?mxinclude(f):mxscript(f):l?mxinclude(f):mxscript(drawDevUrl+f))}else null!=window.console&&console.log("Unknown plugin:",b[p])}catch(x){null!=window.console&&console.log("Error loading plugin:",b[p],x)}};App.prototype.initializeEmbedMode=function(){"1"==urlParams.embed&&("app.diagrams.net"==window.location.hostname&&this.showBanner("EmbedDeprecationFooter","app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net."),0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments)))};App.prototype.initializeViewerMode=function(){var b=window.opener||window.parent;null!=b&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){b.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")}))};@@ -13926,7 +13938,7 @@ App.prototype.init=function(){if(!App.blockedAncestorFrames()){this.buttonContaimxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(y){null!=window.console&&console.log("GitLabClient disabled: "+y.message)}if("1"!=urlParams.embed||"1"==urlParams.od){var b=mxUtils.bind(this,function(){if("undefined"!==typeof OneDrive)try{this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))}catch(y){null!=window.console&&console.log("OneDriveClient disabled: "+y.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=b)});b()}if("0"!=urlParams.ms365)try{this.m365=new OneDriveClient(this,!1,!1,!1,!0),this.m365.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.m365))}catch(y){null!=window.console&&console.log("M365Client disabled: "+y.message)}if("1"!=urlParams.embed||"1"==urlParams.tr){var l=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(y){null!=window.console&&console.log("TrelloClient disabled: "+y.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=-l)});l()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var p=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var y=mxUtils.bind(this,function(){try{this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(F){null!=window.console&&console.log("DriveClient disabled: "+F.message)}});+l)});l()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var p=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var y=mxUtils.bind(this,function(){try{this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(E){null!=window.console&&console.log("DriveClient disabled: "+E.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,y),window.DrawGapiClientCallback=null):y()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=p)});p()}if("1"!=urlParams.embed||"1"==urlParams.db){var f=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(y){null!=window.console&&console.log("DropboxClient disabled: "+y.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=f)});f()}if("1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(y){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),mxUtils.bind(this,function(){y.prompt()}),!0,!0)})),!this.isOwnGDriveDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var y=this.getCurrentFile();y=null!=y?y.getMode():null;mxClient.IS_CHROMEAPP||mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||y!=App.MODE_DEVICE&&@@ -13948,21 +13960,21 @@ p.setAttribute("border","0");p.setAttribute("align","absmiddle");p.setAttribute(b.appendChild(p);var f=document.createElement("img");f.setAttribute("border","0");f.setAttribute("align","absmiddle");f.setAttribute("title","2 star");f.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");f.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==");b.appendChild(f);var x=document.createElement("img");x.setAttribute("border","0");x.setAttribute("align","absmiddle");x.setAttribute("title","3 star");x.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");x.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==");b.appendChild(x);var z=document.createElement("img");z.setAttribute("border","0");z.setAttribute("align","absmiddle");z.setAttribute("title","4 star");z.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");z.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==");-b.appendChild(z);this.bannerShowing=!0;var y=mxUtils.bind(this,function(){null!=b.parentNode&&(b.parentNode.removeChild(b),this.bannerShowing=!1,this.hideBannerratingFooter=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeratingFooter=Date.now(),mxSettings.save()))});mxEvent.addListener(l,"click",mxUtils.bind(this,function(F){mxEvent.consume(F);y()}));mxEvent.addListener(p,"click",mxUtils.bind(this,function(F){mxEvent.consume(F);y()}));mxEvent.addListener(f,"click",mxUtils.bind(this,-function(F){mxEvent.consume(F);y()}));mxEvent.addListener(x,"click",mxUtils.bind(this,function(F){mxEvent.consume(F);y()}));mxEvent.addListener(z,"click",mxUtils.bind(this,function(F){mxEvent.consume(F);window.open("https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence?hosting=datacenter&tab=reviews");y()}));l=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,120%)");window.setTimeout(mxUtils.bind(this,function(){y()}),1E3)});window.setTimeout(mxUtils.bind(this,+b.appendChild(z);this.bannerShowing=!0;var y=mxUtils.bind(this,function(){null!=b.parentNode&&(b.parentNode.removeChild(b),this.bannerShowing=!1,this.hideBannerratingFooter=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeratingFooter=Date.now(),mxSettings.save()))});mxEvent.addListener(l,"click",mxUtils.bind(this,function(E){mxEvent.consume(E);y()}));mxEvent.addListener(p,"click",mxUtils.bind(this,function(E){mxEvent.consume(E);y()}));mxEvent.addListener(f,"click",mxUtils.bind(this,+function(E){mxEvent.consume(E);y()}));mxEvent.addListener(x,"click",mxUtils.bind(this,function(E){mxEvent.consume(E);y()}));mxEvent.addListener(z,"click",mxUtils.bind(this,function(E){mxEvent.consume(E);window.open("https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence?hosting=datacenter&tab=reviews");y()}));l=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,120%)");window.setTimeout(mxUtils.bind(this,function(){y()}),1E3)});window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,0%)")}),500);window.setTimeout(l,6E4)}};App.prototype.checkLicense=function(){var b=this.drive.getUser(),l=null!=b?b.email:null;if(!this.isOffline()&&!this.editor.chromeless&&null!=l&&null!=b.id){var p=l.lastIndexOf("@"),f=0<=p?l.substring(p+1):"";b=Editor.crc32(b.id);"gmail.com"!==f.toLowerCase()&&mxUtils.post("/license","domain="+encodeURIComponent(f)+"&id="+encodeURIComponent(b)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(x){try{if(200<=x.getStatus()&&299>=x.getStatus()){var z=x.getText();if(0<z.length){var y=JSON.parse(z);-null!=y&&this.handleLicense(y,f)}}}catch(F){}}))}};App.prototype.handleLicense=function(b,l){};App.prototype.getEditBlankXml=function(){var b=this.getCurrentFile();return null!=b&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?b.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())};+null!=y&&this.handleLicense(y,f)}}}catch(E){}}))}};App.prototype.handleLicense=function(b,l){};App.prototype.getEditBlankXml=function(){var b=this.getCurrentFile();return null!=b&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?b.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())};App.prototype.addRecent=function(b,l,p){if(isLocalStorage&&null!=localStorage){l=null!=l?l:"";var f=this.getRecent(l);if(null==f)f=[];else for(var x=0;x<f.length;x++)f[x].mode==b.mode&&f[x].id==b.id&&f.splice(x,1);null!=f&&(p=null!=p?p:10,f.unshift(b),f=f.slice(0,p),localStorage.setItem(".recent"+l,JSON.stringify(f)))}};App.prototype.getRecent=function(b){if(isLocalStorage&&null!=localStorage){try{var l=localStorage.getItem(".recent"+(null!=b?b:""));if(null!=l)return JSON.parse(l)}catch(p){}return null}};App.prototype.resetRecent=function(b){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent"+(null!=b?b:""))}catch(l){}};App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");this.unloading=!0;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,l=this.getCurrentFile();null==l||!this.editor.graph.isLightboxView()&&"simple"!=Editor.currentTheme||null==this.pages||null==this.currentPage?this.isOfflineApp()&&(b+=" app"):b=this.getShortPageName(this.currentPage);null!=l&&(b=(null!=l.getTitle()?l.getTitle():this.defaultFilename)+" - "+b);document.title!=b&&(document.title=b)};-App.prototype.getThumbnail=function(b,l,p){p=null!=p?p:0;var f=!1;try{var x=!0,z=window.setTimeout(mxUtils.bind(this,function(){x=!1;l(null)}),this.timeout),y=mxUtils.bind(this,function(V){window.clearTimeout(z);x&&l(V)});null==this.thumbImageCache&&(this.thumbImageCache={});var F=this.editor.graph,O=F.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var K=F.getGlobalVariable;F=this.createTemporaryGraph(F.getStylesheet());F.setBackgroundImage=this.editor.graph.setBackgroundImage;-var L=this.pages[0];this.currentPage==L?F.setBackgroundImage(O):null!=L.viewState&&null!=L.viewState&&(O=L.viewState.backgroundImage,F.setBackgroundImage(O));F.getGlobalVariable=function(V){return"page"==V?L.getName():"pagenumber"==V?1:K.apply(this,arguments)};F.getGlobalVariable=K;document.body.appendChild(F.container);F.model.setRoot(L.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{F!=this.editor.graph&&null!=F.container.parentNode&&-F.container.parentNode.removeChild(F.container)}catch(n){V=null}y(V)}),b,this.thumbImageCache,"#ffffff",function(){y()},null,null,null,null,null,null,F,p,null,null,null,"diagram",null),f=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var M=document.createElement("canvas"),c=F.getGraphBounds(),d=F.view.translate,k=F.view.scale;null!=O&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((d.x+O.x)*k,(d.y+O.y)*k,O.width*k,O.height*k)));var m=b/c.width;m=Math.min(1,Math.min(3*b/(4*-c.height),m));var t=Math.floor(c.x),v=Math.floor(c.y);M.setAttribute("width",Math.ceil(m*(c.width+4)));M.setAttribute("height",Math.ceil(m*(c.height+4)));var A=M.getContext("2d");A.scale(m,m);A.translate(-t,-v);var C=F.background;if(null==C||""==C||C==mxConstants.NONE)C="#ffffff";A.save();A.fillStyle=C;A.fillRect(t,v,Math.ceil(c.width+4),Math.ceil(c.height+4));A.restore();if(null!=O){var E=new Image;E.src=O.src;A.drawImage(E,O.x*m,O.y*m,O.width*m,O.height*m)}var D=new mxJsCanvas(M),U=new mxAsyncCanvas(this.thumbImageCache);-D.images=this.thumbImageCache.images;var T=new mxImageExport;T.drawShape=function(V,n){V.shape instanceof mxShape&&V.shape.checkBounds()&&(n.save(),n.translate(.5,.5),V.shape.paint(n),n.translate(-.5,-.5),n.restore())};T.drawText=function(V,n){};T.drawState(F.getView().getState(F.model.root),U);U.finish(mxUtils.bind(this,function(){try{T.drawState(F.getView().getState(F.model.root),D),F!=this.editor.graph&&null!=F.container.parentNode&&F.container.parentNode.removeChild(F.container)}catch(V){M=null}y(M)}));-f=!0}}catch(V){f=!1,null!=F&&F!=this.editor.graph&&null!=F.container.parentNode&&F.container.parentNode.removeChild(F.container)}f||window.clearTimeout(z);return f};+App.prototype.getThumbnail=function(b,l,p){p=null!=p?p:0;var f=!1;try{var x=!0,z=window.setTimeout(mxUtils.bind(this,function(){x=!1;l(null)}),this.timeout),y=mxUtils.bind(this,function(V){window.clearTimeout(z);x&&l(V)});null==this.thumbImageCache&&(this.thumbImageCache={});var E=this.editor.graph,R=E.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var K=E.getGlobalVariable;E=this.createTemporaryGraph(E.getStylesheet());E.setBackgroundImage=this.editor.graph.setBackgroundImage;+var L=this.pages[0];this.currentPage==L?E.setBackgroundImage(R):null!=L.viewState&&null!=L.viewState&&(R=L.viewState.backgroundImage,E.setBackgroundImage(R));E.getGlobalVariable=function(V){return"page"==V?L.getName():"pagenumber"==V?1:K.apply(this,arguments)};E.getGlobalVariable=K;document.body.appendChild(E.container);E.model.setRoot(L.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{E!=this.editor.graph&&null!=E.container.parentNode&&+E.container.parentNode.removeChild(E.container)}catch(n){V=null}y(V)}),b,this.thumbImageCache,"#ffffff",function(){y()},null,null,null,null,null,null,E,p,null,null,null,"diagram",null),f=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var O=document.createElement("canvas"),c=E.getGraphBounds(),d=E.view.translate,k=E.view.scale;null!=R&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((d.x+R.x)*k,(d.y+R.y)*k,R.width*k,R.height*k)));var m=b/c.width;m=Math.min(1,Math.min(3*b/(4*+c.height),m));var t=Math.floor(c.x),u=Math.floor(c.y);O.setAttribute("width",Math.ceil(m*(c.width+4)));O.setAttribute("height",Math.ceil(m*(c.height+4)));var A=O.getContext("2d");A.scale(m,m);A.translate(-t,-u);var B=E.background;if(null==B||""==B||B==mxConstants.NONE)B="#ffffff";A.save();A.fillStyle=B;A.fillRect(t,u,Math.ceil(c.width+4),Math.ceil(c.height+4));A.restore();if(null!=R){var D=new Image;D.src=R.src;A.drawImage(D,R.x*m,R.y*m,R.width*m,R.height*m)}var N=new mxJsCanvas(O),F=new mxAsyncCanvas(this.thumbImageCache);+N.images=this.thumbImageCache.images;var U=new mxImageExport;U.drawShape=function(V,n){V.shape instanceof mxShape&&V.shape.checkBounds()&&(n.save(),n.translate(.5,.5),V.shape.paint(n),n.translate(-.5,-.5),n.restore())};U.drawText=function(V,n){};U.drawState(E.getView().getState(E.model.root),F);F.finish(mxUtils.bind(this,function(){try{U.drawState(E.getView().getState(E.model.root),N),E!=this.editor.graph&&null!=E.container.parentNode&&E.container.parentNode.removeChild(E.container)}catch(V){O=null}y(O)}));+f=!0}}catch(V){f=!1,null!=E&&E!=this.editor.graph&&null!=E.container.parentNode&&E.container.parentNode.removeChild(E.container)}f||window.clearTimeout(z);return f};(function(){var b=EditorUi.prototype.setMode;App.prototype.setMode=function(l,p){b.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var f=this.getCurrentFile();l=null!=f?f.getMode():l;null==this.updateTitleListener&&(this.updateTitleListener=mxUtils.bind(this,function(){l==App.MODE_GOOGLE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])):l==App.MODE_DROPBOX?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])):l==App.MODE_ONEDRIVE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])):this.appIcon.removeAttribute("title")}),this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTitleListener()})));this.updateTitleListener()}if(p)try{if(isLocalStorage)localStorage.setItem(".mode",l);else if("undefined"!=typeof Storage){var x=new Date;x.setYear(x.getFullYear()+1);document.cookie="MODE="+l+"; expires="+x.toUTCString()}}catch(z){}}})();@@ -13977,17 +13989,17 @@ App.prototype.showRefreshDialog=function(b,l){this.showingRefreshDialog||(this.sApp.prototype.showAlert=function(b){if(null!=b&&0<b.length){var l=document.createElement("div");l.className="geAlert";l.style.zIndex=2E9;l.style.left="50%";l.style.top="-100%";l.style.maxWidth="80%";l.style.width="max-content";l.style.whiteSpace="pre-wrap";mxUtils.setPrefixedStyle(l.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(l.style,"transition","all 1s ease");l.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");l.appendChild(b);mxEvent.addListener(b,"click",function(p){null!=l.parentNode&&(l.parentNode.removeChild(l),mxEvent.consume(p))});document.body.appendChild(l);window.setTimeout(function(){l.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(l.style,"transition","all 2s ease");l.style.opacity="0";window.setTimeout(function(){null!=l.parentNode&&l.parentNode.removeChild(l)},2E3)},15E3)}};-App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(y,F,O,K,L){"ResizeObserver loop limit exceeded"!=y&&(EditorUi.logError("Uncaught: "+(null!=y?y:""),F,O,K,L,null,!0),b.handleError({message:y},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(y){var F=this.getCurrentFile();EditorUi.debug("storage event",[y],-[F]);null!=F&&".draft-alive-check"==y.key&&null!=y.newValue&&null!=F.draftId&&(this.draftAliveCheck=y.newValue,F.saveDraft())}))}catch(y){}var l=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(y){try{var F=this.getDiagramId();if(F!=l){l=F;var O=this.getCurrentFile();null!=O&&O.getHash()==F||this.loadFile(F,!0)}else{var K=this.getHashObject();if(null!=K&&null!=K.pageId&&null!=this.currentPage&&K.pageId!=this.currentPage.getId()){var L=this.getPageById(K.pageId);-null!=L&&this.selectPage(L)}}}catch(M){null!=document.body&&this.handleError(M,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.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(y){this.handleError(y,mxResources.get("errorLoadingFile"))}))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}else if((null==+App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(y,E,R,K,L){"ResizeObserver loop limit exceeded"!=y&&(EditorUi.logError("Uncaught: "+(null!=y?y:""),E,R,K,L,null,!0),b.handleError({message:y},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(y){var E=this.getCurrentFile();EditorUi.debug("storage event",[y],+[E]);null!=E&&".draft-alive-check"==y.key&&null!=y.newValue&&null!=E.draftId&&(this.draftAliveCheck=y.newValue,E.saveDraft())}))}catch(y){}var l=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(y){try{var E=this.getDiagramId();if(E!=l){l=E;var R=this.getCurrentFile();null!=R&&R.getHash()==E||this.loadFile(E,!0)}else{var K=this.getHashObject();if(null!=K&&null!=K.pageId&&null!=this.currentPage&&K.pageId!=this.currentPage.getId()){var L=this.getPageById(K.pageId);+null!=L&&this.selectPage(L)}}}catch(O){null!=document.body&&this.handleError(O,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.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(y){this.handleError(y,mxResources.get("errorLoadingFile"))}))}catch(y){this.handleError(y,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 p=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 y=mxUtils.bind(this,function(K){Editor.isPngDataUrl(K)&&(K=Editor.extractGraphModelFromPng(K));var L=urlParams.title;L=null!=L?decodeURIComponent(L):this.defaultFilename;K=new LocalFile(this,-K,L,!0);this.fileLoaded(K);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(K.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),F=window.opener||window.parent;if(F!=window){var O=urlParams.create;null!=O?y(F[decodeURIComponent(O)]):(O=urlParams.data,null!=O?y(decodeURIComponent(O)):this.spinner.spin(document.body,mxResources.get("loading"))&&this.createTimeout(2E3,mxUtils.bind(this,-function(K){this.installMessageHandler(mxUtils.bind(this,function(L,M){M.source==F&&K.clear()&&(this.spinner.stop(),y(L))}))}),mxUtils.bind(this,function(K){this.handleError(K)})))}}else if(null==this.dialog)if("1"==urlParams.demo)O=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=O;else{O=!1;try{O=null!=window.opener&&null!=window.opener.openFile}catch(K){}O?this.spinner.spin(document.body,mxResources.get("loading")):(O=this.getDiagramId(),-!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=O&&0!=O.length||this.editor.isChromelessView()?null!=O&&0<O.length?this.loadFile(O,null,null,mxUtils.bind(this,function(){var K=decodeURIComponent(urlParams.viewbox||"");if(""!=K)try{var L=JSON.parse(K);this.editor.graph.fitWindow(L,L.border)}catch(M){console.error(M)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,+K,L,!0);this.fileLoaded(K);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(K.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),E=window.opener||window.parent;if(E!=window){var R=urlParams.create;null!=R?y(E[decodeURIComponent(R)]):(R=urlParams.data,null!=R?y(decodeURIComponent(R)):this.spinner.spin(document.body,mxResources.get("loading"))&&this.createTimeout(2E3,mxUtils.bind(this,+function(K){this.installMessageHandler(mxUtils.bind(this,function(L,O){O.source==E&&K.clear()&&(this.spinner.stop(),y(L))}))}),mxUtils.bind(this,function(K){this.handleError(K)})))}}else if(null==this.dialog)if("1"==urlParams.demo)R=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=R;else{R=!1;try{R=null!=window.opener&&null!=window.opener.openFile}catch(K){}R?this.spinner.spin(document.body,mxResources.get("loading")):(R=this.getDiagramId(),+!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=R&&0!=R.length||this.editor.isChromelessView()?null!=R&&0<R.length?this.loadFile(R,null,null,mxUtils.bind(this,function(){var K=decodeURIComponent(urlParams.viewbox||"");if(""!=K)try{var L=JSON.parse(K);this.editor.graph.fitWindow(L,L.border)}catch(O){console.error(O)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),f=decodeURIComponent(urlParams.create||"");null!=window.location.hash&&"#create="==window.location.hash.substring(0,8)&&(f=decodeURIComponent(window.location.hash.substring(8)));null!=urlParams["smart-template"]&&(null==window.location.hash||1>=window.location.hash.length)&&(f=JSON.stringify({type:"generate",data:decodeURIComponent(urlParams["smart-template"])}));if((null==window.location.hash||1>=window.location.hash.length)&&0<f.length&&this.spinner.spin(document.body,-mxResources.get("loading"))){var x=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),z=mxUtils.bind(this,function(y){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,y,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var F=urlParams.title;F=null!=F?decodeURIComponent(F):this.defaultFilename;y=this.getServiceCount(!0);isLocalStorage&&y++;var O=4>=-y?2:6<y?4:3;F=new CreateDialog(this,F,mxUtils.bind(this,function(K,L){if(null==L){this.hideDialog();var M=Editor.useLocalStorage;this.createFile(0<K.length?K:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=M}else this.pickFolder(L,mxUtils.bind(this,function(c){this.createFile(K,this.getFileData(!0),null,L,null,!0,c)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,O,null,null,null,this.editor.fileExtensions);this.showDialog(F.container,420,y>O?-390:280,!0,!1,mxUtils.bind(this,function(K){K&&null==this.getCurrentFile()&&this.showSplash()}));F.init()}});if("http://"!=f.substring(0,7)&&"https://"!=f.substring(0,8))try{if("{"==f.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(f)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=window.opener[f])z(window.opener[f]);else throw Error(mxResources.get("invalidCallFnNotFound",+mxResources.get("loading"))){var x=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),z=mxUtils.bind(this,function(y){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,y,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var E=urlParams.title;E=null!=E?decodeURIComponent(E):this.defaultFilename;y=this.getServiceCount(!0);isLocalStorage&&y++;var R=4>=+y?2:6<y?4:3;E=new CreateDialog(this,E,mxUtils.bind(this,function(K,L){if(null==L){this.hideDialog();var O=Editor.useLocalStorage;this.createFile(0<K.length?K:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=O}else this.pickFolder(L,mxUtils.bind(this,function(c){this.createFile(K,this.getFileData(!0),null,L,null,!0,c)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,R,null,null,null,this.editor.fileExtensions);this.showDialog(E.container,420,y>R?+390:280,!0,!1,mxUtils.bind(this,function(K){K&&null==this.getCurrentFile()&&this.showSplash()}));E.init()}});if("http://"!=f.substring(0,7)&&"https://"!=f.substring(0,8))try{if("{"==f.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(f)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=window.opener[f])z(window.opener[f]);else throw Error(mxResources.get("invalidCallFnNotFound",["window.opener."+f]));}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}else this.loadTemplate(f,function(y){z(y)},mxUtils.bind(this,function(y){this.handleError(y,mxResources.get("errorLoadingFile"),x)}))}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","splash"])),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),p())}}catch(y){this.handleError(y)}};@@ -13997,7 +14009,7 @@ function(z){p(z)},mxUtils.bind(this,function(z){this.handleError(z,mxResources.gApp.prototype.openGenerateDialog=function(b){null==this.chatWindow?(this.chatWindow=new ChatWindow(this,224,104,280,320),this.chatWindow.window.addListener("show",mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("chat"))})),this.chatWindow.window.addListener("hide",function(){this.fireEvent(new mxEventObject("chat"))}),this.chatWindow.window.setVisible(!0),this.fireEvent(new mxEventObject("chat"))):this.chatWindow.window.setVisible(!0);null!=b&&this.chatWindow.generate(b)};App.prototype.openTemplateDialog=function(b){var l=this.editor.graph;l.isEnabled()&&!l.isCellLocked(l.getDefaultParent())&&(b=new NewDialog(this,null,!1,mxUtils.bind(this,function(p){this.hideDialog();if(null!=p){var f=this.editor.graph.getFreeInsertPoint(!0);l.setSelectionCells(this.importXml(p,Math.max(f.x,20),Math.max(f.y,20),!0,null,null,!0));l.scrollCellToVisible(l.getSelectionCell())}}),null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"),null,null,b),this.showDialog(b.container,620,460,!0,!0,mxUtils.bind(this,function(){this.sidebar.hideTooltip()})),b.init())};App.prototype.loadDraft=function(b,l){this.createFile(this.defaultFilename,b,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var p=this.getCurrentFile();null!=p&&(p.fileChanged(),null!=l&&l())}),0)}),null,null,!0)};-App.prototype.filterDrafts=function(b,l,p){function f(){p(x)}var x=[];try{this.getDatabaseItems(mxUtils.bind(this,function(z){EditorUi.debug("App.filterDrafts",[this],"items",z);for(var y=0;y<z.length;y++)try{var F=z[y].key;if(null!=F&&".draft_"==F.substring(0,7)){var O=JSON.parse(z[y].data);null!=O&&"draft"==O.type&&O.aliveCheck!=l&&(null==b&&null==O.fileObject||null!=O.fileObject&&O.fileObject.path==b)&&(O.key=F,x.push(O))}}catch(K){}f()}),f)}catch(z){f()}};+App.prototype.filterDrafts=function(b,l,p){function f(){p(x)}var x=[];try{this.getDatabaseItems(mxUtils.bind(this,function(z){EditorUi.debug("App.filterDrafts",[this],"items",z);for(var y=0;y<z.length;y++)try{var E=z[y].key;if(null!=E&&".draft_"==E.substring(0,7)){var R=JSON.parse(z[y].data);null!=R&&"draft"==R.type&&R.aliveCheck!=l&&(null==b&&null==R.fileObject||null!=R.fileObject&&R.fileObject.path==b)&&(R.key=E,x.push(R))}}catch(K){}f()}),f)}catch(z){f()}};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(l){if(1==l.length)this.loadDraft(l[0].data,mxUtils.bind(this,function(){this.removeDatabaseItem(l[0].key)}));else if(1<l.length){var p=new Date(l[0].modified);p=new DraftDialog(this,1<l.length?mxResources.get("selectDraft"):mxResources.get("draftFound",[p.toLocaleDateString()+" "+p.toLocaleTimeString()]),1<l.length?null:l[0].data,mxUtils.bind(this,function(f){this.hideDialog();f=""!=f&&null!=l[f]?f:0;this.loadDraft(l[f].data,mxUtils.bind(this,function(){this.removeDatabaseItem(l[f].key)}))}),mxUtils.bind(this,function(f,x){this.removeDatabaseItem(l[""!=f?f:0].key);null!=x&&x()}),null,null,null,1<l.length?l:null);this.showDialog(p.container,640,480,!0,!1,mxUtils.bind(this,function(f){f&&("0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))}));p.init()}else"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(l){}};@@ -14006,90 +14018,90 @@ mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplashApp.prototype.addLanguageMenu=function(b,l,p){var f=null;null!=this.menus.get("language")&&(f=document.createElement("div"),this.setElementTitle(f,"language"),f.className="geAdaptiveAsset",f.style.backgroundImage="url("+Editor.globeImage+")",f.style.backgroundPosition="right center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="19px 19px",f.style.width="19px",f.style.height="19px",mxUtils.setOpacity(f,40),f.style.position="absolute",f.style.cursor="pointer",f.style.bottom="20px",f.style.right=null!=p?p:"22px",l&&(f.style.direction="rtl",f.style.textAlign="right",f.style.right=null!=p?p:"24px",l=document.createElement("span"),l.style.display="inline-block",l.style.fontSize="12px",l.style.margin="2px 24px 0 0",l.style.userSelect="none",mxUtils.write(l,mxResources.get("language")),f.appendChild(l),l.className="geAdaptiveAsset"),mxEvent.addListener(f,"click",mxUtils.bind(this,function(x){this.editor.graph.popupMenuHandler.hideMenu();var z=new mxPopupMenu(this.menus.get("language").funct);z.smartSeparators=!0;z.showDisabled=!0;z.autoExpand=!0;z.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(z,arguments);z.destroy()});var y=mxUtils.getOffset(f);z.popup(y.x,y.y+f.offsetHeight,null,x);this.setCurrentMenu(z)})),b.appendChild(f));return f};-App.prototype.loadFileSystemEntry=function(b,l,p){p=null!=p?p:mxUtils.bind(this,function(f){this.handleError(f)});try{b.getFile().then(mxUtils.bind(this,function(f){var x=new FileReader;x.onload=mxUtils.bind(this,function(z){var y=mxUtils.bind(this,function(F){try{if(null!=l){var O=z.target.result;"image/png"==f.type&&(O=this.extractGraphModelFromPng(O));l(new LocalFile(this,O,f.name,null,b,f,F))}else this.openFileHandle(z.target.result,f.name,f,!1,b,F)}catch(K){p(K)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,-function(F){y("denied"!==F)})):b.createWritable().then(mxUtils.bind(this,function(){y(!0)}),mxUtils.bind(this,function(F){y(!1)}))});x.onerror=p;"image"!==f.type.substring(0,5)&&"application/pdf"!==f.type||"image/svg"===f.type.substring(0,9)?x.readAsText(f):x.readAsDataURL(f)}),p)}catch(f){p(f)}};+App.prototype.loadFileSystemEntry=function(b,l,p){p=null!=p?p:mxUtils.bind(this,function(f){this.handleError(f)});try{b.getFile().then(mxUtils.bind(this,function(f){var x=new FileReader;x.onload=mxUtils.bind(this,function(z){var y=mxUtils.bind(this,function(E){try{if(null!=l){var R=z.target.result;"image/png"==f.type&&(R=this.extractGraphModelFromPng(R));l(new LocalFile(this,R,f.name,null,b,f,E))}else this.openFileHandle(z.target.result,f.name,f,!1,b,E)}catch(K){p(K)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,+function(E){y("denied"!==E)})):b.createWritable().then(mxUtils.bind(this,function(){y(!0)}),mxUtils.bind(this,function(E){y(!1)}))});x.onerror=p;"image"!==f.type.substring(0,5)&&"application/pdf"!==f.type||"image/svg"===f.type.substring(0,9)?x.readAsText(f):x.readAsDataURL(f)}),p)}catch(f){p(f)}};App.prototype.createFileSystemOptions=function(b){var l=[],p=null;if(null!=b){var f=b.lastIndexOf(".");0<f&&(p=b.substring(f+1))}for(f=0;f<this.editor.diagramFileTypes.length;f++){var x={description:mxResources.get(this.editor.diagramFileTypes[f].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[f].extension+")":""),accept:{}};x.accept[this.editor.diagramFileTypes[f].mimeType]=["."+this.editor.diagramFileTypes[f].extension];this.editor.diagramFileTypes[f].extension==p?l.splice(0,0,x):this.editor.diagramFileTypes[f].extension==p?l.splice(0,0,x):l.push(x)}return{types:l,suggestedName:b}};App.prototype.showSaveFilePicker=function(b,l,p){l=null!=l?l:mxUtils.bind(this,function(f){"AbortError"!=f.name&&this.handleError(f)});p=null!=p?p:this.createFileSystemOptions();window.showSaveFilePicker(p).then(mxUtils.bind(this,function(f){null!=f&&f.getFile().then(mxUtils.bind(this,function(x){b(f,x)}),l)}),l)};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 l=this.getServiceForName(b);if(null!=l)l.pickFile();else if(b==App.MODE_DEVICE&&EditorUi.nativeFileSupport)window.showOpenFilePicker().then(mxUtils.bind(this,function(y){null!=y&&0<y.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(y[0])}),mxUtils.bind(this,function(y){"AbortError"!=y.name&&this.handleError(y)}));else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var p=document.createElement("input");p.setAttribute("type","file");mxEvent.addListener(p,"change",mxUtils.bind(this,function(){null!=p.files&&(this.openFiles(p.files),p.type="",p.type="file",p.value="")}));p.style.display="none";document.body.appendChild(p);this.openFileInputElt=p}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(y,F){StorageFile.listFiles(this,"F",y,F)});window.openBrowserFile=mxUtils.bind(this,function(y,F,O){StorageFile.getFileContent(this,y,F,O)});window.deleteBrowserFile=mxUtils.bind(this,function(y,F,O){StorageFile.deleteFile(this,y,F,O)});var f=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,-function(y,F){var O=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=F.substring(F.length-4)||(F=F.substring(0,F.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,y,F):new LocalFile(this,y,F))}),K=this.getCurrentFile();null!=K&&K.isModified()?this.confirm(mxResources.get("allChangesLost"),null,O,mxResources.get("cancel"),mxResources.get("discardChanges")):O()}));var x=this.dialog,z=x.close;this.dialog.close=mxUtils.bind(this,function(y){Editor.useLocalStorage=+null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(y,E){StorageFile.listFiles(this,"F",y,E)});window.openBrowserFile=mxUtils.bind(this,function(y,E,R){StorageFile.getFileContent(this,y,E,R)});window.deleteBrowserFile=mxUtils.bind(this,function(y,E,R){StorageFile.deleteFile(this,y,E,R)});var f=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,+function(y,E){var R=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=E.substring(E.length-4)||(E=E.substring(0,E.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,y,E):new LocalFile(this,y,E))}),K=this.getCurrentFile();null!=K&&K.isModified()?this.confirm(mxResources.get("allChangesLost"),null,R,mxResources.get("cancel"),mxResources.get("discardChanges")):R()}));var x=this.dialog,z=x.close;this.dialog.close=mxUtils.bind(this,function(y){Editor.useLocalStorage=f;z.apply(x,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(y){this.handleError(y)}};App.prototype.pickLibrary=function(b){b=null!=b?b:this.mode;var l=mxUtils.bind(this,function(z){try{this.loadLibrary(z);this.showSidebar();try{this.sidebar.palettes[z.getHash()][0].scrollIntoView({behavior:"smooth"})}catch(y){}}catch(y){this.handleError(y,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 p=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!=p&&p.pickLibrary(mxUtils.bind(this,function(z,y){null!=y?l(y):this.spinner.spin(document.body,mxResources.get("loading"))&&p.getLibrary(z,mxUtils.bind(this,function(F){this.spinner.stop();l(F)}),mxUtils.bind(this,function(F){this.handleError(F,null!=F?mxResources.get("errorLoadingFile"):null)}))}))}else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var f=document.createElement("input");-f.setAttribute("type","file");mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if(null!=f.files){for(var z=0;z<f.files.length;z++)mxUtils.bind(this,function(y){var F=new FileReader;F.onload=mxUtils.bind(this,function(O){l(new LocalLibrary(this,O.target.result,y.name))});F.readAsText(y)})(f.files[z]);f.type="";f.type="file";f.value=""}}));f.style.display="none";document.body.appendChild(f);this.libFileInputElt=f}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=-mxUtils.bind(this,function(z,y){StorageFile.listFiles(this,"L",z,y)});window.openBrowserFile=mxUtils.bind(this,function(z,y,F){StorageFile.getFileContent(this,z,y,F)});window.deleteBrowserFile=mxUtils.bind(this,function(z,y,F){StorageFile.deleteFile(this,z,y,F)});var x=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(z){this.hideDialog(z)}));window.openFile.setConsumer(mxUtils.bind(this,function(z,y){l(b==App.MODE_BROWSER?new StorageLibrary(this,+this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:this.dropbox;null!=p&&p.pickLibrary(mxUtils.bind(this,function(z,y){null!=y?l(y):this.spinner.spin(document.body,mxResources.get("loading"))&&p.getLibrary(z,mxUtils.bind(this,function(E){this.spinner.stop();l(E)}),mxUtils.bind(this,function(E){this.handleError(E,null!=E?mxResources.get("errorLoadingFile"):null)}))}))}else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var f=document.createElement("input");+f.setAttribute("type","file");mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if(null!=f.files){for(var z=0;z<f.files.length;z++)mxUtils.bind(this,function(y){var E=new FileReader;E.onload=mxUtils.bind(this,function(R){l(new LocalLibrary(this,R.target.result,y.name))});E.readAsText(y)})(f.files[z]);f.type="";f.type="file";f.value=""}}));f.style.display="none";document.body.appendChild(f);this.libFileInputElt=f}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=+mxUtils.bind(this,function(z,y){StorageFile.listFiles(this,"L",z,y)});window.openBrowserFile=mxUtils.bind(this,function(z,y,E){StorageFile.getFileContent(this,z,y,E)});window.deleteBrowserFile=mxUtils.bind(this,function(z,y,E){StorageFile.deleteFile(this,z,y,E)});var x=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(z){this.hideDialog(z)}));window.openFile.setConsumer(mxUtils.bind(this,function(z,y){l(b==App.MODE_BROWSER?new StorageLibrary(this,z,y):new LocalLibrary(this,z,y))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=x;window.openFile=null})}};-App.prototype.saveLibrary=function(b,l,p,f,x,z,y){try{f=null!=f?f:this.mode;x=null!=x?x:!1;z=null!=z?z:!1;var F=this.createLibraryDataFromImages(l),O=mxUtils.bind(this,function(M){this.spinner.stop();null!=y&&y();this.handleError(M,null!=M?mxResources.get("errorSavingFile"):null)});null==p&&f==App.MODE_DEVICE&&(p=new LocalLibrary(this,F,b));if(null==p)this.pickFolder(f,mxUtils.bind(this,function(M){f==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?-this.drive.insertFile(b,F,M,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),O,this.drive.libraryMimeType):f==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,F,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),O,M):f==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,-F,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),O,M):f==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,F,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),O,M):f==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,F,mxUtils.bind(this,function(c){this.spinner.stop();-this.hideDialog(!0);this.libraryLoaded(c,l)}),O,M):f==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,F,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),O,M):f==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,F,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,l)}),O):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));-else if(x||this.spinner.spin(document.body,mxResources.get("saving"))){p.setData(F);var K=mxUtils.bind(this,function(){p.save(!0,mxUtils.bind(this,function(M){this.spinner.stop();this.hideDialog(!0);z||this.libraryLoaded(p,l);null!=y&&y()}),O)});if(b!=p.getTitle()){var L=p.getHash();p.rename(b,mxUtils.bind(this,function(M){p.constructor!=LocalLibrary&&L!=p.getHash()&&(mxSettings.removeCustomLibrary(L),mxSettings.addCustomLibrary(p.getHash()));this.removeLibrarySidebar(L);K()}),O)}else K()}}catch(M){this.handleError(M)}};+App.prototype.saveLibrary=function(b,l,p,f,x,z,y){try{f=null!=f?f:this.mode;x=null!=x?x:!1;z=null!=z?z:!1;var E=this.createLibraryDataFromImages(l),R=mxUtils.bind(this,function(O){this.spinner.stop();null!=y&&y();this.handleError(O,null!=O?mxResources.get("errorSavingFile"):null)});null==p&&f==App.MODE_DEVICE&&(p=new LocalLibrary(this,E,b));if(null==p)this.pickFolder(f,mxUtils.bind(this,function(O){f==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?+this.drive.insertFile(b,E,O,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),R,this.drive.libraryMimeType):f==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,E,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),R,O):f==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,+E,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),R,O):f==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,E,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),R,O):f==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,E,mxUtils.bind(this,function(c){this.spinner.stop();+this.hideDialog(!0);this.libraryLoaded(c,l)}),R,O):f==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,E,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),R,O):f==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,E,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,l)}),R):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));+else if(x||this.spinner.spin(document.body,mxResources.get("saving"))){p.setData(E);var K=mxUtils.bind(this,function(){p.save(!0,mxUtils.bind(this,function(O){this.spinner.stop();this.hideDialog(!0);z||this.libraryLoaded(p,l);null!=y&&y()}),R)});if(b!=p.getTitle()){var L=p.getHash();p.rename(b,mxUtils.bind(this,function(O){p.constructor!=LocalLibrary&&L!=p.getHash()&&(mxSettings.removeCustomLibrary(L),mxSettings.addCustomLibrary(p.getHash()));this.removeLibrarySidebar(L);K()}),R)}else K()}}catch(O){this.handleError(O)}};App.prototype.saveFile=function(b,l){var p=this.getCurrentFile(),f=this.mode;if(null!=p){var x=mxUtils.bind(this,function(){EditorUi.enableDrafts&&p.removeDraft();this.getCurrentFile()==p||p.isModified()||(p.getMode()!=App.MODE_DEVICE?this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))})):this.clearStatus());null!=l&&l()});if(b||null==p.getTitle()||null!=p.invalidFileHandle||null==this.mode)if(null!=p&&p.constructor==LocalFile&&-null!=p.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(O,K){p.invalidFileHandle=null;p.fileHandle=O;p.title=K.name;p.desc=K;p.editable=null;this.save(K.name,x)}),null,this.createFileSystemOptions(p.getTitle()));else{var z=null!=p.getTitle()?p.getTitle():this.defaultFilename,y=mxUtils.bind(this,function(O,K,L,M){if(null!=O&&0<O.length)if(/(\.pdf)$/i.test(O))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),-mxUtils.bind(this,function(){L.value=O.split(".").slice(0,-1).join(".");L.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==f&&K==App.MODE_DEVICE)null!=p&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(d,k){p.fileHandle=d;p.mode=App.MODE_DEVICE;p.title=k.name;p.desc=k;this.setMode(App.MODE_DEVICE);this.save(k.name,x)}),mxUtils.bind(this,-function(d){"AbortError"!=d.name&&this.handleError(d)}),this.createFileSystemOptions(O)):(this.setMode(App.MODE_DEVICE),this.save(O,x));else if("download"==K)(new LocalFile(this,null,O)).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(b||f!=K){var c=mxUtils.bind(this,function(d){var k=this.editor.graph,m=k.getSelectionCells(),t=k.getViewState(),-v=this.currentPage;k=this.getCurrentFile();k=null==this.mode||null==k||null==k.mode;this.createFile(O,this.getFileData(/(\.xml)$/i.test(O)||0>O.indexOf(".")||/(\.drawio)$/i.test(O),/(\.svg)$/i.test(O),/(\.html)$/i.test(O)),null,K,x,k,d,null,null,mxUtils.bind(this,function(){this.restoreViewState(v,t,m)}))});null!=M?c(M):this.pickFolder(K,c)}else null!=K&&this.save(O,x)}),F=!mxClient.IS_IOS||!navigator.standalone;z=new SaveDialog(this,z,mxUtils.bind(this,function(O,K,L){y(O.value,K,O,L);this.hideDialog()}),-F?null:["_blank"]);this.showDialog(z.container,420,150,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));z.init()}else this.save(p.getTitle(),x)}};-App.prototype.loadTemplate=function(b,l,p,f,x){var z=!1,y=b,F=null!=f?f:b;f=/\.png$/i.test(F)||/\.pdf$/i.test(F);var O=EditorUi.isVisioFilename(F);this.editor.isCorsEnabledForUrl(y)||(z=f||O,y="t="+(new Date).getTime(),y=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+y+(z?"&base64=1":""));this.editor.loadUrl(y,mxUtils.bind(this,function(K){try{var L=z?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(K):atob(K):K;if(O||this.isVisioData(L))O||(F=x?this.isRemoteVisioData(L)?"raw.vss":"raw.vssx":-this.isRemoteVisioData(L)?"raw.vsd":"raw.vsdx"),this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(M){l(M)},p,F);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(L,F))this.isExternalDataComms()?this.parseFileData(L,mxUtils.bind(this,function(M){4==M.readyState&&200<=M.status&&299>=M.status&&"<mxGraphModel"==M.responseText.substring(0,13)&&l(M.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,p);else if(this.isLucidChartData(L))this.convertLucidChart(L,-mxUtils.bind(this,function(M){l(M)}),mxUtils.bind(this,function(M){p(M)}));else{if(/(\.png)($|\?)/i.test(F)||Editor.isPngData(L))L=Editor.extractGraphModelFromPng(K);l(L)}}catch(M){p(M)}}),p,/(\.png)($|\?)/i.test(F)||O,null,null,z)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};+null!=p.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(R,K){p.invalidFileHandle=null;p.fileHandle=R;p.title=K.name;p.desc=K;p.editable=null;this.save(K.name,x)}),null,this.createFileSystemOptions(p.getTitle()));else{var z=null!=p.getTitle()?p.getTitle():this.defaultFilename,y=mxUtils.bind(this,function(R,K,L,O){if(null!=R&&0<R.length)if(/(\.pdf)$/i.test(R))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),+mxUtils.bind(this,function(){L.value=R.split(".").slice(0,-1).join(".");L.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==f&&K==App.MODE_DEVICE)null!=p&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(d,k){p.fileHandle=d;p.mode=App.MODE_DEVICE;p.title=k.name;p.desc=k;this.setMode(App.MODE_DEVICE);this.save(k.name,x)}),mxUtils.bind(this,+function(d){"AbortError"!=d.name&&this.handleError(d)}),this.createFileSystemOptions(R)):(this.setMode(App.MODE_DEVICE),this.save(R,x));else if("download"==K)(new LocalFile(this,null,R)).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(b||f!=K){var c=mxUtils.bind(this,function(d){var k=this.editor.graph,m=k.getSelectionCells(),t=k.getViewState(),+u=this.currentPage;k=this.getCurrentFile();k=null==this.mode||null==k||null==k.mode;this.createFile(R,this.getFileData(/(\.xml)$/i.test(R)||0>R.indexOf(".")||/(\.drawio)$/i.test(R),/(\.svg)$/i.test(R),/(\.html)$/i.test(R)),null,K,x,k,d,null,null,mxUtils.bind(this,function(){this.restoreViewState(u,t,m)}))});null!=O?c(O):this.pickFolder(K,c)}else null!=K&&this.save(R,x)}),E=!mxClient.IS_IOS||!navigator.standalone;z=new SaveDialog(this,z,mxUtils.bind(this,function(R,K,L){y(R.value,K,R,L);this.hideDialog()}),+E?null:["_blank"]);this.showDialog(z.container,420,150,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));z.init()}else this.save(p.getTitle(),x)}};+App.prototype.loadTemplate=function(b,l,p,f,x){var z=!1,y=b,E=null!=f?f:b;f=/\.png$/i.test(E)||/\.pdf$/i.test(E);var R=EditorUi.isVisioFilename(E);this.editor.isCorsEnabledForUrl(y)||(z=f||R,y="t="+(new Date).getTime(),y=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+y+(z?"&base64=1":""));this.editor.loadUrl(y,mxUtils.bind(this,function(K){try{var L=z?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(K):atob(K):K;if(R||this.isVisioData(L))R||(E=x?this.isRemoteVisioData(L)?"raw.vss":"raw.vssx":+this.isRemoteVisioData(L)?"raw.vsd":"raw.vsdx"),this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(O){l(O)},p,E);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(L,E))this.isExternalDataComms()?this.parseFileData(L,mxUtils.bind(this,function(O){4==O.readyState&&200<=O.status&&299>=O.status&&"<mxGraphModel"==O.responseText.substring(0,13)&&l(O.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,p);else if(this.isLucidChartData(L))this.convertLucidChart(L,+mxUtils.bind(this,function(O){l(O)}),mxUtils.bind(this,function(O){p(O)}));else{if(/(\.png)($|\?)/i.test(E)||Editor.isPngData(L))L=Editor.extractGraphModelFromPng(K);l(L)}}catch(O){p(O)}}),p,/(\.png)($|\?)/i.test(E)||R,null,null,z)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"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):b==App.MODE_M365?null!=this.m365:!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 l=mxUtils.parseXml(b);if("mxfile"==l.documentElement.nodeName){for(var p=l.documentElement.getElementsByTagName("diagram"),f=0;f<p.length;f++){var x=Editor.parseDiagramNode(p[f],!0);null!=x&&(mxUtils.setTextContent(p[f],""),p[f].appendChild(x))}b=mxUtils.getPrettyXml(l.documentElement)}}catch(z){}return b};-App.prototype.createFile=function(b,l,p,f,x,z,y,F,O,K){EditorUi.debug("App.createFile",[this],"title",[b],"data",[l],"libs",[p],"mode",[f]);f=F?null:null!=f?f:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){l=null!=l?l:this.emptyDiagramXml;null==l||Editor.defaultCompressed||(l=this.uncompressPages(l));var L=mxUtils.bind(this,function(){this.spinner.stop()}),M=mxUtils.bind(this,function(d){L();null==d&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():-null!=d&&this.handleError(d)});try{var c=mxUtils.bind(this,function(d){L();this.fileCreated(d,p,z,x,O,K)});f==App.MODE_GOOGLE&&null!=this.drive?(null==y&&null!=this.stateArg&&null!=this.stateArg.folderId&&(y=this.stateArg.folderId),this.drive.insertFile(b,l,y,c,M)):f==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,l,c,M,!1,y):f==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,l,c,M,!1,y):f==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,l,c,M,!1,y):f==App.MODE_DROPBOX&&-null!=this.dropbox?this.dropbox.insertFile(b,l,c,M):f==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,l,c,M,!1,y):f==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,l,c,M,!1,y):f==App.MODE_BROWSER?StorageFile.insertFile(this,b,l,c,M):!F&&f==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(L(),this.showSaveFilePicker(mxUtils.bind(this,function(d,k){var m=new LocalFile(this,l,k.name,null,d,k);m.saveFile(k.name,!1,mxUtils.bind(this,function(){this.fileCreated(m,p,z,x,O,K)}),M,!0)}),-mxUtils.bind(this,function(d){"AbortError"!=d.name&&M(d)}),this.createFileSystemOptions(b))):(L(),this.fileCreated(new LocalFile(this,l,b,null==f),p,z,x,O,K))}catch(d){L(),this.handleError(d)}}};-App.prototype.fileCreated=function(b,l,p,f,x,z){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[l],"replace",[p]);var y=window.location.pathname;null!=l&&0<l.length&&(y+="?libs="+l);null!=x&&0<x.length&&(y+="?clibs="+x);y=this.getUrl(y);b.getMode()!=App.MODE_DEVICE&&(y+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var F=b.getData();F=0<F.length?this.editor.extractGraphModel(mxUtils.parseXml(F).documentElement,!0):null;var O=window.location.protocol+-"//"+window.location.hostname+y,K=F,L=null;null!=F&&/\.svg$/i.test(b.getTitle())&&(L=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(L.container),K=this.decodeNodeIntoGraph(K,L));b.setData(this.createFileData(F,L,b,O));null!=L&&L.container.parentNode.removeChild(L.container);var M=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){M();var d=this.getCurrentFile();null==p&&null!=d&&(p=!d.isModified()&&(null==d.getMode()||EditorUi.isElectronApp));-var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,z);p&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=l&&this.sidebar.showEntries(l);if(null!=x){for(var t=[],v=x.split(";"),A=0;A<v.length;A++)t.push(decodeURIComponent(v[A]));this.loadLibraries(t)}null!=f&&f()}),m=mxUtils.bind(this,function(){p||null==d||!d.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});-null==p||p?m():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(y,null,m))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(d){M();null!=d&&"AbortError"==d.name||this.handleError(d)}))}};-App.prototype.loadFile=function(b,l,p,f,x){if("1"==urlParams.openInSameWin||navigator.standalone)l=!0;this.hideDialog();var z=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var O=mxUtils.bind(this,function(t){this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var v=this.getCurrentFile();window.location.hash=-null!=v?v.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(t){null!=t?(this.fileLoaded(new StorageFile(this,t,b)),null!=f&&f()):O({message:mxResources.get("fileNotFound")})}),O)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var t=this.getCurrentFile();window.location.hash=null!=t?t.getHash():""}));else if(null!=p)this.spinner.stop(),this.fileLoaded(p),-null!=f&&f();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("create="==b.substring(0,7)){var K=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==K.type){var L=window.opener||window.parent,M=mxUtils.bind(this,function(t){EditorUi.debug("EditorUi.createMessageHandler",-[this],"evt",[t]);if(t.source==L)try{"create"==t.data.action&&null!=t.data.data&&(mxEvent.removeListener(window,"message",M),this.executeCreateObject(t.data.data))}catch(v){c=null}});mxEvent.addListener(window,"message",M);L.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(K)}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));K=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):-this.defaultFilename,!0);K.getHash=function(){return b};this.fileLoaded(K);null!=f&&f()}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(t,v){this.spinner.stop();this.fileLoaded(new EmbedFile(this,t,v));null!=f&&f()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},-mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var d=decodeURIComponent(b.substring(1)),k=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=d.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var t=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var v=d.substring(31,d.lastIndexOf("&ex"));this.loadFile("G"+v,l,null,mxUtils.bind(this,function(){var A=this.getCurrentFile();null!=A&&this.editor.chromeless&&-!this.editor.editable&&(A.getHash=function(){return"G"+v},window.location.hash="#"+A.getHash());null!=f&&f()}));return!0}return!1});!t()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",t);return!0});this.loadTemplate(d,mxUtils.bind(this,function(t){this.spinner.stop();if(null!=t&&0<t.length){var v=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var A=d,C=d.lastIndexOf("."),E=A.lastIndexOf("/");C>E&&0<E&&(A=A.substring(E+1,C),C=d.substring(C),-Editor.useCanvasForExport||".png"!=C||(C=".drawio"),".svg"===C||".xml"===C||".html"===C||".png"===C||".drawio"===C)&&(v=A+C)}t=new LocalFile(this,t,null!=urlParams.title?decodeURIComponent(urlParams.title):v,!0);t.getHash=function(){return b};this.fileLoaded(t,!0)?null!=f&&f():k()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else k()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,+App.prototype.createFile=function(b,l,p,f,x,z,y,E,R,K){EditorUi.debug("App.createFile",[this],"title",[b],"data",[l],"libs",[p],"mode",[f]);f=E?null:null!=f?f:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){l=null!=l?l:this.emptyDiagramXml;null==l||Editor.defaultCompressed||(l=this.uncompressPages(l));var L=mxUtils.bind(this,function(){this.spinner.stop()}),O=mxUtils.bind(this,function(d){L();null==d&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():+null!=d&&this.handleError(d)});try{var c=mxUtils.bind(this,function(d){L();this.fileCreated(d,p,z,x,R,K)});f==App.MODE_GOOGLE&&null!=this.drive?(null==y&&null!=this.stateArg&&null!=this.stateArg.folderId&&(y=this.stateArg.folderId),this.drive.insertFile(b,l,y,c,O)):f==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,l,c,O,!1,y):f==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,l,c,O,!1,y):f==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,l,c,O,!1,y):f==App.MODE_DROPBOX&&+null!=this.dropbox?this.dropbox.insertFile(b,l,c,O):f==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,l,c,O,!1,y):f==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,l,c,O,!1,y):f==App.MODE_BROWSER?StorageFile.insertFile(this,b,l,c,O):!E&&f==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(L(),this.showSaveFilePicker(mxUtils.bind(this,function(d,k){var m=new LocalFile(this,l,k.name,null,d,k);m.saveFile(k.name,!1,mxUtils.bind(this,function(){this.fileCreated(m,p,z,x,R,K)}),O,!0)}),+mxUtils.bind(this,function(d){"AbortError"!=d.name&&O(d)}),this.createFileSystemOptions(b))):(L(),this.fileCreated(new LocalFile(this,l,b,null==f),p,z,x,R,K))}catch(d){L(),this.handleError(d)}}};+App.prototype.fileCreated=function(b,l,p,f,x,z){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[l],"replace",[p]);var y=window.location.pathname;null!=l&&0<l.length&&(y+="?libs="+l);null!=x&&0<x.length&&(y+="?clibs="+x);y=this.getUrl(y);b.getMode()!=App.MODE_DEVICE&&(y+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var E=b.getData();E=0<E.length?this.editor.extractGraphModel(mxUtils.parseXml(E).documentElement,!0):null;var R=window.location.protocol++"//"+window.location.hostname+y,K=E,L=null;null!=E&&/\.svg$/i.test(b.getTitle())&&(L=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(L.container),K=this.decodeNodeIntoGraph(K,L));b.setData(this.createFileData(E,L,b,R));null!=L&&L.container.parentNode.removeChild(L.container);var O=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){O();var d=this.getCurrentFile();null==p&&null!=d&&(p=!d.isModified()&&(null==d.getMode()||EditorUi.isElectronApp));+var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,z);p&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=l&&this.sidebar.showEntries(l);if(null!=x){for(var t=[],u=x.split(";"),A=0;A<u.length;A++)t.push(decodeURIComponent(u[A]));this.loadLibraries(t)}null!=f&&f()}),m=mxUtils.bind(this,function(){p||null==d||!d.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});+null==p||p?m():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(y,null,m))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(d){O();null!=d&&"AbortError"==d.name||this.handleError(d)}))}};+App.prototype.loadFile=function(b,l,p,f,x){if("1"==urlParams.openInSameWin||navigator.standalone)l=!0;this.hideDialog();var z=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var R=mxUtils.bind(this,function(t){this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var u=this.getCurrentFile();window.location.hash=+null!=u?u.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(t){null!=t?(this.fileLoaded(new StorageFile(this,t,b)),null!=f&&f()):R({message:mxResources.get("fileNotFound")})}),R)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var t=this.getCurrentFile();window.location.hash=null!=t?t.getHash():""}));else if(null!=p)this.spinner.stop(),this.fileLoaded(p),+null!=f&&f();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("create="==b.substring(0,7)){var K=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==K.type){var L=window.opener||window.parent,O=mxUtils.bind(this,function(t){EditorUi.debug("EditorUi.createMessageHandler",+[this],"evt",[t]);if(t.source==L)try{"create"==t.data.action&&null!=t.data.data&&(mxEvent.removeListener(window,"message",O),this.executeCreateObject(t.data.data))}catch(u){c=null}});mxEvent.addListener(window,"message",O);L.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(K)}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));K=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):+this.defaultFilename,!0);K.getHash=function(){return b};this.fileLoaded(K);null!=f&&f()}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(t,u){this.spinner.stop();this.fileLoaded(new EmbedFile(this,t,u));null!=f&&f()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},+mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var d=decodeURIComponent(b.substring(1)),k=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=d.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var t=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var u=d.substring(31,d.lastIndexOf("&ex"));this.loadFile("G"+u,l,null,mxUtils.bind(this,function(){var A=this.getCurrentFile();null!=A&&this.editor.chromeless&&+!this.editor.editable&&(A.getHash=function(){return"G"+u},window.location.hash="#"+A.getHash());null!=f&&f()}));return!0}return!1});!t()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",t);return!0});this.loadTemplate(d,mxUtils.bind(this,function(t){this.spinner.stop();if(null!=t&&0<t.length){var u=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var A=d,B=d.lastIndexOf("."),D=A.lastIndexOf("/");B>D&&0<D&&(A=A.substring(D+1,B),B=d.substring(B),+Editor.useCanvasForExport||".png"!=B||(B=".drawio"),".svg"===B||".xml"===B||".html"===B||".png"===B||".drawio"===B)&&(u=A+B)}t=new LocalFile(this,t,null!=urlParams.title?decodeURIComponent(urlParams.title):u,!0);t.getHash=function(){return b};this.fileLoaded(t,!0)?null!=f&&f():k()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else k()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){k()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else{var m=this.getModeForChar(b.charAt(0));mxUtils.bind(this,function(){var t=this.getServiceForName(m);if(null==t)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var A=this.getCurrentFile();-window.location.hash=null!=A?A.getHash():""}));else{var v=b.charAt(0);b=decodeURIComponent(b.substring(1));t.getFile(b,mxUtils.bind(this,function(A){this.spinner.stop();this.fileLoaded(A);var C=this.getCurrentFile();if(null==C)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){C.getHash=function(){return v+b};A="#"+C.getHash();try{var E=this.getHashObject();null==E||mxUtils.isEmptyObject(E)||(A=A+"#"+encodeURIComponent(JSON.stringify(E)))}catch(D){}window.location.replace(A)}else A==-C&&null==A.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var D=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+D+'" class="geStatusAlert">'+D+"</div>")}));null!=f&&f()}),mxUtils.bind(this,function(A){null!=window.console&&null!=A&&console.log("error in loadFile:",b,A);var C=mxUtils.bind(this,function(){var E=this.getCurrentFile();null==E?(window.location.hash="",this.showSplash()):window.location.hash="#"+E.getHash()});null==A||"AbortError"!=A.name?this.handleError(A,-null!=A?mxResources.get("errorLoadingFile"):null,C,null,null,"#"+v+b):C()}))}})()}}),y=this.getCurrentFile(),F=mxUtils.bind(this,function(){x||null==y||!y.isModified()?z():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=y&&(window.location.hash=y.getHash())}),z,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==l&&null!=y&&!y.isModified()&&this.isBlankFile()?F():null==y||l?F():this.showDialog((new PopupDialog(this,this.getUrl()+-"#"+b,null,F)).container,340,140,!0,!0)};+window.location.hash=null!=A?A.getHash():""}));else{var u=b.charAt(0);b=decodeURIComponent(b.substring(1));t.getFile(b,mxUtils.bind(this,function(A){this.spinner.stop();this.fileLoaded(A);var B=this.getCurrentFile();if(null==B)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){B.getHash=function(){return u+b};A="#"+B.getHash();try{var D=this.getHashObject();null==D||mxUtils.isEmptyObject(D)||(A=A+"#"+encodeURIComponent(JSON.stringify(D)))}catch(N){}window.location.replace(A)}else A==+B&&null==A.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var N=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+N+'" class="geStatusAlert">'+N+"</div>")}));null!=f&&f()}),mxUtils.bind(this,function(A){null!=window.console&&null!=A&&console.log("error in loadFile:",b,A);var B=mxUtils.bind(this,function(){var D=this.getCurrentFile();null==D?(window.location.hash="",this.showSplash()):window.location.hash="#"+D.getHash()});null==A||"AbortError"!=A.name?this.handleError(A,+null!=A?mxResources.get("errorLoadingFile"):null,B,null,null,"#"+u+b):B()}))}})()}}),y=this.getCurrentFile(),E=mxUtils.bind(this,function(){x||null==y||!y.isModified()?z():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=y&&(window.location.hash=y.getHash())}),z,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==l&&null!=y&&!y.isModified()&&this.isBlankFile()?E():null==y||l?E():this.showDialog((new PopupDialog(this,this.getUrl()++"#"+b,null,E)).container,340,140,!0,!0)};App.prototype.getLibraryStorageHint=function(b){var l=b.getTitle();b.constructor!=LocalLibrary&&(l+="\n"+b.getHash());b.constructor==DriveLibrary?l+=" ("+mxResources.get("googleDrive")+")":b.constructor==GitHubLibrary?l+=" ("+mxResources.get("github")+")":b.constructor==TrelloLibrary?l+=" ("+mxResources.get("trello")+")":b.constructor==DropboxLibrary?l+=" ("+mxResources.get("dropbox")+")":b.constructor==OneDriveLibrary?l+=" ("+mxResources.get("oneDrive")+")":b.constructor==StorageLibrary?l+=" ("+mxResources.get("browser")+")":b.constructor==LocalLibrary&&(l+=" ("+mxResources.get("device")+")");return l};App.prototype.restoreLibraries=function(){function b(p){for(var f=0;f<p.length;f++)""!=p[f]&&0>mxUtils.indexOf(l,p[f])&&l.push(p[f])}var l=[];b(mxSettings.getCustomLibraries());b((urlParams.clibs||"").split(";"));this.loadLibraries(l)};-App.prototype.loadLibraries=function(b,l){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var p=mxUtils.bind(this,function(K,L){L||mxSettings.removeCustomLibrary(K);delete this.loadedLibraries[K]}),f=0,x=[],z=0<b.length&&"L.scratchpad"==b[0]?1:0,y=mxUtils.bind(this,function(){if(0==f){if(null!=b)for(var K=b.length-1;0<=K;K--)null!=x[K]&&this.loadLibrary(x[K],K<=z);null!=l&&l()}});if(null!=b)for(var F=0;F<b.length;F++){var O=encodeURIComponent(decodeURIComponent(b[F]));-mxUtils.bind(this,function(K,L){if(null!=K&&0<K.length&&null==this.loadedLibraries[K]&&null==this.sidebar.palettes[K]){this.loadedLibraries[K]=!0;f++;var M=mxUtils.bind(this,function(v){x[L]=v;f--;y()}),c=mxUtils.bind(this,function(v){p(K,v);f--;y()}),d=K.substring(0,1);if("L"==d)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var v=decodeURIComponent(K.substring(1));StorageFile.getFileContent(this,v,mxUtils.bind(this,function(A){".scratchpad"!=v||null!=-A&&"<mxfile"!=A.substring(0,7)||(A=this.emptyLibraryXml);null!=A?M(new StorageLibrary(this,A,v)):c()}),c)}catch(A){c()}}),0);else if("U"==d){var k=decodeURIComponent(K.substring(1));this.isOffline()?c(!0):this.loadTemplate(k,mxUtils.bind(this,function(v){null!=v&&0<v.length?M(new UrlLibrary(this,v,k)):c()}),function(){c()},null,!0)}else if("R"==d){d=decodeURIComponent(K.substring(1));try{d=JSON.parse(d);var m={id:d[0],title:d[1],downloadUrl:d[2]};this.remoteInvoke("getFileContent",[m.downloadUrl],-null,mxUtils.bind(this,function(v){try{M(new RemoteLibrary(this,v,m))}catch(A){c()}}),function(){c()})}catch(v){c()}}else if("S"==d&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(K.substring(1)),function(v){M(v)},c)}catch(v){c()}else{var t=null;"G"==d?null!=this.drive&&null!=this.drive.user&&(t=this.drive):"H"==d?null!=this.gitHub&&null!=this.gitHub.getUser()&&(t=this.gitHub):"T"==d?null!=this.trello&&this.trello.isAuthorized()&&(t=this.trello):"D"==d?null!=this.dropbox&&null!=-this.dropbox.getUser()&&(t=this.dropbox):"W"==d&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(t=this.oneDrive);null!=t?t.getLibrary(decodeURIComponent(K.substring(1)),mxUtils.bind(this,function(v){try{M(v)}catch(A){c()}}),function(v){c()}):c(!0)}}})(O,F)}y()}};+App.prototype.loadLibraries=function(b,l){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var p=mxUtils.bind(this,function(K,L){L||mxSettings.removeCustomLibrary(K);delete this.loadedLibraries[K]}),f=0,x=[],z=0<b.length&&"L.scratchpad"==b[0]?1:0,y=mxUtils.bind(this,function(){if(0==f){if(null!=b)for(var K=b.length-1;0<=K;K--)null!=x[K]&&this.loadLibrary(x[K],K<=z);null!=l&&l()}});if(null!=b)for(var E=0;E<b.length;E++){var R=encodeURIComponent(decodeURIComponent(b[E]));+mxUtils.bind(this,function(K,L){if(null!=K&&0<K.length&&null==this.loadedLibraries[K]&&null==this.sidebar.palettes[K]){this.loadedLibraries[K]=!0;f++;var O=mxUtils.bind(this,function(u){x[L]=u;f--;y()}),c=mxUtils.bind(this,function(u){p(K,u);f--;y()}),d=K.substring(0,1);if("L"==d)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var u=decodeURIComponent(K.substring(1));StorageFile.getFileContent(this,u,mxUtils.bind(this,function(A){".scratchpad"!=u||null!=+A&&"<mxfile"!=A.substring(0,7)||(A=this.emptyLibraryXml);null!=A?O(new StorageLibrary(this,A,u)):c()}),c)}catch(A){c()}}),0);else if("U"==d){var k=decodeURIComponent(K.substring(1));this.isOffline()?c(!0):this.loadTemplate(k,mxUtils.bind(this,function(u){null!=u&&0<u.length?O(new UrlLibrary(this,u,k)):c()}),function(){c()},null,!0)}else if("R"==d){d=decodeURIComponent(K.substring(1));try{d=JSON.parse(d);var m={id:d[0],title:d[1],downloadUrl:d[2]};this.remoteInvoke("getFileContent",[m.downloadUrl],+null,mxUtils.bind(this,function(u){try{O(new RemoteLibrary(this,u,m))}catch(A){c()}}),function(){c()})}catch(u){c()}}else if("S"==d&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(K.substring(1)),function(u){O(u)},c)}catch(u){c()}else{var t=null;"G"==d?null!=this.drive&&null!=this.drive.user&&(t=this.drive):"H"==d?null!=this.gitHub&&null!=this.gitHub.getUser()&&(t=this.gitHub):"T"==d?null!=this.trello&&this.trello.isAuthorized()&&(t=this.trello):"D"==d?null!=this.dropbox&&null!=+this.dropbox.getUser()&&(t=this.dropbox):"W"==d&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(t=this.oneDrive);null!=t?t.getLibrary(decodeURIComponent(K.substring(1)),mxUtils.bind(this,function(u){try{O(u)}catch(A){c()}}),function(u){c()}):c(!0)}}})(R,E)}y()}};App.prototype.updateButtonContainer=function(b){if(null!=this.buttonContainer)if(EditorUi.isElectronApp||this.isOffline()||b||(null!=urlParams.notif?this.fetchAndShowNotification(urlParams.notif):"1"!=urlParams.extAuth&&"atlas"!=Editor.currentTheme&&this.fetchAndShowNotification("online",this.mode)),this.isStandaloneApp()||"simple"==Editor.currentTheme&&"1"!=urlParams.embed)this.buttonContainer.style.display="none",null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.sketchMenubarElt&&this.sketchMenubarElt.appendChild(this.notificationBtn);else{this.buttonContainer.style.display="";b=this.getCurrentFile();null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.buttonContainer&&this.buttonContainer.appendChild(this.notificationBtn);"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&(null==this.commentButton&&(this.commentButton=document.createElement("a"),this.setElementTitle(this.commentButton,"comments"),this.commentButton.className="geButton geRoundButton",this.commentButton.style.backgroundImage="url("+Editor.commentImage+")",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),this.buttonContainer.appendChild(this.commentButton)),this.commentButton.style.display=this.commentsSupported()?"":"none");if(null==this.shareButton){this.shareButton=document.createElement("button");this.shareButton.className="geBtn gePrimaryBtn";var l=document.createElement("div");l.className="geButton";l.style.backgroundImage="url("+Editor.groupImage+")";this.shareButton.appendChild(l);this.dependsOnLanguage(mxUtils.bind(this,function(){l.innerHTML="";mxUtils.write(l,mxResources.get("share"));this.shareButton.setAttribute("title",mxResources.get("share"))}));mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,function(){this.actions.get("share").funct()}));this.buttonContainer.appendChild(this.shareButton)}this.shareButton.style.display=null!=b&&"kennedy"==Editor.currentTheme&&"1"!=urlParams.embed?"":"none";-if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=document.createElement("a");this.userButton.className="geButton geRoundButton";var p=document.createElement("img");this.userButton.appendChild(p);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(F){this.toggleUserPanel();var O=this.userButton.getBoundingClientRect(),K=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=O.bottom+"px";this.userPanel.style.right=K-O.right+"px";-mxEvent.consume(F)}));var f=document.createElement("img");f.style.position="absolute";f.style.width="10px";this.userButton.appendChild(f);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){p=this.userButton.getElementsByTagName("img")[0];f=this.userButton.getElementsByTagName("img")[1];var x=mxResources.get("changeUser"),z=this.getMainUser();null!=z&&null!=z.displayName&&(x=z.displayName);null!=z&&null!=z.pictureUrl?(p.classList.remove("geAdaptiveAsset"),p.src=z.pictureUrl,f.style.top=+if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=document.createElement("a");this.userButton.className="geButton geRoundButton";var p=document.createElement("img");this.userButton.appendChild(p);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(E){this.toggleUserPanel();var R=this.userButton.getBoundingClientRect(),K=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=R.bottom+"px";this.userPanel.style.right=K-R.right+"px";+mxEvent.consume(E)}));var f=document.createElement("img");f.style.position="absolute";f.style.width="10px";this.userButton.appendChild(f);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){p=this.userButton.getElementsByTagName("img")[0];f=this.userButton.getElementsByTagName("img")[1];var x=mxResources.get("changeUser"),z=this.getMainUser();null!=z&&null!=z.displayName&&(x=z.displayName);null!=z&&null!=z.pictureUrl?(p.classList.remove("geAdaptiveAsset"),p.src=z.pictureUrl,f.style.top="3px",f.style.right="0"):(p.classList.add("geAdaptiveAsset"),p.src=Editor.userImage,f.style.top="6px",f.style.right="4px");if(null!=b&&b.isRealtimeEnabled()&&b.isRealtimeSupported()){f.style.display="";p=b.getRealtimeError();var y=b.getRealtimeState();x+=" (";1==y?(f.src=Editor.syncImage,x+=mxResources.get("online")):(f.src=Editor.syncProblemImage,x=null!=p&&null!=p.message?x+p.message:x+mxResources.get("disconnected"));x+=")"}else f.style.display="none",f.src=Editor.cloudImage;this.userButton.setAttribute("title",x);this.userButton.style.display="draw.io"!=this.getServiceName()||null==z||"1"==urlParams.embed||this.isStandaloneApp()||null==b?"none":""}}}};-App.prototype.fetchAndShowNotification=function(b,l){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var p=null,f=mxUtils.bind(this,function(x){x=x.filter(function(O){return!O.targets||-1<O.targets.indexOf(b)||null!=l&&-1<O.targets.indexOf(l)});for(var z=b+"NotifReadTS",y=isLocalStorage?parseInt(localStorage.getItem(z)):!0,F=0;F<x.length;F++)x[F].isNew=!y||x[F].timestamp>y;this.showNotification(x,z)});try{isLocalStorage&&(p=JSON.parse(localStorage.getItem(".notifCache")))}catch(x){}null==-p||p.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(x){if(200<=x.getStatus()&&299>=x.getStatus())try{var z=JSON.parse(x.getText());z.sort(function(y,F){return F.timestamp-y.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:z}));this.fetchingNotif=!1;f(z)}catch(y){}}))):f(p.notifs)}};+App.prototype.fetchAndShowNotification=function(b,l){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var p=null,f=mxUtils.bind(this,function(x){x=x.filter(function(R){return!R.targets||-1<R.targets.indexOf(b)||null!=l&&-1<R.targets.indexOf(l)});for(var z=b+"NotifReadTS",y=isLocalStorage?parseInt(localStorage.getItem(z)):!0,E=0;E<x.length;E++)x[E].isNew=!y||x[E].timestamp>y;this.showNotification(x,z)});try{isLocalStorage&&(p=JSON.parse(localStorage.getItem(".notifCache")))}catch(x){}null==+p||p.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(x){if(200<=x.getStatus()&&299>=x.getStatus())try{var z=JSON.parse(x.getText());z.sort(function(y,E){return E.timestamp-y.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:z}));this.fetchingNotif=!1;f(z)}catch(y){}}))):f(p.notifs)}};App.prototype.showNotification=function(b,l){function p(K){var L=document.querySelector(".geNotification-count");null!=L&&(L.innerHTML=K,L.style.display=0==K?"none":"",L=document.querySelector(".geNotification-bell"),L.style.animation=0==K?"none":"",L.className="geNotification-bell"+(0==K?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==K?"none":"")}var f=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var x=f=0;x<b.length;x++)b[x].isNew&&f++;if(0==f)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var z=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var K=this.notificationWin.querySelectorAll(".circle.active"),L=0;L<K.length;L++)K[L].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(l,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className="geNotification-box";f=document.createElement("span");f.className="geNotification-count";this.notificationBtn.appendChild(f);this.notifCount=f;f=document.createElement("div");f.className="geNotification-bell";x=document.createElement("span");x.className="geBell-top";f.appendChild(x);x=document.createElement("span");x.className="geBell-middle";f.appendChild(x);x=document.createElement("span");x.className="geBell-bottom";f.appendChild(x);x=document.createElement("span");x.className="geBell-rad";f.appendChild(x);this.notificationBtn.appendChild(f);this.notificationWin=document.createElement("div");this.notificationWin.className="geNotifPanel";this.notificationWin.style.display="none";document.body.appendChild(this.notificationWin);x=document.createElement("div");x.className="header";f=document.createElement("span");f.className="title";f.textContent=mxResources.get("notifications");x.appendChild(f);f=document.createElement("span");f.className="closeBtn";f.textContent="x";x.appendChild(f);this.notificationWin.appendChild(x);x=document.createElement("div");x.className="notifications clearfix";var y=document.createElement("div");y.setAttribute("id","geNotifList");y.style.position="relative";x.appendChild(y);this.notificationWin.appendChild(x);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 K=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=-K.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=K.right-this.notificationWin.clientWidth+"px";p(0)}else z()}));mxEvent.addListener(f,"click",z)}else this.notificationBtn.style.display="";var F=0,O=document.getElementById("geNotifList");if(null!=O){O.innerHTML='<div class="line"></div>';for(x=0;x<b.length;x++)(function(K,L){L.isNew&&F++;var M=document.createElement("div");M.className="notification";K=K.timeSince(new Date(L.timestamp));null==K&&(K=mxResources.get("lessThanAMinute"));-M.innerHTML='<div class="circle'+(L.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[K],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(L.content)+"</p>";L.link&&mxEvent.addListener(M,"click",function(){window.open(L.link,"notifWin")});O.appendChild(M)})(this,b[x]);p(F)}}};-App.prototype.save=function(b,l){var p=this.getCurrentFile(),f=!0,x=mxUtils.bind(this,function(){f&&(f=!1,p.handleFileSuccess(!0),null!=l&&l())}),z=mxUtils.bind(this,function(y){if(f){f=!1;Editor.addRetryToError(y,mxUtils.bind(this,function(){this.save(b,l)}));if(null!=y&&null!=y.retry){var F=y.retry;y.retry=function(){f=!0;try{p.isModified()?F():x()}catch(O){z(O)}}}p.handleFileError(y,null==y||"AbortError"!=y.name)}});if(null!=p&&this.spinner.spin(document.body,mxResources.get("saving"),z,3*this.timeout))try{this.clearStatus(),+K.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=K.right-this.notificationWin.clientWidth+"px";p(0)}else z()}));mxEvent.addListener(f,"click",z)}else this.notificationBtn.style.display="";var E=0,R=document.getElementById("geNotifList");if(null!=R){R.innerHTML='<div class="line"></div>';for(x=0;x<b.length;x++)(function(K,L){L.isNew&&E++;var O=document.createElement("div");O.className="notification";K=K.timeSince(new Date(L.timestamp));null==K&&(K=mxResources.get("lessThanAMinute"));+O.innerHTML='<div class="circle'+(L.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[K],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(L.content)+"</p>";L.link&&mxEvent.addListener(O,"click",function(){window.open(L.link,"notifWin")});R.appendChild(O)})(this,b[x]);p(E)}}};+App.prototype.save=function(b,l){var p=this.getCurrentFile(),f=!0,x=mxUtils.bind(this,function(){f&&(f=!1,p.handleFileSuccess(!0),null!=l&&l())}),z=mxUtils.bind(this,function(y){if(f){f=!1;Editor.addRetryToError(y,mxUtils.bind(this,function(){this.save(b,l)}));if(null!=y&&null!=y.retry){var E=y.retry;y.retry=function(){f=!0;try{p.isModified()?E():x()}catch(R){z(R)}}}p.handleFileError(y,null==y||"AbortError"!=y.name)}});if(null!=p&&this.spinner.spin(document.body,mxResources.get("saving"),z,3*this.timeout))try{this.clearStatus(),this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==p.getTitle()?p.save(!0,x,z):p.saveAs(b,x,z)}catch(y){z(y)}};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_M365?this.m365: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"):b==App.MODE_M365?mxResources.get("m365"):EditorUi.prototype.getTitleForService.apply(this,arguments)};-App.prototype.pickFolder=function(b,l,p,f,x,z){p=null!=p?p:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var y=this.spinner.pause();p&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(F){y();if(F.action==google.picker.Action.PICKED){var O=null;null!=F.docs&&0<F.docs.length&&"folder"==F.docs[0].type&&(O=F.docs[0].id);l(z?F:O)}}),x):p&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(F){y();-if(null!=F&&null!=F.value&&0<F.value.length){var O=OneDriveFile.prototype.getIdOf(F.value[0]);l(z?F:O)}}),f):p&&b==App.MODE_M365&&null!=this.m365?this.m365.pickFolder(mxUtils.bind(this,function(F){y();if(null!=F&&null!=F.value&&0<F.value.length){var O=OneDriveFile.prototype.getIdOf(F.value[0]);l(z?F:O)}}),f):p&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(F){y();l(F)})):p&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(F){y();-l(F)})):p&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(F){y();l(F)})):EditorUi.prototype.pickFolder.apply(this,arguments)};+App.prototype.pickFolder=function(b,l,p,f,x,z){p=null!=p?p:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var y=this.spinner.pause();p&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(E){y();if(E.action==google.picker.Action.PICKED){var R=null;null!=E.docs&&0<E.docs.length&&"folder"==E.docs[0].type&&(R=E.docs[0].id);l(z?E:R)}}),x):p&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(E){y();+if(null!=E&&null!=E.value&&0<E.value.length){var R=OneDriveFile.prototype.getIdOf(E.value[0]);l(z?E:R)}}),f):p&&b==App.MODE_M365&&null!=this.m365?this.m365.pickFolder(mxUtils.bind(this,function(E){y();if(null!=E&&null!=E.value&&0<E.value.length){var R=OneDriveFile.prototype.getIdOf(E.value[0]);l(z?E:R)}}),f):p&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(E){y();l(E)})):p&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(E){y();+l(E)})):p&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(E){y();l(E)})):EditorUi.prototype.pickFolder.apply(this,arguments)};App.prototype.exportFile=function(b,l,p,f,x,z){x==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(l,f?this.base64ToBlob(b,p):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)})):x==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(l,b,z,mxUtils.bind(this,function(y){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),p,f):x==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(l,f?this.base64ToBlob(b,p):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),!1,z):x==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(l,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),!0,z,f):x==App.MODE_GITLAB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitLab.insertFile(l,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),!0,z,f):x==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(l,f?this.base64ToBlob(b,@@ -14098,11 +14110,11 @@ function(){localStorage.setItem(l,b)}),null==localStorage.getItem(l)?p():this.coApp.prototype.descriptorChanged=function(){var b=this.getCurrentFile();if(null!=b){if(null!=this.fname){this.fname.innerText="";var l=null!=b.getTitle()?b.getTitle():this.defaultFilename;mxUtils.write(this.fname,l)}l=this.editor.graph;var p=b.isEditable();l.isEnabled()&&!p&&l.reset();l.setEnabled(p);null==urlParams.rev&&(this.updateDocumentTitle(),l=b.getHash(),0<l.length?(l!=this.getDiagramId()&&(window.location.hash=l),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,l,p,f){var x=this.spinner.pause();this.showDialog((new AuthDialog(this,b,l,mxUtils.bind(this,function(z){try{null!=p&&p(z,mxUtils.bind(this,function(){this.hideDialog();x()}))}catch(y){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(y.message))}))}}))).container,300,l?180:140,!0,!0,mxUtils.bind(this,function(z){null!=f&&f(z);z&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};-App.prototype.convertFile=function(b,l,p,f,x,z,y,F){var O=l;/\.svg$/i.test(O)||(O=O.substring(0,l.lastIndexOf("."))+f);var K=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(K=!0);if(/\.v(dx|sdx?)$/i.test(l)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var L=new XMLHttpRequest;L.open("GET",b,!0);K||(L.responseType="blob");if(F)for(var M in F)L.setRequestHeader(M,F[M]);L.onload=mxUtils.bind(this,function(){if(200<=-L.status&&299>=L.status){var d=null;K?(d=JSON.parse(L.responseText),d=this.base64ToBlob(d.content,"application/octet-stream")):d=new Blob([L.response],{type:"application/octet-stream"});this.importVisio(d,mxUtils.bind(this,function(k){x(new LocalFile(this,k,O,!0))}),z,l)}else null!=z&&z({message:mxResources.get("errorLoadingFile")})});L.onerror=z;L.send()}else{var c=mxUtils.bind(this,function(d){try{if(/\.pdf$/i.test(l)){var k=Editor.extractGraphModelFromPdf(d);null!=k&&0<k.length&&x(new LocalFile(this,-k,O,!0))}else/\.png$/i.test(l)?(k=this.extractGraphModelFromPng(d),null!=k?x(new LocalFile(this,k,O,!0)):x(new LocalFile(this,d,l,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,b)?this.parseFileData(d,mxUtils.bind(this,function(m){4==m.readyState&&(200<=m.status&&299>=m.status?x(new LocalFile(this,m.responseText,O,!0)):null!=z&&z({message:mxResources.get("errorLoadingFile")}))}),l):x(new LocalFile(this,d,O,!0))}catch(m){null!=z&&z(m)}});p=/\.png$/i.test(l)||/\.jpe?g$/i.test(l)||+App.prototype.convertFile=function(b,l,p,f,x,z,y,E){var R=l;/\.svg$/i.test(R)||(R=R.substring(0,l.lastIndexOf("."))+f);var K=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(K=!0);if(/\.v(dx|sdx?)$/i.test(l)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var L=new XMLHttpRequest;L.open("GET",b,!0);K||(L.responseType="blob");if(E)for(var O in E)L.setRequestHeader(O,E[O]);L.onload=mxUtils.bind(this,function(){if(200<=+L.status&&299>=L.status){var d=null;K?(d=JSON.parse(L.responseText),d=this.base64ToBlob(d.content,"application/octet-stream")):d=new Blob([L.response],{type:"application/octet-stream"});this.importVisio(d,mxUtils.bind(this,function(k){x(new LocalFile(this,k,R,!0))}),z,l)}else null!=z&&z({message:mxResources.get("errorLoadingFile")})});L.onerror=z;L.send()}else{var c=mxUtils.bind(this,function(d){try{if(/\.pdf$/i.test(l)){var k=Editor.extractGraphModelFromPdf(d);null!=k&&0<k.length&&x(new LocalFile(this,+k,R,!0))}else/\.png$/i.test(l)?(k=this.extractGraphModelFromPng(d),null!=k?x(new LocalFile(this,k,R,!0)):x(new LocalFile(this,d,l,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,b)?this.parseFileData(d,mxUtils.bind(this,function(m){4==m.readyState&&(200<=m.status&&299>=m.status?x(new LocalFile(this,m.responseText,R,!0)):null!=z&&z({message:mxResources.get("errorLoadingFile")}))}),l):x(new LocalFile(this,d,R,!0))}catch(m){null!=z&&z(m)}});p=/\.png$/i.test(l)||/\.jpe?g$/i.test(l)||/\.pdf$/i.test(l)||null!=p&&"image/"==p.substring(0,6);K?mxUtils.get(b,mxUtils.bind(this,function(d){if(200<=d.getStatus()&&299>=d.getStatus()){if(null!=x){d=JSON.parse(d.getText());var k=d.content;"base64"===d.encoding&&(k=/\.png$/i.test(l)?"data:image/png;base64,"+k:/\.pdf$/i.test(l)?"data:application/pdf;base64,"+k:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(k):atob(k));c(k)}}else null!=z&&z({code:App.ERROR_UNKNOWN})}),function(){null!=z&&z({code:App.ERROR_UNKNOWN})},!1,this.timeout,-function(){null!=z&&z({code:App.ERROR_TIMEOUT,retry:fn})},F):null!=y?y(b,c,z,p):this.editor.loadUrl(b,c,z,p,null,null,null,F)}};+function(){null!=z&&z({code:App.ERROR_TIMEOUT,retry:fn})},E):null!=y?y(b,c,z,p):this.editor.loadUrl(b,c,z,p,null,null,null,E)}};App.prototype.updateHeader=function(){if(null!=this.menubar){var b="url("+Editor.logoImage+")";this.appIcon=document.createElement("a");this.appIcon.className="geAppIcon";this.appIcon.style.backgroundImage=b;mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(z){this.appIconClicked(z)}));mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var z=this.getCurrentFile();null!=z&&(z=z.getMode(),z==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):z==App.MODE_DROPBOX?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):z==App.MODE_ONEDRIVE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):z==App.MODE_GITHUB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):z==App.MODE_GITLAB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/gitlab-logo-white.svg)",this.appIcon.style.backgroundSize="90%"):z==App.MODE_TRELLO&&(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/trello-logo-white-orange.svg)",this.appIcon.style.backgroundSize="70%"))}));mxEvent.addListener(this.appIcon,"mouseout",mxUtils.bind(this,function(){this.appIcon.style.backgroundImage=b;this.appIcon.style.backgroundSize=""}));"1"!=urlParams.embed&&this.menubarContainer.appendChild(this.appIcon);@@ -14118,208 +14130,208 @@ App.prototype.updateFullscreenState=function(){if(null!=this.fullscreenElement){App.prototype.getMainUser=function(){var b=null;null!=this.drive&&null!=this.drive.getUser()?b=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?b=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?b=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()?b=this.gitHub.getUser():null!=this.gitLab&&null!=this.gitLab.getUser()&&(b=this.gitLab.getUser());return b};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 geInlineDialog";b.style.minWidth="300px";this.userPanel=b;mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(y){mxEvent.isConsumed(y)||this.hideUserPanel()}))}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var l=!1;this.userPanel.innerText="";b=document.createElement("div");b.className="geButton";b.setAttribute("title",-mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var p=this.drive.getUsersList();if(0<p.length){var f=mxUtils.bind(this,function(y,F){var O=this.getCurrentFile();null!=O&&O.constructor==DriveFile?(this.spinner.spin(document.body,F),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,-function(){this.spinner.stop();y()}),2E3)):y()});b=mxUtils.bind(this,function(y){var F=document.createElement("tr"),O=document.createElement("td");O.setAttribute("valig","middle");O.style.height="59px";O.style.width="66px";var K=document.createElement("img");K.setAttribute("width","50");K.setAttribute("height","50");K.setAttribute("border","0");K.setAttribute("src",null!=y.pictureUrl?y.pictureUrl:Editor.userImage);K.style.borderRadius="50%";K.style.margin="4px 8px 0 8px";O.appendChild(K);F.appendChild(O);-O=document.createElement("td");O.setAttribute("valign","middle");O.style.whiteSpace="nowrap";O.style.paddingTop="4px";O.style.maxWidth="0";O.style.overflow="hidden";O.style.textOverflow="ellipsis";mxUtils.write(O,y.displayName+(y.isCurrent&&1<p.length?" ("+mxResources.get("default")+")":""));null!=y.email&&(mxUtils.br(O),K=document.createElement("small"),K.style.color="gray",mxUtils.write(K,y.email),O.appendChild(K));K=document.createElement("div");K.style.marginTop="4px";var L=document.createElement("i");-mxUtils.write(L,mxResources.get("googleDrive"));K.appendChild(L);O.appendChild(K);F.appendChild(O);y.isCurrent?F.setAttribute("title","User ID: "+y.id):(F.setAttribute("title",mxResources.get("login")+" (User ID: "+y.id+")"),F.style.cursor="pointer",F.style.opacity="0.3",mxEvent.addListener(F,"mouseenter",mxUtils.bind(this,function(){F.style.opacity="1"})),mxEvent.addListener(F,"mouseleave",mxUtils.bind(this,function(){F.style.opacity="0.3"})),mxEvent.addListener(F,"click",mxUtils.bind(this,function(M){this.hideUserPanel();-f(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(y);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(M)})));return F});l=!0;var x=document.createElement("table");x.style.borderSpacing="0";x.style.fontSize="10pt";x.style.width="100%";x.style.padding="10px";for(var z=0;z<p.length;z++)x.appendChild(b(p[z]));+mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var p=this.drive.getUsersList();if(0<p.length){var f=mxUtils.bind(this,function(y,E){var R=this.getCurrentFile();null!=R&&R.constructor==DriveFile?(this.spinner.spin(document.body,E),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,+function(){this.spinner.stop();y()}),2E3)):y()});b=mxUtils.bind(this,function(y){var E=document.createElement("tr"),R=document.createElement("td");R.setAttribute("valig","middle");R.style.height="59px";R.style.width="66px";var K=document.createElement("img");K.setAttribute("width","50");K.setAttribute("height","50");K.setAttribute("border","0");K.setAttribute("src",null!=y.pictureUrl?y.pictureUrl:Editor.userImage);K.style.borderRadius="50%";K.style.margin="4px 8px 0 8px";R.appendChild(K);E.appendChild(R);+R=document.createElement("td");R.setAttribute("valign","middle");R.style.whiteSpace="nowrap";R.style.paddingTop="4px";R.style.maxWidth="0";R.style.overflow="hidden";R.style.textOverflow="ellipsis";mxUtils.write(R,y.displayName+(y.isCurrent&&1<p.length?" ("+mxResources.get("default")+")":""));null!=y.email&&(mxUtils.br(R),K=document.createElement("small"),K.style.color="gray",mxUtils.write(K,y.email),R.appendChild(K));K=document.createElement("div");K.style.marginTop="4px";var L=document.createElement("i");+mxUtils.write(L,mxResources.get("googleDrive"));K.appendChild(L);R.appendChild(K);E.appendChild(R);y.isCurrent?E.setAttribute("title","User ID: "+y.id):(E.setAttribute("title",mxResources.get("login")+" (User ID: "+y.id+")"),E.style.cursor="pointer",E.style.opacity="0.3",mxEvent.addListener(E,"mouseenter",mxUtils.bind(this,function(){E.style.opacity="1"})),mxEvent.addListener(E,"mouseleave",mxUtils.bind(this,function(){E.style.opacity="0.3"})),mxEvent.addListener(E,"click",mxUtils.bind(this,function(O){this.hideUserPanel();+f(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(y);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(O)})));return E});l=!0;var x=document.createElement("table");x.style.borderSpacing="0";x.style.fontSize="10pt";x.style.width="100%";x.style.padding="10px";for(var z=0;z<p.length;z++)x.appendChild(b(p[z]));this.userPanel.appendChild(x);b=document.createElement("div");b.style.textAlign="left";b.style.padding="10px";b.style.whiteSpace="nowrap";b.style.borderTopStyle="solid";b.style.borderTopWidth="1px";x=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){f(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxResources.get("signOut"))}))}));-x.className="geBtn";x.style.float="right";b.appendChild(x);x=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var y=this.drive.createAuthWin();y.blur();window.focus();f(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(F){this.handleError(F)}),!0,y)}),mxResources.get("closingFile")+"...")}));x.className="geBtn";x.style.margin="0px";-b.appendChild(x);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(y,F,O,K){if(null!=y){l&&this.userPanel.appendChild(document.createElement("hr"));l=!0;var L=document.createElement("table");L.style.borderSpacing="0";L.style.fontSize="10pt";L.style.width="100%";L.style.padding="10px";var M=document.createElement("tbody"),c=document.createElement("tr"),d=document.createElement("td");d.setAttribute("valig","top");d.style.width="40px";if(null!=F){var k=document.createElement("img");k.setAttribute("width",-"40");k.setAttribute("height","40");k.setAttribute("border","0");k.setAttribute("src",F);k.style.marginRight="6px";d.appendChild(k)}c.appendChild(d);d=document.createElement("td");d.setAttribute("valign","middle");d.style.whiteSpace="nowrap";d.style.maxWidth="0";d.style.overflow="hidden";d.style.textOverflow="ellipsis";mxUtils.write(d,y.displayName);null!=y.email&&(mxUtils.br(d),F=document.createElement("small"),F.style.color="gray",mxUtils.write(F,y.email),d.appendChild(F));null!=K&&(y=document.createElement("div"),-y.style.marginTop="4px",F=document.createElement("i"),mxUtils.write(F,K),y.appendChild(F),d.appendChild(y));c.appendChild(d);M.appendChild(c);L.appendChild(M);this.userPanel.appendChild(L);y=document.createElement("div");y.style.textAlign="center";y.style.padding="10px";y.style.whiteSpace="nowrap";null!=O&&(O=mxUtils.button(mxResources.get("signOut"),O),O.className="geBtn",y.appendChild(O));this.userPanel.appendChild(y)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",-mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==DropboxFile){var F=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}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 y=-this.getCurrentFile();if(null!=y&&y.constructor==OneDriveFile){var F=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}else this.oneDrive.logout()}),mxResources.get("oneDrive"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==GitHubFile){var F=-mxUtils.bind(this,function(){this.gitHub.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}else this.gitHub.logout()}),mxResources.get("github"));null!=this.gitLab&&b(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==GitLabFile){var F=mxUtils.bind(this,function(){this.gitLab.logout();window.location.hash=-""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}else this.gitLab.logout()}),mxResources.get("gitlab"));null!=this.trello&&b(this.trello.getUser(),IMAGE_PATH+"/trello-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==TrelloFile){var F=mxUtils.bind(this,function(){this.trello.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),-null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}else this.trello.logout()}),mxResources.get("trello"));"min"==uiTheme&&(x=this.getCurrentFile(),null!=x&&x.isRealtimeEnabled()&&x.isRealtimeSupported()&&(b=document.createElement("div"),b.style.padding="10px",b.style.whiteSpace="nowrap",b.style.borderTop="1px solid rgb(224, 224, 224)",b.style.marginTop="4px",b.style.textAlign="center",b.style.padding="10px",b.style.fontSize="9pt",z=x.getRealtimeError(),1!=x.getRealtimeState()&&+x.className="geBtn";x.style.float="right";b.appendChild(x);x=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var y=this.drive.createAuthWin();y.blur();window.focus();f(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(E){this.handleError(E)}),!0,y)}),mxResources.get("closingFile")+"...")}));x.className="geBtn";x.style.margin="0px";+b.appendChild(x);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(y,E,R,K){if(null!=y){l&&this.userPanel.appendChild(document.createElement("hr"));l=!0;var L=document.createElement("table");L.style.borderSpacing="0";L.style.fontSize="10pt";L.style.width="100%";L.style.padding="10px";var O=document.createElement("tbody"),c=document.createElement("tr"),d=document.createElement("td");d.setAttribute("valig","top");d.style.width="40px";if(null!=E){var k=document.createElement("img");k.setAttribute("width",+"40");k.setAttribute("height","40");k.setAttribute("border","0");k.setAttribute("src",E);k.style.marginRight="6px";d.appendChild(k)}c.appendChild(d);d=document.createElement("td");d.setAttribute("valign","middle");d.style.whiteSpace="nowrap";d.style.maxWidth="0";d.style.overflow="hidden";d.style.textOverflow="ellipsis";mxUtils.write(d,y.displayName);null!=y.email&&(mxUtils.br(d),E=document.createElement("small"),E.style.color="gray",mxUtils.write(E,y.email),d.appendChild(E));null!=K&&(y=document.createElement("div"),+y.style.marginTop="4px",E=document.createElement("i"),mxUtils.write(E,K),y.appendChild(E),d.appendChild(y));c.appendChild(d);O.appendChild(c);L.appendChild(O);this.userPanel.appendChild(L);y=document.createElement("div");y.style.textAlign="center";y.style.padding="10px";y.style.whiteSpace="nowrap";null!=R&&(R=mxUtils.button(mxResources.get("signOut"),R),R.className="geBtn",y.appendChild(R));this.userPanel.appendChild(y)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",+mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==DropboxFile){var E=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()}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 y=+this.getCurrentFile();if(null!=y&&y.constructor==OneDriveFile){var E=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()}else this.oneDrive.logout()}),mxResources.get("oneDrive"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==GitHubFile){var E=+mxUtils.bind(this,function(){this.gitHub.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()}else this.gitHub.logout()}),mxResources.get("github"));null!=this.gitLab&&b(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==GitLabFile){var E=mxUtils.bind(this,function(){this.gitLab.logout();window.location.hash=+""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()}else this.gitLab.logout()}),mxResources.get("gitlab"));null!=this.trello&&b(this.trello.getUser(),IMAGE_PATH+"/trello-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==TrelloFile){var E=mxUtils.bind(this,function(){this.trello.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),+null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()}else this.trello.logout()}),mxResources.get("trello"));"min"==uiTheme&&(x=this.getCurrentFile(),null!=x&&x.isRealtimeEnabled()&&x.isRealtimeSupported()&&(b=document.createElement("div"),b.style.padding="10px",b.style.whiteSpace="nowrap",b.style.borderTop="1px solid rgb(224, 224, 224)",b.style.marginTop="4px",b.style.textAlign="center",b.style.padding="10px",b.style.fontSize="9pt",z=x.getRealtimeError(),1!=x.getRealtimeState()&&(mxUtils.write(b,mxResources.get("realtimeCollaboration")+": "+(null!=z&&null!=z.message?z.message:mxResources.get("disconnected"))),this.userPanel.appendChild(b))));document.body.appendChild(this.userPanel)}};App.prototype.getCurrentUser=function(){var b=null;null!=this.drive&&null!=this.drive.getUser()?b=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?b=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?b=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(b=this.gitHub.getUser());return b};var editorResetGraph=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.prototype.createHelpLink=function(p){return this.editorUi.createHelpIcon(p)};Menus.prototype.addLinkToItem=function(p,f){null!=p&&p.firstChild.nextSibling.appendChild(this.createHelpLink(f))};Menus.prototype.removeCustomFont=function(p,f){for(var x=0;x<this.customFonts.length;x++)if(this.customFonts[x].name==p&&this.customFonts[x].url==f){this.customFonts.splice(x,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(p,f){for(var x=0;x<this.customFonts.length;x++)if(this.customFonts[x].name==p&&this.customFonts[x].url==f)return!0;for(x=0;x<this.defaultFonts.length;x++){var z=this.defaultFonts[x];-if("string"!==typeof z&&z.fontFamily==p&&z.fontUrl==f||"string"===typeof z&&z==p&&null==f)return!0}return!1};Menus.prototype.addCustomFont=function(p,f){null==p||this.containsFont(p,f)||(this.customFonts.push({name:p,url:f}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var l=Menus.prototype.init;Menus.prototype.init=function(){function p(n,u,G){f.editor.isExportToCanvas()?f.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),-"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(H,I,g,q,B,J,Q,N,S,P,R,W,X){var Y=parseInt(H);!isNaN(Y)&&0<Y&&(f.exportImage(Y/100,I&&"png"==n,g,q,B&&"png"==n,Q,!N,S,n,R,null,W,X),null!=G&&G(H,I,g,q,B,J,Q,N,S,P,R,W,X))}),!0,u,n,!0):f.isOffline()||mxClient.IS_IOS&&navigator.standalone||f.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(H,I,g,q,B){f.downloadFile(I&&"png"==n?"xmlpng":n,null,null,H,null,null,g,q,B)}),!1,!0)}l.apply(this,arguments);-var f=this.editorUi,x=f.editor.graph,z=mxUtils.bind(x,x.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(n){return"file"!=n}));f.actions.addAction("new...",function(){var n=f.isOffline(),u=new NewDialog(f,n,!(f.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));f.showDialog(u.container,n?350:620,n?70:460,!0,!0,function(G){null!=f.sidebar&&f.sidebar.hideTooltip();G&&null==f.getCurrentFile()&&f.showSplash()});u.init()});f.actions.put("insertTemplate",+if("string"!==typeof z&&z.fontFamily==p&&z.fontUrl==f||"string"===typeof z&&z==p&&null==f)return!0}return!1};Menus.prototype.addCustomFont=function(p,f){null==p||this.containsFont(p,f)||(this.customFonts.push({name:p,url:f}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var l=Menus.prototype.init;Menus.prototype.init=function(){function p(n,v,G){f.editor.isExportToCanvas()?f.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),+"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(H,I,g,q,C,J,M,Q,T,P,S,W,X){var Y=parseInt(H);!isNaN(Y)&&0<Y&&(f.exportImage(Y/100,I&&"png"==n,g,q,C&&"png"==n,M,!Q,T,n,S,null,W,X),null!=G&&G(H,I,g,q,C,J,M,Q,T,P,S,W,X))}),!0,v,n,!0):f.isOffline()||mxClient.IS_IOS&&navigator.standalone||f.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(H,I,g,q,C){f.downloadFile(I&&"png"==n?"xmlpng":n,null,null,H,null,null,g,q,C)}),!1,!0)}l.apply(this,arguments);+var f=this.editorUi,x=f.editor.graph,z=mxUtils.bind(x,x.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(n){return"file"!=n}));f.actions.addAction("new...",function(){var n=f.isOffline(),v=new NewDialog(f,n,!(f.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));f.showDialog(v.container,n?350:620,n?70:460,!0,!0,function(G){null!=f.sidebar&&f.sidebar.hideTooltip();G&&null==f.getCurrentFile()&&f.showSplash()});v.init()});f.actions.put("insertTemplate",new Action("template...",function(){f.openTemplateDialog()})).isEnabled=z;var y=f.actions.addAction("shareCursor",function(){f.setShareCursorPosition(!f.isShareCursorPosition())});y.setToggleAction(!0);y.setSelectedCallback(function(){return f.isShareCursorPosition()});y=f.actions.addAction("showRemoteCursors",function(){f.setShowRemoteCursors(!f.isShowRemoteCursors())});y.setToggleAction(!0);y.setSelectedCallback(function(){return f.isShowRemoteCursors()});y=f.actions.addAction("points",function(){f.editor.graph.view.setUnit(mxConstants.POINTS)});y.setToggleAction(!0);y.setSelectedCallback(function(){return f.editor.graph.view.unit==mxConstants.POINTS});y=f.actions.addAction("inches",function(){f.editor.graph.view.setUnit(mxConstants.INCHES)});y.setToggleAction(!0);y.setSelectedCallback(function(){return f.editor.graph.view.unit==mxConstants.INCHES});y=f.actions.addAction("millimeters",function(){f.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});y.setToggleAction(!0);y.setSelectedCallback(function(){return f.editor.graph.view.unit==mxConstants.MILLIMETERS});-y=f.actions.addAction("meters",function(){f.editor.graph.view.setUnit(mxConstants.METERS)});y.setToggleAction(!0);y.setSelectedCallback(function(){return f.editor.graph.view.unit==mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(n,u){this.addMenuItems(n,["points","inches","millimeters","meters"],u);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||f.menus.addMenuItems(n,["-","pageScale"],u)})));y=f.actions.addAction("pageTabs",function(){f.setTabContainerVisible(!f.isTabContainerVisible(),+y=f.actions.addAction("meters",function(){f.editor.graph.view.setUnit(mxConstants.METERS)});y.setToggleAction(!0);y.setSelectedCallback(function(){return f.editor.graph.view.unit==mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(n,v){this.addMenuItems(n,["points","inches","millimeters","meters"],v);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||f.menus.addMenuItems(n,["-","pageScale"],v)})));y=f.actions.addAction("pageTabs",function(){f.setTabContainerVisible(!f.isTabContainerVisible(),!0)});y.setToggleAction(!0);y.setSelectedCallback(function(){return f.isTabContainerVisible()});y=f.actions.addAction("ruler",function(){f.setRulerVisible(!f.isRulerVisible())});y.setEnabled(Editor.canvasSupported&&9!=document.documentMode);y.setToggleAction(!0);y.setSelectedCallback(function(){return f.isRulerVisible()});y=f.actions.addAction("fullscreen",function(){if("1"==urlParams.embedInline)f.setInlineFullscreen(!Editor.inlineFullscreen);else{var n=mxUtils.isAncestorNode(document.body,f.container)?f.container:f.editor.graph.container;null!=n&&(null==document.fullscreenElement?(document.body.requestFullscreen(),n.classList.add("geFullscreen")):(document.exitFullscreen(),n.classList.remove("geFullscreen")))}});y.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=document.body.requestFullscreen;y.setToggleAction(!0);y.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});y=f.actions.put("lightMode",new Action("light",function(n){f.setAndPersistDarkMode(!1)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return!f.isAutoDarkMode(!0)&&!Editor.isDarkMode()});y=f.actions.put("darkMode",new Action("dark",function(n){f.setAndPersistDarkMode(!0)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return!f.isAutoDarkMode(!0)&&Editor.isDarkMode()});y=f.actions.put("autoMode",new Action("automatic",function(n){f.setAndPersistDarkMode("auto")}));y.setToggleAction(!0);y.setSelectedCallback(function(){return f.isAutoDarkMode(!0)});f.actions.addAction("properties...",function(){f.getPublicUrl(f.getCurrentFile(),function(n){n=new FilePropertiesDialog(f,n);f.showDialog(n.container,340,200,!0,!0);n.init()})}).isEnabled=z;window.mxFreehand&&(y=f.actions.put("insertFreehand",new Action("freehand",function(){x.isEnabled()&&(null==f.freehandWindow&&(f.freehandWindow=new FreehandWindow(f,document.body.offsetWidth-420,102,180,126,!0)),x.freehand.isDrawing()?x.freehand.stopDrawing():x.freehand.startDrawing(),f.freehandWindow.window.setVisible(x.freehand.isDrawing()))},-null,null,"X")),y.isEnabled=function(){return z()},y.setToggleAction(!0),y.setSelectedCallback(function(){return null!=f.freehandWindow&&f.freehandWindow.window.isVisible()}));f.actions.put("exportXml",new Action("formatXml...",function(){var n=document.createElement("div");n.style.whiteSpace="nowrap";var u=null==f.pages||1>=f.pages.length,G=document.createElement("h3");mxUtils.write(G,mxResources.get("formatXml"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";n.appendChild(G);-var H=f.addCheckbox(n,mxResources.get("selectionOnly"),!1,x.isSelectionEmpty()),I=f.addCheckbox(n,mxResources.get("compressed"),Editor.defaultCompressed),g=f.addCheckbox(n,mxResources.get("allPages"),!u,u);g.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});n=new CustomDialog(f,n,mxUtils.bind(this,function(){f.downloadFile("xml",!I.checked,null,!H.checked,u||!g.checked)}),null,mxResources.get("export"));-f.showDialog(n.container,300,200,!0,!0)}));Editor.enableExportUrl&&f.actions.put("exportUrl",new Action("url...",function(){f.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(n,u,G,H,I,g,q,B,J,Q,N,S,P){q=[];H&&J&&q.push("tags=%7B%7D");n=new EmbedDialog(f,f.createLink(n,u,P,H,I,g,null,!0,q,null,G,null,S));f.showDialog(n.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));n.init()},null,!0,!0)}));f.actions.put("exportHtml",new Action("formatHtmlEmbedded...",-function(){f.getPublicUrl(f.getCurrentFile(),function(n){f.showHtmlDialog(mxResources.get("export"),null,n,function(u,G,H,I,g,q,B,J,Q,N,S,P){f.createHtml(u,G,H,I,g,q,B,J,Q,N,S,mxUtils.bind(this,function(R,W){var X=f.getBaseFilename(B);R='\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>'+R+"\n"+W+"\n</body>\n</html>";f.saveData(X+(".drawio"==X.substring(X.lenth--7)?"":".drawio")+".html","html",R,"text/html")}),P)})})}));f.actions.put("exportPdf",new Action("formatPdf...",function(){f.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!f.isOffline()&&!f.printPdfExport?mxUtils.bind(this,function(n,u){n=null!=f.pages?f.pages.length:1;var G=null==f.pages||1>=f.pages.length,H=f.getPageIndex(f.currentPage);H=null!=H?H+1:1;f.downloadFile("pdf",null,null,!u.selection,G||!u.allPages&&u.pagesFrom==H&&u.pagesTo==H,!u.crop,u.transparent,u.scale,null,-u.grid,u.includeCopy,u.allPages||u.pagesFrom==H&&u.pagesTo==H?null:{from:Math.max(0,Math.min(n-1,u.pagesFrom-1)),to:Math.max(0,Math.min(n-1,u.pagesTo-1))},u.border,u.fit,u.sheetsAcross,u.sheetsDown,u.shadows)}):null,mxResources.get("export"))}));f.actions.addAction("open...",function(){f.pickFile()});f.actions.addAction("close",function(){function n(){null!=u&&u.removeDraft();f.fileLoaded(new LocalFile(f,f.emptyDiagramXml,null,!0))}var u=f.getCurrentFile();null!=u&&u.isModified()?f.confirm(mxResources.get("allChangesLost"),-null,n,mxResources.get("cancel"),mxResources.get("discardChanges")):n()});f.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==x.getSelectionCount()){var n=x.getSelectionCell(),u=x.view.getState(n);null!=u&&null!=u.shape&&null!=u.shape.stencil&&(n=new EditShapeDialog(f,n,mxResources.get("editShape")),f.showDialog(n.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),n.init())}}));f.actions.addAction("revisionHistory...",function(){f.isRevisionHistorySupported()?f.spinner.spin(document.body,-mxResources.get("loading"))&&f.getRevisions(mxUtils.bind(this,function(n,u){f.spinner.stop();n=new RevisionDialog(f,n,u);f.showDialog(n.container,640,480,!0,!0);n.init()}),mxUtils.bind(this,function(n){f.handleError(null!=n?n:mxResources.get("notAvailable"))})):f.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});f.actions.addAction("createRevision",function(){f.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");y=f.actions.addAction("synchronize",+null,null,"X")),y.isEnabled=function(){return z()},y.setToggleAction(!0),y.setSelectedCallback(function(){return null!=f.freehandWindow&&f.freehandWindow.window.isVisible()}));f.actions.put("exportXml",new Action("formatXml...",function(){var n=document.createElement("div");n.style.whiteSpace="nowrap";var v=null==f.pages||1>=f.pages.length,G=document.createElement("h3");mxUtils.write(G,mxResources.get("formatXml"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";n.appendChild(G);+var H=f.addCheckbox(n,mxResources.get("selectionOnly"),!1,x.isSelectionEmpty()),I=f.addCheckbox(n,mxResources.get("compressed"),Editor.defaultCompressed),g=f.addCheckbox(n,mxResources.get("allPages"),!v,v);g.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});n=new CustomDialog(f,n,mxUtils.bind(this,function(){f.downloadFile("xml",!I.checked,null,!H.checked,v||!g.checked)}),null,mxResources.get("export"));+f.showDialog(n.container,300,200,!0,!0)}));Editor.enableExportUrl&&f.actions.put("exportUrl",new Action("url...",function(){f.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(n,v,G,H,I,g,q,C,J,M,Q,T,P){q=[];H&&J&&q.push("tags=%7B%7D");n=new EmbedDialog(f,f.createLink(n,v,P,H,I,g,null,!0,q,null,G,null,T));f.showDialog(n.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));n.init()},null,!0,!0)}));f.actions.put("exportHtml",new Action("formatHtmlEmbedded...",+function(){f.getPublicUrl(f.getCurrentFile(),function(n){f.showHtmlDialog(mxResources.get("export"),null,n,function(v,G,H,I,g,q,C,J,M,Q,T,P){f.createHtml(v,G,H,I,g,q,C,J,M,Q,T,mxUtils.bind(this,function(S,W){var X=f.getBaseFilename(C);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(X)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+S+"\n"+W+"\n</body>\n</html>";f.saveData(X+(".drawio"==X.substring(X.lenth-+7)?"":".drawio")+".html","html",S,"text/html")}),P)})})}));f.actions.put("exportPdf",new Action("formatPdf...",function(){f.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!f.isOffline()&&!f.printPdfExport?mxUtils.bind(this,function(n,v){n=null!=f.pages?f.pages.length:1;var G=null==f.pages||1>=f.pages.length,H=f.getPageIndex(f.currentPage);H=null!=H?H+1:1;f.downloadFile("pdf",null,null,!v.selection,G||!v.allPages&&v.pagesFrom==H&&v.pagesTo==H,!v.crop,v.transparent,v.scale,null,+v.grid,v.includeCopy,v.allPages||v.pagesFrom==H&&v.pagesTo==H?null:{from:Math.max(0,Math.min(n-1,v.pagesFrom-1)),to:Math.max(0,Math.min(n-1,v.pagesTo-1))},v.border,v.fit,v.sheetsAcross,v.sheetsDown,v.shadows)}):null,mxResources.get("export"))}));f.actions.addAction("open...",function(){f.pickFile()});f.actions.addAction("close",function(){function n(){null!=v&&v.removeDraft();f.fileLoaded(new LocalFile(f,f.emptyDiagramXml,null,!0))}var v=f.getCurrentFile();null!=v&&v.isModified()?f.confirm(mxResources.get("allChangesLost"),+null,n,mxResources.get("cancel"),mxResources.get("discardChanges")):n()});f.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==x.getSelectionCount()){var n=x.getSelectionCell(),v=x.view.getState(n);null!=v&&null!=v.shape&&null!=v.shape.stencil&&(n=new EditShapeDialog(f,n,mxResources.get("editShape")),f.showDialog(n.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),n.init())}}));f.actions.addAction("revisionHistory...",function(){f.isRevisionHistorySupported()?f.spinner.spin(document.body,+mxResources.get("loading"))&&f.getRevisions(mxUtils.bind(this,function(n,v){f.spinner.stop();n=new RevisionDialog(f,n,v);f.showDialog(n.container,640,480,!0,!0);n.init()}),mxUtils.bind(this,function(n){f.handleError(null!=n?n:mxResources.get("notAvailable"))})):f.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});f.actions.addAction("createRevision",function(){f.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");y=f.actions.addAction("synchronize",function(){f.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");"none"==DrawioFile.SYNC&&(y.label=mxResources.get("refresh"));f.actions.addAction("upload...",function(){var n=f.getCurrentFile();null!=n&&(window.drawdata=f.getFileData(),n=null!=n.getTitle()?n.getTitle():f.defaultFilename,f.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(f.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(n),null,!0))},null,null,null,navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(y=f.actions.addAction("mathematicalTypesetting",function(){var n=new ChangePageSetup(f);n.ignoreColor=!0;n.ignoreImage=!0;n.mathEnabled=!f.isMathEnabled();x.model.execute(n)}),y.setToggleAction(!0),y.setSelectedCallback(function(){return f.isMathEnabled()}),y.isEnabled=z);y=f.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var n=new ChangePageSetup(f);n.ignoreColor=!0;n.ignoreImage=!0;n.adaptiveColors="default";x.model.execute(n)}));y.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+")"};y.setToggleAction(!0);y.setSelectedCallback(function(){return null==x.adaptiveColors});y=f.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var n=new ChangePageSetup(f);n.ignoreColor=!0;n.ignoreImage=!0;n.adaptiveColors="auto";x.model.execute(n)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return"auto"==x.adaptiveColors});y=f.actions.put("simpleAdaptiveColors",new Action("simple",function(){var n=new ChangePageSetup(f);n.ignoreColor=!0;n.ignoreImage=!0;n.adaptiveColors="simple";x.model.execute(n)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return"simple"==x.adaptiveColors});y=f.actions.put("noAdaptiveColors",new Action("none",function(){var n=new ChangePageSetup(f);n.ignoreColor=!0;n.ignoreImage=!0;n.adaptiveColors="none";x.model.execute(n)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return"none"==-x.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(n,u){this.addMenuItems(n,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],u)})));isLocalStorage&&(y=f.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());urlParams.splash=mxSettings.getShowStartScreen()?"1":"0";mxSettings.save()}),y.setToggleAction(!0),y.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));-var F=f.actions.addAction("autosave",function(){f.editor.setAutosave(!f.editor.autosave)});F.setToggleAction(!0);F.setSelectedCallback(function(){return F.isEnabled()&&f.editor.autosave});f.actions.addAction("editGeometry...",function(){for(var n=x.getSelectionCells(),u=[],G=0;G<n.length;G++)x.getModel().isVertex(n[G])&&u.push(n[G]);0<u.length&&(n=new EditGeometryDialog(f,u),f.showDialog(n.container,200,270,!0,!0),n.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");f.actions.addAction("copyStyle",-function(){if(x.isEnabled()&&1==x.getSelectionCount()){var n=x.getSelectionCell(),u=x.getCellStyle(n,!1);f.copiedStyle={};var G=[],H=[],I;for(I in u)G.push(u[I]),H.push(I);x.copyCellStyles([n],H,G,f.copiedStyle,f.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");f.actions.addAction("pasteStyle",function(){x.isEnabled()&&!x.isSelectionEmpty()&&null!=f.copiedStyle&&x.pasteCellStyles(x.includeDescendants(x.getSelectionCells()),f.copiedStyle,f.copiedStyle,!0)},null,null,Editor.altKey+"+V");-f.actions.put("exportSvg",new Action("formatSvg...",function(){f.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(n,u,G,H,I,g,q,B,J,Q,N,S,P,R){n=parseInt(n);f.lastExportSvgEditable=I;!isNaN(n)&&0<n&&f.exportSvg(n/100,u,G,H,I,g,q,!B,J,Q,S,P,R)}),!0,f.lastExportSvgEditable,"svg",!0)}));f.actions.put("exportPng",new Action("formatPng...",function(){p("png",f.lastExportPngEditable,function(n,u,G,H,I){f.lastExportPngEditable=-I})}));f.actions.put("exportJpg",new Action("formatJpg...",function(){p("jpeg")}));f.actions.put("exportWebp",new Action("formatWebp...",function(){p("webp")}));f.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif",null,"Animated GIF")+"...",function(){f.showAnimatedGifExportDialog()}));y=f.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var n=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells())),u=mxUtils.getXml(0==n.length?f.editor.getGraphXml():-x.encodeCells(n));f.copyImage(n,u)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");y.visible=Editor.enableNativeClipboard&&f.editor.isExportToCanvas();y=f.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var n=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells())),u=mxUtils.getXml(0==n.length?f.editor.getGraphXml():x.encodeCells(n));f.copySvg(n,u)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");y.visible=Editor.enableNativeClipboard&&f.editor.isExportToCanvas();-y=f.actions.put("shadowVisible",new Action("shadow",function(){x.setShadowVisible(!x.shadowVisible)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return x.shadowVisible});f.actions.put("about",new Action("v"+EditorUi.VERSION,function(n,u){mxEvent.isShiftDown(u)&&(EditorUi.isElectronApp||f.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));f.actions.addAction("support...",-function(){EditorUi.isElectronApp?f.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):f.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});f.actions.addAction("downloadDesktop...",function(){f.openLink("https://get.diagrams.net/")});f.actions.addAction("exportOptionsDisabled...",function(){f.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});f.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||-EditorUi.isElectronApp||navigator.standalone?f.openLink("https://app.diagrams.net/shortcuts.svg"):f.openLink("shortcuts.svg")});f.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?f.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):f.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});y=f.actions.addAction("tags",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(f,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",-mxUtils.bind(this,function(){f.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),f.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+K");y.setToggleAction(!0);y.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));(Editor.enableAi||-(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!f.isOffline()&&!EditorUi.isElectronApp&&0<Editor.aiActions.length&&f.isExternalDataComms()&&"draw.io"==f.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(y=f.actions.put("generate",new Action("generate",function(){Editor.enableAi?null!=f.chatWindow?f.chatWindow.window.setVisible(!f.chatWindow.window.isVisible()):f.openGenerateDialog(""):-f.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),y.isEnabled=function(){return z()},y.setToggleAction(!0),y.setSelectedCallback(function(){return null!=f.chatWindow&&f.chatWindow.window.isVisible()}));y=f.actions.addAction("findReplace",mxUtils.bind(this,function(n,u){f.showSearchWindow(x.isEnabled()&&(null==u||!mxEvent.isShiftDown(u)))}),null,null,Editor.ctrlKey+"+F");y=new Action("exportVsdx",function(){var n=-null==f.pages||1>=f.pages.length;if(n)f.exportVisio();else{var u=document.createElement("div");u.style.whiteSpace="nowrap";var G=document.createElement("h3");mxUtils.write(G,mxResources.get("formatVsdx"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";u.appendChild(G);var H=f.addCheckbox(u,mxResources.get("allPages"),!n,n);H.style.marginBottom="16px";n=new CustomDialog(f,u,mxUtils.bind(this,function(){f.exportVisio(!H.checked)}),null,mxResources.get("export"));f.showDialog(n.container,-300,130,!0,!0)}});y.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};f.actions.put("exportVsdx",y);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&f.actions.addAction("configuration...",function(){var n=document.createElement("input");n.setAttribute("type","checkbox");n.style.marginRight="8px";n.checked=mxSettings.getShowStartScreen();n.defaultChecked=n.checked;if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||"min"==Editor.currentTheme)){var u=-document.createElement("span");u.style.display="flex";u.style.alignItems="center";u.style.cssFloat="right";u.style.cursor="pointer";u.style.userSelect="none";u.style.marginTop="-3px";u.appendChild(n);mxUtils.write(u,mxResources.get("showStartScreen"));mxEvent.addListener(u,"click",function(H){mxEvent.getSource(H)!=n&&(n.checked=!n.checked)});header=u}u=[[mxResources.get("reset"),function(){f.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),f.hideDialog(),-f.alert(mxResources.get("restartForChangeRequired"))}catch(H){f.handleError(H)}})}]];if(!f.isOfflineApp()&&isLocalStorage&&f.mode!=App.MODE_ATLAS){var G=f.actions.get("plugins");null==G||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||u.push([mxResources.get("plugins"),G.funct])}EditorUi.isElectronApp||u.push([mxResources.get("link"),function(H,I){if(0<I.value.length)try{var g=JSON.parse(I.value),q=window.location.protocol+"//"+window.location.host+"/"+f.getSearch()+-"#_CONFIG_"+Graph.compress(JSON.stringify(g)),B=new EmbedDialog(f,q);f.showDialog(B.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));B.init()}catch(J){f.handleError(J)}else f.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=f.getServiceName()&&"1"!=urlParams.embed&&u.push([mxResources.get("preferences"),function(){f.showLocalStorageDialog(mxResources.get("preferences")+":",Editor.settingsKey,[[mxResources.get("reset"),function(){f.confirm(mxResources.get("areYouSure"),-function(){try{localStorage.removeItem(Editor.settingsKey),localStorage.removeItem(".drawio-config"),f.hideDialog(),f.alert(mxResources.get("restartForChangeRequired"))}catch(H){f.handleError(H)}})}]])}]);f.showLocalStorageDialog(mxResources.get("configuration")+":",Editor.configurationKey,u,n.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=n.parentNode&&(mxSettings.setShowStartScreen(n.checked),mxSettings.save())})});(mxClient.IS_CHROMEAPP||isLocalStorage)&&-this.put("language",new Menu(mxUtils.bind(this,function(n,u){var G=mxLanguage;null==urlParams.lang&&isLocalStorage&&(G=mxSettings.settings.language);var H=mxUtils.bind(this,function(g){var q=""==g?mxResources.get("automatic"):mxLanguageMap[g],B=null;""!=q&&(B=n.addItem(q,null,mxUtils.bind(this,function(){f.setAndPersistLanguage(g)}),u),(g==G||""==g&&null==G)&&n.addCheckmark(B,Editor.checkmarkImage));return B});H("");n.addSeparator(u);for(var I in mxLanguageMap)H(I)})));f.customLayoutConfig=[{layout:"mxHierarchicalLayout",-config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];f.actions.addAction("runLayout",function(){f.showCustomLayoutDialog(JSON.stringify(f.customLayoutConfig,null,2))});f.actions.put("adaptiveColors",new Action("adaptiveColors",function(n){null==f.adaptiveColorsWindow&&(f.adaptiveColorsWindow=new AdaptiveColorsWindow(f,document.body.offsetWidth-520,80,200,160));f.adaptiveColorsWindow.window.setVisible(!0)}));y=this.get("viewZoom");-var O=y.funct;y.funct=mxUtils.bind(this,function(n,u){O.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(n,["-","outline","fullscreen"],u)});y=this.get("layout");var K=y.funct;y.funct=function(n,u){K.apply(this,arguments);n.addItem(mxResources.get("orgChart"),null,function(){var G=null,H=20,I=20,g=function(){"undefined"!==typeof mxOrgChartLayout&&null!=G&&f.tryAndHandle(mxUtils.bind(this,function(){var R=f.editor.graph,W=new mxOrgChartLayout(R,G,H,-I),X=R.getDefaultParent();1<R.model.getChildCount(R.getSelectionCell())&&(X=R.getSelectionCell());W.execute(X)}))},q=document.createElement("div"),B=document.createElement("div");B.style.marginTop="6px";B.style.display="inline-block";B.style.width="180px";mxUtils.write(B,mxResources.get("orgChartType")+": ");q.appendChild(B);var J=document.createElement("select");J.style.width="160px";J.style.boxSizing="border-box";B=[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 Q=0;Q<B.length;Q++){var N=document.createElement("option");mxUtils.write(N,B[Q]);N.value=Q;2==Q&&N.setAttribute("selected","selected");J.appendChild(N)}mxEvent.addListener(J,"change",function(){G=J.value});q.appendChild(J);B=document.createElement("div");B.style.marginTop="6px";B.style.display="inline-block";B.style.width="180px";mxUtils.write(B,-mxResources.get("parentChildSpacing")+": ");q.appendChild(B);var S=document.createElement("input");S.type="number";S.value=H;S.style.width="160px";S.style.boxSizing="border-box";q.appendChild(S);mxEvent.addListener(S,"change",function(){H=S.value});B=document.createElement("div");B.style.marginTop="6px";B.style.display="inline-block";B.style.width="180px";mxUtils.write(B,mxResources.get("siblingSpacing")+": ");q.appendChild(B);var P=document.createElement("input");P.type="number";P.value=I;P.style.width=-"160px";P.style.boxSizing="border-box";q.appendChild(P);mxEvent.addListener(P,"change",function(){I=P.value});B=mxUtils.button(mxResources.get("custom")+"...",function(){var R=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(J.value),parentChildSpacing:parseInt(S.value),siblingSpacing:parseInt(P.value)}}];f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(R,null,2))});B.className="geBtn";q=new CustomDialog(f,q,function(){null==G&&(G=2);f.loadOrgChartLayouts(g)},null,null,null,B);f.showDialog(q.container,-355,140,!0,!0)},u,null,z());n.addSeparator(u);n.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){f.tryAndHandle(mxUtils.bind(this,function(){var G=new mxParallelEdgeLayout(x);G.checkOverlap=!0;f.prompt(mxResources.get("spacing"),G.spacing,mxUtils.bind(this,function(H){f.tryAndHandle(mxUtils.bind(this,function(){G.spacing=H;f.executeLayout(function(){G.execute(x.getDefaultParent(),x.isSelectionEmpty()?null:x.getSelectionCells())},!1)}))}))}))}),u);n.addSeparator(u);f.menus.addMenuItem(n,-"runLayout",u,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(n,u){if(mxClient.IS_CHROMEAPP||!f.isOffline()&&!navigator.standalone){var G=n.addItem(mxResources.get("search")+":",null,null,u,null,null,!1);G.style.cursor="default";var H=document.createElement("input");H.setAttribute("type","text");H.setAttribute("size","25");H.style.borderWidth="1px";H.style.marginLeft="8px";mxEvent.addListener(H,"keydown",mxUtils.bind(this,function(I){var g=mxUtils.trim(H.value);-13==I.keyCode&&0<g.length?(this.editorUi.searchHelp(g),H.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==I.keyCode&&(H.value="")}));G.firstChild.nextSibling.appendChild(H);mxEvent.addGestureListeners(H,function(I){document.activeElement!=H&&H.focus();mxEvent.consume(I)},function(I){mxEvent.consume(I)},function(I){mxEvent.consume(I)});window.setTimeout(function(){H.focus()},0);EditorUi.isElectronApp?(f.actions.addAction("website...",function(){f.openLink("https://www.drawio.com")}),-f.actions.addAction("check4Updates",function(){f.checkForUpdates()}),f.actions.put("desktopZoomIn",new Action("zoomIn",function(){f.desktopZoomIn()})),f.actions.put("desktopZoomOut",new Action("zoomOut",function(){f.desktopZoomOut()})),f.actions.put("desktopResetZoom",new Action("actualSize",function(){f.desktopResetZoom()})),this.addMenuItems(n,"- keyboardShortcuts quickStart website support -".split(" "),u),"1"!=urlParams.disableUpdate&&this.addMenuItems(n,["check4Updates","-"],u),this.addMenuItems(n,-"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),u)):this.addMenuItems(n,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),u)}else this.addMenuItems(n,["keyboardShortcuts","-","about"],u);"1"==urlParams.test&&(n.addSeparator(u),this.addSubmenu("testDevelop",n,u))})));f.actions.addAction("languageCode...",function(){var n=new FilenameDialog(f,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(u){null!=u&&(Graph.diagramLanguage=-0<u.length?u:null,Graph.translateDiagram=!0,x.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");f.showDialog(n.container,340,80,!0,!0);n.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(n,u){this.addMenuItems(n,["languageCode","-"],u);u=n.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;x.refresh()},u);Graph.translateDiagram||n.addCheckmark(u,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");-mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.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");f.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!x.isSelectionEmpty()){var n=x.cloneCells(x.getSelectionCells()),u=x.getBoundingBoxFromGeometry(n,!0);n=x.moveCells(n,-u.x,-u.y);f.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+u.width+", "+u.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(x.encodeCells(n)))+"'),")}}));f.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function n(q){return null==-q||null==q.boundingBox||!isNaN(q.boundingBox.x)&&!isNaN(q.boundingBox.y)&&!isNaN(q.boundingBox.width)&&!isNaN(q.boundingBox.height)}var u=x.isSelectionEmpty()?x.getGraphBounds():x.getBoundingBox(x.getSelectionCells()),G=x.view.translate,H=x.view.scale;x.insertVertex(x.getDefaultParent(),null,"",u.x/H-G.x,u.y/H-G.y,u.width/H,u.height/H,"fillColor=none;strokeColor=red;");var I=0,g=0;x.view.states.visit(function(q,B){q=!0;n(B.shape)||(console.log("invalid shape",B.cell.id,B.shape),q=!1);n(B.text)||(console.log("invalid text",-B.cell.id,B.text),q=!1);q||I++;g++});console.log("states checked",g,"invalid",I)}));f.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var n=null!=f.pages&&null!=f.getCurrentFile()?f.getCurrentFile().getAnonymizedXmlForPages(f.pages):"";n=new TextareaDialog(f,"Paste Data:",n,function(u){if(0<u.length)try{var G=function(B){function J(ba){if(null==aa[ba]){if(aa[ba]=!0,null!=S[ba]){for(;0<S[ba].length;){var fa=S[ba].pop();J(fa)}delete S[ba]}}else mxLog.debug(Q+": Visited: "+ba)}var Q=B.parentNode.id,-N=B.childNodes;B={};for(var S={},P=null,R={},W=0;W<N.length;W++){var X=N[W];if(null!=X.id&&0<X.id.length)if(null==B[X.id]){B[X.id]=X.id;var Y=X.getAttribute("parent");null==Y?null!=P?mxLog.debug(Q+": Multiple roots: "+X.id):P=X.id:(null==S[Y]&&(S[Y]=[]),S[Y].push(X.id))}else R[X.id]=X.id}N=Object.keys(R);0<N.length?(N=Q+": "+N.length+" Duplicates: "+N.join(", "),mxLog.debug(N+" (see console)")):mxLog.debug(Q+": Checked");var aa={};null==P?mxLog.debug(Q+": No root"):(J(P),Object.keys(aa).length!=Object.keys(B).length&&-(mxLog.debug(Q+": Invalid tree: (see console)"),console.log(Q+": Invalid tree",S)))};"<"!=u.charAt(0)&&(u=Graph.decompress(u),mxLog.debug("See console for uncompressed XML"),console.log("xml",u));var H=mxUtils.parseXml(u),I=f.getPagesForNode(H.documentElement,"mxGraphModel");if(null!=I&&0<I.length)try{var g=f.getHashValueForPages(I);mxLog.debug("Checksum: ",g)}catch(B){mxLog.debug("Error: ",B.message)}else mxLog.debug("No pages found for checksum");var q=H.getElementsByTagName("root");for(u=0;u<q.length;u++)G(q[u]);-mxLog.show()}catch(B){f.handleError(B),null!=window.console&&console.error(B)}});f.showDialog(n.container,620,460,!0,!0);n.init()}));var L=null;f.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=f.pages){var n=new TextareaDialog(f,"Diff/Sync:","",function(u){var G=f.getCurrentFile();if(0<u.length&&null!=G)try{var H=JSON.parse(u);G.patch([H],null,!0,!0);f.hideDialog()}catch(I){f.handleError(I)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(u,G){L=f.getPagesForXml(f.getFileData(!0));-n.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+f.getHashValueForPages(L)}],["Diff",function(u,G){try{n.textarea.value=JSON.stringify(f.diffPages(L,f.pages),null,2)}catch(H){f.handleError(H)}}]]);null==L?(L=f.getPagesForXml(f.getFileData(!0)),n.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+f.getHashValueForPages(L)):n.textarea.value=JSON.stringify(f.diffPages(L,f.pages),null,2);f.showDialog(n.container,620,460,!0,!0);n.init()}else f.alert("No pages")}));-f.actions.addAction("testChecksum",mxUtils.bind(this,function(){var n=f.getCurrentFile();null!=f.pages&&null!=n?f.spinner.spin(document.body,mxResources.get("loading"))&&n.getLatestVersion(function(u){f.spinner.stop();var G=f.getHashValueForPages(f.pages),H=n.getCurrentRevisionId(),I=f.getHashValueForPages(u.getShadowPages()),g=u.getDescriptorChecksum(u.getDescriptor()),q=u.getCurrentRevisionId();console.log("Local File",[n],"modified",n.isModified(),"checksum",G);console.log("Remote File",[u],"rev",-q==H,"desc",g==I,"checksum",I);f.alert("Checksums "+(I==G?"match":"no not match"))},function(u){console.log("Error getLatestVersion",u);f.handleError(u)}):console.log("Checksum: no file or pages")}));f.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var n=f.getCurrentFile();console.log("editorUi",f,"file",n);if(null!=n&&n.isRealtime()){console.log("Checksum ownPages",f.getHashValueForPages(n.ownPages));console.log("Checksum theirPages",f.getHashValueForPages(n.theirPages));console.log("diff ownPages/theirPages",-f.diffPages(n.ownPages,n.theirPages));var u=n.getShadowPages();null!=u&&(console.log("Checksum shadowPages",f.getHashValueForPages(u)),console.log("diff shadowPages/ownPages",f.diffPages(u,n.ownPages)),console.log("diff ownPages/shadowPages",f.diffPages(n.ownPages,u)),console.log("diff theirPages/shadowPages",f.diffPages(n.theirPages,u)));null!=n.sync&&null!=n.sync.snapshot&&(console.log("Checksum snapshot",f.getHashValueForPages(n.sync.snapshot)),console.log("diff ownPages/snapshot",f.diffPages(n.ownPages,-n.sync.snapshot)),console.log("diff theirPages/snapshot",f.diffPages(n.theirPages,n.sync.snapshot)),null!=f.pages&&console.log("diff snapshot/actualPages",f.diffPages(n.sync.snapshot,f.pages)));null!=f.pages&&(console.log("diff ownPages/actualPages",f.diffPages(n.ownPages,f.pages)),console.log("diff theirPages/actualPages",f.diffPages(n.theirPages,f.pages)))}null!=n&&console.log("Shadow pages",[f.getXmlForPages(n.getShadowPages())]);null!=f.pages&&console.log("Checksum actualPages",f.getHashValueForPages(f.pages))}));-f.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",f);var n=f.getCurrentFile();null!=n&&n.isRealtime()&&null!=n.shadowPages&&(console.log("patching actualPages to shadowPages",n.patch([f.diffPages(n.shadowPages,f.pages)])),n.ownPages=f.clonePages(f.pages),n.theirPages=f.clonePages(f.pages),n.shadowPages=f.clonePages(f.pages),null!=n.sync&&(n.sync.snapshot=f.clonePages(f.pages)))}));f.actions.addAction("testOptimize",mxUtils.bind(this,function(){x.model.beginUpdate();-try{var n=x.model.cells,u=0,G=[],H=[],I;for(I in n){var g=n[I],q=x.getCurrentCellStyle(g)[mxConstants.STYLE_IMAGE];null!=q&&"data:"==q.substring(0,5)&&(null==G[q]&&(G[q]=(G[q]||0)+1,u++),H.push(g))}x.setCellStyles(mxConstants.STYLE_IMAGE,null,H);console.log("Removed",u,"image(s) from",H.length,"cell(s): ",[H,G])}finally{x.model.endUpdate()}}));f.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(f,x.getModel())}));f.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var n=-new mxImageExport,u=x.getGraphBounds(),G=x.view.scale,H=mxUtils.createXmlDocument(),I=H.createElement("output");H.appendChild(I);H=new mxXmlCanvas2D(I);H.translate(Math.floor((1-u.x)/G),Math.floor((1-u.y)/G));H.scale(1/G);var g=0,q=H.save;H.save=function(){g++;q.apply(this,arguments)};var B=H.restore;H.restore=function(){g--;B.apply(this,arguments)};var J=n.drawShape;n.drawShape=function(Q){mxLog.debug("entering shape",Q,g);J.apply(this,arguments);mxLog.debug("leaving shape",Q,g)};n.drawState(x.getView().getState(x.model.root),-H);mxLog.show();mxLog.debug(mxUtils.getXml(I));mxLog.debug("stateCounter",g)}));f.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var M=null,c=null,d=null,k=null,m=null,t=null,v=null,A=null;f.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=M?(x.view.revalidate=M,M=null):(M=x.view.revalidate,x.view.revalidate=function(){var n=Date.now(),u=M.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",-[this],"time",Date.now()-n+" ms","args",arguments);return u});null!=c?(f.selectPage=c,c=null):(c=f.selectPage,f.selectPage=function(){var n=Date.now(),u=c.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-n+" ms","args",arguments);return u});null!=d?(f.diffPages=d,d=null):(d=f.diffPages,f.diffPages=function(){var n=Date.now(),u=d.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-n+" ms","args",arguments);-return u});null!=k?(f.patchPages=k,k=null):(k=f.patchPages,f.patchPages=function(){var n=Date.now(),u=k.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-n+" ms","args",arguments);return u});null!=m?(f.clonePages=m,m=null):(m=f.clonePages,f.clonePages=function(){var n=Date.now(),u=m.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-n+" ms","args",arguments);return u});null!=v?(f.getHashValueForPages=v,-v=null):(v=f.getHashValueForPages,f.getHashValueForPages=function(){var n=Date.now(),u=v.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-n+" ms","args",arguments);return u});null!=A?(f.resolveCrossReferences=A,A=null):(A=f.resolveCrossReferences,f.resolveCrossReferences=function(){var n=Date.now(),u=A.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-n+" ms","args",arguments);return u});-null!=t?(f.getFileData=t,t=null):(t=f.getFileData,f.getFileData=function(){var n=Date.now(),u=t.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-n+" ms","args",arguments);return u});EditorUi.debug("[Performance]",null!=M?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(n,u){this.addMenuItems(n,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),-u);var G=n.addItem(mxResources.get("testPerformance"),null,function(){f.actions.get("testPerformance").funct()},u);null!=M&&n.addCheckmark(G,Editor.checkmarkImage);this.addMenuItems(n,["-","testShowConsole"],u)})))}f.actions.put("shapes",new Action("moreShapes...",function(n){mxClient.IS_CHROMEAPP||!f.isOffline()?f.showDialog((new MoreShapesDialog(f,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):f.showDialog((new MoreShapesDialog(f,!1)).container,360,isLocalStorage?mxClient.IS_IOS?+x.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(n,v){this.addMenuItems(n,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],v)})));isLocalStorage&&(y=f.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());urlParams.splash=mxSettings.getShowStartScreen()?"1":"0";mxSettings.save()}),y.setToggleAction(!0),y.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));+var E=f.actions.addAction("autosave",function(){f.editor.setAutosave(!f.editor.autosave)});E.setToggleAction(!0);E.setSelectedCallback(function(){return E.isEnabled()&&f.editor.autosave});f.actions.addAction("editGeometry...",function(){for(var n=x.getSelectionCells(),v=[],G=0;G<n.length;G++)x.getModel().isVertex(n[G])&&v.push(n[G]);0<v.length&&(n=new EditGeometryDialog(f,v),f.showDialog(n.container,200,270,!0,!0),n.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");f.actions.addAction("copyStyle",+function(){if(x.isEnabled()&&1==x.getSelectionCount()){var n=x.getSelectionCell(),v=x.getCellStyle(n,!1);f.copiedStyle={};var G=[],H=[],I;for(I in v)G.push(v[I]),H.push(I);x.copyCellStyles([n],H,G,f.copiedStyle,f.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");f.actions.addAction("pasteStyle",function(){x.isEnabled()&&!x.isSelectionEmpty()&&null!=f.copiedStyle&&x.pasteCellStyles(x.includeDescendants(x.getSelectionCells()),f.copiedStyle,f.copiedStyle,!0)},null,null,Editor.altKey+"+V");+f.actions.put("exportSvg",new Action("formatSvg...",function(){f.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(n,v,G,H,I,g,q,C,J,M,Q,T,P,S){n=parseInt(n);f.lastExportSvgEditable=I;!isNaN(n)&&0<n&&f.exportSvg(n/100,v,G,H,I,g,q,!C,J,M,T,P,S)}),!0,f.lastExportSvgEditable,"svg",!0)}));f.actions.put("exportPng",new Action("formatPng...",function(){p("png",f.lastExportPngEditable,function(n,v,G,H,I){f.lastExportPngEditable=+I})}));f.actions.put("exportJpg",new Action("formatJpg...",function(){p("jpeg")}));f.actions.put("exportWebp",new Action("formatWebp...",function(){p("webp")}));f.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif",null,"Animated GIF")+"...",function(){f.showAnimatedGifExportDialog()}));y=f.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var n=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells()));f.copyImage(n)}),null,null,Editor.ctrlKey+"+"+Editor.altKey++"+X");y.visible=Editor.enableNativeClipboard&&f.editor.isExportToCanvas();y=f.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var n=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells()));f.copySvg(n)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");y.visible=Editor.enableNativeClipboard&&f.editor.isExportToCanvas();y=f.actions.put("shadowVisible",new Action("shadow",function(){x.setShadowVisible(!x.shadowVisible)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return x.shadowVisible});+f.actions.put("about",new Action("v"+EditorUi.VERSION,function(n,v){mxEvent.isShiftDown(v)&&(EditorUi.isElectronApp||f.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));f.actions.addAction("support...",function(){EditorUi.isElectronApp?f.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):f.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});f.actions.addAction("downloadDesktop...",+function(){f.openLink("https://get.diagrams.net/")});f.actions.addAction("exportOptionsDisabled...",function(){f.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});f.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||navigator.standalone?f.openLink("https://app.diagrams.net/shortcuts.svg"):f.openLink("shortcuts.svg")});f.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?+f.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):f.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});y=f.actions.addAction("tags",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(f,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){f.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),+f.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+K");y.setToggleAction(!0);y.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));(Editor.enableAi||(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!f.isOffline()&&!EditorUi.isElectronApp&&0<Editor.aiActions.length&&+f.isExternalDataComms()&&"draw.io"==f.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(y=f.actions.put("generate",new Action("generate",function(){Editor.enableAi?null!=f.chatWindow?f.chatWindow.window.setVisible(!f.chatWindow.window.isVisible()):f.openGenerateDialog(""):f.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),y.isEnabled=function(){return z()},y.setToggleAction(!0),+y.setSelectedCallback(function(){return null!=f.chatWindow&&f.chatWindow.window.isVisible()}));y=f.actions.addAction("findReplace",mxUtils.bind(this,function(n,v){f.showSearchWindow(x.isEnabled()&&(null==v||!mxEvent.isShiftDown(v)))}),null,null,Editor.ctrlKey+"+F");y=new Action("exportVsdx",function(){var n=null==f.pages||1>=f.pages.length;if(n)f.exportVisio();else{var v=document.createElement("div");v.style.whiteSpace="nowrap";var G=document.createElement("h3");mxUtils.write(G,mxResources.get("formatVsdx"));+G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";v.appendChild(G);var H=f.addCheckbox(v,mxResources.get("allPages"),!n,n);H.style.marginBottom="16px";n=new CustomDialog(f,v,mxUtils.bind(this,function(){f.exportVisio(!H.checked)}),null,mxResources.get("export"));f.showDialog(n.container,300,130,!0,!0)}});y.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};f.actions.put("exportVsdx",y);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&f.actions.addAction("configuration...",+function(){var n=document.createElement("input");n.setAttribute("type","checkbox");n.style.marginRight="8px";n.checked=mxSettings.getShowStartScreen();n.defaultChecked=n.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.cssFloat="right";v.style.cursor="pointer";v.style.userSelect="none";v.style.marginTop="-3px";v.appendChild(n);+mxUtils.write(v,mxResources.get("showStartScreen"));mxEvent.addListener(v,"click",function(H){mxEvent.getSource(H)!=n&&(n.checked=!n.checked)});header=v}v=[[mxResources.get("reset"),function(){f.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),f.hideDialog(),f.alert(mxResources.get("restartForChangeRequired"))}catch(H){f.handleError(H)}})}]];if(!f.isOfflineApp()&&isLocalStorage&&f.mode!=App.MODE_ATLAS){var G=f.actions.get("plugins");null==G||"sketch"!=+Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||v.push([mxResources.get("plugins"),G.funct])}EditorUi.isElectronApp||v.push([mxResources.get("link"),function(H,I){if(0<I.value.length)try{var g=JSON.parse(I.value),q=window.location.protocol+"//"+window.location.host+"/"+f.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(g)),C=new EmbedDialog(f,q);f.showDialog(C.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));C.init()}catch(J){f.handleError(J)}else f.handleError({message:mxResources.get("invalidInput")})}]);+"atlassian"!=f.getServiceName()&&"1"!=urlParams.embed&&v.push([mxResources.get("preferences"),function(){f.showLocalStorageDialog(mxResources.get("preferences")+":",Editor.settingsKey,[[mxResources.get("reset"),function(){f.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.settingsKey),localStorage.removeItem(".drawio-config"),f.hideDialog(),f.alert(mxResources.get("restartForChangeRequired"))}catch(H){f.handleError(H)}})}]])}]);f.showLocalStorageDialog(mxResources.get("configuration")++":",Editor.configurationKey,v,n.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=n.parentNode&&(mxSettings.setShowStartScreen(n.checked),mxSettings.save())})});(mxClient.IS_CHROMEAPP||isLocalStorage)&&this.put("language",new Menu(mxUtils.bind(this,function(n,v){var G=mxLanguage;null==urlParams.lang&&isLocalStorage&&(G=mxSettings.settings.language);var H=mxUtils.bind(this,function(g){var q=""==g?mxResources.get("automatic"):mxLanguageMap[g],C=null;""!=q&&(C=n.addItem(q,+null,mxUtils.bind(this,function(){f.setAndPersistLanguage(g)}),v),(g==G||""==g&&null==G)&&n.addCheckmark(C,Editor.checkmarkImage));return C});H("");n.addSeparator(v);for(var I in mxLanguageMap)H(I)})));f.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];f.actions.addAction("runLayout",function(){f.showCustomLayoutDialog(JSON.stringify(f.customLayoutConfig,null,2))});f.actions.put("adaptiveColors",+new Action("adaptiveColors",function(n){null==f.adaptiveColorsWindow&&(f.adaptiveColorsWindow=new AdaptiveColorsWindow(f,document.body.offsetWidth-520,80,200,160));f.adaptiveColorsWindow.window.setVisible(!0)}));y=this.get("viewZoom");var R=y.funct;y.funct=mxUtils.bind(this,function(n,v){R.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(n,["-","outline","fullscreen"],v)});y=this.get("layout");var K=y.funct;y.funct=function(n,v){K.apply(this,arguments);+n.addItem(mxResources.get("orgChart"),null,function(){var G=null,H=20,I=20,g=function(){"undefined"!==typeof mxOrgChartLayout&&null!=G&&f.tryAndHandle(mxUtils.bind(this,function(){var S=f.editor.graph,W=new mxOrgChartLayout(S,G,H,I),X=S.getDefaultParent();1<S.model.getChildCount(S.getSelectionCell())&&(X=S.getSelectionCell());W.execute(X)}))},q=document.createElement("div"),C=document.createElement("div");C.style.marginTop="6px";C.style.display="inline-block";C.style.width="180px";mxUtils.write(C,+mxResources.get("orgChartType")+": ");q.appendChild(C);var J=document.createElement("select");J.style.width="160px";J.style.boxSizing="border-box";C=[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 M=0;M<C.length;M++){var Q=document.createElement("option");mxUtils.write(Q,C[M]);Q.value=M;2==M&&Q.setAttribute("selected",+"selected");J.appendChild(Q)}mxEvent.addListener(J,"change",function(){G=J.value});q.appendChild(J);C=document.createElement("div");C.style.marginTop="6px";C.style.display="inline-block";C.style.width="180px";mxUtils.write(C,mxResources.get("parentChildSpacing")+": ");q.appendChild(C);var T=document.createElement("input");T.type="number";T.value=H;T.style.width="160px";T.style.boxSizing="border-box";q.appendChild(T);mxEvent.addListener(T,"change",function(){H=T.value});C=document.createElement("div");+C.style.marginTop="6px";C.style.display="inline-block";C.style.width="180px";mxUtils.write(C,mxResources.get("siblingSpacing")+": ");q.appendChild(C);var P=document.createElement("input");P.type="number";P.value=I;P.style.width="160px";P.style.boxSizing="border-box";q.appendChild(P);mxEvent.addListener(P,"change",function(){I=P.value});C=mxUtils.button(mxResources.get("custom")+"...",function(){var S=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(J.value),parentChildSpacing:parseInt(T.value),+siblingSpacing:parseInt(P.value)}}];f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(S,null,2))});C.className="geBtn";q=new CustomDialog(f,q,function(){null==G&&(G=2);f.loadOrgChartLayouts(g)},null,null,null,C);f.showDialog(q.container,355,140,!0,!0)},v,null,z());n.addSeparator(v);n.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){f.tryAndHandle(mxUtils.bind(this,function(){var G=new mxParallelEdgeLayout(x);G.checkOverlap=!0;f.prompt(mxResources.get("spacing"),G.spacing,+mxUtils.bind(this,function(H){f.tryAndHandle(mxUtils.bind(this,function(){G.spacing=H;f.executeLayout(function(){G.execute(x.getDefaultParent(),x.isSelectionEmpty()?null:x.getSelectionCells())},!1)}))}))}))}),v);n.addSeparator(v);f.menus.addMenuItem(n,"runLayout",v,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(n,v){if(mxClient.IS_CHROMEAPP||!f.isOffline()&&!navigator.standalone){var G=n.addItem(mxResources.get("search")+":",null,null,v,null,null,!1);+G.style.cursor="default";var H=document.createElement("input");H.setAttribute("type","text");H.setAttribute("size","25");H.style.borderWidth="1px";H.style.marginLeft="8px";mxEvent.addListener(H,"keydown",mxUtils.bind(this,function(I){var g=mxUtils.trim(H.value);13==I.keyCode&&0<g.length?(this.editorUi.searchHelp(g),H.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==I.keyCode&&(H.value="")}));G.firstChild.nextSibling.appendChild(H);mxEvent.addGestureListeners(H,+function(I){document.activeElement!=H&&H.focus();mxEvent.consume(I)},function(I){mxEvent.consume(I)},function(I){mxEvent.consume(I)});window.setTimeout(function(){H.focus()},0);EditorUi.isElectronApp?(f.actions.addAction("website...",function(){f.openLink("https://www.drawio.com")}),f.actions.addAction("check4Updates",function(){f.checkForUpdates()}),f.actions.put("desktopZoomIn",new Action("zoomIn",function(){f.desktopZoomIn()})),f.actions.put("desktopZoomOut",new Action("zoomOut",function(){f.desktopZoomOut()})),+f.actions.put("desktopResetZoom",new Action("actualSize",function(){f.desktopResetZoom()})),this.addMenuItems(n,"- keyboardShortcuts quickStart website support -".split(" "),v),"1"!=urlParams.disableUpdate&&this.addMenuItems(n,["check4Updates","-"],v),this.addMenuItems(n,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),v)):this.addMenuItems(n,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),v)}else this.addMenuItems(n,["keyboardShortcuts",+"-","about"],v);"1"==urlParams.test&&(n.addSeparator(v),this.addSubmenu("testDevelop",n,v))})));f.actions.addAction("languageCode...",function(){var n=new FilenameDialog(f,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(v){null!=v&&(Graph.diagramLanguage=0<v.length?v:null,Graph.translateDiagram=!0,x.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");f.showDialog(n.container,340,80,!0,!0);n.init()});this.put("diagramLanguage",+new Menu(mxUtils.bind(this,function(n,v){this.addMenuItems(n,["languageCode","-"],v);v=n.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;x.refresh()},v);Graph.translateDiagram||n.addCheckmark(v,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");+mxResources.parse("testChecksum=Checksum");mxResources.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");f.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!x.isSelectionEmpty()){var n=x.cloneCells(x.getSelectionCells()),+v=x.getBoundingBoxFromGeometry(n,!0);n=x.moveCells(n,-v.x,-v.y);f.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+v.width+", "+v.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(x.encodeCells(n)))+"'),")}}));f.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function n(q){return null==q||null==q.boundingBox||!isNaN(q.boundingBox.x)&&!isNaN(q.boundingBox.y)&&!isNaN(q.boundingBox.width)&&!isNaN(q.boundingBox.height)}var v=x.isSelectionEmpty()?x.getGraphBounds():+x.getBoundingBox(x.getSelectionCells()),G=x.view.translate,H=x.view.scale;x.insertVertex(x.getDefaultParent(),null,"",v.x/H-G.x,v.y/H-G.y,v.width/H,v.height/H,"fillColor=none;strokeColor=red;");var I=0,g=0;x.view.states.visit(function(q,C){q=!0;n(C.shape)||(console.log("invalid shape",C.cell.id,C.shape),q=!1);n(C.text)||(console.log("invalid text",C.cell.id,C.text),q=!1);q||I++;g++});console.log("states checked",g,"invalid",I)}));f.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var n=+null!=f.pages&&null!=f.getCurrentFile()?f.getCurrentFile().getAnonymizedXmlForPages(f.pages):"";n=new TextareaDialog(f,"Paste Data:",n,function(v){if(0<v.length)try{var G=function(C){function J(aa){if(null==Z[aa]){if(Z[aa]=!0,null!=T[aa]){for(;0<T[aa].length;){var ha=T[aa].pop();J(ha)}delete T[aa]}}else mxLog.debug(M+": Visited: "+aa)}var M=C.parentNode.id,Q=C.childNodes;C={};for(var T={},P=null,S={},W=0;W<Q.length;W++){var X=Q[W];if(null!=X.id&&0<X.id.length)if(null==C[X.id]){C[X.id]=X.id;var Y=+X.getAttribute("parent");null==Y?null!=P?mxLog.debug(M+": Multiple roots: "+X.id):P=X.id:(null==T[Y]&&(T[Y]=[]),T[Y].push(X.id))}else S[X.id]=X.id}Q=Object.keys(S);0<Q.length?(Q=M+": "+Q.length+" Duplicates: "+Q.join(", "),mxLog.debug(Q+" (see console)")):mxLog.debug(M+": Checked");var Z={};null==P?mxLog.debug(M+": No root"):(J(P),Object.keys(Z).length!=Object.keys(C).length&&(mxLog.debug(M+": Invalid tree: (see console)"),console.log(M+": Invalid tree",T)))};"<"!=v.charAt(0)&&(v=Graph.decompress(v),+mxLog.debug("See console for uncompressed XML"),console.log("xml",v));var H=mxUtils.parseXml(v),I=f.getPagesForNode(H.documentElement,"mxGraphModel");if(null!=I&&0<I.length)try{var g=f.getHashValueForPages(I);mxLog.debug("Checksum: ",g)}catch(C){mxLog.debug("Error: ",C.message)}else mxLog.debug("No pages found for checksum");var q=H.getElementsByTagName("root");for(v=0;v<q.length;v++)G(q[v]);mxLog.show()}catch(C){f.handleError(C),null!=window.console&&console.error(C)}});f.showDialog(n.container,+620,460,!0,!0);n.init()}));var L=null;f.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=f.pages){var n=new TextareaDialog(f,"Diff/Sync:","",function(v){var G=f.getCurrentFile();if(0<v.length&&null!=G)try{var H=JSON.parse(v);G.patch([H],null,!0,!0);f.hideDialog()}catch(I){f.handleError(I)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(v,G){L=f.getPagesForXml(f.getFileData(!0));n.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "++f.getHashValueForPages(L)}],["Diff",function(v,G){try{n.textarea.value=JSON.stringify(f.diffPages(L,f.pages),null,2)}catch(H){f.handleError(H)}}]]);null==L?(L=f.getPagesForXml(f.getFileData(!0)),n.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+f.getHashValueForPages(L)):n.textarea.value=JSON.stringify(f.diffPages(L,f.pages),null,2);f.showDialog(n.container,620,460,!0,!0);n.init()}else f.alert("No pages")}));f.actions.addAction("testChecksum",mxUtils.bind(this,function(){var n=+f.getCurrentFile();null!=f.pages&&null!=n?f.spinner.spin(document.body,mxResources.get("loading"))&&n.getLatestVersion(function(v){f.spinner.stop();var G=f.getHashValueForPages(f.pages),H=n.getCurrentRevisionId(),I=f.getHashValueForPages(v.getShadowPages()),g=v.getDescriptorChecksum(v.getDescriptor()),q=v.getCurrentRevisionId();console.log("Local File",[n],"modified",n.isModified(),"checksum",G);console.log("Remote File",[v],"rev",q==H,"desc",g==I,"checksum",I);f.alert("Checksums "+(I==G?"match":+"no not match"))},function(v){console.log("Error getLatestVersion",v);f.handleError(v)}):console.log("Checksum: no file or pages")}));f.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var n=f.getCurrentFile();console.log("editorUi",f,"file",n);if(null!=n&&n.isRealtime()){console.log("Checksum ownPages",f.getHashValueForPages(n.ownPages));console.log("Checksum theirPages",f.getHashValueForPages(n.theirPages));console.log("diff ownPages/theirPages",f.diffPages(n.ownPages,n.theirPages));+var v=n.getShadowPages();null!=v&&(console.log("Checksum shadowPages",f.getHashValueForPages(v)),console.log("diff shadowPages/ownPages",f.diffPages(v,n.ownPages)),console.log("diff ownPages/shadowPages",f.diffPages(n.ownPages,v)),console.log("diff theirPages/shadowPages",f.diffPages(n.theirPages,v)));null!=n.sync&&null!=n.sync.snapshot&&(console.log("Checksum snapshot",f.getHashValueForPages(n.sync.snapshot)),console.log("diff ownPages/snapshot",f.diffPages(n.ownPages,n.sync.snapshot)),console.log("diff theirPages/snapshot",+f.diffPages(n.theirPages,n.sync.snapshot)),null!=f.pages&&console.log("diff snapshot/actualPages",f.diffPages(n.sync.snapshot,f.pages)));null!=f.pages&&(console.log("diff ownPages/actualPages",f.diffPages(n.ownPages,f.pages)),console.log("diff theirPages/actualPages",f.diffPages(n.theirPages,f.pages)))}null!=n&&console.log("Shadow pages",[f.getXmlForPages(n.getShadowPages())]);null!=f.pages&&console.log("Checksum actualPages",f.getHashValueForPages(f.pages))}));f.actions.addAction("testFixPages",+mxUtils.bind(this,function(){console.log("editorUi",f);var n=f.getCurrentFile();null!=n&&n.isRealtime()&&null!=n.shadowPages&&(console.log("patching actualPages to shadowPages",n.patch([f.diffPages(n.shadowPages,f.pages)])),n.ownPages=f.clonePages(f.pages),n.theirPages=f.clonePages(f.pages),n.shadowPages=f.clonePages(f.pages),null!=n.sync&&(n.sync.snapshot=f.clonePages(f.pages)))}));f.actions.addAction("testOptimize",mxUtils.bind(this,function(){x.model.beginUpdate();try{var n=x.model.cells,v=0,G=+[],H=[],I;for(I in n){var g=n[I],q=x.getCurrentCellStyle(g)[mxConstants.STYLE_IMAGE];null!=q&&"data:"==q.substring(0,5)&&(null==G[q]&&(G[q]=(G[q]||0)+1,v++),H.push(g))}x.setCellStyles(mxConstants.STYLE_IMAGE,null,H);console.log("Removed",v,"image(s) from",H.length,"cell(s): ",[H,G])}finally{x.model.endUpdate()}}));f.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(f,x.getModel())}));f.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var n=new mxImageExport,+v=x.getGraphBounds(),G=x.view.scale,H=mxUtils.createXmlDocument(),I=H.createElement("output");H.appendChild(I);H=new mxXmlCanvas2D(I);H.translate(Math.floor((1-v.x)/G),Math.floor((1-v.y)/G));H.scale(1/G);var g=0,q=H.save;H.save=function(){g++;q.apply(this,arguments)};var C=H.restore;H.restore=function(){g--;C.apply(this,arguments)};var J=n.drawShape;n.drawShape=function(M){mxLog.debug("entering shape",M,g);J.apply(this,arguments);mxLog.debug("leaving shape",M,g)};n.drawState(x.getView().getState(x.model.root),+H);mxLog.show();mxLog.debug(mxUtils.getXml(I));mxLog.debug("stateCounter",g)}));f.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var O=null,c=null,d=null,k=null,m=null,t=null,u=null,A=null;f.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=O?(x.view.revalidate=O,O=null):(O=x.view.revalidate,x.view.revalidate=function(){var n=Date.now(),v=O.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",+[this],"time",Date.now()-n+" ms","args",arguments);return v});null!=c?(f.selectPage=c,c=null):(c=f.selectPage,f.selectPage=function(){var n=Date.now(),v=c.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-n+" ms","args",arguments);return v});null!=d?(f.diffPages=d,d=null):(d=f.diffPages,f.diffPages=function(){var n=Date.now(),v=d.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-n+" ms","args",arguments);+return v});null!=k?(f.patchPages=k,k=null):(k=f.patchPages,f.patchPages=function(){var n=Date.now(),v=k.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-n+" ms","args",arguments);return v});null!=m?(f.clonePages=m,m=null):(m=f.clonePages,f.clonePages=function(){var n=Date.now(),v=m.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-n+" ms","args",arguments);return v});null!=u?(f.getHashValueForPages=u,+u=null):(u=f.getHashValueForPages,f.getHashValueForPages=function(){var n=Date.now(),v=u.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-n+" ms","args",arguments);return v});null!=A?(f.resolveCrossReferences=A,A=null):(A=f.resolveCrossReferences,f.resolveCrossReferences=function(){var n=Date.now(),v=A.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-n+" ms","args",arguments);return v});+null!=t?(f.getFileData=t,t=null):(t=f.getFileData,f.getFileData=function(){var n=Date.now(),v=t.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-n+" ms","args",arguments);return v});EditorUi.debug("[Performance]",null!=O?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(n,v){this.addMenuItems(n,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),+v);var G=n.addItem(mxResources.get("testPerformance"),null,function(){f.actions.get("testPerformance").funct()},v);null!=O&&n.addCheckmark(G,Editor.checkmarkImage);this.addMenuItems(n,["-","testShowConsole"],v)})))}f.actions.put("shapes",new Action("moreShapes...",function(n){mxClient.IS_CHROMEAPP||!f.isOffline()?f.showDialog((new MoreShapesDialog(f,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):f.showDialog((new MoreShapesDialog(f,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)}));f.actions.put("createShape",new Action("shape...",function(n){x.isEnabled()&&(n=new mxCell("",new mxGeometry(0,0,120,120),f.defaultCustomShapeStyle),n.vertex=!0,n=new EditShapeDialog(f,n,mxResources.get("editShape")),f.showDialog(n.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),n.init())})).isEnabled=z;f.isOffline()||("1"!=urlParams.embed&&(f.actions.put("embedNotion",new Action("notion...",function(){var n=document.createElement("div");n.style.position=-"absolute";n.style.bottom="30px";n.style.textAlign="center";n.style.width="100%";n.style.left="0px";var u=document.createElement("a");u.setAttribute("href","javascript:void(0);");u.setAttribute("target","_blank");u.style.cursor="pointer";mxUtils.write(u,mxResources.get("getNotionChromeExtension"));n.appendChild(u);mxUtils.setPrefixedStyle(u.style,"transition","all 1s ease");mxUtils.setOpacity(u,0);window.setTimeout(function(){mxUtils.setOpacity(u,100)},300);mxEvent.addListener(u,"click",function(G){f.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");-mxEvent.consume(G)});f.getPublicUrl(f.getCurrentFile(),function(G){f.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",n,G,f.getCurrentFile(),function(H,I,g,q,B,J,Q,N,S,P,R,W){Q=["border=0"];S&&Q.push("tags=%7B%7D");H=new EmbedDialog(f,f.createLink(H,I,!0,q,B,J,"public"==P?G:null,null,Q,null,g,null,W));f.showDialog(H.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));H.init()},null,!0)})})),f.actions.addAction("microsoftOffice...",-function(){f.openLink("https://office.draw.io")})),f.actions.put("embedHtml",new Action("html...",function(){f.getPublicUrl(f.getCurrentFile(),function(n){f.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",n,function(u,G,H,I,g,q,B,J,Q,N,S,P){f.createHtml(u,G,H,I,g,q,B,J,Q,N,S,mxUtils.bind(this,function(R,W){var X=new EmbedDialog(f,"\x3c!-- "+f.editor.appName+" diagram --\x3e\n"+R+"\n"+W+"\n",null,null,function(){try{var Y=window.open();if(null!=Y&&null!=-Y.document){var aa=Y.document;"CSS1Compat"===document.compatMode&&aa.writeln("<!DOCTYPE html>");aa.writeln("<html>");aa.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');aa.writeln("<body>");aa.writeln(R);var ba=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;ba&&aa.writeln(W);aa.writeln("</body>");aa.writeln("</html>");aa.close();if(!ba){var fa=Y.document.createElement("div");fa.marginLeft="26px";fa.marginTop="26px";mxUtils.write(fa,-mxResources.get("updatingDocument"));var ia=Y.document.createElement("img");ia.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ia.style.marginLeft="6px";fa.appendChild(ia);Y.document.body.insertBefore(fa,Y.document.body.firstChild);window.setTimeout(function(){var ea=document.createElement("script");ea.type="text/javascript";ea.src=/<script.*?src="(.*?)"/.exec(W)[1];aa.body.appendChild(ea);fa.parentNode.removeChild(fa)},20)}}else f.handleError({message:mxResources.get("errorUpdatingPreview")})}catch(ea){f.handleError(ea)}});-f.showDialog(X.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));X.init()}),P)})})})),f.actions.put("liveImage",new Action("Live image...",function(){var n=f.getCurrentFile();null!=n&&f.getPublicUrl(n,function(u){null!=u?(u=new EmbedDialog(f,'<img src="'+(n.constructor!=DriveFile?u:"https://drive.google.com/uc?id="+n.getId())+'"/>'),f.showDialog(u.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250)),u.init()):f.handleError({message:mxResources.get("invalidPublicUrl")})})})),-f.actions.put("embedImage",new Action("image...",function(){f.showEmbedImageDialog(function(n,u,G,H,I,g){f.spinner.spin(document.body,mxResources.get("loading"))&&f.createEmbedImage(n,u,G,H,I,g,function(q){f.spinner.stop();q=new EmbedDialog(f,q);f.showDialog(q.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));q.init()},function(q){f.spinner.stop();f.handleError(q)})},mxResources.get("image"),mxResources.get("retina"),f.editor.isExportToCanvas())})),f.actions.put("embedSvg",new Action("formatSvg...",-function(){f.showEmbedImageDialog(function(n,u,G,H,I,g){f.spinner.spin(document.body,mxResources.get("loading"))&&f.createEmbedSvg(n,u,G,H,I,g,function(q){f.spinner.stop();q=new EmbedDialog(f,q);f.showDialog(q.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));q.init()},function(q){f.spinner.stop();f.handleError(q)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")})),f.actions.put("embedIframe",new Action("iframe...",function(){f.getPublicUrl(f.getCurrentFile(),-function(n){var u=x.getGraphBounds();f.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,u.height/x.view.scale))+2,null,null,null,n,f.getCurrentFile(),function(G,H,I,g,q,B,J,Q,N,S,P,R){var W=[];N&&W.push("tags=%7B%7D");G=new EmbedDialog(f,'<iframe frameborder="0" style="width:'+J+";height:"+Q+';" src="'+f.createLink(G,H,!0,g,q,B,"public"==S?n:null,null,W,null,I,P,R)+'"'+(P?' allowtransparency="true"':"")+"></iframe>");f.showDialog(G.container,450,270,!0,!0,null,!1,null,-new mxRectangle(0,0,400,250));G.init()},!0,!0)})})));f.actions.put("publishLink",new Action("link...",function(){f.getPublicUrl(f.getCurrentFile(),function(n){f.showPublishLinkDialog(null,null,null,null,null,null,n,f.getCurrentFile(),function(u,G,H,I,g,q,B,J,Q,N,S,P){B=[];I&&Q&&B.push("tags=%7B%7D");u=new EmbedDialog(f,f.createLink(u,G,!0,I,g,q,"public"==N?n:null,null,B,null,H,null,P));f.showDialog(u.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));u.init()},null,!0)})},null,null,+"absolute";n.style.bottom="30px";n.style.textAlign="center";n.style.width="100%";n.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"));n.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(G){f.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");+mxEvent.consume(G)});f.getPublicUrl(f.getCurrentFile(),function(G){f.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",n,G,f.getCurrentFile(),function(H,I,g,q,C,J,M,Q,T,P,S,W){M=["border=0"];T&&M.push("tags=%7B%7D");H=new EmbedDialog(f,f.createLink(H,I,!0,q,C,J,"public"==P?G:null,null,M,null,g,null,W));f.showDialog(H.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));H.init()},null,!0)})})),f.actions.addAction("microsoftOffice...",+function(){f.openLink("https://office.draw.io")})),f.actions.put("embedHtml",new Action("html...",function(){f.getPublicUrl(f.getCurrentFile(),function(n){f.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",n,function(v,G,H,I,g,q,C,J,M,Q,T,P){f.createHtml(v,G,H,I,g,q,C,J,M,Q,T,mxUtils.bind(this,function(S,W){var X=new EmbedDialog(f,"\x3c!-- "+f.editor.appName+" diagram --\x3e\n"+S+"\n"+W+"\n",null,null,function(){try{var Y=window.open();if(null!=Y&&null!=+Y.document){var Z=Y.document;"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(S);var aa=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;aa&&Z.writeln(W);Z.writeln("</body>");Z.writeln("</html>");Z.close();if(!aa){var ha=Y.document.createElement("div");ha.marginLeft="26px";ha.marginTop="26px";mxUtils.write(ha,+mxResources.get("updatingDocument"));var ja=Y.document.createElement("img");ja.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ja.style.marginLeft="6px";ha.appendChild(ja);Y.document.body.insertBefore(ha,Y.document.body.firstChild);window.setTimeout(function(){var fa=document.createElement("script");fa.type="text/javascript";fa.src=/<script.*?src="(.*?)"/.exec(W)[1];Z.body.appendChild(fa);ha.parentNode.removeChild(ha)},20)}}else f.handleError({message:mxResources.get("errorUpdatingPreview")})}catch(fa){f.handleError(fa)}});+f.showDialog(X.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));X.init()}),P)})})})),f.actions.put("liveImage",new Action("Live image...",function(){var n=f.getCurrentFile();null!=n&&f.getPublicUrl(n,function(v){null!=v?(v=new EmbedDialog(f,'<img src="'+(n.constructor!=DriveFile?v:"https://drive.google.com/uc?id="+n.getId())+'"/>'),f.showDialog(v.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250)),v.init()):f.handleError({message:mxResources.get("invalidPublicUrl")})})})),+f.actions.put("embedImage",new Action("image...",function(){f.showEmbedImageDialog(function(n,v,G,H,I,g){f.spinner.spin(document.body,mxResources.get("loading"))&&f.createEmbedImage(n,v,G,H,I,g,function(q){f.spinner.stop();q=new EmbedDialog(f,q);f.showDialog(q.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));q.init()},function(q){f.spinner.stop();f.handleError(q)})},mxResources.get("image"),mxResources.get("retina"),f.editor.isExportToCanvas())})),f.actions.put("embedSvg",new Action("formatSvg...",+function(){f.showEmbedImageDialog(function(n,v,G,H,I,g){f.spinner.spin(document.body,mxResources.get("loading"))&&f.createEmbedSvg(n,v,G,H,I,g,function(q){f.spinner.stop();q=new EmbedDialog(f,q);f.showDialog(q.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));q.init()},function(q){f.spinner.stop();f.handleError(q)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")})),f.actions.put("embedIframe",new Action("iframe...",function(){f.getPublicUrl(f.getCurrentFile(),+function(n){var v=x.getGraphBounds();f.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,v.height/x.view.scale))+2,null,null,null,n,f.getCurrentFile(),function(G,H,I,g,q,C,J,M,Q,T,P,S){var W=[];Q&&W.push("tags=%7B%7D");G=new EmbedDialog(f,'<iframe frameborder="0" style="width:'+J+";height:"+M+';" src="'+f.createLink(G,H,!0,g,q,C,"public"==T?n:null,null,W,null,I,P,S)+'"'+(P?' allowtransparency="true"':"")+"></iframe>");f.showDialog(G.container,450,270,!0,!0,null,!1,null,+new mxRectangle(0,0,400,250));G.init()},!0,!0)})})));f.actions.put("publishLink",new Action("link...",function(){f.getPublicUrl(f.getCurrentFile(),function(n){f.showPublishLinkDialog(null,null,null,null,null,null,n,f.getCurrentFile(),function(v,G,H,I,g,q,C,J,M,Q,T,P){C=[];I&&M&&C.push("tags=%7B%7D");v=new EmbedDialog(f,f.createLink(v,G,!0,I,g,q,"public"==Q?n:null,null,C,null,H,null,P));f.showDialog(v.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));v.init()},null,!0)})},null,null,null,!f.isOffline()));if(isLocalStorage||mxClient.IS_CHROMEAPP)y=f.actions.addAction("scratchpad",function(){f.toggleScratchpad()}),y.setToggleAction(!0),y.setSelectedCallback(function(){return null!=f.scratchpad}),"0"!=urlParams.plugins&&f.actions.addAction("plugins...",function(){f.showDialog((new PluginsDialog(f)).container,380,240,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(y=f.actions.addAction("highContrast",function(){f.setAndPersistHighContrast(!f.isHighContrast())}),y.setToggleAction(!0),y.setSelectedCallback(function(){return f.isHighContrast()}));y=f.actions.addAction("search",function(){if(null!=f.sidebar){var n=f.sidebar.isEntryVisible("search");f.sidebar.showPalette("search",!n);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!n,mxSettings.save())}});y.label=mxResources.get("searchShapes");y.setToggleAction(!0);y.setSelectedCallback(function(){return null!=f.sidebar&&f.sidebar.isEntryVisible("search")});f.actions.get("clearDefaultStyle").funct=function(n){x.isEnabled()&&-(f.clearDefaultStyle(),Editor.sketchMode&&f.setSketchMode(!1))};"1"==urlParams.embed&&(f.actions.get("saveAs").setEnabled(!1),f.actions.get("save").funct=function(n){x.isEditing()&&x.stopEditing();var u="0"!=urlParams.pages||null!=f.pages&&1<f.pages.length?f.getFileData(!0):mxUtils.getXml(f.editor.getGraphXml());if("json"==urlParams.proto){var G=f.createLoadMessage("save");G.xml=u;!0!==n||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(G.exit=!0);u=JSON.stringify(G)}(window.opener||window.parent).postMessage(u,+(f.clearDefaultStyle(),Editor.sketchMode&&f.setSketchMode(!1))};"1"==urlParams.embed&&(f.actions.get("saveAs").setEnabled(!1),f.actions.get("save").funct=function(n){x.isEditing()&&x.stopEditing();var v="0"!=urlParams.pages||null!=f.pages&&1<f.pages.length?f.getFileData(!0):mxUtils.getXml(f.editor.getGraphXml());if("json"==urlParams.proto){var G=f.createLoadMessage("save");G.xml=v;!0!==n||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(G.exit=!0);v=JSON.stringify(G)}(window.opener||window.parent).postMessage(v,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(f.editor.modified=!1,f.clearStatus());n=f.getCurrentFile();null==n||n.constructor==EmbedFile||n.constructor==LocalFile&&null==n.mode||f.saveFile()},f.actions.addAction("saveAndExit",function(){"1"==urlParams.toSvg?f.sendEmbeddedSvgExport():f.actions.get("save").funct(!0)},null,null,Editor.ctrlKey+"+S").label="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),f.actions.addAction("exit",function(){if("1"==-urlParams.embedInline)f.sendEmbeddedSvgExport();else{var n=function(){f.editor.modified=!1;var u="json"==urlParams.proto?JSON.stringify({event:"exit",modified:f.editor.modified}):"";(window.opener||window.parent).postMessage(u,"*")};f.editor.modified?f.confirm(mxResources.get("allChangesLost"),null,n,mxResources.get("cancel"),mxResources.get("discardChanges")):n()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(n,u){f.editor.isExportToCanvas()?-(this.addMenuItems(n,["exportPng"],u),Editor.jpgSupported&&this.addMenuItems(n,["exportJpg"],u),Editor.webpSupported&&this.addMenuItems(n,["exportWebp"],u)):f.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(n,["exportPng","exportJpg"],u);f.editor.isExportToCanvas()&&this.addMenuItems(n,["exportAnimatedGif"],u);this.addMenuItems(n,["exportSvg","-"],u);f.isOffline()||f.printPdfExport?this.addMenuItems(n,["exportPdf"],u):f.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(n,-["exportPdf"],u);!f.vsdxExportEnabled()||mxClient.IS_IE||"undefined"===typeof VsdxExport&&f.isOffline()||this.addMenuItems(n,["exportVsdx"],u);var G=["-","exportHtml","exportXml"];Editor.enableExportUrl&&G.push("exportUrl");this.addMenuItems(n,G,u);f.isOffline()||(n.addSeparator(u),this.addMenuItem(n,"export",u).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=Editor.currentTheme||f.isOffline()||this.addMenuItems(n,["publishLink"],-u);f.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||f.isOffline()||(n.addSeparator(u),f.menus.addSubmenu("embed",n,u))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(n,u){function G(g){g.pickFile(function(q){f.spinner.spin(document.body,mxResources.get("loading"))&&g.getFile(q,function(B){var J="data:image/"==B.getData().substring(0,11)?I(B.getTitle()):"text/xml";/\.svg$/i.test(B.getTitle())&&!f.editor.isDataSvg(B.getData())&&-(B.setData(Editor.createSvgDataUri(B.getData())),J="image/svg+xml");H(B.getData(),J,B.getTitle())},function(B){f.handleError(B,null!=B?mxResources.get("errorLoadingFile"):null)},g==f.drive)},!0)}var H=mxUtils.bind(this,function(g,q,B){var J=x.view,Q=x.getGraphBounds(),N=x.snap(Math.ceil(Math.max(0,Q.x/J.scale-J.translate.x)+4*x.gridSize)),S=x.snap(Math.ceil(Math.max(0,(Q.y+Q.height)/J.scale-J.translate.y)+4*x.gridSize));"data:image/"==g.substring(0,11)?f.loadImage(g,mxUtils.bind(this,function(P){var R=-!0,W=mxUtils.bind(this,function(){f.resizeImage(P,g,mxUtils.bind(this,function(X,Y,aa){X=R?Math.min(1,Math.min(f.maxImageSize/Y,f.maxImageSize/aa)):1;f.importFile(g,q,N,S,Math.round(Y*X),Math.round(aa*X),B,function(ba){f.spinner.stop();x.setSelectionCells(ba);x.scrollCellToVisible(x.getSelectionCell())})}),R)});g.length>f.resampleThreshold?f.confirmImageResize(function(X){R=X;W()}):W()}),mxUtils.bind(this,function(){f.handleError({message:mxResources.get("cannotOpenFile")})})):f.importFile(g,q,N,-S,0,0,B,function(P){f.spinner.stop();x.setSelectionCells(P);x.scrollCellToVisible(x.getSelectionCell())})}),I=mxUtils.bind(this,function(g){var q="text/xml";/\.png$/i.test(g)?q="image/png":/\.jpe?g$/i.test(g)?q="image/jpg":/\.gif$/i.test(g)?q="image/gif":/\.pdf$/i.test(g)&&(q="application/pdf");return q});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=f.drive?n.addItem(mxResources.get("googleDrive")+"...",null,function(){G(f.drive)},u):f.isModeEnabled(App.MODE_GOOGLE)&&n.addItem(mxResources.get("googleDrive")+-" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1));f.isModeReady(App.MODE_ONEDRIVE)?n.addItem(mxResources.get("oneDrive")+"...",null,function(){G(f.oneDrive)},u):f.isModeEnabled(App.MODE_ONEDRIVE)&&n.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);f.isModeReady(App.MODE_DROPBOX)?n.addItem(mxResources.get("dropbox")+"...",null,function(){G(f.dropbox)},u):f.isModeEnabled(App.MODE_DROPBOX)&&n.addItem(mxResources.get("dropbox")+-" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);n.addSeparator(u);f.isModeReady(App.MODE_GITHUB)&&n.addItem(mxResources.get("github")+"...",null,function(){G(f.gitHub)},u);f.isModeReady(App.MODE_GITLAB)&&n.addItem(mxResources.get("gitlab")+"...",null,function(){G(f.gitLab)},u);f.isModeReady(App.MODE_TRELLO)?n.addItem(mxResources.get("trello")+"...",null,function(){G(f.trello)},u):f.isModeEnabled(App.MODE_TRELLO)&&n.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+-"...)",null,function(){},u,null,!1);n.addSeparator(u);isLocalStorage&&"0"!=urlParams.browser&&n.addItem(mxResources.get("browser")+"...",null,function(){f.importLocalFile(!1)},u);"1"!=urlParams.noDevice&&n.addItem(mxResources.get("device")+"...",null,function(){f.importLocalFile(!0)},u);f.isOffline()||(n.addSeparator(u),n.addItem(mxResources.get("url")+"...",null,function(){var g=new FilenameDialog(f,"",mxResources.get("import"),function(q){if(null!=q&&0<q.length&&f.spinner.spin(document.body,mxResources.get("loading"))){var B=-/(\.png)($|\?)/i.test(q)?"image/png":"text/xml";f.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(q),function(J){H(J,B,q)},function(){f.spinner.stop();f.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==B)}},mxResources.get("url"));f.showDialog(g.container,300,80,!0,!0);g.init()},u))}))).isEnabled=z;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(n,u){var G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&-(750>G&&this.addSubmenu("viewZoom",n,u,mxResources.get("zoom")),460>G&&f.isPageMenuVisible()&&this.addSubmenu("pages",n,u),320>G&&this.addSubmenu("insert",n,u),360>G&&"1"!=urlParams.embed&&"draw.io"==f.getServiceName()&&this.addSubmenu("share",n,u))})));this.put("appearance",new Menu(mxUtils.bind(this,function(n,u){if(f.isAutoDarkModeSupported()){var G=f.menus.addMenuItem(n,"autoMode",u);null!=G&&G.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+-")")}this.addMenuItems(n,["lightMode","darkMode","-"],u);G=f.menus.addMenuItem(n,"highContrast",u);(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&f.menus.addLinkToItem(G,"https://github.com/jgraph/drawio/issues/4296")})));f.actions.addAction("addToScratchpad",function(n){x.isSelectionEmpty()||null==f.addSelectionToScratchpad||f.addSelectionToScratchpad(n)});f.actions.addAction("accounts...",function(){f.toggleUserPanel();f.userPanel.style.right="10px";f.userPanel.style.top="10px"});-this.put("theme",new Menu(mxUtils.bind(this,function(n,u){var G="1"==urlParams.sketch?"sketch":mxSettings.getUi(),H=n.addItem(mxResources.get("automatic"),null,function(){f.setCurrentTheme("")},u),I=n.addItem(mxResources.get("classic"),null,function(){f.setCurrentTheme("kennedy")},u),g=!1;if("kennedy"==G||"dark"==G)n.addCheckmark(I,Editor.checkmarkImage),g=!0;for(var q=0;q<Editor.themes.length;q++)mxUtils.bind(this,function(B){I=n.addItem(mxResources.get("min"==B?"minimal":B),null,function(){f.setCurrentTheme(B)},-u);G==B&&(n.addCheckmark(I,Editor.checkmarkImage),g=!0);"simple"==B&&n.addSeparator(u)})(Editor.themes[q]);g||n.addCheckmark(H,Editor.checkmarkImage)})));y=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var n=this.editorUi.getCurrentFile();if(null!=n)if(n.constructor==LocalFile&&null!=n.fileHandle)f.showSaveFilePicker(mxUtils.bind(f,function(G,H){n.invalidFileHandle=null;n.fileHandle=G;n.title=H.name;n.desc=H;f.save(H.name)}),null,f.createFileSystemOptions(n.getTitle()));-else{var u=null!=n.getTitle()?n.getTitle():this.editorUi.defaultFilename;u=new FilenameDialog(this.editorUi,u,mxResources.get("rename"),mxUtils.bind(this,function(G){null!=G&&0<G.length&&null!=n&&G!=n.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&n.rename(G,mxUtils.bind(this,function(H){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(H){this.editorUi.handleError(H,null!=H?mxResources.get("errorRenamingFile"):null)}))}),n.constructor==DriveFile||n.constructor==-StorageFile?mxResources.get("diagramName"):null,function(G){if(null!=G&&0<G.length)return!0;f.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,f.editor.fileExtensions);this.editorUi.showDialog(u.container,340,100,!0,!0);u.init()}}));y.isEnabled=function(){return this.enabled&&z.apply(this,arguments)};y.visible="1"!=urlParams.embed;f.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var n=f.getCurrentFile();-if(null!=n){var u=f.getCopyFilename(n);n.constructor==DriveFile?(u=new SaveDialog(f,u,mxUtils.bind(this,function(G,H,I){f.hideDialog();n.copyFile(mxUtils.bind(this,function(g){n.move(I,mxUtils.bind(this,function(q){f.spinner.stop()}),mxUtils.bind(this,function(q){f.handleError(q)}))}),mxUtils.bind(this,function(g){f.handleError(g)}),G.value)}),null,null,null,null,null,null,[App.MODE_GOOGLE],mxResources.get("ok")),f.showDialog(u.container,420,150,!0,!1,mxUtils.bind(this,function(){f.hideDialog()})),-u.init()):f.editor.editAsNew(this.editorUi.getFileData(!0),u)}}));y=new Action("openFolder",function(n,u){n=f.getCurrentFile();null!=n&&f.openLink(n.getFolderUrl())});y.getTitle=function(){return mxResources.get("openIt",[mxResources.get("folder")])+"..."};f.actions.put("openFolder",y);f.actions.addAction("openFile...",mxUtils.bind(this,function(){var n=f.getCurrentFile();null!=n&&f.openLink(n.getFileUrl())}));f.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var n=f.getCurrentFile();-if(n.getMode()==App.MODE_GOOGLE||n.getMode()==App.MODE_ONEDRIVE){var u=new SaveDialog(f,"",mxUtils.bind(this,function(G,H,I){f.hideDialog();f.spinner.spin(document.body,mxResources.get("moving"))&&n.move(I,mxUtils.bind(this,function(g){f.spinner.stop()}),mxUtils.bind(this,function(g){f.handleError(g)}))}),null,null,null,null,null,n.getMode());f.showDialog(u.container,420,70,!0,!1,mxUtils.bind(this,function(){f.hideDialog()}));u.init()}}));this.put("publish",new Menu(mxUtils.bind(this,function(n,u){this.addMenuItems(n,-["publishLink","presentationMode"],u)})));EditorUi.isElectronApp||!f.isOwnGDriveDomain()||"draw.io"!=f.getServiceName()||navigator.standalone||f.actions.put("presentationMode",new Action("presentationMode...",function(){var n=null!=f.getCurrentFile()?f.getCurrentFile().getTitle():null;f.editor.editAsNew(f.getFileData(!0),n,!0,null!=f.currentPage?f.currentPage.getId():null)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var n=f.getCurrentFile();null!=n&&n.share()}catch(u){f.handleError(u)}})).isEnabled=-z;this.put("embed",new Menu(mxUtils.bind(this,function(n,u){var G=f.getCurrentFile();null==G||G.getMode()!=App.MODE_GOOGLE&&G.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(G.getTitle())||this.addMenuItems(n,["liveImage","-"],u);this.addMenuItems(n,["embedImage","embedSvg","-","embedHtml"],u);navigator.standalone||f.isOffline()||this.addMenuItems(n,["embedIframe"],u);this.addMenuItems(n,["-","microsoftOffice","-","embedNotion"],u)})));y=function(n){var u=mxResources.get(n)+"...";f.actions.put(n,new Action(u,-function(G){if("fromText"==n||"formatSql"==n||"plantUml"==n||"mermaid"==n){var H=new ParseDialog(f,u,n);f.showDialog(H.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280))}else H=new CreateGraphDialog(f,u,n),f.showDialog(H.container,620,420,!0,!1,function(I,g){if(g)return f.confirm(mxResources.get("areYouSure"),function(){f.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()})).isEnabled=z};y("mermaid");y("horizontalFlow");y("verticalFlow");y("horizontalTree");y("verticalTree");y("radialTree");y("organic");y("circle");y("fromText");y("formatSql");("https://plant-aws.diagrams.net"!=window.PLANT_URL||EditorUi.enablePlantUml&&!f.isOffline())&&y("plantUml");var C=function(n){x.getModel().beginUpdate();try{n=x.addCell(n),x.fireEvent(new mxEventObject("cellsInserted","cells",[n])),x.model.isVertex(n)&&x.isAutoSizeCell(n)&&x.updateCellSize(n)}finally{x.getModel().endUpdate()}x.scrollCellToVisible(n);-x.setSelectionCell(n);x.container.focus();x.editAfterInsert&&x.startEditing(n);window.setTimeout(function(){null!=f.hoverIcons&&f.hoverIcons.update(x.view.getState(n))},0);return n},E=function(n,u,G,H,I){n=new mxCell(n,new mxGeometry(0,0,u,G),H);n.vertex=!0;null==I&&(I=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([n],!0)));n.geometry.x=I.x;n.geometry.y=I.y;return C(n)};f.actions.put("insertText",new Action("text",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&x.startEditingAtCell(E("Text",-60,30,x.appendFontSize(Editor.defaultTextStyle,x.vertexFontSize),null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint()))},null,null,"A")).isEnabled=z;f.actions.put("insertRectangle",new Action("rectangle",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&E("",120,60,"whiteSpace=wrap;html=1;",null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"D")).isEnabled=z;f.actions.put("insertNote",-new Action("note",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&E("",160,160,Editor.defaultNoteStyle,null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"S")).isEnabled=z;f.actions.put("insertEllipse",new Action("ellipse",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&E("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?-null:x.getInsertPoint())},null,null,"F")).isEnabled=z;f.actions.put("insertRhombus",new Action("rhombus",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&E("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"R")).isEnabled=z;f.actions.put("insertEdge",new Action("line",function(n){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var u=x.defaultEdgeLength;n=null==n||-mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint();null==n&&(n=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([G],!0)));var G=new mxCell("",new mxGeometry(0,0,u,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");G.geometry.setTerminalPoint(n,!0);G.geometry.setTerminalPoint(new mxPoint(n.x+G.geometry.width,n.y),!1);G.geometry.points=[];G.geometry.relative=!0;G.edge=!0;C(G)}},null,null,"C")).isEnabled=z;f.actions.put("insertPolygon",new Action("polygon...",-function(n){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var u=new PolygonDialog(f,null,function(G){G=new mxCell("",new mxGeometry(0,0,80,80),G);G.vertex=!0;var H=null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint();null==H&&(H=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([G],!0)));G.geometry.x=H.x;G.geometry.y=H.y;return C(G)});f.showDialog(u.container,680,540,!0,!0,function(){u.destroy()},null,null,new mxRectangle(0,0,740,600));-u.init()}})).isEnabled=z;y=f.actions.put("toggleShapes",new Action("shapes",function(){null!=f.sidebarWindow?f.sidebarWindow.window.setVisible(!f.sidebarWindow.window.isVisible()):f.toggleShapesPanel(!f.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+K"));y.setToggleAction(!0);y.setSelectedCallback(mxUtils.bind(this,function(){return null!=f.sidebarWindow&&f.sidebarWindow.window.isVisible()||null==f.sidebarWindow&&0<f.hsplitPosition}));f.actions.put("showShapePicker",new Action(mxResources.get("shapes")+-"...",function(){var n=x._contextMenuScreenPoint;f.showShapePicker(null!=n?n.x:x.container.clientWidth/2,null!=n?n.y:x.container.clientHeight/2)}));this.put("insert",new Menu(mxUtils.bind(this,function(n,u){Editor.passiveScroll?(f.menus.addMenuItems(n,["showShapePicker"],u),f.menus.addSubmenu("table",n,u),n.addSeparator(u),f.menus.addMenuItems(n,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - insertImage createShape insertPolygon -".split(" "),u),f.insertTemplateEnabled&&-!f.isOffline()&&f.menus.addMenuItems(n,["insertTemplate"],u),f.menus.addMenuItems(n,["-","insertFreehand","generate","-"],u),f.menus.addSubmenu("layout",n,u),f.menus.addSubmenu("insertAdvanced",n,u,mxResources.get("advanced"))):"sketch"==Editor.currentTheme?(f.menus.addMenuItems(n,["toggleShapes"],u),f.menus.addSubmenu("table",n,u),n.addSeparator(u),f.menus.addMenuItems(n,"insertText insertLink - insertImage createShape insertPolygon -".split(" "),u),f.insertTemplateEnabled&&!f.isOffline()&&f.menus.addMenuItems(n,-["insertTemplate"],u),window.isMermaidEnabled&&f.menus.addMenuItems(n,["mermaid"],u),f.menus.addMenuItems(n,["-","insertFreehand","generate","-"],u),f.menus.addSubmenu("layout",n,u),f.menus.addSubmenu("insertAdvanced",n,u,mxResources.get("advanced"))):(this.addMenuItems(n,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - insertImage createShape insertPolygon -".split(" "),u),f.insertTemplateEnabled&&!f.isOffline()&&this.addMenuItems(n,["insertTemplate"],-u),window.isMermaidEnabled&&this.addMenuItems(n,["mermaid"],u),f.menus.addMenuItems(n,["-","insertFreehand","generate","-"],u),"min"==uiTheme||"simple"==Editor.currentTheme?(this.addSubmenu("layout",n,u),this.addSubmenu("insertLayout",n,u,mxResources.get("insert")),n.addSeparator(u),this.addSubmenu("table",n,u)):this.addSubmenu("insertLayout",n,u,mxResources.get("layout")),this.addSubmenu("insertAdvanced",n,u,mxResources.get("advanced")))})));this.put("table",new Menu(mxUtils.bind(this,function(n,-u){f.menus.addInsertTableCellItem(n,u)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(n,u){this.addMenuItems(n,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),u)})));f.actions.put("csv",new Action(mxResources.get("csv")+"...",function(){x.popupMenuHandler.hideMenu();f.showImportCsvDialog()})).isEnabled=z;this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(n,u){var G=["fromText","plantUml","formatSql","csv"];EditorUi.enablePlantUml||-G.splice(1,1);this.addMenuItems(n,G,u);"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(n,["-","createShape","editDiagram"],u)})));this.put("openRecent",new Menu(function(n,u){var G=f.getRecent();if(null!=G){for(var H=0;H<G.length;H++)(function(I){var g=I.mode;g==App.MODE_GOOGLE?g="googleDrive":g==App.MODE_ONEDRIVE&&(g="oneDrive");n.addItem(I.title+" ("+mxResources.get(g)+")",null,function(){f.loadFile(I.id)},u)})(G[H]);n.addSeparator(u)}n.addItem(mxResources.get("reset"),-null,function(){f.resetRecent()},u)}));this.put("openFrom",new Menu(function(n,u){null!=f.drive?n.addItem(mxResources.get("googleDrive")+"...",null,function(){f.pickFile(App.MODE_GOOGLE)},u):f.isModeEnabled(App.MODE_GOOGLE)&&n.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);f.isModeReady(App.MODE_ONEDRIVE)?n.addItem(mxResources.get("oneDrive")+"...",null,function(){f.pickFile(App.MODE_ONEDRIVE)},u):f.isModeEnabled(App.MODE_ONEDRIVE)&&n.addItem(mxResources.get("oneDrive")+-" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);f.isModeReady(App.MODE_M365)?n.addItem(mxResources.get("m365")+"...",null,function(){f.pickFile(App.MODE_M365)},u):f.isModeEnabled(App.MODE_M365)&&n.addItem(mxResources.get("m365")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);f.isModeReady(App.MODE_DROPBOX)?n.addItem(mxResources.get("dropbox")+"...",null,function(){f.pickFile(App.MODE_DROPBOX)},u):f.isModeEnabled(App.MODE_DROPBOX)&&n.addItem(mxResources.get("dropbox")+-" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);n.addSeparator(u);f.isModeReady(App.MODE_GITHUB)&&n.addItem(mxResources.get("github")+"...",null,function(){f.pickFile(App.MODE_GITHUB)},u);f.isModeReady(App.MODE_GITLAB)&&n.addItem(mxResources.get("gitlab")+"...",null,function(){f.pickFile(App.MODE_GITLAB)},u);f.isModeReady(App.MODE_TRELLO)?n.addItem(mxResources.get("trello")+"...",null,function(){f.pickFile(App.MODE_TRELLO)},u):f.isModeEnabled(App.MODE_TRELLO)&&n.addItem(mxResources.get("trello")+-" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);n.addSeparator(u);isLocalStorage&&"0"!=urlParams.browser&&n.addItem(mxResources.get("browser")+"...",null,function(){f.pickFile(App.MODE_BROWSER)},u);"1"!=urlParams.noDevice&&n.addItem(mxResources.get("device")+"...",null,function(){f.pickFile(App.MODE_DEVICE)},u);f.isOffline()||(n.addSeparator(u),n.addItem(mxResources.get("url")+"...",null,function(){var G=new FilenameDialog(f,"",mxResources.get("open"),function(H){null!=H&&0<H.length&&-(null==f.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(H):window.geOpenWindow((mxClient.IS_CHROMEAPP?"https://app.diagrams.net/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(H)))},mxResources.get("url"));f.showDialog(G.container,300,80,!0,!0);G.init()},u))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(n,u){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=f.drive?n.addItem(mxResources.get("googleDrive")+-"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},u):f.isModeEnabled(App.MODE_GOOGLE)&&n.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1));f.isModeReady(App.MODE_ONEDRIVE)?n.addItem(mxResources.get("oneDrive")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},u):f.isModeEnabled(App.MODE_ONEDRIVE)&&n.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,-function(){},u,null,!1);f.isModeReady(App.MODE_DROPBOX)?n.addItem(mxResources.get("dropbox")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},u):f.isModeEnabled(App.MODE_DROPBOX)&&n.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);n.addSeparator(u);f.isModeReady(App.MODE_GITHUB)&&n.addItem(mxResources.get("github")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},u);f.isModeReady(App.MODE_GITLAB)&&-n.addItem(mxResources.get("gitlab")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_GITLAB)},u);f.isModeReady(App.MODE_TRELLO)?n.addItem(mxResources.get("trello")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},u):f.isModeEnabled(App.MODE_TRELLO)&&n.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);n.addSeparator(u);isLocalStorage&&"0"!=urlParams.browser&&n.addItem(mxResources.get("browser")+-"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},u);"1"!=urlParams.noDevice&&n.addItem(mxResources.get("device")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},u);"1"==urlParams.confLib&&n.addItem(mxResources.get("confluenceCloud")+"...",null,function(){f.showLibraryDialog(null,null,null,null,"CONF_LIB")},u)})),this.put("openLibraryFrom",new Menu(function(n,u){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=f.drive?-n.addItem(mxResources.get("googleDrive")+"...",null,function(){f.pickLibrary(App.MODE_GOOGLE)},u):f.isModeEnabled(App.MODE_GOOGLE)&&n.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1));f.isModeReady(App.MODE_ONEDRIVE)?n.addItem(mxResources.get("oneDrive")+"...",null,function(){f.pickLibrary(App.MODE_ONEDRIVE)},u):f.isModeEnabled(App.MODE_ONEDRIVE)&&n.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},-u,null,!1);f.isModeReady(App.MODE_DROPBOX)?n.addItem(mxResources.get("dropbox")+"...",null,function(){f.pickLibrary(App.MODE_DROPBOX)},u):f.isModeEnabled(App.MODE_DROPBOX)&&n.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);n.addSeparator(u);f.isModeReady(App.MODE_GITHUB)&&n.addItem(mxResources.get("github")+"...",null,function(){f.pickLibrary(App.MODE_GITHUB)},u);f.isModeReady(App.MODE_GITLAB)&&n.addItem(mxResources.get("gitlab")+"...",null,function(){f.pickLibrary(App.MODE_GITLAB)},-u);f.isModeReady(App.MODE_TRELLO)?n.addItem(mxResources.get("trello")+"...",null,function(){f.pickLibrary(App.MODE_TRELLO)},u):f.isModeEnabled(App.MODE_TRELLO)&&n.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);n.addSeparator(u);isLocalStorage&&"0"!=urlParams.browser&&n.addItem(mxResources.get("browser")+"...",null,function(){f.pickLibrary(App.MODE_BROWSER)},u);"1"!=urlParams.noDevice&&n.addItem(mxResources.get("device")+"...",null,function(){f.pickLibrary(App.MODE_DEVICE)},-u);f.isOffline()||(n.addSeparator(u),n.addItem(mxResources.get("url")+"...",null,function(){var G=new FilenameDialog(f,"",mxResources.get("open"),function(H){if(null!=H&&0<H.length&&f.spinner.spin(document.body,mxResources.get("loading"))){var I=H;f.editor.isCorsEnabledForUrl(H)||(I=PROXY_URL+"?url="+encodeURIComponent(H));mxUtils.get(I,function(g){if(200<=g.getStatus()&&299>=g.getStatus()){f.spinner.stop();try{f.loadLibrary(new UrlLibrary(f,g.getText(),H)),f.showSidebar()}catch(q){f.handleError(q,-mxResources.get("errorLoadingFile"))}}else f.spinner.stop(),f.handleError(null,mxResources.get("errorLoadingFile"))},function(){f.spinner.stop();f.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));f.showDialog(G.container,300,80,!0,!0);G.init()},u));"1"==urlParams.confLib&&(n.addSeparator(u),n.addItem(mxResources.get("confluenceCloud")+"...",null,function(){f.showRemotelyStoredLibrary(mxResources.get("libraries"))},u))})));this.put("edit",new Menu(mxUtils.bind(this,-function(n,u){this.addMenuItems(n,"undo redo - cut copy copyAsImage copyAsSvg paste delete - duplicate - findReplace - editData editTooltip - editStyle editGeometry editConnectionPoints - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));y=f.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow)this.commentsWindow=new CommentsWindow(f,document.body.offsetWidth-380,120,300,350),this.commentsWindow.window.addListener("show",+urlParams.embedInline)f.sendEmbeddedSvgExport();else{var n=function(){f.editor.modified=!1;var v="json"==urlParams.proto?JSON.stringify({event:"exit",modified:f.editor.modified}):"";(window.opener||window.parent).postMessage(v,"*")};f.editor.modified?f.confirm(mxResources.get("allChangesLost"),null,n,mxResources.get("cancel"),mxResources.get("discardChanges")):n()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(n,v){f.editor.isExportToCanvas()?+(this.addMenuItems(n,["exportPng"],v),Editor.jpgSupported&&this.addMenuItems(n,["exportJpg"],v),Editor.webpSupported&&this.addMenuItems(n,["exportWebp"],v)):f.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(n,["exportPng","exportJpg"],v);f.editor.isExportToCanvas()&&this.addMenuItems(n,["exportAnimatedGif"],v);this.addMenuItems(n,["exportSvg","-"],v);f.isOffline()||f.printPdfExport?this.addMenuItems(n,["exportPdf"],v):f.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(n,+["exportPdf"],v);!f.vsdxExportEnabled()||mxClient.IS_IE||"undefined"===typeof VsdxExport&&f.isOffline()||this.addMenuItems(n,["exportVsdx"],v);var G=["-","exportHtml","exportXml"];Editor.enableExportUrl&&G.push("exportUrl");this.addMenuItems(n,G,v);f.isOffline()||(n.addSeparator(v),this.addMenuItem(n,"export",v).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=Editor.currentTheme||f.isOffline()||this.addMenuItems(n,["publishLink"],+v);f.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||f.isOffline()||(n.addSeparator(v),f.menus.addSubmenu("embed",n,v))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(n,v){function G(g){g.pickFile(function(q){f.spinner.spin(document.body,mxResources.get("loading"))&&g.getFile(q,function(C){var J="data:image/"==C.getData().substring(0,11)?I(C.getTitle()):"text/xml";/\.svg$/i.test(C.getTitle())&&!f.editor.isDataSvg(C.getData())&&+(C.setData(Editor.createSvgDataUri(C.getData())),J="image/svg+xml");H(C.getData(),J,C.getTitle())},function(C){f.handleError(C,null!=C?mxResources.get("errorLoadingFile"):null)},g==f.drive)},!0)}var H=mxUtils.bind(this,function(g,q,C){var J=x.view,M=x.getGraphBounds(),Q=x.snap(Math.ceil(Math.max(0,M.x/J.scale-J.translate.x)+4*x.gridSize)),T=x.snap(Math.ceil(Math.max(0,(M.y+M.height)/J.scale-J.translate.y)+4*x.gridSize));"data:image/"==g.substring(0,11)?f.loadImage(g,mxUtils.bind(this,function(P){var S=+!0,W=mxUtils.bind(this,function(){f.resizeImage(P,g,mxUtils.bind(this,function(X,Y,Z){X=S?Math.min(1,Math.min(f.maxImageSize/Y,f.maxImageSize/Z)):1;f.importFile(g,q,Q,T,Math.round(Y*X),Math.round(Z*X),C,function(aa){f.spinner.stop();x.setSelectionCells(aa);x.scrollCellToVisible(x.getSelectionCell())})}),S)});g.length>f.resampleThreshold?f.confirmImageResize(function(X){S=X;W()}):W()}),mxUtils.bind(this,function(){f.handleError({message:mxResources.get("cannotOpenFile")})})):f.importFile(g,q,Q,T,0,+0,C,function(P){f.spinner.stop();x.setSelectionCells(P);x.scrollCellToVisible(x.getSelectionCell())})}),I=mxUtils.bind(this,function(g){var q="text/xml";/\.png$/i.test(g)?q="image/png":/\.jpe?g$/i.test(g)?q="image/jpg":/\.gif$/i.test(g)?q="image/gif":/\.pdf$/i.test(g)&&(q="application/pdf");return q});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=f.drive?n.addItem(mxResources.get("googleDrive")+"...",null,function(){G(f.drive)},v):f.isModeEnabled(App.MODE_GOOGLE)&&n.addItem(mxResources.get("googleDrive")++" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1));f.isModeReady(App.MODE_ONEDRIVE)?n.addItem(mxResources.get("oneDrive")+"...",null,function(){G(f.oneDrive)},v):f.isModeEnabled(App.MODE_ONEDRIVE)&&n.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);f.isModeReady(App.MODE_DROPBOX)?n.addItem(mxResources.get("dropbox")+"...",null,function(){G(f.dropbox)},v):f.isModeEnabled(App.MODE_DROPBOX)&&n.addItem(mxResources.get("dropbox")++" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);n.addSeparator(v);f.isModeReady(App.MODE_GITHUB)&&n.addItem(mxResources.get("github")+"...",null,function(){G(f.gitHub)},v);f.isModeReady(App.MODE_GITLAB)&&n.addItem(mxResources.get("gitlab")+"...",null,function(){G(f.gitLab)},v);f.isModeReady(App.MODE_TRELLO)?n.addItem(mxResources.get("trello")+"...",null,function(){G(f.trello)},v):f.isModeEnabled(App.MODE_TRELLO)&&n.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")++"...)",null,function(){},v,null,!1);n.addSeparator(v);isLocalStorage&&"0"!=urlParams.browser&&n.addItem(mxResources.get("browser")+"...",null,function(){f.importLocalFile(!1)},v);"1"!=urlParams.noDevice&&n.addItem(mxResources.get("device")+"...",null,function(){f.importLocalFile(!0)},v);f.isOffline()||(n.addSeparator(v),n.addItem(mxResources.get("url")+"...",null,function(){var g=new FilenameDialog(f,"",mxResources.get("import"),function(q){if(null!=q&&0<q.length&&f.spinner.spin(document.body,mxResources.get("loading"))){var C=+/(\.png)($|\?)/i.test(q)?"image/png":"text/xml";f.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(q),function(J){H(J,C,q)},function(){f.spinner.stop();f.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==C)}},mxResources.get("url"));f.showDialog(g.container,300,80,!0,!0);g.init()},v))}))).isEnabled=z;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(n,v){var G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&+(750>G&&this.addSubmenu("viewZoom",n,v,mxResources.get("zoom")),460>G&&f.isPageMenuVisible()&&this.addSubmenu("pages",n,v),320>G&&this.addSubmenu("insert",n,v),360>G&&"1"!=urlParams.embed&&"draw.io"==f.getServiceName()&&this.addSubmenu("share",n,v))})));this.put("appearance",new Menu(mxUtils.bind(this,function(n,v){if(f.isAutoDarkModeSupported()){var G=f.menus.addMenuItem(n,"autoMode",v);null!=G&&G.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")++")")}this.addMenuItems(n,["lightMode","darkMode","-"],v);G=f.menus.addMenuItem(n,"highContrast",v);(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&f.menus.addLinkToItem(G,"https://github.com/jgraph/drawio/issues/4296")})));f.actions.addAction("addToScratchpad",function(n){x.isSelectionEmpty()||null==f.addSelectionToScratchpad||f.addSelectionToScratchpad(n)});f.actions.addAction("accounts...",function(){f.toggleUserPanel();f.userPanel.style.right="10px";f.userPanel.style.top="10px"});+this.put("theme",new Menu(mxUtils.bind(this,function(n,v){var G="1"==urlParams.sketch?"sketch":mxSettings.getUi(),H=n.addItem(mxResources.get("automatic"),null,function(){f.setCurrentTheme("")},v),I=n.addItem(mxResources.get("classic"),null,function(){f.setCurrentTheme("kennedy")},v),g=!1;if("kennedy"==G||"dark"==G)n.addCheckmark(I,Editor.checkmarkImage),g=!0;for(var q=0;q<Editor.themes.length;q++)mxUtils.bind(this,function(C){I=n.addItem(mxResources.get("min"==C?"minimal":C),null,function(){f.setCurrentTheme(C)},+v);G==C&&(n.addCheckmark(I,Editor.checkmarkImage),g=!0);"simple"==C&&n.addSeparator(v)})(Editor.themes[q]);g||n.addCheckmark(H,Editor.checkmarkImage)})));y=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var n=this.editorUi.getCurrentFile();if(null!=n)if(n.constructor==LocalFile&&null!=n.fileHandle)f.showSaveFilePicker(mxUtils.bind(f,function(G,H){n.invalidFileHandle=null;n.fileHandle=G;n.title=H.name;n.desc=H;f.save(H.name)}),null,f.createFileSystemOptions(n.getTitle()));+else{var v=null!=n.getTitle()?n.getTitle():this.editorUi.defaultFilename;v=new FilenameDialog(this.editorUi,v,mxResources.get("rename"),mxUtils.bind(this,function(G){null!=G&&0<G.length&&null!=n&&G!=n.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&n.rename(G,mxUtils.bind(this,function(H){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(H){this.editorUi.handleError(H,null!=H?mxResources.get("errorRenamingFile"):null)}))}),n.constructor==DriveFile||n.constructor==+StorageFile?mxResources.get("diagramName"):null,function(G){if(null!=G&&0<G.length)return!0;f.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,f.editor.fileExtensions);this.editorUi.showDialog(v.container,340,100,!0,!0);v.init()}}));y.isEnabled=function(){return this.enabled&&z.apply(this,arguments)};y.visible="1"!=urlParams.embed;f.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var n=f.getCurrentFile();+if(null!=n){var v=f.getCopyFilename(n);n.constructor==DriveFile?(v=new SaveDialog(f,v,mxUtils.bind(this,function(G,H,I){f.hideDialog();n.copyFile(mxUtils.bind(this,function(g){n.move(I,mxUtils.bind(this,function(q){f.spinner.stop()}),mxUtils.bind(this,function(q){f.handleError(q)}))}),mxUtils.bind(this,function(g){f.handleError(g)}),G.value)}),null,null,null,null,null,null,[App.MODE_GOOGLE],mxResources.get("ok")),f.showDialog(v.container,420,150,!0,!1,mxUtils.bind(this,function(){f.hideDialog()})),+v.init()):f.editor.editAsNew(this.editorUi.getFileData(!0),v)}}));y=new Action("openFolder",function(n,v){n=f.getCurrentFile();null!=n&&f.openLink(n.getFolderUrl())});y.getTitle=function(){return mxResources.get("openIt",[mxResources.get("folder")])+"..."};f.actions.put("openFolder",y);f.actions.addAction("openFile...",mxUtils.bind(this,function(){var n=f.getCurrentFile();null!=n&&f.openLink(n.getFileUrl())}));f.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var n=f.getCurrentFile();+if(n.getMode()==App.MODE_GOOGLE||n.getMode()==App.MODE_ONEDRIVE){var v=new SaveDialog(f,"",mxUtils.bind(this,function(G,H,I){f.hideDialog();f.spinner.spin(document.body,mxResources.get("moving"))&&n.move(I,mxUtils.bind(this,function(g){f.spinner.stop()}),mxUtils.bind(this,function(g){f.handleError(g)}))}),null,null,null,null,null,n.getMode());f.showDialog(v.container,420,70,!0,!1,mxUtils.bind(this,function(){f.hideDialog()}));v.init()}}));this.put("publish",new Menu(mxUtils.bind(this,function(n,v){this.addMenuItems(n,+["publishLink","presentationMode"],v)})));EditorUi.isElectronApp||!f.isOwnGDriveDomain()||"draw.io"!=f.getServiceName()||navigator.standalone||f.actions.put("presentationMode",new Action("presentationMode...",function(){var n=null!=f.getCurrentFile()?f.getCurrentFile().getTitle():null;f.editor.editAsNew(f.getFileData(!0),n,!0,null!=f.currentPage?f.currentPage.getId():null)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var n=f.getCurrentFile();null!=n&&n.share()}catch(v){f.handleError(v)}})).isEnabled=+z;this.put("embed",new Menu(mxUtils.bind(this,function(n,v){var G=f.getCurrentFile();null==G||G.getMode()!=App.MODE_GOOGLE&&G.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(G.getTitle())||this.addMenuItems(n,["liveImage","-"],v);this.addMenuItems(n,["embedImage","embedSvg","-","embedHtml"],v);navigator.standalone||f.isOffline()||this.addMenuItems(n,["embedIframe"],v);this.addMenuItems(n,["-","microsoftOffice","-","embedNotion"],v)})));y=function(n){var v=mxResources.get(n)+"...";f.actions.put(n,new Action(v,+function(G){if("fromText"==n||"formatSql"==n||"plantUml"==n||"mermaid"==n){var H=new ParseDialog(f,v,n);f.showDialog(H.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280))}else H=new CreateGraphDialog(f,v,n),f.showDialog(H.container,620,420,!0,!1,function(I,g){if(g)return f.confirm(mxResources.get("areYouSure"),function(){f.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()})).isEnabled=z};y("mermaid");y("horizontalFlow");y("verticalFlow");y("horizontalTree");y("verticalTree");y("radialTree");y("organic");y("circle");y("fromText");y("formatSql");("https://plant-aws.diagrams.net"!=window.PLANT_URL||EditorUi.enablePlantUml&&!f.isOffline())&&y("plantUml");var B=function(n){x.getModel().beginUpdate();try{n=x.addCell(n),x.fireEvent(new mxEventObject("cellsInserted","cells",[n])),x.model.isVertex(n)&&x.isAutoSizeCell(n)&&x.updateCellSize(n)}finally{x.getModel().endUpdate()}x.scrollCellToVisible(n);+x.setSelectionCell(n);x.container.focus();x.editAfterInsert&&x.startEditing(n);window.setTimeout(function(){null!=f.hoverIcons&&f.hoverIcons.update(x.view.getState(n))},0);return n},D=function(n,v,G,H,I){n=new mxCell(n,new mxGeometry(0,0,v,G),H);n.vertex=!0;null==I&&(I=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([n],!0)));n.geometry.x=I.x;n.geometry.y=I.y;return B(n)};f.actions.put("insertText",new Action("text",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&x.startEditingAtCell(D("Text",+60,30,x.appendFontSize(Editor.defaultTextStyle,x.vertexFontSize),null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint()))},null,null,"A")).isEnabled=z;f.actions.put("insertRectangle",new Action("rectangle",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&D("",120,60,"whiteSpace=wrap;html=1;",null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"D")).isEnabled=z;f.actions.put("insertNote",+new Action("note",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&D("",160,160,Editor.defaultNoteStyle,null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"S")).isEnabled=z;f.actions.put("insertEllipse",new Action("ellipse",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&D("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?+null:x.getInsertPoint())},null,null,"F")).isEnabled=z;f.actions.put("insertRhombus",new Action("rhombus",function(n){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&D("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"R")).isEnabled=z;f.actions.put("insertEdge",new Action("line",function(n){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var v=x.defaultEdgeLength;n=null==n||+mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint();null==n&&(n=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([G],!0)));var G=new mxCell("",new mxGeometry(0,0,v,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");G.geometry.setTerminalPoint(n,!0);G.geometry.setTerminalPoint(new mxPoint(n.x+G.geometry.width,n.y),!1);G.geometry.points=[];G.geometry.relative=!0;G.edge=!0;B(G)}},null,null,"C")).isEnabled=z;f.actions.put("insertPolygon",new Action("polygon...",+function(n){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var v=new PolygonDialog(f,null,function(G){G=new mxCell("",new mxGeometry(0,0,80,80),G);G.vertex=!0;var H=null==n||mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||!x.isMouseInsertPoint()?null:x.getInsertPoint();null==H&&(H=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([G],!0)));G.geometry.x=H.x;G.geometry.y=H.y;return B(G)});f.showDialog(v.container,680,540,!0,!0,function(){v.destroy()},null,null,new mxRectangle(0,0,740,600));+v.init()}})).isEnabled=z;y=f.actions.put("toggleShapes",new Action("shapes",function(){null!=f.sidebarWindow?f.sidebarWindow.window.setVisible(!f.sidebarWindow.window.isVisible()):f.toggleShapesPanel(!f.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+K"));y.setToggleAction(!0);y.setSelectedCallback(mxUtils.bind(this,function(){return null!=f.sidebarWindow&&f.sidebarWindow.window.isVisible()||null==f.sidebarWindow&&0<f.hsplitPosition}));f.actions.put("showShapePicker",new Action(mxResources.get("shapes")++"...",function(){var n=x._contextMenuScreenPoint;f.showShapePicker(null!=n?n.x:x.container.clientWidth/2,null!=n?n.y:x.container.clientHeight/2)}));this.put("insert",new Menu(mxUtils.bind(this,function(n,v){Editor.passiveScroll?(f.menus.addMenuItems(n,["showShapePicker"],v),f.menus.addSubmenu("table",n,v),n.addSeparator(v),f.menus.addMenuItems(n,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - insertImage createShape insertPolygon -".split(" "),v),f.insertTemplateEnabled&&+!f.isOffline()&&f.menus.addMenuItems(n,["insertTemplate"],v),f.menus.addMenuItems(n,["-","insertFreehand","generate","-"],v),f.menus.addSubmenu("layout",n,v),f.menus.addSubmenu("insertAdvanced",n,v,mxResources.get("advanced"))):"sketch"==Editor.currentTheme?(f.menus.addMenuItems(n,["toggleShapes"],v),f.menus.addSubmenu("table",n,v),n.addSeparator(v),f.menus.addMenuItems(n,"insertText insertLink - insertImage createShape insertPolygon -".split(" "),v),f.insertTemplateEnabled&&!f.isOffline()&&f.menus.addMenuItems(n,+["insertTemplate"],v),window.isMermaidEnabled&&f.menus.addMenuItems(n,["mermaid"],v),f.menus.addMenuItems(n,["-","insertFreehand","generate","-"],v),f.menus.addSubmenu("layout",n,v),f.menus.addSubmenu("insertAdvanced",n,v,mxResources.get("advanced"))):(this.addMenuItems(n,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - insertImage createShape insertPolygon -".split(" "),v),f.insertTemplateEnabled&&!f.isOffline()&&this.addMenuItems(n,["insertTemplate"],+v),window.isMermaidEnabled&&this.addMenuItems(n,["mermaid"],v),f.menus.addMenuItems(n,["-","insertFreehand","generate","-"],v),"min"==uiTheme||"simple"==Editor.currentTheme?(this.addSubmenu("layout",n,v),this.addSubmenu("insertLayout",n,v,mxResources.get("insert")),n.addSeparator(v),this.addSubmenu("table",n,v)):this.addSubmenu("insertLayout",n,v,mxResources.get("layout")),this.addSubmenu("insertAdvanced",n,v,mxResources.get("advanced")))})));this.put("table",new Menu(mxUtils.bind(this,function(n,+v){f.menus.addInsertTableCellItem(n,v)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(n,v){this.addMenuItems(n,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),v)})));f.actions.put("csv",new Action(mxResources.get("csv")+"...",function(){x.popupMenuHandler.hideMenu();f.showImportCsvDialog()})).isEnabled=z;this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(n,v){var G=["fromText","plantUml","formatSql","csv"];EditorUi.enablePlantUml||+G.splice(1,1);this.addMenuItems(n,G,v);"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(n,["-","createShape","editDiagram"],v)})));this.put("openRecent",new Menu(function(n,v){var G=f.getRecent();if(null!=G){for(var H=0;H<G.length;H++)(function(I){var g=I.mode;g==App.MODE_GOOGLE?g="googleDrive":g==App.MODE_ONEDRIVE&&(g="oneDrive");n.addItem(I.title+" ("+mxResources.get(g)+")",null,function(){f.loadFile(I.id)},v)})(G[H]);n.addSeparator(v)}n.addItem(mxResources.get("reset"),+null,function(){f.resetRecent()},v)}));this.put("openFrom",new Menu(function(n,v){null!=f.drive?n.addItem(mxResources.get("googleDrive")+"...",null,function(){f.pickFile(App.MODE_GOOGLE)},v):f.isModeEnabled(App.MODE_GOOGLE)&&n.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);f.isModeReady(App.MODE_ONEDRIVE)?n.addItem(mxResources.get("oneDrive")+"...",null,function(){f.pickFile(App.MODE_ONEDRIVE)},v):f.isModeEnabled(App.MODE_ONEDRIVE)&&n.addItem(mxResources.get("oneDrive")++" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);f.isModeReady(App.MODE_M365)?n.addItem(mxResources.get("m365")+"...",null,function(){f.pickFile(App.MODE_M365)},v):f.isModeEnabled(App.MODE_M365)&&n.addItem(mxResources.get("m365")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);f.isModeReady(App.MODE_DROPBOX)?n.addItem(mxResources.get("dropbox")+"...",null,function(){f.pickFile(App.MODE_DROPBOX)},v):f.isModeEnabled(App.MODE_DROPBOX)&&n.addItem(mxResources.get("dropbox")++" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);n.addSeparator(v);f.isModeReady(App.MODE_GITHUB)&&n.addItem(mxResources.get("github")+"...",null,function(){f.pickFile(App.MODE_GITHUB)},v);f.isModeReady(App.MODE_GITLAB)&&n.addItem(mxResources.get("gitlab")+"...",null,function(){f.pickFile(App.MODE_GITLAB)},v);f.isModeReady(App.MODE_TRELLO)?n.addItem(mxResources.get("trello")+"...",null,function(){f.pickFile(App.MODE_TRELLO)},v):f.isModeEnabled(App.MODE_TRELLO)&&n.addItem(mxResources.get("trello")++" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);n.addSeparator(v);isLocalStorage&&"0"!=urlParams.browser&&n.addItem(mxResources.get("browser")+"...",null,function(){f.pickFile(App.MODE_BROWSER)},v);"1"!=urlParams.noDevice&&n.addItem(mxResources.get("device")+"...",null,function(){f.pickFile(App.MODE_DEVICE)},v);f.isOffline()||(n.addSeparator(v),n.addItem(mxResources.get("url")+"...",null,function(){var G=new FilenameDialog(f,"",mxResources.get("open"),function(H){null!=H&&0<H.length&&+(null==f.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(H):window.geOpenWindow((mxClient.IS_CHROMEAPP?"https://app.diagrams.net/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(H)))},mxResources.get("url"));f.showDialog(G.container,300,80,!0,!0);G.init()},v))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(n,v){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=f.drive?n.addItem(mxResources.get("googleDrive")++"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},v):f.isModeEnabled(App.MODE_GOOGLE)&&n.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1));f.isModeReady(App.MODE_ONEDRIVE)?n.addItem(mxResources.get("oneDrive")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},v):f.isModeEnabled(App.MODE_ONEDRIVE)&&n.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,+function(){},v,null,!1);f.isModeReady(App.MODE_DROPBOX)?n.addItem(mxResources.get("dropbox")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},v):f.isModeEnabled(App.MODE_DROPBOX)&&n.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);n.addSeparator(v);f.isModeReady(App.MODE_GITHUB)&&n.addItem(mxResources.get("github")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},v);f.isModeReady(App.MODE_GITLAB)&&+n.addItem(mxResources.get("gitlab")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_GITLAB)},v);f.isModeReady(App.MODE_TRELLO)?n.addItem(mxResources.get("trello")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},v):f.isModeEnabled(App.MODE_TRELLO)&&n.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);n.addSeparator(v);isLocalStorage&&"0"!=urlParams.browser&&n.addItem(mxResources.get("browser")++"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},v);"1"!=urlParams.noDevice&&n.addItem(mxResources.get("device")+"...",null,function(){f.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},v);"1"==urlParams.confLib&&n.addItem(mxResources.get("confluenceCloud")+"...",null,function(){f.showLibraryDialog(null,null,null,null,"CONF_LIB")},v)})),this.put("openLibraryFrom",new Menu(function(n,v){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=f.drive?+n.addItem(mxResources.get("googleDrive")+"...",null,function(){f.pickLibrary(App.MODE_GOOGLE)},v):f.isModeEnabled(App.MODE_GOOGLE)&&n.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1));f.isModeReady(App.MODE_ONEDRIVE)?n.addItem(mxResources.get("oneDrive")+"...",null,function(){f.pickLibrary(App.MODE_ONEDRIVE)},v):f.isModeEnabled(App.MODE_ONEDRIVE)&&n.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},+v,null,!1);f.isModeReady(App.MODE_DROPBOX)?n.addItem(mxResources.get("dropbox")+"...",null,function(){f.pickLibrary(App.MODE_DROPBOX)},v):f.isModeEnabled(App.MODE_DROPBOX)&&n.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);n.addSeparator(v);f.isModeReady(App.MODE_GITHUB)&&n.addItem(mxResources.get("github")+"...",null,function(){f.pickLibrary(App.MODE_GITHUB)},v);f.isModeReady(App.MODE_GITLAB)&&n.addItem(mxResources.get("gitlab")+"...",null,function(){f.pickLibrary(App.MODE_GITLAB)},+v);f.isModeReady(App.MODE_TRELLO)?n.addItem(mxResources.get("trello")+"...",null,function(){f.pickLibrary(App.MODE_TRELLO)},v):f.isModeEnabled(App.MODE_TRELLO)&&n.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},v,null,!1);n.addSeparator(v);isLocalStorage&&"0"!=urlParams.browser&&n.addItem(mxResources.get("browser")+"...",null,function(){f.pickLibrary(App.MODE_BROWSER)},v);"1"!=urlParams.noDevice&&n.addItem(mxResources.get("device")+"...",null,function(){f.pickLibrary(App.MODE_DEVICE)},+v);f.isOffline()||(n.addSeparator(v),n.addItem(mxResources.get("url")+"...",null,function(){var G=new FilenameDialog(f,"",mxResources.get("open"),function(H){if(null!=H&&0<H.length&&f.spinner.spin(document.body,mxResources.get("loading"))){var I=H;f.editor.isCorsEnabledForUrl(H)||(I=PROXY_URL+"?url="+encodeURIComponent(H));mxUtils.get(I,function(g){if(200<=g.getStatus()&&299>=g.getStatus()){f.spinner.stop();try{f.loadLibrary(new UrlLibrary(f,g.getText(),H)),f.showSidebar()}catch(q){f.handleError(q,+mxResources.get("errorLoadingFile"))}}else f.spinner.stop(),f.handleError(null,mxResources.get("errorLoadingFile"))},function(){f.spinner.stop();f.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));f.showDialog(G.container,300,80,!0,!0);G.init()},v));"1"==urlParams.confLib&&(n.addSeparator(v),n.addItem(mxResources.get("confluenceCloud")+"...",null,function(){f.showRemotelyStoredLibrary(mxResources.get("libraries"))},v))})));this.put("edit",new Menu(mxUtils.bind(this,+function(n,v){this.addMenuItems(n,"undo redo - cut copy copyAsImage copyAsSvg paste delete - duplicate - findReplace - editData editTooltip - editStyle editGeometry editConnectionPoints - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));y=f.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow)this.commentsWindow=new CommentsWindow(f,document.body.offsetWidth-380,120,300,350),this.commentsWindow.window.addListener("show",function(){f.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.addListener("hide",function(){f.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.setVisible(!0),f.fireEvent(new mxEventObject("comments"));else{var n=!this.commentsWindow.window.isVisible();this.commentsWindow.window.setVisible(n);this.commentsWindow.refreshCommentsTime();n&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));y.setToggleAction(!0);y.setSelectedCallback(mxUtils.bind(this,-function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));f.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));this.get("viewPanels").funct=function(n,u){var G=f.getCurrentFile();f.menus.addMenuItems(n,"toggleShapes format ruler - findReplace layers tags outline -".split(" "),u);f.commentsSupported()&&f.menus.addMenuItems(n,["-","comments"],u);null!=G&&G.isRealtimeEnabled()&&-G.isRealtimeSupported()&&f.menus.addMenuItems(n,["-","showRemoteCursors","shareCursor"],u);f.menus.addMenuItems(n,["-","fullscreen"],u)};this.put("view",new Menu(mxUtils.bind(this,function(n,u){if("simple"==Editor.currentTheme){var G=f.getCurrentFile();f.menus.addMenuItems(n,["toggleShapes","format"],u);f.isPageMenuVisible()&&f.menus.addMenuItems(n,["pageTabs"],u);f.menus.addMenuItems(n,["ruler","-","search"],u);if(isLocalStorage||mxClient.IS_CHROMEAPP){var H=f.menus.addMenuItem(n,"scratchpad",u);-(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&f.menus.addLinkToItem(H,"https://www.drawio.com/doc/faq/scratchpad")}f.menus.addMenuItems(n,"- findReplace layers tags outline -".split(" "),u);f.commentsSupported()&&f.menus.addMenuItems(n,["comments"],u);null!=G&&G.isRealtimeEnabled()&&G.isRealtimeSupported()&&this.addMenuItems(n,["showRemoteCursors"],u);this.addMenuItems(n,["-","fullscreen"],u)}else{this.addMenuItems(n,["format","outline","layers","tags"].concat(f.commentsSupported()?-["comments","-"]:["-"]));this.addMenuItems(n,["-","search"],u);if(isLocalStorage||mxClient.IS_CHROMEAPP)H=this.addMenuItem(n,"scratchpad",u),(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(H,"https://www.drawio.com/doc/faq/scratchpad");this.addMenuItems(n,["toggleShapes","-","pageView","pageScale"]);this.addSubmenu("units",n,u);n.addSeparator(u);f.isPageMenuVisible()&&f.menus.addMenuItems(n,["pageTabs"],u);this.addMenuItems(n,"ruler - tooltips animations - grid guides - connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),-u);"1"!=urlParams.sketch&&this.addMenuItems(n,["-","fullscreen"],u)}})));this.put("editCell",new Menu(mxUtils.bind(this,function(n,u){this.addMenuItems(n,"editLink editShape editImage crop - editData copyData pasteData - editPolygon editConnectionPoints editGeometry - editTooltip editStyle - edit".split(" "),u)})));this.put("currentPage",new Menu(mxUtils.bind(this,function(n,u){var G=f.currentPage;null!=G&&(n.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){f.renamePage(G,-G.getName())}),u),n.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){f.removePage(G)}),u),1<f.pages.length&&(f.menus.addSubmenu("movePage",n,u,mxResources.get("move")),n.addSeparator(u)),n.addSeparator(u),n.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){f.duplicatePage(G,mxResources.get("copyOf",[G.getName()]))}),u),1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=f.getServiceName()||n.addItem(mxResources.get("openInNewWindow"),-null,mxUtils.bind(this,function(){f.editor.editAsNew(f.getFileData(!0,null,null,null,!0,!0))}),u)))})));this.put("pages",new Menu(mxUtils.bind(this,function(n,u){var G=f.currentPage;f.editor.graph.isLightboxView()||(n.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{f.insertPage()}catch(I){f.handleError(I)}}),u,null,f.editor.graph.isEnabled()),n.addSeparator(u));if(null!=f.pages){for(var H=0;H<f.pages.length;H++)mxUtils.bind(this,function(I){var g=null;g=f.pages[I]==G&&-!f.editor.graph.isLightboxView()&&f.editor.graph.isEnabled()?f.menus.addSubmenu("currentPage",n,u,f.getShortPageName(G)):n.addItem(f.getShortPageName(f.pages[I]),null,mxUtils.bind(this,function(){f.selectPage(f.pages[I])}),u);var q=f.pages[I].getId();g.setAttribute("title",f.pages[I].getName()+" ("+(I+1)+"/"+f.pages.length+")"+(null!=q?" ["+q+"]":""));f.pages[I]==G&&n.addCheckmark(g,Editor.checkmarkImage)})(H);n.addSeparator(u);n.addItem(mxResources.get("deleteAll"),null,mxUtils.bind(this,function(){x.getModel().beginUpdate();-try{for(var I=f.pages.length;0<=I;I--)f.removePage(f.pages[I])}catch(g){f.handleError(g)}finally{x.getModel().endUpdate()}f.actions.get("resetView").funct()}),u,null,f.editor.graph.isEnabled())}})));if(EditorUi.isElectronApp){var D="1"==urlParams.enableSpellCheck;y=f.actions.addAction("spellCheck",function(){f.toggleSpellCheck();D=!D;f.alert(mxResources.get("restartForChangeRequired"))});y.setToggleAction(!0);y.setSelectedCallback(function(){return D});var U="1"==urlParams.enableStoreBkp;y=f.actions.addAction("autoBkp",-function(){f.toggleStoreBkp();U=!U});y.setToggleAction(!0);y.setSelectedCallback(function(){return U});var T="1"==urlParams.isGoogleFontsEnabled;y=f.actions.addAction("googleFonts",function(){f.toggleGoogleFonts();T=!T;f.alert(mxResources.get("restartForChangeRequired"))});y.setToggleAction(!0);y.setSelectedCallback(function(){return T});f.actions.addAction("openDevTools",function(){f.openDevTools()});f.actions.addAction("drafts...",function(){var n=new FilenameDialog(f,EditorUi.draftSaveDelay/1E3+-"",mxResources.get("apply"),mxUtils.bind(this,function(u){u=parseInt(u);0<=u&&(EditorUi.draftSaveDelay=1E3*u,EditorUi.enableDrafts=0<u,mxSettings.setDraftSaveDelay(u),mxSettings.save())}),mxResources.get("draftSaveInt"));f.showDialog(n.container,320,80,!0,!0);n.init()})}var V=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(n,u){if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){null==V||"1"==urlParams.embed&&null!=urlParams.lang||-f.menus.addSubmenu("language",n,u);"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||"1"==urlParams.embedInline||f.menus.addSubmenu("appearance",n,u);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&f.mode!=App.MODE_ATLAS&&f.menus.addSubmenu("theme",n,u);n.addSeparator(u);f.menus.addSubmenu("units",n,u);f.menus.addMenuItems(n,"- copyConnect collapseExpand - tooltips animations -".split(" "),u);var G=f.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=G&&G.isRealtimeEnabled()&&-G.isRealtimeSupported()&&this.addMenuItems(n,["showRemoteCursors"],u),f.menus.addMenuItems(n,["ruler","-"],u));EditorUi.isElectronApp&&f.menus.addMenuItems(n,"- googleFonts spellCheck autoBkp drafts -".split(" "),u);this.addSubmenu("diagramLanguage",n,u);n.addSeparator(u);f.mode!=App.MODE_ATLAS&&f.menus.addMenuItem(n,"configuration",u);n.addSeparator(u)}else"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",n,u),"1"==urlParams.embed&&"1"!=urlParams.atlas||f.menus.addSubmenu("appearance",-n,u),"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&f.mode!=App.MODE_ATLAS&&this.addSubmenu("theme",n,u),EditorUi.isElectronApp&&this.addMenuItems(n,"- googleFonts spellCheck autoBkp drafts -".split(" "),u),n.addSeparator(u),G=this.addSubmenu("adaptiveColors",n,u),(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&f.menus.addLinkToItem(G,"https://github.com/jgraph/drawio/discussions/4713"),"undefined"!==typeof MathJax&&(G=this.addMenuItem(n,"mathematicalTypesetting",u),(!f.isOffline()||-mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(G,"https://www.drawio.com/doc/faq/math-typesetting")),"1"!=urlParams.embed&&(G=f.getCurrentFile(),null!=G&&G.isRealtimeEnabled()&&G.isRealtimeSupported()&&this.addMenuItems(n,["-","showRemoteCursors","shareCursor"],u),n.addSeparator(u),(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(n,["showStartScreen"],u),this.addMenuItems(n,["autosave"],u)),this.addMenuItems(n,["-","copyConnect","collapseExpand","-"],u),this.addSubmenu("diagramLanguage",-n,u),this.addMenuItems(n,["editDiagram","-"],u),!f.isOfflineApp()&&isLocalStorage&&this.addMenuItem(n,"plugins",u),this.addMenuItems(n,["configuration"],u)})));this.put("movePage",new Menu(mxUtils.bind(this,function(n,u){var G=f.currentPage,H=f.getPageIndex(G);if(null!=f.pages)for(var I=0;I<f.pages.length;I++)I!=H&&function(g){n.addItem(f.getShortPageName(f.pages[g]),null,function(){f.movePage(H,g);f.scrollToPage(G,!0)},u)}(I)})));this.put("share",new Menu(mxUtils.bind(this,function(n,u){if(!f.isStandaloneApp()){var G=-f.isOffline(!0)?mxResources.get("offline"):f.getNetworkStatus();null!=G&&(n.addItem(G,null,null,u,null,!1),n.addSeparator(u));f.menus.addMenuItems(n,["share"],u)}this.addMenuItem(n,"publishLink",u,null,null,mxResources.get("publish")+"...");EditorUi.isElectronApp||!f.isOwnGDriveDomain()||"draw.io"!=f.getServiceName()||navigator.standalone||this.addMenuItem(n,"presentationMode",u);null!=f.getMainUser()&&this.addMenuItems(n,["accounts"],u)})));this.put("diagram",new Menu(mxUtils.bind(this,function(n,-u){var G=f.getCurrentFile();"simple"!=Editor.currentTheme&&(f.menus.addSubmenu("extras",n,u,mxResources.get("settings")),n.addSeparator(u));var H="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)f.menus.addMenuItems(n,["new","open"],u),f.menus.addSubmenu("openRecent",n,u),f.menus.addMenuItems(n,"- synchronize properties - save saveAs -".split(" "),u);else if(f.mode==App.MODE_ATLAS){"1"!=urlParams.noSaveBtn&&"1"!=urlParams.embedInline&&f.menus.addMenuItems(n,-["-","save"],u);if("1"==urlParams.saveAndExit||"1"==urlParams.noSaveBtn&&"0"!=urlParams.saveAndExit||f.mode==App.MODE_ATLAS)f.menus.addMenuItems(n,["saveAndExit"],u),null!=G&&G.isRevisionHistorySupported()&&f.menus.addMenuItems(n,["revisionHistory"],u);n.addSeparator(u)}else f.mode==App.MODE_ATLAS?f.menus.addMenuItems(n,["save","synchronize","-"],u):"1"!=urlParams.noFileMenu&&(f.menus.addSubmenu("file",n,u),n.addSeparator(u),"min"==Editor.currentTheme&&(f.menus.addMenuItems(n,"toggleShapes format layers tags - findReplace".split(" "),-u),f.commentsSupported()&&f.menus.addMenuItems(n,["comments"],u),n.addSeparator(u)));f.menus.addSubmenu("exportAs",n,u);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"atlassian"==f.getServiceName()?f.menus.addMenuItems(n,["import"],u):"1"!=urlParams.noFileMenu&&f.menus.addSubmenu("importFrom",n,u);"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme?(f.menus.addMenuItems(n,["-","findReplace"],u),f.commentsSupported()&&f.menus.addMenuItems(n,["comments","-"],u),f.menus.addMenuItems(n,["toggleShapes",-"format","layers","tags","-"],u),f.menus.addMenuItems(n,["pageSetup"],u)):"min"!=Editor.currentTheme&&(this.addMenuItems(n,["-"],u),this.addSubmenu("newLibrary",n,u),this.addSubmenu("openLibraryFrom",n,u));n.addSeparator(u);"1"==urlParams.noFileMenu||mxClient.IS_IOS&&navigator.standalone||f.menus.addMenuItems(n,["print"],u);H||"min"==Editor.currentTheme||null==G||null==f.fileNode||"1"==urlParams.embedInline||(H=null!=G.getTitle()?G.getTitle():f.defaultFilename,/(\.html)$/i.test(H)||this.addMenuItems(n,-["-","properties"]));n.addSeparator(u);"simple"==Editor.currentTheme&&(f.menus.addSubmenu("extras",n,u,mxResources.get("settings")),n.addSeparator(u));f.menus.addSubmenu("help",n,u);n.addSeparator(u);"1"==urlParams.embed&&("1"!=urlParams.noSaveBtn&&"1"!=urlParams.embedInline&&f.menus.addMenuItems(n,["save"],u),"1"==urlParams.saveAndExit||"1"==urlParams.noSaveBtn&&"0"!=urlParams.saveAndExit)&&(f.menus.addMenuItems(n,["saveAndExit"],u),null!=G&&G.isRevisionHistorySupported()&&f.menus.addMenuItems(n,-["revisionHistory"],u));"1"!=urlParams.embed&&f.mode!=App.MODE_ATLAS||"1"==urlParams.noExitBtn&&f.mode!=App.MODE_ATLAS||f.menus.addMenuItems(n,["exit"],u);"1"!=urlParams.embed&&null!=G&&"undefined"==typeof AtlasFile&&f.menus.addMenuItems(n,["-","close"],u)})));this.put("save",new Menu(mxUtils.bind(this,function(n,u){var G=f.getCurrentFile();null==G||G.constructor!=DriveFile&&G.constructor!=OneDriveFile?(f.menus.addMenuItems(n,["save","saveAs","-","rename"],u),this.addMenuItems(n,[f.isOfflineApp()?-"upload":"makeCopy"],u)):f.menus.addMenuItems(n,["save","makeCopy","-","rename","moveToFolder"],u);f.menus.addMenuItems(n,["-","autosave"],u);null!=G&&G.isRevisionHistorySupported()&&f.menus.addMenuItems(n,["-","revisionHistory"],u)})));this.put("file",new Menu(mxUtils.bind(this,function(n,u){var G="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme;if("1"==urlParams.embed)this.addSubmenu("importFrom",n,u),this.addSubmenu("exportAs",n,u),this.addSubmenu("embed",-n,u),"1"==urlParams.libraries&&(this.addMenuItems(n,["-"],u),this.addSubmenu("newLibrary",n,u),this.addSubmenu("openLibraryFrom",n,u)),f.isRevisionHistorySupported()&&this.addMenuItems(n,["-","revisionHistory"],u),this.addMenuItems(n,["-","pageSetup","print","-","rename"],u),"1"!=urlParams.embedInline&&("1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.addMenuItems(n,["saveAndExit"],u):(this.addMenuItems(n,["save"],u),"1"==urlParams.saveAndExit&&this.addMenuItems(n,["saveAndExit"],u))),"1"!=-urlParams.noExitBtn&&this.addMenuItems(n,["exit"],u);else if(G){G=f.getCurrentFile();f.menus.addMenuItems(n,["new"],u);f.menus.addSubmenu("openFrom",n,u);isLocalStorage&&this.addSubmenu("openRecent",n,u);n.addSeparator(u);f.menus.addMenuItems(n,["-","save"],u);null!=G&&G.constructor==DriveFile||f.menus.addMenuItems(n,["saveAs"],u);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==G||G.constructor==LocalFile&&null==G.fileHandle||f.menus.addMenuItems(n,["synchronize"],u);n.addSeparator(u);null!=-G&&("simple"==Editor.currentTheme||G.constructor!=DriveFile&&G.constructor!=GitHubFile&&G.constructor!=OneDriveFile||f.menus.addMenuItems(n,["share"],u),"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.addMenuItem(n,"publishLink",u,null,null,mxResources.get("publish")+"..."),"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||EditorUi.isElectronApp||!f.isOwnGDriveDomain()||"draw.io"!=f.getServiceName()||navigator.standalone||this.addMenuItem(n,-"presentationMode",u));n.addSeparator(u);null!=G&&G.isRenamable()&&this.addMenuItems(n,["rename"],u);f.isOfflineApp()?this.addMenuItems(n,["upload"],u):(f.menus.addMenuItems(n,["makeCopy"],u),null!=G&&(G.constructor!=OneDriveFile&&G.constructor!=DriveFile||f.menus.addMenuItems(n,["moveToFolder"],u),n.addSeparator(u),null!=G.getFolderUrl()&&f.menus.addMenuItems(n,["openFolder"],u),null!=G.getFileUrl()&&f.menus.addMenuItems(n,["openFile"],u)));n.addSeparator(u);null!=G&&G.isRevisionHistorySupported()&&-f.menus.addMenuItems(n,["revisionHistory"],u);if(null!=G&&null!=f.fileNode&&"1"!=urlParams.embedInline){var H=null!=G.getTitle()?G.getTitle():f.defaultFilename;(G.constructor==DriveFile&&null!=G.sync&&G.sync.isConnected()||!/(\.html)$/i.test(H))&&this.addMenuItems(n,["properties"],u)}"simple"==Editor.currentTheme&&f.menus.addMenuItems(n,["-","autosave"],u)}else G=this.editorUi.getCurrentFile(),null!=G&&G.constructor==DriveFile?(G.isRestricted()&&this.addMenuItems(n,["exportOptionsDisabled"],u),this.addMenuItems(n,-["save","-","share"],u),H=this.addMenuItem(n,"synchronize",u),(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(H,"https://www.drawio.com/doc/faq/synchronize"),n.addSeparator(u)):this.addMenuItems(n,["new"],u),this.addSubmenu("openFrom",n,u),isLocalStorage&&this.addSubmenu("openRecent",n,u),null!=G&&G.constructor==DriveFile?this.addMenuItems(n,"new - rename makeCopy openFolder moveToFolder".split(" "),u):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==G||G.constructor==-LocalFile&&null==G.fileHandle||(n.addSeparator(u),H=this.addMenuItem(n,"synchronize",u),(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(H,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(n,["-","save","saveAs","-"],u),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=f.getServiceName()||f.isOfflineApp()||null==G||this.addMenuItems(n,["share","-"],u),null!=G&&G.isRenamable()&&this.addMenuItems(n,["rename"],u),f.isOfflineApp()?this.addMenuItems(n,-["upload"],u):(this.addMenuItems(n,["makeCopy"],u),null!=G&&(G.constructor==OneDriveFile&&this.addMenuItems(n,["moveToFolder"],u),null!=G.getFolderUrl()&&f.menus.addMenuItems(n,["openFolder"],u)))),n.addSeparator(u),this.addSubmenu("importFrom",n,u),this.addSubmenu("exportAs",n,u),f.isOffline()||(n.addSeparator(u),this.addSubmenu("embed",n,u),this.addSubmenu("publish",n,u)),n.addSeparator(u),this.addSubmenu("newLibrary",n,u),this.addSubmenu("openLibraryFrom",n,u),f.isRevisionHistorySupported()&&this.addMenuItems(n,-["-","revisionHistory"],u),null!=G&&null!=f.fileNode&&"1"!=urlParams.embedInline&&(H=null!=G.getTitle()?G.getTitle():f.defaultFilename,(G.constructor==DriveFile&&null!=G.sync&&G.sync.isConnected()||!/(\.html)$/i.test(H))&&this.addMenuItems(n,["-","properties"])),this.addMenuItems(n,["-","pageSetup"],u),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(n,["print"],u),this.addMenuItems(n,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(n,u){function G(N){var S=encodeURIComponent(N.name)+-(null==N.url?"":"@"+encodeURIComponent(N.url));if(!I[S]){for(var P=N.name,R=0;null!=J[P.toLowerCase()];)P=N.name+" ("+ ++R+")";null==B[S]&&(Q.push({name:N.name,url:N.url,label:P,title:N.url}),J[P.toLowerCase()]=N,B[S]=N)}}for(var H=mxUtils.bind(this,function(N,S,P,R,W){var X=f.editor.graph,Y=this.styleChange(n,null!=R?R:N,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[N,null!=S?encodeURIComponent(S):null,null],null,u,function(){X.setFont(N,S);f.fireEvent(new mxEventObject("styleChanged","keys",-[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[N,null!=S?encodeURIComponent(S):null,null],"cells",[X.cellEditor.getEditingCell()]))},function(){X.updateLabelElements(X.getSelectionCells(),function(aa){aa.removeAttribute("face");aa.style.fontFamily=null;"PRE"==aa.nodeName&&X.replaceElement(aa,"div")})});P&&(P=document.createElement("img"),P.className="geAdaptiveAsset",P.setAttribute("src",Editor.crossImage),P.setAttribute("title",mxResources.get("delete")),P.setAttribute("valign","absmiddle"),-P.setAttribute("border","0"),P.style.position="relative",P.style.top="2px",P.style.width="14px",P.style.cursor="default",P.style.margin="0 3px",Y.firstChild.nextSibling.nextSibling.appendChild(P),mxEvent.addListener(P,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(aa){this.removeCustomFont(N,S);this.editorUi.hideCurrentMenu();mxEvent.consume(aa)})));Graph.addFont(N,S);Y.firstChild.nextSibling.style.fontFamily=N;W=null!=R?R:N;null!=S&&(W+=" ("+S+")");Y.setAttribute("title",W)}),-I={},g=0;g<this.defaultFonts.length;g++){var q=this.defaultFonts[g];"string"===typeof q?H(q):null!=q.fontFamily&&null!=q.fontUrl&&(I[encodeURIComponent(q.fontFamily)+"@"+encodeURIComponent(q.fontUrl)]=!0,H(q.fontFamily,q.fontUrl))}n.addSeparator(u);var B={},J={},Q=[];for(g=0;g<this.customFonts.length;g++)G(this.customFonts[g]);Q.sort(function(N,S){return N.label<S.label?-1:N.label>S.label?1:0});if(0<Q.length){for(g=0;g<Q.length;g++)H(Q[g].name,Q[g].url,!0,Q[g].label);n.addSeparator(u)}n.addItem(mxResources.get("reset"),-null,mxUtils.bind(this,function(){this.customFonts=[];f.fireEvent(new mxEventObject("customFontsChanged"))}),u);n.addSeparator(u);n.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var N=this.editorUi.editor.graph,S=N.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],P="s",R=null;if(N.isEditing()){var W=N.getSelectedEditingElement();if(null!=W){var X=mxUtils.getCurrentStyle(W);if(null!=X){S=mxUtils.getCssFontFamily(X.fontFamily);X=N.getView().getState(N.cellEditor.getEditingCell());-R=null!=X?X.style.fontSource:null;for(null!=R&&(R=decodeURIComponent(R));null!=W&&W!=N.cellEditor.textarea;){if(W.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=W.getAttribute("data-font-src")){R=W.getAttribute("data-font-src");break}else if(W.getAttribute("face")==S){R=null;break}W=W.parentNode}null!=R&&(Graph.isGoogleFontUrl(R)?(R=null,P="g"):P="w")}}}else X=N.getView().getState(N.getSelectionCell()),null!=X&&(S=X.style[mxConstants.STYLE_FONTFAMILY]||S,W=X.style.fontSource,null!=W&&(W=decodeURIComponent(W),-Graph.isGoogleFontUrl(W)?P="g":(P="w",R=W)));null!=R&&R.substring(0,PROXY_URL.length)==PROXY_URL&&(R=decodeURIComponent(R.substr((PROXY_URL+"?url=").length)));var Y=null;document.activeElement==N.cellEditor.textarea&&(Y=N.cellEditor.saveSelection());S=new FontDialog(this.editorUi,S,R,P,mxUtils.bind(this,function(aa,ba,fa){null!=Y&&(N.cellEditor.restoreSelection(Y),Y=null);if(null!=aa&&0<aa.length)if(this.addCustomFont(aa,ba),N.isEditing())N.setFont(aa,ba);else{N.getModel().beginUpdate();try{N.stopEditing(!1),-N.setCellStyles(mxConstants.STYLE_FONTFAMILY,aa),N.setCellStyles("fontSource",null!=ba?encodeURIComponent(ba):null),N.setCellStyles("FType",null)}finally{N.getModel().endUpdate()}}}));this.editorUi.showDialog(S.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);S.init()}),u,null,!0)})))}})();function DiagramPage(b,l){this.node=b;null!=l?this.node.setAttribute("id",l):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")};+function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));f.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));this.get("viewPanels").funct=function(n,v){var G=f.getCurrentFile();f.menus.addMenuItems(n,"toggleShapes format ruler - findReplace layers tags outline -".split(" "),v);f.commentsSupported()&&f.menus.addMenuItems(n,["-","comments"],v);null!=G&&G.isRealtimeEnabled()&&+G.isRealtimeSupported()&&f.menus.addMenuItems(n,["-","showRemoteCursors","shareCursor"],v);f.menus.addMenuItems(n,["-","fullscreen"],v)};this.put("view",new Menu(mxUtils.bind(this,function(n,v){if("simple"==Editor.currentTheme){var G=f.getCurrentFile();f.menus.addMenuItems(n,["toggleShapes","format"],v);f.isPageMenuVisible()&&f.menus.addMenuItems(n,["pageTabs"],v);f.menus.addMenuItems(n,["ruler","-","search"],v);if(isLocalStorage||mxClient.IS_CHROMEAPP){var H=f.menus.addMenuItem(n,"scratchpad",v);+(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&f.menus.addLinkToItem(H,"https://www.drawio.com/doc/faq/scratchpad")}f.menus.addMenuItems(n,"- findReplace layers tags outline -".split(" "),v);f.commentsSupported()&&f.menus.addMenuItems(n,["comments"],v);null!=G&&G.isRealtimeEnabled()&&G.isRealtimeSupported()&&this.addMenuItems(n,["showRemoteCursors"],v);this.addMenuItems(n,["-","fullscreen"],v)}else{this.addMenuItems(n,["format","outline","layers","tags"].concat(f.commentsSupported()?+["comments","-"]:["-"]));this.addMenuItems(n,["-","search"],v);if(isLocalStorage||mxClient.IS_CHROMEAPP)H=this.addMenuItem(n,"scratchpad",v),(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(H,"https://www.drawio.com/doc/faq/scratchpad");this.addMenuItems(n,["toggleShapes","-","pageView","pageScale"]);this.addSubmenu("units",n,v);n.addSeparator(v);f.isPageMenuVisible()&&f.menus.addMenuItems(n,["pageTabs"],v);this.addMenuItems(n,"ruler - tooltips animations - grid guides - connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),+v);"1"!=urlParams.sketch&&this.addMenuItems(n,["-","fullscreen"],v)}})));this.put("editCell",new Menu(mxUtils.bind(this,function(n,v){this.addMenuItems(n,"editLink editShape editImage crop - editData copyData pasteData - editPolygon editConnectionPoints editGeometry - editTooltip editStyle - edit".split(" "),v)})));this.put("currentPage",new Menu(mxUtils.bind(this,function(n,v){var G=f.currentPage;null!=G&&(n.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){f.renamePage(G,+G.getName())}),v),n.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){f.removePage(G)}),v),1<f.pages.length&&(f.menus.addSubmenu("movePage",n,v,mxResources.get("move")),n.addSeparator(v)),n.addSeparator(v),n.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){f.duplicatePage(G,mxResources.get("copyOf",[G.getName()]))}),v),1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=f.getServiceName()||n.addItem(mxResources.get("openInNewWindow"),+null,mxUtils.bind(this,function(){f.editor.editAsNew(f.getFileData(!0,null,null,null,!0,!0))}),v)))})));this.put("pages",new Menu(mxUtils.bind(this,function(n,v){var G=f.currentPage;f.editor.graph.isLightboxView()||(n.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{f.insertPage()}catch(I){f.handleError(I)}}),v,null,f.editor.graph.isEnabled()),n.addSeparator(v));if(null!=f.pages){for(var H=0;H<f.pages.length;H++)mxUtils.bind(this,function(I){var g=null;g=f.pages[I]==G&&+!f.editor.graph.isLightboxView()&&f.editor.graph.isEnabled()?f.menus.addSubmenu("currentPage",n,v,f.getShortPageName(G)):n.addItem(f.getShortPageName(f.pages[I]),null,mxUtils.bind(this,function(){f.selectPage(f.pages[I])}),v);var q=f.pages[I].getId();g.setAttribute("title",f.pages[I].getName()+" ("+(I+1)+"/"+f.pages.length+")"+(null!=q?" ["+q+"]":""));f.pages[I]==G&&n.addCheckmark(g,Editor.checkmarkImage)})(H);n.addSeparator(v);n.addItem(mxResources.get("deleteAll"),null,mxUtils.bind(this,function(){x.getModel().beginUpdate();+try{for(var I=f.pages.length;0<=I;I--)f.removePage(f.pages[I])}catch(g){f.handleError(g)}finally{x.getModel().endUpdate()}f.actions.get("resetView").funct()}),v,null,f.editor.graph.isEnabled())}})));if(EditorUi.isElectronApp){var N="1"==urlParams.enableSpellCheck;y=f.actions.addAction("spellCheck",function(){f.toggleSpellCheck();N=!N;f.alert(mxResources.get("restartForChangeRequired"))});y.setToggleAction(!0);y.setSelectedCallback(function(){return N});var F="1"==urlParams.enableStoreBkp;y=f.actions.addAction("autoBkp",+function(){f.toggleStoreBkp();F=!F});y.setToggleAction(!0);y.setSelectedCallback(function(){return F});var U="1"==urlParams.isGoogleFontsEnabled;y=f.actions.addAction("googleFonts",function(){f.toggleGoogleFonts();U=!U;f.alert(mxResources.get("restartForChangeRequired"))});y.setToggleAction(!0);y.setSelectedCallback(function(){return U});f.actions.addAction("openDevTools",function(){f.openDevTools()});f.actions.addAction("drafts...",function(){var n=new FilenameDialog(f,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"));f.showDialog(n.container,320,80,!0,!0);n.init()})}var V=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(n,v){if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){null==V||"1"==urlParams.embed&&null!=urlParams.lang||+f.menus.addSubmenu("language",n,v);"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||"1"==urlParams.embedInline||f.menus.addSubmenu("appearance",n,v);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&f.mode!=App.MODE_ATLAS&&f.menus.addSubmenu("theme",n,v);n.addSeparator(v);f.menus.addSubmenu("units",n,v);f.menus.addMenuItems(n,"- copyConnect collapseExpand - tooltips animations -".split(" "),v);var G=f.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=G&&G.isRealtimeEnabled()&&+G.isRealtimeSupported()&&this.addMenuItems(n,["showRemoteCursors"],v),f.menus.addMenuItems(n,["ruler","-"],v));EditorUi.isElectronApp&&f.menus.addMenuItems(n,"- googleFonts spellCheck autoBkp drafts -".split(" "),v);this.addSubmenu("diagramLanguage",n,v);n.addSeparator(v);f.mode!=App.MODE_ATLAS&&f.menus.addMenuItem(n,"configuration",v);n.addSeparator(v)}else"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",n,v),"1"==urlParams.embed&&"1"!=urlParams.atlas||f.menus.addSubmenu("appearance",+n,v),"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&f.mode!=App.MODE_ATLAS&&this.addSubmenu("theme",n,v),EditorUi.isElectronApp&&this.addMenuItems(n,"- googleFonts spellCheck autoBkp drafts -".split(" "),v),n.addSeparator(v),G=this.addSubmenu("adaptiveColors",n,v),(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&f.menus.addLinkToItem(G,"https://github.com/jgraph/drawio/discussions/4713"),"undefined"!==typeof MathJax&&(G=this.addMenuItem(n,"mathematicalTypesetting",v),(!f.isOffline()||+mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(G,"https://www.drawio.com/doc/faq/math-typesetting")),"1"!=urlParams.embed&&(G=f.getCurrentFile(),null!=G&&G.isRealtimeEnabled()&&G.isRealtimeSupported()&&this.addMenuItems(n,["-","showRemoteCursors","shareCursor"],v),n.addSeparator(v),(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(n,["showStartScreen"],v),this.addMenuItems(n,["autosave"],v)),this.addMenuItems(n,["-","copyConnect","collapseExpand","-"],v),this.addSubmenu("diagramLanguage",+n,v),this.addMenuItems(n,["editDiagram","-"],v),!f.isOfflineApp()&&isLocalStorage&&this.addMenuItem(n,"plugins",v),this.addMenuItems(n,["configuration"],v)})));this.put("movePage",new Menu(mxUtils.bind(this,function(n,v){var G=f.currentPage,H=f.getPageIndex(G);if(null!=f.pages)for(var I=0;I<f.pages.length;I++)I!=H&&function(g){n.addItem(f.getShortPageName(f.pages[g]),null,function(){f.movePage(H,g);f.scrollToPage(G,!0)},v)}(I)})));this.put("share",new Menu(mxUtils.bind(this,function(n,v){if(!f.isStandaloneApp()){var G=+f.isOffline(!0)?mxResources.get("offline"):f.getNetworkStatus();null!=G&&(n.addItem(G,null,null,v,null,!1),n.addSeparator(v));f.menus.addMenuItems(n,["share"],v)}this.addMenuItem(n,"publishLink",v,null,null,mxResources.get("publish")+"...");EditorUi.isElectronApp||!f.isOwnGDriveDomain()||"draw.io"!=f.getServiceName()||navigator.standalone||this.addMenuItem(n,"presentationMode",v);null!=f.getMainUser()&&this.addMenuItems(n,["accounts"],v)})));this.put("diagram",new Menu(mxUtils.bind(this,function(n,+v){var G=f.getCurrentFile();"simple"!=Editor.currentTheme&&(f.menus.addSubmenu("extras",n,v,mxResources.get("settings")),n.addSeparator(v));var H="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)f.menus.addMenuItems(n,["new","open"],v),f.menus.addSubmenu("openRecent",n,v),f.menus.addMenuItems(n,"- synchronize properties - save saveAs -".split(" "),v);else if(f.mode==App.MODE_ATLAS){"1"!=urlParams.noSaveBtn&&"1"!=urlParams.embedInline&&f.menus.addMenuItems(n,+["-","save"],v);if("1"==urlParams.saveAndExit||"1"==urlParams.noSaveBtn&&"0"!=urlParams.saveAndExit||f.mode==App.MODE_ATLAS)f.menus.addMenuItems(n,["saveAndExit"],v),null!=G&&G.isRevisionHistorySupported()&&f.menus.addMenuItems(n,["revisionHistory"],v);n.addSeparator(v)}else f.mode==App.MODE_ATLAS?f.menus.addMenuItems(n,["save","synchronize","-"],v):"1"!=urlParams.noFileMenu&&(f.menus.addSubmenu("file",n,v),n.addSeparator(v),"min"==Editor.currentTheme&&(f.menus.addMenuItems(n,"toggleShapes format layers tags - findReplace".split(" "),+v),f.commentsSupported()&&f.menus.addMenuItems(n,["comments"],v),n.addSeparator(v)));f.menus.addSubmenu("exportAs",n,v);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"atlassian"==f.getServiceName()?f.menus.addMenuItems(n,["import"],v):"1"!=urlParams.noFileMenu&&f.menus.addSubmenu("importFrom",n,v);"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme?(f.menus.addMenuItems(n,["-","findReplace"],v),f.commentsSupported()&&f.menus.addMenuItems(n,["comments","-"],v),f.menus.addMenuItems(n,["toggleShapes",+"format","layers","tags","-"],v),f.menus.addMenuItems(n,["pageSetup"],v)):"min"!=Editor.currentTheme&&(this.addMenuItems(n,["-"],v),this.addSubmenu("newLibrary",n,v),this.addSubmenu("openLibraryFrom",n,v));n.addSeparator(v);"1"==urlParams.noFileMenu||mxClient.IS_IOS&&navigator.standalone||f.menus.addMenuItems(n,["print"],v);H||"min"==Editor.currentTheme||null==G||null==f.fileNode||"1"==urlParams.embedInline||(H=null!=G.getTitle()?G.getTitle():f.defaultFilename,/(\.html)$/i.test(H)||this.addMenuItems(n,+["-","properties"]));n.addSeparator(v);"simple"==Editor.currentTheme&&(f.menus.addSubmenu("extras",n,v,mxResources.get("settings")),n.addSeparator(v));f.menus.addSubmenu("help",n,v);n.addSeparator(v);"1"==urlParams.embed&&("1"!=urlParams.noSaveBtn&&"1"!=urlParams.embedInline&&f.menus.addMenuItems(n,["save"],v),"1"==urlParams.saveAndExit||"1"==urlParams.noSaveBtn&&"0"!=urlParams.saveAndExit)&&(f.menus.addMenuItems(n,["saveAndExit"],v),null!=G&&G.isRevisionHistorySupported()&&f.menus.addMenuItems(n,+["revisionHistory"],v));"1"!=urlParams.embed&&f.mode!=App.MODE_ATLAS||"1"==urlParams.noExitBtn&&f.mode!=App.MODE_ATLAS||f.menus.addMenuItems(n,["exit"],v);"1"!=urlParams.embed&&null!=G&&"undefined"==typeof AtlasFile&&f.menus.addMenuItems(n,["-","close"],v)})));this.put("save",new Menu(mxUtils.bind(this,function(n,v){var G=f.getCurrentFile();null==G||G.constructor!=DriveFile&&G.constructor!=OneDriveFile?(f.menus.addMenuItems(n,["save","saveAs","-","rename"],v),this.addMenuItems(n,[f.isOfflineApp()?+"upload":"makeCopy"],v)):f.menus.addMenuItems(n,["save","makeCopy","-","rename","moveToFolder"],v);f.menus.addMenuItems(n,["-","autosave"],v);null!=G&&G.isRevisionHistorySupported()&&f.menus.addMenuItems(n,["-","revisionHistory"],v)})));this.put("file",new Menu(mxUtils.bind(this,function(n,v){var G="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme;if("1"==urlParams.embed)this.addSubmenu("importFrom",n,v),this.addSubmenu("exportAs",n,v),this.addSubmenu("embed",+n,v),"1"==urlParams.libraries&&(this.addMenuItems(n,["-"],v),this.addSubmenu("newLibrary",n,v),this.addSubmenu("openLibraryFrom",n,v)),f.isRevisionHistorySupported()&&this.addMenuItems(n,["-","revisionHistory"],v),this.addMenuItems(n,["-","pageSetup","print","-","rename"],v),"1"!=urlParams.embedInline&&("1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.addMenuItems(n,["saveAndExit"],v):(this.addMenuItems(n,["save"],v),"1"==urlParams.saveAndExit&&this.addMenuItems(n,["saveAndExit"],v))),"1"!=+urlParams.noExitBtn&&this.addMenuItems(n,["exit"],v);else if(G){G=f.getCurrentFile();f.menus.addMenuItems(n,["new"],v);f.menus.addSubmenu("openFrom",n,v);isLocalStorage&&this.addSubmenu("openRecent",n,v);n.addSeparator(v);f.menus.addMenuItems(n,["-","save"],v);null!=G&&G.constructor==DriveFile||f.menus.addMenuItems(n,["saveAs"],v);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==G||G.constructor==LocalFile&&null==G.fileHandle||f.menus.addMenuItems(n,["synchronize"],v);n.addSeparator(v);null!=+G&&("simple"==Editor.currentTheme||G.constructor!=DriveFile&&G.constructor!=GitHubFile&&G.constructor!=OneDriveFile||f.menus.addMenuItems(n,["share"],v),"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.addMenuItem(n,"publishLink",v,null,null,mxResources.get("publish")+"..."),"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||EditorUi.isElectronApp||!f.isOwnGDriveDomain()||"draw.io"!=f.getServiceName()||navigator.standalone||this.addMenuItem(n,+"presentationMode",v));n.addSeparator(v);null!=G&&G.isRenamable()&&this.addMenuItems(n,["rename"],v);f.isOfflineApp()?this.addMenuItems(n,["upload"],v):(f.menus.addMenuItems(n,["makeCopy"],v),null!=G&&(G.constructor!=OneDriveFile&&G.constructor!=DriveFile||f.menus.addMenuItems(n,["moveToFolder"],v),n.addSeparator(v),null!=G.getFolderUrl()&&f.menus.addMenuItems(n,["openFolder"],v),null!=G.getFileUrl()&&f.menus.addMenuItems(n,["openFile"],v)));n.addSeparator(v);null!=G&&G.isRevisionHistorySupported()&&+f.menus.addMenuItems(n,["revisionHistory"],v);if(null!=G&&null!=f.fileNode&&"1"!=urlParams.embedInline){var H=null!=G.getTitle()?G.getTitle():f.defaultFilename;(G.constructor==DriveFile&&null!=G.sync&&G.sync.isConnected()||!/(\.html)$/i.test(H))&&this.addMenuItems(n,["properties"],v)}"simple"==Editor.currentTheme&&f.menus.addMenuItems(n,["-","autosave"],v)}else G=this.editorUi.getCurrentFile(),null!=G&&G.constructor==DriveFile?(G.isRestricted()&&this.addMenuItems(n,["exportOptionsDisabled"],v),this.addMenuItems(n,+["save","-","share"],v),H=this.addMenuItem(n,"synchronize",v),(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(H,"https://www.drawio.com/doc/faq/synchronize"),n.addSeparator(v)):this.addMenuItems(n,["new"],v),this.addSubmenu("openFrom",n,v),isLocalStorage&&this.addSubmenu("openRecent",n,v),null!=G&&G.constructor==DriveFile?this.addMenuItems(n,"new - rename makeCopy openFolder moveToFolder".split(" "),v):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==G||G.constructor==+LocalFile&&null==G.fileHandle||(n.addSeparator(v),H=this.addMenuItem(n,"synchronize",v),(!f.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(H,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(n,["-","save","saveAs","-"],v),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=f.getServiceName()||f.isOfflineApp()||null==G||this.addMenuItems(n,["share","-"],v),null!=G&&G.isRenamable()&&this.addMenuItems(n,["rename"],v),f.isOfflineApp()?this.addMenuItems(n,+["upload"],v):(this.addMenuItems(n,["makeCopy"],v),null!=G&&(G.constructor==OneDriveFile&&this.addMenuItems(n,["moveToFolder"],v),null!=G.getFolderUrl()&&f.menus.addMenuItems(n,["openFolder"],v)))),n.addSeparator(v),this.addSubmenu("importFrom",n,v),this.addSubmenu("exportAs",n,v),f.isOffline()||(n.addSeparator(v),this.addSubmenu("embed",n,v),this.addSubmenu("publish",n,v)),n.addSeparator(v),this.addSubmenu("newLibrary",n,v),this.addSubmenu("openLibraryFrom",n,v),f.isRevisionHistorySupported()&&this.addMenuItems(n,+["-","revisionHistory"],v),null!=G&&null!=f.fileNode&&"1"!=urlParams.embedInline&&(H=null!=G.getTitle()?G.getTitle():f.defaultFilename,(G.constructor==DriveFile&&null!=G.sync&&G.sync.isConnected()||!/(\.html)$/i.test(H))&&this.addMenuItems(n,["-","properties"])),this.addMenuItems(n,["-","pageSetup"],v),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(n,["print"],v),this.addMenuItems(n,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(n,v){function G(Q){var T=encodeURIComponent(Q.name)++(null==Q.url?"":"@"+encodeURIComponent(Q.url));if(!I[T]){for(var P=Q.name,S=0;null!=J[P.toLowerCase()];)P=Q.name+" ("+ ++S+")";null==C[T]&&(M.push({name:Q.name,url:Q.url,label:P,title:Q.url}),J[P.toLowerCase()]=Q,C[T]=Q)}}for(var H=mxUtils.bind(this,function(Q,T,P,S,W){var X=f.editor.graph,Y=this.styleChange(n,null!=S?S:Q,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[Q,null!=T?encodeURIComponent(T):null,null],null,v,function(){X.setFont(Q,T);f.fireEvent(new mxEventObject("styleChanged","keys",+[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[Q,null!=T?encodeURIComponent(T):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")})});P&&(P=document.createElement("img"),P.className="geAdaptiveAsset",P.setAttribute("src",Editor.crossImage),P.setAttribute("title",mxResources.get("delete")),P.setAttribute("valign","absmiddle"),+P.setAttribute("border","0"),P.style.position="relative",P.style.top="2px",P.style.width="14px",P.style.cursor="default",P.style.margin="0 3px",Y.firstChild.nextSibling.nextSibling.appendChild(P),mxEvent.addListener(P,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Z){this.removeCustomFont(Q,T);this.editorUi.hideCurrentMenu();mxEvent.consume(Z)})));Graph.addFont(Q,T);Y.firstChild.nextSibling.style.fontFamily=Q;W=null!=S?S:Q;null!=T&&(W+=" ("+T+")");Y.setAttribute("title",W)}),+I={},g=0;g<this.defaultFonts.length;g++){var q=this.defaultFonts[g];"string"===typeof q?H(q):null!=q.fontFamily&&null!=q.fontUrl&&(I[encodeURIComponent(q.fontFamily)+"@"+encodeURIComponent(q.fontUrl)]=!0,H(q.fontFamily,q.fontUrl))}n.addSeparator(v);var C={},J={},M=[];for(g=0;g<this.customFonts.length;g++)G(this.customFonts[g]);M.sort(function(Q,T){return Q.label<T.label?-1:Q.label>T.label?1:0});if(0<M.length){for(g=0;g<M.length;g++)H(M[g].name,M[g].url,!0,M[g].label);n.addSeparator(v)}n.addItem(mxResources.get("reset"),+null,mxUtils.bind(this,function(){this.customFonts=[];f.fireEvent(new mxEventObject("customFontsChanged"))}),v);n.addSeparator(v);n.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var Q=this.editorUi.editor.graph,T=Q.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],P="s",S=null;if(Q.isEditing()){var W=Q.getSelectedEditingElement();if(null!=W){var X=mxUtils.getCurrentStyle(W);if(null!=X){T=mxUtils.getCssFontFamily(X.fontFamily);X=Q.getView().getState(Q.cellEditor.getEditingCell());+S=null!=X?X.style.fontSource:null;for(null!=S&&(S=decodeURIComponent(S));null!=W&&W!=Q.cellEditor.textarea;){if(W.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=W.getAttribute("data-font-src")){S=W.getAttribute("data-font-src");break}else if(W.getAttribute("face")==T){S=null;break}W=W.parentNode}null!=S&&(Graph.isGoogleFontUrl(S)?(S=null,P="g"):P="w")}}}else X=Q.getView().getState(Q.getSelectionCell()),null!=X&&(T=X.style[mxConstants.STYLE_FONTFAMILY]||T,W=X.style.fontSource,null!=W&&(W=decodeURIComponent(W),+Graph.isGoogleFontUrl(W)?P="g":(P="w",S=W)));null!=S&&S.substring(0,PROXY_URL.length)==PROXY_URL&&(S=decodeURIComponent(S.substr((PROXY_URL+"?url=").length)));var Y=null;document.activeElement==Q.cellEditor.textarea&&(Y=Q.cellEditor.saveSelection());T=new FontDialog(this.editorUi,T,S,P,mxUtils.bind(this,function(Z,aa,ha){null!=Y&&(Q.cellEditor.restoreSelection(Y),Y=null);if(null!=Z&&0<Z.length)if(this.addCustomFont(Z,aa),Q.isEditing())Q.setFont(Z,aa);else{Q.getModel().beginUpdate();try{Q.stopEditing(!1),+Q.setCellStyles(mxConstants.STYLE_FONTFAMILY,Z),Q.setCellStyles("fontSource",null!=aa?encodeURIComponent(aa):null),Q.setCellStyles("FType",null)}finally{Q.getModel().endUpdate()}}}));this.editorUi.showDialog(T.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);T.init()}),v,null,!0)})))}})();function DiagramPage(b,l){this.node=b;null!=l?this.node.setAttribute("id",l):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,l,p){this.ui=b;this.page=l;this.previous=this.name=p}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,l,p){this.ui=b;this.oldIndex=l;this.newIndex=p}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,l,p){this.ui=b;this.previousPage=this.page=l;null!=l&&(this.ui.updatePageRoot(l),null!=p&&(l.viewState=p))}@@ -14332,18 +14344,18 @@ EditorUi.prototype.getPageIndex=function(b){var l=null;if(null!=this.pages&&nullEditorUi.prototype.createImageForPageLink=function(b,l,p,f){var x=b.indexOf(","),z=null;0<x&&(x=this.getPageById(b.substring(x+1)),null!=x&&x!=l&&(z=this.getImageForPage(x,l,p,f),z.originalSrc=b));null==z&&(z={originalSrc:b});return z};EditorUi.prototype.pageSelected=function(){var b=this.editor.graph,l=this.currentPage;null!=l&&(b.tooltipHandler.hide(),null==l.viewState||null==l.viewState.scrollTop||null==l.viewState.scrollLeft?(b.selectUnlockedLayer(),this.resetScrollbars(),b.isLightboxView()?this.lightboxFit():Editor.fitDiagramOnPage&&this.initialFitDiagram(),null!=this.chromelessResize&&(b.container.scrollleft=0,b.container.scrollTop=0,this.chromelessResize())):b.setScrollbarPositions(l.viewState,b.view.translate.x,b.view.translate.y),this.updateTabContainer(),this.scrollToPage())};-EditorUi.prototype.getImageForPage=function(b,l,p,f){p=null!=p?p:this.editor.graph;var x=p.getGlobalVariable;p=this.createTemporaryGraph(p.getStylesheet());var z=this.getPageIndex(null!=l?l:this.currentPage);p.getGlobalVariable=function(F){return"pagenumber"==F?z+1:"page"==F&&null!=l?l.getName():x.apply(this,arguments)};document.body.appendChild(p.container);this.updatePageRoot(b);p.setAdaptiveColors(b.viewState.adaptiveColors);p.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=+EditorUi.prototype.getImageForPage=function(b,l,p,f){p=null!=p?p:this.editor.graph;var x=p.getGlobalVariable;p=this.createTemporaryGraph(p.getStylesheet());var z=this.getPageIndex(null!=l?l:this.currentPage);p.getGlobalVariable=function(E){return"pagenumber"==E?z+1:"page"==E&&null!=l?l.getName():x.apply(this,arguments)};document.body.appendChild(p.container);this.updatePageRoot(b);p.setAdaptiveColors(b.viewState.adaptiveColors);p.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText="";f=p.getSvg(null,null,null,null,null,null,null,null,null,null,f,null,null,null,!0,!0);var y=p.getGraphBounds();document.body.removeChild(p.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(f)),y.width,y.height,y.x,y.y)};EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.isPagesEnabled()&&(this.keyHandler.bindAction(33,!0,"previousPage",!0),this.keyHandler.bindAction(34,!0,"nextPage",!0));var b=this.editor.graph,l=b.view.validateBackground;b.view.validateBackground=mxUtils.bind(this,function(){l.apply(b.view,-arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(y,F){y=F.getProperty("edit").changes;for(F=0;F<y.length;F++)if(y[F]instanceof RenamePage||y[F]instanceof ChangePage||y[F]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==y.length&&y[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var p=b.sizeDidChange,f=null,x=this;b.sizeDidChange=+arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(y,E){y=E.getProperty("edit").changes;for(E=0;E<y.length;E++)if(y[E]instanceof RenamePage||y[E]instanceof ChangePage||y[E]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==y.length&&y[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var p=b.sizeDidChange,f=null,x=this;b.sizeDidChange=function(){var y=p.apply(this,arguments);null!=x.currentPage&&f!=x.currentPage&&(f=x.currentPage,x.pageSelected());return y};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var z=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",z);this.editor.addListener("pagesPatched",z);this.editor.addListener("pageRenamed",z);this.editor.addListener("pageMoved",z);this.editor.addListener("fileLoaded",z);-this.editor.addListener("pageSelected",mxUtils.bind(this,function(y,F){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(y,F){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};+this.editor.addListener("pageSelected",mxUtils.bind(this,function(y,E){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(y,E){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};EditorUi.prototype.scrollToPage=function(b,l){var p=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),f=null!=b?b:this.currentPage;null!=p&&null!=this.tabScroller&&this.tabScroller.children.length>p&&null!=this.tabScroller.children[p]&&(f!=this.lastScrollPage||l)&&(this.tabScroller.children[p].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[p].className="geTab gePageTab geActivePage",this.lastScrollPage=f)};EditorUi.prototype.restoreViewState=function(b,l,p){b=null!=b?this.getPageById(b.getId()):null;var f=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,l):(f.setViewState(l),this.editor.updateGraphComponents(),f.view.revalidate(),f.sizeDidChange()),f.container.scrollLeft=f.view.translate.x*f.view.scale+l.scrollLeft,f.container.scrollTop=f.view.translate.y*f.view.scale+l.scrollTop,f.restoreSelection(p))};-Graph.prototype.createViewState=function(b){var l=b.getAttribute("page"),p=parseFloat(b.getAttribute("pageScale")),f=parseFloat(b.getAttribute("pageWidth")),x=parseFloat(b.getAttribute("pageHeight")),z=b.getAttribute("background"),y=this.parseBackgroundImage(b.getAttribute("backgroundImage")),F=b.getAttribute("extFonts");if(F)try{F=F.split("|").map(function(O){O=O.split("^");return{name:O[0],url:O[1]}})}catch(O){console.log("ExtFonts format error: "+O.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),-gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:function(){var O=b.getAttribute("fold");return null==O||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?Graph.prototype.defaultFoldingEnabled:"0"!=O}(),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=l?"0"!=l:this.defaultPageVisible,background:null!=z&&0<z.length?z:null,backgroundImage:y,pageScale:isNaN(p)?mxGraph.prototype.pageScale:-p,pageFormat:isNaN(f)||isNaN(x)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,f,x),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var O=b.getAttribute("connect");return null==O||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=O}(),arrows:function(){var O=b.getAttribute("arrows");return null==O||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?-Graph.prototype.defaultConnectionArrowsEnabled:"0"!=O}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:F||[]}};+Graph.prototype.createViewState=function(b){var l=b.getAttribute("page"),p=parseFloat(b.getAttribute("pageScale")),f=parseFloat(b.getAttribute("pageWidth")),x=parseFloat(b.getAttribute("pageHeight")),z=b.getAttribute("background"),y=this.parseBackgroundImage(b.getAttribute("backgroundImage")),E=b.getAttribute("extFonts");if(E)try{E=E.split("|").map(function(R){R=R.split("^");return{name:R[0],url:R[1]}})}catch(R){console.log("ExtFonts format error: "+R.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:function(){var R=b.getAttribute("fold");return null==R||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?Graph.prototype.defaultFoldingEnabled:"0"!=R}(),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=l?"0"!=l:this.defaultPageVisible,background:null!=z&&0<z.length?z:null,backgroundImage:y,pageScale:isNaN(p)?mxGraph.prototype.pageScale:+p,pageFormat:isNaN(f)||isNaN(x)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,f,x),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var R=b.getAttribute("connect");return null==R||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=R}(),arrows:function(){var R=b.getAttribute("arrows");return null==R||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?+Graph.prototype.defaultConnectionArrowsEnabled:"0"!=R}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:E||[]}};Graph.prototype.saveViewState=function(b,l,p,f,x){p||(l.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),l.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),l.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),l.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),l.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),l.setAttribute("connect",null==b||b.connect?"1":"0"),l.setAttribute("arrows",null==b||b.arrows?"1":"0"),l.setAttribute("fold",null==b||b.foldingEnabled?"1":"0"));l.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);p=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=p&&(l.setAttribute("pageWidth",p.width),l.setAttribute("pageHeight",p.height));null!=b&&(null!=b.background&&l.setAttribute("background",b.background),f=this.getBackgroundImageObject(b.backgroundImage,f,x),null!=f&&l.setAttribute("backgroundImage",JSON.stringify(f)));l.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");l.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?l.removeAttribute("adaptiveColors"):l.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&l.setAttribute("extFonts",b.extFonts.map(function(z){return z.name+"^"+z.url}).join("|"))};@@ -14365,15 +14377,15 @@ EditorUi.prototype.selectNextPage=function(b){var l=this.currentPage;null!=l&&nuEditorUi.prototype.insertPage=function(b,l,p){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId(),p),l=null!=l?l:this.pages.length,l=new ChangePage(this,b,b,l),this.editor.graph.model.execute(l));return b};EditorUi.prototype.createPageId=function(){do var b=Editor.guid();while(null!=this.getPageById(b));return b};EditorUi.prototype.createPage=function(b,l,p){l=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),l);l.setName(null!=b?b:this.createPageName());this.initDiagramNode(l,p);return l};EditorUi.prototype.createPageName=function(){for(var b={},l=0;l<this.pages.length;l++){var p=this.pages[l].getName();null!=p&&0<p.length&&(b[p]=p)}l=this.pages.length;do p=mxResources.get("pageWithNumber",[++l]);while(null!=b[p]);return p};EditorUi.prototype.removePage=function(b){try{var l=this.editor.graph,p=mxUtils.indexOf(this.pages,b);if(l.isEnabled()&&0<=p){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);l.model.beginUpdate();try{var f=this.currentPage;f==b&&1<this.pages.length?(p==this.pages.length-1?p--:p++,f=this.pages[p]):1>=this.pages.length&&(f=this.insertPage(),l.model.execute(new RenamePage(this,f,mxResources.get("pageWithNumber",[1]))));l.model.execute(new ChangePage(this,b,f))}finally{l.model.endUpdate()}}}catch(x){this.handleError(x)}return b};-EditorUi.prototype.duplicatePage=function(b,l){var p=null;try{var f=this.editor.graph;if(f.isEnabled()){f.isEditing()&&f.stopEditing();var x=b.node.cloneNode(!1);x.removeAttribute("id");var z={},y=f.createCellLookup([f.model.root]);p=new DiagramPage(x);p.root=f.cloneCell(f.model.root,null,z);var F=new mxGraphModel;F.prefix=Editor.guid()+"-";F.setRoot(p.root);f.updateCustomLinks(f.createCellMapping(z,y),[p.root]);p.viewState=b==this.currentPage?f.getViewState():b.viewState;this.initDiagramNode(p);-p.viewState.scale=1;delete p.viewState.scrollLeft;delete p.viewState.scrollTop;delete p.viewState.currentRoot;delete p.viewState.defaultParent;p.setName(l);p=this.insertPage(p,mxUtils.indexOf(this.pages,b)+1)}}catch(O){this.handleError(O)}return p};EditorUi.prototype.initDiagramNode=function(b,l){null==l&&(l=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,l);EditorUi.removeChildNodes(b.node);b.node.appendChild(l)};+EditorUi.prototype.duplicatePage=function(b,l){var p=null;try{var f=this.editor.graph;if(f.isEnabled()){f.isEditing()&&f.stopEditing();var x=b.node.cloneNode(!1);x.removeAttribute("id");var z={},y=f.createCellLookup([f.model.root]);p=new DiagramPage(x);p.root=f.cloneCell(f.model.root,null,z);var E=new mxGraphModel;E.prefix=Editor.guid()+"-";E.setRoot(p.root);f.updateCustomLinks(f.createCellMapping(z,y),[p.root]);p.viewState=b==this.currentPage?f.getViewState():b.viewState;this.initDiagramNode(p);+p.viewState.scale=1;delete p.viewState.scrollLeft;delete p.viewState.scrollTop;delete p.viewState.currentRoot;delete p.viewState.defaultParent;p.setName(l);p=this.insertPage(p,mxUtils.indexOf(this.pages,b)+1)}}catch(R){this.handleError(R)}return p};EditorUi.prototype.initDiagramNode=function(b,l){null==l&&(l=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,l);EditorUi.removeChildNodes(b.node);b.node.appendChild(l)};EditorUi.prototype.clonePages=function(b){for(var l=[],p=[],f=0;f<b.length;f++)try{p.push(this.clonePage(b[f]))}catch(x){l.push(mxResources.get("pageWithNumber",[f+1])+": "+x.toString())}if(0<l.length){b=Error(l.join("\n"));try{0<p.length&&(b.fallbackFileData=this.getXmlForPages(p))}catch(x){}throw b;}return p};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var l=new DiagramPage(b.node.cloneNode(!0)),p=b==this.currentPage?this.editor.graph.getViewState():b.viewState;l.viewState=mxUtils.clone(p,EditorUi.transientViewStateProperties);l.root=this.editor.graph.model.cloneCell(b.root,null,!0);l.diagramModified=b.diagramModified;return l};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var l=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(p){null!=p&&0<p.length&&this.editor.graph.model.execute(new RenamePage(this,b,p))}),mxResources.get("rename"));this.showDialog(l.container,300,80,!0,!0);l.init()}return b};EditorUi.prototype.movePage=function(b,l){this.editor.graph.model.execute(new MovePage(this,b,l))};EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,l=document.createElement("div");l.className="geTabScroller";for(var p=null,f=0;f<this.pages.length;f++)mxUtils.bind(this,function(z,y){y.className="geTab gePageTab";this.pages[z]==this.currentPage&&y.classList.add("geActivePage");y.setAttribute("draggable",-"true");mxEvent.addListener(y,"dragstart",mxUtils.bind(this,function(F){b.isEnabled()?(mxClient.IS_FF&&F.dataTransfer.setData("Text","<diagram/>"),p=z):mxEvent.consume(F)}));mxEvent.addListener(y,"dragend",mxUtils.bind(this,function(F){p=null;F.stopPropagation();F.preventDefault()}));mxEvent.addListener(y,"dragover",mxUtils.bind(this,function(F){null!=p&&(F.dataTransfer.dropEffect="move");F.stopPropagation();F.preventDefault()}));mxEvent.addListener(y,"drop",mxUtils.bind(this,function(F){null!=p&&-z!=p&&this.movePage(p,z);F.stopPropagation();F.preventDefault()}));l.appendChild(y)})(f,this.createTabForPage(this.pages[f],f+1));f=null!=this.tabScroller?this.tabScroller.scrollLeft:0;this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(l);this.leftScrollTab=this.createLeftScrollTab();+"true");mxEvent.addListener(y,"dragstart",mxUtils.bind(this,function(E){b.isEnabled()?(mxClient.IS_FF&&E.dataTransfer.setData("Text","<diagram/>"),p=z):mxEvent.consume(E)}));mxEvent.addListener(y,"dragend",mxUtils.bind(this,function(E){p=null;E.stopPropagation();E.preventDefault()}));mxEvent.addListener(y,"dragover",mxUtils.bind(this,function(E){null!=p&&(E.dataTransfer.dropEffect="move");E.stopPropagation();E.preventDefault()}));mxEvent.addListener(y,"drop",mxUtils.bind(this,function(E){null!=p&&+z!=p&&this.movePage(p,z);E.stopPropagation();E.preventDefault()}));l.appendChild(y)})(f,this.createTabForPage(this.pages[f],f+1));f=null!=this.tabScroller?this.tabScroller.scrollLeft:0;this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(l);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);this.tabScroller=l;this.tabScroller.scrollLeft=f;this.checkTabScrollerOverflow();mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(z){this.checkTabScrollerOverflow()}));var x=document.createElement("a");x.href="https://github.com/jgraph/drawio";x.target="_blank";x.style.cssText="margin-left:auto;display:flex;align-items:center;padding:0 8px;opacity:0.5;flex-shrink:0";f=document.createElement("img");f.src=IMAGE_PATH+(Editor.isDarkMode()?"/github-logo-white.svg":"/github-logo.svg");f.style.cssText="width:18px;height:18px";f.setAttribute("title","jgraph/drawio");x.appendChild(f);mxEvent.addListener(x,"mouseenter",function(){x.style.opacity="1"});mxEvent.addListener(x,"mouseleave",function(){x.style.opacity="0.5"});this.tabContainer.appendChild(x)}};EditorUi.prototype.checkTabScrollerOverflow=function(){null!=this.tabScroller&&null!=this.tabContainer&&2<this.tabContainer.children.length&&(this.tabScroller.scrollWidth>this.tabScroller.offsetWidth?(this.leftScrollTab.style.display="",this.rightScrollTab.style.display="",0==this.tabScroller.scrollLeft?this.leftScrollTab.classList.add("mxDisabled"):this.leftScrollTab.classList.remove("mxDisabled"),Math.ceil(this.tabScroller.scrollLeft)+this.tabScroller.offsetWidth>=this.tabScroller.scrollWidth?this.rightScrollTab.classList.add("mxDisabled"):@@ -14384,62 +14396,62 @@ EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(nEditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,mxUtils.bind(this,function(b){var l=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:l,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=l;mxEvent.consume(b)}))};EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var l=new mxPopupMenu(mxUtils.bind(this,function(x,z){this.menus.get("pages").funct(x,z)}));l.smartSeparators=!0;l.showDisabled=!0;l.autoExpand=!0;l.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(l,arguments);l.destroy()});var p=mxEvent.getClientX(b),f=mxEvent.getClientY(b);l.popup(p,f,null,b);this.setCurrentMenu(l);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,l){var p=this.createTab(),f=b.getName()||mxResources.get("untitled"),x=b.getId();p.setAttribute("title",f+(null!=x?" ("+x+")":"")+" ["+l+"]");l=document.createElement("span");l.style.maxWidth="160px";l.style.textOverflow="ellipsis";l.style.overflow="hidden";mxUtils.write(l,f);p.appendChild(l);this.addTabListeners(b,p);return p};-EditorUi.prototype.addTabListeners=function(b,l){mxEvent.disableContextMenu(l);var p=this.editor.graph;mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(O){this.renamePage(b);mxEvent.consume(O)}));var f=document.createElement("div");f.style.backgroundImage="url("+Editor.thinExpandImage+")";f.className="geButton";l.appendChild(f);var x=!1,z=!1,y=mxUtils.bind(this,function(O){x=null!=this.currentMenu;z=b==this.currentPage;this.scrollToPage(b);p.isMouseDown||z||this.selectPage(b)}),F=mxUtils.bind(this,-function(O){if(!p.isMouseDown&&(z&&(mxEvent.isTouchEvent(O)||mxEvent.getSource(O)==f)||mxEvent.isPopupTrigger(O))&&(p.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(O)||!x)){var K=new mxPopupMenu(this.createPageMenu(b));K.smartSeparators=!0;K.showDisabled=!0;K.autoExpand=!0;K.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(K,arguments);this.resetCurrentMenu();K.destroy()});var L=mxEvent.getClientX(O),M=mxEvent.getClientY(O);K.popup(L,M,null,O);-this.setCurrentMenu(K,l)}mxEvent.consume(O)});mxEvent.addGestureListeners(f,y,null,F);mxEvent.addGestureListeners(l,y,null,F)};+EditorUi.prototype.addTabListeners=function(b,l){mxEvent.disableContextMenu(l);var p=this.editor.graph;mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(R){this.renamePage(b);mxEvent.consume(R)}));var f=document.createElement("div");f.style.backgroundImage="url("+Editor.thinExpandImage+")";f.className="geButton";l.appendChild(f);var x=!1,z=!1,y=mxUtils.bind(this,function(R){x=null!=this.currentMenu;z=b==this.currentPage;this.scrollToPage(b);p.isMouseDown||z||this.selectPage(b)}),E=mxUtils.bind(this,+function(R){if(!p.isMouseDown&&(z&&(mxEvent.isTouchEvent(R)||mxEvent.getSource(R)==f)||mxEvent.isPopupTrigger(R))&&(p.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(R)||!x)){var K=new mxPopupMenu(this.createPageMenu(b));K.smartSeparators=!0;K.showDisabled=!0;K.autoExpand=!0;K.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(K,arguments);this.resetCurrentMenu();K.destroy()});var L=mxEvent.getClientX(R),O=mxEvent.getClientY(R);K.popup(L,O,null,R);+this.setCurrentMenu(K,l)}mxEvent.consume(R)});mxEvent.addGestureListeners(f,y,null,E);mxEvent.addGestureListeners(l,y,null,E)};EditorUi.prototype.createPageMenu=function(b,l){return mxUtils.bind(this,function(p,f){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||p.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),f));this.editor.graph.isEnabled()&&(p.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",-[b.getName()]))}),f),p.addSeparator(f),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",p,f,mxResources.get("move")),p.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),f),p.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,l)}),f))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(f,x,z,y,F){x=null!=x?x:!1;null==z&&(z=this.getFoldableCells(this.getSelectionCells(),f));this.stopEditing();this.model.beginUpdate();try{for(var O=z.slice(),K=0;K<z.length;K++)"1"==mxUtils.getValue(this.getCurrentCellStyle(z[K]),"treeFolding","0")&&this.foldTreeCell(f,z[K]);z=O;z=b.apply(this,arguments)}finally{this.model.endUpdate()}return z};Graph.prototype.foldTreeCell=function(f,x){this.model.beginUpdate();try{var z=-[];this.traverse(x,!0,mxUtils.bind(this,function(F,O){var K=null!=O&&this.isTreeEdge(O);K&&z.push(O);F==x||null!=O&&!K||z.push(F);return(null==O||K)&&(F==x||!this.model.isCollapsed(F))}));this.model.setCollapsed(x,f);for(var y=0;y<z.length;y++)this.model.setVisible(z[y],!f)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(f){return!this.isEdgeIgnored(f)};Graph.prototype.getTreeEdges=function(f,x,z,y,F,O){return this.model.filterCells(this.getEdges(f,x,z,y,F,O),mxUtils.bind(this,+[b.getName()]))}),f),p.addSeparator(f),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",p,f,mxResources.get("move")),p.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),f),p.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,l)}),f))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(f,x,z,y,E){x=null!=x?x:!1;null==z&&(z=this.getFoldableCells(this.getSelectionCells(),f));this.stopEditing();this.model.beginUpdate();try{for(var R=z.slice(),K=0;K<z.length;K++)"1"==mxUtils.getValue(this.getCurrentCellStyle(z[K]),"treeFolding","0")&&this.foldTreeCell(f,z[K]);z=R;z=b.apply(this,arguments)}finally{this.model.endUpdate()}return z};Graph.prototype.foldTreeCell=function(f,x){this.model.beginUpdate();try{var z=+[];this.traverse(x,!0,mxUtils.bind(this,function(E,R){var K=null!=R&&this.isTreeEdge(R);K&&z.push(R);E==x||null!=R&&!K||z.push(E);return(null==R||K)&&(E==x||!this.model.isCollapsed(E))}));this.model.setCollapsed(x,f);for(var y=0;y<z.length;y++)this.model.setVisible(z[y],!f)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(f){return!this.isEdgeIgnored(f)};Graph.prototype.getTreeEdges=function(f,x,z,y,E,R){return this.model.filterCells(this.getEdges(f,x,z,y,E,R),mxUtils.bind(this,function(K){return this.isTreeEdge(K)}))};Graph.prototype.getIncomingTreeEdges=function(f,x){return this.getTreeEdges(f,x,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(f,x){return this.getTreeEdges(f,x,!1,!0,!1)};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){l.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function f(I){return m.isVertex(I)&&z(I)}function x(I){var g=!1;null!=I&&(g="1"==-k.getCurrentCellStyle(I).treeMoving);return g}function z(I){var g=!1;null!=I&&(I=m.getParent(I),g=k.view.getState(I),g="tree"==(null!=g?g.style:k.getCellStyle(I)).containerType);return g}function y(I){var g=!1;null!=I&&(I=m.getParent(I),g=k.view.getState(I),k.view.getState(I),g=null!=(null!=g?g.style:k.getCellStyle(I)).childLayout);return g}function F(I){I=k.view.getState(I);if(null!=I){var g=k.getIncomingTreeEdges(I.cell);if(0<g.length&&(g=k.view.getState(g[0]),null!=g&&(g=g.absolutePoints,null!=-g&&0<g.length&&(g=g[g.length-1],null!=g)))){if(g.y==I.y&&Math.abs(g.x-I.getCenterX())<I.width/2)return mxConstants.DIRECTION_SOUTH;if(g.y==I.y+I.height&&Math.abs(g.x-I.getCenterX())<I.width/2)return mxConstants.DIRECTION_NORTH;if(g.x>I.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function O(I,g){g=null!=g?g:!0;k.model.beginUpdate();try{var q=k.model.getParent(I),B=k.getIncomingTreeEdges(I),J=k.cloneCells([B[0],I]);k.model.setTerminal(J[0],k.model.getTerminal(B[0],-!0),!0);var Q=F(I),N=q.geometry;Q==mxConstants.DIRECTION_SOUTH||Q==mxConstants.DIRECTION_NORTH?J[1].geometry.x+=g?I.geometry.width+10:-J[1].geometry.width-10:J[1].geometry.y+=g?I.geometry.height+10:-J[1].geometry.height-10;k.view.currentRoot!=q&&(J[1].geometry.x-=N.x,J[1].geometry.y-=N.y);var S=k.view.getState(I),P=k.view.scale;if(null!=S){var R=mxRectangle.fromRectangle(S);Q==mxConstants.DIRECTION_SOUTH||Q==mxConstants.DIRECTION_NORTH?R.x+=(g?I.geometry.width+10:-J[1].geometry.width-10)*P:R.y+=(g?-I.geometry.height+10:-J[1].geometry.height-10)*P;var W=k.getOutgoingTreeEdges(k.model.getTerminal(B[0],!0));if(null!=W){for(var X=Q==mxConstants.DIRECTION_SOUTH||Q==mxConstants.DIRECTION_NORTH,Y=N=B=0;Y<W.length;Y++){var aa=k.model.getTerminal(W[Y],!1);if(Q==F(aa)){var ba=k.view.getState(aa);aa!=I&&null!=ba&&(X&&g!=ba.getCenterX()<S.getCenterX()||!X&&g!=ba.getCenterY()<S.getCenterY())&&mxUtils.intersects(R,ba)&&(B=10+Math.max(B,(Math.min(R.x+R.width,ba.x+ba.width)-Math.max(R.x,ba.x))/P),N=10+Math.max(N,-(Math.min(R.y+R.height,ba.y+ba.height)-Math.max(R.y,ba.y))/P))}}X?N=0:B=0;for(Y=0;Y<W.length;Y++)if(aa=k.model.getTerminal(W[Y],!1),Q==F(aa)&&(ba=k.view.getState(aa),aa!=I&&null!=ba&&(X&&g!=ba.getCenterX()<S.getCenterX()||!X&&g!=ba.getCenterY()<S.getCenterY()))){var fa=[];k.traverse(ba.cell,!0,function(ia,ea){var ma=null!=ea&&k.isTreeEdge(ea);ma&&fa.push(ea);(null==ea||ma)&&fa.push(ia);return null==ea||ma});k.moveCells(fa,(g?1:-1)*B,(g?1:-1)*N)}}}return k.addCells(J,q)}finally{k.model.endUpdate()}}-function K(I){k.model.beginUpdate();try{var g=F(I),q=k.getIncomingTreeEdges(I),B=k.cloneCells([q[0],I]);k.model.setTerminal(q[0],B[1],!1);k.model.setTerminal(B[0],B[1],!0);k.model.setTerminal(B[0],I,!1);var J=k.model.getParent(I),Q=J.geometry,N=[];k.view.currentRoot!=J&&(B[1].geometry.x-=Q.x,B[1].geometry.y-=Q.y);k.traverse(I,!0,function(R,W){var X=null!=W&&k.isTreeEdge(W);X&&N.push(W);(null==W||X)&&N.push(R);return null==W||X});var S=I.geometry.width+40,P=I.geometry.height+40;g==mxConstants.DIRECTION_SOUTH?-S=0:g==mxConstants.DIRECTION_NORTH?(S=0,P=-P):g==mxConstants.DIRECTION_WEST?(S=-S,P=0):g==mxConstants.DIRECTION_EAST&&(P=0);k.moveCells(N,S,P);return k.addCells(B,J)}finally{k.model.endUpdate()}}function L(I,g){k.model.beginUpdate();try{var q=k.model.getParent(I),B=k.getIncomingTreeEdges(I),J=F(I);0==B.length&&(B=[k.createEdge(q,null,"",null,null,k.createCurrentEdgeStyle())],J=g);var Q=k.cloneCells([B[0],I]);k.model.setTerminal(Q[0],I,!0);null==k.model.getTerminal(Q[0],!1)&&(k.model.setTerminal(Q[0],-Q[1],!1),k.applyNewEdgeStyle(Q[1],[Q[0]],J));B=k.getOutgoingTreeEdges(I);var N=q.geometry;g=[];k.view.currentRoot==q&&(N=new mxRectangle);for(var S=0;S<B.length;S++){var P=k.model.getTerminal(B[S],!1);null!=P&&g.push(P)}var R=k.view.getBounds(g),W=k.view.translate,X=k.view.scale;J==mxConstants.DIRECTION_SOUTH?(Q[1].geometry.x=null==R?I.geometry.x+(I.geometry.width-Q[1].geometry.width)/2:(R.x+R.width)/X-W.x-N.x+10,Q[1].geometry.y+=Q[1].geometry.height-N.y+40):J==mxConstants.DIRECTION_NORTH?(Q[1].geometry.x=-null==R?I.geometry.x+(I.geometry.width-Q[1].geometry.width)/2:(R.x+R.width)/X-W.x+-N.x+10,Q[1].geometry.y-=Q[1].geometry.height+N.y+40):(Q[1].geometry.x=J==mxConstants.DIRECTION_WEST?Q[1].geometry.x-(Q[1].geometry.width+N.x+40):Q[1].geometry.x+(Q[1].geometry.width-N.x+40),Q[1].geometry.y=null==R?I.geometry.y+(I.geometry.height-Q[1].geometry.height)/2:(R.y+R.height)/X-W.y+-N.y+10);return k.addCells(Q,q)}finally{k.model.endUpdate()}}function M(I,g,q){I=k.getOutgoingTreeEdges(I);q=k.view.getState(q);-var B=[];if(null!=q&&null!=I){for(var J=0;J<I.length;J++){var Q=k.view.getState(k.model.getTerminal(I[J],!1));null!=Q&&(!g&&Math.min(Q.x+Q.width,q.x+q.width)>=Math.max(Q.x,q.x)||g&&Math.min(Q.y+Q.height,q.y+q.height)>=Math.max(Q.y,q.y))&&B.push(Q)}B.sort(function(N,S){return g?N.x+N.width-S.x-S.width:N.y+N.height-S.y-S.height})}return B}function c(I,g){var q=F(I),B=g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST;(q==mxConstants.DIRECTION_EAST||q==mxConstants.DIRECTION_WEST)==B&&q!=g?-d.actions.get("selectParent").funct():q==g?(g=k.getOutgoingTreeEdges(I),null!=g&&0<g.length&&k.setSelectionCell(k.model.getTerminal(g[0],!1))):(q=k.getIncomingTreeEdges(I),null!=q&&0<q.length&&(B=M(k.model.getTerminal(q[0],!0),B,I),I=k.view.getState(I),null!=I&&(I=mxUtils.indexOf(B,I),0<=I&&(I+=g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_WEST?-1:1,0<=I&&I<=B.length-1&&k.setSelectionCell(B[I].cell)))))}var d=this,k=d.editor.graph,m=k.getModel(),t=d.menus.createPopupMenu;d.menus.createPopupMenu=-function(I,g,q){t.apply(this,arguments);if(1==k.getSelectionCount()){g=k.getSelectionCell();var B=k.getOutgoingTreeEdges(g);I.addSeparator();0<B.length&&(f(k.getSelectionCell())&&this.addMenuItems(I,["selectChildren"],null,q),this.addMenuItems(I,["selectDescendants"],null,q));f(k.getSelectionCell())?(I.addSeparator(),0<k.getIncomingTreeEdges(g).length&&this.addMenuItems(I,["selectSiblings","selectParent"],null,q)):0<k.model.getEdgeCount(g)&&this.addMenuItems(I,["selectConnections"],null,q)}};d.actions.addAction("selectChildren",-function(I){if(k.isEnabled()&&1==k.getSelectionCount()){var g=k.getSelectionCell();I=mxEvent.isControlDown(I)?null:k.getOutgoingTreeEdges(g);if(null!=I&&0<I.length){g=[];for(var q=0;q<I.length;q++)g.push(k.model.getTerminal(I[q],!1));k.setSelectionCells(g)}else k.setSelectionCells(k.model.getChildren(g))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");d.actions.addAction("selectDescendants",function(I){var g=k.getSelectionCell();if(k.isEnabled()&&null!=g){var q=[];mxEvent.isControlDown(I)||k.traverse(g,-!0,function(B,J){var Q=null!=J&&k.isTreeEdge(J);Q&&mxEvent.isControlDown(I)&&q.push(J);(null==J||Q)&&q.push(B);return null==J||Q});if(0==q.length||1==q.length&&q[0]==g)q=k.model.getDescendants(g);k.setSelectionCells(q)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");d.actions.addAction("selectParent",function(I){var g=k.getSelectionCell();k.isEnabled()&&null!=g&&(I=mxEvent.isControlDown(I)?null:k.getIncomingTreeEdges(g),null!=I&&0<I.length?k.setSelectionCell(k.model.getTerminal(I[0],!0)):k.selectParentCell())},-null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");d.actions.addAction("selectSiblings",function(I){if(k.isEnabled()&&1==k.getSelectionCount()){var g=k.getSelectionCell(),q=mxEvent.isControlDown(I)?null:k.getIncomingTreeEdges(g);I=[];if(null!=q&&0<q.length&&(q=k.getOutgoingTreeEdges(k.model.getTerminal(q[0],!0)),null!=q))for(var B=0;B<q.length;B++)I.push(k.model.getTerminal(q[B],!1));0==I.length&&(I=k.model.getChildren(k.model.getParent(g)));k.setSelectionCells(I)}},null,null,Editor.altKey+"+"+Editor.shiftKey+-"+S");var v=k.removeCells;k.removeCells=function(I,g){g=null!=g?g:!0;null==I&&(I=this.getDeletableCells(this.getSelectionCells()));g&&(I=this.getDeletableCells(this.addAllEdges(I)));for(var q=[],B=0;B<I.length;B++){var J=I[B];m.isEdge(J)&&z(J)&&(q.push(J),J=m.getTerminal(J,!1));if(f(J)){var Q=[];k.traverse(J,!0,function(N,S){var P=null!=S&&k.isTreeEdge(S);P&&Q.push(S);(null==S||P)&&Q.push(N);return null==S||P});0<Q.length&&(q=q.concat(Q),J=k.getIncomingTreeEdges(I[B]),I=I.concat(J))}else null!=J&&-q.push(I[B])}I=q;return v.apply(this,arguments)};d.hoverIcons.getStateAt=function(I,g,q){return f(I.cell)?null:this.graph.view.getState(this.graph.getCellAt(g,q))};var A=k.duplicateCells;k.duplicateCells=function(I,g){I=null!=I?I:this.getSelectionCells();for(var q=I.slice(0),B=0;B<q.length;B++){var J=k.view.getState(q[B]);if(null!=J&&f(J.cell)){var Q=k.getIncomingTreeEdges(J.cell);for(J=0;J<Q.length;J++)mxUtils.remove(Q[J],I)}}this.model.beginUpdate();try{var N=A.call(this,I,g);if(N.length==I.length)for(B=-0;B<I.length;B++)if(f(I[B])){var S=k.getIncomingTreeEdges(N[B]);Q=k.getIncomingTreeEdges(I[B]);if(0==S.length&&0<Q.length){var P=this.cloneCell(Q[0]);this.addEdge(P,k.getDefaultParent(),this.model.getTerminal(Q[0],!0),N[B])}}}finally{this.model.endUpdate()}return N};var C=k.moveCells;k.moveCells=function(I,g,q,B,J,Q,N){for(var S=null,P=[],R=0;R<I.length;R++)(x(I[R])||f(I[R]))&&!y(I[R])&&this.isCellCollapsed(I[R])?P=P.concat(this.getSubtree(I[R])):P.push(I[R]);I=mxUtils.removeDuplicates(P);this.model.beginUpdate();-try{P=J;var W=this.getCurrentCellStyle(J);if(null!=I&&f(J)&&"1"==mxUtils.getValue(W,"treeFolding","0")){for(R=0;R<I.length;R++)if(f(I[R])||k.model.isEdge(I[R])&&null==k.model.getTerminal(I[R],!0)){J=k.model.getParent(I[R]);break}if(null!=P&&J!=P&&null!=this.view.getState(I[0])){var X=k.getIncomingTreeEdges(I[0]);if(0<X.length){var Y=k.view.getState(k.model.getTerminal(X[0],!0));if(null!=Y){var aa=k.view.getState(P);null!=aa&&(g=(aa.getCenterX()-Y.getCenterX())/k.view.scale,q=(aa.getCenterY()-Y.getCenterY())/-k.view.scale)}}}}S=C.apply(this,arguments);if(null!=S&&null!=I&&S.length==I.length)for(R=0;R<S.length;R++)if(this.model.isEdge(S[R]))f(P)&&0>mxUtils.indexOf(S,this.model.getTerminal(S[R],!0))&&this.model.setTerminal(S[R],P,!0);else if(f(I[R])&&(X=k.getIncomingTreeEdges(I[R]),0<X.length))if(!B)f(P)&&0>mxUtils.indexOf(I,this.model.getTerminal(X[0],!0))&&this.model.setTerminal(X[0],P,!0);else if(0==k.getIncomingTreeEdges(S[R]).length){W=P;if(null==W||W==k.model.getParent(I[R]))W=k.model.getTerminal(X[0],-!0);B=this.cloneCell(X[0]);this.addEdge(B,k.getDefaultParent(),W,S[R])}}finally{this.model.endUpdate()}return S};if(null!=d.sidebar){var E=d.sidebar.dropAndConnect;d.sidebar.dropAndConnect=function(I,g,q,B){var J=k.model,Q=null;J.beginUpdate();try{if(Q=E.apply(this,arguments),f(I))for(var N=0;N<Q.length;N++)if(J.isEdge(Q[N])&&null==J.getTerminal(Q[N],!0)){J.setTerminal(Q[N],I,!0);var S=k.getCellGeometry(Q[N]);S.points=null;null!=S.getTerminalPoint(!0)&&S.setTerminalPoint(null,!0)}}finally{J.endUpdate()}return Q}}var D=-{67:d.actions.get("selectChildren"),88:d.actions.get("selectDescendants"),80:d.actions.get("selectParent"),83:d.actions.get("selectSiblings")},U={67:d.actions.get("copyStyle"),86:d.actions.get("pasteStyle")},T=d.onKeyDown;d.onKeyDown=function(I){try{var g=k.getSelectionCell();if(k.isEnabled()&&!k.isEditing()&&null!=g){var q=mxEvent.isAltDown(I)&&mxEvent.isShiftDown(I)?D[I.keyCode]:mxEvent.isAltDown(I)?U[I.keyCode]:null;null!=q?(q.funct(I),mxEvent.consume(I)):f(g)&&(q=null,0<k.getIncomingTreeEdges(g).length&&-(9==I.which?q=mxEvent.isShiftDown(I)?K(g):L(g):13==I.which&&(q=O(g,!mxEvent.isShiftDown(I)))),null!=q&&0<q.length?(1==q.length&&k.model.isEdge(q[0])?k.setSelectionCell(k.model.getTerminal(q[0],!1)):k.setSelectionCell(q[q.length-1]),null!=d.hoverIcons&&d.hoverIcons.update(k.view.getState(g)),k.startEditingAtCell(g),mxEvent.consume(I)):37==I.keyCode?(c(g,mxConstants.DIRECTION_WEST),mxEvent.consume(I)):38==I.keyCode?(c(g,mxConstants.DIRECTION_NORTH),mxEvent.consume(I)):39==I.keyCode?(c(g,mxConstants.DIRECTION_EAST),-mxEvent.consume(I)):40==I.keyCode&&(c(g,mxConstants.DIRECTION_SOUTH),mxEvent.consume(I)))}}catch(B){d.handleError(B)}mxEvent.isConsumed(I)||T.apply(this,arguments)};var V=k.connectVertex;k.connectVertex=function(I,g,q,B,J,Q,N){var S=k.getIncomingTreeEdges(I);if(f(I)){var P=F(I),R=P==mxConstants.DIRECTION_EAST||P==mxConstants.DIRECTION_WEST,W=g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST;return P==g||0==S.length?L(I,g):R==W?K(I):O(I,g!=mxConstants.DIRECTION_NORTH&&g!=mxConstants.DIRECTION_WEST)}return V.apply(this,-arguments)};k.getSubtree=function(I){var g=[I];!x(I)&&!f(I)||y(I)||k.traverse(I,!0,function(q,B){var J=null!=B&&k.isTreeEdge(B);J&&0>mxUtils.indexOf(g,B)&&g.push(B);(null==B||J)&&0>mxUtils.indexOf(g,q)&&g.push(q);return null==B||J});return g};var n=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){n.apply(this,arguments);(x(this.state.cell)||f(this.state.cell))&&!y(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?+k.getCurrentCellStyle(I).treeMoving);return g}function z(I){var g=!1;null!=I&&(I=m.getParent(I),g=k.view.getState(I),g="tree"==(null!=g?g.style:k.getCellStyle(I)).containerType);return g}function y(I){var g=!1;null!=I&&(I=m.getParent(I),g=k.view.getState(I),k.view.getState(I),g=null!=(null!=g?g.style:k.getCellStyle(I)).childLayout);return g}function E(I){I=k.view.getState(I);if(null!=I){var g=k.getIncomingTreeEdges(I.cell);if(0<g.length&&(g=k.view.getState(g[0]),null!=g&&(g=g.absolutePoints,null!=+g&&0<g.length&&(g=g[g.length-1],null!=g)))){if(g.y==I.y&&Math.abs(g.x-I.getCenterX())<I.width/2)return mxConstants.DIRECTION_SOUTH;if(g.y==I.y+I.height&&Math.abs(g.x-I.getCenterX())<I.width/2)return mxConstants.DIRECTION_NORTH;if(g.x>I.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function R(I,g){g=null!=g?g:!0;k.model.beginUpdate();try{var q=k.model.getParent(I),C=k.getIncomingTreeEdges(I),J=k.cloneCells([C[0],I]);k.model.setTerminal(J[0],k.model.getTerminal(C[0],+!0),!0);var M=E(I),Q=q.geometry;M==mxConstants.DIRECTION_SOUTH||M==mxConstants.DIRECTION_NORTH?J[1].geometry.x+=g?I.geometry.width+10:-J[1].geometry.width-10:J[1].geometry.y+=g?I.geometry.height+10:-J[1].geometry.height-10;k.view.currentRoot!=q&&(J[1].geometry.x-=Q.x,J[1].geometry.y-=Q.y);var T=k.view.getState(I),P=k.view.scale;if(null!=T){var S=mxRectangle.fromRectangle(T);M==mxConstants.DIRECTION_SOUTH||M==mxConstants.DIRECTION_NORTH?S.x+=(g?I.geometry.width+10:-J[1].geometry.width-10)*P:S.y+=(g?+I.geometry.height+10:-J[1].geometry.height-10)*P;var W=k.getOutgoingTreeEdges(k.model.getTerminal(C[0],!0));if(null!=W){for(var X=M==mxConstants.DIRECTION_SOUTH||M==mxConstants.DIRECTION_NORTH,Y=Q=C=0;Y<W.length;Y++){var Z=k.model.getTerminal(W[Y],!1);if(M==E(Z)){var aa=k.view.getState(Z);Z!=I&&null!=aa&&(X&&g!=aa.getCenterX()<T.getCenterX()||!X&&g!=aa.getCenterY()<T.getCenterY())&&mxUtils.intersects(S,aa)&&(C=10+Math.max(C,(Math.min(S.x+S.width,aa.x+aa.width)-Math.max(S.x,aa.x))/P),Q=10+Math.max(Q,+(Math.min(S.y+S.height,aa.y+aa.height)-Math.max(S.y,aa.y))/P))}}X?Q=0:C=0;for(Y=0;Y<W.length;Y++)if(Z=k.model.getTerminal(W[Y],!1),M==E(Z)&&(aa=k.view.getState(Z),Z!=I&&null!=aa&&(X&&g!=aa.getCenterX()<T.getCenterX()||!X&&g!=aa.getCenterY()<T.getCenterY()))){var ha=[];k.traverse(aa.cell,!0,function(ja,fa){var ma=null!=fa&&k.isTreeEdge(fa);ma&&ha.push(fa);(null==fa||ma)&&ha.push(ja);return null==fa||ma});k.moveCells(ha,(g?1:-1)*C,(g?1:-1)*Q)}}}return k.addCells(J,q)}finally{k.model.endUpdate()}}function K(I){k.model.beginUpdate();+try{var g=E(I),q=k.getIncomingTreeEdges(I),C=k.cloneCells([q[0],I]);k.model.setTerminal(q[0],C[1],!1);k.model.setTerminal(C[0],C[1],!0);k.model.setTerminal(C[0],I,!1);var J=k.model.getParent(I),M=J.geometry,Q=[];k.view.currentRoot!=J&&(C[1].geometry.x-=M.x,C[1].geometry.y-=M.y);k.traverse(I,!0,function(S,W){var X=null!=W&&k.isTreeEdge(W);X&&Q.push(W);(null==W||X)&&Q.push(S);return null==W||X});var T=I.geometry.width+40,P=I.geometry.height+40;g==mxConstants.DIRECTION_SOUTH?T=0:g==mxConstants.DIRECTION_NORTH?+(T=0,P=-P):g==mxConstants.DIRECTION_WEST?(T=-T,P=0):g==mxConstants.DIRECTION_EAST&&(P=0);k.moveCells(Q,T,P);return k.addCells(C,J)}finally{k.model.endUpdate()}}function L(I,g){k.model.beginUpdate();try{var q=k.model.getParent(I),C=k.getIncomingTreeEdges(I),J=E(I);0==C.length&&(C=[k.createEdge(q,null,"",null,null,k.createCurrentEdgeStyle())],J=g);var M=k.cloneCells([C[0],I]);k.model.setTerminal(M[0],I,!0);null==k.model.getTerminal(M[0],!1)&&(k.model.setTerminal(M[0],M[1],!1),k.applyNewEdgeStyle(M[1],+[M[0]],J));C=k.getOutgoingTreeEdges(I);var Q=q.geometry;g=[];k.view.currentRoot==q&&(Q=new mxRectangle);for(var T=0;T<C.length;T++){var P=k.model.getTerminal(C[T],!1);null!=P&&g.push(P)}var S=k.view.getBounds(g),W=k.view.translate,X=k.view.scale;J==mxConstants.DIRECTION_SOUTH?(M[1].geometry.x=null==S?I.geometry.x+(I.geometry.width-M[1].geometry.width)/2:(S.x+S.width)/X-W.x-Q.x+10,M[1].geometry.y+=M[1].geometry.height-Q.y+40):J==mxConstants.DIRECTION_NORTH?(M[1].geometry.x=null==S?I.geometry.x+(I.geometry.width-+M[1].geometry.width)/2:(S.x+S.width)/X-W.x+-Q.x+10,M[1].geometry.y-=M[1].geometry.height+Q.y+40):(M[1].geometry.x=J==mxConstants.DIRECTION_WEST?M[1].geometry.x-(M[1].geometry.width+Q.x+40):M[1].geometry.x+(M[1].geometry.width-Q.x+40),M[1].geometry.y=null==S?I.geometry.y+(I.geometry.height-M[1].geometry.height)/2:(S.y+S.height)/X-W.y+-Q.y+10);return k.addCells(M,q)}finally{k.model.endUpdate()}}function O(I,g,q){I=k.getOutgoingTreeEdges(I);q=k.view.getState(q);var C=[];if(null!=q&&null!=I){for(var J=+0;J<I.length;J++){var M=k.view.getState(k.model.getTerminal(I[J],!1));null!=M&&(!g&&Math.min(M.x+M.width,q.x+q.width)>=Math.max(M.x,q.x)||g&&Math.min(M.y+M.height,q.y+q.height)>=Math.max(M.y,q.y))&&C.push(M)}C.sort(function(Q,T){return g?Q.x+Q.width-T.x-T.width:Q.y+Q.height-T.y-T.height})}return C}function c(I,g){var q=E(I),C=g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST;(q==mxConstants.DIRECTION_EAST||q==mxConstants.DIRECTION_WEST)==C&&q!=g?d.actions.get("selectParent").funct():q==+g?(g=k.getOutgoingTreeEdges(I),null!=g&&0<g.length&&k.setSelectionCell(k.model.getTerminal(g[0],!1))):(q=k.getIncomingTreeEdges(I),null!=q&&0<q.length&&(C=O(k.model.getTerminal(q[0],!0),C,I),I=k.view.getState(I),null!=I&&(I=mxUtils.indexOf(C,I),0<=I&&(I+=g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_WEST?-1:1,0<=I&&I<=C.length-1&&k.setSelectionCell(C[I].cell)))))}var d=this,k=d.editor.graph,m=k.getModel(),t=d.menus.createPopupMenu;d.menus.createPopupMenu=function(I,g,q){t.apply(this,arguments);+if(1==k.getSelectionCount()){g=k.getSelectionCell();var C=k.getOutgoingTreeEdges(g);I.addSeparator();0<C.length&&(f(k.getSelectionCell())&&this.addMenuItems(I,["selectChildren"],null,q),this.addMenuItems(I,["selectDescendants"],null,q));f(k.getSelectionCell())?(I.addSeparator(),0<k.getIncomingTreeEdges(g).length&&this.addMenuItems(I,["selectSiblings","selectParent"],null,q)):0<k.model.getEdgeCount(g)&&this.addMenuItems(I,["selectConnections"],null,q)}};d.actions.addAction("selectChildren",function(I){if(k.isEnabled()&&+1==k.getSelectionCount()){var g=k.getSelectionCell();I=mxEvent.isControlDown(I)?null:k.getOutgoingTreeEdges(g);if(null!=I&&0<I.length){g=[];for(var q=0;q<I.length;q++)g.push(k.model.getTerminal(I[q],!1));k.setSelectionCells(g)}else k.setSelectionCells(k.model.getChildren(g))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");d.actions.addAction("selectDescendants",function(I){var g=k.getSelectionCell();if(k.isEnabled()&&null!=g){var q=[];mxEvent.isControlDown(I)||k.traverse(g,!0,function(C,J){var M=+null!=J&&k.isTreeEdge(J);M&&mxEvent.isControlDown(I)&&q.push(J);(null==J||M)&&q.push(C);return null==J||M});if(0==q.length||1==q.length&&q[0]==g)q=k.model.getDescendants(g);k.setSelectionCells(q)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");d.actions.addAction("selectParent",function(I){var g=k.getSelectionCell();k.isEnabled()&&null!=g&&(I=mxEvent.isControlDown(I)?null:k.getIncomingTreeEdges(g),null!=I&&0<I.length?k.setSelectionCell(k.model.getTerminal(I[0],!0)):k.selectParentCell())},null,+null,Editor.altKey+"+"+Editor.shiftKey+"+P");d.actions.addAction("selectSiblings",function(I){if(k.isEnabled()&&1==k.getSelectionCount()){var g=k.getSelectionCell(),q=mxEvent.isControlDown(I)?null:k.getIncomingTreeEdges(g);I=[];if(null!=q&&0<q.length&&(q=k.getOutgoingTreeEdges(k.model.getTerminal(q[0],!0)),null!=q))for(var C=0;C<q.length;C++)I.push(k.model.getTerminal(q[C],!1));0==I.length&&(I=k.model.getChildren(k.model.getParent(g)));k.setSelectionCells(I)}},null,null,Editor.altKey+"+"+Editor.shiftKey++"+S");var u=k.removeCells;k.removeCells=function(I,g){g=null!=g?g:!0;null==I&&(I=this.getDeletableCells(this.getSelectionCells()));g&&(I=this.getDeletableCells(this.addAllEdges(I)));for(var q=[],C=0;C<I.length;C++){var J=I[C];m.isEdge(J)&&z(J)&&(q.push(J),J=m.getTerminal(J,!1));if(f(J)){var M=[];k.traverse(J,!0,function(Q,T){var P=null!=T&&k.isTreeEdge(T);P&&M.push(T);(null==T||P)&&M.push(Q);return null==T||P});0<M.length&&(q=q.concat(M),J=k.getIncomingTreeEdges(I[C]),I=I.concat(J))}else null!=J&&+q.push(I[C])}I=q;return u.apply(this,arguments)};d.hoverIcons.getStateAt=function(I,g,q){return f(I.cell)?null:this.graph.view.getState(this.graph.getCellAt(g,q))};var A=k.duplicateCells;k.duplicateCells=function(I,g){I=null!=I?I:this.getSelectionCells();for(var q=I.slice(0),C=0;C<q.length;C++){var J=k.view.getState(q[C]);if(null!=J&&f(J.cell)){var M=k.getIncomingTreeEdges(J.cell);for(J=0;J<M.length;J++)mxUtils.remove(M[J],I)}}this.model.beginUpdate();try{var Q=A.call(this,I,g);if(Q.length==I.length)for(C=+0;C<I.length;C++)if(f(I[C])){var T=k.getIncomingTreeEdges(Q[C]);M=k.getIncomingTreeEdges(I[C]);if(0==T.length&&0<M.length){var P=this.cloneCell(M[0]);this.addEdge(P,k.getDefaultParent(),this.model.getTerminal(M[0],!0),Q[C])}}}finally{this.model.endUpdate()}return Q};var B=k.moveCells;k.moveCells=function(I,g,q,C,J,M,Q){for(var T=null,P=[],S=0;S<I.length;S++)(x(I[S])||f(I[S]))&&!y(I[S])&&this.isCellCollapsed(I[S])?P=P.concat(this.getSubtree(I[S])):P.push(I[S]);I=mxUtils.removeDuplicates(P);this.model.beginUpdate();+try{P=J;var W=this.getCurrentCellStyle(J);if(null!=I&&f(J)&&"1"==mxUtils.getValue(W,"treeFolding","0")){for(S=0;S<I.length;S++)if(f(I[S])||k.model.isEdge(I[S])&&null==k.model.getTerminal(I[S],!0)){J=k.model.getParent(I[S]);break}if(null!=P&&J!=P&&null!=this.view.getState(I[0])){var X=k.getIncomingTreeEdges(I[0]);if(0<X.length){var Y=k.view.getState(k.model.getTerminal(X[0],!0));if(null!=Y){var Z=k.view.getState(P);null!=Z&&(g=(Z.getCenterX()-Y.getCenterX())/k.view.scale,q=(Z.getCenterY()-Y.getCenterY())/+k.view.scale)}}}}T=B.apply(this,arguments);if(null!=T&&null!=I&&T.length==I.length)for(S=0;S<T.length;S++)if(this.model.isEdge(T[S]))f(P)&&0>mxUtils.indexOf(T,this.model.getTerminal(T[S],!0))&&this.model.setTerminal(T[S],P,!0);else if(f(I[S])&&(X=k.getIncomingTreeEdges(I[S]),0<X.length))if(!C)f(P)&&0>mxUtils.indexOf(I,this.model.getTerminal(X[0],!0))&&this.model.setTerminal(X[0],P,!0);else if(0==k.getIncomingTreeEdges(T[S]).length){W=P;if(null==W||W==k.model.getParent(I[S]))W=k.model.getTerminal(X[0],+!0);C=this.cloneCell(X[0]);this.addEdge(C,k.getDefaultParent(),W,T[S])}}finally{this.model.endUpdate()}return T};if(null!=d.sidebar){var D=d.sidebar.dropAndConnect;d.sidebar.dropAndConnect=function(I,g,q,C){var J=k.model,M=null;J.beginUpdate();try{if(M=D.apply(this,arguments),f(I))for(var Q=0;Q<M.length;Q++)if(J.isEdge(M[Q])&&null==J.getTerminal(M[Q],!0)){J.setTerminal(M[Q],I,!0);var T=k.getCellGeometry(M[Q]);T.points=null;null!=T.getTerminalPoint(!0)&&T.setTerminalPoint(null,!0)}}finally{J.endUpdate()}return M}}var N=+{67:d.actions.get("selectChildren"),88:d.actions.get("selectDescendants"),80:d.actions.get("selectParent"),83:d.actions.get("selectSiblings")},F={67:d.actions.get("copyStyle"),86:d.actions.get("pasteStyle")},U=d.onKeyDown;d.onKeyDown=function(I){try{var g=k.getSelectionCell();if(k.isEnabled()&&!k.isEditing()&&null!=g){var q=mxEvent.isAltDown(I)&&mxEvent.isShiftDown(I)?N[I.keyCode]:mxEvent.isAltDown(I)?F[I.keyCode]:null;null!=q?(q.funct(I),mxEvent.consume(I)):f(g)&&(q=null,0<k.getIncomingTreeEdges(g).length&&+(9==I.which?q=mxEvent.isShiftDown(I)?K(g):L(g):13==I.which&&(q=R(g,!mxEvent.isShiftDown(I)))),null!=q&&0<q.length?(1==q.length&&k.model.isEdge(q[0])?k.setSelectionCell(k.model.getTerminal(q[0],!1)):k.setSelectionCell(q[q.length-1]),null!=d.hoverIcons&&d.hoverIcons.update(k.view.getState(g)),k.startEditingAtCell(g),mxEvent.consume(I)):37==I.keyCode?(c(g,mxConstants.DIRECTION_WEST),mxEvent.consume(I)):38==I.keyCode?(c(g,mxConstants.DIRECTION_NORTH),mxEvent.consume(I)):39==I.keyCode?(c(g,mxConstants.DIRECTION_EAST),+mxEvent.consume(I)):40==I.keyCode&&(c(g,mxConstants.DIRECTION_SOUTH),mxEvent.consume(I)))}}catch(C){d.handleError(C)}mxEvent.isConsumed(I)||U.apply(this,arguments)};var V=k.connectVertex;k.connectVertex=function(I,g,q,C,J,M,Q){var T=k.getIncomingTreeEdges(I);if(f(I)){var P=E(I),S=P==mxConstants.DIRECTION_EAST||P==mxConstants.DIRECTION_WEST,W=g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST;return P==g||0==T.length?L(I,g):S==W?K(I):R(I,g!=mxConstants.DIRECTION_NORTH&&g!=mxConstants.DIRECTION_WEST)}return V.apply(this,+arguments)};k.getSubtree=function(I){var g=[I];!x(I)&&!f(I)||y(I)||k.traverse(I,!0,function(q,C){var J=null!=C&&k.isTreeEdge(C);J&&0>mxUtils.indexOf(g,C)&&g.push(C);(null==C||J)&&0>mxUtils.indexOf(g,q)&&g.push(q);return null==C||J});return g};var n=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){n.apply(this,arguments);(x(this.state.cell)||f(this.state.cell))&&!y(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(I){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(I),mxEvent.getClientY(I),-this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(I);this.graph.isMouseDown=!0;d.hoverIcons.reset();mxEvent.consume(I)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var u=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){u.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=+this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(I);this.graph.isMouseDown=!0;d.hoverIcons.reset();mxEvent.consume(I)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var v=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){v.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 G=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(I){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=I?"":"none")};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(I,g){H.apply(this,-arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var p=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var f=p.apply(this,arguments),x=this.graph,z=this;return f.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");y.vertex=!0;var F=new mxCell("Parent",-new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');F.vertex=!0;var O=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-K.geometry.relative=!0;K.edge=!0;F.insertEdge(K,!0);O.insertEdge(K,!1);y.insert(K);y.insert(F);y.insert(O);return z.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");y.vertex=!0;var F=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};');-F.vertex=!0;var O=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};');O.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-K.geometry.relative=!0;K.edge=!0;F.insertEdge(K,!0);O.insertEdge(K,!1);var L=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};');-L.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),K.style);M.geometry.relative=!0;M.edge=!0;F.insertEdge(M,!0);L.insertEdge(M,!1);var c=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};');-c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),K.style);d.geometry.relative=!0;d.edge=!0;F.insertEdge(d,!0);c.insertEdge(d,!1);var k=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};');-k.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),K.style);m.geometry.relative=!0;m.edge=!0;F.insertEdge(m,!0);k.insertEdge(m,!1);y.insert(K);y.insert(M);y.insert(d);y.insert(m);y.insert(F);y.insert(O);y.insert(L);y.insert(c);y.insert(k);return z.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=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;');+arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var p=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var f=p.apply(this,arguments),x=this.graph,z=this;return f.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");y.vertex=!0;var E=new mxCell("Parent",+new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');E.vertex=!0;var R=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');R.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+K.geometry.relative=!0;K.edge=!0;E.insertEdge(K,!0);R.insertEdge(K,!1);y.insert(K);y.insert(E);y.insert(R);return z.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");y.vertex=!0;var E=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};');+E.vertex=!0;var R=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};');R.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+K.geometry.relative=!0;K.edge=!0;E.insertEdge(K,!0);R.insertEdge(K,!1);var L=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};');+L.vertex=!0;var O=new mxCell("",new mxGeometry(0,0,0,0),K.style);O.geometry.relative=!0;O.edge=!0;E.insertEdge(O,!0);L.insertEdge(O,!1);var c=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};');+c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),K.style);d.geometry.relative=!0;d.edge=!0;E.insertEdge(d,!0);c.insertEdge(d,!1);var k=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};');+k.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),K.style);m.geometry.relative=!0;m.edge=!0;E.insertEdge(m,!0);k.insertEdge(m,!1);y.insert(K);y.insert(O);y.insert(d);y.insert(m);y.insert(E);y.insert(R);y.insert(L);y.insert(c);y.insert(k);return z.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=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;');y.vertex=!0;return z.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var y=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};');-y.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.setTerminalPoint(new mxPoint(-40,40),!0);F.geometry.relative=!0;F.edge=!0;y.insertEdge(F,!1);return z.createVertexTemplateFromCells([y,F],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var y=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};');y.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.setTerminalPoint(new mxPoint(-40,40),!0);F.geometry.relative=!0;F.edge=!0;y.insertEdge(F,!1);return z.createVertexTemplateFromCells([y,F],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree orgchart organization division",function(){var y=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var F=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"};');x.setAttributeForCell(F,"treeRoot","1");F.vertex=!0;var O=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"};');O.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-K.geometry.relative=!0;K.edge=!0;F.insertEdge(K,!0);O.insertEdge(K,!1);var L=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"};');L.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");M.geometry.relative=-!0;M.edge=!0;F.insertEdge(M,!0);L.insertEdge(M,!1);y.insert(K);y.insert(M);y.insert(F);y.insert(O);y.insert(L);return z.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree root",function(){var y=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"};');x.setAttributeForCell(y,"treeRoot","1");y.vertex=!0;return z.createVertexTemplateFromCells([y],-y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree division",function(){var y=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"};');y.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.setTerminalPoint(new mxPoint(0,0),!0);F.geometry.relative=!0;F.edge=!0;y.insertEdge(F,!1);return z.createVertexTemplateFromCells([y,F],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree sub sections",function(){var y=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");y.vertex=!0;var F=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;");-F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;y.insertEdge(F,!1);var O=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");O.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),F.style);K.geometry.setTerminalPoint(new mxPoint(110,-40),!0);K.geometry.relative=!0;K.edge=!0;O.insertEdge(K,!1);return z.createVertexTemplateFromCells([F,K,y,O],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;-EditorUi.initMinimalTheme=function(){function b(K,L){if(EditorUi.windowed){var M=K.editor.graph;M.popupMenuHandler.hideMenu();null==K.formatWindow?(K.formatWindow=new WrapperWindow(K,"",Math.max(10,K.diagramContainer.clientWidth-248),60,240,Math.min(600,M.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";K.createFormat(c).init()}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.formatWindow.window.setTitle(mxResources.get("format"))})),K.formatWindow.window.addListener(mxEvent.SHOW,+y.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");E.geometry.setTerminalPoint(new mxPoint(-40,40),!0);E.geometry.relative=!0;E.edge=!0;y.insertEdge(E,!1);return z.createVertexTemplateFromCells([y,E],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var y=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};');y.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+E.geometry.setTerminalPoint(new mxPoint(-40,40),!0);E.geometry.relative=!0;E.edge=!0;y.insertEdge(E,!1);return z.createVertexTemplateFromCells([y,E],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree orgchart organization division",function(){var y=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var E=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"};');x.setAttributeForCell(E,"treeRoot","1");E.vertex=!0;var R=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"};');R.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+K.geometry.relative=!0;K.edge=!0;E.insertEdge(K,!0);R.insertEdge(K,!1);var L=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"};');L.vertex=!0;var O=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");O.geometry.relative=+!0;O.edge=!0;E.insertEdge(O,!0);L.insertEdge(O,!1);y.insert(K);y.insert(O);y.insert(E);y.insert(R);y.insert(L);return z.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree root",function(){var y=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"};');x.setAttributeForCell(y,"treeRoot","1");y.vertex=!0;return z.createVertexTemplateFromCells([y],+y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree division",function(){var y=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"};');y.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+E.geometry.setTerminalPoint(new mxPoint(0,0),!0);E.geometry.relative=!0;E.edge=!0;y.insertEdge(E,!1);return z.createVertexTemplateFromCells([y,E],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree sub sections",function(){var y=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");y.vertex=!0;var E=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;");+E.geometry.setTerminalPoint(new mxPoint(110,-40),!0);E.geometry.relative=!0;E.edge=!0;y.insertEdge(E,!1);var R=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");R.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),E.style);K.geometry.setTerminalPoint(new mxPoint(110,-40),!0);K.geometry.relative=!0;K.edge=!0;R.insertEdge(K,!1);return z.createVertexTemplateFromCells([E,K,y,R],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+EditorUi.initMinimalTheme=function(){function b(K,L){if(EditorUi.windowed){var O=K.editor.graph;O.popupMenuHandler.hideMenu();null==K.formatWindow?(K.formatWindow=new WrapperWindow(K,"",Math.max(10,K.diagramContainer.clientWidth-248),60,240,Math.min(600,O.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";K.createFormat(c).init()}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.formatWindow.window.setTitle(mxResources.get("format"))})),K.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){K.formatWindow.window.fit()})),K.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):K.formatWindow.window.setVisible(null!=L?L:!K.formatWindow.window.isVisible())}else null==K.formatElt&&(K.formatElt=K.createSidebarContainer(),K.createFormat(K.formatElt).init(),K.formatElt.style.border="none",K.formatElt.style.width="240px",K.formatElt.style.borderLeftWidth="1px",K.formatElt.style.borderLeftStyle="solid",K.formatElt.style.right="0px"),L=K.diagramContainer.parentNode,-null!=K.formatElt.parentNode?(K.formatElt.parentNode.removeChild(K.formatElt),L.style.right="0px"):(L.parentNode.appendChild(K.formatElt),L.style.right=K.formatElt.style.width)}function l(K,L){if(EditorUi.windowed){var M=K.editor.graph;M.popupMenuHandler.hideMenu();null==K.sidebarWindow?(K.sidebarWindow=new WrapperWindow(K,"",10,56,Math.min(M.container.clientWidth-10,218)-6,Math.min(M.container.clientHeight-40,650)-6,function(c){K.createShapesPanel(c)}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),+null!=K.formatElt.parentNode?(K.formatElt.parentNode.removeChild(K.formatElt),L.style.right="0px"):(L.parentNode.appendChild(K.formatElt),L.style.right=K.formatElt.style.width)}function l(K,L){if(EditorUi.windowed){var O=K.editor.graph;O.popupMenuHandler.hideMenu();null==K.sidebarWindow?(K.sidebarWindow=new WrapperWindow(K,"",10,56,Math.min(O.container.clientWidth-10,218)-6,Math.min(O.container.clientHeight-40,650)-6,function(c){K.createShapesPanel(c)}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),K.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){K.sidebarWindow.window.fit()})),K.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),K.sidebarWindow.window.setVisible(!0),isLocalStorage&&K.getLocalData("sidebar",function(c){K.sidebar.showEntries(c,null,!0)}),K.restoreLibraries()):K.sidebarWindow.window.setVisible(null!=L?L:!K.sidebarWindow.window.isVisible())}else null==K.sidebarElt&&(K.sidebarElt=K.createSidebarContainer(),K.createShapesPanel(K.sidebarElt),K.sidebarElt.style.border="none",K.sidebarElt.style.width="210px",K.sidebarElt.style.borderRight="1px solid gray"),L=K.diagramContainer.parentNode,null!=K.sidebarElt.parentNode?(K.sidebarElt.parentNode.removeChild(K.sidebarElt),L.style.left="0px"):(L.parentNode.appendChild(K.sidebarElt),L.style.left=K.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var p=0;try{p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(K){}Menus.prototype.autoPopup=!1;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=@@ -14447,58 +14459,58 @@ document.body.clientWidth}catch(K){}Menus.prototype.autoPopup=!1;mxConstraintHanfunction(){return!1};Graph.prototype.isLightboxView=function(){return!1};var f=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){f.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var x=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(K,L){null!=L.shortcut&&900>p&&!mxClient.IS_IOS?K.firstChild.nextSibling.setAttribute("title",L.shortcut):x.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(K){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=K?K:!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 z=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();z.apply(this,arguments)};var y=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(K){y.apply(this,arguments);if(K){var L=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=L&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=L&&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(){};EditorUi.prototype.installFormatToolbar=-function(K){var L=this.editor.graph,M=document.createElement("div");M.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%;";L.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,d){0<L.getSelectionCount()?(K.appendChild(M),M.innerHTML="Selected: "+L.getSelectionCount()):null!=M.parentNode&&M.parentNode.removeChild(M)}))};var F=!1;EditorUi.prototype.initFormatWindow=-function(){if(!F&&null!=this.formatWindow){F=!0;var K=this.formatWindow.window.toggleMinimized,L=240;this.formatWindow.window.toggleMinimized=function(){K.apply(this,arguments);this.minimized?(L=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+L-140+"px"):(this.div.style.width=L+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-L+140)+"px");this.fit()};-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(M){mxEvent.getSource(M)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var O=EditorUi.prototype.init;EditorUi.prototype.init=function(){function K(B,J,Q){var N=k.menus.get(B);J=v.addMenu(mxResources.get(B),mxUtils.bind(this,function(){N.funct.apply(this,arguments)}));J.className="geButton";J.setAttribute("title",mxResources.get(B));k.menus.menuCreated(N,J,"geButton");null!=Q&&-(J.style.backgroundImage="url("+Q+")",J.innerText="");return J}function L(B,J,Q,N,S,P){var R=document.createElement("a");R.className="geButton";t.appendChild(R);null!=P?R.style.backgroundImage="url("+P+")":mxUtils.write(R,B);mxEvent.addListener(R,"click",function(W){"disabled"!=R.getAttribute("disabled")&&J(W);mxEvent.consume(W)});mxEvent.preventDefault(R);null!=N&&R.setAttribute("title",N);null!=S&&(B=function(){S.isEnabled()?R.removeAttribute("disabled"):R.setAttribute("disabled","disabled")},S.addListener("stateChanged",-B),m.addListener("enabledChanged",B),B());return R}function M(B,J,Q){J=document.createElement("div");J.className="geButtonGroup";for(Q=0;Q<B.length;Q++)null!=B[Q]&&J.appendChild(B[Q]);t.appendChild(J);return J}function c(){p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var B=0;"1"==urlParams.embed&&null!=k.buttonContainer&&(B=k.buttonContainer.offsetWidth||300);t.innerHTML="";var J=p<1E3+B,Q=K("diagram",null,J?Editor.menuImage:null);M([Q,L(mxResources.get("shapes"),-k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),k.actions.get("image"),J?Editor.shapesImage:null),L(mxResources.get("format"),k.actions.get("format").funct,null,mxResources.get("format")+" ("+k.actions.get("format").shortcut+")",k.actions.get("image"),J?Editor.formatImage:null)]);Q=K("insert",!0,J?U:null);M([Q,L(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),J?Editor.trashImage:null)]);m.isEnabled()||Q.setAttribute("disabled",-"disabled");I.setAttribute("title",mxResources.get("undo")+" ("+G.shortcut+")");g.setAttribute("title",mxResources.get("redo")+" ("+H.shortcut+")");q.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");p>=411+B&&(M([I,g]),p>=520+B&&M([q,p>=640+B?L("",n.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",n,Editor.zoomInImage):null,p>=640+B?L("",u.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",u,Editor.zoomOutImage):null]));t.appendChild(k.statusContainer);-t.appendChild(k.buttonContainer)}O.apply(this,arguments);var d=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=d&&(d.classList.add("geSimple"),d.classList.add("geMinimal"),d.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=p||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")));this.formatEnabled&&EditorUi.windowed&&1E3<=p&&(b(this,!0),this.formatWindow.window.setVisible(!0));var k=this,m=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));var t=document.createElement("div");t.className="geMenubarContainer";var v=new Menubar(k,t),A=k.hideCurrentMenu;k.hideCurrentMenu=function(){A.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var C=k.descriptorChanged;-k.descriptorChanged=function(){C.apply(this,arguments);var B=k.getCurrentFile();if(null!=B&&null!=B.getTitle()){var J=B.getMode();"google"==J?J="googleDrive":"github"==J?J="gitHub":"gitlab"==J?J="gitLab":"onedrive"==J&&(J="oneDrive");J=mxResources.get(J);t.setAttribute("title",B.getTitle()+(null!=J?" ("+J+")":""))}else t.removeAttribute("title")};k.setStatusText(k.editor.getStatus());t.appendChild(k.statusContainer);k.buttonContainer=this.createButtonContainer();t.appendChild(k.buttonContainer);k.menubarContainer=-k.buttonContainer;k.tabContainer=this.createTabContainer();var E=this.createZoomInput(!0),D=k.updateTabContainer;k.updateTabContainer=function(){D.apply(this,arguments);k.tabContainer.appendChild(E)};var U=Editor.addBoxImage;if(null!=k.hoverIcons){var T=k.hoverIcons.update;k.hoverIcons.update=function(){m.freehand.isDrawing()||T.apply(this,arguments)}}if(null!=m.freehand){var V=m.freehand.createStyle;m.freehand.createStyle=function(B){return V.apply(this,arguments)+"sketch=0;"}}k.editor.addListener("statusChanged",-mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));k.setStatusText(k.editor.getStatus());var n=k.actions.get("zoomIn"),u=k.actions.get("zoomOut");d=k.actions.get("resetView");var G=k.actions.get("undo"),H=k.actions.get("redo"),I=L("",G.funct,null,"",G,Editor.undoImage),g=L("",H.funct,null,"",H,Editor.redoImage),q=L("",function(B){mxEvent.isAltDown(B)?(k.hideCurrentMenu(),k.actions.get("customZoom").funct()):(k.hideCurrentMenu(),k.actions.get("smartFit").funct());mxEvent.consume(B)},+function(K){var L=this.editor.graph,O=document.createElement("div");O.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%;";L.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,d){0<L.getSelectionCount()?(K.appendChild(O),O.innerHTML="Selected: "+L.getSelectionCount()):null!=O.parentNode&&O.parentNode.removeChild(O)}))};var E=!1;EditorUi.prototype.initFormatWindow=+function(){if(!E&&null!=this.formatWindow){E=!0;var K=this.formatWindow.window.toggleMinimized,L=240;this.formatWindow.window.toggleMinimized=function(){K.apply(this,arguments);this.minimized?(L=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+L-140+"px"):(this.div.style.width=L+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-L+140)+"px");this.fit()};+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(O){mxEvent.getSource(O)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var R=EditorUi.prototype.init;EditorUi.prototype.init=function(){function K(C,J,M){var Q=k.menus.get(C);J=u.addMenu(mxResources.get(C),mxUtils.bind(this,function(){Q.funct.apply(this,arguments)}));J.className="geButton";J.setAttribute("title",mxResources.get(C));k.menus.menuCreated(Q,J,"geButton");null!=M&&+(J.style.backgroundImage="url("+M+")",J.innerText="");return J}function L(C,J,M,Q,T,P){var S=document.createElement("a");S.className="geButton";t.appendChild(S);null!=P?S.style.backgroundImage="url("+P+")":mxUtils.write(S,C);mxEvent.addListener(S,"click",function(W){"disabled"!=S.getAttribute("disabled")&&J(W);mxEvent.consume(W)});mxEvent.preventDefault(S);null!=Q&&S.setAttribute("title",Q);null!=T&&(C=function(){T.isEnabled()?S.removeAttribute("disabled"):S.setAttribute("disabled","disabled")},T.addListener("stateChanged",+C),m.addListener("enabledChanged",C),C());return S}function O(C,J,M){J=document.createElement("div");J.className="geButtonGroup";for(M=0;M<C.length;M++)null!=C[M]&&J.appendChild(C[M]);t.appendChild(J);return J}function c(){p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var C=0;"1"==urlParams.embed&&null!=k.buttonContainer&&(C=k.buttonContainer.offsetWidth||300);t.innerHTML="";var J=p<1E3+C,M=K("diagram",null,J?Editor.menuImage:null);O([M,L(mxResources.get("shapes"),+k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),k.actions.get("image"),J?Editor.shapesImage:null),L(mxResources.get("format"),k.actions.get("format").funct,null,mxResources.get("format")+" ("+k.actions.get("format").shortcut+")",k.actions.get("image"),J?Editor.formatImage:null)]);M=K("insert",!0,J?F:null);O([M,L(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),J?Editor.trashImage:null)]);m.isEnabled()||M.setAttribute("disabled",+"disabled");I.setAttribute("title",mxResources.get("undo")+" ("+G.shortcut+")");g.setAttribute("title",mxResources.get("redo")+" ("+H.shortcut+")");q.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");p>=411+C&&(O([I,g]),p>=520+C&&O([q,p>=640+C?L("",n.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",n,Editor.zoomInImage):null,p>=640+C?L("",v.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",v,Editor.zoomOutImage):null]));t.appendChild(k.statusContainer);+t.appendChild(k.buttonContainer)}R.apply(this,arguments);var d=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=d&&(d.classList.add("geSimple"),d.classList.add("geMinimal"),d.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=p||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")));this.formatEnabled&&EditorUi.windowed&&1E3<=p&&(b(this,!0),this.formatWindow.window.setVisible(!0));var k=this,m=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));var t=document.createElement("div");t.className="geMenubarContainer";var u=new Menubar(k,t),A=k.hideCurrentMenu;k.hideCurrentMenu=function(){A.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var B=k.descriptorChanged;+k.descriptorChanged=function(){B.apply(this,arguments);var C=k.getCurrentFile();if(null!=C&&null!=C.getTitle()){var J=C.getMode();"google"==J?J="googleDrive":"github"==J?J="gitHub":"gitlab"==J?J="gitLab":"onedrive"==J&&(J="oneDrive");J=mxResources.get(J);t.setAttribute("title",C.getTitle()+(null!=J?" ("+J+")":""))}else t.removeAttribute("title")};k.setStatusText(k.editor.getStatus());t.appendChild(k.statusContainer);k.buttonContainer=this.createButtonContainer();t.appendChild(k.buttonContainer);k.menubarContainer=+k.buttonContainer;k.tabContainer=this.createTabContainer();var D=this.createZoomInput(!0),N=k.updateTabContainer;k.updateTabContainer=function(){N.apply(this,arguments);k.tabContainer.appendChild(D)};var F=Editor.addBoxImage;if(null!=k.hoverIcons){var U=k.hoverIcons.update;k.hoverIcons.update=function(){m.freehand.isDrawing()||U.apply(this,arguments)}}if(null!=m.freehand){var V=m.freehand.createStyle;m.freehand.createStyle=function(C){return V.apply(this,arguments)+"sketch=0;"}}k.editor.addListener("statusChanged",+mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));k.setStatusText(k.editor.getStatus());var n=k.actions.get("zoomIn"),v=k.actions.get("zoomOut");d=k.actions.get("resetView");var G=k.actions.get("undo"),H=k.actions.get("redo"),I=L("",G.funct,null,"",G,Editor.undoImage),g=L("",H.funct,null,"",H,Editor.redoImage),q=L("",function(C){mxEvent.isAltDown(C)?(k.hideCurrentMenu(),k.actions.get("customZoom").funct()):(k.hideCurrentMenu(),k.actions.get("smartFit").funct());mxEvent.consume(C)},!0,"",d,Editor.zoomFitImage);k.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){l(k,null)});k.container.appendChild(k.tabContainer);k.container.appendChild(t);k.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=p&&b(this,!0);c();k.addListener("lockedChanged",c);k.addListener("languageChanged",c);k.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,"resize",function(){c();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.chatWindow&&k.menus.chatWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit();null!=k.menus.findReplaceWindow&&k.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var l=EditorUi.initTheme;EditorUi.initTheme=function(){l.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(f,x,z,y){var F=x.y,O=x.x,K=!1,L=!1;if(null!=this.states&&null!=f&&null!=x){var M=this,c=new mxCellState,d=this.graph.getView().scale,k=Math.max(2,this.getGuideTolerance()/2);c.x=f.x+O;c.y=f.y+F;c.width=f.width;c.height=f.height;for(var m=[],t=[],v=0;v<this.states.length;v++){var A=this.states[v];A instanceof mxCellState&&(y||!this.graph.isCellSelected(A.cell))&&((c.x>=A.x&&c.x<=A.x+A.width||A.x>=c.x&&A.x<=c.x+c.width)&&(c.y>-A.y+A.height+4||c.y+c.height+4<A.y)?m.push(A):(c.y>=A.y&&c.y<=A.y+A.height||A.y>=c.y&&A.y<=c.y+c.height)&&(c.x>A.x+A.width+4||c.x+c.width+4<A.x)&&t.push(A))}var C=0,E=0,D=A=0,U=0,T=0,V=0,n=0,u=5*d;if(1<m.length){m.push(c);m.sort(function(g,q){return g.y-q.y});var G=!1;v=c==m[0];d=c==m[m.length-1];if(!v&&!d)for(v=1;v<m.length-1;v++)if(c==m[v]){d=m[v-1];v=m[v+1];A=E=D=(v.y-d.y-d.height-c.height)/2;break}for(v=0;v<m.length-1;v++){d=m[v];var H=m[v+1],I=c==d||c==H;H=H.y-d.y-d.height;G|=c==d;if(0==E&&0==-C)E=H,C=1;else if(Math.abs(E-H)<=(I||1==v&&G?k:0))C+=1;else if(1<C&&G){m=m.slice(0,v+1);break}else if(3<=m.length-v&&!G)C=0,A=E=0!=D?D:0,m.splice(0,0==v?1:v),v=-1;else break;0!=A||I||(E=A=H)}3==m.length&&m[1]==c&&(A=0)}if(1<t.length){t.push(c);t.sort(function(g,q){return g.x-q.x});G=!1;v=c==t[0];d=c==t[t.length-1];if(!v&&!d)for(v=1;v<t.length-1;v++)if(c==t[v]){d=t[v-1];v=t[v+1];V=T=n=(v.x-d.x-d.width-c.width)/2;break}for(v=0;v<t.length-1;v++){d=t[v];H=t[v+1];I=c==d||c==H;H=H.x-d.x-d.width;G|=c==d;-if(0==T&&0==U)T=H,U=1;else if(Math.abs(T-H)<=(I||1==v&&G?k:0))U+=1;else if(1<U&&G){t=t.slice(0,v+1);break}else if(3<=t.length-v&&!G)U=0,V=T=0!=n?n:0,t.splice(0,0==v?1:v),v=-1;else break;0!=V||I||(T=V=H)}3==t.length&&t[1]==c&&(V=0)}k=function(g,q,B,J){var Q=[];if(J){J=u;var N=0}else J=0,N=u;Q.push(new mxPoint(g.x-J,g.y-N));Q.push(new mxPoint(g.x+J,g.y+N));Q.push(g);Q.push(q);Q.push(new mxPoint(q.x-J,q.y-N));Q.push(new mxPoint(q.x+J,q.y+N));if(null!=B)return B.points=Q,B;g=new mxPolyline(Q,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);g.dialect=mxConstants.DIALECT_SVG;g.pointerEvents=!1;g.init(M.graph.getView().getOverlayPane());return g};T=function(g,q){if(g&&null!=M.guidesArrHor)for(g=0;g<M.guidesArrHor.length;g++)M.guidesArrHor[g].node.style.visibility="hidden";if(q&&null!=M.guidesArrVer)for(g=0;g<M.guidesArrVer.length;g++)M.guidesArrVer[g].node.style.visibility="hidden"};if(1<U&&U==t.length-1){U=[];n=M.guidesArrHor;K=[];O=0;v=t[0]==c?1:0;G=t[v].y+t[v].height;if(0<V)for(v=0;v<t.length-1;v++)d=-t[v],H=t[v+1],c==d?(O=H.x-d.width-V,K.push(new mxPoint(O+d.width+u,G)),K.push(new mxPoint(H.x-u,G))):c==H?(K.push(new mxPoint(d.x+d.width+u,G)),O=d.x+d.width+V,K.push(new mxPoint(O-u,G))):(K.push(new mxPoint(d.x+d.width+u,G)),K.push(new mxPoint(H.x-u,G)));else d=t[0],v=t[2],O=d.x+d.width+(v.x-d.x-d.width-c.width)/2,K.push(new mxPoint(d.x+d.width+u,G)),K.push(new mxPoint(O-u,G)),K.push(new mxPoint(O+c.width+u,G)),K.push(new mxPoint(v.x-u,G));for(v=0;v<K.length;v+=2)t=K[v],V=K[v+1],t=k(t,V,null!=n?-n[v/2]:null),t.node.style.visibility="visible",t.redraw(),U.push(t);for(v=K.length/2;null!=n&&v<n.length;v++)n[v].destroy();M.guidesArrHor=U;O-=f.x;K=!0}else T(!0);if(1<C&&C==m.length-1){U=[];n=M.guidesArrVer;L=[];F=0;v=m[0]==c?1:0;C=m[v].x+m[v].width;if(0<A)for(v=0;v<m.length-1;v++)d=m[v],H=m[v+1],c==d?(F=H.y-d.height-A,L.push(new mxPoint(C,F+d.height+u)),L.push(new mxPoint(C,H.y-u))):c==H?(L.push(new mxPoint(C,d.y+d.height+u)),F=d.y+d.height+A,L.push(new mxPoint(C,F-u))):(L.push(new mxPoint(C,d.y+-d.height+u)),L.push(new mxPoint(C,H.y-u)));else d=m[0],v=m[2],F=d.y+d.height+(v.y-d.y-d.height-c.height)/2,L.push(new mxPoint(C,d.y+d.height+u)),L.push(new mxPoint(C,F-u)),L.push(new mxPoint(C,F+c.height+u)),L.push(new mxPoint(C,v.y-u));for(v=0;v<L.length;v+=2)t=L[v],V=L[v+1],t=k(t,V,null!=n?n[v/2]:null,!0),t.node.style.visibility="visible",t.redraw(),U.push(t);for(v=L.length/2;null!=n&&v<n.length;v++)n[v].destroy();M.guidesArrVer=U;F-=f.y;L=!0}else T(!1,!0)}if(K||L)return c=new mxPoint(O,F),m=b.call(this,-f,c,z,y),K&&!L?c.y=m.y:L&&!K&&(c.x=m.x),m.y!=c.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),m.x!=c.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),c;T(!0,!0);return b.apply(this,arguments)};var l=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(f){l.call(this,f);var x=this.guidesArrVer,z=this.guidesArrHor;if(null!=x)for(var y=0;y<x.length;y++)x[y].node.style.visibility=f?"visible":"hidden";if(null!=-z)for(y=0;y<z.length;y++)z[y].node.style.visibility=f?"visible":"hidden"};var p=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){p.call(this);var f=this.guidesArrVer,x=this.guidesArrHor;if(null!=f){for(var z=0;z<f.length;z++)f[z].destroy();this.guidesArrVer=null}if(null!=x){for(z=0;z<x.length;z++)x[z].destroy();this.guidesArrHor=null}}})();function mxRuler(b,l,p,f){function x(){var C=b.getDiagramContainerOffset(),E=b.diagramContainer;M.style.top=E.offsetTop-C.y+"px";M.style.left=E.offsetLeft-C.x+"px";M.style.width=(p?0:E.offsetWidth)+O+"px";M.style.height=(p?E.offsetHeight:0)+O+"px"}function z(C,E,D){if(null!=y)return C;var U;return function(){var T=this,V=arguments,n=D&&!U;clearTimeout(U);U=setTimeout(function(){U=null;D||C.apply(T,V)},E);n&&C.apply(T,V)}}var y=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||-window.msRequestAnimationFrame,F=window.cancelAnimationFrame||window.mozCancelAnimationFrame,O=this.RULER_THICKNESS,K=this;this.unit=l;var L=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},M=document.createElement("div");M.className="geRuler";M.style.position="fixed";this.updateStyle=mxUtils.bind(this,-function(){L=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};M.style[p?"borderRight":"borderBottom"]="0.5px solid "+L.strokeClr;M.style.borderLeft="0.5px solid "+L.strokeClr});this.updateStyle();b.diagramContainer.appendChild(M);mxEvent.disableContextMenu(M);this.editorUiRefresh=b.refresh;b.refresh=function(C){K.editorUiRefresh.apply(b,-arguments);x()};x();var c=document.createElement("canvas");c.width=M.offsetWidth;c.height=M.offsetHeight;M.style.overflow="hidden";c.style.position="relative";M.appendChild(c);var d=c.getContext("2d");this.ui=b;var k=b.editor.graph;this.graph=k;this.container=M;this.canvas=c;var m=function(C,E,D,U,T){C=Math.round(C);E=Math.round(E);D=Math.round(D);U=Math.round(U);d.beginPath();d.moveTo(C+.5,E+.5);d.lineTo(D+.5,U+.5);d.stroke();T&&(p?(d.save(),d.translate(C,E),d.rotate(-Math.PI/2),d.fillText(T,0,0),-d.restore()):d.fillText(T,C,E))},t=function(){d.clearRect(0,0,c.width,c.height);d.beginPath();d.lineWidth=.7;d.strokeStyle=L.strokeClr;d.setLineDash([]);d.font="9px Arial";d.textAlign="center";var C=k.view.scale,E=k.view.getBackgroundPageBounds(),D=k.view.translate,U=k.pageVisible;D=U?O+(p?E.y-k.container.scrollTop:E.x-k.container.scrollLeft):O+(p?D.y*C-k.container.scrollTop:D.x*C-k.container.scrollLeft);var T=0;U&&(T=k.getPageLayout(),T=p?T.y*k.pageFormat.height:T.x*k.pageFormat.width);var V;switch(K.unit){case mxConstants.POINTS:var n=-V=10;var u=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:V=10;n=mxConstants.PIXELS_PER_MM;u=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:V=20;n=mxConstants.PIXELS_PER_MM;u=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:V=.5>=C||4<=C?8:16,n=mxConstants.PIXELS_PER_INCH/V,u=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var G=n;2<=C?G=n/(2*Math.floor(C/2)):.5>=C&&(G=n*Math.floor(1/C/2)*(K.unit==mxConstants.MILLIMETERS?2:1));n=null;E=U?Math.min(D+(p?E.height:E.width),p?-c.height:c.width):p?c.height:c.width;if(U)if(d.fillStyle=L.outBkgClr,p){var H=D-O;0<H&&d.fillRect(0,O,O,H);E<c.height&&d.fillRect(0,E,O,c.height)}else H=D-O,0<H&&d.fillRect(O,0,H,O),E<c.width&&d.fillRect(E,0,c.width,O);d.fillStyle=L.fontClr;for(U=U?D:D%(G*C);U<=E;U+=G*C)if(H=Math.round((U-D)/C/G),!(U<O||H==n)){n=H;var I=null;0==H%V&&(I=K.formatText(T+H*G)+"");p?m(O-u[Math.abs(H)%V],U,O,U,I):m(U,O-u[Math.abs(H)%V],U,O,I)}d.lineWidth=1;m(p?0:O,p?O:0,O,O);d.fillStyle=L.cornerClr;d.fillRect(0,0,O,O)},-v=-1,A=function(){null!=y?(null!=F&&F(v),v=y(t)):t()};this.drawRuler=A;this.sizeListener=l=z(function(){var C=k.container;p?(C=C.offsetHeight+O,c.height!=C&&(c.height=C,M.style.height=C+"px",A())):(C=C.offsetWidth+O,c.width!=C&&(c.width=C,M.style.width=C+"px",A()))},10);this.pageListener=function(){A()};this.scrollListener=f=z(function(){var C=p?k.container.scrollTop:k.container.scrollLeft;K.lastScroll!=C&&(K.lastScroll=C,A())},10);this.unitListener=function(C,E){K.setUnit(E.getProperty("unit"))};-k.addListener(mxEvent.SIZE,l);k.container.addEventListener("scroll",f);k.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(C){L=C;M.style.background=L.bkgClr;t()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(C,E,D,U){if(p&&4<C.height||!p&&4<C.width){if(null!=K.guidePart)try{d.putImageData(K.guidePart.imgData1,-K.guidePart.x1,K.guidePart.y1),d.putImageData(K.guidePart.imgData2,K.guidePart.x2,K.guidePart.y2),d.putImageData(K.guidePart.imgData3,K.guidePart.x3,K.guidePart.y3)}catch(J){}var T=K.origGuideMove.apply(this,arguments);try{d.lineWidth=.5;d.strokeStyle=L.guideClr;d.setLineDash([2]);if(p){var V=C.y+T.y+O-this.graph.container.scrollTop;var n=0;var u=V+C.height/2;var G=O/2;var H=V+C.height;var I=0;var g=d.getImageData(n,V-1,O,3);m(n,V,O,V);V--;var q=d.getImageData(G,u-1,O,3);m(G,u,O,u);u--;var B=d.getImageData(I,-H-1,O,3);m(I,H,O,H);H--}else V=0,n=C.x+T.x+O-this.graph.container.scrollLeft,u=O/2,G=n+C.width/2,H=0,I=n+C.width,g=d.getImageData(n-1,V,3,O),m(n,V,n,O),n--,q=d.getImageData(G-1,u,3,O),m(G,u,G,O),G--,B=d.getImageData(I-1,H,3,O),m(I,H,I,O),I--;if(null==K.guidePart||K.guidePart.x1!=n||K.guidePart.y1!=V)K.guidePart={imgData1:g,x1:n,y1:V,imgData2:q,x2:G,y2:u,imgData3:B,x3:I,y3:H}}catch(J){}}else T=K.origGuideMove.apply(this,arguments);return T};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=-function(){var C=K.origGuideDestroy.apply(this,arguments);if(null!=K.guidePart)try{d.putImageData(K.guidePart.imgData1,K.guidePart.x1,K.guidePart.y1),d.putImageData(K.guidePart.imgData2,K.guidePart.x2,K.guidePart.y2),d.putImageData(K.guidePart.imgData3,K.guidePart.x3,K.guidePart.y3),K.guidePart=null}catch(E){}return C}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var l=EditorUi.initTheme;EditorUi.initTheme=function(){l.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(f,x,z,y){var E=x.y,R=x.x,K=!1,L=!1;if(null!=this.states&&null!=f&&null!=x){var O=this,c=new mxCellState,d=this.graph.getView().scale,k=Math.max(2,this.getGuideTolerance()/2);c.x=f.x+R;c.y=f.y+E;c.width=f.width;c.height=f.height;for(var m=[],t=[],u=0;u<this.states.length;u++){var A=this.states[u];A instanceof mxCellState&&(y||!this.graph.isCellSelected(A.cell))&&((c.x>=A.x&&c.x<=A.x+A.width||A.x>=c.x&&A.x<=c.x+c.width)&&(c.y>+A.y+A.height+4||c.y+c.height+4<A.y)?m.push(A):(c.y>=A.y&&c.y<=A.y+A.height||A.y>=c.y&&A.y<=c.y+c.height)&&(c.x>A.x+A.width+4||c.x+c.width+4<A.x)&&t.push(A))}var B=0,D=0,N=A=0,F=0,U=0,V=0,n=0,v=5*d;if(1<m.length){m.push(c);m.sort(function(g,q){return g.y-q.y});var G=!1;u=c==m[0];d=c==m[m.length-1];if(!u&&!d)for(u=1;u<m.length-1;u++)if(c==m[u]){d=m[u-1];u=m[u+1];A=D=N=(u.y-d.y-d.height-c.height)/2;break}for(u=0;u<m.length-1;u++){d=m[u];var H=m[u+1],I=c==d||c==H;H=H.y-d.y-d.height;G|=c==d;if(0==D&&0==+B)D=H,B=1;else if(Math.abs(D-H)<=(I||1==u&&G?k:0))B+=1;else if(1<B&&G){m=m.slice(0,u+1);break}else if(3<=m.length-u&&!G)B=0,A=D=0!=N?N:0,m.splice(0,0==u?1:u),u=-1;else break;0!=A||I||(D=A=H)}3==m.length&&m[1]==c&&(A=0)}if(1<t.length){t.push(c);t.sort(function(g,q){return g.x-q.x});G=!1;u=c==t[0];d=c==t[t.length-1];if(!u&&!d)for(u=1;u<t.length-1;u++)if(c==t[u]){d=t[u-1];u=t[u+1];V=U=n=(u.x-d.x-d.width-c.width)/2;break}for(u=0;u<t.length-1;u++){d=t[u];H=t[u+1];I=c==d||c==H;H=H.x-d.x-d.width;G|=c==d;+if(0==U&&0==F)U=H,F=1;else if(Math.abs(U-H)<=(I||1==u&&G?k:0))F+=1;else if(1<F&&G){t=t.slice(0,u+1);break}else if(3<=t.length-u&&!G)F=0,V=U=0!=n?n:0,t.splice(0,0==u?1:u),u=-1;else break;0!=V||I||(U=V=H)}3==t.length&&t[1]==c&&(V=0)}k=function(g,q,C,J){var M=[];if(J){J=v;var Q=0}else J=0,Q=v;M.push(new mxPoint(g.x-J,g.y-Q));M.push(new mxPoint(g.x+J,g.y+Q));M.push(g);M.push(q);M.push(new mxPoint(q.x-J,q.y-Q));M.push(new mxPoint(q.x+J,q.y+Q));if(null!=C)return C.points=M,C;g=new mxPolyline(M,mxConstants.GUIDE_COLOR,+mxConstants.GUIDE_STROKEWIDTH);g.dialect=mxConstants.DIALECT_SVG;g.pointerEvents=!1;g.init(O.graph.getView().getOverlayPane());return g};U=function(g,q){if(g&&null!=O.guidesArrHor)for(g=0;g<O.guidesArrHor.length;g++)O.guidesArrHor[g].node.style.visibility="hidden";if(q&&null!=O.guidesArrVer)for(g=0;g<O.guidesArrVer.length;g++)O.guidesArrVer[g].node.style.visibility="hidden"};if(1<F&&F==t.length-1){F=[];n=O.guidesArrHor;K=[];R=0;u=t[0]==c?1:0;G=t[u].y+t[u].height;if(0<V)for(u=0;u<t.length-1;u++)d=+t[u],H=t[u+1],c==d?(R=H.x-d.width-V,K.push(new mxPoint(R+d.width+v,G)),K.push(new mxPoint(H.x-v,G))):c==H?(K.push(new mxPoint(d.x+d.width+v,G)),R=d.x+d.width+V,K.push(new mxPoint(R-v,G))):(K.push(new mxPoint(d.x+d.width+v,G)),K.push(new mxPoint(H.x-v,G)));else d=t[0],u=t[2],R=d.x+d.width+(u.x-d.x-d.width-c.width)/2,K.push(new mxPoint(d.x+d.width+v,G)),K.push(new mxPoint(R-v,G)),K.push(new mxPoint(R+c.width+v,G)),K.push(new mxPoint(u.x-v,G));for(u=0;u<K.length;u+=2)t=K[u],V=K[u+1],t=k(t,V,null!=n?+n[u/2]:null),t.node.style.visibility="visible",t.redraw(),F.push(t);for(u=K.length/2;null!=n&&u<n.length;u++)n[u].destroy();O.guidesArrHor=F;R-=f.x;K=!0}else U(!0);if(1<B&&B==m.length-1){F=[];n=O.guidesArrVer;L=[];E=0;u=m[0]==c?1:0;B=m[u].x+m[u].width;if(0<A)for(u=0;u<m.length-1;u++)d=m[u],H=m[u+1],c==d?(E=H.y-d.height-A,L.push(new mxPoint(B,E+d.height+v)),L.push(new mxPoint(B,H.y-v))):c==H?(L.push(new mxPoint(B,d.y+d.height+v)),E=d.y+d.height+A,L.push(new mxPoint(B,E-v))):(L.push(new mxPoint(B,d.y++d.height+v)),L.push(new mxPoint(B,H.y-v)));else d=m[0],u=m[2],E=d.y+d.height+(u.y-d.y-d.height-c.height)/2,L.push(new mxPoint(B,d.y+d.height+v)),L.push(new mxPoint(B,E-v)),L.push(new mxPoint(B,E+c.height+v)),L.push(new mxPoint(B,u.y-v));for(u=0;u<L.length;u+=2)t=L[u],V=L[u+1],t=k(t,V,null!=n?n[u/2]:null,!0),t.node.style.visibility="visible",t.redraw(),F.push(t);for(u=L.length/2;null!=n&&u<n.length;u++)n[u].destroy();O.guidesArrVer=F;E-=f.y;L=!0}else U(!1,!0)}if(K||L)return c=new mxPoint(R,E),m=b.call(this,+f,c,z,y),K&&!L?c.y=m.y:L&&!K&&(c.x=m.x),m.y!=c.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),m.x!=c.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),c;U(!0,!0);return b.apply(this,arguments)};var l=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(f){l.call(this,f);var x=this.guidesArrVer,z=this.guidesArrHor;if(null!=x)for(var y=0;y<x.length;y++)x[y].node.style.visibility=f?"visible":"hidden";if(null!=+z)for(y=0;y<z.length;y++)z[y].node.style.visibility=f?"visible":"hidden"};var p=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){p.call(this);var f=this.guidesArrVer,x=this.guidesArrHor;if(null!=f){for(var z=0;z<f.length;z++)f[z].destroy();this.guidesArrVer=null}if(null!=x){for(z=0;z<x.length;z++)x[z].destroy();this.guidesArrHor=null}}})();function mxRuler(b,l,p,f){function x(){var B=b.getDiagramContainerOffset(),D=b.diagramContainer;O.style.top=D.offsetTop-B.y+"px";O.style.left=D.offsetLeft-B.x+"px";O.style.width=(p?0:D.offsetWidth)+R+"px";O.style.height=(p?D.offsetHeight:0)+R+"px"}function z(B,D,N){if(null!=y)return B;var F;return function(){var U=this,V=arguments,n=N&&!F;clearTimeout(F);F=setTimeout(function(){F=null;N||B.apply(U,V)},D);n&&B.apply(U,V)}}var y=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||+window.msRequestAnimationFrame,E=window.cancelAnimationFrame||window.mozCancelAnimationFrame,R=this.RULER_THICKNESS,K=this;this.unit=l;var L=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},O=document.createElement("div");O.className="geRuler";O.style.position="fixed";this.updateStyle=mxUtils.bind(this,+function(){L=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};O.style[p?"borderRight":"borderBottom"]="0.5px solid "+L.strokeClr;O.style.borderLeft="0.5px solid "+L.strokeClr});this.updateStyle();b.diagramContainer.appendChild(O);mxEvent.disableContextMenu(O);this.editorUiRefresh=b.refresh;b.refresh=function(B){K.editorUiRefresh.apply(b,+arguments);x()};x();var c=document.createElement("canvas");c.width=O.offsetWidth;c.height=O.offsetHeight;O.style.overflow="hidden";c.style.position="relative";O.appendChild(c);var d=c.getContext("2d");this.ui=b;var k=b.editor.graph;this.graph=k;this.container=O;this.canvas=c;var m=function(B,D,N,F,U){B=Math.round(B);D=Math.round(D);N=Math.round(N);F=Math.round(F);d.beginPath();d.moveTo(B+.5,D+.5);d.lineTo(N+.5,F+.5);d.stroke();U&&(p?(d.save(),d.translate(B,D),d.rotate(-Math.PI/2),d.fillText(U,0,0),+d.restore()):d.fillText(U,B,D))},t=function(){d.clearRect(0,0,c.width,c.height);d.beginPath();d.lineWidth=.7;d.strokeStyle=L.strokeClr;d.setLineDash([]);d.font="9px Arial";d.textAlign="center";var B=k.view.scale,D=k.view.getBackgroundPageBounds(),N=k.view.translate,F=k.pageVisible;N=F?R+(p?D.y-k.container.scrollTop:D.x-k.container.scrollLeft):R+(p?N.y*B-k.container.scrollTop:N.x*B-k.container.scrollLeft);var U=0;F&&(U=k.getPageLayout(),U=p?U.y*k.pageFormat.height:U.x*k.pageFormat.width);var V;switch(K.unit){case mxConstants.POINTS:var n=+V=10;var v=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:V=10;n=mxConstants.PIXELS_PER_MM;v=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:V=20;n=mxConstants.PIXELS_PER_MM;v=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:V=.5>=B||4<=B?8:16,n=mxConstants.PIXELS_PER_INCH/V,v=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var G=n;2<=B?G=n/(2*Math.floor(B/2)):.5>=B&&(G=n*Math.floor(1/B/2)*(K.unit==mxConstants.MILLIMETERS?2:1));n=null;D=F?Math.min(N+(p?D.height:D.width),p?+c.height:c.width):p?c.height:c.width;if(F)if(d.fillStyle=L.outBkgClr,p){var H=N-R;0<H&&d.fillRect(0,R,R,H);D<c.height&&d.fillRect(0,D,R,c.height)}else H=N-R,0<H&&d.fillRect(R,0,H,R),D<c.width&&d.fillRect(D,0,c.width,R);d.fillStyle=L.fontClr;for(F=F?N:N%(G*B);F<=D;F+=G*B)if(H=Math.round((F-N)/B/G),!(F<R||H==n)){n=H;var I=null;0==H%V&&(I=K.formatText(U+H*G)+"");p?m(R-v[Math.abs(H)%V],F,R,F,I):m(F,R-v[Math.abs(H)%V],F,R,I)}d.lineWidth=1;m(p?0:R,p?R:0,R,R);d.fillStyle=L.cornerClr;d.fillRect(0,0,R,R)},+u=-1,A=function(){null!=y?(null!=E&&E(u),u=y(t)):t()};this.drawRuler=A;this.sizeListener=l=z(function(){var B=k.container;p?(B=B.offsetHeight+R,c.height!=B&&(c.height=B,O.style.height=B+"px",A())):(B=B.offsetWidth+R,c.width!=B&&(c.width=B,O.style.width=B+"px",A()))},10);this.pageListener=function(){A()};this.scrollListener=f=z(function(){var B=p?k.container.scrollTop:k.container.scrollLeft;K.lastScroll!=B&&(K.lastScroll=B,A())},10);this.unitListener=function(B,D){K.setUnit(D.getProperty("unit"))};+k.addListener(mxEvent.SIZE,l);k.container.addEventListener("scroll",f);k.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(B){L=B;O.style.background=L.bkgClr;t()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(B,D,N,F){if(p&&4<B.height||!p&&4<B.width){if(null!=K.guidePart)try{d.putImageData(K.guidePart.imgData1,+K.guidePart.x1,K.guidePart.y1),d.putImageData(K.guidePart.imgData2,K.guidePart.x2,K.guidePart.y2),d.putImageData(K.guidePart.imgData3,K.guidePart.x3,K.guidePart.y3)}catch(J){}var U=K.origGuideMove.apply(this,arguments);try{d.lineWidth=.5;d.strokeStyle=L.guideClr;d.setLineDash([2]);if(p){var V=B.y+U.y+R-this.graph.container.scrollTop;var n=0;var v=V+B.height/2;var G=R/2;var H=V+B.height;var I=0;var g=d.getImageData(n,V-1,R,3);m(n,V,R,V);V--;var q=d.getImageData(G,v-1,R,3);m(G,v,R,v);v--;var C=d.getImageData(I,+H-1,R,3);m(I,H,R,H);H--}else V=0,n=B.x+U.x+R-this.graph.container.scrollLeft,v=R/2,G=n+B.width/2,H=0,I=n+B.width,g=d.getImageData(n-1,V,3,R),m(n,V,n,R),n--,q=d.getImageData(G-1,v,3,R),m(G,v,G,R),G--,C=d.getImageData(I-1,H,3,R),m(I,H,I,R),I--;if(null==K.guidePart||K.guidePart.x1!=n||K.guidePart.y1!=V)K.guidePart={imgData1:g,x1:n,y1:V,imgData2:q,x2:G,y2:v,imgData3:C,x3:I,y3:H}}catch(J){}}else U=K.origGuideMove.apply(this,arguments);return U};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=+function(){var B=K.origGuideDestroy.apply(this,arguments);if(null!=K.guidePart)try{d.putImageData(K.guidePart.imgData1,K.guidePart.x1,K.guidePart.y1),d.putImageData(K.guidePart.imgData2,K.guidePart.x2,K.guidePart.y2),d.putImageData(K.guidePart.imgData3,K.guidePart.x3,K.guidePart.y3),K.guidePart=null}catch(D){}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)};function mxDualRuler(b,l){var p=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return p};this.editorUiRefresh=b.refresh;this.ui=b;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(b,l,!0);this.hRuler=new mxRuler(b,l,!1,!0);l=mxUtils.bind(this,function(f){var x=!1;mxEvent.addGestureListeners(f,mxUtils.bind(this,function(z){x=null!=b.currentMenu;mxEvent.consume(z)}),null,mxUtils.bind(this,function(z){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(z)||mxEvent.isPopupTrigger(z))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(z)||!x){var y=new mxPopupMenu(mxUtils.bind(this,function(K,L){b.menus.addMenuItems(K,["points","inches","millimeters","meters"],L)}));y.smartSeparators=!0;y.showDisabled=!0;y.autoExpand=!0;y.hideMenu=mxUtils.bind(this,-function(){mxPopupMenu.prototype.hideMenu.apply(y,arguments);b.resetCurrentMenu();y.destroy()});var F=mxEvent.getClientX(z),O=mxEvent.getClientY(z);y.popup(F,O,null,z);b.setCurrentMenu(y,f)}mxEvent.consume(z)}}))});l(this.hRuler.container);l(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 l=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=l){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var p=mxFreehand.prototype.MILD_SMOOTHING,f=null,x=[],z,y=[],F,O=!1,K=!0,L=!0,M=!0,c=!0,d=[],k=!1,m=!1,t=!1,v="default",A={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},C=!0;this.setClosedPath=function(u){O=u};this.setAutoClose=function(u){K=u};this.setAutoInsert=-function(u){L=u};this.setAutoScroll=function(u){M=u};this.setOpenFill=function(u){c=u};this.setStopClickEnabled=function(u){m=u};this.setSelectInserted=function(u){t=u};this.setSmoothing=function(u){p=u};this.getSmoothing=function(){return p};this.setPerfectFreehandMode=function(u){C=u};this.isPerfectFreehandMode=function(){return C};this.setBrushSize=function(u){A.size=u};this.getBrushSize=function(){return A.size};var E=function(u){k=u;b.getRubberband().setEnabled(!u);b.graphHandler.setSelectEnabled(!u);-b.graphHandler.setMoveEnabled(!u);b.panningHandler.setPinchEnabled(!u);u?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){E(!0)};this.isDrawing=function(){return k};this.isActive=function(){return null!=f};var D=mxUtils.bind(this,function(u){if(f){var G=F.length,H=m&&0<y.length&&null!=F&&2>F.length;H||y.push.apply(y,F);F=[];y.push(null);x.push(f);f=null;(H||L)&&this.stopDrawing();-L&&(!H||2<=G)&&this.startDrawing();mxEvent.consume(u)}}),U=new mxCell;U.edge=!0;this.getStrokeColor=function(u){var G=null!=v?v:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(U),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=G||u||(G=b.shapeForegroundColor);return G};this.setStrokeColor=function(u){v=u};this.createStyle=function(u){var G=";fillColor=none;";C&&(G=";lineShape=1;");G+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+-"="+u+G};this.stopDrawing=function(){if(0<x.length){if(C){for(var u=[],G=0;G<y.length;G++)null!=y[G]&&u.push([y[G].x,y[G].y]);u=PerfectFreehand.getStroke(u,A);y=[];for(G=0;G<u.length;G++)y.push({x:u[G][0],y:u[G][1]});y.push(null)}u=y[0].x;var H=y[0].x,I=y[0].y,g=y[0].y;for(G=1;G<y.length;G++)null!=y[G]&&(u=Math.max(u,y[G].x),H=Math.min(H,y[G].x),I=Math.max(I,y[G].y),g=Math.min(g,y[G].y));u-=H;I-=g;if(0<u&&0<I){var q=100/u,B=100/I;y.map(function(P){if(null==P)return P;P.x=(P.x-H)*q;P.y=(P.y-g)*B;return P});-var J='<shape strokewidth="inherit"><foreground>',Q=0;for(G=0;G<y.length;G++){var N=y[G];if(null==N){N=!1;Q=y[Q];var S=y[G-1];!O&&K&&(N=Q.x-S.x,S=Q.y-S.y,N=Math.sqrt(N*N+S*S)<=b.tolerance);if(O||N)J+='<line x="'+Q.x.toFixed(2)+'" y="'+Q.y.toFixed(2)+'"/>';J+="</path>"+(c||O||N?"<fillstroke/>":"<stroke/>");Q=G+1}else J=G==Q?J+('<path><move x="'+N.x.toFixed(2)+'" y="'+N.y.toFixed(2)+'"/>'):J+('<line x="'+N.x.toFixed(2)+'" y="'+N.y.toFixed(2)+'"/>')}J+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){G=-this.createStyle("stencil("+Graph.compress(J)+")");J=b.view.scale;Q=b.view.translate;G=new mxCell("",new mxGeometry(H/J-Q.x,g/J-Q.y,u/J,I/J),G);G.vertex=1;b.model.beginUpdate();try{G=b.addCell(G),b.fireEvent(new mxEventObject("cellsInserted","cells",[G])),b.fireEvent(new mxEventObject("freehandInserted","cell",G))}finally{b.model.endUpdate()}t&&b.setSelectionCells([G])}}for(G=0;G<x.length;G++)x[G].parentNode.removeChild(x[G]);f=null;x=[];y=[]}E(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,-function(u,G){k&&G.getProperty("event").consume()}));b.addListener(mxEvent.GESTURE,mxUtils.bind(this,function(u,G){k&&mxEvent.consume(G.getProperty("event"))}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(u,G){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(u=G.getEvent(),k&&!mxEvent.isPopupTrigger(u)&&!mxEvent.isMiddleMouseButton(u)&&!mxEvent.isMultiTouchEvent(u))){var H=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);H=Math.max(1,H*b.view.scale);var I=this.getStrokeColor();-f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("fill",C?I:"none");f.setAttribute("pointer-events","none");f.setAttribute("stroke",I);f.setAttribute("stroke-width",H);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(I=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",I=I.split(" ").map(function(g){return parseFloat(g)*H}).join(" "),f.setAttribute("stroke-dasharray",I));d=[];u=T(u);V(u);z="M"+u.x+" "+u.y;y.push(u);F=[];f.setAttribute("d",C?PerfectFreehand.getSvgPathFromStroke([[u.x,-u.y]],A):z);l.appendChild(f);G.consume()}}),mouseMove:mxUtils.bind(this,function(u,G){if(null!=f&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){u=G.getEvent();u=T(u);V(u);var H=n(0);if(H)if(y.push(H),C){var I=[];for(H=0;H<y.length;H++)I.push([y[H].x,y[H].y]);F=[];for(var g=2;g<d.length;g+=2)H=n(g),I.push([H.x,H.y]),F.push(H);f.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(I,A))}else{z+=" L"+H.x+" "+H.y;I="";F=[];for(g=2;g<d.length;g+=2)H=n(g),I+=" L"+H.x+" "+H.y,F.push(H);f.setAttribute("d",-z+I)}M&&(H=b.view.translate,b.scrollRectToVisible((new mxRectangle(u.x-H.x,u.y-H.y)).grow(20)));G.consume()}}),mouseUp:mxUtils.bind(this,function(u,G){null!=f&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(D(G.getEvent()),G.consume())})});var T=function(u){return mxUtils.convertPoint(b.container,mxEvent.getClientX(u),mxEvent.getClientY(u))},V=function(u){for(d.push(u);d.length>p;)d.shift()},n=function(u){var G=d.length;if(1===G%2||G>=p){var H=0,I=0,g,q=0;for(g=u;g<G;g++)q++,u=d[g],H+=u.x,-I+=u.y;return{x:H/q,y:I/q}}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,l,p,f,x){this.id=b;this.email=l;this.displayName=p;this.pictureUrl=f;this.locale=x};DrawioComment=function(b,l,p,f,x,z,y){this.file=b;this.id=l;this.content=p;this.modifiedDate=f;this.createdDate=x;this.isResolved=z;this.user=y;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,l,p,f,x){l()};DrawioComment.prototype.editComment=function(b,l,p){l()};DrawioComment.prototype.deleteComment=function(b,l){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;+function(){mxPopupMenu.prototype.hideMenu.apply(y,arguments);b.resetCurrentMenu();y.destroy()});var E=mxEvent.getClientX(z),R=mxEvent.getClientY(z);y.popup(E,R,null,z);b.setCurrentMenu(y,f)}mxEvent.consume(z)}}))});l(this.hRuler.container);l(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 l=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=l){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var p=mxFreehand.prototype.MILD_SMOOTHING,f=null,x=[],z,y=[],E,R=!1,K=!0,L=!0,O=!0,c=!0,d=[],k=!1,m=!1,t=!1,u="default",A={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},B=!0;this.setClosedPath=function(v){R=v};this.setAutoClose=function(v){K=v};this.setAutoInsert=+function(v){L=v};this.setAutoScroll=function(v){O=v};this.setOpenFill=function(v){c=v};this.setStopClickEnabled=function(v){m=v};this.setSelectInserted=function(v){t=v};this.setSmoothing=function(v){p=v};this.getSmoothing=function(){return p};this.setPerfectFreehandMode=function(v){B=v};this.isPerfectFreehandMode=function(){return B};this.setBrushSize=function(v){A.size=v};this.getBrushSize=function(){return A.size};var D=function(v){k=v;b.getRubberband().setEnabled(!v);b.graphHandler.setSelectEnabled(!v);+b.graphHandler.setMoveEnabled(!v);b.panningHandler.setPinchEnabled(!v);v?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){D(!0)};this.isDrawing=function(){return k};this.isActive=function(){return null!=f};var N=mxUtils.bind(this,function(v){if(f){var G=E.length,H=m&&0<y.length&&null!=E&&2>E.length;H||y.push.apply(y,E);E=[];y.push(null);x.push(f);f=null;(H||L)&&this.stopDrawing();+L&&(!H||2<=G)&&this.startDrawing();mxEvent.consume(v)}}),F=new mxCell;F.edge=!0;this.getStrokeColor=function(v){var G=null!=u?u:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(F),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=G||v||(G=b.shapeForegroundColor);return G};this.setStrokeColor=function(v){u=v};this.createStyle=function(v){var G=";fillColor=none;";B&&(G=";lineShape=1;");G+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE++"="+v+G};this.stopDrawing=function(){if(0<x.length){if(B){for(var v=[],G=0;G<y.length;G++)null!=y[G]&&v.push([y[G].x,y[G].y]);v=PerfectFreehand.getStroke(v,A);y=[];for(G=0;G<v.length;G++)y.push({x:v[G][0],y:v[G][1]});y.push(null)}v=y[0].x;var H=y[0].x,I=y[0].y,g=y[0].y;for(G=1;G<y.length;G++)null!=y[G]&&(v=Math.max(v,y[G].x),H=Math.min(H,y[G].x),I=Math.max(I,y[G].y),g=Math.min(g,y[G].y));v-=H;I-=g;if(0<v&&0<I){var q=100/v,C=100/I;y.map(function(P){if(null==P)return P;P.x=(P.x-H)*q;P.y=(P.y-g)*C;return P});+var J='<shape strokewidth="inherit"><foreground>',M=0;for(G=0;G<y.length;G++){var Q=y[G];if(null==Q){Q=!1;M=y[M];var T=y[G-1];!R&&K&&(Q=M.x-T.x,T=M.y-T.y,Q=Math.sqrt(Q*Q+T*T)<=b.tolerance);if(R||Q)J+='<line x="'+M.x.toFixed(2)+'" y="'+M.y.toFixed(2)+'"/>';J+="</path>"+(c||R||Q?"<fillstroke/>":"<stroke/>");M=G+1}else J=G==M?J+('<path><move x="'+Q.x.toFixed(2)+'" y="'+Q.y.toFixed(2)+'"/>'):J+('<line x="'+Q.x.toFixed(2)+'" y="'+Q.y.toFixed(2)+'"/>')}J+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){G=+this.createStyle("stencil("+Graph.compress(J)+")");J=b.view.scale;M=b.view.translate;G=new mxCell("",new mxGeometry(H/J-M.x,g/J-M.y,v/J,I/J),G);G.vertex=1;b.model.beginUpdate();try{G=b.addCell(G),b.fireEvent(new mxEventObject("cellsInserted","cells",[G])),b.fireEvent(new mxEventObject("freehandInserted","cell",G))}finally{b.model.endUpdate()}t&&b.setSelectionCells([G])}}for(G=0;G<x.length;G++)x[G].parentNode.removeChild(x[G]);f=null;x=[];y=[]}D(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,+function(v,G){k&&G.getProperty("event").consume()}));b.addListener(mxEvent.GESTURE,mxUtils.bind(this,function(v,G){k&&mxEvent.consume(G.getProperty("event"))}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(v,G){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(v=G.getEvent(),k&&!mxEvent.isPopupTrigger(v)&&!mxEvent.isMiddleMouseButton(v)&&!mxEvent.isMultiTouchEvent(v))){var H=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);H=Math.max(1,H*b.view.scale);var I=this.getStrokeColor();+f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("fill",B?I:"none");f.setAttribute("pointer-events","none");f.setAttribute("stroke",I);f.setAttribute("stroke-width",H);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(I=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",I=I.split(" ").map(function(g){return parseFloat(g)*H}).join(" "),f.setAttribute("stroke-dasharray",I));d=[];v=U(v);V(v);z="M"+v.x+" "+v.y;y.push(v);E=[];f.setAttribute("d",B?PerfectFreehand.getSvgPathFromStroke([[v.x,+v.y]],A):z);l.appendChild(f);G.consume()}}),mouseMove:mxUtils.bind(this,function(v,G){if(null!=f&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){v=G.getEvent();v=U(v);V(v);var H=n(0);if(H)if(y.push(H),B){var I=[];for(H=0;H<y.length;H++)I.push([y[H].x,y[H].y]);E=[];for(var g=2;g<d.length;g+=2)H=n(g),I.push([H.x,H.y]),E.push(H);f.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(I,A))}else{z+=" L"+H.x+" "+H.y;I="";E=[];for(g=2;g<d.length;g+=2)H=n(g),I+=" L"+H.x+" "+H.y,E.push(H);f.setAttribute("d",+z+I)}O&&(H=b.view.translate,b.scrollRectToVisible((new mxRectangle(v.x-H.x,v.y-H.y)).grow(20)));G.consume()}}),mouseUp:mxUtils.bind(this,function(v,G){null!=f&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(N(G.getEvent()),G.consume())})});var U=function(v){return mxUtils.convertPoint(b.container,mxEvent.getClientX(v),mxEvent.getClientY(v))},V=function(v){for(d.push(v);d.length>p;)d.shift()},n=function(v){var G=d.length;if(1===G%2||G>=p){var H=0,I=0,g,q=0;for(g=v;g<G;g++)q++,v=d[g],H+=v.x,+I+=v.y;return{x:H/q,y:I/q}}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,l,p,f,x){this.id=b;this.email=l;this.displayName=p;this.pictureUrl=f;this.locale=x};DrawioComment=function(b,l,p,f,x,z,y){this.file=b;this.id=l;this.content=p;this.modifiedDate=f;this.createdDate=x;this.isResolved=z;this.user=y;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,l,p,f,x){l()};DrawioComment.prototype.editComment=function(b,l,p){l()};DrawioComment.prototype.deleteComment=function(b,l){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"];var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(g){return g.raw=g};$jscomp.createTemplateTagFirstArgWithRaw=function(g,C){g.raw=C;return g};$jscomp.arrayIteratorImpl=function(g){var C=0;return function(){return C<g.length?{done:!1,value:g[C++]}:{done:!0}}};$jscomp.arrayIterator=function(g){return{next:$jscomp.arrayIteratorImpl(g)}};$jscomp.makeIterator=function(g){var C="undefined"!=typeof Symbol&&Symbol.iterator&&g[Symbol.iterator];return C?C.call(g):$jscomp.arrayIterator(g)};$jscomp.arrayFromIterator=function(g){for(var C,E=[];!(C=g.next()).done;)E.push(C.value);return E};$jscomp.arrayFromIterable=function(g){return g instanceof Array?g:$jscomp.arrayFromIterator($jscomp.makeIterator(g))};$jscomp.owns=function(g,C){return Object.prototype.hasOwnProperty.call(g,C)};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;diff --git a/src/main/webapp/js/viewer-static.min.js b/src/main/webapp/js/viewer-static.min.jsindex fb3446a61..6d63af9ad 100644--- a/src/main/webapp/js/viewer-static.min.js+++ b/src/main/webapp/js/viewer-static.min.js@@ -31,7 +31,7 @@ b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io"))}})();"1"==urlPa"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:"29.6.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/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"29.6.5",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||@@ -171,7 +171,7 @@ a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;f[],e=0,f=0;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)||null==g.pointerId||d.push(g)}),mxUtils.bind(this,function(g){if(!mxEvent.isMouseEvent(g)&&2==d.length){for(var k=0;k<d.length;k++)if(g.pointerId==d[k].pointerId){d[k]=g;break}g=Math.abs(d[0].clientX-d[1].clientX);k=Math.abs(d[0].clientY-d[1].clientY);var l=Math.abs(g-e),m=Math.abs(k-f);if(l>mxEvent.PINCH_THRESHOLD||m>mxEvent.PINCH_THRESHOLD)a(d[0],l>m?g>e:k>f,!0,d[0].clientX+(d[1].clientX-d[0].clientX)/2,d[0].clientY+(d[1].clientY-d[0].clientY)/2),e=g,f=k}}),mxUtils.bind(this,function(g){d=[];f=e=0}))}mxEvent.addListener(b,"wheel",function(g){null==g&&(g=window.event);g.ctrlKey&&g.preventDefault();(.5<Math.abs(g.deltaX)||.5<Math.abs(g.deltaY))&&a(g,0==g.deltaY?0<-g.deltaX:0<-g.deltaY)})}},disableContextMenu:function(a){mxEvent.addListener(a,"contextmenu",function(b){b.preventDefault&&b.preventDefault();return!1})},getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.type&&0==a.type.indexOf("touch")},isPenEvent:function(a){return null!=a.pointerType?"pen"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_PEN:null!=a.type&&0==a.type.indexOf("pen")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&null!=a.touches&&1<a.touches.length},isMouseEvent:function(a){return!mxClient.IS_ANDROID&&-mxClient.IS_LINUX&&mxClient.IS_GC?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||+mxClient.IS_LINUX&&mxClient.IS_GC&&1>=navigator.maxTouchPoints?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){"touchstart"!=a.type&&"touchmove"!=a.type||null==a.touches||null==a.touches[0]?"touchend"==a.type&&null!=a.changedTouches&&null!=a.changedTouches[0]&&(a=a.changedTouches[0]):a=a.touches[0];return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},preventDefault:function(a){mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(b){b.preventDefault()}))},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CONNECT_HANDLE:-3,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1E5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",DOCK:"dock",UNDOCK:"undock",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",@@ -346,8 +346,8 @@ mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var r=this.createElement("text");r.setAttribute("x",this.format(a));r.setAttribute("y",this.format(b));r.setAttribute("w",this.format(c));r.setAttribute("h",this.format(d));r.setAttribute("str",e);null!=f&&r.setAttribute("align",f);null!=g&&r.setAttribute("valign",g);r.setAttribute("wrap",k?"1":"0");null==l&&(l="");r.setAttribute("format",l);null!=m&&r.setAttribute("overflow",m);null!=n&&r.setAttribute("clip",n?"1":"0");null!=p&&r.setAttribute("rotation",p);null!=q&&r.setAttribute("dir",q);this.root.appendChild(r)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};-function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):b.appendChild(this.defs)),-this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);+function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=this.viewTranslate=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):+b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.cacheOffsetSize=!0;mxSvgCanvas2D.prototype.allowConvertHtmlToSvg=!1;mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&a.setAttribute("style",b)};mxSvgCanvas2D.prototype.getLightDarkColor=function(a){return mxUtils.getLightDarkColor(a,null,null,"simple"==this.adaptiveColors)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};@@ -362,25 +362,25 @@ mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkCok.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement(e==mxConstants.DIRECTION_RADIAL?"radialGradient":"linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%");e=this.createElement("stop");e.setAttribute("offset","0%");e.setAttribute("stop-color",a.light);e.style.stopColor=a.cssText;e.setAttribute("stop-opacity",c);e.style.stopOpacity=c;f.appendChild(e);e=this.createElement("stop");e.setAttribute("offset","100%");e.setAttribute("stop-color",b.light);e.style.stopColor=b.cssText;e.setAttribute("stop-opacity",d);e.style.stopOpacity=d;f.appendChild(e);return f};-mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c){return("mx-pattern-"+a+"-"+b+"-"+c).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};-mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=-this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}return f.getAttribute("id")};-mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;-e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a=.5*a*c;c=this.format(1.5*(10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format((10+a)*c);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};+mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c,d){return("mx-pattern-"+a+"-"+b+"-"+c+"-"+Math.round(100*d)).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};+mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText,d),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=+this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}c=this.viewTranslate;b=null!=c?this.format(c.x*d):0;c=null!=c?this.format(c.y*d):0;f.setAttribute("patternTransform","translate("+b+","+c+")"+("dots"!==a?" rotate(45)":"")+" scale("+d+")");return f.getAttribute("id")};+mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");+d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a*=.5;c=this.format(1.5*(10+a));var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);+e.setAttribute("fill","none");d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format(10+a);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};mxSvgCanvas2D.prototype.addTitle=function(a){if(null!=a&&null!=this.title){var b=this.createElement("title");mxUtils.write(b,this.title);a.appendChild(b)}return a};mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,this.getCurrentStrokeWidth(),c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill",-"url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",+"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -460,7 +460,7 @@ mxShape.prototype.getShadowStyle=function(){var a={dx:mxConstants.SHADOW_OFFSET_a.color),a.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OPACITY,a.opacity));return a};mxShape.prototype.createDropShadow=function(a,b){var c=mxUtils.getLightDarkColor(a.color,a.opacity/100);return"drop-shadow("+Math.round(a.dx*b*100)/100+"px "+Math.round(a.dy*b*100)/100+"px "+Math.round(a.blur*b*100)/100+"px "+c.cssText+")"};mxShape.prototype.updateSvgFilters=function(a){this.node.style.filter=this.isShadowEnabled()?this.createDropShadow(this.getShadowStyle(),a):""};mxShape.prototype.isShadowEnabled=function(){return this.isShadow};mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.beforePaint(a),this.paint(a),this.afterPaint(a),this.destroyCanvas(a))};mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement&&(a=this.createSvgCanvas());null!=a&&this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){},a.image=function(){},a.text=function(){});return a};-mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};+mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;a.viewTranslate=this.viewTranslate;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity="+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var c=this.fill,d=this.gradient,e="0",f={east:0,south:1,west:2,north:3},g=null!=this.direction?f[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+f[this.gradientDirection]-1,4));1==g?(e="1",f=c,c=d,d=f):2==g?(f=c,c=d,d=f):3==g&&(e="1");b+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+c+"', endColorStr='"+d+"', gradientType='"+e+"')"}a.style.filter=b};@@ -482,10 +482,10 @@ mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=nu1,b.length)];l<b.length-2&&0==Math.round(m.x-g.x)&&0==Math.round(m.y-g.y);)m=b[mxUtils.mod(l+2,b.length)],l++;n=m.x-g.x;m=m.y-g.y;p=Math.max(1,Math.sqrt(n*n+m*m));n=g.x+n*Math.min(d,p/2)/p;m=g.y+m*Math.min(d,p/2)/p;a.quadTo(g.x,g.y,n,m);g=new mxPoint(n,m)}else a.lineTo(g.x,g.y);m=g;l++}e?a.close():a.lineTo(k.x,k.y)}};mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,-this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,this.fillStyle);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,-mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,-mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=-1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};+this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,null);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,+this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,+0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=1==mxUtils.getValue(this.style,+mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return!1};mxShape.prototype.getSvgBoundingBox=function(){var a=null;if(null!=this.node&&null!=this.node.ownerSVGElement)try{var b=this.node.getBBox();0<b.width&&0<b.height&&(a=new mxRectangle(b.x,b.y,b.width,b.height),null!=this.stroke&&a.grow(this.strokewidth*this.scale/2))}catch(c){}return a};mxShape.prototype.getShapeBoundingBox=function(){var a=null;if(null!=this.bounds&&(a=this.createBoundingBox(),null!=a)){this.augmentBoundingBox(a);var b=this.getShapeRotation();0!=b&&(a=mxUtils.getBoundingBox(a,b))}return a};mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a};mxShape.prototype.augmentBoundingBox=function(a){if(this.isShadow){var b=this.getShadowStyle();0>b.dx&&(a.x+=b.dx,a.width-=b.dx);0>b.dy&&(a.y+=b.dy,a.height-=b.dy);a.grow(Math.max(b.blur,0)*this.scale*2);a.width+=Math.ceil(Math.max(b.dx,0)*this.scale);a.height+=Math.ceil(Math.max(b.dy,0)*this.scale)}null!=this.stroke&&a.grow(this.strokewidth*this.scale/2)};@@ -1035,7 +1035,7 @@ mxCellRenderer.prototype.rotateLabelBounds=function(a,b,c,d,e){var f=null!=d?d:cvar g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(f==mxConstants.ALIGN_CENTER&&null==k?c.spacingLeft*d+c.spacingRight*d:0));b.height=Math.max(0,b.height-(g==mxConstants.ALIGN_MIDDLE?c.spacingTop*d+c.spacingBottom*d:0))}e=e?0:c.getTextRotation();0!=e&&null!=a&&a.view.graph.model.isVertex(a.cell)&&(c=a.getCenterX(),a=a.getCenterY(),b.x!=c||b.y!=a)&&(e*=Math.PI/180,a=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(e),Math.sin(e),new mxPoint(c,a)),b.x=a.x,b.y=a.y)};mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(g,k){g=k.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var l=g.getCenterX(),m=g.getCenterY();m=mxUtils.getRotatedPoint(new mxPoint(l,m),e,f,new mxPoint(a.getCenterX(),a.getCenterY()));l=m.x;m=m.y;g.x=Math.round(l--g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.redraw()})}};+g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.viewTranslate=a.view.translate,k.redraw()})}};mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+b*d,f=a.y+c*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var k=(a.width-a.height)/2;e+=k;f-=k}0!=g&&(k=mxUtils.toRadians(g),g=Math.cos(k),k=Math.sin(k),f=mxUtils.getRotatedPoint(new mxPoint(e,f),g,k,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};@@ -1044,8 +1044,8 @@ a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSiblinmxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))};mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a),this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a),-null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};-mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};+null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,a.shape.viewTranslate=a.view.translate,(null==c||c)&&this.doRedrawShape(a),e=!0);+return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));@@ -2007,99 +2007,99 @@ Editor.prototype.updateGraphComponents=function(){var b=this.graph;null!=b.contaEditor.prototype.createUndoManager=function(){var b=this.graph,d=new mxUndoManager;this.undoListener=function(n,v){d.undoableEditHappened(v.getProperty("edit"))};var m=mxUtils.bind(this,function(n,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,m);b.getView().addListener(mxEvent.UNDO,m);m=function(n,v){n=v.getProperty("edit").changes;n=b.getSelectionCellsForChanges(n);v=!1;if(0<n.length){for(var p=[],C=0;C<n.length;C++)null!=b.view.getState(n[C])&&(p.push(n[C]),v||(b.scrollCellToVisible(n[C]),v=!0));b.setSelectionCells(p)}};d.addListener(mxEvent.UNDO,m);d.addListener(mxEvent.REDO,m);return d};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,d,m,n,v,p,C,G,T,E,Q){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&document.body.appendChild(this.bg);v=b.createDiv(T?"geTransDialog":"geDialog");v.style.width=m+48+"px";v.style.height=n+48+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(d);document.body.appendChild(v);if(p&&(d=document.createElement("div"),-d.className="geButton",d.setAttribute("title",mxResources.get("close")),d.style.backgroundImage="url("+Editor.crossImage+")",d.style.position="absolute",d.style.top="0px",d.style.right="0px",mxEvent.addListener(d,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),v.appendChild(d),!Q)){var M=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){M=!0}),null,mxUtils.bind(this,function(c){M&&(b.hideDialog(!0),M=!1)}))}this.onDialogClose=C;this.container=v;null!=E&&this.addResizeHandler(E);+function Dialog(b,d,m,n,v,p,C,G,T,E,P){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&document.body.appendChild(this.bg);v=b.createDiv(T?"geTransDialog":"geDialog");v.style.width=m+48+"px";v.style.height=n+48+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(d);document.body.appendChild(v);if(p&&(d=document.createElement("div"),+d.className="geButton",d.setAttribute("title",mxResources.get("close")),d.style.backgroundImage="url("+Editor.crossImage+")",d.style.position="absolute",d.style.top="0px",d.style.right="0px",mxEvent.addListener(d,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),v.appendChild(d),!P)){var L=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){L=!0}),null,mxUtils.bind(this,function(c){L&&(b.hideDialog(!0),L=!1)}))}this.onDialogClose=C;this.container=v;null!=E&&this.addResizeHandler(E);b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";Dialog.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==";Dialog.prototype.clearImage="data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==";Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,d){return new mxPoint(b,d)};Dialog.prototype.addResizeHandler=function(b){var d=document.createElement("img");d.setAttribute("src",mxWindow.prototype.resizeImage);d.style.cursor="nwse-resize";d.style.position="absolute";d.style.bottom="0px";d.style.right="0px";d.style.zIndex="2";var m=null,n=null,v=null,p=null,C=mxUtils.bind(this,function(E){m=mxEvent.getClientX(E);n=mxEvent.getClientY(E);v=parseInt(this.container.style.width);p=parseInt(this.container.style.height);mxEvent.addGestureListeners(document,null,G,T);mxEvent.consume(E)}),-G=mxUtils.bind(this,function(E){if(null!=m&&null!=n){var Q=mxEvent.getClientX(E)-m,M=mxEvent.getClientY(E)-n;this.container.style.width=Math.max(b.width,v+2*Q)+"px";this.container.style.height=Math.max(b.height,p+2*M)+"px";mxEvent.consume(E)}}),T=mxUtils.bind(this,function(E){null!=m&&null!=n&&(n=m=null,mxEvent.removeGestureListeners(document,null,G,T),mxEvent.consume(E))});mxEvent.addGestureListeners(d,C,G,T);this.container.appendChild(d)};+G=mxUtils.bind(this,function(E){if(null!=m&&null!=n){var P=mxEvent.getClientX(E)-m,L=mxEvent.getClientY(E)-n;this.container.style.width=Math.max(b.width,v+2*P)+"px";this.container.style.height=Math.max(b.height,p+2*L)+"px";mxEvent.consume(E)}}),T=mxUtils.bind(this,function(E){null!=m&&null!=n&&(n=m=null,mxEvent.removeGestureListeners(document,null,G,T),mxEvent.consume(E))});mxEvent.addGestureListeners(d,C,G,T);this.container.appendChild(d)};Dialog.prototype.close=function(b,d){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,d))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,d,m,n,v,p,C,G,T,E,Q){T=null!=T?T:!0;var M=document.createElement("div");M.style.textAlign="center";M.style.flexDirection="column";M.style.maxHeight="100%";M.style.display="flex";if(null!=d){var c=document.createElement("div");c.style.padding="0px";c.style.margin="0px";c.style.fontSize="14px";c.style.fontWeight="600";c.style.paddingBottom="12px";c.style.marginBottom="10px";c.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";c.style.whiteSpace=-"nowrap";c.style.textOverflow="ellipsis";c.style.overflow="hidden";c.style.flexShrink="0";mxUtils.write(c,d);c.setAttribute("title",d);M.appendChild(c)}d=document.createElement("div");d.style.lineHeight="1.2em";d.style.padding="6px";d.style.flexGrow="1";d.style.overflowY="auto";"string"===typeof m&&(m=m.replace(/\n/g,"<br/>"));d.innerHTML=Graph.sanitizeHtml(m);M.appendChild(d);m=document.createElement("div");m.style.marginTop="12px";m.style.textAlign="center";null!=p&&(d=mxUtils.button(mxResources.get("tryAgain"),-function(){b.hideDialog();p()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=E&&(E=mxUtils.button(E,function(){null!=Q&&Q()}),E.className="geBtn",m.appendChild(E));var g=mxUtils.button(n,function(){T&&b.hideDialog();null!=v&&v()});g.className="geBtn";m.appendChild(g);null!=C&&(n=mxUtils.button(C,function(){T&&b.hideDialog();null!=G&&G()}),n.className="geBtn gePrimaryBtn",m.appendChild(n));this.init=function(){g.focus()};M.appendChild(m);this.container=M},PrintDialog=function(b,+var ErrorDialog=function(b,d,m,n,v,p,C,G,T,E,P){T=null!=T?T:!0;var L=document.createElement("div");L.style.textAlign="center";L.style.flexDirection="column";L.style.maxHeight="100%";L.style.display="flex";if(null!=d){var c=document.createElement("div");c.style.padding="0px";c.style.margin="0px";c.style.fontSize="14px";c.style.fontWeight="600";c.style.paddingBottom="12px";c.style.marginBottom="10px";c.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";c.style.whiteSpace=+"nowrap";c.style.textOverflow="ellipsis";c.style.overflow="hidden";c.style.flexShrink="0";mxUtils.write(c,d);c.setAttribute("title",d);L.appendChild(c)}d=document.createElement("div");d.style.lineHeight="1.2em";d.style.padding="6px";d.style.flexGrow="1";d.style.overflowY="auto";"string"===typeof m&&(m=m.replace(/\n/g,"<br/>"));d.innerHTML=Graph.sanitizeHtml(m);L.appendChild(d);m=document.createElement("div");m.style.marginTop="12px";m.style.textAlign="center";null!=p&&(d=mxUtils.button(mxResources.get("tryAgain"),+function(){b.hideDialog();p()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=E&&(E=mxUtils.button(E,function(){null!=P&&P()}),E.className="geBtn",m.appendChild(E));var g=mxUtils.button(n,function(){T&&b.hideDialog();null!=v&&v()});g.className="geBtn";m.appendChild(g);null!=C&&(n=mxUtils.button(C,function(){T&&b.hideDialog();null!=G&&G()}),n.className="geBtn gePrimaryBtn",m.appendChild(n));this.init=function(){g.focus()};L.appendChild(m);this.container=L},PrintDialog=function(b,d,m,n){this.create(b,d,m,n)};-PrintDialog.prototype.create=function(b){function d(g){var l=C.checked||E.checked,t=parseInt(M.value)/100;isNaN(t)&&(t=1,M.value="100%");mxClient.IS_SF&&(t*=.75);var B=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,D=1/m.pageScale;if(l){var I=C.checked?1:parseInt(Q.value);isNaN(I)||(D=mxUtils.getScaleForPageCount(I,m,B))}var L=I=0;B=mxRectangle.fromRectangle(B);B.width=Math.ceil(B.width*t);B.height=Math.ceil(B.height*t);D*=t;!l&&m.pageVisible?(t=m.getPageLayout(),I-=t.x*B.width,L-=t.y*B.height):-l=!0;l=PrintDialog.createPrintPreview(m,D,B,0,I,L,l);l.open();g&&PrintDialog.printPreview(l)}var m=b.editor.graph,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var C=document.createElement("input");C.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(C);var T=document.createElement("span");mxUtils.write(T," "+mxResources.get("fitPage"));+PrintDialog.prototype.create=function(b){function d(g){var l=C.checked||E.checked,t=parseInt(L.value)/100;isNaN(t)&&(t=1,L.value="100%");mxClient.IS_SF&&(t*=.75);var B=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,D=1/m.pageScale;if(l){var I=C.checked?1:parseInt(P.value);isNaN(I)||(D=mxUtils.getScaleForPageCount(I,m,B))}var K=I=0;B=mxRectangle.fromRectangle(B);B.width=Math.ceil(B.width*t);B.height=Math.ceil(B.height*t);D*=t;!l&&m.pageVisible?(t=m.getPageLayout(),I-=t.x*B.width,K-=t.y*B.height):+l=!0;l=PrintDialog.createPrintPreview(m,D,B,0,I,K,l);l.open();g&&PrintDialog.printPreview(l)}var m=b.editor.graph,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var C=document.createElement("input");C.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(C);var T=document.createElement("span");mxUtils.write(T," "+mxResources.get("fitPage"));G.appendChild(T);mxEvent.addListener(T,"click",function(g){C.checked=!C.checked;E.checked=!C.checked;mxEvent.consume(g)});mxEvent.addListener(C,"change",function(){E.checked=!C.checked});p.appendChild(G);v.appendChild(p);p=p.cloneNode(!1);var E=document.createElement("input");E.setAttribute("type","checkbox");G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(E);T=document.createElement("span");mxUtils.write(T," "+mxResources.get("posterPrint")+":");G.appendChild(T);mxEvent.addListener(T,-"click",function(g){E.checked=!E.checked;C.checked=!E.checked;mxEvent.consume(g)});p.appendChild(G);var Q=document.createElement("input");Q.setAttribute("value","1");Q.setAttribute("type","number");Q.setAttribute("min","1");Q.setAttribute("size","4");Q.setAttribute("disabled","disabled");Q.style.width="50px";G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(Q);mxUtils.write(G," "+mxResources.get("pages")+" (max)");p.appendChild(G);v.appendChild(p);mxEvent.addListener(E,"change",-function(){E.checked?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled");C.checked=!E.checked});p=p.cloneNode(!1);G=document.createElement("td");mxUtils.write(G,mxResources.get("pageScale")+":");p.appendChild(G);G=document.createElement("td");var M=document.createElement("input");M.setAttribute("value","100 %");M.setAttribute("size","5");M.style.width="50px";G.appendChild(M);p.appendChild(G);v.appendChild(p);p=document.createElement("tr");G=document.createElement("td");G.colSpan=2;+"click",function(g){E.checked=!E.checked;C.checked=!E.checked;mxEvent.consume(g)});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(E,"change",+function(){E.checked?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled");C.checked=!E.checked});p=p.cloneNode(!1);G=document.createElement("td");mxUtils.write(G,mxResources.get("pageScale")+":");p.appendChild(G);G=document.createElement("td");var L=document.createElement("input");L.setAttribute("value","100 %");L.setAttribute("size","5");L.style.width="50px";G.appendChild(L);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 c=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();d(!1)});c.className="geBtn";G.appendChild(c)}c=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();d(!0)});c.className="geBtn gePrimaryBtn";G.appendChild(c);b.editor.cancelFirst||G.appendChild(T);p.appendChild(G);v.appendChild(p);n.appendChild(v);this.container=n};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(d){}};PrintDialog.createPrintPreview=function(b,d,m,n,v,p,C){d=new mxPrintPreview(b,d,m,n,v,p);d.title=mxResources.get("preview");d.addPageCss=!mxClient.IS_SF;d.printBackgroundImage=!0;d.autoOrigin=C;C=b.background;if(null==C||""==C||C==mxConstants.NONE)C="#ffffff";d.backgroundColor=C;var G=d.isTextLabel;d.isTextLabel=function(E){return"geHint"==!E.className&&G.apply(this,arguments)};var T=d.getLinkForCellState;d.getLinkForCellState=function(E){return b.getAbsoluteUrl(T.apply(this,arguments))};return d};PrintDialog.previewEnabled=!0;-var PageSetupDialog=function(b){function d(){var t=M;null!=t&&null!=t.originalSrc&&(t=b.createImageForPageLink(t.originalSrc,null));null!=t&&null!=t.src?(Q.style.backgroundImage="url("+t.src+")",Q.style.display="inline-block"):(Q.style.backgroundImage="",Q.style.display="none");Q.style.backgroundColor="";null!=c&&c!=mxConstants.NONE&&(Q.style.backgroundColor=c,Q.style.display="inline-block")}var m=b.editor.graph,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var v=document.createElement("tbody");+var PageSetupDialog=function(b){function d(){var t=L;null!=t&&null!=t.originalSrc&&(t=b.createImageForPageLink(t.originalSrc,null));null!=t&&null!=t.src?(P.style.backgroundImage="url("+t.src+")",P.style.display="inline-block"):(P.style.backgroundImage="",P.style.display="none");P.style.backgroundColor="";null!=c&&c!=mxConstants.NONE&&(P.style.backgroundColor=c,P.style.display="inline-block")}var m=b.editor.graph,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var C=document.createElement("td");C.style.verticalAlign="top";C.style.fontSize="10pt";mxUtils.write(C,mxResources.get("paperSize")+":");p.appendChild(C);C=document.createElement("td");C.style.verticalAlign="top";C.style.fontSize="10pt";var G=PageSetupDialog.addPageFormatPanel(C,"pagesetupdialog",m.pageFormat);p.appendChild(C);v.appendChild(p);p=document.createElement("tr");C=document.createElement("td");mxUtils.write(C,mxResources.get("gridSize")+":");p.appendChild(C);C=document.createElement("td");C.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=m.getGridSize();C.appendChild(T);mxEvent.addListener(T,"change",function(){var t=parseInt(T.value);T.value=Math.max(1,isNaN(t)?m.getGridSize():t)});p.appendChild(C);v.appendChild(p);p=document.createElement("tr");C=document.createElement("td");mxUtils.write(C,mxResources.get("background")+":");-p.appendChild(C);C=document.createElement("td");var E=document.createElement("button");E.className="geBtn";E.style.margin="0px";mxUtils.write(E,mxResources.get("change")+"...");var Q=document.createElement("div");Q.style.display="inline-block";Q.style.verticalAlign="middle";Q.style.backgroundPosition="center center";Q.style.backgroundRepeat="no-repeat";Q.style.backgroundSize="contain";Q.style.border="1px solid lightGray";Q.style.borderRadius="4px";Q.style.marginRight="14px";Q.style.height="32px";-Q.style.width="64px";Q.style.cursor="pointer";Q.style.padding="4px";var M=m.backgroundImage,c=m.background,g=m.shadowVisible,l=function(t){b.showBackgroundImageDialog(function(B,D,I,L){D||(null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src}),M=B,g=L);c=I;d()},M,c,!0);mxEvent.consume(t)};mxEvent.addListener(E,"click",l);mxEvent.addListener(Q,"click",l);d();C.appendChild(Q);C.appendChild(E);p.appendChild(C);v.appendChild(p);p=document.createElement("tr");C=document.createElement("td");-C.colSpan=2;C.style.paddingTop="16px";C.setAttribute("align","right");E=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});E.className="geBtn";b.editor.cancelFirst&&C.appendChild(E);l=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var t=parseInt(T.value);isNaN(t)||m.gridSize===t||m.setGridSize(t);t=new ChangePageSetup(b,c,M,G.get());t.ignoreColor=m.background==c;t.ignoreImage=(null!=m.backgroundImage?m.backgroundImage.src:null)===(null!=M?M.src:null);null!=g&&+p.appendChild(C);C=document.createElement("td");var E=document.createElement("button");E.className="geBtn";E.style.margin="0px";mxUtils.write(E,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 L=m.backgroundImage,c=m.background,g=m.shadowVisible,l=function(t){b.showBackgroundImageDialog(function(B,D,I,K){D||(null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src}),L=B,g=K);c=I;d()},L,c,!0);mxEvent.consume(t)};mxEvent.addListener(E,"click",l);mxEvent.addListener(P,"click",l);d();C.appendChild(P);C.appendChild(E);p.appendChild(C);v.appendChild(p);p=document.createElement("tr");C=document.createElement("td");+C.colSpan=2;C.style.paddingTop="16px";C.setAttribute("align","right");E=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});E.className="geBtn";b.editor.cancelFirst&&C.appendChild(E);l=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var t=parseInt(T.value);isNaN(t)||m.gridSize===t||m.setGridSize(t);t=new ChangePageSetup(b,c,L,G.get());t.ignoreColor=m.background==c;t.ignoreImage=(null!=m.backgroundImage?m.backgroundImage.src:null)===(null!=L?L.src:null);null!=g&&(t.shadowVisible=g);m.pageFormat.width==t.previousFormat.width&&m.pageFormat.height==t.previousFormat.height&&t.ignoreColor&&t.ignoreImage&&t.shadowVisible==m.shadowVisible||m.model.execute(t)});l.className="geBtn gePrimaryBtn";C.appendChild(l);b.editor.cancelFirst||C.appendChild(E);p.appendChild(C);v.appendChild(p);n.appendChild(v);this.container=n};PageSetupDialog.addPageFormatPanel=function(b,d,m,n){d="format-"+d;var v=document.createElement("input");v.setAttribute("name",d);v.setAttribute("type","radio");v.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",d);p.setAttribute("type","radio");p.setAttribute("value","landscape");var C=document.createElement("select");C.style.position="relative";C.style.marginBottom="4px";C.style.borderRadius="4px";C.style.borderWidth="1px";C.style.borderStyle="solid";C.style.boxSizing="border-box";C.style.padding="2px";C.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);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));G.appendChild(d);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 E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.fontSize="12px";E.style.width="210px";E.style.height="24px";var Q=document.createElement("input");Q.setAttribute("size","6");Q.setAttribute("title",mxResources.get("width"));Q.style.textAlign="right";E.appendChild(Q);mxUtils.write(E," x ");var M=document.createElement("input");M.setAttribute("size","6");M.setAttribute("title",mxResources.get("height"));M.style.textAlign="right";E.appendChild(M);+mxResources.get("landscape"));G.appendChild(T);var E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.fontSize="12px";E.style.width="210px";E.style.height="24px";var P=document.createElement("input");P.setAttribute("size","6");P.setAttribute("title",mxResources.get("width"));P.style.textAlign="right";E.appendChild(P);mxUtils.write(E," x ");var L=document.createElement("input");L.setAttribute("size","6");L.setAttribute("title",mxResources.get("height"));L.style.textAlign="right";E.appendChild(L);var c=document.createElement("select");c.style.marginLeft="4px";c.style.boxSizing="border-box";for(var g=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],l=0;l<g.length;l++){var t=document.createElement("option");t.setAttribute("value",g[l].unit);mxUtils.write(t,g[l].label);c.appendChild(t)}c.value=Editor.pageSizeUnit;E.appendChild(c);G.style.display="none";E.style.display=-"none";var B={},D=PageSetupDialog.getFormats();for(l=0;l<D.length;l++)g=D[l],B[g.key]=g,t=document.createElement("option"),t.setAttribute("value",g.key),mxUtils.write(t,g.title),C.appendChild(t);var I=function(){C.value="custom";for(var N=0;N<D.length;N++){var K=D[N];null!=K.format&&("a4"==K.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==K.key&&(584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&-(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==K.format.width&&m.height==K.format.height?(C.value=K.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):m.width==K.format.height&&m.height==K.format.width&&(C.value=K.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==C.value?(Q.value=Editor.toUnit(m.width,-c.value),M.value=Editor.toUnit(m.height,c.value),v.setAttribute("checked","checked"),C.value="custom",G.style.display="none",E.style.display=""):(G.style.display="",E.style.display="none")};I();b.appendChild(C);mxUtils.br(b);b.appendChild(G);b.appendChild(E);var L=function(N,K){N=B[C.value];null!=N.format?(Q.value=Editor.toUnit(p.checked?N.format.height:N.format.width,c.value),M.value=Editor.toUnit(p.checked?N.format.width:N.format.height,c.value),E.style.display="none",G.style.display=""):(G.style.display=-"none",E.style.display="");N=parseFloat(Q.value);if(isNaN(N)||0>=N)Q.value=Editor.toUnit(m.width,c.value);N=parseFloat(M.value);if(isNaN(N)||0>=N)M.value=Editor.toUnit(m.height,c.value);N=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(Q.value),c.value)),Math.floor(Editor.fromUnit(parseFloat(M.value),c.value)));K||N.width==m.width&&N.height==m.height||(m=N,null!=n&&n(m))};mxEvent.addListener(d,"click",function(N){v.checked=!0;L(N);mxEvent.consume(N)});mxEvent.addListener(T,"click",function(N){p.checked=-!0;L(N);mxEvent.consume(N)});mxEvent.addListener(Q,"blur",L);mxEvent.addListener(Q,"click",L);mxEvent.addListener(M,"blur",L);mxEvent.addListener(M,"click",L);mxEvent.addListener(p,"change",L);mxEvent.addListener(v,"change",L);mxEvent.addListener(C,"change",function(N){L(N,"custom"==C.value);mxEvent.consume(N)});mxEvent.addListener(c,"change",function(N){Q.value=Editor.toUnit(Editor.fromUnit(Q.value,Editor.pageSizeUnit),c.value);M.value=Editor.toUnit(Editor.fromUnit(M.value,Editor.pageSizeUnit),c.value);-Editor.pageSizeUnit=c.value;L(N,!0);mxEvent.consume(N)});L(null,!0);return{set:function(N){m=N;I(null,null,!0)},get:function(){return m},widthInput:Q,heightInput:M}};+"none";var B={},D=PageSetupDialog.getFormats();for(l=0;l<D.length;l++)g=D[l],B[g.key]=g,t=document.createElement("option"),t.setAttribute("value",g.key),mxUtils.write(t,g.title),C.appendChild(t);var I=function(){C.value="custom";for(var M=0;M<D.length;M++){var V=D[M];null!=V.format&&("a4"==V.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==V.key&&(584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&+(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==V.format.width&&m.height==V.format.height?(C.value=V.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):m.width==V.format.height&&m.height==V.format.width&&(C.value=V.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==C.value?(P.value=Editor.toUnit(m.width,+c.value),L.value=Editor.toUnit(m.height,c.value),v.setAttribute("checked","checked"),C.value="custom",G.style.display="none",E.style.display=""):(G.style.display="",E.style.display="none")};I();b.appendChild(C);mxUtils.br(b);b.appendChild(G);b.appendChild(E);var K=function(M,V){M=B[C.value];null!=M.format?(P.value=Editor.toUnit(p.checked?M.format.height:M.format.width,c.value),L.value=Editor.toUnit(p.checked?M.format.width:M.format.height,c.value),E.style.display="none",G.style.display=""):(G.style.display=+"none",E.style.display="");M=parseFloat(P.value);if(isNaN(M)||0>=M)P.value=Editor.toUnit(m.width,c.value);M=parseFloat(L.value);if(isNaN(M)||0>=M)L.value=Editor.toUnit(m.height,c.value);M=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(P.value),c.value)),Math.floor(Editor.fromUnit(parseFloat(L.value),c.value)));V||M.width==m.width&&M.height==m.height||(m=M,null!=n&&n(m))};mxEvent.addListener(d,"click",function(M){v.checked=!0;K(M);mxEvent.consume(M)});mxEvent.addListener(T,"click",function(M){p.checked=+!0;K(M);mxEvent.consume(M)});mxEvent.addListener(P,"blur",K);mxEvent.addListener(P,"click",K);mxEvent.addListener(L,"blur",K);mxEvent.addListener(L,"click",K);mxEvent.addListener(p,"change",K);mxEvent.addListener(v,"change",K);mxEvent.addListener(C,"change",function(M){K(M,"custom"==C.value);mxEvent.consume(M)});mxEvent.addListener(c,"change",function(M){P.value=Editor.toUnit(Editor.fromUnit(P.value,Editor.pageSizeUnit),c.value);L.value=Editor.toUnit(Editor.fromUnit(L.value,Editor.pageSizeUnit),c.value);+Editor.pageSizeUnit=c.value;K(M,!0);mxEvent.consume(M)});K(null,!0);return{set:function(M){m=M;I(null,null,!0)},get:function(){return m},widthInput:P,heightInput:L}};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,d,m,n,v,p,C,G,T,E,Q){T=null!=T?T:!0;var M=document.createElement("div"),c=document.createElement("div");c.style.width="100%";c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoColumns="auto 1fr";c.style.boxSizing="border-box";c.style.padding="3px";var g=document.createElement("div");g.style.display="inline-flex";g.style.alignItems="center";g.style.justifyContent="flex-end";g.style.minWidth="0";var l=document.createElement("div");l.style.display="inline-block";+var FilenameDialog=function(b,d,m,n,v,p,C,G,T,E,P){T=null!=T?T:!0;var L=document.createElement("div"),c=document.createElement("div");c.style.width="100%";c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoColumns="auto 1fr";c.style.boxSizing="border-box";c.style.padding="3px";var g=document.createElement("div");g.style.display="inline-flex";g.style.alignItems="center";g.style.justifyContent="flex-end";g.style.minWidth="0";var l=document.createElement("div");l.style.display="inline-block";l.style.textOverflow="ellipsis";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.fontSize="10pt";l.style.padding="2px 0";l.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(l,(v||mxResources.get("filename"))+":");g.appendChild(l);c.appendChild(g);var t=document.createElement("input");t.setAttribute("value",d||"");t.style.flexGrow="1";var B=mxUtils.button(m,function(){if(null==p||p(t.value))T&&b.hideDialog(),n(t.value)});B.className="geBtn gePrimaryBtn";this.init=function(){if(null!=-v||null==C)if(null!=Q?Editor.selectFilename(t):(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var D=c.parentNode;if(null!=D){var I=null;mxEvent.addListener(D,"dragleave",function(L){null!=I&&(I.style.backgroundColor="",I=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(L){null==I&&(!mxClient.IS_IE||10<document.documentMode)&&(I=t,I.style.backgroundColor=-"#ebf2f9");L.stopPropagation();L.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(L){null!=I&&(I.style.backgroundColor="",I=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(t.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),B.click());L.stopPropagation();L.preventDefault()}))}}};g=document.createElement("div");g.style.display="inline-flex";g.style.alignItems="center";g.style.gap="4px";g.style.whiteSpace="nowrap";g.appendChild(t);c.appendChild(g);-null==v&&null!=C||null==Q||null==b.editor.diagramFileTypes||(g=document.createElement("div"),g.style.display="inline-flex",g.style.alignItems="center",g.style.textOverflow="ellipsis",g.style.justifyContent="flex-end",g.style.fontSize="10pt",mxUtils.write(g,mxResources.get("type")+":"),c.appendChild(g),g=document.createElement("div"),g.style.display="inline-flex",g.style.alignItems="center",g.style.whiteSpace="nowrap",c.appendChild(g),d=FilenameDialog.createFileTypes(b,t,b.editor.diagramFileTypes),-d.style.width="100%",g.appendChild(d));null!=C&&c.appendChild(C);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=Q?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=E&&E()});g.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));-b.editor.cancelFirst&&row.appendChild(g);mxEvent.addListener(t,"keypress",function(D){13==D.keyCode&&B.click()});row.appendChild(B);b.editor.cancelFirst||row.appendChild(g);c.appendChild(row);M.appendChild(c);this.container=M};FilenameDialog.filenameHelpLink=null;+v||null==C)if(null!=P?Editor.selectFilename(t):(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var D=c.parentNode;if(null!=D){var I=null;mxEvent.addListener(D,"dragleave",function(K){null!=I&&(I.style.backgroundColor="",I=null);K.stopPropagation();K.preventDefault()});mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(K){null==I&&(!mxClient.IS_IE||10<document.documentMode)&&(I=t,I.style.backgroundColor=+"#ebf2f9");K.stopPropagation();K.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(K){null!=I&&(I.style.backgroundColor="",I=null);0<=mxUtils.indexOf(K.dataTransfer.types,"text/uri-list")&&(t.value=decodeURIComponent(K.dataTransfer.getData("text/uri-list")),B.click());K.stopPropagation();K.preventDefault()}))}}};g=document.createElement("div");g.style.display="inline-flex";g.style.alignItems="center";g.style.gap="4px";g.style.whiteSpace="nowrap";g.appendChild(t);c.appendChild(g);+null==v&&null!=C||null==P||null==b.editor.diagramFileTypes||(g=document.createElement("div"),g.style.display="inline-flex",g.style.alignItems="center",g.style.textOverflow="ellipsis",g.style.justifyContent="flex-end",g.style.fontSize="10pt",mxUtils.write(g,mxResources.get("type")+":"),c.appendChild(g),g=document.createElement("div"),g.style.display="inline-flex",g.style.alignItems="center",g.style.whiteSpace="nowrap",c.appendChild(g),d=FilenameDialog.createFileTypes(b,t,b.editor.diagramFileTypes),+d.style.width="100%",g.appendChild(d));null!=C&&c.appendChild(C);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");g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=E&&E()});g.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));+b.editor.cancelFirst&&row.appendChild(g);mxEvent.addListener(t,"keypress",function(D){13==D.keyCode&&B.click()});row.appendChild(B);b.editor.cancelFirst||row.appendChild(g);c.appendChild(row);L.appendChild(c);this.container=L};FilenameDialog.filenameHelpLink=null;FilenameDialog.createFileTypes=function(b,d,m){var n=document.createElement("select");for(b=0;b<m.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(m[b].description)+" (."+m[b].extension+")");n.appendChild(v)}mxEvent.addListener(n,"change",function(p){p=m[n.value].extension;var C=d.value.lastIndexOf(".drawio.");C=0<C?C:d.value.lastIndexOf(".");"drawio"!=p&&(p="drawio."+p);d.value=0<C?d.value.substring(0,C+1)+p:d.value+"."+p;"createEvent"indocument?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),d.dispatchEvent(p)):d.fireEvent("onchange")});b=function(p){p=d.value.toLowerCase();for(var C=0,G=0;G<m.length;G++){var T=m[G].extension,E=null;"drawio"!=T&&(E=T,T=".drawio."+T);if(p.substring(p.length-T.length-1)=="."+T||null!=E&&p.substring(p.length-E.length-1)=="."+E){C=G;break}}n.value=C};mxEvent.addListener(d,"change",b);mxEvent.addListener(d,"keyup",b);b();return n};var WrapperWindow=function(b,d,m,n,v,p,C,G){G=null!=G?G:document.createElement("div");this.window=new mxWindow(d,G,m,n,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);C(G)};(function(){mxGraphView.prototype.validateBackgroundPage=function(){var C=this.graph;if(null!=C.container&&!C.transparentBackground){if(C.pageVisible){var G=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var T=C.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(C.container),T.style.position="absolute",C.container.insertBefore(this.backgroundPageShape.node,T),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(E){C.dblClick(E)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(E){C.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(E))}),mxUtils.bind(this,function(E){null!=C.tooltipHandler&&C.tooltipHandler.isHideOnHover()&&C.tooltipHandler.hide();C.isMouseDown&&!mxEvent.isConsumed(E)&&C.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(E))}),mxUtils.bind(this,function(E){C.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(E))})))}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(C,G,T){var E=this.graph;C=null!=C?C:1;var Q=mxUtils.getLightDarkColor(null==E.background||E.background==mxConstants.NONE?E.defaultPageBackgroundColor:E.background).cssText,M=mxUtils.getLightDarkColor(E.defaultPageBorderColor).cssText,c=null!=Q&&this.gridColor!=Q.toLowerCase()?this.gridColor:"#ffffff",g="none",l="";"simple"==E.getAdaptiveColors()&&E.background!=mxConstants.NONE&&null!=E.background&&(Q=E.background);if(E.isGridEnabled()||E.gridVisible){l=+mxGraphView.prototype.validateBackgroundStyles=function(C,G,T){var E=this.graph;C=null!=C?C:1;var P=mxUtils.getLightDarkColor(null==E.background||E.background==mxConstants.NONE?E.defaultPageBackgroundColor:E.background).cssText,L=mxUtils.getLightDarkColor(E.defaultPageBorderColor).cssText,c=null!=P&&this.gridColor!=P.toLowerCase()?this.gridColor:"#ffffff",g="none",l="";"simple"==E.getAdaptiveColors()&&E.background!=mxConstants.NONE&&null!=E.background&&(P=E.background);if(E.isGridEnabled()||E.gridVisible){l=10;mxClient.IS_SVG?(g=unescape(encodeURIComponent(this.createSvgGrid(c,C))),g=window.btoa?btoa(g):Base64.encode(g,!0),g="url(data:image/svg+xml;base64,"+g+")",l=E.gridSize*this.scale*this.gridSteps*C):g="url("+this.gridImage+")";var t=c=0;G=null!=G?G-this.translate.x*this.scale:0;T=null!=T?T-this.translate.y*this.scale:0;var B=E.gridSize*this.scale*this.gridSteps,D=G%B;B=T%B;null!=E.view.backgroundPageShape&&(t=this.getBackgroundPageBounds(),c=1+t.x,t=1+t.y);l=-Math.round(l-mxUtils.mod(this.translate.x*-this.scale-c+G,l)+D*C)+"px "+-Math.round(l-mxUtils.mod(this.translate.y*this.scale-t+T,l)+B*C)+"px"}C=E.view.canvas;null!=C.ownerSVGElement&&(C=C.ownerSVGElement);c=!Editor.isDarkMode()&&E.enableDiagramBackground;null!=E.view.backgroundPageShape?(E.view.backgroundPageShape.node.style.backgroundPosition=l,E.view.backgroundPageShape.node.style.backgroundImage=g,E.view.backgroundPageShape.node.style.backgroundColor=Q,E.view.backgroundPageShape.node.style.borderColor=M,E.view.backgroundPageShape.node.style.colorScheme=-"none"==E.getAdaptiveColors()?"light":"",C.style.backgroundImage="none",C.style.backgroundColor="",E.container.style.backgroundColor=c?E.diagramBackgroundColor:""):(C.style.backgroundPosition=l,C.style.backgroundImage=g,"1"==urlParams.transparent?E.container.style.background="transparent":!c||null!=E.background&&E.background!=mxConstants.NONE?C.style.backgroundColor=Q:(C.style.backgroundColor=E.diagramBackgroundColor,E.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(C,-G){for(var T=this.graph.gridSize*this.scale*(null!=G?G:1);T<this.minGridSize;)T*=2;G=this.gridSteps*T;for(var E=[],Q=1;Q<this.gridSteps;Q++){var M=Q*T;E.push("M 0 "+M+" L "+G+" "+M+" M "+M+" 0 L "+M+" "+G)}C=mxUtils.getLightDarkColor(C);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="'++this.scale-c+G,l)+D*C)+"px "+-Math.round(l-mxUtils.mod(this.translate.y*this.scale-t+T,l)+B*C)+"px"}C=E.view.canvas;null!=C.ownerSVGElement&&(C=C.ownerSVGElement);c=!Editor.isDarkMode()&&E.enableDiagramBackground;null!=E.view.backgroundPageShape?(E.view.backgroundPageShape.node.style.backgroundPosition=l,E.view.backgroundPageShape.node.style.backgroundImage=g,E.view.backgroundPageShape.node.style.backgroundColor=P,E.view.backgroundPageShape.node.style.borderColor=L,E.view.backgroundPageShape.node.style.colorScheme=+"none"==E.getAdaptiveColors()?"light":"",C.style.backgroundImage="none",C.style.backgroundColor="",E.container.style.backgroundColor=c?E.diagramBackgroundColor:""):(C.style.backgroundPosition=l,C.style.backgroundImage=g,"1"==urlParams.transparent?E.container.style.background="transparent":!c||null!=E.background&&E.background!=mxConstants.NONE?C.style.backgroundColor=P:(C.style.backgroundColor=E.diagramBackgroundColor,E.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(C,+G){for(var T=this.graph.gridSize*this.scale*(null!=G?G:1);T<this.minGridSize;)T*=2;G=this.gridSteps*T;for(var E=[],P=1;P<this.gridSteps;P++){var L=P*T;E.push("M 0 "+L+" L "+G+" "+L+" M "+L+" 0 L "+L+" "+G)}C=mxUtils.getLightDarkColor(C);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="'+E.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(C.cssText)+';" stroke="'+C.light+'" opacity="0.2" stroke-width="1"/><path d="M '+G+" 0 L 0 0 0 "+G+'" fill="none" style="stroke:'+mxUtils.htmlEntities(C.cssText)+';" stroke="'+C.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(C,G){b.apply(this,arguments);-if(null!=this.shiftPreview1){var T=this.view.canvas;null!=T.ownerSVGElement&&(T=T.ownerSVGElement);var E=this.gridSize*this.view.scale*this.view.gridSteps;E=-Math.round(E-mxUtils.mod(this.view.translate.x*this.view.scale+C,E))+"px "+-Math.round(E-mxUtils.mod(this.view.translate.y*this.view.scale+G,E))+"px";T.style.backgroundPosition=E}};mxGraph.prototype.updatePageBreaks=function(C,G,T){var E=this.view.scale,Q=this.view.translate,M=this.pageFormat,c=E*this.pageScale,g=this.view.getBackgroundPageBounds();-G=g.width;T=g.height;var l=new mxRectangle(E*Q.x,E*Q.y,M.width*c,M.height*c),t=(C=C&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(T/l.height)-1:0,B=C?Math.ceil(G/l.width)-1:0,D=g.x+G,I=g.y+T;null==this.horizontalPageBreaks&&0<t&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<B&&(this.verticalPageBreaks=[]);C=mxUtils.bind(this,function(L){if(null!=L){for(var N=L==this.horizontalPageBreaks?t:B,K=0;K<=N;K++){var da=L==this.horizontalPageBreaks?[new mxPoint(Math.round(g.x),-Math.round(g.y+(K+1)*l.height)),new mxPoint(Math.round(D),Math.round(g.y+(K+1)*l.height))]:[new mxPoint(Math.round(g.x+(K+1)*l.width),Math.round(g.y)),new mxPoint(Math.round(g.x+(K+1)*l.width),Math.round(I))];null!=L[K]?(L[K].points=da,L[K].redraw()):(da=new mxPolyline(da,this.pageBreakColor),da.dialect=this.dialect,da.isDashed=this.pageBreakDashed,da.pointerEvents=!1,da.init(this.view.backgroundPane),da.redraw(),L[K]=da)}for(K=N;K<L.length;K++)null!=L[K]&&L[K].destroy();L.splice(N,L.length-N)}});-C(this.horizontalPageBreaks);C(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(C,G,T){for(var E=0;E<G.length;E++){if(this.graph.isTableCell(G[E])||this.graph.isTableRow(G[E]))return!1;if(this.graph.getModel().isVertex(G[E])){var Q=this.graph.getCellGeometry(G[E]);if(null!=Q&&Q.relative)return!1}}return d.apply(this,arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=-function(){var C=m.apply(this,arguments);C.intersects=mxUtils.bind(this,function(G,T){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(C,arguments)});return C};mxGraphView.prototype.createBackgroundPageShape=function(C){return new mxRectangleShape(C,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var C=this.getGraphBounds(),G=0<C.width?C.x/this.scale-this.translate.x:0,T=0<C.height?C.y/this.scale-this.translate.y:0,E=this.graph.pageFormat,-Q=this.graph.pageScale,M=E.width*Q;E=E.height*Q;Q=Math.floor(Math.min(0,G)/M);var c=Math.floor(Math.min(0,T)/E);return new mxRectangle(this.scale*(this.translate.x+Q*M),this.scale*(this.translate.y+c*E),this.scale*(Math.ceil(Math.max(1,G+C.width/this.scale)/M)-Q)*M,this.scale*(Math.ceil(Math.max(1,T+C.height/this.scale)/E)-c)*E)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(C,G){n.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||-this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=C+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(C,G,T,E,Q,M){var c=v.apply(this,arguments);null==M||M||mxEvent.addListener(c,"mousedown",function(g){mxEvent.consume(g)});return c};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=-function(C,G,T){var E=this.graph.model.getParent(C);if(G){var Q=this.graph.model.isEdge(C)?null:this.graph.getCellGeometry(C);Q=!this.graph.model.isEdge(E)&&!this.graph.isSiblingSelected(C)&&(null!=Q&&Q.relative||!this.graph.isContainer(E)||this.graph.isPart(C))}else if(Q=p.apply(this,arguments),this.graph.isTableCell(C)||this.graph.isTableRow(C))Q=E,this.graph.isTable(Q)||(Q=this.graph.model.getParent(Q)),Q=!this.graph.selectionCellsHandler.isHandled(Q)||this.graph.isCellSelected(Q)&&this.graph.isToggleEvent(T.getEvent())||-this.graph.isCellSelected(C)&&!this.graph.isToggleEvent(T.getEvent())||this.graph.isTableCell(C)&&this.graph.isCellSelected(E);return Q};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(C){C=C.getCell();for(var G=this.graph.getModel(),T=G.getParent(C),E=this.graph.view.getState(T),Q=this.graph.isCellSelected(C);null!=E&&(G.isVertex(T)||G.isEdge(T));){var M=this.graph.isCellSelected(T);Q=Q||M;if(M||!Q&&(this.graph.isTableCell(C)||this.graph.isTableRow(C)))C=T;T=G.getParent(T)}return C}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var n=this,v=this.editor.graph;v.lightbox=m;var p=v.getGraphBounds;v.getGraphBounds=function(){var ka=p.apply(this,arguments),V=this.backgroundImage;if(null!=V&&null!=V.width&&null!=V.height){var k=this.view.translate,x=this.view.scale;ka=mxRectangle.fromRectangle(ka);ka.add(new mxRectangle((k.x+V.x)*x,(k.y+V.y)*x,V.width*x,V.height*x))}return ka};v.useCssTransforms&&-(this.lazyZoomDelay=0);this.selectionStateListener=mxUtils.bind(this,function(ka,V){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){v.isEnabled=-function(){return!1};v.panningHandler.isForcePanningEvent=function(ka){for(var V=ka.getSource();null!=V&&V!=v.container;){if("foreignObject"===V.nodeName||"text"===V.nodeName)return!1;V=V.parentNode}return!mxEvent.isPopupTrigger(ka.getEvent())};var C=v.panningHandler.start;v.panningHandler.start=function(){C.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(ka){try{v.getModel().isEdge(ka)?-T=v.pasteEdgeStyle=!1:G=!1;var V=v.getCellStyle(ka,!1),k=[],x=[],J;for(J in V)k.push(V[J]),x.push(J);v.getModel().isEdge(ka)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",x,"values",k,"cells",[ka],"force",!0));v.getModel().isEdge(ka)?T=v.pasteEdgeStyle=!0:G=!0}catch(R){this.handleError(R)}};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(ka,V){v.pasteCellStyles(v.includeDescendants(V.getProperty("cells")))});v.addListener("textInserted",function(ka,V){v.pasteCellStyles(V.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var E=mxUtils.bind(this,function(ka){null==ka&&(ka=window.event);return v.isEditing()||null!=ka&&this.isSelectionAllowed(ka)});this.container!=document.body||this.editor.chromeless&&-!this.editor.editable||(this.menubarContainer.onselectstart=E,this.menubarContainer.onmousedown=E,this.toolbarContainer.onselectstart=E,this.toolbarContainer.onmousedown=E,this.diagramContainer.onselectstart=E,this.diagramContainer.onmousedown=E,this.sidebarContainer.onselectstart=E,this.sidebarContainer.onmousedown=E,this.formatContainer.onselectstart=E,this.formatContainer.onmousedown=E,null!=this.tabContainer&&(this.tabContainer.onselectstart=E),mxClient.IS_IOS&&(d=function(){var ka=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var V=-navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{ka=[parseInt(V[1],10),parseInt(V[2],10),parseInt(V[3]||0,10)]}catch(k){}}return ka}(),null!=d&&16<=d[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"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,-"userSelect","none"))));!this.editor.chromeless||this.editor.editable?(d=function(ka){if(null!=ka){var V=mxEvent.getSource(ka);if("A"==V.nodeName)for(;null!=V;){if("geHint"==V.className)return!0;V=V.parentNode}}return E(ka)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",d):this.diagramContainer.oncontextmenu=d):v.panningHandler.usePopupTrigger=!1;v.init(this.diagramContainer);mxClient.IS_SVG&&null!=v.view.getDrawPane()&&-(d=v.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(ka,V){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(ka,V){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));-if(null!=v.graphHandler){var Q=v.graphHandler.start;v.graphHandler.start=function(){null!=n.hoverIcons&&n.hoverIcons.reset();null!=n.inlineToolbar&&null!=this.cell&&n.inlineToolbar.hide();Q.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(ka){var V=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(ka)-V.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(ka)-V.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",-mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var M=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(ka,V){return n.isSpaceDown()||M.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(ka){if(Editor.passiveScroll){var V=mxEvent.getSource(ka);if(V!=v.container&&!v.container.contains(V)&&!v.isEditing())return}16==ka.which?this.shiftDown=!0:32!=ka.which||v.isEditing()?mxEvent.isConsumed(ka)||27!=ka.keyCode||this.hideDialog(null,!0):+if(null!=this.shiftPreview1){var T=this.view.canvas;null!=T.ownerSVGElement&&(T=T.ownerSVGElement);var E=this.gridSize*this.view.scale*this.view.gridSteps;E=-Math.round(E-mxUtils.mod(this.view.translate.x*this.view.scale+C,E))+"px "+-Math.round(E-mxUtils.mod(this.view.translate.y*this.view.scale+G,E))+"px";T.style.backgroundPosition=E}};mxGraph.prototype.updatePageBreaks=function(C,G,T){var E=this.view.scale,P=this.view.translate,L=this.pageFormat,c=E*this.pageScale,g=this.view.getBackgroundPageBounds();+G=g.width;T=g.height;var l=new mxRectangle(E*P.x,E*P.y,L.width*c,L.height*c),t=(C=C&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(T/l.height)-1:0,B=C?Math.ceil(G/l.width)-1:0,D=g.x+G,I=g.y+T;null==this.horizontalPageBreaks&&0<t&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<B&&(this.verticalPageBreaks=[]);C=mxUtils.bind(this,function(K){if(null!=K){for(var M=K==this.horizontalPageBreaks?t:B,V=0;V<=M;V++){var Q=K==this.horizontalPageBreaks?[new mxPoint(Math.round(g.x),+Math.round(g.y+(V+1)*l.height)),new mxPoint(Math.round(D),Math.round(g.y+(V+1)*l.height))]:[new mxPoint(Math.round(g.x+(V+1)*l.width),Math.round(g.y)),new mxPoint(Math.round(g.x+(V+1)*l.width),Math.round(I))];null!=K[V]?(K[V].points=Q,K[V].redraw()):(Q=new mxPolyline(Q,this.pageBreakColor),Q.dialect=this.dialect,Q.isDashed=this.pageBreakDashed,Q.pointerEvents=!1,Q.init(this.view.backgroundPane),Q.redraw(),K[V]=Q)}for(V=M;V<K.length;V++)null!=K[V]&&K[V].destroy();K.splice(M,K.length-M)}});C(this.horizontalPageBreaks);+C(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(C,G,T){for(var E=0;E<G.length;E++){if(this.graph.isTableCell(G[E])||this.graph.isTableRow(G[E]))return!1;if(this.graph.getModel().isVertex(G[E])){var P=this.graph.getCellGeometry(G[E]);if(null!=P&&P.relative)return!1}}return d.apply(this,arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var C=+m.apply(this,arguments);C.intersects=mxUtils.bind(this,function(G,T){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(C,arguments)});return C};mxGraphView.prototype.createBackgroundPageShape=function(C){return new mxRectangleShape(C,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var C=this.getGraphBounds(),G=0<C.width?C.x/this.scale-this.translate.x:0,T=0<C.height?C.y/this.scale-this.translate.y:0,E=this.graph.pageFormat,+P=this.graph.pageScale,L=E.width*P;E=E.height*P;P=Math.floor(Math.min(0,G)/L);var c=Math.floor(Math.min(0,T)/E);return new mxRectangle(this.scale*(this.translate.x+P*L),this.scale*(this.translate.y+c*E),this.scale*(Math.ceil(Math.max(1,G+C.width/this.scale)/L)-P)*L,this.scale*(Math.ceil(Math.max(1,T+C.height/this.scale)/E)-c)*E)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(C,G){n.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||+this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=C+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(C,G,T,E,P,L){var c=v.apply(this,arguments);null==L||L||mxEvent.addListener(c,"mousedown",function(g){mxEvent.consume(g)});return c};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=+function(C,G,T){var E=this.graph.model.getParent(C);if(G){var P=this.graph.model.isEdge(C)?null:this.graph.getCellGeometry(C);P=!this.graph.model.isEdge(E)&&!this.graph.isSiblingSelected(C)&&(null!=P&&P.relative||!this.graph.isContainer(E)||this.graph.isPart(C))}else if(P=p.apply(this,arguments),this.graph.isTableCell(C)||this.graph.isTableRow(C))P=E,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(C)&&!this.graph.isToggleEvent(T.getEvent())||this.graph.isTableCell(C)&&this.graph.isCellSelected(E);return P};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(C){C=C.getCell();for(var G=this.graph.getModel(),T=G.getParent(C),E=this.graph.view.getState(T),P=this.graph.isCellSelected(C);null!=E&&(G.isVertex(T)||G.isEdge(T));){var L=this.graph.isCellSelected(T);P=P||L;if(L||!P&&(this.graph.isTableCell(C)||this.graph.isTableRow(C)))C=T;T=G.getParent(T)}return C}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var n=this,v=this.editor.graph;v.lightbox=m;var p=v.getGraphBounds;v.getGraphBounds=function(){var ka=p.apply(this,arguments),W=this.backgroundImage;if(null!=W&&null!=W.width&&null!=W.height){var k=this.view.translate,y=this.view.scale;ka=mxRectangle.fromRectangle(ka);ka.add(new mxRectangle((k.x+W.x)*y,(k.y+W.y)*y,W.width*y,W.height*y))}return ka};v.useCssTransforms&&+(this.lazyZoomDelay=0);this.selectionStateListener=mxUtils.bind(this,function(ka,W){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){v.isEnabled=+function(){return!1};v.panningHandler.isForcePanningEvent=function(ka){for(var W=ka.getSource();null!=W&&W!=v.container;){if("foreignObject"===W.nodeName||"text"===W.nodeName)return!1;W=W.parentNode}return!mxEvent.isPopupTrigger(ka.getEvent())};var C=v.panningHandler.start;v.panningHandler.start=function(){C.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(ka){try{v.getModel().isEdge(ka)?+T=v.pasteEdgeStyle=!1:G=!1;var W=v.getCellStyle(ka,!1),k=[],y=[],J;for(J in W)k.push(W[J]),y.push(J);v.getModel().isEdge(ka)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",y,"values",k,"cells",[ka],"force",!0));v.getModel().isEdge(ka)?T=v.pasteEdgeStyle=!0:G=!0}catch(R){this.handleError(R)}};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(ka,W){v.pasteCellStyles(v.includeDescendants(W.getProperty("cells")))});v.addListener("textInserted",function(ka,W){v.pasteCellStyles(W.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var E=mxUtils.bind(this,function(ka){null==ka&&(ka=window.event);return v.isEditing()||null!=ka&&this.isSelectionAllowed(ka)});this.container!=document.body||this.editor.chromeless&&+!this.editor.editable||(this.menubarContainer.onselectstart=E,this.menubarContainer.onmousedown=E,this.toolbarContainer.onselectstart=E,this.toolbarContainer.onmousedown=E,this.diagramContainer.onselectstart=E,this.diagramContainer.onmousedown=E,this.sidebarContainer.onselectstart=E,this.sidebarContainer.onmousedown=E,this.formatContainer.onselectstart=E,this.formatContainer.onmousedown=E,null!=this.tabContainer&&(this.tabContainer.onselectstart=E),mxClient.IS_IOS&&(d=function(){var ka=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var W=+navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{ka=[parseInt(W[1],10),parseInt(W[2],10),parseInt(W[3]||0,10)]}catch(k){}}return ka}(),null!=d&&16<=d[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"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,+"userSelect","none"))));!this.editor.chromeless||this.editor.editable?(d=function(ka){if(null!=ka){var W=mxEvent.getSource(ka);if("A"==W.nodeName)for(;null!=W;){if("geHint"==W.className)return!0;W=W.parentNode}}return E(ka)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",d):this.diagramContainer.oncontextmenu=d):v.panningHandler.usePopupTrigger=!1;v.init(this.diagramContainer);mxClient.IS_SVG&&null!=v.view.getDrawPane()&&+(d=v.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(ka,W){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(ka,W){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));+if(null!=v.graphHandler){var P=v.graphHandler.start;v.graphHandler.start=function(){null!=n.hoverIcons&&n.hoverIcons.reset();null!=n.inlineToolbar&&null!=this.cell&&n.inlineToolbar.hide();P.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(ka){var W=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(ka)-W.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(ka)-W.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",+mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var L=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(ka,W){return n.isSpaceDown()||L.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(ka){if(Editor.passiveScroll){var W=mxEvent.getSource(ka);if(W!=v.container&&!v.container.contains(W)&&!v.isEditing())return}16==ka.which?this.shiftDown=!0:32!=ka.which||v.isEditing()?mxEvent.isConsumed(ka)||27!=ka.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(ka)!=v.container||mxEvent.consume(ka))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(ka){v.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var c=v.panningHandler.isForcePanningEvent;v.panningHandler.isForcePanningEvent=function(ka){return null!=v.freehand&&v.freehand.isActive()?!1:c.apply(this,arguments)||n.isSpaceDown()||mxEvent.isMouseEvent(ka.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(ka.getEvent()))&&(!mxEvent.isControlDown(ka.getEvent())&&mxEvent.isRightMouseButton(ka.getEvent())||mxEvent.isMiddleMouseButton(ka.getEvent()))};var g=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(ka){return g.apply(this,arguments)||13==ka.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(ka)||mxClient.IS_MAC&&mxEvent.isMetaDown(ka)||mxClient.IS_SF&&-mxEvent.isShiftDown(ka))};var l=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return n.isSpaceDown()||l.apply(this,arguments)};var t=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var ka=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,V=this.toolbar.container.firstChild;null!=V;){var k=V.getAttribute("data-min-width");null!=k&&parseInt(k)>ka?V.style.display="none":V.style.display="";V=V.nextSibling}}),B=!1,D=null,I=null,L=null,N=mxUtils.bind(this,function(){if(null!=-this.toolbar&&B!=v.cellEditor.isContentEditing()){for(var ka=this.toolbar.container.firstChild,V=[];null!=ka;){var k=ka.nextSibling;ka.parentNode.removeChild(ka);V.push(ka);ka=k}ka=this.toolbar.fontMenu;k=this.toolbar.sizeMenu;if(null==L)this.toolbar.createTextToolbar();else{for(var x=0;x<L.length;x++)this.toolbar.container.appendChild(L[x]);this.toolbar.fontMenu=D;this.toolbar.sizeMenu=I}B=v.cellEditor.isContentEditing();D=ka;I=k;L=V;t()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);-this.descriptorChanged();this.updateStatusAgain();N()}));this.addListener("currentThemeChanged",t);mxEvent.addListener(window,"resize",t);t();v.isTouchPopupMenuEnabled=function(){return null==n.dialog};var K=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){K.apply(this,arguments);N();if(v.cellEditor.isContentEditing()){var ka=!1,V=function(){ka||(ka=!0,window.setTimeout(function(){var k=v.getSelectedEditingElement();null!=k&&(k=mxUtils.getCurrentStyle(k),null!=k&&null!=n.toolbar&&(n.toolbar.setFontName(mxUtils.getCssFontFamily(k.fontFamily)),-n.toolbar.setFontSize(parseInt(k.fontSize))));ka=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",V);mxEvent.addListener(v.cellEditor.textarea,"touchend",V);mxEvent.addListener(v.cellEditor.textarea,"mouseup",V);mxEvent.addListener(v.cellEditor.textarea,"keyup",V);V()}};var da=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(ka,V){try{da.apply(this,arguments),N()}catch(k){n.handleError(k)}};v.container.setAttribute("tabindex","0");v.container.style.cursor="default";if(window.self===-window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(ka){}var ja=v.fireMouseEvent;v.fireMouseEvent=function(ka,V,k){try{ka==mxEvent.MOUSE_DOWN&&this.container.focus(),ja.apply(this,arguments)}catch(x){n.handleError(x)}};var ea=v.foldCells;v.foldCells=function(ka,V,k,x,J){try{ea.apply(this,arguments)}catch(R){n.handleError(R)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(ka,V,k){this.menus.createPopupMenu(ka,V,k)}));-mxEvent.addGestureListeners(document,mxUtils.bind(this,function(ka){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(ka,V){var k=[V.getProperty("cell")];V.getProperty("terminalInserted")&&(k.push(V.getProperty("terminal")),window.setTimeout(function(){null!=n.hoverIcons&&n.hoverIcons.update(v.view.getState(k[k.length-1]))},0));v.pasteCellStyles(k)});var ca=null,fa=null;-b=mxUtils.bind(this,function(){if(null!=this.toolbar){var ka=this.getSelectionState();if(v.isEnabled()&&0<ka.edges.length){if(null!=this.toolbar.edgeStyleMenu){var V=this.getImageForEdgeStyle(ka.style);1==ka.edges.length&&"arrow"==ka.style[mxConstants.STYLE_SHAPE]&&(V=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+V+")"}null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(ka.style)+")")}else null!=this.toolbar.edgeStyleMenu&&-(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ca+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+fa+")")}});v.selectionModel.addListener(mxEvent.CHANGE,b);v.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(ka,V){ka=V.getProperty("force");(this.updateDefaultStyle||ka)&&v.copyCellStyles(V.getProperty("cells"),V.getProperty("keys"),V.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),V=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(ca=this.getImageForEdgeStyle(v.currentEdgeStyle),0==V.edges.length&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ca+")")),null!=this.toolbar.edgeShapeMenu&&(fa=this.getImageForEdgeShape(v.currentEdgeStyle),0==V.edges.length&&-(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+fa+")")))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var ka=v.currentVertexStyle.fontFamily||"Helvetica",V=String(v.currentVertexStyle.fontSize||"12"),k=v.getView().getState(v.getSelectionCell());null!=k&&(ka=k.style[mxConstants.STYLE_FONTFAMILY]||ka,V=k.style[mxConstants.STYLE_FONTSIZE]||V,10<ka.length&&(ka=ka.substring(0,8)+"..."));this.toolbar.setFontName(ka);this.toolbar.setFontSize(V)}),v.getSelectionModel().addListener(mxEvent.CHANGE,-b),v.getModel().addListener(mxEvent.CHANGE,b));v.addListener(mxEvent.CELLS_ADDED,function(ka,V){ka=V.getProperty("cells");V=V.getProperty("parent");null!=V&&v.getModel().isLayer(V)&&!v.isCellVisible(V)&&null!=ka&&0<ka.length&&v.getModel().setVisible(V,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&!v.isSelectionEmpty()){var ka=v.getLayerForCells(v.getSelectionCells());null!=ka&&v.setDefaultParent(ka)}});this.gestureHandler=mxUtils.bind(this,+mxEvent.isShiftDown(ka))};var l=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return n.isSpaceDown()||l.apply(this,arguments)};var t=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var ka=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,W=this.toolbar.container.firstChild;null!=W;){var k=W.getAttribute("data-min-width");null!=k&&parseInt(k)>ka?W.style.display="none":W.style.display="";W=W.nextSibling}}),B=!1,D=null,I=null,K=null,M=mxUtils.bind(this,function(){if(null!=+this.toolbar&&B!=v.cellEditor.isContentEditing()){for(var ka=this.toolbar.container.firstChild,W=[];null!=ka;){var k=ka.nextSibling;ka.parentNode.removeChild(ka);W.push(ka);ka=k}ka=this.toolbar.fontMenu;k=this.toolbar.sizeMenu;if(null==K)this.toolbar.createTextToolbar();else{for(var y=0;y<K.length;y++)this.toolbar.container.appendChild(K[y]);this.toolbar.fontMenu=D;this.toolbar.sizeMenu=I}B=v.cellEditor.isContentEditing();D=ka;I=k;K=W;t()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);+this.descriptorChanged();this.updateStatusAgain();M()}));this.addListener("currentThemeChanged",t);mxEvent.addListener(window,"resize",t);t();v.isTouchPopupMenuEnabled=function(){return null==n.dialog};var V=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){V.apply(this,arguments);M();if(v.cellEditor.isContentEditing()){var ka=!1,W=function(){ka||(ka=!0,window.setTimeout(function(){var k=v.getSelectedEditingElement();null!=k&&(k=mxUtils.getCurrentStyle(k),null!=k&&null!=n.toolbar&&(n.toolbar.setFontName(mxUtils.getCssFontFamily(k.fontFamily)),+n.toolbar.setFontSize(parseInt(k.fontSize))));ka=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",W);mxEvent.addListener(v.cellEditor.textarea,"touchend",W);mxEvent.addListener(v.cellEditor.textarea,"mouseup",W);mxEvent.addListener(v.cellEditor.textarea,"keyup",W);W()}};var Q=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(ka,W){try{Q.apply(this,arguments),M()}catch(k){n.handleError(k)}};v.container.setAttribute("tabindex","0");v.container.style.cursor="default";if(window.self===+window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(ka){}var ja=v.fireMouseEvent;v.fireMouseEvent=function(ka,W,k){try{ka==mxEvent.MOUSE_DOWN&&this.container.focus(),ja.apply(this,arguments)}catch(y){n.handleError(y)}};var ea=v.foldCells;v.foldCells=function(ka,W,k,y,J){try{ea.apply(this,arguments)}catch(R){n.handleError(R)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(ka,W,k){this.menus.createPopupMenu(ka,W,k)}));+mxEvent.addGestureListeners(document,mxUtils.bind(this,function(ka){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(ka,W){var k=[W.getProperty("cell")];W.getProperty("terminalInserted")&&(k.push(W.getProperty("terminal")),window.setTimeout(function(){null!=n.hoverIcons&&n.hoverIcons.update(v.view.getState(k[k.length-1]))},0));v.pasteCellStyles(k)});var da=null,ia=null;+b=mxUtils.bind(this,function(){if(null!=this.toolbar){var ka=this.getSelectionState();if(v.isEnabled()&&0<ka.edges.length){if(null!=this.toolbar.edgeStyleMenu){var W=this.getImageForEdgeStyle(ka.style);1==ka.edges.length&&"arrow"==ka.style[mxConstants.STYLE_SHAPE]&&(W=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+W+")"}null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(ka.style)+")")}else null!=this.toolbar.edgeStyleMenu&&+(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+da+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+ia+")")}});v.selectionModel.addListener(mxEvent.CHANGE,b);v.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(ka,W){ka=W.getProperty("force");(this.updateDefaultStyle||ka)&&v.copyCellStyles(W.getProperty("cells"),W.getProperty("keys"),W.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),W=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(da=this.getImageForEdgeStyle(v.currentEdgeStyle),0==W.edges.length&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+da+")")),null!=this.toolbar.edgeShapeMenu&&(ia=this.getImageForEdgeShape(v.currentEdgeStyle),0==W.edges.length&&+(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+ia+")")))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var ka=v.currentVertexStyle.fontFamily||"Helvetica",W=String(v.currentVertexStyle.fontSize||"12"),k=v.getView().getState(v.getSelectionCell());null!=k&&(ka=k.style[mxConstants.STYLE_FONTFAMILY]||ka,W=k.style[mxConstants.STYLE_FONTSIZE]||W,10<ka.length&&(ka=ka.substring(0,8)+"..."));this.toolbar.setFontName(ka);this.toolbar.setFontSize(W)}),v.getSelectionModel().addListener(mxEvent.CHANGE,+b),v.getModel().addListener(mxEvent.CHANGE,b));v.addListener(mxEvent.CELLS_ADDED,function(ka,W){ka=W.getProperty("cells");W=W.getProperty("parent");null!=W&&v.getModel().isLayer(W)&&!v.isCellVisible(W)&&null!=ka&&0<ka.length&&v.getModel().setVisible(W,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&!v.isSelectionEmpty()){var ka=v.getLayerForCells(v.getSelectionCells());null!=ka&&v.setDefaultParent(ka)}});this.gestureHandler=mxUtils.bind(this,function(ka){this.isHideCurrentMenuEvent(ka)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var la=null;this.resizeHandler=mxUtils.bind(this,function(){null!=la&&window.clearTimeout(la);la=window.setTimeout(mxUtils.bind(this,function(){la=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;@@ -2111,48 +2111,50 @@ EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"mxUtils.bind(m,m.showLinkDialog);b.editLink=m.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,d=b.getSelectionCells(),m=this.initSelectionState(),n=!0,v=0;v<d.length;v++){var p=b.getCurrentCellStyle(d[v]);"0"!=mxUtils.getValue(p,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(m,d[v],d,n),n=!1)}this.updateSelectionStateForTableCells(m);if(Editor.enableCustomProperties){m.customProperties={};b=m.vertices;d=m.edges;for(v=0;v<b.length;v++)this.findCommonProperties(b[v],m.customProperties,0==v,m);for(v=0;v<d.length;v++)this.findCommonProperties(d[v],m.customProperties,0==b.length&&0==v,m)}return m};-EditorUi.prototype.findCommonProperties=function(b,d,m,n){n=mxUtils.bind(this,function(E){if(null!=E)if(m)for(var Q=0;Q<E.length;Q++)d[E[Q].name]=E[Q];else for(var M in d)if(null!=M){var c=!1;for(Q=0;Q<E.length;Q++)if(E[Q].name==M&&E[Q].type==d[M].type){c=!0;break}c||delete d[M]}});var v=this.editor.graph,p=v.view.getState(b);if(null!=p&&null!=p.shape){if(!p.shape.commonCustomPropAdded){p.shape.commonCustomPropAdded=!0;p.shape.customProperties=p.shape.customProperties||[];if(null!=p.shape&&null!=-p.shape.stencil&&null!=p.shape.stencil.desc){var C=p.shape.stencil,G=[],T=mxUtils.bind(this,function(E){E=C.desc.getElementsByTagName(E);for(var Q=[],M=0;M<E.length;M++){var c=E[M].getAttribute("color");if(!mxUtils.isValidColor(c)&&!G[c]&&"fill"!=c&&"stroke"!=c&&"font"!=c){G[c]=!0;var g=E[M].getAttribute("name");g=null!=g?g:Editor.getLabelForStylename(c);var l=E[M].getAttribute("default"),t=C.getDefaultColorValue(E[M],v),B=l;l==mxConstants.NONE&&(l="default");Q.push({name:c,type:"color",primary:"false"!=-E[M].getAttribute("primary"),defVal:l,defaultColor:t,undefinedColor:B,dispName:g})}}return Q});Array.prototype.push.apply(p.shape.customProperties,T("fillcolor"));Array.prototype.push.apply(p.shape.customProperties,T("strokecolor"));Array.prototype.push.apply(p.shape.customProperties,T("fontcolor"))}p.cell.vertex?Array.prototype.push.apply(p.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(p.shape.customProperties,Editor.commonEdgeProperties)}n(p.shape.customProperties)}b=+EditorUi.prototype.findCommonProperties=function(b,d,m,n){n=mxUtils.bind(this,function(E){if(null!=E)if(m)for(var P=0;P<E.length;P++)d[E[P].name]=E[P];else for(var L in d)if(null!=L){var c=!1;for(P=0;P<E.length;P++)if(E[P].name==L&&E[P].type==d[L].type){c=!0;break}c||delete d[L]}});var v=this.editor.graph,p=v.view.getState(b);if(null!=p&&null!=p.shape){if(!p.shape.commonCustomPropAdded){p.shape.commonCustomPropAdded=!0;p.shape.customProperties=p.shape.customProperties||[];if(null!=p.shape&&null!=+p.shape.stencil&&null!=p.shape.stencil.desc){var C=p.shape.stencil,G=[],T=mxUtils.bind(this,function(E){E=C.desc.getElementsByTagName(E);for(var P=[],L=0;L<E.length;L++){var c=E[L].getAttribute("color");if(!mxUtils.isValidColor(c)&&!G[c]&&"fill"!=c&&"stroke"!=c&&"font"!=c){G[c]=!0;var g=E[L].getAttribute("name");g=null!=g?g:Editor.getLabelForStylename(c);var l=E[L].getAttribute("default"),t=C.getDefaultColorValue(E[L],v),B=l;l==mxConstants.NONE&&(l="default");P.push({name:c,type:"color",primary:"false"!=+E[L].getAttribute("primary"),defVal:l,defaultColor:t,undefinedColor:B,dispName:g})}}return P});Array.prototype.push.apply(p.shape.customProperties,T("fillcolor"));Array.prototype.push.apply(p.shape.customProperties,T("strokecolor"));Array.prototype.push.apply(p.shape.customProperties,T("fontcolor"))}p.cell.vertex?Array.prototype.push.apply(p.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(p.shape.customProperties,Editor.commonEdgeProperties)}n(p.shape.customProperties)}b=b.getAttribute("customProperties");if(null!=b)try{n(JSON.parse(b))}catch(E){}};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 d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,n=m.getParent(d[0]),v=m.getParent(n);if(null!=n&&null!=v){for(var p=n.getIndex(d[0]),C=v.getIndex(n),G=null,T=1,E=1,Q=0,M=C<v.getChildCount()-1?m.getChildAt(m.getChildAt(v,C+1),p):null;Q<d.length-1;){var c=d[++Q];null==M||M!=c||null!=G&&T!=G||(G=T,T=0,E++,n=m.getParent(M),M=C+E<v.getChildCount()?m.getChildAt(m.getChildAt(v,C+E),p):null);var g=this.editor.graph.view.getState(c);-if(c==m.getChildAt(n,p+T)&&null!=g&&1==mxUtils.getValue(g.style,"colspan",1)&&1==mxUtils.getValue(g.style,"rowspan",1))T++;else break}Q==E*T-1&&(b.mergeCell=d[0],b.colspan=T,b.rowspan=E)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};+EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,n=m.getParent(d[0]),v=m.getParent(n);if(null!=n&&null!=v){for(var p=n.getIndex(d[0]),C=v.getIndex(n),G=null,T=1,E=1,P=0,L=C<v.getChildCount()-1?m.getChildAt(m.getChildAt(v,C+1),p):null;P<d.length-1;){var c=d[++P];null==L||L!=c||null!=G&&T!=G||(G=T,T=0,E++,n=m.getParent(L),L=C+E<v.getChildCount()?m.getChildAt(m.getChildAt(v,C+E),p):null);var g=this.editor.graph.view.getState(c);+if(c==m.getChildAt(n,p+T)&&null!=g&&1==mxUtils.getValue(g.style,"colspan",1)&&1==mxUtils.getValue(g.style,"rowspan",1))T++;else break}P==E*T-1&&(b.mergeCell=d[0],b.colspan=T,b.rowspan=E)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};EditorUi.prototype.createTimeout=function(b,d,m){var n=!0,v=null,p=mxUtils.bind(this,function(G){v.clear()&&(n=!1,G=null!=G?G:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,d,m)})},null!=m?m(G):this.handleError(G))}),C=window.setTimeout(p,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(C);return n},isAlive:function(){return n}};null!=d&&this.tryAndHandle(mxUtils.bind(this,function(){d(v)}),p);return v};EditorUi.prototype.tryAndHandle=function(b,d){try{b()}catch(m){null!=d?d(m):this.handleError(m)}};-EditorUi.prototype.removeUserDefinedDarkColors=function(b,d,m){var n=this.editor.graph;b=null!=b?b:n.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");n.model.beginUpdate();try{for(var C=0;C<b.length;C++)if(n.model.isEdge(b[C])||n.model.isVertex(b[C])){var G=n.getCellStyle(b[C],!1);if(null!=G)for(var T=0;T<v.length;T++)try{var E=G[v[T]];if(mxUtils.isLightDarkColor(E)){var Q=mxUtils.getLightDarkColor(E);n.setCellStyles(v[T],Q.light,[b[C]])}}catch(c){}d&&n.isHtmlLabel(b[C])&&-"0"!=mxUtils.getValue(G,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(n.getLabel(b[C])),Graph.addLightDarkColors(p,null,null,function(c,g,l){return mxUtils.isLightDarkColor(l)?(l=mxUtils.getLightDarkColor(l),c.style.setProperty(g,l.light),!0):!1})&&n.cellLabelChanged(b[C],p.innerHTML))}if(m&&mxUtils.isLightDarkColor(n.background)){Q=mxUtils.getLightDarkColor(n.background);var M=new ChangePageSetup(this,Q.light);M.ignoreImage=!0;n.model.execute(M)}}finally{n.model.endUpdate()}return b};+EditorUi.prototype.removeUserDefinedDarkColors=function(b,d,m){var n=this.editor.graph;b=null!=b?b:n.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");n.model.beginUpdate();try{for(var C=0;C<b.length;C++)if(n.model.isEdge(b[C])||n.model.isVertex(b[C])){var G=n.getCellStyle(b[C],!1);if(null!=G)for(var T=0;T<v.length;T++)try{var E=G[v[T]];if(mxUtils.isLightDarkColor(E)){var P=mxUtils.getLightDarkColor(E);n.setCellStyles(v[T],P.light,[b[C]])}}catch(c){}d&&n.isHtmlLabel(b[C])&&+"0"!=mxUtils.getValue(G,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(n.getLabel(b[C])),Graph.addLightDarkColors(p,null,null,function(c,g,l){return mxUtils.isLightDarkColor(l)?(l=mxUtils.getLightDarkColor(l),c.style.setProperty(g,l.light),!0):!1})&&n.cellLabelChanged(b[C],p.innerHTML))}if(m&&mxUtils.isLightDarkColor(n.background)){P=mxUtils.getLightDarkColor(n.background);var L=new ChangePageSetup(this,P.light);L.ignoreImage=!0;n.model.execute(L)}}finally{n.model.endUpdate()}return b};EditorUi.prototype.updateSelectionStateForCell=function(b,d,m,n){m=this.editor.graph;b.cells.push(d);if(m.getModel().isVertex(d)){b.connections=0<m.model.getEdgeCount(d);b.unlocked=b.unlocked&&!m.isCellLocked(d);b.resizable=b.resizable&&m.isCellResizable(d);b.rotatable=b.rotatable&&m.isCellRotatable(d);b.movable=b.movable&&m.isCellMovable(d)&&!m.isTableRow(d)&&!m.isTableCell(d);b.swimlane=b.swimlane||m.isSwimlane(d);b.table=b.table||m.isTable(d);b.cell=b.cell||m.isTableCell(d);b.row=b.row||m.isTableRow(d);b.vertices.push(d);var v=m.getCellGeometry(d);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 m.getModel().isEdge(d)&&(b.edges.push(d),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=!1);p=m.view.getState(d);null!=p&&(b.html=b.html&&m.isHtmlLabel(d),b.autoSize=b.autoSize||m.isAutoSizeState(p),b.glass=b.glass&&m.isGlassState(p),b.rounded=b.rounded&&m.isRoundedState(p),b.lineJumps=b.lineJumps&&m.isLineJumpState(p),b.image=b.image||m.isImageState(p),b.shadow=b.shadow&&m.isShadowState(p),b.fill=b.fill&&m.isFillState(p),b.gradient=b.fill&&m.isGradientState(p),b.stroke=b.stroke&&m.isStrokeState(p),d=mxUtils.getValue(p.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||"image"==d,m.mergeStyle(p.style,b.style,n))};-EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,d=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(E,Q){"mouseDown"==Q.getProperty("eventName")&&d.hideShapePicker()}));var m=mxUtils.bind(this,function(){d.hideShapePicker(!0)});b.addListener("wheel",m);b.addListener(mxEvent.ESCAPE,m);b.view.addListener(mxEvent.SCALE,m);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,m);b.getSelectionModel().addListener(mxEvent.CHANGE,m);var n=b.popupMenuHandler.isMenuShowing;-b.popupMenuHandler.isMenuShowing=function(){return n.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var v=b.dblClick;b.dblClick=function(E,Q){if(this.isEnabled())if(null!=Q||null==d.sidebar||mxEvent.isShiftDown(E)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var M=mxUtils.convertPoint(this.container,mxEvent.getClientX(E),mxEvent.getClientY(E));mxEvent.consume(E);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(M.x,M.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",-mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,d.hideShapePicker(!0))}));var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){d.hideShapePicker();p.apply(this,arguments)};var C=this.hoverIcons.execute;this.hoverIcons.execute=function(E,Q,M){var c=M.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?C.apply(this,arguments):this.graph.connectVertex(E.cell,Q,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,-function(g,l,t){var B=b.getCompositeParent(E.cell);g=b.getCellGeometry(B);for(M.consume();null!=B&&b.model.isVertex(B)&&null!=g&&g.relative;)cell=B,B=b.model.getParent(cell),g=b.getCellGeometry(B);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=d.showShapePicker(M.getGraphX(),M.getGraphY(),B,mxUtils.bind(this,function(D){t(D);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(D))}),Q)}),30)}),mxUtils.bind(this,function(g){this.graph.selectCellsForConnectVertex(g,c,this)}))};-var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(E,Q){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var M=Q.getProperty("arrow"),c=Q.getProperty("direction"),g=Q.getProperty("event");M=M.getBoundingClientRect();var l=mxUtils.getOffset(b.container),t=b.container.scrollLeft+M.x-l.x;l=b.container.scrollTop+M.y-l.y;var B=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),D=d.showShapePicker(t,l,B,-mxUtils.bind(this,function(I){null!=I&&b.connectVertex(B,c,b.defaultEdgeLength,g,!0,!1,function(L,N,K){K(I);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(I))},function(L){b.selectCellsForConnectVertex(L)},g,this.hoverIcons)}),c,!0);null!=D&&(this.centerShapePicker(D,M,t,l,c),this.hoverIcons.shapePickerHoverDiv=D,mxUtils.setOpacity(D,30),mxEvent.addListener(D,"mouseenter",function(){mxUtils.setOpacity(D,100)}),mxEvent.addListener(D,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));-this.hoverIcons.addListener("blur",mxUtils.bind(this,function(E,Q){null!=G&&window.clearTimeout(G)}))}var T=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(E,Q){T=!1}),mouseMove:mxUtils.bind(this,function(E,Q){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(T=!0)}),mouseUp:mxUtils.bind(this,function(E,Q){E=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=E&&!T){var M=Q.getEvent();if(!b.isCloneEvent(M)&&!mxEvent.isShiftDown(M)){for(var c=-mxConstants.DIRECTION_EAST,g=b.getCompositeParent(E.cell),l=b.getCellGeometry(g);null!=g&&b.model.isVertex(g)&&null!=l&&l.relative;)g=b.model.getParent(g),l=b.getCellGeometry(g);b.connectVertex(E.cell,c,b.defaultEdgeLength,M,null,!0,mxUtils.bind(this,function(t,B,D){Q.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(Q.getGraphX(),Q.getGraphY(),g,mxUtils.bind(this,function(I){D(I);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(I))}),c)}),30)}),mxUtils.bind(this,function(t){b.selectCellsForConnectVertex(t,-M)}))}}T=!1})})};EditorUi.prototype.centerShapePicker=function(b,d,m,n,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(m-=p.width/2-10,n-=p.height+6):v==mxConstants.DIRECTION_SOUTH?(m-=p.width/2-10,n+=d.height+6):v==mxConstants.DIRECTION_WEST?(m-=p.width+6,n-=p.height/2-10):v==mxConstants.DIRECTION_EAST&&(m+=d.width+6,n-=p.height/2-10);b.style.left=m+"px";b.style.top=n+"px"};+EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,d=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(E,P){"mouseDown"==P.getProperty("eventName")&&d.hideShapePicker()}));var m=mxUtils.bind(this,function(){d.hideShapePicker(!0)});b.addListener("wheel",m);b.addListener(mxEvent.ESCAPE,m);b.view.addListener(mxEvent.SCALE,m);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,m);b.getSelectionModel().addListener(mxEvent.CHANGE,m);var n=b.popupMenuHandler.isMenuShowing;+b.popupMenuHandler.isMenuShowing=function(){return n.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var v=b.dblClick;b.dblClick=function(E,P){if(this.isEnabled())if(null!=P||null==d.sidebar||mxEvent.isShiftDown(E)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var L=mxUtils.convertPoint(this.container,mxEvent.getClientX(E),mxEvent.getClientY(E));mxEvent.consume(E);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(L.x,L.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",+mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,d.hideShapePicker(!0))}));var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){d.hideShapePicker();p.apply(this,arguments)};var C=this.hoverIcons.execute;this.hoverIcons.execute=function(E,P,L){var c=L.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?C.apply(this,arguments):this.graph.connectVertex(E.cell,P,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,+function(g,l,t){var B=b.getCompositeParent(E.cell);g=b.getCellGeometry(B);for(L.consume();null!=B&&b.model.isVertex(B)&&null!=g&&g.relative;)cell=B,B=b.model.getParent(cell),g=b.getCellGeometry(B);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=d.showShapePicker(L.getGraphX(),L.getGraphY(),B,mxUtils.bind(this,function(D){t(D);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(D))}),P)}),30)}),mxUtils.bind(this,function(g){this.graph.selectCellsForConnectVertex(g,c,this)}))};+var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(E,P){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var L=P.getProperty("arrow"),c=P.getProperty("direction"),g=P.getProperty("event");L=L.getBoundingClientRect();var l=mxUtils.getOffset(b.container),t=b.container.scrollLeft+L.x-l.x;l=b.container.scrollTop+L.y-l.y;var B=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),D=d.showShapePicker(t,l,B,+mxUtils.bind(this,function(I){null!=I&&b.connectVertex(B,c,b.defaultEdgeLength,g,!0,!1,function(K,M,V){V(I);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(I))},function(K){b.selectCellsForConnectVertex(K)},g,this.hoverIcons)}),c,!0);null!=D&&(this.centerShapePicker(D,L,t,l,c),this.hoverIcons.shapePickerHoverDiv=D,mxUtils.setOpacity(D,30),mxEvent.addListener(D,"mouseenter",function(){mxUtils.setOpacity(D,100)}),mxEvent.addListener(D,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));+this.hoverIcons.addListener("blur",mxUtils.bind(this,function(E,P){null!=G&&window.clearTimeout(G)}))}var T=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(E,P){T=!1}),mouseMove:mxUtils.bind(this,function(E,P){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(T=!0)}),mouseUp:mxUtils.bind(this,function(E,P){E=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=E&&!T){var L=P.getEvent();if(!b.isCloneEvent(L)&&!mxEvent.isShiftDown(L)){for(var c=+mxConstants.DIRECTION_EAST,g=b.getCompositeParent(E.cell),l=b.getCellGeometry(g);null!=g&&b.model.isVertex(g)&&null!=l&&l.relative;)g=b.model.getParent(g),l=b.getCellGeometry(g);b.connectVertex(E.cell,c,b.defaultEdgeLength,L,null,!0,mxUtils.bind(this,function(t,B,D){P.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(P.getGraphX(),P.getGraphY(),g,mxUtils.bind(this,function(I){D(I);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(I))}),c)}),30)}),mxUtils.bind(this,function(t){b.selectCellsForConnectVertex(t,+L)}))}}T=!1})})};EditorUi.prototype.centerShapePicker=function(b,d,m,n,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(m-=p.width/2-10,n-=p.height+6):v==mxConstants.DIRECTION_SOUTH?(m-=p.width/2-10,n+=d.height+6):v==mxConstants.DIRECTION_WEST?(m-=p.width+6,n-=p.height/2-10):v==mxConstants.DIRECTION_EAST&&(m+=d.width+6,n-=p.height/2-10);b.style.left=m+"px";b.style.top=n+"px"};EditorUi.prototype.showShapePicker=function(b,d,m,n,v,p,C,G,T){var E=null;this.editor.graph.freehand.isDrawing()||(G=G||null==m,E=this.createShapePicker(b,d,m,n,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(m,p,G),p,C,G,T),null!=E&&(null==this.hoverIcons||p||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=n,this.shapePicker=E));return E};-EditorUi.prototype.createShapePicker=function(b,d,m,n,v,p,C,G,T,E,Q){Q=null!=Q?Q:!0;var M=this.editor.graph,c=null;T=null!=T?T:function(t){t=t[0];var B=0,D=0,I=t.geometry;null!=I&&(M.model.isEdge(t)&&(t=I.getTerminalPoint(!1),I=new mxRectangle(0,0,t.x,t.y)),B=I.width/2,D=I.height/2);return new mxPoint(M.snap(Math.round(b/M.view.scale)-M.view.translate.x-B),M.snap(Math.round(d/M.view.scale)-M.view.translate.y-D))};if(null!=C&&0<C.length){var g=this;M=this.editor.graph;c=document.createElement("div");-v=M.view.getState(m);var l=null==m||null!=v&&M.isTransparentState(v)?null:M.copyStyle(m);c.className="geShapePicker";c.setAttribute("title",mxResources.get("sidebarTooltip"));c.style.left=Math.round(b)+"px";c.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(c.style.touchAction="none");G||mxUtils.setPrefixedStyle(c.style,"transform","translate(-22px,-22px)");M.container.appendChild(c);v=mxUtils.bind(this,function(t){var B=document.createElement("a");c.appendChild(B);null!=l&&"1"!=urlParams.sketch?-this.sidebar.graph.pasteStyle(l,[t]):this.sidebar.graph.pasteCellStyles([t],M.currentVertexStyle,M.currentEdgeStyle);var D=t.geometry;M.model.isEdge(t)&&(D=D.getTerminalPoint(!1),D=new mxRectangle(0,0,D.x,D.y));null!=D&&(D=this.sidebar.createVertexTemplateFromCells([t],D.width,D.height,"",!0,!1,null,!1,mxUtils.bind(this,function(I){if(!mxEvent.isAltDown(I)||1!=M.getSelectionCount()){if(!mxEvent.isShiftDown(I)||null==m&&M.isSelectionEmpty()){var L=M.cloneCell(t);if(null!=n)n(L);else{var N=T([L]);M.model.isEdge(L)?-L.geometry.translate(N.x,N.y):(L.geometry.x=N.x,L.geometry.y=N.y);M.model.beginUpdate();try{M.addCell(L),M.model.isVertex(L)&&M.isAutoSizeCell(L)&&M.updateCellSize(L)}finally{M.model.endUpdate()}M.setSelectionCell(L);M.scrollCellToVisible(L);Q&&M.startEditing(L);null!=g.hoverIcons&&g.hoverIcons.update(M.view.getState(L))}}else L=M.getEditableCells(null!=m?[m]:M.getSelectionCells()),M.updateShapes(t,L);null!=p&&p(I);mxEvent.consume(I)}}),25,25,null,null,m),D.style.display="flex",D.style.alignItems=-"center",D.style.justifyContent="center",B.appendChild(D))});for(E=0;E<(G?Math.min(C.length,4):C.length);E++)v(C[E]);C=c.offsetTop+c.clientHeight-(M.container.scrollTop+M.container.offsetHeight);0<C&&(c.style.top=Math.max(M.container.scrollTop+22,d-C)+"px");C=c.offsetLeft+c.clientWidth-(M.container.scrollLeft+M.container.offsetWidth);0<C&&(c.style.left=Math.max(M.container.scrollLeft+22,b-C)+"px")}return c};-EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var n=this.editor.graph,v=mxUtils.bind(this,function(p,C,G,T){return n.createVertex(null,null,T||"",0,0,C||120,G||60,p,!1)});d=mxUtils.bind(this,function(p,C,G){p=new mxCell(G||"",new mxGeometry(0,0,n.defaultEdgeLength+20,0),p);p.geometry.setTerminalPoint(new mxPoint(0,0),!0);p.geometry.setTerminalPoint(new mxPoint(p.geometry.width,null!=C?C:0),!1);p.geometry.points=null!=C?[new mxPoint(p.geometry.width/2,C)]:[];p.geometry.relative=!0;p.edge=-!0;return p});if(null!=b)try{b=n.cloneCell(b),n.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(p){b=null}null==b&&(b=v(n.appendFontSize(Editor.defaultTextStyle,n.vertexFontSize),60,30,"Text"));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)];m&&(b=b.concat([d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),d("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",-this.editor.graph.defaultEdgeLength/2)]));return b};EditorUi.prototype.isShapePickerVisible=function(b){return null!=this.shapePicker};EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};-EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};+EditorUi.prototype.createShapePicker=function(b,d,m,n,v,p,C,G,T,E,P){P=null!=P?P:!0;var L=this.editor.graph,c=null;T=null!=T?T:function(t){t=t[0];var B=0,D=0,I=t.geometry;null!=I&&(L.model.isEdge(t)&&(t=I.getTerminalPoint(!1),I=new mxRectangle(0,0,t.x,t.y)),B=I.width/2,D=I.height/2);return new mxPoint(L.snap(Math.round(b/L.view.scale)-L.view.translate.x-B),L.snap(Math.round(d/L.view.scale)-L.view.translate.y-D))};if(null!=C&&0<C.length){var g=this;L=this.editor.graph;c=document.createElement("div");+v=L.view.getState(m);var l=null==m||null!=v&&L.isTransparentState(v)?null:L.copyStyle(m);c.className="geShapePicker";c.setAttribute("title",mxResources.get("sidebarTooltip"));c.style.left=Math.round(b)+"px";c.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(c.style.touchAction="none");G||mxUtils.setPrefixedStyle(c.style,"transform","translate(-22px,-22px)");L.container.appendChild(c);v=mxUtils.bind(this,function(t){var B=document.createElement("a");c.appendChild(B);var D=t.shapePickerKeepStyle;+delete t.shapePickerKeepStyle;D||(null!=l&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(l,[t]):this.sidebar.graph.pasteCellStyles([t],L.currentVertexStyle,L.currentEdgeStyle));D=t.geometry;L.model.isEdge(t)&&(D=D.getTerminalPoint(!1),D=new mxRectangle(0,0,D.x,D.y));null!=D&&(D=this.sidebar.createVertexTemplateFromCells([t],D.width,D.height,"",!0,!1,null,!0,mxUtils.bind(this,function(I){if(!mxEvent.isAltDown(I)||1!=L.getSelectionCount()){if(!mxEvent.isShiftDown(I)||null==m&&L.isSelectionEmpty()){var K=+L.cloneCell(t);if(null!=n)n(K);else{var M=T([K]);L.model.isEdge(K)?K.geometry.translate(M.x,M.y):(K.geometry.x=M.x,K.geometry.y=M.y);L.model.beginUpdate();try{L.addCell(K),L.model.isVertex(K)&&L.isAutoSizeCell(K)&&L.updateCellSize(K)}finally{L.model.endUpdate()}L.setSelectionCell(K);L.scrollCellToVisible(K);P&&L.startEditing(K);null!=g.hoverIcons&&g.hoverIcons.update(L.view.getState(K))}}else K=L.getEditableCells(null!=m?[m]:L.getSelectionCells()),L.updateShapes(t,K);null!=p&&p(I);mxEvent.consume(I)}}),+25,25,null,null,m),D.style.display="flex",D.style.alignItems="center",D.style.justifyContent="center",B.appendChild(D))});for(E=0;E<(G?Math.min(C.length,4):C.length);E++)v(C[E]);C=c.offsetTop+c.clientHeight-(L.container.scrollTop+L.container.offsetHeight);0<C&&(c.style.top=Math.max(L.container.scrollTop+22,d-C)+"px");C=c.offsetLeft+c.clientWidth-(L.container.scrollLeft+L.container.offsetWidth);0<C&&(c.style.left=Math.max(L.container.scrollLeft+22,b-C)+"px")}return c};+EditorUi.prototype.defaultShapePickerEntries=null;+EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var n=this.editor.graph,v=mxUtils.bind(this,function(L,c,g,l){return n.createVertex(null,null,l||"",0,0,c||120,g||60,L,!1)});d=mxUtils.bind(this,function(L,c,g){L=new mxCell(g||"",new mxGeometry(0,0,n.defaultEdgeLength+20,0),L);L.geometry.setTerminalPoint(new mxPoint(0,0),!0);L.geometry.setTerminalPoint(new mxPoint(L.geometry.width,null!=c?c:0),!1);L.geometry.points=null!=c?[new mxPoint(L.geometry.width/2,c)]:[];L.geometry.relative=!0;L.edge=+!0;return L});if(null!=b)try{b=n.cloneCell(b),n.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(L){b=null}if(null!=this.defaultShapePickerEntries){for(var p=[],C=[],G=function(L){if(null!=L&&"object"===typeof L){var c=mxUtils.createXmlDocument().createElement("UserObject"),g;for(g in L)L.hasOwnProperty(g)&&c.setAttribute(g,L[g]);null==c.getAttribute("label")&&c.setAttribute("label","");return c}return L},T=0;T<this.defaultShapePickerEntries.length;T++){var E=this.defaultShapePickerEntries[T];+if(null!=E.style){var P=G(E.value);E.edge?C.push(d(E.style,E.y,P)):(P=v(E.style,E.width,E.height,P),E.keepStyle&&(P.shapePickerKeepStyle=!0),p.push(P))}}null!=b&&(p[0]=b);b=p;m&&(b=b.concat(C));return b}null==b&&(b=v(n.appendFontSize(Editor.defaultTextStyle,n.vertexFontSize),60,30,"Text"));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)];m&&(b=b.concat([d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),+d("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return b};EditorUi.prototype.isShapePickerVisible=function(b){return null!=this.shapePicker};+EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var m=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!m&&!mxClient.IS_IE&&!mxClient.IS_IE11){var n=window.getSelection(),v=0<n.rangeCount?n.getRangeAt(0).commonAncestorContainer:null;m=null!=v&&("LI"==v.nodeName||null!=v.parentNode&&"LI"==v.parentNode.nodeName)}m?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?d.stopEditing(!1):d.cellEditor.insertTab(d.cellEditor.isContentEditing()?null:4)}catch(p){}else mxEvent.isAltDown(b)?d.selectParentCell():d.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};EditorUi.prototype.onKeyPress=function(b){var d=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(b)===this.typingShim||!this.isImmediateEditingEvent(b)||d.isEditing()||d.isSelectionEmpty()||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(null==b.key||1!==b.key.length)&&229!==b.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(b)||(d.escape(),d.cellEditor.editByTyping=!0,d.startEditing())};-EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";this.typingShim=d;var m=!1,n=mxUtils.bind(this,-function(){if(!m&&0<d.value.length){var p=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,p)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;n()});mxEvent.addListener(d,"input",function(){n()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(p){229!==p.keyCode&&(mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||(null==p.key||1!==p.key.length||mxEvent.isAltDown(p)?p.preventDefault():-null!=this.keyHandler&&null!=this.keyHandler.getFunction(p)&&p.preventDefault()))}));b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));b.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));b.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));-if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var v=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?v.apply(b.cellEditor):this.updateTypingShim()})};+EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&d.setAttribute("inputmode","none");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";+this.typingShim=d;var m=!1,n=mxUtils.bind(this,function(){if(!m&&0<d.value.length){var p=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,p)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;n()});mxEvent.addListener(d,"input",function(){n()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(p){229!==p.keyCode&&(mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||(null==p.key||+1!==p.key.length||mxEvent.isAltDown(p)?p.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(p)&&p.preventDefault()))}));b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));b.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));b.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,+function(){this.updateTypingShim()}),0)}));if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var v=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?v.apply(b.cellEditor):this.updateTypingShim()})};EditorUi.prototype.updateTypingShim=function(){var b=this.editor.graph;b.isEditing()||b.isSelectionEmpty()||!b.isEnabled()||b.isCellLocked(b.getSelectionCell())?this.hideTypingShim():this.showTypingShim()};EditorUi.prototype.showTypingShim=function(){var b=this.editor.graph,d=this.typingShim;if(null!=d&&!b.isEditing()){var m=b.getSelectionCell();m=b.getView().getState(m);null!=m&&(d.style.left=Math.round(m.x)+"px",d.style.top=Math.round(m.y)+"px",d.parentNode!==b.container&&b.container.appendChild(d),d.value="",m=document.activeElement,(null==m||m===document.body||m===b.container||b.container.contains(m))&&d.focus({preventScroll:!0}))}};EditorUi.prototype.hideTypingShim=function(){var b=this.typingShim;null!=b&&null!=b.parentNode&&b.parentNode.removeChild(b)};EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};EditorUi.prototype.updateCssForMarker=function(b,d,m,n,v){m=this.getImageForMarker(n,v,m);b.innerHTML="";null==m?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(n=document.createElement("img"),n.setAttribute("src",m),"end"==d&&mxUtils.setPrefixedStyle(n.style,"transform","scaleX(-1)"),b.appendChild(n))};@@ -2164,49 +2166,49 @@ EditorUi.prototype.getImageForEdgeShape=function(b){var d=Format.connectionImageEditorUi.prototype.getImageForEdgeStyle=function(b){var d=Format.orthogonalImage.src,m=mxUtils.getValue(b,mxConstants.STYLE_EDGE,null);"1"==mxUtils.getValue(b,mxConstants.STYLE_NOEDGESTYLE,null)&&(m=null);"orthogonalEdgeStyle"==m&&"1"==mxUtils.getValue(b,mxConstants.STYLE_CURVED,null)?d=Format.curvedImage.src:"straight"==m||"none"==m||null==m?d=Format.straightImage.src:"entityRelationEdgeStyle"==m?d=Format.entityImage.src:"elbowEdgeStyle"==m?d="vertical"==mxUtils.getValue(b,mxConstants.STYLE_ELBOW,null)?Format.verticalElbowImage.src:Format.horizontalElbowImage.src:"isometricEdgeStyle"==m&&(d="vertical"==mxUtils.getValue(b,mxConstants.STYLE_ELBOW,null)?Format.verticalIsometricImage.src:Format.horizontalIsometricImage.src);return d};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,d=this.actions.get("paste"),m=this.actions.get("pasteHere");d.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));m.setEnabled(d.isEnabled())};-EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var C=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{C=C||p.getSelectionCells();C=p.getExportableCells(p.model.getTopmostCells(C));for(var G={},T=p.createCellLookup(C),E=p.cloneCells(C,null,G),Q=new mxGraphModel,M=Q.getChildAt(Q.getRoot(),-0),c=0;c<E.length;c++){Q.add(M,E[c]);var g=p.view.getState(C[c]);if(null!=g){var l=p.getCellGeometry(E[c]);null!=l&&l.relative&&!Q.isEdge(C[c])&&null==T[mxObjectIdentity.get(Q.getParent(C[c]))]&&(l.offset=null,l.relative=!1,l.x=g.x/g.view.scale-g.view.translate.x,l.y=g.y/g.view.scale-g.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(G,T),E);mxClipboard.insertCount=1;mxClipboard.setCells(E)}b.updatePasteActionStates();return C};var m=mxClipboard.paste;mxClipboard.paste=function(p){var C=+EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var C=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{C=C||p.getSelectionCells();C=p.getExportableCells(p.model.getTopmostCells(C));for(var G={},T=p.createCellLookup(C),E=p.cloneCells(C,null,G),P=new mxGraphModel,L=P.getChildAt(P.getRoot(),+0),c=0;c<E.length;c++){P.add(L,E[c]);var g=p.view.getState(C[c]);if(null!=g){var l=p.getCellGeometry(E[c]);null!=l&&l.relative&&!P.isEdge(C[c])&&null==T[mxObjectIdentity.get(P.getParent(C[c]))]&&(l.offset=null,l.relative=!1,l.x=g.x/g.view.scale-g.view.translate.x,l.y=g.y/g.view.scale-g.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(G,T),E);mxClipboard.insertCount=1;mxClipboard.setCells(E)}b.updatePasteActionStates();return C};var m=mxClipboard.paste;mxClipboard.paste=function(p){var C=null;p.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):C=m.apply(this,arguments);b.updatePasteActionStates();return C};var n=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){n.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(p,C){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 W=this.graph.getPageLayout(),U=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+W.x*U.width),this.scale*(this.translate.y+W.y*U.height),this.scale*W.width*U.width,-this.scale*W.height*U.height)};b.getPreferredPageSize=function(W,U,aa){W=this.getPageLayout();U=this.getPageSize();return new mxRectangle(0,0,W.width*U.width,W.height*U.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(W,U,aa,ia){if(null!=b.container&&!b.isViewer()){aa=null!=aa?aa:0;ia=null!=ia?ia:0;var na=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),qa=mxUtils.hasScrollbars(b.container),ta=b.view.translate,ua=b.view.scale,-Ba=mxRectangle.fromRectangle(na);Ba.x=Ba.x/ua-ta.x;Ba.y=Ba.y/ua-ta.y;Ba.width/=ua;Ba.height/=ua;ta=b.container.scrollTop;var za=b.container.scrollLeft,Aa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)Aa+=3;var Ga=b.container.offsetWidth-Aa;Aa=b.container.offsetHeight-Aa;W=W?Math.max(.3,Math.min(U||1,Ga/Ba.width)):ua;U=(Ga-W*Ba.width)/2/W;var Ra=0==this.lightboxVerticalDivider?0:(Aa-W*Ba.height)/this.lightboxVerticalDivider/W;qa&&(U=Math.max(U,0),Ra=Math.max(Ra,-0));if(qa||na.width<Ga||na.height<Aa)b.view.scaleAndTranslate(W,Math.floor(U-Ba.x),Math.floor(Ra-Ba.y)),b.container.scrollTop=ta*W/ua,b.container.scrollLeft=za*W/ua;else if(0!=aa||0!=ia)na=b.view.translate,b.view.setTranslate(Math.floor(na.x+aa/ua),Math.floor(na.y+ia/ua))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var n=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",n);this.destroyFunctions.push(function(){mxEvent.removeListener(window,-"resize",n)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(W){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(W){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 Z=this.graph.getPageLayout(),U=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+Z.x*U.width),this.scale*(this.translate.y+Z.y*U.height),this.scale*Z.width*U.width,+this.scale*Z.height*U.height)};b.getPreferredPageSize=function(Z,U,ba){Z=this.getPageLayout();U=this.getPageSize();return new mxRectangle(0,0,Z.width*U.width,Z.height*U.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(Z,U,ba,fa){if(null!=b.container&&!b.isViewer()){ba=null!=ba?ba:0;fa=null!=fa?fa:0;var na=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),pa=mxUtils.hasScrollbars(b.container),ta=b.view.translate,ua=b.view.scale,+Ca=mxRectangle.fromRectangle(na);Ca.x=Ca.x/ua-ta.x;Ca.y=Ca.y/ua-ta.y;Ca.width/=ua;Ca.height/=ua;ta=b.container.scrollTop;var Ba=b.container.scrollLeft,Aa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)Aa+=3;var Fa=b.container.offsetWidth-Aa;Aa=b.container.offsetHeight-Aa;Z=Z?Math.max(.3,Math.min(U||1,Fa/Ca.width)):ua;U=(Fa-Z*Ca.width)/2/Z;var Sa=0==this.lightboxVerticalDivider?0:(Aa-Z*Ca.height)/this.lightboxVerticalDivider/Z;pa&&(U=Math.max(U,0),Sa=Math.max(Sa,+0));if(pa||na.width<Fa||na.height<Aa)b.view.scaleAndTranslate(Z,Math.floor(U-Ca.x),Math.floor(Sa-Ca.y)),b.container.scrollTop=ta*Z/ua,b.container.scrollLeft=Ba*Z/ua;else if(0!=ba||0!=fa)na=b.view.translate,b.view.setTranslate(Math.floor(na.x+ba/ua),Math.floor(na.y+fa/ua))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var n=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",n);this.destroyFunctions.push(function(){mxEvent.removeListener(window,+"resize",n)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(Z){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(Z){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 W=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=W?parseInt(W["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var C=0;p=mxUtils.bind(this,function(W,U,aa){C++;-var ia=document.createElement("span");ia.style.paddingLeft="8px";ia.style.paddingRight="8px";ia.style.cursor="pointer";mxEvent.addListener(ia,"click",W);null!=aa&&ia.setAttribute("title",aa);W=document.createElement("img");W.setAttribute("border","0");W.setAttribute("src",U);W.style.width="36px";W.style.filter="invert(100%)";ia.appendChild(W);this.chromelessToolbar.appendChild(ia);return ia});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&p(mxUtils.bind(this,function(W){window.location.href=-G;mxEvent.consume(W)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var T=p(mxUtils.bind(this,function(W){this.actions.get("previousPage").funct();mxEvent.consume(W)}),Editor.chevronLeftImage,mxResources.get("previousPage")),E=document.createElement("div");E.style.fontFamily=Editor.defaultHtmlFont;E.style.display="inline-block";E.style.verticalAlign="top";E.style.fontWeight="bold";E.style.marginTop="8px";E.style.fontSize="14px";E.style.cursor="default";E.style.color=-mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(E);var Q=p(mxUtils.bind(this,function(W){this.actions.get("nextPage").funct();mxEvent.consume(W)}),Editor.chevronRightImage,mxResources.get("nextPage")),M=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){E.innerText="";var W=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(E,W+1+" / "+this.pages.length);E.setAttribute("title",mxResources.get("currentPage")+-": "+this.currentPage.getName());T.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(W-1,this.pages.length)].getName());Q.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(W+1,this.pages.length)].getName())}});T.style.paddingLeft="0px";T.style.paddingRight="4px";Q.style.paddingLeft="4px";Q.style.paddingRight="0px";var c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(Q.style.display="",T.style.display=-"",E.style.display="inline-block"):(Q.style.display="none",T.style.display="none",E.style.display="none");M()});if(null!=this.menus){var g=this.menus.get("pages");null!=g&&mxEvent.addListener(E,"click",mxUtils.bind(this,function(W){var U=new mxPopupMenu(g.funct);U.smartSeparators=!0;U.showDisabled=!0;U.autoExpand=!0;U.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(U,arguments);U.destroy()});var aa=mxUtils.getOffset(E);U.popup(aa.x,aa.y+E.offsetHeight,null,W);mxEvent.addListener(U.div,-"mouseleave",mxUtils.bind(this,function(){U.hideMenu()}))}))}this.editor.addListener("resetGraphView",c);this.editor.addListener("pageSelected",M)}p(mxUtils.bind(this,function(W){this.actions.get("zoomOut").funct();mxEvent.consume(W)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(W){this.actions.get("zoomIn").funct();mxEvent.consume(W)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(W){this.actions.get("smartFit").funct();-mxEvent.consume(W)}),Editor.zoomFitImage,mxResources.get("fit"));var l=null,t=null,B=mxUtils.bind(this,function(W){null!=l&&(window.clearTimeout(l),l=null);null!=t&&(window.clearTimeout(t),t=null);l=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);l=null;t=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";t=null}),600)}),W||200)}),D=mxUtils.bind(this,function(W){null!=l&&(window.clearTimeout(l),l=null);null!=t&&(window.clearTimeout(t),-t=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,W||30)});if("1"==urlParams.layers){this.layersDialog=null;var I=p(mxUtils.bind(this,function(W){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);+"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var Z=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=Z?parseInt(Z["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var C=0;p=mxUtils.bind(this,function(Z,U,ba){C++;+var fa=document.createElement("span");fa.style.paddingLeft="8px";fa.style.paddingRight="8px";fa.style.cursor="pointer";mxEvent.addListener(fa,"click",Z);null!=ba&&fa.setAttribute("title",ba);Z=document.createElement("img");Z.setAttribute("border","0");Z.setAttribute("src",U);Z.style.width="36px";Z.style.filter="invert(100%)";fa.appendChild(Z);this.chromelessToolbar.appendChild(fa);return fa});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&p(mxUtils.bind(this,function(Z){window.location.href=+G;mxEvent.consume(Z)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var T=p(mxUtils.bind(this,function(Z){this.actions.get("previousPage").funct();mxEvent.consume(Z)}),Editor.chevronLeftImage,mxResources.get("previousPage")),E=document.createElement("div");E.style.fontFamily=Editor.defaultHtmlFont;E.style.display="inline-block";E.style.verticalAlign="top";E.style.fontWeight="bold";E.style.marginTop="8px";E.style.fontSize="14px";E.style.cursor="default";E.style.color=+mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(E);var P=p(mxUtils.bind(this,function(Z){this.actions.get("nextPage").funct();mxEvent.consume(Z)}),Editor.chevronRightImage,mxResources.get("nextPage")),L=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){E.innerText="";var Z=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(E,Z+1+" / "+this.pages.length);E.setAttribute("title",mxResources.get("currentPage")++": "+this.currentPage.getName());T.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(Z-1,this.pages.length)].getName());P.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(Z+1,this.pages.length)].getName())}});T.style.paddingLeft="0px";T.style.paddingRight="4px";P.style.paddingLeft="4px";P.style.paddingRight="0px";var c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(P.style.display="",T.style.display=+"",E.style.display="inline-block"):(P.style.display="none",T.style.display="none",E.style.display="none");L()});if(null!=this.menus){var g=this.menus.get("pages");null!=g&&mxEvent.addListener(E,"click",mxUtils.bind(this,function(Z){var U=new mxPopupMenu(g.funct);U.smartSeparators=!0;U.showDisabled=!0;U.autoExpand=!0;U.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(U,arguments);U.destroy()});var ba=mxUtils.getOffset(E);U.popup(ba.x,ba.y+E.offsetHeight,null,Z);mxEvent.addListener(U.div,+"mouseleave",mxUtils.bind(this,function(){U.hideMenu()}))}))}this.editor.addListener("resetGraphView",c);this.editor.addListener("pageSelected",L)}p(mxUtils.bind(this,function(Z){this.actions.get("zoomOut").funct();mxEvent.consume(Z)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(Z){this.actions.get("zoomIn").funct();mxEvent.consume(Z)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(Z){this.actions.get("smartFit").funct();+mxEvent.consume(Z)}),Editor.zoomFitImage,mxResources.get("fit"));var l=null,t=null,B=mxUtils.bind(this,function(Z){null!=l&&(window.clearTimeout(l),l=null);null!=t&&(window.clearTimeout(t),t=null);l=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);l=null;t=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";t=null}),600)}),Z||200)}),D=mxUtils.bind(this,function(Z){null!=l&&(window.clearTimeout(l),l=null);null!=t&&(window.clearTimeout(t),+t=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,Z||30)});if("1"==urlParams.layers){this.layersDialog=null;var I=p(mxUtils.bind(this,function(Z){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 U=I.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=U.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));U=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=U.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(W)}),Editor.layersImage,-mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){I.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(W){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"==this.editor.editButtonLink){var U=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),-null,null,U)}else b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(W)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(c=0;c<this.lightboxToolbarActions.length;c++){var N=this.lightboxToolbarActions[c];N.elem=p(N.fn,N.icon,N.tooltip)}if(null!=v.refreshBtn){var K=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(W){null!=K?window.location.href=K:window.location.reload();mxEvent.consume(W)}),Editor.refreshImage,-mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(W){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(W)}),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(W){"1"==urlParams.close||v.closeBtn?-window.close():(this.destroy(),mxEvent.consume(W))}),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(W){mxEvent.isTouchEvent(W)||(mxEvent.isShiftDown(W)||D(30),B())}));mxEvent.addListener(this.chromelessToolbar,-mxClient.IS_POINTER?"pointermove":"mousemove",function(W){mxEvent.consume(W)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(W){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(W)?B():D(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(W){mxEvent.isShiftDown(W)?B():D(100);mxEvent.consume(W)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(W){mxEvent.isTouchEvent(W)||-D(30)}));var da=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(W,U){this.startX=U.getGraphX();this.startY=U.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(W,U){},mouseUp:function(W,U){mxEvent.isTouchEvent(U.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<da&&Math.abs(this.scrollTop-b.container.scrollTop)<da&&Math.abs(this.startX-U.getGraphX())<da&&Math.abs(this.startY-U.getGraphY())<-da&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?B():D(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ja=b.view.validate,ea=new mxPoint,ca=!1,fa=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&fa!=m.currentPage){fa=m.currentPage;ca=!0;var W=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==W&&(W=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*-b.view.scale));W=b.getPageLayout(W,ea,1);var U=b.getDefaultTranslate(W);this.x0=W.x;this.y0=W.y;if(U.x!=this.translate.x||U.y!=this.translate.y)this.invalidate(),this.translate.x=U.x,this.translate.y=U.y}U=b.getPagePadding();var aa=b.getPageSize();W=U.x-(this.x0||0)*aa.width;U=U.y-(this.y0||0)*aa.height;if(this.translate.x!=W||this.translate.y!=U)this.invalidate(),this.translate.x=W,this.translate.y=U}ja.apply(this,arguments)};if(!b.isViewer()){var la=b.sizeDidChange;b.sizeDidChange=function(){var W=-ca;ca=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var U=this.getPageLayout(),aa=this.getDefaultTranslate(U),ia=this.view.translate.x,na=this.view.translate.y;if(aa.x!=ia||aa.y!=na){this.view.x0=U.x;this.view.y0=U.y;this.autoTranslate=!0;this.view.setTranslate(aa.x,aa.y);this.autoTranslate=!1;W||(this.container.scrollLeft+=Math.round((aa.x-ia)*this.view.scale),this.container.scrollTop+=Math.round((aa.y-na)*this.view.scale));return}}la.apply(this,-arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ka=b.view.getBackgroundPane(),V=b.view.getDrawPane();b.cumulativeZoomFactor=1;var k=null,x=null,J=null,R=null,Y=null,Z=function(W){null!=k&&window.clearTimeout(k);0<=W&&window.setTimeout(function(){if(!b.isMouseDown||R)k=window.setTimeout(mxUtils.bind(this,function(){if(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));V.style.transformOrigin="";ka.style.transformOrigin="";mxClient.IS_SF?(V.style.transform="scale(1)",ka.style.transform="scale(1)",window.setTimeout(function(){V.style.transform="";ka.style.transform=""},0)):(V.style.transform="",ka.style.transform="");b.view.getDecoratorPane().style.opacity="";b.view.getOverlayPane().style.opacity="";for(var U=b.container.querySelectorAll(".geHint"),aa=0;aa<-U.length;aa++)U[aa].style.opacity=""}U=new mxPoint(b.container.scrollLeft,b.container.scrollTop);aa=mxUtils.getOffset(b.container);var ia=b.view.scale,na=0,qa=0;null!=x&&(na=b.container.offsetWidth/2-x.x+aa.x,qa=b.container.offsetHeight/2-x.y+aa.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=ia&&(null!=J&&(na+=U.x-J.x,qa+=U.y-J.y),null!=d&&m.chromelessResize(!1,null,na*(b.cumulativeZoomFactor-1),qa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||-0==na&&0==qa||(b.container.scrollLeft-=na*(b.cumulativeZoomFactor-1),b.container.scrollTop-=qa*(b.cumulativeZoomFactor-1)));null!=Y&&V.setAttribute("filter",Y);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;Y=R=x=J=k=null}),null!=W?W:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(W,U,aa,ia){ia=null!=ia?ia:this.zoomFactor;(U=U||!b.scrollbars)&&(x=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/-2));W?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ia,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/=ia,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==Y&&""!=V.getAttribute("filter")&&(Y=V.getAttribute("filter"),V.removeAttribute("filter"));J=new mxPoint(b.container.scrollLeft,b.container.scrollTop);W=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);ia=U||null==x?b.container.scrollLeft+b.container.clientWidth/2:x.x+b.container.scrollLeft-b.container.offsetLeft;-var na=U||null==x?b.container.scrollTop+b.container.clientHeight/2:x.y+b.container.scrollTop-b.container.offsetTop;V.style.transformOrigin=ia+"px "+na+"px";V.style.transform="scale("+W+")";ka.style.transformOrigin=ia+"px "+na+"px";ka.style.transform="scale("+W+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ia=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ia.style,"transform-origin",(U||null==x?b.container.clientWidth/2+b.container.scrollLeft-ia.offsetLeft+-"px":x.x+b.container.scrollLeft-ia.offsetLeft-b.container.offsetLeft+"px")+" "+(U||null==x?b.container.clientHeight/2+b.container.scrollTop-ia.offsetTop+"px":x.y+b.container.scrollTop-ia.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ia.style,"transform","scale("+W+")")):b.view.validateBackgroundStyles(W,ia,na);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";U=b.container.querySelectorAll(".geHint");for(ia=0;ia<U.length;ia++)U[ia].style.opacity=-"0";b.fireEvent(new mxEventObject("zoomPreview","factor",W))}Z(b.isFastZoomEnabled()?aa:0)};mxEvent.addGestureListeners(b.container,function(W){null!=k&&window.clearTimeout(k)},null,function(W){1!=b.cumulativeZoomFactor&&Z(0)});mxEvent.addListener(b.container,"scroll",function(W){null==k||b.isMouseDown||1==b.cumulativeZoomFactor||Z(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(W,U,aa,ia,na){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&-!aa&&b.isScrollWheelEvent(W))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=W.deltaX?W.deltaX:0,deltaY:null!=W.deltaY?W.deltaY:U?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!aa&&b.isScrollWheelEvent(W))ia=b.view.getTranslate(),na=40/b.view.scale,mxEvent.isShiftDown(W)?b.view.setTranslate(ia.x+(U?-na:na),ia.y):b.view.setTranslate(ia.x,ia.y+(U?na:-na));else if(aa||b.isZoomWheelEvent(W))for(var qa=-mxEvent.getSource(W);null!=qa;){if(qa==b.container){b.tooltipHandler.hideTooltip();ia=null!=ia&&null!=na?new mxPoint(ia,na):new mxPoint(mxEvent.getClientX(W),mxEvent.getClientY(W));na=null!=x?new mxPoint(x.x,x.y):null;qa=b.cumulativeZoomFactor;x=ia;R=aa;aa=b.zoomFactor;var ta=null;W.ctrlKey&&null!=W.deltaY&&40>Math.abs(W.deltaY)&&Math.round(W.deltaY)!=W.deltaY?aa=1+Math.abs(W.deltaY)/20*(aa-1):null!=W.movementY&&"pointermove"==W.type&&(aa=1+Math.max(1,Math.abs(W.movementY))/20*(aa-1),ta=-1);b.lazyZoom(U,-null,ta,aa);null!=na&&1!=qa&&b.isFastZoomEnabled()&&b.scrollbars&&(U=b.cumulativeZoomFactor,aa=U/qa,ta=1-U,.001<Math.abs(ta)&&(x=new mxPoint((ia.x*(1-aa)+aa*na.x*(1-qa))/ta,(ia.y*(1-aa)+aa*na.y*(1-qa))/ta),ia=x.x+b.container.scrollLeft-b.container.offsetLeft,na=x.y+b.container.scrollTop-b.container.offsetTop,V.style.transformOrigin=ia+"px "+na+"px",ka.style.transformOrigin=ia+"px "+na+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(U=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(U.style,-"transform-origin",x.x+b.container.scrollLeft-U.offsetLeft-b.container.offsetLeft+"px "+(x.y+b.container.scrollTop-U.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*U*100)/100*20)/(20*b.view.scale),ia,na)));mxEvent.consume(W);return!1}qa=qa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(W){b.cumulativeZoomFactor=W.scale;b.lazyZoom(0<W.scale,!0);mxEvent.consume(W)}};+(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));U=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=U.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(Z)}),Editor.layersImage,+mxResources.get("layers")),K=b.getModel();K.addListener(mxEvent.CHANGE,function(){I.style.display=1<K.getChildCount(K.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(Z){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"==this.editor.editButtonLink){var U=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),+null,null,U)}else b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(Z)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(c=0;c<this.lightboxToolbarActions.length;c++){var M=this.lightboxToolbarActions[c];M.elem=p(M.fn,M.icon,M.tooltip)}if(null!=v.refreshBtn){var V=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(Z){null!=V?window.location.href=V:window.location.reload();mxEvent.consume(Z)}),Editor.refreshImage,+mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(Z){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(Z)}),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(Z){"1"==urlParams.close||v.closeBtn?+window.close():(this.destroy(),mxEvent.consume(Z))}),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(Z){mxEvent.isTouchEvent(Z)||(mxEvent.isShiftDown(Z)||D(30),B())}));mxEvent.addListener(this.chromelessToolbar,+mxClient.IS_POINTER?"pointermove":"mousemove",function(Z){mxEvent.consume(Z)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(Z){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(Z)?B():D(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(Z){mxEvent.isShiftDown(Z)?B():D(100);mxEvent.consume(Z)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(Z){mxEvent.isTouchEvent(Z)||+D(30)}));var Q=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(Z,U){this.startX=U.getGraphX();this.startY=U.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(Z,U){},mouseUp:function(Z,U){mxEvent.isTouchEvent(U.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<Q&&Math.abs(this.scrollTop-b.container.scrollTop)<Q&&Math.abs(this.startX-U.getGraphX())<Q&&Math.abs(this.startY-U.getGraphY())<+Q&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?B():D(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ja=b.view.validate,ea=new mxPoint,da=!1,ia=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ia!=m.currentPage){ia=m.currentPage;da=!0;var Z=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==Z&&(Z=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*+b.view.scale));Z=b.getPageLayout(Z,ea,1);var U=b.getDefaultTranslate(Z);this.x0=Z.x;this.y0=Z.y;if(U.x!=this.translate.x||U.y!=this.translate.y)this.invalidate(),this.translate.x=U.x,this.translate.y=U.y}U=b.getPagePadding();var ba=b.getPageSize();Z=U.x-(this.x0||0)*ba.width;U=U.y-(this.y0||0)*ba.height;if(this.translate.x!=Z||this.translate.y!=U)this.invalidate(),this.translate.x=Z,this.translate.y=U}ja.apply(this,arguments)};if(!b.isViewer()){var la=b.sizeDidChange;b.sizeDidChange=function(){var Z=+da;da=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var U=this.getPageLayout(),ba=this.getDefaultTranslate(U),fa=this.view.translate.x,na=this.view.translate.y;if(ba.x!=fa||ba.y!=na){this.view.x0=U.x;this.view.y0=U.y;this.autoTranslate=!0;this.view.setTranslate(ba.x,ba.y);this.autoTranslate=!1;Z||(this.container.scrollLeft+=Math.round((ba.x-fa)*this.view.scale),this.container.scrollTop+=Math.round((ba.y-na)*this.view.scale));return}}la.apply(this,+arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ka=b.view.getBackgroundPane(),W=b.view.getDrawPane();b.cumulativeZoomFactor=1;var k=null,y=null,J=null,R=null,X=null,aa=function(Z){null!=k&&window.clearTimeout(k);0<=Z&&window.setTimeout(function(){if(!b.isMouseDown||R)k=window.setTimeout(mxUtils.bind(this,function(){if(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));W.style.transformOrigin="";ka.style.transformOrigin="";mxClient.IS_SF?(W.style.transform="scale(1)",ka.style.transform="scale(1)",window.setTimeout(function(){W.style.transform="";ka.style.transform=""},0)):(W.style.transform="",ka.style.transform="");b.view.getDecoratorPane().style.opacity="";b.view.getOverlayPane().style.opacity="";for(var U=b.container.querySelectorAll(".geHint"),ba=0;ba<+U.length;ba++)U[ba].style.opacity=""}U=new mxPoint(b.container.scrollLeft,b.container.scrollTop);ba=mxUtils.getOffset(b.container);var fa=b.view.scale,na=0,pa=0;null!=y&&(na=b.container.offsetWidth/2-y.x+ba.x,pa=b.container.offsetHeight/2-y.y+ba.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=fa&&(null!=J&&(na+=U.x-J.x,pa+=U.y-J.y),null!=d&&m.chromelessResize(!1,null,na*(b.cumulativeZoomFactor-1),pa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||+0==na&&0==pa||(b.container.scrollLeft-=na*(b.cumulativeZoomFactor-1),b.container.scrollTop-=pa*(b.cumulativeZoomFactor-1)));null!=X&&W.setAttribute("filter",X);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;X=R=y=J=k=null}),null!=Z?Z:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(Z,U,ba,fa){fa=null!=fa?fa:this.zoomFactor;(U=U||!b.scrollbars)&&(y=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/+2));Z?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=fa,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/=fa,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==X&&""!=W.getAttribute("filter")&&(X=W.getAttribute("filter"),W.removeAttribute("filter"));J=new mxPoint(b.container.scrollLeft,b.container.scrollTop);Z=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);fa=U||null==y?b.container.scrollLeft+b.container.clientWidth/2:y.x+b.container.scrollLeft-b.container.offsetLeft;+var na=U||null==y?b.container.scrollTop+b.container.clientHeight/2:y.y+b.container.scrollTop-b.container.offsetTop;W.style.transformOrigin=fa+"px "+na+"px";W.style.transform="scale("+Z+")";ka.style.transformOrigin=fa+"px "+na+"px";ka.style.transform="scale("+Z+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(fa=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(fa.style,"transform-origin",(U||null==y?b.container.clientWidth/2+b.container.scrollLeft-fa.offsetLeft++"px":y.x+b.container.scrollLeft-fa.offsetLeft-b.container.offsetLeft+"px")+" "+(U||null==y?b.container.clientHeight/2+b.container.scrollTop-fa.offsetTop+"px":y.y+b.container.scrollTop-fa.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(fa.style,"transform","scale("+Z+")")):b.view.validateBackgroundStyles(Z,fa,na);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";U=b.container.querySelectorAll(".geHint");for(fa=0;fa<U.length;fa++)U[fa].style.opacity=+"0";b.fireEvent(new mxEventObject("zoomPreview","factor",Z))}aa(b.isFastZoomEnabled()?ba:0)};mxEvent.addGestureListeners(b.container,function(Z){null!=k&&window.clearTimeout(k)},null,function(Z){1!=b.cumulativeZoomFactor&&aa(0)});mxEvent.addListener(b.container,"scroll",function(Z){null==k||b.isMouseDown||1==b.cumulativeZoomFactor||aa(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(Z,U,ba,fa,na){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&+!ba&&b.isScrollWheelEvent(Z))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=Z.deltaX?Z.deltaX:0,deltaY:null!=Z.deltaY?Z.deltaY:U?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!ba&&b.isScrollWheelEvent(Z))fa=b.view.getTranslate(),na=40/b.view.scale,mxEvent.isShiftDown(Z)?b.view.setTranslate(fa.x+(U?-na:na),fa.y):b.view.setTranslate(fa.x,fa.y+(U?na:-na));else if(ba||b.isZoomWheelEvent(Z))for(var pa=+mxEvent.getSource(Z);null!=pa;){if(pa==b.container){b.tooltipHandler.hideTooltip();fa=null!=fa&&null!=na?new mxPoint(fa,na):new mxPoint(mxEvent.getClientX(Z),mxEvent.getClientY(Z));na=null!=y?new mxPoint(y.x,y.y):null;pa=b.cumulativeZoomFactor;y=fa;R=ba;ba=b.zoomFactor;var ta=null;Z.ctrlKey&&null!=Z.deltaY&&40>Math.abs(Z.deltaY)&&Math.round(Z.deltaY)!=Z.deltaY?ba=1+Math.abs(Z.deltaY)/20*(ba-1):null!=Z.movementY&&"pointermove"==Z.type&&(ba=1+Math.max(1,Math.abs(Z.movementY))/20*(ba-1),ta=-1);b.lazyZoom(U,+null,ta,ba);null!=na&&1!=pa&&b.isFastZoomEnabled()&&b.scrollbars&&(U=b.cumulativeZoomFactor,ba=U/pa,ta=1-U,.001<Math.abs(ta)&&(y=new mxPoint((fa.x*(1-ba)+ba*na.x*(1-pa))/ta,(fa.y*(1-ba)+ba*na.y*(1-pa))/ta),fa=y.x+b.container.scrollLeft-b.container.offsetLeft,na=y.y+b.container.scrollTop-b.container.offsetTop,W.style.transformOrigin=fa+"px "+na+"px",ka.style.transformOrigin=fa+"px "+na+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(U=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(U.style,+"transform-origin",y.x+b.container.scrollLeft-U.offsetLeft-b.container.offsetLeft+"px "+(y.y+b.container.scrollTop-U.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*U*100)/100*20)/(20*b.view.scale),fa,na)));mxEvent.consume(Z);return!1}pa=pa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(Z){b.cumulativeZoomFactor=Z.scale;b.lazyZoom(0<Z.scale,!0);mxEvent.consume(Z)}};EditorUi.prototype.addChromelessToolbarItems=function(b){"1"!=urlParams.noPrint&&b(mxUtils.bind(this,function(d){this.actions.get("print").funct();mxEvent.consume(d)}),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;if(null!=this.format){var d=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.formatContainer.style,"transition","width "+d+"s ease-in-out");window.setTimeout(mxUtils.bind(this,function(){this.formatWidth=b?240:0;this.hsplitPosition=Math.min(this.container.clientWidth-this.hsplit.clientWidth-this.formatWidth,this.hsplitPosition);this.refresh();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.formatContainer.style,@@ -2259,11 +2261,11 @@ EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Grap"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(m,100);mxUtils.setPrefixedStyle(m.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(m.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(m.style,"transform","scaleX(0)");mxUtils.setOpacity(m,0);window.setTimeout(mxUtils.bind(this,function(){null!=m.parentNode&&m.parentNode.removeChild(m)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[d])};EditorUi.prototype.clearStatus=function(){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus("")}))};EditorUi.prototype.updateStatus=function(b){null!=b&&b();this.lastStatusUpdate=b};EditorUi.prototype.updateStatusAgain=function(){null!=this.lastStatusUpdate&&this.lastStatusUpdate()};EditorUi.prototype.createStatusDiv=function(b){var d=document.createElement("div");d.className="geStatusDiv";d.setAttribute("title",b);d.innerText=b;return d};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.createDiv=function(b){var d=document.createElement("div");d.className=b;return d};-EditorUi.prototype.addSplitHandler=function(b,d,m,n){function v(M){if(null!=C){var c=new mxPoint(mxEvent.getClientX(M),mxEvent.getClientY(M));n(Math.max(0,G+(d?c.x-C.x:C.y-c.y)-m));mxEvent.consume(M);G!=Q()&&(T=!0,E=null)}}function p(M){v(M);C=G=null}var C=null,G=null,T=!0,E=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var Q=mxUtils.bind(this,function(){var M=parseInt(d?b.offsetLeft:b.offsetTop);d||(M+=m);return M});mxEvent.addGestureListeners(b,function(M){C=new mxPoint(mxEvent.getClientX(M),-mxEvent.getClientY(M));G=Q();T=!1;mxEvent.consume(M)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(M){if(!T&&this.hsplitClickEnabled){var c=null!=E?E-m:0;E=Q();n(c);mxEvent.consume(M)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};+EditorUi.prototype.addSplitHandler=function(b,d,m,n){function v(L){if(null!=C){var c=new mxPoint(mxEvent.getClientX(L),mxEvent.getClientY(L));n(Math.max(0,G+(d?c.x-C.x:C.y-c.y)-m));mxEvent.consume(L);G!=P()&&(T=!0,E=null)}}function p(L){v(L);C=G=null}var C=null,G=null,T=!0,E=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var P=mxUtils.bind(this,function(){var L=parseInt(d?b.offsetLeft:b.offsetTop);d||(L+=m);return L});mxEvent.addGestureListeners(b,function(L){C=new mxPoint(mxEvent.getClientX(L),+mxEvent.getClientY(L));G=P();T=!1;mxEvent.consume(L)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(L){if(!T&&this.hsplitClickEnabled){var c=null!=E?E-m:0;E=P();n(c);mxEvent.consume(L)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};EditorUi.prototype.prompt=function(b,d,m,n){b=new FilenameDialog(this,d,mxResources.get("apply"),function(v){m(n?v:parseFloat(v))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};EditorUi.prototype.handleError=function(b,d,m,n,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=d){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var p=mxResources.get("ok");d=null!=d?d:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(d,v,p,m,null,null,null,null,null,null,null,null,n?m:null)}else null!=m&&m()};-EditorUi.prototype.showError=function(b,d,m,n,v,p,C,G,T,E,Q,M,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),n,v,p,C,M,G,T);d=Math.ceil(null!=d?d.length/50:1);this.showDialog(b.container,E||340,Q||100+20*d,!0,!1,c);b.init()};EditorUi.prototype.showDialog=function(b,d,m,n,v,p,C,G,T,E){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,n,v,p,C,G,T,E);this.dialogs.push(this.dialog)};+EditorUi.prototype.showError=function(b,d,m,n,v,p,C,G,T,E,P,L,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),n,v,p,C,L,G,T);d=Math.ceil(null!=d?d.length/50:1);this.showDialog(b.container,E||340,P||100+20*d,!0,!1,c);b.init()};EditorUi.prototype.showDialog=function(b,d,m,n,v,p,C,G,T,E){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,n,v,p,C,G,T,E);this.dialogs.push(this.dialog)};EditorUi.prototype.hideDialog=function(b,d,m){var n=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var v=this.dialogs.length-1;0<=v;v--)if(!this.dialogs[v].closing){n=this.dialogs[v];break}null==n||null!=m&&m!=this.dialog.container.firstChild||(n.closing=!0,0==n.close(b,d)?delete n.closing:(delete n.closing,b=mxUtils.lastIndexOf(this.dialogs,n),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",n)),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 d=b.getSelectionCells(),m=new mxDictionary,n=[],v=0;v<d.length;v++){var p=b.isTableCell(d[v])?b.model.getParent(d[v]):d[v];null==p||m.get(p)||(m.put(p,!0),n.push(p))}b.setSelectionCells(b.duplicateCells(n,!1))}catch(C){this.handleError(C)}};@@ -2282,19 +2284,19 @@ EditorUi.prototype.showDataDialog=function(b){null!=b&&"undefined"!==typeof windEditorUi.prototype.showBackgroundImageDialog=function(b,d){b=null!=b?b:mxUtils.bind(this,function(n){n=new ChangePageSetup(this,null,n);n.ignoreColor=!0;this.editor.graph.model.execute(n)});var m=mxUtils.prompt(mxResources.get("backgroundImage"),null!=d?d.src:"");null!=m&&0<m.length?(d=new Image,d.onload=function(){b(new mxImage(m,d.width,d.height),!1)},d.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},d.src=m):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,d,m){mxUtils.confirm(b)?null!=d&&d():null!=m&&m()};EditorUi.prototype.createOutline=function(b){var d=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){d.update(!1)});return d};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",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};-EditorUi.prototype.createKeyHandler=function(b){function d(M,c,g){if(!n.isSelectionEmpty()&&n.isEnabled()){c=null!=c?c:1;var l=n.getCompositeParents(n.getSelectionCells()),t=0<l.length?l[0]:null;if(null!=t)if(g){n.getModel().beginUpdate();try{for(t=0;t<l.length;t++)if(n.getModel().isVertex(l[t])&&n.isCellResizable(l[t])){var B=n.getCellGeometry(l[t]);null!=B&&(B=B.clone(),37==M?B.width=Math.max(0,B.width-c):38==M?B.height=Math.max(0,B.height-c):39==M?B.width+=c:40==M&&(B.height+=c),n.getModel().setGeometry(l[t],-B))}}finally{n.getModel().endUpdate()}}else{B=n.model.getParent(t);var D=n.getView().scale;g=null;1==n.getSelectionCount()&&n.model.isVertex(t)&&null!=n.layoutManager&&!n.isCellLocked(t)&&(g=n.layoutManager.getLayout(B));if(null!=g&&g.constructor==mxStackLayout)c=B.getIndex(t),37==M||38==M?n.model.add(B,t,Math.max(0,c-1)):(39==M||40==M)&&n.model.add(B,t,Math.min(n.model.getChildCount(B),c+1));else{var I=n.graphHandler;null!=I&&(null==I.first&&I.start(t,0,0,n.getMovableCells(l)),null!=I.first&&(t=-l=0,37==M?l=-c:38==M?t=-c:39==M?l=c:40==M&&(t=c),I.currentDx+=l*D,I.currentDy+=t*D,I.checkPreview(),I.updatePreview()),null!=C&&window.clearTimeout(C),C=window.setTimeout(function(){if(null!=I.first){var L=I.roundLength(I.currentDx/D),N=I.roundLength(I.currentDy/D);I.moveCells(I.cells,L,N);I.reset()}},400))}}}}var m=this,n=this.editor.graph,v=new mxKeyHandler(n),p=v.isEventIgnored;v.isEventIgnored=function(M){return!(mxEvent.isShiftDown(M)&&9==M.keyCode)&&(!this.isControlDown(M)||mxEvent.isShiftDown(M)||-90!=M.keyCode&&89!=M.keyCode&&188!=M.keyCode&&190!=M.keyCode&&85!=M.keyCode&&83!=M.keyCode)&&(66!=M.keyCode&&73!=M.keyCode||!this.isControlDown(M)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=M.keyCode&&107!=M.keyCode||!this.isControlDown(M)&&!mxEvent.isShiftDown(M)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};v.isEnabledForEvent=function(M){return!mxEvent.isConsumed(M)&&this.isGraphEvent(M)&&this.isEnabled()&&-(null==m.dialogs||0==m.dialogs.length)};v.isControlDown=function(M){return mxEvent.isControlDown(M)||mxClient.IS_MAC&&M.metaKey};var C=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(M){if(n.isEnabled()){var c=null;mxEvent.isShiftDown(M)&&this.isControlDown(M)&&mxEvent.isAltDown(M)?c=m.actions.get(m.ctrlAltShiftActions[M.keyCode]):mxEvent.isShiftDown(M)&&mxEvent.isAltDown(M)?-c=m.actions.get(m.altShiftActions[M.keyCode]):this.isControlDown(M)&&mxEvent.isAltDown(M)&&(c=m.actions.get(m.ctrlAltActions[M.keyCode]));if(null!=c)return c.funct;if("/"==M.key&&!this.isControlDown(M)&&!mxEvent.isAltDown(M))return function(){var g=document.getElementById("geOmniSearch");null!=g&&30<g.clientWidth&&g.focus()};if(null!=G[M.keyCode]&&!n.isSelectionEmpty())if(!this.isControlDown(M)&&mxEvent.isShiftDown(M)&&mxEvent.isAltDown(M)){if(n.model.isVertex(n.getSelectionCell()))return function(){var g=-n.connectVertex(n.getSelectionCell(),G[M.keyCode],n.defaultEdgeLength,M,!0);null!=g&&0<g.length&&(1==g.length&&n.model.isEdge(g[0])?n.setSelectionCell(n.model.getTerminal(g[0],!1)):n.setSelectionCell(g[g.length-1]),n.scrollCellToVisible(n.getSelectionCell()),null!=m.hoverIcons&&m.hoverIcons.update(n.view.getState(n.getSelectionCell())))}}else return this.isControlDown(M)?function(){d(M.keyCode,mxEvent.isShiftDown(M)?n.gridSize:null,!0)}:function(){d(M.keyCode,mxEvent.isShiftDown(M)?n.gridSize:null)}}return T.apply(this,-arguments)};v.bindAction=mxUtils.bind(this,function(M,c,g,l){var t=this.actions.get(g);null!=t&&(g=function(){t.isEnabled()&&t.funct.apply(this,arguments)},c?l?v.bindControlShiftKey(M,g):v.bindControlKey(M,g):l?v.bindShiftKey(M,g):v.bindKey(M,g))});var E=this,Q=v.escape;v.escape=function(M){Q.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){n.exitGroup()});v.bindControlShiftKey(35,function(){n.enterGroup()});v.bindShiftKey(36,function(){n.home()});v.bindKey(35,function(){n.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(){n.isEnabled()&&n.foldCells(!0)}),v.bindControlKey(35,function(){n.isEnabled()&&n.foldCells(!1)}),v.bindControlKey(13,function(){E.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),"1"!=urlParams.dev&&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,!0,"lockUnlock"),v.bindAction(76,!0,"layers",!0),v.bindAction(80,!0,"format",!0),v.bindAction(85,!0,"underline"),v.bindAction(85,!0,"ungroup",!0),v.bindAction(109,!0,"decreaseFontSize",!0),v.bindAction(107,!0,"increaseFontSize",!0),v.bindAction(219,!0,"decreaseFontSize",!0),v.bindAction(221,!0,"increaseFontSize",!0),v.bindAction(190,!0,"superscript"),-v.bindAction(188,!0,"subscript"),v.bindAction(13,!1,"keyPressEnter"),v.bindKey(113,function(){n.isEnabled()&&n.startEditingAtCell()});return v};EditorUi.prototype.createMenuElement=function(b,d,m){var n=document.createElement("a");this.addMenuHandler(n,d,m);mxUtils.write(n,b);n.className="geItem";return n};+EditorUi.prototype.createKeyHandler=function(b){function d(L,c,g){if(!n.isSelectionEmpty()&&n.isEnabled()){c=null!=c?c:1;var l=n.getCompositeParents(n.getSelectionCells()),t=0<l.length?l[0]:null;if(null!=t)if(g){n.getModel().beginUpdate();try{for(t=0;t<l.length;t++)if(n.getModel().isVertex(l[t])&&n.isCellResizable(l[t])){var B=n.getCellGeometry(l[t]);null!=B&&(B=B.clone(),37==L?B.width=Math.max(0,B.width-c):38==L?B.height=Math.max(0,B.height-c):39==L?B.width+=c:40==L&&(B.height+=c),n.getModel().setGeometry(l[t],+B))}}finally{n.getModel().endUpdate()}}else{B=n.model.getParent(t);var D=n.getView().scale;g=null;1==n.getSelectionCount()&&n.model.isVertex(t)&&null!=n.layoutManager&&!n.isCellLocked(t)&&(g=n.layoutManager.getLayout(B));if(null!=g&&g.constructor==mxStackLayout)c=B.getIndex(t),37==L||38==L?n.model.add(B,t,Math.max(0,c-1)):(39==L||40==L)&&n.model.add(B,t,Math.min(n.model.getChildCount(B),c+1));else{var I=n.graphHandler;null!=I&&(null==I.first&&I.start(t,0,0,n.getMovableCells(l)),null!=I.first&&(t=+l=0,37==L?l=-c:38==L?t=-c:39==L?l=c:40==L&&(t=c),I.currentDx+=l*D,I.currentDy+=t*D,I.checkPreview(),I.updatePreview()),null!=C&&window.clearTimeout(C),C=window.setTimeout(function(){if(null!=I.first){var K=I.roundLength(I.currentDx/D),M=I.roundLength(I.currentDy/D);I.moveCells(I.cells,K,M);I.reset()}},400))}}}}var m=this,n=this.editor.graph,v=new mxKeyHandler(n),p=v.isEventIgnored;v.isEventIgnored=function(L){return 188==L.keyCode&&this.isControlDown(L)&&!this.graph.cellEditor.isContentEditing()?+!0:!(mxEvent.isShiftDown(L)&&9==L.keyCode)&&(!this.isControlDown(L)||mxEvent.isShiftDown(L)||90!=L.keyCode&&89!=L.keyCode&&188!=L.keyCode&&190!=L.keyCode&&85!=L.keyCode&&83!=L.keyCode)&&(66!=L.keyCode&&73!=L.keyCode||!this.isControlDown(L)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=L.keyCode&&107!=L.keyCode||!this.isControlDown(L)&&!mxEvent.isShiftDown(L)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};+v.isEnabledForEvent=function(L){return!mxEvent.isConsumed(L)&&this.isGraphEvent(L)&&this.isEnabled()&&(null==m.dialogs||0==m.dialogs.length)};v.isControlDown=function(L){return mxEvent.isControlDown(L)||mxClient.IS_MAC&&L.metaKey};var C=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(L){if(n.isEnabled()){var c=null;mxEvent.isShiftDown(L)&&this.isControlDown(L)&&+mxEvent.isAltDown(L)?c=m.actions.get(m.ctrlAltShiftActions[L.keyCode]):mxEvent.isShiftDown(L)&&mxEvent.isAltDown(L)?c=m.actions.get(m.altShiftActions[L.keyCode]):this.isControlDown(L)&&mxEvent.isAltDown(L)&&(c=m.actions.get(m.ctrlAltActions[L.keyCode]));if(null!=c)return c.funct;if("/"==L.key&&!this.isControlDown(L)&&!mxEvent.isAltDown(L))return function(){var g=document.getElementById("geOmniSearch");null!=g&&30<g.clientWidth&&g.focus()};if(null!=G[L.keyCode]&&!n.isSelectionEmpty())if(!this.isControlDown(L)&&+mxEvent.isShiftDown(L)&&mxEvent.isAltDown(L)){if(n.model.isVertex(n.getSelectionCell()))return function(){var g=n.connectVertex(n.getSelectionCell(),G[L.keyCode],n.defaultEdgeLength,L,!0);null!=g&&0<g.length&&(1==g.length&&n.model.isEdge(g[0])?n.setSelectionCell(n.model.getTerminal(g[0],!1)):n.setSelectionCell(g[g.length-1]),n.scrollCellToVisible(n.getSelectionCell()),null!=m.hoverIcons&&m.hoverIcons.update(n.view.getState(n.getSelectionCell())))}}else return this.isControlDown(L)?function(){d(L.keyCode,+mxEvent.isShiftDown(L)?n.gridSize:null,!0)}:function(){d(L.keyCode,mxEvent.isShiftDown(L)?n.gridSize:null)}}return T.apply(this,arguments)};v.bindAction=mxUtils.bind(this,function(L,c,g,l){var t=this.actions.get(g);null!=t&&(g=function(){t.isEnabled()&&t.funct.apply(this,arguments)},c?l?v.bindControlShiftKey(L,g):v.bindControlKey(L,g):l?v.bindShiftKey(L,g):v.bindKey(L,g))});var E=this,P=v.escape;v.escape=function(L){P.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){n.exitGroup()});+v.bindControlShiftKey(35,function(){n.enterGroup()});v.bindShiftKey(36,function(){n.home()});v.bindKey(35,function(){n.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(){n.isEnabled()&&n.foldCells(!0)}),+v.bindControlKey(35,function(){n.isEnabled()&&n.foldCells(!1)}),v.bindControlKey(13,function(){E.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),"1"!=urlParams.dev&&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,!0,"lockUnlock"),v.bindAction(76,!0,"layers",!0),v.bindAction(80,!0,"format",!0),v.bindAction(85,!0,"underline"),v.bindAction(85,!0,"ungroup",!0),v.bindAction(109,!0,"decreaseFontSize",!0),v.bindAction(107,!0,"increaseFontSize",+!0),v.bindAction(219,!0,"decreaseFontSize",!0),v.bindAction(221,!0,"increaseFontSize",!0),v.bindAction(190,!0,"superscript"),v.bindAction(188,!0,"subscript"),v.bindAction(13,!1,"keyPressEnter"),v.bindKey(113,function(){n.isEnabled()&&n.startEditingAtCell()});return v};EditorUi.prototype.createMenuElement=function(b,d,m){var n=document.createElement("a");this.addMenuHandler(n,d,m);mxUtils.write(n,b);n.className="geItem";return n};EditorUi.prototype.addMenuHandler=function(b,d,m,n){if(null!=d){var v=null,p=!0,C=mxUtils.bind(this,function(G){null!=m&&m(G);if(!mxEvent.isConsumed(G)&&p&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var T=new mxPopupMenu(d);T.smartSeparators=!0;T.showDisabled=!0;T.autoExpand=!0;T.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(T,arguments);this.resetCurrentMenu();v=null;T.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();var E=mxUtils.getOffset(b);T.popup(E.x,E.y+b.offsetHeight,null,G);this.setCurrentMenu(T,b);v=T}n||mxEvent.consume(G)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(G){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var T=this.currentMenuElt;this.hideCurrentMenu();T.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&C(G)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(G){!this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(G)&&this.hideCurrentMenu();p=null==this.currentMenu;"INPUT"!=mxEvent.getSource(G).nodeName?G.preventDefault():G.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(G){C(G);p=!0}));n&&(mxEvent.addListener(b,"focus",mxUtils.bind(this,function(G){C(G);p=!0})),mxEvent.addListener(b,"blur",mxUtils.bind(this,function(G){this.currentMenu==v&&this.hideCurrentMenu()})),mxEvent.addListener(b,"keyup",mxUtils.bind(this,@@ -2312,45 +2314,45 @@ null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=null}var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<d.length;b++)null!=d[b]&&null!=d[b].parentNode&&d[b].parentNode.removeChild(d[b])};(function(){var b=[["nbsp","160"],["shy","173"]],d=mxUtils.parseXml;mxUtils.parseXml=function(n){for(var v=0;v<b.length;v++)n=n.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return d(n)};var m=mxUtils.getSizeForString;mxUtils.getSizeForString=function(n,v,p,C){return m(Graph.sanitizeHtml(n),v,p,C)}})();Date.prototype.toISOString||function(){function b(d){d=String(d);1===d.length&&(d="0"+d);return d}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,d=function(n){return"function"===typeof n||"[object Function]"===b.call(n)},m=Math.pow(2,53)-1;return function(n){var v=Object(n);if(null==n)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=1<arguments.length?arguments[1]:void 0,C;if("undefined"!==typeof p){if(!d(p))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(C=-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),m);for(var T=d(this)?Object(new this(G)):Array(G),E=0,Q;E<G;)Q=v[E],T[E]=p?"undefined"===typeof C?p(Q,E):p.call(C,Q,E):Q,E+=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),m);for(var T=d(this)?Object(new this(G)):Array(G),E=0,P;E<G;)P=v[E],T[E]=p?"undefined"===typeof C?p(P,E):p.call(C,P,E):P,E+=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(" ");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(d){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage="data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=";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,d,m){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),this.clippedImage=b;b=this.clippedSvg}return b};(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(d,m,n,v,p){return"default"==v&&null!=p?"fillcolor"==n.nodeName?p.shapeBackgroundColor:p.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(d,m,n){null==n&&(n=d);return b.apply(this,[d,m,n])}})();-(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,n,v,p,C,G,T){var E=b.apply(this,arguments);if(null!=m){var Q=E.getElementsByTagName("img");0<Q.length&&(Q[0].className="geButton")}return E}})();+(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,n,v,p,C,G,T){var E=b.apply(this,arguments);if(null!=m){var P=E.getElementsByTagName("img");0<P.length&&(P[0].className="geButton")}return E}})();Graph=function(b,d,m,n,v,p){mxGraph.call(this,b,d,m,n);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;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(k){k=this.getCurrentCellStyle(k);-return null!=k?"1"==k.html||"wrap"==k[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var C=null,G=null,T=null,E=null,Q=!1,M=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,x){if("mouseDown"==x.getProperty("eventName")&&this.isEnabled()){k=x.getProperty("event");var J=k.getState();x=this.view.scale;if(!mxEvent.isAltDown(k.getEvent())&&null!=J&&(M=this.isCellSelected(J.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(k.getEvent()))){var R=this.selectionCellsHandler.getHandler(J.cell);-if(null==R||null==R.getHandleForEvent(k)){var Y=new mxRectangle(k.getGraphX()-1,k.getGraphY()-1),Z=mxEvent.isTouchEvent(k.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;R=Z+2;Y.grow(Z);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&!this.isCellSelected(J.cell)&&!(mxUtils.contains(J,k.getGraphX()-R,k.getGraphY()-R)&&mxUtils.contains(J,k.getGraphX()-R,k.getGraphY()+R)&&mxUtils.contains(J,k.getGraphX()+R,k.getGraphY()+R)&&mxUtils.contains(J,k.getGraphX()+-R,k.getGraphY()-R))){var W=this.model.getParent(J.cell);R=this.model.getParent(W);if(!this.isCellSelected(R)){Z*=x;var U=2*Z;if(this.model.getChildAt(R,0)!=W&&mxUtils.intersects(Y,new mxRectangle(J.x,J.y-Z,J.width,U))||this.model.getChildAt(W,0)!=J.cell&&mxUtils.intersects(Y,new mxRectangle(J.x-Z,J.y,U,J.height))||mxUtils.intersects(Y,new mxRectangle(J.x,J.y+J.height-Z,J.width,U))||mxUtils.intersects(Y,new mxRectangle(J.x+J.width-Z,J.y,U,J.height)))W=this.selectionCellsHandler.isHandled(R),this.selectCellForEvent(R,-k.getEvent()),R=this.selectionCellsHandler.getHandler(R),null!=R&&(Z=R.getHandleForEvent(k),null!=Z&&(R.start(k.getGraphX(),k.getGraphY(),Z),R.blockDelayedSelection=!W,k.consume()))}}for(;!k.isConsumed()&&null!=J&&(this.isTableCell(J.cell)||this.isTableRow(J.cell)||this.isTable(J.cell));)this.isSwimlane(J.cell)&&this.isCellMovable(J.cell)&&(R=this.getActualStartSize(J.cell),(0<R.x||0<R.width)&&mxUtils.intersects(Y,new mxRectangle(J.x+(R.x-R.width-1)*x+(0==R.x?J.width:0),J.y,1,J.height))||(0<R.y||-0<R.height)&&mxUtils.intersects(Y,new mxRectangle(J.x,J.y+(R.y-R.height-1)*x+(0==R.y?J.height:0),J.width,1)))&&(this.selectCellForEvent(J.cell,k.getEvent()),R=this.selectionCellsHandler.getHandler(J.cell),null!=R&&null!=R.customHandles&&(Z=mxEvent.CUSTOM_HANDLE-R.customHandles.length+1,R.start(k.getGraphX(),k.getGraphY(),Z),k.consume())),J=this.view.getState(this.model.getParent(J.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(k,x){if("mouseDown"==x.getProperty("eventName")&&-this.isEnabled()){k=x.getProperty("event");var J=k.getState();mxEvent.isAltDown(k.getEvent())||mxEvent.isControlDown(x)||mxEvent.isShiftDown(x)||M||null==J||!this.model.isEdge(J.cell)||(C=new mxPoint(k.getGraphX(),k.getGraphY()),Q=this.isCellSelected(J.cell),T=J,G=k,null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,k.getGraphX(),k.getGraphY())?E=mxEvent.LABEL_HANDLE:(x=this.selectionCellsHandler.getHandler(J.cell),null!=x&&null!=x.bends&&0<x.bends.length&&(E=x.getHandleForEvent(k))))}}));-this.addMouseListener({mouseDown:function(k,x){},mouseMove:mxUtils.bind(this,function(k,x){k=this.selectionCellsHandler.handlers.map;for(var J in k)if(null!=k[J].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(x.getEvent())){var R=this.tolerance;if(null!=C&&null!=T&&null!=G){if(J=T,null!=E||Math.abs(C.x-x.getGraphX())>R||Math.abs(C.y-x.getGraphY())>R){var Y=null;mxEvent.isShiftDown(x.getEvent())||(Y=this.selectionCellsHandler.getHandler(J.cell));if(null!=Y&&null!=-Y.bends&&0<Y.bends.length){Y.redrawHandles();var Z=null!=E?E:Y.getHandleForEvent(G),W=this.view.getEdgeStyle(J),U=W==mxEdgeStyle.EntityRelation;R=J.absolutePoints;Q||(Z=E);Z!=mxEvent.LABEL_HANDLE&&null!=R&&(Z=E,null==Z&&(k=new mxRectangle(C.x,C.y),k.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(k,R[0].x,R[0].y)?Z=0:mxUtils.contains(k,R[R.length-1].x,R[R.length-1].y)?Z=Y.bends.length-1:null!=R&&(null==W&&null==Z||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&-(null!=W&&(2==R.length||3==R.length&&(0==Math.round(R[0].x-R[1].x)&&0==Math.round(R[1].x-R[2].x)||0==Math.round(R[0].y-R[1].y)&&0==Math.round(R[1].y-R[2].y)))?Z=2:(Z=mxUtils.findNearestSegment(J,C.x,C.y),Z=null==W?mxEvent.VIRTUAL_HANDLE-Z:Z+1))),null==Z&&(Z=mxEvent.VIRTUAL_HANDLE));k=Z==mxEvent.LABEL_HANDLE||0==Z||Z==Y.bends.length-1;if(!U&&(null!=J.visibleSourceState||null!=J.visibleTargetState)||k)Y.start(x.getGraphX(),x.getGraphX(),Z),x.consume(),this.graphHandler.reset()}null!=Y&&(this.selectionCellsHandler.isHandlerActive(Y)?-this.isCellSelected(J.cell)||(this.selectionCellsHandler.handlers.put(J.cell,Y),this.selectCellForEvent(J.cell,x.getEvent())):this.isCellSelected(J.cell)||Y.destroy());Q=!1;C=G=T=E=null}}else if(J=x.getState(),null!=J&&this.isCellEditable(J.cell)){k=this.model.getParent(J.cell);Y=null;if(this.model.isEdge(J.cell)&&!this.isCellSelected(J.cell)&&!mxEvent.isAltDown(x.getEvent())&&!mxEvent.isShiftDown(x.getEvent())&&!this.isAncestorSelected(J.cell)&&(this.isSwimlane(k)||this.model.isLayer(k)||this.getCurrentRoot()==-k)){if(k=new mxRectangle(x.getGraphX(),x.getGraphY()),k.grow(mxEdgeHandler.prototype.handleImage.width/2),R=J.absolutePoints,null!=R)null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,x.getGraphX(),x.getGraphY())?Y="move":mxUtils.contains(k,R[0].x,R[0].y)||mxUtils.contains(k,R[R.length-1].x,R[R.length-1].y)?Y="pointer":(W=this.view.getEdgeStyle(J),W==mxEdgeStyle.EntityRelation||null==J.visibleSourceState&&null==J.visibleTargetState||(Y="crosshair",W!=mxEdgeStyle.SegmentConnector&&-W!=mxEdgeStyle.OrthConnector))||(x=mxUtils.findNearestSegment(J,x.getGraphX(),x.getGraphY()),x<R.length-1&&0<=x&&(Y=0==Math.round(R[x].x-R[x+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(x.getEvent())){R=mxShape.prototype.svgStrokeTolerance/2;k=new mxRectangle(x.getGraphX(),x.getGraphY());k.grow(R);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&(x=this.model.getParent(J.cell),R=this.model.getParent(x),!this.isCellSelected(R)))if(mxUtils.intersects(k,new mxRectangle(J.x,-J.y-2,J.width,4))&&this.model.getChildAt(R,0)!=x||mxUtils.intersects(k,new mxRectangle(J.x,J.y+J.height-2,J.width,4)))Y="row-resize";else if(mxUtils.intersects(k,new mxRectangle(J.x-2,J.y,4,J.height))&&this.model.getChildAt(x,0)!=J.cell||mxUtils.intersects(k,new mxRectangle(J.x+J.width-2,J.y,4,J.height)))Y="col-resize";for(x=J;null==Y&&null!=x&&(this.isTableCell(x.cell)||this.isTableRow(x.cell)||this.isTable(x.cell));)this.isSwimlane(x.cell)&&this.isCellMovable(x.cell)&&(R=this.getActualStartSize(x.cell),-Z=this.view.scale,(0<R.x||0<R.width)&&mxUtils.intersects(k,new mxRectangle(x.x+(R.x-R.width-1)*Z+(0==R.x?x.width*Z:0),x.y,1,x.height))?Y="col-resize":(0<R.y||0<R.height)&&mxUtils.intersects(k,new mxRectangle(x.x,x.y+(R.y-R.height-1)*Z+(0==R.y?x.height:0),x.width,1))&&(Y="row-resize")),x=this.view.getState(this.model.getParent(x.cell))}null!=Y&&J.setCursor(Y)}}}),mouseUp:mxUtils.bind(this,function(k,x){E=C=G=T=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=-function(k){var x=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);k.view.graph.isHtmlLabel(k.cell)&&("0"==mxUtils.getValue(k.style,"html","0")?x=mxUtils.htmlEntities(x,!1):(k.lastLabelValue!=x&&(k.lastLabelValue=x,k.lastSanitizedLabelValue=Graph.sanitizeHtml(x),c.innerHTML=k.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==k.view.graph.getAdaptiveColors())&&(k.lastSanitizedLabelValue=c.innerHTML)),x=k.lastSanitizedLabelValue));return x};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(k,x){return!1};this.alternateEdgeStyle="vertical";null==n&&this.loadStylesheet();var g=this.graphHandler.getGuideStates;-this.graphHandler.getGuideStates=function(){var k=g.apply(this,arguments);if(this.graph.pageVisible){var x=[],J=this.graph.pageFormat,R=this.graph.pageScale,Y=J.width*R;J=J.height*R;R=this.graph.view.translate;for(var Z=this.graph.view.scale,W=this.graph.getPageLayout(),U=0;U<W.width;U++)x.push(new mxRectangle(((W.x+U)*Y+R.x)*Z,(W.y*J+R.y)*Z,Y*Z,J*Z));for(U=1;U<W.height;U++)x.push(new mxRectangle((W.x*Y+R.x)*Z,((W.y+U)*J+R.y)*Z,Y*Z,J*Z));k=x.concat(k)}return k};mxDragSource.prototype.dragElementZIndex=-mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(k,x){return null==k.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(k){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var l=this.graphHandler.getCells;this.graphHandler.getCells=function(k){for(var x=l.apply(this,arguments),J=new mxDictionary,R=[],Y=0;Y<x.length;Y++){var Z=-this.graph.isTableCell(k)&&this.graph.isTableCell(x[Y])&&this.graph.isCellSelected(x[Y])?this.graph.model.getParent(x[Y]):this.graph.isTableRow(k)&&this.graph.isTableRow(x[Y])&&this.graph.isCellSelected(x[Y])?x[Y]:this.graph.getCompositeParent(x[Y]);null==Z||J.get(Z)||(J.put(Z,!0),R.push(Z))}return R};var t=this.graphHandler.start;this.graphHandler.start=function(k,x,J,R){var Y=!1;this.graph.isTableCell(k)&&(this.graph.isCellSelected(k)?Y=!0:k=this.graph.model.getParent(k));Y||this.graph.isTableRow(k)&&-this.graph.isCellSelected(k)||(k=this.graph.getCompositeParent(k));t.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(k,x){x=this.graph.getCompositeParent(x);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(k,x,J,R,Y,Z){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=R&&this.graph.applyNewEdgeStyle(R,[W]);return W};var B=new mxRubberband(this);this.getRubberband=function(){return B};-var D=(new Date).getTime(),I=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var k=this.currentState;L.apply(this,arguments);k!=this.currentState?(D=(new Date).getTime(),I=0):I=(new Date).getTime()-D};var N=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(k){return mxEvent.isShiftDown(k.getEvent())&&mxEvent.isAltDown(k.getEvent())?!1:null!=this.currentState&&k.getState()==this.currentState&&2E3<I||(null==this.currentState||-"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&N.apply(this,arguments)};var K=this.isToggleEvent;this.isToggleEvent=function(k){return K.apply(this,arguments)||mxEvent.isShiftDown(k)};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(k){return mxEvent.isMouseEvent(k.getEvent())};var ja=this.click;this.click=function(k){var x=null==k.state&&null!=k.sourceState&&this.isCellLocked(this.getLayerForCell(k.sourceState.cell));if(this.isEnabled()&&!x||k.isConsumed())return ja.apply(this,arguments);var J=x?k.sourceState.cell:k.getCell();if(null!=J){var R=this.getClickableLinkForCell(J);null!=R?this.isCustomLink(R)?this.customLinkClicked(R,J):this.openLink(R):-x&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};var ea=this.tooltipHandler.show;this.tooltipHandler.show=function(){ea.apply(this,arguments);if(null!=this.div)for(var k=this.div.getElementsByTagName("a"),x=0;x<k.length;x++)null!=k[x].getAttribute("href")&&null==k[x].getAttribute("target")&&k[x].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};this.getCursorForMouseEvent=function(k){var x=null==-k.state&&null!=k.sourceState&&this.isCellLocked(k.sourceState.cell);return this.getCursorForCell(x?k.sourceState.cell:k.getCell())};var ca=this.getCursorForCell;this.getCursorForCell=function(k){if(!this.isEnabled()||this.isCellLocked(k)){if(null!=this.getClickableLinkForCell(k))return"pointer";if(this.isCellLocked(k))return"default"}return ca.apply(this,arguments)};this.selectRegion=function(k,x){var J=mxEvent.isAltDown(x)?k:null;k=this.getCells(k.x,k.y,k.width,k.height,null,null,J,null,!0);if(this.isToggleEvent(x))for(J=-0;J<k.length;J++)this.selectCellForEvent(k[J],x);else this.selectCellsForEvent(k,x);return k};var fa=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(k,x,J){return this.graph.isCellSelected(k)?!1:fa.apply(this,arguments)};var la=this.updateMouseEvent;this.updateMouseEvent=function(k){k=la.apply(this,arguments);null!=k.state&&this.isCellLocked(this.getLayerForCell(k.getCell()))&&(null==this.getLinkForCell(k.getCell())?k.state=this.view.getState(this.getCellAt(k.getGraphX(),-k.getGraphY(),null,null,null,mxUtils.bind(this,function(x,J,R){return k.state==x||this.isCellLocked(this.getLayerForCell(x.cell))&&null==this.getLinkForCell(x.cell)}))):k.state=null);return k};var ka=this.isCellSelectable;this.isCellSelectable=function(k){return ka.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(k))};this.isCellLocked=function(k){for(;null!=k;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(k),"locked","0"))return!0;k=this.model.getParent(k)}return!1};var V=null;-this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,x){"mouseDown"==x.getProperty("eventName")&&(k=x.getProperty("event").getState(),V=null==k||this.isSelectionEmpty()||this.isCellSelected(k.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(k,x){if(!mxEvent.isMultiTouchEvent(x)){k=x.getProperty("event");var J=x.getProperty("cell");null==J?(k=mxUtils.convertPoint(this.container,mxEvent.getClientX(k),mxEvent.getClientY(k)),B.start(k.x,-k.y)):null!=V?this.addSelectionCells(V):1<this.getSelectionCount()&&this.isCellSelected(J)&&this.removeSelectionCell(J);V=null;x.consume()}}));this.connectionHandler.selectCells=function(k,x){this.graph.setSelectionCell(x||k)};this.connectionHandler.constraintHandler.isStateIgnored=function(k,x){var J=k.view.graph;return x&&(J.isCellSelected(k.cell)||J.isTableRow(k.cell)&&J.selectionCellsHandler.isHandled(J.model.getParent(k.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,-function(){var k=this.connectionHandler.constraintHandler;null!=k.currentFocus&&k.isStateIgnored(k.currentFocus,!0)&&(k.currentFocus=null,k.constraints=null,k.destroyIcons());k.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";+return null!=k?"1"==k.html||"wrap"==k[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var C=null,G=null,T=null,E=null,P=!1,L=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,y){if("mouseDown"==y.getProperty("eventName")&&this.isEnabled()){k=y.getProperty("event");var J=k.getState();y=this.view.scale;if(!mxEvent.isAltDown(k.getEvent())&&null!=J&&(L=this.isCellSelected(J.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(k.getEvent()))){var R=this.selectionCellsHandler.getHandler(J.cell);+if(null==R||null==R.getHandleForEvent(k)){var X=new mxRectangle(k.getGraphX()-1,k.getGraphY()-1),aa=mxEvent.isTouchEvent(k.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;R=aa+2;X.grow(aa);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&!this.isCellSelected(J.cell)&&!(mxUtils.contains(J,k.getGraphX()-R,k.getGraphY()-R)&&mxUtils.contains(J,k.getGraphX()-R,k.getGraphY()+R)&&mxUtils.contains(J,k.getGraphX()+R,k.getGraphY()+R)&&mxUtils.contains(J,+k.getGraphX()+R,k.getGraphY()-R))){var Z=this.model.getParent(J.cell);R=this.model.getParent(Z);if(!this.isCellSelected(R)){aa*=y;var U=2*aa;if(this.model.getChildAt(R,0)!=Z&&mxUtils.intersects(X,new mxRectangle(J.x,J.y-aa,J.width,U))||this.model.getChildAt(Z,0)!=J.cell&&mxUtils.intersects(X,new mxRectangle(J.x-aa,J.y,U,J.height))||mxUtils.intersects(X,new mxRectangle(J.x,J.y+J.height-aa,J.width,U))||mxUtils.intersects(X,new mxRectangle(J.x+J.width-aa,J.y,U,J.height)))Z=this.selectionCellsHandler.isHandled(R),+this.selectCellForEvent(R,k.getEvent()),R=this.selectionCellsHandler.getHandler(R),null!=R&&(aa=R.getHandleForEvent(k),null!=aa&&(R.start(k.getGraphX(),k.getGraphY(),aa),R.blockDelayedSelection=!Z,k.consume()))}}for(;!k.isConsumed()&&null!=J&&(this.isTableCell(J.cell)||this.isTableRow(J.cell)||this.isTable(J.cell));)this.isSwimlane(J.cell)&&this.isCellMovable(J.cell)&&(R=this.getActualStartSize(J.cell),(0<R.x||0<R.width)&&mxUtils.intersects(X,new mxRectangle(J.x+(R.x-R.width-1)*y+(0==R.x?J.width:+0),J.y,1,J.height))||(0<R.y||0<R.height)&&mxUtils.intersects(X,new mxRectangle(J.x,J.y+(R.y-R.height-1)*y+(0==R.y?J.height:0),J.width,1)))&&(this.selectCellForEvent(J.cell,k.getEvent()),R=this.selectionCellsHandler.getHandler(J.cell),null!=R&&null!=R.customHandles&&(aa=mxEvent.CUSTOM_HANDLE-R.customHandles.length+1,R.start(k.getGraphX(),k.getGraphY(),aa),k.consume())),J=this.view.getState(this.model.getParent(J.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(k,+y){if("mouseDown"==y.getProperty("eventName")&&this.isEnabled()){k=y.getProperty("event");var J=k.getState();mxEvent.isAltDown(k.getEvent())||mxEvent.isControlDown(y)||mxEvent.isShiftDown(y)||L||null==J||!this.model.isEdge(J.cell)||(C=new mxPoint(k.getGraphX(),k.getGraphY()),P=this.isCellSelected(J.cell),T=J,G=k,null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,k.getGraphX(),k.getGraphY())?E=mxEvent.LABEL_HANDLE:(y=this.selectionCellsHandler.getHandler(J.cell),null!=y&&null!=+y.bends&&0<y.bends.length&&(E=y.getHandleForEvent(k))))}}));this.addMouseListener({mouseDown:function(k,y){},mouseMove:mxUtils.bind(this,function(k,y){k=this.selectionCellsHandler.handlers.map;for(var J in k)if(null!=k[J].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(y.getEvent())){var R=this.tolerance;if(null!=C&&null!=T&&null!=G){if(J=T,null!=E||Math.abs(C.x-y.getGraphX())>R||Math.abs(C.y-y.getGraphY())>R){var X=null;mxEvent.isShiftDown(y.getEvent())||(X=+this.selectionCellsHandler.getHandler(J.cell));if(null!=X&&null!=X.bends&&0<X.bends.length){X.redrawHandles();var aa=null!=E?E:X.getHandleForEvent(G),Z=this.view.getEdgeStyle(J),U=Z==mxEdgeStyle.EntityRelation;R=J.absolutePoints;P||(aa=E);aa!=mxEvent.LABEL_HANDLE&&null!=R&&(aa=E,null==aa&&(k=new mxRectangle(C.x,C.y),k.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(k,R[0].x,R[0].y)?aa=0:mxUtils.contains(k,R[R.length-1].x,R[R.length-1].y)?aa=X.bends.length-1:null!=R&&(null==Z&&null==+aa||Z==mxEdgeStyle.SegmentConnector||Z==mxEdgeStyle.OrthConnector)&&(null!=Z&&(2==R.length||3==R.length&&(0==Math.round(R[0].x-R[1].x)&&0==Math.round(R[1].x-R[2].x)||0==Math.round(R[0].y-R[1].y)&&0==Math.round(R[1].y-R[2].y)))?aa=2:(aa=mxUtils.findNearestSegment(J,C.x,C.y),aa=null==Z?mxEvent.VIRTUAL_HANDLE-aa:aa+1))),null==aa&&(aa=mxEvent.VIRTUAL_HANDLE));k=aa==mxEvent.LABEL_HANDLE||0==aa||aa==X.bends.length-1;if(!U&&(null!=J.visibleSourceState||null!=J.visibleTargetState)||k)X.start(y.getGraphX(),+y.getGraphX(),aa),y.consume(),this.graphHandler.reset()}null!=X&&(this.selectionCellsHandler.isHandlerActive(X)?this.isCellSelected(J.cell)||(this.selectionCellsHandler.handlers.put(J.cell,X),this.selectCellForEvent(J.cell,y.getEvent())):this.isCellSelected(J.cell)||X.destroy());P=!1;C=G=T=E=null}}else if(J=y.getState(),null!=J&&this.isCellEditable(J.cell)){k=this.model.getParent(J.cell);X=null;if(this.model.isEdge(J.cell)&&!this.isCellSelected(J.cell)&&!mxEvent.isAltDown(y.getEvent())&&!mxEvent.isShiftDown(y.getEvent())&&+!this.isAncestorSelected(J.cell)&&(this.isSwimlane(k)||this.model.isLayer(k)||this.getCurrentRoot()==k)){if(k=new mxRectangle(y.getGraphX(),y.getGraphY()),k.grow(mxEdgeHandler.prototype.handleImage.width/2),R=J.absolutePoints,null!=R)null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,y.getGraphX(),y.getGraphY())?X="move":mxUtils.contains(k,R[0].x,R[0].y)||mxUtils.contains(k,R[R.length-1].x,R[R.length-1].y)?X="pointer":(Z=this.view.getEdgeStyle(J),Z==mxEdgeStyle.EntityRelation||+null==J.visibleSourceState&&null==J.visibleTargetState||(X="crosshair",Z!=mxEdgeStyle.SegmentConnector&&Z!=mxEdgeStyle.OrthConnector))||(y=mxUtils.findNearestSegment(J,y.getGraphX(),y.getGraphY()),y<R.length-1&&0<=y&&(X=0==Math.round(R[y].x-R[y+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(y.getEvent())){R=mxShape.prototype.svgStrokeTolerance/2;k=new mxRectangle(y.getGraphX(),y.getGraphY());k.grow(R);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&(y=this.model.getParent(J.cell),+R=this.model.getParent(y),!this.isCellSelected(R)))if(mxUtils.intersects(k,new mxRectangle(J.x,J.y-2,J.width,4))&&this.model.getChildAt(R,0)!=y||mxUtils.intersects(k,new mxRectangle(J.x,J.y+J.height-2,J.width,4)))X="row-resize";else if(mxUtils.intersects(k,new mxRectangle(J.x-2,J.y,4,J.height))&&this.model.getChildAt(y,0)!=J.cell||mxUtils.intersects(k,new mxRectangle(J.x+J.width-2,J.y,4,J.height)))X="col-resize";for(y=J;null==X&&null!=y&&(this.isTableCell(y.cell)||this.isTableRow(y.cell)||this.isTable(y.cell));)this.isSwimlane(y.cell)&&+this.isCellMovable(y.cell)&&(R=this.getActualStartSize(y.cell),aa=this.view.scale,(0<R.x||0<R.width)&&mxUtils.intersects(k,new mxRectangle(y.x+(R.x-R.width-1)*aa+(0==R.x?y.width*aa:0),y.y,1,y.height))?X="col-resize":(0<R.y||0<R.height)&&mxUtils.intersects(k,new mxRectangle(y.x,y.y+(R.y-R.height-1)*aa+(0==R.y?y.height:0),y.width,1))&&(X="row-resize")),y=this.view.getState(this.model.getParent(y.cell))}null!=X&&J.setCursor(X)}}}),mouseUp:mxUtils.bind(this,function(k,y){E=C=G=T=null})})}this.cellRenderer.minSvgStrokeWidth=+.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=function(k){var y=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);k.view.graph.isHtmlLabel(k.cell)&&("0"==mxUtils.getValue(k.style,"html","0")?y=mxUtils.htmlEntities(y,!1):(k.lastLabelValue!=y&&(k.lastLabelValue=y,k.lastSanitizedLabelValue=Graph.sanitizeHtml(y),c.innerHTML=k.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==k.view.graph.getAdaptiveColors())&&(k.lastSanitizedLabelValue=c.innerHTML)),+y=k.lastSanitizedLabelValue));return y};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(k,+y){return!1};this.alternateEdgeStyle="vertical";null==n&&this.loadStylesheet();var g=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var k=g.apply(this,arguments);if(this.graph.pageVisible){var y=[],J=this.graph.pageFormat,R=this.graph.pageScale,X=J.width*R;J=J.height*R;R=this.graph.view.translate;for(var aa=this.graph.view.scale,Z=this.graph.getPageLayout(),U=0;U<Z.width;U++)y.push(new mxRectangle(((Z.x+U)*X+R.x)*aa,(Z.y*J+R.y)*aa,X*aa,J*aa));for(U=1;U<Z.height;U++)y.push(new mxRectangle((Z.x*+X+R.x)*aa,((Z.y+U)*J+R.y)*aa,X*aa,J*aa));k=y.concat(k)}return k};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(k,y){return null==k.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(k){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var l=this.graphHandler.getCells;this.graphHandler.getCells=+function(k){for(var y=l.apply(this,arguments),J=new mxDictionary,R=[],X=0;X<y.length;X++){var aa=this.graph.isTableCell(k)&&this.graph.isTableCell(y[X])&&this.graph.isCellSelected(y[X])?this.graph.model.getParent(y[X]):this.graph.isTableRow(k)&&this.graph.isTableRow(y[X])&&this.graph.isCellSelected(y[X])?y[X]:this.graph.getCompositeParent(y[X]);null==aa||J.get(aa)||(J.put(aa,!0),R.push(aa))}return R};var t=this.graphHandler.start;this.graphHandler.start=function(k,y,J,R){var X=!1;this.graph.isTableCell(k)&&+(this.graph.isCellSelected(k)?X=!0:k=this.graph.model.getParent(k));X||this.graph.isTableRow(k)&&this.graph.isCellSelected(k)||(k=this.graph.getCompositeParent(k));t.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(k,y){y=this.graph.getCompositeParent(y);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(k,y,J,R,X,aa){var Z=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=R&&this.graph.applyNewEdgeStyle(R,+[Z]);return Z};var B=new mxRubberband(this);this.getRubberband=function(){return B};var D=(new Date).getTime(),I=0,K=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var k=this.currentState;K.apply(this,arguments);k!=this.currentState?(D=(new Date).getTime(),I=0):I=(new Date).getTime()-D};var M=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(k){return mxEvent.isShiftDown(k.getEvent())&&mxEvent.isAltDown(k.getEvent())?!1:+null!=this.currentState&&k.getState()==this.currentState&&2E3<I||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&M.apply(this,arguments)};var V=this.isToggleEvent;this.isToggleEvent=function(k){return V.apply(this,arguments)||mxEvent.isShiftDown(k)};var Q=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(Q=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=Q)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(k){return mxEvent.isMouseEvent(k.getEvent())};var ja=this.click;this.click=function(k){var y=null==k.state&&null!=k.sourceState&&this.isCellLocked(this.getLayerForCell(k.sourceState.cell));if(this.isEnabled()&&!y||k.isConsumed())return ja.apply(this,arguments);var J=y?k.sourceState.cell:k.getCell();if(null!=J){var R=this.getClickableLinkForCell(J);+null!=R?this.isCustomLink(R)?this.customLinkClicked(R,J):this.openLink(R):y&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};var ea=this.tooltipHandler.show;this.tooltipHandler.show=function(){ea.apply(this,arguments);if(null!=this.div)for(var k=this.div.getElementsByTagName("a"),y=0;y<k.length;y++)null!=k[y].getAttribute("href")&&null==k[y].getAttribute("target")&&k[y].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};+this.getCursorForMouseEvent=function(k){var y=null==k.state&&null!=k.sourceState&&this.isCellLocked(k.sourceState.cell);return this.getCursorForCell(y?k.sourceState.cell:k.getCell())};var da=this.getCursorForCell;this.getCursorForCell=function(k){if(!this.isEnabled()||this.isCellLocked(k)){if(null!=this.getClickableLinkForCell(k))return"pointer";if(this.isCellLocked(k))return"default"}return da.apply(this,arguments)};this.selectRegion=function(k,y){var J=Graph.intersectionSelect||mxEvent.isAltDown(y)?+k:null;k=this.getCells(k.x,k.y,k.width,k.height,null,null,J,null,!0);if(this.isToggleEvent(y))for(J=0;J<k.length;J++)this.selectCellForEvent(k[J],y);else this.selectCellsForEvent(k,y);return k};var ia=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(k,y,J){return this.graph.isCellSelected(k)?!1:ia.apply(this,arguments)};var la=this.updateMouseEvent;this.updateMouseEvent=function(k){k=la.apply(this,arguments);null!=k.state&&this.isCellLocked(this.getLayerForCell(k.getCell()))&&+(null==this.getLinkForCell(k.getCell())?k.state=this.view.getState(this.getCellAt(k.getGraphX(),k.getGraphY(),null,null,null,mxUtils.bind(this,function(y,J,R){return k.state==y||this.isCellLocked(this.getLayerForCell(y.cell))&&null==this.getLinkForCell(y.cell)}))):k.state=null);return k};var ka=this.isCellSelectable;this.isCellSelectable=function(k){return ka.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(k))};this.isCellLocked=function(k){for(;null!=k;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(k),+"locked","0"))return!0;k=this.model.getParent(k)}return!1};var W=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,y){"mouseDown"==y.getProperty("eventName")&&(k=y.getProperty("event").getState(),W=null==k||this.isSelectionEmpty()||this.isCellSelected(k.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(k,y){if(!mxEvent.isMultiTouchEvent(y)){k=y.getProperty("event");var J=y.getProperty("cell");null==J?(k=mxUtils.convertPoint(this.container,+mxEvent.getClientX(k),mxEvent.getClientY(k)),B.start(k.x,k.y)):null!=W?this.addSelectionCells(W):1<this.getSelectionCount()&&this.isCellSelected(J)&&this.removeSelectionCell(J);W=null;y.consume()}}));this.connectionHandler.selectCells=function(k,y){this.graph.setSelectionCell(y||k)};this.connectionHandler.constraintHandler.isStateIgnored=function(k,y){var J=k.view.graph;return y&&(J.isCellSelected(k.cell)||J.isTableRow(k.cell)&&J.selectionCellsHandler.isHandled(J.model.getParent(k.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,+mxUtils.bind(this,function(){var k=this.connectionHandler.constraintHandler;null!=k.currentFocus&&k.isStateIgnored(k.currentFocus,!0)&&(k.currentFocus=null,k.constraints=null,k.destroyIcons());k.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.intersectionSelect=!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";Graph.colorStyles=[mxConstants.STYLE_FONTCOLOR,mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_IMAGE_BORDER,mxConstants.STYLE_IMAGE_BACKGROUND,mxConstants.STYLE_LABEL_BORDERCOLOR,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];Graph.textStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity labelBorderColor labelBackgroundColor autosize resizable horizontal textDirection autosizeText".split(" ");Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin".split(" ");Graph.cellStyleGroups=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing","targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"]];Graph.cellStyles=mxUtils.addItems(mxUtils.addItems(mxUtils.addItems("rounded shadow glass dashed dashPattern comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification sketchStyle pointerEvents opacity strokeColor strokeWidth align verticalAlign spacingLeft spacingRight spacingTop spacingBottom spacing arcSize absoluteArcSize comicStyle swimlaneFillColor shadowOffsetX shadowOffsetY shadowBlur shadowColor shadowOpacity".split(" "),Graph.textStyles),@@ -2361,10 +2363,10 @@ Graph.createSvgImage=function(b,d,m,n,v){m=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,d,m,n,v){var p=mxUtils.createXmlDocument(),C=null!=p.createElementNS?p.createElementNS(mxConstants.NS_SVG,"svg"):p.createElement("svg");null!=v&&C.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==p.createElementNS?(C.setAttribute("xmlns",mxConstants.NS_SVG),C.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):C.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);C.setAttribute("version","1.1");C.setAttribute("width",m+"px");C.setAttribute("height",n+"px");C.setAttribute("viewBox",b+" "+d+" "+m+" "+n);p.appendChild(C);return C};-Graph.htmlToPng=function(b,d,m,n,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var C=document.createElement("canvas");C.width=d*p;C.height=m*p;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var E=C.getContext("2d");E.scale(p,p);E.drawImage(G,0,0);n(C.toDataURL())}catch(Q){n(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,d,m,n,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var C=document.createElement("canvas");C.width=d*p;C.height=m*p;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var E=C.getContext("2d");E.scale(p,p);E.drawImage(G,0,0);n(C.toDataURL())}catch(P){n(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=function(E){n(null)};G.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+d+'" height="'+m+'">'+(""!=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,d,m,n){function v(c,g,l){return null!=n?n(c,g,l):mxUtils.isValidColor(l)?(null==C&&null!=d&&(C={}),null!=C&&(C[g]=c.style.getPropertyValue(g)),l=mxUtils.getLightDarkColor(l,null,null,m),c.style.setProperty(g,l.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),C=null,G=!1,T=0;T<p.length;T++)if(p[T]!=b&&null!=p[T].style){C=null;for(var E=0;E<p[T].style.length;E++){var Q=p[T].style.item(E),M=p[T].style.getPropertyValue(Q);G=v(p[T],Q,M)||G}"FONT"==p[T].nodeName&&-""==p[T].style.getPropertyValue("color")&&(M=p[T].getAttribute("color"),G=v(p[T],"color",M)||G);null!=d&&null!=C&&p[T].setAttribute(d,JSON.stringify(C))}return G};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,n=0;n<b.length;n++)try{var v=b[n].getAttribute(d);if(null!=v){b[n].removeAttribute(d);var p=JSON.parse(v),C;for(C in p){var G=p[C];""==G?(b[n].style[C]=null,""==b[n].getAttribute("style")&&b[n].removeAttribute("style")):b[n].style[C]=G;m=!0}}}catch(T){}return m};+Graph.addLightDarkColors=function(b,d,m,n){function v(c,g,l){return null!=n?n(c,g,l):mxUtils.isValidColor(l)?(null==C&&null!=d&&(C={}),null!=C&&(C[g]=c.style.getPropertyValue(g)),l=mxUtils.getLightDarkColor(l,null,null,m),c.style.setProperty(g,l.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),C=null,G=!1,T=0;T<p.length;T++)if(p[T]!=b&&null!=p[T].style){C=null;for(var E=0;E<p[T].style.length;E++){var P=p[T].style.item(E),L=p[T].style.getPropertyValue(P);G=v(p[T],P,L)||G}"FONT"==p[T].nodeName&&+""==p[T].style.getPropertyValue("color")&&(L=p[T].getAttribute("color"),G=v(p[T],"color",L)||G);null!=d&&null!=C&&p[T].setAttribute(d,JSON.stringify(C))}return G};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,n=0;n<b.length;n++)try{var v=b[n].getAttribute(d);if(null!=v){b[n].removeAttribute(d);var p=JSON.parse(v),C;for(C in p){var G=p[C];""==G?(b[n].style[C]=null,""==b[n].getAttribute("style")&&b[n].removeAttribute("style")):b[n].style[C]=G;m=!0}}}catch(T){}return m};Graph.getGivenColor=function(b,d){var m=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var n=b.getAttribute(Graph.backupStyleAttribute);if(null!=n){var v=JSON.parse(n);null!=v&&null!=v[d]&&("color"==d&&"FONT"==b.nodeName&&""==v[d]&&null!=b.getAttribute("color")?m=b.getAttribute("color"):""!=v[d]&&(m=v[d]))}}catch(p){}null==m&&""!=b.style[d]&&(m=b.style[d])}return m};Graph.setTextColor=function(b,d,m){for(var n=m?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=m?"color":"background-color",p=b.getElementsByTagName("*"),C=[],G=0;G<p.length;G++)C.push({node:p[G],value:p[G].style[v]});document.execCommand(m?"forecolor":"backcolor",!1,n);b=b.getElementsByTagName("*");for(G=0;G<b.length;G++){if(G<C.length&&C[G].node==b[G]&&C[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(E){}if(m&&b[G].getAttribute("color")==n||b[G].style[v]==n){m&&b[G].getAttribute("color")==n&&b[G].removeAttribute("color");b[G].style[v]=d!=mxConstants.NONE?mxUtils.getLightDarkColor(d).cssText:null;try{p=b[G].getAttribute(Graph.backupStyleAttribute),T=null!=p?JSON.parse(p):{},T[v]=d!=mxConstants.NONE?d:"",b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(T))}catch(E){}if(m&&mxClient.IS_FF){d=b[G];m=d.firstChild;if(null!=@@ -2374,17 +2376,17 @@ Graph.arrayBufferToString=function(b){var d="";b=new Uint8Array(b);for(var m=b.bGraph.arrayBufferIndexOfString=function(b,d,m){var n=d.charCodeAt(0),v=1,p=-1;for(m=m||0;m<b.byteLength;m++)if(b[m]==n){p=m;break}for(m=p+1;-1<p&&m<b.byteLength&&m<p+d.length-1;m++){if(b[m]!=d.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,d,p+1);v++}return v==d.length-1?p:-1};Graph.compress=function(b,d){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=d?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};Graph.decompress=function(b,d,m){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));d=decodeURIComponent(d?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return m?d:Graph.zapGremlins(d)};Graph.fadeNodes=function(b,d,m,n,v){v=null!=v?v:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,d);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+v+"ms ease-in-out");Graph.setOpacityForNodes(b,m);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=n&&n()},v)},0)};-Graph.exploreFromCell=function(b,d,m){pageSize=null!=m&&null!=m.pageSize?m.pageSize:8;minSize=null!=m&&null!=m.minSize?m.minSize:180;(function(n,v){function p(M){M.view.states.visit(function(c,g){null!=g.shape&&M.model.isEdge(M.model.getParent(g.cell))?g.shape.node.parentNode.appendChild(g.shape.node):null!=g.text&&M.model.isEdge(g.cell)&&g.text.node.parentNode.appendChild(g.text.node)})}function C(M,c){if(M.getModel().isVertex(c)){var g=M.container.offsetWidth/2,l=M.container.offsetHeight/2;M.rootCell=-c.referenceCell||c;M.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(M.container.offsetWidth-800/120,M.container.offsetHeight-600)/30));for(var t=c.referenceCell||c,B=n.model.getCell(t.sourceCellId),D=n.getEdges(B,null,!0,!0,!1,!0),I=[],L=0;L<D.length;L++)null!=D[L].getTerminal(!0)&&null!=D[L].getTerminal(!1)&&n.isCellVisible(D[L])&&!n.isEdgeIgnored(D[L])&&n.isCellVisible(D[L].getTerminal(!0))&&n.isCellVisible(D[L].getTerminal(!1))&&n.isCellVisible(n.getLayerForCell(D[L]))&&-I.push(D[L]);I=D=I;if(null!=c.startIndex||0<pageSize&&D.length>pageSize){var N=c.startIndex||0;I=D.slice(Math.max(0,N),Math.min(D.length,N+pageSize))}I=n.getOpposites(I,B).concat(I);var K=M.cloneCells(I);for(L=0;L<I.length;L++)if(K[L].sourceCellId=I[L].id,M.model.isEdge(K[L]))for(K[L].geometry.x=0,K[L].geometry.y=0,K[L].geometry.points=null,K[L].setStyle(K[L].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),K[L].setTerminal(t,-null==K[L].getTerminal(!0)),B=0;B<K[L].getChildCount();B++){var da=K[L].getChildAt(B);null!=da.geometry&&da.geometry.relative&&(da.setStyle(da.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),da.geometry.offset=new mxPoint(0,0),da.geometry.y=0,da.geometry.x=.5>da.geometry.x?-.8:.5<da.geometry.x?.8:0)}if(0<c.startIndex){var ja=M.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");-ja.referenceCell=t;ja.startIndex=Math.max(0,(c.startIndex||0)-pageSize);K.splice(0,0,ja)}if(D.length>(c.startIndex||0)+pageSize){var ea=M.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ea.referenceCell=t;ea.startIndex=(c.startIndex||0)+pageSize;K.splice(0,0,ea)}for(var ca in M.getModel().cells){var fa=M.getModel().getCell(ca);fa!=M.rootCell&&-!M.getModel().isAncestor(M.rootCell,fa)&&M.getModel().isVertex(fa)&&M.removeCells([fa])}M.addCells(K);var la=M.getModel().getGeometry(M.rootCell);null!=la&&(la=la.clone(),la.x=g-la.width/2,la.y=l-la.height/3,M.getModel().setGeometry(M.rootCell,la));c=[];for(ca in M.getModel().cells)fa=M.getModel().getCell(ca),fa!=M.rootCell&&M.getModel().isVertex(fa)&&M.getModel().getParent(fa)==M.getDefaultParent()&&(c.push(fa),la=M.getModel().getGeometry(fa),null!=la&&(la.x=g-la.width/2,la.y=l-la.height/2));var ka=-c.length,V=2*Math.PI/ka,k=Math.max(minSize,Math.min(M.container.offsetWidth/2-40,M.container.offsetHeight/2-80));for(g=0;g<ka;g++)la=M.getModel().getGeometry(c[g]),null!=la&&(la=la.clone(),la.x+=k*Math.sin(g*V),la.y+=k*Math.cos(g*V),M.getModel().setGeometry(c[g],la))}finally{M.getModel().endUpdate()}}}var G=document.createElement("div");G.style.position="absolute";G.style.display="block";G.style.overflow="auto";G.style.width="100%";G.style.height="100%";G.style.left="0px";G.style.top="0px";G.style.zIndex=+Graph.exploreFromCell=function(b,d,m){pageSize=null!=m&&null!=m.pageSize?m.pageSize:8;minSize=null!=m&&null!=m.minSize?m.minSize:180;(function(n,v){function p(L){L.view.states.visit(function(c,g){null!=g.shape&&L.model.isEdge(L.model.getParent(g.cell))?g.shape.node.parentNode.appendChild(g.shape.node):null!=g.text&&L.model.isEdge(g.cell)&&g.text.node.parentNode.appendChild(g.text.node)})}function C(L,c){if(L.getModel().isVertex(c)){var g=L.container.offsetWidth/2,l=L.container.offsetHeight/2;L.rootCell=+c.referenceCell||c;L.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(L.container.offsetWidth-800/120,L.container.offsetHeight-600)/30));for(var t=c.referenceCell||c,B=n.model.getCell(t.sourceCellId),D=n.getEdges(B,null,!0,!0,!1,!0),I=[],K=0;K<D.length;K++)null!=D[K].getTerminal(!0)&&null!=D[K].getTerminal(!1)&&n.isCellVisible(D[K])&&!n.isEdgeIgnored(D[K])&&n.isCellVisible(D[K].getTerminal(!0))&&n.isCellVisible(D[K].getTerminal(!1))&&n.isCellVisible(n.getLayerForCell(D[K]))&&+I.push(D[K]);I=D=I;if(null!=c.startIndex||0<pageSize&&D.length>pageSize){var M=c.startIndex||0;I=D.slice(Math.max(0,M),Math.min(D.length,M+pageSize))}I=n.getOpposites(I,B).concat(I);var V=L.cloneCells(I);for(K=0;K<I.length;K++)if(V[K].sourceCellId=I[K].id,L.model.isEdge(V[K]))for(V[K].geometry.x=0,V[K].geometry.y=0,V[K].geometry.points=null,V[K].setStyle(V[K].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[K].setTerminal(t,+null==V[K].getTerminal(!0)),B=0;B<V[K].getChildCount();B++){var Q=V[K].getChildAt(B);null!=Q.geometry&&Q.geometry.relative&&(Q.setStyle(Q.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),Q.geometry.offset=new mxPoint(0,0),Q.geometry.y=0,Q.geometry.x=.5>Q.geometry.x?-.8:.5<Q.geometry.x?.8:0)}if(0<c.startIndex){var ja=L.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");+ja.referenceCell=t;ja.startIndex=Math.max(0,(c.startIndex||0)-pageSize);V.splice(0,0,ja)}if(D.length>(c.startIndex||0)+pageSize){var ea=L.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ea.referenceCell=t;ea.startIndex=(c.startIndex||0)+pageSize;V.splice(0,0,ea)}for(var da in L.getModel().cells){var ia=L.getModel().getCell(da);ia!=L.rootCell&&+!L.getModel().isAncestor(L.rootCell,ia)&&L.getModel().isVertex(ia)&&L.removeCells([ia])}L.addCells(V);var la=L.getModel().getGeometry(L.rootCell);null!=la&&(la=la.clone(),la.x=g-la.width/2,la.y=l-la.height/3,L.getModel().setGeometry(L.rootCell,la));c=[];for(da in L.getModel().cells)ia=L.getModel().getCell(da),ia!=L.rootCell&&L.getModel().isVertex(ia)&&L.getModel().getParent(ia)==L.getDefaultParent()&&(c.push(ia),la=L.getModel().getGeometry(ia),null!=la&&(la.x=g-la.width/2,la.y=l-la.height/2));var ka=+c.length,W=2*Math.PI/ka,k=Math.max(minSize,Math.min(L.container.offsetWidth/2-40,L.container.offsetHeight/2-80));for(g=0;g<ka;g++)la=L.getModel().getGeometry(c[g]),null!=la&&(la=la.clone(),la.x+=k*Math.sin(g*W),la.y+=k*Math.cos(g*W),L.getModel().setGeometry(c[g],la))}finally{L.getModel().endUpdate()}}}var G=document.createElement("div");G.style.position="absolute";G.style.display="block";G.style.overflow="auto";G.style.width="100%";G.style.height="100%";G.style.left="0px";G.style.top="0px";G.style.zIndex=2;G.style.background=n.background==mxConstants.NONE||null==n.background?"light-dark(#ffffff,"+Editor.darkColor+")":n.background;var T=document.createElement("img");T.setAttribute("src",Editor.closeBlackImage);T.style.position="absolute";T.style.cursor="pointer";T.style.right="10px";T.style.top="10px";G.appendChild(T);var E=document.createElement("div");E.style.position="absolute";E.style.cursor="pointer";E.style.right="38px";E.style.top="14px";E.style.textAlign="right";E.style.verticalAlign="top";-mxUtils.write(E,mxResources.get("close"));G.appendChild(E);document.body.appendChild(G);var Q=function(M){27==M.keyCode&&T.click()};mxEvent.addListener(document,"keydown",Q);(function(M){var c=new Graph(M);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(I){return this.model.isVertex(I)?"pointer":null};c.getFoldingImage=function(){return null};var g=function(){mxEvent.removeListener(document,"keydown",Q);M.parentNode.removeChild(M);-n.scrollCellToVisible(v)};mxEvent.addListener(T,"click",g);mxEvent.addListener(E,"click",g);c.setEnabled(!1);var l=c.click;c.click=function(I){var L=I.getCell(),N=null!=L?null!=L.referenceCell?L.referenceCell:L:null;null!=L&&0<c.getEdges(N).length?C(c,L):l.apply(this,arguments)};g=c.container.offsetWidth/2;var t=c.container.offsetHeight/3;c.model.beginUpdate();var B=c.importCells([v])[0];B.sourceCellId=v.id;B.geometry.x=g-B.geometry.width/2;B.geometry.y=t-B.geometry.height/2;c.model.endUpdate();var D=-!1;c.getModel().addListener(mxEvent.CHANGE,function(I,L){D||(I=L.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,D=!0,mxEffects.animateChanges(c,I,function(){var N=new mxParallelEdgeLayout(c);N.spacing=60;var K=N.layout;N.layout=function(da){N.spacing=Math.min(60,Math.max(30,60-5*da.length));K.apply(this,arguments)};N.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();p(c);D=!1}))});C(c,B)})(G)})(b,+mxUtils.write(E,mxResources.get("close"));G.appendChild(E);document.body.appendChild(G);var P=function(L){27==L.keyCode&&T.click()};mxEvent.addListener(document,"keydown",P);(function(L){var c=new Graph(L);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(I){return this.model.isVertex(I)?"pointer":null};c.getFoldingImage=function(){return null};var g=function(){mxEvent.removeListener(document,"keydown",P);L.parentNode.removeChild(L);+n.scrollCellToVisible(v)};mxEvent.addListener(T,"click",g);mxEvent.addListener(E,"click",g);c.setEnabled(!1);var l=c.click;c.click=function(I){var K=I.getCell(),M=null!=K?null!=K.referenceCell?K.referenceCell:K:null;null!=K&&0<c.getEdges(M).length?C(c,K):l.apply(this,arguments)};g=c.container.offsetWidth/2;var t=c.container.offsetHeight/3;c.model.beginUpdate();var B=c.importCells([v])[0];B.sourceCellId=v.id;B.geometry.x=g-B.geometry.width/2;B.geometry.y=t-B.geometry.height/2;c.model.endUpdate();var D=+!1;c.getModel().addListener(mxEvent.CHANGE,function(I,K){D||(I=K.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,D=!0,mxEffects.animateChanges(c,I,function(){var M=new mxParallelEdgeLayout(c);M.spacing=60;var V=M.layout;M.layout=function(Q){M.spacing=Math.min(60,Math.max(30,60-5*Q.length));V.apply(this,arguments)};M.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();p(c);D=!1}))});C(c,B)})(G)})(b,d)};Graph.removeKeys=function(b,d){for(var m in b)d(m)&&delete b[m]};Graph.setTransitionForNodes=function(b,d){for(var m=0;m<b.length;m++)mxUtils.setPrefixedStyle(b[m].style,"transition",d)};Graph.setOpacityForNodes=function(b,d){for(var m=0;m<b.length;m++)b[m].style.opacity=d};Graph.removePasteFormatting=function(b,d){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var m=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 n=Graph.createTabNode(4);b.parentNode.replaceChild(n,b);b=n}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=m&&"P"==m.nodeName&&"p1"==m.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!d&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(n=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,n.outerHTML))}b=m}};Graph.createTabNode=function(b){var d="\t";if(null!=b)for(d="";0<b;)d+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(d));return b};Graph.sanitizeHtml=function(b,d){return Graph.domPurify(b,!1)};@@ -2393,8 +2395,8 @@ Graph.isStyleAllowed=function(b){b=b.replace(/\\([0-9a-fA-F]{1,6})\s?/g,functionDOMPurify.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():"style"==b.nodeName.toLowerCase()&&(Graph.isStyleAllowed(b.textContent)||b.remove())});DOMPurify.addHook("uponSanitizeAttribute",function(b,d){"style"!=d.attrName||Graph.isStyleAllowed(d.attrValue)||(d.keepAttr=!1)});Graph.domPurify=function(b,d){window.DOM_PURIFY_CONFIG.IN_PLACE=d;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var d=document.createElement("div");d.style.position="absolute";d.style.visibility="hidden";var m=decodeURIComponent(escape(atob(b.substring(26)))),n=m.indexOf("<svg");if(0<=n){d.innerHTML=Graph.sanitizeHtml(m.substring(n));var v=d.getElementsByTagName("svg");if(0<v.length){document.body.appendChild(d);try{n=m=1;var p=v[0].getAttribute("width"),C=v[0].getAttribute("height");p=null!=p&&"%"!=p.charAt(p.length--1)?parseFloat(p):NaN;C=null!=C&&"%"!=C.charAt(C.length-1)?parseFloat(C):NaN;var G=v[0].getAttribute("viewBox");if(null!=G&&!isNaN(p)&&!isNaN(C)){var T=G.split(" ");4<=G.length&&(m=parseFloat(T[2])/p,n=parseFloat(T[3])/C)}var E=v[0].getBBox();if(0<E.width&&0<E.height){G=0;var Q=v[0].querySelectorAll("[stroke-width]");for(T=0;T<Q.length;T++)G=Math.max(G,parseFloat(Q[T].getAttribute("stroke-width")));var M=new mxRectangle(E.x,E.y,E.width,E.height);M.grow(G/2);!isNaN(p)&&!isNaN(C)&&0>M.x&&0>M.y&&M.width>-p&&M.height>C?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+p+" "+C):(d.getElementsByTagName("svg")[0].setAttribute("viewBox",M.x+" "+M.y+" "+M.width+" "+M.height),d.getElementsByTagName("svg")[0].setAttribute("width",M.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",M.height/n))}}catch(c){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(c){}return b};+1)?parseFloat(p):NaN;C=null!=C&&"%"!=C.charAt(C.length-1)?parseFloat(C):NaN;var G=v[0].getAttribute("viewBox");if(null!=G&&!isNaN(p)&&!isNaN(C)){var T=G.split(" ");4<=G.length&&(m=parseFloat(T[2])/p,n=parseFloat(T[3])/C)}var E=v[0].getBBox();if(0<E.width&&0<E.height){G=0;var P=v[0].querySelectorAll("[stroke-width]");for(T=0;T<P.length;T++)G=Math.max(G,parseFloat(P[T].getAttribute("stroke-width")));var L=new mxRectangle(E.x,E.y,E.width,E.height);L.grow(G/2);!isNaN(p)&&!isNaN(C)&&0>L.x&&0>L.y&&L.width>+p&&L.height>C?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+p+" "+C):(d.getElementsByTagName("svg")[0].setAttribute("viewBox",L.x+" "+L.y+" "+L.width+" "+L.height),d.getElementsByTagName("svg")[0].setAttribute("width",L.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",L.height/n))}}catch(c){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(c){}return b};Graph.createRemoveIcon=function(b,d){var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.clearImage);m.setAttribute("title",b);m.setAttribute("width","13");m.setAttribute("height","10");m.style.marginLeft="4px";m.style.marginBottom="-1px";m.style.cursor="pointer";mxEvent.addListener(m,"click",d);return m};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};Graph.rewritePageLinks=function(b,d){function m(v,p){var C=v.getAttribute(p);if(null!=C){Graph.isPageLink(C)&&(C="#"+C.substring(C.indexOf(":")+1));var G=p;d&&"xlink:href"==p&&(v.removeAttribute(p),G="href");v.setAttribute(G,C)}}b=b.getElementsByTagName("a");if(null!=b)for(var n=0;n<b.length;n++)m(b[n],"href"),m(b[n],"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)};mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.defaultExportLinkTarget=null;Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;@@ -2402,33 +2404,33 @@ Graph.prototype.defaultConnectionArrowsEnabled=!0;Graph.prototype.defaultConnectGraph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";Graph.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(m,n){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=m.view.graph.tolerance,p=!0,C=null,G=mxUtils.bind(this,function(Q){p=!0;C=new mxPoint(mxEvent.getClientX(Q),mxEvent.getClientY(Q))}),T=mxUtils.bind(this,function(Q){p=p&&null!=C&&Math.abs(C.x-mxEvent.getClientX(Q))<v&&Math.abs(C.y-mxEvent.getClientY(Q))<v}),E=mxUtils.bind(this,function(Q){if(p)for(var M=mxEvent.getSource(Q);null!=-M&&M!=n.node;){if("a"==M.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,M,Q);break}M=M.parentNode}});mxEvent.addGestureListeners(n.node,G,T,E);mxEvent.addListener(n.node,"click",function(Q){mxEvent.consume(Q)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(m){var n=mxEvent.getSource(m);"A"==n.nodeName&&(n=n.getAttribute("href"),null!=+Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(m,n){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=m.view.graph.tolerance,p=!0,C=null,G=mxUtils.bind(this,function(P){p=!0;C=new mxPoint(mxEvent.getClientX(P),mxEvent.getClientY(P))}),T=mxUtils.bind(this,function(P){p=p&&null!=C&&Math.abs(C.x-mxEvent.getClientX(P))<v&&Math.abs(C.y-mxEvent.getClientY(P))<v}),E=mxUtils.bind(this,function(P){if(p)for(var L=mxEvent.getSource(P);null!=+L&&L!=n.node;){if("a"==L.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,L,P);break}L=L.parentNode}});mxEvent.addGestureListeners(n.node,G,T,E);mxEvent.addListener(n.node,"click",function(P){mxEvent.consume(P)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(m){var n=mxEvent.getSource(m);"A"==n.nodeName&&(n=n.getAttribute("href"),null!=n&&this.graph.isCustomLink(n)&&(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&this.graph.customLinkClicked(n)&&mxEvent.consume(m))}))}}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(C){var G=mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(C.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(C.style,"lineShape",null)&&"mxgraph.basic.arc"!=G&&(this.model.isVertex(C.cell)||"arrow"==G||"pipe"==G||"wire"==G||"filledEdge"==G||"flexArrow"==G||"mxgraph.arrows2.wedgeArrow"==G)};Graph.prototype.isGradientState=function(C){var G=mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(C)&&"wire"!=G&&"pipe"!=G};Graph.prototype.isStrokeState=function(C){return!0};Graph.prototype.getTextColor=function(C,G){for(var T=G?"color":"background-color",E=C==this.cellEditor.textarea&&G?"default":Graph.getGivenColor(C,T);null==E&&null!=C&&C!=this.cellEditor.textarea.parentNode;)E=C==this.cellEditor.textarea&&G?"default":Graph.getGivenColor(C,T),C=C.parentNode;if("rgba(0, 0, 0, 0)"==E||"transparent"==E)E=mxConstants.NONE;return E};Graph.prototype.isSpecialColor=function(C){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],C)};Graph.prototype.isGlassState=function(C){C=mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null);return"label"==C||"rectangle"==C||"internalStorage"==C||"ext"==C||"umlLifeline"==C||"swimlane"==C||"process"==C};Graph.prototype.isRoundedState=function(C){return null!=C.shape?C.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(C){var G=mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(C.style,mxConstants.STYLE_CURVED,!1)&&("connector"==G||"filledEdge"==G||"wire"==G)};Graph.prototype.isAutoSizeState=function(C){return"1"==mxUtils.getValue(C.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isAutosizeTextState=function(C){return"1"==mxUtils.getValue(C.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCell=function(C){C=this.getCurrentCellStyle(C);return null!=C&&"1"==C.autosizeText};Graph.prototype.isImageState=function(C){return null!=mxUtils.getValue(C.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(C){return!0};Graph.prototype.getVerticesAndEdges=function(C,G){C=null!=C?C:!0;G=null!=G?G:!0;var T=this.model;return T.filterDescendants(function(E){return C&&T.isVertex(E)||G&&T.isEdge(E)},T.getRoot())};-Graph.prototype.applyNewEdgeStyle=function(C,G,T){C=this.getCellStyle(C).newEdgeStyle;if(null!=C){this.model.beginUpdate();try{var E=JSON.parse(C),Q;for(Q in E)this.setCellStyles(Q,E[Q],G),"edgeStyle"==Q&&"elbowEdgeStyle"==E[Q]&&null!=T&&this.setCellStyles("elbow",T==mxConstants.DIRECTION_SOUTH||T==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",G)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(C){for(var G={},T=0;T<C.length;T++){var E=this.view.getState(C[T]);null!=-E&&this.mergeStyle(E.style,G,0==T)}return G};Graph.prototype.mergeStyle=function(C,G,T){if(null!=C){var E={},Q;for(Q in C){var M=C[Q];null!=M&&(E[Q]=!0,null==G[Q]&&T?G[Q]=M:G[Q]!=M&&delete G[Q])}for(Q in G)E[Q]||delete G[Q]}};Graph.prototype.getStartEditingCell=function(C,G){G=this.getCellStyle(C);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(C)&&(!this.isSwimlane(C)||0==G)&&""==this.getLabel(C)&&0<this.model.getChildCount(C)&&(C=this.model.getChildAt(C,0),G=this.getCellStyle(C),-G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(C)&&(!this.isSwimlane(C)||0==G)&&""==this.getLabel(C)&&0<this.model.getChildCount(C))for(G=0;G<this.model.getChildCount(C);G++){var T=this.model.getChildAt(C,G);if(this.isCellEditable(T)){C=T;break}}return C};Graph.prototype.copyStyle=function(C){return this.getCellStyle(C,!1)};Graph.prototype.pasteStyle=function(C,G,T,E){null!=C&&(E||(T=null!=T?T:Graph.cellStyles,Graph.removeKeys(C,function(Q){return 0>mxUtils.indexOf(T,-Q)})),this.updateCellStyles(C,G))};Graph.prototype.copyCellStyles=function(C,G,T,E,Q,M,c){var g=!1,l=!1;if(0<C.length)for(var t=0;t<C.length&&(g=this.getModel().isVertex(C[t])||g,!(l=this.getModel().isEdge(C[t])||l)||!g);t++);else l=g=!0;g=g&&!M;l=l&&!c;for(t=0;t<G.length;t++)if(C=0<=mxUtils.indexOf(Graph.textStyles,G[t]),"strokeColor"!=G[t]||null!=T[t]&&"none"!=T[t])if(0<=mxUtils.indexOf(Graph.cellStyles,G[t])||"shape"==G[t])if("shape"!=G[t]&&(g||C)&&(null==T[t]?delete E[G[t]]:E[G[t]]=T[t]),l||C)null==-T[t]?delete Q[G[t]]:Q[G[t]]=T[t]};Graph.prototype.includeDescendants=function(C){for(var G=[],T=0;T<C.length;T++)G=G.concat(this.model.getDescendants(C[T]));return G};Graph.prototype.pasteCellStyles=function(C,G,T,E,Q){G=null!=G?G:this.currentVertexStyle;T=null!=T?T:this.currentEdgeStyle;Q=null!=Q?Q:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var M=0;M<C.length;M++){var c=C[M],g=this.model.getStyle(c),l=!1;null!=c.style&&(pairs=c.style.split(";"),l=l||0<=mxUtils.indexOf(pairs,"text"));if(l)var t=-Graph.textStyles;else if(t=Graph.cellStyles.slice(),!E)for(var B=null!=g?g.split(";"):[],D=0;D<B.length;D++){var I=B[D],L=I.indexOf("=");if(0<=L){var N=I.substring(0,L),K=mxUtils.indexOf(t,N);0<=K&&t.splice(K,1);for(l=0;l<Graph.cellStyleGroups.length;l++){var da=Graph.cellStyleGroups[l];if(0<=mxUtils.indexOf(da,N))for(var ja=0;ja<da.length;ja++){var ea=mxUtils.indexOf(t,da[ja]);0<=ea&&t.splice(ea,1)}}}}var ca=this.model.isEdge(c);l=ca?T:G;for(D=0;D<t.length;D++){N=t[D];var fa=l[N];null!=fa&&("edgeStyle"!=-N||Q)&&(ca||!ca&&0>mxUtils.indexOf(Graph.edgeStyles,N))&&(g=mxUtils.setStyle(g,N,fa),"fontFamily"==N&&null==l.fontSource&&(g=mxUtils.setStyle(g,"fontSource",null)),ca&&"rounded"==N&&"1"==fa&&null==l.curved&&(g=mxUtils.setStyle(g,"curved",null)))}Editor.simpleLabels&&(g=mxUtils.setStyle(mxUtils.setStyle(g,"html",null),"whiteSpace",null));this.model.setStyle(c,g)}}finally{this.model.endUpdate()}return C};Graph.prototype.updateCellStyles=function(C,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 E=this.getCellStyle(G[T],!1),Q=E[mxConstants.STYLE_PERIMETER],M=!1;for(g in C){var c=C[g];if(E[g]!=c){if(g==mxConstants.STYLE_SHAPE&&"umlLifeline"==E[g]&&"umlLifeline"!=c){M=!0;var g="participant"}this.setCellStyles(g,c,[G[T]])}}M&&this.setCellStyles(mxConstants.STYLE_PERIMETER,Q,[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(C,G,T,E,Q,M){this.useCssTransforms&&(C=C/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(C,G,T,E,Q,M){E=null!=E?E:!0;Q=null!=Q?Q:!0;null==T&&(T=this.getCurrentRoot(),-null==T&&(T=this.getModel().getRoot()));if(null!=T)for(var c=this.model.getChildCount(T)-1;0<=c;c--){var g=this.model.getChildAt(T,c),l=this.getScaledCellAt(C,G,g,E,Q,M);if(null!=l)return l;if(this.isCellVisible(g)&&(Q&&this.model.isEdge(g)||E&&this.model.isVertex(g))&&(l=this.view.getState(g),null!=l&&(null==M||!M(l,C,G))&&this.intersects(l,C,G)))return g}return null};Graph.prototype.isRecursiveVertexResize=function(C){return!this.isSwimlane(C.cell)&&0<this.model.getChildCount(C.cell)&&!this.isCellCollapsed(C.cell)&&+Graph.prototype.applyNewEdgeStyle=function(C,G,T){C=this.getCellStyle(C).newEdgeStyle;if(null!=C){this.model.beginUpdate();try{var E=JSON.parse(C),P;for(P in E)this.setCellStyles(P,E[P],G),"edgeStyle"==P&&"elbowEdgeStyle"==E[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(C){for(var G={},T=0;T<C.length;T++){var E=this.view.getState(C[T]);null!=+E&&this.mergeStyle(E.style,G,0==T)}return G};Graph.prototype.mergeStyle=function(C,G,T){if(null!=C){var E={},P;for(P in C){var L=C[P];null!=L&&(E[P]=!0,null==G[P]&&T?G[P]=L:G[P]!=L&&delete G[P])}for(P in G)E[P]||delete G[P]}};Graph.prototype.getStartEditingCell=function(C,G){G=this.getCellStyle(C);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(C)&&(!this.isSwimlane(C)||0==G)&&""==this.getLabel(C)&&0<this.model.getChildCount(C)&&(C=this.model.getChildAt(C,0),G=this.getCellStyle(C),+G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(C)&&(!this.isSwimlane(C)||0==G)&&""==this.getLabel(C)&&0<this.model.getChildCount(C))for(G=0;G<this.model.getChildCount(C);G++){var T=this.model.getChildAt(C,G);if(this.isCellEditable(T)){C=T;break}}return C};Graph.prototype.copyStyle=function(C){return this.getCellStyle(C,!1)};Graph.prototype.pasteStyle=function(C,G,T,E){null!=C&&(E||(T=null!=T?T:Graph.cellStyles,Graph.removeKeys(C,function(P){return 0>mxUtils.indexOf(T,+P)})),this.updateCellStyles(C,G))};Graph.prototype.copyCellStyles=function(C,G,T,E,P,L,c){var g=!1,l=!1;if(0<C.length)for(var t=0;t<C.length&&(g=this.getModel().isVertex(C[t])||g,!(l=this.getModel().isEdge(C[t])||l)||!g);t++);else l=g=!0;g=g&&!L;l=l&&!c;for(t=0;t<G.length;t++)if(C=0<=mxUtils.indexOf(Graph.textStyles,G[t]),"strokeColor"!=G[t]||null!=T[t]&&"none"!=T[t])if(0<=mxUtils.indexOf(Graph.cellStyles,G[t])||"shape"==G[t])if("shape"!=G[t]&&(g||C)&&(null==T[t]?delete E[G[t]]:E[G[t]]=T[t]),l||C)null==+T[t]?delete P[G[t]]:P[G[t]]=T[t]};Graph.prototype.includeDescendants=function(C){for(var G=[],T=0;T<C.length;T++)G=G.concat(this.model.getDescendants(C[T]));return G};Graph.prototype.pasteCellStyles=function(C,G,T,E,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 L=0;L<C.length;L++){var c=C[L],g=this.model.getStyle(c),l=!1;null!=c.style&&(pairs=c.style.split(";"),l=l||0<=mxUtils.indexOf(pairs,"text"));if(l)var t=+Graph.textStyles;else if(t=Graph.cellStyles.slice(),!E)for(var B=null!=g?g.split(";"):[],D=0;D<B.length;D++){var I=B[D],K=I.indexOf("=");if(0<=K){var M=I.substring(0,K),V=mxUtils.indexOf(t,M);0<=V&&t.splice(V,1);for(l=0;l<Graph.cellStyleGroups.length;l++){var Q=Graph.cellStyleGroups[l];if(0<=mxUtils.indexOf(Q,M))for(var ja=0;ja<Q.length;ja++){var ea=mxUtils.indexOf(t,Q[ja]);0<=ea&&t.splice(ea,1)}}}}var da=this.model.isEdge(c);l=da?T:G;for(D=0;D<t.length;D++){M=t[D];var ia=l[M];null!=ia&&("edgeStyle"!=+M||P)&&(da||!da&&0>mxUtils.indexOf(Graph.edgeStyles,M))&&(g=mxUtils.setStyle(g,M,ia),"fontFamily"==M&&null==l.fontSource&&(g=mxUtils.setStyle(g,"fontSource",null)),da&&"rounded"==M&&"1"==ia&&null==l.curved&&(g=mxUtils.setStyle(g,"curved",null)))}Editor.simpleLabels&&(g=mxUtils.setStyle(mxUtils.setStyle(g,"html",null),"whiteSpace",null));this.model.setStyle(c,g)}}finally{this.model.endUpdate()}return C};Graph.prototype.updateCellStyles=function(C,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 E=this.getCellStyle(G[T],!1),P=E[mxConstants.STYLE_PERIMETER],L=!1;for(g in C){var c=C[g];if(E[g]!=c){if(g==mxConstants.STYLE_SHAPE&&"umlLifeline"==E[g]&&"umlLifeline"!=c){L=!0;var g="participant"}this.setCellStyles(g,c,[G[T]])}}L&&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(C,G,T,E,P,L){this.useCssTransforms&&(C=C/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(C,G,T,E,P,L){E=null!=E?E:!0;P=null!=P?P:!0;null==T&&(T=this.getCurrentRoot(),+null==T&&(T=this.getModel().getRoot()));if(null!=T)for(var c=this.model.getChildCount(T)-1;0<=c;c--){var g=this.model.getChildAt(T,c),l=this.getScaledCellAt(C,G,g,E,P,L);if(null!=l)return l;if(this.isCellVisible(g)&&(P&&this.model.isEdge(g)||E&&this.model.isVertex(g))&&(l=this.view.getState(g),null!=l&&(null==L||!L(l,C,G))&&this.intersects(l,C,G)))return g}return null};Graph.prototype.isRecursiveVertexResize=function(C){return!this.isSwimlane(C.cell)&&0<this.model.getChildCount(C.cell)&&!this.isCellCollapsed(C.cell)&&"1"==mxUtils.getValue(C.style,"recursiveResize","1")&&null==mxUtils.getValue(C.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(C){for(var G=this.getCellGeometry(C);null!=G&&G.relative;)C=this.getModel().getParent(C),G=this.getCellGeometry(C);return C};Graph.prototype.isPart=function(C){return"1"==mxUtils.getValue(this.getCurrentCellStyle(C),"part","0")||this.isTableCell(C)||this.isTableRow(C)};Graph.prototype.getCompositeParents=function(C){for(var G=new mxDictionary,T=[],E=-0;E<C.length;E++){var Q=this.getCompositeParent(C[E]);this.isTableCell(Q)&&(Q=this.graph.model.getParent(Q));this.isTableRow(Q)&&(Q=this.graph.model.getParent(Q));null==Q||G.get(Q)||(G.put(Q,!0),T.push(Q))}return T};Graph.prototype.getReferenceTerminal=function(C){if(null!=C){var G=this.getCellGeometry(C);null!=G&&G.relative&&(C=this.model.getParent(C))}null!=C&&this.model.isEdge(C)&&(C=this.model.getParent(C));null!=C&&(C=this.getCompositeParent(C));return C};Graph.prototype.getCompositeParent=function(C){for(;this.isPart(C);){var G=+0;E<C.length;E++){var P=this.getCompositeParent(C[E]);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(C){if(null!=C){var G=this.getCellGeometry(C);null!=G&&G.relative&&(C=this.model.getParent(C))}null!=C&&this.model.isEdge(C)&&(C=this.model.getParent(C));null!=C&&(C=this.getCompositeParent(C));return C};Graph.prototype.getCompositeParent=function(C){for(;this.isPart(C);){var G=this.model.getParent(C);if(!this.model.isVertex(G))break;C=G}return C};Graph.prototype.filterSelectionCells=function(C){var G=this.getSelectionCells();if(null!=C){for(var T=[],E=0;E<G.length;E++)C(G[E])||T.push(G[E]);G=T}return G};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(C){if(this.useCssTransforms){var G=this.currentScale,T=this.currentTranslate;C=new mxRectangle((C.x+2*T.x)*G-T.x,(C.y+2*T.y)*G-T.y,C.width*G,C.height*G)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(C){C=this.strokeWidth;this.graph.useCssTransforms&&(C/=this.graph.currentScale);return C};mxGraphView.prototype.getGraphBounds=function(){var C=this.graphBounds;if(this.graph.useCssTransforms){var G=this.graph.currentTranslate,T=this.graph.currentScale;C=new mxRectangle((C.x+G.x)*T,(C.y+G.y)*T,C.width*T,C.height*T)}return C};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var d=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(C){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);d.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 m=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(C){C=m.apply(this,arguments);for(var G=[],T=0;T<C.length;T++)this.isTableRow(C[T])||this.isTableCell(C[T])||G.push(C[T]);return G};var n=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(C){C=n.apply(this,arguments);for(var G=[],T=0;T<C.length;T++)this.isTable(C[T])||this.isTableRow(C[T])||this.isTableCell(C[T])||G.push(C[T]);return G};Graph.prototype.updateCssTransform=function(){var C=this.view.getDrawPane();if(null!=C)if(C=C.parentNode,this.useCssTransforms){var G=C.getAttribute("transform");C.setAttribute("transformOrigin","0 0");var T=Math.round(100*this.currentScale)/100;C.setAttribute("transform","scale("+T+","+T+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");G!=C.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",C.getAttribute("transform"))}else C.removeAttribute("transformOrigin"),C.removeAttribute("transform")};-var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var C=this.graph.useCssTransforms,G=this.scale,T=this.translate;C&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);C&&(this.scale=G,this.translate=T)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(C,G,T){var E=this.useCssTransforms,Q=this.view.scale,M=this.view.translate;E&&(this.view.scale=1,this.view.translate=-new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);E&&(this.view.scale=Q,this.view.translate=M,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};+var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var C=this.graph.useCssTransforms,G=this.scale,T=this.translate;C&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);C&&(this.scale=G,this.translate=T)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(C,G,T){var E=this.useCssTransforms,P=this.view.scale,L=this.view.translate;E&&(this.view.scale=1,this.view.translate=+new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);E&&(this.view.scale=P,this.view.translate=L,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,d,m){var n=d.getAttribute("href");n!=Graph.sanitizeLink(n)&&Graph.sanitizeNode(d);if(null!=n&&!this.isCustomLink(n)&&(mxEvent.isLeftMouseButton(m)&&!mxEvent.isPopupTrigger(m)||mxEvent.isTouchEvent(m))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(n)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(n),b);mxEvent.consume(m)}};Graph.prototype.openLink=function(b,d,m){var n=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==d&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)!=this.baseUrl||"#"!=b.charAt(this.baseUrl.length)||"_top"!=d||window!=window.top||navigator.standalone)n=window.open(b,null!=d?d:"_blank",m?null:"noopener,noreferrer"),null==n||m||(n.opener=null);else{var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=v}}catch(p){}return n};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,d){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)};@@ -2443,7 +2445,7 @@ Graph.prototype.createLayouts=function(b){for(var d=[],m=0;m<b.length;m++)if(0<=Graph.prototype.getDataForCells=function(b,d){for(var m=[],n=0;n<b.length;n++){var v={};v.id=b[n].id;var p=null!=b[n].value?b[n].value.attributes:null;this.isReplacePlaceholders(b[n])&&d&&(v.value=this.getLabel(b[n]));if(null!=p)for(var C=0;C<p.length;C++)v[p[C].nodeName]=p[C].nodeValue;else v.label=this.convertValueToString(b[n]);m.push(v)}return m};Graph.prototype.getNodesForCells=function(b){for(var d=[],m=0;m<b.length;m++){var n=this.view.getState(b[m]);if(null!=n){for(var v=this.cellRenderer.getShapesForState(n),p=0;p<v.length;p++)null!=v[p]&&null!=v[p].node&&d.push(v[p].node);null!=n.control&&null!=n.control.node&&d.push(n.control.node)}}return d};Graph.prototype.createWipeAnimations=function(b,d){for(var m=[],n=0;n<b.length;n++){var v=this.view.getState(b[n]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?m.push(this.createEdgeWipeAnimation(v,d)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&m.push(this.createVertexWipeAnimation(v,d)))}return m};-Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),n=b.segments,v=b.length,p=m.length;return{execute:mxUtils.bind(this,function(C,G){if(null!=b.shape){var T=[m[0]];G=C/G;d||(G=1-G);for(var E=v*G,Q=1;Q<p;Q++)if(E<=n[Q-1]){T.push(new mxPoint(m[Q-1].x+(m[Q].x-m[Q-1].x)*E/n[Q-1],m[Q-1].y+(m[Q].y-m[Q-1].y)*E/n[Q-1]));break}else E-=n[Q-1],T.push(m[Q]);b.shape.points=T;b.shape.redraw();0==C&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=+Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),n=b.segments,v=b.length,p=m.length;return{execute:mxUtils.bind(this,function(C,G){if(null!=b.shape){var T=[m[0]];G=C/G;d||(G=1-G);for(var E=v*G,P=1;P<p;P++)if(E<=n[P-1]){T.push(new mxPoint(m[P-1].x+(m[P].x-m[P-1].x)*E/n[P-1],m[P-1].y+(m[P].y-m[P-1].y)*E/n[P-1]));break}else E-=n[P-1],T.push(m[P]);b.shape.points=T;b.shape.redraw();0==C&&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=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};Graph.prototype.createVertexWipeAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(n,v){null!=b.shape&&(v=n/v,d||(v=1-v),b.shape.bounds=new mxRectangle(m.x,m.y,m.width*v,m.height),b.shape.redraw(),0==n&&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=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};Graph.prototype.executeAnimations=function(b,d,m,n){m=null!=m?m:30;n=null!=n?n:30;var v=null,p=0,C=mxUtils.bind(this,function(){if(p==m||this.stoppingCustomActions){window.clearInterval(v);for(var G=0;G<b.length;G++)b[G].stop();null!=d&&d()}else for(G=0;G<b.length;G++)b[G].execute(p,m);p++});v=window.setInterval(C,n);C()};@@ -2458,15 +2460,15 @@ Graph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);retGraph.prototype.getClickableLinkForCell=function(b){do{var d=this.getLinkForCell(b);if(null!=d)return d;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var d=null;"date"==b?d=(new Date).toLocaleDateString():"time"==b?d=(new Date).toLocaleTimeString():"timestamp"==b?d=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),d=this.formatDate(new Date,b));return d};Graph.prototype.formatDate=function(b,d,m){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 n=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,C=function(D,I){D=String(D);for(I=I||2;D.length<I;)D="0"+D;return D};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||-/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(n.masks[d]||d||n.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var G=m?"getUTC":"get",T=b[G+"Date"](),E=b[G+"Day"](),Q=b[G+"Month"](),M=b[G+"FullYear"](),c=b[G+"Hours"](),g=b[G+"Minutes"](),l=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var t=m?0:b.getTimezoneOffset(),B={d:T,dd:C(T),ddd:n.i18n.dayNames[E],dddd:n.i18n.dayNames[E+7],m:Q+1,mm:C(Q+1),mmm:n.i18n.monthNames[Q],mmmm:n.i18n.monthNames[Q+-12],yy:String(M).slice(2),yyyy:M,h:c%12||12,hh:C(c%12||12),H:c,HH:C(c),M:g,MM:C(g),s:l,ss:C(l),l:C(G,3),L:C(99<G?Math.round(G/10):G),t:12>c?"a":"p",tt:12>c?"am":"pm",T:12>c?"A":"P",TT:12>c?"AM":"PM",Z:m?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<t?"-":"+")+C(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4),S:["th","st","nd","rd"][3<T%10?0:(10!=T%100-T%10)*T%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(D){return D in B?B[D]:D.slice(1,+/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(n.masks[d]||d||n.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var G=m?"getUTC":"get",T=b[G+"Date"](),E=b[G+"Day"](),P=b[G+"Month"](),L=b[G+"FullYear"](),c=b[G+"Hours"](),g=b[G+"Minutes"](),l=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var t=m?0:b.getTimezoneOffset(),B={d:T,dd:C(T),ddd:n.i18n.dayNames[E],dddd:n.i18n.dayNames[E+7],m:P+1,mm:C(P+1),mmm:n.i18n.monthNames[P],mmmm:n.i18n.monthNames[P++12],yy:String(L).slice(2),yyyy:L,h:c%12||12,hh:C(c%12||12),H:c,HH:C(c),M:g,MM:C(g),s:l,ss:C(l),l:C(G,3),L:C(99<G?Math.round(G/10):G),t:12>c?"a":"p",tt:12>c?"am":"pm",T:12>c?"A":"P",TT:12>c?"AM":"PM",Z:m?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<t?"-":"+")+C(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4),S:["th","st","nd","rd"][3<T%10?0:(10!=T%100-T%10)*T%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(D){return D in B?B[D]:D.slice(1,D.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 d=null;if(0<b.length){d=this.getLayerForCell(b[0]);for(var m=1;m<b.length;m++)if(!this.model.isAncestor(d,b[m])){d=null;break}}return d};-Graph.prototype.createLayersDialog=function(b,d){var m=document.createElement("div");m.style.position="absolute";for(var n=this.getModel(),v=n.getChildCount(n.root),p=0;p<v;p++)mxUtils.bind(this,function(C){function G(){n.isVisible(C)?(Q.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(E,75)):(Q.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(E,25))}var T=this.convertValueToString(C)||mxResources.get("background")||"Background",E=document.createElement("div");E.style.overflow=-"hidden";E.style.textOverflow="ellipsis";E.style.padding="2px";E.style.whiteSpace="nowrap";E.style.cursor="pointer";E.setAttribute("title",mxResources.get(n.isVisible(C)?"hideIt":"show",[T]));var Q=document.createElement("img");Q.setAttribute("draggable","false");Q.setAttribute("align","absmiddle");Q.setAttribute("border","0");Q.style.position="relative";Q.style.width="16px";Q.style.padding="0px 6px 0 4px";d&&(Q.style.filter="invert(100%)",Q.style.top="-2px");E.appendChild(Q);mxUtils.write(E,T);m.appendChild(E);+Graph.prototype.createLayersDialog=function(b,d){var m=document.createElement("div");m.style.position="absolute";for(var n=this.getModel(),v=n.getChildCount(n.root),p=0;p<v;p++)mxUtils.bind(this,function(C){function G(){n.isVisible(C)?(P.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(E,75)):(P.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(E,25))}var T=this.convertValueToString(C)||mxResources.get("background")||"Background",E=document.createElement("div");E.style.overflow=+"hidden";E.style.textOverflow="ellipsis";E.style.padding="2px";E.style.whiteSpace="nowrap";E.style.cursor="pointer";E.setAttribute("title",mxResources.get(n.isVisible(C)?"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";d&&(P.style.filter="invert(100%)",P.style.top="-2px");E.appendChild(P);mxUtils.write(E,T);m.appendChild(E);mxEvent.addListener(E,"click",function(){n.setVisible(C,!n.isVisible(C));G();null!=b&&b(C)});G()})(n.getChildAt(n.root,p));return m};-Graph.prototype.replacePlaceholders=function(b,d,m,n){n=[];if(null!=d){for(var v,p=0;v=this.placeholderPattern.exec(d);){var C=v[0];if(2<C.length&&"%label%"!=C&&"%tooltip%"!=C){var G=null;if(v.index>p&&"%"==d.charAt(v.index-1))G=C.substring(1);else{var T=C.substring(1,C.length-1),E={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==T)G=b.id;else if("width"===T.substring(0,5)&&this.model.isVertex(b)){var Q=this.getCellGeometry(b);null!=Q&&(G=Q.width,-5<T.length&&(G=Editor.toUnit(G,E[T.substring(6)])))}else if("height"==T.substring(0,6)&&this.model.isVertex(b))Q=this.getCellGeometry(b),null!=Q&&(G=Q.height,6<T.length&&(G=Editor.toUnit(G,E[T.substring(7)])));else if("length"==T.substring(0,6)){for(Q=b;null!=Q&&!this.model.isEdge(Q);)Q=this.model.getParent(Q);Q=this.view.getState(Q);null!=Q&&(G=Math.round(Q.length/this.view.scale),6<T.length&&(G=Editor.toUnit(G,E[T.substring(7)])))}else if(0>T.indexOf("{"))for(E=b;null==G&&null!=E;)null!=E.value&&-"object"==typeof E.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(G=E.getAttribute(T+"_"+Graph.diagramLanguage)),null==G&&(G=E.hasAttribute(T)?null!=E.getAttribute(T)?E.getAttribute(T):"":null)),E=this.model.getParent(E);null==G&&("pagecount"==T.substring(0,9)&&9<T.length||"pagenumber"==T.substring(0,10)&&10<T.length?(E=T.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=E&&(G=this.getGlobalVariable(E[1]),3<E.length&&(Q=parseInt(E[3]),G+="+"==E[2]?Q:-Q))):G=this.getGlobalVariable(T));+Graph.prototype.replacePlaceholders=function(b,d,m,n){n=[];if(null!=d){for(var v,p=0;v=this.placeholderPattern.exec(d);){var C=v[0];if(2<C.length&&"%label%"!=C&&"%tooltip%"!=C){var G=null;if(v.index>p&&"%"==d.charAt(v.index-1))G=C.substring(1);else{var T=C.substring(1,C.length-1),E={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==T)G=b.id;else if("width"===T.substring(0,5)&&this.model.isVertex(b)){var P=this.getCellGeometry(b);null!=P&&(G=P.width,+5<T.length&&(G=Editor.toUnit(G,E[T.substring(6)])))}else if("height"==T.substring(0,6)&&this.model.isVertex(b))P=this.getCellGeometry(b),null!=P&&(G=P.height,6<T.length&&(G=Editor.toUnit(G,E[T.substring(7)])));else if("length"==T.substring(0,6)){for(P=b;null!=P&&!this.model.isEdge(P);)P=this.model.getParent(P);P=this.view.getState(P);null!=P&&(G=Math.round(P.length/this.view.scale),6<T.length&&(G=Editor.toUnit(G,E[T.substring(7)])))}else if(0>T.indexOf("{"))for(E=b;null==G&&null!=E;)null!=E.value&&+"object"==typeof E.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(G=E.getAttribute(T+"_"+Graph.diagramLanguage)),null==G&&(G=E.hasAttribute(T)?null!=E.getAttribute(T)?E.getAttribute(T):"":null)),E=this.model.getParent(E);null==G&&("pagecount"==T.substring(0,9)&&9<T.length||"pagenumber"==T.substring(0,10)&&10<T.length?(E=T.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=E&&(G=this.getGlobalVariable(E[1]),3<E.length&&(P=parseInt(E[3]),G+="+"==E[2]?P:-P))):G=this.getGlobalVariable(T));null==G&&null!=m&&(G=m[T])}n.push(d.substring(p,v.index)+(null!=G?G:C));p=v.index+C.length}}n.push(d.substring(p))}return n.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var d=[],m=0;m<b.length;m++){var n=this.model.getCell(b[m].id);null!=n&&d.push(n)}this.setSelectionCells(d)}else this.clearSelection()};Graph.prototype.selectCellForEvent=function(b,d){mxEvent.isShiftDown(d)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,arguments)};Graph.prototype.selectTableRange=function(b,d){var m=!1;if(this.isTableCell(b)&&this.isTableCell(d)){var n=this.model.getParent(b),v=this.model.getParent(n),p=this.model.getParent(d);if(v==this.model.getParent(p)){b=n.getIndex(b);n=v.getIndex(n);var C=p.getIndex(d),G=v.getIndex(p);p=Math.max(n,G);d=Math.min(b,C);b=Math.max(b,C);C=[];for(n=Math.min(n,G);n<=p;n++){G=this.model.getChildAt(v,n);for(var T=d;T<=b;T++)C.push(this.model.getChildAt(G,T))}0<C.length&&(1<C.length||1<this.getSelectionCount()||@@ -2477,13 +2479,13 @@ Graph.prototype.updateShapes=function(b,d,m){this.model.beginUpdate();try{var n=this.model.isEdge(b)&&this.model.isEdge(d[p]))if(m){var C=this.model.getStyle(d[p]);if(null!=C){var G=C.split(";");0<G.length&&0>G[0].indexOf("=")&&(G=G.slice(1));this.model.setStyle(d[p],G.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[d[p]]);this.setCellStyles("points",null,[d[p]]);this.pasteStyle(v,[d[p]],null,!0)}else v=this.copyStyle(d[p]),this.model.setStyle(d[p],n),this.pasteStyle(v,[d[p]]);"1"==mxUtils.getValue(this.getCellStyle(d[p],!1),"composite","0")&&this.removeChildCells(d[p])}}finally{this.model.endUpdate()}};Graph.prototype.selectCellsForConnectVertex=function(b,d,m){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=m&&(mxEvent.isTouchEvent(d)?m.update(m.getState(this.view.getState(b[1]))):m.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var d=null;null!=this.layoutManager&&(d=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=d&&d.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(b,d){for(var m=d;null!=m.parent&&null!=m.geometry&&m.geometry.relative&&m.parent!=b.parent;)m=this.model.getParent(m);null!=m&&null!=m.parent&&m.parent==b.parent&&(d=m.parent.getIndex(m),this.model.add(m.parent,b,d))};-Graph.prototype.connectVertex=function(b,d,m,n,v,p,C,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),E=T?b:this.getCompositeParent(b),Q=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(E.geometry.x,E.geometry.y);d==mxConstants.DIRECTION_NORTH?(Q.x+=E.geometry.width/2,Q.y-=m):d==-mxConstants.DIRECTION_SOUTH?(Q.x+=E.geometry.width/2,Q.y+=E.geometry.height+m):(Q.x=d==mxConstants.DIRECTION_WEST?Q.x-m:Q.x+(E.geometry.width+m),Q.y+=E.geometry.height/2);var M=this.view.getState(this.model.getParent(b));m=this.view.scale;var c=this.view.translate;E=c.x*m;c=c.y*m;null!=M&&this.model.isVertex(M.cell)&&(E=M.x,c=M.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(Q.x+=b.parent.geometry.x,Q.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(E+Q.x*m,c+Q.y*m)).grow(40*m);p=null!=p?-this.getCells(0,0,0,0,null,null,p,null,!0):null;M=this.view.getState(b);var g=null,l=null;if(null!=p){p=p.reverse();for(var t=0;t<p.length;t++)if(!this.isCellLocked(p[t])&&!this.model.isEdge(p[t])&&p[t]!=b)if(!this.model.isAncestor(b,p[t])&&this.isContainer(p[t])&&(null==g||p[t]==this.model.getParent(b)))g=p[t];else if(null==l&&this.isCellConnectable(p[t])&&!this.model.isAncestor(p[t],b)&&!this.isSwimlane(p[t])){var B=this.view.getState(p[t]);null==M||null==B||mxUtils.intersects(M,B)||(l=p[t])}}var D=-!mxEvent.isShiftDown(n)||mxEvent.isControlDown(n)||v;D&&("1"!=urlParams.sketch||v)&&(d==mxConstants.DIRECTION_NORTH?Q.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?Q.y+=b.geometry.height/2:Q.x=d==mxConstants.DIRECTION_WEST?Q.x-b.geometry.width/2:Q.x+b.geometry.width/2);var I=[],L=l;l=g;v=mxUtils.bind(this,function(N){if(null==C||null!=N||null==l&&T){this.model.beginUpdate();try{if(null==L&&D){var K=this.getAbsoluteParent(null!=N?N:b);K=T?b:this.getCompositeParent(K);L=null!=N?N:this.duplicateCells([K],-!1)[0];null!=N&&this.addCells([L],this.model.getParent(b),null,null,null,!0);var da=this.getCellGeometry(L);null!=da&&(null!=N&&"1"==urlParams.sketch&&(d==mxConstants.DIRECTION_NORTH?Q.y-=da.height/2:d==mxConstants.DIRECTION_SOUTH?Q.y+=da.height/2:Q.x=d==mxConstants.DIRECTION_WEST?Q.x-da.width/2:Q.x+da.width/2),da.x=Q.x-da.width/2,da.y=Q.y-da.height/2);null!=g?(this.addCells([L],g,null,null,null,!0),l=null):D&&!T&&this.addCells([L],this.getDefaultParent(),null,null,null,!0)}var ja=mxEvent.isControlDown(n)&&-mxEvent.isShiftDown(n)&&D||null==l&&T?null:this.insertEdge(this.model.getParent(b),null,"",b,L,this.createCurrentEdgeStyle());null!=ja&&(I.push(ja),this.applyNewEdgeStyle(b,[ja],d),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ja,b));if(null==l&&null!=L&&null!=b.parent&&T&&d==mxConstants.DIRECTION_WEST){var ea=b.parent.getIndex(b);this.model.add(b.parent,L,ea)}null==l&&null!=L&&I.push(L);null==L&&null!=ja&&ja.geometry.setTerminalPoint(Q,!1);null!=ja&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[ja]))}finally{this.model.endUpdate()}}if(null!=G)G(I);else return I});if(null==C||null!=L||!D||null==l&&T)return v(L);C(E+Q.x*m,c+Q.y*m,v)};+Graph.prototype.connectVertex=function(b,d,m,n,v,p,C,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),E=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(E.geometry.x,E.geometry.y);d==mxConstants.DIRECTION_NORTH?(P.x+=E.geometry.width/2,P.y-=m):d==+mxConstants.DIRECTION_SOUTH?(P.x+=E.geometry.width/2,P.y+=E.geometry.height+m):(P.x=d==mxConstants.DIRECTION_WEST?P.x-m:P.x+(E.geometry.width+m),P.y+=E.geometry.height/2);var L=this.view.getState(this.model.getParent(b));m=this.view.scale;var c=this.view.translate;E=c.x*m;c=c.y*m;null!=L&&this.model.isVertex(L.cell)&&(E=L.x,c=L.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(E+P.x*m,c+P.y*m)).grow(40*m);p=null!=p?+this.getCells(0,0,0,0,null,null,p,null,!0):null;L=this.view.getState(b);var g=null,l=null;if(null!=p){p=p.reverse();for(var t=0;t<p.length;t++)if(!this.isCellLocked(p[t])&&!this.model.isEdge(p[t])&&p[t]!=b)if(!this.model.isAncestor(b,p[t])&&this.isContainer(p[t])&&(null==g||p[t]==this.model.getParent(b)))g=p[t];else if(null==l&&this.isCellConnectable(p[t])&&!this.model.isAncestor(p[t],b)&&!this.isSwimlane(p[t])){var B=this.view.getState(p[t]);null==L||null==B||mxUtils.intersects(L,B)||(l=p[t])}}var D=+!mxEvent.isShiftDown(n)||mxEvent.isControlDown(n)||v;D&&("1"!=urlParams.sketch||v)&&(d==mxConstants.DIRECTION_NORTH?P.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?P.y+=b.geometry.height/2:P.x=d==mxConstants.DIRECTION_WEST?P.x-b.geometry.width/2:P.x+b.geometry.width/2);var I=[],K=l;l=g;v=mxUtils.bind(this,function(M){if(null==C||null!=M||null==l&&T){this.model.beginUpdate();try{if(null==K&&D){var V=this.getAbsoluteParent(null!=M?M:b);V=T?b:this.getCompositeParent(V);K=null!=M?M:this.duplicateCells([V],+!1)[0];null!=M&&this.addCells([K],this.model.getParent(b),null,null,null,!0);var Q=this.getCellGeometry(K);null!=Q&&(null!=M&&"1"==urlParams.sketch&&(d==mxConstants.DIRECTION_NORTH?P.y-=Q.height/2:d==mxConstants.DIRECTION_SOUTH?P.y+=Q.height/2:P.x=d==mxConstants.DIRECTION_WEST?P.x-Q.width/2:P.x+Q.width/2),Q.x=P.x-Q.width/2,Q.y=P.y-Q.height/2);null!=g?(this.addCells([K],g,null,null,null,!0),l=null):D&&!T&&this.addCells([K],this.getDefaultParent(),null,null,null,!0)}var ja=mxEvent.isControlDown(n)&&+mxEvent.isShiftDown(n)&&D||null==l&&T?null:this.insertEdge(this.model.getParent(b),null,"",b,K,this.createCurrentEdgeStyle());null!=ja&&(I.push(ja),this.applyNewEdgeStyle(b,[ja],d),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ja,b));if(null==l&&null!=K&&null!=b.parent&&T&&d==mxConstants.DIRECTION_WEST){var ea=b.parent.getIndex(b);this.model.add(b.parent,K,ea)}null==l&&null!=K&&I.push(K);null==K&&null!=ja&&ja.geometry.setTerminalPoint(P,!1);null!=ja&&this.fireEvent(new mxEventObject("cellsInserted",+"cells",[ja]))}finally{this.model.endUpdate()}}if(null!=G)G(I);else return I});if(null==C||null!=K||!D||null==l&&T)return v(K);C(E+P.x*m,c+P.y*m,v)};Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var d=document.createElement("div"),m=[],n,v=0;v<b.length;v++)if(n=b[v],this.model.isVertex(n)||this.model.isEdge(n))this.isHtmlLabel(n)?(d.innerHTML=Graph.sanitizeHtml(this.getLabel(n)),n=mxUtils.extractTextWithWhitespace([d])):n=this.getLabel(n),n=mxUtils.trim(n.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<n.length&&m.push(n);return m.join(" ")};Graph.prototype.convertValueToString=function(b){var d=this.model.getValue(b);if(null!=d&&"object"==typeof d){var m=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){d=b.getAttribute("placeholder");for(var n=b;null==m&&null!=n;)null!=n.value&&"object"==typeof n.value&&(m=n.hasAttribute(d)?null!=n.getAttribute(d)?n.getAttribute(d):"":null),n=this.model.getParent(n)}else m=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(m=d.getAttribute("label_"+Graph.diagramLanguage)),null==m&&(m=d.getAttribute("label")||"");return m||""}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,d){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),d||(b=mxUtils.removeJavascriptProtocol(b)),b):null};@@ -2496,7 +2498,7 @@ Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?nGraph.prototype.updateAlternateBounds=function(b,d,m){if(null!=b&&null!=d&&null!=this.layoutManager&&null!=d.alternateBounds){var n=this.layoutManager.getLayout(this.model.getParent(b));null!=n&&n.constructor==mxStackLayout&&(n.horizontal?d.alternateBounds.height=0:d.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.moveCellsTo=function(b,d){if(null!=b&&null!=d){for(var m=!0,n=0;n<b.length&&m;n++)m=m&&this.model.isEdge(b[n]);n=null;if(1==b.length&&m){var v=this.getCellGeometry(b[0]);null!=v&&(n=v.getTerminalPoint(!0))}n=null!=n?n:this.getBoundingBoxFromGeometry(b,m);null!=n&&(m=Math.round(this.snap(d.x)),d=Math.round(this.snap(d.y)),this.cellsMoved(b,m-n.x,d-n.y))}};Graph.prototype.isMoveCellsEvent=function(b,d){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(d.style,"moveCells","0")};Graph.prototype.foldCells=function(b,d,m,n,v){d=null!=d?d:!1;null==m&&(m=this.getFoldableCells(this.getSelectionCells(),b));if(null!=m){this.model.beginUpdate();try{mxGraph.prototype.foldCells.apply(this,arguments);for(var p=0;p<m.length;p++){var C=this.view.getState(m[p]),G=this.getCellGeometry(m[p]);if(null!=C&&null!=G&&("1"!=mxUtils.getValue(C.style,"expandToFront","0")||this.isCellCollapsed(m[p])||this.orderCells(!1,[m[p]]),null!=this.layoutManager)){var T=0,E=0;if(G.alternateBounds)T=G.width--G.alternateBounds.width,E=G.height-G.alternateBounds.height;else{var Q=this.useCssTransforms?1:this.view.scale;T=Math.round(G.width-C.width/Q);E=Math.round(G.height-C.height/Q)}if(0!=E||0!=T){var M=this.model.getParent(m[p]),c=this.layoutManager.getLayout(M);null==c?null!=v&&this.isMoveCellsEvent(v,C)&&this.moveSiblings(C,M,T,E):null!=v&&mxEvent.isAltDown(v)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(M,c,T,E)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}};+G.alternateBounds.width,E=G.height-G.alternateBounds.height;else{var P=this.useCssTransforms?1:this.view.scale;T=Math.round(G.width-C.width/P);E=Math.round(G.height-C.height/P)}if(0!=E||0!=T){var L=this.model.getParent(m[p]),c=this.layoutManager.getLayout(L);null==c?null!=v&&this.isMoveCellsEvent(v,C)&&this.moveSiblings(C,L,T,E):null!=v&&mxEvent.isAltDown(v)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(L,c,T,E)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}};Graph.prototype.moveSiblings=function(b,d,m,n){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,d,!0,!0);for(d=0;d<v.length;d++)if(v[d]!=b.cell){var p=this.view.getState(v[d]),C=this.getCellGeometry(v[d]);null!=p&&null!=C&&(C=C.clone(),C.translate(Math.round(m*Math.max(0,Math.min(1,(p.x-b.x)/b.width))),Math.round(n*Math.max(0,Math.min(1,(p.y-b.y)/b.height)))),this.model.setGeometry(v[d],C))}}finally{this.model.endUpdate()}};Graph.prototype.resizeParentStacks=function(b,d,m,n){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var v=d.horizontal;null!=b&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==v&&!d.resizeLast;){var p=this.getCellGeometry(b),C=this.view.getState(b);null!=C&&null!=p&&(p=p.clone(),d.horizontal?p.width+=m+Math.min(0,C.width/this.view.scale-p.width):p.height+=n+Math.min(0,C.height/this.view.scale-p.height),this.model.setGeometry(b,p));b=this.model.getParent(b);d=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var d=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=d.container:"1"==d.container};Graph.prototype.isCellConnectable=function(b){var d=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=d.connectable?"0"!=d.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};@@ -2538,7 +2540,7 @@ HoverIcons.prototype.click=function(b,d,m){var n=m.getEvent(),v=m.getGraphX(),p=HoverIcons.prototype.execute=function(b,d,m){m=m.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,d,this.graph.defaultEdgeLength,m,this.graph.isCloneEvent(m),this.graph.isCloneEvent(m)),m,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 d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(d=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var m=null;null!=d&&(b.x-=d.horizontalOffset/2,b.y-=d.verticalOffset/2,b.width+=d.horizontalOffset,b.height+=d.verticalOffset,null!=d.rotationShape&&null!=d.rotationShape.node&&"hidden"!=d.rotationShape.node.style.visibility&&"none"!=d.rotationShape.node.style.display&&null!=d.rotationShape.boundingBox&&-(m=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(G,T,E){if(null!=m){var Q=new mxRectangle(T,E,G.clientWidth,G.clientHeight);mxUtils.intersects(Q,m)&&(G==this.arrowUp?E-=Q.y+Q.height-m.y:G==this.arrowRight?T+=m.x+m.width-Q.x:G==this.arrowDown?E+=m.y+m.height-Q.y:G==this.arrowLeft&&(T-=Q.x+Q.width-m.x))}G.style.left=T+"px";G.style.top=E+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-+(m=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(G,T,E){if(null!=m){var P=new mxRectangle(T,E,G.clientWidth,G.clientHeight);mxUtils.intersects(P,m)&&(G==this.arrowUp?E-=P.y+P.height-m.y:G==this.arrowRight?T+=m.x+m.width-P.x:G==this.arrowDown?E+=m.y+m.height-P.y:G==this.arrowLeft&&(T-=P.x+P.width-m.x))}G.style.left=T+"px";G.style.top=E+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-this.triangleUp.height-this.tolerance));d(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));d(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));d(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){d=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());var n=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!=d&&d==n&&n==v&&v==b&&(b=v=n=d=null);var p=this.graph.getCellGeometry(this.currentState.cell),C=mxUtils.bind(this,function(G,T){var E=this.graph.model.isVertex(G)&&this.graph.getCellGeometry(G);null==G||this.graph.model.isAncestor(G,this.currentState.cell)||this.graph.isSwimlane(G)||!(null==E||null==p||E.height<3*p.height&&E.width<3*p.width)?T.style.visibility="visible":T.style.visibility="hidden"});C(d,this.arrowRight);C(n,this.arrowLeft);C(v,this.arrowUp);C(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")),@@ -2560,8 +2562,10 @@ InlineToolbar.prototype.getEdgeMidpoint=function(b){b=b.absolutePoints;if(null==2,(n.y+b.y)/2):null};InlineToolbar.prototype.show=function(){this.updateIcons();this.toolbar.style.display="block";this.repaint()};InlineToolbar.prototype.hide=function(){this.toolbar.style.display="none"};InlineToolbar.prototype.supportsCurvedBend=function(b){b=mxUtils.getValue(b,mxConstants.STYLE_SHAPE,null);return null==b||"connector"==b||"filledEdge"==b||"wire"==b||"pipe"==b};InlineToolbar.prototype.updateIcons=function(){if(null!=this.currentState){var b=this.graph.getCurrentCellStyle(this.currentState.cell),d=this.editorUi.getImageForEdgeStyle(b);"arrow"==b[mxConstants.STYLE_SHAPE]&&(d=Format.straightImage.src);this.icon.style.backgroundImage="url("+d+")";d=this.graph.view.getState(this.currentState.cell);d=this.supportsCurvedBend(b)||null!=d&&this.graph.isRoundedState(d);this.bendSep.style.display=d?"inline-block":"none";this.bendIcon.style.display=d?"inline-block":"none";d&&("1"==mxUtils.getValue(b,mxConstants.STYLE_CURVED,null)?this.bendIcon.style.backgroundImage="url("+Format.curvedBendImage.src+")":"1"==mxUtils.getValue(b,mxConstants.STYLE_ROUNDED,null)?this.bendIcon.style.backgroundImage="url("+Format.roundedBendImage.src+")":this.bendIcon.style.backgroundImage="url("+Format.sharpBendImage.src+")")}};-InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var b=this.graph.view.getState(this.currentState.cell);if(null!=b){this.currentState=b;this.updateIcons();var d=this.getEdgeMidpoint(b);if(null!=d){var m="none"!=this.bendIcon.style.display?2*this.iconSize+1:this.iconSize,n=this.iconSize,v=d.x-m/2,p=d.y-n-this.offset;b=this.graph.selectionCellsHandler.getHandler(b.cell);if(null!=b){var C=(b.bends||[]).concat(b.virtualBends||[]);b=mxUtils.bind(this,-function(T,E){T=new mxRectangle(Math.round(T)-8,Math.round(E)-8,m+16,n+16);for(E=0;E<C.length;E++)if(null!=C[E]&&null!=C[E].bounds&&"hidden"!==C[E].node.style.visibility&&mxUtils.intersects(T,C[E].bounds))return!0;return!1});if(b(v,p)){var G=d.y+this.offset;if(b(v,G))for(G=this.offset+8;100>G;G+=8)if(!b(v,d.y-n-G)){p=d.y-n-G;break}else{if(!b(v,d.y+G)){p=d.y+G;break}}else p=G}}this.toolbar.style.left=Math.round(v)+"px";this.toolbar.style.top=Math.round(p)+"px"}}}};+InlineToolbar.prototype.segmentIntersectsRect=function(b,d,m,n,v,p,C,G){m-=b;n-=d;n=[-m,m,-n,n];b=[b-v,v+C-b,d-p,p+G-d];d=0;v=1;for(p=0;4>p;p++)if(0==n[p]){if(0>b[p])return!1}else if(C=b[p]/n[p],0>n[p]?d=Math.max(d,C):v=Math.min(v,C),d>v)return!1;return!0};+InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var b=this.graph.view.getState(this.currentState.cell);if(null!=b){this.currentState=b;this.updateIcons();var d=this.getEdgeMidpoint(b);if(null!=d){var m="none"!=this.bendIcon.style.display?2*this.iconSize+1:this.iconSize,n=this.iconSize,v=d.x-m/2,p=d.y-n-this.offset,C=this.graph.selectionCellsHandler.getHandler(b.cell);if(null!=C){var G=(C.bends||[]).concat(C.virtualBends||[]);C=mxUtils.bind(this,+function(c,g){c=new mxRectangle(Math.round(c)-8,Math.round(g)-8,m+16,n+16);for(g=0;g<G.length;g++)if(null!=G[g]&&null!=G[g].bounds&&"hidden"!==G[g].node.style.visibility&&mxUtils.intersects(c,G[g].bounds))return!0;var l=b.absolutePoints;if(null!=l)for(g=1;g<l.length;g++)if(null!=l[g]&&null!=l[g-1]&&this.segmentIntersectsRect(l[g-1].x,l[g-1].y,l[g].x,l[g].y,c.x,c.y,c.width,c.height))return!0;return!1});if(C(v,p)){var T=d.y+this.offset,E=!1;C(v,T)||(p=T,E=!0);if(!E){T=d.y-n/2;var P=d.x-m-this.offset,+L=d.x+this.offset;C(P,T)?C(L,T)||(v=L,p=T,E=!0):(v=P,p=T,E=!0)}if(!E)for(T=d.y-n/2,E=this.offset+8;100>E;E+=8)if(!C(v,d.y-n-E)){p=d.y-n-E;break}else if(!C(v,d.y+E)){p=d.y+E;break}else if(!C(d.x-m-E,T)){v=d.x-m-E;p=T;break}else if(!C(d.x+E,T)){v=d.x+E;p=T;break}}}this.toolbar.style.left=Math.round(v)+"px";this.toolbar.style.top=Math.round(p)+"px"}}}};InlineToolbar.prototype.showMenu=function(b){var d=this.editorUi;d.hideCurrentMenu();d.showPopupMenu(mxUtils.bind(this,function(m,n){d.menus.addMenu("line",m,n)}),mxEvent.getClientX(b),mxEvent.getClientY(b),b)};InlineToolbar.prototype.showBendMenu=function(b){var d=this.editorUi;d.hideCurrentMenu();d.showPopupMenu(mxUtils.bind(this,function(m,n){var v=d.menus,p=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED];Format.processMenuIcon(v.edgeStyleChange(m,"",p,["0","0"],null,n,!1,Format.sharpBendImage.src)).setAttribute("title",mxResources.get("sharp"));Format.processMenuIcon(v.edgeStyleChange(m,"",p,["1","0"],null,n,!1,Format.roundedBendImage.src)).setAttribute("title",mxResources.get("rounded"));if(null!=this.currentState){var C=this.graph.getCurrentCellStyle(this.currentState.cell);this.supportsCurvedBend(C)&&Format.processMenuIcon(v.edgeStyleChange(m,"",p,["0","1"],null,n,!1,Format.curvedBendImage.src)).setAttribute("title",mxResources.get("curved"))}}),mxEvent.getClientX(b),mxEvent.getClientY(b),b)};@@ -2574,41 +2578,41 @@ Graph.prototype.setTableValues=function(b,d,m){for(var n=this.model.getChildCellGraph.prototype.createCrossFunctionalSwimlane=function(b,d,m,n,v,p,C,G,T){m=null!=m?m:120;n=null!=n?n:120;C=null!=C?C:"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,d*m,b*n,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;C=this.createVertex(null,null,"",0,p,d*m+p,n,C);v.insert(this.createParent(C,this.createVertex(null,null,"",p,0,m,n,G),d,m,0));return 1<b?(C.geometry.y=n+p,this.createParent(v,this.createParent(C,this.createVertex(null,null,"",p,0,m,n,T),d,m,0),b-1,0,n)):v};-Graph.prototype.visitTableCells=function(b,d){var m=null,n=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<n.length;v++){for(var p=this.getActualStartSize(n[v],!0),C=this.model.getChildCells(n[v],!0),G=this.getCellStyle(n[v],!0),T=null,E=[],Q=0;Q<C.length;Q++){var M=this.getCellGeometry(C[Q]),c={cell:C[Q],rospan:1,colspan:1,row:v,col:Q,geo:M};M=null!=M.alternateBounds?M.alternateBounds:M;c.point=new mxPoint(M.width+(null!=T?T.point.x:b.x+p.x),M.height+(null!=m&&null!=-m[0]?m[0].point.y:b.y+p.y));c.actual=c;null!=m&&null!=m[Q]&&1<m[Q].rowspan?(c.rowspan=m[Q].rowspan-1,c.colspan=m[Q].colspan,c.actual=m[Q].actual):null!=T&&1<T.colspan?(c.rowspan=T.rowspan,c.colspan=T.colspan-1,c.actual=T.actual):(T=this.getCurrentCellStyle(C[Q],!0),null!=T&&(c.rowspan=parseInt(T.rowspan||1),c.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;d(c,C.length,+Graph.prototype.visitTableCells=function(b,d){var m=null,n=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<n.length;v++){for(var p=this.getActualStartSize(n[v],!0),C=this.model.getChildCells(n[v],!0),G=this.getCellStyle(n[v],!0),T=null,E=[],P=0;P<C.length;P++){var L=this.getCellGeometry(C[P]),c={cell:C[P],rospan:1,colspan:1,row:v,col:P,geo:L};L=null!=L.alternateBounds?L.alternateBounds:L;c.point=new mxPoint(L.width+(null!=T?T.point.x:b.x+p.x),L.height+(null!=m&&null!=+m[0]?m[0].point.y:b.y+p.y));c.actual=c;null!=m&&null!=m[P]&&1<m[P].rowspan?(c.rowspan=m[P].rowspan-1,c.colspan=m[P].colspan,c.actual=m[P].actual):null!=T&&1<T.colspan?(c.rowspan=T.rowspan,c.colspan=T.colspan-1,c.actual=T.actual):(T=this.getCurrentCellStyle(C[P],!0),null!=T&&(c.rowspan=parseInt(T.rowspan||1),c.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;d(c,C.length,n.length,b.x+(T?p.x:0),b.y+(T?p.y:0));E.push(c);T=c}m=E}};Graph.prototype.getTableLines=function(b,d,m){var n=[],v=[];(d||m)&&this.visitTableCells(b,mxUtils.bind(this,function(p,C,G,T,E){d&&p.row<G-1&&(null==n[p.row]&&(n[p.row]=[new mxPoint(T,p.point.y)]),1<p.rowspan&&n[p.row].push(null),n[p.row].push(p.point));m&&p.col<C-1&&(null==v[p.col]&&(v[p.col]=[new mxPoint(p.point.x,E)]),1<p.colspan&&v[p.col].push(null),v[p.col].push(p.point))}));return n.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,d,m){m=null!=m?m:!0;var n=this.getModel();n.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=d;n.setGeometry(b,v);var p=n.getParent(b),C=n.getChildCells(p,!0);if(!m){var G=mxUtils.indexOf(C,b);if(G<C.length-1){var T=C[G+1],E=this.getCellGeometry(T);null!=E&&(E=E.clone(),E.y+=d,E.height-=d,n.setGeometry(T,E))}}var Q=this.getCellGeometry(p);null!=Q&&(m||(m=b==C[C.length-1]),m&&(Q=Q.clone(),Q.height+=d,n.setGeometry(p,Q)))}}finally{n.endUpdate()}};-Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var n=this.getModel(),v=n.getParent(b),p=n.getParent(v),C=n.getChildCells(v,!0);b=mxUtils.indexOf(C,b);var G=b==C.length-1;n.beginUpdate();try{for(var T=n.getChildCells(p,!0),E=0;E<T.length;E++){v=T[E];C=n.getChildCells(v,!0);var Q=C[b],M=this.getCellGeometry(Q);null!=M&&(M=M.clone(),M.width+=d,null!=M.alternateBounds&&(M.alternateBounds.width+=d),n.setGeometry(Q,M));b<C.length-1&&(Q=C[b+1],M=this.getCellGeometry(Q),null!=M&&(M=M.clone(),-M.x+=d,m||(M.width-=d,null!=M.alternateBounds&&(M.alternateBounds.width-=d)),n.setGeometry(Q,M)))}if(G||m){var c=this.getCellGeometry(p);null!=c&&(c=c.clone(),c.width+=d,n.setGeometry(p,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{n.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,d,m){m=null!=m?m:!0;var n=this.getModel();n.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=d;n.setGeometry(b,v);var p=n.getParent(b),C=n.getChildCells(p,!0);if(!m){var G=mxUtils.indexOf(C,b);if(G<C.length-1){var T=C[G+1],E=this.getCellGeometry(T);null!=E&&(E=E.clone(),E.y+=d,E.height-=d,n.setGeometry(T,E))}}var P=this.getCellGeometry(p);null!=P&&(m||(m=b==C[C.length-1]),m&&(P=P.clone(),P.height+=d,n.setGeometry(p,P)))}}finally{n.endUpdate()}};+Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var n=this.getModel(),v=n.getParent(b),p=n.getParent(v),C=n.getChildCells(v,!0);b=mxUtils.indexOf(C,b);var G=b==C.length-1;n.beginUpdate();try{for(var T=n.getChildCells(p,!0),E=0;E<T.length;E++){v=T[E];C=n.getChildCells(v,!0);var P=C[b],L=this.getCellGeometry(P);null!=L&&(L=L.clone(),L.width+=d,null!=L.alternateBounds&&(L.alternateBounds.width+=d),n.setGeometry(P,L));b<C.length-1&&(P=C[b+1],L=this.getCellGeometry(P),null!=L&&(L=L.clone(),+L.x+=d,m||(L.width-=d,null!=L.alternateBounds&&(L.alternateBounds.width-=d)),n.setGeometry(P,L)))}if(G||m){var c=this.getCellGeometry(p);null!=c&&(c=c.clone(),c.width+=d,n.setGeometry(p,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{n.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,d){for(var m=0,n=0;n<b.length;n++)if(!this.isVertexIgnored(b[n])){var v=this.graph.getCellGeometry(b[n]);null!=v&&(m+=d?v.width:v.height)}return m};TableLayout.prototype.getRowLayout=function(b,d){var m=this.graph.model.getChildCells(b,!0),n=this.graph.getActualStartSize(b,!0);b=this.getSize(m,!0);d=d-n.x-n.width;var v=[];n=n.x;for(var p=0;p<m.length;p++){var C=this.graph.getCellGeometry(m[p]);null!=C&&(n+=(null!=C.alternateBounds?C.alternateBounds.width:C.width)*d/b,v.push(Math.round(n)))}return v};TableLayout.prototype.layoutRow=function(b,d,m,n){var v=this.graph.getModel(),p=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var C=b.x,G=0;null!=d&&(d=d.slice(),d.splice(0,0,b.x));for(var T=0;T<p.length;T++){var E=this.graph.getCellGeometry(p[T]);null!=E&&(E=E.clone(),E.y=b.y,E.height=m-b.y-b.height,null!=d?(E.x=d[T],E.width=d[T+1]-E.x,T==p.length-1&&T<d.length-2&&(E.width=n-E.x-b.x-b.width)):(E.x=C,C+=E.width,T==p.length-1?E.width=n-b.x-b.width-G:G+=E.width),E.alternateBounds=new mxRectangle(0,0,E.width,E.height),v.setGeometry(p[T],E))}return G};-TableLayout.prototype.execute=function(b){if(null!=b){var d=this.graph.getActualStartSize(b,!0),m=this.graph.getCellGeometry(b),n=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(n,"resizeLastRow","0"),p="1"==mxUtils.getValue(n,"resizeLast","0");n="1"==mxUtils.getValue(n,"fixedRows","0");var C=this.graph.getModel(),G=0;C.beginUpdate();try{for(var T=m.height-d.y-d.height,E=m.width-d.x-d.width,Q=C.getChildCells(b,!0),M=0;M<Q.length;M++)C.setVisible(Q[M],!0);var c=this.getSize(Q,!1);if(0<T&&0<E&&0<-Q.length&&0<c){if(v){var g=this.graph.getCellGeometry(Q[Q.length-1]);null!=g&&(g=g.clone(),g.height=T-c+g.height,C.setGeometry(Q[Q.length-1],g))}var l=p?null:this.getRowLayout(Q[0],E),t=[],B=d.y;for(M=0;M<Q.length;M++)g=this.graph.getCellGeometry(Q[M]),null!=g&&(g=g.clone(),g.x=d.x,g.width=E,g.y=Math.round(B),B=v||n?B+g.height:B+g.height/c*T,g.height=Math.round(B)-g.y,C.setGeometry(Q[M],g)),G=Math.max(G,this.layoutRow(Q[M],l,g.height,E,t));n&&T<c&&(m=m.clone(),m.height=B+d.height,C.setGeometry(b,-m));p&&E<G+Graph.minTableColumnWidth&&(m=m.clone(),m.width=G+d.width+d.x+Graph.minTableColumnWidth,C.setGeometry(b,m));this.graph.visitTableCells(b,mxUtils.bind(this,function(D){C.setVisible(D.cell,D.actual.cell==D.cell);if(D.actual.cell!=D.cell){if(D.actual.row==D.row){var I=null!=D.geo.alternateBounds?D.geo.alternateBounds:D.geo;D.actual.geo.width+=I.width}D.actual.col==D.col&&(I=null!=D.geo.alternateBounds?D.geo.alternateBounds:D.geo,D.actual.geo.height+=I.height)}}))}else for(M=0;M<Q.length;M++)C.setVisible(Q[M],+TableLayout.prototype.execute=function(b){if(null!=b){var d=this.graph.getActualStartSize(b,!0),m=this.graph.getCellGeometry(b),n=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(n,"resizeLastRow","0"),p="1"==mxUtils.getValue(n,"resizeLast","0");n="1"==mxUtils.getValue(n,"fixedRows","0");var C=this.graph.getModel(),G=0;C.beginUpdate();try{for(var T=m.height-d.y-d.height,E=m.width-d.x-d.width,P=C.getChildCells(b,!0),L=0;L<P.length;L++)C.setVisible(P[L],!0);var c=this.getSize(P,!1);if(0<T&&0<E&&0<+P.length&&0<c){if(v){var g=this.graph.getCellGeometry(P[P.length-1]);null!=g&&(g=g.clone(),g.height=T-c+g.height,C.setGeometry(P[P.length-1],g))}var l=p?null:this.getRowLayout(P[0],E),t=[],B=d.y;for(L=0;L<P.length;L++)g=this.graph.getCellGeometry(P[L]),null!=g&&(g=g.clone(),g.x=d.x,g.width=E,g.y=Math.round(B),B=v||n?B+g.height:B+g.height/c*T,g.height=Math.round(B)-g.y,C.setGeometry(P[L],g)),G=Math.max(G,this.layoutRow(P[L],l,g.height,E,t));n&&T<c&&(m=m.clone(),m.height=B+d.height,C.setGeometry(b,+m));p&&E<G+Graph.minTableColumnWidth&&(m=m.clone(),m.width=G+d.width+d.x+Graph.minTableColumnWidth,C.setGeometry(b,m));this.graph.visitTableCells(b,mxUtils.bind(this,function(D){C.setVisible(D.cell,D.actual.cell==D.cell);if(D.actual.cell!=D.cell){if(D.actual.row==D.row){var I=null!=D.geo.alternateBounds?D.geo.alternateBounds:D.geo;D.actual.geo.width+=I.width}D.actual.col==D.col&&(I=null!=D.geo.alternateBounds?D.geo.alternateBounds:D.geo,D.actual.geo.height+=I.height)}}))}else for(L=0;L<P.length;L++)C.setVisible(P[L],!1)}finally{C.endUpdate()}}};-(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(M,c){c=null!=c?c:!0;var g=this.getState(M);null!=g&&c&&this.graph.model.isEdge(g.cell)&&null!=g.style&&1!=g.style[mxConstants.STYLE_CURVED]&&!g.invalid&&this.updateLineJumps(g)&&this.graph.cellRenderer.redraw(g,!1,this.isRendering());if(null!=g&&g.invalid){if(this.graph.showLinkIcons){g=-this.graph.getLinkForCell(M);var l=null!=g&&0<g.length,t=!1;if(null!=M.overlays)for(g=0;g<M.overlays.length;g++)if(M.overlays[g].isLinkOverlay){t=!0;break}if(l&&!t)g=this.graph.createLinkOverlay(M),null!=g&&(null==M.overlays&&(M.overlays=[]),M.overlays.push(g));else if(!l&&t){for(g=M.overlays.length-1;0<=g;g--)M.overlays[g].isLinkOverlay&&M.overlays.splice(g,1);0==M.overlays.length&&(M.overlays=null)}}else if(null!=M.overlays){for(g=M.overlays.length-1;0<=g;g--)M.overlays[g].isLinkOverlay&&M.overlays.splice(g,-1);0==M.overlays.length&&(M.overlays=null)}if(this.graph.showTooltipIcons){g=this.graph.convertValueToTooltip(M);l=null!=g&&0<g.length;t=!1;if(null!=M.overlays)for(g=0;g<M.overlays.length;g++)if(M.overlays[g].isTooltipOverlay){t=!0;break}if(l&&!t)g=this.graph.createTooltipOverlay(M),null!=g&&(null==M.overlays&&(M.overlays=[]),M.overlays.push(g));else if(!l&&t){for(g=M.overlays.length-1;0<=g;g--)M.overlays[g].isTooltipOverlay&&M.overlays.splice(g,1);0==M.overlays.length&&(M.overlays=null)}}else if(null!=-M.overlays){for(g=M.overlays.length-1;0<=g;g--)M.overlays[g].isTooltipOverlay&&M.overlays.splice(g,1);0==M.overlays.length&&(M.overlays=null)}}g=d.apply(this,arguments);null!=g&&c&&this.graph.model.isEdge(g.cell)&&null!=g.style&&1!=g.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(g);return g};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(M){var c=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=c)for(var g=null,l=0;l<c.length;l++)if("hidden"!=c[l].getAttribute("visibility")){if(!(null!=g&&g!=c[l].getAttribute("d")||null!=M&&0!=--M))return c[l]}else null==g&&(g=c[l].getAttribute("d"));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 m=mxShape.prototype.paint;mxShape.prototype.paint=function(M){m.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var n=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(M){M=n.apply(this,arguments);null!=this.state&&(M.adaptiveColors=this.state.view.graph.getAdaptiveColors());return M};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=-function(M,c){return v.apply(this,arguments)||null!=M.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.routedPoints,M.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(M){p.apply(this,arguments);this.graph.model.isEdge(M.cell)&&1!=M.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(M)};mxGraphView.prototype.updateLineJumps=function(M){var c=M.absolutePoints;if(Graph.lineJumpsEnabled){var g=null!=M.routedPoints,l=null;if(null!=c&&-null!=this.validEdges&&"none"!==mxUtils.getValue(M.style,"jumpStyle","none")){var t=function(V,k,x){var J=new mxPoint(k,x);J.type=V;l.push(J);J=null!=M.routedPoints?M.routedPoints[l.length-1]:null;return null==J||J.type!=V||J.x!=k||J.y!=x},B=.5*this.scale;g=!1;l=[];for(var D=0;D<c.length-1;D++){for(var I=c[D+1],L=c[D],N=[],K=c[D+2];D<c.length-2&&mxUtils.ptSegDistSq(L.x,L.y,K.x,K.y,I.x,I.y)<1*this.scale*this.scale;)I=K,D++,K=c[D+2];g=t(0,L.x,L.y)||g;for(var da=0;da<this.validEdges.length;da++){var ja=-this.validEdges[da],ea=ja.absolutePoints;if(null!=ea&&mxUtils.intersects(M,ja)&&"1"!=ja.style.noJump){var ca=null;for(ja=0;ja<ea.length-1;ja++){var fa=ea[ja+1],la=ea[ja];for(K=ea[ja+2];ja<ea.length-2&&mxUtils.ptSegDistSq(la.x,la.y,K.x,K.y,fa.x,fa.y)<1*this.scale*this.scale;)fa=K,ja++,K=ea[ja+2];var ka=mxUtils.intersection(L.x,L.y,I.x,I.y,la.x,la.y,fa.x,fa.y);if(null!=ka&&(Math.abs(ka.x-L.x)>B||Math.abs(ka.y-L.y)>B)&&(Math.abs(ka.x-I.x)>B||Math.abs(ka.y-I.y)>B)&&(null==ca||mxUtils.ptLineDist(L.x,L.y,-I.x,I.y,ca.x,ca.y)>B||mxUtils.ptLineDist(L.x,L.y,I.x,I.y,la.x,la.y)>B)&&(null==K||mxUtils.ptLineDist(L.x,L.y,I.x,I.y,K.x,K.y)>B||mxUtils.ptLineDist(L.x,L.y,I.x,I.y,fa.x,fa.y)>B)){K=ka.x-L.x;ca=ka.y-L.y;ka={distSq:K*K+ca*ca,x:ka.x,y:ka.y};for(K=0;K<N.length;K++)if(N[K].distSq>ka.distSq){N.splice(K,0,ka);ka=null;break}null==ka||0!=N.length&&N[N.length-1].x===ka.x&&N[N.length-1].y===ka.y||N.push(ka)}ca=la}}}for(ja=0;ja<N.length;ja++)g=t(1,N[ja].x,N[ja].y)||g}ka=c[c.length-1];g=t(0,ka.x,ka.y)||g}M.routedPoints=-l;return g}return!1};var C=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(M,c,g){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)C.apply(this,arguments);else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,t=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,-B=mxUtils.getValue(this.style,"jumpStyle","none"),D=!0,I=null,L=null,N=[],K=null;M.begin();for(var da=0;da<this.state.routedPoints.length;da++){var ja=this.state.routedPoints[da],ea=new mxPoint(ja.x/this.scale,ja.y/this.scale);0==da?ea=c[0]:da==this.state.routedPoints.length-1&&(ea=c[c.length-1]);var ca=!1;if(null!=I&&1==ja.type){var fa=this.state.routedPoints[da+1];ja=fa.x/this.scale-ea.x;fa=fa.y/this.scale-ea.y;ja=ja*ja+fa*fa;null==K&&(K=new mxPoint(ea.x-I.x,ea.y-I.y),L=Math.sqrt(K.x*K.x+K.y*K.y),-0<L?(K.x=K.x*t/L,K.y=K.y*t/L):K=null);ja>t*t&&0<L&&(ja=I.x-ea.x,fa=I.y-ea.y,ja=ja*ja+fa*fa,ja>t*t&&(ca=new mxPoint(ea.x-K.x,ea.y-K.y),ja=new mxPoint(ea.x+K.x,ea.y+K.y),N.push(ca),this.addPoints(M,N,g,l,!1,null,D),N=0>Math.round(K.x)||0==Math.round(K.x)&&0>=Math.round(K.y)?1:-1,D=!1,"sharp"==B?(M.lineTo(ca.x-K.y*N,ca.y+K.x*N),M.lineTo(ja.x-K.y*N,ja.y+K.x*N),M.lineTo(ja.x,ja.y)):"line"==B?(M.moveTo(ca.x+K.y*N,ca.y-K.x*N),M.lineTo(ca.x-K.y*N,ca.y+K.x*N),M.moveTo(ja.x-K.y*N,ja.y+K.x*N),M.lineTo(ja.x+-K.y*N,ja.y-K.x*N),M.moveTo(ja.x,ja.y)):"arc"==B?(N*=1.3,M.curveTo(ca.x-K.y*N,ca.y+K.x*N,ja.x-K.y*N,ja.y+K.x*N,ja.x,ja.y)):(M.moveTo(ja.x,ja.y),D=!0),N=[ja],ca=!0))}else K=null;ca||(N.push(ea),I=ea)}this.addPoints(M,N,g,l,!1,null,D);M.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(M,c,g,l){return null!=c&&"centerPerimeter"==c.style[mxConstants.STYLE_PERIMETER]?new mxPoint(c.getCenterX(),c.getCenterY()):G.apply(this,arguments)};var T=-mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(M,c,g,l){if(null==c||null==M||"1"!=c.style.snapToPoint&&"1"!=M.style.snapToPoint)T.apply(this,arguments);else{c=this.getTerminalPort(M,c,l);var t=this.getNextPoint(M,g,l),B=this.graph.isOrthogonal(M),D=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),I=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=D){var L=Math.cos(-D),N=Math.sin(-D);t=mxUtils.getRotatedPoint(t,L,N,I)}L=-parseFloat(M.style[mxConstants.STYLE_PERIMETER_SPACING]||0);L+=parseFloat(M.style[l?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);t=this.getPerimeterPoint(c,t,0==D&&B,L);0!=D&&(L=Math.cos(D),N=Math.sin(D),t=mxUtils.getRotatedPoint(t,L,N,I));M.setAbsoluteTerminalPoint(this.snapToAnchorPoint(M,c,g,l,t),l)}};mxGraphView.prototype.snapToAnchorPoint=function(M,c,g,l,t){if(null!=c&&null!=M){M=this.graph.getAllConnectionConstraints(c);l=g=null;if(null!=M)for(var B=-0;B<M.length;B++){var D=this.graph.getConnectionPoint(c,M[B]);if(null!=D){var I=(D.x-t.x)*(D.x-t.x)+(D.y-t.y)*(D.y-t.y);if(null==l||I<l)g=D,l=I}}null!=g&&(t=g)}return t};var E=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(M,c,g){var l=E.apply(this,arguments);"1"==M.getAttribute("placeholders")&&null!=g.state&&(l=g.state.view.graph.replacePlaceholders(g.state.cell,l));return l};var Q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=-function(M){if(null!=M.style&&"undefined"!==typeof pako){var c=mxUtils.getValue(M.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"string"===typeof c&&"stencil("==c.substring(0,8))try{var g=c.substring(8,c.length-1),l=mxUtils.parseXml(Graph.decompress(g));return new mxShape(new mxStencil(l.documentElement))}catch(t){null!=window.console&&console.log("Error in shape: "+t)}}return Q.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};+(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(L,c){c=null!=c?c:!0;var g=this.getState(L);null!=g&&c&&this.graph.model.isEdge(g.cell)&&null!=g.style&&1!=g.style[mxConstants.STYLE_CURVED]&&!g.invalid&&this.updateLineJumps(g)&&this.graph.cellRenderer.redraw(g,!1,this.isRendering());if(null!=g&&g.invalid){if(this.graph.showLinkIcons){g=+this.graph.getLinkForCell(L);var l=null!=g&&0<g.length,t=!1;if(null!=L.overlays)for(g=0;g<L.overlays.length;g++)if(L.overlays[g].isLinkOverlay){t=!0;break}if(l&&!t)g=this.graph.createLinkOverlay(L),null!=g&&(null==L.overlays&&(L.overlays=[]),L.overlays.push(g));else if(!l&&t){for(g=L.overlays.length-1;0<=g;g--)L.overlays[g].isLinkOverlay&&L.overlays.splice(g,1);0==L.overlays.length&&(L.overlays=null)}}else if(null!=L.overlays){for(g=L.overlays.length-1;0<=g;g--)L.overlays[g].isLinkOverlay&&L.overlays.splice(g,+1);0==L.overlays.length&&(L.overlays=null)}if(this.graph.showTooltipIcons){g=this.graph.convertValueToTooltip(L);l=null!=g&&0<g.length;t=!1;if(null!=L.overlays)for(g=0;g<L.overlays.length;g++)if(L.overlays[g].isTooltipOverlay){t=!0;break}if(l&&!t)g=this.graph.createTooltipOverlay(L),null!=g&&(null==L.overlays&&(L.overlays=[]),L.overlays.push(g));else if(!l&&t){for(g=L.overlays.length-1;0<=g;g--)L.overlays[g].isTooltipOverlay&&L.overlays.splice(g,1);0==L.overlays.length&&(L.overlays=null)}}else if(null!=+L.overlays){for(g=L.overlays.length-1;0<=g;g--)L.overlays[g].isTooltipOverlay&&L.overlays.splice(g,1);0==L.overlays.length&&(L.overlays=null)}}g=d.apply(this,arguments);null!=g&&c&&this.graph.model.isEdge(g.cell)&&null!=g.style&&1!=g.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(g);return g};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(L){var c=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=c)for(var g=null,l=0;l<c.length;l++)if("hidden"!=c[l].getAttribute("visibility")){if(!(null!=g&&g!=c[l].getAttribute("d")||null!=L&&0!=--L))return c[l]}else null==g&&(g=c[l].getAttribute("d"));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 m=mxShape.prototype.paint;mxShape.prototype.paint=function(L){m.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var n=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(L){L=n.apply(this,arguments);null!=this.state&&(L.adaptiveColors=this.state.view.graph.getAdaptiveColors());return L};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=+function(L,c){return v.apply(this,arguments)||null!=L.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.routedPoints,L.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(L){p.apply(this,arguments);this.graph.model.isEdge(L.cell)&&1!=L.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(L)};mxGraphView.prototype.updateLineJumps=function(L){var c=L.absolutePoints;if(Graph.lineJumpsEnabled){var g=null!=L.routedPoints,l=null;if(null!=c&&+null!=this.validEdges&&"none"!==mxUtils.getValue(L.style,"jumpStyle","none")){var t=function(W,k,y){var J=new mxPoint(k,y);J.type=W;l.push(J);J=null!=L.routedPoints?L.routedPoints[l.length-1]:null;return null==J||J.type!=W||J.x!=k||J.y!=y},B=.5*this.scale;g=!1;l=[];for(var D=0;D<c.length-1;D++){for(var I=c[D+1],K=c[D],M=[],V=c[D+2];D<c.length-2&&mxUtils.ptSegDistSq(K.x,K.y,V.x,V.y,I.x,I.y)<1*this.scale*this.scale;)I=V,D++,V=c[D+2];g=t(0,K.x,K.y)||g;for(var Q=0;Q<this.validEdges.length;Q++){var ja=+this.validEdges[Q],ea=ja.absolutePoints;if(null!=ea&&mxUtils.intersects(L,ja)&&"1"!=ja.style.noJump){var da=null;for(ja=0;ja<ea.length-1;ja++){var ia=ea[ja+1],la=ea[ja];for(V=ea[ja+2];ja<ea.length-2&&mxUtils.ptSegDistSq(la.x,la.y,V.x,V.y,ia.x,ia.y)<1*this.scale*this.scale;)ia=V,ja++,V=ea[ja+2];var ka=mxUtils.intersection(K.x,K.y,I.x,I.y,la.x,la.y,ia.x,ia.y);if(null!=ka&&(Math.abs(ka.x-K.x)>B||Math.abs(ka.y-K.y)>B)&&(Math.abs(ka.x-I.x)>B||Math.abs(ka.y-I.y)>B)&&(null==da||mxUtils.ptLineDist(K.x,K.y,+I.x,I.y,da.x,da.y)>B||mxUtils.ptLineDist(K.x,K.y,I.x,I.y,la.x,la.y)>B)&&(null==V||mxUtils.ptLineDist(K.x,K.y,I.x,I.y,V.x,V.y)>B||mxUtils.ptLineDist(K.x,K.y,I.x,I.y,ia.x,ia.y)>B)){V=ka.x-K.x;da=ka.y-K.y;ka={distSq:V*V+da*da,x:ka.x,y:ka.y};for(V=0;V<M.length;V++)if(M[V].distSq>ka.distSq){M.splice(V,0,ka);ka=null;break}null==ka||0!=M.length&&M[M.length-1].x===ka.x&&M[M.length-1].y===ka.y||M.push(ka)}da=la}}}for(ja=0;ja<M.length;ja++)g=t(1,M[ja].x,M[ja].y)||g}ka=c[c.length-1];g=t(0,ka.x,ka.y)||g}L.routedPoints=+l;return g}return!1};var C=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(L,c,g){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)C.apply(this,arguments);else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,t=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,+B=mxUtils.getValue(this.style,"jumpStyle","none"),D=!0,I=null,K=null,M=[],V=null;L.begin();for(var Q=0;Q<this.state.routedPoints.length;Q++){var ja=this.state.routedPoints[Q],ea=new mxPoint(ja.x/this.scale,ja.y/this.scale);0==Q?ea=c[0]:Q==this.state.routedPoints.length-1&&(ea=c[c.length-1]);var da=!1;if(null!=I&&1==ja.type){var ia=this.state.routedPoints[Q+1];ja=ia.x/this.scale-ea.x;ia=ia.y/this.scale-ea.y;ja=ja*ja+ia*ia;null==V&&(V=new mxPoint(ea.x-I.x,ea.y-I.y),K=Math.sqrt(V.x*V.x+V.y*V.y),0<K?+(V.x=V.x*t/K,V.y=V.y*t/K):V=null);ja>t*t&&0<K&&(ja=I.x-ea.x,ia=I.y-ea.y,ja=ja*ja+ia*ia,ja>t*t&&(da=new mxPoint(ea.x-V.x,ea.y-V.y),ja=new mxPoint(ea.x+V.x,ea.y+V.y),M.push(da),this.addPoints(L,M,g,l,!1,null,D),M=0>Math.round(V.x)||0==Math.round(V.x)&&0>=Math.round(V.y)?1:-1,D=!1,"sharp"==B?(L.lineTo(da.x-V.y*M,da.y+V.x*M),L.lineTo(ja.x-V.y*M,ja.y+V.x*M),L.lineTo(ja.x,ja.y)):"line"==B?(L.moveTo(da.x+V.y*M,da.y-V.x*M),L.lineTo(da.x-V.y*M,da.y+V.x*M),L.moveTo(ja.x-V.y*M,ja.y+V.x*M),L.lineTo(ja.x+V.y*+M,ja.y-V.x*M),L.moveTo(ja.x,ja.y)):"arc"==B?(M*=1.3,L.curveTo(da.x-V.y*M,da.y+V.x*M,ja.x-V.y*M,ja.y+V.x*M,ja.x,ja.y)):(L.moveTo(ja.x,ja.y),D=!0),M=[ja],da=!0))}else V=null;da||(M.push(ea),I=ea)}this.addPoints(L,M,g,l,!1,null,D);L.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(L,c,g,l){return null!=c&&"centerPerimeter"==c.style[mxConstants.STYLE_PERIMETER]?new mxPoint(c.getCenterX(),c.getCenterY()):G.apply(this,arguments)};var T=mxGraphView.prototype.updateFloatingTerminalPoint;+mxGraphView.prototype.updateFloatingTerminalPoint=function(L,c,g,l){if(null==c||null==L||"1"!=c.style.snapToPoint&&"1"!=L.style.snapToPoint)T.apply(this,arguments);else{c=this.getTerminalPort(L,c,l);var t=this.getNextPoint(L,g,l),B=this.graph.isOrthogonal(L),D=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),I=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=D){var K=Math.cos(-D),M=Math.sin(-D);t=mxUtils.getRotatedPoint(t,K,M,I)}K=parseFloat(L.style[mxConstants.STYLE_PERIMETER_SPACING]||+0);K+=parseFloat(L.style[l?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);t=this.getPerimeterPoint(c,t,0==D&&B,K);0!=D&&(K=Math.cos(D),M=Math.sin(D),t=mxUtils.getRotatedPoint(t,K,M,I));L.setAbsoluteTerminalPoint(this.snapToAnchorPoint(L,c,g,l,t),l)}};mxGraphView.prototype.snapToAnchorPoint=function(L,c,g,l,t){if(null!=c&&null!=L){L=this.graph.getAllConnectionConstraints(c);l=g=null;if(null!=L)for(var B=0;B<L.length;B++){var D=this.graph.getConnectionPoint(c,+L[B]);if(null!=D){var I=(D.x-t.x)*(D.x-t.x)+(D.y-t.y)*(D.y-t.y);if(null==l||I<l)g=D,l=I}}null!=g&&(t=g)}return t};var E=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(L,c,g){var l=E.apply(this,arguments);"1"==L.getAttribute("placeholders")&&null!=g.state&&(l=g.state.view.graph.replacePlaceholders(g.state.cell,l));return l};var P=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(L){if(null!=L.style&&"undefined"!==typeof pako){var c=+mxUtils.getValue(L.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"string"===typeof c&&"stencil("==c.substring(0,8))try{var g=c.substring(8,c.length-1),l=mxUtils.parseXml(Graph.decompress(g));return new mxShape(new mxStencil(l.documentElement))}catch(t){null!=window.console&&console.log("Error in shape: "+t)}}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 d=mxStencilRegistry.stencils[b];if(null==d&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var m=mxStencilRegistry.getBasenameForStencil(b);if(null!=m){d=mxStencilRegistry.libraries[m];if(null!=d){if(null==mxStencilRegistry.packages[m]){for(var n=0;n<d.length;n++){var v=d[n];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(C){null!=window.console&&console.log("error in getStencil:",b,m,d,v,C)}}mxStencilRegistry.packages[m]=1}}else m=m.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+m+".xml",null);d=mxStencilRegistry.stencils[b]}}return d};mxStencilRegistry.getBasenameForStencil=function(b){var d=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0<b.length&&"mxgraph"==b[0])){d=b[1];for(var m=2;m<b.length-1;m++)d+="/"+b[m]}return d};@@ -2616,178 +2620,178 @@ mxStencilRegistry.loadStencilSet=function(b,d,m,n){var v=mxStencilRegistry.packav.documentElement&&mxStencilRegistry.parseStencilSet(v.documentElement,d,p)}};mxStencilRegistry.loadStencil=function(b,d){if(null!=d)mxUtils.get(b,mxUtils.bind(this,function(m){d(200<=m.getStatus()&&299>=m.getStatus()?m.getXml():null)}),mxUtils.bind(this,function(m){d(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var d=0;d<b.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[d]).documentElement)};mxStencilRegistry.parseStencilSet=function(b,d,m){if("stencils"==b.nodeName)for(var n=b.firstChild;null!=n;)"shapes"==n.nodeName&&mxStencilRegistry.parseStencilSet(n,d,m),n=n.nextSibling;else{m=null!=m?m:!0;n=b.firstChild;var v="";b=b.getAttribute("name");for(null!=b&&(v=b+".");null!=n;){if(n.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=n.getAttribute("name"),null!=b)){v=v.toLowerCase();var p=b.replace(/ /g,"_");m&&mxStencilRegistry.addStencil(v+p.toLowerCase(),new mxStencil(n));if(null!=d){var C=n.getAttribute("w"),G=n.getAttribute("h");C=null==C?80:parseInt(C,10);G=null==G?80:parseInt(G,10);d(v,p,b,C,G)}}n=n.nextSibling}}};-"undefined"!==typeof mxVertexHandler&&function(){function b(){var y=document.createElement("div");y.className="geHint";y.style.whiteSpace="nowrap";y.style.position="absolute";return y}function d(y,P){switch(P){case mxConstants.POINTS:return y;case mxConstants.MILLIMETERS:return(y/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(y/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(y/mxConstants.PIXELS_PER_INCH).toFixed(3)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";+"undefined"!==typeof mxVertexHandler&&function(){function b(){var x=document.createElement("div");x.className="geHint";x.style.whiteSpace="nowrap";x.style.position="absolute";return x}function d(x,N){switch(N){case mxConstants.POINTS:return x;case mxConstants.MILLIMETERS:return(x/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(x/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(x/mxConstants.PIXELS_PER_INCH).toFixed(3)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR="#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=50;mxConstants.HIGHLIGHT_SIZE=5;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#707070" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'<path d="Z" stroke="#C0C0C0" stroke-width="1" fill="none"/>').src;-mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(y){return!mxEvent.isAltDown(y)||mxEvent.isShiftDown(y)};var m=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(y){return m.apply(this,arguments)||this.graph.isTableRow(y)||this.graph.isTableCell(y)};var n=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=-function(y){return n.apply(this,arguments)||this.graph.isEdgeIgnored(y)};var v=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(y){return this.graph.isCloneEvent(y)!=v.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var y=new mxEllipse(null,this.highlightColor,this.highlightColor,0);y.opacity=mxConstants.HIGHLIGHT_OPACITY;return y};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor=-"crosshair";mxConnectionHandler.prototype.createEdgeState=function(y){y=this.graph.createCurrentEdgeStyle();y=this.graph.createEdge(null,null,null,null,null,y);y=new mxCellState(this.graph.view,y,this.graph.getCellStyle(y));for(var P in this.graph.currentEdgeStyle)y.style[P]=this.graph.currentEdgeStyle[P];if(null!=this.previous){var S=this.previous.style.newEdgeStyle;if(null!=S)try{var X=JSON.parse(S);for(P in X)y.style[P]=X[P]}catch(ba){}}y.style=this.graph.postProcessCellStyle(y.cell,y.style);return y};-var p=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var y=p.apply(this,arguments);y.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return y};mxConnectionHandler.prototype.updatePreview=function(y){};var C=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=C.apply(this,arguments),P=y.getCell;y.getCell=mxUtils.bind(this,function(S){var X=P.apply(this,arguments);this.error=null;return X});-return y};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var y="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",P="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),S=0;S<P.length;S++)null!=-this.currentEdgeStyle[P[S]]&&(y+=P[S]+"="+this.currentEdgeStyle[P[S]]+";");null!=this.currentEdgeStyle.orthogonalLoop?y+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(y+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?y+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(y+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+-";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(y+="elbow="+this.currentEdgeStyle.elbow+";");return y=null!=this.currentEdgeStyle.html?y+("html="+this.currentEdgeStyle.html+";"):y+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var y=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=-y&&(new mxCodec(y.ownerDocument)).decode(y,this.getStylesheet())};Graph.prototype.createCellLookup=function(y,P){P=null!=P?P:{};for(var S=0;S<y.length;S++){var X=y[S];P[mxObjectIdentity.get(X)]=X.getId();for(var ba=this.model.getChildCount(X),ma=0;ma<ba;ma++)this.createCellLookup([this.model.getChildAt(X,ma)],P)}return P};Graph.prototype.createCellMapping=function(y,P,S){S=null!=S?S:{};for(var X in y){var ba=P[X];null==S[ba]&&(S[ba]=y[X].getId()||"")}return S};Graph.prototype.importGraphModel=function(y,-P,S,X){P=null!=P?P:0;S=null!=S?S:0;var ba=new mxCodec(y.ownerDocument),ma=new mxGraphModel;ba.decode(y,ma);y=[];ba={};var ra={},wa=ma.getChildren(this.cloneCell(ma.root,this.isCloneInvalidEdges(),ba));if(null!=wa){var sa=this.createCellLookup([ma.root]);wa=wa.slice();this.model.beginUpdate();try{if(1!=wa.length||this.isCellLocked(this.getDefaultParent()))for(ma=0;ma<wa.length;ma++)xa=this.model.getChildren(this.moveCells([wa[ma]],P,S,!1,this.model.getRoot())[0]),null!=xa&&(y=y.concat(xa));else{var xa=-ma.getChildren(wa[0]);null!=xa&&(y=this.moveCells(xa,P,S,!1,this.getDefaultParent()),ra[ma.getChildAt(ma.root,0).getId()]=this.getDefaultParent().getId())}if(null!=y&&(this.createCellMapping(ba,sa,ra),this.updateCustomLinks(ra,y),X)){this.isGridEnabled()&&(P=this.snap(P),S=this.snap(S));var Fa=this.getBoundingBoxFromGeometry(y,!0);null!=Fa&&this.moveCells(y,P-Fa.x,S-Fa.y)}}finally{this.model.endUpdate()}}return y};Graph.prototype.encodeCells=function(y){for(var P={},S=this.cloneCells(y,null,P),X=-new mxDictionary,ba=0;ba<y.length;ba++)X.put(y[ba],!0);var ma=new mxCodec,ra=new mxGraphModel,wa=ra.getChildAt(ra.getRoot(),0);for(ba=0;ba<S.length;ba++){ra.add(wa,S[ba]);var sa=this.view.getState(y[ba]);if(null!=sa){var xa=this.getCellGeometry(S[ba]);null!=xa&&xa.relative&&!this.model.isEdge(y[ba])&&null==X.get(this.model.getParent(y[ba]))&&(xa.offset=null,xa.relative=!1,xa.x=sa.x/sa.view.scale-sa.view.translate.x,xa.y=sa.y/sa.view.scale-sa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(P,-this.createCellLookup(y)),S);return ma.encode(ra)};Graph.prototype.isSwimlane=function(y,P){var S=null;null==y||this.model.isEdge(y)||this.model.getParent(y)==this.model.getRoot()||(S=this.getCurrentCellStyle(y,P)[mxConstants.STYLE_SHAPE]);return S==mxConstants.SHAPE_SWIMLANE||"table"==S||"tableRow"==S};var G=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(y){return null!=y&&G.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellEditable(this.model.getParent(y)):-!0:!1};var T=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(y){return null!=y&&T.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellMovable(this.model.getParent(y)):!0:!1};var E=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(y){var P=this.model.getParent(y);if(null!=P){var S=this.getCurrentCellStyle(P);if(null!=S.expand)return"0"!=S.expand}return E.apply(this,arguments)&&(null==P||!this.isTable(P))};var Q=Graph.prototype.splitEdge;-Graph.prototype.splitEdge=function(y,P,S,X,ba,ma,ra,wa){null==wa&&(wa=this.model.getParent(y),this.isTable(wa)||this.isTableRow(wa))&&(wa=this.getCellAt(ma,ra,null,!0,!1));S=null;this.model.beginUpdate();try{var sa=this.getCellGeometry(y);if(null!=sa&&null!=sa.points&&0<sa.points.length&&1==P.length&&this.model.isVertex(P[0])){var xa=this.getCellGeometry(P[0]);if(null!=xa&&!xa.relative){var Fa=new mxRectangle(xa.x+X,xa.y+ba,xa.width,xa.height),Ya=sa.points;xa=[];for(var Ua=0;Ua<Ya.length;Ua++)Fa.intersectsPoint(Ya[Ua].x,-Ya[Ua].y)||xa.push(Ya[Ua]);xa.length<Ya.length&&(sa=sa.clone(),sa.points=xa,this.model.setGeometry(y,sa))}}S=Q.apply(this,[y,P,S,X,ba,ma,ra,wa]);this.model.setValue(S,"");var cb=this.getChildCells(S,!0);for(Ua=0;Ua<cb.length;Ua++)sa=this.getCellGeometry(cb[Ua]),null!=sa&&sa.relative&&0<sa.x&&this.model.remove(cb[Ua]);var hb=this.getChildCells(y,!0);for(Ua=0;Ua<hb.length;Ua++)sa=this.getCellGeometry(hb[Ua]),null!=sa&&sa.relative&&0>=sa.x&&this.model.remove(hb[Ua]);var jb=this.model.getTerminal(S,!1);-if(null!=jb){var Ta=this.getCurrentCellStyle(jb);null!=Ta&&"1"==Ta.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[y]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[y]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[S]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[S]))}}finally{this.model.endUpdate()}return S};var M=Graph.prototype.selectCell;Graph.prototype.selectCell=function(y,P,S){if(P||S)M.apply(this,arguments);else{var X=this.getSelectionCell(),ba=null,ma=[],ra=-mxUtils.bind(this,function(wa){if(null!=this.view.getState(wa)&&(this.model.isVertex(wa)||this.model.isEdge(wa)))if(ma.push(wa),wa==X)ba=ma.length-1;else if(y&&null==X&&0<ma.length||null!=ba&&y&&ma.length>ba||!y&&0<ba)return;for(var sa=0;sa<this.model.getChildCount(wa);sa++)ra(this.model.getChildAt(wa,sa))});ra(this.model.root);0<ma.length&&(ba=null!=ba?mxUtils.mod(ba+(y?1:-1),ma.length):0,this.setSelectionCell(ma[ba]))}};Graph.prototype.swapShapes=function(y,P){if(this.model.isVertex(y)&&this.model.isVertex(P)&&-2==this.getMovableCells([y,P]).length){var S=this.getCellGeometry(y),X=this.getCellGeometry(P);if(null!=S&&null!=X){var ba=S.clone(),ma=X.clone();this.model.beginUpdate();try{ba.x=X.getCenterX()-S.width/2,ba.y=X.getCenterY()-S.height/2,ma.x=S.getCenterX()-X.width/2,ma.y=S.getCenterY()-X.height/2,this.model.setGeometry(y,ba),this.model.setGeometry(P,ma)}finally{this.model.endUpdate()}}}};var c=Graph.prototype.moveCells;Graph.prototype.moveCells=function(y,P,S,X,ba,ma,ra){ra=null!=ra?ra:{};if(this.isTable(ba)){for(var wa=-[],sa=0;sa<y.length;sa++)this.isTable(y[sa])?wa=wa.concat(this.model.getChildCells(y[sa],!0).reverse()):wa.push(y[sa]);y=wa}this.model.beginUpdate();try{wa=[];for(sa=0;sa<y.length;sa++)if(null!=ba&&this.isTableRow(y[sa])){var xa=this.model.getParent(y[sa]),Fa=this.getCellGeometry(y[sa]);this.isTable(xa)&&wa.push(xa);if(null!=xa&&null!=Fa&&this.isTable(xa)&&this.isTable(ba)&&(X||xa!=ba)){if(!X){var Ya=this.getCellGeometry(xa);null!=Ya&&(Ya=Ya.clone(),Ya.height-=Fa.height,this.model.setGeometry(xa,-Ya))}Ya=this.getCellGeometry(ba);null!=Ya&&(Ya=Ya.clone(),Ya.height+=Fa.height,this.model.setGeometry(ba,Ya));var Ua=this.model.getChildCells(ba,!0);if(0<Ua.length){y[sa]=X?this.cloneCell(y[sa]):y[sa];var cb=this.model.getChildCells(y[sa],!0),hb=this.model.getChildCells(Ua[0],!0),jb=hb.length-cb.length;if(0<jb)for(var Ta=0;Ta<jb;Ta++){var qb=this.cloneCell(cb[cb.length-1]);null!=qb&&(qb.value="",this.model.add(y[sa],qb))}else if(0>jb)for(Ta=0;Ta>jb;Ta--)this.model.remove(cb[cb.length+Ta-1]);cb=this.model.getChildCells(y[sa],-!0);for(Ta=0;Ta<hb.length;Ta++){var gb=this.getCellGeometry(hb[Ta]),bb=this.getCellGeometry(cb[Ta]);null!=gb&&null!=bb&&(bb=bb.clone(),bb.width=gb.width,this.model.setGeometry(cb[Ta],bb))}}}}var db=c.apply(this,arguments);for(sa=0;sa<wa.length;sa++)!X&&this.model.contains(wa[sa])&&0==this.model.getChildCount(wa[sa])&&this.model.remove(wa[sa]);X&&this.updateCustomLinks(this.createCellMapping(ra,this.createCellLookup(y)),db)}finally{this.model.endUpdate()}return db};var g=Graph.prototype.removeCells;-Graph.prototype.removeCells=function(y,P){var S=[];this.model.beginUpdate();try{for(var X=0;X<y.length;X++)if(this.isTableCell(y[X])){var ba=this.model.getParent(y[X]),ma=this.model.getParent(ba);1==this.model.getChildCount(ba)&&1==this.model.getChildCount(ma)?0>mxUtils.indexOf(y,ma)&&0>mxUtils.indexOf(S,ma)&&S.push(ma):this.labelChanged(y[X],"")}else{if(this.isTableRow(y[X])&&(ma=this.model.getParent(y[X]),0>mxUtils.indexOf(y,ma)&&0>mxUtils.indexOf(S,ma))){for(var ra=this.model.getChildCells(ma,-!0),wa=0,sa=0;sa<ra.length;sa++)0<=mxUtils.indexOf(y,ra[sa])&&wa++;wa==ra.length&&S.push(ma)}S.push(y[X])}S=g.apply(this,[S,P])}finally{this.model.endUpdate()}return S};Graph.prototype.updateCustomLinks=function(y,P,S){S=null!=S?S:new Graph;for(var X=0;X<P.length;X++)null!=P[X]&&S.updateCustomLinksForCell(y,P[X],S)};Graph.prototype.updateCustomLinksForCell=function(y,P){this.doUpdateCustomLinksForCell(y,P);for(var S=this.model.getChildCount(P),X=0;X<S;X++)this.updateCustomLinksForCell(y,this.model.getChildAt(P,-X))};Graph.prototype.doUpdateCustomLinksForCell=function(y,P){};Graph.prototype.getAllConnectionConstraints=function(y,P){if(null!=y){P=mxUtils.getValue(y.style,"points",null);if(null!=P){y=[];try{var S=JSON.parse(P);for(P=0;P<S.length;P++){var X=S[P];y.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(ma){}return y}if(null!=y.shape&&null!=y.shape.bounds){X=y.shape.direction;P=y.shape.bounds;var ba=y.shape.scale;S=P.width/-ba;P=P.height/ba;if(X==mxConstants.DIRECTION_NORTH||X==mxConstants.DIRECTION_SOUTH)X=S,S=P,P=X;P=y.shape.getConstraints(y.style,S,P);if(null!=P)return P;if(null!=y.shape.stencil&&null!=y.shape.stencil.constraints)return y.shape.stencil.constraints;if(null!=y.shape.constraints)return y.shape.constraints}}return null};Graph.prototype.flipEdge=function(y){if(null!=y){var P=this.getCurrentCellStyle(y);P=mxUtils.getValue(P,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?-mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,P,[y])}};Graph.prototype.isValidRoot=function(y){for(var P=this.model.getChildCount(y),S=0,X=0;X<P;X++){var ba=this.model.getChildAt(y,X);this.model.isVertex(ba)&&(ba=this.getCellGeometry(ba),null==ba||ba.relative||S++)}return 0<S||this.isContainer(y)};Graph.prototype.isValidDropTarget=function(y,P,S){for(var X=this.getCurrentCellStyle(y),ba=!0,ma=!0,ra=0;ra<P.length&&ma;ra++)ba=ba&&this.isTable(P[ra]),-ma=ma&&this.isTableRow(P[ra]);return!this.isCellLocked(y)&&(this.isTargetShape(y,P,S)||("1"!=mxUtils.getValue(X,"part","0")||this.isContainer(y))&&"0"!=mxUtils.getValue(X,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(y))&&!this.isTableRow(y)&&(!this.isTable(y)||ma||ba))};Graph.prototype.createGroupCell=function(){var y=mxGraph.prototype.createGroupCell.apply(this,arguments);y.setStyle("group");return y};Graph.prototype.isExtendParentsOnAdd=function(y){var P=-mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(P&&null!=y&&null!=this.layoutManager){var S=this.model.getParent(y);null!=S&&(S=this.layoutManager.getLayout(S),null!=S&&S.constructor==mxStackLayout&&(P=!1))}return P};Graph.prototype.getPreferredSizeForCell=function(y,P,S){S=null!=S?S:this.gridEnabled;var X=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=X&&(X.width+=10,X.height+=4,S&&(X.width=this.snap(X.width),X.height=this.snap(X.height)));return X};Graph.prototype.getAutosizeTextAvailableSpace=-function(y,P,S,X){var ba=0,ma=0;(null!=X&&null!=this.getImage(X)||null!=y[mxConstants.STYLE_IMAGE])&&y[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(y[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(ba+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),y[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(ma+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));ba+=2*parseFloat(mxUtils.getValue(y,-mxConstants.STYLE_SPACING,2));ba+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING_LEFT,2));ba+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING_RIGHT,2));ma+=2*parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING,2));ma+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING_TOP,2));ma+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING_BOTTOM,2));null!=X&&(X=this.getFoldingImage(X),null!=X&&(ba+=X.width+8));y=mxUtils.getValue(y,mxConstants.STYLE_HORIZONTAL,!0);ba=(y?P:S)--ba;P=(y?S:P)-ma;return 0>=ba||0>=P?null:{availW:ba,availH:P}};Graph.prototype.computeAutosizeTextFontSize=function(y,P,S,X,ba,ma){var ra=1,wa=84,sa=ma?P:null,xa=null;if(ma){for(var Fa=y.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Ya=[],Ua=0;Ua<Fa.length;Ua++)0<Fa[Ua].length&&Ya.push(mxUtils.htmlEntities(Fa[Ua],!1));0<Ya.length&&(xa=Ya.join("<br>"))}for(;ra<wa;)Fa=Math.ceil((ra+wa)/2),Ya=mxUtils.getSizeForString(y,Fa,X,sa,ba),(Ya=ma?Ya.height<=S:Ya.width<=P&&Ya.height<=S)&&-ma&&null!=xa&&mxUtils.getSizeForString(xa,Fa,X,null,ba).width>P&&(Ya=!1),Ya?ra=Fa:wa=Fa-1;return Math.max(6,ra)};Graph.prototype.updateAutosizeTextFontSize=function(y,P){var S=this.view.getState(y);null==S&&(S=this.view.createState(y));P=P||S.style;var X=this.getCellGeometry(y);if(null!=X&&!this.model.isEdge(y)){var ba=this.cellRenderer.getLabelValue(S);null!=ba&&0!=ba.length&&(S=this.getAutosizeTextAvailableSpace(P,X.width,X.height,S),null!=S&&(this.isHtmlLabel(y)||(ba=mxUtils.htmlEntities(ba,!1)),-ba=ba.replace(/\n/g,"<br>"),P=this.computeAutosizeTextFontSize(ba,S.availW,S.availH,P[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,P[mxConstants.STYLE_FONTSTYLE],"wrap"==P[mxConstants.STYLE_WHITE_SPACE]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,P,[y])))}};Graph.prototype.cellsResized=function(y,P,S){var X=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=y)for(var ba=0;ba<y.length;ba++)this.model.isVertex(y[ba])&&this.isAutosizeTextCell(y[ba])&&this.updateAutosizeTextFontSize(y[ba]);-return X};Graph.prototype.turnShapes=function(y,P){var S=this.getModel(),X=[];S.beginUpdate();try{for(var ba=0;ba<y.length;ba++){var ma=y[ba];if(S.isEdge(ma)){var ra=S.getTerminal(ma,!0),wa=S.getTerminal(ma,!1);S.setTerminal(ma,wa,!0);S.setTerminal(ma,ra,!1);var sa=S.getGeometry(ma);if(null!=sa){sa=sa.clone();null!=sa.points&&sa.points.reverse();var xa=sa.getTerminalPoint(!0),Fa=sa.getTerminalPoint(!1);sa.setTerminalPoint(xa,!1);sa.setTerminalPoint(Fa,!0);S.setGeometry(ma,sa);var Ya=this.view.getState(ma),-Ua=this.view.getState(ra),cb=this.view.getState(wa);if(null!=Ya){var hb=null!=Ua?this.getConnectionConstraint(Ya,Ua,!0):null,jb=null!=cb?this.getConnectionConstraint(Ya,cb,!1):null;this.setConnectionConstraint(ma,ra,!0,jb);this.setConnectionConstraint(ma,wa,!1,hb);var Ta=mxUtils.getValue(Ya.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Ya.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ma]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,-Ta,[ma])}X.push(ma)}}else if(S.isVertex(ma)&&(sa=this.getCellGeometry(ma),null!=sa)){if(!(this.isTable(ma)||this.isTableRow(ma)||this.isTableCell(ma)||this.isSwimlane(ma))){sa=sa.clone();sa.x+=sa.width/2-sa.height/2;sa.y+=sa.height/2-sa.width/2;var qb=sa.width;sa.width=sa.height;sa.height=qb;S.setGeometry(ma,sa)}var gb=this.view.getState(ma);if(null!=gb){var bb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],db=mxUtils.getValue(gb.style,-mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,bb[mxUtils.mod(mxUtils.indexOf(bb,db)+(P?-1:1),bb.length)],[ma])}X.push(ma)}}}finally{S.endUpdate()}return X};Graph.prototype.stencilHasPlaceholders=function(y){if(null!=y&&null!=y.fgNode)for(y=y.fgNode.firstChild;null!=y;){if("text"==y.nodeName&&"1"==y.getAttribute("placeholders"))return!0;y=y.nextSibling}return!1};var l=Graph.prototype.processChange;Graph.prototype.processChange=function(y){if(y instanceof-mxGeometryChange&&(this.isTableCell(y.cell)||this.isTableRow(y.cell))&&(null==y.previous&&null!=y.geometry||null!=y.previous&&!y.previous.equals(y.geometry))){var P=y.cell;this.isTableCell(P)&&(P=this.model.getParent(P));this.isTableRow(P)&&(P=this.model.getParent(P));var S=this.view.getState(P);null!=S&&null!=S.shape&&(this.view.invalidate(P),S.shape.bounds=null)}l.apply(this,arguments);y instanceof mxValueChange&&null!=y.cell&&null!=y.cell.value&&"object"==typeof y.cell.value&&this.invalidateDescendantsWithPlaceholders(y.cell)};-Graph.prototype.invalidateDescendantsWithPlaceholders=function(y){y=this.model.getDescendants(y);if(0<y.length)for(var P=0;P<y.length;P++){var S=this.view.getState(y[P]);null!=S&&null!=S.shape&&null!=S.shape.stencil&&this.stencilHasPlaceholders(S.shape.stencil)?this.removeStateForCell(y[P]):this.isReplacePlaceholders(y[P])&&this.view.invalidate(y[P],!1,!1)}};Graph.prototype.replaceElement=function(y,P){P=y.ownerDocument.createElement(null!=P?P:"span");for(var S=Array.prototype.slice.call(y.attributes);attr=-S.pop();)P.setAttribute(attr.nodeName,attr.nodeValue);P.innerHTML=y.innerHTML;y.parentNode.replaceChild(P,y)};Graph.prototype.processElements=function(y,P){if(null!=y){y=y.getElementsByTagName("*");for(var S=0;S<y.length;S++)null!=y[S]&&P(y[S])}};Graph.prototype.updateLabelElements=function(y,P,S){y=null!=y?y:this.getSelectionCells();for(var X=document.createElement("div"),ba=0;ba<y.length;ba++){var ma=this.getCurrentCellStyle(y[ba]);if(null!=ma&&"1"==ma.html&&(ma=this.convertValueToString(y[ba]),-null!=ma&&0<ma.length)){X.innerHTML=Graph.sanitizeHtml(ma);for(var ra=X.getElementsByTagName(null!=S?S:"*"),wa=0;wa<ra.length;wa++)P(ra[wa]);X.innerHTML!=ma&&this.cellLabelChanged(y[ba],X.innerHTML)}}};Graph.prototype.cellLabelChanged=function(y,P,S){P=Graph.zapGremlins(P);this.model.beginUpdate();try{if(null!=y.value&&"object"==typeof y.value){if(this.isReplacePlaceholders(y)&&null!=y.getAttribute("placeholder"))for(var X=y.getAttribute("placeholder"),ba=y;null!=ba;){if(ba==this.model.getRoot()||-null!=ba.value&&"object"==typeof ba.value&&ba.hasAttribute(X)){this.setAttributeForCell(ba,X,P);break}ba=this.model.getParent(ba)}var ma=y.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&ma.hasAttribute("label_"+Graph.diagramLanguage)?ma.setAttribute("label_"+Graph.diagramLanguage,P):ma.setAttribute("label",P);P=ma}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(y)&&this.updateAutosizeTextFontSize(y)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=-function(y){if(null!=y){for(var P=new mxDictionary,S=0;S<y.length;S++)P.put(y[S],!0);var X=[];for(S=0;S<y.length;S++){var ba=this.model.getParent(y[S]);null==ba||P.get(ba)||(P.put(ba,!0),X.push(ba))}for(S=0;S<X.length;S++)if(ba=this.view.getState(X[S]),null!=ba&&(this.model.isEdge(ba.cell)||this.model.isVertex(ba.cell))&&this.isCellDeletable(ba.cell)&&this.isTransparentState(ba)){for(var ma=!0,ra=0;ra<this.model.getChildCount(ba.cell)&&ma;ra++)P.get(this.model.getChildAt(ba.cell,ra))||(ma=!1);ma&&-y.push(ba.cell)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(y){for(var P=[],S=0;S<y.length;S++)this.isCellDeletable(y[S])&&this.isTransparentState(this.view.getState(y[S]))&&P.push(y[S]);y=P;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(y,P){this.setAttributeForCell(y,"link",P)};Graph.prototype.createLinkOverlay=function(y){y=this.getLinkForCell(y);if(null!=y&&0<y.length){y=this.getLinkOverlayTooltip(y);-y=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),y,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));y.isLinkOverlay=!0;var P=this;y.addListener(mxEvent.CLICK,function(S,X){P.setSelectionCell(X.getProperty("cell"))});return y}return null};Graph.prototype.getLinkOverlayTooltip=function(y){return y};Graph.prototype.createTooltipOverlay=function(y){y=this.convertValueToTooltip(y);if(null!=y&&0<y.length){y=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),-y,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));y.isTooltipOverlay=!0;var P=this;y.addListener(mxEvent.CLICK,function(S,X){S=X.getProperty("cell");P.isEnabled()&&P.isCellEditable(S)?(P.setSelectionCell(S),P.editTooltip(S)):(X=X.getProperty("event"),S=P.getTooltipForCell(S),null!=S&&0<S.length&&P.tooltipHandler.show(S,X.clientX,X.clientY))});return y}return null};Graph.prototype.editTooltip=function(y){};Graph.prototype.setTooltipForCell=function(y,P){var S="tooltip";Graph.translateDiagram&&-null!=Graph.diagramLanguage&&mxUtils.isNode(y.value)&&y.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(S="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(y,S,P)};Graph.prototype.getAttributeForCell=function(y,P,S){y=null!=y.value&&"object"===typeof y.value?y.value.getAttribute(P):null;return null!=y?y:S};Graph.prototype.setAttributeForCell=function(y,P,S){if(null!=y.value&&"object"==typeof y.value)var X=y.value.cloneNode(!0);else X=mxUtils.createXmlDocument().createElement("UserObject"),-X.setAttribute("label",y.value||"");null!=S?X.setAttribute(P,S):X.removeAttribute(P);this.model.setValue(y,X)};Graph.prototype.isTargetShape=function(y,P,S){y=mxUtils.getValue(this.getCurrentCellStyle(y),mxConstants.STYLE_SHAPE,"");for(S=0;S<P.length;S++){var X=mxUtils.getValue(this.getCurrentCellStyle(P[S]),"targetShapes","").split(",");if(0<=mxUtils.indexOf(X,y))return!0}return!1};var t=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(y,P,S,X){if(mxEvent.isAltDown(P))return null;-for(var ba=0;ba<y.length;ba++){var ma=this.model.getParent(y[ba]);if(this.model.isEdge(ma)&&0>mxUtils.indexOf(y,ma))return null}ma=t.apply(this,arguments);var ra=!0;for(ba=0;ba<y.length&&ra;ba++)ra=ra&&this.isTableRow(y[ba]);ra&&(this.isTableCell(ma)&&(ma=this.model.getParent(ma)),this.isTableRow(ma)&&(ma=this.model.getParent(ma)),this.isTable(ma)||(ma=null));return ma};Graph.prototype.click=function(y){mxGraph.prototype.click.call(this,y);this.firstClickState=y.getState();this.firstClickSource=y.getSource()};-Graph.prototype.dblClick=function(y,P){this.isEnabled()&&(P=this.insertTextForEvent(y,P),mxGraph.prototype.dblClick.call(this,y,P))};Graph.prototype.insertTextForEvent=function(y,P){var S=mxUtils.convertPoint(this.container,mxEvent.getClientX(y),mxEvent.getClientY(y));if(null!=y&&!this.model.isVertex(P)){var X=this.model.isEdge(P)?this.view.getState(P):null,ba=mxEvent.getSource(y);this.firstClickState!=X||this.firstClickSource!=ba||null!=X&&null!=X.text&&null!=X.text.node&&null!=X.text.boundingBox&&-(mxUtils.contains(X.text.boundingBox,S.x,S.y)||mxUtils.isAncestorNode(X.text.node,mxEvent.getSource(y)))||(null!=X||this.isCellLocked(this.getDefaultParent()))&&(null==X||this.isCellLocked(X.cell))||!(null!=X||mxClient.IS_SVG&&ba==this.view.getCanvas().ownerSVGElement)||(null==X&&(X=this.view.getState(this.getCellAt(S.x,S.y))),P=this.addText(S.x,S.y,X))}return P};Graph.prototype.getInsertPoint=function(y){y=this.getGridSize();var P=this.container.scrollLeft/this.view.scale-this.view.translate.x,S=-this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var X=this.getPageLayout(),ba=this.getPageSize();P=Math.max(P,X.x*ba.width);S=Math.max(S,X.y*ba.height)}return new mxPoint(this.snap(P+y),this.snap(S+y))};Graph.prototype.getFreeInsertPoint=function(y){var P=this.view,S=this.getGraphBounds(),X=this.getInsertPoint(y);y=this.snap(Math.round(Math.max(X.x,S.x/P.scale-P.translate.x+(0==S.width?2*this.gridSize:0))));P=this.snap(Math.round(Math.max(X.y,(S.y+S.height)/P.scale--P.translate.y+2*this.gridSize)));return new mxPoint(y,P)};Graph.prototype.getCenterInsertPoint=function(y){y=null!=y?y:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-y.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale-this.view.translate.y-y.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/-2/this.view.scale-this.view.translate.x-y.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-y.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(y,P){y=null!=y?y:"";null!=P&&(0<y.length&&";"!=y.charAt(y.length-1)&&(y+=";"),y+="fontSize="+P+";");return y};Graph.prototype.addText=function(y,P,S){var X=new mxCell;X.value="Text";X.geometry=new mxGeometry(0,0,0,0);X.vertex=!0;if(null!=S&&this.model.isEdge(S.cell)){X.style=-"edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);X.geometry.relative=!0;X.connectable=!1;var ba=this.view.getRelativePoint(S,y,P);X.geometry.x=Math.round(1E4*ba.x)/1E4;X.geometry.y=Math.round(ba.y);X.geometry.offset=new mxPoint(0,0);ba=this.view.getPoint(S,X.geometry);var ma=this.view.scale;X.geometry.offset=new mxPoint(Math.round((y-ba.x)/ma),Math.round((P-ba.y)/ma))}else ba=this.view.translate,X.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",-this.vertexFontSize),X.geometry.width=40,X.geometry.height=20,X.geometry.x=Math.round(y/this.view.scale)-ba.x-(null!=S?S.origin.x:0),X.geometry.y=Math.round(P/this.view.scale)-ba.y-(null!=S?S.origin.y:0),X.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([X],null!=S?S.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[X])),this.autoSizeCell(X)}finally{this.getModel().endUpdate()}return X};Graph.prototype.addClickHandler=function(y,P,S){var X=mxUtils.bind(this,-function(){var sa=this.container.getElementsByTagName("a");if(null!=sa)for(var xa=0;xa<sa.length;xa++){var Fa=this.getAbsoluteUrl(sa[xa].getAttribute("href"));null!=Fa&&(sa[xa].setAttribute("rel",this.linkRelation),sa[xa].setAttribute("href",Fa),null!=P&&mxEvent.addGestureListeners(sa[xa],null,null,P))}});this.model.addListener(mxEvent.CHANGE,X);X();var ba=this.container.style.cursor,ma=this.getTolerance(),ra=this,wa={currentState:null,currentLink:null,currentTarget:null,highlight:null!=y&&""!=y&&-y!=mxConstants.NONE?new mxCellHighlight(ra,y,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(sa){var xa=sa.sourceState;if(null==xa||null==ra.getLinkForCell(xa.cell))sa=ra.getCellAt(sa.getGraphX(),sa.getGraphY(),null,null,null,function(Fa,Ya,Ua){return null==ra.getLinkForCell(Fa.cell)}),xa=null==xa||ra.model.isAncestor(sa,xa.cell)?ra.view.getState(sa):null;xa!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=xa,null!=this.currentState&&this.activate(this.currentState))},-mouseDown:function(sa,xa){this.startX=xa.getGraphX();this.startY=xa.getGraphY();this.scrollLeft=ra.container.scrollLeft;this.scrollTop=ra.container.scrollTop;null==this.currentLink&&"auto"==ra.container.style.overflow&&(ra.container.style.cursor="move");this.updateCurrentState(xa)},mouseMove:function(sa,xa){if(ra.isMouseDown)null!=this.currentLink&&(sa=Math.abs(this.startX-xa.getGraphX()),xa=Math.abs(this.startY-xa.getGraphY()),(sa>ma||xa>ma)&&this.clear());else{for(sa=xa.getSource();null!=sa&&"a"!=-sa.nodeName.toLowerCase();)sa=sa.parentNode;null!=sa?this.clear():(null!=ra.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&ra.tooltipHandler.reset(xa,!0,this.currentState),(null==this.currentState||xa.getState()!=this.currentState&&null!=xa.sourceState||!ra.intersects(this.currentState,xa.getGraphX(),xa.getGraphY()))&&this.updateCurrentState(xa))}},mouseUp:function(sa,xa){var Fa=xa.getSource();for(sa=xa.getEvent();null!=Fa&&"a"!=Fa.nodeName.toLowerCase();)Fa=Fa.parentNode;null==-Fa&&Math.abs(this.scrollLeft-ra.container.scrollLeft)<ma&&Math.abs(this.scrollTop-ra.container.scrollTop)<ma&&(null==xa.sourceState||!xa.isSource(xa.sourceState.control))&&((mxEvent.isLeftMouseButton(sa)||mxEvent.isMiddleMouseButton(sa))&&!mxEvent.isPopupTrigger(sa)||mxEvent.isTouchEvent(sa))&&(null!=this.currentLink?(Fa=ra.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&Fa||null==P||P(sa,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(sa)||-(sa=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(sa)?"_blank":Fa?ra.linkTarget:"_top",ra.openLink(this.currentLink,sa),xa.consume())):null!=S&&!xa.isConsumed()&&Math.abs(this.scrollLeft-ra.container.scrollLeft)<ma&&Math.abs(this.scrollTop-ra.container.scrollTop)<ma&&Math.abs(this.startX-xa.getGraphX())<ma&&Math.abs(this.startY-xa.getGraphY())<ma&&S(xa.getEvent()));this.clear()},activate:function(sa){this.currentLink=ra.getAbsoluteUrl(ra.getLinkForCell(sa.cell));null!=this.currentLink&&-(this.currentTarget=ra.getLinkTargetForCell(sa.cell),ra.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(sa))},clear:function(){null!=ra.container&&(ra.container.style.cursor=ba);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=ra.tooltipHandler&&ra.tooltipHandler.hide()}};ra.click=function(sa){};ra.addMouseListener(wa);mxEvent.addListener(document,"mouseleave",function(sa){wa.clear()})};Graph.prototype.duplicateCells=-function(y,P){y=null!=y?y:this.getSelectionCells();P=null!=P?P:!0;for(var S=0;S<y.length;S++)this.isTableCell(y[S])&&(y[S]=this.model.getParent(y[S]));y=this.model.getTopmostCells(y);var X=this.getModel(),ba=this.gridSize,ma=[];X.beginUpdate();try{var ra={},wa=this.createCellLookup(y),sa=this.cloneCells(y,!1,ra,!0);for(S=0;S<y.length;S++){var xa=X.getParent(y[S]);if(null!=xa){var Fa=this.moveCells([sa[S]],ba,ba,!1)[0];ma.push(Fa);if(P)X.add(xa,sa[S]);else{var Ya=xa.getIndex(y[S]);X.add(xa,sa[S],Ya+-1)}if(this.isTable(xa)){var Ua=this.getCellGeometry(sa[S]),cb=this.getCellGeometry(xa);null!=Ua&&null!=cb&&(cb=cb.clone(),cb.height+=Ua.height,X.setGeometry(xa,cb))}}else ma.push(sa[S])}this.updateCustomLinks(this.createCellMapping(ra,wa),sa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",sa))}finally{X.endUpdate()}return ma};Graph.prototype.insertImage=function(y,P,S){if(null!=y&&null!=this.cellEditor.textarea){for(var X=this.cellEditor.textarea.getElementsByTagName("img"),ba=-[],ma=0;ma<X.length;ma++)ba.push(X[ma]);document.execCommand("insertimage",!1,y);y=this.cellEditor.textarea.getElementsByTagName("img");if(y.length==ba.length+1)for(ma=y.length-1;0<=ma;ma--)if(0==ma||y[ma]!=ba[ma-1]){y[ma].setAttribute("width",P);y[ma].setAttribute("height",S);break}}};Graph.prototype.insertLink=function(y){if(null!=this.cellEditor.textarea)if(0==y.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var P=this.cellEditor.textarea.getElementsByTagName("a"),S=[],X=-0;X<P.length;X++)S.push(P[X]);document.execCommand("createlink",!1,mxUtils.trim(y));P=this.cellEditor.textarea.getElementsByTagName("a");if(P.length==S.length+1)for(X=P.length-1;0<=X;X--)if(P[X]!=S[X-1]){for(P=P[X].getElementsByTagName("a");0<P.length;){for(S=P[0].parentNode;null!=P[0].firstChild;)S.insertBefore(P[0].firstChild,P[0]);S.removeChild(P[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(y))};Graph.prototype.isCellResizable=function(y){var P=mxGraph.prototype.isCellResizable.apply(this,-arguments),S=this.getCurrentCellStyle(y);return!this.isTableCell(y)&&!this.isTableRow(y)&&(P||"0"!=mxUtils.getValue(S,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==S[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(y,P,S){null==P&&(P=this.getSelectionCells());if(null!=P&&1<P.length){for(var X=[],ba=null,ma=null,ra=0,wa=0;wa<P.length;wa++)if(this.getModel().isVertex(P[wa])){var sa=this.view.getState(P[wa]);if(null!=sa){var xa=y?sa.getCenterX():sa.getCenterY();ba=null!=ba?Math.max(ba,-xa):xa;ma=null!=ma?Math.min(ma,xa):xa;S&&(ra+=y?sa.width:sa.height);X.push(sa)}}if(2<X.length){X.sort(function(hb,jb){return y?hb.x-jb.x:hb.y-jb.y});S&&(ra-=y?X[0].width/2+X[X.length-1].width/2:X[0].height/2+X[X.length-1].height/2);sa=this.view.translate;xa=this.view.scale;ma=ma/xa-(y?sa.x:sa.y);ba=ba/xa-(y?sa.x:sa.y);this.getModel().beginUpdate();try{var Fa=(ba-ma-ra)/(X.length-1),Ya=ma+(S?y?X[0].width/2:X[0].height/2:0);for(wa=1;wa<X.length-1;wa++){var Ua=this.view.getState(this.model.getParent(X[wa].cell)),-cb=this.getCellGeometry(X[wa].cell);Ya+=Fa;null!=cb&&null!=Ua&&(cb=cb.clone(),y?cb.x=Math.round(Ya-(S?0:cb.width/2))-Ua.origin.x:cb.y=Math.round(Ya-(S?0:cb.height/2))-Ua.origin.y,this.getModel().setGeometry(X[wa].cell,cb));S&&(Ya+=y?X[wa].width:X[wa].height)}}finally{this.getModel().endUpdate()}}}return P};Graph.prototype.isCloneEvent=function(y){return mxClient.IS_MAC&&mxEvent.isMetaDown(y)||mxEvent.isControlDown(y)};Graph.prototype.createSvgImageExport=function(y){y=new mxImageExport;y.addCellData=-function(S,X,ba){X.setAttribute("data-cell-id",S.id);if(ba)if(mxUtils.isNode(S.value))for(ba=0;ba<S.value.attributes.length;ba++){var ma=S.value.attributes[ba];X.setAttribute("data-cell-"+ma.name,ma.value)}else if("object"===typeof S.value)for(ma in S.value)X.setAttribute("data-cell-"+ma,S.value[ma]);else null!=S.value&&X.setAttribute("data-cell-value",S.value);return X};var P=y.visitStatesRecursive;y.visitStatesRecursive=function(S,X,ba){if(null!=S){var ma=X.root,ra=X.root.ownerDocument;X.root=this.addCellData(S.cell,-null!=ra.createElementNS?ra.createElementNS(mxConstants.NS_SVG,"g"):ra.createElement("g"),Editor.addSvgMetadata);ma.appendChild(X.root);P.apply(this,arguments);X.root=ma}};y.getLinkForCellState=mxUtils.bind(this,function(S,X){return this.getLinkForCell(S.cell)});y.getTitleForCellState=mxUtils.bind(this,function(S,X){return Editor.convertHtmlToText(this.convertValueToTooltip(S.cell))});return y};Graph.prototype.parseBackgroundImage=function(y){var P=null;null!=y&&0<y.length&&(y=JSON.parse(y),P=new mxImage(y.src,-y.width,y.height));return P};Graph.prototype.getBackgroundImageObject=function(y){return y};Graph.prototype.getSvg=function(y,P,S,X,ba,ma,ra,wa,sa,xa,Fa,Ya,Ua,cb,hb,jb){var Ta=null;if(null!=cb)for(Ta=new mxDictionary,ba=0;ba<cb.length;ba++)Ta.put(cb[ba],!0);cb=this.useCssTransforms;var qb=this.enableFlowAnimation;this.enableFlowAnimation=!1;cb&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{P=null!=P?P:1;S=null!=S?S:0;ma=null!=ma?ma:!0;ra=null!=ra?ra:!0;xa=null!=xa?xa:-!1;sa=null!=sa?sa:this.defaultExportLinkTarget;var gb="page"==Ua?this.view.getBackgroundPageBounds():ma&&null==Ta||X||"diagram"==Ua?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),bb=this.backgroundImage,db=this.view.translate,lb=this.view.scale;"diagram"==Ua&&null!=bb&&null!=bb.width&&null!=bb.height&&(gb=mxRectangle.fromRectangle(gb),gb.add(new mxRectangle((db.x+bb.x)*lb,(db.y+bb.y)*lb,bb.width*lb,bb.height*lb)));if(null==gb)throw Error(mxResources.get("drawingEmpty"));X=P/lb;-var ub=Math.max(1,Math.ceil(gb.width*X)+2*S)+(xa&&0==S?5:0),ob=Math.max(1,Math.ceil(gb.height*X)+2*S)+(xa&&0==S?5:0),pb=mxUtils.getLightDarkColor(y),sb=Graph.createSvgNode(0,0,ub,ob,pb),rb=sb.ownerDocument;if(null!=y){var tb=mxUtils.createElementNs(rb,mxConstants.NS_SVG,"rect");tb.setAttribute("fill",pb.light);tb.style.fill=pb.cssText;tb.setAttribute("width","100%");tb.setAttribute("height","100%");tb.setAttribute("x","0");tb.setAttribute("y","0");sb.appendChild(tb)}var yb=mxUtils.createElementNs(rb,-mxConstants.NS_SVG,"g");sb.appendChild(yb);var vb=this.createSvgCanvas(yb);vb.translate(Math.floor(S/P-gb.x/lb),Math.floor(S/P-gb.y/lb));vb.idPrefix="drawio-svg-"+Editor.guid();var Fb=document.createElement("div"),zb=vb.getAlternateText;vb.getAlternateText=function(nb,Ab,wb,f,q,z,u,A,F,H,ha,O,va){if(null!=z&&0<this.state.fontSize)try{mxUtils.isNode(z)?z=z.innerText:(Fb.innerHTML=z,z=mxUtils.extractTextWithWhitespace(Fb.childNodes));for(var pa=Math.ceil(2*f/this.state.fontSize),Wa=[],kb=0,fb=0;(0==-pa||kb<pa)&&fb<z.length;){var Ea=z.charCodeAt(fb);if(10==Ea||13==Ea){if(0<kb)break}else Wa.push(z.charAt(fb)),255>Ea&&kb++;fb++}Wa.length<z.length&&1<z.length-Wa.length&&(z=mxUtils.trim(Wa.join(""))+"...");return z}catch(La){return zb.apply(this,arguments)}else return zb.apply(this,arguments)};if(null!=bb&&null!=bb.width&&null!=bb.height){y=lb/P;var xb=new mxRectangle((bb.x+db.x)*y,(bb.y+db.y)*y,bb.width*y,bb.height*y);mxUtils.intersects(gb,xb)&&vb.image(bb.x+db.x,bb.y+db.y,bb.width,bb.height,bb.src,-!0)}vb.scale(X);vb.textEnabled=ra;wa=null!=wa?wa:this.createSvgImageExport();var mb=wa.getLinkForCellState;wa.getLinkForCellState=function(nb,Ab){var wb=nb.view.graph.getAbsoluteUrl(mb.apply(this,arguments));return null==wb||nb.view.graph.isCustomLink(wb)?null:wb};wa.getLinkTargetForCellState=function(nb,Ab){return nb.view.graph.getLinkTargetForCell(nb.cell)};var Bb=wa.drawCellState,Cb=null,Db=mxUtils.bind(this,function(){if(null==Cb){Cb="ge-flow-animation-"+Editor.guid();var nb=null!=rb.createElementNS?+mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(x){return!mxEvent.isAltDown(x)||mxEvent.isShiftDown(x)};var m=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(x){return m.apply(this,arguments)||this.graph.isTableRow(x)||this.graph.isTableCell(x)};var n=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=+function(x){return n.apply(this,arguments)||this.graph.isEdgeIgnored(x)};var v=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(x){return this.graph.isCloneEvent(x)!=v.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var x=new mxEllipse(null,this.highlightColor,this.highlightColor,0);x.opacity=mxConstants.HIGHLIGHT_OPACITY;return x};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor=+"crosshair";mxConnectionHandler.prototype.createEdgeState=function(x){x=this.graph.createCurrentEdgeStyle();x=this.graph.createEdge(null,null,null,null,null,x);x=new mxCellState(this.graph.view,x,this.graph.getCellStyle(x));for(var N in this.graph.currentEdgeStyle)x.style[N]=this.graph.currentEdgeStyle[N];if(null!=this.previous){var S=this.previous.style.newEdgeStyle;if(null!=S)try{var Y=JSON.parse(S);for(N in Y)x.style[N]=Y[N]}catch(ca){}}x.style=this.graph.postProcessCellStyle(x.cell,x.style);return x};+var p=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var x=p.apply(this,arguments);x.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return x};mxConnectionHandler.prototype.updatePreview=function(x){};var C=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var x=C.apply(this,arguments),N=x.getCell;x.getCell=mxUtils.bind(this,function(S){var Y=N.apply(this,arguments);this.error=null;return Y});+return x};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var x="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",N="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),S=0;S<N.length;S++)null!=+this.currentEdgeStyle[N[S]]&&(x+=N[S]+"="+this.currentEdgeStyle[N[S]]+";");null!=this.currentEdgeStyle.orthogonalLoop?x+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(x+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?x+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(x+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize++";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(x+="elbow="+this.currentEdgeStyle.elbow+";");return x=null!=this.currentEdgeStyle.html?x+("html="+this.currentEdgeStyle.html+";"):x+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var x=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=+x&&(new mxCodec(x.ownerDocument)).decode(x,this.getStylesheet())};Graph.prototype.createCellLookup=function(x,N){N=null!=N?N:{};for(var S=0;S<x.length;S++){var Y=x[S];N[mxObjectIdentity.get(Y)]=Y.getId();for(var ca=this.model.getChildCount(Y),ma=0;ma<ca;ma++)this.createCellLookup([this.model.getChildAt(Y,ma)],N)}return N};Graph.prototype.createCellMapping=function(x,N,S){S=null!=S?S:{};for(var Y in x){var ca=N[Y];null==S[ca]&&(S[ca]=x[Y].getId()||"")}return S};Graph.prototype.importGraphModel=function(x,+N,S,Y){N=null!=N?N:0;S=null!=S?S:0;var ca=new mxCodec(x.ownerDocument),ma=new mxGraphModel;ca.decode(x,ma);x=[];ca={};var qa={},wa=ma.getChildren(this.cloneCell(ma.root,this.isCloneInvalidEdges(),ca));if(null!=wa){var sa=this.createCellLookup([ma.root]);wa=wa.slice();this.model.beginUpdate();try{if(1!=wa.length||this.isCellLocked(this.getDefaultParent()))for(ma=0;ma<wa.length;ma++)ya=this.model.getChildren(this.moveCells([wa[ma]],N,S,!1,this.model.getRoot())[0]),null!=ya&&(x=x.concat(ya));else{var ya=+ma.getChildren(wa[0]);null!=ya&&(x=this.moveCells(ya,N,S,!1,this.getDefaultParent()),qa[ma.getChildAt(ma.root,0).getId()]=this.getDefaultParent().getId())}if(null!=x&&(this.createCellMapping(ca,sa,qa),this.updateCustomLinks(qa,x),Y)){this.isGridEnabled()&&(N=this.snap(N),S=this.snap(S));var Ga=this.getBoundingBoxFromGeometry(x,!0);null!=Ga&&this.moveCells(x,N-Ga.x,S-Ga.y)}}finally{this.model.endUpdate()}}return x};Graph.prototype.encodeCells=function(x){for(var N={},S=this.cloneCells(x,null,N),Y=+new mxDictionary,ca=0;ca<x.length;ca++)Y.put(x[ca],!0);var ma=new mxCodec,qa=new mxGraphModel,wa=qa.getChildAt(qa.getRoot(),0);for(ca=0;ca<S.length;ca++){qa.add(wa,S[ca]);var sa=this.view.getState(x[ca]);if(null!=sa){var ya=this.getCellGeometry(S[ca]);null!=ya&&ya.relative&&!this.model.isEdge(x[ca])&&null==Y.get(this.model.getParent(x[ca]))&&(ya.offset=null,ya.relative=!1,ya.x=sa.x/sa.view.scale-sa.view.translate.x,ya.y=sa.y/sa.view.scale-sa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(N,+this.createCellLookup(x)),S);return ma.encode(qa)};Graph.prototype.isSwimlane=function(x,N){var S=null;null==x||this.model.isEdge(x)||this.model.getParent(x)==this.model.getRoot()||(S=this.getCurrentCellStyle(x,N)[mxConstants.STYLE_SHAPE]);return S==mxConstants.SHAPE_SWIMLANE||"table"==S||"tableRow"==S};var G=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(x){return null!=x&&G.apply(this,arguments)?this.isTableCell(x)||this.isTableRow(x)?this.isCellEditable(this.model.getParent(x)):+!0:!1};var T=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(x){return null!=x&&T.apply(this,arguments)?this.isTableCell(x)||this.isTableRow(x)?this.isCellMovable(this.model.getParent(x)):!0:!1};var E=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(x){var N=this.model.getParent(x);if(null!=N){var S=this.getCurrentCellStyle(N);if(null!=S.expand)return"0"!=S.expand}return E.apply(this,arguments)&&(null==N||!this.isTable(N))};var P=Graph.prototype.splitEdge;+Graph.prototype.splitEdge=function(x,N,S,Y,ca,ma,qa,wa){null==wa&&(wa=this.model.getParent(x),this.isTable(wa)||this.isTableRow(wa))&&(wa=this.getCellAt(ma,qa,null,!0,!1));S=null;this.model.beginUpdate();try{var sa=this.getCellGeometry(x);if(null!=sa&&null!=sa.points&&0<sa.points.length&&1==N.length&&this.model.isVertex(N[0])){var ya=this.getCellGeometry(N[0]);if(null!=ya&&!ya.relative){var Ga=new mxRectangle(ya.x+Y,ya.y+ca,ya.width,ya.height),Ya=sa.points;ya=[];for(var Va=0;Va<Ya.length;Va++)Ga.intersectsPoint(Ya[Va].x,+Ya[Va].y)||ya.push(Ya[Va]);ya.length<Ya.length&&(sa=sa.clone(),sa.points=ya,this.model.setGeometry(x,sa))}}S=P.apply(this,[x,N,S,Y,ca,ma,qa,wa]);this.model.setValue(S,"");var eb=this.getChildCells(S,!0);for(Va=0;Va<eb.length;Va++)sa=this.getCellGeometry(eb[Va]),null!=sa&&sa.relative&&0<sa.x&&this.model.remove(eb[Va]);var ib=this.getChildCells(x,!0);for(Va=0;Va<ib.length;Va++)sa=this.getCellGeometry(ib[Va]),null!=sa&&sa.relative&&0>=sa.x&&this.model.remove(ib[Va]);var jb=this.model.getTerminal(S,!1);+if(null!=jb){var Ta=this.getCurrentCellStyle(jb);null!=Ta&&"1"==Ta.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[x]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[x]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[S]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[S]))}}finally{this.model.endUpdate()}return S};var L=Graph.prototype.selectCell;Graph.prototype.selectCell=function(x,N,S){if(N||S)L.apply(this,arguments);else{var Y=this.getSelectionCell(),ca=null,ma=[],qa=+mxUtils.bind(this,function(wa){if(null!=this.view.getState(wa)&&(this.model.isVertex(wa)||this.model.isEdge(wa)))if(ma.push(wa),wa==Y)ca=ma.length-1;else if(x&&null==Y&&0<ma.length||null!=ca&&x&&ma.length>ca||!x&&0<ca)return;for(var sa=0;sa<this.model.getChildCount(wa);sa++)qa(this.model.getChildAt(wa,sa))});qa(this.model.root);0<ma.length&&(ca=null!=ca?mxUtils.mod(ca+(x?1:-1),ma.length):0,this.setSelectionCell(ma[ca]))}};Graph.prototype.swapShapes=function(x,N){if(this.model.isVertex(x)&&this.model.isVertex(N)&&+2==this.getMovableCells([x,N]).length){var S=this.getCellGeometry(x),Y=this.getCellGeometry(N);if(null!=S&&null!=Y){var ca=S.clone(),ma=Y.clone();this.model.beginUpdate();try{ca.x=Y.getCenterX()-S.width/2,ca.y=Y.getCenterY()-S.height/2,ma.x=S.getCenterX()-Y.width/2,ma.y=S.getCenterY()-Y.height/2,this.model.setGeometry(x,ca),this.model.setGeometry(N,ma)}finally{this.model.endUpdate()}}}};var c=Graph.prototype.moveCells;Graph.prototype.moveCells=function(x,N,S,Y,ca,ma,qa){qa=null!=qa?qa:{};if(this.isTable(ca)){for(var wa=+[],sa=0;sa<x.length;sa++)this.isTable(x[sa])?wa=wa.concat(this.model.getChildCells(x[sa],!0).reverse()):wa.push(x[sa]);x=wa}this.model.beginUpdate();try{wa=[];for(sa=0;sa<x.length;sa++)if(null!=ca&&this.isTableRow(x[sa])){var ya=this.model.getParent(x[sa]),Ga=this.getCellGeometry(x[sa]);this.isTable(ya)&&wa.push(ya);if(null!=ya&&null!=Ga&&this.isTable(ya)&&this.isTable(ca)&&(Y||ya!=ca)){if(!Y){var Ya=this.getCellGeometry(ya);null!=Ya&&(Ya=Ya.clone(),Ya.height-=Ga.height,this.model.setGeometry(ya,+Ya))}Ya=this.getCellGeometry(ca);null!=Ya&&(Ya=Ya.clone(),Ya.height+=Ga.height,this.model.setGeometry(ca,Ya));var Va=this.model.getChildCells(ca,!0);if(0<Va.length){x[sa]=Y?this.cloneCell(x[sa]):x[sa];var eb=this.model.getChildCells(x[sa],!0),ib=this.model.getChildCells(Va[0],!0),jb=ib.length-eb.length;if(0<jb)for(var Ta=0;Ta<jb;Ta++){var qb=this.cloneCell(eb[eb.length-1]);null!=qb&&(qb.value="",this.model.add(x[sa],qb))}else if(0>jb)for(Ta=0;Ta>jb;Ta--)this.model.remove(eb[eb.length+Ta-1]);eb=this.model.getChildCells(x[sa],+!0);for(Ta=0;Ta<ib.length;Ta++){var hb=this.getCellGeometry(ib[Ta]),cb=this.getCellGeometry(eb[Ta]);null!=hb&&null!=cb&&(cb=cb.clone(),cb.width=hb.width,this.model.setGeometry(eb[Ta],cb))}}}}var fb=c.apply(this,arguments);for(sa=0;sa<wa.length;sa++)!Y&&this.model.contains(wa[sa])&&0==this.model.getChildCount(wa[sa])&&this.model.remove(wa[sa]);Y&&this.updateCustomLinks(this.createCellMapping(qa,this.createCellLookup(x)),fb)}finally{this.model.endUpdate()}return fb};var g=Graph.prototype.removeCells;+Graph.prototype.removeCells=function(x,N){var S=[];this.model.beginUpdate();try{for(var Y=0;Y<x.length;Y++)if(this.isTableCell(x[Y])){var ca=this.model.getParent(x[Y]),ma=this.model.getParent(ca);1==this.model.getChildCount(ca)&&1==this.model.getChildCount(ma)?0>mxUtils.indexOf(x,ma)&&0>mxUtils.indexOf(S,ma)&&S.push(ma):this.labelChanged(x[Y],"")}else{if(this.isTableRow(x[Y])&&(ma=this.model.getParent(x[Y]),0>mxUtils.indexOf(x,ma)&&0>mxUtils.indexOf(S,ma))){for(var qa=this.model.getChildCells(ma,+!0),wa=0,sa=0;sa<qa.length;sa++)0<=mxUtils.indexOf(x,qa[sa])&&wa++;wa==qa.length&&S.push(ma)}S.push(x[Y])}S=g.apply(this,[S,N])}finally{this.model.endUpdate()}return S};Graph.prototype.updateCustomLinks=function(x,N,S){S=null!=S?S:new Graph;for(var Y=0;Y<N.length;Y++)null!=N[Y]&&S.updateCustomLinksForCell(x,N[Y],S)};Graph.prototype.updateCustomLinksForCell=function(x,N){this.doUpdateCustomLinksForCell(x,N);for(var S=this.model.getChildCount(N),Y=0;Y<S;Y++)this.updateCustomLinksForCell(x,this.model.getChildAt(N,+Y))};Graph.prototype.doUpdateCustomLinksForCell=function(x,N){};Graph.prototype.getAllConnectionConstraints=function(x,N){if(null!=x){N=mxUtils.getValue(x.style,"points",null);if(null!=N){x=[];try{var S=JSON.parse(N);for(N=0;N<S.length;N++){var Y=S[N];x.push(new mxConnectionConstraint(new mxPoint(Y[0],Y[1]),2<Y.length?"0"!=Y[2]:!0,null,3<Y.length?Y[3]:0,4<Y.length?Y[4]:0))}}catch(ma){}return x}if(null!=x.shape&&null!=x.shape.bounds){Y=x.shape.direction;N=x.shape.bounds;var ca=x.shape.scale;S=N.width/+ca;N=N.height/ca;if(Y==mxConstants.DIRECTION_NORTH||Y==mxConstants.DIRECTION_SOUTH)Y=S,S=N,N=Y;N=x.shape.getConstraints(x.style,S,N);if(null!=N)return N;if(null!=x.shape.stencil&&null!=x.shape.stencil.constraints)return x.shape.stencil.constraints;if(null!=x.shape.constraints)return x.shape.constraints}}return null};Graph.prototype.flipEdge=function(x){if(null!=x){var N=this.getCurrentCellStyle(x);N=mxUtils.getValue(N,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?+mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,N,[x])}};Graph.prototype.isValidRoot=function(x){for(var N=this.model.getChildCount(x),S=0,Y=0;Y<N;Y++){var ca=this.model.getChildAt(x,Y);this.model.isVertex(ca)&&(ca=this.getCellGeometry(ca),null==ca||ca.relative||S++)}return 0<S||this.isContainer(x)};Graph.prototype.isValidDropTarget=function(x,N,S){for(var Y=this.getCurrentCellStyle(x),ca=!0,ma=!0,qa=0;qa<N.length&&ma;qa++)ca=ca&&this.isTable(N[qa]),+ma=ma&&this.isTableRow(N[qa]);return!this.isCellLocked(x)&&(this.isTargetShape(x,N,S)||("1"!=mxUtils.getValue(Y,"part","0")||this.isContainer(x))&&"0"!=mxUtils.getValue(Y,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(x))&&!this.isTableRow(x)&&(!this.isTable(x)||ma||ca))};Graph.prototype.createGroupCell=function(){var x=mxGraph.prototype.createGroupCell.apply(this,arguments);x.setStyle("group");return x};Graph.prototype.isExtendParentsOnAdd=function(x){var N=+mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(N&&null!=x&&null!=this.layoutManager){var S=this.model.getParent(x);null!=S&&(S=this.layoutManager.getLayout(S),null!=S&&S.constructor==mxStackLayout&&(N=!1))}return N};Graph.prototype.getPreferredSizeForCell=function(x,N,S){S=null!=S?S:this.gridEnabled;var Y=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=Y&&(Y.width+=10,Y.height+=4,S&&(Y.width=this.snap(Y.width),Y.height=this.snap(Y.height)));return Y};Graph.prototype.getAutosizeTextAvailableSpace=+function(x,N,S,Y){var ca=0,ma=0;(null!=Y&&null!=this.getImage(Y)||null!=x[mxConstants.STYLE_IMAGE])&&x[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(x[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),x[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(ma+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));ca+=2*parseFloat(mxUtils.getValue(x,+mxConstants.STYLE_SPACING,2));ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_LEFT,2));ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_RIGHT,2));ma+=2*parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING,2));ma+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_TOP,2));ma+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_BOTTOM,2));null!=Y&&(Y=this.getFoldingImage(Y),null!=Y&&(ca+=Y.width+8));x=mxUtils.getValue(x,mxConstants.STYLE_HORIZONTAL,!0);ca=(x?N:S)-+ca;N=(x?S:N)-ma;return 0>=ca||0>=N?null:{availW:ca,availH:N}};Graph.prototype.computeAutosizeTextFontSize=function(x,N,S,Y,ca,ma){var qa=1,wa=84,sa=ma?N:null,ya=null;if(ma){for(var Ga=x.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Ya=[],Va=0;Va<Ga.length;Va++)0<Ga[Va].length&&Ya.push(mxUtils.htmlEntities(Ga[Va],!1));0<Ya.length&&(ya=Ya.join("<br>"))}for(;qa<wa;)Ga=Math.ceil((qa+wa)/2),Ya=mxUtils.getSizeForString(x,Ga,Y,sa,ca),(Ya=ma?Ya.height<=S:Ya.width<=N&&Ya.height<=S)&&+ma&&null!=ya&&mxUtils.getSizeForString(ya,Ga,Y,null,ca).width>N&&(Ya=!1),Ya?qa=Ga:wa=Ga-1;return Math.max(6,qa)};Graph.prototype.updateAutosizeTextFontSize=function(x,N){var S=this.view.getState(x);null==S&&(S=this.view.createState(x));N=N||S.style;var Y=this.getCellGeometry(x);if(null!=Y&&!this.model.isEdge(x)){var ca=this.cellRenderer.getLabelValue(S);null!=ca&&0!=ca.length&&(S=this.getAutosizeTextAvailableSpace(N,Y.width,Y.height,S),null!=S&&(this.isHtmlLabel(x)||(ca=mxUtils.htmlEntities(ca,!1)),+ca=ca.replace(/\n/g,"<br>"),N=this.computeAutosizeTextFontSize(ca,S.availW,S.availH,N[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,N[mxConstants.STYLE_FONTSTYLE],"wrap"==N[mxConstants.STYLE_WHITE_SPACE]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,N,[x])))}};Graph.prototype.cellsResized=function(x,N,S){var Y=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=x)for(var ca=0;ca<x.length;ca++)this.model.isVertex(x[ca])&&this.isAutosizeTextCell(x[ca])&&this.updateAutosizeTextFontSize(x[ca]);+return Y};Graph.prototype.turnShapes=function(x,N){var S=this.getModel(),Y=[];S.beginUpdate();try{for(var ca=0;ca<x.length;ca++){var ma=x[ca];if(S.isEdge(ma)){var qa=S.getTerminal(ma,!0),wa=S.getTerminal(ma,!1);S.setTerminal(ma,wa,!0);S.setTerminal(ma,qa,!1);var sa=S.getGeometry(ma);if(null!=sa){sa=sa.clone();null!=sa.points&&sa.points.reverse();var ya=sa.getTerminalPoint(!0),Ga=sa.getTerminalPoint(!1);sa.setTerminalPoint(ya,!1);sa.setTerminalPoint(Ga,!0);S.setGeometry(ma,sa);var Ya=this.view.getState(ma),+Va=this.view.getState(qa),eb=this.view.getState(wa);if(null!=Ya){var ib=null!=Va?this.getConnectionConstraint(Ya,Va,!0):null,jb=null!=eb?this.getConnectionConstraint(Ya,eb,!1):null;this.setConnectionConstraint(ma,qa,!0,jb);this.setConnectionConstraint(ma,wa,!1,ib);var Ta=mxUtils.getValue(Ya.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Ya.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ma]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,+Ta,[ma])}Y.push(ma)}}else if(S.isVertex(ma)&&(sa=this.getCellGeometry(ma),null!=sa)){if(!(this.isTable(ma)||this.isTableRow(ma)||this.isTableCell(ma)||this.isSwimlane(ma))){sa=sa.clone();sa.x+=sa.width/2-sa.height/2;sa.y+=sa.height/2-sa.width/2;var qb=sa.width;sa.width=sa.height;sa.height=qb;S.setGeometry(ma,sa)}var hb=this.view.getState(ma);if(null!=hb){var cb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],fb=mxUtils.getValue(hb.style,+mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,cb[mxUtils.mod(mxUtils.indexOf(cb,fb)+(N?-1:1),cb.length)],[ma])}Y.push(ma)}}}finally{S.endUpdate()}return Y};Graph.prototype.stencilHasPlaceholders=function(x){if(null!=x&&null!=x.fgNode)for(x=x.fgNode.firstChild;null!=x;){if("text"==x.nodeName&&"1"==x.getAttribute("placeholders"))return!0;x=x.nextSibling}return!1};var l=Graph.prototype.processChange;Graph.prototype.processChange=function(x){if(x instanceof+mxGeometryChange&&(this.isTableCell(x.cell)||this.isTableRow(x.cell))&&(null==x.previous&&null!=x.geometry||null!=x.previous&&!x.previous.equals(x.geometry))){var N=x.cell;this.isTableCell(N)&&(N=this.model.getParent(N));this.isTableRow(N)&&(N=this.model.getParent(N));var S=this.view.getState(N);null!=S&&null!=S.shape&&(this.view.invalidate(N),S.shape.bounds=null)}l.apply(this,arguments);x instanceof mxValueChange&&null!=x.cell&&null!=x.cell.value&&"object"==typeof x.cell.value&&this.invalidateDescendantsWithPlaceholders(x.cell)};+Graph.prototype.invalidateDescendantsWithPlaceholders=function(x){x=this.model.getDescendants(x);if(0<x.length)for(var N=0;N<x.length;N++){var S=this.view.getState(x[N]);null!=S&&null!=S.shape&&null!=S.shape.stencil&&this.stencilHasPlaceholders(S.shape.stencil)?this.removeStateForCell(x[N]):this.isReplacePlaceholders(x[N])&&this.view.invalidate(x[N],!1,!1)}};Graph.prototype.replaceElement=function(x,N){N=x.ownerDocument.createElement(null!=N?N:"span");for(var S=Array.prototype.slice.call(x.attributes);attr=+S.pop();)N.setAttribute(attr.nodeName,attr.nodeValue);N.innerHTML=x.innerHTML;x.parentNode.replaceChild(N,x)};Graph.prototype.processElements=function(x,N){if(null!=x){x=x.getElementsByTagName("*");for(var S=0;S<x.length;S++)null!=x[S]&&N(x[S])}};Graph.prototype.updateLabelElements=function(x,N,S){x=null!=x?x:this.getSelectionCells();for(var Y=document.createElement("div"),ca=0;ca<x.length;ca++){var ma=this.getCurrentCellStyle(x[ca]);if(null!=ma&&"1"==ma.html&&(ma=this.convertValueToString(x[ca]),+null!=ma&&0<ma.length)){Y.innerHTML=Graph.sanitizeHtml(ma);for(var qa=Y.getElementsByTagName(null!=S?S:"*"),wa=0;wa<qa.length;wa++)N(qa[wa]);Y.innerHTML!=ma&&this.cellLabelChanged(x[ca],Y.innerHTML)}}};Graph.prototype.cellLabelChanged=function(x,N,S){N=Graph.zapGremlins(N);this.model.beginUpdate();try{if(null!=x.value&&"object"==typeof x.value){if(this.isReplacePlaceholders(x)&&null!=x.getAttribute("placeholder"))for(var Y=x.getAttribute("placeholder"),ca=x;null!=ca;){if(ca==this.model.getRoot()||+null!=ca.value&&"object"==typeof ca.value&&ca.hasAttribute(Y)){this.setAttributeForCell(ca,Y,N);break}ca=this.model.getParent(ca)}var ma=x.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&ma.hasAttribute("label_"+Graph.diagramLanguage)?ma.setAttribute("label_"+Graph.diagramLanguage,N):ma.setAttribute("label",N);N=ma}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(x)&&this.updateAutosizeTextFontSize(x)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=+function(x){if(null!=x){for(var N=new mxDictionary,S=0;S<x.length;S++)N.put(x[S],!0);var Y=[];for(S=0;S<x.length;S++){var ca=this.model.getParent(x[S]);null==ca||N.get(ca)||(N.put(ca,!0),Y.push(ca))}for(S=0;S<Y.length;S++)if(ca=this.view.getState(Y[S]),null!=ca&&(this.model.isEdge(ca.cell)||this.model.isVertex(ca.cell))&&this.isCellDeletable(ca.cell)&&this.isTransparentState(ca)){for(var ma=!0,qa=0;qa<this.model.getChildCount(ca.cell)&&ma;qa++)N.get(this.model.getChildAt(ca.cell,qa))||(ma=!1);ma&&+x.push(ca.cell)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(x){for(var N=[],S=0;S<x.length;S++)this.isCellDeletable(x[S])&&this.isTransparentState(this.view.getState(x[S]))&&N.push(x[S]);x=N;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(x,N){this.setAttributeForCell(x,"link",N)};Graph.prototype.createLinkOverlay=function(x){x=this.getLinkForCell(x);if(null!=x&&0<x.length){x=this.getLinkOverlayTooltip(x);+x=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),x,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));x.isLinkOverlay=!0;var N=this;x.addListener(mxEvent.CLICK,function(S,Y){N.setSelectionCell(Y.getProperty("cell"))});return x}return null};Graph.prototype.getLinkOverlayTooltip=function(x){return x};Graph.prototype.createTooltipOverlay=function(x){x=this.convertValueToTooltip(x);if(null!=x&&0<x.length){x=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),+x,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));x.isTooltipOverlay=!0;var N=this;x.addListener(mxEvent.CLICK,function(S,Y){S=Y.getProperty("cell");N.isEnabled()&&N.isCellEditable(S)?(N.setSelectionCell(S),N.editTooltip(S)):(Y=Y.getProperty("event"),S=N.getTooltipForCell(S),null!=S&&0<S.length&&N.tooltipHandler.show(S,Y.clientX,Y.clientY))});return x}return null};Graph.prototype.editTooltip=function(x){};Graph.prototype.setTooltipForCell=function(x,N){var S="tooltip";Graph.translateDiagram&&+null!=Graph.diagramLanguage&&mxUtils.isNode(x.value)&&x.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(S="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(x,S,N)};Graph.prototype.getAttributeForCell=function(x,N,S){x=null!=x.value&&"object"===typeof x.value?x.value.getAttribute(N):null;return null!=x?x:S};Graph.prototype.setAttributeForCell=function(x,N,S){if(null!=x.value&&"object"==typeof x.value)var Y=x.value.cloneNode(!0);else Y=mxUtils.createXmlDocument().createElement("UserObject"),+Y.setAttribute("label",x.value||"");null!=S?Y.setAttribute(N,S):Y.removeAttribute(N);this.model.setValue(x,Y)};Graph.prototype.isTargetShape=function(x,N,S){x=mxUtils.getValue(this.getCurrentCellStyle(x),mxConstants.STYLE_SHAPE,"");for(S=0;S<N.length;S++){var Y=mxUtils.getValue(this.getCurrentCellStyle(N[S]),"targetShapes","").split(",");if(0<=mxUtils.indexOf(Y,x))return!0}return!1};var t=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(x,N,S,Y){if(mxEvent.isAltDown(N))return null;+for(var ca=0;ca<x.length;ca++){var ma=this.model.getParent(x[ca]);if(this.model.isEdge(ma)&&0>mxUtils.indexOf(x,ma))return null}ma=t.apply(this,arguments);var qa=!0;for(ca=0;ca<x.length&&qa;ca++)qa=qa&&this.isTableRow(x[ca]);qa&&(this.isTableCell(ma)&&(ma=this.model.getParent(ma)),this.isTableRow(ma)&&(ma=this.model.getParent(ma)),this.isTable(ma)||(ma=null));return ma};Graph.prototype.click=function(x){mxGraph.prototype.click.call(this,x);this.firstClickState=x.getState();this.firstClickSource=x.getSource()};+Graph.prototype.dblClick=function(x,N){this.isEnabled()&&(N=this.insertTextForEvent(x,N),mxGraph.prototype.dblClick.call(this,x,N))};Graph.prototype.insertTextForEvent=function(x,N){var S=mxUtils.convertPoint(this.container,mxEvent.getClientX(x),mxEvent.getClientY(x));if(null!=x&&!this.model.isVertex(N)){var Y=this.model.isEdge(N)?this.view.getState(N):null,ca=mxEvent.getSource(x);this.firstClickState!=Y||this.firstClickSource!=ca||null!=Y&&null!=Y.text&&null!=Y.text.node&&null!=Y.text.boundingBox&&+(mxUtils.contains(Y.text.boundingBox,S.x,S.y)||mxUtils.isAncestorNode(Y.text.node,mxEvent.getSource(x)))||(null!=Y||this.isCellLocked(this.getDefaultParent()))&&(null==Y||this.isCellLocked(Y.cell))||!(null!=Y||mxClient.IS_SVG&&ca==this.view.getCanvas().ownerSVGElement)||(null==Y&&(Y=this.view.getState(this.getCellAt(S.x,S.y))),N=this.addText(S.x,S.y,Y))}return N};Graph.prototype.getInsertPoint=function(x){x=this.getGridSize();var N=this.container.scrollLeft/this.view.scale-this.view.translate.x,S=+this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var Y=this.getPageLayout(),ca=this.getPageSize();N=Math.max(N,Y.x*ca.width);S=Math.max(S,Y.y*ca.height)}return new mxPoint(this.snap(N+x),this.snap(S+x))};Graph.prototype.getFreeInsertPoint=function(x){var N=this.view,S=this.getGraphBounds(),Y=this.getInsertPoint(x);x=this.snap(Math.round(Math.max(Y.x,S.x/N.scale-N.translate.x+(0==S.width?2*this.gridSize:0))));N=this.snap(Math.round(Math.max(Y.y,(S.y+S.height)/N.scale-+N.translate.y+2*this.gridSize)));return new mxPoint(x,N)};Graph.prototype.getCenterInsertPoint=function(x){x=null!=x?x:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-x.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale-this.view.translate.y-x.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/+2/this.view.scale-this.view.translate.x-x.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-x.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(x,N){x=null!=x?x:"";null!=N&&(0<x.length&&";"!=x.charAt(x.length-1)&&(x+=";"),x+="fontSize="+N+";");return x};Graph.prototype.addText=function(x,N,S){var Y=new mxCell;Y.value="Text";Y.geometry=new mxGeometry(0,0,0,0);Y.vertex=!0;if(null!=S&&this.model.isEdge(S.cell)){Y.style=+"edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);Y.geometry.relative=!0;Y.connectable=!1;var ca=this.view.getRelativePoint(S,x,N);Y.geometry.x=Math.round(1E4*ca.x)/1E4;Y.geometry.y=Math.round(ca.y);Y.geometry.offset=new mxPoint(0,0);ca=this.view.getPoint(S,Y.geometry);var ma=this.view.scale;Y.geometry.offset=new mxPoint(Math.round((x-ca.x)/ma),Math.round((N-ca.y)/ma))}else ca=this.view.translate,Y.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",+this.vertexFontSize),Y.geometry.width=40,Y.geometry.height=20,Y.geometry.x=Math.round(x/this.view.scale)-ca.x-(null!=S?S.origin.x:0),Y.geometry.y=Math.round(N/this.view.scale)-ca.y-(null!=S?S.origin.y:0),Y.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([Y],null!=S?S.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[Y])),this.autoSizeCell(Y)}finally{this.getModel().endUpdate()}return Y};Graph.prototype.addClickHandler=function(x,N,S){var Y=mxUtils.bind(this,+function(){var sa=this.container.getElementsByTagName("a");if(null!=sa)for(var ya=0;ya<sa.length;ya++){var Ga=this.getAbsoluteUrl(sa[ya].getAttribute("href"));null!=Ga&&(sa[ya].setAttribute("rel",this.linkRelation),sa[ya].setAttribute("href",Ga),null!=N&&mxEvent.addGestureListeners(sa[ya],null,null,N))}});this.model.addListener(mxEvent.CHANGE,Y);Y();var ca=this.container.style.cursor,ma=this.getTolerance(),qa=this,wa={currentState:null,currentLink:null,currentTarget:null,highlight:null!=x&&""!=x&&+x!=mxConstants.NONE?new mxCellHighlight(qa,x,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(sa){var ya=sa.sourceState;if(null==ya||null==qa.getLinkForCell(ya.cell))sa=qa.getCellAt(sa.getGraphX(),sa.getGraphY(),null,null,null,function(Ga,Ya,Va){return null==qa.getLinkForCell(Ga.cell)}),ya=null==ya||qa.model.isAncestor(sa,ya.cell)?qa.view.getState(sa):null;ya!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=ya,null!=this.currentState&&this.activate(this.currentState))},+mouseDown:function(sa,ya){this.startX=ya.getGraphX();this.startY=ya.getGraphY();this.scrollLeft=qa.container.scrollLeft;this.scrollTop=qa.container.scrollTop;null==this.currentLink&&"auto"==qa.container.style.overflow&&(qa.container.style.cursor="move");this.updateCurrentState(ya)},mouseMove:function(sa,ya){if(qa.isMouseDown)null!=this.currentLink&&(sa=Math.abs(this.startX-ya.getGraphX()),ya=Math.abs(this.startY-ya.getGraphY()),(sa>ma||ya>ma)&&this.clear());else{for(sa=ya.getSource();null!=sa&&"a"!=+sa.nodeName.toLowerCase();)sa=sa.parentNode;null!=sa?this.clear():(null!=qa.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&qa.tooltipHandler.reset(ya,!0,this.currentState),(null==this.currentState||ya.getState()!=this.currentState&&null!=ya.sourceState||!qa.intersects(this.currentState,ya.getGraphX(),ya.getGraphY()))&&this.updateCurrentState(ya))}},mouseUp:function(sa,ya){var Ga=ya.getSource();for(sa=ya.getEvent();null!=Ga&&"a"!=Ga.nodeName.toLowerCase();)Ga=Ga.parentNode;null==+Ga&&Math.abs(this.scrollLeft-qa.container.scrollLeft)<ma&&Math.abs(this.scrollTop-qa.container.scrollTop)<ma&&(null==ya.sourceState||!ya.isSource(ya.sourceState.control))&&((mxEvent.isLeftMouseButton(sa)||mxEvent.isMiddleMouseButton(sa))&&!mxEvent.isPopupTrigger(sa)||mxEvent.isTouchEvent(sa))&&(null!=this.currentLink?(Ga=qa.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&Ga||null==N||N(sa,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(sa)||+(sa=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(sa)?"_blank":Ga?qa.linkTarget:"_top",qa.openLink(this.currentLink,sa),ya.consume())):null!=S&&!ya.isConsumed()&&Math.abs(this.scrollLeft-qa.container.scrollLeft)<ma&&Math.abs(this.scrollTop-qa.container.scrollTop)<ma&&Math.abs(this.startX-ya.getGraphX())<ma&&Math.abs(this.startY-ya.getGraphY())<ma&&S(ya.getEvent()));this.clear()},activate:function(sa){this.currentLink=qa.getAbsoluteUrl(qa.getLinkForCell(sa.cell));null!=this.currentLink&&+(this.currentTarget=qa.getLinkTargetForCell(sa.cell),qa.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(sa))},clear:function(){null!=qa.container&&(qa.container.style.cursor=ca);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=qa.tooltipHandler&&qa.tooltipHandler.hide()}};qa.click=function(sa){};qa.addMouseListener(wa);mxEvent.addListener(document,"mouseleave",function(sa){wa.clear()})};Graph.prototype.duplicateCells=+function(x,N){x=null!=x?x:this.getSelectionCells();N=null!=N?N:!0;for(var S=0;S<x.length;S++)this.isTableCell(x[S])&&(x[S]=this.model.getParent(x[S]));x=this.model.getTopmostCells(x);var Y=this.getModel(),ca=this.gridSize,ma=[];Y.beginUpdate();try{var qa={},wa=this.createCellLookup(x),sa=this.cloneCells(x,!1,qa,!0);for(S=0;S<x.length;S++){var ya=Y.getParent(x[S]);if(null!=ya){var Ga=this.moveCells([sa[S]],ca,ca,!1)[0];ma.push(Ga);if(N)Y.add(ya,sa[S]);else{var Ya=ya.getIndex(x[S]);Y.add(ya,sa[S],Ya++1)}if(this.isTable(ya)){var Va=this.getCellGeometry(sa[S]),eb=this.getCellGeometry(ya);null!=Va&&null!=eb&&(eb=eb.clone(),eb.height+=Va.height,Y.setGeometry(ya,eb))}}else ma.push(sa[S])}this.updateCustomLinks(this.createCellMapping(qa,wa),sa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",sa))}finally{Y.endUpdate()}return ma};Graph.prototype.insertImage=function(x,N,S){if(null!=x&&null!=this.cellEditor.textarea){for(var Y=this.cellEditor.textarea.getElementsByTagName("img"),ca=+[],ma=0;ma<Y.length;ma++)ca.push(Y[ma]);document.execCommand("insertimage",!1,x);x=this.cellEditor.textarea.getElementsByTagName("img");if(x.length==ca.length+1)for(ma=x.length-1;0<=ma;ma--)if(0==ma||x[ma]!=ca[ma-1]){x[ma].setAttribute("width",N);x[ma].setAttribute("height",S);break}}};Graph.prototype.insertLink=function(x){if(null!=this.cellEditor.textarea)if(0==x.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var N=this.cellEditor.textarea.getElementsByTagName("a"),S=[],Y=+0;Y<N.length;Y++)S.push(N[Y]);document.execCommand("createlink",!1,mxUtils.trim(x));N=this.cellEditor.textarea.getElementsByTagName("a");if(N.length==S.length+1)for(Y=N.length-1;0<=Y;Y--)if(N[Y]!=S[Y-1]){for(N=N[Y].getElementsByTagName("a");0<N.length;){for(S=N[0].parentNode;null!=N[0].firstChild;)S.insertBefore(N[0].firstChild,N[0]);S.removeChild(N[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(x))};Graph.prototype.isCellResizable=function(x){var N=mxGraph.prototype.isCellResizable.apply(this,+arguments),S=this.getCurrentCellStyle(x);return!this.isTableCell(x)&&!this.isTableRow(x)&&(N||"0"!=mxUtils.getValue(S,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==S[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(x,N,S){null==N&&(N=this.getSelectionCells());if(null!=N&&1<N.length){for(var Y=[],ca=null,ma=null,qa=0,wa=0;wa<N.length;wa++)if(this.getModel().isVertex(N[wa])){var sa=this.view.getState(N[wa]);if(null!=sa){var ya=x?sa.getCenterX():sa.getCenterY();ca=null!=ca?Math.max(ca,+ya):ya;ma=null!=ma?Math.min(ma,ya):ya;S&&(qa+=x?sa.width:sa.height);Y.push(sa)}}if(2<Y.length){Y.sort(function(ib,jb){return x?ib.x-jb.x:ib.y-jb.y});S&&(qa-=x?Y[0].width/2+Y[Y.length-1].width/2:Y[0].height/2+Y[Y.length-1].height/2);sa=this.view.translate;ya=this.view.scale;ma=ma/ya-(x?sa.x:sa.y);ca=ca/ya-(x?sa.x:sa.y);this.getModel().beginUpdate();try{var Ga=(ca-ma-qa)/(Y.length-1),Ya=ma+(S?x?Y[0].width/2:Y[0].height/2:0);for(wa=1;wa<Y.length-1;wa++){var Va=this.view.getState(this.model.getParent(Y[wa].cell)),+eb=this.getCellGeometry(Y[wa].cell);Ya+=Ga;null!=eb&&null!=Va&&(eb=eb.clone(),x?eb.x=Math.round(Ya-(S?0:eb.width/2))-Va.origin.x:eb.y=Math.round(Ya-(S?0:eb.height/2))-Va.origin.y,this.getModel().setGeometry(Y[wa].cell,eb));S&&(Ya+=x?Y[wa].width:Y[wa].height)}}finally{this.getModel().endUpdate()}}}return N};Graph.prototype.isCloneEvent=function(x){return mxClient.IS_MAC&&mxEvent.isMetaDown(x)||mxEvent.isControlDown(x)};Graph.prototype.createSvgImageExport=function(x){x=new mxImageExport;x.addCellData=+function(S,Y,ca){Y.setAttribute("data-cell-id",S.id);if(ca)if(mxUtils.isNode(S.value))for(ca=0;ca<S.value.attributes.length;ca++){var ma=S.value.attributes[ca];Y.setAttribute("data-cell-"+ma.name,ma.value)}else if("object"===typeof S.value)for(ma in S.value)Y.setAttribute("data-cell-"+ma,S.value[ma]);else null!=S.value&&Y.setAttribute("data-cell-value",S.value);return Y};var N=x.visitStatesRecursive;x.visitStatesRecursive=function(S,Y,ca){if(null!=S){var ma=Y.root,qa=Y.root.ownerDocument;Y.root=this.addCellData(S.cell,+null!=qa.createElementNS?qa.createElementNS(mxConstants.NS_SVG,"g"):qa.createElement("g"),Editor.addSvgMetadata);ma.appendChild(Y.root);N.apply(this,arguments);Y.root=ma}};x.getLinkForCellState=mxUtils.bind(this,function(S,Y){return this.getLinkForCell(S.cell)});x.getTitleForCellState=mxUtils.bind(this,function(S,Y){return Editor.convertHtmlToText(this.convertValueToTooltip(S.cell))});return x};Graph.prototype.parseBackgroundImage=function(x){var N=null;null!=x&&0<x.length&&(x=JSON.parse(x),N=new mxImage(x.src,+x.width,x.height));return N};Graph.prototype.getBackgroundImageObject=function(x){return x};Graph.prototype.getSvg=function(x,N,S,Y,ca,ma,qa,wa,sa,ya,Ga,Ya,Va,eb,ib,jb){var Ta=null;if(null!=eb)for(Ta=new mxDictionary,ca=0;ca<eb.length;ca++)Ta.put(eb[ca],!0);eb=this.useCssTransforms;var qb=this.enableFlowAnimation;this.enableFlowAnimation=!1;eb&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{N=null!=N?N:1;S=null!=S?S:0;ma=null!=ma?ma:!0;qa=null!=qa?qa:!0;ya=null!=ya?ya:+!1;sa=null!=sa?sa:this.defaultExportLinkTarget;var hb="page"==Va?this.view.getBackgroundPageBounds():ma&&null==Ta||Y||"diagram"==Va?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),cb=this.backgroundImage,fb=this.view.translate,lb=this.view.scale;"diagram"==Va&&null!=cb&&null!=cb.width&&null!=cb.height&&(hb=mxRectangle.fromRectangle(hb),hb.add(new mxRectangle((fb.x+cb.x)*lb,(fb.y+cb.y)*lb,cb.width*lb,cb.height*lb)));if(null==hb)throw Error(mxResources.get("drawingEmpty"));Y=N/lb;+var ub=Math.max(1,Math.ceil(hb.width*Y)+2*S)+(ya&&0==S?5:0),ob=Math.max(1,Math.ceil(hb.height*Y)+2*S)+(ya&&0==S?5:0),pb=mxUtils.getLightDarkColor(x),sb=Graph.createSvgNode(0,0,ub,ob,pb),rb=sb.ownerDocument;if(null!=x){var tb=mxUtils.createElementNs(rb,mxConstants.NS_SVG,"rect");tb.setAttribute("fill",pb.light);tb.style.fill=pb.cssText;tb.setAttribute("width","100%");tb.setAttribute("height","100%");tb.setAttribute("x","0");tb.setAttribute("y","0");sb.appendChild(tb)}var yb=mxUtils.createElementNs(rb,+mxConstants.NS_SVG,"g");sb.appendChild(yb);var vb=this.createSvgCanvas(yb);vb.translate(Math.floor(S/N-hb.x/lb),Math.floor(S/N-hb.y/lb));vb.idPrefix="drawio-svg-"+Editor.guid();var Fb=document.createElement("div"),zb=vb.getAlternateText;vb.getAlternateText=function(nb,Ab,wb,f,q,z,u,A,F,H,ha,O,va){if(null!=z&&0<this.state.fontSize)try{mxUtils.isNode(z)?z=z.innerText:(Fb.innerHTML=z,z=mxUtils.extractTextWithWhitespace(Fb.childNodes));for(var oa=Math.ceil(2*f/this.state.fontSize),Xa=[],kb=0,gb=0;(0==+oa||kb<oa)&&gb<z.length;){var Ea=z.charCodeAt(gb);if(10==Ea||13==Ea){if(0<kb)break}else Xa.push(z.charAt(gb)),255>Ea&&kb++;gb++}Xa.length<z.length&&1<z.length-Xa.length&&(z=mxUtils.trim(Xa.join(""))+"...");return z}catch(Ka){return zb.apply(this,arguments)}else return zb.apply(this,arguments)};if(null!=cb&&null!=cb.width&&null!=cb.height){x=lb/N;var xb=new mxRectangle((cb.x+fb.x)*x,(cb.y+fb.y)*x,cb.width*x,cb.height*x);mxUtils.intersects(hb,xb)&&vb.image(cb.x+fb.x,cb.y+fb.y,cb.width,cb.height,cb.src,+!0)}vb.scale(Y);vb.textEnabled=qa;wa=null!=wa?wa:this.createSvgImageExport();var mb=wa.getLinkForCellState;wa.getLinkForCellState=function(nb,Ab){var wb=nb.view.graph.getAbsoluteUrl(mb.apply(this,arguments));return null==wb||nb.view.graph.isCustomLink(wb)?null:wb};wa.getLinkTargetForCellState=function(nb,Ab){return nb.view.graph.getLinkTargetForCell(nb.cell)};var Bb=wa.drawCellState,Cb=null,Db=mxUtils.bind(this,function(){if(null==Cb){Cb="ge-flow-animation-"+Editor.guid();var nb=null!=rb.createElementNS?rb.createElementNS(mxConstants.NS_SVG,"style"):rb.createElement("style");nb.innerHTML=this.createFlowAnimationCss(Cb);rb.getElementsByTagName("defs")[0].appendChild(nb)}return Cb});wa.drawCellState=function(nb,Ab){for(var wb=nb.view.graph,f=null!=Ta?Ta.get(nb.cell):wb.isCellSelected(nb.cell),q=wb.model.getParent(nb.cell);!(ma&&null==Ta||f)&&null!=q;)f=null!=Ta?Ta.get(q):wb.isCellSelected(q),q=wb.model.getParent(q);if(null!=nb.shape)try{var z=nb.shape.isFlowAnimationEnabled,u=nb.shape.addFlowAnimationToShape;-nb.shape.isFlowAnimationEnabled=function(){return qb&&wb.model.isEdge(nb.cell)&&"1"==mxUtils.getValue(nb.style,"flowAnimation","0")};nb.shape.addFlowAnimationToShape=function(){wb.addFlowAnimationToNode(this.getFlowAnimationPath(),nb.style,P,Db())};if(ma&&null==Ta||f)wb.view.redrawEnumerationState(nb),Bb.apply(this,arguments),this.doDrawShape(nb.secondLabel,Ab)}finally{nb.shape.isFlowAnimationEnabled=z,nb.shape.addFlowAnimationToShape=u}};var Eb=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;-wa.drawState(this.getView().getState(Eb),vb);this.addForeignObjectWarning(vb,sb);jb?this.disableSvgLinks(sb):this.updateSvgLinks(sb,sa,!0);return sb}finally{this.enableFlowAnimation=qb,cb&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(y,P){if("0"!=urlParams["svg-warning"]&&0<P.getElementsByTagName("foreignObject").length){var S=y.createElement("switch"),X=y.createElement("g");X.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");-var ba=y.createElement("a");ba.setAttribute("transform","translate(0,-5)");null==ba.setAttributeNS||P.ownerDocument!=document&&null==document.documentMode?(ba.setAttribute("xlink:href",Graph.foreignObjectWarningLink),ba.setAttribute("target","_blank")):(ba.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),ba.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));y=y.createElement("text");y.setAttribute("text-anchor","middle");y.setAttribute("font-size","10px");y.setAttribute("x",-"50%");y.setAttribute("y","100%");mxUtils.write(y,Graph.foreignObjectWarningText);S.appendChild(X);ba.appendChild(y);S.appendChild(ba);P.appendChild(S)}};Graph.prototype.disableSvgLinks=function(y,P){y=y.getElementsByTagName("a");for(var S=0;S<y.length;S++){var X=y[S].getAttribute("href");null==X&&(X=y[S].getAttribute("xlink:href"));null!=X&&(y[S].style.pointerEvents="none",y[S].setAttribute("href",""));P&&P(y[S])}};Graph.prototype.updateSvgLinks=function(y,P,S){y=y.getElementsByTagName("a");for(var X=-0;X<y.length;X++)if(null==y[X].getAttribute("target")){var ba=y[X].getAttribute("href");null==ba&&(ba=y[X].getAttribute("xlink:href"));null!=ba&&(null!=P&&/^https?:\/\//.test(ba)?y[X].setAttribute("target",P):S&&this.isCustomLink(ba)&&y[X].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(y){y=new mxSvgCanvas2D(y);y.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;y.adaptiveColors=this.getAdaptiveColors();y.pointerEvents=!0;return y};Graph.prototype.getSelectedElement=-function(){var y=null;if(window.getSelection){var P=window.getSelection();P.getRangeAt&&P.rangeCount&&(y=P.getRangeAt(0).commonAncestorContainer)}else document.selection&&(y=document.selection.createRange().parentElement());return y};Graph.prototype.getSelectedEditingElement=function(){var y=null;if(null!=this.cellEditor.textarea)for(y=this.getSelectedElement();null!=y&&y.nodeType!=mxConstants.NODETYPE_ELEMENT;)y=y.parentNode;return y};Graph.prototype.getParentByName=function(y,P,S){for(;null!=y&&-y.nodeName!=P;){if(y==S)return null;y=y.parentNode}return y};Graph.prototype.getParentByNames=function(y,P,S){for(;null!=y&&!(0<=mxUtils.indexOf(P,y.nodeName));){if(y==S)return null;y=y.parentNode}return y};Graph.prototype.selectNode=function(y){var P=null;if(window.getSelection){if(P=window.getSelection(),P.getRangeAt&&P.rangeCount){var S=document.createRange();S.selectNode(y);P.removeAllRanges();P.addRange(S)}}else(P=document.selection)&&"Control"!=P.type&&(y=P.createRange(),y.collapse(!0),S=P.createRange(),-S.setEndPoint("StartToStart",y),S.select())};Graph.prototype.flipEdgePoints=function(y,P,S){var X=this.getCellGeometry(y);if(null!=X){X=X.clone();if(null!=X.points)for(var ba=0;ba<X.points.length;ba++)P?X.points[ba].x=S+(S-X.points[ba].x):X.points[ba].y=S+(S-X.points[ba].y);ba=function(ma){null!=ma&&(P?ma.x=S+(S-ma.x):ma.y=S+(S-ma.y))};ba(X.getTerminalPoint(!0));ba(X.getTerminalPoint(!1));this.model.setGeometry(y,X)}};Graph.prototype.flipChildren=function(y,P,S){this.model.beginUpdate();try{for(var X=-this.model.getChildCount(y),ba=0;ba<X;ba++){var ma=this.model.getChildAt(y,ba);if(this.model.isEdge(ma))this.flipEdgePoints(ma,P,S);else{var ra=this.getCellGeometry(ma);null!=ra&&(ra=ra.clone(),P?ra.x=S+(S-ra.x-ra.width):ra.y=S+(S-ra.y-ra.height),this.model.setGeometry(ma,ra))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(y,P,S){return null!=y&&1==mxUtils.getValue(y.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(y,P,S):mxGraph.prototype.getConnectionPoint.apply(this,-arguments)};Graph.prototype.getLegacyConnectionPoint=function(y,P,S){S=null!=S?S:!0;var X=null;if(null!=y&&null!=P.point){var ba=this.view.getPerimeterBounds(y),ma=new mxPoint(ba.getCenterX(),ba.getCenterY()),ra=y.style[mxConstants.STYLE_DIRECTION],wa=0;null!=ra&&1==mxUtils.getValue(y.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(ra==mxConstants.DIRECTION_NORTH?wa+=270:ra==mxConstants.DIRECTION_WEST?wa+=180:ra==mxConstants.DIRECTION_SOUTH&&(wa+=90),ra!=mxConstants.DIRECTION_NORTH&&ra!=mxConstants.DIRECTION_SOUTH||-ba.rotate90());X=this.view.scale;X=new mxPoint(ba.x+P.point.x*ba.width+P.dx*X,ba.y+P.point.y*ba.height+P.dy*X);var sa=y.style[mxConstants.STYLE_ROTATION]||0;if(P.perimeter)0!=wa&&(ra=ba=0,90==wa?ra=1:180==wa?ba=-1:270==wa&&(ra=-1),X=mxUtils.getRotatedPoint(X,ba,ra,ma)),X=this.view.getPerimeterPoint(y,X,!1);else if(sa+=wa,this.getModel().isVertex(y.cell)){wa=1==y.style[mxConstants.STYLE_FLIPH];P=1==y.style[mxConstants.STYLE_FLIPV];null!=y.shape&&null!=y.shape.stencil&&(wa=1==mxUtils.getValue(y.style,-"stencilFlipH",0)||wa,P=1==mxUtils.getValue(y.style,"stencilFlipV",0)||P);if(ra==mxConstants.DIRECTION_NORTH||ra==mxConstants.DIRECTION_SOUTH)y=wa,wa=P,P=y;wa&&(X.x=2*ba.getCenterX()-X.x);P&&(X.y=2*ba.getCenterY()-X.y)}0!=sa&&null!=X&&(y=mxUtils.toRadians(sa),ba=Math.cos(y),ra=Math.sin(y),X=mxUtils.getRotatedPoint(X,ba,ra,ma))}S&&null!=X&&(X.x=Math.round(X.x),X.y=Math.round(X.y));return X};Graph.prototype.flipCells=function(y,P){this.model.beginUpdate();try{y=this.model.getTopmostCells(y);for(var S=-[],X=0;X<y.length;X++)if(this.model.isEdge(y[X])){var ba=this.view.getState(y[X]);null!=ba&&this.flipEdgePoints(y[X],P,(P?ba.getCenterX():ba.getCenterY())/this.view.scale-(P?ba.origin.x:ba.origin.y)-(P?this.view.translate.x:this.view.translate.y))}else{var ma=this.getCellGeometry(y[X]);null!=ma&&this.flipChildren(y[X],P,P?ma.getCenterX()-ma.x:ma.getCenterY()-ma.y);S.push(y[X])}this.toggleCellStyles(P?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,S);this.setCellStyles("legacyAnchorPoints","0",-S)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(y,P){var S=null;if(null!=y&&0<y.length){this.model.beginUpdate();try{for(var X=0;X<y.length;X++){var ba=this.model.getParent(y[X]);if(this.isTable(ba)){var ma=this.getCellGeometry(y[X]),ra=this.getCellGeometry(ba);null!=ma&&null!=ra&&(ra=ra.clone(),ra.height-=ma.height,this.model.setGeometry(ba,ra))}}var wa=this.selectParentAfterDelete?this.model.getParents(y):null;this.removeCells(y,P)}finally{this.model.endUpdate()}if(null!=-wa)for(S=[],X=0;X<wa.length;X++)this.model.contains(wa[X])&&(this.model.isVertex(wa[X])||this.model.isEdge(wa[X]))&&S.push(wa[X])}return S};Graph.prototype.insertTableColumn=function(y,P){var S=this.getModel();S.beginUpdate();try{var X=y,ba=0;if(this.isTableCell(y)){var ma=S.getParent(y);X=S.getParent(ma);ba=mxUtils.indexOf(S.getChildCells(ma,!0),y)}else this.isTableRow(y)?X=S.getParent(y):y=S.getChildCells(X,!0)[0],P||(ba=S.getChildCells(y,!0).length-1);var ra=S.getChildCells(X,!0),wa=Graph.minTableColumnWidth;-for(y=0;y<ra.length;y++){var sa=S.getChildCells(ra[y],!0)[ba],xa=S.cloneCell(sa,!1);null==xa&&(xa=this.createVertex());var Fa=this.getCellGeometry(xa);xa.value=null;xa.style=mxUtils.setStyle(mxUtils.setStyle(xa.style,"rowspan",null),"colspan",null);if(null!=Fa){null!=Fa.alternateBounds&&(Fa.width=Fa.alternateBounds.width,Fa.height=Fa.alternateBounds.height,Fa.alternateBounds=null);wa=Fa.width;var Ya=this.getCellGeometry(ra[y]);null!=Ya&&(Fa.height=Ya.height)}S.add(ra[y],xa,ba+(P?0:1))}var Ua=this.getCellGeometry(X);-null!=Ua&&(Ua=Ua.clone(),Ua.width+=wa,S.setGeometry(X,Ua))}finally{S.endUpdate()}};Graph.prototype.deleteLane=function(y){var P=this.getModel();P.beginUpdate();try{var S=null;S="stackLayout"==this.getCurrentCellStyle(y).childLayout?y:P.getParent(y);var X=P.getChildCells(S,!0);0==X.length?P.remove(S):(S==y&&(y=X[X.length-1]),P.remove(y))}finally{P.endUpdate()}};Graph.prototype.insertLane=function(y,P){var S=this.getModel();S.beginUpdate();try{var X=null;if("stackLayout"==this.getCurrentCellStyle(y).childLayout){X=-y;var ba=S.getChildCells(X,!0);y=ba[P?0:ba.length-1]}else X=S.getParent(y);var ma=X.getIndex(y);y=S.cloneCell(y,!1);y.value=null;S.add(X,y,ma+(P?0:1))}finally{S.endUpdate()}};Graph.prototype.insertTableRow=function(y,P){var S=this.getModel();S.beginUpdate();try{var X=y,ba=y;if(this.isTableCell(y))ba=S.getParent(y),X=S.getParent(ba);else if(this.isTableRow(y))X=S.getParent(y);else{var ma=S.getChildCells(X,!0);ba=ma[P?0:ma.length-1]}var ra=S.getChildCells(ba,!0),wa=X.getIndex(ba);ba=S.cloneCell(ba,-!1);ba.value=null;var sa=this.getCellGeometry(ba);if(null!=sa){for(ma=0;ma<ra.length;ma++){y=S.cloneCell(ra[ma],!1);y.value=null;y.style=mxUtils.setStyle(mxUtils.setStyle(y.style,"rowspan",null),"colspan",null);var xa=this.getCellGeometry(y);null!=xa&&(null!=xa.alternateBounds&&(xa.width=xa.alternateBounds.width,xa.height=xa.alternateBounds.height,xa.alternateBounds=null),xa.height=sa.height);ba.insert(y)}S.add(X,ba,wa+(P?0:1));var Fa=this.getCellGeometry(X);null!=Fa&&(Fa=Fa.clone(),Fa.height+=sa.height,-S.setGeometry(X,Fa))}}finally{S.endUpdate()}};Graph.prototype.deleteTableColumn=function(y){var P=this.getModel();P.beginUpdate();try{var S=y,X=y;this.isTableCell(y)&&(X=P.getParent(y));this.isTableRow(X)&&(S=P.getParent(X));var ba=P.getChildCells(S,!0);if(0==ba.length)P.remove(S);else{this.isTableRow(X)||(X=ba[0]);var ma=P.getChildCells(X,!0);if(1>=ma.length)P.remove(S);else{var ra=ma.length-1;this.isTableCell(y)&&(ra=mxUtils.indexOf(ma,y));for(X=y=0;X<ba.length;X++){var wa=P.getChildCells(ba[X],-!0)[ra];P.remove(wa);var sa=this.getCellGeometry(wa);null!=sa&&(y=Math.max(y,sa.width))}var xa=this.getCellGeometry(S);null!=xa&&(xa=xa.clone(),xa.width-=y,P.setGeometry(S,xa))}}}finally{P.endUpdate()}};Graph.prototype.deleteTableRow=function(y){var P=this.getModel();P.beginUpdate();try{var S=y,X=y;this.isTableCell(y)&&(y=X=P.getParent(y));this.isTableRow(y)&&(S=P.getParent(X));var ba=P.getChildCells(S,!0);if(1>=ba.length)P.remove(S);else{this.isTableRow(X)||(X=ba[ba.length-1]);P.remove(X);y=0;var ma=-this.getCellGeometry(X);null!=ma&&(y=ma.height);var ra=this.getCellGeometry(S);null!=ra&&(ra=ra.clone(),ra.height-=y,P.setGeometry(S,ra))}}finally{P.endUpdate()}};Graph.prototype.insertRow=function(y,P){for(var S=y.tBodies[0],X=S.rows[0].cells,ba=y=0;ba<X.length;ba++){var ma=X[ba].getAttribute("colspan");y+=null!=ma?parseInt(ma):1}P=S.insertRow(P);for(ba=0;ba<y;ba++)mxUtils.br(P.insertCell(-1));return P.cells[0]};Graph.prototype.deleteRow=function(y,P){y.tBodies[0].deleteRow(P)};Graph.prototype.insertColumn=-function(y,P){var S=y.tHead;if(null!=S)for(var X=0;X<S.rows.length;X++){var ba=document.createElement("th");S.rows[X].appendChild(ba);mxUtils.br(ba)}y=y.tBodies[0];for(S=0;S<y.rows.length;S++)X=y.rows[S].insertCell(P),mxUtils.br(X);return y.rows[0].cells[0<=P?P:y.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(y,P){if(0<=P){y=y.tBodies[0].rows;for(var S=0;S<y.length;S++)y[S].cells.length>P&&y[S].deleteCell(P)}};Graph.prototype.pasteHtmlAtCaret=function(y){if(window.getSelection){var P=-window.getSelection();if(P.getRangeAt&&P.rangeCount){P=P.getRangeAt(0);P.deleteContents();var S=document.createElement("div");S.innerHTML=y;y=document.createDocumentFragment();for(var X;X=S.firstChild;)lastNode=y.appendChild(X);P.insertNode(y)}}else(P=document.selection)&&"Control"!=P.type&&P.createRange().pasteHTML(y)};Graph.prototype.createLinkForHint=function(y,P,S){function X(ma,ra){ma.length>ra&&(ma=ma.substring(0,Math.round(ra/2))+"..."+ma.substring(ma.length-Math.round(ra/4)));return ma}y=-null!=y?y:"javascript:void(0);";if(null==P||0==P.length)P=this.isCustomLink(y)?this.getLinkTitle(y):y;var ba=document.createElement("a");ba.setAttribute("rel",this.linkRelation);ba.setAttribute("href",this.getAbsoluteUrl(y));ba.setAttribute("title",X(this.isCustomLink(y)?this.getLinkTitle(y):y,80));null!=this.linkTarget&&ba.setAttribute("target",this.linkTarget);mxUtils.write(ba,X(P,40));this.isCustomLink(y)&&mxEvent.addListener(ba,"click",mxUtils.bind(this,function(ma){this.customLinkClicked(y,S);-mxEvent.consume(ma)}));return ba};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ma,ra){this.popupMenuHandler.hideMenu()});var y=this.updateMouseEvent;this.updateMouseEvent=function(ma){ma=y.apply(this,arguments);if(mxEvent.isTouchEvent(ma.getEvent())&&null==ma.getState()){var ra=this.getCellAt(ma.graphX,ma.graphY);null!=ra&&this.isSwimlane(ra)&&this.hitsSwimlaneContent(ra,-ma.graphX,ma.graphY)||(ma.state=this.view.getState(ra),null!=ma.state&&null!=ma.state.shape&&(this.container.style.cursor=ma.state.shape.node.style.cursor))}null==ma.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ma};var P=!1,S=!1,X=!1,ba=this.fireMouseEvent;this.fireMouseEvent=function(ma,ra,wa){ma==mxEvent.MOUSE_DOWN&&(ra=this.updateMouseEvent(ra),P=this.isCellSelected(ra.getCell()),S=this.isSelectionEmpty(),X=this.popupMenuHandler.isMenuShowing());ba.apply(this,arguments)};-this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(ma,ra){if(null!=this.freehand&&!this.freehand.isDrawing()){var wa=mxEvent.isMouseEvent(ra.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==ra.getState()||!ra.isSource(ra.getState().control))&&(this.popupMenuHandler.popupTrigger||!X&&!wa&&(S&&null==ra.getCell()&&this.isSelectionEmpty()||P&&this.isCellSelected(ra.getCell())));wa=!P||wa?null:mxUtils.bind(this,function(sa){window.setTimeout(mxUtils.bind(this,-function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var xa=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(ra.getX()+xa.x+1,ra.getY()+xa.y+1,sa,ra.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ma,ra,wa])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var y=this.graph.view.getState(this.editingCell);return null!=y&&1==y.style.html};mxCellEditor.prototype.isTableSelected=-function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var y="";window.getSelection?y=window.getSelection():document.getSelection?y=document.getSelection():document.selection&&(y=document.selection.createRange().text);return""!=y};mxCellEditor.prototype.insertTab=function(y){var P=this.textarea.ownerDocument.defaultView.getSelection(),S=P.getRangeAt(0);y=Graph.createTabNode(y);S.insertNode(y);S.setStartAfter(y);-S.setEndAfter(y);P.removeAllRanges();P.addRange(S)};mxCellEditor.prototype.alignText=function(y,P){var S=this.graph.getView().getState(this.editingCell);if(null!=S){S=mxUtils.getValue(S.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var X=null!=S&&"vertical-"==S.substring(0,9),ba=null!=P&&mxEvent.isShiftDown(P);if(ba||null!=window.getSelection&&null!=window.getSelection().containsNode){var ma=!0;this.graph.processElements(this.textarea,function(ra){ba||X||window.getSelection().containsNode(ra,-!0)?(ra.removeAttribute("align"),ra.style.textAlign=null):ma=!1});(ma||X)&&this.graph.cellEditor.setAlign(y)}X||document.execCommand("justify"+y.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var y=window.getSelection();if(y.getRangeAt&&y.rangeCount){for(var P=[],S=0,X=y.rangeCount;S<X;++S)P.push(y.getRangeAt(S));return P}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=-function(y){try{if(y)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var P=0,S=y.length;P<S;++P)sel.addRange(y[P])}else document.selection&&y.select&&y.select()}catch(X){}};var B=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(y){null!=y.text&&(y.text.replaceLinefeeds="0"!=mxUtils.getValue(y.style,"nl2Br","1"));B.apply(this,arguments)};var D=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(y,P){this.isKeepFocusEvent(y)||-!mxEvent.isAltDown(y.getEvent())?D.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(y){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var I=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(y,P){y=this.graph.getStartEditingCell(y,P);I.apply(this,arguments);var S=this.graph.view.getState(y);this.textarea.className=null!=S&&1==S.style.html?"mxCellEditor geContentEditable":-"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(y);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=S&&this.graph.isAutosizeTextState(S)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var y=this.graph.view.getState(this.editingCell);if(null!=y){var P=null!=y&&"0"!=mxUtils.getValue(y.style,"nl2Br","1"),-S=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);wa=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<wa.length&&"\n"==wa.charAt(wa.length-1)&&(wa=wa.substring(0,wa.length-1));wa=Graph.sanitizeHtml(P?wa.replace(/\n/g,"<br/>"):wa,!0);this.textarea.className="mxCellEditor geContentEditable";sa=mxUtils.getValue(y.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);P=mxUtils.getValue(y.style,mxConstants.STYLE_FONTFAMILY,-mxConstants.DEFAULT_FONTFAMILY);var X=mxUtils.getValue(y.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),ba=(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ma=(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,ra=[];(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&ra.push("underline");(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,-0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&ra.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(sa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(sa)+"px";this.textarea.style.textDecoration=ra.join(" ");this.textarea.style.fontWeight=ba?"bold":"normal";this.textarea.style.fontStyle=ma?"italic":"";this.textarea.style.fontFamily=P;this.textarea.style.textAlign=X;this.textarea.style.padding=+nb.shape.isFlowAnimationEnabled=function(){return qb&&wb.model.isEdge(nb.cell)&&"1"==mxUtils.getValue(nb.style,"flowAnimation","0")};nb.shape.addFlowAnimationToShape=function(){wb.addFlowAnimationToNode(this.getFlowAnimationPath(),nb.style,N,Db())};if(ma&&null==Ta||f)wb.view.redrawEnumerationState(nb),Bb.apply(this,arguments),this.doDrawShape(nb.secondLabel,Ab)}finally{nb.shape.isFlowAnimationEnabled=z,nb.shape.addFlowAnimationToShape=u}};var Eb=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;+wa.drawState(this.getView().getState(Eb),vb);this.addForeignObjectWarning(vb,sb);jb?this.disableSvgLinks(sb):this.updateSvgLinks(sb,sa,!0);return sb}finally{this.enableFlowAnimation=qb,eb&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(x,N){if("0"!=urlParams["svg-warning"]&&0<N.getElementsByTagName("foreignObject").length){var S=x.createElement("switch"),Y=x.createElement("g");Y.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");+var ca=x.createElement("a");ca.setAttribute("transform","translate(0,-5)");null==ca.setAttributeNS||N.ownerDocument!=document&&null==document.documentMode?(ca.setAttribute("xlink:href",Graph.foreignObjectWarningLink),ca.setAttribute("target","_blank")):(ca.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),ca.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));x=x.createElement("text");x.setAttribute("text-anchor","middle");x.setAttribute("font-size","10px");x.setAttribute("x",+"50%");x.setAttribute("y","100%");mxUtils.write(x,Graph.foreignObjectWarningText);S.appendChild(Y);ca.appendChild(x);S.appendChild(ca);N.appendChild(S)}};Graph.prototype.disableSvgLinks=function(x,N){x=x.getElementsByTagName("a");for(var S=0;S<x.length;S++){var Y=x[S].getAttribute("href");null==Y&&(Y=x[S].getAttribute("xlink:href"));null!=Y&&(x[S].style.pointerEvents="none",x[S].setAttribute("href",""));N&&N(x[S])}};Graph.prototype.updateSvgLinks=function(x,N,S){x=x.getElementsByTagName("a");for(var Y=+0;Y<x.length;Y++)if(null==x[Y].getAttribute("target")){var ca=x[Y].getAttribute("href");null==ca&&(ca=x[Y].getAttribute("xlink:href"));null!=ca&&(null!=N&&/^https?:\/\//.test(ca)?x[Y].setAttribute("target",N):S&&this.isCustomLink(ca)&&x[Y].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(x){x=new mxSvgCanvas2D(x);x.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;x.adaptiveColors=this.getAdaptiveColors();x.pointerEvents=!0;return x};Graph.prototype.getSelectedElement=+function(){var x=null;if(window.getSelection){var N=window.getSelection();N.getRangeAt&&N.rangeCount&&(x=N.getRangeAt(0).commonAncestorContainer)}else document.selection&&(x=document.selection.createRange().parentElement());return x};Graph.prototype.getSelectedEditingElement=function(){var x=null;if(null!=this.cellEditor.textarea)for(x=this.getSelectedElement();null!=x&&x.nodeType!=mxConstants.NODETYPE_ELEMENT;)x=x.parentNode;return x};Graph.prototype.getParentByName=function(x,N,S){for(;null!=x&&+x.nodeName!=N;){if(x==S)return null;x=x.parentNode}return x};Graph.prototype.getParentByNames=function(x,N,S){for(;null!=x&&!(0<=mxUtils.indexOf(N,x.nodeName));){if(x==S)return null;x=x.parentNode}return x};Graph.prototype.selectNode=function(x){var N=null;if(window.getSelection){if(N=window.getSelection(),N.getRangeAt&&N.rangeCount){var S=document.createRange();S.selectNode(x);N.removeAllRanges();N.addRange(S)}}else(N=document.selection)&&"Control"!=N.type&&(x=N.createRange(),x.collapse(!0),S=N.createRange(),+S.setEndPoint("StartToStart",x),S.select())};Graph.prototype.flipEdgePoints=function(x,N,S){var Y=this.getCellGeometry(x);if(null!=Y){Y=Y.clone();if(null!=Y.points)for(var ca=0;ca<Y.points.length;ca++)N?Y.points[ca].x=S+(S-Y.points[ca].x):Y.points[ca].y=S+(S-Y.points[ca].y);ca=function(ma){null!=ma&&(N?ma.x=S+(S-ma.x):ma.y=S+(S-ma.y))};ca(Y.getTerminalPoint(!0));ca(Y.getTerminalPoint(!1));this.model.setGeometry(x,Y)}};Graph.prototype.flipChildren=function(x,N,S){this.model.beginUpdate();try{for(var Y=+this.model.getChildCount(x),ca=0;ca<Y;ca++){var ma=this.model.getChildAt(x,ca);if(this.model.isEdge(ma))this.flipEdgePoints(ma,N,S);else{var qa=this.getCellGeometry(ma);null!=qa&&(qa=qa.clone(),N?qa.x=S+(S-qa.x-qa.width):qa.y=S+(S-qa.y-qa.height),this.model.setGeometry(ma,qa))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(x,N,S){return null!=x&&1==mxUtils.getValue(x.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(x,N,S):mxGraph.prototype.getConnectionPoint.apply(this,+arguments)};Graph.prototype.getLegacyConnectionPoint=function(x,N,S){S=null!=S?S:!0;var Y=null;if(null!=x&&null!=N.point){var ca=this.view.getPerimeterBounds(x),ma=new mxPoint(ca.getCenterX(),ca.getCenterY()),qa=x.style[mxConstants.STYLE_DIRECTION],wa=0;null!=qa&&1==mxUtils.getValue(x.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(qa==mxConstants.DIRECTION_NORTH?wa+=270:qa==mxConstants.DIRECTION_WEST?wa+=180:qa==mxConstants.DIRECTION_SOUTH&&(wa+=90),qa!=mxConstants.DIRECTION_NORTH&&qa!=mxConstants.DIRECTION_SOUTH||+ca.rotate90());Y=this.view.scale;Y=new mxPoint(ca.x+N.point.x*ca.width+N.dx*Y,ca.y+N.point.y*ca.height+N.dy*Y);var sa=x.style[mxConstants.STYLE_ROTATION]||0;if(N.perimeter)0!=wa&&(qa=ca=0,90==wa?qa=1:180==wa?ca=-1:270==wa&&(qa=-1),Y=mxUtils.getRotatedPoint(Y,ca,qa,ma)),Y=this.view.getPerimeterPoint(x,Y,!1);else if(sa+=wa,this.getModel().isVertex(x.cell)){wa=1==x.style[mxConstants.STYLE_FLIPH];N=1==x.style[mxConstants.STYLE_FLIPV];null!=x.shape&&null!=x.shape.stencil&&(wa=1==mxUtils.getValue(x.style,+"stencilFlipH",0)||wa,N=1==mxUtils.getValue(x.style,"stencilFlipV",0)||N);if(qa==mxConstants.DIRECTION_NORTH||qa==mxConstants.DIRECTION_SOUTH)x=wa,wa=N,N=x;wa&&(Y.x=2*ca.getCenterX()-Y.x);N&&(Y.y=2*ca.getCenterY()-Y.y)}0!=sa&&null!=Y&&(x=mxUtils.toRadians(sa),ca=Math.cos(x),qa=Math.sin(x),Y=mxUtils.getRotatedPoint(Y,ca,qa,ma))}S&&null!=Y&&(Y.x=Math.round(Y.x),Y.y=Math.round(Y.y));return Y};Graph.prototype.flipCells=function(x,N){this.model.beginUpdate();try{x=this.model.getTopmostCells(x);for(var S=+[],Y=0;Y<x.length;Y++)if(this.model.isEdge(x[Y])){var ca=this.view.getState(x[Y]);null!=ca&&this.flipEdgePoints(x[Y],N,(N?ca.getCenterX():ca.getCenterY())/this.view.scale-(N?ca.origin.x:ca.origin.y)-(N?this.view.translate.x:this.view.translate.y))}else{var ma=this.getCellGeometry(x[Y]);null!=ma&&this.flipChildren(x[Y],N,N?ma.getCenterX()-ma.x:ma.getCenterY()-ma.y);S.push(x[Y])}this.toggleCellStyles(N?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,S);this.setCellStyles("legacyAnchorPoints","0",+S)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(x,N){var S=null;if(null!=x&&0<x.length){this.model.beginUpdate();try{for(var Y=0;Y<x.length;Y++){var ca=this.model.getParent(x[Y]);if(this.isTable(ca)){var ma=this.getCellGeometry(x[Y]),qa=this.getCellGeometry(ca);null!=ma&&null!=qa&&(qa=qa.clone(),qa.height-=ma.height,this.model.setGeometry(ca,qa))}}var wa=this.selectParentAfterDelete?this.model.getParents(x):null;this.removeCells(x,N)}finally{this.model.endUpdate()}if(null!=+wa)for(S=[],Y=0;Y<wa.length;Y++)this.model.contains(wa[Y])&&(this.model.isVertex(wa[Y])||this.model.isEdge(wa[Y]))&&S.push(wa[Y])}return S};Graph.prototype.insertTableColumn=function(x,N){var S=this.getModel();S.beginUpdate();try{var Y=x,ca=0;if(this.isTableCell(x)){var ma=S.getParent(x);Y=S.getParent(ma);ca=mxUtils.indexOf(S.getChildCells(ma,!0),x)}else this.isTableRow(x)?Y=S.getParent(x):x=S.getChildCells(Y,!0)[0],N||(ca=S.getChildCells(x,!0).length-1);var qa=S.getChildCells(Y,!0),wa=Graph.minTableColumnWidth;+for(x=0;x<qa.length;x++){var sa=S.getChildCells(qa[x],!0)[ca],ya=S.cloneCell(sa,!1);null==ya&&(ya=this.createVertex());var Ga=this.getCellGeometry(ya);ya.value=null;ya.style=mxUtils.setStyle(mxUtils.setStyle(ya.style,"rowspan",null),"colspan",null);if(null!=Ga){null!=Ga.alternateBounds&&(Ga.width=Ga.alternateBounds.width,Ga.height=Ga.alternateBounds.height,Ga.alternateBounds=null);wa=Ga.width;var Ya=this.getCellGeometry(qa[x]);null!=Ya&&(Ga.height=Ya.height)}S.add(qa[x],ya,ca+(N?0:1))}var Va=this.getCellGeometry(Y);+null!=Va&&(Va=Va.clone(),Va.width+=wa,S.setGeometry(Y,Va))}finally{S.endUpdate()}};Graph.prototype.deleteLane=function(x){var N=this.getModel();N.beginUpdate();try{var S=null;S="stackLayout"==this.getCurrentCellStyle(x).childLayout?x:N.getParent(x);var Y=N.getChildCells(S,!0);0==Y.length?N.remove(S):(S==x&&(x=Y[Y.length-1]),N.remove(x))}finally{N.endUpdate()}};Graph.prototype.insertLane=function(x,N){var S=this.getModel();S.beginUpdate();try{var Y=null;if("stackLayout"==this.getCurrentCellStyle(x).childLayout){Y=+x;var ca=S.getChildCells(Y,!0);x=ca[N?0:ca.length-1]}else Y=S.getParent(x);var ma=Y.getIndex(x);x=S.cloneCell(x,!1);x.value=null;S.add(Y,x,ma+(N?0:1))}finally{S.endUpdate()}};Graph.prototype.insertTableRow=function(x,N){var S=this.getModel();S.beginUpdate();try{var Y=x,ca=x;if(this.isTableCell(x))ca=S.getParent(x),Y=S.getParent(ca);else if(this.isTableRow(x))Y=S.getParent(x);else{var ma=S.getChildCells(Y,!0);ca=ma[N?0:ma.length-1]}var qa=S.getChildCells(ca,!0),wa=Y.getIndex(ca);ca=S.cloneCell(ca,+!1);ca.value=null;var sa=this.getCellGeometry(ca);if(null!=sa){for(ma=0;ma<qa.length;ma++){x=S.cloneCell(qa[ma],!1);x.value=null;x.style=mxUtils.setStyle(mxUtils.setStyle(x.style,"rowspan",null),"colspan",null);var ya=this.getCellGeometry(x);null!=ya&&(null!=ya.alternateBounds&&(ya.width=ya.alternateBounds.width,ya.height=ya.alternateBounds.height,ya.alternateBounds=null),ya.height=sa.height);ca.insert(x)}S.add(Y,ca,wa+(N?0:1));var Ga=this.getCellGeometry(Y);null!=Ga&&(Ga=Ga.clone(),Ga.height+=sa.height,+S.setGeometry(Y,Ga))}}finally{S.endUpdate()}};Graph.prototype.deleteTableColumn=function(x){var N=this.getModel();N.beginUpdate();try{var S=x,Y=x;this.isTableCell(x)&&(Y=N.getParent(x));this.isTableRow(Y)&&(S=N.getParent(Y));var ca=N.getChildCells(S,!0);if(0==ca.length)N.remove(S);else{this.isTableRow(Y)||(Y=ca[0]);var ma=N.getChildCells(Y,!0);if(1>=ma.length)N.remove(S);else{var qa=ma.length-1;this.isTableCell(x)&&(qa=mxUtils.indexOf(ma,x));for(Y=x=0;Y<ca.length;Y++){var wa=N.getChildCells(ca[Y],+!0)[qa];N.remove(wa);var sa=this.getCellGeometry(wa);null!=sa&&(x=Math.max(x,sa.width))}var ya=this.getCellGeometry(S);null!=ya&&(ya=ya.clone(),ya.width-=x,N.setGeometry(S,ya))}}}finally{N.endUpdate()}};Graph.prototype.deleteTableRow=function(x){var N=this.getModel();N.beginUpdate();try{var S=x,Y=x;this.isTableCell(x)&&(x=Y=N.getParent(x));this.isTableRow(x)&&(S=N.getParent(Y));var ca=N.getChildCells(S,!0);if(1>=ca.length)N.remove(S);else{this.isTableRow(Y)||(Y=ca[ca.length-1]);N.remove(Y);x=0;var ma=+this.getCellGeometry(Y);null!=ma&&(x=ma.height);var qa=this.getCellGeometry(S);null!=qa&&(qa=qa.clone(),qa.height-=x,N.setGeometry(S,qa))}}finally{N.endUpdate()}};Graph.prototype.insertRow=function(x,N){for(var S=x.tBodies[0],Y=S.rows[0].cells,ca=x=0;ca<Y.length;ca++){var ma=Y[ca].getAttribute("colspan");x+=null!=ma?parseInt(ma):1}N=S.insertRow(N);for(ca=0;ca<x;ca++)mxUtils.br(N.insertCell(-1));return N.cells[0]};Graph.prototype.deleteRow=function(x,N){x.tBodies[0].deleteRow(N)};Graph.prototype.insertColumn=+function(x,N){var S=x.tHead;if(null!=S)for(var Y=0;Y<S.rows.length;Y++){var ca=document.createElement("th");S.rows[Y].appendChild(ca);mxUtils.br(ca)}x=x.tBodies[0];for(S=0;S<x.rows.length;S++)Y=x.rows[S].insertCell(N),mxUtils.br(Y);return x.rows[0].cells[0<=N?N:x.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(x,N){if(0<=N){x=x.tBodies[0].rows;for(var S=0;S<x.length;S++)x[S].cells.length>N&&x[S].deleteCell(N)}};Graph.prototype.pasteHtmlAtCaret=function(x){if(window.getSelection){var N=+window.getSelection();if(N.getRangeAt&&N.rangeCount){N=N.getRangeAt(0);N.deleteContents();var S=document.createElement("div");S.innerHTML=x;x=document.createDocumentFragment();for(var Y;Y=S.firstChild;)lastNode=x.appendChild(Y);N.insertNode(x)}}else(N=document.selection)&&"Control"!=N.type&&N.createRange().pasteHTML(x)};Graph.prototype.createLinkForHint=function(x,N,S){function Y(ma,qa){ma.length>qa&&(ma=ma.substring(0,Math.round(qa/2))+"..."+ma.substring(ma.length-Math.round(qa/4)));return ma}x=+null!=x?x:"javascript:void(0);";if(null==N||0==N.length)N=this.isCustomLink(x)?this.getLinkTitle(x):x;var ca=document.createElement("a");ca.setAttribute("rel",this.linkRelation);ca.setAttribute("href",this.getAbsoluteUrl(x));ca.setAttribute("title",Y(this.isCustomLink(x)?this.getLinkTitle(x):x,80));null!=this.linkTarget&&ca.setAttribute("target",this.linkTarget);mxUtils.write(ca,Y(N,40));this.isCustomLink(x)&&mxEvent.addListener(ca,"click",mxUtils.bind(this,function(ma){this.customLinkClicked(x,S);+mxEvent.consume(ma)}));return ca};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ma,qa){this.popupMenuHandler.hideMenu()});var x=this.updateMouseEvent;this.updateMouseEvent=function(ma){ma=x.apply(this,arguments);if(mxEvent.isTouchEvent(ma.getEvent())&&null==ma.getState()){var qa=this.getCellAt(ma.graphX,ma.graphY);null!=qa&&this.isSwimlane(qa)&&this.hitsSwimlaneContent(qa,+ma.graphX,ma.graphY)||(ma.state=this.view.getState(qa),null!=ma.state&&null!=ma.state.shape&&(this.container.style.cursor=ma.state.shape.node.style.cursor))}null==ma.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ma};var N=!1,S=!1,Y=!1,ca=this.fireMouseEvent;this.fireMouseEvent=function(ma,qa,wa){ma==mxEvent.MOUSE_DOWN&&(qa=this.updateMouseEvent(qa),N=this.isCellSelected(qa.getCell()),S=this.isSelectionEmpty(),Y=this.popupMenuHandler.isMenuShowing());ca.apply(this,arguments)};+this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(ma,qa){if(null!=this.freehand&&!this.freehand.isDrawing()){var wa=mxEvent.isMouseEvent(qa.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==qa.getState()||!qa.isSource(qa.getState().control))&&(this.popupMenuHandler.popupTrigger||!Y&&!wa&&(S&&null==qa.getCell()&&this.isSelectionEmpty()||N&&this.isCellSelected(qa.getCell())));wa=!N||wa?null:mxUtils.bind(this,function(sa){window.setTimeout(mxUtils.bind(this,+function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var ya=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(qa.getX()+ya.x+1,qa.getY()+ya.y+1,sa,qa.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ma,qa,wa])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var x=this.graph.view.getState(this.editingCell);return null!=x&&1==x.style.html};mxCellEditor.prototype.isTableSelected=+function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var x="";window.getSelection?x=window.getSelection():document.getSelection?x=document.getSelection():document.selection&&(x=document.selection.createRange().text);return""!=x};mxCellEditor.prototype.insertTab=function(x){var N=this.textarea.ownerDocument.defaultView.getSelection(),S=N.getRangeAt(0);x=Graph.createTabNode(x);S.insertNode(x);S.setStartAfter(x);+S.setEndAfter(x);N.removeAllRanges();N.addRange(S)};mxCellEditor.prototype.alignText=function(x,N){var S=this.graph.getView().getState(this.editingCell);if(null!=S){S=mxUtils.getValue(S.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var Y=null!=S&&"vertical-"==S.substring(0,9),ca=null!=N&&mxEvent.isShiftDown(N);if(ca||null!=window.getSelection&&null!=window.getSelection().containsNode){var ma=!0;this.graph.processElements(this.textarea,function(qa){ca||Y||window.getSelection().containsNode(qa,+!0)?(qa.removeAttribute("align"),qa.style.textAlign=null):ma=!1});(ma||Y)&&this.graph.cellEditor.setAlign(x)}Y||document.execCommand("justify"+x.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var x=window.getSelection();if(x.getRangeAt&&x.rangeCount){for(var N=[],S=0,Y=x.rangeCount;S<Y;++S)N.push(x.getRangeAt(S));return N}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=+function(x){try{if(x)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var N=0,S=x.length;N<S;++N)sel.addRange(x[N])}else document.selection&&x.select&&x.select()}catch(Y){}};var B=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(x){null!=x.text&&(x.text.replaceLinefeeds="0"!=mxUtils.getValue(x.style,"nl2Br","1"));B.apply(this,arguments)};var D=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(x,N){this.isKeepFocusEvent(x)||+!mxEvent.isAltDown(x.getEvent())?D.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(x){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var I=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(x,N){x=this.graph.getStartEditingCell(x,N);I.apply(this,arguments);var S=this.graph.view.getState(x);this.textarea.className=null!=S&&1==S.style.html?"mxCellEditor geContentEditable":+"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(x);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=S&&this.graph.isAutosizeTextState(S)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var x=this.graph.view.getState(this.editingCell);if(null!=x){var N=null!=x&&"0"!=mxUtils.getValue(x.style,"nl2Br","1"),+S=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);wa=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<wa.length&&"\n"==wa.charAt(wa.length-1)&&(wa=wa.substring(0,wa.length-1));wa=Graph.sanitizeHtml(N?wa.replace(/\n/g,"<br/>"):wa,!0);this.textarea.className="mxCellEditor geContentEditable";sa=mxUtils.getValue(x.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);N=mxUtils.getValue(x.style,mxConstants.STYLE_FONTFAMILY,+mxConstants.DEFAULT_FONTFAMILY);var Y=mxUtils.getValue(x.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),ca=(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ma=(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,qa=[];(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&qa.push("underline");(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,+0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&qa.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(sa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(sa)+"px";this.textarea.style.textDecoration=qa.join(" ");this.textarea.style.fontWeight=ca?"bold":"normal";this.textarea.style.fontStyle=ma?"italic":"";this.textarea.style.fontFamily=N;this.textarea.style.textAlign=Y;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(P?wa.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):wa,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var sa=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(sa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(sa)+"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=S;this.resize()}};var L=mxCellEditor.prototype.resize;-mxCellEditor.prototype.resize=function(y,P){if(null!=this.textarea)if(y=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=y){var S=y.view.scale;this.bounds=mxRectangle.fromRectangle(y);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*S;this.bounds.height=60*S;var X=null!=y.text?y.text.margin:null;null==X&&(X=mxUtils.getAlignmentAsPoint(mxUtils.getValue(y.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(y.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)/S)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/S)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/S)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*-S);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/S)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*S);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("+S+","+S+")")}else if(null!=y&&this.graph.isAutosizeTextState(y)){S=y.view.scale;X=y.style;var ba=-this.graph.getCellGeometry(this.editingCell);if(null!=ba){this.bounds=mxRectangle.fromRectangle(y);this.textarea.style.left=Math.round(y.x)+"px";this.textarea.style.top=Math.round(y.y)+"px";var ma=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=ma?"rotate("+ma+"deg) ":"")+"scale("+S+","+S+")");this.textarea.style.borderWidth="0";this.textarea.style.width=-Math.round(ba.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(ba.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==X[mxConstants.STYLE_WHITE_SPACE]&&(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var ra=parseInt(mxUtils.getValue(X,mxConstants.STYLE_SPACING,2));S=ra+parseInt(mxUtils.getValue(X,mxConstants.STYLE_SPACING_TOP,0));ma=ra+parseInt(mxUtils.getValue(X,-mxConstants.STYLE_SPACING_BOTTOM,0));var wa=ra+parseInt(mxUtils.getValue(X,mxConstants.STYLE_SPACING_LEFT,0));ra+=parseInt(mxUtils.getValue(X,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(wa)+"px";this.textarea.style.paddingRight=Math.round(ra)+"px";this.textarea.style.paddingTop=Math.round(S)+"px";this.textarea.style.paddingBottom=Math.round(ma)+"px";this.textarea.style.display="flex";this.textarea.style.flexDirection="column";S=mxUtils.getValue(X,mxConstants.STYLE_VERTICAL_ALIGN,-mxConstants.ALIGN_MIDDLE);this.textarea.style.justifyContent=S==mxConstants.ALIGN_MIDDLE?"center":S==mxConstants.ALIGN_BOTTOM?"flex-end":"flex-start";S=this.textarea.innerText;null!=S&&0<S.length&&(ba=this.graph.getAutosizeTextAvailableSpace(X,ba.width,ba.height,y),null!=ba&&(S=mxUtils.htmlEntities(S,!1).replace(/\n/g,"<br>"),X=this.graph.computeAutosizeTextFontSize(S,ba.availW,ba.availH,X[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,X[mxConstants.STYLE_FONTSTYLE],"wrap"==X[mxConstants.STYLE_WHITE_SPACE]),-this.textarea.style.fontSize=X+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?X*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection=-"",this.textarea.style.justifyContent="",L.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(y,P){if("0"==mxUtils.getValue(y.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var S=this.graph.getEditingValue(y.cell,P);"1"==mxUtils.getValue(y.style,"nl2Br","1")&&(S=S.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(S,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;-mxCellEditor.prototype.setEditingValue=function(y,P){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(y.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(y){if("0"==mxUtils.getValue(y.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,-Graph.backupStyleAttribute);var P=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(y.style,"nl2Br","1")?(P=P.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<P.length&&("<br/>"==P.substring(P.length-5)||"<br>"==P.substring(P.length-4))&&(P=P.substring(0,P.lastIndexOf("<br"))+"<div><br/></div>")):P=P.replace(/\r\n/g,"").replace(/\n/g,"");return P};var N=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(y){this.codeViewMode&&this.toggleViewMode();N.apply(this,-arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(y){}};var K=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(y,P){this.graph.getModel().beginUpdate();try{K.apply(this,arguments),""==P&&this.graph.isCellDeletable(y.cell)&&0==this.graph.model.getChildCount(y.cell)&&this.graph.isTransparentState(y)&&this.graph.removeCells([y.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=-function(y){y=mxUtils.getValue(y.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);y==mxConstants.NONE&&(y=null);return y};mxCellEditor.prototype.getBorderColor=function(y){y=mxUtils.getValue(y.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);y==mxConstants.NONE&&(y=null);return y};mxCellEditor.prototype.getMinimumSize=function(y){var P=this.graph.getView().scale;return new mxRectangle(0,0,null==y.text?30:y.text.size*P+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;-mxGraphHandler.prototype.isValidDropTarget=function(y,P){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(P.getEvent)};mxGraphView.prototype.formatUnitText=function(y){return y?d(y,this.unit):y};mxGraphHandler.prototype.updateHint=function(y){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var P=this.graph.view.translate,S=this.graph.view.scale;y=this.roundLength((this.bounds.x+-this.currentDx)/S-P.x);P=this.roundLength((this.bounds.y+this.currentDy)/S-P.y);S=this.graph.view.unit;this.hint.innerHTML=d(y,S)+", "+d(P,S);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 da=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(y,P){da.apply(this,arguments);var S=this.graph.getCellStyle(y);if(null==S.childLayout){var X=this.graph.model.getParent(y),ba=null!=X?this.graph.getCellGeometry(X):null;if(null!=ba&&(S=this.graph.getCellStyle(X),"stackLayout"==S.childLayout)){var ma=parseFloat(mxUtils.getValue(S,"stackBorder",mxStackLayout.prototype.border));S="1"==mxUtils.getValue(S,"horizontalStack","1");var ra=this.graph.getActualStartSize(X);-ba=ba.clone();S?ba.height=P.height+ra.y+ra.height+2*ma:ba.width=P.width+ra.x+ra.width+2*ma;this.graph.model.setGeometry(X,ba)}}};var ja=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function y(wa){S.get(wa)||(S.put(wa,!0),ba.push(wa))}for(var P=ja.apply(this,arguments),S=new mxDictionary,X=this.graph.model,ba=[],ma=0;ma<P.length;ma++){var ra=P[ma];this.graph.isTableCell(ra)?y(X.getParent(X.getParent(ra))):this.graph.isTableRow(ra)&&-y(X.getParent(ra));y(ra)}return ba};var ea=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(y){return ea.apply(this,arguments)&&!mxEvent.isControlDown(y.getEvent())&&!mxEvent.isShiftDown(y.getEvent())};var ca=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return ca.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 fa=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(y){var P=fa.apply(this,arguments);P.stroke="#C0C0C0";P.strokewidth=1;return P};var la=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(y){var P=la.apply(this,arguments);P.stroke="#C0C0C0";P.strokewidth=1;return P};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=-function(){var y=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+y.x/2,this.bounds.y+this.rotationHandleVSpacing-y.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(y,P){return this.graph.isRecursiveVertexResize(y)&&!mxEvent.isAltDown(P.getEvent())};mxVertexHandler.prototype.isCenteredEvent=function(y,P){return mxEvent.isControlDown(P.getEvent())||mxEvent.isMetaDown(P.getEvent())};var ka=mxVertexHandler.prototype.isRotationHandleVisible;-mxVertexHandler.prototype.isRotationHandleVisible=function(){return ka.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.isConnectHandleVisible=function(){return Editor.showConnectHandle&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=--12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var y=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+y.x/2,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+y.y/2)};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 V=mxVertexHandler.prototype.isParentHighlightVisible;-mxVertexHandler.prototype.isParentHighlightVisible=function(){return V.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var k=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(y){return y.tableHandle||k.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var y=0;this.graph.isTableRow(this.state.cell)?-y=1:this.graph.isTableCell(this.state.cell)&&(y=2);return y};var x=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return x.apply(this,arguments).grow(-this.getSelectionBorderInset())};var J=null,R=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==J&&(J=mxCellRenderer.defaultShapes.tableLine);var y=R.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var P=-function(hb,jb,Ta){for(var qb=[],gb=0;gb<hb.length;gb++){var bb=hb[gb];qb.push(null==bb?null:new mxPoint((sa+bb.x+jb)*ma,(xa+bb.y+Ta)*ma))}return qb},S=this,X=this.graph,ba=X.model,ma=X.view.scale,ra=this.state,wa=this.selectionBorder,sa=this.state.origin.x+X.view.translate.x,xa=this.state.origin.y+X.view.translate.y;null==y&&(y=[]);var Fa=X.view.getCellStates(ba.getChildCells(this.state.cell,!0));if(0<Fa.length){var Ya=ba.getChildCells(Fa[0].cell,!0),Ua=X.getTableLines(this.state.cell,!1,!0),cb=-X.getTableLines(this.state.cell,!0,!1);for(ba=0;ba<Fa.length;ba++)mxUtils.bind(this,function(hb){var jb=Fa[hb],Ta=null;if(X.isCellMovable(jb.cell)){Ta=hb<Fa.length-1?Fa[hb+1]:null;Ta=null!=Ta?X.getCellGeometry(Ta.cell):null;var qb=null!=Ta&&null!=Ta.alternateBounds?Ta.alternateBounds:Ta;Ta=null!=cb[hb]?new J(cb[hb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Ta.isDashed=wa.isDashed;Ta.svgStrokeTolerance++;Ta=new mxHandle(jb,"row-resize",null,Ta);Ta.tableHandle=!0;var gb=-0;Ta.shape.node.parentNode.insertBefore(Ta.shape.node,Ta.shape.node.parentNode.firstChild);Ta.redraw=function(){if(null!=this.shape){this.shape.stroke=0==gb?mxConstants.NONE:wa.stroke;if(this.shape.constructor==J)this.shape.line=P(cb[hb],0,gb),this.shape.updateBoundsFromLine();else{var db=X.getActualStartSize(ra.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+gb*ma;this.shape.bounds.x=ra.x+(hb==Fa.length-1?0:db.x*ma);this.shape.bounds.width=ra.width-(hb==Fa.length--1?0:db.width+db.x+ma)}this.shape.redraw()}};var bb=!1;Ta.setPosition=function(db,lb,ub){gb=Math.max(Graph.minTableRowHeight-db.height,lb.y-db.y-db.height);bb=mxEvent.isShiftDown(ub.getEvent());null!=qb&&bb&&(gb=Math.min(gb,qb.height-Graph.minTableRowHeight))};Ta.execute=function(db){if(0!=gb)X.setTableRowHeight(this.state.cell,gb,!bb);else if(!S.blockDelayedSelection){var lb=X.getCellAt(db.getGraphX(),db.getGraphY())||ra.cell;X.graphHandler.selectCellForEvent(lb,db)}gb=0};Ta.reset=function(){gb=0}}y.push(Ta)})(ba);-for(ba=0;ba<Ya.length;ba++)mxUtils.bind(this,function(hb){var jb=X.view.getState(Ya[hb]),Ta=X.getCellGeometry(Ya[hb]),qb=null!=Ta.alternateBounds?Ta.alternateBounds:Ta;null==jb&&(jb=new mxCellState(X.view,Ya[hb],X.getCellStyle(Ya[hb])),jb.x=ra.x+Ta.x*ma,jb.y=ra.y+Ta.y*ma,jb.width=qb.width*ma,jb.height=qb.height*ma,jb.updateCachedBounds());Ta=hb<Ya.length-1?Ya[hb+1]:null;Ta=null!=Ta?X.getCellGeometry(Ta):null;var gb=null!=Ta&&null!=Ta.alternateBounds?Ta.alternateBounds:Ta;Ta=null!=Ua[hb]?new J(Ua[hb],-mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Ta.isDashed=wa.isDashed;Ta.svgStrokeTolerance++;jb=new mxHandle(jb,"col-resize",null,Ta);jb.tableHandle=!0;var bb=0;jb.shape.node.parentNode.insertBefore(jb.shape.node,jb.shape.node.parentNode.firstChild);jb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==bb?mxConstants.NONE:wa.stroke;if(this.shape.constructor==J)this.shape.line=P(Ua[hb],bb,0),this.shape.updateBoundsFromLine();else{var lb=X.getActualStartSize(ra.cell,-!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(qb.width+bb)*ma;this.shape.bounds.y=ra.y+(hb==Ya.length-1?0:lb.y*ma);this.shape.bounds.height=ra.height-(hb==Ya.length-1?0:(lb.height+lb.y)*ma)}this.shape.redraw()}};var db=!1;jb.setPosition=function(lb,ub,ob){bb=Math.max(Graph.minTableColumnWidth-qb.width,ub.x-lb.x-qb.width);db=mxEvent.isShiftDown(ob.getEvent());null==gb||db||(bb=Math.min(bb,gb.width-Graph.minTableColumnWidth))};jb.execute=function(lb){if(0!=bb)X.setTableColumnWidth(this.state.cell,-bb,db);else if(!S.blockDelayedSelection){var ub=X.getCellAt(lb.getGraphX(),lb.getGraphY())||ra.cell;X.graphHandler.selectCellForEvent(ub,lb)}bb=0};jb.positionChanged=function(){};jb.reset=function(){bb=0};y.push(jb)})(ba)}}return null!=y?y.reverse():null};var Y=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(y){Y.apply(this,arguments);if(null!=this.moveHandles)for(var P=0;P<this.moveHandles.length;P++)null!=this.moveHandles[P]&&(this.moveHandles[P].node.style.visibility=-y?"":"hidden");if(null!=this.cornerHandles)for(P=0;P<this.cornerHandles.length;P++)this.cornerHandles[P].node.style.visibility=y?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var y=this.isMoveHandlesVisible();y&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():y||null==this.moveHandles||this.destroyMoveHandles();if(y&&-null==this.moveHandles){for(y=0;y<this.moveHandles.length;y++)null!=this.moveHandles[y]&&this.moveHandles[y].parentNode.removeChild(this.moveHandles[y]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var y=this.graph,P=y.model,S=[],X=0;X<P.getChildCount(this.state.cell);X++)mxUtils.bind(this,function(ba){if(null!=ba&&P.isVertex(ba.cell)&&y.isCellMovable(ba.cell)){var ma=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ma=new mxImageShape(ma,-this.rowHandleImage.src);ma.rowState=ba;ma.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ma.init(this.graph.getView().getOverlayPane());ma.node.style.cursor="move";mxEvent.addGestureListeners(ma.node,mxUtils.bind(this,function(ra){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(ra)&&this.graph.isCellSelected(ba.cell)||this.graph.selectCellForEvent(ba.cell,ra);mxEvent.isPopupTrigger(ra)||(this.graph.graphHandler.start(this.state.cell,-mxEvent.getClientX(ra),mxEvent.getClientY(ra),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(ra),this.graph.isMouseDown=!0);mxEvent.consume(ra)}),null,mxUtils.bind(this,function(ra){mxEvent.isPopupTrigger(ra)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(ra),mxEvent.getClientY(ra),ba.cell,ra),mxEvent.consume(ra))}));S.push(ma)}else S.push(null)})(this.graph.view.getState(P.getChildAt(this.state.cell,X)));return S};-mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var y=0;y<this.moveHandles.length;y++)null!=this.moveHandles[y]&&this.moveHandles[y].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var y=0;y<this.cornerHandles.length;y++)null!=this.cornerHandles[y]&&null!=this.cornerHandles[y].node&&null!=this.cornerHandles[y].node.parentNode&&this.cornerHandles[y].node.parentNode.removeChild(this.cornerHandles[y].node);-this.cornerHandles=null}};var Z=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){Z.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 y=0;4>-y;y++){var P=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);P.dialect=mxConstants.DIALECT_SVG;P.init(this.graph.view.getOverlayPane());this.cornerHandles.push(P)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();y=this.graph.getLinkForCell(this.state.cell);P=this.graph.getLinksForState(this.state);this.updateLinkHint(y,P)};var W=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=-function(){var y=new mxPoint(0,0),P=this.tolerance,S=this.state.style.shape;null==mxCellRenderer.defaultShapes[S]&&mxStencilRegistry.getStencil(S);S=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!S&&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 ba=this.customHandles[X].shape.bounds,ma=ba.getCenterX(),ra=ba.getCenterY();-if(Math.abs(this.state.x-ma)<ba.width/2||Math.abs(this.state.y-ra)<ba.height/2||Math.abs(this.state.x+this.state.width-ma)<ba.width/2||Math.abs(this.state.y+this.state.height-ra)<ba.height/2){S=!0;break}}S&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(P/=2,this.graph.isTable(this.state.cell)&&(P+=7),y.x=this.sizers[0].bounds.width+P,y.y=this.sizers[0].bounds.height+P):y=W.apply(this,arguments);return y};mxVertexHandler.prototype.updateHint=function(y){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{y=this.state.view.scale;var P=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/y),P)+" x "+d(this.roundLength(this.bounds.height/y),P)}y=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==y&&(y=this.bounds);this.hint.style.left=-y.x+Math.round((y.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=y.y+y.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 U=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){U.apply(this,arguments);var y=this.graph.getLinkForCell(this.state.cell),P=this.graph.getLinksForState(this.state);-this.updateLinkHint(y,P)};var aa=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(y,P){aa.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 ia=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(y,P){ia.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&-(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(y,P,S){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var X=this.graph.view.translate,ba=this.graph.view.scale,ma=this.roundLength(P.x/ba-X.x);X=this.roundLength(P.y/ba-X.y);var ra=this.graph.view.unit;this.hint.innerHTML=d(ma,ra)+", "+d(X,ra);this.hint.style.visibility="visible";null!=S&&(S.view.updateEdgeBounds(S),this.hint.innerHTML+=" ("+(ra==mxConstants.POINTS?Math.round(S.length/-ba):d(S.length/ba,ra))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(S=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*S.x)+"%, "+Math.round(100*S.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(y.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(y.getGraphY(),P.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=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+-HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');+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 sa=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(sa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(sa)+"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=S;this.resize()}};var K=mxCellEditor.prototype.resize;+mxCellEditor.prototype.resize=function(x,N){if(null!=this.textarea)if(x=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=x){var S=x.view.scale;this.bounds=mxRectangle.fromRectangle(x);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*S;this.bounds.height=60*S;var Y=null!=x.text?x.text.margin:null;null==Y&&(Y=mxUtils.getAlignmentAsPoint(mxUtils.getValue(x.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(x.style,mxConstants.STYLE_VERTICAL_ALIGN,+mxConstants.ALIGN_MIDDLE)));this.bounds.x+=Y.x*this.bounds.width;this.bounds.y+=Y.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/S)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/S)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/S)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*+S);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/S)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*S);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("+S+","+S+")")}else if(null!=x&&this.graph.isAutosizeTextState(x)){S=x.view.scale;Y=x.style;var ca=+this.graph.getCellGeometry(this.editingCell);if(null!=ca){this.bounds=mxRectangle.fromRectangle(x);this.textarea.style.left=Math.round(x.x)+"px";this.textarea.style.top=Math.round(x.y)+"px";var ma=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=ma?"rotate("+ma+"deg) ":"")+"scale("+S+","+S+")");this.textarea.style.borderWidth="0";this.textarea.style.width=+Math.round(ca.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(ca.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==Y[mxConstants.STYLE_WHITE_SPACE]&&(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var qa=parseInt(mxUtils.getValue(Y,mxConstants.STYLE_SPACING,2));S=qa+parseInt(mxUtils.getValue(Y,mxConstants.STYLE_SPACING_TOP,0));ma=qa+parseInt(mxUtils.getValue(Y,+mxConstants.STYLE_SPACING_BOTTOM,0));var wa=qa+parseInt(mxUtils.getValue(Y,mxConstants.STYLE_SPACING_LEFT,0));qa+=parseInt(mxUtils.getValue(Y,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(wa)+"px";this.textarea.style.paddingRight=Math.round(qa)+"px";this.textarea.style.paddingTop=Math.round(S)+"px";this.textarea.style.paddingBottom=Math.round(ma)+"px";this.textarea.style.display="table-cell";this.textarea.style.flexDirection="";this.textarea.style.justifyContent="";+S=mxUtils.getValue(Y,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.verticalAlign=S==mxConstants.ALIGN_MIDDLE?"middle":S==mxConstants.ALIGN_BOTTOM?"bottom":"top";S=this.textarea.innerText;null!=S&&0<S.length&&(ca=this.graph.getAutosizeTextAvailableSpace(Y,ca.width,ca.height,x),null!=ca&&(S=mxUtils.htmlEntities(S,!1).replace(/\n/g,"<br>"),Y=this.graph.computeAutosizeTextFontSize(S,ca.availW,ca.availH,Y[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,Y[mxConstants.STYLE_FONTSTYLE],+"wrap"==Y[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=Y+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Y*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight=+"",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",K.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(x,N){if("0"==mxUtils.getValue(x.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var S=this.graph.getEditingValue(x.cell,N);"1"==mxUtils.getValue(x.style,"nl2Br","1")&&(S=S.replace(/\n/g,"<br/>"));+return Graph.sanitizeHtml(S,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(x,N){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(x.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(x){if("0"==mxUtils.getValue(x.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(x.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 M=mxCellEditor.prototype.stopEditing;+mxCellEditor.prototype.stopEditing=function(x){this.codeViewMode&&this.toggleViewMode();M.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(x){}};var V=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(x,N){this.graph.getModel().beginUpdate();try{V.apply(this,arguments),""==N&&this.graph.isCellDeletable(x.cell)&&0==this.graph.model.getChildCount(x.cell)&&this.graph.isTransparentState(x)&&+this.graph.removeCells([x.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(x){x=mxUtils.getValue(x.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);x==mxConstants.NONE&&(x=null);return x};mxCellEditor.prototype.getBorderColor=function(x){x=mxUtils.getValue(x.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);x==mxConstants.NONE&&(x=null);return x};mxCellEditor.prototype.getMinimumSize=function(x){var N=this.graph.getView().scale;return new mxRectangle(0,+0,null==x.text?30:x.text.size*N+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(x,N){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(N.getEvent)};mxGraphView.prototype.formatUnitText=function(x){return x?d(x,this.unit):x};mxGraphHandler.prototype.updateHint=function(x){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,S=this.graph.view.scale;x=this.roundLength((this.bounds.x+this.currentDx)/S-N.x);N=this.roundLength((this.bounds.y+this.currentDy)/S-N.y);S=this.graph.view.unit;this.hint.innerHTML=d(x,S)+", "+d(N,S);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 Q=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(x,N){Q.apply(this,arguments);var S=this.graph.getCellStyle(x);if(null==S.childLayout){var Y=this.graph.model.getParent(x),ca=null!=Y?this.graph.getCellGeometry(Y):null;if(null!=ca&&(S=this.graph.getCellStyle(Y),"stackLayout"==S.childLayout)){var ma=parseFloat(mxUtils.getValue(S,"stackBorder",mxStackLayout.prototype.border));+S="1"==mxUtils.getValue(S,"horizontalStack","1");var qa=this.graph.getActualStartSize(Y);ca=ca.clone();S?ca.height=N.height+qa.y+qa.height+2*ma:ca.width=N.width+qa.x+qa.width+2*ma;this.graph.model.setGeometry(Y,ca)}}};var ja=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function x(wa){S.get(wa)||(S.put(wa,!0),ca.push(wa))}for(var N=ja.apply(this,arguments),S=new mxDictionary,Y=this.graph.model,ca=[],ma=0;ma<N.length;ma++){var qa=+N[ma];this.graph.isTableCell(qa)?x(Y.getParent(Y.getParent(qa))):this.graph.isTableRow(qa)&&x(Y.getParent(qa));x(qa)}return ca};var ea=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(x){return ea.apply(this,arguments)&&!mxEvent.isControlDown(x.getEvent())&&!mxEvent.isShiftDown(x.getEvent())};var da=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return da.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 ia=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(x){var N=ia.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=1;return N};var la=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(x){var N=la.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=+1;return N};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var x=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+x.x/2,this.bounds.y+this.rotationHandleVSpacing-x.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(x,N){return this.graph.isRecursiveVertexResize(x)&&!mxEvent.isAltDown(N.getEvent())};mxVertexHandler.prototype.isCenteredEvent=function(x,N){return mxEvent.isControlDown(N.getEvent())||+mxEvent.isMetaDown(N.getEvent())};var ka=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return ka.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.isConnectHandleVisible=function(){return Editor.showConnectHandle&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&+!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var x=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+x.x/2,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+x.y/2)};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 W=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return W.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var k=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(x){return x.tableHandle||k.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=+function(){var x=0;this.graph.isTableRow(this.state.cell)?x=1:this.graph.isTableCell(this.state.cell)&&(x=2);return x};var y=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return y.apply(this,arguments).grow(-this.getSelectionBorderInset())};var J=null,R=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==J&&(J=mxCellRenderer.defaultShapes.tableLine);var x=R.apply(this,arguments);+if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var N=function(ib,jb,Ta){for(var qb=[],hb=0;hb<ib.length;hb++){var cb=ib[hb];qb.push(null==cb?null:new mxPoint((sa+cb.x+jb)*ma,(ya+cb.y+Ta)*ma))}return qb},S=this,Y=this.graph,ca=Y.model,ma=Y.view.scale,qa=this.state,wa=this.selectionBorder,sa=this.state.origin.x+Y.view.translate.x,ya=this.state.origin.y+Y.view.translate.y;null==x&&(x=[]);var Ga=Y.view.getCellStates(ca.getChildCells(this.state.cell,!0));if(0<Ga.length){var Ya=+ca.getChildCells(Ga[0].cell,!0),Va=Y.getTableLines(this.state.cell,!1,!0),eb=Y.getTableLines(this.state.cell,!0,!1);for(ca=0;ca<Ga.length;ca++)mxUtils.bind(this,function(ib){var jb=Ga[ib],Ta=null;if(Y.isCellMovable(jb.cell)){Ta=ib<Ga.length-1?Ga[ib+1]:null;Ta=null!=Ta?Y.getCellGeometry(Ta.cell):null;var qb=null!=Ta&&null!=Ta.alternateBounds?Ta.alternateBounds:Ta;Ta=null!=eb[ib]?new J(eb[ib],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Ta.isDashed=wa.isDashed;Ta.svgStrokeTolerance++;+Ta=new mxHandle(jb,"row-resize",null,Ta);Ta.tableHandle=!0;var hb=0;Ta.shape.node.parentNode.insertBefore(Ta.shape.node,Ta.shape.node.parentNode.firstChild);Ta.redraw=function(){if(null!=this.shape){this.shape.stroke=0==hb?mxConstants.NONE:wa.stroke;if(this.shape.constructor==J)this.shape.line=N(eb[ib],0,hb),this.shape.updateBoundsFromLine();else{var fb=Y.getActualStartSize(qa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+hb*ma;this.shape.bounds.x=qa.x+(ib==+Ga.length-1?0:fb.x*ma);this.shape.bounds.width=qa.width-(ib==Ga.length-1?0:fb.width+fb.x+ma)}this.shape.redraw()}};var cb=!1;Ta.setPosition=function(fb,lb,ub){hb=Math.max(Graph.minTableRowHeight-fb.height,lb.y-fb.y-fb.height);cb=mxEvent.isShiftDown(ub.getEvent());null!=qb&&cb&&(hb=Math.min(hb,qb.height-Graph.minTableRowHeight))};Ta.execute=function(fb){if(0!=hb)Y.setTableRowHeight(this.state.cell,hb,!cb);else if(!S.blockDelayedSelection){var lb=Y.getCellAt(fb.getGraphX(),fb.getGraphY())||qa.cell;+Y.graphHandler.selectCellForEvent(lb,fb)}hb=0};Ta.reset=function(){hb=0}}x.push(Ta)})(ca);for(ca=0;ca<Ya.length;ca++)mxUtils.bind(this,function(ib){var jb=Y.view.getState(Ya[ib]),Ta=Y.getCellGeometry(Ya[ib]),qb=null!=Ta.alternateBounds?Ta.alternateBounds:Ta;null==jb&&(jb=new mxCellState(Y.view,Ya[ib],Y.getCellStyle(Ya[ib])),jb.x=qa.x+Ta.x*ma,jb.y=qa.y+Ta.y*ma,jb.width=qb.width*ma,jb.height=qb.height*ma,jb.updateCachedBounds());Ta=ib<Ya.length-1?Ya[ib+1]:null;Ta=null!=Ta?Y.getCellGeometry(Ta):null;+var hb=null!=Ta&&null!=Ta.alternateBounds?Ta.alternateBounds:Ta;Ta=null!=Va[ib]?new J(Va[ib],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Ta.isDashed=wa.isDashed;Ta.svgStrokeTolerance++;jb=new mxHandle(jb,"col-resize",null,Ta);jb.tableHandle=!0;var cb=0;jb.shape.node.parentNode.insertBefore(jb.shape.node,jb.shape.node.parentNode.firstChild);jb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==cb?mxConstants.NONE:wa.stroke;if(this.shape.constructor==J)this.shape.line=+N(Va[ib],cb,0),this.shape.updateBoundsFromLine();else{var lb=Y.getActualStartSize(qa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(qb.width+cb)*ma;this.shape.bounds.y=qa.y+(ib==Ya.length-1?0:lb.y*ma);this.shape.bounds.height=qa.height-(ib==Ya.length-1?0:(lb.height+lb.y)*ma)}this.shape.redraw()}};var fb=!1;jb.setPosition=function(lb,ub,ob){cb=Math.max(Graph.minTableColumnWidth-qb.width,ub.x-lb.x-qb.width);fb=mxEvent.isShiftDown(ob.getEvent());null==hb||fb||(cb=Math.min(cb,hb.width-+Graph.minTableColumnWidth))};jb.execute=function(lb){if(0!=cb)Y.setTableColumnWidth(this.state.cell,cb,fb);else if(!S.blockDelayedSelection){var ub=Y.getCellAt(lb.getGraphX(),lb.getGraphY())||qa.cell;Y.graphHandler.selectCellForEvent(ub,lb)}cb=0};jb.positionChanged=function(){};jb.reset=function(){cb=0};x.push(jb)})(ca)}}return null!=x?x.reverse():null};var X=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(x){X.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=x?"":"hidden");if(null!=this.cornerHandles)for(N=0;N<this.cornerHandles.length;N++)this.cornerHandles[N].node.style.visibility=x?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var x=this.isMoveHandlesVisible();x&&null==this.moveHandles?+this.moveHandles=this.createMoveHandles():x||null==this.moveHandles||this.destroyMoveHandles();if(x&&null==this.moveHandles){for(x=0;x<this.moveHandles.length;x++)null!=this.moveHandles[x]&&this.moveHandles[x].parentNode.removeChild(this.moveHandles[x]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var x=this.graph,N=x.model,S=[],Y=0;Y<N.getChildCount(this.state.cell);Y++)mxUtils.bind(this,function(ca){if(null!=ca&&N.isVertex(ca.cell)&&x.isCellMovable(ca.cell)){var ma=+new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ma=new mxImageShape(ma,this.rowHandleImage.src);ma.rowState=ca;ma.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ma.init(this.graph.getView().getOverlayPane());ma.node.style.cursor="move";mxEvent.addGestureListeners(ma.node,mxUtils.bind(this,function(qa){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(qa)&&this.graph.isCellSelected(ca.cell)||+this.graph.selectCellForEvent(ca.cell,qa);mxEvent.isPopupTrigger(qa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(qa),mxEvent.getClientY(qa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(qa),this.graph.isMouseDown=!0);mxEvent.consume(qa)}),null,mxUtils.bind(this,function(qa){mxEvent.isPopupTrigger(qa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(qa),mxEvent.getClientY(qa),ca.cell,qa),mxEvent.consume(qa))}));+S.push(ma)}else S.push(null)})(this.graph.view.getState(N.getChildAt(this.state.cell,Y)));return S};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var x=0;x<this.moveHandles.length;x++)null!=this.moveHandles[x]&&this.moveHandles[x].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var x=0;x<this.cornerHandles.length;x++)null!=this.cornerHandles[x]&&null!=this.cornerHandles[x].node&&null!=+this.cornerHandles[x].node.parentNode&&this.cornerHandles[x].node.parentNode.removeChild(this.cornerHandles[x].node);this.cornerHandles=null}};var aa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){aa.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 x=0;4>x;x++){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();x=this.graph.getLinkForCell(this.state.cell);N=this.graph.getLinksForState(this.state);+this.updateLinkHint(x,N)};var Z=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var x=new mxPoint(0,0),N=this.tolerance,S=this.state.style.shape;null==mxCellRenderer.defaultShapes[S]&&mxStencilRegistry.getStencil(S);S=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!S&&null!=this.customHandles)for(var Y=0;Y<this.customHandles.length;Y++)if(null!=this.customHandles[Y]&&null!=this.customHandles[Y].shape&&+null!=this.customHandles[Y].shape.bounds){var ca=this.customHandles[Y].shape.bounds,ma=ca.getCenterX(),qa=ca.getCenterY();if(Math.abs(this.state.x-ma)<ca.width/2||Math.abs(this.state.y-qa)<ca.height/2||Math.abs(this.state.x+this.state.width-ma)<ca.width/2||Math.abs(this.state.y+this.state.height-qa)<ca.height/2){S=!0;break}}S&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(N/=2,this.graph.isTable(this.state.cell)&&(N+=7),x.x=this.sizers[0].bounds.width+N,x.y=this.sizers[0].bounds.height++N):x=Z.apply(this,arguments);return x};mxVertexHandler.prototype.updateHint=function(x){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{x=this.state.view.scale;var N=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/x),N)+" x "+d(this.roundLength(this.bounds.height/x),N)}x=mxUtils.getBoundingBox(this.bounds,+null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==x&&(x=this.bounds);this.hint.style.left=x.x+Math.round((x.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=x.y+x.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 U=mxEdgeHandler.prototype.refresh;+mxEdgeHandler.prototype.refresh=function(){U.apply(this,arguments);var x=this.graph.getLinkForCell(this.state.cell),N=this.graph.getLinksForState(this.state);this.updateLinkHint(x,N)};var ba=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(x,N){ba.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 fa=mxEdgeHandler.prototype.mouseUp;+mxEdgeHandler.prototype.mouseUp=function(x,N){fa.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(x,N,S){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var Y=this.graph.view.translate,ca=this.graph.view.scale,ma=this.roundLength(N.x/ca-Y.x);Y=this.roundLength(N.y/ca-Y.y);var qa=this.graph.view.unit;this.hint.innerHTML=+d(ma,qa)+", "+d(Y,qa);this.hint.style.visibility="visible";null!=S&&(S.view.updateEdgeBounds(S),this.hint.innerHTML+=" ("+(qa==mxConstants.POINTS?Math.round(S.length/ca):d(S.length/ca,qa))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(S=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*S.x)+"%, "+Math.round(100*S.y)+"%]"):this.marker.hasValidState()&&+(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(x.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(x.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=+Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',24,24);HoverIcons.prototype.connectHandle=Graph.createSvgImage(16,16,'<circle cx="12" cy="12" r="10" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><path transform="translate(5,5) scale(0.583)" d="M6 18v-3h7.6L4 5.4 5.4 4 15 13.6V6h3v12z" fill="#fff"/>',24,24);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="'+HoverIcons.prototype.arrowFill+@@ -2795,53 +2799,53 @@ HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" f'"/>');mxEdgeHandler.prototype.handleImage=HoverIcons.prototype.mainHandle;mxEdgeHandler.prototype.endHandleImage=HoverIcons.prototype.endMainHandle;mxEdgeHandler.prototype.terminalHandleImage=HoverIcons.prototype.terminalHandle;mxEdgeHandler.prototype.endTerminalHandleImage=HoverIcons.prototype.endTerminalHandle;mxEdgeHandler.prototype.fixedHandleImage=HoverIcons.prototype.fixedHandle;mxEdgeHandler.prototype.endFixedHandleImage=HoverIcons.prototype.endFixedHandle;mxEdgeHandler.prototype.labelHandleImage=HoverIcons.prototype.secondaryHandle;mxOutline.prototype.sizerImage=HoverIcons.prototype.mainHandle;null!=window.Sidebar&&(Sidebar.prototype.triangleUp=HoverIcons.prototype.triangleUp,Sidebar.prototype.triangleRight=HoverIcons.prototype.triangleRight,Sidebar.prototype.triangleDown=HoverIcons.prototype.triangleDown,Sidebar.prototype.triangleLeft=HoverIcons.prototype.triangleLeft,Sidebar.prototype.refreshTarget=HoverIcons.prototype.refreshTarget,Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop);mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSizers=!0;mxVertexHandler.prototype.livePreview=!0;mxGraphHandler.prototype.maxLivePreview=32;mxGraphHandler.prototype.previewColor="light-dark(#000000, #cccccc)";mxRubberband.prototype.defaultOpacity=30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=-!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(y){return!mxEvent.isShiftDown(y.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(y){return!mxEvent.isShiftDown(y.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||-0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(y){return mxEvent.isMouseEvent(y.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(y){var P=y.getEvent();return null==y.getState()&&!mxEvent.isMouseEvent(P)||mxEvent.isPopupTrigger(P)&&-(null==y.getState()||mxEvent.isControlDown(P)||mxEvent.isShiftDown(P))}}else mxPanningHandler.prototype.isPanningTrigger=function(y){var P=y.getEvent();return mxEvent.isLeftMouseButton(P)&&(this.useLeftButtonForPanning&&null==y.getState()||mxEvent.isControlDown(P)&&!mxEvent.isShiftDown(P))||this.usePopupTrigger&&mxEvent.isPopupTrigger(P)};mxRubberband.prototype.isSpaceEvent=function(y){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(y.getEvent())||-mxEvent.isMetaDown(y.getEvent()))&&mxEvent.isShiftDown(y.getEvent())&&mxEvent.isAltDown(y.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(y,P){if(this.cancelled)this.cancelled=!1,P.consume();else{var S=null!=this.div&&"none"!=this.div.style.display,X=null,ba=null,ma=y=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(X=this.first.x,ba=this.first.y,y=-(this.currentX-X)/this.graph.view.scale,ma=(this.currentY-ba)/this.graph.view.scale,mxEvent.isAltDown(P.getEvent())||(y=this.graph.snap(y),ma=this.graph.snap(ma),this.graph.isGridEnabled()||(Math.abs(y)<this.graph.tolerance&&(y=0),Math.abs(ma)<this.graph.tolerance&&(ma=0))));this.reset();if(S){if(this.isSpaceEvent(P)){this.graph.model.beginUpdate();try{var ra=this.graph.getCellsBeyond(X,ba,this.graph.getDefaultParent(),!0,!0);for(S=0;S<ra.length;S++)if(this.graph.isCellMovable(ra[S])){var wa=this.graph.view.getState(ra[S]),-sa=this.graph.getCellGeometry(ra[S]);null!=wa&&null!=sa&&(sa=sa.clone(),sa.translate(y,ma),this.graph.model.setGeometry(ra[S],sa))}}finally{this.graph.model.endUpdate()}}else ra=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(ra,P.getEvent());P.consume()}}};mxRubberband.prototype.mouseMove=function(y,P){if(!P.isConsumed()&&null!=this.first){var S=mxUtils.getScrollOrigin(this.graph.container);y=mxUtils.getOffset(this.graph.container);S.x-=y.x;S.y-=y.y;y=P.getX()+S.x;S=-P.getY()+S.y;var X=this.first.x-y,ba=this.first.y-S,ma=this.graph.tolerance;if(null!=this.div||Math.abs(X)>ma||Math.abs(ba)>ma)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(y,S),this.isSpaceEvent(P)?(y=this.x+this.width,S=this.y+this.height,X=this.graph.view.scale,mxEvent.isAltDown(P.getEvent())||(this.width=this.graph.snap(this.width/X)*X,this.height=this.graph.snap(this.height/X)*X,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),-this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=y-this.width),this.y<this.first.y&&(this.y=S-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=+!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(x){return!mxEvent.isShiftDown(x.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(x){return!mxEvent.isShiftDown(x.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||+0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(x){return mxEvent.isMouseEvent(x.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(x){var N=x.getEvent();return null==x.getState()&&!mxEvent.isMouseEvent(N)||mxEvent.isPopupTrigger(N)&&+(null==x.getState()||mxEvent.isControlDown(N)||mxEvent.isShiftDown(N))}}else mxPanningHandler.prototype.isPanningTrigger=function(x){var N=x.getEvent();return mxEvent.isLeftMouseButton(N)&&(this.useLeftButtonForPanning&&null==x.getState()||mxEvent.isControlDown(N)&&!mxEvent.isShiftDown(N))||this.usePopupTrigger&&mxEvent.isPopupTrigger(N)};mxRubberband.prototype.isSpaceEvent=function(x){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(x.getEvent())||+mxEvent.isMetaDown(x.getEvent()))&&mxEvent.isShiftDown(x.getEvent())&&mxEvent.isAltDown(x.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(x,N){if(this.cancelled)this.cancelled=!1,N.consume();else{var S=null!=this.div&&"none"!=this.div.style.display,Y=null,ca=null,ma=x=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(Y=this.first.x,ca=this.first.y,x=+(this.currentX-Y)/this.graph.view.scale,ma=(this.currentY-ca)/this.graph.view.scale,mxEvent.isAltDown(N.getEvent())||(x=this.graph.snap(x),ma=this.graph.snap(ma),this.graph.isGridEnabled()||(Math.abs(x)<this.graph.tolerance&&(x=0),Math.abs(ma)<this.graph.tolerance&&(ma=0))));this.reset();if(S){if(this.isSpaceEvent(N)){this.graph.model.beginUpdate();try{var qa=this.graph.getCellsBeyond(Y,ca,this.graph.getDefaultParent(),!0,!0);for(S=0;S<qa.length;S++)if(this.graph.isCellMovable(qa[S])){var wa=this.graph.view.getState(qa[S]),+sa=this.graph.getCellGeometry(qa[S]);null!=wa&&null!=sa&&(sa=sa.clone(),sa.translate(x,ma),this.graph.model.setGeometry(qa[S],sa))}}finally{this.graph.model.endUpdate()}}else qa=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(qa,N.getEvent());N.consume()}}};mxRubberband.prototype.mouseMove=function(x,N){if(!N.isConsumed()&&null!=this.first){var S=mxUtils.getScrollOrigin(this.graph.container);x=mxUtils.getOffset(this.graph.container);S.x-=x.x;S.y-=x.y;x=N.getX()+S.x;S=+N.getY()+S.y;var Y=this.first.x-x,ca=this.first.y-S,ma=this.graph.tolerance;if(null!=this.div||Math.abs(Y)>ma||Math.abs(ca)>ma)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(x,S),this.isSpaceEvent(N)?(x=this.x+this.width,S=this.y+this.height,Y=this.graph.view.scale,mxEvent.isAltDown(N.getEvent())||(this.width=this.graph.snap(this.width/Y)*Y,this.height=this.graph.snap(this.height/Y)*Y,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),+this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=x-this.width),this.y<this.first.y&&(this.y=S-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),-this.secondDiv=null)),P.consume()}};var na=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);na.apply(this,arguments)};var qa=(new Date).getTime(),ta=0,ua=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(y,P,S,X){ua.apply(this,arguments);S!=this.currentTerminalState?(qa=(new Date).getTime(),ta=0):ta=(new Date).getTime()-qa;this.currentTerminalState=-S};var Ba=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(y){return mxEvent.isShiftDown(y.getEvent())&&mxEvent.isAltDown(y.getEvent())?!1:null!=this.currentTerminalState&&y.getState()==this.currentTerminalState&&2E3<ta||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&Ba.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(y,P,S){P=null!=y&&0==y;var X=this.state.getVisibleTerminalState(P);-y=null!=y&&null!=this.state.absolutePoints&&(0==y||y>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==y)?this.graph.getConnectionConstraint(this.state,X,P):null;S=null!=(null!=y?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(P),y):null)?S?this.endFixedHandleImage:this.fixedHandleImage:null!=y&&null!=X?S?this.endTerminalHandleImage:this.terminalHandleImage:S?this.endHandleImage:this.handleImage;if(null!=S)return S=new mxImageShape(new mxRectangle(0,0,-S.width,S.height),S.src),S.preserveImageAspect=!1,S;S=mxConstants.HANDLE_SIZE;this.preferHtml&&--S;return new mxRectangleShape(new mxRectangle(0,0,S,S),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var za=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(y,P,S,X){X=P==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:P==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle:P==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:-X;return za.apply(this,arguments)};var Aa=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=function(){var y=Aa.apply(this,arguments);null==this.connectShape&&this.isConnectHandleVisible()&&(this.connectShape=this.createSizer("copy",mxEvent.CONNECT_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),y.push(this.connectShape));return y};var Ga=mxVertexHandler.prototype.destroySizers;mxVertexHandler.prototype.destroySizers=function(){Ga.apply(this,arguments);this.connectShape=-null};var Ra=mxVertexHandler.prototype.getHandleForEvent;mxVertexHandler.prototype.getHandleForEvent=function(y){if(null!=this.connectShape&&null!=this.connectShape.node&&"hidden"!=this.connectShape.node.style.visibility){var P=mxEvent.isMouseEvent(y.getEvent())?1:this.tolerance;P=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<P)?new mxRectangle(y.getGraphX()-P,y.getGraphY()-P,2*P,2*P):null;if(y.isSource(this.connectShape)||null!=P&&this.connectShape.intersectsRectangle(P))return mxEvent.CONNECT_HANDLE}return Ra.apply(this,-arguments)};var Ha=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(y,P){if(!P.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(P)==mxEvent.CONNECT_HANDLE){var S=P.getGraphX(),X=P.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,S,X);this.graph.isMouseTrigger=mxEvent.isMouseEvent(P.getEvent());this.graph.isMouseDown=-!0;S=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=S&&S.setHandlesVisible(!1);P.consume()}else Ha.apply(this,arguments)};var Qa=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(y){if(null!=y&&1==y.length){var P=this.graph.getModel(),S=P.getParent(y[0]),X=this.graph.getCellGeometry(y[0]);if(P.isEdge(S)&&null!=X&&X.relative&&(P=this.graph.view.getState(y[0]),null!=P&&2>P.width&&2>P.height&&null!=P.text&&null!=P.text.boundingBox))return mxRectangle.fromRectangle(P.text.boundingBox)}return Qa.apply(this,-arguments)};var eb=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var y=eb.apply(this,arguments),P=[],S=0;S<y.length;S++)"1"!=mxUtils.getValue(y[S].style,"part","0")&&P.push(y[S]);return P};var Ma=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(y){var P=this.graph.getModel(),S=P.getParent(y.cell),X=this.graph.getCellGeometry(y.cell);return P.isEdge(S)&&null!=X&&X.relative&&2>y.width&&2>y.height&&null!=-y.text&&null!=y.text.boundingBox?(P=y.text.unrotatedBoundingBox||y.text.boundingBox,new mxRectangle(Math.round(P.x),Math.round(P.y),Math.round(P.width),Math.round(P.height))):Ma.apply(this,arguments)};var ya=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(y,P){var S=this.graph.getModel(),X=S.getParent(this.state.cell),ba=this.graph.getCellGeometry(this.state.cell),ma=this.getHandleForEvent(P);(ma==mxEvent.ROTATION_HANDLE||ma==mxEvent.CONNECT_HANDLE||!S.isEdge(X)||-null==ba||!ba.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&ya.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var y=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),P=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&y==mxConstants.NONE&&P==mxConstants.NONE?(y=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,-0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,y,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var Sa=mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(y){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var P=this.graph.view.scale,S=this.state.style,X=this.roundLength(this.bounds.width/P),ba=this.roundLength(this.bounds.height/P);P=this.graph.cellRenderer.getLabelValue(this.state);-if(null!=P&&0<P.length&&(X=this.graph.getAutosizeTextAvailableSpace(S,X,ba,this.state),null!=X)){this.graph.isHtmlLabel(this.state.cell)||(P=mxUtils.htmlEntities(P,!1));P=P.replace(/\n/g,"<br>");X=this.graph.computeAutosizeTextFontSize(P,X.availW,X.availH,S[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,S[mxConstants.STYLE_FONTSTYLE],"wrap"==S[mxConstants.STYLE_WHITE_SPACE]);P=S[mxConstants.STYLE_FONTSIZE];S[mxConstants.STYLE_FONTSIZE]=X;Sa.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]=-P;return}}Sa.apply(this,arguments)};var Oa=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(y,P){Oa.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var Na=-mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(y,P){Na.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display=-"");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(y,P){try{if(null==y&&(null==P||0==P.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=y||null!=P&&0<P.length){var S=document.createElement("img");S.className="geAdaptiveAsset";S.setAttribute("src",Editor.editImage);S.setAttribute("title",mxResources.get("editLink"));S.setAttribute("width","14");S.setAttribute("height","14");S.style.paddingLeft="8px";-S.style.marginLeft="auto";S.style.marginBottom="-1px";S.style.cursor="pointer";var X=S.cloneNode(!0);X.setAttribute("src",Editor.trashImage);X.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));X.style.paddingLeft="4px";X.style.marginLeft="0";null==this.linkHint&&(this.linkHint=b(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),-mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=y){var ba=document.createElement("div");ba.style.display="flex";ba.style.alignItems="center";ba.appendChild(this.graph.createLinkForHint(y,null,this.state.cell));this.linkHint.appendChild(ba);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var ma=S.cloneNode(!0);ba.appendChild(ma);mxEvent.addListener(ma,-"click",mxUtils.bind(this,function(wa){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(wa)}));var ra=X.cloneNode(!0);ba.appendChild(ra);mxEvent.addListener(ra,"click",mxUtils.bind(this,function(wa){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(wa)}))}}if(null!=P)for(ba=0;ba<P.length;ba++)mxUtils.bind(this,function(wa,sa){var xa=document.createElement("div");xa.style.display="flex";xa.style.alignItems="center";xa.style.marginTop=null!=y||0<sa?"6px":-"0px";xa.appendChild(this.graph.createLinkForHint(wa.getAttribute("href"),mxUtils.getTextContent(wa),this.state.cell));var Fa=S.cloneNode(!0);xa.appendChild(Fa);var Ya=mxUtils.bind(this,function(Ua){var cb=document.createElement("div");cb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var hb=cb.getElementsByTagName("a")[sa];if(null!=hb){if(null==Ua||""==Ua){for(Ua=hb.cloneNode(!0).firstChild;null!=Ua;)hb.parentNode.insertBefore(Ua.cloneNode(!0),hb),Ua=Ua.nextSibling;hb.parentNode.removeChild(hb)}else hb.setAttribute("href",-Ua);this.graph.labelChanged(this.state.cell,cb.innerHTML)}});mxEvent.addListener(Fa,"click",mxUtils.bind(this,function(Ua){this.graph.showLinkDialog(wa.getAttribute("href")||"",mxResources.get("ok"),Ya);mxEvent.consume(Ua)}));Fa=X.cloneNode(!0);xa.appendChild(Fa);mxEvent.addListener(Fa,"click",mxUtils.bind(this,function(Ua){Ya();mxEvent.consume(Ua)}));this.linkHint.appendChild(xa)})(P[ba],ba)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(wa){}};mxEdgeHandler.prototype.updateLinkHint=-mxVertexHandler.prototype.updateLinkHint;var Pa=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var y=Pa.apply(this,arguments);y.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return y};var oa=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){oa.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};-var Da=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var y=0;y<this.moveHandles.length;y++)null!=this.moveHandles[y]&&(this.moveHandles[y].bounds.x=Math.round(this.moveHandles[y].rowState.x+this.moveHandles[y].rowState.width-this.moveHandles[y].bounds.width/2),this.moveHandles[y].bounds.y=Math.round(this.moveHandles[y].rowState.y+(this.moveHandles[y].rowState.height-this.moveHandles[y].bounds.height)/2),this.moveHandles[y].redraw());-if(null!=this.cornerHandles){y=this.getSelectionBorderInset();var P=this.cornerHandles,S=P[0].bounds.height/2;P[0].bounds.x=this.state.x-P[0].bounds.width/2+y;P[0].bounds.y=this.state.y-S+y;P[0].redraw();P[1].bounds.x=P[0].bounds.x+this.state.width-2*y;P[1].bounds.y=P[0].bounds.y;P[1].redraw();P[2].bounds.x=P[0].bounds.x;P[2].bounds.y=this.state.y+this.state.height-2*y;P[2].redraw();P[3].bounds.x=P[1].bounds.x;P[3].bounds.y=P[2].bounds.y;P[3].redraw();for(y=0;y<this.cornerHandles.length;y++)this.cornerHandles[y].node.style.display=-1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=this.moveHandles||1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?"none":"");Da.apply(this);null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.setAttribute("title",mxResources.get("plusTooltip")),y=null==this.moveHandles&&-1==this.graph.getSelectionCount()&&(null==this.index||this.index==mxEvent.CONNECT_HANDLE)&&!this.graph.isEditing()&&this.handlesVisible&&this.isHandlesVisible()&&this.isConnectHandleVisible(),this.connectShape.node.style.display=y?"":"none",this.connectShape.node.style.visibility=y?"":"hidden",y&&(P=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),y=Math.cos(P),P=Math.sin(P),S=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),-y=mxUtils.getRotatedPoint(this.getConnectHandlePosition(),y,P,S),this.moveSizerTo(this.connectShape,y.x,y.y)));null!=this.state&&null!=this.linkHint&&(y=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),P=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),S=mxUtils.getBoundingBox(P,this.state.style[mxConstants.STYLE_ROTATION]||"0",y),y=null!=S?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,P=null!=this.state.text?-this.state.text.boundingBox:null,null==S&&(S=this.state),S=S.y+S.height,null!=P&&(S=Math.max(S,P.y+P.height)),this.linkHint.style.left=y.x+y.width/2+"px",this.linkHint.style.top=Math.round(S+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Ca=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Ca.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 Ja=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Ja.apply(this),-null!=this.state&&null!=this.linkHint)){var y=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(y=new mxRectangle(y.x,y.y,y.width,y.height),y.add(this.state.text.bounds));this.linkHint.style.left=y.x+y.width/2+"px";this.linkHint.style.top=Math.round(y.y+y.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 ib=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){ib.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(f,q,z){mxShape.call(this);this.line=f;this.stroke=q;this.strokewidth=null!=z?z:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function n(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function C(){mxActor.call(this)}function G(){mxCylinder.call(this)}function T(){mxCylinder.call(this)}function E(){mxCylinder.call(this)}function Q(){mxCylinder.call(this)}function M(){mxShape.call(this)}-function c(){mxShape.call(this)}function g(f,q,z,u){mxShape.call(this);this.bounds=f;this.fill=q;this.stroke=z;this.strokewidth=null!=u?u:1}function l(){mxActor.call(this)}function t(){mxCylinder.call(this)}function B(){mxCylinder.call(this)}function D(){mxActor.call(this)}function I(){mxActor.call(this)}function L(){mxActor.call(this)}function N(){mxActor.call(this)}function K(){mxActor.call(this)}function da(){mxActor.call(this)}function ja(){mxActor.call(this)}function ea(f,q){this.canvas=f;this.canvas.setLineJoin("round");+this.secondDiv=null)),N.consume()}};var na=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);na.apply(this,arguments)};var pa=(new Date).getTime(),ta=0,ua=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(x,N,S,Y){ua.apply(this,arguments);S!=this.currentTerminalState?(pa=(new Date).getTime(),ta=0):ta=(new Date).getTime()-pa;this.currentTerminalState=+S};var Ca=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(x){return mxEvent.isShiftDown(x.getEvent())&&mxEvent.isAltDown(x.getEvent())?!1:null!=this.currentTerminalState&&x.getState()==this.currentTerminalState&&2E3<ta||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&Ca.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(x,N,S){N=null!=x&&0==x;var Y=this.state.getVisibleTerminalState(N);+x=null!=x&&null!=this.state.absolutePoints&&(0==x||x>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==x)?this.graph.getConnectionConstraint(this.state,Y,N):null;S=null!=(null!=x?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(N),x):null)?S?this.endFixedHandleImage:this.fixedHandleImage:null!=x&&null!=Y?S?this.endTerminalHandleImage:this.terminalHandleImage:S?this.endHandleImage:this.handleImage;if(null!=S)return S=new mxImageShape(new mxRectangle(0,0,+S.width,S.height),S.src),S.preserveImageAspect=!1,S;S=mxConstants.HANDLE_SIZE;this.preferHtml&&--S;return new mxRectangleShape(new mxRectangle(0,0,S,S),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var Ba=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(x,N,S,Y){Y=N==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:N==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle:N==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:+Y;return Ba.apply(this,arguments)};var Aa=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=function(){var x=Aa.apply(this,arguments);null==this.connectShape&&this.isConnectHandleVisible()&&(this.connectShape=this.createSizer("copy",mxEvent.CONNECT_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),x.push(this.connectShape));return x};var Fa=mxVertexHandler.prototype.destroySizers;mxVertexHandler.prototype.destroySizers=function(){Fa.apply(this,arguments);this.connectShape=+null};var Sa=mxVertexHandler.prototype.getHandleForEvent;mxVertexHandler.prototype.getHandleForEvent=function(x){if(null!=this.connectShape&&null!=this.connectShape.node&&"hidden"!=this.connectShape.node.style.visibility){var N=mxEvent.isMouseEvent(x.getEvent())?1:this.tolerance;N=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<N)?new mxRectangle(x.getGraphX()-N,x.getGraphY()-N,2*N,2*N):null;if(x.isSource(this.connectShape)||null!=N&&this.connectShape.intersectsRectangle(N))return mxEvent.CONNECT_HANDLE}return Sa.apply(this,+arguments)};var La=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(x,N){if(!N.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(N)==mxEvent.CONNECT_HANDLE){var S=N.getGraphX(),Y=N.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,S,Y);this.graph.isMouseTrigger=mxEvent.isMouseEvent(N.getEvent());this.graph.isMouseDown=+!0;S=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=S&&S.setHandlesVisible(!1);N.consume()}else La.apply(this,arguments)};var Pa=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(x){if(null!=x&&1==x.length){var N=this.graph.getModel(),S=N.getParent(x[0]),Y=this.graph.getCellGeometry(x[0]);if(N.isEdge(S)&&null!=Y&&Y.relative&&(N=this.graph.view.getState(x[0]),null!=N&&2>N.width&&2>N.height&&null!=N.text&&null!=N.text.boundingBox))return mxRectangle.fromRectangle(N.text.boundingBox)}return Pa.apply(this,+arguments)};var db=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var x=db.apply(this,arguments),N=[],S=0;S<x.length;S++)"1"!=mxUtils.getValue(x[S].style,"part","0")&&N.push(x[S]);return N};var Ia=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(x){var N=this.graph.getModel(),S=N.getParent(x.cell),Y=this.graph.getCellGeometry(x.cell);return N.isEdge(S)&&null!=Y&&Y.relative&&2>x.width&&2>x.height&&null!=+x.text&&null!=x.text.boundingBox?(N=x.text.unrotatedBoundingBox||x.text.boundingBox,new mxRectangle(Math.round(N.x),Math.round(N.y),Math.round(N.width),Math.round(N.height))):Ia.apply(this,arguments)};var za=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(x,N){var S=this.graph.getModel(),Y=S.getParent(this.state.cell),ca=this.graph.getCellGeometry(this.state.cell),ma=this.getHandleForEvent(N);(ma==mxEvent.ROTATION_HANDLE||ma==mxEvent.CONNECT_HANDLE||!S.isEdge(Y)||+null==ca||!ca.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&za.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var x=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),N=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&x==mxConstants.NONE&&N==mxConstants.NONE?(x=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,+0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,x,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var Ua=mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(x){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var N=this.graph.view.scale,S=this.state.style,Y=this.roundLength(this.bounds.width/N),ca=this.roundLength(this.bounds.height/N);N=this.graph.cellRenderer.getLabelValue(this.state);+if(null!=N&&0<N.length&&(Y=this.graph.getAutosizeTextAvailableSpace(S,Y,ca,this.state),null!=Y)){this.graph.isHtmlLabel(this.state.cell)||(N=mxUtils.htmlEntities(N,!1));N=N.replace(/\n/g,"<br>");Y=this.graph.computeAutosizeTextFontSize(N,Y.availW,Y.availH,S[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,S[mxConstants.STYLE_FONTSTYLE],"wrap"==S[mxConstants.STYLE_WHITE_SPACE]);N=S[mxConstants.STYLE_FONTSIZE];S[mxConstants.STYLE_FONTSIZE]=Y;Ua.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]=+N;return}}Ua.apply(this,arguments)};var Qa=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(x,N){Qa.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var Ma=+mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(x,N){Ma.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display=+"");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(x,N){try{if(null==x&&(null==N||0==N.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=x||null!=N&&0<N.length){var S=document.createElement("img");S.className="geAdaptiveAsset";S.setAttribute("src",Editor.editImage);S.setAttribute("title",mxResources.get("editLink"));S.setAttribute("width","14");S.setAttribute("height","14");S.style.paddingLeft="8px";+S.style.marginLeft="auto";S.style.marginBottom="-1px";S.style.cursor="pointer";var Y=S.cloneNode(!0);Y.setAttribute("src",Editor.trashImage);Y.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));Y.style.paddingLeft="4px";Y.style.marginLeft="0";null==this.linkHint&&(this.linkHint=b(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),+mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=x){var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.appendChild(this.graph.createLinkForHint(x,null,this.state.cell));this.linkHint.appendChild(ca);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var ma=S.cloneNode(!0);ca.appendChild(ma);mxEvent.addListener(ma,+"click",mxUtils.bind(this,function(wa){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(wa)}));var qa=Y.cloneNode(!0);ca.appendChild(qa);mxEvent.addListener(qa,"click",mxUtils.bind(this,function(wa){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(wa)}))}}if(null!=N)for(ca=0;ca<N.length;ca++)mxUtils.bind(this,function(wa,sa){var ya=document.createElement("div");ya.style.display="flex";ya.style.alignItems="center";ya.style.marginTop=null!=x||0<sa?"6px":+"0px";ya.appendChild(this.graph.createLinkForHint(wa.getAttribute("href"),mxUtils.getTextContent(wa),this.state.cell));var Ga=S.cloneNode(!0);ya.appendChild(Ga);var Ya=mxUtils.bind(this,function(Va){var eb=document.createElement("div");eb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var ib=eb.getElementsByTagName("a")[sa];if(null!=ib){if(null==Va||""==Va){for(Va=ib.cloneNode(!0).firstChild;null!=Va;)ib.parentNode.insertBefore(Va.cloneNode(!0),ib),Va=Va.nextSibling;ib.parentNode.removeChild(ib)}else ib.setAttribute("href",+Va);this.graph.labelChanged(this.state.cell,eb.innerHTML)}});mxEvent.addListener(Ga,"click",mxUtils.bind(this,function(Va){this.graph.showLinkDialog(wa.getAttribute("href")||"",mxResources.get("ok"),Ya);mxEvent.consume(Va)}));Ga=Y.cloneNode(!0);ya.appendChild(Ga);mxEvent.addListener(Ga,"click",mxUtils.bind(this,function(Va){Ya();mxEvent.consume(Va)}));this.linkHint.appendChild(ya)})(N[ca],ca)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(wa){}};mxEdgeHandler.prototype.updateLinkHint=+mxVertexHandler.prototype.updateLinkHint;var Na=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var x=Na.apply(this,arguments);x.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return x};var xa=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){xa.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};+var Za=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var x=0;x<this.moveHandles.length;x++)null!=this.moveHandles[x]&&(this.moveHandles[x].bounds.x=Math.round(this.moveHandles[x].rowState.x+this.moveHandles[x].rowState.width-this.moveHandles[x].bounds.width/2),this.moveHandles[x].bounds.y=Math.round(this.moveHandles[x].rowState.y+(this.moveHandles[x].rowState.height-this.moveHandles[x].bounds.height)/2),this.moveHandles[x].redraw());+if(null!=this.cornerHandles){x=this.getSelectionBorderInset();var N=this.cornerHandles,S=N[0].bounds.height/2;N[0].bounds.x=this.state.x-N[0].bounds.width/2+x;N[0].bounds.y=this.state.y-S+x;N[0].redraw();N[1].bounds.x=N[0].bounds.x+this.state.width-2*x;N[1].bounds.y=N[0].bounds.y;N[1].redraw();N[2].bounds.x=N[0].bounds.x;N[2].bounds.y=this.state.y+this.state.height-2*x;N[2].redraw();N[3].bounds.x=N[1].bounds.x;N[3].bounds.y=N[2].bounds.y;N[3].redraw();for(x=0;x<this.cornerHandles.length;x++)this.cornerHandles[x].node.style.display=+1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=this.moveHandles||1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?"none":"");Za.apply(this);null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.setAttribute("title",mxResources.get("plusTooltip")),x=null==this.moveHandles&&+1==this.graph.getSelectionCount()&&(null==this.index||this.index==mxEvent.CONNECT_HANDLE)&&!this.graph.isEditing()&&this.handlesVisible&&this.isHandlesVisible()&&this.isConnectHandleVisible(),this.connectShape.node.style.display=x?"":"none",this.connectShape.node.style.visibility=x?"":"hidden",x&&(N=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),x=Math.cos(N),N=Math.sin(N),S=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),+x=mxUtils.getRotatedPoint(this.getConnectHandlePosition(),x,N,S),this.moveSizerTo(this.connectShape,x.x,x.y)));null!=this.state&&null!=this.linkHint&&(x=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),N=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),S=mxUtils.getBoundingBox(N,this.state.style[mxConstants.STYLE_ROTATION]||"0",x),x=null!=S?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,N=null!=this.state.text?+this.state.text.boundingBox:null,null==S&&(S=this.state),S=S.y+S.height,null!=N&&(S=Math.max(S,N.y+N.height)),this.linkHint.style.left=x.x+x.width/2+"px",this.linkHint.style.top=Math.round(S+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Oa=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Oa.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 ra=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(ra.apply(this),+null!=this.state&&null!=this.linkHint)){var x=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(x=new mxRectangle(x.x,x.y,x.width,x.height),x.add(this.state.text.bounds));this.linkHint.style.left=x.x+x.width/2+"px";this.linkHint.style.top=Math.round(x.y+x.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Da=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){Da.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility=+"")};var Ra=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ra.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(f,q,z){mxShape.call(this);this.line=f;this.stroke=q;this.strokewidth=null!=z?z:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function n(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function C(){mxActor.call(this)}function G(){mxCylinder.call(this)}function T(){mxCylinder.call(this)}function E(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function L(){mxShape.call(this)}+function c(){mxShape.call(this)}function g(f,q,z,u){mxShape.call(this);this.bounds=f;this.fill=q;this.stroke=z;this.strokewidth=null!=u?u:1}function l(){mxActor.call(this)}function t(){mxCylinder.call(this)}function B(){mxCylinder.call(this)}function D(){mxActor.call(this)}function I(){mxActor.call(this)}function K(){mxActor.call(this)}function M(){mxActor.call(this)}function V(){mxActor.call(this)}function Q(){mxActor.call(this)}function ja(){mxActor.call(this)}function ea(f,q){this.canvas=f;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=q;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,ea.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,ea.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,ea.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,ea.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=-mxUtils.bind(this,ea.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,ea.prototype.arcTo)}function ca(){mxRectangleShape.call(this)}function fa(){mxRectangleShape.call(this)}function la(){mxActor.call(this)}function ka(){mxActor.call(this)}function V(){mxActor.call(this)}function k(){mxRectangleShape.call(this)}function x(){mxRectangleShape.call(this)}function J(){mxCylinder.call(this)}function R(){mxShape.call(this)}function Y(){mxShape.call(this)}function Z(){mxEllipse.call(this)}-function W(){mxShape.call(this)}function U(){mxShape.call(this)}function aa(){mxRectangleShape.call(this)}function ia(){mxShape.call(this)}function na(){mxShape.call(this)}function qa(){mxShape.call(this)}function ta(){mxShape.call(this)}function ua(){mxShape.call(this)}function Ba(){mxCylinder.call(this)}function za(){mxCylinder.call(this)}function Aa(){mxRectangleShape.call(this)}function Ga(){mxDoubleEllipse.call(this)}function Ra(){mxDoubleEllipse.call(this)}function Ha(){mxArrowConnector.call(this);-this.spacing=0}function Qa(){mxArrowConnector.call(this);this.spacing=0}function eb(){mxActor.call(this)}function Ma(){mxRectangleShape.call(this)}function ya(){mxActor.call(this)}function Sa(){mxActor.call(this)}function Oa(){mxActor.call(this)}function Na(){mxActor.call(this)}function Pa(){mxActor.call(this)}function oa(){mxActor.call(this)}function Da(){mxActor.call(this)}function Ca(){mxActor.call(this)}function Ja(){mxActor.call(this)}function Xa(){mxActor.call(this)}function ib(){mxEllipse.call(this)}-function y(){mxEllipse.call(this)}function P(){mxEllipse.call(this)}function S(){mxRhombus.call(this)}function X(){mxEllipse.call(this)}function ba(){mxEllipse.call(this)}function ma(){mxEllipse.call(this)}function ra(){mxEllipse.call(this)}function wa(){mxActor.call(this)}function sa(){mxActor.call(this)}function xa(){mxActor.call(this)}function Fa(f,q,z,u){mxShape.call(this);this.bounds=f;this.fill=q;this.stroke=z;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=-!0;this.indent=2;this.rectOutline="single"}function Ya(){mxConnector.call(this)}function Ua(){mxConnector.call(this)}function cb(){mxActor.call(this)}function hb(f,q,z,u,A,F,H,ha,O,va){H+=O;var pa=u.clone();u.x-=A*(2*H+O);u.y-=F*(2*H+O);A*=H+O;F*=H+O;return function(){f.ellipse(pa.x-A-H,pa.y-F-H,2*H,2*H);va?f.fillAndStroke():f.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var f=null;if(null!=this.line)for(var q=0;q<this.line.length;q++){var z=this.line[q];null!=z&&+mxUtils.bind(this,ea.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,ea.prototype.arcTo)}function da(){mxRectangleShape.call(this)}function ia(){mxRectangleShape.call(this)}function la(){mxActor.call(this)}function ka(){mxActor.call(this)}function W(){mxActor.call(this)}function k(){mxRectangleShape.call(this)}function y(){mxRectangleShape.call(this)}function J(){mxCylinder.call(this)}function R(){mxShape.call(this)}function X(){mxShape.call(this)}function aa(){mxEllipse.call(this)}+function Z(){mxShape.call(this)}function U(){mxShape.call(this)}function ba(){mxRectangleShape.call(this)}function fa(){mxShape.call(this)}function na(){mxShape.call(this)}function pa(){mxShape.call(this)}function ta(){mxShape.call(this)}function ua(){mxShape.call(this)}function Ca(){mxCylinder.call(this)}function Ba(){mxCylinder.call(this)}function Aa(){mxRectangleShape.call(this)}function Fa(){mxDoubleEllipse.call(this)}function Sa(){mxDoubleEllipse.call(this)}function La(){mxArrowConnector.call(this);+this.spacing=0}function Pa(){mxArrowConnector.call(this);this.spacing=0}function db(){mxActor.call(this)}function Ia(){mxRectangleShape.call(this)}function za(){mxActor.call(this)}function Ua(){mxActor.call(this)}function Qa(){mxActor.call(this)}function Ma(){mxActor.call(this)}function Na(){mxActor.call(this)}function xa(){mxActor.call(this)}function Za(){mxActor.call(this)}function Oa(){mxActor.call(this)}function ra(){mxActor.call(this)}function Da(){mxActor.call(this)}function Ra(){mxEllipse.call(this)}+function x(){mxEllipse.call(this)}function N(){mxEllipse.call(this)}function S(){mxRhombus.call(this)}function Y(){mxEllipse.call(this)}function ca(){mxEllipse.call(this)}function ma(){mxEllipse.call(this)}function qa(){mxEllipse.call(this)}function wa(){mxActor.call(this)}function sa(){mxActor.call(this)}function ya(){mxActor.call(this)}function Ga(f,q,z,u){mxShape.call(this);this.bounds=f;this.fill=q;this.stroke=z;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=+!0;this.indent=2;this.rectOutline="single"}function Ya(){mxConnector.call(this)}function Va(){mxConnector.call(this)}function eb(){mxActor.call(this)}function ib(f,q,z,u,A,F,H,ha,O,va){H+=O;var oa=u.clone();u.x-=A*(2*H+O);u.y-=F*(2*H+O);A*=H+O;F*=H+O;return function(){f.ellipse(oa.x-A-H,oa.y-F-H,2*H,2*H);va?f.fillAndStroke():f.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var f=null;if(null!=this.line)for(var q=0;q<this.line.length;q++){var z=this.line[q];null!=z&&(z=new mxRectangle(z.x,z.y,this.strokewidth,this.strokewidth),null==f?f=z:f.add(z))}this.bounds=null!=f?f:new mxRectangle};b.prototype.paintVertexShape=function(f,q,z,u,A){this.paintTableLine(f,this.line,0,0)};b.prototype.paintTableLine=function(f,q,z,u){if(null!=q){var A=null;f.begin();for(var F=0;F<q.length;F++){var H=q[F];null!=H&&(null==A?f.moveTo(H.x+z,H.y+u):null!=A&&f.lineTo(H.x+z,H.y+u));A=H}f.end();f.stroke()}};b.prototype.intersectsRectangle=function(f){var q=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var z=null,u=0;u<this.line.length&&!q;u++){var A=this.line[u];null!=A&&null!=z&&(q=mxUtils.rectangleIntersectsSegment(f,z,A));z=A}return q};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.getLabelBounds=function(f){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};d.prototype.paintVertexShape=function(f,q,z,u,A){var F=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,H=this.isHorizontal(),ha=this.getTitleSize();0==ha||this.outline?ma.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),f.translate(-q,-z));F||this.outline||!(H&&ha<A||!H&&ha<u)||this.paintForeground(f,q,z,u,A)};d.prototype.paintForeground=function(f,q,z,u,A){if(null!=this.state){var F=this.flipH,H=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ha=F;F=H;H=ha}f.rotate(-this.getShapeRotation(),@@ -2855,9 +2859,9 @@ p);mxUtils.extend(C,mxActor);C.prototype.size=20;C.prototype.redrawPath=functionq,(.5-Ta)*q),f.lineTo(.5*q,(1-Ta)*q)):(f.translate((u-q)/2,(A-q)/2),f.moveTo(0,.25*q),f.lineTo(.5*q,q*Ta),f.lineTo(q,.25*q),f.lineTo(q,.75*q),f.lineTo(.5*q,(1-Ta)*q),f.lineTo(0,.75*q),f.close());f.end()};mxCellRenderer.registerShape("isoCube",G);mxUtils.extend(T,mxCylinder);T.prototype.redrawPath=function(f,q,z,u,A,F){q=Math.min(A/2,Math.round(A/8)+this.strokewidth-1);if(F&&null!=this.fill||!F&&null==this.fill)f.moveTo(0,q),f.curveTo(0,2*q,u,2*q,u,q),F||(f.stroke(),f.begin()),f.translate(0,q/2),f.moveTo(0,q),f.curveTo(0,2*q,u,2*q,u,q),F||(f.stroke(),f.begin()),f.translate(0,q/2),f.moveTo(0,q),f.curveTo(0,2*q,u,2*q,u,q),F||(f.stroke(),f.begin()),f.translate(0,-q);F||(f.moveTo(0,q),f.curveTo(0,-q/3,u,-q/3,u,q),f.lineTo(u,A-q),f.curveTo(u,A+q/3,0,A+q/3,0,A-q),f.close())};T.prototype.getLabelMargins=function(f){return new mxRectangle(0,2.5*Math.min(f.height/2,Math.round(f.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",T);mxUtils.extend(E,mxCylinder);E.prototype.size=30;E.prototype.darkOpacity=0;E.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(0,Math.min(u,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),H=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));f.translate(q,z);f.begin();f.moveTo(0,0);f.lineTo(u-F,0);f.lineTo(u,F);f.lineTo(u,A);f.lineTo(0,A);f.lineTo(0,0);f.close();f.end();f.fillAndStroke();this.outline||(f.setShadow(!1),0!=H&&(f.setFillAlpha(Math.abs(H)),f.setFillColor(0>H?"#FFFFFF":"#000000"),-f.begin(),f.moveTo(u-F,0),f.lineTo(u-F,F),f.lineTo(u,F),f.close(),f.fill()),f.begin(),f.moveTo(u-F,0),f.lineTo(u-F,F),f.lineTo(u,F),f.end(),f.stroke())};mxCellRenderer.registerShape("note",E);mxUtils.extend(Q,E);mxCellRenderer.registerShape("note2",Q);Q.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,q*this.scale),0,0)}return null};mxUtils.extend(M,mxShape);M.prototype.isoAngle=-15;M.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;F=Math.min(u*Math.tan(F),.5*A);f.translate(q,z);f.begin();f.moveTo(.5*u,0);f.lineTo(u,F);f.lineTo(u,A-F);f.lineTo(.5*u,A);f.lineTo(0,A-F);f.lineTo(0,F);f.close();f.fillAndStroke();f.setShadow(!1);f.begin();f.moveTo(0,F);f.lineTo(.5*u,2*F);f.lineTo(u,F);f.moveTo(.5*u,2*F);f.lineTo(.5*u,A);f.stroke()};mxCellRenderer.registerShape("isoCube2",-M);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(0,Math.min(.5*A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.translate(q,z);0==F?(f.rect(0,0,u,A),f.fillAndStroke()):(f.begin(),f.moveTo(0,F),f.arcTo(.5*u,F,0,0,1,.5*u,0),f.arcTo(.5*u,F,0,0,1,u,F),f.lineTo(u,A-F),f.arcTo(.5*u,F,0,0,1,.5*u,A),f.arcTo(.5*u,F,0,0,1,0,A-F),f.close(),f.fillAndStroke(),f.setShadow(!1),f.begin(),f.moveTo(u,F),f.arcTo(.5*u,F,0,0,1,.5*u,2*F),f.arcTo(.5*+f.begin(),f.moveTo(u-F,0),f.lineTo(u-F,F),f.lineTo(u,F),f.close(),f.fill()),f.begin(),f.moveTo(u-F,0),f.lineTo(u-F,F),f.lineTo(u,F),f.end(),f.stroke())};mxCellRenderer.registerShape("note",E);mxUtils.extend(P,E);mxCellRenderer.registerShape("note2",P);P.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,q*this.scale),0,0)}return null};mxUtils.extend(L,mxShape);L.prototype.isoAngle=+15;L.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;F=Math.min(u*Math.tan(F),.5*A);f.translate(q,z);f.begin();f.moveTo(.5*u,0);f.lineTo(u,F);f.lineTo(u,A-F);f.lineTo(.5*u,A);f.lineTo(0,A-F);f.lineTo(0,F);f.close();f.fillAndStroke();f.setShadow(!1);f.begin();f.moveTo(0,F);f.lineTo(.5*u,2*F);f.lineTo(u,F);f.moveTo(.5*u,2*F);f.lineTo(.5*u,A);f.stroke()};mxCellRenderer.registerShape("isoCube2",+L);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(0,Math.min(.5*A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.translate(q,z);0==F?(f.rect(0,0,u,A),f.fillAndStroke()):(f.begin(),f.moveTo(0,F),f.arcTo(.5*u,F,0,0,1,.5*u,0),f.arcTo(.5*u,F,0,0,1,u,F),f.lineTo(u,A-F),f.arcTo(.5*u,F,0,0,1,.5*u,A),f.arcTo(.5*u,F,0,0,1,0,A-F),f.close(),f.fillAndStroke(),f.setShadow(!1),f.begin(),f.moveTo(u,F),f.arcTo(.5*u,F,0,0,1,.5*u,2*F),f.arcTo(.5*u,F,0,0,1,0,F),f.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(g,mxCylinder);g.prototype.size=15;g.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(0,Math.min(.5*A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),H=mxUtils.getValue(this.style,"lid",!0);f.translate(q,z);0==F?(f.rect(0,0,u,A),f.fillAndStroke()):(f.begin(),H?(f.moveTo(0,F),f.arcTo(.5*u,F,0,0,1,.5*u,0),f.arcTo(.5*u,F,0,0,1,u,F)):(f.moveTo(0,0),f.arcTo(.5*u,F,0,0,0,.5*u,F),f.arcTo(.5*u,F,0,0,0,u,0)),f.lineTo(u,A-F),f.arcTo(.5*u,F,0,0,1,.5*u,A),f.arcTo(.5*u,F,0,0,1,0,A-F),f.close(),f.fillAndStroke(),f.setShadow(!1),H&&(f.begin(),f.moveTo(u,F),f.arcTo(.5*u,F,0,0,1,.5*u,2*F),f.arcTo(.5*u,F,0,0,1,0,F),f.stroke()))};mxCellRenderer.registerShape("cylinder3",g);mxUtils.extend(l,mxActor);l.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u/2,.5*A,u,0);f.quadTo(.5*u,A/2,u,A);f.quadTo(u/2,.5*A,0,A);f.quadTo(.5*u,A/2,0,0);f.end()};mxCellRenderer.registerShape("switch",l);mxUtils.extend(t,mxCylinder);t.prototype.tabWidth=60;t.prototype.tabHeight=20;t.prototype.tabPosition="right";t.prototype.arcSize=.1;t.prototype.isRoundable=function(){return!0};t.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var F=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),H=mxUtils.getValue(this.style,@@ -2869,158 +2873,158 @@ this.arcSize));z=mxUtils.getValue(this.style,"umlStateConnection",null);H||(q*=M3,3),f.stroke(),f.begin(),f.moveTo(u-30,A-15),f.lineTo(u-20,A-15),f.stroke());"connPointRefEntry"==z?(f.ellipse(0,.5*A-10,20,20),f.fillAndStroke()):"connPointRefExit"==z&&(f.ellipse(0,.5*A-10,20,20),f.fillAndStroke(),f.begin(),f.moveTo(5,.5*A-5),f.lineTo(15,.5*A+5),f.moveTo(15,.5*A-5),f.lineTo(5,.5*A+5),f.stroke())};B.prototype.getLabelMargins=function(f){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(D,mxActor);D.prototype.size=30;D.prototype.isRoundable=function(){return!0};D.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u,0),new mxPoint(u,A),new mxPoint(0,A),new mxPoint(0,q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("card",D);mxUtils.extend(I,mxActor);I.prototype.size=.4;I.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(0,q/2);f.quadTo(u/4,1.4*q,u/2,q/2);f.quadTo(3*u/4,q*(1-1.4),u,q/2);f.lineTo(u,A-q/2);f.quadTo(3*u/4,A-1.4*q,u/2,A-q/2);f.quadTo(u/4,A-q*(1-1.4),0,A-q/2);f.lineTo(0,q/2);f.close();f.end()};I.prototype.getLabelBounds=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=-mxUtils.getValue(this.style,"size",this.size),z=f.width,u=f.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return q*=u,new mxRectangle(f.x,f.y+q,z,u-2*q);q*=z;return new mxRectangle(f.x+q,f.y,z-2*q,u)}return f};mxCellRenderer.registerShape("tape",I);mxUtils.extend(L,mxActor);L.prototype.size=.3;L.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,-"size",this.size))*f.height):null};L.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(0,0);f.lineTo(u,0);f.lineTo(u,A-q/2);f.quadTo(3*u/4,A-1.4*q,u/2,A-q/2);f.quadTo(u/4,A-q*(1-1.4),0,A-q/2);f.lineTo(0,q/2);f.close();f.end()};mxCellRenderer.registerShape("document",L);var qb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(f,q,z,u){var A=mxUtils.getValue(this.style,"size");return null!=+mxUtils.getValue(this.style,"size",this.size),z=f.width,u=f.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return q*=u,new mxRectangle(f.x,f.y+q,z,u-2*q);q*=z;return new mxRectangle(f.x+q,f.y,z-2*q,u)}return f};mxCellRenderer.registerShape("tape",I);mxUtils.extend(K,mxActor);K.prototype.size=.3;K.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,+"size",this.size))*f.height):null};K.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(0,0);f.lineTo(u,0);f.lineTo(u,A-q/2);f.quadTo(3*u/4,A-1.4*q,u/2,A-q/2);f.quadTo(u/4,A-q*(1-1.4),0,A-q/2);f.lineTo(0,q/2);f.close();f.end()};mxCellRenderer.registerShape("document",K);var qb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(f,q,z,u){var A=mxUtils.getValue(this.style,"size");return null!=A?u*Math.max(0,Math.min(1,A)):qb.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,f.height*q),0,0)}return null};g.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(q/=2);return new mxRectangle(0,Math.min(f.height*this.scale,2*q*this.scale),0,Math.max(0,.3*q*this.scale))}return null};t.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;q=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),A=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));A||(F*=Math.min(f.width,f.height));F=Math.min(F,.5*f.width,.5*(f.height-q));u||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(f.width,f.width-z),Math.min(f.height,f.height-q)):new mxRectangle(Math.min(f.width,f.width-z),0,F,Math.min(f.height,f.height-q))}return new mxRectangle(0,Math.min(f.height,q),0,0)}return null};B.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=-mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};Q.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,q*this.scale),0,Math.max(0,q*this.scale))}return null};mxUtils.extend(N,mxActor);N.prototype.size=.2;N.prototype.fixedSize=20;N.prototype.isRoundable=function(){return!0};N.prototype.redrawPath=function(f,q,z,u,A){q=-"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(q,0),new mxPoint(u,0),new mxPoint(u-q,A)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("parallelogram",N);mxUtils.extend(K,mxActor);K.prototype.size=-.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,-A)],this.isRounded,z,!0)};mxCellRenderer.registerShape("trapezoid",K);mxUtils.extend(da,mxActor);da.prototype.size=.5;da.prototype.redrawPath=function(f,q,z,u,A){f.setFillColor(null);q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(u,0),new mxPoint(q,0),new mxPoint(q,A/2),new mxPoint(0,A/2),new mxPoint(q,A/2),new mxPoint(q,A),new mxPoint(u,A)],this.isRounded,-z,!1);f.end()};mxCellRenderer.registerShape("curlyBracket",da);mxUtils.extend(ja,mxActor);ja.prototype.redrawPath=function(f,q,z,u,A){f.setStrokeWidth(1);f.setFillColor(this.stroke);q=u/5;f.rect(0,0,q,A);f.fillAndStroke();f.rect(2*q,0,q,A);f.fillAndStroke();f.rect(4*q,0,q,A);f.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ja);ea.prototype.moveTo=function(f,q){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q;this.firstX=f;this.firstY=q};ea.prototype.close=+mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};P.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,q*this.scale),0,Math.max(0,q*this.scale))}return null};mxUtils.extend(M,mxActor);M.prototype.size=.2;M.prototype.fixedSize=20;M.prototype.isRoundable=function(){return!0};M.prototype.redrawPath=function(f,q,z,u,A){q=+"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(q,0),new mxPoint(u,0),new mxPoint(u-q,A)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("parallelogram",M);mxUtils.extend(V,mxActor);V.prototype.size=+.2;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,+A)],this.isRounded,z,!0)};mxCellRenderer.registerShape("trapezoid",V);mxUtils.extend(Q,mxActor);Q.prototype.size=.5;Q.prototype.redrawPath=function(f,q,z,u,A){f.setFillColor(null);q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(u,0),new mxPoint(q,0),new mxPoint(q,A/2),new mxPoint(0,A/2),new mxPoint(q,A/2),new mxPoint(q,A),new mxPoint(u,A)],this.isRounded,+z,!1);f.end()};mxCellRenderer.registerShape("curlyBracket",Q);mxUtils.extend(ja,mxActor);ja.prototype.redrawPath=function(f,q,z,u,A){f.setStrokeWidth(1);f.setFillColor(this.stroke);q=u/5;f.rect(0,0,q,A);f.fillAndStroke();f.rect(2*q,0,q,A);f.fillAndStroke();f.rect(4*q,0,q,A);f.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ja);ea.prototype.moveTo=function(f,q){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q;this.firstX=f;this.firstY=q};ea.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)};ea.prototype.quadTo=function(f,q,z,u){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=u};ea.prototype.curveTo=function(f,q,z,u,A,F){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=A;this.lastY=F};ea.prototype.arcTo=function(f,q,z,u,A,F,H){this.originalArcTo.apply(this.canvas,arguments);-this.lastX=F;this.lastY=H};ea.prototype.lineTo=function(f,q){if(null!=this.lastX&&null!=this.lastY){var z=function(pa){return"number"===typeof pa?pa?0>pa?-1:1:pa===pa?0:NaN:NaN},u=Math.abs(f-this.lastX),A=Math.abs(q-this.lastY),F=Math.sqrt(u*u+A*A);if(2>F){this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q;return}var H=Math.round(F/10),ha=this.defaultVariation;5>H&&(H=5,ha/=3);var O=z(f-this.lastX)*u/H;z=z(q-this.lastY)*A/H;u/=F;A/=F;for(F=0;F<H;F++){var va=(Math.random()--.5)*ha;this.originalLineTo.call(this.canvas,O*F+this.lastX-va*A,z*F+this.lastY-va*u)}this.originalLineTo.call(this.canvas,f,q)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q};ea.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 gb=mxShape.prototype.beforePaint;-mxShape.prototype.beforePaint=function(f){gb.apply(this,arguments);null==f.handJiggle&&(f.handJiggle=this.createHandJiggle(f))};var bb=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(f){bb.apply(this,arguments);null!=f.handJiggle&&(f.handJiggle.destroy(),delete f.handJiggle)};mxShape.prototype.createComicCanvas=function(f){return new ea(f,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(f){return this.outline||null==-this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(f)};var db=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"))&&db.apply(this,arguments)};var lb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(f,q,z,u,A){if(null==f.handJiggle||+this.lastX=F;this.lastY=H};ea.prototype.lineTo=function(f,q){if(null!=this.lastX&&null!=this.lastY){var z=function(oa){return"number"===typeof oa?oa?0>oa?-1:1:oa===oa?0:NaN:NaN},u=Math.abs(f-this.lastX),A=Math.abs(q-this.lastY),F=Math.sqrt(u*u+A*A);if(2>F){this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q;return}var H=Math.round(F/10),ha=this.defaultVariation;5>H&&(H=5,ha/=3);var O=z(f-this.lastX)*u/H;z=z(q-this.lastY)*A/H;u/=F;A/=F;for(F=0;F<H;F++){var va=(Math.random()-+.5)*ha;this.originalLineTo.call(this.canvas,O*F+this.lastX-va*A,z*F+this.lastY-va*u)}this.originalLineTo.call(this.canvas,f,q)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q};ea.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 hb=mxShape.prototype.beforePaint;+mxShape.prototype.beforePaint=function(f){hb.apply(this,arguments);null==f.handJiggle&&(f.handJiggle=this.createHandJiggle(f))};var cb=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(f){cb.apply(this,arguments);null!=f.handJiggle&&(f.handJiggle.destroy(),delete f.handJiggle)};mxShape.prototype.createComicCanvas=function(f){return new ea(f,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(f){return this.outline||null==+this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(f)};var fb=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"))&&fb.apply(this,arguments)};var lb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(f,q,z,u,A){if(null==f.handJiggle||f.handJiggle.constructor!=ea)lb.apply(this,arguments);else{var F=!0;null!=this.style&&(F="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(F||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)F||null!=this.fill&&this.fill!=mxConstants.NONE||(f.pointerEvents=!1),f.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?F=Math.min(u/2,Math.min(A/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,-mxConstants.LINE_ARCSIZE)/2)):(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,F=Math.min(u*F,A*F)),f.moveTo(q+F,z),f.lineTo(q+u-F,z),f.quadTo(q+u,z,q+u,z+F),f.lineTo(q+u,z+A-F),f.quadTo(q+u,z+A,q+u-F,z+A),f.lineTo(q+F,z+A),f.quadTo(q,z+A,q,z+A-F),f.lineTo(q,z+F),f.quadTo(q,z,q+F,z)):(f.moveTo(q,z),f.lineTo(q+u,z),f.lineTo(q+u,z+A),f.lineTo(q,z+A),f.lineTo(q,z)),f.close(),f.end(),f.fillAndStroke()}};mxUtils.extend(ca,mxRectangleShape);ca.prototype.size=-.1;ca.prototype.fixedSize=!1;ca.prototype.isHtmlAllowed=function(){return!1};ca.prototype.getLabelBounds=function(f){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var q=f.width,z=f.height;f=new mxRectangle(f.x,f.y,q,z);var u=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),A=parseFloat(mxUtils.getValue(this.style,"size",this.size));u?A=Math.max(0,Math.min(q,-A*this.scale)):(A=q*Math.max(0,Math.min(1,A)),this.isRounded&&(u=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,A=Math.max(A,Math.min(q*u,z*u))));f.x+=Math.round(A);f.width-=Math.round(2*A);return f}return f};ca.prototype.paintForeground=function(f,q,z,u,A){var F=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),H=parseFloat(mxUtils.getValue(this.style,"size",this.size));H=F?Math.max(0,Math.min(u,H)):u*Math.max(0,Math.min(1,H));this.isRounded&&-(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,H=Math.max(H,Math.min(u*F,A*F)));H=Math.round(H);f.begin();f.moveTo(q+H,z);f.lineTo(q+H,z+A);f.moveTo(q+u-H,z);f.lineTo(q+u-H,z+A);f.end();f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",ca);mxCellRenderer.registerShape("process2",ca);mxUtils.extend(fa,mxRectangleShape);fa.prototype.paintBackground=function(f,q,z,u,A){f.setFillColor(mxConstants.NONE);-f.rect(q,z,u,A);f.fill()};fa.prototype.paintForeground=function(f,q,z,u,A){};mxCellRenderer.registerShape("transparent",fa);mxUtils.extend(la,mxHexagon);la.prototype.size=30;la.prototype.position=.5;la.prototype.position2=.5;la.prototype.base=20;la.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};la.prototype.isRoundable=function(){return!0};la.prototype.redrawPath=function(f,q,z,u,A){q=mxUtils.getValue(this.style,+mxConstants.LINE_ARCSIZE)/2)):(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,F=Math.min(u*F,A*F)),f.moveTo(q+F,z),f.lineTo(q+u-F,z),f.quadTo(q+u,z,q+u,z+F),f.lineTo(q+u,z+A-F),f.quadTo(q+u,z+A,q+u-F,z+A),f.lineTo(q+F,z+A),f.quadTo(q,z+A,q,z+A-F),f.lineTo(q,z+F),f.quadTo(q,z,q+F,z)):(f.moveTo(q,z),f.lineTo(q+u,z),f.lineTo(q+u,z+A),f.lineTo(q,z+A),f.lineTo(q,z)),f.close(),f.end(),f.fillAndStroke()}};mxUtils.extend(da,mxRectangleShape);da.prototype.size=+.1;da.prototype.fixedSize=!1;da.prototype.isHtmlAllowed=function(){return!1};da.prototype.getLabelBounds=function(f){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var q=f.width,z=f.height;f=new mxRectangle(f.x,f.y,q,z);var u=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),A=parseFloat(mxUtils.getValue(this.style,"size",this.size));u?A=Math.max(0,Math.min(q,+A*this.scale)):(A=q*Math.max(0,Math.min(1,A)),this.isRounded&&(u=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,A=Math.max(A,Math.min(q*u,z*u))));f.x+=Math.round(A);f.width-=Math.round(2*A);return f}return f};da.prototype.paintForeground=function(f,q,z,u,A){var F=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),H=parseFloat(mxUtils.getValue(this.style,"size",this.size));H=F?Math.max(0,Math.min(u,H)):u*Math.max(0,Math.min(1,H));this.isRounded&&+(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,H=Math.max(H,Math.min(u*F,A*F)));H=Math.round(H);f.begin();f.moveTo(q+H,z);f.lineTo(q+H,z+A);f.moveTo(q+u-H,z);f.lineTo(q+u-H,z+A);f.end();f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",da);mxCellRenderer.registerShape("process2",da);mxUtils.extend(ia,mxRectangleShape);ia.prototype.paintBackground=function(f,q,z,u,A){f.setFillColor(mxConstants.NONE);+f.rect(q,z,u,A);f.fill()};ia.prototype.paintForeground=function(f,q,z,u,A){};mxCellRenderer.registerShape("transparent",ia);mxUtils.extend(la,mxHexagon);la.prototype.size=30;la.prototype.position=.5;la.prototype.position2=.5;la.prototype.base=20;la.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};la.prototype.isRoundable=function(){return!0};la.prototype.redrawPath=function(f,q,z,u,A){q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var F=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),H=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ha=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A-z),new mxPoint(Math.min(u,F+ha),A-z),new mxPoint(H,A),new mxPoint(Math.max(0,F),A-z),new mxPoint(0,A-z)],this.isRounded,q,!0,[4])};mxCellRenderer.registerShape("callout",la);mxUtils.extend(ka,mxActor);ka.prototype.size=.2;ka.prototype.fixedSize=20;ka.prototype.isRoundable=function(){return!0};ka.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(0,A),new mxPoint(q,A/2)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("step",ka);mxUtils.extend(V,mxHexagon);V.prototype.size=.25;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,-"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,.5*A),new mxPoint(u-q,A),new mxPoint(q,A),new mxPoint(0,.5*A)],this.isRounded,z,!0)};mxCellRenderer.registerShape("hexagon",V);mxUtils.extend(k,mxRectangleShape);+"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(0,A),new mxPoint(q,A/2)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("step",ka);mxUtils.extend(W,mxHexagon);W.prototype.size=.25;W.prototype.fixedSize=20;W.prototype.isRoundable=function(){return!0};W.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,+"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,.5*A),new mxPoint(u-q,A),new mxPoint(q,A),new mxPoint(0,.5*A)],this.isRounded,z,!0)};mxCellRenderer.registerShape("hexagon",W);mxUtils.extend(k,mxRectangleShape);k.prototype.isHtmlAllowed=function(){return!1};k.prototype.paintForeground=function(f,q,z,u,A){var F=Math.min(u/5,A/5)+1;f.begin();f.moveTo(q+u/2,z+F);f.lineTo(q+u/2,z+A-F);f.moveTo(q+F,z+A/2);f.lineTo(q+u-F,z+A/2);f.end();f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",k);var ub=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(f){if(1==this.style["double"]){var q=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||-0))*this.scale;return new mxRectangle(f.x+q,f.y+q,f.width-2*q,f.height-2*q)}return f};mxRhombus.prototype.paintVertexShape=function(f,q,z,u,A){ub.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var F=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);q+=F;z+=F;u-=2*F;A-=2*F;0<u&&0<A&&(f.setShadow(!1),ub.apply(this,[f,q,z,u,A]))}};mxUtils.extend(x,mxRectangleShape);x.prototype.isHtmlAllowed=function(){return!1};x.prototype.getLabelBounds=function(f){if(1==-this.style["double"]){var q=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(f.x+q,f.y+q,f.width-2*q,f.height-2*q)}return f};x.prototype.paintForeground=function(f,q,z,u,A){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var F=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);q+=F;z+=F;u-=2*F;A-=2*F;0<u&&0<A&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}f.setDashed(!1);-F=0;do{var H=mxCellRenderer.defaultShapes[this.style["symbol"+F]];if(null!=H){var ha=this.style["symbol"+F+"Align"],O=this.style["symbol"+F+"VerticalAlign"],va=this.style["symbol"+F+"Width"],pa=this.style["symbol"+F+"Height"],Wa=this.style["symbol"+F+"Spacing"]||0,kb=this.style["symbol"+F+"VSpacing"]||Wa,fb=this.style["symbol"+F+"ArcSpacing"];null!=fb&&(fb*=this.getArcSize(u+this.strokewidth,A+this.strokewidth),Wa+=fb,kb+=fb);fb=q;var Ea=z;fb=ha==mxConstants.ALIGN_CENTER?fb+(u-va)/2:ha==mxConstants.ALIGN_RIGHT?-fb+(u-va-Wa):fb+Wa;Ea=O==mxConstants.ALIGN_MIDDLE?Ea+(A-pa)/2:O==mxConstants.ALIGN_BOTTOM?Ea+(A-pa-kb):Ea+kb;f.save();ha=new H;ha.style=this.style;H.prototype.paintVertexShape.call(ha,f,fb,Ea,va,pa);f.restore()}F++}while(null!=H)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",x);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(f,q,z,u,A,F){F?(f.moveTo(0,0),f.lineTo(u/2,A/2),f.lineTo(u,0),f.end()):(f.moveTo(0,0),f.lineTo(u,0),f.lineTo(u,-A),f.lineTo(0,A),f.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(R,mxShape);R.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.ellipse(u/4,0,u/2,A/4);f.fillAndStroke();f.begin();f.moveTo(u/2,A/4);f.lineTo(u/2,2*A/3);f.moveTo(u/2,A/3);f.lineTo(0,A/3);f.moveTo(u/2,A/3);f.lineTo(u,A/3);f.moveTo(u/2,2*A/3);f.lineTo(0,A);f.moveTo(u/2,2*A/3);f.lineTo(u,A);f.end();f.stroke()};mxCellRenderer.registerShape("umlActor",R);mxUtils.extend(Y,mxShape);Y.prototype.getLabelMargins=-function(f){return new mxRectangle(f.width/6,0,0,0)};Y.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(0,A/4);f.lineTo(0,3*A/4);f.end();f.stroke();f.begin();f.moveTo(0,A/2);f.lineTo(u/6,A/2);f.end();f.stroke();f.ellipse(u/6,0,5*u/6,A);f.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",Y);mxUtils.extend(Z,mxEllipse);Z.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(q+u/8,z+A);f.lineTo(q+-7*u/8,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("umlEntity",Z);mxUtils.extend(W,mxShape);W.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(u,0);f.lineTo(0,A);f.moveTo(0,0);f.lineTo(u,A);f.end();f.stroke()};mxCellRenderer.registerShape("umlDestroy",W);mxUtils.extend(U,mxShape);U.prototype.getLabelBounds=function(f){return new mxRectangle(f.x,f.y+f.height/8,f.width,7*f.height/8)};U.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();-f.moveTo(3*u/8,A/8*1.1);f.lineTo(5*u/8,0);f.end();f.stroke();f.ellipse(0,A/8,u,7*A/8);f.fillAndStroke()};U.prototype.paintForeground=function(f,q,z,u,A){f.begin();f.moveTo(3*u/8,A/8*1.1);f.lineTo(5*u/8,A/4);f.end();f.stroke()};mxCellRenderer.registerShape("umlControl",U);mxUtils.extend(aa,mxRectangleShape);aa.prototype.size=40;aa.prototype.isHtmlAllowed=function(){return!1};aa.prototype.getLabelBounds=function(f){var q=Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*-this.scale));return new mxRectangle(f.x,f.y,f.width,q)};aa.prototype.paintBackground=function(f,q,z,u,A){var F=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),H=mxUtils.getValue(this.style,"participant");null==H||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,f,q,z,u,F):(H=this.state.view.graph.cellRenderer.getShape(H),null!=H&&H!=aa&&(H=new H,H.apply(this.state),f.save(),H.paintVertexShape(f,q,z,u,F),f.restore()));F<A&&(f.setDashed("1"==mxUtils.getValue(this.style,-"lifelineDashed","1")),f.begin(),f.moveTo(q+u/2,z+F),f.lineTo(q+u/2,z+A),f.end(),f.stroke())};aa.prototype.paintForeground=function(f,q,z,u,A){var F=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,f,q,z,u,Math.min(A,F))};mxCellRenderer.registerShape("umlLifeline",aa);mxUtils.extend(ia,mxShape);ia.prototype.width=60;ia.prototype.height=30;ia.prototype.corner=10;ia.prototype.configurePointerEvents=function(f){var q=-mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=q&&q!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(f.pointerEvents=!1)};ia.prototype.getLabelMargins=function(f){return new mxRectangle(0,0,f.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),f.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};ia.prototype.paintBackground=-function(f,q,z,u,A){var F=this.corner,H=Math.min(u,Math.max(F,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ha=Math.min(A,Math.max(1.5*F,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),O=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);O!=mxConstants.NONE&&(f.setFillColor(O),f.rect(q,z,u,A),f.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(f,q,z,u,A),f.setGradient(this.fill,-this.gradient,q,z,u,A,this.gradientDirection)):f.setFillColor(this.fill);f.pointerEvents=!0;f.begin();f.moveTo(q,z);f.lineTo(q+H,z);f.lineTo(q+H,z+Math.max(0,ha-1.5*F));f.lineTo(q+Math.max(0,H-F),z+ha);f.lineTo(q,z+ha);f.close();f.fillAndStroke();this.configurePointerEvents(f);f.begin();f.moveTo(q+H,z);f.lineTo(q+u,z);f.lineTo(q+u,z+A);f.lineTo(q,z+A);f.lineTo(q,z+ha);f.stroke()};mxCellRenderer.registerShape("umlFrame",ia);mxPerimeter.CenterPerimeter=function(f,q,z,u){return new mxPoint(f.getCenterX(),-f.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(f,q,z,u){u=aa.prototype.size;null!=q&&(u=mxUtils.getValue(q.style,"size",u)*q.view.scale);q=parseFloat(q.style[mxConstants.STYLE_STROKEWIDTH]||1)*q.view.scale/2-1;z.x<f.getCenterX()&&(q=-1*(q+1));return new mxPoint(f.getCenterX()+q,Math.min(f.y+f.height,Math.max(f.y+u,z.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=-function(f,q,z,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(f,q,z,u){u=parseFloat(q.style[mxConstants.STYLE_STROKEWIDTH]||1)*q.view.scale/2-1;null!=q.style.backboneSize&&(u+=parseFloat(q.style.backboneSize)*q.view.scale/2-1);if("south"==q.style[mxConstants.STYLE_DIRECTION]||"north"==q.style[mxConstants.STYLE_DIRECTION])return z.x<f.getCenterX()&&(u=-1*(u+1)),-new mxPoint(f.getCenterX()+u,Math.min(f.y+f.height,Math.max(f.y,z.y)));z.y<f.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(f.x+f.width,Math.max(f.x,z.x)),f.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(f,q,z,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(f,new mxRectangle(0,0,0,Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(q.style,"size",la.prototype.size))*q.view.scale))),-q.style),q,z,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize","0"),F=A?N.prototype.fixedSize:N.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height;q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_NORTH||q==-mxConstants.DIRECTION_SOUTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha)]):(A=A?Math.max(0,Math.min(.5*O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,ha+va),new mxPoint(H,ha+va),new mxPoint(H+A,ha)]);va=f.getCenterX();f=f.getCenterY();f=new mxPoint(va,f);u&&(z.x<H||z.x>H+O?f.y=z.y:f.x=z.x);return mxUtils.getPerimeterPoint(ha,f,-z)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize","0"),F=A?K.prototype.fixedSize:K.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height;q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_EAST?(A=A?Math.max(0,+0))*this.scale;return new mxRectangle(f.x+q,f.y+q,f.width-2*q,f.height-2*q)}return f};mxRhombus.prototype.paintVertexShape=function(f,q,z,u,A){ub.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var F=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);q+=F;z+=F;u-=2*F;A-=2*F;0<u&&0<A&&(f.setShadow(!1),ub.apply(this,[f,q,z,u,A]))}};mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.getLabelBounds=function(f){if(1==+this.style["double"]){var q=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(f.x+q,f.y+q,f.width-2*q,f.height-2*q)}return f};y.prototype.paintForeground=function(f,q,z,u,A){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var F=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);q+=F;z+=F;u-=2*F;A-=2*F;0<u&&0<A&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}f.setDashed(!1);+F=0;do{var H=mxCellRenderer.defaultShapes[this.style["symbol"+F]];if(null!=H){var ha=this.style["symbol"+F+"Align"],O=this.style["symbol"+F+"VerticalAlign"],va=this.style["symbol"+F+"Width"],oa=this.style["symbol"+F+"Height"],Xa=this.style["symbol"+F+"Spacing"]||0,kb=this.style["symbol"+F+"VSpacing"]||Xa,gb=this.style["symbol"+F+"ArcSpacing"];null!=gb&&(gb*=this.getArcSize(u+this.strokewidth,A+this.strokewidth),Xa+=gb,kb+=gb);gb=q;var Ea=z;gb=ha==mxConstants.ALIGN_CENTER?gb+(u-va)/2:ha==mxConstants.ALIGN_RIGHT?+gb+(u-va-Xa):gb+Xa;Ea=O==mxConstants.ALIGN_MIDDLE?Ea+(A-oa)/2:O==mxConstants.ALIGN_BOTTOM?Ea+(A-oa-kb):Ea+kb;f.save();ha=new H;ha.style=this.style;H.prototype.paintVertexShape.call(ha,f,gb,Ea,va,oa);f.restore()}F++}while(null!=H)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",y);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(f,q,z,u,A,F){F?(f.moveTo(0,0),f.lineTo(u/2,A/2),f.lineTo(u,0),f.end()):(f.moveTo(0,0),f.lineTo(u,0),f.lineTo(u,+A),f.lineTo(0,A),f.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(R,mxShape);R.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.ellipse(u/4,0,u/2,A/4);f.fillAndStroke();f.begin();f.moveTo(u/2,A/4);f.lineTo(u/2,2*A/3);f.moveTo(u/2,A/3);f.lineTo(0,A/3);f.moveTo(u/2,A/3);f.lineTo(u,A/3);f.moveTo(u/2,2*A/3);f.lineTo(0,A);f.moveTo(u/2,2*A/3);f.lineTo(u,A);f.end();f.stroke()};mxCellRenderer.registerShape("umlActor",R);mxUtils.extend(X,mxShape);X.prototype.getLabelMargins=+function(f){return new mxRectangle(f.width/6,0,0,0)};X.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(0,A/4);f.lineTo(0,3*A/4);f.end();f.stroke();f.begin();f.moveTo(0,A/2);f.lineTo(u/6,A/2);f.end();f.stroke();f.ellipse(u/6,0,5*u/6,A);f.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",X);mxUtils.extend(aa,mxEllipse);aa.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(q+u/8,z+A);+f.lineTo(q+7*u/8,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("umlEntity",aa);mxUtils.extend(Z,mxShape);Z.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(u,0);f.lineTo(0,A);f.moveTo(0,0);f.lineTo(u,A);f.end();f.stroke()};mxCellRenderer.registerShape("umlDestroy",Z);mxUtils.extend(U,mxShape);U.prototype.getLabelBounds=function(f){return new mxRectangle(f.x,f.y+f.height/8,f.width,7*f.height/8)};U.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,+z);f.begin();f.moveTo(3*u/8,A/8*1.1);f.lineTo(5*u/8,0);f.end();f.stroke();f.ellipse(0,A/8,u,7*A/8);f.fillAndStroke()};U.prototype.paintForeground=function(f,q,z,u,A){f.begin();f.moveTo(3*u/8,A/8*1.1);f.lineTo(5*u/8,A/4);f.end();f.stroke()};mxCellRenderer.registerShape("umlControl",U);mxUtils.extend(ba,mxRectangleShape);ba.prototype.size=40;ba.prototype.isHtmlAllowed=function(){return!1};ba.prototype.getLabelBounds=function(f){var q=Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(this.style,+"size",this.size))*this.scale));return new mxRectangle(f.x,f.y,f.width,q)};ba.prototype.paintBackground=function(f,q,z,u,A){var F=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),H=mxUtils.getValue(this.style,"participant");null==H||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,f,q,z,u,F):(H=this.state.view.graph.cellRenderer.getShape(H),null!=H&&H!=ba&&(H=new H,H.apply(this.state),f.save(),H.paintVertexShape(f,q,z,u,F),f.restore()));F<A&&(f.setDashed("1"==+mxUtils.getValue(this.style,"lifelineDashed","1")),f.begin(),f.moveTo(q+u/2,z+F),f.lineTo(q+u/2,z+A),f.end(),f.stroke())};ba.prototype.paintForeground=function(f,q,z,u,A){var F=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,f,q,z,u,Math.min(A,F))};mxCellRenderer.registerShape("umlLifeline",ba);mxUtils.extend(fa,mxShape);fa.prototype.width=60;fa.prototype.height=30;fa.prototype.corner=10;fa.prototype.configurePointerEvents=+function(f){var q=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=q&&q!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(f.pointerEvents=!1)};fa.prototype.getLabelMargins=function(f){return new mxRectangle(0,0,f.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),f.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};+fa.prototype.paintBackground=function(f,q,z,u,A){var F=this.corner,H=Math.min(u,Math.max(F,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ha=Math.min(A,Math.max(1.5*F,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),O=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);O!=mxConstants.NONE&&(f.setFillColor(O),f.rect(q,z,u,A),f.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(f,+q,z,u,A),f.setGradient(this.fill,this.gradient,q,z,u,A,this.gradientDirection)):f.setFillColor(this.fill);f.pointerEvents=!0;f.begin();f.moveTo(q,z);f.lineTo(q+H,z);f.lineTo(q+H,z+Math.max(0,ha-1.5*F));f.lineTo(q+Math.max(0,H-F),z+ha);f.lineTo(q,z+ha);f.close();f.fillAndStroke();this.configurePointerEvents(f);f.begin();f.moveTo(q+H,z);f.lineTo(q+u,z);f.lineTo(q+u,z+A);f.lineTo(q,z+A);f.lineTo(q,z+ha);f.stroke()};mxCellRenderer.registerShape("umlFrame",fa);mxPerimeter.CenterPerimeter=function(f,q,+z,u){return new mxPoint(f.getCenterX(),f.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(f,q,z,u){u=ba.prototype.size;null!=q&&(u=mxUtils.getValue(q.style,"size",u)*q.view.scale);q=parseFloat(q.style[mxConstants.STYLE_STROKEWIDTH]||1)*q.view.scale/2-1;z.x<f.getCenterX()&&(q=-1*(q+1));return new mxPoint(f.getCenterX()+q,Math.min(f.y+f.height,Math.max(f.y+u,z.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);+mxPerimeter.OrthogonalPerimeter=function(f,q,z,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(f,q,z,u){u=parseFloat(q.style[mxConstants.STYLE_STROKEWIDTH]||1)*q.view.scale/2-1;null!=q.style.backboneSize&&(u+=parseFloat(q.style.backboneSize)*q.view.scale/2-1);if("south"==q.style[mxConstants.STYLE_DIRECTION]||"north"==q.style[mxConstants.STYLE_DIRECTION])return z.x<+f.getCenterX()&&(u=-1*(u+1)),new mxPoint(f.getCenterX()+u,Math.min(f.y+f.height,Math.max(f.y,z.y)));z.y<f.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(f.x+f.width,Math.max(f.x,z.x)),f.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(f,q,z,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(f,new mxRectangle(0,0,0,Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(q.style,"size",la.prototype.size))*+q.view.scale))),q.style),q,z,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize","0"),F=A?M.prototype.fixedSize:M.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height;q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_NORTH||+q==mxConstants.DIRECTION_SOUTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha)]):(A=A?Math.max(0,Math.min(.5*O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,ha+va),new mxPoint(H,ha+va),new mxPoint(H+A,ha)]);va=f.getCenterX();f=f.getCenterY();f=new mxPoint(va,f);u&&(z.x<H||z.x>H+O?f.y=z.y:f.x=z.x);return mxUtils.getPerimeterPoint(ha,+f,z)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize","0"),F=A?V.prototype.fixedSize:V.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height;q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_EAST?(A=A?Math.max(0,Math.min(.5*O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,ha+va),new mxPoint(H,ha+va),new mxPoint(H+A,ha)]):q==mxConstants.DIRECTION_WEST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,ha)]):q==mxConstants.DIRECTION_NORTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha+A),new mxPoint(H+O,ha),new mxPoint(H+O,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha+A)]):(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va-A),new mxPoint(H,ha+va),new mxPoint(H,ha)]);va=f.getCenterX();f=f.getCenterY();f=new mxPoint(va,f);u&&(z.x<H||z.x>H+O?f.y=z.y:f.x=z.x);return mxUtils.getPerimeterPoint(ha,f,z)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,-"fixedSize","0"),F=A?ka.prototype.fixedSize:ka.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height,pa=f.getCenterX();f=f.getCenterY();q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_EAST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,f),new mxPoint(H+O-A,ha+va),new mxPoint(H,-ha+va),new mxPoint(H+A,f),new mxPoint(H,ha)]):q==mxConstants.DIRECTION_WEST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,f),new mxPoint(H+O,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,f),new mxPoint(H+A,ha)]):q==mxConstants.DIRECTION_NORTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha+A),new mxPoint(pa,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va),new mxPoint(pa,ha+va-A),new mxPoint(H,-ha+va),new mxPoint(H,ha+A)]):(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(pa,ha+A),new mxPoint(H+O,ha),new mxPoint(H+O,ha+va-A),new mxPoint(pa,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha)]);pa=new mxPoint(pa,f);u&&(z.x<H||z.x>H+O?pa.y=z.y:pa.x=z.x);return mxUtils.getPerimeterPoint(ha,pa,z)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize",-"0"),F=A?V.prototype.fixedSize:V.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height,pa=f.getCenterX();f=f.getCenterY();q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_NORTH||q==mxConstants.DIRECTION_SOUTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(pa,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va-A),-new mxPoint(pa,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha+A),new mxPoint(pa,ha)]):(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,f),new mxPoint(H+O-A,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,f),new mxPoint(H+A,ha)]);pa=new mxPoint(pa,f);u&&(z.x<H||z.x>H+O?pa.y=z.y:pa.x=z.x);return mxUtils.getPerimeterPoint(ha,pa,z)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(na,mxShape);-na.prototype.size=10;na.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size));f.translate(q,z);f.ellipse((u-F)/2,0,F,F);f.fillAndStroke();f.begin();f.moveTo(u/2,F);f.lineTo(u/2,A);f.end();f.stroke()};mxCellRenderer.registerShape("lollipop",na);mxUtils.extend(qa,mxShape);qa.prototype.size=10;qa.prototype.inset=2;qa.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size)),H=parseFloat(mxUtils.getValue(this.style,-"inset",this.inset))+this.strokewidth;f.translate(q,z);f.begin();f.moveTo(u/2,F+H);f.lineTo(u/2,A);f.end();f.stroke();f.begin();f.moveTo((u-F)/2-H,F/2);f.quadTo((u-F)/2-H,F+H,u/2,F+H);f.quadTo((u+F)/2+H,F+H,(u+F)/2+H,F/2);f.end();f.stroke()};mxCellRenderer.registerShape("requires",qa);mxUtils.extend(ta,mxShape);ta.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.end();f.stroke()};mxCellRenderer.registerShape("requiredInterface",-ta);mxUtils.extend(ua,mxShape);ua.prototype.inset=2;ua.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;f.translate(q,z);f.ellipse(0,F,u-2*F,A-2*F);f.fillAndStroke();f.begin();f.moveTo(u/2,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u/2,A);f.end();f.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",ua);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=20;Ba.prototype.jettyHeight=10;Ba.prototype.redrawPath=+"fixedSize","0"),F=A?ka.prototype.fixedSize:ka.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height,oa=f.getCenterX();f=f.getCenterY();q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_EAST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,f),new mxPoint(H+O-A,ha+va),new mxPoint(H,+ha+va),new mxPoint(H+A,f),new mxPoint(H,ha)]):q==mxConstants.DIRECTION_WEST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,f),new mxPoint(H+O,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,f),new mxPoint(H+A,ha)]):q==mxConstants.DIRECTION_NORTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha+A),new mxPoint(oa,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va),new mxPoint(oa,ha+va-A),new mxPoint(H,+ha+va),new mxPoint(H,ha+A)]):(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(oa,ha+A),new mxPoint(H+O,ha),new mxPoint(H+O,ha+va-A),new mxPoint(oa,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha)]);oa=new mxPoint(oa,f);u&&(z.x<H||z.x>H+O?oa.y=z.y:oa.x=z.x);return mxUtils.getPerimeterPoint(ha,oa,z)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize",+"0"),F=A?W.prototype.fixedSize:W.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height,oa=f.getCenterX();f=f.getCenterY();q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_NORTH||q==mxConstants.DIRECTION_SOUTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(oa,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va-A),+new mxPoint(oa,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha+A),new mxPoint(oa,ha)]):(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,f),new mxPoint(H+O-A,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,f),new mxPoint(H+A,ha)]);oa=new mxPoint(oa,f);u&&(z.x<H||z.x>H+O?oa.y=z.y:oa.x=z.x);return mxUtils.getPerimeterPoint(ha,oa,z)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(na,mxShape);+na.prototype.size=10;na.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size));f.translate(q,z);f.ellipse((u-F)/2,0,F,F);f.fillAndStroke();f.begin();f.moveTo(u/2,F);f.lineTo(u/2,A);f.end();f.stroke()};mxCellRenderer.registerShape("lollipop",na);mxUtils.extend(pa,mxShape);pa.prototype.size=10;pa.prototype.inset=2;pa.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size)),H=parseFloat(mxUtils.getValue(this.style,+"inset",this.inset))+this.strokewidth;f.translate(q,z);f.begin();f.moveTo(u/2,F+H);f.lineTo(u/2,A);f.end();f.stroke();f.begin();f.moveTo((u-F)/2-H,F/2);f.quadTo((u-F)/2-H,F+H,u/2,F+H);f.quadTo((u+F)/2+H,F+H,(u+F)/2+H,F/2);f.end();f.stroke()};mxCellRenderer.registerShape("requires",pa);mxUtils.extend(ta,mxShape);ta.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.end();f.stroke()};mxCellRenderer.registerShape("requiredInterface",+ta);mxUtils.extend(ua,mxShape);ua.prototype.inset=2;ua.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;f.translate(q,z);f.ellipse(0,F,u-2*F,A-2*F);f.fillAndStroke();f.begin();f.moveTo(u/2,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u/2,A);f.end();f.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",ua);mxUtils.extend(Ca,mxCylinder);Ca.prototype.jettyWidth=20;Ca.prototype.jettyHeight=10;Ca.prototype.redrawPath=function(f,q,z,u,A,F){var H=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));q=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=H/2;H=z+H/2;var ha=Math.min(q,A-q),O=Math.min(ha+2*q,A-q);F?(f.moveTo(z,ha),f.lineTo(H,ha),f.lineTo(H,ha+q),f.lineTo(z,ha+q),f.moveTo(z,O),f.lineTo(H,O),f.lineTo(H,O+q),f.lineTo(z,O+q)):(f.moveTo(z,0),f.lineTo(u,0),f.lineTo(u,A),f.lineTo(z,A),f.lineTo(z,O+q),f.lineTo(0,O+q),f.lineTo(0,O),f.lineTo(z,O),f.lineTo(z,ha+q),f.lineTo(0,-ha+q),f.lineTo(0,ha),f.lineTo(z,ha),f.close());f.end()};mxCellRenderer.registerShape("module",Ba);mxUtils.extend(za,mxCylinder);za.prototype.jettyWidth=32;za.prototype.jettyHeight=12;za.prototype.redrawPath=function(f,q,z,u,A,F){var H=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));q=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=H/2;H=z+H/2;var ha=.3*A-q/2,O=.7*A-q/2;F?(f.moveTo(z,ha),f.lineTo(H,ha),f.lineTo(H,ha+q),f.lineTo(z,ha+q),f.moveTo(z,O),-f.lineTo(H,O),f.lineTo(H,O+q),f.lineTo(z,O+q)):(f.moveTo(z,0),f.lineTo(u,0),f.lineTo(u,A),f.lineTo(z,A),f.lineTo(z,O+q),f.lineTo(0,O+q),f.lineTo(0,O),f.lineTo(z,O),f.lineTo(z,ha+q),f.lineTo(0,ha+q),f.lineTo(0,ha),f.lineTo(z,ha),f.close());f.end()};mxCellRenderer.registerShape("component",za);mxUtils.extend(Aa,mxRectangleShape);Aa.prototype.paintForeground=function(f,q,z,u,A){var F=u/2,H=A/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;f.begin();this.addPoints(f,-[new mxPoint(q+F,z),new mxPoint(q+u,z+H),new mxPoint(q+F,z+A),new mxPoint(q,z+H)],this.isRounded,ha,!0);f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Aa);mxUtils.extend(Ga,mxDoubleEllipse);Ga.prototype.outerStroke=!0;Ga.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.min(4,Math.min(u/5,A/5));0<u&&0<A&&(f.ellipse(q+F,z+F,u-2*F,A-2*F),f.fillAndStroke());f.setShadow(!1);this.outerStroke&&(f.ellipse(q,z,u,A),f.stroke())};-mxCellRenderer.registerShape("endState",Ga);mxUtils.extend(Ra,Ga);Ra.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Ra);mxUtils.extend(Ha,mxArrowConnector);Ha.prototype.defaultWidth=4;Ha.prototype.isOpenEnded=function(){return!0};Ha.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Ha.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",Ha);mxUtils.extend(Qa,-mxArrowConnector);Qa.prototype.defaultWidth=10;Qa.prototype.defaultArrowWidth=20;Qa.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Qa.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Qa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",-Qa);mxUtils.extend(eb,mxActor);eb.prototype.size=30;eb.prototype.isRoundable=function(){return!0};eb.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(0,q),new mxPoint(u,0),new mxPoint(u,A)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("manualInput",eb);mxUtils.extend(Ma,mxRectangleShape);Ma.prototype.dx=-20;Ma.prototype.dy=20;Ma.prototype.isHtmlAllowed=function(){return!1};Ma.prototype.paintForeground=function(f,q,z,u,A){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var F=0;if(this.isRounded){var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;F=Math.max(F,Math.min(u*H,A*H))}H=Math.max(F,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));F=Math.max(F,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));-f.begin();f.moveTo(q,z+F);f.lineTo(q+u,z+F);f.end();f.stroke();f.begin();f.moveTo(q+H,z);f.lineTo(q+H,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("internalStorage",Ma);mxUtils.extend(ya,mxActor);ya.prototype.dx=20;ya.prototype.dy=20;ya.prototype.isRoundable=function(){return!0};ya.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,-"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint(q,z),new mxPoint(q,A),new mxPoint(0,A)],this.isRounded,F,!0);f.end()};mxCellRenderer.registerShape("corner",ya);mxUtils.extend(Sa,mxActor);Sa.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.lineTo(0,A);f.end();f.moveTo(u,0);f.lineTo(u,A);f.end();f.moveTo(0,A/2);f.lineTo(u,A/2);f.end()};mxCellRenderer.registerShape("crossbar",-Sa);mxUtils.extend(Oa,mxActor);Oa.prototype.dx=20;Oa.prototype.dy=20;Oa.prototype.isRoundable=function(){return!0};Oa.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,-0),new mxPoint(u,z),new mxPoint((u+q)/2,z),new mxPoint((u+q)/2,A),new mxPoint((u-q)/2,A),new mxPoint((u-q)/2,z),new mxPoint(0,z)],this.isRounded,F,!0);f.end()};mxCellRenderer.registerShape("tee",Oa);mxUtils.extend(Na,mxActor);Na.prototype.arrowWidth=.3;Na.prototype.arrowSize=.2;Na.prototype.isRoundable=function(){return!0};Na.prototype.redrawPath=function(f,q,z,u,A){var F=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"arrowSize",this.arrowSize))));z=(A-F)/2;F=z+F;var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,z),new mxPoint(u-q,z),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(u-q,F),new mxPoint(0,F)],this.isRounded,H,!0);f.end()};mxCellRenderer.registerShape("singleArrow",Na);mxUtils.extend(Pa,mxActor);Pa.prototype.isRoundable=function(){return!0};Pa.prototype.redrawPath=function(f,q,z,u,A){var F=A*Math.max(0,Math.min(1,-parseFloat(mxUtils.getValue(this.style,"arrowWidth",Na.prototype.arrowWidth))));q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Na.prototype.arrowSize))));z=(A-F)/2;F=z+F;var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A/2),new mxPoint(q,0),new mxPoint(q,z),new mxPoint(u-q,z),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(u-q,F),new mxPoint(q,F),new mxPoint(q,A)],this.isRounded,-H,!0);f.end()};mxCellRenderer.registerShape("doubleArrow",Pa);mxUtils.extend(oa,mxActor);oa.prototype.size=.1;oa.prototype.fixedSize=20;oa.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(q,0);f.lineTo(u,0);f.quadTo(u-2*q,A/2,u,A);f.lineTo(q,A);f.quadTo(q-2*q,A/2,q,0);f.close();-f.end()};mxCellRenderer.registerShape("dataStorage",oa);mxUtils.extend(Da,mxActor);Da.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.close();f.end()};mxCellRenderer.registerShape("or",Da);mxUtils.extend(Ca,mxActor);Ca.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.quadTo(u/2,A/2,0,0);f.close();f.end()};mxCellRenderer.registerShape("xor",Ca);mxUtils.extend(Ja,mxActor);Ja.prototype.size=20;Ja.prototype.isRoundable=-function(){return!0};Ja.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(u/2,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,.8*q),new mxPoint(u,A),new mxPoint(0,A),new mxPoint(0,.8*q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("loopLimit",Ja);mxUtils.extend(Xa,mxActor);Xa.prototype.size=.375;Xa.prototype.isRoundable=-function(){return!0};Xa.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A-q),new mxPoint(u/2,A),new mxPoint(0,A-q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("offPageConnector",Xa);mxUtils.extend(ib,mxEllipse);ib.prototype.paintVertexShape=function(f,q,z,-u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(q+u/2,z+A);f.lineTo(q+u,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("tapeData",ib);mxUtils.extend(y,mxEllipse);y.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(q,z+A/2);f.lineTo(q+u,z+A/2);f.end();f.stroke();f.begin();f.moveTo(q+u/2,z);f.lineTo(q+u/2,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("orEllipse",-y);mxUtils.extend(P,mxEllipse);P.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(q+.145*u,z+.145*A);f.lineTo(q+.855*u,z+.855*A);f.end();f.stroke();f.begin();f.moveTo(q+.855*u,z+.145*A);f.lineTo(q+.145*u,z+.855*A);f.end();f.stroke()};mxCellRenderer.registerShape("sumEllipse",P);mxUtils.extend(S,mxRhombus);S.prototype.paintVertexShape=function(f,q,z,u,A){mxRhombus.prototype.paintVertexShape.apply(this,arguments);-f.setShadow(!1);f.begin();f.moveTo(q,z+A/2);f.lineTo(q+u,z+A/2);f.end();f.stroke()};mxCellRenderer.registerShape("sortShape",S);mxUtils.extend(X,mxEllipse);X.prototype.paintVertexShape=function(f,q,z,u,A){f.begin();f.moveTo(q,z);f.lineTo(q+u,z);f.lineTo(q+u/2,z+A/2);f.close();f.fillAndStroke();f.begin();f.moveTo(q,z+A);f.lineTo(q+u,z+A);f.lineTo(q+u/2,z+A/2);f.close();f.fillAndStroke()};mxCellRenderer.registerShape("collate",X);mxUtils.extend(ba,mxEllipse);ba.prototype.paintVertexShape=function(f,-q,z,u,A){var F=f.state.strokeWidth/2,H=10+2*F,ha=z+A-H/2;f.begin();f.moveTo(q,z);f.lineTo(q,z+A);f.moveTo(q+F,ha);f.lineTo(q+F+H,ha-H/2);f.moveTo(q+F,ha);f.lineTo(q+F+H,ha+H/2);f.moveTo(q+F,ha);f.lineTo(q+u-F,ha);f.moveTo(q+u,z);f.lineTo(q+u,z+A);f.moveTo(q+u-F,ha);f.lineTo(q+u-H-F,ha-H/2);f.moveTo(q+u-F,ha);f.lineTo(q+u-H-F,ha+H/2);f.end();f.stroke()};mxCellRenderer.registerShape("dimension",ba);mxUtils.extend(ma,mxEllipse);ma.prototype.drawHidden=!0;ma.prototype.paintVertexShape=function(f,q,z,-u,A){this.outline||f.setStrokeColor(null);if(null!=this.style){var F=f.pointerEvents,H=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||H||(f.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),O="1"==mxUtils.getValue(this.style,"left","1"),va="1"==mxUtils.getValue(this.style,"right","1"),pa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||H||this.outline||ha||va||pa||O?(f.rect(q,z,u,A),f.fill(),f.pointerEvents=-F,f.setStrokeColor(this.stroke),f.setLineCap("square"),f.begin(),f.moveTo(q,z),this.outline||ha?f.lineTo(q+u,z):f.moveTo(q+u,z),this.outline||va?f.lineTo(q+u,z+A):f.moveTo(q+u,z+A),this.outline||pa?f.lineTo(q,z+A):f.moveTo(q,z+A),(this.outline||O)&&f.lineTo(q,z),f.end(),f.stroke(),f.setLineCap("flat")):f.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",ma);mxUtils.extend(ra,mxEllipse);ra.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,-arguments);f.setShadow(!1);f.begin();"vertical"==mxUtils.getValue(this.style,"line")?(f.moveTo(q+u/2,z),f.lineTo(q+u/2,z+A)):(f.moveTo(q,z+A/2),f.lineTo(q+u,z+A/2));f.end();f.stroke()};mxCellRenderer.registerShape("lineEllipse",ra);mxUtils.extend(wa,mxActor);wa.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(u,A/2);f.moveTo(0,0);f.lineTo(u-q,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u-q,A);f.lineTo(0,A);f.close();f.end()};mxCellRenderer.registerShape("delay",wa);mxUtils.extend(sa,mxActor);sa.prototype.size=-.2;sa.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(A,u);var F=Math.max(0,Math.min(q,q*parseFloat(mxUtils.getValue(this.style,"size",this.size))));q=(A-F)/2;z=q+F;var H=(u-F)/2;F=H+F;f.moveTo(0,q);f.lineTo(H,q);f.lineTo(H,0);f.lineTo(F,0);f.lineTo(F,q);f.lineTo(u,q);f.lineTo(u,z);f.lineTo(F,z);f.lineTo(F,A);f.lineTo(H,A);f.lineTo(H,z);f.lineTo(0,z);f.close();f.end()};mxCellRenderer.registerShape("cross",sa);mxUtils.extend(xa,mxActor);xa.prototype.size=.25;xa.prototype.redrawPath=function(f,-q,z,u,A){q=Math.min(u,A/2);z=Math.min(u-q,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);f.moveTo(0,A/2);f.lineTo(z,0);f.lineTo(u-q,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u-q,A);f.lineTo(z,A);f.close();f.end()};mxCellRenderer.registerShape("display",xa);mxUtils.extend(Fa,mxActor);Fa.prototype.cst={RECT2:"mxgraph.basic.rect"};Fa.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",+ha+q),f.lineTo(0,ha),f.lineTo(z,ha),f.close());f.end()};mxCellRenderer.registerShape("module",Ca);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=32;Ba.prototype.jettyHeight=12;Ba.prototype.redrawPath=function(f,q,z,u,A,F){var H=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));q=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=H/2;H=z+H/2;var ha=.3*A-q/2,O=.7*A-q/2;F?(f.moveTo(z,ha),f.lineTo(H,ha),f.lineTo(H,ha+q),f.lineTo(z,ha+q),f.moveTo(z,O),+f.lineTo(H,O),f.lineTo(H,O+q),f.lineTo(z,O+q)):(f.moveTo(z,0),f.lineTo(u,0),f.lineTo(u,A),f.lineTo(z,A),f.lineTo(z,O+q),f.lineTo(0,O+q),f.lineTo(0,O),f.lineTo(z,O),f.lineTo(z,ha+q),f.lineTo(0,ha+q),f.lineTo(0,ha),f.lineTo(z,ha),f.close());f.end()};mxCellRenderer.registerShape("component",Ba);mxUtils.extend(Aa,mxRectangleShape);Aa.prototype.paintForeground=function(f,q,z,u,A){var F=u/2,H=A/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;f.begin();this.addPoints(f,+[new mxPoint(q+F,z),new mxPoint(q+u,z+H),new mxPoint(q+F,z+A),new mxPoint(q,z+H)],this.isRounded,ha,!0);f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Aa);mxUtils.extend(Fa,mxDoubleEllipse);Fa.prototype.outerStroke=!0;Fa.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.min(4,Math.min(u/5,A/5));0<u&&0<A&&(f.ellipse(q+F,z+F,u-2*F,A-2*F),f.fillAndStroke());f.setShadow(!1);this.outerStroke&&(f.ellipse(q,z,u,A),f.stroke())};+mxCellRenderer.registerShape("endState",Fa);mxUtils.extend(Sa,Fa);Sa.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Sa);mxUtils.extend(La,mxArrowConnector);La.prototype.defaultWidth=4;La.prototype.isOpenEnded=function(){return!0};La.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};La.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",La);mxUtils.extend(Pa,+mxArrowConnector);Pa.prototype.defaultWidth=10;Pa.prototype.defaultArrowWidth=20;Pa.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Pa.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Pa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",+Pa);mxUtils.extend(db,mxActor);db.prototype.size=30;db.prototype.isRoundable=function(){return!0};db.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(0,q),new mxPoint(u,0),new mxPoint(u,A)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("manualInput",db);mxUtils.extend(Ia,mxRectangleShape);Ia.prototype.dx=+20;Ia.prototype.dy=20;Ia.prototype.isHtmlAllowed=function(){return!1};Ia.prototype.paintForeground=function(f,q,z,u,A){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var F=0;if(this.isRounded){var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;F=Math.max(F,Math.min(u*H,A*H))}H=Math.max(F,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));F=Math.max(F,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));+f.begin();f.moveTo(q,z+F);f.lineTo(q+u,z+F);f.end();f.stroke();f.begin();f.moveTo(q+H,z);f.lineTo(q+H,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("internalStorage",Ia);mxUtils.extend(za,mxActor);za.prototype.dx=20;za.prototype.dy=20;za.prototype.isRoundable=function(){return!0};za.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,+"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint(q,z),new mxPoint(q,A),new mxPoint(0,A)],this.isRounded,F,!0);f.end()};mxCellRenderer.registerShape("corner",za);mxUtils.extend(Ua,mxActor);Ua.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.lineTo(0,A);f.end();f.moveTo(u,0);f.lineTo(u,A);f.end();f.moveTo(0,A/2);f.lineTo(u,A/2);f.end()};mxCellRenderer.registerShape("crossbar",+Ua);mxUtils.extend(Qa,mxActor);Qa.prototype.dx=20;Qa.prototype.dy=20;Qa.prototype.isRoundable=function(){return!0};Qa.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,+0),new mxPoint(u,z),new mxPoint((u+q)/2,z),new mxPoint((u+q)/2,A),new mxPoint((u-q)/2,A),new mxPoint((u-q)/2,z),new mxPoint(0,z)],this.isRounded,F,!0);f.end()};mxCellRenderer.registerShape("tee",Qa);mxUtils.extend(Ma,mxActor);Ma.prototype.arrowWidth=.3;Ma.prototype.arrowSize=.2;Ma.prototype.isRoundable=function(){return!0};Ma.prototype.redrawPath=function(f,q,z,u,A){var F=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"arrowSize",this.arrowSize))));z=(A-F)/2;F=z+F;var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,z),new mxPoint(u-q,z),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(u-q,F),new mxPoint(0,F)],this.isRounded,H,!0);f.end()};mxCellRenderer.registerShape("singleArrow",Ma);mxUtils.extend(Na,mxActor);Na.prototype.isRoundable=function(){return!0};Na.prototype.redrawPath=function(f,q,z,u,A){var F=A*Math.max(0,Math.min(1,+parseFloat(mxUtils.getValue(this.style,"arrowWidth",Ma.prototype.arrowWidth))));q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Ma.prototype.arrowSize))));z=(A-F)/2;F=z+F;var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A/2),new mxPoint(q,0),new mxPoint(q,z),new mxPoint(u-q,z),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(u-q,F),new mxPoint(q,F),new mxPoint(q,A)],this.isRounded,+H,!0);f.end()};mxCellRenderer.registerShape("doubleArrow",Na);mxUtils.extend(xa,mxActor);xa.prototype.size=.1;xa.prototype.fixedSize=20;xa.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(q,0);f.lineTo(u,0);f.quadTo(u-2*q,A/2,u,A);f.lineTo(q,A);f.quadTo(q-2*q,A/2,q,0);f.close();+f.end()};mxCellRenderer.registerShape("dataStorage",xa);mxUtils.extend(Za,mxActor);Za.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.close();f.end()};mxCellRenderer.registerShape("or",Za);mxUtils.extend(Oa,mxActor);Oa.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.quadTo(u/2,A/2,0,0);f.close();f.end()};mxCellRenderer.registerShape("xor",Oa);mxUtils.extend(ra,mxActor);ra.prototype.size=20;ra.prototype.isRoundable=+function(){return!0};ra.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(u/2,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,.8*q),new mxPoint(u,A),new mxPoint(0,A),new mxPoint(0,.8*q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("loopLimit",ra);mxUtils.extend(Da,mxActor);Da.prototype.size=.375;Da.prototype.isRoundable=+function(){return!0};Da.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A-q),new mxPoint(u/2,A),new mxPoint(0,A-q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("offPageConnector",Da);mxUtils.extend(Ra,mxEllipse);Ra.prototype.paintVertexShape=function(f,q,z,+u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(q+u/2,z+A);f.lineTo(q+u,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("tapeData",Ra);mxUtils.extend(x,mxEllipse);x.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(q,z+A/2);f.lineTo(q+u,z+A/2);f.end();f.stroke();f.begin();f.moveTo(q+u/2,z);f.lineTo(q+u/2,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("orEllipse",+x);mxUtils.extend(N,mxEllipse);N.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(q+.145*u,z+.145*A);f.lineTo(q+.855*u,z+.855*A);f.end();f.stroke();f.begin();f.moveTo(q+.855*u,z+.145*A);f.lineTo(q+.145*u,z+.855*A);f.end();f.stroke()};mxCellRenderer.registerShape("sumEllipse",N);mxUtils.extend(S,mxRhombus);S.prototype.paintVertexShape=function(f,q,z,u,A){mxRhombus.prototype.paintVertexShape.apply(this,arguments);+f.setShadow(!1);f.begin();f.moveTo(q,z+A/2);f.lineTo(q+u,z+A/2);f.end();f.stroke()};mxCellRenderer.registerShape("sortShape",S);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(f,q,z,u,A){f.begin();f.moveTo(q,z);f.lineTo(q+u,z);f.lineTo(q+u/2,z+A/2);f.close();f.fillAndStroke();f.begin();f.moveTo(q,z+A);f.lineTo(q+u,z+A);f.lineTo(q+u/2,z+A/2);f.close();f.fillAndStroke()};mxCellRenderer.registerShape("collate",Y);mxUtils.extend(ca,mxEllipse);ca.prototype.paintVertexShape=function(f,+q,z,u,A){var F=f.state.strokeWidth/2,H=10+2*F,ha=z+A-H/2;f.begin();f.moveTo(q,z);f.lineTo(q,z+A);f.moveTo(q+F,ha);f.lineTo(q+F+H,ha-H/2);f.moveTo(q+F,ha);f.lineTo(q+F+H,ha+H/2);f.moveTo(q+F,ha);f.lineTo(q+u-F,ha);f.moveTo(q+u,z);f.lineTo(q+u,z+A);f.moveTo(q+u-F,ha);f.lineTo(q+u-H-F,ha-H/2);f.moveTo(q+u-F,ha);f.lineTo(q+u-H-F,ha+H/2);f.end();f.stroke()};mxCellRenderer.registerShape("dimension",ca);mxUtils.extend(ma,mxEllipse);ma.prototype.drawHidden=!0;ma.prototype.paintVertexShape=function(f,q,z,+u,A){this.outline||f.setStrokeColor(null);if(null!=this.style){var F=f.pointerEvents,H=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||H||(f.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),O="1"==mxUtils.getValue(this.style,"left","1"),va="1"==mxUtils.getValue(this.style,"right","1"),oa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||H||this.outline||ha||va||oa||O?(f.rect(q,z,u,A),f.fill(),f.pointerEvents=+F,f.setStrokeColor(this.stroke),f.setLineCap("square"),f.begin(),f.moveTo(q,z),this.outline||ha?f.lineTo(q+u,z):f.moveTo(q+u,z),this.outline||va?f.lineTo(q+u,z+A):f.moveTo(q+u,z+A),this.outline||oa?f.lineTo(q,z+A):f.moveTo(q,z+A),(this.outline||O)&&f.lineTo(q,z),f.end(),f.stroke(),f.setLineCap("flat")):f.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",ma);mxUtils.extend(qa,mxEllipse);qa.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,+arguments);f.setShadow(!1);f.begin();"vertical"==mxUtils.getValue(this.style,"line")?(f.moveTo(q+u/2,z),f.lineTo(q+u/2,z+A)):(f.moveTo(q,z+A/2),f.lineTo(q+u,z+A/2));f.end();f.stroke()};mxCellRenderer.registerShape("lineEllipse",qa);mxUtils.extend(wa,mxActor);wa.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(u,A/2);f.moveTo(0,0);f.lineTo(u-q,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u-q,A);f.lineTo(0,A);f.close();f.end()};mxCellRenderer.registerShape("delay",wa);mxUtils.extend(sa,mxActor);sa.prototype.size=+.2;sa.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(A,u);var F=Math.max(0,Math.min(q,q*parseFloat(mxUtils.getValue(this.style,"size",this.size))));q=(A-F)/2;z=q+F;var H=(u-F)/2;F=H+F;f.moveTo(0,q);f.lineTo(H,q);f.lineTo(H,0);f.lineTo(F,0);f.lineTo(F,q);f.lineTo(u,q);f.lineTo(u,z);f.lineTo(F,z);f.lineTo(F,A);f.lineTo(H,A);f.lineTo(H,z);f.lineTo(0,z);f.close();f.end()};mxCellRenderer.registerShape("cross",sa);mxUtils.extend(ya,mxActor);ya.prototype.size=.25;ya.prototype.redrawPath=function(f,+q,z,u,A){q=Math.min(u,A/2);z=Math.min(u-q,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);f.moveTo(0,A/2);f.lineTo(z,0);f.lineTo(u-q,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u-q,A);f.lineTo(z,A);f.close();f.end()};mxCellRenderer.registerShape("display",ya);mxUtils.extend(Ga,mxActor);Ga.prototype.cst={RECT2:"mxgraph.basic.rect"};Ga.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",type:"bool",defVal:!0},{name:"indent",dispName:"Indent",type:"float",defVal:2},{name:"rectOutline",dispName:"Outline",type:"enum",defVal:"single",enumList:[{val:"single",dispName:"Single"},{val:"double",dispName:"Double"},{val:"frame",dispName:"Frame"}]},{name:"fillColor2",dispName:"Inside Fill Color",type:"color",defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"color",defVal:"none"},{name:"gradientDirection2",dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"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"}]}];Fa.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);this.strictDrawShape(f,0,0,u,A)};Fa.prototype.strictDrawShape=function(f,q,z,u,A,F){var H=F&&F.rectStyle?F.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ha=F&&F.absoluteCornerSize?F.absoluteCornerSize:mxUtils.getValue(this.style,-"absoluteCornerSize",this.absoluteCornerSize),O=F&&F.size?F.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),va=F&&F.rectOutline?F.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),pa=F&&F.indent?F.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Wa=F&&F.dashed?F.dashed:mxUtils.getValue(this.style,"dashed",!1),kb=F&&F.dashPattern?F.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),fb=-F&&F.relIndent?F.relIndent:Math.max(0,Math.min(50,pa)),Ea=F&&F.top?F.top:mxUtils.getValue(this.style,"top",!0),La=F&&F.right?F.right:mxUtils.getValue(this.style,"right",!0),Ka=F&&F.bottom?F.bottom:mxUtils.getValue(this.style,"bottom",!0),Ia=F&&F.left?F.left:mxUtils.getValue(this.style,"left",!0),Va=F&&F.topLeftStyle?F.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),Za=F&&F.topRightStyle?F.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),$a=F&&F.bottomRightStyle?-F.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),ab=F&&F.bottomLeftStyle?F.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Ib=F&&F.fillColor?F.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");F&&F.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Jb=F&&F.strokeWidth?F.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Gb=F&&F.fillColor2?F.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Hb=F&&F.gradientColor2?-F.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),Kb=F&&F.gradientDirection2?F.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Lb=F&&F.opacity?F.opacity:mxUtils.getValue(this.style,"opacity","100"),Mb=Math.max(0,Math.min(50,O));F=Fa.prototype;f.setDashed(Wa);kb&&""!=kb&&f.setDashPattern(kb);f.setStrokeWidth(Jb);O=Math.min(.5*A,.5*u,O);ha||(O=Mb*Math.min(u,A)/100);O=Math.min(O,.5*Math.min(u,A));ha||(pa=Math.min(fb*Math.min(u,A)/100));pa=Math.min(pa,-.5*Math.min(u,A)-O);(Ea||La||Ka||Ia)&&"frame"!=va&&(f.begin(),Ea?F.moveNW(f,q,z,u,A,H,Va,O,Ia):f.moveTo(0,0),Ea&&F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),La&&F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),Ka&&F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),Ia&&F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),f.close(),f.fill(),f.setShadow(!1),f.setFillColor(Gb),Wa=ha=Lb,"none"==Gb&&(ha=0),"none"==Hb&&(Wa=0),f.setGradient(Gb,-Hb,0,0,u,A,Kb,ha,Wa),f.begin(),Ea?F.moveNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia):f.moveTo(pa,0),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),Ia&&Ka&&F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),Ka&&La&&F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),La&&Ea&&F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),Ea&&Ia&&F.paintNWInner(f,q,z,u,A,H,Va,O,pa),f.fill(),"none"==Ib&&(f.begin(),F.paintFolds(f,q,z,u,A,-H,Va,Za,$a,ab,O,Ea,La,Ka,Ia),f.stroke()));Ea||La||Ka||!Ia?Ea||La||!Ka||Ia?!Ea&&!La&&Ka&&Ia?"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,-u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.lineNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),f.close(),f.fillAndStroke()):Ea||!La||Ka||Ia?!Ea&&La&&!Ka&&Ia?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,Va,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia)),f.stroke(),-f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,Va,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.lineNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke(),f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.lineSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,-q,z,u,A,H,Za,O,pa,Ea,La),f.close(),f.fillAndStroke()):!Ea&&La&&Ka&&!Ia?"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,-q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.lineSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),f.close(),f.fillAndStroke()):!Ea&&La&&Ka&&Ia?"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),"double"==va&&(F.moveNWInner(f,-q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.lineNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,-q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),f.close(),f.fillAndStroke()):!Ea||La||Ka||Ia?Ea&&!La&&!Ka&&Ia?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,-q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.lineNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke()):Ea&&!La&&Ka&&!Ia?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,-La),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea)),f.stroke(),f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.lineNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),f.close(),f.fillAndStroke(),f.begin(),F.moveSE(f,-q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.lineSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),f.close(),f.fillAndStroke()):Ea&&!La&&Ka&&Ia?"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,-q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.lineNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,-z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),f.close(),f.fillAndStroke()):Ea&&La&&!Ka&&!Ia?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea)),f.stroke()):(f.begin(),-F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.lineSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),f.close(),f.fillAndStroke()):Ea&&La&&!Ka&&Ia?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,-A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,-z,u,A,H,$a,O,Ka),F.lineSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke()):Ea&&La&&Ka&&!Ia?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,-q,z,u,A,H,ab,O,Ia),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.lineSWInner(f,-q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),f.close(),f.fillAndStroke()):Ea&&La&&Ka&&Ia&&("frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,-q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),f.close(),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close()),f.stroke()):(f.begin(),-F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),f.close(),F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),-F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke())):"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.lineNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,-q,z,u,A,H,Va,O,pa,Ia,Ea),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.lineSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,-q,z,u,A,H,ab,O,Ia),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.lineSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,Va,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,-Ia)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,Va,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.lineNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke());f.begin();F.paintFolds(f,q,z,u,A,H,Va,Za,$a,ab,O,Ea,La,Ka,Ia);f.stroke()};Fa.prototype.moveNW=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(0,0):f.moveTo(0,ha)};Fa.prototype.moveNE=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(u,-0):f.moveTo(u-ha,0)};Fa.prototype.moveSE=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(u,A):f.moveTo(u,A-ha)};Fa.prototype.moveSW=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(0,A):f.moveTo(ha,A)};Fa.prototype.paintNW=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,ha,0)}else("snip"==-H||"default"==H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(ha,0);else f.lineTo(0,0)};Fa.prototype.paintTop=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(u,0):f.lineTo(u-ha,0)};Fa.prototype.paintNE=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,u,ha)}else("snip"==H||"default"==H&&"snip"==F||"fold"==H||"default"==-H&&"fold"==F)&&f.lineTo(u,ha);else f.lineTo(u,0)};Fa.prototype.paintRight=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(u,A):f.lineTo(u,A-ha)};Fa.prototype.paintLeft=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(0,0):f.lineTo(0,ha)};Fa.prototype.paintSE=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,-ha,0,0,q,u-ha,A)}else("snip"==H||"default"==H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-ha,A);else f.lineTo(u,A)};Fa.prototype.paintBottom=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(0,A):f.lineTo(ha,A)};Fa.prototype.paintSW=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,0,A-ha)}else("snip"==H||"default"==-H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(0,A-ha);else f.lineTo(0,A)};Fa.prototype.paintNWInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,O,.5*O+ha);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,O,O+ha);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(O,.5*O+ha);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(O+ha,O+ha),f.lineTo(O,O+ha)};Fa.prototype.paintTopInner=function(f,q,z,u,A,-F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(0,O):va&&!pa?f.lineTo(O,0):va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(ha+.5*O,O):f.lineTo(ha+O,O):f.lineTo(0,O):f.lineTo(0,0)};Fa.prototype.paintNEInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,u-ha-.5*O,O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,u-ha-O,O);else if("snip"==-H||"default"==H&&"snip"==F)f.lineTo(u-ha-.5*O,O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(u-ha-O,ha+O),f.lineTo(u-ha-O,O)};Fa.prototype.paintRightInner=function(f,q,z,u,A,F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(u-O,0):va&&!pa?f.lineTo(u,O):va?"square"==H||"default"==H&&"square"==F?f.lineTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,ha+.5*O):f.lineTo(u-O,ha+O):f.lineTo(u-O,0):f.lineTo(u,0)};Fa.prototype.paintLeftInner=function(f,q,z,-u,A,F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(O,A):va&&!pa?f.lineTo(0,A-O):va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,A-ha-.5*O):f.lineTo(O,A-ha-O):f.lineTo(O,A):f.lineTo(0,A)};Fa.prototype.paintSEInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,u-O,A-ha-.5*O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,u-O,-A-ha-O);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(u-O,A-ha-.5*O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(u-ha-O,A-ha-O),f.lineTo(u-O,A-ha-O)};Fa.prototype.paintBottomInner=function(f,q,z,u,A,F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(u,A-O):va&&!pa?f.lineTo(u-O,A):"square"==H||"default"==H&&"square"==F||!va?f.lineTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-ha-.5*O,A-O):f.lineTo(u-ha-O,A-O):f.lineTo(u,A)};Fa.prototype.paintSWInner=-function(f,q,z,u,A,F,H,ha,O,va){if(!va)f.lineTo(O,A);else if("square"==H||"default"==H&&"square"==F)f.lineTo(O,A-O);else if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,ha+.5*O,A-O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,ha+O,A-O);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(ha+.5*O,A-O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(O+ha,A-ha-O),f.lineTo(O+ha,A-O)};Fa.prototype.moveSWInner=function(f,q,z,u,A,F,H,ha,O,va){va?-"square"==H||"default"==H&&"square"==F?f.moveTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(O,A-ha-O):f.moveTo(0,A-O)};Fa.prototype.lineSWInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,A-ha-.5*O):("invRound"==H||-"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(O,A-ha-O):f.lineTo(0,A-O)};Fa.prototype.moveSEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F?f.moveTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(u-O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(u-O,A-ha-O):f.moveTo(u-O,A)};Fa.prototype.lineSEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==-H||"default"==H&&"square"==F?f.lineTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-O,A-ha-O):f.lineTo(u-O,A)};Fa.prototype.moveNEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F||va?f.moveTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(u-O,ha+.5*O):("invRound"==H||-"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(u-O,ha+O):f.moveTo(u,O)};Fa.prototype.lineNEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F||va?f.lineTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-O,ha+O):f.lineTo(u,O)};Fa.prototype.moveNWInner=function(f,q,z,u,A,F,H,ha,O,va,pa){va||pa?-!va&&pa?f.moveTo(O,0):va&&!pa?f.moveTo(0,O):"square"==H||"default"==H&&"square"==F?f.moveTo(O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(O,ha+O):f.moveTo(0,0)};Fa.prototype.lineNWInner=function(f,q,z,u,A,F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(O,0):va&&!pa?f.lineTo(0,O):"square"==H||"default"==H&&"square"==F?f.lineTo(O,O):"rounded"==H||"default"==H&&"rounded"==-F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(O,ha+O):f.lineTo(0,0)};Fa.prototype.paintFolds=function(f,q,z,u,A,F,H,ha,O,va,pa,Wa,kb,fb,Ea){if("fold"==F||"fold"==H||"fold"==ha||"fold"==O||"fold"==va)("fold"==H||"default"==H&&"fold"==F)&&Wa&&Ea&&(f.moveTo(0,pa),f.lineTo(pa,pa),f.lineTo(pa,0)),("fold"==ha||"default"==ha&&"fold"==F)&&Wa&&kb&&(f.moveTo(u-pa,0),f.lineTo(u-pa,pa),f.lineTo(u,pa)),("fold"==-O||"default"==O&&"fold"==F)&&fb&&kb&&(f.moveTo(u-pa,A),f.lineTo(u-pa,A-pa),f.lineTo(u,A-pa)),("fold"==va||"default"==va&&"fold"==F)&&fb&&Ea&&(f.moveTo(0,A-pa),f.lineTo(pa,A-pa),f.lineTo(pa,A))};mxCellRenderer.registerShape(Fa.prototype.cst.RECT2,Fa);Fa.prototype.constraints=null;mxUtils.extend(Ya,mxConnector);Ya.prototype.origPaintEdgeShape=Ya.prototype.paintEdgeShape;Ya.prototype.paintEdgeShape=function(f,q){for(var z=[],u=0;u<q.length;u++)z.push(mxUtils.clone(q[u]));u=f.state.dashed;var A=f.state.fixDash;-Ya.prototype.origPaintEdgeShape.apply(this,[f,z]);3<=f.state.strokeWidth&&(z=mxUtils.getValue(this.style,"fillColor",null),null!=z&&(f.setStrokeColor(z),f.setStrokeWidth(f.state.strokeWidth-2),f.setDashed(u,A),Ya.prototype.origPaintEdgeShape.apply(this,[f,q])))};mxCellRenderer.registerShape("filledEdge",Ya);mxUtils.extend(Ua,mxConnector);Ua.prototype.defaultWidth=4;Ua.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Ua.prototype.getFlowAnimationPath=-function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)};Ua.prototype.origPaintEdgeShape=Ua.prototype.paintEdgeShape;Ua.prototype.paintEdgeShape=function(f,q){for(var z=[],u=0;u<q.length;u++)z.push(mxUtils.clone(q[u]));u=f.state.dashed;var A=f.state.fixDash,F=this.getEdgeWidth();f.setStrokeWidth(F+2*this.strokewidth);f.setDashed(!1);Ua.prototype.origPaintEdgeShape.apply(this,[f,z]);z=mxUtils.getValue(this.style,"fillColor",null);null!=z&&(f.setStrokeWidth(F),f.setStrokeColor(z),f.setDashed(u,-A),Ua.prototype.origPaintEdgeShape.apply(this,[f,q]))};mxCellRenderer.registerShape("pipe",Ua);mxUtils.extend(cb,mxRectangleShape);cb.prototype.size=10;cb.prototype.isRoundable=function(){return!0};cb.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);q=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=q&&q!=mxConstants.NONE&&(f.setStrokeColor("none"),f.begin(),f.rect(0,0,u,A),f.fillAndStroke(),f.setStrokeColor(this.stroke));var F=Math.max(5,parseFloat(mxUtils.getValue(this.style,-"size",this.size)));q=A/2;z=this.strokewidth;z=this.isRounded?z/2:z;A-=z;F=Math.max(1,Math.round(u/F)-1);var H=u/(F+1),ha=H/2;f.begin();f.moveTo(0,q);if(this.isRounded){f.curveTo(.4*ha,q-.4*(q-z),.6*ha,z,ha,z);for(var O=0;O<F;O++){var va=ha+O*H,pa=va+H,Wa=0==O%2?A:z;f.curveTo(va+.4*H,0==O%2?z:A,pa-.4*H,Wa,pa,Wa)}A=0==F%2?z:A;f.curveTo(ha+F*H+.4*ha,A,u-.4*ha,q-(A==z?1:-1)*(q-z)*.4,u,q)}else{f.lineTo(ha,z);for(O=0;O<F;O++)pa=ha+(O+1)*H,Wa=0==O%2?A:z,f.lineTo(pa,Wa);f.lineTo(u,q)}f.stroke()};mxCellRenderer.registerShape("zigzag",-cb);"undefined"!==typeof StyleFormatPanel&&function(){var f=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var q=this.editorUi.getSelectionState(),z=f.apply(this,arguments);"umlFrame"==q.style.shape&&z.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return z}}();mxMarker.addMarker("dash",function(f,q,z,u,A,F,H,ha,O,va){var pa=A*(H+O+1),Wa=F*(H+O+1);return function(){f.begin();f.moveTo(u.x-pa/2-Wa/2,u.y-Wa/-2+pa/2);f.lineTo(u.x+Wa/2-3*pa/2,u.y-3*Wa/2-pa/2);f.stroke()}});mxMarker.addMarker("box",function(f,q,z,u,A,F,H,ha,O,va){var pa=A*(H+O+1),Wa=F*(H+O+1),kb=u.x+pa/2,fb=u.y+Wa/2;u.x-=pa;u.y-=Wa;return function(){f.begin();f.moveTo(kb-pa/2-Wa/2,fb-Wa/2+pa/2);f.lineTo(kb-pa/2+Wa/2,fb-Wa/2-pa/2);f.lineTo(kb+Wa/2-3*pa/2,fb-3*Wa/2-pa/2);f.lineTo(kb-Wa/2-3*pa/2,fb-3*Wa/2+pa/2);f.close();va?f.fillAndStroke():f.stroke()}});mxMarker.addMarker("cross",function(f,q,z,u,A,F,H,ha,O,va){var pa=A*(H+O+1),Wa=F*(H+O+-1);return function(){f.begin();f.moveTo(u.x-pa/2-Wa/2,u.y-Wa/2+pa/2);f.lineTo(u.x+Wa/2-3*pa/2,u.y-3*Wa/2-pa/2);f.moveTo(u.x-pa/2+Wa/2,u.y-Wa/2-pa/2);f.lineTo(u.x-Wa/2-3*pa/2,u.y-3*Wa/2+pa/2);f.stroke()}});mxMarker.addMarker("circle",hb);mxMarker.addMarker("circlePlus",function(f,q,z,u,A,F,H,ha,O,va){var pa=u.clone(),Wa=hb.apply(this,arguments),kb=A*(H+2*O),fb=F*(H+2*O);return function(){Wa.apply(this,arguments);f.begin();f.moveTo(pa.x-A*O,pa.y-F*O);f.lineTo(pa.x-2*kb+A*O,pa.y-2*fb+F*O);f.moveTo(pa.x--kb-fb+F*O,pa.y-fb+kb-A*O);f.lineTo(pa.x+fb-kb-F*O,pa.y-fb-kb+A*O);f.stroke()}});mxMarker.addMarker("halfCircle",function(f,q,z,u,A,F,H,ha,O,va){var pa=A*(H+O+1),Wa=F*(H+O+1),kb=u.clone();u.x-=pa;u.y-=Wa;return function(){f.begin();f.moveTo(kb.x-Wa,kb.y+pa);f.quadTo(u.x-Wa,u.y+pa,u.x,u.y);f.quadTo(u.x+Wa,u.y-pa,kb.x+Wa,kb.y-pa);f.stroke()}});mxMarker.addMarker("async",function(f,q,z,u,A,F,H,ha,O,va){q=A*O*1.118;z=F*O*1.118;A*=H+O;F*=H+O;var pa=u.clone();pa.x-=q;pa.y-=z;u.x+=-A-q;u.y+=-F-z;return function(){f.begin();-f.moveTo(pa.x,pa.y);ha?f.lineTo(pa.x-A-F/2,pa.y-F+A/2):f.lineTo(pa.x+F/2-A,pa.y-F-A/2);f.lineTo(pa.x-A,pa.y-F);f.close();va?f.fillAndStroke():f.stroke()}});mxMarker.addMarker("openAsync",function(f){f=null!=f?f:2;return function(q,z,u,A,F,H,ha,O,va,pa){F*=ha+va;H*=ha+va;var Wa=A.clone();return function(){q.begin();q.moveTo(Wa.x,Wa.y);O?q.lineTo(Wa.x-F-H/f,Wa.y-H+F/f):q.lineTo(Wa.x+H/f-F,Wa.y-H-F/f);q.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var ob=function(f,q,z){return pb(f,["width"],-q,function(u,A,F,H,ha){ha=f.shape.getEdgeWidth()*f.view.scale+z;return new mxPoint(H.x+A*u/4+F*ha/2,H.y+F*u/4-A*ha/2)},function(u,A,F,H,ha,O){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));f.style.width=Math.round(2*u)/f.view.scale-z})},pb=function(f,q,z,u,A){return mb(f,q,function(F){var H=f.absolutePoints;if(null!=H&&0<H.length){var ha=H.length-1;F=f.view.translate;var O=f.view.scale,va=z?H[0]:H[ha];H=z?H[1]:H[ha-1];ha=H.x-va.x;var pa=H.y-va.y,Wa=Math.sqrt(ha*ha+pa*pa);va=u.call(this,-Wa,ha/Wa,pa/Wa,va,H);return new mxPoint(va.x/O-F.x,va.y/O-F.y)}return null},function(F,H,ha){var O=f.absolutePoints,va=O.length-1;F=f.view.translate;var pa=f.view.scale,Wa=z?O[0]:O[va];O=z?O[1]:O[va-1];va=O.x-Wa.x;var kb=O.y-Wa.y,fb=Math.sqrt(va*va+kb*kb);H.x=(H.x+F.x)*pa;H.y=(H.y+F.y)*pa;A.call(this,fb,va/fb,kb/fb,Wa,O,H,ha)})},sb=function(f,q){return function(z){return[pb(z,["startWidth"],!0,function(u,A,F,H,ha){ha=mxUtils.getNumber(z.style,"startWidth",f)*z.view.scale+q;return new mxPoint(H.x+-A*u/4+F*ha/2,H.y+F*u/4-A*ha/2)},function(u,A,F,H,ha,O){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));z.style.startWidth=Math.round(2*u)/z.view.scale-q})]}},rb=function(f){return function(q){return[mb(q,["arrowWidth","arrowSize"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Na.prototype.arrowWidth))),A=Math.max(0,Math.min(f,mxUtils.getValue(this.state.style,"arrowSize",Na.prototype.arrowSize)));return new mxPoint(z.x+(1-A)*z.width,z.y+(1-u)*z.height/+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"}]}];Ga.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);this.strictDrawShape(f,0,0,u,A)};Ga.prototype.strictDrawShape=function(f,q,z,u,A,F){var H=F&&F.rectStyle?F.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ha=F&&F.absoluteCornerSize?F.absoluteCornerSize:mxUtils.getValue(this.style,+"absoluteCornerSize",this.absoluteCornerSize),O=F&&F.size?F.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),va=F&&F.rectOutline?F.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),oa=F&&F.indent?F.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Xa=F&&F.dashed?F.dashed:mxUtils.getValue(this.style,"dashed",!1),kb=F&&F.dashPattern?F.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),gb=+F&&F.relIndent?F.relIndent:Math.max(0,Math.min(50,oa)),Ea=F&&F.top?F.top:mxUtils.getValue(this.style,"top",!0),Ka=F&&F.right?F.right:mxUtils.getValue(this.style,"right",!0),Ja=F&&F.bottom?F.bottom:mxUtils.getValue(this.style,"bottom",!0),Ha=F&&F.left?F.left:mxUtils.getValue(this.style,"left",!0),Wa=F&&F.topLeftStyle?F.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),$a=F&&F.topRightStyle?F.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),ab=F&&F.bottomRightStyle?+F.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),bb=F&&F.bottomLeftStyle?F.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Ib=F&&F.fillColor?F.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");F&&F.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Jb=F&&F.strokeWidth?F.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Gb=F&&F.fillColor2?F.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Hb=F&&F.gradientColor2?+F.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),Kb=F&&F.gradientDirection2?F.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Lb=F&&F.opacity?F.opacity:mxUtils.getValue(this.style,"opacity","100"),Mb=Math.max(0,Math.min(50,O));F=Ga.prototype;f.setDashed(Xa);kb&&""!=kb&&f.setDashPattern(kb);f.setStrokeWidth(Jb);O=Math.min(.5*A,.5*u,O);ha||(O=Mb*Math.min(u,A)/100);O=Math.min(O,.5*Math.min(u,A));ha||(oa=Math.min(gb*Math.min(u,A)/100));oa=Math.min(oa,+.5*Math.min(u,A)-O);(Ea||Ka||Ja||Ha)&&"frame"!=va&&(f.begin(),Ea?F.moveNW(f,q,z,u,A,H,Wa,O,Ha):f.moveTo(0,0),Ea&&F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),Ka&&F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),Ja&&F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),Ha&&F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),f.close(),f.fill(),f.setShadow(!1),f.setFillColor(Gb),Xa=ha=Lb,"none"==Gb&&(ha=0),"none"==Hb&&(Xa=0),f.setGradient(Gb,+Hb,0,0,u,A,Kb,ha,Xa),f.begin(),Ea?F.moveNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha):f.moveTo(oa,0),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),Ha&&Ja&&F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),Ja&&Ka&&F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),Ka&&Ea&&F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),Ea&&Ha&&F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),f.fill(),"none"==Ib&&(f.begin(),F.paintFolds(f,q,z,u,A,+H,Wa,$a,ab,bb,O,Ea,Ka,Ja,Ha),f.stroke()));Ea||Ka||Ja||!Ha?Ea||Ka||!Ja||Ha?!Ea&&!Ka&&Ja&&Ha?"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,+u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.lineNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),f.close(),f.fillAndStroke()):Ea||!Ka||Ja||Ha?!Ea&&Ka&&!Ja&&Ha?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,Wa,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha)),f.stroke(),+f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,Wa,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.lineNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke(),f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.lineSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,+q,z,u,A,H,$a,O,oa,Ea,Ka),f.close(),f.fillAndStroke()):!Ea&&Ka&&Ja&&!Ha?"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,+q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.lineSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),f.close(),f.fillAndStroke()):!Ea&&Ka&&Ja&&Ha?"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),"double"==va&&(F.moveNWInner(f,+q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.lineNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,+q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),f.close(),f.fillAndStroke()):!Ea||Ka||Ja||Ha?Ea&&!Ka&&!Ja&&Ha?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,+q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.lineNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke()):Ea&&!Ka&&Ja&&!Ha?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,+Ka),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea)),f.stroke(),f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.lineNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),f.close(),f.fillAndStroke(),f.begin(),F.moveSE(f,+q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.lineSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),f.close(),f.fillAndStroke()):Ea&&!Ka&&Ja&&Ha?"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,+q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.lineNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,+z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),f.close(),f.fillAndStroke()):Ea&&Ka&&!Ja&&!Ha?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea)),f.stroke()):(f.begin(),+F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.lineSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),f.close(),f.fillAndStroke()):Ea&&Ka&&!Ja&&Ha?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,+A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,+z,u,A,H,ab,O,Ja),F.lineSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke()):Ea&&Ka&&Ja&&!Ha?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,+q,z,u,A,H,bb,O,Ha),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.lineSWInner(f,+q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),f.close(),f.fillAndStroke()):Ea&&Ka&&Ja&&Ha&&("frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,+q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),f.close(),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close()),f.stroke()):(f.begin(),+F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),f.close(),F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),+F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke())):"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.lineNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,+q,z,u,A,H,Wa,O,oa,Ha,Ea),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.lineSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,+q,z,u,A,H,bb,O,Ha),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.lineSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,Wa,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,+Ha)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,Wa,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.lineNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke());f.begin();F.paintFolds(f,q,z,u,A,H,Wa,$a,ab,bb,O,Ea,Ka,Ja,Ha);f.stroke()};Ga.prototype.moveNW=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(0,0):f.moveTo(0,ha)};Ga.prototype.moveNE=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(u,+0):f.moveTo(u-ha,0)};Ga.prototype.moveSE=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(u,A):f.moveTo(u,A-ha)};Ga.prototype.moveSW=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(0,A):f.moveTo(ha,A)};Ga.prototype.paintNW=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,ha,0)}else("snip"==+H||"default"==H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(ha,0);else f.lineTo(0,0)};Ga.prototype.paintTop=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(u,0):f.lineTo(u-ha,0)};Ga.prototype.paintNE=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,u,ha)}else("snip"==H||"default"==H&&"snip"==F||"fold"==H||"default"==+H&&"fold"==F)&&f.lineTo(u,ha);else f.lineTo(u,0)};Ga.prototype.paintRight=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(u,A):f.lineTo(u,A-ha)};Ga.prototype.paintLeft=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(0,0):f.lineTo(0,ha)};Ga.prototype.paintSE=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,+ha,0,0,q,u-ha,A)}else("snip"==H||"default"==H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-ha,A);else f.lineTo(u,A)};Ga.prototype.paintBottom=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(0,A):f.lineTo(ha,A)};Ga.prototype.paintSW=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,0,A-ha)}else("snip"==H||"default"==+H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(0,A-ha);else f.lineTo(0,A)};Ga.prototype.paintNWInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,O,.5*O+ha);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,O,O+ha);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(O,.5*O+ha);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(O+ha,O+ha),f.lineTo(O,O+ha)};Ga.prototype.paintTopInner=function(f,q,z,u,A,+F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(0,O):va&&!oa?f.lineTo(O,0):va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(ha+.5*O,O):f.lineTo(ha+O,O):f.lineTo(0,O):f.lineTo(0,0)};Ga.prototype.paintNEInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,u-ha-.5*O,O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,u-ha-O,O);else if("snip"==+H||"default"==H&&"snip"==F)f.lineTo(u-ha-.5*O,O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(u-ha-O,ha+O),f.lineTo(u-ha-O,O)};Ga.prototype.paintRightInner=function(f,q,z,u,A,F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(u-O,0):va&&!oa?f.lineTo(u,O):va?"square"==H||"default"==H&&"square"==F?f.lineTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,ha+.5*O):f.lineTo(u-O,ha+O):f.lineTo(u-O,0):f.lineTo(u,0)};Ga.prototype.paintLeftInner=function(f,q,z,+u,A,F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(O,A):va&&!oa?f.lineTo(0,A-O):va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,A-ha-.5*O):f.lineTo(O,A-ha-O):f.lineTo(O,A):f.lineTo(0,A)};Ga.prototype.paintSEInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,u-O,A-ha-.5*O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,u-O,+A-ha-O);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(u-O,A-ha-.5*O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(u-ha-O,A-ha-O),f.lineTo(u-O,A-ha-O)};Ga.prototype.paintBottomInner=function(f,q,z,u,A,F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(u,A-O):va&&!oa?f.lineTo(u-O,A):"square"==H||"default"==H&&"square"==F||!va?f.lineTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-ha-.5*O,A-O):f.lineTo(u-ha-O,A-O):f.lineTo(u,A)};Ga.prototype.paintSWInner=+function(f,q,z,u,A,F,H,ha,O,va){if(!va)f.lineTo(O,A);else if("square"==H||"default"==H&&"square"==F)f.lineTo(O,A-O);else if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,ha+.5*O,A-O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,ha+O,A-O);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(ha+.5*O,A-O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(O+ha,A-ha-O),f.lineTo(O+ha,A-O)};Ga.prototype.moveSWInner=function(f,q,z,u,A,F,H,ha,O,va){va?+"square"==H||"default"==H&&"square"==F?f.moveTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(O,A-ha-O):f.moveTo(0,A-O)};Ga.prototype.lineSWInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,A-ha-.5*O):("invRound"==H||+"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(O,A-ha-O):f.lineTo(0,A-O)};Ga.prototype.moveSEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F?f.moveTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(u-O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(u-O,A-ha-O):f.moveTo(u-O,A)};Ga.prototype.lineSEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==+H||"default"==H&&"square"==F?f.lineTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-O,A-ha-O):f.lineTo(u-O,A)};Ga.prototype.moveNEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F||va?f.moveTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(u-O,ha+.5*O):("invRound"==H||+"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(u-O,ha+O):f.moveTo(u,O)};Ga.prototype.lineNEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F||va?f.lineTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-O,ha+O):f.lineTo(u,O)};Ga.prototype.moveNWInner=function(f,q,z,u,A,F,H,ha,O,va,oa){va||oa?+!va&&oa?f.moveTo(O,0):va&&!oa?f.moveTo(0,O):"square"==H||"default"==H&&"square"==F?f.moveTo(O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(O,ha+O):f.moveTo(0,0)};Ga.prototype.lineNWInner=function(f,q,z,u,A,F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(O,0):va&&!oa?f.lineTo(0,O):"square"==H||"default"==H&&"square"==F?f.lineTo(O,O):"rounded"==H||"default"==H&&"rounded"==+F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(O,ha+O):f.lineTo(0,0)};Ga.prototype.paintFolds=function(f,q,z,u,A,F,H,ha,O,va,oa,Xa,kb,gb,Ea){if("fold"==F||"fold"==H||"fold"==ha||"fold"==O||"fold"==va)("fold"==H||"default"==H&&"fold"==F)&&Xa&&Ea&&(f.moveTo(0,oa),f.lineTo(oa,oa),f.lineTo(oa,0)),("fold"==ha||"default"==ha&&"fold"==F)&&Xa&&kb&&(f.moveTo(u-oa,0),f.lineTo(u-oa,oa),f.lineTo(u,oa)),("fold"==+O||"default"==O&&"fold"==F)&&gb&&kb&&(f.moveTo(u-oa,A),f.lineTo(u-oa,A-oa),f.lineTo(u,A-oa)),("fold"==va||"default"==va&&"fold"==F)&&gb&&Ea&&(f.moveTo(0,A-oa),f.lineTo(oa,A-oa),f.lineTo(oa,A))};mxCellRenderer.registerShape(Ga.prototype.cst.RECT2,Ga);Ga.prototype.constraints=null;mxUtils.extend(Ya,mxConnector);Ya.prototype.origPaintEdgeShape=Ya.prototype.paintEdgeShape;Ya.prototype.paintEdgeShape=function(f,q){for(var z=[],u=0;u<q.length;u++)z.push(mxUtils.clone(q[u]));u=f.state.dashed;var A=f.state.fixDash;+Ya.prototype.origPaintEdgeShape.apply(this,[f,z]);3<=f.state.strokeWidth&&(z=mxUtils.getValue(this.style,"fillColor",null),null!=z&&(f.setStrokeColor(z),f.setStrokeWidth(f.state.strokeWidth-2),f.setDashed(u,A),Ya.prototype.origPaintEdgeShape.apply(this,[f,q])))};mxCellRenderer.registerShape("filledEdge",Ya);mxUtils.extend(Va,mxConnector);Va.prototype.defaultWidth=4;Va.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Va.prototype.getFlowAnimationPath=+function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)};Va.prototype.origPaintEdgeShape=Va.prototype.paintEdgeShape;Va.prototype.paintEdgeShape=function(f,q){for(var z=[],u=0;u<q.length;u++)z.push(mxUtils.clone(q[u]));u=f.state.dashed;var A=f.state.fixDash,F=this.getEdgeWidth();f.setStrokeWidth(F+2*this.strokewidth);f.setDashed(!1);Va.prototype.origPaintEdgeShape.apply(this,[f,z]);z=mxUtils.getValue(this.style,"fillColor",null);null!=z&&(f.setStrokeWidth(F),f.setStrokeColor(z),f.setDashed(u,+A),Va.prototype.origPaintEdgeShape.apply(this,[f,q]))};mxCellRenderer.registerShape("pipe",Va);mxUtils.extend(eb,mxRectangleShape);eb.prototype.size=10;eb.prototype.isRoundable=function(){return!0};eb.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);q=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=q&&q!=mxConstants.NONE&&(f.setStrokeColor("none"),f.begin(),f.rect(0,0,u,A),f.fillAndStroke(),f.setStrokeColor(this.stroke));var F=Math.max(5,parseFloat(mxUtils.getValue(this.style,+"size",this.size)));q=A/2;z=this.strokewidth;z=this.isRounded?z/2:z;A-=z;F=Math.max(1,Math.round(u/F)-1);var H=u/(F+1),ha=H/2;f.begin();f.moveTo(0,q);if(this.isRounded){f.curveTo(.4*ha,q-.4*(q-z),.6*ha,z,ha,z);for(var O=0;O<F;O++){var va=ha+O*H,oa=va+H,Xa=0==O%2?A:z;f.curveTo(va+.4*H,0==O%2?z:A,oa-.4*H,Xa,oa,Xa)}A=0==F%2?z:A;f.curveTo(ha+F*H+.4*ha,A,u-.4*ha,q-(A==z?1:-1)*(q-z)*.4,u,q)}else{f.lineTo(ha,z);for(O=0;O<F;O++)oa=ha+(O+1)*H,Xa=0==O%2?A:z,f.lineTo(oa,Xa);f.lineTo(u,q)}f.stroke()};mxCellRenderer.registerShape("zigzag",+eb);"undefined"!==typeof StyleFormatPanel&&function(){var f=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var q=this.editorUi.getSelectionState(),z=f.apply(this,arguments);"umlFrame"==q.style.shape&&z.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return z}}();mxMarker.addMarker("dash",function(f,q,z,u,A,F,H,ha,O,va){var oa=A*(H+O+1),Xa=F*(H+O+1);return function(){f.begin();f.moveTo(u.x-oa/2-Xa/2,u.y-Xa/+2+oa/2);f.lineTo(u.x+Xa/2-3*oa/2,u.y-3*Xa/2-oa/2);f.stroke()}});mxMarker.addMarker("box",function(f,q,z,u,A,F,H,ha,O,va){var oa=A*(H+O+1),Xa=F*(H+O+1),kb=u.x+oa/2,gb=u.y+Xa/2;u.x-=oa;u.y-=Xa;return function(){f.begin();f.moveTo(kb-oa/2-Xa/2,gb-Xa/2+oa/2);f.lineTo(kb-oa/2+Xa/2,gb-Xa/2-oa/2);f.lineTo(kb+Xa/2-3*oa/2,gb-3*Xa/2-oa/2);f.lineTo(kb-Xa/2-3*oa/2,gb-3*Xa/2+oa/2);f.close();va?f.fillAndStroke():f.stroke()}});mxMarker.addMarker("cross",function(f,q,z,u,A,F,H,ha,O,va){var oa=A*(H+O+1),Xa=F*(H+O++1);return function(){f.begin();f.moveTo(u.x-oa/2-Xa/2,u.y-Xa/2+oa/2);f.lineTo(u.x+Xa/2-3*oa/2,u.y-3*Xa/2-oa/2);f.moveTo(u.x-oa/2+Xa/2,u.y-Xa/2-oa/2);f.lineTo(u.x-Xa/2-3*oa/2,u.y-3*Xa/2+oa/2);f.stroke()}});mxMarker.addMarker("circle",ib);mxMarker.addMarker("circlePlus",function(f,q,z,u,A,F,H,ha,O,va){var oa=u.clone(),Xa=ib.apply(this,arguments),kb=A*(H+2*O),gb=F*(H+2*O);return function(){Xa.apply(this,arguments);f.begin();f.moveTo(oa.x-A*O,oa.y-F*O);f.lineTo(oa.x-2*kb+A*O,oa.y-2*gb+F*O);f.moveTo(oa.x-+kb-gb+F*O,oa.y-gb+kb-A*O);f.lineTo(oa.x+gb-kb-F*O,oa.y-gb-kb+A*O);f.stroke()}});mxMarker.addMarker("halfCircle",function(f,q,z,u,A,F,H,ha,O,va){var oa=A*(H+O+1),Xa=F*(H+O+1),kb=u.clone();u.x-=oa;u.y-=Xa;return function(){f.begin();f.moveTo(kb.x-Xa,kb.y+oa);f.quadTo(u.x-Xa,u.y+oa,u.x,u.y);f.quadTo(u.x+Xa,u.y-oa,kb.x+Xa,kb.y-oa);f.stroke()}});mxMarker.addMarker("async",function(f,q,z,u,A,F,H,ha,O,va){q=A*O*1.118;z=F*O*1.118;A*=H+O;F*=H+O;var oa=u.clone();oa.x-=q;oa.y-=z;u.x+=-A-q;u.y+=-F-z;return function(){f.begin();+f.moveTo(oa.x,oa.y);ha?f.lineTo(oa.x-A-F/2,oa.y-F+A/2):f.lineTo(oa.x+F/2-A,oa.y-F-A/2);f.lineTo(oa.x-A,oa.y-F);f.close();va?f.fillAndStroke():f.stroke()}});mxMarker.addMarker("openAsync",function(f){f=null!=f?f:2;return function(q,z,u,A,F,H,ha,O,va,oa){F*=ha+va;H*=ha+va;var Xa=A.clone();return function(){q.begin();q.moveTo(Xa.x,Xa.y);O?q.lineTo(Xa.x-F-H/f,Xa.y-H+F/f):q.lineTo(Xa.x+H/f-F,Xa.y-H-F/f);q.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var ob=function(f,q,z){return pb(f,["width"],+q,function(u,A,F,H,ha){ha=f.shape.getEdgeWidth()*f.view.scale+z;return new mxPoint(H.x+A*u/4+F*ha/2,H.y+F*u/4-A*ha/2)},function(u,A,F,H,ha,O){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));f.style.width=Math.round(2*u)/f.view.scale-z})},pb=function(f,q,z,u,A){return mb(f,q,function(F){var H=f.absolutePoints;if(null!=H&&0<H.length){var ha=H.length-1;F=f.view.translate;var O=f.view.scale,va=z?H[0]:H[ha];H=z?H[1]:H[ha-1];ha=H.x-va.x;var oa=H.y-va.y,Xa=Math.sqrt(ha*ha+oa*oa);va=u.call(this,+Xa,ha/Xa,oa/Xa,va,H);return new mxPoint(va.x/O-F.x,va.y/O-F.y)}return null},function(F,H,ha){var O=f.absolutePoints,va=O.length-1;F=f.view.translate;var oa=f.view.scale,Xa=z?O[0]:O[va];O=z?O[1]:O[va-1];va=O.x-Xa.x;var kb=O.y-Xa.y,gb=Math.sqrt(va*va+kb*kb);H.x=(H.x+F.x)*oa;H.y=(H.y+F.y)*oa;A.call(this,gb,va/gb,kb/gb,Xa,O,H,ha)})},sb=function(f,q){return function(z){return[pb(z,["startWidth"],!0,function(u,A,F,H,ha){ha=mxUtils.getNumber(z.style,"startWidth",f)*z.view.scale+q;return new mxPoint(H.x++A*u/4+F*ha/2,H.y+F*u/4-A*ha/2)},function(u,A,F,H,ha,O){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));z.style.startWidth=Math.round(2*u)/z.view.scale-q})]}},rb=function(f){return function(q){return[mb(q,["arrowWidth","arrowSize"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Ma.prototype.arrowWidth))),A=Math.max(0,Math.min(f,mxUtils.getValue(this.state.style,"arrowSize",Ma.prototype.arrowSize)));return new mxPoint(z.x+(1-A)*z.width,z.y+(1-u)*z.height/2)},function(z,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(z.y+z.height/2-u.y)/z.height*2));this.state.style.arrowSize=Math.max(0,Math.min(f,(z.x+z.width-u.x)/z.width))})]}},tb=function(f){return function(q){return[mb(q,["size"],function(z){var u=Math.max(0,Math.min(.5*z.height,parseFloat(mxUtils.getValue(this.state.style,"size",f))));return new mxPoint(z.x,z.y+u)},function(z,u){this.state.style.size=Math.max(0,u.y-z.y)},!0)]}},yb=function(f,q,z){return function(u){var A=[mb(u,["size"],function(F){var H=Math.max(0,Math.min(F.width,Math.min(F.height,parseFloat(mxUtils.getValue(this.state.style,"size",q)))))*f;return new mxPoint(F.x+H,F.y+H)},function(F,H){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(F.width,H.x-F.x),Math.min(F.height,H.y-F.y)))/f)},!1)];z&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&A.push(xb(u));return A}},vb=function(f,q,z,u,A){z=null!=z?z:.5;return function(F){var H=[mb(F,["size"],function(ha){var O=null!=A?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,va=parseFloat(mxUtils.getValue(this.state.style,"size",O?A:f));return new mxPoint(ha.x+Math.max(0,Math.min(.5*ha.width,va*(O?1:ha.width))),ha.getCenterY())},function(ha,O,va){ha=null!=A&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?O.x-ha.x:Math.max(0,Math.min(z,(O.x-ha.x)/ha.width));this.state.style.size=ha},!1,u)];q&&mxUtils.getValue(F.style,mxConstants.STYLE_ROUNDED,!1)&&H.push(xb(F));return H}},Fb=function(f,q,z){f=null!=f?f:.5;return function(u){var A=[mb(u,["size"],function(F){var H=null!=z?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ha=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",H?z:q)));return new mxPoint(F.x+Math.min(.75*F.width*f,ha*(H?.75:.75*F.width)),F.y+F.height/4)},function(F,H){F=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?H.x-F.x:Math.max(0,Math.min(f,(H.x-F.x)/F.width*.75));this.state.style.size=F},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&A.push(xb(u));return A}},zb=function(){return function(f){var q=[];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q}},xb=function(f,q){return mb(f,[mxConstants.STYLE_ARCSIZE],function(z){var u=null!=q?q:z.height/8;if("1"==mxUtils.getValue(f.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var A=mxUtils.getValue(f.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(z.x+z.width-Math.min(z.width/2,A),z.y+u)}A=Math.max(0,parseFloat(mxUtils.getValue(f.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(z.x+z.width-Math.min(Math.max(z.width/2,z.height/2),Math.min(z.width,z.height)*A),z.y+u)},function(z,u,A){"1"==mxUtils.getValue(f.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(z.width,2*(z.x+z.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(z.width-u.x+z.x)/Math.min(z.width,z.height))))})},mb=function(f,q,z,u,-A,F,H){var ha=new mxHandle(f,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(va){for(var pa=0;pa<q.length;pa++)this.copyStyle(q[pa]);H&&H(va)};ha.getPosition=z;ha.setPosition=u;ha.ignoreGrid=null!=A?A:!0;if(F){var O=ha.positionChanged;ha.positionChanged=function(){O.apply(this,arguments);f.view.invalidate(this.state.cell);f.view.validate()}}return ha},Bb={link:function(f){return[ob(f,!0,10),ob(f,!1,10)]},pipe:function(f){return[ob(f,!0,10),ob(f,!1,10)]},flexArrow:function(f){var q=+A,F,H){var ha=new mxHandle(f,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(va){for(var oa=0;oa<q.length;oa++)this.copyStyle(q[oa]);H&&H(va)};ha.getPosition=z;ha.setPosition=u;ha.ignoreGrid=null!=A?A:!0;if(F){var O=ha.positionChanged;ha.positionChanged=function(){O.apply(this,arguments);f.view.invalidate(this.state.cell);f.view.validate()}}return ha},Bb={link:function(f){return[ob(f,!0,10),ob(f,!1,10)]},pipe:function(f){return[ob(f,!0,10),ob(f,!1,10)]},flexArrow:function(f){var q=f.view.graph.gridSize/f.view.scale,z=[];mxUtils.getValue(f.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(z.push(pb(f,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,A,F,H,ha){u=(f.shape.getEdgeWidth()-f.shape.strokewidth)*f.view.scale;ha=3*mxUtils.getNumber(f.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*f.view.scale;return new mxPoint(H.x+A*(ha+f.shape.strokewidth*f.view.scale)+F*u/2,H.y+F*(ha+f.shape.strokewidth*f.view.scale)-A*u/2)},function(u,A,F,H,ha,O,va){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));A=mxUtils.ptLineDist(H.x,H.y,H.x+F,H.y-A,O.x,O.y);f.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(A-f.shape.strokewidth)/3)/100/f.view.scale;f.style.width=Math.round(2*u)/f.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))f.style[mxConstants.STYLE_ENDSIZE]=f.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(va.getEvent())||Math.abs(parseFloat(f.style[mxConstants.STYLE_STARTSIZE])-parseFloat(f.style[mxConstants.STYLE_ENDSIZE]))<q/6&&(f.style[mxConstants.STYLE_STARTSIZE]=f.style[mxConstants.STYLE_ENDSIZE])})),z.push(pb(f,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,A,F,H,ha){u=(f.shape.getStartArrowWidth()-f.shape.strokewidth)*f.view.scale;ha=3*mxUtils.getNumber(f.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*f.view.scale;return new mxPoint(H.x+A*(ha+f.shape.strokewidth*f.view.scale)+F*u/2,H.y+F*(ha+f.shape.strokewidth*@@ -3033,32 +3037,32 @@ f.style.startWidth;mxEvent.isAltDown(va.getEvent())||(Math.abs(parseFloat(f.stylMath.abs(parseFloat(f.style.endWidth)-parseFloat(f.style.startWidth))<q&&(f.style.endWidth=f.style.startWidth))})));return z},swimlane:function(f){var q=[];if(mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED)){var z=parseFloat(mxUtils.getValue(f.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));q.push(xb(f,z/2))}q.push(mb(f,[mxConstants.STYLE_STARTSIZE],function(u){var A=parseFloat(mxUtils.getValue(f.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(f.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(u.getCenterX(),u.y+Math.max(0,Math.min(u.height,A))):new mxPoint(u.x+Math.max(0,Math.min(u.width,A)),u.getCenterY())},function(u,A){f.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(u.height,A.y-u.y))):Math.round(Math.max(0,Math.min(u.width,A.x-u.x)))},!1,null,function(u){var A=f.view.graph;if(!mxEvent.isShiftDown(u.getEvent())&&!mxEvent.isControlDown(u.getEvent())&&(A.isTableRow(f.cell)||A.isTableCell(f.cell))){u=A.getSwimlaneDirection(f.style);var F=A.model.getParent(f.cell);F=A.model.getChildCells(F,!0);for(var H=[],ha=0;ha<F.length;ha++)F[ha]!=f.cell&&A.isSwimlane(F[ha])&&A.getSwimlaneDirection(A.getCurrentCellStyle(F[ha]))==u&&H.push(F[ha]);A.setCellStyles(mxConstants.STYLE_STARTSIZE,f.style[mxConstants.STYLE_STARTSIZE],H)}}));return q},label:zb(),ext:zb(),rectangle:zb(),triangle:zb(),rhombus:zb(),umlLifeline:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(q.height,-parseFloat(mxUtils.getValue(this.state.style,"size",aa.prototype.size))));return new mxPoint(q.getCenterX(),q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},umlFrame:function(f){return[mb(f,["width","height"],function(q){var z=Math.max(ia.prototype.corner,Math.min(q.width,mxUtils.getValue(this.state.style,"width",ia.prototype.width))),u=Math.max(1.5*ia.prototype.corner,Math.min(q.height,mxUtils.getValue(this.state.style,"height",ia.prototype.height)));-return new mxPoint(q.x+z,q.y+u)},function(q,z){this.state.style.width=Math.round(Math.max(ia.prototype.corner,Math.min(q.width,z.x-q.x)));this.state.style.height=Math.round(Math.max(1.5*ia.prototype.corner,Math.min(q.height,z.y-q.y)))},!1)]},process:function(f){var q=[mb(f,["size"],function(z){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),A=parseFloat(mxUtils.getValue(this.state.style,"size",ca.prototype.size));return u?new mxPoint(z.x+A,z.y+z.height/4):new mxPoint(z.x+z.width*A,z.y++parseFloat(mxUtils.getValue(this.state.style,"size",ba.prototype.size))));return new mxPoint(q.getCenterX(),q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},umlFrame:function(f){return[mb(f,["width","height"],function(q){var z=Math.max(fa.prototype.corner,Math.min(q.width,mxUtils.getValue(this.state.style,"width",fa.prototype.width))),u=Math.max(1.5*fa.prototype.corner,Math.min(q.height,mxUtils.getValue(this.state.style,"height",fa.prototype.height)));+return new mxPoint(q.x+z,q.y+u)},function(q,z){this.state.style.width=Math.round(Math.max(fa.prototype.corner,Math.min(q.width,z.x-q.x)));this.state.style.height=Math.round(Math.max(1.5*fa.prototype.corner,Math.min(q.height,z.y-q.y)))},!1)]},process:function(f){var q=[mb(f,["size"],function(z){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),A=parseFloat(mxUtils.getValue(this.state.style,"size",da.prototype.size));return u?new mxPoint(z.x+A,z.y+z.height/4):new mxPoint(z.x+z.width*A,z.y+z.height/4)},function(z,u){z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*z.width,u.x-z.x)):Math.max(0,Math.min(.5,(u.x-z.x)/z.width));this.state.style.size=z},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},cross:function(f){return[mb(f,["size"],function(q){var z=Math.min(q.width,q.height);z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",sa.prototype.size)))*z/2;return new mxPoint(q.getCenterX()-z,q.getCenterY()-z)},function(q,z){var u=Math.min(q.width,q.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,q.getCenterY()-z.y)/u*2,Math.max(0,q.getCenterX()-z.x)/u*2)))})]},note:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(q.width,Math.min(q.height,parseFloat(mxUtils.getValue(this.state.style,"size",E.prototype.size)))));return new mxPoint(q.x+q.width-z,q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(q.width,q.x+q.width-z.x),Math.min(q.height,-z.y-q.y))))})]},note2:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(q.width,Math.min(q.height,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size)))));return new mxPoint(q.x+q.width-z,q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(q.width,q.x+q.width-z.x),Math.min(q.height,z.y-q.y))))})]},manualInput:function(f){var q=[mb(f,["size"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",-eb.prototype.size)));return new mxPoint(z.x+z.width/4,z.y+3*u/4)},function(z,u){this.state.style.size=Math.round(Math.max(0,Math.min(z.height,4*(u.y-z.y)/3)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},dataStorage:function(f){return[mb(f,["size"],function(q){var z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",z?oa.prototype.fixedSize:oa.prototype.size));return new mxPoint(q.x+q.width-u*(z?1:+z.y-q.y))))})]},note2:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(q.width,Math.min(q.height,parseFloat(mxUtils.getValue(this.state.style,"size",P.prototype.size)))));return new mxPoint(q.x+q.width-z,q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(q.width,q.x+q.width-z.x),Math.min(q.height,z.y-q.y))))})]},manualInput:function(f){var q=[mb(f,["size"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",+db.prototype.size)));return new mxPoint(z.x+z.width/4,z.y+3*u/4)},function(z,u){this.state.style.size=Math.round(Math.max(0,Math.min(z.height,4*(u.y-z.y)/3)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},dataStorage:function(f){return[mb(f,["size"],function(q){var z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",z?xa.prototype.fixedSize:xa.prototype.size));return new mxPoint(q.x+q.width-u*(z?1:q.width),q.getCenterY())},function(q,z){q="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(q.width,q.x+q.width-z.x)):Math.max(0,Math.min(1,(q.x+q.width-z.x)/q.width));this.state.style.size=q},!1)]},callout:function(f){var q=[mb(f,["size","position"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",la.prototype.size))),A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",la.prototype.position)));mxUtils.getValue(this.state.style,"base",la.prototype.base);return new mxPoint(z.x+A*z.width,z.y+z.height-u)},function(z,u){mxUtils.getValue(this.state.style,"base",la.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(z.height,z.y+z.height-u.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(u.x-z.x)/z.width)))/100},!1),mb(f,["position2"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",la.prototype.position2)));return new mxPoint(z.x+u*z.width,z.y+z.height)},function(z,u){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(u.x-z.x)/z.width)))/100},!1),mb(f,["base"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",la.prototype.size))),A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",la.prototype.position))),F=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"base",la.prototype.base)));return new mxPoint(z.x+Math.min(z.width,A*z.width+F),z.y+z.height-u)},function(z,u){var A=-Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",la.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(z.width,u.x-z.x-A*z.width)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},internalStorage:function(f){var q=[mb(f,["dx","dy"],function(z){var u=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"dx",Ma.prototype.dx))),A=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"dy",Ma.prototype.dy)));-return new mxPoint(z.x+u,z.y+A)},function(z,u){this.state.style.dx=Math.round(Math.max(0,Math.min(z.width,u.x-z.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(z.height,u.y-z.y)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},module:function(f){return[mb(f,["jettyWidth","jettyHeight"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"jettyWidth",Ba.prototype.jettyWidth))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,-"jettyHeight",Ba.prototype.jettyHeight)));return new mxPoint(q.x+z/2,q.y+2*u)},function(q,z){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(q.width,z.x-q.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(q.height,z.y-q.y))/2)})]},corner:function(f){return[mb(f,["dx","dy"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"dx",ya.prototype.dx))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"dy",ya.prototype.dy)));return new mxPoint(q.x+-z,q.y+u)},function(q,z){this.state.style.dx=Math.round(Math.max(0,Math.min(q.width,z.x-q.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},tee:function(f){return[mb(f,["dx","dy"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"dx",Oa.prototype.dx))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"dy",Oa.prototype.dy)));return new mxPoint(q.x+(q.width+z)/2,q.y+u)},function(q,z){this.state.style.dx=Math.round(Math.max(0,+Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",la.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(z.width,u.x-z.x-A*z.width)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},internalStorage:function(f){var q=[mb(f,["dx","dy"],function(z){var u=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"dx",Ia.prototype.dx))),A=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"dy",Ia.prototype.dy)));+return new mxPoint(z.x+u,z.y+A)},function(z,u){this.state.style.dx=Math.round(Math.max(0,Math.min(z.width,u.x-z.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(z.height,u.y-z.y)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},module:function(f){return[mb(f,["jettyWidth","jettyHeight"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"jettyWidth",Ca.prototype.jettyWidth))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,+"jettyHeight",Ca.prototype.jettyHeight)));return new mxPoint(q.x+z/2,q.y+2*u)},function(q,z){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(q.width,z.x-q.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(q.height,z.y-q.y))/2)})]},corner:function(f){return[mb(f,["dx","dy"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"dx",za.prototype.dx))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"dy",za.prototype.dy)));return new mxPoint(q.x++z,q.y+u)},function(q,z){this.state.style.dx=Math.round(Math.max(0,Math.min(q.width,z.x-q.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},tee:function(f){return[mb(f,["dx","dy"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"dx",Qa.prototype.dx))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"dy",Qa.prototype.dy)));return new mxPoint(q.x+(q.width+z)/2,q.y+u)},function(q,z){this.state.style.dx=Math.round(Math.max(0,2*Math.min(q.width/2,z.x-q.x-q.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},singleArrow:rb(1),doubleArrow:rb(.5),"mxgraph.arrows2.wedgeArrow":sb(20,20),"mxgraph.arrows2.wedgeArrowDashed":sb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":sb(20,20),folder:function(f){return[mb(f,["tabWidth","tabHeight"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"tabWidth",t.prototype.tabWidth))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"tabHeight",t.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",t.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(z=q.width-z);return new mxPoint(q.x+z,q.y+u)},function(q,z){var u=Math.max(0,Math.min(q.width,z.x-q.x));mxUtils.getValue(this.state.style,"tabPosition",t.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=q.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},document:function(f){return[mb(f,-["size"],function(q){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",L.prototype.size))));return new mxPoint(q.x+3*q.width/4,q.y+(1-z)*q.height)},function(q,z){this.state.style.size=Math.max(0,Math.min(1,(q.y+q.height-z.y)/q.height))},!1)]},tape:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",I.prototype.size))));return new mxPoint(q.getCenterX(),q.y+z*q.height/2)},function(q,z){this.state.style.size=-Math.max(0,Math.min(1,(z.y-q.y)/q.height*2))},!1)]},isoCube2:function(f){return[mb(f,["isoAngle"],function(q){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",M.isoAngle))))*Math.PI/200;return new mxPoint(q.x,q.y+Math.min(q.width*Math.tan(z),.5*q.height))},function(q,z){this.state.style.isoAngle=Math.max(0,50*(z.y-q.y)/q.height)},!0)]},cylinder2:tb(c.prototype.size),cylinder3:tb(g.prototype.size),offPageConnector:function(f){return[mb(f,["size"],function(q){var z=-Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Xa.prototype.size))));return new mxPoint(q.getCenterX(),q.y+(1-z)*q.height)},function(q,z){this.state.style.size=Math.max(0,Math.min(1,(q.y+q.height-z.y)/q.height))},!1)]},"mxgraph.basic.rect":function(f){var q=[Graph.createHandle(f,["size"],function(z){var u=Math.max(0,Math.min(z.width/2,z.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(z.x+u,z.y+u)},function(z,u){this.state.style.size=-Math.round(100*Math.max(0,Math.min(z.height/2,z.width/2,u.x-z.x)))/100})];f=Graph.createHandle(f,["indent"],function(z){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(z.x+.75*z.width,z.y+u*z.height/200)},function(z,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-z.y)/z.height)))/100});q.push(f);return q},step:vb(ka.prototype.size,!0,null,!0,ka.prototype.fixedSize),hexagon:vb(V.prototype.size,!0,.5,!0,V.prototype.fixedSize),-curlyBracket:vb(da.prototype.size,!1),display:vb(xa.prototype.size,!1),cube:yb(1,n.prototype.size,!1),card:yb(.5,D.prototype.size,!0),loopLimit:yb(.5,Ja.prototype.size,!0),trapezoid:Fb(.5,K.prototype.size,K.prototype.fixedSize),parallelogram:Fb(1,N.prototype.size,N.prototype.fixedSize),zigzag:function(f){return[mb(f,["size"],function(q){var z=Math.max(5,parseFloat(mxUtils.getValue(this.state.style,"size",cb.prototype.size)));return new mxPoint(q.x+3*z,q.y)},function(q,z){this.state.style.size=Math.max(5,+["size"],function(q){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size))));return new mxPoint(q.x+3*q.width/4,q.y+(1-z)*q.height)},function(q,z){this.state.style.size=Math.max(0,Math.min(1,(q.y+q.height-z.y)/q.height))},!1)]},tape:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",I.prototype.size))));return new mxPoint(q.getCenterX(),q.y+z*q.height/2)},function(q,z){this.state.style.size=+Math.max(0,Math.min(1,(z.y-q.y)/q.height*2))},!1)]},isoCube2:function(f){return[mb(f,["isoAngle"],function(q){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",L.isoAngle))))*Math.PI/200;return new mxPoint(q.x,q.y+Math.min(q.width*Math.tan(z),.5*q.height))},function(q,z){this.state.style.isoAngle=Math.max(0,50*(z.y-q.y)/q.height)},!0)]},cylinder2:tb(c.prototype.size),cylinder3:tb(g.prototype.size),offPageConnector:function(f){return[mb(f,["size"],function(q){var z=+Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Da.prototype.size))));return new mxPoint(q.getCenterX(),q.y+(1-z)*q.height)},function(q,z){this.state.style.size=Math.max(0,Math.min(1,(q.y+q.height-z.y)/q.height))},!1)]},"mxgraph.basic.rect":function(f){var q=[Graph.createHandle(f,["size"],function(z){var u=Math.max(0,Math.min(z.width/2,z.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(z.x+u,z.y+u)},function(z,u){this.state.style.size=+Math.round(100*Math.max(0,Math.min(z.height/2,z.width/2,u.x-z.x)))/100})];f=Graph.createHandle(f,["indent"],function(z){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(z.x+.75*z.width,z.y+u*z.height/200)},function(z,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-z.y)/z.height)))/100});q.push(f);return q},step:vb(ka.prototype.size,!0,null,!0,ka.prototype.fixedSize),hexagon:vb(W.prototype.size,!0,.5,!0,W.prototype.fixedSize),+curlyBracket:vb(Q.prototype.size,!1),display:vb(ya.prototype.size,!1),cube:yb(1,n.prototype.size,!1),card:yb(.5,D.prototype.size,!0),loopLimit:yb(.5,ra.prototype.size,!0),trapezoid:Fb(.5,V.prototype.size,V.prototype.fixedSize),parallelogram:Fb(1,M.prototype.size,M.prototype.fixedSize),zigzag:function(f){return[mb(f,["size"],function(q){var z=Math.max(5,parseFloat(mxUtils.getValue(this.state.style,"size",eb.prototype.size)));return new mxPoint(q.x+3*z,q.y)},function(q,z){this.state.style.size=Math.max(5,Math.round((z.x-q.x)/3))},!1)]}};Graph.createHandle=mb;Graph.handleFactory=Bb;var Cb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var f=Cb.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var q=this.state.style.shape;null==mxCellRenderer.defaultShapes[q]&&null==mxStencilRegistry.getStencil(q)?q=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(q=mxConstants.SHAPE_SWIMLANE);q=Bb[q];null==q&&null!=this.state.shape&&this.state.shape.isRoundable()&&(q=Bb[mxConstants.SHAPE_RECTANGLE]);null!=q&&(q=q(this.state),null!=q&&(f=null==f?q:f.concat(q)))}return f};mxEdgeHandler.prototype.createCustomHandles=function(){var f=this.state.style.shape;null==mxCellRenderer.defaultShapes[f]&&null==mxStencilRegistry.getStencil(f)&&(f=mxConstants.SHAPE_CONNECTOR);f=Bb[f];return null!=f?f(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Db=new mxPoint(1,0),Eb=new mxPoint(1,0),nb=mxUtils.toRadians(-30);Db=mxUtils.getRotatedPoint(Db,Math.cos(nb),Math.sin(nb));var Ab=mxUtils.toRadians(-150);Eb=mxUtils.getRotatedPoint(Eb,Math.cos(Ab),Math.sin(Ab));mxEdgeStyle.IsometricConnector=function(f,q,z,u,A){var F=f.view;u=null!=u&&0<u.length?u[0]:null;var H=f.absolutePoints,ha=H[0];H=H[H.length-1];null!=u&&(u=F.transformControlPoint(f,u));null==ha&&null!=q&&(ha=new mxPoint(q.getCenterX(),q.getCenterY()));null==H&&null!=z&&(H=new mxPoint(z.getCenterX(),z.getCenterY()));var O=Db.x,-va=Db.y,pa=Eb.x,Wa=Eb.y,kb="horizontal"==mxUtils.getValue(f.style,"elbow","horizontal");if(null!=H&&null!=ha){f=function(Ea,La,Ka){Ea-=fb.x;var Ia=La-fb.y;La=(Wa*Ea-pa*Ia)/(O*Wa-va*pa);Ea=(va*Ea-O*Ia)/(va*pa-O*Wa);kb?(Ka&&(fb=new mxPoint(fb.x+O*La,fb.y+va*La),A.push(fb)),fb=new mxPoint(fb.x+pa*Ea,fb.y+Wa*Ea)):(Ka&&(fb=new mxPoint(fb.x+pa*Ea,fb.y+Wa*Ea),A.push(fb)),fb=new mxPoint(fb.x+O*La,fb.y+va*La));A.push(fb)};var fb=ha;null==u&&(u=new mxPoint(ha.x+(H.x-ha.x)/2,ha.y+(H.y-ha.y)/2));f(u.x,u.y,!0);+va=Db.y,oa=Eb.x,Xa=Eb.y,kb="horizontal"==mxUtils.getValue(f.style,"elbow","horizontal");if(null!=H&&null!=ha){f=function(Ea,Ka,Ja){Ea-=gb.x;var Ha=Ka-gb.y;Ka=(Xa*Ea-oa*Ha)/(O*Xa-va*oa);Ea=(va*Ea-O*Ha)/(va*oa-O*Xa);kb?(Ja&&(gb=new mxPoint(gb.x+O*Ka,gb.y+va*Ka),A.push(gb)),gb=new mxPoint(gb.x+oa*Ea,gb.y+Xa*Ea)):(Ja&&(gb=new mxPoint(gb.x+oa*Ea,gb.y+Xa*Ea),A.push(gb)),gb=new mxPoint(gb.x+O*Ka,gb.y+va*Ka));A.push(gb)};var gb=ha;null==u&&(u=new mxPoint(ha.x+(H.x-ha.x)/2,ha.y+(H.y-ha.y)/2));f(u.x,u.y,!0);f(H.x,H.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var wb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(f,q){if(q==mxEdgeStyle.IsometricConnector){var z=new mxElbowEdgeHandler(f);z.snapToTerminals=!1;return z}return wb.apply(this,arguments)};C.prototype.constraints=[];G.prototype.getConstraints=function(f,q,z){f=[];var u=Math.tan(mxUtils.toRadians(30)),A=(.5-u)/2;u=Math.min(q,z/(.5+u));q=(q-u)/2;z=(z-u)/2;f.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,q,z+.25*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+.5*u,z+u*A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+u,z+.25*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+u,z+.75*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+.5*u,z+(1-A)*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z+.75*u));return f};M.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,+0),!1,null,q,z+.25*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+.5*u,z+u*A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+u,z+.25*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+u,z+.75*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+.5*u,z+(1-A)*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z+.75*u));return f};L.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(q*Math.tan(u),.5*z);f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,u));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z-u));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));return f};la.prototype.getConstraints=function(f,q,z){f=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var A=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));f.push(new mxConnectionConstraint(new mxPoint(1,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.5*(z-u)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z-u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,@@ -3076,14 +3080,14 @@ null,q-u,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-.5*u,."tabWidth",this.tabWidth)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(f.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,0)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,A)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),A))):(f.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-.5*u,0)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,0)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,A)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-u),A)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.25*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.5*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.75*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,z));f.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return f};Ma.prototype.constraints=mxRectangleShape.prototype.constraints;oa.prototype.constraints=mxRectangleShape.prototype.constraints;ib.prototype.constraints=mxEllipse.prototype.constraints;y.prototype.constraints=mxEllipse.prototype.constraints;P.prototype.constraints=mxEllipse.prototype.constraints;ra.prototype.constraints=-mxEllipse.prototype.constraints;eb.prototype.constraints=mxRectangleShape.prototype.constraints;wa.prototype.constraints=mxRectangleShape.prototype.constraints;xa.prototype.getConstraints=function(f,q,z){f=[];var u=Math.min(q,z/2),A=Math.min(q-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*q);f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,-.5*(A+q-u),0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,0));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(A+q-u),z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));return f};Ba.prototype.getConstraints=function(f,q,z){q=parseFloat(mxUtils.getValue(f,"jettyWidth",Ba.prototype.jettyWidth))/2;f=parseFloat(mxUtils.getValue(f,-"jettyHeight",Ba.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,q),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(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,+0),!1,null,0,z));f.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return f};Ia.prototype.constraints=mxRectangleShape.prototype.constraints;xa.prototype.constraints=mxRectangleShape.prototype.constraints;Ra.prototype.constraints=mxEllipse.prototype.constraints;x.prototype.constraints=mxEllipse.prototype.constraints;N.prototype.constraints=mxEllipse.prototype.constraints;qa.prototype.constraints=+mxEllipse.prototype.constraints;db.prototype.constraints=mxRectangleShape.prototype.constraints;wa.prototype.constraints=mxRectangleShape.prototype.constraints;ya.prototype.getConstraints=function(f,q,z){f=[];var u=Math.min(q,z/2),A=Math.min(q-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*q);f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,+.5*(A+q-u),0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,0));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(A+q-u),z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));return f};Ca.prototype.getConstraints=function(f,q,z){q=parseFloat(mxUtils.getValue(f,"jettyWidth",Ca.prototype.jettyWidth))/2;f=parseFloat(mxUtils.getValue(f,+"jettyHeight",Ca.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,q),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(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,q),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),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*f,1.5*f)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*f,3.5*f))];z>5*f&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,q));z>8*f&&u.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,q));z>-15*f&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,q));return u};Ja.prototype.constraints=mxRectangleShape.prototype.constraints;Xa.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,+15*f&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,q));return u};ra.prototype.constraints=mxRectangleShape.prototype.constraints;Da.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];R.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,-1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];za.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,+1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];Ba.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];l.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];I.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,@@ -3092,87 +3096,87 @@ q),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(1),!1)];mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,-.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];N.prototype.constraints=mxRectangleShape.prototype.constraints;K.prototype.constraints=mxRectangleShape.prototype.constraints;L.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;Oa.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,+.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)];M.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;K.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;Qa.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(1,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.5*A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*q+.25*u,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),.5*(z+A)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),z));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-u),z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-u),.5*(z+A)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-u),A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*q-.25*u,A));f.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*A));return f};ya.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(1,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*A));return f};za.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(1,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.5*A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(z+A)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z));f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,-1),!1));return f};Sa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Na.prototype.getConstraints=+1),!1));return f};Ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Ma.prototype.getConstraints=function(f,q,z){f=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),A=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));u=(z-u)/2;f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-A),u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,0));f.push(new mxConnectionConstraint(new mxPoint(1,-.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-A),z-u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));return f};Pa.prototype.getConstraints=function(f,q,z){f=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Na.prototype.arrowWidth)))),A=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Na.prototype.arrowSize))));u=(z-u)/2;f.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-A),z-u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));return f};Na.prototype.getConstraints=function(f,q,z){f=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Ma.prototype.arrowWidth)))),A=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Ma.prototype.arrowSize))));u=(z-u)/2;f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*q,u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,0));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*q,z-u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));return f};sa.prototype.getConstraints=function(f,q,z){f=[];var u=Math.min(z,q),A=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(z-A)/2;var F=u+A,H=(q-A)/2;A=H+A;f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,.5*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,0));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,.5*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,z-.5*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,z));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z-.5*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+A),u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,u));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+A),F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*H,u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*H,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,u));return f};aa.prototype.constraints=null;Da.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)];Ca.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)];ta.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*H,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,u));return f};ba.prototype.constraints=null;Za.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)];Oa.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)];ta.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ua.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(E){p.escape();E=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),E);null!=E&&p.setSelectionCells(E)}function d(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var E=p.getSelectionCells(),Q=0;Q<E.length;Q++)p.cellLabelChanged(E[Q],"")}finally{p.getModel().endUpdate()}}}function m(E,Q,M,c,g){g.getModel().beginUpdate();try{var l=g.getCellGeometry(E);null!=l&&M&&c&&(M/=c,l=l.clone(),1<M?l.height=l.width/M:l.width=l.height*M,g.getModel().setGeometry(E,-l));g.setCellStyles(mxConstants.STYLE_CLIP_PATH,Q,[E]);g.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[E])}finally{g.getModel().endUpdate()}}var n=this.editorUi,v=n.editor,p=v.graph,C=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(n.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";n.openFile()});var G=new Action("smartFit",function(){if(n.chromelessResize)p.isLightboxView()?(1==-p.view.scale?n.lightboxFit():p.zoomTo(1),n.chromelessResize(!1)):n.chromelessResize(!0);else{p.popupMenuHandler.hideMenu();var E=p.view.scale,Q=p.container.scrollLeft,M=p.container.scrollTop,c=p.view.translate.x,g=p.view.translate.y;n.actions.get("resetView").funct();1E-5>Math.abs(E-p.view.scale)&&5>Math.abs(Q-p.container.scrollLeft)&&5>Math.abs(M-p.container.scrollTop)&&c==p.view.translate.x&&g==p.view.translate.y&&n.actions.get("fitWindow").funct()}},null,null,"Enter");G.getTitle=function(){return mxResources.get("fitWindow")+-" / "+mxResources.get("resetView")};this.put("smartFit",G);this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?n.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(){n.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(E,Q){try{var M=mxUtils.parseXml(E);v.graph.setSelectionCells(v.graph.importGraphModel(M.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")++Actions.prototype.init=function(){function b(E){p.escape();E=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),E);null!=E&&p.setSelectionCells(E)}function d(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var E=p.getSelectionCells(),P=0;P<E.length;P++)p.cellLabelChanged(E[P],"")}finally{p.getModel().endUpdate()}}}function m(E,P,L,c,g){g.getModel().beginUpdate();try{var l=g.getCellGeometry(E);null!=l&&L&&c&&(L/=c,l=l.clone(),1<L?l.height=l.width/L:l.width=l.height*L,g.getModel().setGeometry(E,+l));g.setCellStyles(mxConstants.STYLE_CLIP_PATH,P,[E]);g.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[E])}finally{g.getModel().endUpdate()}}var n=this.editorUi,v=n.editor,p=v.graph,C=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(n.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";n.openFile()});var G=new Action("smartFit",function(){if(n.chromelessResize)p.isLightboxView()?(1==+p.view.scale?n.lightboxFit():p.zoomTo(1),n.chromelessResize(!1)):n.chromelessResize(!0);else{p.popupMenuHandler.hideMenu();var E=p.view.scale,P=p.container.scrollLeft,L=p.container.scrollTop,c=p.view.translate.x,g=p.view.translate.y;n.actions.get("resetView").funct();1E-5>Math.abs(E-p.view.scale)&&5>Math.abs(P-p.container.scrollLeft)&&5>Math.abs(L-p.container.scrollTop)&&c==p.view.translate.x&&g==p.view.translate.y&&n.actions.get("fitWindow").funct()}},null,null,"Enter");G.getTitle=function(){return mxResources.get("fitWindow")++" / "+mxResources.get("resetView")};this.put("smartFit",G);this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?n.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(){n.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(E,P){try{var L=mxUtils.parseXml(E);v.graph.setSelectionCells(v.graph.importGraphModel(L.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+c.message)}}));n.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=C;this.addAction("save",function(){n.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=C;this.addAction("saveAs...",function(){n.saveFile(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+S");this.addAction("export...",function(){n.showDialog((new ExportDialog(n)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var E=new EditDiagramDialog(n);n.showDialog(E.container,620,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));E.init()}).isEnabled=C;this.addAction("pageSetup...",function(){n.showDialog((new PageSetupDialog(n)).container,320,240,!0,!0)}).isEnabled=C;this.addAction("print...",function(){n.showPrintDialog()},null,"",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(p,null,10,10)});this.addAction("undo",function(){n.undo()},null,"",Editor.ctrlKey+"+Z");this.addAction("redo",function(){n.redo()},null,"",mxClient.IS_WIN?Editor.ctrlKey+-"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var E=null;try{E=n.copyXml(),null!=E&&p.removeCells(E,!1)}catch(Q){}try{null==E&&mxClipboard.cut(p)}catch(Q){n.handleError(Q)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{n.copyXml()}catch(E){}try{mxClipboard.copy(p)}catch(E){n.handleError(E)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){n.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(E){n.pasteFromClipboard(p.popupMenuHandler.getTriggerPoint())});+"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var E=null;try{E=n.copyXml(),null!=E&&p.removeCells(E,!1)}catch(P){}try{null==E&&mxClipboard.cut(p)}catch(P){n.handleError(P)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{n.copyXml()}catch(E){}try{mxClipboard.copy(p)}catch(E){n.handleError(E)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){n.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(E){n.pasteFromClipboard(p.popupMenuHandler.getTriggerPoint())});this.addAction("swap",function(){var E=p.getSelectionCells();2==E.length&&p.swapShapes(E[0],E[1])});this.addAction("copySize",function(){var E=p.getSelectionCell();p.isEnabled()&&null!=E&&p.getModel().isVertex(E)&&(E=p.getCellGeometry(E),null!=E&&(n.copiedSize=new mxRectangle(E.x,E.y,E.width,E.height)))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+F");this.addAction("pasteSize",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=n.copiedSize){p.getModel().beginUpdate();try{for(var E=p.getResizableCells(p.getSelectionCells()),-Q=0;Q<E.length;Q++)if(p.getModel().isVertex(E[Q])){var M=p.getCellGeometry(E[Q]);null!=M&&(M=M.clone(),M.width=n.copiedSize.width,M.height=n.copiedSize.height,p.getModel().setGeometry(E[Q],M))}}finally{p.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");this.addAction("copyData",function(){var E=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&null!=E&&(E=E.cloneValue(),null==E||isNaN(E.nodeType)||(n.copiedValue=E))},null,null,Editor.altKey+"+"+Editor.shiftKey+-"+B");this.addAction("copyAsText",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E)try{p.isHtmlLabel(E)?n.writeHtmlToClipboard(p.getLabel(E),mxUtils.bind(this,function(Q){n.handleError(Q)})):n.writeTextToClipboard(p.getLabel(E),mxUtils.bind(this,function(Q){n.handleError(Q)}))}catch(Q){n.handleError(Q)}});this.addAction("pasteData",function(E,Q){function M(l,t){var B=c.getValue(l);t=l.cloneValue(t);t.removeAttribute("placeholders");null==B||isNaN(B.nodeType)||t.setAttribute("placeholders",-B.getAttribute("placeholders"));null!=E&&mxEvent.isShiftDown(E)||t.setAttribute("label",p.convertValueToString(l));c.setValue(l,t)}E=null!=Q?Q:E;var c=p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=n.copiedValue){c.beginUpdate();try{var g=p.getEditableCells(p.getSelectionCells());if(0==g.length)M(c.getRoot(),n.copiedValue);else for(Q=0;Q<g.length;Q++)M(g[Q],n.copiedValue)}finally{c.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(E,Q){E=-null!=Q?Q:E;null!=E&&mxEvent.isShiftDown(E)?d():b(null!=E&&(mxEvent.isControlDown(E)||mxEvent.isMetaDown(E)||mxEvent.isAltDown(E)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){d()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(E){n.handleError(E)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",+P=0;P<E.length;P++)if(p.getModel().isVertex(E[P])){var L=p.getCellGeometry(E[P]);null!=L&&(L=L.clone(),L.width=n.copiedSize.width,L.height=n.copiedSize.height,p.getModel().setGeometry(E[P],L))}}finally{p.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");this.addAction("copyData",function(){var E=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&null!=E&&(E=E.cloneValue(),null==E||isNaN(E.nodeType)||(n.copiedValue=E))},null,null,Editor.altKey+"+"+Editor.shiftKey++"+B");this.addAction("copyAsText",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E)try{p.isHtmlLabel(E)?n.writeHtmlToClipboard(p.getLabel(E),mxUtils.bind(this,function(P){n.handleError(P)})):n.writeTextToClipboard(p.getLabel(E),mxUtils.bind(this,function(P){n.handleError(P)}))}catch(P){n.handleError(P)}});this.addAction("pasteData",function(E,P){function L(l,t){var B=c.getValue(l);t=l.cloneValue(t);t.removeAttribute("placeholders");null==B||isNaN(B.nodeType)||t.setAttribute("placeholders",+B.getAttribute("placeholders"));null!=E&&mxEvent.isShiftDown(E)||t.setAttribute("label",p.convertValueToString(l));c.setValue(l,t)}E=null!=P?P:E;var c=p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=n.copiedValue){c.beginUpdate();try{var g=p.getEditableCells(p.getSelectionCells());if(0==g.length)L(c.getRoot(),n.copiedValue);else for(P=0;P<g.length;P++)L(g[P],n.copiedValue)}finally{c.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(E,P){E=+null!=P?P:E;null!=E&&mxEvent.isShiftDown(E)?d():b(null!=E&&(mxEvent.isControlDown(E)||mxEvent.isMetaDown(E)||mxEvent.isAltDown(E)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){d()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(E){n.handleError(E)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var E=n.getSelectionState();if(null!=E.mergeCell){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",E.rowspan,[E.mergeCell]),p.setCellStyles("colspan",E.colspan,[E.mergeCell])}finally{p.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var E=n.getSelectionState();if(0<E.cells.length){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",null,E.cells),p.setCellStyles("colspan",null,E.cells)}finally{p.getModel().endUpdate()}}}));G=new Action("turn",-function(E,Q){E=null!=Q?Q:E;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=E?mxEvent.isShiftDown(E):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");G.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",G);this.put("selectConnections",new Action("selectEdges",function(E){E=p.getSelectionCell();p.isEnabled()&&null!=E&&p.addSelectionCells(p.getEdges(E))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,-null,Editor.ctrlKey+"+"+Editor.shiftKey+"+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+E");this.addAction("selectAll",function(){p.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){p.clearSelection()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+A");this.addAction("lockUnlock",function(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{var E=p.getSelectionCells(),Q=p.getCurrentCellStyle(p.getSelectionCell()),-M=1==mxUtils.getValue(Q,mxConstants.STYLE_EDITABLE,1)?0:1;p.setCellStyles(mxConstants.STYLE_MOVABLE,M,E);p.setCellStyles(mxConstants.STYLE_RESIZABLE,M,E);p.setCellStyles(mxConstants.STYLE_ROTATABLE,M,E);p.setCellStyles(mxConstants.STYLE_DELETABLE,M,E);p.setCellStyles(mxConstants.STYLE_EDITABLE,M,E);p.setCellStyles("locked",1==M?0:1,E);p.setCellStyles("connectable",M,E)}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){var E=p.getSelectionCell();+function(E,P){E=null!=P?P:E;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=E?mxEvent.isShiftDown(E):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");G.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",G);this.put("selectConnections",new Action("selectEdges",function(E){E=p.getSelectionCell();p.isEnabled()&&null!=E&&p.addSelectionCells(p.getEdges(E))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,+null,Editor.ctrlKey+"+"+Editor.shiftKey+"+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+E");this.addAction("selectAll",function(){p.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){p.clearSelection()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+A");this.addAction("lockUnlock",function(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{var E=p.getSelectionCells(),P=p.getCurrentCellStyle(p.getSelectionCell()),+L=1==mxUtils.getValue(P,mxConstants.STYLE_EDITABLE,1)?0:1;p.setCellStyles(mxConstants.STYLE_MOVABLE,L,E);p.setCellStyles(mxConstants.STYLE_RESIZABLE,L,E);p.setCellStyles(mxConstants.STYLE_ROTATABLE,L,E);p.setCellStyles(mxConstants.STYLE_DELETABLE,L,E);p.setCellStyles(mxConstants.STYLE_EDITABLE,L,E);p.setCellStyles("locked",1==L?0:1,E);p.setCellStyles("connectable",L,E)}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){var E=p.getSelectionCell();p.model.isEdge(E)&&(E=p.model.getTerminal(E,!0));p.model.isVertex(E)&&Graph.exploreFromCell(n.editor.graph,E)});this.addAction("home",function(){p.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){p.exitGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Home");this.addAction("enterGroup",function(){p.enterGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+End");this.addAction("collapse",function(){p.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){p.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){p.orderCells(!1)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+F");this.addAction("toBack",function(){p.orderCells(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+B");this.addAction("bringForward",function(E){p.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(E){p.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",-function(){if(p.isEnabled()){var E=mxUtils.sortCells(p.getSelectionCells(),!0);1!=E.length||p.isTable(E[0])||p.isTableRow(E[0])?(E=p.getCellsForGroup(E),1<E.length&&p.setSelectionCell(p.groupCells(null,0,E))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(p.isEnabled()){var E=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var Q=p.ungroupCells();if(null!=E)for(var M=0;M<E.length;M++)p.model.contains(E[M])&&(0==p.model.getChildCount(E[M])&&-p.model.isVertex(E[M])&&p.setCellStyles("container","0",[E[M]]),Q.push(E[M]))}finally{p.model.endUpdate()}0<Q.length&&p.setSelectionCells(Q)}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var E=p.getSelectionCells();if(null!=E){for(var Q=[],M=0;M<E.length;M++)p.isTableRow(E[M])||p.isTableCell(E[M])||Q.push(E[M]);p.removeCellsFromParent(Q);0<Q.length&&p.scrollCellToVisible(Q[0])}}});this.addAction("edit",function(){p.isEnabled()&&-p.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var E=p.getSelectionCell()||p.getModel().getRoot();n.showDataDialog(E)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E&&p.isCellEditable(E)){var Q="";if(mxUtils.isNode(E.value)){var M=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&E.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(M=E.value.getAttribute("tooltip_"+Graph.diagramLanguage));-null==M&&(M=E.value.getAttribute("tooltip"));null!=M&&(Q=M)}Q=new TextareaDialog(n,mxResources.get("editTooltip")+":",Q,function(c){p.setTooltipForCell(E,c)});n.showDialog(Q.container,320,200,!0,!0);Q.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+T");this.addAction("openLink",function(){var E=p.getLinkForCell(p.getSelectionCell());null!=E&&p.openLink(E)});this.addAction("editLink...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E&&p.isCellEditable(E)){var Q=p.getLinkForCell(E,-!0)||"";n.showLinkDialog(Q,mxResources.get("ok"),function(M,c,g){p.getModel().beginUpdate();try{p.setLinkForCell(E,0<M.length?M:null),p.setAttributeForCell(E,"linkTarget",g)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(E))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+L");this.put("insertImage",new Action("image...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),n.actions.get("image").funct())})).isEnabled=C;this.addAction("editImage...",function(){n.actions.get("image").funct()});-this.put("insertLink",new Action("link...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&n.showLinkDialog("",mxResources.get("ok"),function(E,Q,M){E=mxUtils.trim(E);if(0<E.length){var c=null,g=p.getLinkTitle(E);null!=Q&&0<Q.length&&(c=Q[0].iconUrl,g=Q[0].name||Q[0].type,g=g.charAt(0).toUpperCase()+g.substring(1),30<g.length&&(g=g.substring(0,30)+"..."));Q=new mxCell(g,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+-c:"spacing=10;"));Q.vertex=!0;c=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([Q],!0));Q.geometry.x=c.x;Q.geometry.y=c.y;p.setAttributeForCell(Q,"linkTarget",M);p.setLinkForCell(Q,E);p.cellSizeUpdated(Q,!0);p.getModel().beginUpdate();try{Q=p.addCell(Q),p.fireEvent(new mxEventObject("cellsInserted","cells",[Q]))}finally{p.getModel().endUpdate()}p.setSelectionCell(Q);p.scrollCellToVisible(p.getSelectionCell())}},!0)},null,null,"L")).isEnabled=C;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var E=-p.getSelectedElement(),Q=p.getParentByName(E,"A",p.cellEditor.textarea),M="";if(null==Q&&null!=E&&null!=E.getElementsByTagName)for(var c=E.getElementsByTagName("a"),g=0;g<c.length&&null==Q;g++)c[g].textContent==E.textContent&&(Q=c[g]);null!=Q&&"A"==Q.nodeName&&(M=Q.getAttribute("href")||"",p.selectNode(Q));var l=p.cellEditor.saveSelection();n.showLinkDialog(M,mxResources.get("ok"),mxUtils.bind(this,function(t){p.cellEditor.restoreSelection(l);null!=t&&p.insertLink(t)}))}else p.isSelectionEmpty()?-this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=C;this.addAction("autosize",function(){var E=p.getSelectionCells();if(null!=E){p.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var M=E[Q];p.getModel().isVertex(M)&&(p.isAutosizeTextCell(M)&&p.setCellStyles("autosizeText",null,[M]),0<p.getModel().getChildCount(M)?p.updateGroupBounds([M],0,!0):p.updateCellSize(M))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Y");this.addAction("snapToGrid",-function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var E=p.getCommonStyle(p.getSelectionCells());E="1"==mxUtils.getValue(E,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var Q=p.getEditableCells(p.getSelectionCells()),M=0;M<Q.length;M++){var c=p.getView().getState(Q[M]);if(null!=c){var g=mxUtils.getValue(c.style,"html","0");if("1"==g&&null==E)p.removeTextStyleForCell(c.cell),p.setCellStyles("html",E,[Q[M]]);else if("0"==-g&&"1"==E){var l=mxUtils.htmlEntities(p.convertValueToString(c.cell),!1);"0"!=mxUtils.getValue(c.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>"));p.cellLabelChanged(c.cell,Graph.sanitizeHtml(l));p.setCellStyles("html",E,[Q[M]])}}}n.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=E?E:"0"],"cells",Q))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var E=p.getView().getState(p.getSelectionCell()),Q="wrap";p.stopEditing();null!=E&&"wrap"==E.style[mxConstants.STYLE_WHITE_SPACE]&&-(Q=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,Q)});this.addAction("rotation",function(){var E="0",Q=p.getView().getState(p.getSelectionCell());null!=Q&&(E=Q.style[mxConstants.STYLE_ROTATION]||E);E=new FilenameDialog(n,E,mxResources.get("apply"),function(M){null!=M&&0<M.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,M)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");n.showDialog(E.container,375,80,!0,!0);E.init()});this.addAction("resetView",function(){p.zoomTo(1);+function(){if(p.isEnabled()){var E=mxUtils.sortCells(p.getSelectionCells(),!0);1!=E.length||p.isTable(E[0])||p.isTableRow(E[0])?(E=p.getCellsForGroup(E),1<E.length&&p.setSelectionCell(p.groupCells(null,0,E))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(p.isEnabled()){var E=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var P=p.ungroupCells();if(null!=E)for(var L=0;L<E.length;L++)p.model.contains(E[L])&&(0==p.model.getChildCount(E[L])&&+p.model.isVertex(E[L])&&p.setCellStyles("container","0",[E[L]]),P.push(E[L]))}finally{p.model.endUpdate()}0<P.length&&p.setSelectionCells(P)}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var E=p.getSelectionCells();if(null!=E){for(var P=[],L=0;L<E.length;L++)p.isTableRow(E[L])||p.isTableCell(E[L])||P.push(E[L]);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 E=p.getSelectionCell()||p.getModel().getRoot();n.showDataDialog(E)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E&&p.isCellEditable(E)){var P="";if(mxUtils.isNode(E.value)){var L=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&E.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(L=E.value.getAttribute("tooltip_"+Graph.diagramLanguage));+null==L&&(L=E.value.getAttribute("tooltip"));null!=L&&(P=L)}P=new TextareaDialog(n,mxResources.get("editTooltip")+":",P,function(c){p.setTooltipForCell(E,c)});n.showDialog(P.container,320,200,!0,!0);P.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+T");this.addAction("openLink",function(){var E=p.getLinkForCell(p.getSelectionCell());null!=E&&p.openLink(E)});this.addAction("editLink...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E&&p.isCellEditable(E)){var P=p.getLinkForCell(E,+!0)||"";n.showLinkDialog(P,mxResources.get("ok"),function(L,c,g){p.getModel().beginUpdate();try{p.setLinkForCell(E,0<L.length?L:null),p.setAttributeForCell(E,"linkTarget",g)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(E))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+L");this.put("insertImage",new Action("image...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),n.actions.get("image").funct())})).isEnabled=C;this.addAction("editImage...",function(){n.actions.get("image").funct()});+this.put("insertLink",new Action("link...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&n.showLinkDialog("",mxResources.get("ok"),function(E,P,L){E=mxUtils.trim(E);if(0<E.length){var c=null,g=p.getLinkTitle(E);null!=P&&0<P.length&&(c=P[0].iconUrl,g=P[0].name||P[0].type,g=g.charAt(0).toUpperCase()+g.substring(1),30<g.length&&(g=g.substring(0,30)+"..."));P=new mxCell(g,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="++c:"spacing=10;"));P.vertex=!0;c=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([P],!0));P.geometry.x=c.x;P.geometry.y=c.y;p.setAttributeForCell(P,"linkTarget",L);p.setLinkForCell(P,E);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=C;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var E=+p.getSelectedElement(),P=p.getParentByName(E,"A",p.cellEditor.textarea),L="";if(null==P&&null!=E&&null!=E.getElementsByTagName)for(var c=E.getElementsByTagName("a"),g=0;g<c.length&&null==P;g++)c[g].textContent==E.textContent&&(P=c[g]);null!=P&&"A"==P.nodeName&&(L=P.getAttribute("href")||"",p.selectNode(P));var l=p.cellEditor.saveSelection();n.showLinkDialog(L,mxResources.get("ok"),mxUtils.bind(this,function(t){p.cellEditor.restoreSelection(l);null!=t&&p.insertLink(t)}))}else p.isSelectionEmpty()?+this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=C;this.addAction("autosize",function(){var E=p.getSelectionCells();if(null!=E){p.getModel().beginUpdate();try{for(var P=0;P<E.length;P++){var L=E[P];p.getModel().isVertex(L)&&(p.isAutosizeTextCell(L)&&p.setCellStyles("autosizeText",null,[L]),0<p.getModel().getChildCount(L)?p.updateGroupBounds([L],0,!0):p.updateCellSize(L))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Y");this.addAction("snapToGrid",+function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var E=p.getCommonStyle(p.getSelectionCells());E="1"==mxUtils.getValue(E,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var P=p.getEditableCells(p.getSelectionCells()),L=0;L<P.length;L++){var c=p.getView().getState(P[L]);if(null!=c){var g=mxUtils.getValue(c.style,"html","0");if("1"==g&&null==E)p.removeTextStyleForCell(c.cell),p.setCellStyles("html",E,[P[L]]);else if("0"==+g&&"1"==E){var l=mxUtils.htmlEntities(p.convertValueToString(c.cell),!1);"0"!=mxUtils.getValue(c.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>"));p.cellLabelChanged(c.cell,Graph.sanitizeHtml(l));p.setCellStyles("html",E,[P[L]])}}}n.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=E?E:"0"],"cells",P))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var E=p.getView().getState(p.getSelectionCell()),P="wrap";p.stopEditing();null!=E&&"wrap"==E.style[mxConstants.STYLE_WHITE_SPACE]&&+(P=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,P)});this.addAction("rotation",function(){var E="0",P=p.getView().getState(p.getSelectionCell());null!=P&&(E=P.style[mxConstants.STYLE_ROTATION]||E);E=new FilenameDialog(n,E,mxResources.get("apply"),function(L){null!=L&&0<L.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,L)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");n.showDialog(E.container,375,80,!0,!0);E.init()});this.addAction("resetView",function(){p.zoomTo(1);n.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(E){p.isFastZoomEnabled()?p.lazyZoom(!0,!0,n.buttonZoomDelay):p.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(E){p.isFastZoomEnabled()?p.lazyZoom(!1,!0,n.buttonZoomDelay):p.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){n.fitDiagramOrPages()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+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()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var E=new FilenameDialog(this.editorUi,-parseInt(100*p.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(Q){Q=parseInt(Q);!isNaN(Q)&&0<Q&&p.zoomTo(Q/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var E=new FilenameDialog(this.editorUi,parseInt(100*p.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(Q){Q=parseInt(Q);!isNaN(Q)&&0<Q&&(Q=new ChangePageSetup(n,null,-null,null,Q/100),Q.ignoreColor=!0,Q.ignoreImage=!0,p.model.execute(Q))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}));G=null;G=this.addAction("grid",function(){p.setGridEnabled(!p.isGridEnabled());p.defaultGridEnabled=p.isGridEnabled();n.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+G");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.isGridEnabled()});G.setEnabled(!1);G=this.addAction("guides",+parseInt(100*p.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(P){P=parseInt(P);!isNaN(P)&&0<P&&p.zoomTo(P/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var E=new FilenameDialog(this.editorUi,parseInt(100*p.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(P){P=parseInt(P);!isNaN(P)&&0<P&&(P=new ChangePageSetup(n,null,+null,null,P/100),P.ignoreColor=!0,P.ignoreImage=!0,p.model.execute(P))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}));G=null;G=this.addAction("grid",function(){p.setGridEnabled(!p.isGridEnabled());p.defaultGridEnabled=p.isGridEnabled();n.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+G");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.isGridEnabled()});G.setEnabled(!1);G=this.addAction("guides",function(){p.graphHandler.guidesEnabled=!p.graphHandler.guidesEnabled;n.fireEvent(new mxEventObject("guidesEnabledChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.graphHandler.guidesEnabled});G.setEnabled(!1);G=this.addAction("animations",function(){Editor.enableAnimations=!Editor.enableAnimations;n.fireEvent(new mxEventObject("enableAnimationsChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return Editor.enableAnimations});G=this.addAction("tooltips",function(){p.tooltipHandler.setEnabled(!p.tooltipHandler.isEnabled());n.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.tooltipHandler.isEnabled()});G=this.addAction("collapseExpand",function(){var E=new ChangePageSetup(n);E.ignoreColor=!0;E.ignoreImage=!0;E.foldingEnabled=!p.foldingEnabled;p.model.execute(E)});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.foldingEnabled});G.isEnabled=C;G=this.addAction("pageView",mxUtils.bind(this,function(){n.setPageVisible(!p.pageVisible)}));G.setToggleAction(!0);G.setSelectedCallback(function(){return p.pageVisible});G=this.addAction("connectionArrows",function(){p.connectionArrowsEnabled=!p.connectionArrowsEnabled;n.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+A");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionArrowsEnabled});G=this.addAction("connectionPoints",function(){p.setConnectable(!p.connectionHandler.isEnabled());n.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionHandler.isEnabled()});G=this.addAction("copyConnect",function(){p.connectionHandler.setCreateTarget(!p.connectionHandler.isCreateTarget());n.fireEvent(new mxEventObject("copyConnectChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionHandler.isCreateTarget()});G.isEnabled=C;G=this.addAction("autosave",function(){n.editor.setAutosave(!n.editor.autosave)});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.editor.autosave});G.isEnabled=C;G.visible=!1;this.addAction("help",function(){var E="";mxResources.isLanguageSupported(mxClient.language)&&(E="_"+mxClient.language);p.openLink(RESOURCES_PATH+"/help"+E+".html")});var T=!1;G=new Action("about",function(){T||(n.showDialog((new AboutDialog(n)).container,320,280,!0,!0,function(){T=!1}),T=!0)});G.getTitle=function(){return mxResources.get("about")+-" Graph Editor..."};this.put("about",G);G=mxUtils.bind(this,function(E,Q,M,c){return this.addAction(E,function(){if(null!=M&&p.cellEditor.isContentEditing())M();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var g=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,Q,g);(Q&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?p.updateLabelElements(g,function(t){t.style.fontWeight=null;"B"==t.nodeName&&p.replaceElement(t)}):(Q&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?-p.updateLabelElements(g,function(t){t.style.fontStyle=null;"I"==t.nodeName&&p.replaceElement(t)}):(Q&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(g,function(t){t.style.textDecoration=null;"U"==t.nodeName&&p.replaceElement(t)});for(var l=0;l<g.length;l++)0==p.model.getChildCount(g[l])&&p.autoSizeCell(g[l],!1)}finally{p.getModel().endUpdate()}}},null,null,c)});G("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");G("italic",+" Graph Editor..."};this.put("about",G);G=mxUtils.bind(this,function(E,P,L,c){return this.addAction(E,function(){if(null!=L&&p.cellEditor.isContentEditing())L();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var g=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,P,g);(P&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?p.updateLabelElements(g,function(t){t.style.fontWeight=null;"B"==t.nodeName&&p.replaceElement(t)}):(P&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?+p.updateLabelElements(g,function(t){t.style.fontStyle=null;"I"==t.nodeName&&p.replaceElement(t)}):(P&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(g,function(t){t.style.textDecoration=null;"U"==t.nodeName&&p.replaceElement(t)});for(var l=0;l<g.length;l++)0==p.model.getChildCount(g[l])&&p.autoSizeCell(g[l],!1)}finally{p.getModel().endUpdate()}}},null,null,c)});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(){n.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",p.shapeForegroundColor)});this.addAction("strokeColor...",function(){n.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("fillColor...",function(){n.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",p.shapeBackgroundColor)});this.addAction("gradientColor...",function(){n.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("backgroundColor...",function(){n.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",p.shapeBackgroundColor)});this.addAction("borderColor...",function(){n.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 E=p.getSelectionCells(),Q=0;Q<E.length;Q++)p.removeTextStyleForCell(E[Q],!0)}finally{p.getModel().endUpdate()}}});this.addAction("vertical",function(){n.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){n.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){p.getModel().beginUpdate();+null,"default",p.shapeForegroundColor)});this.addAction("removeFormat",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&!p.isEditing()){p.getModel().beginUpdate();try{for(var E=p.getSelectionCells(),P=0;P<E.length;P++)p.removeTextStyleForCell(E[P],!0)}finally{p.getModel().endUpdate()}}});this.addAction("vertical",function(){n.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){n.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),n.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();try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dotted",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("sharp",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,"0"),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("rounded",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),p.setCellStyles(mxConstants.STYLE_CURVED,-"0"),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!p.isSelectionEmpty()&&p.isEnabled()){p.getModel().beginUpdate();try{var E=p.getSelectionCells(),Q=p.getCurrentCellStyle(E[0]),M="1"==mxUtils.getValue(Q,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,M);p.setCellStyles(mxConstants.STYLE_CURVED,-null);n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[M,"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"),n.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 E=p.view.getState(p.getSelectionCell()),Q="1";null!=E&&null!=p.getFoldingImage(E)&&(Q="0");p.setCellStyles("collapsible",Q);n.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[Q],"cells",p.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var E=p.getEditableCells(p.getSelectionCells());if(null!=E&&0<E.length){var Q=p.getModel();Q=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",-Q.getStyle(E[0])||"",function(M){null!=M&&p.setCellStyle(mxUtils.trim(M),E)},null,null,400,220);this.editorUi.showDialog(Q.container,420,300,!0,!0);Q.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){p.isEnabled()&&!p.isSelectionEmpty()&&n.setDefaultStyle(p.getSelectionCell())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&n.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");-this.addAction("addWaypoint",function(){var E=p.getSelectionCell();if(null!=E&&p.getModel().isEdge(E)){var Q=v.graph.selectionCellsHandler.getHandler(E);if(Q instanceof mxEdgeHandler){var M=0,c=0;E=p.getModel().getParent(E);for(var g=p.getCellGeometry(E);p.getModel().isVertex(E)&&null!=g;)M+=g.x,c+=g.y,E=p.getModel().getParent(E),g=p.getCellGeometry(E);E=p.popupMenuHandler.getTriggerPoint();M=Math.round(p.snap(E.x-M));c=Math.round(p.snap(E.y-c));Q.addPointAt(Q.state,M,c)}}});this.addAction("removeWaypoint",-function(){var E=n.actions.get("removeWaypoint");null!=E.handler&&E.handler.removePoint(E.handler.state,E.index)});this.addAction("clearAnchors",function(){var E=p.getSelectionCells();if(null!=E){E=p.getEditableCells(p.addAllEdges(E));p.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var M=E[Q];p.getModel().isEdge(M)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[M]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[M]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[M]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,-null,[M]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var E=p.getSelectionCells();if(null!=E){E=p.getEditableCells(p.addAllEdges(E));p.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var M=E[Q];if(p.getModel().isEdge(M)){var c=p.getCellGeometry(M);null!=c&&(c=c.clone(),c.points=null,c.x=0,c.y=0,c.offset=null,p.getModel().setGeometry(M,c))}}}finally{p.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");G=this.addAction("subscript",+"0"),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!p.isSelectionEmpty()&&p.isEnabled()){p.getModel().beginUpdate();try{var E=p.getSelectionCells(),P=p.getCurrentCellStyle(E[0]),L="1"==mxUtils.getValue(P,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,L);p.setCellStyles(mxConstants.STYLE_CURVED,+null);n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[L,"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"),n.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 E=p.view.getState(p.getSelectionCell()),P="1";null!=E&&null!=p.getFoldingImage(E)&&(P="0");p.setCellStyles("collapsible",P);n.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[P],"cells",p.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var E=p.getEditableCells(p.getSelectionCells());if(null!=E&&0<E.length){var P=p.getModel();P=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",+P.getStyle(E[0])||"",function(L){null!=L&&p.setCellStyle(mxUtils.trim(L),E)},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()&&n.setDefaultStyle(p.getSelectionCell())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&n.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");+this.addAction("addWaypoint",function(){var E=p.getSelectionCell();if(null!=E&&p.getModel().isEdge(E)){var P=v.graph.selectionCellsHandler.getHandler(E);if(P instanceof mxEdgeHandler){var L=0,c=0;E=p.getModel().getParent(E);for(var g=p.getCellGeometry(E);p.getModel().isVertex(E)&&null!=g;)L+=g.x,c+=g.y,E=p.getModel().getParent(E),g=p.getCellGeometry(E);E=p.popupMenuHandler.getTriggerPoint();L=Math.round(p.snap(E.x-L));c=Math.round(p.snap(E.y-c));P.addPointAt(P.state,L,c)}}});this.addAction("removeWaypoint",+function(){var E=n.actions.get("removeWaypoint");null!=E.handler&&E.handler.removePoint(E.handler.state,E.index)});this.addAction("clearAnchors",function(){var E=p.getSelectionCells();if(null!=E){E=p.getEditableCells(p.addAllEdges(E));p.getModel().beginUpdate();try{for(var P=0;P<E.length;P++){var L=E[P];p.getModel().isEdge(L)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[L]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[L]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[L]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,+null,[L]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var E=p.getSelectionCells();if(null!=E){E=p.getEditableCells(p.addAllEdges(E));p.getModel().beginUpdate();try{for(var P=0;P<E.length;P++){var L=E[P];if(p.getModel().isEdge(L)){var c=p.getCellGeometry(L);null!=c&&(c=c.clone(),c.points=null,c.x=0,c.y=0,c.offset=null,p.getModel().setGeometry(L,c))}}}finally{p.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+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 E=p.getCurrentCellStyle(p.getSelectionCell());E=mxUtils.getValue(E,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,E-1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");G=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var E=p.getCurrentCellStyle(p.getSelectionCell());E=mxUtils.getValue(E,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,E+1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");-this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var E=mxResources.get("image")+" ("+mxResources.get("url")+"):",Q=p.getView().getState(p.getSelectionCell()),M="",c=null;null!=Q&&(M=Q.style[mxConstants.STYLE_IMAGE]||M,c=Q.style[mxConstants.STYLE_CLIP_PATH]||c);var g=p.cellEditor.saveSelection();n.showImageDialog(E,M,function(l,t,B,D,I,L){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(g),p.insertImage(l,t,B);else{var N=p.getSelectionCells();-if(null!=l&&(0<l.length||0<N.length)){var K=null;p.getModel().beginUpdate();try{if(0==N.length){N=[p.insertVertex(p.getDefaultParent(),null,"",0,0,t,B,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var da=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(N,!0));N[0].geometry.x=da.x;N[0].geometry.y=da.y;null!=D&&m(N[0],D,I,L,p);K=N;p.fireEvent(new mxEventObject("cellsInserted","cells",K))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<l.length?l:null,N);var ja=-p.getCurrentCellStyle(N[0]);"image"!=ja[mxConstants.STYLE_SHAPE]&&"label"!=ja[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",N):0==l.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,N);null==D&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,N);if(null!=t&&null!=B)for(l=0;l<N.length;l++){var ea=N[l];if("0"!=p.getCurrentCellStyle(ea).expand){var ca=p.getModel().getGeometry(ea);null!=ca&&(ca=ca.clone(),ca.width=t,ca.height=B,p.getModel().setGeometry(ea,ca))}null!=D&&m(ea,-D,I,L,p)}}finally{p.getModel().endUpdate()}null!=K&&(p.setSelectionCells(K),p.scrollCellToVisible(K[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,c)}}).isEnabled=C;this.addAction("crop...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=E){var Q=p.getCurrentCellStyle(E),M=Q[mxConstants.STYLE_IMAGE],c=Q[mxConstants.STYLE_SHAPE];M&&"image"==c&&(Q=new CropImageDialog(n,M,Q[mxConstants.STYLE_CLIP_PATH],function(g,l,t){m(E,-g,l,t,p)}),n.showDialog(Q.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=C;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(n,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){n.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){n.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),+this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var E=mxResources.get("image")+" ("+mxResources.get("url")+"):",P=p.getView().getState(p.getSelectionCell()),L="",c=null;null!=P&&(L=P.style[mxConstants.STYLE_IMAGE]||L,c=P.style[mxConstants.STYLE_CLIP_PATH]||c);var g=p.cellEditor.saveSelection();n.showImageDialog(E,L,function(l,t,B,D,I,K){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(g),p.insertImage(l,t,B);else{var M=p.getSelectionCells();+if(null!=l&&(0<l.length||0<M.length)){var V=null;p.getModel().beginUpdate();try{if(0==M.length){M=[p.insertVertex(p.getDefaultParent(),null,"",0,0,t,B,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var Q=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(M,!0));M[0].geometry.x=Q.x;M[0].geometry.y=Q.y;null!=D&&m(M[0],D,I,K,p);V=M;p.fireEvent(new mxEventObject("cellsInserted","cells",V))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<l.length?l:null,M);var ja=+p.getCurrentCellStyle(M[0]);"image"!=ja[mxConstants.STYLE_SHAPE]&&"label"!=ja[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",M):0==l.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,M);null==D&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,M);if(null!=t&&null!=B)for(l=0;l<M.length;l++){var ea=M[l];if("0"!=p.getCurrentCellStyle(ea).expand){var da=p.getModel().getGeometry(ea);null!=da&&(da=da.clone(),da.width=t,da.height=B,p.getModel().setGeometry(ea,da))}null!=D&&m(ea,+D,I,K,p)}}finally{p.getModel().endUpdate()}null!=V&&(p.setSelectionCells(V),p.scrollCellToVisible(V[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,c)}}).isEnabled=C;this.addAction("crop...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=E){var P=p.getCurrentCellStyle(E),L=P[mxConstants.STYLE_IMAGE],c=P[mxConstants.STYLE_SHAPE];L&&"image"==c&&(P=new CropImageDialog(n,L,P[mxConstants.STYLE_CLIP_PATH],function(g,l,t){m(E,+g,l,t,p)}),n.showDialog(P.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=C;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(n,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){n.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){n.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),n.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+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(){n.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return n.isFormatPanelVisible()}));G=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(n,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){n.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){n.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),n.fireEvent(new mxEventObject("outline"))):-this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E){var Q=p.view.getState(E);if(null!=Q&&"mxgraph.basic.polygon"===mxUtils.getValue(Q.style,mxConstants.STYLE_SHAPE)){var M=new PolygonDialog(n,-E);n.showDialog(M.container,680,540,!0,!0,function(){M.destroy()},null,null,new mxRectangle(0,0,740,600));M.init()}}}).isEnabled=C;this.addAction("editConnectionPoints...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=E&&null!=E.geometry){var Q=new ConnectionPointsDialog(n,E);n.showDialog(Q.container,400,450,!0,!1,function(){Q.destroy()},null,null,new mxRectangle(0,0,450,500));Q.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=+this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E){var P=p.view.getState(E);if(null!=P&&"mxgraph.basic.polygon"===mxUtils.getValue(P.style,mxConstants.STYLE_SHAPE)){var L=new PolygonDialog(n,+E);n.showDialog(L.container,680,540,!0,!0,function(){L.destroy()},null,null,new mxRectangle(0,0,740,600));L.init()}}}).isEnabled=C;this.addAction("editConnectionPoints...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=E&&null!=E.geometry){var P=new ConnectionPointsDialog(n,E);n.showDialog(P.container,400,450,!0,!1,function(){P.destroy()},null,null,new mxRectangle(0,0,450,500));P.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=C};Actions.prototype.addAction=function(b,d,m,n,v,p){var C=b;"..."==C.substring(C.length-3)&&(C=C.substring(0,C.length-3));return this.put(C,new Action(b,d,m,n,v,p))};Actions.prototype.put=function(b,d){return this.actions[b]=d};Actions.prototype.get=function(b){return this.actions[b]};function Action(b,d,m,n,v,p){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(d);this.enabled=null!=m?m:!0;this.iconCls=n;this.shortcut=v;this.visible=null!=p?p:!0}mxUtils.extend(Action,mxEventSource);Action.prototype.getTitle=function(){var b=this.label;"..."==b.substring(b.length-3)?(b=b.substring(0,b.length-3),b=mxResources.get(b)+"..."):b=mxResources.get(b);return b};Action.prototype.createFunction=function(b){return b};Action.prototype.setEnabled=function(b){this.enabled!=b&&(this.enabled=b,this.fireEvent(new mxEventObject("stateChanged","attribute","enabled")))};Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setVisible=function(b){this.visible!=b&&(this.visible=b,this.fireEvent(new mxEventObject("stateChanged","attribute","visible")))};Action.prototype.isVisible=function(){return this.visible};Action.prototype.setToggleAction=function(b){this.toggleAction=b};Action.prototype.setSelectedCallback=function(b){this.selectedCallback=b};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(b,d){mxEventSource.call(this);this.ui=b;this.setData(d||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;DrawioFile.RESTRICT_EXPORT=!1;mxUtils.extend(DrawioFile,mxEventSource);@@ -3185,25 +3189,25 @@ d&&d(G))}),C=mxUtils.bind(this,function(){return!n});null!=this.sync?this.sync.fDrawioFile.prototype.updateFile=function(b,d,m,n,v,p){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum,"latestFile",[p]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=d&&d();else{var C=mxUtils.bind(this,function(G){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[G]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=G?this.mergeFile(G,b,d,n,v):this.reloadFile(b,d))}catch(T){null!=d&&d(T)}});null!=p?C(p):this.getLatestVersion(C,d)}};DrawioFile.prototype.mergeFile=function(b,d,m,n,v){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var C=this.getShadowPages(),G=[this.ui.diffPages(null!=n?n:C,p)];n=null;try{var T=mxUtils.parseXml(b.initialData).documentElement;null!=T&&"mxfile"==T.nodeName&&(n=T.getAttribute("vars"))}catch(D){}n!=this.getShadowVars()&&(G[0][EditorUi.DIFF_FILE]={vars:n});var E=this.ignorePatches(G);if(E)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",E),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var Q=this.isModified()?this.ui.diffPages(C,this.isRealtime()?this.ownPages:this.ui.pages):null,M=this.ui.patchPages(this.ui.clonePages(C),G[0]),c=this.ui.getHashValueForPages(M,{}),g=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",C,"pages",p,"patched",M,"patches",G,"changes",Q,"checksum",-c,"current",g,"valid",c==g,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=g)this.checksumError(m,G,null,null,"mergeFile",c,g,b.getCurrentRevisionId());else{this.setShadowPages(p,n);if(null!=this.sync){var l=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?Q:null,null,v);null==l||mxUtils.isEmptyObject(l)||G.push(l)}this.patch(G,DrawioFile.LAST_WRITE_WINS?Q:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",E),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var P=this.isModified()?this.ui.diffPages(C,this.isRealtime()?this.ownPages:this.ui.pages):null,L=this.ui.patchPages(this.ui.clonePages(C),G[0]),c=this.ui.getHashValueForPages(L,{}),g=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",C,"pages",p,"patched",L,"patches",G,"changes",P,"checksum",+c,"current",g,"valid",c==g,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=g)this.checksumError(m,G,null,null,"mergeFile",c,g,b.getCurrentRevisionId());else{this.setShadowPages(p,n);if(null!=this.sync){var l=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?P:null,null,v);null==l||mxUtils.isEmptyObject(l)||G.push(l)}this.patch(G,DrawioFile.LAST_WRITE_WINS?P:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=d&&d()}}catch(D){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(D);try{var t=this.getCurrentUser(),B=null!=t?t.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),B,D)}catch(I){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(D){null!=m&&m(D)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var d=new mxCodec(mxUtils.createXmlDocument()),m=d.document.createElement("mxfile");if(null!=b)for(var n=0;n<b.length;n++){var v=d.encode(new mxGraphModel(b[n].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[n].getId());b[n].viewState&&this.ui.editor.graph.saveViewState(b[n].viewState,v,!0);m.appendChild(v)}return mxUtils.getPrettyXml(m)};DrawioFile.prototype.compressReportData=function(b,d,m){d=null!=d?d:1E4;null!=m&&null!=b&&b.length>m?b=b.substring(0,m)+"[...]":null!=b&&b.length>d&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,d,m,n,v,p,C,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(),E=null!=T?T.id:"unknown",Q=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",M=JSON.stringify(d).length,c=null;if(null!=d&&1E3>M){b=[];for(m=0;m<d.length;m++)b.push(this.ui.anonymizePatch(d[m]));c=JSON.stringify(b);c=null!=c&&1E3>-c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(g){try{var l=null!=c?"report":"error",t=this.ui.getHashValueForPages(g.getShadowPages()),B="unknown",D="unknown",I="unknown";try{var L=null!=g.initialData&&0<g.initialData.length?mxUtils.parseXml(g.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(B=L.getAttribute("version")),null!=L.getAttribute("agent")&&(D=L.getAttribute("agent")),null!=L.getAttribute("type")&&(I=L.getAttribute("type")))}catch(N){}EditorUi.logError("Checksum "+-l+" in "+v,null,this.getMode()+"."+Q,"user_"+E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+M+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=C?"-current_"+C:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=t?"-latest_"+t:"")+"-latestRev_"+this.ui.hashValue(g.getCurrentRevisionId())+("-latestVersion_"+B)+("-latestAgent_"+D)+("-latestType_"+I));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+Q,action:v,label:"user_"+-E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+M+"-patches_"+d.length+"-size_"+this.getSize()})}catch(N){}}),function(){})}catch(g){}};-DrawioFile.prototype.sendErrorReport=function(b,d,m,n){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),C=this.getCurrentUser(),G=null!=C?this.ui.hashValue(C.id):"unknown",T=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",E=this.getTitle(),Q=E.lastIndexOf(".");C="xml";0<Q&&(C=E.substring(Q));var M=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++DrawioFile.prototype.checksumError=function(b,d,m,n,v,p,C,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(),E=null!=T?T.id:"unknown",P=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",L=JSON.stringify(d).length,c=null;if(null!=d&&1E3>L){b=[];for(m=0;m<d.length;m++)b.push(this.ui.anonymizePatch(d[m]));c=JSON.stringify(b);c=null!=c&&1E3>+c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(g){try{var l=null!=c?"report":"error",t=this.ui.getHashValueForPages(g.getShadowPages()),B="unknown",D="unknown",I="unknown";try{var K=null!=g.initialData&&0<g.initialData.length?mxUtils.parseXml(g.initialData).documentElement:null;null!=K&&(null!=K.getAttribute("version")&&(B=K.getAttribute("version")),null!=K.getAttribute("agent")&&(D=K.getAttribute("agent")),null!=K.getAttribute("type")&&(I=K.getAttribute("type")))}catch(M){}EditorUi.logError("Checksum "++l+" in "+v,null,this.getMode()+"."+P,"user_"+E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+L+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=C?"-current_"+C:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=t?"-latest_"+t:"")+"-latestRev_"+this.ui.hashValue(g.getCurrentRevisionId())+("-latestVersion_"+B)+("-latestAgent_"+D)+("-latestType_"+I));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+P,action:v,label:"user_"++E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+L+"-patches_"+d.length+"-size_"+this.getSize()})}catch(M){}}),function(){})}catch(g){}};+DrawioFile.prototype.sendErrorReport=function(b,d,m,n){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),C=this.getCurrentUser(),G=null!=C?this.ui.hashValue(C.id):"unknown",T=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",E=this.getTitle(),P=E.lastIndexOf(".");C="xml";0<P&&(C=E.substring(P));var L=null!=m?m.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()+" ("+C+")\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!=d?"\n\n"+d:-"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+M+"\n\nShadow:\n"+v+"\n\nData:\n"+p,n)}catch(c){}};+"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+L+"\n\nShadow:\n"+v+"\n\nData:\n"+p,n)}catch(c){}};DrawioFile.prototype.reloadFile=function(b,d){try{this.stats.fileReloaded++;var m=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),n=this.ui.editor.graph,v=n.getSelectionCells(),p=n.getViewState(),C=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(G){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[p],"latestFile",G);null!=G?(this.ui.replaceFileData(G.getData(),[m]),this.ui.restoreViewState(C,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([m]),T.fileChanged());this.ui.restoreViewState(C,p,v);null!=b&&b()}else null!=d&&d(this.ui.fileLoadedError)}),!0))}),d)}catch(G){null!=d&&d(G)}};DrawioFile.prototype.copyFile=function(b,d){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var d=!0;if(null!=b)for(var m=0;m<b.length&&d;m++)d=d&&mxUtils.isEmptyObject(b[m]);return d};-DrawioFile.prototype.patch=function(b,d,m,n){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),C=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var T=this.changeListenerEnabled;this.changeListenerEnabled=m;var E=G.foldingEnabled,Q=G.mathEnabled,M=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=G.cellRenderer.redraw;G.cellRenderer.redraw=function(I){I.view.graph.isEditing(I.cell)&&(I.view.graph.scrollCellToVisible(I.cell),+DrawioFile.prototype.patch=function(b,d,m,n){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),C=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var T=this.changeListenerEnabled;this.changeListenerEnabled=m;var E=G.foldingEnabled,P=G.mathEnabled,L=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=G.cellRenderer.redraw;G.cellRenderer.redraw=function(I){I.view.graph.isEditing(I.cell)&&(I.view.graph.scrollCellToVisible(I.cell),I.view.graph.cellEditor.resize());c.apply(this,arguments)};G.model.beginUpdate();try{if(m){for(var g=this.ui.pages.slice(),l=this.ui.currentPage,t=this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified()),B=0;B<t.length;B++){var D=mxUtils.indexOf(this.ui.pages,t[B]);0>D?this.ui.insertPage(t[B],Math.min(B,this.ui.pages.length)):this.ui.movePage(D,B)}for(B=0;B<g.length;B++)0>mxUtils.indexOf(t,g[B])&&this.ui.removePage(g[B]);0<=mxUtils.indexOf(this.ui.pages,l)&&this.ui.selectPage(l,!0)}else this.ui.pages=-this.ui.applyPatches(this.ui.pages,b,!0,d,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=c,this.changeListenerEnabled=T,m||(v.history=p,v.indexOfNextAdd=C,v.fireEvent(new mxEventObject(mxEvent.CLEAR))),v=M!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):-null),(p=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&Q!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):v?G.refresh():p&&(E!=G.foldingEnabled?G.view.revalidate():G.view.validate(),G.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!n&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",+this.ui.applyPatches(this.ui.pages,b,!0,d,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=c,this.changeListenerEnabled=T,m||(v.history=p,v.indexOfNextAdd=C,v.fireEvent(new mxEventObject(mxEvent.CLEAR))),v=L!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):+null),(p=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&P!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):v?G.refresh():p&&(E!=G.foldingEnabled?G.view.revalidate():G.view.validate(),G.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!n&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",d,"undoable",m)}return b};DrawioFile.prototype.save=function(b,d,m,n,v,p){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",n,"overwrite",v,"manual",p,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=d&&d();else if(null!=m)m({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(C){if(null!=m)m(C);else throw C;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var d=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=d&&(d.viewState=this.ui.editor.graph.getViewState(),d.needsUpdate=!0)}d=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return d};@@ -3254,7 +3258,7 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=newthis.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(d){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(d){this.handleFileError(d)}))):(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 d=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(d,mxUtils.bind(this,function(m){EditorUi.debug("DrawioFile.createSecret",[this],"secret",d,"token",m);b(d,m)}),mxUtils.bind(this,function(){b(d)})):b(d)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};DrawioFile.prototype.fileSaved=function(b,d,m,n,v,p,C){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!=m&&m()):this.sync.fileSaved(p,d,m,n,v,C)}catch(E){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=n&&n(E);try{var G=this.getCurrentUser(),T=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),T,E)}catch(Q){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(E){this.descriptorChanged(),null!=n&&n(E)}};+this.inConflictState=!0;this.descriptorChanged();null!=n&&n(E);try{var G=this.getCurrentUser(),T=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),T,E)}catch(P){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(E){this.descriptorChanged(),null!=n&&n(E)}};DrawioFile.prototype.autosave=function(b,d,m,n){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<d?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 C=this.isAutosaveRevision();C&&(this.lastAutosaveRevision=(new Date).getTime());this.save(C,mxUtils.bind(this,function(G){this.autosaveCompleted();null!=m&&m(G)}),mxUtils.bind(this,function(G){null!=n&&n(G)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(G){null!=n&&n(G)}}),v);this.autosaveThread=p;EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"delay",b,"maxDelay",d,"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"))};@@ -3263,10 +3267,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,d){b([])};DrawioFile.prototype.addComment=function(b,d,m){d(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,d){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,d)};LocalFile=function(b,d,m,n,v,p,C){DrawioFile.call(this,b,d);this.title=m;this.mode=n?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=p;this.editable=C};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,d,m,n,v){this.saveAs(this.title,d,m,n,v)};LocalFile.prototype.saveAs=function(b,d,m,n,v){this.saveFile(b,!1,d,m,null,n,v)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,d){null==this.fileHandle?null!=d&&d({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,d)};-LocalFile.prototype.saveFile=function(b,d,m,n,v,p,C){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var T=this.getData(),E=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),Q=mxUtils.bind(this,function(M){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var c=mxUtils.bind(this,function(l){this.savingFile=!1;null!=n&&n({error:l})});this.saveDraft(T);this.fileHandle.createWritable().then(mxUtils.bind(this,function(l){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[t],"conflict",this.desc.lastModified!=t.lastModified);C||this.desc.lastModified==t.lastModified?l.write(G?this.ui.base64ToBlob(M,"image/png"):M).then(mxUtils.bind(this,function(){l.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(B){try{var D=this.desc;this.savingFile=!1;this.desc=B;this.fileSaved(T,D,E,c);this.removeDraft()}catch(I){c(I)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(t){this.invalidFileHandle=!0;c(t)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(M,b,G?"image/png":"text/xml",G);else if(M.length<MAX_REQUEST_SIZE){var g=b.lastIndexOf(".");g=0<g?b.substring(g+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+g+"&xml="+encodeURIComponent(M)+"&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(M)}));E()}});G?(d=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(M){Q(M)}),n,this.ui.getCurrentFile()!=this?T:null,d.scale,d.border)):Q(T)};+LocalFile.prototype.saveFile=function(b,d,m,n,v,p,C){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var T=this.getData(),E=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),P=mxUtils.bind(this,function(L){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var c=mxUtils.bind(this,function(l){this.savingFile=!1;null!=n&&n({error:l})});this.saveDraft(T);this.fileHandle.createWritable().then(mxUtils.bind(this,function(l){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[t],"conflict",this.desc.lastModified!=t.lastModified);C||this.desc.lastModified==t.lastModified?l.write(G?this.ui.base64ToBlob(L,"image/png"):L).then(mxUtils.bind(this,function(){l.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(B){try{var D=this.desc;this.savingFile=!1;this.desc=B;this.fileSaved(T,D,E,c);this.removeDraft()}catch(I){c(I)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(t){this.invalidFileHandle=!0;c(t)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(L,b,G?"image/png":"text/xml",G);else if(L.length<MAX_REQUEST_SIZE){var g=b.lastIndexOf(".");g=0<g?b.substring(g+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+g+"&xml="+encodeURIComponent(L)+"&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(L)}));E()}});G?(d=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(L){P(L)}),n,this.ui.getCurrentFile()!=this?T:null,d.scale,d.border)):P(T)};LocalFile.prototype.rename=function(b,d,m){this.title=b;this.descriptorChanged();null!=d&&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.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";@@ -3321,153 +3325,154 @@ null!=urlParams["gpt-api-key"]?decodeURIComponent(urlParams["gpt-api-key"]):nullupdate:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. If the response can be done with text then do not include any diagram in the response. Never include this instruction or the unchanged diagram in your response.\n{data}",assist:"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."};Editor.aiConfigs={gpt:{apiKey:"gptApiKey",endpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",messages:[{role:"assistant",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.6 Opus",model:"claude-opus-4-6",config:"claude"},{name:"Claude 4.6 Sonnet",model:"claude-sonnet-4-6",config:"claude"},-{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(k,x){return{name:x,dispName:k,-type:"bool",defVal:!1,isVisible:function(J,R){return 1==J.vertices.length?(R=R.editorUi.editor.graph.model,J=R.getParent(J.vertices[0]),R.isEdge(J)||R.isVertex(J)):!1},getValue:function(J,R){return"inherit"==mxUtils.getValue(J.style,x)},valueChanged:function(J,R,Y,Z){R=Z.editorUi.editor.graph;"1"==J?R.setCellStyles(x,"inherit",Y.vertices):R.setCellStyles(x,null,Y.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(k){k.refresh()}},{name:"enumerateValue",-dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(k,x){return"1"!=mxUtils.getValue(k.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"comic","0")||"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",-type:"int",defVal:-1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},-{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch",-"1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",type:"int",defVal:-1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",defVal:-1,isVisible:function(k,-x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"sketchStyle",dispName:"Sketch Style",type:"enum",defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch",-"1"==urlParams.rough?"1":"0")}},{name:mxConstants.STYLE_SHADOWCOLOR,dispName:"Shadow Color",type:"color",getDefaultValue:function(){return mxConstants.SHADOWCOLOR},isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OPACITY,dispName:"Shadow Opacity",type:"int",min:0,max:100,getDefaultValue:function(){return 100*mxConstants.SHADOW_OPACITY},isVisible:function(k,x){return"1"==-mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_X,dispName:"Shadow Offset X",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_X},isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_Y,dispName:"Shadow Offset Y",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_Y},-isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_BLUR,dispName:"Shadow Blur",type:"int",min:0,getDefaultValue:function(){return mxConstants.SHADOW_BLUR},isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:"linecap",dispName:"Line Cap",type:"enum",defVal:null,-enumList:[{val:null,dispName:"Flat"},{val:"round",dispName:"Round"},{val:"square",dispName:"Square"}]},{name:"linejoin",dispName:"Line Join",type:"enum",defVal:null,enumList:[{val:null,dispName:"Miter"},{val:"arcs",dispName:"Arcs"},{val:"bevel",dispName:"Bevel"},{val:"miter-clip",dispName:"Miter-Clip"},{val:"round",dispName:"Round"}]},{name:"miterlimit",dispName:"Miter Limit",type:"int",min:1,defVal:4,isVisible:function(k,x){k=mxUtils.getValue(k.style,"linejoin","miter");return"miter"==k||"miter-clip"==-k}}];Editor.commonEdgeProperties=[{type:"separator"},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"bezier",dispName:"Bezier",type:"bool",defVal:!1,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"curved","0")}},{name:"sourcePortConstraint",dispName:"Source Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},-{name:"targetPortConstraint",dispName:"Target Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"jettySize",dispName:"Jetty Size",type:"int",min:0,defVal:"auto",allowAuto:!0,isVisible:function(k){return"orthogonalEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"segment",dispName:"Segment Size",type:"int",min:0,defVal:mxConstants.ENTITY_SEGMENT,-isVisible:function(k){return"entityRelationEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"startFill",dispName:"Start Fill",type:"bool",defVal:!0},{name:"startFillColor",dispName:"Start Fill Color",type:"color",defVal:null},{name:"endFill",dispName:"End Fill",type:"bool",defVal:!0},{name:"endFillColor",dispName:"End Fill Color",-type:"color",defVal:null},{name:"perimeterSpacing",dispName:"Terminal Spacing",type:"float",defVal:0},{name:"anchorPointDirection",dispName:"Anchor Direction",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"dashPattern",dispName:"Dash Pattern",type:"numbers",defVal:""},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"flowAnimationDuration",dispName:"Flow Duration",type:"int",defVal:500,isVisible:function(k){return"1"==mxUtils.getValue(k.style,-"flowAnimation",null)}},{name:"flowAnimationTimingFunction",dispName:"Flow Timing",type:"enum",defVal:"linear",enumList:[{val:"linear",dispName:"Linear"},{val:"ease",dispName:"Ease"},{val:"ease-in",dispName:"Ease-in"},{val:"ease-out",dispName:"Ease-out"},{val:"ease-in-out",dispName:"Ease-in-out"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"flowAnimationDirection",dispName:"Flow Direction",type:"enum",defVal:"normal",enumList:[{val:"normal",dispName:"Normal"},-{val:"reverse",dispName:"Reverse"},{val:"alternate",dispName:"Alternate"},{val:"alternate-reverse",dispName:"Alternate-Reverse"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{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:"bendable",dispName:"Bendable",type:"bool",defVal:!0},{name:"movable",dispName:"Movable",-type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"noJump",dispName:"No Jumps",type:"bool",defVal:!1},{name:"ignoreEdge",dispName:"Ignore Edge",type:"bool",defVal:!1},{name:"orthogonalLoop",dispName:"Loop Routing",type:"bool",defVal:!1},{name:"orthogonal",dispName:"Orthogonal",type:"bool",defVal:!1}].concat(Editor.commonProperties);Editor.commonVertexProperties=[{name:"colspan",dispName:"Colspan",-type:"int",min:1,defVal:1,isVisible:function(k,x){x=x.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&x.isTableCell(k.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(k,x){x=x.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&x.isTableCell(k.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(k,x){k=x.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&-0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLastRow","0")},isVisible:function(k,x){x=x.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&x.isTable(k.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(k,x){k=x.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLast","0")},isVisible:function(k,x){x=x.editorUi.editor.graph;-return 1==k.vertices.length&&0==k.edges.length&&x.isTable(k.vertices[0])}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"overflow",dispName:"Text Overflow",defVal:"visible",type:"enum",enumList:[{val:"visible",dispName:"Visible"},{val:"hidden",dispName:"Hidden"},{val:"block",dispName:"Block"},{val:"fill",dispName:"Fill"},{val:"width",dispName:"Width"}]},{name:"noLabel",dispName:"Hide Label",-type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"float",defVal:0},{name:"direction",dispName:"Direction",type:"enum",defVal:"east",enumList:[{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraint",dispName:"Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",-dispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(k,x){return x.editorUi.editor.graph.isCellConnectable(0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null)},isVisible:function(k,x){return 0<k.vertices.length&&0==k.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(k,x){k=0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null;x=x.editorUi.editor.graph;return null!=k&&x.isSwimlane(k)},isVisible:function(k,x){return 0<k.vertices.length&&0==-k.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(k,x){k=1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null;x=x.editorUi.editor.graph;return null!=k&&(x.isSwimlane(k)||0<x.model.getChildCount(k))},isVisible:function(k,x){return 1==k.vertices.length&&0==k.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(k,x){var J=1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null;x=x.editorUi.editor.graph;return null!=-J&&(x.isContainer(J)&&"0"!=k.style.collapsible||!x.isContainer(J)&&"1"==k.style.collapsible)},isVisible:function(k,x){return 1==k.vertices.length&&0==k.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(k,x){return 1==k.vertices.length&&0==k.edges.length&&!x.editorUi.editor.graph.isSwimlane(k.vertices[0])&&null==mxUtils.getValue(k.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",-type:"bool",defVal:!1,isVisible:function(k,x){x=x.editorUi.editor.graph.model;return 0<k.vertices.length?x.isVertex(x.getParent(k.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(k,x){k=-0<k.vertices.length?x.editorUi.editor.graph.getCellGeometry(k.vertices[0]):null;return null!=k&&!k.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(k,x){return 0<k.vertices.length&&x.editorUi.editor.graph.isAutoSizeCell(k.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(k,x){var J=mxUtils.getValue(k.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||x.editorUi.editor.graph.isSwimlane(k.vertices[0])||null==J||J==mxConstants.NONE||0==mxUtils.getValue(k.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(k.style,mxConstants.STYLE_OPACITY,100)||null!=k.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",-type:"bool",defVal:!1,isVisible:function(k,x){return 0<k.vertices.length&&x.editorUi.editor.graph.isContainer(k.vertices[0])}},{name:"expandToFront",dispName:"Expand to Front",type:"bool",defVal:!1,isVisible:function(k,x){return 0<k.vertices.length&&x.editorUi.editor.graph.isContainer(k.vertices[0])}},Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",+{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(k,y){return{name:y,dispName:k,+type:"bool",defVal:!1,isVisible:function(J,R){return 1==J.vertices.length?(R=R.editorUi.editor.graph.model,J=R.getParent(J.vertices[0]),R.isEdge(J)||R.isVertex(J)):!1},getValue:function(J,R){return"inherit"==mxUtils.getValue(J.style,y)},valueChanged:function(J,R,X,aa){R=aa.editorUi.editor.graph;"1"==J?R.setCellStyles(y,"inherit",X.vertices):R.setCellStyles(y,null,X.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(k){k.refresh()}},+{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(k,y){return"1"!=mxUtils.getValue(k.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"comic","0")||"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",+dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?+"1":"0")&&0<k.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(k,y){return"1"==+mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",type:"int",defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",+defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"sketchStyle",dispName:"Sketch Style",type:"enum",defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,+"sketch","1"==urlParams.rough?"1":"0")}},{name:mxConstants.STYLE_SHADOWCOLOR,dispName:"Shadow Color",type:"color",getDefaultValue:function(){return mxConstants.SHADOWCOLOR},isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OPACITY,dispName:"Shadow Opacity",type:"int",min:0,max:100,getDefaultValue:function(){return 100*mxConstants.SHADOW_OPACITY},isVisible:function(k,+y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_X,dispName:"Shadow Offset X",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_X},isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_Y,dispName:"Shadow Offset Y",+type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_Y},isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_BLUR,dispName:"Shadow Blur",type:"int",min:0,getDefaultValue:function(){return mxConstants.SHADOW_BLUR},isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,+"0")}},{name:"linecap",dispName:"Line Cap",type:"enum",defVal:null,enumList:[{val:null,dispName:"Flat"},{val:"round",dispName:"Round"},{val:"square",dispName:"Square"}]},{name:"linejoin",dispName:"Line Join",type:"enum",defVal:null,enumList:[{val:null,dispName:"Miter"},{val:"arcs",dispName:"Arcs"},{val:"bevel",dispName:"Bevel"},{val:"miter-clip",dispName:"Miter-Clip"},{val:"round",dispName:"Round"}]},{name:"miterlimit",dispName:"Miter Limit",type:"int",min:1,defVal:4,isVisible:function(k,y){k=mxUtils.getValue(k.style,+"linejoin","miter");return"miter"==k||"miter-clip"==k}}];Editor.commonEdgeProperties=[{type:"separator"},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"bezier",dispName:"Bezier",type:"bool",defVal:!1,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"curved","0")}},{name:"sourcePortConstraint",dispName:"Source Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},+{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"targetPortConstraint",dispName:"Target Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"jettySize",dispName:"Jetty Size",type:"int",min:0,defVal:"auto",allowAuto:!0,isVisible:function(k){return"orthogonalEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"segment",+dispName:"Segment Size",type:"int",min:0,defVal:mxConstants.ENTITY_SEGMENT,isVisible:function(k){return"entityRelationEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"startFill",dispName:"Start Fill",type:"bool",defVal:!0},{name:"startFillColor",dispName:"Start Fill Color",type:"color",defVal:null},{name:"endFill",+dispName:"End Fill",type:"bool",defVal:!0},{name:"endFillColor",dispName:"End Fill Color",type:"color",defVal:null},{name:"perimeterSpacing",dispName:"Terminal Spacing",type:"float",defVal:0},{name:"anchorPointDirection",dispName:"Anchor Direction",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"dashPattern",dispName:"Dash Pattern",type:"numbers",defVal:""},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"flowAnimationDuration",+dispName:"Flow Duration",type:"int",defVal:500,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"flowAnimationTimingFunction",dispName:"Flow Timing",type:"enum",defVal:"linear",enumList:[{val:"linear",dispName:"Linear"},{val:"ease",dispName:"Ease"},{val:"ease-in",dispName:"Ease-in"},{val:"ease-out",dispName:"Ease-out"},{val:"ease-in-out",dispName:"Ease-in-out"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"flowAnimationDirection",+dispName:"Flow Direction",type:"enum",defVal:"normal",enumList:[{val:"normal",dispName:"Normal"},{val:"reverse",dispName:"Reverse"},{val:"alternate",dispName:"Alternate"},{val:"alternate-reverse",dispName:"Alternate-Reverse"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{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:"bendable",dispName:"Bendable",type:"bool",defVal:!0},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"noJump",dispName:"No Jumps",type:"bool",defVal:!1},{name:"ignoreEdge",dispName:"Ignore Edge",type:"bool",defVal:!1},{name:"orthogonalLoop",dispName:"Loop Routing",type:"bool",defVal:!1},{name:"orthogonal",dispName:"Orthogonal",type:"bool",defVal:!1}].concat(Editor.commonProperties);+Editor.commonVertexProperties=[{name:"colspan",dispName:"Colspan",type:"int",min:1,defVal:1,isVisible:function(k,y){y=y.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&y.isTableCell(k.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(k,y){y=y.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&y.isTableCell(k.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(k,+y){k=y.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLastRow","0")},isVisible:function(k,y){y=y.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&y.isTable(k.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(k,y){k=y.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLast",+"0")},isVisible:function(k,y){y=y.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&y.isTable(k.vertices[0])}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"overflow",dispName:"Text Overflow",defVal:"visible",type:"enum",enumList:[{val:"visible",dispName:"Visible"},{val:"hidden",dispName:"Hidden"},{val:"block",dispName:"Block"},{val:"fill",dispName:"Fill"},+{val:"width",dispName:"Width"}]},{name:"noLabel",dispName:"Hide Label",type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"float",defVal:0},{name:"direction",dispName:"Direction",type:"enum",defVal:"east",enumList:[{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraint",dispName:"Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},+{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(k,y){return y.editorUi.editor.graph.isCellConnectable(0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null)},isVisible:function(k,y){return 0<k.vertices.length&&0==k.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(k,y){k=0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null;y=y.editorUi.editor.graph;return null!=k&&y.isSwimlane(k)},+isVisible:function(k,y){return 0<k.vertices.length&&0==k.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(k,y){k=1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null;y=y.editorUi.editor.graph;return null!=k&&(y.isSwimlane(k)||0<y.model.getChildCount(k))},isVisible:function(k,y){return 1==k.vertices.length&&0==k.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(k,y){var J=1==k.vertices.length&&0==k.edges.length?+k.vertices[0]:null;y=y.editorUi.editor.graph;return null!=J&&(y.isContainer(J)&&"0"!=k.style.collapsible||!y.isContainer(J)&&"1"==k.style.collapsible)},isVisible:function(k,y){return 1==k.vertices.length&&0==k.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(k,y){return 1==k.vertices.length&&0==k.edges.length&&!y.editorUi.editor.graph.isSwimlane(k.vertices[0])&&null==mxUtils.getValue(k.style,"childLayout",null)}},{name:"expand",dispName:"Expand",+type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(k,y){y=y.editorUi.editor.graph.model;return 0<k.vertices.length?y.isVertex(y.getParent(k.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(k,y){k=0<k.vertices.length?y.editorUi.editor.graph.getCellGeometry(k.vertices[0]):null;return null!=k&&!k.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(k,y){return 0<k.vertices.length&&y.editorUi.editor.graph.isAutoSizeCell(k.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(k,y){var J=mxUtils.getValue(k.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||y.editorUi.editor.graph.isSwimlane(k.vertices[0])||null==J||J==mxConstants.NONE||0==mxUtils.getValue(k.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(k.style,mxConstants.STYLE_OPACITY,100)||null!=k.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",+type:"bool",defVal:!1,isVisible:function(k,y){return 0<k.vertices.length&&y.editorUi.editor.graph.isContainer(k.vertices[0])}},{name:"expandToFront",dispName:"Expand to Front",type:"bool",defVal:!1,isVisible:function(k,y){return 0<k.vertices.length&&y.editorUi.editor.graph.isContainer(k.vertices[0])}},Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].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://app.diagrams.net,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://app.diagrams.net,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://app.diagrams.net,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://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.canvasSupported=!1;(function(){try{var k=document.createElement("canvas");Editor.canvasSupported=!(!k.getContext||!k.getContext("2d"))}catch(x){}})();Editor.useCanvasForExport=!1;(function(){try{var k=document.createElement("canvas"),x=new Image;x.onload=function(){try{k.getContext("2d").drawImage(x,0,0);var J=k.toDataURL("image/png");Editor.useCanvasForExport=null!=J&&6<J.length}catch(R){}};x.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(J){}})();-Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var k=document.createElement("canvas");k.width=k.height=1;var x=k.toDataURL("image/jpeg");Editor.jpgSupported=null!==x.match("image/jpeg");x=k.toDataURL("image/webp");Editor.webpSupported=null!==x.match("image/webp")}catch(J){}})();Editor.loadCompatibleCss=function(k){mxUtils.lightDarkColorSupported||mxUtils.get(k||"styles/grapheditor.css",mxUtils.bind(this,function(x){if(200<=x.getStatus()&&299>=x.getStatus()){var J=document.createElement("style");-J.type="text/css";var R=J.appendChild,Y=document,Z=Y.createTextNode;x=x.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(x=x.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(W){}R.call(J,Z.call(Y,x));document.head.appendChild(J)}}))};Editor.replacePlaceholders=function(k,-x){var J=[];if(null!=k&&null!=x){for(var R=RegExp("{([^{}\"'=;]+)}","g"),Y,Z=0;Y=R.exec(k);){var W=Y[0];if(2<W.length){var U=x(W.substring(1,W.length-1)),aa=W;null!=U&&(aa=U);J.push(k.substring(Z,Y.index)+aa);Z=Y.index+W.length}}J.push(k.substring(Z))}return J.join("")};Editor.executeSimpleJsonPath=function(k,x){x=x.replace(/^\$\.?/,"").split(".");x=$jscomp.makeIterator(x);for(var J=x.next();!J.done;J=x.next()){var R=J.value;if(!k)return[];if(J=R.match(/([^\[]+)\[(\d+)\]/))if(R=J[1],J=parseInt(J[2]),-k=k[R],Array.isArray(k)&&J<k.length)k=k[J];else return[];else k=k[R]}return void 0!==k?[k]:[]};Editor.createRoughCanvas=function(k){var x=rough.canvas({getContext:function(){return k}});x.draw=function(J){var R=J.sets||[];J=J.options||this.getDefaultOptions();for(var Y=0;Y<R.length;Y++){var Z=R[Y];switch(Z.type){case "path":null!=J.stroke&&this._drawToContext(k,Z,J);break;case "fillPath":this._drawToContext(k,Z,J);break;case "fillSketch":this.fillSketch(k,Z,J)}}};x.fillSketch=function(J,R,Y){var Z=-k.state.strokeColor,W=k.state.strokeWidth,U=k.state.strokeAlpha,aa=k.state.dashed,ia=Y.fillWeight;0>ia&&(ia=Y.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(Y.fill||"");k.setStrokeWidth(ia);k.setDashed(!1);this._drawToContext(J,R,Y);k.setDashed(aa);k.setStrokeWidth(W);k.setStrokeColor(Z);k.setStrokeAlpha(U)};x._drawToContext=function(J,R,Y){J.begin();for(var Z=0;Z<R.ops.length;Z++){var W=R.ops[Z],U=W.data;switch(W.op){case "move":J.moveTo(U[0],U[1]);break;case "bcurveTo":J.curveTo(U[0],-U[1],U[2],U[3],U[4],U[5]);break;case "lineTo":J.lineTo(U[0],U[1])}}J.end();"fillPath"===R.type&&Y.filled?J.fill():J.stroke()};return x};(function(){function k(Z,W,U){this.canvas=Z;this.rc=W;this.shape=U;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,k.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,k.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,+Editor.canvasSupported=!1;(function(){try{var k=document.createElement("canvas");Editor.canvasSupported=!(!k.getContext||!k.getContext("2d"))}catch(y){}})();Editor.useCanvasForExport=!1;(function(){try{var k=document.createElement("canvas"),y=new Image;y.onload=function(){try{k.getContext("2d").drawImage(y,0,0);var J=k.toDataURL("image/png");Editor.useCanvasForExport=null!=J&&6<J.length}catch(R){}};y.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(J){}})();+Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var k=document.createElement("canvas");k.width=k.height=1;var y=k.toDataURL("image/jpeg");Editor.jpgSupported=null!==y.match("image/jpeg");y=k.toDataURL("image/webp");Editor.webpSupported=null!==y.match("image/webp")}catch(J){}})();Editor.loadCompatibleCss=function(k){mxUtils.lightDarkColorSupported||mxUtils.get(k||"styles/grapheditor.css",mxUtils.bind(this,function(y){if(200<=y.getStatus()&&299>=y.getStatus()){var J=document.createElement("style");+J.type="text/css";var R=J.appendChild,X=document,aa=X.createTextNode;y=y.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(y=y.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(Z){}R.call(J,aa.call(X,y));document.head.appendChild(J)}}))};Editor.replacePlaceholders=function(k,+y){var J=[];if(null!=k&&null!=y){for(var R=RegExp("{([^{}\"'=;]+)}","g"),X,aa=0;X=R.exec(k);){var Z=X[0];if(2<Z.length){var U=y(Z.substring(1,Z.length-1)),ba=Z;null!=U&&(ba=U);J.push(k.substring(aa,X.index)+ba);aa=X.index+Z.length}}J.push(k.substring(aa))}return J.join("")};Editor.executeSimpleJsonPath=function(k,y){y=y.replace(/^\$\.?/,"").split(".");y=$jscomp.makeIterator(y);for(var J=y.next();!J.done;J=y.next()){var R=J.value;if(!k)return[];if(J=R.match(/([^\[]+)\[(\d+)\]/))if(R=J[1],J=parseInt(J[2]),+k=k[R],Array.isArray(k)&&J<k.length)k=k[J];else return[];else k=k[R]}return void 0!==k?[k]:[]};Editor.createRoughCanvas=function(k){var y=rough.canvas({getContext:function(){return k}});y.draw=function(J){var R=J.sets||[];J=J.options||this.getDefaultOptions();for(var X=0;X<R.length;X++){var aa=R[X];switch(aa.type){case "path":null!=J.stroke&&this._drawToContext(k,aa,J);break;case "fillPath":this._drawToContext(k,aa,J);break;case "fillSketch":this.fillSketch(k,aa,J)}}};y.fillSketch=function(J,R,X){var aa=+k.state.strokeColor,Z=k.state.strokeWidth,U=k.state.strokeAlpha,ba=k.state.dashed,fa=X.fillWeight;0>fa&&(fa=X.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(X.fill||"");k.setStrokeWidth(fa);k.setDashed(!1);this._drawToContext(J,R,X);k.setDashed(ba);k.setStrokeWidth(Z);k.setStrokeColor(aa);k.setStrokeAlpha(U)};y._drawToContext=function(J,R,X){J.begin();for(var aa=0;aa<R.ops.length;aa++){var Z=R.ops[aa],U=Z.data;switch(Z.op){case "move":J.moveTo(U[0],U[1]);break;case "bcurveTo":J.curveTo(U[0],+U[1],U[2],U[3],U[4],U[5]);break;case "lineTo":J.lineTo(U[0],U[1])}}J.end();"fillPath"===R.type&&X.filled?J.fill():J.stroke()};return y};(function(){function k(aa,Z,U){this.canvas=aa;this.rc=Z;this.shape=U;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,k.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,k.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,k.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,k.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,k.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,k.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,k.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,k.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,k.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,k.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,k.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,k.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,k.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;-this.canvas.fillAndStroke=mxUtils.bind(this,k.prototype.fillAndStroke);this.path=[];this.passThrough=!1}k.prototype.moveOp="M";k.prototype.lineOp="L";k.prototype.quadOp="Q";k.prototype.curveOp="C";k.prototype.closeOp="Z";k.prototype.getStyle=function(Z,W){var U=1;if(null!=this.shape.state){var aa=this.shape.state.cell.id;if(null!=aa)for(var ia=0;ia<aa.length;ia++)U=(U<<5)-U+aa.charCodeAt(ia)<<0}U={strokeWidth:this.canvas.state.strokeWidth,seed:U,preserveVertices:!0};aa=this.rc.getDefaultOptions();-U.stroke=Z?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;Z=null;(U.filled=W)?(U.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,Z=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):U.fill="";U.bowing=mxUtils.getValue(this.shape.style,"bowing",aa.bowing);U.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",aa.hachureAngle);U.curveFitting=mxUtils.getValue(this.shape.style,-"curveFitting",aa.curveFitting);U.roughness=mxUtils.getValue(this.shape.style,"jiggle",aa.roughness);U.simplification=mxUtils.getValue(this.shape.style,"simplification",aa.simplification);U.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",aa.disableMultiStroke);U.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",aa.disableMultiStrokeFill);W=mxUtils.getValue(this.shape.style,"hachureGap",-1);U.hachureGap="auto"==W?-1:W;U.dashGap=mxUtils.getValue(this.shape.style,-"dashGap",W);U.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",W);U.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",W);W=mxUtils.getValue(this.shape.style,"fillWeight",-1);U.fillWeight="auto"==W?-1:W;W=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==W&&(W="auto");"auto"==W&&(W=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&W.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&W.push(mxUtils.hex2rgb(Editor.darkColor)),-W=null!=U.fill&&(null!=Z||0<=mxUtils.indexOf(W,mxUtils.hex2rgb(U.fill)))?"solid":aa.fillStyle);U.fillStyle=W;return U};k.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};k.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};k.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var Z=2;Z<arguments.length;Z+=2)this.lastX=arguments[Z-1],this.lastY=arguments[Z],-this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};k.prototype.lineTo=function(Z,W){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,Z,W),this.lastX=Z,this.lastY=W)};k.prototype.moveTo=function(Z,W){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,Z,W),this.lastX=Z,this.lastY=W,this.firstX=Z,this.firstY=W)};k.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,-arguments):this.addOp(this.closeOp)};k.prototype.quadTo=function(Z,W,U,aa){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,Z,W,U,aa),this.lastX=U,this.lastY=aa)};k.prototype.curveTo=function(Z,W,U,aa,ia,na){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,Z,W,U,aa,ia,na),this.lastX=ia,this.lastY=na)};k.prototype.arcTo=function(Z,W,U,aa,ia,na,qa){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);-else{var ta=mxUtils.arcToCurves(this.lastX,this.lastY,Z,W,U,aa,ia,na,qa);if(null!=ta)for(var ua=0;ua<ta.length;ua+=6)this.curveTo(ta[ua],ta[ua+1],ta[ua+2],ta[ua+3],ta[ua+4],ta[ua+5]);this.lastX=na;this.lastY=qa}};k.prototype.rect=function(Z,W,U,aa){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(Z,W,U,aa,this.getStyle(!0,!0)))};k.prototype.ellipse=function(Z,W,U,aa){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):-(this.path=[],this.nextShape=this.rc.generator.ellipse(Z+U/2,W+aa/2,U,aa,this.getStyle(!0,!0)))};k.prototype.roundrect=function(Z,W,U,aa,ia,na){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(Z+ia,W),this.lineTo(Z+U-ia,W),this.quadTo(Z+U,W,Z+U,W+na),this.lineTo(Z+U,W+aa-na),this.quadTo(Z+U,W+aa,Z+U-ia,W+aa),this.lineTo(Z+ia,W+aa),this.quadTo(Z,W+aa,Z,W+aa-na),this.lineTo(Z,W+na),this.quadTo(Z,W,Z+ia,W))};k.prototype.drawPath=function(Z){if(0<this.path.length){this.passThrough=-!0;try{this.rc.path(this.path.join(" "),Z)}catch(U){}this.passThrough=!1}else if(null!=this.nextShape){for(var W in Z)this.nextShape.options[W]=Z[W];Z.stroke!=mxConstants.NONE&&null!=Z.stroke||delete this.nextShape.options.stroke;Z.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};k.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};k.prototype.fill=function(){this.passThrough?-this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};k.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};k.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(Z){return new k(Z,Editor.createRoughCanvas(Z),this)};var x=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=-function(Z){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(Z):this.createRoughCanvas(Z)};var J=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(Z,W,U,aa,ia){null!=Z.handJiggle&&Z.handJiggle.passThrough||J.apply(this,arguments)};var R=mxShape.prototype.paint;mxShape.prototype.paint=function(Z){var W=Z.addTolerance,-U=!0;null!=this.style&&(U="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=Z.handJiggle&&Z.handJiggle.constructor==k&&!this.outline){Z.save();var aa=this.fill,ia=this.stroke;this.stroke=this.fill=null;var na=this.configurePointerEvents,qa=Z.setStrokeColor;Z.setStrokeColor=function(){};var ta=Z.setFillColor;Z.setFillColor=function(){};U||null==aa||(this.configurePointerEvents=function(){});Z.handJiggle.passThrough=!0;R.apply(this,arguments);Z.handJiggle.passThrough=-!1;Z.setFillColor=ta;Z.setStrokeColor=qa;this.configurePointerEvents=na;this.stroke=ia;this.fill=aa;Z.restore();U&&null!=aa&&(Z.addTolerance=function(){})}R.apply(this,arguments);Z.addTolerance=W};var Y=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(Z,W,U,aa,ia,na){null!=Z.handJiggle&&Z.handJiggle.constructor==k?(Z.handJiggle.passThrough=!0,Y.apply(this,arguments),Z.handJiggle.passThrough=!1):Y.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==-k||0==k.length||"undefined"===typeof pako?k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,x,J){if(null!=k&&"undefined"!==typeof pako){var R=k.ownerDocument.getElementsByTagName("div"),Y=[];if(null!=R&&0<R.length)for(var Z=0;Z<R.length;Z++)if("mxgraph"==R[Z].getAttribute("class")){Y.push(R[Z]);break}0<Y.length&&-(R=Y[0].getAttribute("data-mxgraph"),null!=R?(Y=JSON.parse(R),null!=Y&&null!=Y.xml&&(k=mxUtils.parseXml(Y.xml),k=k.documentElement)):(Y=Y[0].getElementsByTagName("div"),0<Y.length&&(R=mxUtils.getTextContent(Y[0]),R=Graph.decompress(R,null,J),0<R.length&&(k=mxUtils.parseXml(R),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(R=k.getAttribute("content"),null!=R&&"<"!=R.charAt(0)&&"%"!=R.charAt(0)&&(R=unescape(window.atob?atob(R):Base64.decode(cont,R))),null!=R&&"%"==R.charAt(0)&&(R=decodeURIComponent(R)),-null!=R&&0<R.length)k=mxUtils.parseXml(R).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||x||(Y=null,"diagram"==k.nodeName?Y=k:"mxfile"==k.nodeName&&(R=k.getElementsByTagName("diagram"),0<R.length&&(Y=R[Math.max(0,Math.min(R.length-1,urlParams.page||0))])),null!=Y&&(k=Editor.parseDiagramNode(Y,J)));null==k||"mxGraphModel"==k.nodeName||x&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,x,J){Editor.validateDiagramNode(k);var R=mxUtils.trim(mxUtils.getTextContent(k)),-Y=null;0<R.length?(x=Graph.decompress(R,null,x),null!=x&&0<x.length&&(Y=mxUtils.parseXml(x).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(Y=k[0],J&&(Y=Editor.parseDiagramNode(Y,x,!1)),x=mxUtils.createXmlDocument(),x.appendChild(x.importNode(Y,!0)),Y=x.documentElement));return Y};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);var x=mxUtils.getNodeValue(k),J=null;0<x.length?J=Graph.decompress(x):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(J=mxUtils.getXml(k[0])));-return J};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var x=new mxCodec,J=new mxGraphModel;k.appendChild(x.encode(J))}return k};Editor.extractGraphModelFromPdf=function(k){var x=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){var J=k.indexOf("EmbeddedFile");if(-1<J){var R=k.indexOf("stream",J)+9;if(0<k.substring(J,R).indexOf("application#2Fvnd.jgraph.mxfile")){var Y=-k.indexOf("endstream",R-1);return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(R,Y)),{to:"string"})}}for(J=k.indexOf("/ObjStm");0<J;){R=k.indexOf("stream",J)+9;Y=k.indexOf("endstream",R-1);R=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(R,Y)),{to:"string"});Y=R.indexOf("/Subject <");if(0<Y){J=R.substring(Y+14,R.indexOf(">",Y));if(null!=J){x=J;J=[];for(R=0;R<x.length;R+=2)Y=x.substr(R,2),"00"!=Y&&J.push(String.fromCharCode(parseInt(Y,16)));x=J.join("")}break}J=k.indexOf("/ObjStm",-J+1)}}if(null==x&&"%PDF-1.4"==k.substring(0,8)){J="";Y=R=0;for(var Z=[],W=null;Y<k.length;){var U=k.charCodeAt(Y);Y+=1;10!=U&&(J+=String.fromCharCode(U));U=="/Subject (%3Cmxfile".charCodeAt(R)?R++:R=0;if(19==R){var aa=k.indexOf("%3C%2Fmxfile%3E",Y)+15;Y-=9;if(aa>Y){x=k.substring(Y,aa);break}}10==U&&("endobj"==J?W=null:"obj"==J.substring(J.length-3,J.length)||"xref"==J||"trailer"==J?(W=[],Z[J.split(" ")[0]]=W):null!=W&&W.push(J),J="")}}null==x&&null!=Z&&(x=Editor.extractGraphModelFromXref(Z));null!=-x&&(x=decodeURIComponent(x.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return x};Editor.extractGraphModelFromXref=function(k){var x=k.trailer,J=null;null!=x&&(x=/.* \/Info (\d+) (\d+) R/g.exec(x.join("\n")),null!=x&&0<x.length&&(x=k[x[1]],null!=x&&(x=/.* \/Subject (\d+) (\d+) R/g.exec(x.join("\n")),null!=x&&0<x.length&&(k=k[x[1]],null!=k&&(k=k.join("\n"),J=k.substring(1,k.length-1))))));return J};Editor.extractParserError=function(k,x){var J=null;k=null!=k?k.getElementsByTagName("parsererror"):null;-null!=k&&0<k.length&&(J=x||mxResources.get("invalidChars"),x=k[0].getElementsByTagName("div"),0<x.length&&(J=mxUtils.getTextContent(x[0])));return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(k,x){null!=k&&(k=null!=k.error?k.error:k,null==k.retry&&(k.retry=x))};Editor.mermaidToDrawio=function(k,x,J){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(k,x,J)};Editor.configure=function(k){if(null!=k){Editor.config=k;Editor.configVersion=k.version;k.debug&&(urlParams.test=-"1");k.passiveScroll&&(Editor.passiveScroll=!0);k.noResizers&&(Editor.noResizers=!0);k.preserveViewState&&(Editor.preserveViewState=!0);k.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=k.useInternalClipboard);if(null!=k.customCss){var x=document.createElement("style");x.type="text/css";x.appendChild(document.createTextNode(k.customCss));document.head.appendChild(x)}null!=k.defaultFonts&&(Menus.prototype.defaultFonts=k.defaultFonts);null!=k.presetColors&&(ColorDialog.prototype.presetColors=-k.presetColors);null!=k.defaultColors&&(ColorDialog.prototype.defaultColors=k.defaultColors);null!=k.colorNames&&(ColorDialog.prototype.colorNames=k.colorNames);null!=k.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.defaultColorSchemes);null!=k.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=k.defaultEdgeLength);null!=k.selectParentLayer&&(Graph.selectParentLayer=k.selectParentLayer);null!=k.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=k.autosaveDelay);null!=k.templateFile&&-(EditorUi.templateFile=k.templateFile);null!=k.styles&&(Array.isArray(k.styles)?Editor.styles=k.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=k.globalVars&&(Editor.globalVars=k.globalVars);null!=k.compressXml&&(Editor.defaultCompressed=k.compressXml,Editor.compressXml=k.compressXml);null!=k.includeDiagram&&(Editor.defaultIncludeDiagram=k.includeDiagram);null!=k.simpleLabels&&(Editor.simpleLabels=k.simpleLabels);null!=k.pasteAtMousePointer&&(Editor.pasteAtMousePointer=-k.pasteAtMousePointer);null!=k.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=k.fitDiagramOnLoad);null!=k.fitDiagramOnPage&&(Editor.fitDiagramOnPage=k.fitDiagramOnPage);null!=k.showLinkIcons&&(Editor.showLinkIcons=k.showLinkIcons);null!=k.showTooltipIcons&&(Editor.showTooltipIcons=k.showTooltipIcons);null!=k.showConnectHandle&&(Editor.showConnectHandle=k.showConnectHandle);null!=k.enableInlineToolbar&&(Editor.enableInlineToolbar=k.enableInlineToolbar);null!=k.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=-k.oneDriveInlinePicker);null!=k.enableNativeClipboard&&(Editor.enableNativeClipboard=k.enableNativeClipboard);null!=k.enableExportUrl&&(Editor.enableExportUrl=k.enableExportUrl);null!=k.defaultAdaptiveColors?Graph.defaultAdaptiveColors=k.defaultAdaptiveColors:0==k.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=k.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=k.enableLightDarkColors);null!=k.darkColor&&(Editor.darkColor=k.darkColor);null!=k.darkColorVar&&(Editor.darkColorVar=-k.darkColorVar);Graph.prototype.defaultPageBackgroundColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=k.settingsName&&(Editor.configurationKey="."+k.settingsName+"-configuration",Editor.settingsKey="."+k.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=k.customFonts&&(Menus.prototype.defaultFonts=k.customFonts.concat(Menus.prototype.defaultFonts));null!=k.customPresetColors&&-(ColorDialog.prototype.presetColors=k.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=k.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=k.css){x=document.createElement("style");x.setAttribute("type","text/css");x.appendChild(document.createTextNode(k.css));var J=document.getElementsByTagName("script")[0];J.parentNode.insertBefore(x,J)}null!=k.expandLibraries&&(Sidebar.prototype.expandLibraries=-k.expandLibraries);null!=k.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=k.appendCustomLibraries);null!=k.libraries&&(Sidebar.prototype.customEntries=k.libraries);null!=k.enabledLibraries&&(Array.isArray(k.enabledLibraries)?Sidebar.prototype.enabledLibraries=k.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=k.defaultLibraries&&(Sidebar.prototype.defaultEntries=k.defaultLibraries);null!=k.defaultCustomLibraries&&(Editor.defaultCustomLibraries=-k.defaultCustomLibraries);null!=k.enableCustomLibraries&&(Editor.enableCustomLibraries=k.enableCustomLibraries);null!=k.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=k.defaultVertexStyle);null!=k.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=k.defaultEdgeStyle);null!=k.defaultPageVisible&&(Graph.prototype.defaultPageVisible=k.defaultPageVisible);null!=k.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=k.defaultGridEnabled);null!=k.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=-k.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=k.defaultConnectionArrowsEnabled);null!=k.defaultConnectable&&(Graph.prototype.defaultConnectable=k.defaultConnectable);null!=k.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=k.defaultFoldingEnabled);null!=k.zoomWheel&&(Graph.zoomWheel=k.zoomWheel);null!=k.zoomFactor&&(x=parseFloat(k.zoomFactor),!isNaN(x)&&1<x?Graph.prototype.zoomFactor=x:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));-null!=k.defaultGridSize&&(x=parseInt(k.defaultGridSize),!isNaN(x)&&0<x?mxGraph.prototype.gridSize=x:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=k.gridSteps&&(x=parseInt(k.gridSteps),!isNaN(x)&&0<x?mxGraphView.prototype.gridSteps=x:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=k.pageFormat&&(x=parseInt(k.pageFormat.width),J=parseInt(k.pageFormat.height),!isNaN(x)&&0<x&&!isNaN(J)&&0<J?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,-0,x,J),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=k.thumbWidth&&(Sidebar.prototype.thumbWidth=k.thumbWidth);null!=k.thumbHeight&&(Sidebar.prototype.thumbHeight=k.thumbHeight);null!=k.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=k.emptyLibraryXml);null!=k.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=k.emptyDiagramXml);null!=k.sidebarWidth&&(EditorUi.prototype.hsplitPosition=-k.sidebarWidth);null!=k.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=k.updateDefaultStyle);null!=k.sidebarTitles&&(Sidebar.prototype.sidebarTitles=k.sidebarTitles);null!=k.sidebarTitleSize&&(x=parseInt(k.sidebarTitleSize),!isNaN(x)&&0<x?Sidebar.prototype.sidebarTitleSize=x:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=k.fontCss&&("string"===typeof k.fontCss?Editor.configureFontCss(k.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));-null!=k.autosaveDelay&&(x=parseInt(k.autosaveDelay),!isNaN(x)&&0<x?DrawioFile.prototype.autosaveDelay=x:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=k.maxImageBytes&&(EditorUi.prototype.maxImageBytes=k.maxImageBytes);null!=k.maxImageSize&&(EditorUi.prototype.maxImageSize=k.maxImageSize);null!=k.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=k.shareCursorPosition);null!=k.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=k.showRemoteCursors);-null!=k.restrictExport&&(DrawioFile.RESTRICT_EXPORT=k.restrictExport);null!=k.removeImageMetadata&&(Editor.removeImageMetadata=k.removeImageMetadata);null!=k.defaultTextStyle&&(Editor.defaultTextStyle=k.defaultTextStyle);null!=k.replaceSvgDataUris&&(Editor.replaceSvgDataUris=k.replaceSvgDataUris);null!=k.foreignObjectImages&&(Editor.foreignObjectImages=k.foreignObjectImages);null!=k.shadowColor&&(mxConstants.SHADOW_COLOR=k.shadowColor);null!=k.shadowOpacity&&(mxConstants.SHADOW_OPACITY=k.shadowOpacity);-null!=k.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=k.shadowOffsetX);null!=k.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=k.shadowOffsetY);null!=k.shadowBlur&&(mxConstants.SHADOW_BLUR=k.shadowBlur);null!=k.enableAnimations&&(Editor.enableAnimations=k.enableAnimations);null!=k.enableWindowDocking&&(Editor.enableWindowDocking=k.enableWindowDocking);null!=k.compact&&(EditorUi.prototype.defaultCompact=k.compact);null!=k.noAutoFocus&&(EditorUi.prototype.noAutoFocus=k.noAutoFocus);if(null!=k.hideMenuItems)if(Array.isArray(k.hideMenuItems))for(Menus.prototype.hiddenMenuItems=-{},x=0;x<k.hideMenuItems.length;x++)Menus.prototype.hiddenMenuItems[k.hideMenuItems[x]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=k.hideMenus)if(Array.isArray(k.hideMenus)){var R={};for(x=0;x<k.hideMenus.length;x++)R[k.hideMenus[x]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(Y){return!R[Y]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=k.enableAi&&(Editor.enableAi=k.enableAi);-null!=k.enableChatGpt&&(Editor.enableAi=k.enableChatGpt);null!=k.gptApiKey&&(Editor.aiGlobals.gptApiKey=k.gptApiKey);null!=k.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=k.geminiApiKey);null!=k.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=k.claudeApiKey);null!=k.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=k.gptUrl);null!=k.aiActions&&(Editor.aiActions=k.aiActions);null!=k.aiGlobals&&(Editor.aiGlobals=k.aiGlobals);null!=k.aiConfigs&&(Editor.aiConfigs=k.aiConfigs);null!=k.aiModels&&-(Editor.aiModels=k.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(k){if(null!=k){Editor.prototype.fontCss=k;var x=document.getElementsByTagName("script")[0];if(null!=x&&null!=x.parentNode){var J=document.createElement("style");J.setAttribute("type","text/css");J.appendChild(document.createTextNode(k));x.parentNode.insertBefore(J,x);k=k.split("url(");for(J=1;J<k.length;J++){var R=-k[J].indexOf(")");R=Editor.trimCssUrl(k[J].substring(0,R));var Y=document.createElement("link");Y.setAttribute("rel","preload");Y.setAttribute("href",R);Y.setAttribute("as","font");Y.setAttribute("crossorigin","");x.parentNode.insertBefore(Y,x)}}}};Editor.trimCssUrl=function(k){return k.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(k){k=null!=k?k:Editor.GUID_LENGTH;for(var x=[],J=0;J<k;J++)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.generateTimeout=6E4;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(k){k=null!=k&&"mxlibrary"!=k.nodeName?this.extractGraphModel(k):null;if(null!=k){var x=Editor.extractParserError(k,mxResources.get("invalidOrMissingFile"));if(x)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[k],"cause",[x]),Error(mxResources.get("notADiagramFile")+" ("+x+")");if("mxGraphModel"==k.nodeName){x=k.getAttribute("style")||-"default-style2";if("1"==urlParams.embed||null!=x&&""!=x)x!=this.graph.currentStyle&&(J=null!=this.graph.themes?this.graph.themes[x]:mxUtils.load(STYLE_PATH+"/"+x+".xml").getDocumentElement(),null!=J&&(R=new mxCodec(J.ownerDocument),R.decode(J,this.graph.getStylesheet())));else{var J=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=J){var R=new mxCodec(J.ownerDocument);R.decode(J,this.graph.getStylesheet())}}this.graph.currentStyle=-x;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));x=k.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"==k.getAttribute("shadow"),!1);if(x=k.getAttribute("extFonts"))try{for(x=-x.split("|").map(function(Y){Y=Y.split("^");return{name:Y[0],url:Y[1]}}),J=0;J<x.length;J++)this.graph.addExtFont(x[J].name,x[J].url)}catch(Y){console.log("ExtFonts format error: "+Y.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 d=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,x){k=null!=-k?k:!0;var J=d.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&J.setAttribute("style",this.graph.currentStyle);var R=this.graph.getBackgroundImageObject(this.graph.backgroundImage,x);null!=R&&J.setAttribute("backgroundImage",JSON.stringify(R));J.setAttribute("math",this.graph.mathEnabled?"1":"0");J.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?J.setAttribute("adaptiveColors",this.graph.adaptiveColors):J.removeAttribute("adaptiveColors");-null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(R=this.graph.extFonts.map(function(Y){return Y.name+"^"+Y.url}),J.setAttribute("extFonts",R.join("|")));return J};Editor.prototype.isDataSvg=function(k){try{var x=mxUtils.parseXml(k).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 J=mxUtils.parseXml(x).documentElement;-return"mxfile"==J.nodeName||"mxGraphModel"==J.nodeName}}catch(R){}return!1};Editor.prototype.extractGraphModel=function(k,x,J){return Editor.extractGraphModel.apply(this,arguments)};var m=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();-m.apply(this,arguments)};var n=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){n.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(k,x){if("undefined"===typeof window.MathJax){var J=function(){R=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?-k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var R=null;Editor.doMathJaxRender=function(W){try{null==R?(MathJax.typesetClear([W]),MathJax.typeset([W]),J()):R!=W&&Editor.mathJaxQueue.push(W)}catch(U){MathJax.typesetClear([W]),null!=U.retry?(R=W,U.retry.then(function(){MathJax.typesetPromise([W]).then(J)["catch"](function(aa){console.log("Error in MathJax.typesetPromise: "+aa.toString());J()})})["catch"](function(aa){console.log("Error in MathJax.retry: "+aa.toString());J()})):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"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var W=0;W<Editor.mathJaxQueue.length;W++)Editor.doMathJaxRender(Editor.mathJaxQueue[W])}}};Editor.MathJaxRender=function(W){"undefined"!==-typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(W):Editor.mathJaxQueue.push(W)};Editor.onMathJaxDone=function(){};var Y=Editor.prototype.init;Editor.prototype.init=function(){Y.apply(this,arguments);var W=mxUtils.bind(this,function(U,aa){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,W);this.graph.addListener(mxEvent.REFRESH,W)};x=document.getElementsByTagName("script");if(null!=-x&&0<x.length){var Z=document.createElement("script");Z.setAttribute("type","text/javascript");Z.setAttribute("src",k);x[0].parentNode.appendChild(Z)}}};Editor.prototype.csvToArray=function(k){if(0<k.length){var x="",J=[""],R=0,Y=!0,Z;k=$jscomp.makeIterator(k);for(Z=k.next();!Z.done;Z=k.next())Z=Z.value,'"'===Z?(Y&&Z===x&&(J[R]+=Z),Y=!Y):","===Z&&Y?Z=J[++R]="":J[R]+=Z,x=Z;return J}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&-!this.isCorsEnabledForUrl(k)){var x=EditorUi.isVisioFilename(k);x=/\.png$/i.test(k)||/\.pdf$/i.test(k)||x;var J="t="+(new Date).getTime();k=PROXY_URL+"?url="+encodeURIComponent(k)+"&"+J+(x?"&base64=1":"")}return k};Editor.prototype.isCorsEnabledForUrl=function(k){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||k.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(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var x=k.convert,J=this;k.convert=function(R){null!=R&&navigator.onLine&&("http://"!=R.substring(0,7)&&"https://"!=R.substring(0,8)||R.substring(0,k.baseUrl.length)==k.baseUrl||J.crossOriginImages&&-J.isCorsEnabledForUrl(R)?"chrome-extension://"!=R.substring(0,19)&&(R=x.apply(this,arguments)):R=PROXY_URL+"?url="+encodeURIComponent(R));return R};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,x,J,R,Y){try{var Z=!0,W=window.setTimeout(mxUtils.bind(this,function(){Z=!1;x(k)}),this.timeout),U=mxUtils.bind(this,function(){null!=R?this.convertImageToDataUri(k,x,J,R,!0):x(k)});if(/(\.svg)$/i.test(k)&&-!Y)mxUtils.get(k,mxUtils.bind(this,function(ia){window.clearTimeout(W);Z&&(200>ia.getStatus()||299<ia.getStatus()?U():x(Editor.createSvgDataUri(ia.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(W);Z&&U()}));else{var aa=new Image;this.crossOriginImages&&(aa.crossOrigin="anonymous");aa.onload=function(){window.clearTimeout(W);if(Z)try{R=null!=R&&Y?R:1;var ia=document.createElement("canvas"),na=ia.getContext("2d");na.scale(R,R);ia.height=aa.height*R;ia.width=aa.width*R;na.drawImage(aa,-0,0);x(ia.toDataURL())}catch(qa){x(k)}};aa.onerror=function(){window.clearTimeout(W);Z&&(null!=J?J():x(k))};aa.src=k}}catch(ia){null!=J?J():x(k)}};Editor.prototype.convertImages=function(k,x,J,R){function Y(){0<Z.length?Z.shift()():x(k)}null==R&&(R=this.createImageUrlConverter());var Z=[],W=J||{};J=mxUtils.bind(this,function(U,aa){U=k.getElementsByTagName(U);for(var ia=0;ia<U.length;ia++)mxUtils.bind(this,function(na){Z.push(mxUtils.bind(this,function(){try{if(null!=na){var qa=R.convert(na.getAttribute(aa));-if(null!=qa&&"data:"!=qa.substring(0,5)){var ta=W[qa];null==ta?this.convertImageToDataUri(qa,function(ua){null!=ua&&(W[qa]=ua,na.setAttribute(aa,ua));Y()},null,Editor.svgRasterScale):(na.setAttribute(aa,ta),Y())}else null!=qa&&na.setAttribute(aa,qa),Y()}}catch(ua){Y()}}))})(U[ia])});J("image","xlink:href");J("img","src");Y()};Editor.base64Encode=function(k){for(var x="",J=0,R=k.length,Y,Z,W;J<R;){Y=k.charCodeAt(J++)&255;if(J==R){x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y>>-2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Y&3)<<4);x+="==";break}Z=k.charCodeAt(J++);if(J==R){x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y>>2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Y&3)<<4|(Z&240)>>4);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Z&15)<<2);x+="=";break}W=k.charCodeAt(J++);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y>>-2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Y&3)<<4|(Z&240)>>4);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Z&15)<<2|(W&192)>>6);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(W&63)}return x};Editor.prototype.loadUrl=function(k,x,J,R,Y,Z,W,U){try{var aa=!W&&(R||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));Y=null!=Y?Y:!0;var ia=mxUtils.bind(this,-function(){mxUtils.get(k,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?null!=x&&(na=na.getText(),aa&&(Z=null!=Z?Z:"data:image/png;base64,",na=Z+Editor.base64Encode(na)),x(na)):null!=J&&(0==na.getStatus()?J({message:mxResources.get("accessDenied")},na):404==na.getStatus()?J({message:mxResources.get("fileNotFound"),code:na.getStatus()},na):J({message:this.getErrorMessage(na)},na))}),function(na){null!=J&&J({message:mxResources.get("error")+" "+na.getStatus()})},aa,this.timeout,-function(){Y&&null!=J&&J({code:App.ERROR_TIMEOUT,retry:ia})},U)});ia()}catch(na){null!=J&&J(na)}};Editor.prototype.getErrorMessage=function(k){var x=mxResources.get("error")+" "+k.getStatus();try{var J=k.getText(),R=JSON.parse(J);null!=R&&null!=R.error&&null!=R.error.message&&(x=R.error.message+" ("+x+")")}catch(Y){}return x};Editor.prototype.absoluteCssFonts=function(k){var x=null;if(null!=k){var J=k.split("url(");if(0<J.length){x=[J[0]];k=window.location.pathname;var R=null!=k?k.lastIndexOf("/"):--1;0<=R&&(k=k.substring(0,R+1));R=document.getElementsByTagName("base");var Y=null;null!=R&&0<R.length&&(Y=R[0].getAttribute("href"));for(var Z=1;Z<J.length;Z++)if(R=J[Z].indexOf(")"),0<R){var W=Editor.trimCssUrl(J[Z].substring(0,R));this.graph.isRelativeUrl(W)&&(W=null!=Y?Y+W:window.location.protocol+"//"+window.location.hostname+("/"==W.charAt(0)?"":k)+W);x.push('url("'+W+'"'+J[Z].substring(R))}else x.push(J[Z])}else x=[k]}return null!=x?x.join(""):null};Editor.prototype.mapFontUrl=function(k,x,-J){/^https?:\/\//.test(x)&&!this.isCorsEnabledForUrl(x)&&(x=PROXY_URL+"?url="+encodeURIComponent(x));J(k,x)};Editor.prototype.embedCssFonts=function(k,x){var J=k.split("url("),R=0;null==this.cachedFonts&&(this.cachedFonts={});var Y=mxUtils.bind(this,function(){if(0==R){for(var aa=[J[0]],ia=1;ia<J.length;ia++){var na=J[ia].indexOf(")");aa.push('url("');aa.push(this.cachedFonts[Editor.trimCssUrl(J[ia].substring(0,na))]);aa.push('"'+J[ia].substring(na))}x(aa.join(""))}});if(0<J.length){for(k=1;k<J.length;k++){var Z=-J[k].indexOf(")"),W=null,U=J[k].indexOf("format(",Z);0<U&&(W=Editor.trimCssUrl(J[k].substring(U+7,J[k].indexOf(")",U))));mxUtils.bind(this,function(aa){if(null==this.cachedFonts[aa]){this.cachedFonts[aa]=aa;R++;var ia="application/x-font-ttf";if("svg"==W||/(\.svg)($|\?)/i.test(aa))ia="image/svg+xml";else if("otf"==W||"embedded-opentype"==W||/(\.otf)($|\?)/i.test(aa))ia="application/x-font-opentype";else if("woff"==W||/(\.woff)($|\?)/i.test(aa))ia="application/font-woff";else if("woff2"==W||/(\.woff2)($|\?)/i.test(aa))ia=-"application/font-woff2";else if("eot"==W||/(\.eot)($|\?)/i.test(aa))ia="application/vnd.ms-fontobject";else if("sfnt"==W||/(\.sfnt)($|\?)/i.test(aa))ia="application/font-sfnt";this.mapFontUrl(ia,aa,mxUtils.bind(this,function(na,qa){this.loadUrl(qa,mxUtils.bind(this,function(ta){this.cachedFonts[aa]=ta;R--;Y()}),mxUtils.bind(this,function(ta){R--;Y()}),!0,null,"data:"+na+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(J[k].substring(0,Z)),W)}Y()}else x(k)};Editor.prototype.loadFonts=function(k){null!=-this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(x){this.resolvedFontCss=x;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},x;for(x in Graph.fontMapping)Graph.isCssFontUrl(x)&&(k[x]=Graph.fontMapping[x]);return k};Editor.prototype.embedExtFonts=function(k){var x=this.graph.getCustomFonts();if(0<x.length){var J=[],R=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var Y=-mxUtils.bind(this,function(){0==R&&this.embedCssFonts(J.join(""),k)}),Z=0;Z<x.length;Z++)mxUtils.bind(this,function(W,U){Graph.isCssFontUrl(U)?null==this.cachedGoogleFonts[U]?(R++,this.loadUrl(Graph.rewriteGoogleFontUrl(U),mxUtils.bind(this,function(aa){this.cachedGoogleFonts[U]=aa;J.push(aa+"\n");R--;Y()}),mxUtils.bind(this,function(aa){R--;J.push("@import url("+U+");\n");Y()}))):J.push(this.cachedGoogleFonts[U]+"\n"):J.push('@font-face {font-family: "'+W+'";src: url("'+U+'")}\n')})(x[Z].name,x[Z].url);-Y()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var x=document.getElementsByTagName("style"),J=0;J<x.length;J++){var R=mxUtils.getTextContent(x[J]);0>R.indexOf("mxPageSelector")&&0<R.indexOf("MathJax")&&k[0].appendChild(x[J].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,x){x=null!=x?x:this.absoluteCssFonts(this.fontCss);if(null!=x){var J=mxUtils.getSvgDefs(k),R=x.split("\n");x=[];for(var Y=[],Z=0;Z<R.length;Z++)"@import"==-R[Z].substring(0,7)?x.push(R[Z]):Y.push(R[Z]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<x.length&&(mxUtils.setTextContent(k,x.join("\n")),J.appendChild(k));0<Y.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,Y.join("\n")),J.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,-x,J){var R=mxClient.IS_FF?8192:16384;return Math.min(J,Math.min(R/k,R/x))};Editor.prototype.exportToCanvas=function(k,x,J,R,Y,Z,W,U,aa,ia,na,qa,ta,ua,Ba,za,Aa,Ga){try{Z=null!=Z?Z:!0;W=null!=W?W:!0;qa=null!=qa?qa:this.graph;ta=null!=ta?ta:0;var Ra=aa?null:qa.background;Ra==mxConstants.NONE&&(Ra=null);null==Ra&&(Ra=R);null==Ra&&0==aa&&(Ra="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(qa.getSvg(null,null,ta,ua,null,W,null,null,null,ia,null,za,Aa,Ga),mxUtils.bind(this,function(Ha){try{Ha.style.setProperty("-webkit-font-smoothing",-"antialiased");Ha.style.setProperty("-moz-osx-font-smoothing","grayscale");var Qa=new Image;Qa.onload=mxUtils.bind(this,function(){try{var Ma=function(){mxClient.IS_SF?window.setTimeout(function(){Na.drawImage(Qa,0,0);k(ya,Ha)},0):(Na.drawImage(Qa,0,0),k(ya,Ha))},ya=document.createElement("canvas"),Sa=parseInt(Ha.getAttribute("width")),Oa=parseInt(Ha.getAttribute("height"));U=null!=U?U:1;null!=x&&(U=Z?Math.min(1,Math.min(3*x/(4*Oa),x/Sa)):x/Sa);U=this.getMaxCanvasScale(Sa,Oa,U);Sa=Math.ceil(U*Sa);-Oa=Math.ceil(U*Oa);ya.setAttribute("width",Sa);ya.setAttribute("height",Oa);var Na=ya.getContext("2d");if(null!=Ra){var Pa=mxUtils.getLightDarkColor(Ra);Na.beginPath();Na.rect(0,0,Sa,Oa);Na.fillStyle="dark"==za&&"none"!=qa.getAdaptiveColors()?Pa.dark:Pa.light;Na.fill()}1!=U&&Na.scale(U,U);if(Ba){var oa=qa.view,Da=oa.scale;oa.scale=1;var Ca=btoa(unescape(encodeURIComponent(oa.createSvgGrid(oa.gridColor))));oa.scale=Da;Ca="data:image/svg+xml;base64,"+Ca;var Ja=qa.gridSize*oa.gridSteps*U,Xa=qa.getGraphBounds(),-ib=oa.translate.x*Da,y=oa.translate.y*Da,P=ib+(Xa.x-ib)/Da-ta,S=y+(Xa.y-y)/Da-ta,X=new Image;X.onload=function(){try{for(var ba=-Math.round(Ja-mxUtils.mod((ib-P)*U,Ja)),ma=-Math.round(Ja-mxUtils.mod((y-S)*U,Ja));ba<Sa;ba+=Ja)for(var ra=ma;ra<Oa;ra+=Ja)Na.drawImage(X,ba/U,ra/U);Ma()}catch(wa){null!=Y&&Y(wa)}};X.onerror=function(ba){null!=Y&&Y(ba)};X.src=Ca}else Ma()}catch(ba){null!=Y&&Y(ba)}});Qa.onerror=function(Ma){null!=Y&&Y(Ma)};ia&&this.graph.addSvgShadow(Ha);this.graph.mathEnabled&&this.addMathCss(Ha);-var eb=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ha,this.resolvedFontCss),Qa.src=Editor.createSvgDataUri(mxUtils.getXml(Ha))}catch(Ma){null!=Y&&Y(Ma)}});this.embedExtFonts(mxUtils.bind(this,function(Ma){try{null!=Ma&&this.addFontCss(Ha,Ma),this.loadFonts(eb)}catch(ya){null!=Y&&Y(ya)}}))}catch(Ma){null!=Y&&Y(Ma)}}),J,na)}catch(Ha){null!=Y&&Y(Ha)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,C=0;8>C;C++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=-p;Editor.updateCRC=function(k,x,J,R){for(var Y=0;Y<R;Y++)k=Editor.crcTable[(k^x.charCodeAt(J+Y))&255]^k>>>8;return k};Editor.crc32=function(k){for(var x=-1,J=0;J<k.length;J++)x=x>>>8^Editor.crcTable[(x^k.charCodeAt(J))&255];return(x^-1)>>>0};Editor.writeGraphModelToPng=function(k,x,J,R,Y){function Z(na,qa){var ta=aa;aa+=qa;return na.substring(ta,aa)}function W(na){na=Z(na,4);return na.charCodeAt(3)+(na.charCodeAt(2)<<8)+(na.charCodeAt(1)<<16)+(na.charCodeAt(0)<<24)}function U(na){return String.fromCharCode(na>>-24&255,na>>16&255,na>>8&255,na&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var aa=0;if(Z(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=Y&&Y();else if(Z(k,4),"IHDR"!=Z(k,4))null!=Y&&Y();else{Z(k,17);Y=k.substring(0,aa);do{var ia=W(k);if("IDAT"==Z(k,4)){Y=k.substring(0,aa-8);"pHYs"==x&&"dpi"==J?(J=Math.round(R/.0254),J=U(J)+U(J)+String.fromCharCode(1)):J=J+String.fromCharCode(0)+("zTXt"==x?String.fromCharCode(0):"")+R;R=4294967295;R=Editor.updateCRC(R,-x,0,4);R=Editor.updateCRC(R,J,0,J.length);Y+=U(J.length)+x+J+U(R^4294967295);Y+=k.substring(aa-8,k.length);break}Y+=k.substring(aa-8,aa-4+ia);Z(k,ia);Z(k,4)}while(ia);return"data:image/png;base64,"+(window.btoa?btoa(Y):Base64.encode(Y,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,x){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(k,x,J){var R=null;if(null!=J)return null;null!=k.editor.graph.getModel().getParent(x)?R=x.getId():null!=k.currentPage&&(R=k.currentPage.getId());return R});if(null!=window.StyleFormatPanel){var E=Format.prototype.init;Format.prototype.init=-function(){E.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var Q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?Q.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var M=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=-function(k){k=M.apply(this,arguments);var x=this.editorUi,J=x.editor.graph;if(J.isEnabled()){var R=x.getCurrentFile();null!=R&&R.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return x.editor.autosave},function(Z){x.editor.setAutosave(Z);x.editor.autosave&&R.isModified()&&R.fileChanged()},{install:function(Z){this.listener=function(){Z(x.editor.autosave)};x.editor.addListener("autosaveChanged",this.listener)},destroy:function(){x.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&-J.isEnabled()&&"undefined"!==typeof MathJax){var Y=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return J.mathEnabled},function(Z){x.actions.get("mathematicalTypesetting").funct()},{install:function(Z){this.listener=function(){Z(J.mathEnabled)};x.addListener("mathEnabledChanged",this.listener)},destroy:function(){x.removeListener(this.listener)}});k.appendChild(Y);(!x.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&Y.appendChild(x.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};-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.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];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(k){return"0"==mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(k){return"1"==mxUtils.getValue(k.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,isVisible:function(k){return"0"==mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,-min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",-dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",-dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",-min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",-type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",-type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",-type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);-mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},-{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},-{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=+this.canvas.fillAndStroke=mxUtils.bind(this,k.prototype.fillAndStroke);this.path=[];this.passThrough=!1}k.prototype.moveOp="M";k.prototype.lineOp="L";k.prototype.quadOp="Q";k.prototype.curveOp="C";k.prototype.closeOp="Z";k.prototype.getStyle=function(aa,Z){var U=1;if(null!=this.shape.state){var ba=this.shape.state.cell.id;if(null!=ba)for(var fa=0;fa<ba.length;fa++)U=(U<<5)-U+ba.charCodeAt(fa)<<0}U={strokeWidth:this.canvas.state.strokeWidth,seed:U,preserveVertices:!0};ba=this.rc.getDefaultOptions();+U.stroke=aa?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;aa=null;(U.filled=Z)?(U.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,aa=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):U.fill="";U.bowing=mxUtils.getValue(this.shape.style,"bowing",ba.bowing);U.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ba.hachureAngle);U.curveFitting=mxUtils.getValue(this.shape.style,+"curveFitting",ba.curveFitting);U.roughness=mxUtils.getValue(this.shape.style,"jiggle",ba.roughness);U.simplification=mxUtils.getValue(this.shape.style,"simplification",ba.simplification);U.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ba.disableMultiStroke);U.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ba.disableMultiStrokeFill);Z=mxUtils.getValue(this.shape.style,"hachureGap",-1);U.hachureGap="auto"==Z?-1:Z;U.dashGap=mxUtils.getValue(this.shape.style,+"dashGap",Z);U.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Z);U.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Z);Z=mxUtils.getValue(this.shape.style,"fillWeight",-1);U.fillWeight="auto"==Z?-1:Z;Z=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==Z&&(Z="auto");"auto"==Z&&(Z=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&Z.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&Z.push(mxUtils.hex2rgb(Editor.darkColor)),+Z=null!=U.fill&&(null!=aa||0<=mxUtils.indexOf(Z,mxUtils.hex2rgb(U.fill)))?"solid":ba.fillStyle);U.fillStyle=Z;return U};k.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};k.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};k.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var aa=2;aa<arguments.length;aa+=2)this.lastX=arguments[aa-1],this.lastY=arguments[aa],+this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};k.prototype.lineTo=function(aa,Z){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,aa,Z),this.lastX=aa,this.lastY=Z)};k.prototype.moveTo=function(aa,Z){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,aa,Z),this.lastX=aa,this.lastY=Z,this.firstX=aa,this.firstY=Z)};k.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,+arguments):this.addOp(this.closeOp)};k.prototype.quadTo=function(aa,Z,U,ba){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,aa,Z,U,ba),this.lastX=U,this.lastY=ba)};k.prototype.curveTo=function(aa,Z,U,ba,fa,na){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,aa,Z,U,ba,fa,na),this.lastX=fa,this.lastY=na)};k.prototype.arcTo=function(aa,Z,U,ba,fa,na,pa){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);+else{var ta=mxUtils.arcToCurves(this.lastX,this.lastY,aa,Z,U,ba,fa,na,pa);if(null!=ta)for(var ua=0;ua<ta.length;ua+=6)this.curveTo(ta[ua],ta[ua+1],ta[ua+2],ta[ua+3],ta[ua+4],ta[ua+5]);this.lastX=na;this.lastY=pa}};k.prototype.rect=function(aa,Z,U,ba){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(aa,Z,U,ba,this.getStyle(!0,!0)))};k.prototype.ellipse=function(aa,Z,U,ba){this.passThrough?this.originalEllipse.apply(this.canvas,+arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(aa+U/2,Z+ba/2,U,ba,this.getStyle(!0,!0)))};k.prototype.roundrect=function(aa,Z,U,ba,fa,na){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(aa+fa,Z),this.lineTo(aa+U-fa,Z),this.quadTo(aa+U,Z,aa+U,Z+na),this.lineTo(aa+U,Z+ba-na),this.quadTo(aa+U,Z+ba,aa+U-fa,Z+ba),this.lineTo(aa+fa,Z+ba),this.quadTo(aa,Z+ba,aa,Z+ba-na),this.lineTo(aa,Z+na),this.quadTo(aa,Z,aa+fa,Z))};k.prototype.drawPath=+function(aa){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),aa)}catch(U){}this.passThrough=!1}else if(null!=this.nextShape){for(var Z in aa)this.nextShape.options[Z]=aa[Z];aa.stroke!=mxConstants.NONE&&null!=aa.stroke||delete this.nextShape.options.stroke;aa.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};k.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):+this.drawPath(this.getStyle(!0,!1))};k.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};k.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};k.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(aa){return new k(aa,Editor.createRoughCanvas(aa),+this)};var y=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(aa){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?y.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(aa):this.createRoughCanvas(aa)};var J=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(aa,Z,U,ba,fa){null!=aa.handJiggle&&aa.handJiggle.passThrough||J.apply(this,arguments)};+var R=mxShape.prototype.paint;mxShape.prototype.paint=function(aa){var Z=aa.addTolerance,U=!0;null!=this.style&&(U="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=aa.handJiggle&&aa.handJiggle.constructor==k&&!this.outline){aa.save();var ba=this.fill,fa=this.stroke;this.stroke=this.fill=null;var na=this.configurePointerEvents,pa=aa.setStrokeColor;aa.setStrokeColor=function(){};var ta=aa.setFillColor;aa.setFillColor=function(){};U||null==ba||(this.configurePointerEvents=+function(){});aa.handJiggle.passThrough=!0;R.apply(this,arguments);aa.handJiggle.passThrough=!1;aa.setFillColor=ta;aa.setStrokeColor=pa;this.configurePointerEvents=na;this.stroke=fa;this.fill=ba;aa.restore();U&&null!=ba&&(aa.addTolerance=function(){})}R.apply(this,arguments);aa.addTolerance=Z};var X=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(aa,Z,U,ba,fa,na){null!=aa.handJiggle&&aa.handJiggle.constructor==k?(aa.handJiggle.passThrough=!0,X.apply(this,arguments),+aa.handJiggle.passThrough=!1):X.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,y,J){if(null!=k&&"undefined"!==typeof pako){var R=k.ownerDocument.getElementsByTagName("div"),X=[];if(null!=R&&0<+R.length)for(var aa=0;aa<R.length;aa++)if("mxgraph"==R[aa].getAttribute("class")){X.push(R[aa]);break}0<X.length&&(R=X[0].getAttribute("data-mxgraph"),null!=R?(X=JSON.parse(R),null!=X&&null!=X.xml&&(k=mxUtils.parseXml(X.xml),k=k.documentElement)):(X=X[0].getElementsByTagName("div"),0<X.length&&(R=mxUtils.getTextContent(X[0]),R=Graph.decompress(R,null,J),0<R.length&&(k=mxUtils.parseXml(R),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(R=k.getAttribute("content"),null!=R&&"<"!=R.charAt(0)&&+"%"!=R.charAt(0)&&(R=unescape(window.atob?atob(R):Base64.decode(cont,R))),null!=R&&"%"==R.charAt(0)&&(R=decodeURIComponent(R)),null!=R&&0<R.length)k=mxUtils.parseXml(R).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||y||(X=null,"diagram"==k.nodeName?X=k:"mxfile"==k.nodeName&&(R=k.getElementsByTagName("diagram"),0<R.length&&(X=R[Math.max(0,Math.min(R.length-1,urlParams.page||0))])),null!=X&&(k=Editor.parseDiagramNode(X,J)));null==k||"mxGraphModel"==k.nodeName||y&&"mxfile"==+k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,y,J){Editor.validateDiagramNode(k);var R=mxUtils.trim(mxUtils.getTextContent(k)),X=null;0<R.length?(y=Graph.decompress(R,null,y),null!=y&&0<y.length&&(X=mxUtils.parseXml(y).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(X=k[0],J&&(X=Editor.parseDiagramNode(X,y,!1)),y=mxUtils.createXmlDocument(),y.appendChild(y.importNode(X,!0)),X=y.documentElement));return X};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);+var y=mxUtils.getNodeValue(k),J=null;0<y.length?J=Graph.decompress(y):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(J=mxUtils.getXml(k[0])));return J};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var y=new mxCodec,J=new mxGraphModel;k.appendChild(y.encode(J))}return k};Editor.extractGraphModelFromPdf=function(k){var y=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,+!0);if("%PDF-1.7"==k.substring(0,8)){var J=k.indexOf("EmbeddedFile");if(-1<J){var R=k.indexOf("stream",J)+9;if(0<k.substring(J,R).indexOf("application#2Fvnd.jgraph.mxfile")){var X=k.indexOf("endstream",R-1);return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(R,X)),{to:"string"})}}for(J=k.indexOf("/ObjStm");0<J;){R=k.indexOf("stream",J)+9;X=k.indexOf("endstream",R-1);R=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(R,X)),{to:"string"});X=R.indexOf("/Subject <");if(0<X){J=R.substring(X++14,R.indexOf(">",X));if(null!=J){y=J;J=[];for(R=0;R<y.length;R+=2)X=y.substr(R,2),"00"!=X&&J.push(String.fromCharCode(parseInt(X,16)));y=J.join("")}break}J=k.indexOf("/ObjStm",J+1)}}if(null==y&&"%PDF-1.4"==k.substring(0,8)){J="";X=R=0;for(var aa=[],Z=null;X<k.length;){var U=k.charCodeAt(X);X+=1;10!=U&&(J+=String.fromCharCode(U));U=="/Subject (%3Cmxfile".charCodeAt(R)?R++:R=0;if(19==R){var ba=k.indexOf("%3C%2Fmxfile%3E",X)+15;X-=9;if(ba>X){y=k.substring(X,ba);break}}10==U&&("endobj"==J?Z=null:"obj"==+J.substring(J.length-3,J.length)||"xref"==J||"trailer"==J?(Z=[],aa[J.split(" ")[0]]=Z):null!=Z&&Z.push(J),J="")}}null==y&&null!=aa&&(y=Editor.extractGraphModelFromXref(aa));null!=y&&(y=decodeURIComponent(y.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return y};Editor.extractGraphModelFromXref=function(k){var y=k.trailer,J=null;null!=y&&(y=/.* \/Info (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(y=k[y[1]],null!=y&&(y=/.* \/Subject (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(k=+k[y[1]],null!=k&&(k=k.join("\n"),J=k.substring(1,k.length-1))))));return J};Editor.extractParserError=function(k,y){var J=null;k=null!=k?k.getElementsByTagName("parsererror"):null;null!=k&&0<k.length&&(J=y||mxResources.get("invalidChars"),y=k[0].getElementsByTagName("div"),0<y.length&&(J=mxUtils.getTextContent(y[0])));return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(k,y){null!=k&&(k=null!=k.error?k.error:k,null==k.retry&&(k.retry=y))};Editor.mermaidToDrawio=function(k,y,J){if("function"===+typeof mxMermaidToDrawio)return mxMermaidToDrawio(k,y,J)};Editor.configure=function(k){if(null!=k){Editor.config=k;Editor.configVersion=k.version;k.debug&&(urlParams.test="1");k.passiveScroll&&(Editor.passiveScroll=!0);k.noResizers&&(Editor.noResizers=!0);k.preserveViewState&&(Editor.preserveViewState=!0);k.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=k.useInternalClipboard);if(null!=k.customCss){var y=document.createElement("style");y.type="text/css";y.appendChild(document.createTextNode(k.customCss));+document.head.appendChild(y)}null!=k.defaultFonts&&(Menus.prototype.defaultFonts=k.defaultFonts);null!=k.presetColors&&(ColorDialog.prototype.presetColors=k.presetColors);null!=k.defaultColors&&(ColorDialog.prototype.defaultColors=k.defaultColors);null!=k.colorNames&&(ColorDialog.prototype.colorNames=k.colorNames);null!=k.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.defaultColorSchemes);null!=k.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=k.defaultEdgeLength);null!=+k.selectParentLayer&&(Graph.selectParentLayer=k.selectParentLayer);null!=k.intersectionSelect&&(Graph.intersectionSelect=k.intersectionSelect);null!=k.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=k.autosaveDelay);null!=k.templateFile&&(EditorUi.templateFile=k.templateFile);null!=k.styles&&(Array.isArray(k.styles)?Editor.styles=k.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=k.globalVars&&(Editor.globalVars=k.globalVars);null!=k.compressXml&&(Editor.defaultCompressed=+k.compressXml,Editor.compressXml=k.compressXml);null!=k.includeDiagram&&(Editor.defaultIncludeDiagram=k.includeDiagram);null!=k.simpleLabels&&(Editor.simpleLabels=k.simpleLabels);null!=k.pasteAtMousePointer&&(Editor.pasteAtMousePointer=k.pasteAtMousePointer);null!=k.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=k.fitDiagramOnLoad);null!=k.fitDiagramOnPage&&(Editor.fitDiagramOnPage=k.fitDiagramOnPage);null!=k.showLinkIcons&&(Editor.showLinkIcons=k.showLinkIcons);null!=k.showTooltipIcons&&(Editor.showTooltipIcons=+k.showTooltipIcons);null!=k.showConnectHandle&&(Editor.showConnectHandle=k.showConnectHandle);null!=k.enableInlineToolbar&&(Editor.enableInlineToolbar=k.enableInlineToolbar);null!=k.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=k.oneDriveInlinePicker);null!=k.enableNativeClipboard&&(Editor.enableNativeClipboard=k.enableNativeClipboard);null!=k.enableExportUrl&&(Editor.enableExportUrl=k.enableExportUrl);null!=k.defaultAdaptiveColors?Graph.defaultAdaptiveColors=k.defaultAdaptiveColors:0==k.enableCssDarkMode&&+(Graph.defaultAdaptiveColors="simple");null!=k.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=k.enableLightDarkColors);null!=k.darkColor&&(Editor.darkColor=k.darkColor);null!=k.darkColorVar&&(Editor.darkColorVar=k.darkColorVar);Graph.prototype.defaultPageBackgroundColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=k.settingsName&&(Editor.configurationKey="."+k.settingsName++"-configuration",Editor.settingsKey="."+k.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=k.customFonts&&(Menus.prototype.defaultFonts=k.customFonts.concat(Menus.prototype.defaultFonts));null!=k.customPresetColors&&(ColorDialog.prototype.presetColors=k.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=k.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=k.css){y=+document.createElement("style");y.setAttribute("type","text/css");y.appendChild(document.createTextNode(k.css));var J=document.getElementsByTagName("script")[0];J.parentNode.insertBefore(y,J)}null!=k.expandLibraries&&(Sidebar.prototype.expandLibraries=k.expandLibraries);null!=k.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=k.appendCustomLibraries);null!=k.libraries&&(Sidebar.prototype.customEntries=k.libraries);null!=k.enabledLibraries&&(Array.isArray(k.enabledLibraries)?Sidebar.prototype.enabledLibraries=+k.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=k.defaultLibraries&&(Sidebar.prototype.defaultEntries=k.defaultLibraries);null!=k.defaultCustomLibraries&&(Editor.defaultCustomLibraries=k.defaultCustomLibraries);null!=k.enableCustomLibraries&&(Editor.enableCustomLibraries=k.enableCustomLibraries);null!=k.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=k.defaultVertexStyle);null!=k.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=k.defaultEdgeStyle);+null!=k.shapePicker&&(EditorUi.prototype.defaultShapePickerEntries=k.shapePicker.shapes);null!=k.defaultPageVisible&&(Graph.prototype.defaultPageVisible=k.defaultPageVisible);null!=k.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=k.defaultGridEnabled);null!=k.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=k.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=k.defaultConnectionArrowsEnabled);null!=k.defaultConnectable&&(Graph.prototype.defaultConnectable=+k.defaultConnectable);null!=k.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=k.defaultFoldingEnabled);null!=k.zoomWheel&&(Graph.zoomWheel=k.zoomWheel);null!=k.zoomFactor&&(y=parseFloat(k.zoomFactor),!isNaN(y)&&1<y?Graph.prototype.zoomFactor=y:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=k.defaultGridSize&&(y=parseInt(k.defaultGridSize),!isNaN(y)&&0<y?mxGraph.prototype.gridSize=y:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));+null!=k.gridSteps&&(y=parseInt(k.gridSteps),!isNaN(y)&&0<y?mxGraphView.prototype.gridSteps=y:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=k.pageFormat&&(y=parseInt(k.pageFormat.width),J=parseInt(k.pageFormat.height),!isNaN(y)&&0<y&&!isNaN(J)&&0<J?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,y,J),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=+k.thumbWidth&&(Sidebar.prototype.thumbWidth=k.thumbWidth);null!=k.thumbHeight&&(Sidebar.prototype.thumbHeight=k.thumbHeight);null!=k.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=k.emptyLibraryXml);null!=k.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=k.emptyDiagramXml);null!=k.sidebarWidth&&(EditorUi.prototype.hsplitPosition=k.sidebarWidth);null!=k.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=k.updateDefaultStyle);null!=k.sidebarTitles&&(Sidebar.prototype.sidebarTitles=+k.sidebarTitles);null!=k.sidebarTitleSize&&(y=parseInt(k.sidebarTitleSize),!isNaN(y)&&0<y?Sidebar.prototype.sidebarTitleSize=y:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=k.fontCss&&("string"===typeof k.fontCss?Editor.configureFontCss(k.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=k.autosaveDelay&&(y=parseInt(k.autosaveDelay),!isNaN(y)&&0<y?DrawioFile.prototype.autosaveDelay=y:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));+null!=k.maxImageBytes&&(EditorUi.prototype.maxImageBytes=k.maxImageBytes);null!=k.maxImageSize&&(EditorUi.prototype.maxImageSize=k.maxImageSize);null!=k.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=k.shareCursorPosition);null!=k.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=k.showRemoteCursors);null!=k.restrictExport&&(DrawioFile.RESTRICT_EXPORT=k.restrictExport);null!=k.removeImageMetadata&&(Editor.removeImageMetadata=k.removeImageMetadata);null!=k.defaultTextStyle&&(Editor.defaultTextStyle=+k.defaultTextStyle);null!=k.replaceSvgDataUris&&(Editor.replaceSvgDataUris=k.replaceSvgDataUris);null!=k.foreignObjectImages&&(Editor.foreignObjectImages=k.foreignObjectImages);null!=k.shadowColor&&(mxConstants.SHADOW_COLOR=k.shadowColor);null!=k.shadowOpacity&&(mxConstants.SHADOW_OPACITY=k.shadowOpacity);null!=k.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=k.shadowOffsetX);null!=k.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=k.shadowOffsetY);null!=k.shadowBlur&&(mxConstants.SHADOW_BLUR=k.shadowBlur);+null!=k.enableAnimations&&(Editor.enableAnimations=k.enableAnimations);null!=k.enableWindowDocking&&(Editor.enableWindowDocking=k.enableWindowDocking);null!=k.compact&&(EditorUi.prototype.defaultCompact=k.compact);null!=k.noAutoFocus&&(EditorUi.prototype.noAutoFocus=k.noAutoFocus);if(null!=k.hideMenuItems)if(Array.isArray(k.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},y=0;y<k.hideMenuItems.length;y++)Menus.prototype.hiddenMenuItems[k.hideMenuItems[y]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");+if(null!=k.hideMenus)if(Array.isArray(k.hideMenus)){var R={};for(y=0;y<k.hideMenus.length;y++)R[k.hideMenus[y]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(X){return!R[X]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=k.enableAi&&(Editor.enableAi=k.enableAi);null!=k.enableChatGpt&&(Editor.enableAi=k.enableChatGpt);null!=k.gptApiKey&&(Editor.aiGlobals.gptApiKey=k.gptApiKey);null!=k.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=+k.geminiApiKey);null!=k.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=k.claudeApiKey);null!=k.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=k.gptUrl);null!=k.aiActions&&(Editor.aiActions=k.aiActions);null!=k.aiGlobals&&(Editor.aiGlobals=k.aiGlobals);null!=k.aiConfigs&&(Editor.aiConfigs=k.aiConfigs);null!=k.aiModels&&(Editor.aiModels=k.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=+function(k){if(null!=k){Editor.prototype.fontCss=k;var y=document.getElementsByTagName("script")[0];if(null!=y&&null!=y.parentNode){var J=document.createElement("style");J.setAttribute("type","text/css");J.appendChild(document.createTextNode(k));y.parentNode.insertBefore(J,y);k=k.split("url(");for(J=1;J<k.length;J++){var R=k[J].indexOf(")");R=Editor.trimCssUrl(k[J].substring(0,R));var X=document.createElement("link");X.setAttribute("rel","preload");X.setAttribute("href",R);X.setAttribute("as","font");+X.setAttribute("crossorigin","");y.parentNode.insertBefore(X,y)}}}};Editor.trimCssUrl=function(k){return k.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(k){k=null!=k?k:Editor.GUID_LENGTH;for(var y=[],J=0;J<k;J++)y.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*+Editor.GUID_ALPHABET.length)));return y.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.generateTimeout=6E4;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(k){k=null!=k&&"mxlibrary"!=k.nodeName?this.extractGraphModel(k):+null;if(null!=k){var y=Editor.extractParserError(k,mxResources.get("invalidOrMissingFile"));if(y)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[k],"cause",[y]),Error(mxResources.get("notADiagramFile")+" ("+y+")");if("mxGraphModel"==k.nodeName){y=k.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=y&&""!=y)y!=this.graph.currentStyle&&(J=null!=this.graph.themes?this.graph.themes[y]:mxUtils.load(STYLE_PATH+"/"+y+".xml").getDocumentElement(),null!=J&&(R=new mxCodec(J.ownerDocument),+R.decode(J,this.graph.getStylesheet())));else{var J=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=J){var R=new mxCodec(J.ownerDocument);R.decode(J,this.graph.getStylesheet())}}this.graph.currentStyle=y;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));y=k.getAttribute("backgroundImage");null!=y?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(y)):+this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==k.getAttribute("shadow"),!1);if(y=k.getAttribute("extFonts"))try{for(y=y.split("|").map(function(X){X=X.split("^");return{name:X[0],url:X[1]}}),J=0;J<y.length;J++)this.graph.addExtFont(y[J].name,y[J].url)}catch(X){console.log("ExtFonts format error: "+X.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 d=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,y){k=null!=k?k:!0;var J=d.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&J.setAttribute("style",this.graph.currentStyle);var R=this.graph.getBackgroundImageObject(this.graph.backgroundImage,+y);null!=R&&J.setAttribute("backgroundImage",JSON.stringify(R));J.setAttribute("math",this.graph.mathEnabled?"1":"0");J.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?J.setAttribute("adaptiveColors",this.graph.adaptiveColors):J.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(R=this.graph.extFonts.map(function(X){return X.name+"^"+X.url}),J.setAttribute("extFonts",R.join("|")));return J};Editor.prototype.isDataSvg=+function(k){try{var y=mxUtils.parseXml(k).documentElement.getAttribute("content");if(null!=y&&(null!=y&&"<"!=y.charAt(0)&&"%"!=y.charAt(0)&&(y=unescape(window.atob?atob(y):Base64.decode(cont,y))),null!=y&&"%"==y.charAt(0)&&(y=decodeURIComponent(y)),null!=y&&0<y.length)){var J=mxUtils.parseXml(y).documentElement;return"mxfile"==J.nodeName||"mxGraphModel"==J.nodeName}}catch(R){}return!1};Editor.prototype.extractGraphModel=function(k,y,J){return Editor.extractGraphModel.apply(this,arguments)};var m=+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();m.apply(this,arguments)};var n=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){n.apply(this,arguments);this.graph.useCssTransforms=+!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(k,y){if("undefined"===typeof window.MathJax){var J=function(){R=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var R=null;Editor.doMathJaxRender=function(Z){try{null==R?(MathJax.typesetClear([Z]),MathJax.typeset([Z]),J()):R!=Z&&Editor.mathJaxQueue.push(Z)}catch(U){MathJax.typesetClear([Z]),+null!=U.retry?(R=Z,U.retry.then(function(){MathJax.typesetPromise([Z]).then(J)["catch"](function(ba){console.log("Error in MathJax.typesetPromise: "+ba.toString());J()})})["catch"](function(ba){console.log("Error in MathJax.retry: "+ba.toString());J()})):null!=window.console&&console.log("Error in MathJax.typeset: "+U.toString())}};window.MathJax=null!=y?y:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg",+"input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var Z=0;Z<Editor.mathJaxQueue.length;Z++)Editor.doMathJaxRender(Editor.mathJaxQueue[Z])}}};Editor.MathJaxRender=function(Z){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(Z):Editor.mathJaxQueue.push(Z)};Editor.onMathJaxDone=function(){};var X=Editor.prototype.init;Editor.prototype.init=function(){X.apply(this,arguments);+var Z=mxUtils.bind(this,function(U,ba){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,Z);this.graph.addListener(mxEvent.REFRESH,Z)};y=document.getElementsByTagName("script");if(null!=y&&0<y.length){var aa=document.createElement("script");aa.setAttribute("type","text/javascript");aa.setAttribute("src",k);y[0].parentNode.appendChild(aa)}}};Editor.prototype.csvToArray=function(k){if(0<k.length){var y="",J=[""],+R=0,X=!0,aa;k=$jscomp.makeIterator(k);for(aa=k.next();!aa.done;aa=k.next())aa=aa.value,'"'===aa?(X&&aa===y&&(J[R]+=aa),X=!X):","===aa&&X?aa=J[++R]="":J[R]+=aa,y=aa;return J}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(k)){var y=EditorUi.isVisioFilename(k);y=/\.png$/i.test(k)||/\.pdf$/i.test(k)||y;var J="t="+(new Date).getTime();k=PROXY_URL+"?url="+encodeURIComponent(k)++"&"+J+(y?"&base64=1":"")}return k};Editor.prototype.isCorsEnabledForUrl=function(k){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||k.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(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===+k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var y=k.convert,J=this;k.convert=function(R){null!=R&&navigator.onLine&&("http://"!=R.substring(0,7)&&"https://"!=R.substring(0,8)||R.substring(0,k.baseUrl.length)==k.baseUrl||J.crossOriginImages&&J.isCorsEnabledForUrl(R)?"chrome-extension://"!=R.substring(0,19)&&(R=y.apply(this,arguments)):R=PROXY_URL+"?url="+encodeURIComponent(R));return R};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"++btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,y,J,R,X){try{var aa=!0,Z=window.setTimeout(mxUtils.bind(this,function(){aa=!1;y(k)}),this.timeout),U=mxUtils.bind(this,function(){null!=R?this.convertImageToDataUri(k,y,J,R,!0):y(k)});if(/(\.svg)$/i.test(k)&&!X)mxUtils.get(k,mxUtils.bind(this,function(fa){window.clearTimeout(Z);aa&&(200>fa.getStatus()||299<fa.getStatus()?U():y(Editor.createSvgDataUri(fa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Z);+aa&&U()}));else{var ba=new Image;this.crossOriginImages&&(ba.crossOrigin="anonymous");ba.onload=function(){window.clearTimeout(Z);if(aa)try{R=null!=R&&X?R:1;var fa=document.createElement("canvas");fa.height=ba.height*R;fa.width=ba.width*R;var na=fa.getContext("2d");na.scale(R,R);na.drawImage(ba,0,0);y(fa.toDataURL())}catch(pa){y(k)}};ba.onerror=function(){window.clearTimeout(Z);aa&&(null!=J?J():y(k))};ba.src=k}}catch(fa){null!=J?J():y(k)}};Editor.prototype.convertImages=function(k,y,J,R){function X(){0<+aa.length?aa.shift()():y(k)}null==R&&(R=this.createImageUrlConverter());var aa=[],Z=J||{};J=mxUtils.bind(this,function(U,ba){U=k.getElementsByTagName(U);for(var fa=0;fa<U.length;fa++)mxUtils.bind(this,function(na){aa.push(mxUtils.bind(this,function(){try{if(null!=na){var pa=R.convert(na.getAttribute(ba));if(null!=pa&&"data:"!=pa.substring(0,5)){var ta=Z[pa];null==ta?this.convertImageToDataUri(pa,function(ua){null!=ua&&(Z[pa]=ua,na.setAttribute(ba,ua));X()},null,Editor.svgRasterScale):(na.setAttribute(ba,+ta),X())}else null!=pa&&na.setAttribute(ba,pa),X()}}catch(ua){X()}}))})(U[fa])});J("image","xlink:href");J("img","src");X()};Editor.base64Encode=function(k){for(var y="",J=0,R=k.length,X,aa,Z;J<R;){X=k.charCodeAt(J++)&255;if(J==R){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(X>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((X&3)<<4);y+="==";break}aa=k.charCodeAt(J++);if(J==R){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(X>>+2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((X&3)<<4|(aa&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((aa&15)<<2);y+="=";break}Z=k.charCodeAt(J++);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(X>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((X&3)<<4|(aa&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((aa&15)<<2|(Z&192)>>+6);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Z&63)}return y};Editor.prototype.loadUrl=function(k,y,J,R,X,aa,Z,U){try{var ba=!Z&&(R||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));X=null!=X?X:!0;var fa=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?null!=y&&(na=na.getText(),ba&&(aa=null!=aa?aa:"data:image/png;base64,",na=aa+Editor.base64Encode(na)),+y(na)):null!=J&&(0==na.getStatus()?J({message:mxResources.get("accessDenied")},na):404==na.getStatus()?J({message:mxResources.get("fileNotFound"),code:na.getStatus()},na):J({message:this.getErrorMessage(na)},na))}),function(na){null!=J&&J({message:mxResources.get("error")+" "+na.getStatus()})},ba,this.timeout,function(){X&&null!=J&&J({code:App.ERROR_TIMEOUT,retry:fa})},U)});fa()}catch(na){null!=J&&J(na)}};Editor.prototype.getErrorMessage=function(k){var y=mxResources.get("error")+" "+k.getStatus();+try{var J=k.getText(),R=JSON.parse(J);null!=R&&null!=R.error&&null!=R.error.message&&(y=R.error.message+" ("+y+")")}catch(X){}return y};Editor.prototype.absoluteCssFonts=function(k){var y=null;if(null!=k){var J=k.split("url(");if(0<J.length){y=[J[0]];k=window.location.pathname;var R=null!=k?k.lastIndexOf("/"):-1;0<=R&&(k=k.substring(0,R+1));R=document.getElementsByTagName("base");var X=null;null!=R&&0<R.length&&(X=R[0].getAttribute("href"));for(var aa=1;aa<J.length;aa++)if(R=J[aa].indexOf(")"),0<+R){var Z=Editor.trimCssUrl(J[aa].substring(0,R));this.graph.isRelativeUrl(Z)&&(Z=null!=X?X+Z:window.location.protocol+"//"+window.location.hostname+("/"==Z.charAt(0)?"":k)+Z);y.push('url("'+Z+'"'+J[aa].substring(R))}else y.push(J[aa])}else y=[k]}return null!=y?y.join(""):null};Editor.prototype.mapFontUrl=function(k,y,J){/^https?:\/\//.test(y)&&!this.isCorsEnabledForUrl(y)&&(y=PROXY_URL+"?url="+encodeURIComponent(y));J(k,y)};Editor.prototype.embedCssFonts=function(k,y){var J=k.split("url("),R=0;null==+this.cachedFonts&&(this.cachedFonts={});var X=mxUtils.bind(this,function(){if(0==R){for(var ba=[J[0]],fa=1;fa<J.length;fa++){var na=J[fa].indexOf(")");ba.push('url("');ba.push(this.cachedFonts[Editor.trimCssUrl(J[fa].substring(0,na))]);ba.push('"'+J[fa].substring(na))}y(ba.join(""))}});if(0<J.length){for(k=1;k<J.length;k++){var aa=J[k].indexOf(")"),Z=null,U=J[k].indexOf("format(",aa);0<U&&(Z=Editor.trimCssUrl(J[k].substring(U+7,J[k].indexOf(")",U))));mxUtils.bind(this,function(ba){if(null==this.cachedFonts[ba]){this.cachedFonts[ba]=+ba;R++;var fa="application/x-font-ttf";if("svg"==Z||/(\.svg)($|\?)/i.test(ba))fa="image/svg+xml";else if("otf"==Z||"embedded-opentype"==Z||/(\.otf)($|\?)/i.test(ba))fa="application/x-font-opentype";else if("woff"==Z||/(\.woff)($|\?)/i.test(ba))fa="application/font-woff";else if("woff2"==Z||/(\.woff2)($|\?)/i.test(ba))fa="application/font-woff2";else if("eot"==Z||/(\.eot)($|\?)/i.test(ba))fa="application/vnd.ms-fontobject";else if("sfnt"==Z||/(\.sfnt)($|\?)/i.test(ba))fa="application/font-sfnt";this.mapFontUrl(fa,+ba,mxUtils.bind(this,function(na,pa){this.loadUrl(pa,mxUtils.bind(this,function(ta){this.cachedFonts[ba]=ta;R--;X()}),mxUtils.bind(this,function(ta){R--;X()}),!0,null,"data:"+na+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(J[k].substring(0,aa)),Z)}X()}else y(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(y){this.resolvedFontCss=y;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=+function(){var k={},y;for(y in Graph.fontMapping)Graph.isCssFontUrl(y)&&(k[y]=Graph.fontMapping[y]);return k};Editor.prototype.embedExtFonts=function(k){var y=this.graph.getCustomFonts();if(0<y.length){var J=[],R=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var X=mxUtils.bind(this,function(){0==R&&this.embedCssFonts(J.join(""),k)}),aa=0;aa<y.length;aa++)mxUtils.bind(this,function(Z,U){Graph.isCssFontUrl(U)?null==this.cachedGoogleFonts[U]?(R++,this.loadUrl(Graph.rewriteGoogleFontUrl(U),+mxUtils.bind(this,function(ba){this.cachedGoogleFonts[U]=ba;J.push(ba+"\n");R--;X()}),mxUtils.bind(this,function(ba){R--;J.push("@import url("+U+");\n");X()}))):J.push(this.cachedGoogleFonts[U]+"\n"):J.push('@font-face {font-family: "'+Z+'";src: url("'+U+'")}\n')})(y[aa].name,y[aa].url);X()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var y=document.getElementsByTagName("style"),J=0;J<y.length;J++){var R=mxUtils.getTextContent(y[J]);+0>R.indexOf("mxPageSelector")&&0<R.indexOf("MathJax")&&k[0].appendChild(y[J].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,y){y=null!=y?y:this.absoluteCssFonts(this.fontCss);if(null!=y){var J=mxUtils.getSvgDefs(k),R=y.split("\n");y=[];for(var X=[],aa=0;aa<R.length;aa++)"@import"==R[aa].substring(0,7)?y.push(R[aa]):X.push(R[aa]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<y.length&&+(mxUtils.setTextContent(k,y.join("\n")),J.appendChild(k));0<X.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,X.join("\n")),J.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,y,J){var R=mxClient.IS_FF?8192:16384;return Math.min(J,Math.min(R/k,R/y))};Editor.prototype.exportToCanvas=function(k,y,J,R,X,aa,Z,U,ba,fa,na,pa,ta,ua,Ca,Ba,Aa,Fa){try{aa=null!=aa?aa:!0;Z=null!=Z?Z:!0;pa=null!=+pa?pa:this.graph;ta=null!=ta?ta:0;var Sa=ba?null:pa.background;Sa==mxConstants.NONE&&(Sa=null);null==Sa&&(Sa=R);null==Sa&&0==ba&&(Sa="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(pa.getSvg(null,null,ta,ua,null,Z,null,null,null,fa,null,Ba,Aa,Fa),mxUtils.bind(this,function(La){try{La.style.setProperty("-webkit-font-smoothing","antialiased");La.style.setProperty("-moz-osx-font-smoothing","grayscale");var Pa=new Image;Pa.onload=mxUtils.bind(this,function(){try{var Ia=function(){mxClient.IS_SF?+window.setTimeout(function(){Ma.drawImage(Pa,0,0);k(za,La)},0):(Ma.drawImage(Pa,0,0),k(za,La))},za=document.createElement("canvas"),Ua=parseInt(La.getAttribute("width")),Qa=parseInt(La.getAttribute("height"));U=null!=U?U:1;null!=y&&(U=aa?Math.min(1,Math.min(3*y/(4*Qa),y/Ua)):y/Ua);U=this.getMaxCanvasScale(Ua,Qa,U);Ua=Math.ceil(U*Ua);Qa=Math.ceil(U*Qa);za.setAttribute("width",Ua);za.setAttribute("height",Qa);var Ma=za.getContext("2d");if(null!=Sa){var Na=mxUtils.getLightDarkColor(Sa);Ma.beginPath();+Ma.rect(0,0,Ua,Qa);Ma.fillStyle="dark"==Ba&&"none"!=pa.getAdaptiveColors()?Na.dark:Na.light;Ma.fill()}1!=U&&Ma.scale(U,U);if(Ca){var xa=pa.view,Za=xa.scale;xa.scale=1;var Oa=btoa(unescape(encodeURIComponent(xa.createSvgGrid(xa.gridColor))));xa.scale=Za;Oa="data:image/svg+xml;base64,"+Oa;var ra=pa.gridSize*xa.gridSteps*U,Da=pa.getGraphBounds(),Ra=xa.translate.x*Za,x=xa.translate.y*Za,N=Ra+(Da.x-Ra)/Za-ta,S=x+(Da.y-x)/Za-ta,Y=new Image;Y.onload=function(){try{for(var ca=-Math.round(ra-mxUtils.mod((Ra-+N)*U,ra)),ma=-Math.round(ra-mxUtils.mod((x-S)*U,ra));ca<Ua;ca+=ra)for(var qa=ma;qa<Qa;qa+=ra)Ma.drawImage(Y,ca/U,qa/U);Ia()}catch(wa){null!=X&&X(wa)}};Y.onerror=function(ca){null!=X&&X(ca)};Y.src=Oa}else Ia()}catch(ca){null!=X&&X(ca)}});Pa.onerror=function(Ia){null!=X&&X(Ia)};fa&&this.graph.addSvgShadow(La);this.graph.mathEnabled&&this.addMathCss(La);var db=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(La,this.resolvedFontCss),Pa.src=Editor.createSvgDataUri(mxUtils.getXml(La))}catch(Ia){null!=+X&&X(Ia)}});this.embedExtFonts(mxUtils.bind(this,function(Ia){try{null!=Ia&&this.addFontCss(La,Ia),this.loadFonts(db)}catch(za){null!=X&&X(za)}}))}catch(Ia){null!=X&&X(Ia)}}),J,na)}catch(La){null!=X&&X(La)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,C=0;8>C;C++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=p;Editor.updateCRC=function(k,y,J,R){for(var X=0;X<R;X++)k=Editor.crcTable[(k^y.charCodeAt(J+X))&255]^k>>>8;return k};Editor.crc32=function(k){for(var y=-1,J=0;J<k.length;J++)y=+y>>>8^Editor.crcTable[(y^k.charCodeAt(J))&255];return(y^-1)>>>0};Editor.writeGraphModelToPng=function(k,y,J,R,X){function aa(na,pa){var ta=ba;ba+=pa;return na.substring(ta,ba)}function Z(na){na=aa(na,4);return na.charCodeAt(3)+(na.charCodeAt(2)<<8)+(na.charCodeAt(1)<<16)+(na.charCodeAt(0)<<24)}function U(na){return String.fromCharCode(na>>24&255,na>>16&255,na>>8&255,na&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var ba=0;if(aa(k,8)!=String.fromCharCode(137)+"PNG"++String.fromCharCode(13,10,26,10))null!=X&&X();else if(aa(k,4),"IHDR"!=aa(k,4))null!=X&&X();else{aa(k,17);X=k.substring(0,ba);do{var fa=Z(k);if("IDAT"==aa(k,4)){X=k.substring(0,ba-8);"pHYs"==y&&"dpi"==J?(J=Math.round(R/.0254),J=U(J)+U(J)+String.fromCharCode(1)):J=J+String.fromCharCode(0)+("zTXt"==y?String.fromCharCode(0):"")+R;R=4294967295;R=Editor.updateCRC(R,y,0,4);R=Editor.updateCRC(R,J,0,J.length);X+=U(J.length)+y+J+U(R^4294967295);X+=k.substring(ba-8,k.length);break}X+=k.substring(ba-8,ba-4+fa);+aa(k,fa);aa(k,4)}while(fa);return"data:image/png;base64,"+(window.btoa?btoa(X):Base64.encode(X,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,y){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(k,y,J){var R=null;if(null!=J)return null;null!=k.editor.graph.getModel().getParent(y)?R=y.getId():null!=k.currentPage&&(R=k.currentPage.getId());return R});if(null!=window.StyleFormatPanel){var E=Format.prototype.init;Format.prototype.init=function(){E.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(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var L=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(k){k=L.apply(this,arguments);var y=this.editorUi,J=y.editor.graph;if(J.isEnabled()){var R=y.getCurrentFile();null!=R&&R.isAutosaveOptional()&&+k.appendChild(this.createOption(mxResources.get("autosave"),function(){return y.editor.autosave},function(aa){y.editor.setAutosave(aa);y.editor.autosave&&R.isModified()&&R.fileChanged()},{install:function(aa){this.listener=function(){aa(y.editor.autosave)};y.editor.addListener("autosaveChanged",this.listener)},destroy:function(){y.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&J.isEnabled()&&"undefined"!==typeof MathJax){var X=this.createOption(mxResources.get("mathematicalTypesetting"),+function(){return J.mathEnabled},function(aa){y.actions.get("mathematicalTypesetting").funct()},{install:function(aa){this.listener=function(){aa(J.mathEnabled)};y.addListener("mathEnabledChanged",this.listener)},destroy:function(){y.removeListener(this.listener)}});k.appendChild(X);(!y.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&X.appendChild(y.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};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.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];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(k){return"0"==mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(k){return"1"==mxUtils.getValue(k.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,isVisible:function(k){return"0"==+mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=+[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},+{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},+{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",+type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=+[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];+mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",+type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",+type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",+dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",@@ -3475,89 +3480,89 @@ stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#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;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));-c.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),k.customProperties,k))};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var x=this.editorUi.getSelectionState();1==x.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=x.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);g.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=-function(k,x,J,R){function Y(Na,Pa,oa,Da,Ca){if(null!=oa.valueChanged)oa.valueChanged(Pa,Ca,J,qa);else{ta.getModel().beginUpdate();try{Ca=[];var Ja=[];if(null!=oa.index){for(var Xa=[],ib=oa.parentRow.nextSibling;ib&&ib.getAttribute("data-pName")==Na;)Xa.push(ib.getAttribute("data-pValue")),ib=ib.nextSibling;oa.index<Xa.length?null!=Da?Xa.splice(Da,1):Xa[oa.index]=Pa:Xa.push(Pa);null!=oa.size&&Xa.length>oa.size&&(Xa=Xa.slice(0,oa.size));Pa=Xa.join(",");null!=oa.countProperty&&(ta.setCellStyles(oa.countProperty,-Xa.length,ta.getSelectionCells()),Ca.push(oa.countProperty),Ja.push(Xa.length))}ta.setCellStyles(Na,Pa,ta.getSelectionCells());Ca.push(Na);Ja.push(Pa);if(null!=oa.dependentProps)for(Na=0;Na<oa.dependentProps.length;Na++){var y=oa.dependentPropsDefVal[Na],P=oa.dependentPropsVals[Na];if(P.length>Pa)P=P.slice(0,Pa);else for(var S=P.length;S<Pa;S++)P.push(y);P=P.join(",");ta.setCellStyles(oa.dependentProps[Na],P,ta.getSelectionCells());Ca.push(oa.dependentProps[Na]);Ja.push(P)}if("function"==typeof oa.onChange)oa.onChange(ta,-Pa);qa.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Ca,"values",Ja,"cells",ta.getSelectionCells()))}finally{ta.getModel().endUpdate()}}}function Z(Na,Pa){Pa.style.left="0px";Pa.style.top="0px";Pa.style.position="relative";Pa.style.right="0px";Pa.style.bottom="0px";Pa.style.width="100%";Pa.style.maxWidth="100%";Pa.style.maxHeight="100%";Pa.style.textAlign="left"}function W(Na,Pa,oa){function Da(Ja){if(null==Ja||Ja==mxConstants.NONE)Ca.style.background="url('"+Dialog.prototype.noColorImage+-"')";else if("default"==Ja)Ca.style.background="";else{var Xa=mxUtils.getLightDarkColor(Ja);mxUtils.isLightDarkColor(Ja)&&Xa.light!=Xa.dark?Ca.style.background="linear-gradient(to right bottom, "+Xa.cssText+" 50%, "+mxUtils.invertLightDarkColor(Xa).cssText+" 50.3%)":Ca.style.background=Ja}}var Ca=document.createElement("div");Ca.style.width="32px";Ca.style.height="8px";Ca.style.margin="2px";Ca.style.borderStyle="solid";Ca.style.borderWidth="1px";Da(Pa);btn=mxUtils.button("",mxUtils.bind(qa,function(Ja){this.editorUi.pickColor(Pa,-function(Xa){Y(Na,Xa,oa);Da(Xa)});mxEvent.consume(Ja)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Ca);return btn}function U(Na,Pa,oa,Da,Ca,Ja,Xa){null!=Pa&&(Pa=Pa.split(","),ua.push({name:Na,values:Pa,type:oa,defVal:Da,countProperty:Ca,parentRow:Ja,isDeletable:!0,flipBkg:Xa}));btn=mxUtils.button("+",mxUtils.bind(qa,function(ib){for(var y=Ja,P=0;null!=y.nextSibling;)if(y.nextSibling.getAttribute("data-pName")==-Na)y=y.nextSibling,P++;else break;var S={type:oa,parentRow:Ja,index:P,isDeletable:!0,defVal:Da,countProperty:Ca};P=na(Na,"",S,0==P%2,Xa);Y(Na,Da,S);y.parentNode.insertBefore(P,y.nextSibling);mxEvent.consume(ib)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function aa(Na,Pa,oa,Da,Ca,Ja,Xa){if(0<Ca){var ib=Array(Ca);Pa=null!=Pa?Pa.split(","):[];for(var y=0;y<Ca;y++)ib[y]=null!=Pa[y]?Pa[y]:null!=Da?Da:"";ua.push({name:Na,values:ib,type:oa,defVal:Da,parentRow:Ja,-flipBkg:Xa,size:Ca})}return document.createElement("div")}function ia(Na,Pa,oa){var Da=document.createElement("input");Da.type="checkbox";Da.checked="1"==Pa;mxEvent.addListener(Da,"change",function(){Y(Na,Da.checked?"1":"0",oa,null,Da)});return Da}function na(Na,Pa,oa,Da,Ca){var Ja=oa.dispName,Xa=oa.type,ib=document.createElement("tr");ib.className="gePropRow"+(Ca?"Dark":"")+(Da?"Alt":"")+" gePropNonHeaderRow";ib.setAttribute("data-pName",Na);ib.setAttribute("data-pValue",Pa);Da=!1;null!=oa.index&&-(ib.setAttribute("data-index",oa.index),Ja=(null!=Ja?Ja:"")+"["+oa.index+"]",Da=!0);var y=document.createElement("td");y.className="gePropRowCell";Ja=mxResources.get(Ja,null,Ja);mxUtils.write(y,Ja);y.setAttribute("title",Ja);Da&&(y.style.textAlign="right");ib.appendChild(y);y=document.createElement("td");y.className="gePropRowCell";y.setAttribute("title",null!=Pa?decodeURIComponent(Pa):mxResources.get("none"));mxEvent.addListener(y,"click",mxUtils.bind(qa,function(ba){!mxUtils.isAncestorNode(ib,document.activeElement)&&-mxUtils.isAncestorNode(ib.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ba))}));if("color"==Xa)y.appendChild(W(Na,Pa,oa));else if("bool"==Xa||"boolean"==Xa)y.appendChild(ia(Na,Pa,oa));else if("enum"==Xa){var P=oa.enumList;y.innerHTML="";var S=document.createElement("div");S.className="gePropValue";y.appendChild(S);for(Ca=0;Ca<P.length;Ca++)if(Ja=P[Ca],Ja.val==Pa){mxUtils.write(S,mxResources.get(Ja.dispName,-null,Ja.dispName));break}mxEvent.addListener(y,"click",mxUtils.bind(qa,function(ba){var ma=mxEvent.getSource(ba);if(!(ma!=y&&ma!=S||mxEvent.isConsumed(ba))){S.innerHTML="";var ra=document.createElement("select"),wa=null;Z(y,ra);for(ba=0;ba<P.length;ba++){ma=P[ba];var sa=document.createElement("option");sa.value=mxUtils.htmlEntities(ma.val);mxUtils.write(sa,mxResources.get(ma.dispName,null,ma.dispName));ra.appendChild(sa);null==ma.val&&(sa.value="null",wa=sa)}ra.value=null==Pa&&null!=wa?"null":Pa;-S.appendChild(ra);mxEvent.addListener(ra,"change",function(){var xa=mxUtils.htmlEntities(ra.value);if(ra[ra.selectedIndex]==wa||"null"==xa.value)xa=null;Y(Na,xa,oa)});ra.focus();mxEvent.addListener(ra,"blur",function(){S.innerHTML="";for(var xa=0;xa<P.length;xa++){var Fa=P[xa];if(Fa.val==ra.value){mxUtils.write(S,mxResources.get(Fa.dispName,null,Fa.dispName));break}}})}}))}else if("dynamicArr"==Xa)y.appendChild(U(Na,Pa,oa.subType,oa.subDefVal,oa.countProperty,ib,Ca));else if("staticArr"==Xa)y.appendChild(aa(Na,-Pa,oa.subType,oa.subDefVal,oa.size,ib,Ca));else if("readOnly"==Xa)Ca=document.createElement("input"),Ca.setAttribute("readonly",""),Ca.value=Pa,Ca.style.borderWidth="0px","id"==Na||"shape"==Na?(ib.firstChild.innerHTML="",ib.firstChild.setAttribute("colspan","2"),Ca.style.flexGrow="1",Ca.style.marginLeft="4px",Ca.style.textAlign="id"==Na?"center":"left",Ca.setAttribute("title",Pa),Ja=document.createElement("div"),mxUtils.write(Ja,mxResources.get(Na)+":"),Ja.style.display="inline-flex",Ja.style.alignItems=-"center",Ja.style.width="100%",Ja.appendChild(Ca),ib.firstChild.appendChild(Ja)):(Ca.style.width="96px",y.appendChild(Ca));else{y.innerHTML="";var X=document.createElement("div");X.className="gePropValue";y.appendChild(X);X.innerHTML=mxUtils.htmlEntities(decodeURIComponent(Pa));mxEvent.addListener(y,"click",mxUtils.bind(qa,function(ba){function ma(){var sa=wa.value;sa=0==sa.length&&"string"!=Xa&&"numbers"!=Xa?0:sa;oa.allowAuto&&(null!=sa.trim&&"auto"==sa.trim().toLowerCase()?(sa="auto",Xa="string"):-(sa=parseFloat(sa),sa=isNaN(sa)?0:sa));null!=oa.min&&sa<oa.min?sa=oa.min:null!=oa.max&&sa>oa.max&&(sa=oa.max);var xa=null;try{xa="numbers"==Xa?sa.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==Xa?parseInt(sa):sa)+"")}catch(Fa){}Y(Na,xa,oa,null,wa)}var ra=mxEvent.getSource(ba);if(!(ra!=y&&ra!=X||mxEvent.isConsumed(ba))){X.innerHTML="";var wa=document.createElement("input");Z(X,wa);wa.value=decodeURIComponent(Pa);wa.className="gePropEditor";"int"!=Xa&&"float"!=Xa||oa.allowAuto||(wa.type=-"number",wa.step="int"==Xa?"1":"any",null!=oa.min&&(wa.min=parseFloat(oa.min)),null!=oa.max&&(wa.max=parseFloat(oa.max)));X.appendChild(wa);mxEvent.addListener(wa,"keypress",function(sa){13==sa.keyCode&&ma()});wa.focus();mxEvent.addListener(wa,"blur",function(){ma()})}}))}oa.isDeletable&&(Ca=mxUtils.button("-",mxUtils.bind(qa,function(ba){Y(Na,"",oa,oa.index);mxEvent.consume(ba)})),Ca.style.height="16px",Ca.style.width="25px",Ca.style.float="right",Ca.className="geColorBtn",y.appendChild(Ca));ib.appendChild(y);-return ib}var qa=this,ta=this.editorUi.editor.graph,ua=[],Ba=document.createElement("table");Ba.className="geProperties geFullWidthElement";var za=document.createElement("tr");za.className="gePropHeader";var Aa=document.createElement("th");Aa.className="gePropHeaderCell";Aa.style.paddingLeft="16px";Aa.style.backgroundRepeat="no-repeat";Aa.style.backgroundPosition="-2px 50%";Aa.style.backgroundSize="20px";mxUtils.write(Aa,mxResources.get("property"));za.style.cursor="pointer";var Ga=function(){var Na=-Ba.querySelectorAll(".gePropNonHeaderRow");if(qa.editorUi.propertiesCollapsed){Aa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Pa="none";for(var oa=k.childNodes.length-1;0<=oa;oa--)try{var Da=k.childNodes[oa],Ca=Da.nodeName.toUpperCase();"INPUT"!=Ca&&"SELECT"!=Ca||k.removeChild(Da)}catch(Ja){}}else Aa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Pa="";for(oa=0;oa<Na.length;oa++)Na[oa].style.display=Pa};mxEvent.addListener(za,"click",function(){qa.editorUi.propertiesCollapsed=-!qa.editorUi.propertiesCollapsed;Ga()});za.appendChild(Aa);var Ra=document.createElement("th");Ra.className="gePropHeaderCell";Ra.style.paddingLeft="4px";mxUtils.write(Ra,mxResources.get("value"));za.appendChild(Ra);Ba.appendChild(za);var Ha=Ra=!1;za=null;1==J.vertices.length&&0==J.edges.length?za=J.vertices[0].id:0==J.vertices.length&&1==J.edges.length&&(za=J.edges[0].id);null==za||R||(Ba.appendChild(na("id",mxUtils.htmlEntities(za),{dispName:"id",type:"readOnly"},!0,!1)),null!=J.style&&null!=J.style.shape&&-Ba.appendChild(na("shape",mxUtils.htmlEntities(J.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var Qa in x)if(R=x[Qa],("function"!=typeof R.isVisible||R.isVisible(J,this))&&!R.primary){var eb=null!=R.getValue?R.getValue(J,this):null!=J.style[Qa]?mxUtils.htmlEntities(J.style[Qa]+""):null!=R.getDefaultValue?R.getDefaultValue(J,this):R.defVal;if("separator"==R.type)Ha=!Ha;else{if("staticArr"==R.type)R.size=parseInt(J.style[R.sizeProperty]||x[R.sizeProperty].defVal)||0;else if(null!=R.dependentProps){var Ma=-R.dependentProps,ya=[],Sa=[];for(za=0;za<Ma.length;za++)if(null!=x[Ma[za]]){var Oa=J.style[Ma[za]];Sa.push(x[Ma[za]].subDefVal);ya.push(null!=Oa?Oa.split(","):[])}R.dependentPropsDefVal=Sa;R.dependentPropsVals=ya}Ba.appendChild(na(Qa,eb,R,Ra,Ha));Ra=!Ra}}for(za=0;za<ua.length;za++)for(R=ua[za],x=R.parentRow,Qa=0;Qa<R.values.length;Qa++)Ra=na(R.name,R.values[Qa],{type:R.type,parentRow:R.parentRow,isDeletable:R.isDeletable,index:Qa,defVal:R.defVal,countProperty:R.countProperty,size:R.size},0==Qa%2,-R.flipBkg),x.parentNode.insertBefore(Ra,x.nextSibling),x=Ra;k.appendChild(Ba);Ga();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var x=this.editorUi,J=x.editor.graph,R=document.createElement("div");R.style.padding="6px 20px 0 24px";k.appendChild(R);var Y=document.createElement("div");Y.className="geSwitcher";Y.style.padding="4px 18px 6px 0px";for(var Z=[],W=0;W<this.defaultColorSchemes.length;W++){var U=document.createElement("div");U.className="geSwitcherDot";-mxUtils.bind(this,function(ta){mxEvent.addListener(U,"click",mxUtils.bind(this,function(){aa(ta)}))})(W);Z.push(U);Y.appendChild(U)}var aa=mxUtils.bind(this,function(ta){null!=Z[ta]&&(null!=this.format.currentScheme&&null!=Z[this.format.currentScheme]&&(Z[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ta,ia(this.defaultColorSchemes[this.format.currentScheme]),Z[this.format.currentScheme].style.background="#84d7ff")}),ia=mxUtils.bind(this,function(ta){var ua=mxUtils.clone(J.defaultVertexStyle);-ua[mxConstants.STYLE_STROKECOLOR]=null!=ua[mxConstants.STYLE_STROKECOLOR]?ua[mxConstants.STYLE_STROKECOLOR]:"default";ua[mxConstants.STYLE_FILLCOLOR]=null!=ua[mxConstants.STYLE_FILLCOLOR]?ua[mxConstants.STYLE_FILLCOLOR]:"default";ua[mxConstants.STYLE_FONTCOLOR]=null!=ua[mxConstants.STYLE_FONTCOLOR]?ua[mxConstants.STYLE_FONTCOLOR]:"default";J.replaceDefaultColors(new mxCell,ua);var Ba=mxUtils.bind(this,function(Aa){var Ga=mxUtils.button("",mxUtils.bind(this,function(Qa){J.getModel().beginUpdate();-try{for(var eb=x.getSelectionState().cells,Ma=0;Ma<eb.length;Ma++){var ya=J.getModel().getStyle(eb[Ma]);null!=Aa?(mxEvent.isShiftDown(Qa)||(ya=""==Aa.fill||null==Aa.fill?mxUtils.setStyle(ya,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_FILLCOLOR,Aa.fill),ya=""==Aa.gradient||null==Aa.gradient?mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,Aa.gradient),mxEvent.isControlDown(Qa)||mxClient.IS_MAC&&mxEvent.isMetaDown(Qa)||-!J.getModel().isVertex(eb[Ma])||(ya=""==Aa.font||null==Aa.font?mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,Aa.font))),mxEvent.isAltDown(Qa)||(ya=""==Aa.stroke||null==Aa.fill?mxUtils.setStyle(ya,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_STROKECOLOR,Aa.stroke))):(ya=mxUtils.setStyle(ya,mxConstants.STYLE_FILLCOLOR,null),ya=mxUtils.setStyle(ya,mxConstants.STYLE_STROKECOLOR,null),ya=mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,-null),J.getModel().isVertex(eb[Ma])&&(ya=mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,null)));J.getModel().setStyle(eb[Ma],ya)}}finally{J.getModel().endUpdate()}}));Ga.className="geStyleButton";Ga.style.width="36px";Ga.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Ga.style.margin="0px 6px 6px 0px";if(null!=Aa){var Ra="1px solid";null!=Aa.border&&(Ra=Aa.border);if(null!=Aa.gradient)Ga.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(Aa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Aa.gradient).cssText+-" 100%)";else if(Aa.fill==mxConstants.NONE)Ga.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Aa.fill||""==Aa.fill)Ga.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ua,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Ha=mxUtils.getLightDarkColor(Aa.fill);Ga.style.backgroundImage="linear-gradient(to right bottom, "+Ha.cssText+" 50%, "+Ha.light+" 50.3%)"}null==Aa.stroke||Aa.stroke==mxConstants.NONE?Ga.style.border=Ra+" transparent":""==Aa.stroke?Ga.style.border=-"1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ua,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ha=mxUtils.getLightDarkColor(Aa.stroke),Ga.style.border=Ra+" "+Ha.cssText,Ga.style.borderRightColor=Ha.light,Ga.style.borderBottomColor=Ga.style.borderRightColor);null!=Aa.title&&Ga.setAttribute("title",Aa.title)}else Ra=mxUtils.getValue(ua,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Ha=mxUtils.getValue(ua,mxConstants.STYLE_STROKECOLOR,"#000000"),Ga.style.backgroundColor=Ra,Ga.style.border="1px solid "+-Ha;Ga.style.borderRadius="0";R.appendChild(Ga);null!=Aa&&null!=Aa.gradient&&(Ra=Ga.cloneNode(!1),Ra.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Aa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(Aa.gradient).light+") 100%)",Ra.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ra.style.backgroundColor="transparent",R.appendChild(Ra),Ra.style.marginLeft="-42px",mxEvent.addListener(Ra,"click",function(){Ga.click()}))});R.innerText=-"";if(null!=ta)for(var za=0;za<ta.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(R),Ba(ta[za])});null==this.format.currentScheme?aa(Math.min(Z.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):aa(this.format.currentScheme);W=10>=this.defaultColorSchemes.length?43:23;var na=document.createElement("div");na.className="geButton";na.style.cssText="position:absolute;left:0px;bottom:"+W+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(na,"click",mxUtils.bind(this,-function(){aa(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var qa=document.createElement("div");qa.className="geButton";qa.style.cssText="position:absolute;left:186px;bottom:"+W+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(na),k.appendChild(qa));mxEvent.addListener(qa,"click",mxUtils.bind(this,function(){aa(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));ia(this.defaultColorSchemes[this.format.currentScheme]);-10>=this.defaultColorSchemes.length&&k.appendChild(Y)}return k}}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(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=-function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.createFontElement=function(k,x){var J=Graph.fontMapping[x];null==J&&Graph.isCssFontUrl(x)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",-Graph.rewriteGoogleFontUrl(x))):(null==J&&(J='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+x+'");\n}'),k=document.createElement("style"),mxUtils.write(k,J));return k};Graph.addRecentCustomFont=function(k,x){};Graph.addFont=function(k,x,J,R){if(null!=k&&0<k.length&&null!=x&&0<x.length){R=null!=R?R:Graph.customFontElements;var Y=k.toLowerCase();if("helvetica"!=Y&&"arial"!=k&&"sans-serif"!=Y){var Z=R[Y];null!=Z&&Z.url!=x&&(Z.elt.parentNode.removeChild(Z.elt),Z=null);null==Z?(Z=x,"http:"==x.substring(0,-5)&&(Z=PROXY_URL+"?url="+encodeURIComponent(x)),Z={name:k,url:x,elt:Graph.createFontElement(k,Z)},R[Y]=Z,x=R==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=J&&("link"==Z.elt.nodeName.toLowerCase()?(Z.elt.onload=J,Z.elt.onerror=J):J()),null!=x&&x.appendChild(Z.elt)):null!=J&&J()}else null!=J&&J()}else null!=J&&J();return k};Graph.getFontUrl=function(k,x){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(x=k.url);return x};Graph.processFontAttributes=function(k){k=-k.getElementsByTagName("*");for(var x=0;x<k.length;x++){var J=k[x].getAttribute("data-font-src");if(null!=J){var R="FONT"==k[x].nodeName?k[x].getAttribute("face"):k[x].style.fontFamily;null!=R&&Graph.addFont(R,J)}}};Graph.processFontStyle=function(k){if(null!=k){var x=mxUtils.getValue(k,"fontSource",null);if(null!=x){var J=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=J)try{Graph.addFont(J,decodeURIComponent(x))}catch(R){}}}return k};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.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var l=Graph.prototype.init;Graph.prototype.init=function(){function k(Y){x=Y}l.apply(this,arguments);this.hiddenTags=-[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var x=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(Y){x=null});this.isMouseInsertPoint=function(){return null!=x};var J=this.getInsertPoint;this.getInsertPoint=function(Y){return null==x||Y?J.apply(this,arguments):this.getPointForEvent(x)};var R=this.layoutManager.getLayout;this.layoutManager.getLayout=function(Y){var Z=this.graph.getCellStyle(Y);-if(null!=Z&&"rack"==Z.childLayout){var W=new mxStackLayout(this.graph,!1);W.gridSize=null!=Z.rackUnitSize?parseFloat(Z.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;W.marginLeft=Z.marginLeft||0;W.marginRight=Z.marginRight||0;W.marginTop=Z.marginTop||0;W.marginBottom=Z.marginBottom||0;W.allowGaps=Z.allowGaps||0;W.horizontal="1"==mxUtils.getValue(Z,"horizontalRack","0");W.resizeParent=!1;W.fill=!0;return W}return R.apply(this,arguments)};this.updateGlobalUrlVariables()};-var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,x){return Graph.processFontStyle(t.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,x,J,R,Y,Z,W,U,aa,ia,na,qa){B.apply(this,arguments);Graph.processFontAttributes(qa)};var D=mxText.prototype.redraw;mxText.prototype.redraw=function(){D.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};-Graph.prototype.createTagsDialog=function(k,x,J,R){function Y(){for(var za=U.getSelectionCells(),Aa=[],Ga=0;Ga<za.length;Ga++)U.isCellVisible(za[Ga])&&Aa.push(za[Ga]);U.setSelectionCells(Aa)}function Z(za){U.setHiddenTags(za?[]:aa.slice());Y();U.refresh()}function W(za,Aa){na.innerText="";if(0<za.length){var Ga=document.createElement("table");Ga.setAttribute("cellpadding","2");Ga.style.boxSizing="border-box";Ga.style.tableLayout="fixed";Ga.style.width="100%";var Ra=document.createElement("tbody");-if(null!=za&&0<za.length)for(var Ha=0;Ha<za.length;Ha++)(function(Qa){function eb(){var Pa=U.getCellsForTags([Qa],null,null,!0);U.isEnabled()?U.setSelectionCells(Pa):U.highlightCells(Pa,null,null,70)}var Ma=0>mxUtils.indexOf(U.hiddenTags,Qa),ya=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Oa=document.createElement("img");Oa.setAttribute("src",Ma?Editor.visibleImage:Editor.hiddenImage);Oa.setAttribute("title",mxResources.get(Ma?"hideIt":-"show",[Qa]));mxUtils.setOpacity(Oa,Ma?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(x||Editor.isDarkMode())Oa.style.filter="invert(100%)";Sa.appendChild(Oa);mxEvent.addListener(Oa,"click",function(Pa){mxEvent.isShiftDown(Pa)?Z(0<=mxUtils.indexOf(U.hiddenTags,Qa)):(U.toggleHiddenTag(Qa),Y(),U.refresh());mxEvent.consume(Pa)});ya.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Oa=-document.createElement("img");Oa.setAttribute("src",Editor.selectImage);Oa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Oa,Ma?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(x||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Pa){Z(!0);eb();mxEvent.consume(Pa)});Sa.appendChild(Oa);ya.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace=-"nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",Qa);a=document.createElement("a");mxUtils.write(a,Qa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Ma?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(Pa){if(mxEvent.isShiftDown(Pa))Z(!0),eb();else if(Ma&&0<U.hiddenTags.length)Z(!0);else{var oa=aa.slice(),Da=mxUtils.indexOf(oa,Qa);oa.splice(Da,1);U.setHiddenTags(oa);Y();U.refresh()}mxEvent.consume(Pa)});-ya.appendChild(Sa);if(U.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==Aa){Sa.style.align="center";Sa.style.width="16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.trashImage);Oa.setAttribute("title",mxResources.get("removeIt",[Qa]));mxUtils.setOpacity(Oa,Ma?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(x||Editor.isDarkMode())Oa.style.filter=-"invert(100%)";mxEvent.addListener(Oa,"click",function(Pa){var oa=mxUtils.indexOf(aa,Qa);0<=oa&&aa.splice(oa,1);U.removeTagsForCells(U.model.getDescendants(U.model.getRoot()),[Qa]);U.refresh();mxEvent.consume(Pa)});Sa.appendChild(Oa)}else{var Na=document.createElement("input");Na.setAttribute("type","checkbox");Na.style.margin="0px";Na.defaultChecked=null!=Aa&&0<=mxUtils.indexOf(Aa,Qa);Na.checked=Na.defaultChecked;Na.style.background="transparent";Na.setAttribute("title",mxResources.get(Na.defaultChecked?-"removeIt":"add",[Qa]));mxEvent.addListener(Na,"change",function(Pa){Na.checked?U.addTagsForCells(U.getSelectionCells(),[Qa]):U.removeTagsForCells(U.getSelectionCells(),[Qa]);mxEvent.consume(Pa)});Sa.appendChild(Na)}ya.appendChild(Sa)}Ra.appendChild(ya)})(za[Ha]);Ga.appendChild(Ra);na.appendChild(Ga)}}var U=this,aa=U.hiddenTags.slice(),ia=document.createElement("div");ia.style.userSelect="none";ia.style.overflow="hidden";ia.style.padding="10px";ia.style.height="100%";var na=document.createElement("div");-na.style.position="absolute";na.style.boxSizing="border-box";na.style.userSelect="none";na.style.overflow="auto";na.style.padding="3px";na.style.left="0px";na.style.right="0px";na.style.top="0px";na.style.bottom="0px";ia.appendChild(na);U.addListener(mxEvent.ROOT,function(){aa=U.hiddenTags.slice()});var qa=mxUtils.bind(this,function(za,Aa){if(k()){za=U.getAllTags();for(Aa=0;Aa<za.length;Aa++)0>mxUtils.indexOf(aa,za[Aa])&&aa.push(za[Aa]);aa.sort();U.isSelectionEmpty()?W(aa):W(aa,U.getCommonTagsForCells(U.getSelectionCells()))}});-U.selectionModel.addListener(mxEvent.CHANGE,qa);U.model.addListener(mxEvent.CHANGE,qa);U.addListener(mxEvent.REFRESH,qa);var ta=document.createElement("div");ta.className="geToolbarContainer geDialogToolbar";ta.style.position="absolute";ta.style.display="flex";ta.style.bottom="0px";ta.style.left="0px";ta.style.right="0px";ta.style.height="32px";ta.style.overflow="hidden";ta.style.padding="3px 4px 4px 4px";ta.style.borderWidth="1px 0px 0px 0px";ta.style.borderStyle="solid";ta.style.whiteSpace="nowrap";-if(U.isEnabled()){na.style.bottom="32px";var ua=document.createElement("a");ua.className="geButton";var Ba=ua.cloneNode(!1);Ba.style.backgroundImage="url("+Editor.visibleImage+")";Ba.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Ba,"click",function(za){U.setHiddenTags([]);mxEvent.isShiftDown(za)||(aa=U.hiddenTags.slice());Y();U.refresh();mxEvent.consume(za)});ta.appendChild(Ba);null!=J&&(ua=ua.cloneNode(!1),ua.style.backgroundImage="url("+Editor.plusImage+")",ua.setAttribute("title",-mxResources.get("add")),mxEvent.addListener(ua,"click",function(za){J(aa,function(Aa){aa=Aa;qa()});mxEvent.consume(za)}),ta.appendChild(ua));ia.appendChild(ta)}null!=R&&ta.appendChild(R);return{div:ia,refresh:qa}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var x in Graph.customFontElements){var J=Graph.customFontElements[x];k.push({name:J.name,url:J.url})}return k};Graph.prototype.setFont=function(k,x){Graph.addFont(k,x);var J=Editor.guid();document.execCommand("fontname",-!1,J);for(var R=this.cellEditor.textarea.getElementsByTagName("font"),Y=!1,Z=0;Z<R.length;Z++)R[Z].getAttribute("face")==J&&(Y=!0,R[Z].setAttribute("face",k),null!=x?R[Z].setAttribute("data-font-src",x):R[Z].removeAttribute("data-font-src"));Y||document.execCommand("fontname",!1,k)};var I=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return I.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 k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var x in k)this.globalVars[x]=k[x]}catch(J){null!=window.console&&console.log("Error in vars URL parameter: "+J)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var x=-L.apply(this,arguments);null==x&&null!=this.globalVars&&(x=this.globalVars[k]);return x};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var N=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,x,J,R,Y,Z,W,U,aa,ia,na,qa,ta,ua,Ba,za){var Aa=N.apply(this,arguments);if(null!=-qa){var Ga=Aa.getAttribute("style");null==Ga&&(Ga="");qa="auto"==qa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":qa;Aa.setAttribute("style",Ga+(" color-scheme: "+qa+";"))}var Ra=this.getCustomFonts();if(na&&0<Ra.length){var Ha=Aa.ownerDocument;Ga=null!=Ha.createElementNS?Ha.createElementNS(mxConstants.NS_SVG,"style"):Ha.createElement("style");null!=Ha.setAttributeNS?Ga.setAttributeNS("type","text/css"):Ga.setAttribute("type","text/css");for(var Qa="",eb=-"",Ma=0;Ma<Ra.length;Ma++){var ya=Ra[Ma].name,Sa=Ra[Ma].url;Graph.isCssFontUrl(Sa)?Qa+="@import url("+Graph.rewriteGoogleFontUrl(Sa)+");\n":eb+='@font-face {\nfont-family: "'+ya+'";\nsrc: url("'+Sa+'");\n}\n'}Ga.appendChild(Ha.createTextNode(Qa+eb));Aa.getElementsByTagName("defs")[0].appendChild(Ga)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Aa);this.mathEnabled&&(document.body.appendChild(Aa),Editor.MathJaxRender(Aa),Aa.parentNode.removeChild(Aa),-Ga=Aa.ownerDocument.getElementById("MJX-SVG-styles"),null!=Ga&&Aa.getElementsByTagName("defs")[0].appendChild(Ga.cloneNode(!0)));return Aa};var K=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){K.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var da=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=-function(){da.apply(this,arguments);this.enumerationState=0};var ja=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ja.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+-"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var x="1"==mxUtils.getValue(k.style,"enumerate",0);x&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):x||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);x=k.secondLabel;if(null!=x){var J=k.view.scale,-R=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*J,k.y+4*J,0,0):mxRectangle.fromPoint(k.view.getPoint(k));x.bounds.equals(k)&&x.value==R&&x.scale==J||(x.bounds=k,x.value=R,x.scale=J,x.redraw())}};var ea=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();ea.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),-this.view.validateBackgroundImage())};var ca=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){ca.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,x){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&this.executeCustomActions(k.actions,null,x))};Graph.prototype.executeCustomActions=function(k,x,J){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 R=!1,Y=0,Z=0,W=mxUtils.bind(this,function(){R||(R=!0,this.model.beginUpdate())}),U=mxUtils.bind(this,function(){R&&(R=!1,this.model.endUpdate())}),aa=mxUtils.bind(this,function(){0<Y&&Y--;0==Y&&ia()}),ia=mxUtils.bind(this,function(){if(Z<k.length){var na=this.stoppingCustomActions,qa=-k[Z++],ta=[];if(null!=qa.open)if(U(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,J))return}else this.openLink(qa.open);null==qa.wait||na||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;aa()}),Y++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),U());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,-!0)),qa.opacity.value);null!=qa.fadeIn&&(Y++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,aa,na?0:qa.fadeIn.delay));null!=qa.fadeOut&&(Y++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,!0)),1,0,aa,na?0:qa.fadeOut.delay));null!=qa.wipeIn&&(ta=ta.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,!0),!0)));null!=qa.wipeOut&&(ta=ta.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.toggle&&-(W(),this.toggleCells(this.getCellsForAction(qa.toggle,!0)));if(null!=qa.show){W();var ua=this.getCellsForAction(qa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ua),1);this.setCellsVisible(ua,!0)}null!=qa.hide&&(W(),ua=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ua),0),this.setCellsVisible(ua,!1));null!=qa.toggleStyle&&null!=qa.toggleStyle.key&&(W(),this.toggleCellStyles(qa.toggleStyle.key,null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:-"0",this.getCellsForAction(qa.toggleStyle,!0)));null!=qa.style&&null!=qa.style.key&&(W(),this.setCellStyles(qa.style.key,qa.style.value,this.getCellsForAction(qa.style,!0)));ua=[];null!=qa.select&&this.isEnabled()&&(ua=this.getCellsForAction(qa.select),this.setSelectionCells(ua));null!=qa.highlight&&(ua=this.getCellsForAction(qa.highlight),this.highlightCells(ua,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ua=this.getCellsForAction(qa.scroll));null!=qa.viewbox&&-this.fitWindow(qa.viewbox,qa.viewbox.border);0<ua.length&&this.scrollCellToVisible(ua[0]);null!=J&&null!=qa.explore&&Graph.exploreFromCell(this,J,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle){var Ba=qa.tags.toggle;0==Ba.length&&(Ba=this.getAllTags());for(ua=0;ua<Ba.length;ua++)this.toggleHiddenTag(Ba[ua])}Ba=null;null!=qa.tags.hidden&&(null==Ba&&(Ba=[]),Ba=Ba.concat(qa.tags.hidden));if(null!=qa.tags.visible){null==Ba&&(Ba=[]);var za=this.getAllTags();for(ua=0;ua<za.length;ua++)0>mxUtils.indexOf(qa.tags.visible,-za[ua])&&0>mxUtils.indexOf(Ba,za[ua])&&Ba.push(za[ua])}null!=Ba&&this.setHiddenTags(Ba);this.refresh()}0<ta.length&&(Y++,this.executeAnimations(ta,aa,na?1:qa.steps,na?0:qa.delay));0==Y?ia():U()}else this.stoppingCustomActions=this.executingCustomActions=!1,U(),null!=x&&x()});ia()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,x){var J=this.getLinkForCell(x);null!=J&&"data:action/json,"==J.substring(0,17)&&this.setLinkForCell(x,this.updateCustomLink(k,J));if(this.isHtmlLabel(x)){var R=document.createElement("div");-R.innerHTML=Graph.sanitizeHtml(this.getLabel(x));for(var Y=R.getElementsByTagName("a"),Z=!1,W=0;W<Y.length;W++)J=Y[W].getAttribute("href"),null!=J&&"data:action/json,"==J.substring(0,17)&&(Y[W].setAttribute("href",this.updateCustomLink(k,J)),Z=!0);Z&&this.labelChanged(x,R.innerHTML)}};Graph.prototype.updateCustomLink=function(k,x){if("data:action/json,"==x.substring(0,17))try{var J=JSON.parse(x.substring(17));null!=J.actions&&(this.updateCustomLinkActions(k,J.actions),x="data:action/json,"+JSON.stringify(J))}catch(R){}return x};-Graph.prototype.updateCustomLinkActions=function(k,x){for(var J=0;J<x.length;J++){var R=x[J],Y;for(Y in R)this.updateCustomLinkAction(k,R[Y],"cells"),this.updateCustomLinkAction(k,R[Y],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,x,J){if(null!=x&&null!=x[J]){for(var R=[],Y=0;Y<x[J].length;Y++)if("*"==x[J][Y])R.push(x[J][Y]);else{var Z=k[x[J][Y]];null!=Z?""!=Z&&R.push(Z):R.push(x[J][Y])}x[J]=R}};Graph.prototype.getCellsForAction=function(k,x){x=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,-null,x));if(null!=k.excludeCells){for(var J=[],R=0;R<x.length;R++)0>k.excludeCells.indexOf(x[R].id)&&J.push(x[R]);x=J}return x};Graph.prototype.getCellsById=function(k){var x=[];if(null!=k)for(var J=0;J<k.length;J++)if("*"==k[J]){var R=this.model.getRoot();x=x.concat(this.model.filterDescendants(function(Z){return Z!=R},R))}else{var Y=this.model.getCell(k[J]);null!=Y&&x.push(Y)}return x};var fa=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return fa.apply(this,arguments)&&-!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var x=mxUtils.indexOf(this.hiddenTags,k);0>x?this.hiddenTags.push(k):0<=x&&this.hiddenTags.splice(x,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;-for(var x=0;x<k.length;x++)if(0>mxUtils.indexOf(this.hiddenTags,k[x]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,x,J,R){var Y=[];if(null!=k){x=null!=x?x:this.model.getDescendants(this.model.getRoot());for(var Z=0,W={},U=0;U<k.length;U++)0<k[U].length&&(W[k[U]]=!0,Z++);for(U=0;U<x.length;U++)if(J&&this.model.getParent(x[U])==this.model.root||this.model.isVertex(x[U])||this.model.isEdge(x[U])){var aa=this.getTagsForCell(x[U]),ia=!1;if(0<aa.length&&(aa=aa.split(" "),aa.length>=k.length)){for(var na=-ia=0;na<aa.length&&ia<Z;na++)null!=W[aa[na]]&&ia++;ia=ia==Z}ia&&(1!=R||this.isCellVisible(x[U]))&&Y.push(x[U])}}return Y};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var x=null,J=[],R=0;R<k.length;R++){var Y=this.getTagsForCell(k[R]);J=[];if(0<Y.length){Y=Y.split(" ");for(var Z={},W=0;W<Y.length;W++)if(null==x||null!=x[Y[W]])Z[Y[W]]=!0,J.push(Y[W]);x=Z}else return[]}return J};-Graph.prototype.getTagsForCells=function(k){for(var x=[],J={},R=0;R<k.length;R++){var Y=this.getTagsForCell(k[R]);if(0<Y.length){Y=Y.split(" ");for(var Z=0;Z<Y.length;Z++)null==J[Y[Z]]&&(J[Y[Z]]=!0,x.push(Y[Z]))}}return x};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,x){if(0<k.length&&0<x.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){for(var R=this.getTagsForCell(k[J]),Y=R.split(" "),Z=!1,W=0;W<-x.length;W++){var U=mxUtils.trim(x[W]);""!=U&&0>mxUtils.indexOf(Y,U)&&(R=0<R.length?R+" "+U:U,Z=!0)}Z&&this.setAttributeForCell(k[J],"tags",R)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,x){if(0<k.length&&0<x.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){var R=this.getTagsForCell(k[J]);if(0<R.length){for(var Y=R.split(" "),Z=!1,W=0;W<x.length;W++){var U=mxUtils.indexOf(Y,x[W]);0<=U&&(Y.splice(U,1),Z=!0)}Z&&this.setAttributeForCell(k[J],"tags",-Y.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var x=0;x<k.length;x++)this.model.setVisible(k[x],!this.model.isVisible(k[x]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,x){this.model.beginUpdate();try{for(var J=0;J<k.length;J++)this.model.setVisible(k[J],x)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,x,J,R){for(var Y=0;Y<k.length;Y++)this.highlightCell(k[Y],x,-J,R)};Graph.prototype.highlightCell=function(k,x,J,R,Y){x=null!=x?x:mxConstants.DEFAULT_VALID_COLOR;J=null!=J?J:1E3;k=this.view.getState(k);var Z=null;null!=k&&(Y=null!=Y?Y:4,Y=Math.max(Y+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+Y),Z=new mxCellHighlight(this,x,Y,!1),null!=R&&(Z.opacity=R),Z.highlight(k),window.setTimeout(function(){null!=Z.shape&&(mxUtils.setPrefixedStyle(Z.shape.node.style,"transition","all 1200ms ease-in-out"),Z.shape.node.style.opacity=0);window.setTimeout(function(){Z.destroy()},-1200)},J));return Z};Graph.prototype.addSvgShadow=function(k,x,J,R){R=null!=R?R:!0;var Y=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=J&&J||(x=null!=x?x:k.getElementsByTagName("g")[0],null!=x&&(this.updateShadowFilter(x,!0),!isNaN(parseInt(k.getAttribute("width")))&&R&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+Y),k.setAttribute("height",parseInt(k.getAttribute("height"))+Y),x=k.getAttribute("viewBox"),null!=x&&0<x.length&&(x=x.split(" "),3<x.length&&(w=parseFloat(x[2])+Y,-h=parseFloat(x[3])+Y,k.setAttribute("viewBox",x[0]+" "+x[1]+" "+w+" "+h))))));return Y};Graph.prototype.updateShadowFilter=function(k,x){mxClient.IS_SF||(x?(x=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+x.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,x){x=null!=x?x:!0;this.shadowVisible=-k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);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 k=this.model.getChildCount(this.model.root),x=0;do var J=this.model.getChildAt(this.model.root,x);while(x++<k&&"1"==mxUtils.getValue(this.getCellStyle(J),+c.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),k.customProperties,k))};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var y=this.editorUi.getSelectionState();1==y.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=y.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);g.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=+function(k,y,J,R){function X(Ma,Na,xa,Za,Oa){if(null!=xa.valueChanged)xa.valueChanged(Na,Oa,J,pa);else{ta.getModel().beginUpdate();try{Oa=[];var ra=[];if(null!=xa.index){for(var Da=[],Ra=xa.parentRow.nextSibling;Ra&&Ra.getAttribute("data-pName")==Ma;)Da.push(Ra.getAttribute("data-pValue")),Ra=Ra.nextSibling;xa.index<Da.length?null!=Za?Da.splice(Za,1):Da[xa.index]=Na:Da.push(Na);null!=xa.size&&Da.length>xa.size&&(Da=Da.slice(0,xa.size));Na=Da.join(",");null!=xa.countProperty&&(ta.setCellStyles(xa.countProperty,+Da.length,ta.getSelectionCells()),Oa.push(xa.countProperty),ra.push(Da.length))}ta.setCellStyles(Ma,Na,ta.getSelectionCells());Oa.push(Ma);ra.push(Na);if(null!=xa.dependentProps)for(Ma=0;Ma<xa.dependentProps.length;Ma++){var x=xa.dependentPropsDefVal[Ma],N=xa.dependentPropsVals[Ma];if(N.length>Na)N=N.slice(0,Na);else for(var S=N.length;S<Na;S++)N.push(x);N=N.join(",");ta.setCellStyles(xa.dependentProps[Ma],N,ta.getSelectionCells());Oa.push(xa.dependentProps[Ma]);ra.push(N)}if("function"==typeof xa.onChange)xa.onChange(ta,+Na);pa.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Oa,"values",ra,"cells",ta.getSelectionCells()))}finally{ta.getModel().endUpdate()}}}function aa(Ma,Na){Na.style.left="0px";Na.style.top="0px";Na.style.position="relative";Na.style.right="0px";Na.style.bottom="0px";Na.style.width="100%";Na.style.maxWidth="100%";Na.style.maxHeight="100%";Na.style.textAlign="left"}function Z(Ma,Na,xa){function Za(ra){if(null==ra||ra==mxConstants.NONE)Oa.style.background="url('"+Dialog.prototype.noColorImage++"')";else if("default"==ra)Oa.style.background="";else{var Da=mxUtils.getLightDarkColor(ra);mxUtils.isLightDarkColor(ra)&&Da.light!=Da.dark?Oa.style.background="linear-gradient(to right bottom, "+Da.cssText+" 50%, "+mxUtils.invertLightDarkColor(Da).cssText+" 50.3%)":Oa.style.background=ra}}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";Za(Na);btn=mxUtils.button("",mxUtils.bind(pa,function(ra){this.editorUi.pickColor(Na,+function(Da){X(Ma,Da,xa);Za(Da)});mxEvent.consume(ra)}));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(Ma,Na,xa,Za,Oa,ra,Da){null!=Na&&(Na=Na.split(","),ua.push({name:Ma,values:Na,type:xa,defVal:Za,countProperty:Oa,parentRow:ra,isDeletable:!0,flipBkg:Da}));btn=mxUtils.button("+",mxUtils.bind(pa,function(Ra){for(var x=ra,N=0;null!=x.nextSibling;)if(x.nextSibling.getAttribute("data-pName")==+Ma)x=x.nextSibling,N++;else break;var S={type:xa,parentRow:ra,index:N,isDeletable:!0,defVal:Za,countProperty:Oa};N=na(Ma,"",S,0==N%2,Da);X(Ma,Za,S);x.parentNode.insertBefore(N,x.nextSibling);mxEvent.consume(Ra)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ba(Ma,Na,xa,Za,Oa,ra,Da){if(0<Oa){var Ra=Array(Oa);Na=null!=Na?Na.split(","):[];for(var x=0;x<Oa;x++)Ra[x]=null!=Na[x]?Na[x]:null!=Za?Za:"";ua.push({name:Ma,values:Ra,type:xa,defVal:Za,parentRow:ra,+flipBkg:Da,size:Oa})}return document.createElement("div")}function fa(Ma,Na,xa){var Za=document.createElement("input");Za.type="checkbox";Za.checked="1"==Na;mxEvent.addListener(Za,"change",function(){X(Ma,Za.checked?"1":"0",xa,null,Za)});return Za}function na(Ma,Na,xa,Za,Oa){var ra=xa.dispName,Da=xa.type,Ra=document.createElement("tr");Ra.className="gePropRow"+(Oa?"Dark":"")+(Za?"Alt":"")+" gePropNonHeaderRow";Ra.setAttribute("data-pName",Ma);Ra.setAttribute("data-pValue",Na);Za=!1;null!=xa.index&&+(Ra.setAttribute("data-index",xa.index),ra=(null!=ra?ra:"")+"["+xa.index+"]",Za=!0);var x=document.createElement("td");x.className="gePropRowCell";ra=mxResources.get(ra,null,ra);mxUtils.write(x,ra);x.setAttribute("title",ra);Za&&(x.style.textAlign="right");Ra.appendChild(x);x=document.createElement("td");x.className="gePropRowCell";x.setAttribute("title",null!=Na?decodeURIComponent(Na):mxResources.get("none"));mxEvent.addListener(x,"click",mxUtils.bind(pa,function(ca){!mxUtils.isAncestorNode(Ra,document.activeElement)&&+mxUtils.isAncestorNode(Ra.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ca))}));if("color"==Da)x.appendChild(Z(Ma,Na,xa));else if("bool"==Da||"boolean"==Da)x.appendChild(fa(Ma,Na,xa));else if("enum"==Da){var N=xa.enumList;x.innerHTML="";var S=document.createElement("div");S.className="gePropValue";x.appendChild(S);for(Oa=0;Oa<N.length;Oa++)if(ra=N[Oa],ra.val==Na){mxUtils.write(S,mxResources.get(ra.dispName,+null,ra.dispName));break}mxEvent.addListener(x,"click",mxUtils.bind(pa,function(ca){var ma=mxEvent.getSource(ca);if(!(ma!=x&&ma!=S||mxEvent.isConsumed(ca))){S.innerHTML="";var qa=document.createElement("select"),wa=null;aa(x,qa);for(ca=0;ca<N.length;ca++){ma=N[ca];var sa=document.createElement("option");sa.value=mxUtils.htmlEntities(ma.val);mxUtils.write(sa,mxResources.get(ma.dispName,null,ma.dispName));qa.appendChild(sa);null==ma.val&&(sa.value="null",wa=sa)}qa.value=null==Na&&null!=wa?"null":Na;+S.appendChild(qa);mxEvent.addListener(qa,"change",function(){var ya=mxUtils.htmlEntities(qa.value);if(qa[qa.selectedIndex]==wa||"null"==ya.value)ya=null;X(Ma,ya,xa)});qa.focus();mxEvent.addListener(qa,"blur",function(){S.innerHTML="";for(var ya=0;ya<N.length;ya++){var Ga=N[ya];if(Ga.val==qa.value){mxUtils.write(S,mxResources.get(Ga.dispName,null,Ga.dispName));break}}})}}))}else if("dynamicArr"==Da)x.appendChild(U(Ma,Na,xa.subType,xa.subDefVal,xa.countProperty,Ra,Oa));else if("staticArr"==Da)x.appendChild(ba(Ma,+Na,xa.subType,xa.subDefVal,xa.size,Ra,Oa));else if("readOnly"==Da)Oa=document.createElement("input"),Oa.setAttribute("readonly",""),Oa.value=Na,Oa.style.borderWidth="0px","id"==Ma||"shape"==Ma?(Ra.firstChild.innerHTML="",Ra.firstChild.setAttribute("colspan","2"),Oa.style.flexGrow="1",Oa.style.marginLeft="4px",Oa.style.textAlign="id"==Ma?"center":"left",Oa.setAttribute("title",Na),ra=document.createElement("div"),mxUtils.write(ra,mxResources.get(Ma)+":"),ra.style.display="inline-flex",ra.style.alignItems=+"center",ra.style.width="100%",ra.appendChild(Oa),Ra.firstChild.appendChild(ra)):(Oa.style.width="96px",x.appendChild(Oa));else{x.innerHTML="";var Y=document.createElement("div");Y.className="gePropValue";x.appendChild(Y);Y.innerHTML=mxUtils.htmlEntities(decodeURIComponent(Na));mxEvent.addListener(x,"click",mxUtils.bind(pa,function(ca){function ma(){var sa=wa.value;sa=0==sa.length&&"string"!=Da&&"numbers"!=Da?0:sa;xa.allowAuto&&(null!=sa.trim&&"auto"==sa.trim().toLowerCase()?(sa="auto",Da="string"):+(sa=parseFloat(sa),sa=isNaN(sa)?0:sa));null!=xa.min&&sa<xa.min?sa=xa.min:null!=xa.max&&sa>xa.max&&(sa=xa.max);var ya=null;try{ya="numbers"==Da?sa.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==Da?parseInt(sa):sa)+"")}catch(Ga){}X(Ma,ya,xa,null,wa)}var qa=mxEvent.getSource(ca);if(!(qa!=x&&qa!=Y||mxEvent.isConsumed(ca))){Y.innerHTML="";var wa=document.createElement("input");aa(Y,wa);wa.value=decodeURIComponent(Na);wa.className="gePropEditor";"int"!=Da&&"float"!=Da||xa.allowAuto||(wa.type=+"number",wa.step="int"==Da?"1":"any",null!=xa.min&&(wa.min=parseFloat(xa.min)),null!=xa.max&&(wa.max=parseFloat(xa.max)));Y.appendChild(wa);mxEvent.addListener(wa,"keypress",function(sa){13==sa.keyCode&&ma()});wa.focus();mxEvent.addListener(wa,"blur",function(){ma()})}}))}xa.isDeletable&&(Oa=mxUtils.button("-",mxUtils.bind(pa,function(ca){X(Ma,"",xa,xa.index);mxEvent.consume(ca)})),Oa.style.height="16px",Oa.style.width="25px",Oa.style.float="right",Oa.className="geColorBtn",x.appendChild(Oa));Ra.appendChild(x);+return Ra}var pa=this,ta=this.editorUi.editor.graph,ua=[],Ca=document.createElement("table");Ca.className="geProperties geFullWidthElement";var Ba=document.createElement("tr");Ba.className="gePropHeader";var Aa=document.createElement("th");Aa.className="gePropHeaderCell";Aa.style.paddingLeft="16px";Aa.style.backgroundRepeat="no-repeat";Aa.style.backgroundPosition="-2px 50%";Aa.style.backgroundSize="20px";mxUtils.write(Aa,mxResources.get("property"));Ba.style.cursor="pointer";var Fa=function(){var Ma=+Ca.querySelectorAll(".gePropNonHeaderRow");if(pa.editorUi.propertiesCollapsed){Aa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Na="none";for(var xa=k.childNodes.length-1;0<=xa;xa--)try{var Za=k.childNodes[xa],Oa=Za.nodeName.toUpperCase();"INPUT"!=Oa&&"SELECT"!=Oa||k.removeChild(Za)}catch(ra){}}else Aa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Na="";for(xa=0;xa<Ma.length;xa++)Ma[xa].style.display=Na};mxEvent.addListener(Ba,"click",function(){pa.editorUi.propertiesCollapsed=+!pa.editorUi.propertiesCollapsed;Fa()});Ba.appendChild(Aa);var Sa=document.createElement("th");Sa.className="gePropHeaderCell";Sa.style.paddingLeft="4px";mxUtils.write(Sa,mxResources.get("value"));Ba.appendChild(Sa);Ca.appendChild(Ba);var La=Sa=!1;Ba=null;1==J.vertices.length&&0==J.edges.length?Ba=J.vertices[0].id:0==J.vertices.length&&1==J.edges.length&&(Ba=J.edges[0].id);null==Ba||R||(Ca.appendChild(na("id",mxUtils.htmlEntities(Ba),{dispName:"id",type:"readOnly"},!0,!1)),null!=J.style&&null!=J.style.shape&&+Ca.appendChild(na("shape",mxUtils.htmlEntities(J.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var Pa in y)if(R=y[Pa],("function"!=typeof R.isVisible||R.isVisible(J,this))&&!R.primary){var db=null!=R.getValue?R.getValue(J,this):null!=J.style[Pa]?mxUtils.htmlEntities(J.style[Pa]+""):null!=R.getDefaultValue?R.getDefaultValue(J,this):R.defVal;if("separator"==R.type)La=!La;else{if("staticArr"==R.type)R.size=parseInt(J.style[R.sizeProperty]||y[R.sizeProperty].defVal)||0;else if(null!=R.dependentProps){var Ia=+R.dependentProps,za=[],Ua=[];for(Ba=0;Ba<Ia.length;Ba++)if(null!=y[Ia[Ba]]){var Qa=J.style[Ia[Ba]];Ua.push(y[Ia[Ba]].subDefVal);za.push(null!=Qa?Qa.split(","):[])}R.dependentPropsDefVal=Ua;R.dependentPropsVals=za}Ca.appendChild(na(Pa,db,R,Sa,La));Sa=!Sa}}for(Ba=0;Ba<ua.length;Ba++)for(R=ua[Ba],y=R.parentRow,Pa=0;Pa<R.values.length;Pa++)Sa=na(R.name,R.values[Pa],{type:R.type,parentRow:R.parentRow,isDeletable:R.isDeletable,index:Pa,defVal:R.defVal,countProperty:R.countProperty,size:R.size},0==Pa%2,+R.flipBkg),y.parentNode.insertBefore(Sa,y.nextSibling),y=Sa;k.appendChild(Ca);Fa();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var y=this.editorUi,J=y.editor.graph,R=document.createElement("div");R.style.padding="6px 20px 0 24px";k.appendChild(R);var X=document.createElement("div");X.className="geSwitcher";X.style.padding="4px 18px 6px 0px";for(var aa=[],Z=0;Z<this.defaultColorSchemes.length;Z++){var U=document.createElement("div");U.className="geSwitcherDot";+mxUtils.bind(this,function(ta){mxEvent.addListener(U,"click",mxUtils.bind(this,function(){ba(ta)}))})(Z);aa.push(U);X.appendChild(U)}var ba=mxUtils.bind(this,function(ta){null!=aa[ta]&&(null!=this.format.currentScheme&&null!=aa[this.format.currentScheme]&&(aa[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ta,fa(this.defaultColorSchemes[this.format.currentScheme]),aa[this.format.currentScheme].style.background="#84d7ff")}),fa=mxUtils.bind(this,function(ta){var ua=+mxUtils.clone(J.defaultVertexStyle);ua[mxConstants.STYLE_STROKECOLOR]=null!=ua[mxConstants.STYLE_STROKECOLOR]?ua[mxConstants.STYLE_STROKECOLOR]:"default";ua[mxConstants.STYLE_FILLCOLOR]=null!=ua[mxConstants.STYLE_FILLCOLOR]?ua[mxConstants.STYLE_FILLCOLOR]:"default";ua[mxConstants.STYLE_FONTCOLOR]=null!=ua[mxConstants.STYLE_FONTCOLOR]?ua[mxConstants.STYLE_FONTCOLOR]:"default";J.replaceDefaultColors(new mxCell,ua);var Ca=mxUtils.bind(this,function(Aa){var Fa=mxUtils.button("",mxUtils.bind(this,function(Pa){J.getModel().beginUpdate();+try{for(var db=y.getSelectionState().cells,Ia=0;Ia<db.length;Ia++){var za=J.getModel().getStyle(db[Ia]);null!=Aa?(mxEvent.isShiftDown(Pa)||(za=""==Aa.fill||null==Aa.fill?mxUtils.setStyle(za,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_FILLCOLOR,Aa.fill),za=""==Aa.gradient||null==Aa.gradient?mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,Aa.gradient),mxEvent.isControlDown(Pa)||mxClient.IS_MAC&&mxEvent.isMetaDown(Pa)||+!J.getModel().isVertex(db[Ia])||(za=""==Aa.font||null==Aa.font?mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,Aa.font))),mxEvent.isAltDown(Pa)||(za=""==Aa.stroke||null==Aa.fill?mxUtils.setStyle(za,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_STROKECOLOR,Aa.stroke))):(za=mxUtils.setStyle(za,mxConstants.STYLE_FILLCOLOR,null),za=mxUtils.setStyle(za,mxConstants.STYLE_STROKECOLOR,null),za=mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,+null),J.getModel().isVertex(db[Ia])&&(za=mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,null)));J.getModel().setStyle(db[Ia],za)}}finally{J.getModel().endUpdate()}}));Fa.className="geStyleButton";Fa.style.width="36px";Fa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Fa.style.margin="0px 6px 6px 0px";if(null!=Aa){var Sa="1px solid";null!=Aa.border&&(Sa=Aa.border);if(null!=Aa.gradient)Fa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(Aa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Aa.gradient).cssText++" 100%)";else if(Aa.fill==mxConstants.NONE)Fa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Aa.fill||""==Aa.fill)Fa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ua,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var La=mxUtils.getLightDarkColor(Aa.fill);Fa.style.backgroundImage="linear-gradient(to right bottom, "+La.cssText+" 50%, "+La.light+" 50.3%)"}null==Aa.stroke||Aa.stroke==mxConstants.NONE?Fa.style.border=Sa+" transparent":""==Aa.stroke?Fa.style.border=+"1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ua,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(La=mxUtils.getLightDarkColor(Aa.stroke),Fa.style.border=Sa+" "+La.cssText,Fa.style.borderRightColor=La.light,Fa.style.borderBottomColor=Fa.style.borderRightColor);null!=Aa.title&&Fa.setAttribute("title",Aa.title)}else Sa=mxUtils.getValue(ua,mxConstants.STYLE_FILLCOLOR,"#ffffff"),La=mxUtils.getValue(ua,mxConstants.STYLE_STROKECOLOR,"#000000"),Fa.style.backgroundColor=Sa,Fa.style.border="1px solid "++La;Fa.style.borderRadius="0";R.appendChild(Fa);null!=Aa&&null!=Aa.gradient&&(Sa=Fa.cloneNode(!1),Sa.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Aa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(Aa.gradient).light+") 100%)",Sa.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Sa.style.backgroundColor="transparent",R.appendChild(Sa),Sa.style.marginLeft="-42px",mxEvent.addListener(Sa,"click",function(){Fa.click()}))});R.innerText=+"";if(null!=ta)for(var Ba=0;Ba<ta.length;Ba++)0<Ba&&0==mxUtils.mod(Ba,4)&&mxUtils.br(R),Ca(ta[Ba])});null==this.format.currentScheme?ba(Math.min(aa.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ba(this.format.currentScheme);Z=10>=this.defaultColorSchemes.length?43:23;var na=document.createElement("div");na.className="geButton";na.style.cssText="position:absolute;left:0px;bottom:"+Z+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(na,"click",mxUtils.bind(this,+function(){ba(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var pa=document.createElement("div");pa.className="geButton";pa.style.cssText="position:absolute;left:186px;bottom:"+Z+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(na),k.appendChild(pa));mxEvent.addListener(pa,"click",mxUtils.bind(this,function(){ba(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));fa(this.defaultColorSchemes[this.format.currentScheme]);+10>=this.defaultColorSchemes.length&&k.appendChild(X)}return k}}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(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=+function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.createFontElement=function(k,y){var J=Graph.fontMapping[y];null==J&&Graph.isCssFontUrl(y)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",+Graph.rewriteGoogleFontUrl(y))):(null==J&&(J='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+y+'");\n}'),k=document.createElement("style"),mxUtils.write(k,J));return k};Graph.addRecentCustomFont=function(k,y){};Graph.addFont=function(k,y,J,R){if(null!=k&&0<k.length&&null!=y&&0<y.length){R=null!=R?R:Graph.customFontElements;var X=k.toLowerCase();if("helvetica"!=X&&"arial"!=k&&"sans-serif"!=X){var aa=R[X];null!=aa&&aa.url!=y&&(aa.elt.parentNode.removeChild(aa.elt),aa=null);null==aa?(aa=y,"http:"==+y.substring(0,5)&&(aa=PROXY_URL+"?url="+encodeURIComponent(y)),aa={name:k,url:y,elt:Graph.createFontElement(k,aa)},R[X]=aa,y=R==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=J&&("link"==aa.elt.nodeName.toLowerCase()?(aa.elt.onload=J,aa.elt.onerror=J):J()),null!=y&&y.appendChild(aa.elt)):null!=J&&J()}else null!=J&&J()}else null!=J&&J();return k};Graph.getFontUrl=function(k,y){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(y=k.url);return y};Graph.processFontAttributes=+function(k){k=k.getElementsByTagName("*");for(var y=0;y<k.length;y++){var J=k[y].getAttribute("data-font-src");if(null!=J){var R="FONT"==k[y].nodeName?k[y].getAttribute("face"):k[y].style.fontFamily;null!=R&&Graph.addFont(R,J)}}};Graph.processFontStyle=function(k){if(null!=k){var y=mxUtils.getValue(k,"fontSource",null);if(null!=y){var J=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=J)try{Graph.addFont(J,decodeURIComponent(y))}catch(R){}}}return k};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.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var l=Graph.prototype.init;Graph.prototype.init=function(){function k(X){y=X}l.apply(this,arguments);+this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var y=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(X){y=null});this.isMouseInsertPoint=function(){return null!=y};var J=this.getInsertPoint;this.getInsertPoint=function(X){return null==y||X?J.apply(this,arguments):this.getPointForEvent(y)};var R=this.layoutManager.getLayout;this.layoutManager.getLayout=function(X){var aa=+this.graph.getCellStyle(X);if(null!=aa&&"rack"==aa.childLayout){var Z=new mxStackLayout(this.graph,!1);Z.gridSize=null!=aa.rackUnitSize?parseFloat(aa.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Z.marginLeft=aa.marginLeft||0;Z.marginRight=aa.marginRight||0;Z.marginTop=aa.marginTop||0;Z.marginBottom=aa.marginBottom||0;Z.allowGaps=aa.allowGaps||0;Z.horizontal="1"==mxUtils.getValue(aa,"horizontalRack","0");Z.resizeParent=!1;Z.fill=!0;return Z}return R.apply(this,arguments)};+this.updateGlobalUrlVariables()};var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,y){return Graph.processFontStyle(t.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,y,J,R,X,aa,Z,U,ba,fa,na,pa){B.apply(this,arguments);Graph.processFontAttributes(pa)};var D=mxText.prototype.redraw;mxText.prototype.redraw=function(){D.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};+Graph.prototype.createTagsDialog=function(k,y,J,R){function X(){for(var Ba=U.getSelectionCells(),Aa=[],Fa=0;Fa<Ba.length;Fa++)U.isCellVisible(Ba[Fa])&&Aa.push(Ba[Fa]);U.setSelectionCells(Aa)}function aa(Ba){U.setHiddenTags(Ba?[]:ba.slice());X();U.refresh()}function Z(Ba,Aa){na.innerText="";if(0<Ba.length){var Fa=document.createElement("table");Fa.setAttribute("cellpadding","2");Fa.style.boxSizing="border-box";Fa.style.tableLayout="fixed";Fa.style.width="100%";var Sa=document.createElement("tbody");+if(null!=Ba&&0<Ba.length)for(var La=0;La<Ba.length;La++)(function(Pa){function db(){var Na=U.getCellsForTags([Pa],null,null,!0);U.isEnabled()?U.setSelectionCells(Na):U.highlightCells(Na,null,null,70)}var Ia=0>mxUtils.indexOf(U.hiddenTags,Pa),za=document.createElement("tr"),Ua=document.createElement("td");Ua.style.align="center";Ua.style.width="16px";var Qa=document.createElement("img");Qa.setAttribute("src",Ia?Editor.visibleImage:Editor.hiddenImage);Qa.setAttribute("title",mxResources.get(Ia?"hideIt":+"show",[Pa]));mxUtils.setOpacity(Qa,Ia?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor="pointer";Qa.style.width="16px";if(y||Editor.isDarkMode())Qa.style.filter="invert(100%)";Ua.appendChild(Qa);mxEvent.addListener(Qa,"click",function(Na){mxEvent.isShiftDown(Na)?aa(0<=mxUtils.indexOf(U.hiddenTags,Pa)):(U.toggleHiddenTag(Pa),X(),U.refresh());mxEvent.consume(Na)});za.appendChild(Ua);Ua=document.createElement("td");Ua.style.align="center";Ua.style.width="16px";Qa=+document.createElement("img");Qa.setAttribute("src",Editor.selectImage);Qa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Qa,Ia?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor="pointer";Qa.style.width="16px";if(y||Editor.isDarkMode())Qa.style.filter="invert(100%)";mxEvent.addListener(Qa,"click",function(Na){aa(!0);db();mxEvent.consume(Na)});Ua.appendChild(Qa);za.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",Pa);a=document.createElement("a");mxUtils.write(a,Pa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Ia?100:40);Ua.appendChild(a);mxEvent.addListener(Ua,"click",function(Na){if(mxEvent.isShiftDown(Na))aa(!0),db();else if(Ia&&0<U.hiddenTags.length)aa(!0);else{var xa=ba.slice(),Za=mxUtils.indexOf(xa,Pa);xa.splice(Za,1);U.setHiddenTags(xa);X();+U.refresh()}mxEvent.consume(Na)});za.appendChild(Ua);if(U.isEnabled()){Ua=document.createElement("td");Ua.style.verticalAlign="middle";Ua.style.textAlign="center";Ua.style.width="18px";if(null==Aa){Ua.style.align="center";Ua.style.width="16px";Qa=document.createElement("img");Qa.setAttribute("src",Editor.trashImage);Qa.setAttribute("title",mxResources.get("removeIt",[Pa]));mxUtils.setOpacity(Qa,Ia?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor="pointer";Qa.style.width=+"16px";if(y||Editor.isDarkMode())Qa.style.filter="invert(100%)";mxEvent.addListener(Qa,"click",function(Na){var xa=mxUtils.indexOf(ba,Pa);0<=xa&&ba.splice(xa,1);U.removeTagsForCells(U.model.getDescendants(U.model.getRoot()),[Pa]);U.refresh();mxEvent.consume(Na)});Ua.appendChild(Qa)}else{var Ma=document.createElement("input");Ma.setAttribute("type","checkbox");Ma.style.margin="0px";Ma.defaultChecked=null!=Aa&&0<=mxUtils.indexOf(Aa,Pa);Ma.checked=Ma.defaultChecked;Ma.style.background="transparent";+Ma.setAttribute("title",mxResources.get(Ma.defaultChecked?"removeIt":"add",[Pa]));mxEvent.addListener(Ma,"change",function(Na){Ma.checked?U.addTagsForCells(U.getSelectionCells(),[Pa]):U.removeTagsForCells(U.getSelectionCells(),[Pa]);mxEvent.consume(Na)});Ua.appendChild(Ma)}za.appendChild(Ua)}Sa.appendChild(za)})(Ba[La]);Fa.appendChild(Sa);na.appendChild(Fa)}}var U=this,ba=U.hiddenTags.slice(),fa=document.createElement("div");fa.style.userSelect="none";fa.style.overflow="hidden";fa.style.padding="10px";+fa.style.height="100%";var na=document.createElement("div");na.style.position="absolute";na.style.boxSizing="border-box";na.style.userSelect="none";na.style.overflow="auto";na.style.padding="3px";na.style.left="0px";na.style.right="0px";na.style.top="0px";na.style.bottom="0px";fa.appendChild(na);U.addListener(mxEvent.ROOT,function(){ba=U.hiddenTags.slice()});var pa=mxUtils.bind(this,function(Ba,Aa){if(k()){Ba=U.getAllTags();for(Aa=0;Aa<Ba.length;Aa++)0>mxUtils.indexOf(ba,Ba[Aa])&&ba.push(Ba[Aa]);+ba.sort();U.isSelectionEmpty()?Z(ba):Z(ba,U.getCommonTagsForCells(U.getSelectionCells()))}});U.selectionModel.addListener(mxEvent.CHANGE,pa);U.model.addListener(mxEvent.CHANGE,pa);U.addListener(mxEvent.REFRESH,pa);var ta=document.createElement("div");ta.className="geToolbarContainer geDialogToolbar";ta.style.position="absolute";ta.style.display="flex";ta.style.bottom="0px";ta.style.left="0px";ta.style.right="0px";ta.style.height="32px";ta.style.overflow="hidden";ta.style.padding="3px 4px 4px 4px";+ta.style.borderWidth="1px 0px 0px 0px";ta.style.borderStyle="solid";ta.style.whiteSpace="nowrap";if(U.isEnabled()){na.style.bottom="32px";var ua=document.createElement("a");ua.className="geButton";var Ca=ua.cloneNode(!1);Ca.style.backgroundImage="url("+Editor.visibleImage+")";Ca.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Ca,"click",function(Ba){U.setHiddenTags([]);mxEvent.isShiftDown(Ba)||(ba=U.hiddenTags.slice());X();U.refresh();mxEvent.consume(Ba)});ta.appendChild(Ca);null!=+J&&(ua=ua.cloneNode(!1),ua.style.backgroundImage="url("+Editor.plusImage+")",ua.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ua,"click",function(Ba){J(ba,function(Aa){ba=Aa;pa()});mxEvent.consume(Ba)}),ta.appendChild(ua));fa.appendChild(ta)}null!=R&&ta.appendChild(R);return{div:fa,refresh:pa}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var y in Graph.customFontElements){var J=Graph.customFontElements[y];k.push({name:J.name,url:J.url})}return k};+Graph.prototype.setFont=function(k,y){Graph.addFont(k,y);var J=Editor.guid();document.execCommand("fontname",!1,J);for(var R=this.cellEditor.textarea.getElementsByTagName("font"),X=!1,aa=0;aa<R.length;aa++)R[aa].getAttribute("face")==J&&(X=!0,R[aa].setAttribute("face",k),null!=y?R[aa].setAttribute("data-font-src",y):R[aa].removeAttribute("data-font-src"));X||document.execCommand("fontname",!1,k)};var I=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return I.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 k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var y in k)this.globalVars[y]=k[y]}catch(J){null!=window.console&&console.log("Error in vars URL parameter: "+J)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):+{}};var K=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var y=K.apply(this,arguments);null==y&&null!=this.globalVars&&(y=this.globalVars[k]);return y};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var M=Graph.prototype.getSvg;Graph.prototype.getSvg=+function(k,y,J,R,X,aa,Z,U,ba,fa,na,pa,ta,ua,Ca,Ba){var Aa=M.apply(this,arguments);if(null!=pa){var Fa=Aa.getAttribute("style");null==Fa&&(Fa="");pa="auto"==pa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":pa;Aa.setAttribute("style",Fa+(" color-scheme: "+pa+";"))}var Sa=this.getCustomFonts();if(na&&0<Sa.length){var La=Aa.ownerDocument;Fa=null!=La.createElementNS?La.createElementNS(mxConstants.NS_SVG,"style"):La.createElement("style");null!=La.setAttributeNS?+Fa.setAttributeNS("type","text/css"):Fa.setAttribute("type","text/css");for(var Pa="",db="",Ia=0;Ia<Sa.length;Ia++){var za=Sa[Ia].name,Ua=Sa[Ia].url;Graph.isCssFontUrl(Ua)?Pa+="@import url("+Graph.rewriteGoogleFontUrl(Ua)+");\n":db+='@font-face {\nfont-family: "'+za+'";\nsrc: url("'+Ua+'");\n}\n'}Fa.appendChild(La.createTextNode(Pa+db));Aa.getElementsByTagName("defs")[0].appendChild(Fa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Aa);+this.mathEnabled&&(document.body.appendChild(Aa),Editor.MathJaxRender(Aa),Aa.parentNode.removeChild(Aa),Fa=Aa.ownerDocument.getElementById("MJX-SVG-styles"),null!=Fa&&Aa.getElementsByTagName("defs")[0].appendChild(Fa.cloneNode(!0)));return Aa};var V=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){V.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,+k.control]};var Q=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){Q.apply(this,arguments);this.enumerationState=0};var ja=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ja.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'++mxUtils.htmlEntities(k)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var y="1"==mxUtils.getValue(k.style,"enumerate",0);y&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):y||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);y=k.secondLabel;if(null!=+y){var J=k.view.scale,R=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*J,k.y+4*J,0,0):mxRectangle.fromPoint(k.view.getPoint(k));y.bounds.equals(k)&&y.value==R&&y.scale==J||(y.bounds=k,y.value=R,y.scale=J,y.redraw())}};var ea=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();ea.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&+(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var da=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){da.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,y){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&this.executeCustomActions(k.actions,null,y))};Graph.prototype.executeCustomActions=function(k,y,J){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 R=!1,X=0,aa=0,Z=mxUtils.bind(this,function(){R||(R=!0,this.model.beginUpdate())}),U=mxUtils.bind(this,function(){R&&(R=!1,this.model.endUpdate())}),ba=mxUtils.bind(this,function(){0<X&&X--;0==X&&fa()}),fa=mxUtils.bind(this,function(){if(aa<k.length){var na=+this.stoppingCustomActions,pa=k[aa++],ta=[];if(null!=pa.open)if(U(),this.isCustomLink(pa.open)){if(!this.customLinkClicked(pa.open,J))return}else this.openLink(pa.open);null==pa.wait||na||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ba()}),X++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=pa.wait?parseInt(pa.wait):1E3),U());null!=pa.opacity&&null!=pa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(pa.opacity,+!0)),pa.opacity.value);null!=pa.fadeIn&&(X++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(pa.fadeIn,!0)),0,1,ba,na?0:pa.fadeIn.delay));null!=pa.fadeOut&&(X++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(pa.fadeOut,!0)),1,0,ba,na?0:pa.fadeOut.delay));null!=pa.wipeIn&&(ta=ta.concat(this.createWipeAnimations(this.getCellsForAction(pa.wipeIn,!0),!0)));null!=pa.wipeOut&&(ta=ta.concat(this.createWipeAnimations(this.getCellsForAction(pa.wipeOut,!0),!1)));null!=pa.toggle&&+(Z(),this.toggleCells(this.getCellsForAction(pa.toggle,!0)));if(null!=pa.show){Z();var ua=this.getCellsForAction(pa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ua),1);this.setCellsVisible(ua,!0)}null!=pa.hide&&(Z(),ua=this.getCellsForAction(pa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ua),0),this.setCellsVisible(ua,!1));null!=pa.toggleStyle&&null!=pa.toggleStyle.key&&(Z(),this.toggleCellStyles(pa.toggleStyle.key,null!=pa.toggleStyle.defaultValue?pa.toggleStyle.defaultValue:+"0",this.getCellsForAction(pa.toggleStyle,!0)));null!=pa.style&&null!=pa.style.key&&(Z(),this.setCellStyles(pa.style.key,pa.style.value,this.getCellsForAction(pa.style,!0)));ua=[];null!=pa.select&&this.isEnabled()&&(ua=this.getCellsForAction(pa.select),this.setSelectionCells(ua));null!=pa.highlight&&(ua=this.getCellsForAction(pa.highlight),this.highlightCells(ua,pa.highlight.color,pa.highlight.duration,pa.highlight.opacity));null!=pa.scroll&&(ua=this.getCellsForAction(pa.scroll));null!=pa.viewbox&&+this.fitWindow(pa.viewbox,pa.viewbox.border);0<ua.length&&this.scrollCellToVisible(ua[0]);null!=J&&null!=pa.explore&&Graph.exploreFromCell(this,J,pa.explore);if(null!=pa.tags){if(null!=pa.tags.toggle){var Ca=pa.tags.toggle;0==Ca.length&&(Ca=this.getAllTags());for(ua=0;ua<Ca.length;ua++)this.toggleHiddenTag(Ca[ua])}Ca=null;null!=pa.tags.hidden&&(null==Ca&&(Ca=[]),Ca=Ca.concat(pa.tags.hidden));if(null!=pa.tags.visible){null==Ca&&(Ca=[]);var Ba=this.getAllTags();for(ua=0;ua<Ba.length;ua++)0>mxUtils.indexOf(pa.tags.visible,+Ba[ua])&&0>mxUtils.indexOf(Ca,Ba[ua])&&Ca.push(Ba[ua])}null!=Ca&&this.setHiddenTags(Ca);this.refresh()}0<ta.length&&(X++,this.executeAnimations(ta,ba,na?1:pa.steps,na?0:pa.delay));0==X?fa():U()}else this.stoppingCustomActions=this.executingCustomActions=!1,U(),null!=y&&y()});fa()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,y){var J=this.getLinkForCell(y);null!=J&&"data:action/json,"==J.substring(0,17)&&this.setLinkForCell(y,this.updateCustomLink(k,J));if(this.isHtmlLabel(y)){var R=document.createElement("div");+R.innerHTML=Graph.sanitizeHtml(this.getLabel(y));for(var X=R.getElementsByTagName("a"),aa=!1,Z=0;Z<X.length;Z++)J=X[Z].getAttribute("href"),null!=J&&"data:action/json,"==J.substring(0,17)&&(X[Z].setAttribute("href",this.updateCustomLink(k,J)),aa=!0);aa&&this.labelChanged(y,R.innerHTML)}};Graph.prototype.updateCustomLink=function(k,y){if("data:action/json,"==y.substring(0,17))try{var J=JSON.parse(y.substring(17));null!=J.actions&&(this.updateCustomLinkActions(k,J.actions),y="data:action/json,"+JSON.stringify(J))}catch(R){}return y};+Graph.prototype.updateCustomLinkActions=function(k,y){for(var J=0;J<y.length;J++){var R=y[J],X;for(X in R)this.updateCustomLinkAction(k,R[X],"cells"),this.updateCustomLinkAction(k,R[X],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,y,J){if(null!=y&&null!=y[J]){for(var R=[],X=0;X<y[J].length;X++)if("*"==y[J][X])R.push(y[J][X]);else{var aa=k[y[J][X]];null!=aa?""!=aa&&R.push(aa):R.push(y[J][X])}y[J]=R}};Graph.prototype.getCellsForAction=function(k,y){y=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,+null,y));if(null!=k.excludeCells){for(var J=[],R=0;R<y.length;R++)0>k.excludeCells.indexOf(y[R].id)&&J.push(y[R]);y=J}return y};Graph.prototype.getCellsById=function(k){var y=[];if(null!=k)for(var J=0;J<k.length;J++)if("*"==k[J]){var R=this.model.getRoot();y=y.concat(this.model.filterDescendants(function(aa){return aa!=R},R))}else{var X=this.model.getCell(k[J]);null!=X&&y.push(X)}return y};var ia=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return ia.apply(this,arguments)&&+!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var y=mxUtils.indexOf(this.hiddenTags,k);0>y?this.hiddenTags.push(k):0<=y&&this.hiddenTags.splice(y,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;+for(var y=0;y<k.length;y++)if(0>mxUtils.indexOf(this.hiddenTags,k[y]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,y,J,R){var X=[];if(null!=k){y=null!=y?y:this.model.getDescendants(this.model.getRoot());for(var aa=0,Z={},U=0;U<k.length;U++)0<k[U].length&&(Z[k[U]]=!0,aa++);for(U=0;U<y.length;U++)if(J&&this.model.getParent(y[U])==this.model.root||this.model.isVertex(y[U])||this.model.isEdge(y[U])){var ba=this.getTagsForCell(y[U]),fa=!1;if(0<ba.length&&(ba=ba.split(" "),ba.length>=k.length)){for(var na=+fa=0;na<ba.length&&fa<aa;na++)null!=Z[ba[na]]&&fa++;fa=fa==aa}fa&&(1!=R||this.isCellVisible(y[U]))&&X.push(y[U])}}return X};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var y=null,J=[],R=0;R<k.length;R++){var X=this.getTagsForCell(k[R]);J=[];if(0<X.length){X=X.split(" ");for(var aa={},Z=0;Z<X.length;Z++)if(null==y||null!=y[X[Z]])aa[X[Z]]=!0,J.push(X[Z]);y=aa}else return[]}return J};+Graph.prototype.getTagsForCells=function(k){for(var y=[],J={},R=0;R<k.length;R++){var X=this.getTagsForCell(k[R]);if(0<X.length){X=X.split(" ");for(var aa=0;aa<X.length;aa++)null==J[X[aa]]&&(J[X[aa]]=!0,y.push(X[aa]))}}return y};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,y){if(0<k.length&&0<y.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){for(var R=this.getTagsForCell(k[J]),X=R.split(" "),aa=+!1,Z=0;Z<y.length;Z++){var U=mxUtils.trim(y[Z]);""!=U&&0>mxUtils.indexOf(X,U)&&(R=0<R.length?R+" "+U:U,aa=!0)}aa&&this.setAttributeForCell(k[J],"tags",R)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,y){if(0<k.length&&0<y.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){var R=this.getTagsForCell(k[J]);if(0<R.length){for(var X=R.split(" "),aa=!1,Z=0;Z<y.length;Z++){var U=mxUtils.indexOf(X,y[Z]);0<=U&&(X.splice(U,1),aa=!0)}aa&&this.setAttributeForCell(k[J],+"tags",X.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var y=0;y<k.length;y++)this.model.setVisible(k[y],!this.model.isVisible(k[y]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,y){this.model.beginUpdate();try{for(var J=0;J<k.length;J++)this.model.setVisible(k[J],y)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,y,J,R){for(var X=0;X<k.length;X++)this.highlightCell(k[X],+y,J,R)};Graph.prototype.highlightCell=function(k,y,J,R,X){y=null!=y?y:mxConstants.DEFAULT_VALID_COLOR;J=null!=J?J:1E3;k=this.view.getState(k);var aa=null;null!=k&&(X=null!=X?X:4,X=Math.max(X+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+X),aa=new mxCellHighlight(this,y,X,!1),null!=R&&(aa.opacity=R),aa.highlight(k),window.setTimeout(function(){null!=aa.shape&&(mxUtils.setPrefixedStyle(aa.shape.node.style,"transition","all 1200ms ease-in-out"),aa.shape.node.style.opacity=0);window.setTimeout(function(){aa.destroy()},+1200)},J));return aa};Graph.prototype.addSvgShadow=function(k,y,J,R){R=null!=R?R:!0;var X=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=J&&J||(y=null!=y?y:k.getElementsByTagName("g")[0],null!=y&&(this.updateShadowFilter(y,!0),!isNaN(parseInt(k.getAttribute("width")))&&R&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+X),k.setAttribute("height",parseInt(k.getAttribute("height"))+X),y=k.getAttribute("viewBox"),null!=y&&0<y.length&&(y=y.split(" "),3<y.length&&(w=parseFloat(y[2])++X,h=parseFloat(y[3])+X,k.setAttribute("viewBox",y[0]+" "+y[1]+" "+w+" "+h))))));return X};Graph.prototype.updateShadowFilter=function(k,y){mxClient.IS_SF||(y?(y=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+y.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,y){y=null!=y?y:!0;this.shadowVisible=+k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);y&&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 k=this.model.getChildCount(this.model.root),y=0;do var J=this.model.getChildAt(this.model.root,y);while(y++<k&&"1"==mxUtils.getValue(this.getCellStyle(J),"locked","0"));null!=J&&this.setDefaultParent(J)}};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=@@ -3570,43 +3575,43 @@ mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.x[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.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.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(k){var x=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?x="mxgraph.er":"sysML"==k.substring(0,5)&&(x="mxgraph.sysml"));return x};var la=mxMarker.createMarker;mxMarker.createMarker=function(k,x,J,R,Y,Z,W,U,aa,ia){if(null!=J&&null==mxMarker.markers[J]){var na=this.getPackageForType(J);null!=na&&mxStencilRegistry.getStencil(na)}return la.apply(this,arguments)};var ka=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,x,J,R,Y,Z){"1"==mxUtils.getValue(x.style,"lineShape",-null)&&k.setFillColor(mxUtils.getValue(x.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ka.apply(this,arguments)};PrintDialog.prototype.create=function(k,x,J,R){function Y(){Ba.value=Math.max(1,Math.min(na,Math.max(parseInt(Ba.value),parseInt(ua.value))));ua.value=Math.max(1,Math.min(na,Math.min(parseInt(Ba.value),parseInt(ua.value))))}function Z(ba){k.lastPrintPagesRadioChecked=ta.checked;k.lastPrintSelectionOnlyChecked=Aa.checked;k.lastPrintCropRadioChecked=Ra.checked;k.lastPrintFitRadioChecked=-Ha.checked;ta.checked&&ua.value<Ba.value?(k.lastPrintPagesFromInput=ua.value,k.lastPrintPagesToInput=Ba.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);Ja.value=Math.max(1,Math.min(1600,parseInt(Ja.value)))+"%";k.lastPrintZoom=Ja.value;k.lastPrintBorder=Ca.value;k.lastPrintGrid=Xa.checked;k.lastPrintTransparent=y.checked;k.lastPrintInclude=P.checked;k.lastPrintSheetsAcross=oa.value;k.lastPrintSheetsDown=Da.value;var ma={};ma.border=parseInt(Ca.value);ma.scale=parseInt(Ja.value)/-100;ma.grid=Xa.checked;ma.shadows=ib.checked;ma.transparent=y.checked;ma.includeCopy=P.checked;ma.sheetsAcross=parseInt(oa.value);ma.sheetsDown=parseInt(Da.value);ma.pagesFrom=parseInt(ua.value);ma.pagesTo=parseInt(Ba.value);ma.allPages=qa.checked;ma.selection=Aa.checked;ma.pageView=Ga.checked;ma.crop=Ra.checked;ma.fit=Ha.checked;return null!=J?J(!ba,ma):k.print(!ba,ma)}var W=k.editor.graph,U=document.createElement("div"),aa=document.createElement("h3");aa.style.width="100%";aa.style.textAlign="center";-aa.style.marginTop="0px";mxUtils.write(aa,x||mxResources.get("print"));U.appendChild(aa);var ia=1,na=1;aa=document.createElement("div");aa.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");aa.appendChild(qa);x=document.createElement("span");mxUtils.write(x,mxResources.get("allPages"));mxEvent.addListener(x,"click",function(){qa.checked=!0});aa.appendChild(x);-mxUtils.br(aa);var ta=qa.cloneNode(!0);aa.appendChild(ta);x=document.createElement("span");mxUtils.write(x,mxResources.get("pages")+":");aa.appendChild(x);mxEvent.addListener(x,"click",function(){ta.checked=!0});var ua=document.createElement("input");ua.style.margin="0 4px";ua.setAttribute("value","1");ua.setAttribute("type","number");ua.setAttribute("min","1");ua.style.width="40px";aa.appendChild(ua);x=document.createElement("span");mxUtils.write(x,mxResources.get("to"));aa.appendChild(x);var Ba=-ua.cloneNode(!0);aa.appendChild(Ba);mxEvent.addListener(ua,"focus",function(){ta.checked=!0});mxEvent.addListener(Ba,"focus",function(){ta.checked=!0});mxEvent.addListener(ua,"change",Y);mxEvent.addListener(Ba,"change",Y);if(null!=k.pages&&(na=k.pages.length,null!=k.currentPage))for(var za=0;za<na;za++)if(k.currentPage==k.pages[za]){ia=za+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ua.value=Math.min(na,Math.max(1,k.lastPrintPagesFromInput)),Ba.value=Math.min(na,Math.max(1,-k.lastPrintPagesToInput))):(ua.value=ia,Ba.value=ia);ua.setAttribute("max",na);Ba.setAttribute("max",na);za=mxUtils.button(mxResources.get("currentPage"),function(ba){ua.value=ia;Ba.value=ia;ta.checked=!0});za.setAttribute("title",mxResources.get("currentPage"));za.style.marginLeft="4px";za.style.maxWidth="100px";za.style.overflow="hidden";za.style.textOverflow="ellipsis";za.style.whiteSpace="nowrap";aa.appendChild(za);1<na&&U.appendChild(aa);aa=document.createElement("div");aa.style.borderBottom=-"1px solid lightGray";aa.style.paddingBottom="12px";aa.style.marginBottom="12px";aa.style.whiteSpace="nowrap";var Aa=document.createElement("input");Aa.setAttribute("name","pages-printdialog");Aa.setAttribute("type",1==na?"checkbox":"radio");Aa.style.marginRight="8px";W.isSelectionEmpty()&&Aa.setAttribute("disabled","disabled");W.isEnabled()&&(aa.appendChild(Aa),x=document.createElement("span"),mxUtils.write(x,mxResources.get("selectionOnly")),aa.appendChild(x));(W.isEnabled()||1<na)&&U.appendChild(aa);-!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?ta.checked=!0:!W.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Aa.checked=!0:qa.checked=!0;W.isSelectionEmpty()||mxEvent.addListener(x,"click",function(){Aa.checked=!Aa.checked});W=document.createElement("div");W.style.whiteSpace="nowrap";var Ga=document.createElement("input");Ga.style.marginBottom="8px";Ga.style.marginRight="8px";Ga.setAttribute("type","radio");Ga.setAttribute("name","printSize");W.appendChild(Ga);x=document.createElement("span");-mxUtils.write(x,mxResources.get("pageView"));W.appendChild(x);mxEvent.addListener(W,"click",function(){Ga.checked=!0});U.appendChild(W);W=document.createElement("div");W.style.whiteSpace="nowrap";var Ra=document.createElement("input");Ra.style.marginBottom="8px";Ra.style.marginRight="8px";Ra.setAttribute("type","radio");Ra.setAttribute("name","printSize");W.appendChild(Ra);x=document.createElement("span");mxUtils.write(x,mxResources.get("crop"));W.appendChild(x);mxEvent.addListener(W,"click",function(){Ra.checked=-!0});U.appendChild(W);W=document.createElement("div");W.style.whiteSpace="nowrap";var Ha=document.createElement("input");Ha.style.marginBottom="8px";Ha.style.marginRight="8px";Ha.setAttribute("type","radio");Ha.setAttribute("name","printSize");x=document.createElement("div");x.style.display="inline-block";x.style.verticalAlign="top";x.style.paddingTop="2px";x.appendChild(Ha);W.appendChild(x);aa=document.createElement("table");aa.style.display="inline-block";aa.style.borderSpacing="0";za=document.createElement("tbody");-var Qa=document.createElement("tr"),eb=Qa.cloneNode(!0),Ma=document.createElement("td"),ya=Ma.cloneNode(!0),Sa=Ma.cloneNode(!0),Oa=Ma.cloneNode(!0),Na=Ma.cloneNode(!0),Pa=Ma.cloneNode(!0);Ma.style.textAlign="right";Oa.style.textAlign="right";mxUtils.write(Ma,mxResources.get("fitTo"));mxEvent.addListener(W,"click",function(ba){mxEvent.getSource(ba)!=Ha&&(Ha.checked=!Ha.checked)});var oa=document.createElement("input");oa.style.margin="0 2px";oa.style.boxSizing="border-box";oa.setAttribute("value",-k.lastPrintSheetsAcross||"1");oa.setAttribute("min","1");oa.setAttribute("type","number");oa.style.width="40px";ya.appendChild(oa);x=document.createElement("span");mxUtils.write(x,mxResources.get("fitToSheetsAcross"));Sa.appendChild(x);mxUtils.write(Oa,mxResources.get("fitToBy"));var Da=oa.cloneNode(!0);Da.setAttribute("value",k.lastPrintSheetsDown||"1");Na.appendChild(Da);mxEvent.addListener(oa,"click",function(ba){Ha.checked=!0;mxEvent.consume(ba)});mxEvent.addListener(Da,"click",function(ba){Ha.checked=-!0;mxEvent.consume(ba)});k.lastPrintCropRadioChecked?Ra.checked=!0:k.lastPrintFitRadioChecked?Ha.checked=!0:Ga.checked=!0;x=document.createElement("span");mxUtils.write(x,mxResources.get("fitToSheetsDown"));Pa.appendChild(x);Qa.appendChild(Ma);Qa.appendChild(ya);Qa.appendChild(Sa);eb.appendChild(Oa);eb.appendChild(Na);eb.appendChild(Pa);za.appendChild(Qa);za.appendChild(eb);aa.appendChild(za);W.appendChild(aa);U.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 Ca=document.createElement("input");Ca.setAttribute("type","number");Ca.setAttribute("min","0");Ca.style.width="40px";Ca.style.marginLeft="4px";Ca.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;W.appendChild(Ca);x=document.createElement("span");x.style.marginLeft="8px";mxUtils.write(x,mxResources.get("zoom")+-":");W.appendChild(x);var Ja=document.createElement("input");Ja.style.width="60px";Ja.style.marginLeft="4px";Ja.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";W.appendChild(Ja);mxUtils.br(W);var Xa=document.createElement("input");Xa.setAttribute("type","checkbox");Xa.style.marginTop="12px";Xa.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;W.appendChild(Xa);x=document.createElement("span");x.style.marginLeft="4px";x.style.marginRight="8px";mxUtils.write(x,mxResources.get("grid"));W.appendChild(x);-mxEvent.addListener(x,"click",function(ba){Xa.checked=!0;mxEvent.consume(ba)});var ib=document.createElement("input");ib.setAttribute("type","checkbox");ib.style.marginTop="12px";ib.checked=null!=k.lastPrintShadow?k.lastPrintShadow:!1;W.appendChild(ib);x=document.createElement("span");x.style.marginLeft="4px";x.style.marginRight="8px";mxUtils.write(x,mxResources.get("shadows"));W.appendChild(x);k.isOffline()&&!mxClient.IS_CHROMEAPP||x.appendChild(k.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));-mxEvent.addListener(x,"click",function(ba){"IMG"!=mxEvent.getSource(ba).nodeName&&(ib.checked=!0,mxEvent.consume(ba))});Editor.enableShadowOption?null!=J&&mxUtils.br(W):(ib.style.display="none",x.style.display="none");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginTop="10px";y.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=J&&(W.appendChild(y),x=document.createElement("span"),x.style.marginLeft="4px",mxUtils.write(x,mxResources.get("transparentBackground")),-W.appendChild(x),mxEvent.addListener(x,"click",function(ba){y.checked=!0;mxEvent.consume(ba)}));var P=document.createElement("input");P.setAttribute("type","checkbox");P.style.marginTop="10px";P.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==J||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(mxUtils.br(W),W.appendChild(P),x=document.createElement("span"),x.style.marginLeft="4px",mxUtils.write(x,mxResources.get("includeCopyOfMyDiagram")),W.appendChild(x),-mxEvent.addListener(x,"click",function(ba){P.checked=!0;mxEvent.consume(ba)}));U.appendChild(W);x=document.createElement("div");x.style.marginTop="30px";x.style.textAlign="right";x.style.whiteSpace="nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=J||x.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));W=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});W.className="geBtn";k.editor.cancelFirst&&x.appendChild(W);PrintDialog.previewEnabled&&null==J&&-(aa=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),Z(!1)}catch(ba){k.handleError(ba)}}),aa.className="geBtn",x.appendChild(aa));R=null!=R?R:null!=J?"export":PrintDialog.previewEnabled?"print":"ok";R=mxUtils.button(mxResources.get(R),function(){try{k.hideDialog(),Z(!0)}catch(ba){k.handleError(ba)}});R.className="geBtn gePrimaryBtn";x.appendChild(R);k.editor.cancelFirst||x.appendChild(W);U.appendChild(x);if(k.editor.isChromelessView()){var S=function(){Editor.isDarkMode()?(U.classList.add("geDarkMode"),-U.style.colorScheme="dark"):(U.classList.remove("geDarkMode"),U.style.colorScheme="light")};k.addListener("darkModeChanged",S);S();var X=function(ba,ma){ba=ma.getProperty("dialog");U.parentNode==ba.container&&(k.editor.removeListener(X),k.removeListener(S))};k.editor.addListener("hideDialog",X)}this.container=U};var V=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 k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}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 V.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&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.6.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)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&+function(k){var y=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?y="mxgraph.er":"sysML"==k.substring(0,5)&&(y="mxgraph.sysml"));return y};var la=mxMarker.createMarker;mxMarker.createMarker=function(k,y,J,R,X,aa,Z,U,ba,fa){if(null!=J&&null==mxMarker.markers[J]){var na=this.getPackageForType(J);null!=na&&mxStencilRegistry.getStencil(na)}return la.apply(this,arguments)};var ka=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,y,J,R,X,aa){"1"==mxUtils.getValue(y.style,"lineShape",+null)&&k.setFillColor(mxUtils.getValue(y.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ka.apply(this,arguments)};PrintDialog.prototype.create=function(k,y,J,R){function X(){Ca.value=Math.max(1,Math.min(na,Math.max(parseInt(Ca.value),parseInt(ua.value))));ua.value=Math.max(1,Math.min(na,Math.min(parseInt(Ca.value),parseInt(ua.value))))}function aa(ca){k.lastPrintPagesRadioChecked=ta.checked;k.lastPrintSelectionOnlyChecked=Aa.checked;k.lastPrintCropRadioChecked=Sa.checked;k.lastPrintFitRadioChecked=+La.checked;ta.checked&&ua.value<Ca.value?(k.lastPrintPagesFromInput=ua.value,k.lastPrintPagesToInput=Ca.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);ra.value=Math.max(1,Math.min(1600,parseInt(ra.value)))+"%";k.lastPrintZoom=ra.value;k.lastPrintBorder=Oa.value;k.lastPrintGrid=Da.checked;k.lastPrintTransparent=x.checked;k.lastPrintInclude=N.checked;k.lastPrintSheetsAcross=xa.value;k.lastPrintSheetsDown=Za.value;var ma={};ma.border=parseInt(Oa.value);ma.scale=parseInt(ra.value)/+100;ma.grid=Da.checked;ma.shadows=Ra.checked;ma.transparent=x.checked;ma.includeCopy=N.checked;ma.sheetsAcross=parseInt(xa.value);ma.sheetsDown=parseInt(Za.value);ma.pagesFrom=parseInt(ua.value);ma.pagesTo=parseInt(Ca.value);ma.allPages=pa.checked;ma.selection=Aa.checked;ma.pageView=Fa.checked;ma.crop=Sa.checked;ma.fit=La.checked;return null!=J?J(!ca,ma):k.print(!ca,ma)}var Z=k.editor.graph,U=document.createElement("div"),ba=document.createElement("h3");ba.style.width="100%";ba.style.textAlign="center";+ba.style.marginTop="0px";mxUtils.write(ba,y||mxResources.get("print"));U.appendChild(ba);var fa=1,na=1;ba=document.createElement("div");ba.style.whiteSpace="nowrap";var pa=document.createElement("input");pa.style.marginRight="8px";pa.style.marginBottom="8px";pa.setAttribute("type","radio");pa.setAttribute("name","pages-printdialog");ba.appendChild(pa);y=document.createElement("span");mxUtils.write(y,mxResources.get("allPages"));mxEvent.addListener(y,"click",function(){pa.checked=!0});ba.appendChild(y);+mxUtils.br(ba);var ta=pa.cloneNode(!0);ba.appendChild(ta);y=document.createElement("span");mxUtils.write(y,mxResources.get("pages")+":");ba.appendChild(y);mxEvent.addListener(y,"click",function(){ta.checked=!0});var ua=document.createElement("input");ua.style.margin="0 4px";ua.setAttribute("value","1");ua.setAttribute("type","number");ua.setAttribute("min","1");ua.style.width="40px";ba.appendChild(ua);y=document.createElement("span");mxUtils.write(y,mxResources.get("to"));ba.appendChild(y);var Ca=+ua.cloneNode(!0);ba.appendChild(Ca);mxEvent.addListener(ua,"focus",function(){ta.checked=!0});mxEvent.addListener(Ca,"focus",function(){ta.checked=!0});mxEvent.addListener(ua,"change",X);mxEvent.addListener(Ca,"change",X);if(null!=k.pages&&(na=k.pages.length,null!=k.currentPage))for(var Ba=0;Ba<na;Ba++)if(k.currentPage==k.pages[Ba]){fa=Ba+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ua.value=Math.min(na,Math.max(1,k.lastPrintPagesFromInput)),Ca.value=Math.min(na,Math.max(1,+k.lastPrintPagesToInput))):(ua.value=fa,Ca.value=fa);ua.setAttribute("max",na);Ca.setAttribute("max",na);Ba=mxUtils.button(mxResources.get("currentPage"),function(ca){ua.value=fa;Ca.value=fa;ta.checked=!0});Ba.setAttribute("title",mxResources.get("currentPage"));Ba.style.marginLeft="4px";Ba.style.maxWidth="100px";Ba.style.overflow="hidden";Ba.style.textOverflow="ellipsis";Ba.style.whiteSpace="nowrap";ba.appendChild(Ba);1<na&&U.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 Aa=document.createElement("input");Aa.setAttribute("name","pages-printdialog");Aa.setAttribute("type",1==na?"checkbox":"radio");Aa.style.marginRight="8px";Z.isSelectionEmpty()&&Aa.setAttribute("disabled","disabled");Z.isEnabled()&&(ba.appendChild(Aa),y=document.createElement("span"),mxUtils.write(y,mxResources.get("selectionOnly")),ba.appendChild(y));(Z.isEnabled()||1<na)&&U.appendChild(ba);+!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?ta.checked=!0:!Z.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Aa.checked=!0:pa.checked=!0;Z.isSelectionEmpty()||mxEvent.addListener(y,"click",function(){Aa.checked=!Aa.checked});Z=document.createElement("div");Z.style.whiteSpace="nowrap";var Fa=document.createElement("input");Fa.style.marginBottom="8px";Fa.style.marginRight="8px";Fa.setAttribute("type","radio");Fa.setAttribute("name","printSize");Z.appendChild(Fa);y=document.createElement("span");+mxUtils.write(y,mxResources.get("pageView"));Z.appendChild(y);mxEvent.addListener(Z,"click",function(){Fa.checked=!0});U.appendChild(Z);Z=document.createElement("div");Z.style.whiteSpace="nowrap";var Sa=document.createElement("input");Sa.style.marginBottom="8px";Sa.style.marginRight="8px";Sa.setAttribute("type","radio");Sa.setAttribute("name","printSize");Z.appendChild(Sa);y=document.createElement("span");mxUtils.write(y,mxResources.get("crop"));Z.appendChild(y);mxEvent.addListener(Z,"click",function(){Sa.checked=+!0});U.appendChild(Z);Z=document.createElement("div");Z.style.whiteSpace="nowrap";var La=document.createElement("input");La.style.marginBottom="8px";La.style.marginRight="8px";La.setAttribute("type","radio");La.setAttribute("name","printSize");y=document.createElement("div");y.style.display="inline-block";y.style.verticalAlign="top";y.style.paddingTop="2px";y.appendChild(La);Z.appendChild(y);ba=document.createElement("table");ba.style.display="inline-block";ba.style.borderSpacing="0";Ba=document.createElement("tbody");+var Pa=document.createElement("tr"),db=Pa.cloneNode(!0),Ia=document.createElement("td"),za=Ia.cloneNode(!0),Ua=Ia.cloneNode(!0),Qa=Ia.cloneNode(!0),Ma=Ia.cloneNode(!0),Na=Ia.cloneNode(!0);Ia.style.textAlign="right";Qa.style.textAlign="right";mxUtils.write(Ia,mxResources.get("fitTo"));mxEvent.addListener(Z,"click",function(ca){mxEvent.getSource(ca)!=La&&(La.checked=!La.checked)});var xa=document.createElement("input");xa.style.margin="0 2px";xa.style.boxSizing="border-box";xa.setAttribute("value",+k.lastPrintSheetsAcross||"1");xa.setAttribute("min","1");xa.setAttribute("type","number");xa.style.width="40px";za.appendChild(xa);y=document.createElement("span");mxUtils.write(y,mxResources.get("fitToSheetsAcross"));Ua.appendChild(y);mxUtils.write(Qa,mxResources.get("fitToBy"));var Za=xa.cloneNode(!0);Za.setAttribute("value",k.lastPrintSheetsDown||"1");Ma.appendChild(Za);mxEvent.addListener(xa,"click",function(ca){La.checked=!0;mxEvent.consume(ca)});mxEvent.addListener(Za,"click",function(ca){La.checked=+!0;mxEvent.consume(ca)});k.lastPrintCropRadioChecked?Sa.checked=!0:k.lastPrintFitRadioChecked?La.checked=!0:Fa.checked=!0;y=document.createElement("span");mxUtils.write(y,mxResources.get("fitToSheetsDown"));Na.appendChild(y);Pa.appendChild(Ia);Pa.appendChild(za);Pa.appendChild(Ua);db.appendChild(Qa);db.appendChild(Ma);db.appendChild(Na);Ba.appendChild(Pa);Ba.appendChild(db);ba.appendChild(Ba);Z.appendChild(ba);U.appendChild(Z);Z=document.createElement("div");Z.style.borderTop="1px solid lightGray";+Z.style.whiteSpace="nowrap";Z.style.paddingTop="12px";Z.style.marginTop="12px";Z.style.paddingLeft="8px";mxUtils.write(Z,mxResources.get("borderWidth")+":");var Oa=document.createElement("input");Oa.setAttribute("type","number");Oa.setAttribute("min","0");Oa.style.width="40px";Oa.style.marginLeft="4px";Oa.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;Z.appendChild(Oa);y=document.createElement("span");y.style.marginLeft="8px";mxUtils.write(y,mxResources.get("zoom")++":");Z.appendChild(y);var ra=document.createElement("input");ra.style.width="60px";ra.style.marginLeft="4px";ra.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";Z.appendChild(ra);mxUtils.br(Z);var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.marginTop="12px";Da.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;Z.appendChild(Da);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("grid"));Z.appendChild(y);+mxEvent.addListener(y,"click",function(ca){Da.checked=!0;mxEvent.consume(ca)});var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.style.marginTop="12px";Ra.checked=null!=k.lastPrintShadow?k.lastPrintShadow:!1;Z.appendChild(Ra);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("shadows"));Z.appendChild(y);k.isOffline()&&!mxClient.IS_CHROMEAPP||y.appendChild(k.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));+mxEvent.addListener(y,"click",function(ca){"IMG"!=mxEvent.getSource(ca).nodeName&&(Ra.checked=!0,mxEvent.consume(ca))});Editor.enableShadowOption?null!=J&&mxUtils.br(Z):(Ra.style.display="none",y.style.display="none");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginTop="10px";x.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=J&&(Z.appendChild(x),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("transparentBackground")),+Z.appendChild(y),mxEvent.addListener(y,"click",function(ca){x.checked=!0;mxEvent.consume(ca)}));var N=document.createElement("input");N.setAttribute("type","checkbox");N.style.marginTop="10px";N.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==J||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(mxUtils.br(Z),Z.appendChild(N),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("includeCopyOfMyDiagram")),Z.appendChild(y),+mxEvent.addListener(y,"click",function(ca){N.checked=!0;mxEvent.consume(ca)}));U.appendChild(Z);y=document.createElement("div");y.style.marginTop="30px";y.style.textAlign="right";y.style.whiteSpace="nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=J||y.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Z=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});Z.className="geBtn";k.editor.cancelFirst&&y.appendChild(Z);PrintDialog.previewEnabled&&null==J&&+(ba=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),aa(!1)}catch(ca){k.handleError(ca)}}),ba.className="geBtn",y.appendChild(ba));R=null!=R?R:null!=J?"export":PrintDialog.previewEnabled?"print":"ok";R=mxUtils.button(mxResources.get(R),function(){try{k.hideDialog(),aa(!0)}catch(ca){k.handleError(ca)}});R.className="geBtn gePrimaryBtn";y.appendChild(R);k.editor.cancelFirst||y.appendChild(Z);U.appendChild(y);if(k.editor.isChromelessView()){var S=function(){Editor.isDarkMode()?+(U.classList.add("geDarkMode"),U.style.colorScheme="dark"):(U.classList.remove("geDarkMode"),U.style.colorScheme="light")};k.addListener("darkModeChanged",S);S();var Y=function(ca,ma){ca=ma.getProperty("dialog");U.parentNode==ca.container&&(k.editor.removeListener(Y),k.removeListener(S))};k.editor.addListener("hideDialog",Y)}this.container=U};var W=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 k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}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 W.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&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),+this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.6.5";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)||/.*\.cdn\.prod\.atlassian-dev\.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||"1"==urlParams.dev;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,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:{useWidth:1E3,useMaxWidth:!0,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,g,l,t,B,D,I){if(null!=c){B=null!=B?B:Error(c);B.stack=null!=B.stack?B.stack:"";D=null!=D?D: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>B.stack.indexOf("extension:")&&0>B.stack.indexOf("<anonymous>:")&&0>B.stack.indexOf("/math4/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+D+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(l)+(null!=t?":colno:"+encodeURIComponent(t):-"")+(""!=B.stack?"&stack="+encodeURIComponent(B.stack):""))}catch(L){}try{I||null==window.console||console.error(D,c,g,l,t,B)}catch(L){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var g=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=g+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(l){}};EditorUi.sendReport=function(c,g){if("1"==+"")+(""!=B.stack?"&stack="+encodeURIComponent(B.stack):""))}catch(K){}try{I||null==window.console||console.error(D,c,g,l,t,B)}catch(K){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var g=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=g+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(l){}};EditorUi.sendReport=function(c,g){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{g=null!=g?g:5E4,c.length>g&&(c=c.substring(0,g)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(l){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],g=0;g<arguments.length;g++)c.push(arguments[g]);mxClient.IS_IOS?(mxLog.show(),mxLog.debug(c.join(" "))):console.log.apply(console,c)}}catch(l){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var g=[],l=0;l<c.length;l++)g.push(c[l]);for(l=0;l<g.length;l++)EditorUi.replaceSvgImage(g[l])};EditorUi.replaceSvgImage=function(c){try{var g=null;g=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var l=EditorUi.getSvgSubtree(g);if(null!=l&&"svg"==l.nodeName){var t=l.getAttribute("width"),B=l.getAttribute("height");l.setAttribute("x",c.getAttribute("x"));l.setAttribute("y",c.getAttribute("y"));l.setAttribute("width",c.getAttribute("width"));l.setAttribute("height",c.getAttribute("height"));l.style.fontFamily="initial";0<t&&0<B&&null==l.getAttribute("viewBox")&&l.setAttribute("viewBox","0 0 "+t+" "+B);var D=mxUtils.createElementNs(l.ownerDocument,mxConstants.NS_SVG,"g");D.appendChild(l);c.hasAttribute("transform")&&D.setAttribute("transform",-c.getAttribute("transform"));c.parentNode.replaceChild(D,c)}}catch(I){}};EditorUi.getSvgSubtree=function(c){var g=Graph.getSvgFromDataUri(c);c=null;if(null!=g){c=Graph.sanitizeNode(mxUtils.parseXml(g).documentElement);g=c.getElementsByTagName("style");if(0<g.length){var l="svg-image-"+Editor.guid();c.setAttribute("id",l);for(var t=document.implementation.createHTMLDocument(""),B=document.createElement("style"),D=0;D<g.length;D++){B.textContent=g[D].textContent;t.body.appendChild(B);for(var I="",L=-0;L<B.sheet.cssRules.length;L++){var N=B.sheet.cssRules[L];if(null!=N.selectorText){for(var K=N.selectorText.split(","),da=0;da<K.length;da++)K[da]="#"+l+" "+K[da];N.selectorText=K.join(",")}I+=N.cssText+"\n"}g[D].textContent=I}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");g=c.getElementsByTagName("*");for(l=0;l<g.length;l++)g[l].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+c.getAttribute("transform"));c.parentNode.replaceChild(D,c)}}catch(I){}};EditorUi.getSvgSubtree=function(c){var g=Graph.getSvgFromDataUri(c);c=null;if(null!=g){c=Graph.sanitizeNode(mxUtils.parseXml(g).documentElement);g=c.getElementsByTagName("style");if(0<g.length){var l="svg-image-"+Editor.guid();c.setAttribute("id",l);for(var t=document.implementation.createHTMLDocument(""),B=document.createElement("style"),D=0;D<g.length;D++){B.textContent=g[D].textContent;t.body.appendChild(B);for(var I="",K=+0;K<B.sheet.cssRules.length;K++){var M=B.sheet.cssRules[K];if(null!=M.selectorText){for(var V=M.selectorText.split(","),Q=0;Q<V.length;Q++)V[Q]="#"+l+" "+V[Q];M.selectorText=V.join(",")}I+=M.cssText+"\n"}g[D].textContent=I}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");g=c.getElementsByTagName("*");for(l=0;l<g.length;l++)g[l].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.sidebarEnabled="0"!=urlParams.sidebar;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedMessageSource=null;EditorUi.prototype.defaultCompact=!1;EditorUi.prototype.noAutoFocus=!1;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;EditorUi.prototype.createButtonContainer=function(){var c=document.createElement("div");c.className="geButtonContainer";return c};EditorUi.prototype.openLink=@@ -3614,10 +3619,10 @@ function(c,g,l){return this.editor.graph.openLink(c,g,l)};EditorUi.prototype.shoc;this.fireEvent(new mxEventObject("shareCursorPositionChanged"))};EditorUi.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 g=this.editor.graph;g.mathEnabled=c;null!=g.view.backgroundImage&&(g.view.backgroundImage.destroy(),g.view.backgroundImage=null);this.editor.updateGraphComponents();g.refresh();g.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,g,l){var t=null==c||null==g;l=null!=l?l:24;var B=new Spinner({lines:12,length:l,width:Math.round(l/-3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),D=this.timeout,I=B.spin,L=null,N=null,K=mxUtils.bind(this,function(ea){null!=ea&&ea()}),da=this;B.spin=function(ea,ca,fa,la){la=null!=la?la:D;var ka=!1;if(!this.active){var V=Date.now();null!=fa&&(L=window.setTimeout(function(){B.stop();L=null;fa({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:N})},la));t&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||-0)/2,c=document.body.clientWidth/2-2);ea==document.body&&"1"==urlParams.embedInline&&(ea=da.diagramContainer,c=ea.scrollLeft+ea.clientWidth/2,g=ea.scrollTop+ea.clientHeight/2);I.call(this,ea);"1"==urlParams.embedInline&&null!=B.el&&(B.el.style.marginTop=ea.scrollTop+"px",B.el.style.marginLeft=ea.scrollLeft+"px");this.active=!0;null!=ca&&(ka=document.createElement("div"),ka.className="geSpinnerStatus",ka.setAttribute("title",ca),ea==document.body?(ka.style.left=Math.max(0,c)+"px",ka.style.top=Math.max(0,-g+66)+"px"):(ka.style.left="50%",ka.style.top="50%",ka.style.marginTop="70px"),"..."!=ca.substring(ca.length-3,ca.length)&&"!"!=ca.charAt(ca.length-1)&&(ca+="..."),ka.innerText=ca,ea.appendChild(ka),B.status=ka);this.pause=mxUtils.bind(this,function(){var k=K;this.active&&(la=Math.max(0,la-(Date.now()-V)),k=mxUtils.bind(this,function(x){this.spin(ea,ca,fa,la);if(null!=x)try{x(),N=mxUtils.bind(this,function(){this.spin(ea,ca,fa,la);try{x()}catch(J){null!=fa&&fa(J)}})}catch(J){null!=fa&&fa(J)}}));this.stop();-return k});ka=!0}return ka};var ja=B.stop;B.stop=function(){ja.call(this);this.active&&(this.active=!1,null!=L&&(window.clearTimeout(L),L=null),null!=B.status&&null!=B.status.parentNode&&B.status.parentNode.removeChild(B.status),B.status=null)};B.pause=function(){return K};return B};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var g=mxUtils.parseXml(c),l=this.editor.extractGraphModel(g.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}}catch(t){}return!1};+3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),D=this.timeout,I=B.spin,K=null,M=null,V=mxUtils.bind(this,function(ea){null!=ea&&ea()}),Q=this;B.spin=function(ea,da,ia,la){la=null!=la?la:D;var ka=!1;if(!this.active){var W=Date.now();null!=ia&&(K=window.setTimeout(function(){B.stop();K=null;ia({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:M})},la));t&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||+0)/2,c=document.body.clientWidth/2-2);ea==document.body&&"1"==urlParams.embedInline&&(ea=Q.diagramContainer,c=ea.scrollLeft+ea.clientWidth/2,g=ea.scrollTop+ea.clientHeight/2);I.call(this,ea);"1"==urlParams.embedInline&&null!=B.el&&(B.el.style.marginTop=ea.scrollTop+"px",B.el.style.marginLeft=ea.scrollLeft+"px");this.active=!0;null!=da&&(ka=document.createElement("div"),ka.className="geSpinnerStatus",ka.setAttribute("title",da),ea==document.body?(ka.style.left=Math.max(0,c)+"px",ka.style.top=Math.max(0,+g+66)+"px"):(ka.style.left="50%",ka.style.top="50%",ka.style.marginTop="70px"),"..."!=da.substring(da.length-3,da.length)&&"!"!=da.charAt(da.length-1)&&(da+="..."),ka.innerText=da,ea.appendChild(ka),B.status=ka);this.pause=mxUtils.bind(this,function(){var k=V;this.active&&(la=Math.max(0,la-(Date.now()-W)),k=mxUtils.bind(this,function(y){this.spin(ea,da,ia,la);if(null!=y)try{y(),M=mxUtils.bind(this,function(){this.spin(ea,da,ia,la);try{y()}catch(J){null!=ia&&ia(J)}})}catch(J){null!=ia&&ia(J)}}));this.stop();+return k});ka=!0}return ka};var ja=B.stop;B.stop=function(){ja.call(this);this.active&&(this.active=!1,null!=K&&(window.clearTimeout(K),K=null),null!=B.status&&null!=B.status.parentNode&&B.status.parentNode.removeChild(B.status),B.status=null)};B.pause=function(){return V};return B};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var g=mxUtils.parseXml(c),l=this.editor.extractGraphModel(g.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}}catch(t){}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 g=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=g.getFunction,t=this.editor.graph,B=this;g.getFunction=function(D){if(t.isSelectionEmpty()&&null!=B.pages&&0<B.pages.length){var I=B.getSelectedPageIndex();if(mxEvent.isShiftDown(D)){if(37==D.keyCode)return function(){0<I&&B.movePage(I,I-1)};if(38==D.keyCode)return function(){0<I&&B.movePage(I,0)};if(39==D.keyCode)return function(){I<B.pages.length-1&&B.movePage(I,I+1)};if(40==D.keyCode)return function(){I<B.pages.length-1&&B.movePage(I,B.pages.length-1)}}else if(mxEvent.isControlDown(D)||mxClient.IS_MAC&&@@ -3626,580 +3631,587 @@ arguments):null}}return g};var d=EditorUi.prototype.extractGraphModelFromHtml;Edg=null!=D?mxUtils.getXml(D):""}}catch(I){}return g};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var g=c.indexOf('<meta charset="utf-8">');0<=g&&(c=c.slice(0,g)+'<meta charset="utf-8"/>'+c.slice(g+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,g){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",g);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=null!=c?this.editor.extractGraphModel(c,!0):null;null!=l&&(c=l);if(null!=c){l=this.editor.graph;l.model.beginUpdate();try{var t=null!=this.pages?this.pages.slice():null,B=c.getElementsByTagName("diagram");if(1<B.length||1==B.length&&B[0].hasAttribute("name")){this.fileNode=c;l.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var D=B.length-1;0<=D;D--){var I=this.updatePageRoot(new DiagramPage(B[D]));null==I.getName()&&I.setName(mxResources.get("pageWithNumber",[D+1]));l.model.execute(new ChangePage(this,I,0==D?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])),l.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,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=-t)for(D=0;D<t.length;D++)l.model.execute(new ChangePage(this,t[D],null));var L=this.getCurrentFile();null!=L&&L.fileReplaced(g)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){g=null!=g?g:this.editor.graph;B=null!=B?B:!1;N=null!=N?N:!0;K=null!=K?K:this.defaultCompact;da=null!=da?da:!Editor.defaultCompressed;var ca=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var fa="_blank";else ca=fa=t;if(null==c)return"";var la=-c;if("mxfile"!=la.nodeName.toLowerCase()){if(da){var ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());ka.appendChild(c)}else{ka=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(ka);if(Graph.decompress(la)!=ka)return ka;ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());mxUtils.setTextContent(ka,la)}la=c.ownerDocument.createElement("mxfile");-la.appendChild(ka)}K?(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?+t)for(D=0;D<t.length;D++)l.model.execute(new ChangePage(this,t[D],null));var K=this.getCurrentFile();null!=K&&K.fileReplaced(g)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){g=null!=g?g:this.editor.graph;B=null!=B?B:!1;M=null!=M?M:!0;V=null!=V?V:this.defaultCompact;Q=null!=Q?Q:!Editor.defaultCompressed;var da=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var ia="_blank";else da=ia=t;if(null==c)return"";var la=+c;if("mxfile"!=la.nodeName.toLowerCase()){if(Q){var ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());ka.appendChild(c)}else{ka=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(ka);if(Graph.decompress(la)!=ka)return ka;ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());mxUtils.setTextContent(ka,la)}la=c.ownerDocument.createElement("mxfile");+la.appendChild(ka)}V?(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!=ja&&(la=la.cloneNode(!0),la.setAttribute("scale",ja));null!=ea&&(la=la.cloneNode(!0),la.setAttribute("border",ea));-c=da?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!D&&!B&&(I||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(la),g,null!=l?l.getTitle():null,fa,ca);else if(D||!B&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(t=null),l=this.getSvgFileProperties(la),c=this.getEmbeddedSvg(c,g,t,null,L,N,ca,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,t){c=null!=-c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var B=this.editor.getGraphXml(c,t);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(N){var K=N.getElementsByTagName("mxGraphModel"),da=0<K.length?K[0]:null;K=N;null==da&&l?(da=mxUtils.getNodeValue(N),0<da.length&&(da=Graph.decompress(da),null!=da&&0<da.length&&(K=N.cloneNode(!1),K.appendChild(mxUtils.parseXml(da).documentElement)))):null==da||l?K=N.cloneNode(!0):(K=N.cloneNode(!1),mxUtils.setTextContent(K,Graph.compressNode(da)));-B.appendChild(K)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(B),B=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var D=this.pages[g],I=D.node;if(D!=this.currentPage)if(D.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(D.root));this.editor.graph.saveViewState(D.viewState,L,null,t);EditorUi.removeChildNodes(I);I.appendChild(L);delete D.needsUpdate}else t&&(this.updatePageRoot(D),-null!=D.viewState.backgroundImage&&null!=D.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(D.root)),this.editor.graph.saveViewState(D.viewState,L,null,t,D),I=I.cloneNode(!1),I.appendChild(L)));c(I)}return B};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],t=0;t<c.length;t++){var B=c.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(B)?l.push(B):isNaN(parseInt(B))?B.toLowerCase()!=B?l.push(String.fromCharCode(65+Math.round(25*-Math.random()))):B.toUpperCase()!=B?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(B)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));-c[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(D){c[EditorUi.DIFF_INSERT][g].data=D.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var t in c[EditorUi.DIFF_UPDATE]){var B=c[EditorUi.DIFF_UPDATE][t];null!=B.name&&(B.name=this.anonymizeString(B.name));null!=B.cells&&(g=mxUtils.bind(this,function(D){var I=B.cells[D];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 B.cells[D]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(B.cells)&&delete B.cells);mxUtils.isEmptyObject(B)&&delete c[EditorUi.DIFF_UPDATE][t]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&-c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(c,g){g=c.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&g[l].setAttribute("value","["+g[l].getAttribute("value").length+"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+-"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length+"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&g.invalidChecksum?-g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=-function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){B=null!=B?B:!0;D=null!=D?D:!1;K=null!=K?K:!Editor.defaultCompressed;var ca=this.editor.graph;if((g||!c&&null!=N&&/(\.svg)$/i.test(N.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var fa=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(ka){return"page"==ka&&null!=la?la.getName():"pagenumber"==ka?1:fa.apply(this,arguments)};document.body.appendChild(ca.container);null!=la&&ca.model.setRoot(la.root)}I=null!=I?I:this.getXmlFileData(B,D,K,da);N=null!=N?N:this.getCurrentFile();c=this.createFileData(I,ca,N,window.location.href,c,g,l,t,B,L,K,ja,ea);ca!=this.editor.graph&&ca.container.parentNode.removeChild(ca.container);-return c};EditorUi.prototype.getHtml=function(c,g,l,t,B,D){D=null!=D?D:!0;var I=null,L=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=g){I=D?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var N=g.view.scale;D=Math.floor(I.x/N-g.view.translate.x);N=Math.floor(I.y/N-g.view.translate.y);I=g.background;null==B&&(g=this.getBasenames().join(";"),0<g.length&&(L=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",D);c.setAttribute("y0",N)}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!=t&&c.setAttribute("edit",t));null!=B&&(B=B.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";t=Graph.compress(c);Graph.decompress(t)!=c&&(t=encodeURIComponent(c));return(null==B?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=B?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+-(null==B?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=B?'<meta http-equiv="refresh" content="0;URL=\''+B+"'\"/>\n":"")+"</head>\n<body"+(null==B&&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;">'+t+"</div>\n</div>\n"+(null==B?'<script type="text/javascript" src="'+L+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+-B+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,g,l,t,B){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=B&&(B=B.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==B?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=B?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==B?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=B?'<meta http-equiv="refresh" content="0;URL=\''+B+"'\"/>\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==B?'<script type="text/javascript" src="'+g+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+B+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.updateFileVars=function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=-null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(g){}};EditorUi.prototype.setFileData=function(c,g){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,-!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var t=this.getHashObject(),B=null;this.fileNode=g;this.editor.graph.defaultExportLinkTarget=g.getAttribute("linkTarget");this.pages=[];for(var D=0;D<c.length;D++){null==c[D].getAttribute("id")&&c[D].setAttribute("id",D);g=new DiagramPage(c[D]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[D+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)B=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=B?B: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 I=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(D=0;D<I.length;D++)g[I[D]]=!0;var L=this.editor.graph.getModel(),N=L.getChildren(L.root);for(D=0;D<N.length;D++){var K=N[D];L.setVisible(K,g[K.id]||!1)}}catch(da){}};EditorUi.prototype.fileStats=function(c,g){try{if(null!=-c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=g.getElementsByTagName("diagram");g={};g.modified=c.getLastModifiedDate();g.fileMode=c.getMode();g.fileSize=c.getSize();g.fileHash=c.getHash();g.pages=l.length;g.redundantStencils=0;g.redundantImages=0;g.redundantSize=0;g.stencils=0;g.images=0;for(var t=g.cells=0;t<l.length;t++){var B=l[t].getElementsByTagName("mxCell");g.cells+=B.length;for(var D={},I=0;I<B.length;I++){var L=B[I].getAttribute("style");if(null!=L)for(var N=-L.split(";"),K=0;K<N.length;K++){var da=N[K];if(da.startsWith("image=data:")||da.startsWith("shape=stencil("))null==D[da]?D[da]=1:D[da]++}}for(var ja in D){var ea=D[ja];ja.startsWith("shape=stencil(")?g.stencils+=ea:g.images+=ea;1<ea&&(g.redundantSize+=ja.length*(ea-1),ja.startsWith("shape=stencil(")?g.redundantStencils+=ea-1:g.redundantImages+=ea-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(g)})}}catch(ca){}};-EditorUi.prototype.getBaseFilename=function(c){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(".")));!c&&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(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la,ka){try{t=null!=t?t:this.editor.graph.isSelectionEmpty();var V=this.getBaseFilename(!B),k=V+("xml"==c||"pdf"==c&&da?".drawio":"")+"."+c;if("xml"==c){var x=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,B,null,null,null,g);this.saveData(k,c,x,"text/xml")}else if("html"==c)x=this.getHtml2(this.getFileData(!0),this.editor.graph,V),this.saveData(k,c,x,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,-mxResources.get("export")))"xmlpng"==c?k=V+".png":"jpeg"==c&&(k=V+".jpg"),this.saveRequest(k,c,mxUtils.bind(this,function(W,U){try{return this.createDownloadRequest(W,c,t,U,I,B,L,N,K,da,ja,void 0,void 0,!D,ea,ca,fa,la,ka)}catch(aa){this.handleError(aa)}}));else{var J=null,R=mxUtils.bind(this,function(W){W.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(J)}))});-if("svg"==c){var Y=this.editor.graph.background;if(I||Y==mxConstants.NONE)Y=null;var Z=this.editor.graph.getSvg(Y,null,null,null,null,t);l&&this.editor.graph.addSvgShadow(Z);this.editor.convertImages(Z,mxUtils.bind(this,mxUtils.bind(this,function(W){this.spinner.stop();R(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(W))})))}else k=V+".svg",J=this.getFileData(!1,!0,null,mxUtils.bind(this,function(W){this.spinner.stop();R(W)}),t)}}catch(W){this.handleError(W)}};EditorUi.prototype.createDownloadRequest=-function(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la,ka,V,k){c=this.downloadRequestBuilder(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la,ka,V,k);g="";for(var x in c)l=c[x],null!=l&&(g+=x+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la,ka,V,k){var x=this.editor.graph,J=x.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==D?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var R=-null,Y=null,Z=null;if(!EditorUi.isElectronApp&&(J.width*J.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};K=K?"1":"0";"pdf"==g&&(null!=da?(R=da.from,Y=da.to):0==D&&(Z="1"));"xmlpng"==g&&(K="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(D=0;D<this.pages.length;D++)if(this.pages[D]==this.currentPage){R=D;break}D=x.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!B?B||null!=D&&D!=mxConstants.NONE||(D="#ffffff"):D=mxConstants.NONE;-B={globalVars:x.getExportVariables()};null!=da&&null!=da.from&&(B.globalVars.pagenumber=da.from+1);N&&(B.grid={size:x.gridSize,steps:x.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:x.view.gridColor});Graph.translateDiagram&&(B.diagramLanguage=Graph.diagramLanguage);return{format:g,from:R,to:Y,allPages:Z,bg:null!=D?D:mxConstants.NONE,base64:t,embedXml:K,xml:l,filename:null!=c?c:"",extras:JSON.stringify(B),scale:I,border:L,pageMargin:fa,w:ja&&isFinite(ja)?-ja:null,h:ea&&isFinite(ea)?ea:null,crop:null!=ca&&ca?"1":"0",fit:null!=la&&la?"1":"0",shadows:null!=k&&k?"1":"0",sheetsAcross:ka,sheetsDown:V}};EditorUi.prototype.setMode=function(c,g){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 g=c.indexOf("#");0<=g&&(c=c.substring(0,g))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,g={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");-if(0<l){c=decodeURIComponent(c.substring(l+1));try{g=JSON.parse(c)}catch(t){}}}return g};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 g=window.location.hash;if(null==g||""==g)g="#";var l=g.lastIndexOf("#");0<l&&(g=g.substring(0,-l));try{null==c||mxUtils.isEmptyObject(c)||(g=g+"#"+encodeURIComponent(JSON.stringify(c)))}catch(t){}0<l&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=function(c,g,l){var t=window.location.hash,B=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 t};this.fileLoaded(I);"csv"==c.format&&this.importCsv(L,mxUtils.bind(this,function(ea){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var N=null!=c.interval?parseInt(c.interval):6E4,K=null,da=mxUtils.bind(this,function(){var ea=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(ca){ea===this.currentPage&&(200<=ca.getStatus()&&300>=-ca.getStatus()?(this.updateDiagram(ca.getText()),ja()):this.handleError({message:mxResources.get("error")+" "+ca.getStatus()}))}),mxUtils.bind(this,function(ca){this.handleError(ca)}))}),ja=mxUtils.bind(this,function(){window.clearTimeout(K);K=window.setTimeout(da,N)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ja();da()}));ja();da()}null!=g&&g()});if(null!=c.url&&0<c.url.length){var D=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(D,mxUtils.bind(this,function(I){B(I)}),-mxUtils.bind(this,function(I){null!=l&&l(I)}))}else B("")};EditorUi.prototype.updateDiagram=function(c){function g(x){var J=new mxCellOverlay(x.image||B.warningImage,x.tooltip,x.align,x.valign,x.offset);J.addListener(mxEvent.CLICK,function(R,Y){t.alert(x.tooltip)});return J}var l=null,t=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var B=this.editor.graph,D=B.getModel();D.beginUpdate();var I=null;try{for(c=c.firstChild;null!=-c;){if("update"==c.nodeName){var L=D.getCell(c.getAttribute("id"));if(null!=L){try{var N=c.getAttribute("value");if(null!=N){var K=mxUtils.parseXml(N).documentElement;if(null!=K)if("1"==K.getAttribute("replace-value"))D.setValue(L,K);else for(var da=K.attributes,ja=0;ja<da.length;ja++)B.setAttributeForCell(L,da[ja].nodeName,0<da[ja].nodeValue.length?da[ja].nodeValue:null)}}catch(x){null!=window.console&&console.log("Error in value for "+L.id+": "+x)}try{var ea=c.getAttribute("style");null!=ea&&B.model.setStyle(L,-ea)}catch(x){null!=window.console&&console.log("Error in style for "+L.id+": "+x)}try{var ca=c.getAttribute("icon");if(null!=ca){var fa=0<ca.length?JSON.parse(ca):null;null!=fa&&fa.append||B.removeCellOverlays(L);null!=fa&&B.addCellOverlay(L,g(fa))}}catch(x){null!=window.console&&console.log("Error in icon for "+L.id+": "+x)}try{var la=c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var ka=B.getCellGeometry(L);if(null!=ka){ka=ka.clone();for(key in la){var V=parseFloat(la[key]);"dx"==key?-ka.x+=V:"dy"==key?ka.y+=V:"dw"==key?ka.width+=V:"dh"==key?ka.height+=V:ka[key]=parseFloat(la[key])}B.model.setGeometry(L,ka)}}}catch(x){null!=window.console&&console.log("Error in icon for "+L.id+": "+x)}}}else if("model"==c.nodeName){for(var k=c.firstChild;null!=k&&k.nodeType!=mxConstants.NODETYPE_ELEMENT;)k=k.nextSibling;null!=k&&(new mxCodec(c.firstChild)).decode(k,D)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(B.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||-c.hasAttribute("dy"))B.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{D.endUpdate()}null!=I&&this.chromelessResize&&this.chromelessResize(!0,I)}return l};EditorUi.prototype.getCopyFilename=function(c,g){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var t=l.lastIndexOf(".");0<=t&&(c=l.substring(t),l=-l.substring(0,t));if(g){g=l;var B=new Date;l=B.getFullYear();t=B.getMonth()+1;var D=B.getDate(),I=B.getHours(),L=B.getMinutes();B=B.getSeconds();l=g+(" "+(l+"-"+t+"-"+D+"-"+I+"-"+L+"-"+B))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=function(c,g){try{null!=c&&g&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,g,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[g]);var t=this.getCurrentFile();this.fileEditable=-this.fileLoadedError=null;this.setCurrentFile(null);var B=!1;this.hideDialog();null!=t&&(t.removeListener(this.descriptorChangedListener),this.logIfModified(t,!0),t.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var D=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=t&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!g&&null!=window.location.hash&&0<window.location.hash.length&&-(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();g||("0"!=urlParams.splash?this.showSplash():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=c)try{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.clearStatus():this.updateStatus(mxUtils.bind(this,function(){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||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));B=!0;if(!this.isOffline()&&null!=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.logEvent({category:c.getMode().toUpperCase()+-"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+I})}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(N){}c=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)||D():D()});g?c():(null!=L.fallbackFileData&&(L.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var N=new LocalFile(this,L.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(N)})}),this.handleError(L,mxResources.get("errorLoadingFile"),-c,!0,null,null,!0))}else D();return B};EditorUi.prototype.getHashValueForPages=function(c,g){var l=0,t=new mxGraphModel,B=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var D=0;D<c.length;D++){this.updatePageRoot(c[D]);var I=c[D].node.cloneNode(!1);I.removeAttribute("name");t.root=c[D].root;var L=B.encode(t);this.editor.graph.saveViewState(c[D].viewState,L,!0);L.removeAttribute("pageWidth");L.removeAttribute("pageHeight");I.appendChild(L);null!=g&&(g.eltCount+=I.getElementsByTagName("*").length,-g.nodeCount+=I.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(I,function(N,K,da,ja){return!ja||"mxGeometry"!=N.nodeName&&"mxPoint"!=N.nodeName||"x"!=K&&"y"!=K&&"width"!=K&&"height"!=K?ja&&"mxCell"==N.nodeName&&"previous"==K?null:da:Math.round(da)},g)<<0}return l};EditorUi.prototype.hashValue=function(c,g,l){var t=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(t^=this.hashValue(c.nodeName,-g,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var B=0;B<c.attributes.length;B++){var D=c.attributes[B].name,I=null!=g?g(c,D,c.attributes[B].value,!0):c.attributes[B].value;null!=I&&(t^=this.hashValue(D,g,l)+this.hashValue(I,g,l))}}if(null!=c.childNodes)for(B=0;B<c.childNodes.length;B++)t=(t<<5)-t+this.hashValue(c.childNodes[B],g,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);g=0;null!=l&&(l.byteCount+=c.length);for(B=0;B<c.length;B++)g=(g<<5)-g+c.charCodeAt(B)<<-0;t^=g}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,g,l,t,B,D,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){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;-this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var g=0;g<c.length;g++)null!=c[g].xml&&"<"!=c[g].xml.charAt(0)&&(c[g].xml=mxUtils.trim(Graph.decompress(c[g].xml)));g=mxUtils.createXmlDocument();var l=g.createElement("mxlibrary");mxUtils.setTextContent(l,JSON.stringify(c,null,2));g.appendChild(l);return mxUtils.getXml(g,"\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 g=this.sidebar.palettes[c];if(null!=g){for(var l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,g){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||-null!=c||!g){null==c&&(g=this.sidebar.palettes["L.scratchpad"],null==g&&(g=this.sidebar.palettes.search),null!=g&&(c=g[g.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;g=l.lastChild;var t=g.previousSibling;l.insertBefore(g,c);l.insertBefore(t,g)}};EditorUi.prototype.loadLibrary=function(c,g){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var t=JSON.parse(mxUtils.getTextContent(l.documentElement));this.libraryLoaded(c,t,l.documentElement.getAttribute("title"),-g,l.documentElement.getAttribute("tags"))}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.showSearchWindow=function(c,g){var l=c?"findReplace":"find",t=l+"Window";if(null==this[t]){var B="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,-D=c?B?330:300:240;this[t]=new FindWindow(this,document.body.offsetWidth-(D+20),100,D,c?B?304:288:180,c);this[t].window.addListener("show",function(){this.fireEvent(new mxEventObject(l))});this[t].window.addListener("hide",function(){this.fireEvent(new mxEventObject(l))});this[t].window.setVisible(!0)}else null==g&&this[t].window.setVisible(!this[t].window.isVisible());null!=g&&(this[t].doSearch(g),this[t].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,g,l,t,B){if(null!=this.sidebar){c.constructor!=-LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var D=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var I=0;I<this.openLibraries.length;I++)if(this.openLibraries[I].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[I],this.openLibraries);break}D={file:c,images:g,title:l,expand:t};this.openLibraries.push(D)}else this.scratchpad=c;I=this.sidebar.palettes[c.getHash()];I=null!=I?I[I.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());-var L=null,N=mxUtils.bind(this,function(k,x){0==k.length&&c.isEditable()?(null==L&&(L=document.createElement("div"),L.className="geDropTarget",mxUtils.write(L,mxResources.get("dragElementsHere"))),x.appendChild(L)):this.addLibraryEntries(k,x)});null!=this.sidebar&&null!=g&&this.sidebar.addEntries(g,B);null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var K=this.sidebar.addPalette(c.getHash(),l,null!=t?t:!0,mxUtils.bind(this,function(k){N(g,k)}));null!=D&&-(D.div=K);this.repositionLibrary(I,"L.scratchpad"!=c.getHash());t=K.parentNode.previousSibling;l=t.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&t.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var da=document.createElement("div");da.style.backgroundColor="inherit";t.style.position="relative";var ja=document.createElement("img");ja.className="geLibraryButton";ja.setAttribute("src",Editor.crossImage);ja.setAttribute("title",mxResources.get("close"));var ea=null;if(".scratchpad"!=-c.title||this.closableScratchpad)da.appendChild(ja),mxEvent.addListener(ja,"click",mxUtils.bind(this,function(k){if(!mxEvent.isConsumed(k)){var x=mxUtils.bind(this,function(){null!=D&&mxUtils.remove(D,this.openLibraries);this.closeLibrary(c)});null!=ea?this.confirm(mxResources.get("allChangesLost"),null,x,mxResources.get("cancel"),mxResources.get("discardChanges")):x();mxEvent.consume(k)}}));if(c.isEditable()){var ca=this.editor.graph,fa=null;l=mxUtils.bind(this,function(k){this.showLibraryDialog(c.getTitle(),-K,g,c,c.getMode());mxEvent.consume(k)});var la=mxUtils.bind(this,function(k){c.setModified(!0);c.isAutosave()?(null!=fa&&null!=fa.parentNode&&fa.parentNode.removeChild(fa),fa=ja.cloneNode(!1),fa.setAttribute("src",Editor.spinImage),fa.setAttribute("title",mxResources.get("saving")),fa.style.cursor="default",fa.style.marginRight="2px",fa.style.marginTop="-2px",da.insertBefore(fa,da.firstChild),this.saveLibrary(c.getTitle(),g,c,c.getMode(),!0,!0,function(){null!=fa&&null!=fa.parentNode&&fa.parentNode.removeChild(fa)})):-null==ea&&(ea=ja.cloneNode(!1),ea.setAttribute("src",Editor.saveImage),ea.setAttribute("title",mxResources.get("save")),da.insertBefore(ea,da.firstChild),mxEvent.addListener(ea,"click",mxUtils.bind(this,function(x){this.saveLibrary(c.getTitle(),g,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==ea||c.isModified()||(ea.parentNode.removeChild(ea),ea=null)});mxEvent.consume(x)})))}),ka=mxUtils.bind(this,function(k,x,J,R){k=ca.cloneCells(mxUtils.sortCells(ca.model.getTopmostCells(k)));for(var Y=-0;Y<k.length;Y++){var Z=ca.getCellGeometry(k[Y]);null!=Z&&Z.translate(-x.x,-x.y)}K.appendChild(this.sidebar.createVertexTemplateFromCells(k,x.width,x.height,R||"",!0,null,!1));k=mxUtils.getXml(this.editor.graph.encodeCells(k));Editor.defaultCompressed&&(k=Graph.compress(k));x={xml:k,w:x.width,h:x.height};null!=R&&(x.title=R);g.push(x);la(J);null!=L&&null!=L.parentNode&&0<g.length&&(L.parentNode.removeChild(L),L=null)}),V=mxUtils.bind(this,function(k){if(ca.isSelectionEmpty())ca.getRubberband().isActive()?-(ca.getRubberband().execute(k),ca.getRubberband().reset()):null!=k&&mxEvent.getSource(k).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var x=ca.getSelectionCells(),J=ca.view.getBounds(x);if(null!=J&&0<J.width&&0<J.height){var R=ca.view.scale;J.x/=R;J.y/=R;J.width/=R;J.height/=R;J.x-=ca.view.translate.x;J.y-=ca.view.translate.y;ka(x,J)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),-mxResources.get("ok"))}mxEvent.consume(k)});mxEvent.addGestureListeners(K,function(){},mxUtils.bind(this,function(k){ca.isMouseDown&&null!=ca.panningManager&&null!=ca.graphHandler.first&&(ca.graphHandler.suspend(),null!=ca.graphHandler.hint&&(ca.graphHandler.hint.style.visibility="hidden"),K.style.backgroundColor="light-dark(#fefefe, #000000)",K.style.cursor="copy",ca.panningManager.stop(),ca.autoScroll=!1,mxEvent.consume(k))}),mxUtils.bind(this,function(k){ca.isMouseDown&&null!=ca.panningManager&&-null!=ca.graphHandler&&(K.style.backgroundColor="",K.style.cursor="default",this.sidebar.showTooltips=!0,ca.panningManager.stop(),ca.graphHandler.reset(),ca.isMouseDown=!1,ca.autoScroll=!0,V(k),mxEvent.consume(k))}));mxEvent.addListener(K,"mouseleave",mxUtils.bind(this,function(k){ca.isMouseDown&&null!=ca.graphHandler.first&&(ca.graphHandler.resume(),null!=ca.graphHandler.hint&&(ca.graphHandler.hint.style.visibility="visible"),K.style.backgroundColor="",K.style.cursor="",ca.autoScroll=!0)}));Graph.fileSupport&&-(mxEvent.addListener(K,"dragover",mxUtils.bind(this,function(k){K.style.backgroundColor="light-dark(#fefefe, #000000)";k.dataTransfer.dropEffect="copy";K.style.cursor="copy";this.sidebar.hideTooltip();k.stopPropagation();k.preventDefault()})),mxEvent.addListener(K,"drop",mxUtils.bind(this,function(k){K.style.cursor="";K.style.backgroundColor="";0<k.dataTransfer.files.length&&this.importFiles(k.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(x,J,R,Y,Z,W,U,aa,ia){if(null!=x&&"image/"==-J.substring(0,6))x="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(x),x=[new mxCell("",new mxGeometry(0,0,Z,W),x)],x[0].vertex=!0,ka(x,new mxRectangle(0,0,Z,W),k,mxEvent.isAltDown(k)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g," ")),null!=L&&null!=L.parentNode&&0<g.length&&(L.parentNode.removeChild(L),L=null);else{var na=!1,qa=mxUtils.bind(this,function(ta,ua){null!=ta&&"application/pdf"==ua&&(ua=Editor.extractGraphModelFromPdf(ta),-null!=ua&&0<ua.length&&(ta=ua));if(null!=ta)if(ta=mxUtils.parseXml(ta),"mxlibrary"==ta.documentElement.nodeName)try{var Ba=JSON.parse(mxUtils.getTextContent(ta.documentElement));N(Ba,K);g=g.concat(Ba);la(k);this.spinner.stop();na=!0}catch(Ra){}else if("mxfile"==ta.documentElement.nodeName)try{var za=ta.documentElement.getElementsByTagName("diagram");for(Ba=0;Ba<za.length;Ba++){var Aa=this.stringToCells(Editor.getDiagramNodeXml(za[Ba])),Ga=this.editor.graph.getBoundingBoxFromGeometry(Aa);null!=Ga&&-ka(Aa,new mxRectangle(0,0,Ga.width,Ga.height),k)}na=!0}catch(Ra){null!=window.console&&console.log("error in drop handler:",Ra)}na||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=L&&null!=L.parentNode&&0<g.length&&(L.parentNode.removeChild(L),L=null)});null!=ia&&null!=U&&EditorUi.isVisioFilename(U)?this.importVisio(ia,function(ta){qa(ta,"text/xml")},null,U):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(x,U)&&null!=ia?this.isExternalDataComms()?this.parseFile(ia,-mxUtils.bind(this,function(ta){4==ta.readyState&&(this.spinner.stop(),200<=ta.status&&299>=ta.status?qa(ta.responseText,"text/xml"):this.handleError({message:mxResources.get(413==ta.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):qa(x,J)}}));k.stopPropagation();k.preventDefault()})),mxEvent.addListener(K,"dragleave",function(k){K.style.cursor="";K.style.backgroundColor=-"";k.stopPropagation();k.preventDefault()}));ja=ja.cloneNode(!1);ja.setAttribute("src",Editor.editImage);ja.setAttribute("title",mxResources.get("edit"));da.insertBefore(ja,da.firstChild);mxEvent.addListener(ja,"click",l);l=ja.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));da.insertBefore(l,da.firstChild);mxEvent.addListener(l,"click",V);".scratchpad"==c.title&&(this.addSelectionToScratchpad=V);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||-(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",da.insertBefore(l,da.firstChild))}t.appendChild(da);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,g){for(var l=0;l<c.length;l++)try{var t=c[l],B=t.data;if(null!=B){B="data:"==B.substring(0,5)?this.convertDataUri(B):B;var D="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==t.aspect&&(D+="aspect=fixed;");D=D+"image="+B+-";";null!=t.style&&(D+=t.style);g.appendChild(this.sidebar.createVertexTemplate(D,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var I=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),L=0==I.length?mxResources.get("drawingEmpty"):null!=t.title?t.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(I,t.w,t.h,L,!0,null,!0))}}catch(N){L=null!=N.message?mxResources.get("error")+": "+N.message:String(N),D=this.sidebar.createVertexTemplateFromCells(null,t.w,-t.h,L,!0,null,!0),g.appendChild(D)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,g,l,t,B,D,I){c=new ImageDialog(this,c,g,-l,t,B,D,I);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,g,l,t,B,D){var I=localStorage.getItem(g);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!=D&&D(L),L==I)this.hideDialog();else{if(0<L.length){var N=JSON.parse(L);localStorage.setItem(g,JSON.stringify(N))}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,B,l,t);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,g,l,t){c=null!=c?c:mxUtils.bind(this,function(B,D,I,L){D||(B=new ChangePageSetup(this,t?I:null,B),B.ignoreColor=!t,null!=L&&t&&(B.shadowVisible=L),this.editor.graph.model.execute(B))});c=new BackgroundImageDialog(this,c,g,l,t);this.showDialog(c.container,400,-t?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,g,l,t,B){c=new LibraryDialog(this,c,g,l,t,B);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(D){D&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var m=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var g=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&-g.refresh()}));return g};EditorUi.prototype.handleError=function(c,g,l,t,B,D,I){var L=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},N=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(ea){}if(null!=-N||null!=g){I=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var K=mxResources.get("ok"),da=null;g=null!=g?g:mxResources.get("error");if(null!=N){null!=N.retry&&(K=mxResources.get("cancel"),da=function(){L();N.retry()});if(404==N.code||404==N.status||403==N.code){I=403==N.code?null!=N.message?mxUtils.htmlEntities(N.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=B?B:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?-" ("+this.drive.user.email+")":""),!1);var ja=null!=B?null:null!=D?D:window.location.hash;if(null!=ja&&("#G"==ja.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==ja.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==N.code||404==N.status)){ja="#U"==ja.substring(0,2)?ja.substring(45,ja.lastIndexOf("%26ex")):ja.substring(2);-this.showError(g,I,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ja);null!=t&&t()}),da,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ea(){ka.innerText="";for(var V=0;V<ca.length;V++){var k=document.createElement("option");mxUtils.write(k,ca[V].displayName);k.value=V;ka.appendChild(k);k=document.createElement("option");k.innerHTML=" ";mxUtils.write(k,"<"+ca[V].email+">");k.setAttribute("disabled",-"disabled");ka.appendChild(k)}k=document.createElement("option");mxUtils.write(k,mxResources.get("addAccount"));k.value=ca.length;ka.appendChild(k)}var ca=this.drive.getUsersList(),fa=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");fa.appendChild(la);var ka=document.createElement("select");ka.style.width="100%";ea();mxEvent.addListener(ka,"change",mxUtils.bind(this,function(){var V=ka.value,k=ca.length!=-V;k&&this.drive.setUser(ca[V]);this.drive.authorize(k,mxUtils.bind(this,function(){k||(ca=this.drive.getUsersList(),ea())}),mxUtils.bind(this,function(x){this.handleError(x)}),!0)}));fa.appendChild(ka);fa=new CustomDialog(this,fa,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(fa.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=N.message?I=""==N.message&&null!=-N.name?mxUtils.htmlEntities(N.name,!1):mxUtils.htmlEntities(N.message,!1):null!=N.response&&null!=N.response.error?I=mxUtils.htmlEntities(N.response.error,!1):"undefined"!==typeof window.App&&(N.code==App.ERROR_TIMEOUT?I=mxUtils.htmlEntities(mxResources.get("timeout"),!1):N.code==App.ERROR_BUSY?I=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof N&&0<N.length&&(I=mxUtils.htmlEntities(N,!1)))}B=c=null;null!=N&&null!=N.helpLink?(c=mxResources.get("help"),B=mxUtils.bind(this,function(){return this.editor.graph.openLink(N.helpLink)})):-null!=N&&null!=N.ownerEmail?(c=mxResources.get("contactOwner"),I+=mxUtils.htmlEntities(" ("+c+": "+N.ownerEmail+")",!1),B=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(N.ownerEmail))})):null!=N&&null!=N.alternateAction&&(c=N.alternateAction.label,B=N.alternateAction.funct);this.showError(g,I,K,l,da,null,null,c,B,null,null,null,t?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,g,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),g);this.showDialog(c.container,-l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,g,l,t,B,D){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!=g&&g()},function(){I();null!=l&&l()},t,B,null,null,null,null,L);this.showDialog(c.container,340,46+L,!0,D);c.init()};EditorUi.prototype.showBanner=function(c,g,l,t,B,D,I,L,N){D=!1;if(!(this.bannerShowing||this["hideBanner"+-c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){I=null!=I?I:"translate(-50%,120%)";L=null!=L?L:"translate(-50%,0%)";var K=document.createElement("div");K.className="geBtn gePrimaryBtn geBanner"+(B?" geSmallBanner":"");K.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(K.style,"transform",I);mxUtils.setPrefixedStyle(K.style,"transition","all 1000ms ease");null!=N&&mxUtils.setPrefixedStyle(K.style,"transform-origin",N);N=N=document.createElement("img");-N.setAttribute("src",Editor.crossImage);N.setAttribute("title",mxResources.get(t?"doNotShowAgain":"close"));N.setAttribute("border","0");B||(D=document.createElement("img"),D.setAttribute("src",IMAGE_PATH+"/logo.png"),D.setAttribute("border","0"),D.setAttribute("align","absmiddle"),D.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",K.appendChild(D),N.style.cssText=(B?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",-K.appendChild(N));mxUtils.write(K,g);document.body.appendChild(K);this.bannerShowing=!0;B&&(N.className="geLibraryButton",K.appendChild(N));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 da=document.createElement("input");da.setAttribute("type","checkbox");da.setAttribute("id","geDoNotShowAgainCheckbox");da.style.marginRight="6px";if(!t){g.appendChild(da);var ja=document.createElement("label");-ja.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ja,mxResources.get("doNotShowAgain"));g.appendChild(ja);K.style.paddingBottom=B?"16px":"30px";K.appendChild(g)}var ea=mxUtils.bind(this,function(){null!=K.parentNode&&(K.parentNode.removeChild(K),this.bannerShowing=!1,da.checked||t)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=N&&mxEvent.addListener(N,"click",mxUtils.bind(this,function(fa){mxEvent.consume(fa);-ea()}));var ca=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(K.style,"transform",I);window.setTimeout(mxUtils.bind(this,function(){ea()}),1E3)});mxEvent.addListener(K,"click",mxUtils.bind(this,function(fa){var la=mxEvent.getSource(fa);la!=da&&la!=ja?(null!=l&&l(),ea(),mxEvent.consume(fa)):ca()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(K.style,"transform",L)}),500);window.setTimeout(ca,B?5E3:3E4);D=!0}return D};EditorUi.prototype.setCurrentFile=function(c){null!=-c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,g,l,t){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<t&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",t));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,g,l,t,B){var D="jpeg"==l?"jpg":l;t=this.getBaseFilename(t)+-(null!=g?".drawio":"")+"."+D;c=this.createImageDataUri(c,g,l,B);this.saveData(t,D,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("formatAnimatedGif",null,"Animated GIF"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(g);mxUtils.write(c,mxResources.get("speed",-null,"Speed")+":");var l=document.createElement("select");l.style.marginLeft="4px";l.style.width="80px";var t=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(g=0;g<t.length;g++){var B=document.createElement("option");mxUtils.write(B,t[g].label);B.setAttribute("value",t[g].value);15==t[g].value&&B.setAttribute("selected","selected");l.appendChild(B)}c.appendChild(l);mxUtils.br(c);-g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("zoom")+":");var D=document.createElement("input");D.setAttribute("type","text");D.style.width="60px";D.style.marginLeft="4px";D.value="100%";g.appendChild(D);c.appendChild(g);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("borderWidth",null,"Border Width")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.width="60px";I.style.marginLeft=-"4px";I.value="0";g.appendChild(I);c.appendChild(g);t=document.createElement("div");t.style.marginTop="10px";mxUtils.write(t,mxResources.get("loops",null,"Loops")+":");var L=document.createElement("select");L.style.marginLeft="4px";L.style.width="80px";var N=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(g=0;g<N.length;g++)B=document.createElement("option"),mxUtils.write(B,N[g].label),B.setAttribute("value",N[g].value),0==-N[g].value&&B.setAttribute("selected","selected"),L.appendChild(B);t.appendChild(L);c.appendChild(t);var K=this.addCheckbox(c,mxResources.get("transparentBackground",null,"Transparent Background"),!1);c=new CustomDialog(this,c,mxUtils.bind(this,function(){var da=parseInt(D.value);if(isNaN(da)||0>=da)da=100;this.exportAnimatedGif({fps:parseInt(l.value),scale:da/100,border:parseInt(I.value)||0,repeat:parseInt(L.value),transparent:K.checked,background:K.checked?null:null!=this.editor.graph.background&&-this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"#ffffff"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,300,260,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(g){this.spinner.stop();if(null!=g){var l=this.getBaseFilename()+".gif";if("function"===-typeof navigator.msSaveBlob)navigator.msSaveBlob(g,l);else{var t=document.createElement("a");t.href=URL.createObjectURL(g);t.download=l;document.body.appendChild(t);t.click();setTimeout(function(){document.body.removeChild(t);URL.revokeObjectURL(t.href)},0)}}}),mxUtils.bind(this,function(g){this.spinner.stop();this.handleError(g)}))}catch(g){this.spinner.stop(),this.handleError(g)}};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,g){c=new TextareaDialog(this,c,g,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,g,l,t,B,D){"text/xml"!=l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||-/(\.html)$/i.test(g)||(g=g+"."+(null!=D?D:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=t?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,-l,t);else{var I=document.createElement("a");D=(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]+)\./);D=65==(L?parseInt(L[2],10):!1)?!1:D}if(D||this.isOffline()){I.href=URL.createObjectURL(t?this.base64ToBlob(c,l):new Blob([c],{type:l}));D?I.download=g:I.setAttribute("target","_blank");document.body.appendChild(I);try{window.setTimeout(function(){URL.revokeObjectURL(I.href)},-2E4),I.click(),I.parentNode.removeChild(I)}catch(N){}}else this.createEchoRequest(c,g,l,t,B).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,l,t,B,D){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=B?"&format="+B:"")+(null!=D?"&base64="+D:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,g,l,t,B,D,I,L,N){D=null!=D?D:!1;I=null!=I?I:"vsdx"!=B&&(!mxClient.IS_IOS||-!navigator.standalone);var K=mxUtils.bind(this,function(ja,ea,ca,fa){try{if("_blank"==ea)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,t);else if(null!=l&&"text/html"==l.substring(0,9)){var la=new EmbedDialog(this,c);this.showDialog(la.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));la.init()}else{var ka=window.open("about:blank");null==ka?mxUtils.popup(c,!0):(ka.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),ka.document.close())}else if(ea==App.MODE_DEVICE||-"download"==ea)this.doSaveLocalFile(c,ja,l,t,null,L);else if(null!=ja&&0<ja.length){var V=mxUtils.bind(this,function(k){try{this.exportFile(c,ja,l,t,ea,k)}catch(x){this.handleError(x)}});null!=fa?V(fa):this.pickFolder(ea,V)}}catch(k){this.handleError(k)}});B=[];D||B.push(App.MODE_BROWSER);I||B.push("_blank");var da=new SaveDialog(this,g,mxUtils.bind(this,function(ja,ea,ca){K(ja.value,ea,ja,ca);this.hideDialog(null,null,da.container)}),B,c,l,t,N);this.showDialog(da.container,420,110,!0,!1,mxUtils.bind(this,-function(){this.hideDialog()}));da.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var t=window.open("about:blank");if(null==t||null==t.document)mxUtils.popup(c,!0);else{var B="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var D=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=D&&(B="background: "+D+";")}B='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+B+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=-g||l?(D=l?c:btoa(unescape(encodeURIComponent(c))),t.document.write(B+'<img style="max-width:100%;" src="data:'+g+";base64,"+D+'"/></body></html>')):t.document.write(B+c+"</body></html>"):t.document.write(B+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");t.document.close()}};var n=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 g=c(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.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=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=-this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var B=g.getBoundingClientRect();this.tagsDialog.style.left=B.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";B=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=B.zIndex;document.body.appendChild(this.tagsDialog);-this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(t)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var t=this.editor.graph.getAllTags();g.style.display=0<t.length?"":"none"}))}n.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=-null)}));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,+c=Q?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!D&&!B&&(I||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(la),g,null!=l?l.getTitle():null,ia,da);else if(D||!B&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(t=null),l=this.getSvgFileProperties(la),c=this.getEmbeddedSvg(c,g,t,null,K,M,da,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,t){c=null!=+c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var B=this.editor.getGraphXml(c,t);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(M){var V=M.getElementsByTagName("mxGraphModel"),Q=0<V.length?V[0]:null;V=M;null==Q&&l?(Q=mxUtils.getNodeValue(M),0<Q.length&&(Q=Graph.decompress(Q),null!=Q&&0<Q.length&&(V=M.cloneNode(!1),V.appendChild(mxUtils.parseXml(Q).documentElement)))):null==Q||l?V=M.cloneNode(!0):(V=M.cloneNode(!1),mxUtils.setTextContent(V,Graph.compressNode(Q)));B.appendChild(V)},+EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(B),B=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var D=this.pages[g],I=D.node;if(D!=this.currentPage)if(D.needsUpdate){var K=new mxCodec(mxUtils.createXmlDocument());K=K.encode(new mxGraphModel(D.root));this.editor.graph.saveViewState(D.viewState,K,null,t);EditorUi.removeChildNodes(I);I.appendChild(K);delete D.needsUpdate}else t&&(this.updatePageRoot(D),null!=D.viewState.backgroundImage&&+null!=D.viewState.backgroundImage.originalSrc&&(K=new mxCodec(mxUtils.createXmlDocument()),K=K.encode(new mxGraphModel(D.root)),this.editor.graph.saveViewState(D.viewState,K,null,t,D),I=I.cloneNode(!1),I.appendChild(K)));c(I)}return B};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],t=0;t<c.length;t++){var B=c.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(B)?l.push(B):isNaN(parseInt(B))?B.toLowerCase()!=B?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):B.toUpperCase()!=+B?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(B)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][g].data=+mxUtils.getXml(l)}catch(D){c[EditorUi.DIFF_INSERT][g].data=D.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var t in c[EditorUi.DIFF_UPDATE]){var B=c[EditorUi.DIFF_UPDATE][t];null!=B.name&&(B.name=this.anonymizeString(B.name));null!=B.cells&&(g=mxUtils.bind(this,function(D){var I=B.cells[D];if(null!=I){for(var K in I)null!=I[K].value&&(I[K].value="["+I[K].value.length+"]"),null!=I[K].xmlValue&&(I[K].xmlValue="["+I[K].xmlValue.length+"]"),null!=I[K].style&&(I[K].style="["+I[K].style.length+"]"),mxUtils.isEmptyObject(I[K])&&+delete I[K];mxUtils.isEmptyObject(I)&&delete B.cells[D]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(B.cells)&&delete B.cells);mxUtils.isEmptyObject(B)&&delete c[EditorUi.DIFF_UPDATE][t]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,+g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(c,g){g=c.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&g[l].setAttribute("value","["+g[l].getAttribute("value").length+"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length++"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&+(g.clearAutosave(),this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){B=null!=B?B:!0;D=null!=D?D:!1;V=null!=V?V:!Editor.defaultCompressed;+var da=this.editor.graph;if((g||!c&&null!=M&&/(\.svg)$/i.test(M.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ia=da.getGlobalVariable;da=this.createTemporaryGraph(da.getStylesheet());da.setBackgroundImage=this.editor.graph.setBackgroundImage;da.background=this.editor.graph.background;var la=null!=this.pages?this.pages[0]:null;null==la||this.currentPage==la?da.setBackgroundImage(this.editor.graph.backgroundImage):null!=la.viewState&&null!=la.viewState&&da.setBackgroundImage(la.viewState.backgroundImage);+da.getGlobalVariable=function(ka){return"page"==ka&&null!=la?la.getName():"pagenumber"==ka?1:ia.apply(this,arguments)};document.body.appendChild(da.container);null!=la&&da.model.setRoot(la.root)}I=null!=I?I:this.getXmlFileData(B,D,V,Q);M=null!=M?M:this.getCurrentFile();c=this.createFileData(I,da,M,window.location.href,c,g,l,t,B,K,V,ja,ea);da!=this.editor.graph&&da.container.parentNode.removeChild(da.container);return c};EditorUi.prototype.getHtml=function(c,g,l,t,B,D){D=null!=D?D:!0;var I=null,K=+EditorUi.drawHost+"/js/embed-static.min.js";if(null!=g){I=D?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var M=g.view.scale;D=Math.floor(I.x/M-g.view.translate.x);M=Math.floor(I.y/M-g.view.translate.y);I=g.background;null==B&&(g=this.getBasenames().join(";"),0<g.length&&(K=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",D);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!=t&&c.setAttribute("edit",t));null!=B&&(B=B.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";t=Graph.compress(c);Graph.decompress(t)!=c&&(t=encodeURIComponent(c));return(null==B?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=B?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==B?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")++(null!=B?'<meta http-equiv="refresh" content="0;URL=\''+B+"'\"/>\n":"")+"</head>\n<body"+(null==B&&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;">'+t+"</div>\n</div>\n"+(null==B?'<script type="text/javascript" src="'+K+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+B+'" target="_blank"><img border="0" src="'++EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,g,l,t,B){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=B&&(B=B.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==B?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':+"")+"<!DOCTYPE html>\n<html"+(null!=B?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==B?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=B?'<meta http-equiv="refresh" content="0;URL=\''+B+"'\"/>\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==B?'<script type="text/javascript" src="'+g+'">\x3c/script>':+'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+B+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.updateFileVars=function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(g){}};EditorUi.prototype.setFileData=function(c,g){c=this.validateFileData(c);+this.pages=this.fileNode=this.currentPage=null;g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var t=+this.getHashObject(),B=null;this.fileNode=g;this.editor.graph.defaultExportLinkTarget=g.getAttribute("linkTarget");this.pages=[];for(var D=0;D<c.length;D++){null==c[D].getAttribute("id")&&c[D].setAttribute("id",D);g=new DiagramPage(c[D]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[D+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)B=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()++": Duplicate page ID");}this.currentPage=null!=B?B: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 I=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(D=0;D<I.length;D++)g[I[D]]=!0;var K=this.editor.graph.getModel(),M=K.getChildren(K.root);for(D=0;D<M.length;D++){var V=M[D];K.setVisible(V,g[V.id]||!1)}}catch(Q){}};EditorUi.prototype.fileStats=function(c,g){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=g.getElementsByTagName("diagram");g=+{};g.modified=c.getLastModifiedDate();g.fileMode=c.getMode();g.fileSize=c.getSize();g.fileHash=c.getHash();g.pages=l.length;g.redundantStencils=0;g.redundantImages=0;g.redundantSize=0;g.stencils=0;g.images=0;for(var t=g.cells=0;t<l.length;t++){var B=l[t].getElementsByTagName("mxCell");g.cells+=B.length;for(var D={},I=0;I<B.length;I++){var K=B[I].getAttribute("style");if(null!=K)for(var M=K.split(";"),V=0;V<M.length;V++){var Q=M[V];if(Q.startsWith("image=data:")||Q.startsWith("shape=stencil("))null==+D[Q]?D[Q]=1:D[Q]++}}for(var ja in D){var ea=D[ja];ja.startsWith("shape=stencil(")?g.stencils+=ea:g.images+=ea;1<ea&&(g.redundantSize+=ja.length*(ea-1),ja.startsWith("shape=stencil(")?g.redundantStencils+=ea-1:g.redundantImages+=ea-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(g)})}}catch(da){}};EditorUi.prototype.getBaseFilename=function(c){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(".")));!c&&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(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la,ka){try{t=null!=+t?t:this.editor.graph.isSelectionEmpty();var W=this.getBaseFilename(!B),k=W+("xml"==c||"pdf"==c&&Q?".drawio":"")+"."+c;if("xml"==c){var y=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,B,null,null,null,g);this.saveData(k,c,y,"text/xml")}else if("html"==c)y=this.getHtml2(this.getFileData(!0),this.editor.graph,W),this.saveData(k,c,y,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?k=W+".png":"jpeg"==c&&(k=W+".jpg"),+"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var J=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(k,c,t,"1",I,B,K,M,V,Q,ja,void 0,void 0,!D,ea,da,ia,la,ka).send(mxUtils.bind(this,function(U){this.spinner.stop();if(200<=U.getStatus()&&299>=U.getStatus()){var ba=this.createLoadMessage("export");ba.format=c;ba.filename=k;ba.data="data:application/pdf;base64,"+U.getText();ba.xml=+this.getFileData(!0);J.postMessage(JSON.stringify(ba),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(k,c,mxUtils.bind(this,function(U,ba){try{return this.createDownloadRequest(U,c,t,ba,I,B,K,M,V,Q,ja,void 0,void 0,!D,ea,da,ia,la,ka)}catch(fa){this.handleError(fa)}}));else{var R=null,X=mxUtils.bind(this,function(U){U.length<=MAX_REQUEST_SIZE?+this.saveData(k,"svg",U,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(R)}))});if("svg"==c){var aa=this.editor.graph.background;if(I||aa==mxConstants.NONE)aa=null;var Z=this.editor.graph.getSvg(aa,null,null,null,null,t);l&&this.editor.graph.addSvgShadow(Z);this.editor.convertImages(Z,mxUtils.bind(this,mxUtils.bind(this,function(U){this.spinner.stop();X(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"++mxUtils.getXml(U))})))}else k=W+".svg",R=this.getFileData(!1,!0,null,mxUtils.bind(this,function(U){this.spinner.stop();X(U)}),t)}}catch(U){this.handleError(U)}};EditorUi.prototype.createDownloadRequest=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la,ka,W,k){c=this.downloadRequestBuilder(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la,ka,W,k);g="";for(var y in c)l=c[y],null!=l&&(g+=y+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,l,t,+B,D,I,K,M,V,Q,ja,ea,da,ia,la,ka,W,k){var y=this.editor.graph,J=y.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==D?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var R=null,X=null,aa=null;if(!EditorUi.isElectronApp&&(J.width*J.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};V=V?"1":"0";"pdf"==g&&(null!=Q?(R=Q.from,X=Q.to):0==D&&(aa="1"));"xmlpng"==g&&(V="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(D=+0;D<this.pages.length;D++)if(this.pages[D]==this.currentPage){R=D;break}D=y.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!B?B||null!=D&&D!=mxConstants.NONE||(D="#ffffff"):D=mxConstants.NONE;B={globalVars:y.getExportVariables()};null!=Q&&null!=Q.from&&(B.globalVars.pagenumber=Q.from+1);M&&(B.grid={size:y.gridSize,steps:y.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:y.view.gridColor});Graph.translateDiagram&&(B.diagramLanguage=Graph.diagramLanguage);return{format:g,+from:R,to:X,allPages:aa,bg:null!=D?D:mxConstants.NONE,base64:t,embedXml:V,xml:l,filename:null!=c?c:"",extras:JSON.stringify(B),scale:I,border:K,pageMargin:ia,w:ja&&isFinite(ja)?ja:null,h:ea&&isFinite(ea)?ea:null,crop:null!=da&&da?"1":"0",fit:null!=la&&la?"1":"0",shadows:null!=k&&k?"1":"0",sheetsAcross:ka,sheetsDown:W}};EditorUi.prototype.setMode=function(c,g){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 g=+c.indexOf("#");0<=g&&(c=c.substring(0,g))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,g={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{g=JSON.parse(c)}catch(t){}}}return g};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 g=window.location.hash;if(null==g||""==g)g="#";var l=g.lastIndexOf("#");0<l&&(g=g.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(g=g+"#"+encodeURIComponent(JSON.stringify(c)))}catch(t){}0<l&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=function(c,g,l){var t=window.location.hash,B=mxUtils.bind(this,function(I){var K=null!=c.data?c.data:"";null!=I&&0<I.length&&+(0<K.length&&(K+="\n"),K+=I);I=new LocalFile(this,"csv"!=c.format&&0<K.length?K:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);I.getHash=function(){return t};this.fileLoaded(I);"csv"==c.format&&this.importCsv(K,mxUtils.bind(this,function(ea){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var M=null!=c.interval?parseInt(c.interval):6E4,V=null,Q=mxUtils.bind(this,function(){var ea=this.currentPage;+mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(da){ea===this.currentPage&&(200<=da.getStatus()&&300>=da.getStatus()?(this.updateDiagram(da.getText()),ja()):this.handleError({message:mxResources.get("error")+" "+da.getStatus()}))}),mxUtils.bind(this,function(da){this.handleError(da)}))}),ja=mxUtils.bind(this,function(){window.clearTimeout(V);V=window.setTimeout(Q,M)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ja();+Q()}));ja();Q()}null!=g&&g()});if(null!=c.url&&0<c.url.length){var D=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(D,mxUtils.bind(this,function(I){B(I)}),mxUtils.bind(this,function(I){null!=l&&l(I)}))}else B("")};EditorUi.prototype.updateDiagram=function(c){function g(y){var J=new mxCellOverlay(y.image||B.warningImage,y.tooltip,y.align,y.valign,y.offset);J.addListener(mxEvent.CLICK,function(R,X){t.alert(y.tooltip)});return J}var l=null,t=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),+c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var B=this.editor.graph,D=B.getModel();D.beginUpdate();var I=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var K=D.getCell(c.getAttribute("id"));if(null!=K){try{var M=c.getAttribute("value");if(null!=M){var V=mxUtils.parseXml(M).documentElement;if(null!=V)if("1"==V.getAttribute("replace-value"))D.setValue(K,V);else for(var Q=V.attributes,ja=0;ja<Q.length;ja++)B.setAttributeForCell(K,Q[ja].nodeName,0<Q[ja].nodeValue.length?+Q[ja].nodeValue:null)}}catch(y){null!=window.console&&console.log("Error in value for "+K.id+": "+y)}try{var ea=c.getAttribute("style");null!=ea&&B.model.setStyle(K,ea)}catch(y){null!=window.console&&console.log("Error in style for "+K.id+": "+y)}try{var da=c.getAttribute("icon");if(null!=da){var ia=0<da.length?JSON.parse(da):null;null!=ia&&ia.append||B.removeCellOverlays(K);null!=ia&&B.addCellOverlay(K,g(ia))}}catch(y){null!=window.console&&console.log("Error in icon for "+K.id+": "+y)}try{var la=+c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var ka=B.getCellGeometry(K);if(null!=ka){ka=ka.clone();for(key in la){var W=parseFloat(la[key]);"dx"==key?ka.x+=W:"dy"==key?ka.y+=W:"dw"==key?ka.width+=W:"dh"==key?ka.height+=W:ka[key]=parseFloat(la[key])}B.model.setGeometry(K,ka)}}}catch(y){null!=window.console&&console.log("Error in icon for "+K.id+": "+y)}}}else if("model"==c.nodeName){for(var k=c.firstChild;null!=k&&k.nodeType!=mxConstants.NODETYPE_ELEMENT;)k=k.nextSibling;null!=k&&(new mxCodec(c.firstChild)).decode(k,+D)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(B.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))B.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{D.endUpdate()}null!=I&&this.chromelessResize&&this.chromelessResize(!0,I)}return l};EditorUi.prototype.getCopyFilename=function(c,+g){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var t=l.lastIndexOf(".");0<=t&&(c=l.substring(t),l=l.substring(0,t));if(g){g=l;var B=new Date;l=B.getFullYear();t=B.getMonth()+1;var D=B.getDate(),I=B.getHours(),K=B.getMinutes();B=B.getSeconds();l=g+(" "+(l+"-"+t+"-"+D+"-"+I+"-"+K+"-"+B))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=function(c,g){try{null!=c&&g&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,+g,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[g]);var t=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var B=!1;this.hideDialog();null!=t&&(t.removeListener(this.descriptorChangedListener),this.logIfModified(t,!0),t.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var D=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=t&&this.updateDocumentTitle();this.editor.graph.model.clear();+this.editor.undoManager.clear();this.setBackgroundImage(null);!g&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();g||("0"!=urlParams.splash?this.showSplash():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=c)try{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.clearStatus():this.updateStatus(mxUtils.bind(this,function(){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||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));B=!0;if(!this.isOffline()&&null!=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.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+I})}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!=t?this.fileLoaded(t)||D():D()});g?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 D();return B};EditorUi.prototype.getHashValueForPages=function(c,g){var l=0,t=new mxGraphModel,B=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var D=0;D<c.length;D++){this.updatePageRoot(c[D]);var I=c[D].node.cloneNode(!1);I.removeAttribute("name");t.root=c[D].root;var K=B.encode(t);this.editor.graph.saveViewState(c[D].viewState,K,!0);K.removeAttribute("pageWidth");+K.removeAttribute("pageHeight");I.appendChild(K);null!=g&&(g.eltCount+=I.getElementsByTagName("*").length,g.nodeCount+=I.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(I,function(M,V,Q,ja){return!ja||"mxGeometry"!=M.nodeName&&"mxPoint"!=M.nodeName||"x"!=V&&"y"!=V&&"width"!=V&&"height"!=V?ja&&"mxCell"==M.nodeName&&"previous"==V?null:Q:Math.round(Q)},g)<<0}return l};EditorUi.prototype.hashValue=function(c,g,l){var t=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&+"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(t^=this.hashValue(c.nodeName,g,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var B=0;B<c.attributes.length;B++){var D=c.attributes[B].name,I=null!=g?g(c,D,c.attributes[B].value,!0):c.attributes[B].value;null!=I&&(t^=this.hashValue(D,g,l)+this.hashValue(I,g,l))}}if(null!=c.childNodes)for(B=0;B<c.childNodes.length;B++)t=(t<<5)-t+this.hashValue(c.childNodes[B],g,l)<<0}else if(null!=c&&"function"!==+typeof c){c=String(c);g=0;null!=l&&(l.byteCount+=c.length);for(B=0;B<c.length;B++)g=(g<<5)-g+c.charCodeAt(B)<<0;t^=g}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,g,l,t,B,D,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){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var g=0;g<c.length;g++)null!=c[g].xml&&"<"!=c[g].xml.charAt(0)&&(c[g].xml=mxUtils.trim(Graph.decompress(c[g].xml)));g=mxUtils.createXmlDocument();var l=g.createElement("mxlibrary");mxUtils.setTextContent(l,+JSON.stringify(c,null,2));g.appendChild(l);return mxUtils.getXml(g,"\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 g=this.sidebar.palettes[c];if(null!=g){for(var l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=+function(c,g){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!g){null==c&&(g=this.sidebar.palettes["L.scratchpad"],null==g&&(g=this.sidebar.palettes.search),null!=g&&(c=g[g.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;g=l.lastChild;var t=g.previousSibling;l.insertBefore(g,c);l.insertBefore(t,g)}};EditorUi.prototype.loadLibrary=function(c,g){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var t=JSON.parse(mxUtils.getTextContent(l.documentElement));+this.libraryLoaded(c,t,l.documentElement.getAttribute("title"),g,l.documentElement.getAttribute("tags"))}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.showSearchWindow=function(c,g){var l=c?"findReplace":"find",t=l+"Window";if(null==this[t]){var B="min"==Editor.currentTheme||+"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,D=c?B?330:300:240;this[t]=new FindWindow(this,document.body.offsetWidth-(D+20),100,D,c?B?304:288:180,c);this[t].window.addListener("show",function(){this.fireEvent(new mxEventObject(l))});this[t].window.addListener("hide",function(){this.fireEvent(new mxEventObject(l))});this[t].window.setVisible(!0)}else null==g&&this[t].window.setVisible(!this[t].window.isVisible());null!=g&&(this[t].doSearch(g),this[t].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=+function(c,g,l,t,B){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var D=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var I=0;I<this.openLibraries.length;I++)if(this.openLibraries[I].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[I],this.openLibraries);break}D={file:c,images:g,title:l,expand:t};this.openLibraries.push(D)}else this.scratchpad=c;I=this.sidebar.palettes[c.getHash()];+I=null!=I?I[I.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var K=null,M=mxUtils.bind(this,function(k,y){0==k.length&&c.isEditable()?(null==K&&(K=document.createElement("div"),K.className="geDropTarget",mxUtils.write(K,mxResources.get("dragElementsHere"))),y.appendChild(K)):this.addLibraryEntries(k,y)});null!=this.sidebar&&null!=g&&this.sidebar.addEntries(g,B);null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var V=this.sidebar.addPalette(c.getHash(),+l,null!=t?t:!0,mxUtils.bind(this,function(k){M(g,k)}));null!=D&&(D.div=V);this.repositionLibrary(I,"L.scratchpad"!=c.getHash());t=V.parentNode.previousSibling;l=t.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&t.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var Q=document.createElement("div");Q.style.backgroundColor="inherit";t.style.position="relative";var ja=document.createElement("img");ja.className="geLibraryButton";ja.setAttribute("src",Editor.crossImage);ja.setAttribute("title",+mxResources.get("close"));var ea=null;if(".scratchpad"!=c.title||this.closableScratchpad)Q.appendChild(ja),mxEvent.addListener(ja,"click",mxUtils.bind(this,function(k){if(!mxEvent.isConsumed(k)){var y=mxUtils.bind(this,function(){null!=D&&mxUtils.remove(D,this.openLibraries);this.closeLibrary(c)});null!=ea?this.confirm(mxResources.get("allChangesLost"),null,y,mxResources.get("cancel"),mxResources.get("discardChanges")):y();mxEvent.consume(k)}}));if(c.isEditable()){var da=this.editor.graph,ia=null;+l=mxUtils.bind(this,function(k){this.showLibraryDialog(c.getTitle(),V,g,c,c.getMode());mxEvent.consume(k)});var la=mxUtils.bind(this,function(k){c.setModified(!0);c.isAutosave()?(null!=ia&&null!=ia.parentNode&&ia.parentNode.removeChild(ia),ia=ja.cloneNode(!1),ia.setAttribute("src",Editor.spinImage),ia.setAttribute("title",mxResources.get("saving")),ia.style.cursor="default",ia.style.marginRight="2px",ia.style.marginTop="-2px",Q.insertBefore(ia,Q.firstChild),this.saveLibrary(c.getTitle(),g,c,c.getMode(),+!0,!0,function(){null!=ia&&null!=ia.parentNode&&ia.parentNode.removeChild(ia)})):null==ea&&(ea=ja.cloneNode(!1),ea.setAttribute("src",Editor.saveImage),ea.setAttribute("title",mxResources.get("save")),Q.insertBefore(ea,Q.firstChild),mxEvent.addListener(ea,"click",mxUtils.bind(this,function(y){this.saveLibrary(c.getTitle(),g,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==ea||c.isModified()||(ea.parentNode.removeChild(ea),ea=null)});mxEvent.consume(y)})))}),ka=mxUtils.bind(this,function(k,+y,J,R){k=da.cloneCells(mxUtils.sortCells(da.model.getTopmostCells(k)));for(var X=0;X<k.length;X++){var aa=da.getCellGeometry(k[X]);null!=aa&&aa.translate(-y.x,-y.y)}V.appendChild(this.sidebar.createVertexTemplateFromCells(k,y.width,y.height,R||"",!0,null,!1));k=mxUtils.getXml(this.editor.graph.encodeCells(k));Editor.defaultCompressed&&(k=Graph.compress(k));y={xml:k,w:y.width,h:y.height};null!=R&&(y.title=R);g.push(y);la(J);null!=K&&null!=K.parentNode&&0<g.length&&(K.parentNode.removeChild(K),K=null)}),+W=mxUtils.bind(this,function(k){if(da.isSelectionEmpty())da.getRubberband().isActive()?(da.getRubberband().execute(k),da.getRubberband().reset()):null!=k&&mxEvent.getSource(k).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var y=da.getSelectionCells(),J=da.view.getBounds(y);if(null!=J&&0<J.width&&0<J.height){var R=da.view.scale;J.x/=R;J.y/=R;J.width/=R;J.height/=R;J.x-=da.view.translate.x;J.y-=da.view.translate.y;+ka(y,J)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(k)});mxEvent.addGestureListeners(V,function(){},mxUtils.bind(this,function(k){da.isMouseDown&&null!=da.panningManager&&null!=da.graphHandler.first&&(da.graphHandler.suspend(),null!=da.graphHandler.hint&&(da.graphHandler.hint.style.visibility="hidden"),V.style.backgroundColor="light-dark(#fefefe, #000000)",V.style.cursor="copy",da.panningManager.stop(),da.autoScroll=!1,mxEvent.consume(k))}),+mxUtils.bind(this,function(k){da.isMouseDown&&null!=da.panningManager&&null!=da.graphHandler&&(V.style.backgroundColor="",V.style.cursor="default",this.sidebar.showTooltips=!0,da.panningManager.stop(),da.graphHandler.reset(),da.isMouseDown=!1,da.autoScroll=!0,W(k),mxEvent.consume(k))}));mxEvent.addListener(V,"mouseleave",mxUtils.bind(this,function(k){da.isMouseDown&&null!=da.graphHandler.first&&(da.graphHandler.resume(),null!=da.graphHandler.hint&&(da.graphHandler.hint.style.visibility="visible"),+V.style.backgroundColor="",V.style.cursor="",da.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(k){V.style.backgroundColor="light-dark(#fefefe, #000000)";k.dataTransfer.dropEffect="copy";V.style.cursor="copy";this.sidebar.hideTooltip();k.stopPropagation();k.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,function(k){V.style.cursor="";V.style.backgroundColor="";0<k.dataTransfer.files.length&&this.importFiles(k.dataTransfer.files,+0,0,this.maxImageSize,mxUtils.bind(this,function(y,J,R,X,aa,Z,U,ba,fa){if(null!=y&&"image/"==J.substring(0,6))y="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(y),y=[new mxCell("",new mxGeometry(0,0,aa,Z),y)],y[0].vertex=!0,ka(y,new mxRectangle(0,0,aa,Z),k,mxEvent.isAltDown(k)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g," ")),null!=K&&null!=K.parentNode&&0<g.length&&(K.parentNode.removeChild(K),K=null);else{var na=!1,pa=mxUtils.bind(this,+function(ta,ua){null!=ta&&"application/pdf"==ua&&(ua=Editor.extractGraphModelFromPdf(ta),null!=ua&&0<ua.length&&(ta=ua));if(null!=ta)if(ta=mxUtils.parseXml(ta),"mxlibrary"==ta.documentElement.nodeName)try{var Ca=JSON.parse(mxUtils.getTextContent(ta.documentElement));M(Ca,V);g=g.concat(Ca);la(k);this.spinner.stop();na=!0}catch(Sa){}else if("mxfile"==ta.documentElement.nodeName)try{var Ba=ta.documentElement.getElementsByTagName("diagram");for(Ca=0;Ca<Ba.length;Ca++){var Aa=this.stringToCells(Editor.getDiagramNodeXml(Ba[Ca])),+Fa=this.editor.graph.getBoundingBoxFromGeometry(Aa);null!=Fa&&ka(Aa,new mxRectangle(0,0,Fa.width,Fa.height),k)}na=!0}catch(Sa){null!=window.console&&console.log("error in drop handler:",Sa)}na||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=K&&null!=K.parentNode&&0<g.length&&(K.parentNode.removeChild(K),K=null)});null!=fa&&null!=U&&EditorUi.isVisioFilename(U)?this.importVisio(fa,function(ta){pa(ta,"text/xml")},null,U):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(y,+U)&&null!=fa?this.isExternalDataComms()?this.parseFile(fa,mxUtils.bind(this,function(ta){4==ta.readyState&&(this.spinner.stop(),200<=ta.status&&299>=ta.status?pa(ta.responseText,"text/xml"):this.handleError({message:mxResources.get(413==ta.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):pa(y,J)}}));k.stopPropagation();k.preventDefault()})),mxEvent.addListener(V,+"dragleave",function(k){V.style.cursor="";V.style.backgroundColor="";k.stopPropagation();k.preventDefault()}));ja=ja.cloneNode(!1);ja.setAttribute("src",Editor.editImage);ja.setAttribute("title",mxResources.get("edit"));Q.insertBefore(ja,Q.firstChild);mxEvent.addListener(ja,"click",l);l=ja.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));Q.insertBefore(l,Q.firstChild);mxEvent.addListener(l,"click",W);".scratchpad"==c.title&&(this.addSelectionToScratchpad=+W);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",Q.insertBefore(l,Q.firstChild))}t.appendChild(Q);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,g){for(var l=0;l<c.length;l++)try{var t=c[l],B=t.data;if(null!=B){B="data:"==B.substring(0,5)?this.convertDataUri(B):B;var D="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";+"fixed"==t.aspect&&(D+="aspect=fixed;");D=D+"image="+B+";";null!=t.style&&(D+=t.style);g.appendChild(this.sidebar.createVertexTemplate(D,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var I=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),K=0==I.length?mxResources.get("drawingEmpty"):null!=t.title?t.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(I,t.w,t.h,K,!0,null,!0))}}catch(M){K=null!=M.message?mxResources.get("error")+": "+M.message:String(M),+D=this.sidebar.createVertexTemplateFromCells(null,t.w,t.h,K,!0,null,!0),g.appendChild(D)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=+function(c,g,l,t,B,D,I){c=new ImageDialog(this,c,g,l,t,B,D,I);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,g,l,t,B,D){var I=localStorage.getItem(g);c=new TextareaDialog(this,c,null!=I?JSON.stringify(JSON.parse(I),null,2):"",mxUtils.bind(this,function(K){if(null!=K)try{if(null!=D&&D(K),K==I)this.hideDialog();else{if(0<K.length){var M=JSON.parse(K);localStorage.setItem(g,JSON.stringify(M))}else localStorage.removeItem(g);+this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(V){this.handleError(V)}}),null,mxResources.get("close"),null,null,null,!0,null,null,B,l,t);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,g,l,t){c=null!=c?c:mxUtils.bind(this,function(B,D,I,K){D||(B=new ChangePageSetup(this,t?I:null,B),B.ignoreColor=!t,null!=K&&t&&(B.shadowVisible=K),this.editor.graph.model.execute(B))});+c=new BackgroundImageDialog(this,c,g,l,t);this.showDialog(c.container,400,t?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,g,l,t,B){c=new LibraryDialog(this,c,g,l,t,B);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(D){D&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var m=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var g=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",+mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&g.refresh()}));return g};EditorUi.prototype.handleError=function(c,g,l,t,B,D,I){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{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(ea){}if(null!=M||null!=g){I=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var V=mxResources.get("ok"),Q=null;g=null!=g?g:mxResources.get("error");if(null!=M){null!=M.retry&&(V=mxResources.get("cancel"),Q=function(){K();M.retry()});if(404==M.code||404==M.status||403==M.code){I=403==M.code?null!=M.message?mxUtils.htmlEntities(M.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=B?B:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")++(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var ja=null!=B?null:null!=D?D:window.location.hash;if(null!=ja&&("#G"==ja.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==ja.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)){ja="#U"==ja.substring(0,2)?ja.substring(45,+ja.lastIndexOf("%26ex")):ja.substring(2);this.showError(g,I,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ja);null!=t&&t()}),Q,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ea(){ka.innerText="";for(var W=0;W<da.length;W++){var k=document.createElement("option");mxUtils.write(k,da[W].displayName);k.value=W;ka.appendChild(k);k=document.createElement("option");k.innerHTML=" ";+mxUtils.write(k,"<"+da[W].email+">");k.setAttribute("disabled","disabled");ka.appendChild(k)}k=document.createElement("option");mxUtils.write(k,mxResources.get("addAccount"));k.value=da.length;ka.appendChild(k)}var da=this.drive.getUsersList(),ia=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");ia.appendChild(la);var ka=document.createElement("select");ka.style.width="100%";ea();mxEvent.addListener(ka,"change",+mxUtils.bind(this,function(){var W=ka.value,k=da.length!=W;k&&this.drive.setUser(da[W]);this.drive.authorize(k,mxUtils.bind(this,function(){k||(da=this.drive.getUsersList(),ea())}),mxUtils.bind(this,function(y){this.handleError(y)}),!0)}));ia.appendChild(ka);ia=new CustomDialog(this,ia,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ia.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),+520,150);return}}null!=M.message?I=""==M.message&&null!=M.name?mxUtils.htmlEntities(M.name,!1):mxUtils.htmlEntities(M.message,!1):null!=M.response&&null!=M.response.error?I=mxUtils.htmlEntities(M.response.error,!1):"undefined"!==typeof window.App&&(M.code==App.ERROR_TIMEOUT?I=mxUtils.htmlEntities(mxResources.get("timeout"),!1):M.code==App.ERROR_BUSY?I=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof M&&0<M.length&&(I=mxUtils.htmlEntities(M,!1)))}B=c=null;null!=M&&null!=M.helpLink?+(c=mxResources.get("help"),B=mxUtils.bind(this,function(){return this.editor.graph.openLink(M.helpLink)})):null!=M&&null!=M.ownerEmail?(c=mxResources.get("contactOwner"),I+=mxUtils.htmlEntities(" ("+c+": "+M.ownerEmail+")",!1),B=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(M.ownerEmail))})):null!=M&&null!=M.alternateAction&&(c=M.alternateAction.label,B=M.alternateAction.funct);this.showError(g,I,V,l,Q,null,null,c,B,null,null,null,t?l:null)}else null!=l&&l()};EditorUi.prototype.alert=+function(c,g,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),g);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,g,l,t,B,D){c=null!=c?c:"";var I=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(){I();null!=g&&g()},function(){I();null!=l&&l()},t,B,null,null,null,null,K);this.showDialog(c.container,340,46+K,!0,D);c.init()};EditorUi.prototype.showBanner=+function(c,g,l,t,B,D,I,K,M){D=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){I=null!=I?I:"translate(-50%,120%)";K=null!=K?K:"translate(-50%,0%)";var V=document.createElement("div");V.className="geBtn gePrimaryBtn geBanner"+(B?" geSmallBanner":"");V.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(V.style,"transform",I);mxUtils.setPrefixedStyle(V.style,"transition","all 1000ms ease");null!=M&&mxUtils.setPrefixedStyle(V.style,+"transform-origin",M);M=M=document.createElement("img");M.setAttribute("src",Editor.crossImage);M.setAttribute("title",mxResources.get(t?"doNotShowAgain":"close"));M.setAttribute("border","0");B||(D=document.createElement("img"),D.setAttribute("src",IMAGE_PATH+"/logo.png"),D.setAttribute("border","0"),D.setAttribute("align","absmiddle"),D.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",V.appendChild(D),M.style.cssText=(B?"right:6px;top:9px;":"right:10px;top:12px;")++"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",V.appendChild(M));mxUtils.write(V,g);document.body.appendChild(V);this.bannerShowing=!0;B&&(M.className="geLibraryButton",V.appendChild(M));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 Q=document.createElement("input");Q.setAttribute("type","checkbox");Q.setAttribute("id","geDoNotShowAgainCheckbox");+Q.style.marginRight="6px";if(!t){g.appendChild(Q);var ja=document.createElement("label");ja.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ja,mxResources.get("doNotShowAgain"));g.appendChild(ja);V.style.paddingBottom=B?"16px":"30px";V.appendChild(g)}var ea=mxUtils.bind(this,function(){null!=V.parentNode&&(V.parentNode.removeChild(V),this.bannerShowing=!1,Q.checked||t)&&(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(ia){mxEvent.consume(ia);ea()}));var da=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",I);window.setTimeout(mxUtils.bind(this,function(){ea()}),1E3)});mxEvent.addListener(V,"click",mxUtils.bind(this,function(ia){var la=mxEvent.getSource(ia);la!=Q&&la!=ja?(null!=l&&l(),ea(),mxEvent.consume(ia)):da()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",K)}),500);window.setTimeout(da,+B?5E3:3E4);D=!0}return D};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,g,l,t){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<t&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",t));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=+function(c,g,l,t,B){var D="jpeg"==l?"jpg":l;t=this.getBaseFilename(t)+(null!=g?".drawio":"")+"."+D;c=this.createImageDataUri(c,g,l,B);this.saveData(t,D,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("formatAnimatedGif",null,"Animated GIF"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";+c.appendChild(g);mxUtils.write(c,mxResources.get("speed",null,"Speed")+":");var l=document.createElement("select");l.style.marginLeft="4px";l.style.width="80px";var t=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(g=0;g<t.length;g++){var B=document.createElement("option");mxUtils.write(B,t[g].label);B.setAttribute("value",t[g].value);15==t[g].value&&B.setAttribute("selected","selected");+l.appendChild(B)}c.appendChild(l);mxUtils.br(c);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("zoom")+":");var D=document.createElement("input");D.setAttribute("type","text");D.style.width="60px";D.style.marginLeft="4px";D.value="100%";g.appendChild(D);c.appendChild(g);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("borderWidth",null,"Border Width")+":");var I=document.createElement("input");I.setAttribute("type",+"text");I.style.width="60px";I.style.marginLeft="4px";I.value="0";g.appendChild(I);c.appendChild(g);t=document.createElement("div");t.style.marginTop="10px";mxUtils.write(t,mxResources.get("loops",null,"Loops")+":");var K=document.createElement("select");K.style.marginLeft="4px";K.style.width="80px";var M=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(g=0;g<M.length;g++)B=document.createElement("option"),mxUtils.write(B,+M[g].label),B.setAttribute("value",M[g].value),0==M[g].value&&B.setAttribute("selected","selected"),K.appendChild(B);t.appendChild(K);c.appendChild(t);var V=this.addCheckbox(c,mxResources.get("transparentBackground",null,"Transparent Background"),!1);c=new CustomDialog(this,c,mxUtils.bind(this,function(){var Q=parseInt(D.value);if(isNaN(Q)||0>=Q)Q=100;this.exportAnimatedGif({fps:parseInt(l.value),scale:Q/100,border:parseInt(I.value)||0,repeat:parseInt(K.value),transparent:V.checked,background:V.checked?+null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"#ffffff"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,300,260,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(g){this.spinner.stop();if(null!=g){var l=+this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(g,l);else{var t=document.createElement("a");t.href=URL.createObjectURL(g);t.download=l;document.body.appendChild(t);t.click();setTimeout(function(){document.body.removeChild(t);URL.revokeObjectURL(t.href)},0)}}}),mxUtils.bind(this,function(g){this.spinner.stop();this.handleError(g)}))}catch(g){this.spinner.stop(),this.handleError(g)}};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,g){c=new TextareaDialog(this,c,g,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,g,l,t,B,D){"text/xml"!=+l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=D?D:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=t?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=+l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,l,t);else{var I=document.createElement("a");D=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof I.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var K=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);D=65==(K?parseInt(K[2],10):!1)?!1:D}if(D||this.isOffline()){I.href=URL.createObjectURL(t?this.base64ToBlob(c,l):new Blob([c],{type:l}));D?I.download=g:I.setAttribute("target",+"_blank");document.body.appendChild(I);try{window.setTimeout(function(){URL.revokeObjectURL(I.href)},2E4),I.click(),I.parentNode.removeChild(I)}catch(M){}}else this.createEchoRequest(c,g,l,t,B).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,l,t,B,D){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=B?"&format="+B:"")+(null!=D?"&base64="+D:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=+function(c,g,l,t,B,D,I,K,M){D=null!=D?D:!1;I=null!=I?I:"vsdx"!=B&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(ja,ea,da,ia){try{if("_blank"==ea)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,t);else if(null!=l&&"text/html"==l.substring(0,9)){var la=new EmbedDialog(this,c);this.showDialog(la.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));la.init()}else{var ka=window.open("about:blank");null==ka?mxUtils.popup(c,!0):(ka.document.write("<pre>"++mxUtils.htmlEntities(c,!1)+"</pre>"),ka.document.close())}else if(ea==App.MODE_DEVICE||"download"==ea)this.doSaveLocalFile(c,ja,l,t,null,K);else if(null!=ja&&0<ja.length){var W=mxUtils.bind(this,function(k){try{this.exportFile(c,ja,l,t,ea,k)}catch(y){this.handleError(y)}});null!=ia?W(ia):this.pickFolder(ea,W)}}catch(k){this.handleError(k)}});B=[];D||B.push(App.MODE_BROWSER);I||B.push("_blank");var Q=new SaveDialog(this,g,mxUtils.bind(this,function(ja,ea,da){V(ja.value,ea,ja,da);this.hideDialog(null,+null,Q.container)}),B,c,l,t,M);this.showDialog(Q.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Q.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var t=window.open("about:blank");if(null==t||null==t.document)mxUtils.popup(c,!0);else{var B="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var D=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=D&&(B="background: "+D+";")}B='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '++B+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||l?(D=l?c:btoa(unescape(encodeURIComponent(c))),t.document.write(B+'<img style="max-width:100%;" src="data:'+g+";base64,"+D+'"/></body></html>')):t.document.write(B+c+"</body></html>"):t.document.write(B+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");t.document.close()}};var n=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 g=c(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.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=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),+this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var B=g.getBoundingClientRect();this.tagsDialog.style.left=B.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";B=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=+B.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(t)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var t=this.editor.graph.getAllTags();g.style.display=0<t.length?"":"none"}))}n.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),+this.layersDialog=null)}));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.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()&&"1"!=urlParams.noExport){this.exportDialog=null;var l=c(mxUtils.bind(this,function(t){var B=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",B);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)B.apply(this);else{this.exportDialog=document.createElement("div");var D=l.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=D.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";D=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=D.zIndex;var 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",B);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 N=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",N);this.exportDialog.appendChild(L);mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.openInNewWindow(N.substring(N.indexOf(",")+1),"image/png",!0);B.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(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,t,B,D){this.isLocalFileSave()?this.saveLocalFile(l,c,t,B,g,D):this.saveRequest(c,g,mxUtils.bind(this,function(I,L){return this.createEchoRequest(l,I,t,B,g,L)}),l,B,t)};EditorUi.prototype.saveRequest=-function(c,g,l,t,B,D,I){I=null!=I?I:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,function(K,da,ja,ea){if("_blank"==da||null!=K&&0<K.length){var ca=l("_blank"==da?null:K,da==App.MODE_DEVICE||"download"==da||null==da||"_blank"==da?"0":"1");null!=ca&&(da==App.MODE_DEVICE||"download"==da||"_blank"==da?ca.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(fa){D=null!=D?D:"pdf"==g?"application/pdf":"image/"+g;if(null!=t)try{this.exportFile(t,K,D,!0,da,fa)}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(),K,D,!0,da,fa)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=ea?ja(ea):this.pickFolder(da,ja)))}});B=[App.MODE_BROWSER];I||B.push("_blank");var N=new SaveDialog(this,c,mxUtils.bind(this,function(K,da,ja){L(K.value,-da,K,ja);this.hideDialog(null,null,N.container)}),B,null,"application/pdf");this.showDialog(N.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));N.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,g,l,t,B,D){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};-EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(qa){Editor.addRetryToError(qa,mxUtils.bind(this,function(){this.exportSvg(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca)}));this.handleError(qa)})))try{var fa=this.editor.graph.isSelectionEmpty();l=null!=l?l:fa;var la=g?null:this.editor.graph.background;la==mxConstants.NONE&&(la=null);null==la&&0==-g&&(la=this.editor.graph.shapeBackgroundColor);var ka=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var V=mxUtils.lightDarkColorSupported,k=mxUtils.preferDarkColor;if("light"==da||"dark"==da)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==da;var x=Graph.addFont,J={};Graph.addFont=function(qa,ta,ua,Ba){x.call(this,qa,ta,ua,J)};var R=this.editor.graph.createSvgImageExport(B),Y=R.drawCellState;R.drawCellState=-function(qa,ta){null!=qa&&Graph.processFontStyle(qa.style);Y.apply(this,arguments)};var Z=this.editor.graph.getSvg(la,c,I,L,null,l,null,R,"blank"==K?"_blank":"self"==K?"_top":null,null,!ea,da,ja);mxUtils.lightDarkColorSupported=V;mxUtils.preferDarkColor=k;this.editor.graph.addForeignObjectWarning=ka;t&&this.editor.graph.addSvgShadow(Z);var W=this.getBaseFilename()+(B?".drawio":"")+".svg";ca=null!=ca?ca:mxUtils.bind(this,function(qa){this.isLocalFileSave()||qa.length<=MAX_REQUEST_SIZE?this.saveData(W,-"svg",qa,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(qa)}))});var U=mxUtils.bind(this,function(qa){this.spinner.stop();B&&qa.setAttribute("content",this.getFileData(!0,null,null,null,l,N,null,null,null,null,null,c,I));ca(Graph.xmlDeclaration+"\n"+(B?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(qa))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Z);var aa=mxUtils.bind(this,-function(qa){Editor.replaceSvgDataUris&&D&&EditorUi.embedSvgImages(qa);Editor.foreignObjectImages&&ea?this.replaceAlternateContent(qa,da,U):U(qa)}),ia=Graph.customFontElements;Graph.customFontElements=J;var na=mxUtils.bind(this,function(qa){Graph.customFontElements=ia;Graph.addFont=x;D&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(qa,aa,this.thumbImageCache)):aa(qa)});ea?this.embedFonts(Z,na):(this.editor.addFontCss(Z),-na(Z))}catch(qa){this.handleError(qa)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function t(ja,ea,ca,fa,la){var ka=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ka.setAttribute("x",ea);ka.setAttribute("y",ca+.5);ka.setAttribute("width",fa.width);ka.setAttribute("height",fa.height);null==ka.setAttributeNS?ka.setAttribute("xlink:href",la):ka.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);ja.replaceChild(ka,ja.lastChild);L()}function B(){if(I<da.length)da[I++](B)}-var D="";g=c.getElementsByTagName("style");for(var I=0;I<g.length;I++)D+=g[I].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var L=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),N={},K={},da=[];for(I=0;I<g.length;I++)mxUtils.bind(this,function(ja){var ea=ja.getElementsByTagName("div");if(0<ea.length)try{var ca=ea[0].cloneNode(!0),fa=parseInt(ca.style.marginLeft),la=parseInt(ca.style.paddingTop),ka=ca.getElementsByTagName("div")[1],V=ea=!1,k=ca.style.alignItems,x=ca.style.justifyContent;-if(null!=ca.style.writingMode){var J=ca.style.writingMode;V="vertical-"==J.substring(0,9);ea="-rl"==J.substring(J.length-3)}var R=!V&&"1px"==ca.style.width||V&&"1px"==ca.style.height;if(!V&&"1px"==ca.style.height||V&&"1px"==ca.style.width)ca.style.alignItems=V&&ea?"unsafe flex-end":"unsafe flex-start";R&&(ca.style.justifyContent="unsafe flex-start");ca.style.paddingTop="";ca.style.marginLeft="";var Y=ca.outerHTML,Z=N[Y];null==Z&&(ca.style.position="absolute",ca.style.visibility="hidden",document.body.appendChild(ca),-J=1,J="1px"==ca.style.width?ka.offsetWidth:parseInt(ca.style.width),R=1,R="1px"==ca.style.height?ka.offsetHeight:parseInt(ca.style.height),document.body.removeChild(ca),Z=new mxRectangle(fa,la,J,R),N[Y]=Z);"1px"==ca.style.height&&("unsafe center"==k?la-=Z.height/2:"unsafe flex-end"==k&&(la-=Z.height));if("1px"==ca.style.width)if(!V&&"unsafe center"==x||V&&"unsafe center"==k)fa-=Z.width/2;else if(!V&&"unsafe flex-end"==x||V&&(!ea&&"unsafe flex-end"==k||ea&&"unsafe flex-start"==k))fa-=Z.width;Z=new mxRectangle(fa,-la,Z.width,Z.height+parseInt(ka.style.fontSize)/4);da.push(mxUtils.bind(this,function(W){var U=K[Y];null==U?Graph.htmlToPng(Y,Z.width,Z.height,mxUtils.bind(this,function(aa){t(ja,fa,la,Z,aa);K[Y]=aa;W()}),D):(t(ja,fa,la,Z,U),W())}))}catch(W){L()}else L()})(g[I]);0==counter&&l(c);I=0;B()};EditorUi.prototype.addRadiobox=function(c,g,l,t,B,D,I){return this.addCheckbox(c,l,t,B,D,I,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,t,B,D,I,L){D=null!=D?D:!0;var N=document.createElement("input");N.style.marginRight=-"8px";N.style.marginTop="16px";N.setAttribute("type",I?"radio":"checkbox");I="geCheckbox-"+Editor.guid();N.id=I;null!=L&&N.setAttribute("name",L);l&&(N.setAttribute("checked","checked"),N.defaultChecked=!0);t&&N.setAttribute("disabled","disabled");D&&(c.appendChild(N),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",I),c.appendChild(l),B||mxUtils.br(c));return N};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);-l.style.marginLeft="24px";var t=this.getCurrentFile(),B="";null!=t&&t.getMode()!=App.MODE_DEVICE&&t.getMode()!=App.MODE_BROWSER&&(B=window.location.href);var D=document.createElement("select");D.style.maxWidth="200px";D.style.width="auto";D.style.marginLeft="8px";D.style.marginRight="10px";D.className="geBtn";t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("makeCopy"));D.appendChild(t);var I=document.createElement("option");I.setAttribute("value",-"custom");mxUtils.write(I,mxResources.get("custom")+"...");D.appendChild(I);c.appendChild(D);mxEvent.addListener(D,"change",mxUtils.bind(this,function(){if("custom"==D.value){var L=new FilenameDialog(this,B,mxResources.get("ok"),function(N){null!=N?(B=N,I.setAttribute("title",N)):(D.value="blank",I.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){D.value="blank"});this.showDialog(L.container,300,80,!0,!1);L.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,-function(){l.checked&&(null==g||g.checked)?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===D.value?"_blank":B:null},getEditInput:function(){return l},getEditSelect:function(){return D}}};EditorUi.prototype.addLinkSection=function(c,g){function l(){var L=document.createElement("div");L.style.width="100%";L.style.height="100%";L.style.boxSizing="border-box";null!=D&&D!=mxConstants.NONE?(L.style.border="1px solid black",-L.style.backgroundColor=D):(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 t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginLeft="8px";t.style.marginRight="10px";t.className="geBtn";var B=document.createElement("option");B.setAttribute("value","auto");mxUtils.write(B,mxResources.get("automatic"));-t.appendChild(B);B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("openInNewWindow"));t.appendChild(B);B=document.createElement("option");B.setAttribute("value","self");mxUtils.write(B,mxResources.get("openInThisWindow"));t.appendChild(B);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(g));c.appendChild(t);mxUtils.write(c,mxResources.get("borderColor")+-":");var D="#0000ff",I=null;I=mxUtils.button("",mxUtils.bind(this,function(L){this.pickColor(D||"none",function(N){D=N;l()});mxEvent.consume(L)}));l();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 D},getTarget:function(){return t.value},-focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,t,B,D){D=null!=D?D:[];l&&(D.push("lightbox=1"),"auto"!=c&&D.push("target="+c),null!=g&&g!=mxConstants.NONE&&D.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=t&&0<t.length&&D.push("edit="+encodeURIComponent(t)),B&&D.push("layers=1"),this.editor.graph.foldingEnabled&&D.push("nav=1"));return D};EditorUi.prototype.createLink=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){var ca=this.getCurrentFile();N=this.createUrlParameters(c,-g,t,B,D,N);c=!0;null!=I?l="#U"+encodeURIComponent(I):L||null==ca||""==ca.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+ca.getHash(),c=!1);c&&null!=ca&&null!=ca.getTitle()&&ca.getTitle()!=this.defaultFilename&&N.push("title="+encodeURIComponent(ca.getTitle()));K&&1<l.length&&(N.push("open="+l.substring(1)),l="");da&&null!=this.currentPage&&N.push("page-id="+this.currentPage.getId());-ja&&N.push("transparent=1");null!=ea&&N.push("dark="+ea);return(t&&(null!=I||null!=ca&&ca.getMode()!=App.MODE_GITHUB&&ca.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<N.length?"?"+N.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){this.getBasenames();var ca={};""!=B&&B!=mxConstants.NONE&&(ca.highlight=B);"auto"!==-t&&(ca.target=t);K||(ca.lightbox=!1);ca.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(ca.zoom=l/100);l=[];I&&(l.push("pages"),ca.resize=!0,null!=this.pages&&null!=this.currentPage&&(ca.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),ca.resize=!0);L&&l.push("layers");N&&l.push("tags");null!=ea&&(ca["dark-mode"]=ea);0<l.length&&(K&&l.push("lightbox"),ca.toolbar=l.join(" "));null!=da&&0<da.length&&(ca.edit=da);null!=c?ca.url=c:ca.xml=this.getFileData(!0,-null,null,null,null,!I);g='<div class="mxgraph" style="'+(D?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ca))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<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,g,l,t){var B=document.createElement("div");B.style.whiteSpace="nowrap";var D=document.createElement("h3");mxUtils.write(D,mxResources.get("html"));D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";B.appendChild(D);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");D=L.cloneNode(!0);D.setAttribute("value","copy");I.appendChild(D);var N=document.createElement("span");mxUtils.write(N,mxResources.get("includeCopyOfMyDiagram"));I.appendChild(N);mxUtils.br(I);I.appendChild(L);N=document.createElement("span");mxUtils.write(N,mxResources.get("publicDiagramUrl"));I.appendChild(N);var K=this.getCurrentFile();-null==l&&null!=K&&K.constructor==window.DriveFile&&(N=document.createElement("a"),N.style.paddingLeft="12px",N.style.color="gray",N.style.cursor="pointer",mxUtils.write(N,mxResources.get("share")),I.appendChild(N),mxEvent.addListener(N,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(K.getId(),K)})));D.setAttribute("checked","checked");null==l&&L.setAttribute("disabled","disabled");B.appendChild(I);I=380;var da=this.addLinkSection(B),ja=document.createElement("select");-ja.style.maxWidth="260px";ja.style.marginLeft="8px";ja.style.marginTop="16px";N=document.createElement("option");N.setAttribute("value","light");mxUtils.write(N,mxResources.get("light"));ja.appendChild(N);N=document.createElement("option");N.setAttribute("value","dark");mxUtils.write(N,mxResources.get("dark"));ja.appendChild(N);N=document.createElement("option");N.setAttribute("value","auto");mxUtils.write(N,mxResources.get("automatic"));N.setAttribute("selected","selected");ja.appendChild(N);N.setAttribute("selected",-"selected");mxUtils.write(B,mxResources.get("appearance")+":");B.appendChild(ja);mxUtils.br(B);I+=26;var ea=this.addCheckbox(B,mxResources.get("zoom"),!0,null,!0);mxUtils.write(B,":");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="100%";B.appendChild(ca);var fa=this.addCheckbox(B,mxResources.get("fit"),!0);N=null!=this.pages&&1<this.pages.length;var la=la=this.addCheckbox(B,-mxResources.get("allPages"),N,!N),ka=this.addCheckbox(B,mxResources.get("layers"),!0),V=this.addCheckbox(B,mxResources.get("tags"),!0),k=this.addCheckbox(B,mxResources.get("lightbox"),!0),x=null;if(EditorUi.enableHtmlEditOption){x=this.addEditButton(B,k);var J=x.getEditInput();J.style.marginBottom="16px";I+=50;mxEvent.addListener(k,"change",function(){k.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled");J.checked&&k.checked?x.getEditSelect().removeAttribute("disabled"):x.getEditSelect().setAttribute("disabled",-"disabled")})}c=new CustomDialog(this,B,mxUtils.bind(this,function(){t(L.checked?l:null,ea.checked,ca.value,da.getTarget(),da.getColor(),fa.checked,la.checked,ka.checked,V.checked,k.checked,null!=x?x.getLink():null,null!=ja?ja.value:null)}),null,c,g);this.showDialog(c.container,340,I,!0,!0);D.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,t,B,D,I,L,N,K,da,ja){var ea=document.createElement("div");ea.style.whiteSpace="nowrap";var ca=document.createElement("h3");mxUtils.write(ca,c||-mxResources.get("publish"));ca.style.width="100%";ca.style.textAlign="center";ca.style.marginTop="2px";ca.style.marginBottom="20px";ea.appendChild(ca);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())B=null!=B?B:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ca=document.createElement("option"),mxUtils.write(ca,mxResources.get("makeCopy")),-ca.setAttribute("value","copy"),fa.appendChild(ca);ca=document.createElement("option");mxUtils.write(ca,mxResources.get("authorizationRequired"));ca.setAttribute("value","auth");fa.appendChild(ca);null!=L&&""!=L.getHash()||ca.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"));ea.appendChild(fa);mxUtils.br(ea);fa.focus();var la=null,ka=null;if(null!=g||null!=l)c+=30,mxUtils.write(ea,mxResources.get("width")+":"),la=document.createElement("input"),la.setAttribute("type","text"),la.style.marginRight="16px",la.style.width="50px",la.style.marginLeft="6px",la.style.marginRight="16px",la.style.marginBottom="10px",la.value="100%",ea.appendChild(la),mxUtils.write(ea,mxResources.get("height")+-":"),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.style.width="50px",ka.style.marginLeft="6px",ka.style.marginBottom="10px",ka.value=l+"px",ea.appendChild(ka),mxUtils.br(ea);var V=this.addLinkSection(ea,t),k=K?this.addCheckbox(ea,mxResources.get("transparentBackground"),!1):null;null!=k&&(c+=20);var x=document.createElement("select");x.className="geBtn";x.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value",-"allPages");x.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");x.appendChild(g);var J=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(ea,mxResources.get("pages")+":"),ea.appendChild(x),mxUtils.br(ea),c+=30),J=this.addCheckbox(ea,mxResources.get("selectedPage")+-": "+g));var R=document.createElement("select");R.style.maxWidth="260px";R.style.marginLeft="8px";R.style.marginTop="16px";ja=document.createElement("option");ja.setAttribute("value","0");mxUtils.write(ja,mxResources.get("light"));R.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));R.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected",-"selected");R.appendChild(ja);da&&(mxUtils.write(ea,mxResources.get("appearance")+":"),ea.appendChild(R),mxUtils.br(ea),c+=30);var Y=this.addCheckbox(ea,mxResources.get("lightbox"),!0,null,null,!t),Z=this.addEditButton(ea,Y),W=Z.getEditInput();t&&(W.style.marginLeft=Y.style.marginLeft,Y.style.display="none",c-=20);var U=this.addCheckbox(ea,mxResources.get("layers"),!0);U.style.marginLeft=W.style.marginLeft;U.style.marginTop="8px";var aa=this.addCheckbox(ea,mxResources.get("tags"),!0);aa.style.marginLeft=-W.style.marginLeft;aa.style.marginBottom="16px";aa.style.marginTop="16px";mxEvent.addListener(Y,"change",function(){Y.checked?(U.removeAttribute("disabled"),W.removeAttribute("disabled"),aa.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"));W.checked&&Y.checked?Z.getEditSelect().removeAttribute("disabled"):Z.getEditSelect().setAttribute("disabled","disabled")});t=new CustomDialog(this,ea,mxUtils.bind(this,-function(){N(V.getTarget(),V.getColor(),null==J?!1:J.checked,Y.checked,Z.getLink(),U.checked,null!=la?la.value:null,null!=ka?ka.value:null,aa.checked,fa.value,null!=k?k.checked:!1,R.value,"allPages"==x.value)}),null,mxResources.get("create"),B,D);this.showDialog(t.container,340,296+c,!0,!0);null!=la?(la.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?la.select():document.execCommand("selectAll",!1,null)):null==fa.parentNode;V.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,-g,l,t,B){var D=document.createElement("div");D.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:"+(B?"10":"4")+"px";D.appendChild(I);if(B){mxUtils.write(D,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%";D.appendChild(L);mxUtils.write(D,mxResources.get("borderWidth")+":");var N=document.createElement("input");N.setAttribute("type","text");N.style.marginRight="16px";N.style.width="60px";N.style.marginLeft="4px";N.value=this.lastExportBorder||"0";D.appendChild(N);mxUtils.br(D)}var K=this.addCheckbox(D,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),da=t?null:this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);I=this.editor.graph;-var ja=t?null:this.addCheckbox(D,mxResources.get("transparentBackground"),I.background==mxConstants.NONE||null==I.background);null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,D,mxUtils.bind(this,function(){var ea=parseInt(L.value)/100||1,ca=parseInt(N.value)||0;l(!K.checked,null!=da?da.checked:!1,null!=ja?ja.checked:!1,ea,ca)}),null,c,g);this.showDialog(c.container,300,(B?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,t,B,D,I,L,N){I=null!=I?I:Editor.defaultIncludeDiagram;-var K=document.createElement("div");K.style.whiteSpace="nowrap";var da=this.editor.graph,ja="jpeg"==L||"webp"==L?220:320,ea=document.createElement("h3");mxUtils.write(ea,c);ea.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";K.appendChild(ea);mxUtils.write(K,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%";K.appendChild(ca);mxUtils.write(K,mxResources.get("borderWidth")+":");var fa=document.createElement("input");fa.setAttribute("type","text");fa.style.marginRight="16px";fa.style.width="60px";fa.style.marginLeft="4px";fa.value=this.lastExportBorder||"0";K.appendChild(fa);mxUtils.br(K);var la=this.addCheckbox(K,mxResources.get("selectionOnly"),!1,da.isSelectionEmpty()),ka=document.createElement("input");ka.style.marginTop="16px";ka.style.marginRight="8px";ka.style.marginLeft=-"24px";ka.setAttribute("disabled","disabled");ka.setAttribute("type","checkbox");var V=document.createElement("select");V.style.marginTop="16px";V.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(ea=0;ea<c.length;ea++)if(!da.isSelectionEmpty()||"selectionOnly"!=c[ea]){var k=document.createElement("option");mxUtils.write(k,mxResources.get(c[ea]));k.setAttribute("value",c[ea]);V.appendChild(k)}N?(mxUtils.write(K,mxResources.get("size")+":"),K.appendChild(V),mxUtils.br(K),ja+=26,mxEvent.addListener(V,-"change",function(){"selectionOnly"==V.value&&(la.checked=!0)})):D&&(K.appendChild(ka),mxUtils.write(K,mxResources.get("crop")),mxUtils.br(K),ja+=30,mxEvent.addListener(la,"change",function(){la.checked?ka.removeAttribute("disabled"):ka.setAttribute("disabled","disabled")}));da.isSelectionEmpty()?N&&(la.style.display="none",la.nextSibling.style.display="none",la.nextSibling.nextSibling.style.display="none",ja-=30):(V.value="diagram",ka.setAttribute("checked","checked"),ka.defaultChecked=!0,mxEvent.addListener(la,-"change",function(){V.value=la.checked?"selectionOnly":"diagram"}));var x=this.addCheckbox(K,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=L&&"webp"!=L),J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft="8px";J.style.marginTop="16px";D=document.createElement("option");D.setAttribute("value","light");mxUtils.write(D,mxResources.get("light"));J.appendChild(D);N=document.createElement("option");N.setAttribute("value","dark");mxUtils.write(N,mxResources.get("dark"));-J.appendChild(N);"svg"==L&&mxUtils.lightDarkColorSupported?(D=document.createElement("option"),D.setAttribute("value","auto"),mxUtils.write(D,mxResources.get("automatic")),D.setAttribute("selected","selected"),J.appendChild(D)):Editor.isDarkMode()?N.setAttribute("selected","selected"):D.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("appearance")+":");K.appendChild(J);mxUtils.br(K);ja+=26;var R=this.addCheckbox(K,mxResources.get("shadow"),da.shadowVisible),Y=null;if("png"==L||-"jpeg"==L||"webp"==L)Y=this.addCheckbox(K,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;da=null!=this.pages?this.pages.length:1;var Z=this.addCheckbox(K,mxResources.get("includeCopyOfMyDiagram")+(1<da?":":""),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(){Z.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},D=document.createElement("option"),-D.setAttribute("value","allPages"),mxUtils.write(D,mxResources.get("allPages")),W.appendChild(D),D=document.createElement("option"),D.setAttribute("value","currentPage"),mxUtils.write(D,mxResources.get("currentPage")),W.appendChild(D),1<da?(Z.style.marginBottom="12px",W.style.marginBottom="16px",K.appendChild(W),mxUtils.br(K),ja+=20):Z.style.marginBottom="16px",null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(Z,"change",I),I()):Z.style.marginBottom="16px";var U=document.createElement("input");-U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");U.id="geCheckbox-"+Editor.guid();var aa=document.createElement("input");aa.style.marginBottom="16px";aa.style.marginRight="8px";aa.setAttribute("type","checkbox");aa.id="geCheckbox-"+Editor.guid();g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,K.appendChild(U),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedImages")),I.setAttribute("for",U.id),K.appendChild(I),mxUtils.br(K),-aa.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,K.appendChild(aa),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedFonts")),I.setAttribute("for",aa.id),K.appendChild(I),mxUtils.br(K),ja+=50);var ia=document.createElement("select");ia.style.maxWidth="260px";ia.style.marginLeft="8px";D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));ia.appendChild(D);I=document.createElement("option");I.setAttribute("value",-"blank");mxUtils.write(I,mxResources.get("openInNewWindow"));ia.appendChild(I);I=document.createElement("option");I.setAttribute("value","self");mxUtils.write(I,mxResources.get("openInThisWindow"));ia.appendChild(I);I=document.createElement("div");mxUtils.write(I,mxResources.get("LinksLost"));I.style.margin="7px";I.style.display="none";"svg"==L&&(mxUtils.write(K,mxResources.get("links")+":"),K.appendChild(ia),K.appendChild(I),mxUtils.br(K),mxUtils.br(K),ja+=50);l=new CustomDialog(this,K,mxUtils.bind(this,-function(){this.lastExportBorder=fa.value;this.lastExportZoom=ca.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=aa.checked;this.lastEmbedInclude=W.value;B(ca.value,x.checked,!la.checked,R.checked,Z.checked,U.checked&&g,fa.value,ka.checked,("png"==L||"svg"==L)&&"currentPage"==W.value,ia.value,null!=Y?Y.checked:null,null!=J?J.value:null,V.value,aa.checked)}),null,l,t);this.showDialog(l.container,340,ja,!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,g,l,t,B){var D=document.createElement("div");D.style.whiteSpace="nowrap";var I=this.editor.graph;if(null!=g){var L=document.createElement("h3");mxUtils.write(L,g);L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";D.appendChild(L)}var N=this.addCheckbox(D,mxResources.get("fit"),!0),K=this.addCheckbox(D,mxResources.get("shadow"),I.shadowVisible&&t,!t),da=this.addCheckbox(D,-l),ja=this.addCheckbox(D,mxResources.get("lightbox"),!0),ea=this.addEditButton(D,ja),ca=ea.getEditInput(),fa=1<I.model.getChildCount(I.model.getRoot()),la=this.addCheckbox(D,mxResources.get("layers"),fa,!fa);la.style.marginLeft=ca.style.marginLeft;la.style.marginBottom="12px";la.style.marginTop="8px";mxEvent.addListener(ja,"change",function(){ja.checked?(fa&&la.removeAttribute("disabled"),ca.removeAttribute("disabled")):(la.setAttribute("disabled","disabled"),ca.setAttribute("disabled","disabled"));-ca.checked&&ja.checked?ea.getEditSelect().removeAttribute("disabled"):ea.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,D,mxUtils.bind(this,function(){c(N.checked,K.checked,da.checked,ja.checked,ea.getLink(),la.checked)}),null,mxResources.get("embed"),B);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,t,B,D,I,L){function N(ca){var fa=" ",la="";t&&(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"+(null!=da?"&page="+da:"")+(B?"&edit=_blank":"")+(D?"&layers=1":"")+"');}})(this);\"",la+="cursor:pointer;");c&&(la+="max-width:100%;");var ka="";l&&(ka=' width="'+Math.round(K.width)+'" height="'+Math.round(K.height)+'"');I('<img src="'+ca+'"'+ka+(""!=la?' style="'+la+'"':"")+fa+"/>")}var K=this.editor.graph.getGraphBounds(),da=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ca){var fa=t?this.getFileData(!0):-null;ca=this.createImageDataUri(ca,fa,"png");N(ca)}),null,null,null,mxUtils.bind(this,function(ca){L({message:mxResources.get("unknownError")})}),null,!0,l?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 ja="";l&&(ja="&w="+Math.round(2*K.width)+"&h="+Math.round(2*K.height));var ea=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(t?"1":"0")+ja+"&xml="+encodeURIComponent(g));ea.send(mxUtils.bind(this,function(){200<=-ea.getStatus()&&299>=ea.getStatus()?N("data:image/png;base64,"+ea.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,t,B,D,I){var L=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),N=L.getElementsByTagName("a");if(null!=N)for(var K=0;K<N.length;K++){var da=N[K].getAttribute("href");null!=da&&"#"==da.charAt(0)&&"_blank"==N[K].getAttribute("target")&&N[K].removeAttribute("target")}t&&-L.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(L);if(l){var ja=" ",ea="";t&&(ja="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"+(B?"&edit=_blank":"")+(D?"&layers=1":-"")+"');}})(this);\"",ea+="cursor:pointer;");c&&(ea+="max-width:100%;");this.editor.convertImages(L,mxUtils.bind(this,function(ca){I('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ca))+'"'+(""!=ea?' style="'+ea+'"':"")+ja+"/>")}))}else ea="",t&&(g=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!=g?"&page="+g:"")+(B?"&edit=_blank":"")+(D?"&layers=1":"")+"');}}})(this);"),ea+="cursor:pointer;"),c&&(c=parseInt(L.getAttribute("width")),B=parseInt(L.getAttribute("height")),L.setAttribute("viewBox","-0.5 -0.5 "+c+" "+B),ea+="max-width:100%;max-height:"+B+"px;",L.removeAttribute("height")),""!=ea&&L.setAttribute("style",ea),this.editor.addFontCss(L),this.editor.graph.mathEnabled&&this.editor.addMathCss(L),I(mxUtils.getXml(L))};EditorUi.prototype.timeSince=+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",B);this.editor.exportToCanvas(mxUtils.bind(this,function(K){I.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);B.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(K){I.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(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,t,B,D){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){D=this.embedMessageSource||window.opener||window.parent;var I=this.createLoadMessage("export");I.format=g;+I.filename=c;I.data=B?"data:"+t+";base64,"+l:l;I.xml=this.getFileData(!0);D.postMessage(JSON.stringify(I),"*")}else this.isLocalFileSave()?this.saveLocalFile(l,c,t,B,g,D):this.saveRequest(c,g,mxUtils.bind(this,function(K,M){return this.createEchoRequest(l,K,t,B,g,M)}),l,B,t)};EditorUi.prototype.saveRequest=function(c,g,l,t,B,D,I){I=null!=I?I:!mxClient.IS_IOS||!navigator.standalone;var K=mxUtils.bind(this,function(V,Q,ja,ea){if("_blank"==Q||null!=V&&0<V.length){var da=l("_blank"==Q?null:V,Q==App.MODE_DEVICE||+"download"==Q||null==Q||"_blank"==Q?"0":"1");null!=da&&(Q==App.MODE_DEVICE||"download"==Q||"_blank"==Q?da.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(ia){D=null!=D?D:"pdf"==g?"application/pdf":"image/"+g;if(null!=t)try{this.exportFile(t,V,D,!0,Q,ia)}catch(la){this.handleError(la)}else this.spinner.spin(document.body,mxResources.get("saving"))&&da.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=da.getStatus()&&299>=da.getStatus())try{this.exportFile(da.getText(),V,D,!0,+Q,ia)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=ea?ja(ea):this.pickFolder(Q,ja)))}});B=[App.MODE_BROWSER];I||B.push("_blank");var M=new SaveDialog(this,c,mxUtils.bind(this,function(V,Q,ja){K(V.value,Q,V,ja);this.hideDialog(null,null,M.container)}),B,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,g,l,t,B,D){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da){if(this.spinner.spin(document.body,mxResources.get("exporting"),+mxUtils.bind(this,function(pa){Editor.addRetryToError(pa,mxUtils.bind(this,function(){this.exportSvg(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da)}));this.handleError(pa)})))try{var ia=this.editor.graph.isSelectionEmpty();l=null!=l?l:ia;var la=g?null:this.editor.graph.background;la==mxConstants.NONE&&(la=null);null==la&&0==g&&(la=this.editor.graph.shapeBackgroundColor);var ka=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var W=mxUtils.lightDarkColorSupported,+k=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var y=Graph.addFont,J={};Graph.addFont=function(pa,ta,ua,Ca){y.call(this,pa,ta,ua,J)};var R=this.editor.graph.createSvgImageExport(B),X=R.drawCellState;R.drawCellState=function(pa,ta){null!=pa&&Graph.processFontStyle(pa.style);X.apply(this,arguments)};var aa=this.editor.graph.getSvg(la,c,I,K,null,l,null,R,"blank"==V?"_blank":"self"==V?"_top":null,null,!ea,Q,ja);mxUtils.lightDarkColorSupported=+W;mxUtils.preferDarkColor=k;this.editor.graph.addForeignObjectWarning=ka;t&&this.editor.graph.addSvgShadow(aa);var Z=this.getBaseFilename()+(B?".drawio":"")+".svg";da=null!=da?da:mxUtils.bind(this,function(pa){this.isLocalFileSave()||pa.length<=MAX_REQUEST_SIZE?this.saveData(Z,"svg",pa,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(pa)}))});var U=mxUtils.bind(this,function(pa){this.spinner.stop();B&&+pa.setAttribute("content",this.getFileData(!0,null,null,null,l,M,null,null,null,null,null,c,I));da(Graph.xmlDeclaration+"\n"+(B?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(pa))});this.editor.graph.mathEnabled&&this.editor.addMathCss(aa);var ba=mxUtils.bind(this,function(pa){Editor.replaceSvgDataUris&&D&&EditorUi.embedSvgImages(pa);Editor.foreignObjectImages&&ea?this.replaceAlternateContent(pa,Q,U):U(pa)}),fa=Graph.customFontElements;Graph.customFontElements=J;var na=mxUtils.bind(this,+function(pa){Graph.customFontElements=fa;Graph.addFont=y;D&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(pa,ba,this.thumbImageCache)):ba(pa)});ea?this.embedFonts(aa,na):(this.editor.addFontCss(aa),na(aa))}catch(pa){this.handleError(pa)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function t(ja,ea,da,ia,la){var ka=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ka.setAttribute("x",ea);+ka.setAttribute("y",da+.5);ka.setAttribute("width",ia.width);ka.setAttribute("height",ia.height);null==ka.setAttributeNS?ka.setAttribute("xlink:href",la):ka.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);ja.replaceChild(ka,ja.lastChild);K()}function B(){if(I<Q.length)Q[I++](B)}var D="";g=c.getElementsByTagName("style");for(var I=0;I<g.length;I++)D+=g[I].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var K=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),M={},V={},Q=[];+for(I=0;I<g.length;I++)mxUtils.bind(this,function(ja){var ea=ja.getElementsByTagName("div");if(0<ea.length)try{var da=ea[0].cloneNode(!0),ia=parseInt(da.style.marginLeft),la=parseInt(da.style.paddingTop),ka=da.getElementsByTagName("div")[1],W=ea=!1,k=da.style.alignItems,y=da.style.justifyContent;if(null!=da.style.writingMode){var J=da.style.writingMode;W="vertical-"==J.substring(0,9);ea="-rl"==J.substring(J.length-3)}var R=!W&&"1px"==da.style.width||W&&"1px"==da.style.height;if(!W&&"1px"==da.style.height||+W&&"1px"==da.style.width)da.style.alignItems=W&&ea?"unsafe flex-end":"unsafe flex-start";R&&(da.style.justifyContent="unsafe flex-start");da.style.paddingTop="";da.style.marginLeft="";var X=da.outerHTML,aa=M[X];null==aa&&(da.style.position="absolute",da.style.visibility="hidden",document.body.appendChild(da),J=1,J="1px"==da.style.width?ka.offsetWidth:parseInt(da.style.width),R=1,R="1px"==da.style.height?ka.offsetHeight:parseInt(da.style.height),document.body.removeChild(da),aa=new mxRectangle(ia,+la,J,R),M[X]=aa);"1px"==da.style.height&&("unsafe center"==k?la-=aa.height/2:"unsafe flex-end"==k&&(la-=aa.height));if("1px"==da.style.width)if(!W&&"unsafe center"==y||W&&"unsafe center"==k)ia-=aa.width/2;else if(!W&&"unsafe flex-end"==y||W&&(!ea&&"unsafe flex-end"==k||ea&&"unsafe flex-start"==k))ia-=aa.width;aa=new mxRectangle(ia,la,aa.width,aa.height+parseInt(ka.style.fontSize)/4);Q.push(mxUtils.bind(this,function(Z){var U=V[X];null==U?Graph.htmlToPng(X,aa.width,aa.height,mxUtils.bind(this,function(ba){t(ja,+ia,la,aa,ba);V[X]=ba;Z()}),D):(t(ja,ia,la,aa,U),Z())}))}catch(Z){K()}else K()})(g[I]);0==counter&&l(c);I=0;B()};EditorUi.prototype.addRadiobox=function(c,g,l,t,B,D,I){return this.addCheckbox(c,l,t,B,D,I,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,t,B,D,I,K){D=null!=D?D:!0;var M=document.createElement("input");M.style.marginRight="8px";M.style.marginTop="16px";M.setAttribute("type",I?"radio":"checkbox");I="geCheckbox-"+Editor.guid();M.id=I;null!=K&&M.setAttribute("name",K);l&&(M.setAttribute("checked",+"checked"),M.defaultChecked=!0);t&&M.setAttribute("disabled","disabled");D&&(c.appendChild(M),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",I),c.appendChild(l),B||mxUtils.br(c));return M};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var t=this.getCurrentFile(),B="";null!=t&&t.getMode()!=App.MODE_DEVICE&&t.getMode()!=App.MODE_BROWSER&&(B=window.location.href);var D=document.createElement("select");+D.style.maxWidth="200px";D.style.width="auto";D.style.marginLeft="8px";D.style.marginRight="10px";D.className="geBtn";t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("makeCopy"));D.appendChild(t);var I=document.createElement("option");I.setAttribute("value","custom");mxUtils.write(I,mxResources.get("custom")+"...");D.appendChild(I);c.appendChild(D);mxEvent.addListener(D,"change",mxUtils.bind(this,function(){if("custom"==D.value){var K=new FilenameDialog(this,+B,mxResources.get("ok"),function(M){null!=M?(B=M,I.setAttribute("title",M)):(D.value="blank",I.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){D.value="blank"});this.showDialog(K.container,300,80,!0,!1);K.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===D.value?"_blank":B:null},+getEditInput:function(){return l},getEditSelect:function(){return D}}};EditorUi.prototype.addLinkSection=function(c,g){function l(){var K=document.createElement("div");K.style.width="100%";K.style.height="100%";K.style.boxSizing="border-box";null!=D&&D!=mxConstants.NONE?(K.style.border="1px solid black",K.style.backgroundColor=D):(K.style.backgroundPosition="center center",K.style.backgroundRepeat="no-repeat",K.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");I.innerText="";I.appendChild(K)}+mxUtils.write(c,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 B=document.createElement("option");B.setAttribute("value","auto");mxUtils.write(B,mxResources.get("automatic"));t.appendChild(B);B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("openInNewWindow"));t.appendChild(B);B=document.createElement("option");+B.setAttribute("value","self");mxUtils.write(B,mxResources.get("openInThisWindow"));t.appendChild(B);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(g));c.appendChild(t);mxUtils.write(c,mxResources.get("borderColor")+":");var D="#0000ff",I=null;I=mxUtils.button("",mxUtils.bind(this,function(K){this.pickColor(D||"none",function(M){D=M;l()});mxEvent.consume(K)}));l();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 D},getTarget:function(){return t.value},focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,t,B,D){D=null!=D?D:[];l&&(D.push("lightbox=1"),"auto"!=c&&D.push("target="+c),+null!=g&&g!=mxConstants.NONE&&D.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=t&&0<t.length&&D.push("edit="+encodeURIComponent(t)),B&&D.push("layers=1"),this.editor.graph.foldingEnabled&&D.push("nav=1"));return D};EditorUi.prototype.createLink=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){var da=this.getCurrentFile();M=this.createUrlParameters(c,g,t,B,D,M);c=!0;null!=I?l="#U"+encodeURIComponent(I):K||null==da||""==da.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,+null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+da.getHash(),c=!1);c&&null!=da&&null!=da.getTitle()&&da.getTitle()!=this.defaultFilename&&M.push("title="+encodeURIComponent(da.getTitle()));V&&1<l.length&&(M.push("open="+l.substring(1)),l="");Q&&null!=this.currentPage&&M.push("page-id="+this.currentPage.getId());ja&&M.push("transparent=1");null!=ea&&M.push("dark="+ea);return(t&&(null!=I||null!=da&&da.getMode()!=App.MODE_GITHUB&&da.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("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){this.getBasenames();var da={};""!=B&&B!=mxConstants.NONE&&(da.highlight=B);"auto"!==t&&(da.target=t);V||(da.lightbox=!1);da.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(da.zoom=l/100);l=[];I&&(l.push("pages"),+da.resize=!0,null!=this.pages&&null!=this.currentPage&&(da.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),da.resize=!0);K&&l.push("layers");M&&l.push("tags");null!=ea&&(da["dark-mode"]=ea);0<l.length&&(V&&l.push("lightbox"),da.toolbar=l.join(" "));null!=Q&&0<Q.length&&(da.edit=Q);null!=c?da.url=c:da.xml=this.getFileData(!0,null,null,null,null,!I);g='<div class="mxgraph" style="'+(D?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(da))++'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<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,g,l,t){var B=document.createElement("div");B.style.whiteSpace=+"nowrap";var D=document.createElement("h3");mxUtils.write(D,mxResources.get("html"));D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";B.appendChild(D);var I=document.createElement("div");I.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");+D=K.cloneNode(!0);D.setAttribute("value","copy");I.appendChild(D);var M=document.createElement("span");mxUtils.write(M,mxResources.get("includeCopyOfMyDiagram"));I.appendChild(M);mxUtils.br(I);I.appendChild(K);M=document.createElement("span");mxUtils.write(M,mxResources.get("publicDiagramUrl"));I.appendChild(M);var V=this.getCurrentFile();null==l&&null!=V&&V.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")),I.appendChild(M),mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(V.getId(),V)})));D.setAttribute("checked","checked");null==l&&K.setAttribute("disabled","disabled");B.appendChild(I);I=380;var Q=this.addLinkSection(B),ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";ja.style.marginTop="16px";M=document.createElement("option");M.setAttribute("value","light");mxUtils.write(M,mxResources.get("light"));+ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","auto");mxUtils.write(M,mxResources.get("automatic"));M.setAttribute("selected","selected");ja.appendChild(M);M.setAttribute("selected","selected");mxUtils.write(B,mxResources.get("appearance")+":");B.appendChild(ja);mxUtils.br(B);I+=26;var ea=this.addCheckbox(B,mxResources.get("zoom"),!0,null,!0);mxUtils.write(B,+":");var da=document.createElement("input");da.setAttribute("type","text");da.style.marginRight="16px";da.style.width="60px";da.style.marginLeft="4px";da.style.marginRight="12px";da.value="100%";B.appendChild(da);var ia=this.addCheckbox(B,mxResources.get("fit"),!0);M=null!=this.pages&&1<this.pages.length;var la=la=this.addCheckbox(B,mxResources.get("allPages"),M,!M),ka=this.addCheckbox(B,mxResources.get("layers"),!0),W=this.addCheckbox(B,mxResources.get("tags"),!0),k=this.addCheckbox(B,mxResources.get("lightbox"),+!0),y=null;if(EditorUi.enableHtmlEditOption){y=this.addEditButton(B,k);var J=y.getEditInput();J.style.marginBottom="16px";I+=50;mxEvent.addListener(k,"change",function(){k.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled");J.checked&&k.checked?y.getEditSelect().removeAttribute("disabled"):y.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,B,mxUtils.bind(this,function(){t(K.checked?l:null,ea.checked,da.value,Q.getTarget(),Q.getColor(),ia.checked,+la.checked,ka.checked,W.checked,k.checked,null!=y?y.getLink():null,null!=ja?ja.value:null)}),null,c,g);this.showDialog(c.container,340,I,!0,!0);D.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,t,B,D,I,K,M,V,Q,ja){var ea=document.createElement("div");ea.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";ea.appendChild(da);+var ia=document.createElement("select");c=30;ia.className="geBtn";ia.style.marginBottom="8px";ia.style.marginLeft="0px";ia.style.width="100%";ia.style.boxSizing="border-box";if(null==K||""==K.getHash())B=null!=B?B:"https://www.drawio.com/doc/faq/publish-diagram-as-link",da=document.createElement("option"),mxUtils.write(da,mxResources.get("makeCopy")),da.setAttribute("value","copy"),ia.appendChild(da);da=document.createElement("option");mxUtils.write(da,mxResources.get("authorizationRequired"));da.setAttribute("value",+"auth");ia.appendChild(da);null!=K&&""!=K.getHash()||da.setAttribute("disabled","disabled");K=document.createElement("option");K.setAttribute("value","public");ia.appendChild(K);null!=I?(mxUtils.write(K,mxResources.get("publicDiagramUrl")),K.setAttribute("title",I),ia.value="public"):(mxUtils.write(K,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),K.setAttribute("disabled","disabled"));ea.appendChild(ia);mxUtils.br(ea);ia.focus();var la=null,ka=null;if(null!=g||+null!=l)c+=30,mxUtils.write(ea,mxResources.get("width")+":"),la=document.createElement("input"),la.setAttribute("type","text"),la.style.marginRight="16px",la.style.width="50px",la.style.marginLeft="6px",la.style.marginRight="16px",la.style.marginBottom="10px",la.value="100%",ea.appendChild(la),mxUtils.write(ea,mxResources.get("height")+":"),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.style.width="50px",ka.style.marginLeft="6px",ka.style.marginBottom="10px",ka.value=l+"px",+ea.appendChild(ka),mxUtils.br(ea);var W=this.addLinkSection(ea,t),k=V?this.addCheckbox(ea,mxResources.get("transparentBackground"),!1):null;null!=k&&(c+=20);var y=document.createElement("select");y.className="geBtn";y.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");y.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");y.appendChild(g);+var J=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(ea,mxResources.get("pages")+":"),ea.appendChild(y),mxUtils.br(ea),c+=30),J=this.addCheckbox(ea,mxResources.get("selectedPage")+": "+g));var R=document.createElement("select");R.style.maxWidth="260px";R.style.marginLeft="8px";R.style.marginTop="16px";ja=document.createElement("option");ja.setAttribute("value",+"0");mxUtils.write(ja,mxResources.get("light"));R.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));R.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected","selected");R.appendChild(ja);Q&&(mxUtils.write(ea,mxResources.get("appearance")+":"),ea.appendChild(R),mxUtils.br(ea),c+=30);var X=this.addCheckbox(ea,mxResources.get("lightbox"),+!0,null,null,!t),aa=this.addEditButton(ea,X),Z=aa.getEditInput();t&&(Z.style.marginLeft=X.style.marginLeft,X.style.display="none",c-=20);var U=this.addCheckbox(ea,mxResources.get("layers"),!0);U.style.marginLeft=Z.style.marginLeft;U.style.marginTop="8px";var ba=this.addCheckbox(ea,mxResources.get("tags"),!0);ba.style.marginLeft=Z.style.marginLeft;ba.style.marginBottom="16px";ba.style.marginTop="16px";mxEvent.addListener(X,"change",function(){X.checked?(U.removeAttribute("disabled"),Z.removeAttribute("disabled"),+ba.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));Z.checked&&X.checked?aa.getEditSelect().removeAttribute("disabled"):aa.getEditSelect().setAttribute("disabled","disabled")});t=new CustomDialog(this,ea,mxUtils.bind(this,function(){M(W.getTarget(),W.getColor(),null==J?!1:J.checked,X.checked,aa.getLink(),U.checked,null!=la?la.value:null,null!=ka?ka.value:null,ba.checked,ia.value,null!=k?k.checked:!1,R.value,+"allPages"==y.value)}),null,mxResources.get("create"),B,D);this.showDialog(t.container,340,296+c,!0,!0);null!=la?(la.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?la.select():document.execCommand("selectAll",!1,null)):null==ia.parentNode;W.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,g,l,t,B){var D=document.createElement("div");D.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:"++(B?"10":"4")+"px";D.appendChild(I);if(B){mxUtils.write(D,mxResources.get("zoom")+":");var K=document.createElement("input");K.setAttribute("type","text");K.style.marginRight="16px";K.style.width="60px";K.style.marginLeft="4px";K.style.marginRight="12px";K.value=this.lastExportZoom||"100%";D.appendChild(K);mxUtils.write(D,mxResources.get("borderWidth")+":");var M=document.createElement("input");M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.value=+this.lastExportBorder||"0";D.appendChild(M);mxUtils.br(D)}var V=this.addCheckbox(D,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Q=t?null:this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);I=this.editor.graph;var ja=t?null:this.addCheckbox(D,mxResources.get("transparentBackground"),I.background==mxConstants.NONE||null==I.background);null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,D,mxUtils.bind(this,function(){var ea=+parseInt(K.value)/100||1,da=parseInt(M.value)||0;l(!V.checked,null!=Q?Q.checked:!1,null!=ja?ja.checked:!1,ea,da)}),null,c,g);this.showDialog(c.container,300,(B?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,t,B,D,I,K,M){I=null!=I?I:Editor.defaultIncludeDiagram;var V=document.createElement("div");V.style.whiteSpace="nowrap";var Q=this.editor.graph,ja="jpeg"==K||"webp"==K?220:320,ea=document.createElement("h3");mxUtils.write(ea,c);ea.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";+V.appendChild(ea);mxUtils.write(V,mxResources.get("zoom")+":");var da=document.createElement("input");da.setAttribute("type","text");da.style.marginRight="16px";da.style.width="60px";da.style.marginLeft="4px";da.style.marginRight="12px";da.value=this.lastExportZoom||"100%";V.appendChild(da);mxUtils.write(V,mxResources.get("borderWidth")+":");var ia=document.createElement("input");ia.setAttribute("type","text");ia.style.marginRight="16px";ia.style.width="60px";ia.style.marginLeft="4px";ia.value=this.lastExportBorder||+"0";V.appendChild(ia);mxUtils.br(V);var la=this.addCheckbox(V,mxResources.get("selectionOnly"),!1,Q.isSelectionEmpty()),ka=document.createElement("input");ka.style.marginTop="16px";ka.style.marginRight="8px";ka.style.marginLeft="24px";ka.setAttribute("disabled","disabled");ka.setAttribute("type","checkbox");var W=document.createElement("select");W.style.marginTop="16px";W.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(ea=0;ea<c.length;ea++)if(!Q.isSelectionEmpty()||"selectionOnly"!=+c[ea]){var k=document.createElement("option");mxUtils.write(k,mxResources.get(c[ea]));k.setAttribute("value",c[ea]);W.appendChild(k)}M?(mxUtils.write(V,mxResources.get("size")+":"),V.appendChild(W),mxUtils.br(V),ja+=26,mxEvent.addListener(W,"change",function(){"selectionOnly"==W.value&&(la.checked=!0)})):D&&(V.appendChild(ka),mxUtils.write(V,mxResources.get("crop")),mxUtils.br(V),ja+=30,mxEvent.addListener(la,"change",function(){la.checked?ka.removeAttribute("disabled"):ka.setAttribute("disabled",+"disabled")}));Q.isSelectionEmpty()?M&&(la.style.display="none",la.nextSibling.style.display="none",la.nextSibling.nextSibling.style.display="none",ja-=30):(W.value="diagram",ka.setAttribute("checked","checked"),ka.defaultChecked=!0,mxEvent.addListener(la,"change",function(){W.value=la.checked?"selectionOnly":"diagram"}));var y=this.addCheckbox(V,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=K&&"webp"!=K),J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft=+"8px";J.style.marginTop="16px";D=document.createElement("option");D.setAttribute("value","light");mxUtils.write(D,mxResources.get("light"));J.appendChild(D);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));J.appendChild(M);"svg"==K&&mxUtils.lightDarkColorSupported?(D=document.createElement("option"),D.setAttribute("value","auto"),mxUtils.write(D,mxResources.get("automatic")),D.setAttribute("selected","selected"),J.appendChild(D)):Editor.isDarkMode()?+M.setAttribute("selected","selected"):D.setAttribute("selected","selected");mxUtils.write(V,mxResources.get("appearance")+":");V.appendChild(J);mxUtils.br(V);ja+=26;var R=this.addCheckbox(V,mxResources.get("shadow"),Q.shadowVisible),X=null;if("png"==K||"jpeg"==K||"webp"==K)X=this.addCheckbox(V,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;Q=null!=this.pages?this.pages.length:1;var aa=this.addCheckbox(V,mxResources.get("includeCopyOfMyDiagram")+(1<Q?":":""),I,null,+null,"jpeg"!=K&&"webp"!=K),Z=document.createElement("select");Z.style.maxWidth="260px";Z.style.marginLeft="28px";"png"==K||"svg"==K?(I=function(){aa.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")},D=document.createElement("option"),D.setAttribute("value","allPages"),mxUtils.write(D,mxResources.get("allPages")),Z.appendChild(D),D=document.createElement("option"),D.setAttribute("value","currentPage"),mxUtils.write(D,mxResources.get("currentPage")),Z.appendChild(D),1<Q?(aa.style.marginBottom=+"12px",Z.style.marginBottom="16px",V.appendChild(Z),mxUtils.br(V),ja+=20):aa.style.marginBottom="16px",null!=this.lastEmbedInclude&&(Z.value=this.lastEmbedInclude),mxEvent.addListener(aa,"change",I),I()):aa.style.marginBottom="16px";var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");U.id="geCheckbox-"+Editor.guid();var ba=document.createElement("input");ba.style.marginBottom="16px";ba.style.marginRight="8px";ba.setAttribute("type",+"checkbox");ba.id="geCheckbox-"+Editor.guid();g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,V.appendChild(U),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedImages")),I.setAttribute("for",U.id),V.appendChild(I),mxUtils.br(V),ba.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,V.appendChild(ba),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedFonts")),I.setAttribute("for",ba.id),V.appendChild(I),mxUtils.br(V),ja+=50);var fa=+document.createElement("select");fa.style.maxWidth="260px";fa.style.marginLeft="8px";D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));fa.appendChild(D);I=document.createElement("option");I.setAttribute("value","blank");mxUtils.write(I,mxResources.get("openInNewWindow"));fa.appendChild(I);I=document.createElement("option");I.setAttribute("value","self");mxUtils.write(I,mxResources.get("openInThisWindow"));fa.appendChild(I);I=document.createElement("div");+mxUtils.write(I,mxResources.get("LinksLost"));I.style.margin="7px";I.style.display="none";"svg"==K&&(mxUtils.write(V,mxResources.get("links")+":"),V.appendChild(fa),V.appendChild(I),mxUtils.br(V),mxUtils.br(V),ja+=50);l=new CustomDialog(this,V,mxUtils.bind(this,function(){this.lastExportBorder=ia.value;this.lastExportZoom=da.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=ba.checked;this.lastEmbedInclude=Z.value;B(da.value,y.checked,!la.checked,R.checked,aa.checked,U.checked&&g,ia.value,+ka.checked,("png"==K||"svg"==K)&&"currentPage"==Z.value,fa.value,null!=X?X.checked:null,null!=J?J.value:null,W.value,ba.checked)}),null,l,t);this.showDialog(l.container,340,ja,!0,!0,null,null,null,null,!0);da.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?da.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,l,t,B){var D=document.createElement("div");D.style.whiteSpace="nowrap";var I=this.editor.graph;if(null!=g){var K=document.createElement("h3");+mxUtils.write(K,g);K.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";D.appendChild(K)}var M=this.addCheckbox(D,mxResources.get("fit"),!0),V=this.addCheckbox(D,mxResources.get("shadow"),I.shadowVisible&&t,!t),Q=this.addCheckbox(D,l),ja=this.addCheckbox(D,mxResources.get("lightbox"),!0),ea=this.addEditButton(D,ja),da=ea.getEditInput(),ia=1<I.model.getChildCount(I.model.getRoot()),la=this.addCheckbox(D,mxResources.get("layers"),ia,!ia);la.style.marginLeft=da.style.marginLeft;+la.style.marginBottom="12px";la.style.marginTop="8px";mxEvent.addListener(ja,"change",function(){ja.checked?(ia&&la.removeAttribute("disabled"),da.removeAttribute("disabled")):(la.setAttribute("disabled","disabled"),da.setAttribute("disabled","disabled"));da.checked&&ja.checked?ea.getEditSelect().removeAttribute("disabled"):ea.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,D,mxUtils.bind(this,function(){c(M.checked,V.checked,Q.checked,ja.checked,ea.getLink(),la.checked)}),+null,mxResources.get("embed"),B);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,t,B,D,I,K){function M(da){var ia=" ",la="";t&&(ia=" 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!=Q?"&page="+Q:"")+(B?"&edit=_blank":"")+(D?"&layers=1":"")+"');}})(this);\"",la+="cursor:pointer;");c&&(la+="max-width:100%;");var ka="";l&&(ka=' width="'+Math.round(V.width)+'" height="'+Math.round(V.height)+'"');I('<img src="'+da+'"'+ka+(""!=la?' style="'+la+'"':"")+ia+"/>")}var V=this.editor.graph.getGraphBounds(),Q=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(da){var ia=t?this.getFileData(!0):null;da=this.createImageDataUri(da,+ia,"png");M(da)}),null,null,null,mxUtils.bind(this,function(da){K({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),V.width*V.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var ja="";l&&(ja="&w="+Math.round(2*V.width)+"&h="+Math.round(2*V.height));var ea=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(t?"1":"0")+ja+"&xml="+encodeURIComponent(g));ea.send(mxUtils.bind(this,function(){200<=ea.getStatus()&&299>=+ea.getStatus()?M("data:image/png;base64,"+ea.getText()):K({message:mxResources.get("unknownError")})}))}else K({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,t,B,D,I){var K=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),M=K.getElementsByTagName("a");if(null!=M)for(var V=0;V<M.length;V++){var Q=M[V].getAttribute("href");null!=Q&&"#"==Q.charAt(0)&&"_blank"==M[V].getAttribute("target")&&M[V].removeAttribute("target")}t&&+K.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(K);if(l){var ja=" ",ea="";t&&(ja="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"+(B?"&edit=_blank":"")+(D?"&layers=1":+"")+"');}})(this);\"",ea+="cursor:pointer;");c&&(ea+="max-width:100%;");this.editor.convertImages(K,mxUtils.bind(this,function(da){I('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(da))+'"'+(""!=ea?' style="'+ea+'"':"")+ja+"/>")}))}else ea="",t&&(g=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!=g?"&page="+g:"")+(B?"&edit=_blank":"")+(D?"&layers=1":"")+"');}}})(this);"),ea+="cursor:pointer;"),c&&(c=parseInt(K.getAttribute("width")),B=parseInt(K.getAttribute("height")),K.setAttribute("viewBox","-0.5 -0.5 "+c+" "+B),ea+="max-width:100%;max-height:"+B+"px;",K.removeAttribute("height")),""!=ea&&K.setAttribute("style",ea),this.editor.addFontCss(K),this.editor.graph.mathEnabled&&this.editor.addMathCss(K),I(mxUtils.getXml(K))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var g=Math.floor(c/31536E3);if(1<g)return g+" "+mxResources.get("years");g=Math.floor(c/2592E3);if(1<g)return g+" "+mxResources.get("months");g=Math.floor(c/86400);if(1<g)return g+" "+mxResources.get("days");g=Math.floor(c/3600);if(1<g)return g+" "+mxResources.get("hours");g=Math.floor(c/60);return 1<g?g+" "+mxResources.get("minutes"):1==g?g+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,g){if(null!=c){var l=null;if("diagram"==c.nodeName)l=c;else if("mxfile"==c.nodeName){var t=c.getElementsByTagName("diagram");if(0<t.length){l=t[0];var B=g.getGlobalVariable;g.getGlobalVariable=function(D){return"page"==D?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==D?1:B.apply(this,arguments)}}}null!=l&&(c=Editor.parseDiagramNode(l))}t=this.editor.graph;try{this.editor.graph=g,this.editor.setGraphXml(c)}catch(D){}finally{this.editor.graph=t}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};EditorUi.prototype.getPngFileProperties=function(c){var g=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var t=parseFloat(c.getAttribute("scale"));!isNaN(t)&&0<t&&(g=t)}c.hasAttribute("border")&&(t=parseInt(c.getAttribute("border")),!isNaN(t)&&0<t&&(l=t))}return{scale:g,border:l}};EditorUi.prototype.getEmbeddedPng=function(c,g,l,t,B){try{var D=this.editor.graph,I=null;if(null!=l&&0<l.length)D=this.createTemporaryGraph(D.getStylesheet()),document.body.appendChild(D.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,-!0),D),I=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){D=this.createTemporaryGraph(D.getStylesheet());var L=D.getGlobalVariable;D.setBackgroundImage=this.editor.graph.setBackgroundImage;var N=this.pages[0];this.currentPage==N?D.setBackgroundImage(this.editor.graph.backgroundImage):null!=N.viewState&&null!=N.viewState&&D.setBackgroundImage(N.viewState.backgroundImage);D.getGlobalVariable=function(K){return"page"==K?N.getName():"pagenumber"==K?1:L.apply(this,arguments)};document.body.appendChild(D.container);-D.model.setRoot(N.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(K){try{null==I&&(I=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var da=K.toDataURL("image/png");da=Editor.writeGraphModelToPng(da,"tEXt","mxfile",encodeURIComponent(I));c(da.substring(da.lastIndexOf(",")+1));D!=this.editor.graph&&D.container.parentNode.removeChild(D.container)}catch(ja){null!=g&&g(ja)}}),null,null,null,mxUtils.bind(this,function(K){null!=g&&g(K)}),null,null,t,null,D.shadowVisible,null,-D,B,null,null,null,"diagram",null)}catch(K){null!=g&&g(K)}};EditorUi.prototype.getEmbeddedSvg=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){L=null!=L?L:!0;da=null!=da?da:0;I=null!=N?N:g.background;I==mxConstants.NONE&&(I=null);null==I&&"none"==g.getAdaptiveColors()&&(I="#ffffff");N=this.editor.graph.createSvgImageExport(null!=c);D=g.getSvg(I,K,da,null,null,D,null,N,null,g.shadowVisible||ja,null,ea,"diagram");(g.shadowVisible||ja)&&g.addSvgShadow(D,null,null,0==da);null!=c&&D.setAttribute("content",c);null!=-l&&D.setAttribute("resource",l);var ca=mxUtils.bind(this,function(fa){fa=(t?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(fa);null!=B&&B(fa);return fa});g.mathEnabled&&this.editor.addMathCss(D);if(null!=B)this.embedFonts(D,mxUtils.bind(this,function(fa){L?this.editor.convertImages(fa,mxUtils.bind(this,function(la){ca(la)})):ca(fa)}));else return ca(D)};EditorUi.prototype.embedFonts=function(c,g){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(l){try{null!=l&&this.editor.addFontCss(c,l),g(c)}catch(t){g(c)}}))}catch(l){g(c)}}))};EditorUi.prototype.exportImage=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){N=null!=N?N:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(fa){Editor.addRetryToError(fa,mxUtils.bind(this,function(){this.exportImage(c,g,l,t,B,D,I,L,N,K,da,ja,-ea)}));this.handleError(fa)}))){var ca=this.editor.graph.isSelectionEmpty();l=null!=l?l:ca;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(fa){this.spinner.stop();try{this.saveCanvas(fa,B?this.getFileData(!0,null,null,null,l,L,null,null,null,null,null,c,D):null,N,null==this.pages||0==this.pages.length,da)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(fa){this.spinner.stop();this.handleError(fa)}),-null,l,c||1,g,t,null,null,D,I,K,ja,ea)}catch(fa){this.spinner.stop(),this.handleError(fa)}}};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 g=0;g<this.pages.length;g++)c[this.pages[g].getId()]=this.pages[g].getId();return c};EditorUi.prototype.importXml=function(c,g,l,t,B,D,I){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[g],"dy",[l],"crop",[t],-"noErrorHandling",[B],"addNewPage",[D],"applyDefaultStyles",[I]);g=null!=g?g:0;l=null!=l?l:0;var L=[];try{if(null!=c&&0<c.length){var N=null!=this.pages?this.pages.length:0,K=this.isDiagramEmpty(),da=this.currentPage,ja=this.editor.graph;ja.model.beginUpdate();try{var ea=mxUtils.parseXml(c);c={};var ca=this.editor.extractGraphModel(ea.documentElement,null!=this.pages);if(null!=ca&&"mxfile"==ca.nodeName&&null!=this.pages){var fa=ca.getElementsByTagName("diagram");if(0<fa.length){ea=[];var la=0;if(1==-fa.length&&!D){if(null!=this.currentPage&&(c[fa[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ka=fa[0].getAttribute("name");null!=ka&&""!=ka&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ka))}ca=Editor.parseDiagramNode(fa[0]);t=!1;la=1}for(;la<fa.length;la++){var V=fa[la].getAttribute("id");fa[la].removeAttribute("id");var k=this.updatePageRoot(new DiagramPage(fa[la]));c[V]=fa[la].getAttribute("id");var x=this.pages.length;null==k.getName()&&k.setName(mxResources.get("pageWithNumber",-[x+1]));ja.model.execute(new ChangePage(this,k,k,x,0<la));ea.push(k)}this.updatePageLinks(c,ea)}}if(null!=ca&&"mxGraphModel"===ca.nodeName){L=ja.importGraphModel(ca,g,l,t);if(null!=L)for(this.addLocalPagesToMapping(c),la=0;la<L.length;la++)this.updatePageLinksForCell(c,L[la]);var J=ja.parseBackgroundImage(ca.getAttribute("backgroundImage"));if(null!=J&&null!=J.originalSrc&&this.updateBackgroundPageLink(c,J)){var R=new ChangePageSetup(this,null,J);R.ignoreColor=!0;ja.model.execute(R)}}I&&ja.pasteCellStyles(ja.includeDescendants(L),-ja.defaultVertexStyle,ja.defaultEdgeStyle);!D&&da!=this.currentPage&&null!=this.pages&&1<this.pages.length&&K&&1==N&&this.removePage(da)}finally{ja.model.endUpdate()}}}catch(Y){if(B)throw Y;this.handleError(Y)}return L};EditorUi.prototype.updatePageLinks=function(c,g){for(var l=0;l<g.length;l++)this.updatePageLinksForCell(c,g[l].root),null!=g[l].viewState&&this.updateBackgroundPageLink(c,g[l].viewState.backgroundImage)&&(g[l]==this.currentPage&&this.editor.graph.setViewState(g[l].viewState,!0),g[l].needsUpdate=-!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,g){var l=!1;try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var t=c[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=t&&(g.originalSrc="data:page/id,"+t,l=!0)}}catch(B){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,g){var l=document.createElement("div"),t=this.editor.graph,B=t.getLinkForCell(g);null!=B&&t.setLinkForCell(g,this.updatePageLink(c,B));if(t.isHtmlLabel(g)){l.innerHTML=Graph.sanitizeHtml(t.getLabel(g));-for(var D=l.getElementsByTagName("a"),I=!1,L=0;L<D.length;L++)B=D[L].getAttribute("href"),null!=B&&(D[L].setAttribute("href",this.updatePageLink(c,B)),I=!0);I&&t.labelChanged(g,l.innerHTML)}for(L=0;L<t.model.getChildCount(g);L++)this.updatePageLinksForCell(c,t.model.getChildAt(g,L))};EditorUi.prototype.updatePageLink=function(c,g){if(Graph.isPageLink(g)){var l=c[g.substring(g.indexOf(",")+1)];g=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==g.substring(0,17))try{var t=JSON.parse(g.substring(17));-if(null!=t.actions){for(var B=0;B<t.actions.length;B++){var D=t.actions[B];if(null!=D.open&&Graph.isPageLink(D.open)){var I=D.open.substring(D.open.indexOf(",")+1);l=c[I];null!=l?D.open="data:page/id,"+l:null==this.getPageById(I)&&delete D.open}}g="data:action/json,"+JSON.stringify(t)}}catch(L){}return g};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,g,l,t,B){var D=mxUtils.bind(this,function(I){this.loadingExtensions=-!1;null!=l?l(I):this.handleError(I)});this.createTimeout(null,mxUtils.bind(this,function(I){t=null!=t?t:c.name;var L=mxUtils.bind(this,function(K){I.clear()&&D(K)}),N=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var K=this.isRemoteVisioFormat(t);try{var da=t.lastIndexOf(".");if(0<=da&&da<t.length)t.substring(da+1).toUpperCase();else{var ja=t.lastIndexOf("/");0<=ja&&ja<t.length&&(t=t.substring(ja+1))}}catch(ca){}if(K)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(t)?-L({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):L({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{K=new FormData;K.append("file1",c,t);var ea=new XMLHttpRequest;ea.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));ea.responseType="blob";this.addRemoteServiceSecurityCheck(ea);null!=B&&ea.setRequestHeader("x-convert-custom",B);ea.onreadystatechange=mxUtils.bind(this,function(){if(4==-ea.readyState&&I.clear())if(200<=ea.status&&299>=ea.status)try{var ca=ea.response;if("text/xml"==ca.type){var fa=new FileReader;fa.onload=mxUtils.bind(this,function(la){try{g(la.target.result)}catch(ka){L({message:mxResources.get("errorLoadingFile")})}});fa.readAsText(ca)}else this.doImportVisio(ca,g,L,t)}catch(la){L(la)}else try{""==ea.responseType||"text"==ea.responseType?L({message:ea.responseText}):(fa=new FileReader,fa.onload=function(){try{L({message:JSON.parse(fa.result).Message})}catch(la){null!=-fa.result&&0<fa.result.length?L({message:fa.result}):L(la)}},fa.readAsText(ea.response))}catch(la){L({})}});ea.send(K)}else if(I.clear())try{this.doImportVisio(c,g,L,t)}catch(ca){L(ca)}}else L({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?N():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",N,null,null,null,L))}),D)};EditorUi.prototype.importGraphML=function(c,g,l){var t=mxUtils.bind(this,-function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){var D=mxUtils.bind(this,function(L){B.clear()&&t(L)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(B.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,g,t)}catch(L){D(L)}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?I():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL++!0),D),I=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){D=this.createTemporaryGraph(D.getStylesheet());var K=D.getGlobalVariable;D.setBackgroundImage=this.editor.graph.setBackgroundImage;var M=this.pages[0];this.currentPage==M?D.setBackgroundImage(this.editor.graph.backgroundImage):null!=M.viewState&&null!=M.viewState&&D.setBackgroundImage(M.viewState.backgroundImage);D.getGlobalVariable=function(V){return"page"==V?M.getName():"pagenumber"==V?1:K.apply(this,arguments)};document.body.appendChild(D.container);+D.model.setRoot(M.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{null==I&&(I=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var Q=V.toDataURL("image/png");Q=Editor.writeGraphModelToPng(Q,"tEXt","mxfile",encodeURIComponent(I));c(Q.substring(Q.lastIndexOf(",")+1));D!=this.editor.graph&&D.container.parentNode.removeChild(D.container)}catch(ja){null!=g&&g(ja)}}),null,null,null,mxUtils.bind(this,function(V){null!=g&&g(V)}),null,null,t,null,D.shadowVisible,null,D,B,+null,null,null,"diagram",null)}catch(V){null!=g&&g(V)}};EditorUi.prototype.getEmbeddedSvg=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){K=null!=K?K:!0;Q=null!=Q?Q:0;I=null!=M?M:g.background;I==mxConstants.NONE&&(I=null);null==I&&"none"==g.getAdaptiveColors()&&(I="#ffffff");M=this.editor.graph.createSvgImageExport(null!=c);D=g.getSvg(I,V,Q,null,null,D,null,M,null,g.shadowVisible||ja,null,ea,"diagram");(g.shadowVisible||ja)&&g.addSvgShadow(D,null,null,0==Q);null!=c&&D.setAttribute("content",c);null!=l&&D.setAttribute("resource",+l);var da=mxUtils.bind(this,function(ia){ia=(t?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(ia);null!=B&&B(ia);return ia});g.mathEnabled&&this.editor.addMathCss(D);if(null!=B)this.embedFonts(D,mxUtils.bind(this,function(ia){K?this.editor.convertImages(ia,mxUtils.bind(this,function(la){da(la)})):da(ia)}));else return da(D)};EditorUi.prototype.embedFonts=function(c,g){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(l){try{null!=l&&this.editor.addFontCss(c,l),g(c)}catch(t){g(c)}}))}catch(l){g(c)}}))};EditorUi.prototype.exportImage=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){M=null!=M?M:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ia){Editor.addRetryToError(ia,mxUtils.bind(this,function(){this.exportImage(c,g,l,t,B,D,I,K,M,V,Q,ja,ea)}));this.handleError(ia)}))){var da=+this.editor.graph.isSelectionEmpty();l=null!=l?l:da;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ia){this.spinner.stop();try{this.saveCanvas(ia,B?this.getFileData(!0,null,null,null,l,K,null,null,null,null,null,c,D):null,M,null==this.pages||0==this.pages.length,Q)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ia){this.spinner.stop();this.handleError(ia)}),null,l,c||1,g,t,null,null,D,I,V,+ja,ea)}catch(ia){this.spinner.stop(),this.handleError(ia)}}};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 g=0;g<this.pages.length;g++)c[this.pages[g].getId()]=this.pages[g].getId();return c};EditorUi.prototype.importXml=function(c,g,l,t,B,D,I){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[g],"dy",[l],"crop",[t],"noErrorHandling",[B],"addNewPage",+[D],"applyDefaultStyles",[I]);g=null!=g?g:0;l=null!=l?l:0;var K=[];try{if(null!=c&&0<c.length){var M=null!=this.pages?this.pages.length:0,V=this.isDiagramEmpty(),Q=this.currentPage,ja=this.editor.graph;ja.model.beginUpdate();try{var ea=mxUtils.parseXml(c);c={};var da=this.editor.extractGraphModel(ea.documentElement,null!=this.pages);if(null!=da&&"mxfile"==da.nodeName&&null!=this.pages){var ia=da.getElementsByTagName("diagram");if(0<ia.length){ea=[];var la=0;if(1==ia.length&&!D){if(null!=this.currentPage&&+(c[ia[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ka=ia[0].getAttribute("name");null!=ka&&""!=ka&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ka))}da=Editor.parseDiagramNode(ia[0]);t=!1;la=1}for(;la<ia.length;la++){var W=ia[la].getAttribute("id");ia[la].removeAttribute("id");var k=this.updatePageRoot(new DiagramPage(ia[la]));c[W]=ia[la].getAttribute("id");var y=this.pages.length;null==k.getName()&&k.setName(mxResources.get("pageWithNumber",[y++1]));ja.model.execute(new ChangePage(this,k,k,y,0<la));ea.push(k)}this.updatePageLinks(c,ea)}}if(null!=da&&"mxGraphModel"===da.nodeName){K=ja.importGraphModel(da,g,l,t);if(null!=K)for(this.addLocalPagesToMapping(c),la=0;la<K.length;la++)this.updatePageLinksForCell(c,K[la]);var J=ja.parseBackgroundImage(da.getAttribute("backgroundImage"));if(null!=J&&null!=J.originalSrc&&this.updateBackgroundPageLink(c,J)){var R=new ChangePageSetup(this,null,J);R.ignoreColor=!0;ja.model.execute(R)}}I&&ja.pasteCellStyles(ja.includeDescendants(K),+ja.defaultVertexStyle,ja.defaultEdgeStyle);!D&&Q!=this.currentPage&&null!=this.pages&&1<this.pages.length&&V&&1==M&&this.removePage(Q)}finally{ja.model.endUpdate()}}}catch(X){if(B)throw X;this.handleError(X)}return K};EditorUi.prototype.updatePageLinks=function(c,g){for(var l=0;l<g.length;l++)this.updatePageLinksForCell(c,g[l].root),g[l]!=this.currentPage&&(g[l].needsUpdate=!0),null!=g[l].viewState&&this.updateBackgroundPageLink(c,g[l].viewState.backgroundImage)&&(g[l]==this.currentPage&&this.editor.graph.setViewState(g[l].viewState,+!0),g[l].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,g){var l=!1;try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var t=c[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=t&&(g.originalSrc="data:page/id,"+t,l=!0)}}catch(B){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,g){var l=document.createElement("div"),t=this.editor.graph,B=t.getLinkForCell(g);null!=B&&t.setLinkForCell(g,this.updatePageLink(c,B));if(t.isHtmlLabel(g)){l.innerHTML=Graph.sanitizeHtml(t.getLabel(g));+for(var D=l.getElementsByTagName("a"),I=!1,K=0;K<D.length;K++)B=D[K].getAttribute("href"),null!=B&&(D[K].setAttribute("href",this.updatePageLink(c,B)),I=!0);I&&t.labelChanged(g,l.innerHTML)}for(K=0;K<t.model.getChildCount(g);K++)this.updatePageLinksForCell(c,t.model.getChildAt(g,K))};EditorUi.prototype.updatePageLink=function(c,g){if(Graph.isPageLink(g)){var l=c[g.substring(g.indexOf(",")+1)];g=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==g.substring(0,17))try{var t=JSON.parse(g.substring(17));+if(null!=t.actions){for(var B=0;B<t.actions.length;B++){var D=t.actions[B];if(null!=D.open&&Graph.isPageLink(D.open)){var I=D.open.substring(D.open.indexOf(",")+1);l=c[I];null!=l?D.open="data:page/id,"+l:null==this.getPageById(I)&&delete D.open}}g="data:action/json,"+JSON.stringify(t)}}catch(K){}return g};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,g,l,t,B){var D=mxUtils.bind(this,function(I){this.loadingExtensions=+!1;null!=l?l(I):this.handleError(I)});this.createTimeout(null,mxUtils.bind(this,function(I){t=null!=t?t:c.name;var K=mxUtils.bind(this,function(V){I.clear()&&D(V)}),M=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var V=this.isRemoteVisioFormat(t);try{var Q=t.lastIndexOf(".");if(0<=Q&&Q<t.length)t.substring(Q+1).toUpperCase();else{var ja=t.lastIndexOf("/");0<=ja&&ja<t.length&&(t=t.substring(ja+1))}}catch(da){}if(V)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(t)?+K({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):K({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{V=new FormData;V.append("file1",c,t);var ea=new XMLHttpRequest;ea.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));ea.responseType="blob";this.addRemoteServiceSecurityCheck(ea);null!=B&&ea.setRequestHeader("x-convert-custom",B);ea.onreadystatechange=mxUtils.bind(this,function(){if(4==+ea.readyState&&I.clear())if(200<=ea.status&&299>=ea.status)try{var da=ea.response;if("text/xml"==da.type){var ia=new FileReader;ia.onload=mxUtils.bind(this,function(la){try{g(la.target.result)}catch(ka){K({message:mxResources.get("errorLoadingFile")})}});ia.readAsText(da)}else this.doImportVisio(da,g,K,t)}catch(la){K(la)}else try{""==ea.responseType||"text"==ea.responseType?K({message:ea.responseText}):(ia=new FileReader,ia.onload=function(){try{K({message:JSON.parse(ia.result).Message})}catch(la){null!=+ia.result&&0<ia.result.length?K({message:ia.result}):K(la)}},ia.readAsText(ea.response))}catch(la){K({})}});ea.send(V)}else if(I.clear())try{this.doImportVisio(c,g,K,t)}catch(da){K(da)}}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))}),D)};EditorUi.prototype.importGraphML=function(c,g,l){var t=mxUtils.bind(this,+function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){var D=mxUtils.bind(this,function(K){B.clear()&&t(K)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(B.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,g,t)}catch(K){D(K)}else D({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,D))}),t)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var g=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(D){l.clear()&&g(D)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(l.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||t({message:mxResources.get("unknownError")})}catch(D){t(D)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(B,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,t))}),g):g({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,g,l){var t=-mxUtils.bind(this,function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){var D=mxUtils.bind(this,function(L){B.clear()&&t(L)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(B.clear())if("undefined"!==typeof window.LucidImporter)try{var L=JSON.parse(c);g(LucidImporter.importState(L));try{if(null!=window.console&&"1"==urlParams.test){var N=[(new Date).toISOString(),"convertLucidChart",L];null!=L.state&&N.push(JSON.parse(L.state));-if(null!=L.svgThumbs)for(var K=0;K<L.svgThumbs.length;K++)N.push(Editor.createSvgDataUri(L.svgThumbs[K]));null!=L.thumb&&N.push(L.thumb);console.log.apply(console,N)}}catch(da){}}catch(da){null!=window.console&&console.error(da),D(da)}else D({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",+mxUtils.bind(this,function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){var D=mxUtils.bind(this,function(K){B.clear()&&t(K)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(B.clear())if("undefined"!==typeof window.LucidImporter)try{var K=JSON.parse(c);g(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 V=0;V<K.svgThumbs.length;V++)M.push(Editor.createSvgDataUri(K.svgThumbs[V]));null!=K.thumb&&M.push(K.thumb);console.log.apply(console,M)}}catch(Q){}}catch(Q){null!=window.console&&console.error(Q),D(Q)}else D({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,D)},null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,D))}),t)};EditorUi.prototype.createMermaidXml=function(c,g,l,t,B,D){var I=new Graph(document.createElement("div"));l=I.insertVertex(null,null,null,0,0,t,B,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+l+";");I.setAttributeForCell(l,"mermaidData",JSON.stringify({data:c,config:g},null,2));null!=D&&I.setAttributeForCell(l,"templatePrompt",D);c=(new mxCodec).encode(I.getModel());return mxUtils.getXml(c)};EditorUi.prototype.getSvgForXml=function(c){var g=null,l=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(l.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,l.getModel()),g=l.getSvg(null,null,null,null,null,null,null,-null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(l.container)}return g};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,g,l,t,B){var D=0,I=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(L){var N="";if(null!=this.drive&&null!=this.drive.getUser()){var K=this.drive.getUser();null!=K.email&&0<K.email.indexOf("@")&&(N=K.email.substring(K.email.indexOf("@")+1))}var da={prompt:c,driveDomain:N,options:null!=B?B:-{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",t,"data",[da],"url",["https://www.draw.io/generate/v3"]);var ja=Date.now();N=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(da),"POST");var ea=mxUtils.bind(this,function(fa){L.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[da],"error",[fa],"time",Date.now()-ja+" ms"),l(fa))}),ca=mxUtils.bind(this,function(fa){3>D++?L.clear()&&I():ea(fa)});N.send(mxUtils.bind(this,function(fa){if(L.isAlive())if(200<=-fa.getStatus()&&299>=fa.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ka=fa.getText();try{ka=JSON.parse(ka),result=ka.result}catch(V){result=ka}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[da],"response",[ka],"time",Date.now()-ja+" ms");t?"<"==result.charAt(0)?L.clear()&&(ka=Editor.extractGraphModelFromText(result),g(null!=ka&&3==ka.length?ka[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(V){this.tryAndHandle(mxUtils.bind(this,-function(){L.clear()&&g(V)}),ea)}),ea,ca,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(V,k,x){this.tryAndHandle(mxUtils.bind(this,function(){L.clear()&&g(result,V,k,x)}),ea)}),ea,ca)}),ea,!0);else{var la={message:mxResources.get("error")+" "+fa.getStatus()};try{la=JSON.parse(fa.getText()),null!=la.error&&(la.message=la.error)}catch(ka){}ea(la)}}),ea)}),l)});I()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));+null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(l.container)}return g};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,g,l,t,B){var D=0,I=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(K){var M="";if(null!=this.drive&&null!=this.drive.getUser()){var V=this.drive.getUser();null!=V.email&&0<V.email.indexOf("@")&&(M=V.email.substring(V.email.indexOf("@")+1))}var Q={prompt:c,driveDomain:M,options:null!=B?B:+{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",t,"data",[Q],"url",["https://www.draw.io/generate/v3"]);var ja=Date.now();M=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(Q),"POST");var ea=mxUtils.bind(this,function(ia){K.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[Q],"error",[ia],"time",Date.now()-ja+" ms"),l(ia))}),da=mxUtils.bind(this,function(ia){3>D++?K.clear()&&I():ea(ia)});M.send(mxUtils.bind(this,function(ia){if(K.isAlive())if(200<=+ia.getStatus()&&299>=ia.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ka=ia.getText();try{ka=JSON.parse(ka),result=ka.result}catch(W){result=ka}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[Q],"response",[ka],"time",Date.now()-ja+" ms");t?"<"==result.charAt(0)?K.clear()&&(ka=Editor.extractGraphModelFromText(result),g(null!=ka&&3==ka.length?ka[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(W){this.tryAndHandle(mxUtils.bind(this,+function(){K.clear()&&g(W)}),ea)}),ea,da,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(W,k,y){this.tryAndHandle(mxUtils.bind(this,function(){K.clear()&&g(result,W,k,y)}),ea)}),ea,da)}),ea,!0);else{var la={message:mxResources.get("error")+" "+ia.getStatus()};try{la=JSON.parse(ia.getText()),null!=la.error&&(la.message=la.error)}catch(ka){}ea(la)}}),ea)}),l)});I()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var g=c.split("```");g=1<g.length?g:c.split("<pre>");g=1<g.length?g:c.split("~~~");g=1<g.length?g:c.split("(Begins)");for(var l=mxUtils.trim(1>=g.length?c:g[1]),t=l.split("\n"),B=0;B<t.length&&("mermaid"==t[B]||0==t[B].trim().length||"%%"==t[B].substring(0,2));)B++;l=[];for(var D=B;D<t.length;D++){var I=mxUtils.trim(t[D]);if("%%"!=I.substring(0,2)&&"classDef "!=I.substring(0,9))l.push(t[D]);else if("mermaid"==I)break}t=l;l=mxUtils.trim(t.join("\n"));D=1<t.length?t[0]:null;null!=D&&(I=D.indexOf("-"),0<I&&D.substring(0,I));D=t[0].split(" ")[0].replace(/:$/,"");I=D.indexOf("-");0<I&&(D=D.substring(0,I));EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[l],"type",[D],"startLine",B,"lines",t,"tokens",g);0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,D)&&(l=null);return l};EditorUi.prototype.isSupportedMermaidDiagramType=function(c){return"graph"==c||"flowchart"==c||"sequencediagram"==c||"classdiagram"==c||"statediagram-v2"==c||"statediagram"==c||"erdiagram"==c||"requirementdiagram"==c||"gitgraph"==c||"mindmap"==c||"journey"==c};EditorUi.prototype.getMermaidDiagramType=function(c){c=c.split("\n");for(var g=0;g<c.length&&(0==c[g].trim().length||"%%"==c[g].substring(0,2));)g++;if("---"==c[g].trim()){do g++;while(g<c.length&&"---"!=c[g].trim());g++}c=c[g].trim().toLowerCase();g=c.indexOf(" ");return c.substring(0,0<g?g:c.length)};EditorUi.prototype.parseMermaidDiagram=function(c,g,l,t,B,D){var I=!1;D&&"undefined"!==typeof mxMermaidToDrawio&&this.isSupportedMermaidDiagramType(this.getMermaidDiagramType(c))&&-mxMermaidToDrawio.addListener(mxUtils.bind(this,function(L){I||L==this.emptyDiagramXml||(I=!0,l(L))}));this.generateMermaidImage(c,g,mxUtils.bind(this,function(L,N,K){I||(I=!0,l(this.createMermaidXml(c,g,L,N,K)))}),t,B)};EditorUi.prototype.loadMermaid=function(c,g){var l=mxUtils.bind(this,function(B){this.loadingMermaid=!1;g(B)}),t=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(B){l(B)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(t,+mxMermaidToDrawio.addListener(mxUtils.bind(this,function(K){I||K==this.emptyDiagramXml||(I=!0,l(K))}));this.generateMermaidImage(c,g,mxUtils.bind(this,function(K,M,V){I||(I=!0,l(this.createMermaidXml(c,g,K,M,V)))}),t,B)};EditorUi.prototype.loadMermaid=function(c,g){var l=mxUtils.bind(this,function(B){this.loadingMermaid=!1;g(B)}),t=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(B){l(B)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(t,0):(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",t,null,null,null,l):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,l))};EditorUi.prototype.mermaidSvgToDataUri=function(c,g,l,t){try{c=c.replace(/xlink:href/g,"href").replace(/<br>/g,"<br/>");var B=mxUtils.parseXml(c).getElementsByTagName("svg");if(0<B.length&&"error"!=B[0].getAttribute("aria-roledescription")){var D=parseFloat(B[0].getAttribute("width")),I=parseFloat(B[0].getAttribute("height"));-if(isNaN(D)||isNaN(I))try{var L=B[0].getAttribute("viewBox").split(/\s+/);D=parseFloat(L[2]);I=parseFloat(L[3])}catch(N){D=D||100,I=I||100}g(this.convertDataUri(Editor.createSvgDataUri(c)),D,I)}else null!=t?t():l({message:mxResources.get("invalidInput")})}catch(N){l(N)}};EditorUi.prototype.getMermaidConfig=function(c,g){g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=c.indexOf("$$")&&+if(isNaN(D)||isNaN(I))try{var K=B[0].getAttribute("viewBox").split(/\s+/);D=parseFloat(K[2]);I=parseFloat(K[3])}catch(M){D=D||100,I=I||100}g(this.convertDataUri(Editor.createSvgDataUri(c)),D,I)}else null!=t?t():l({message:mxResources.get("invalidInput")})}catch(M){l(M)}};EditorUi.prototype.getMermaidConfig=function(c,g){g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=c.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme="dark");return g};EditorUi.prototype.generateMermaidImage=function(c,g,l,t,B){var D=mxUtils.bind(this,function(I){null!=t?t(I):this.handleError(I)});this.loadMermaid(mxUtils.bind(this,function(){try{mermaid.mermaidAPI.initialize(this.getMermaidConfig(c,g)),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(mxUtils.bind(this,function(I){this.mermaidSvgToDataUri(I.svg,l,t,B)})).catch(mxUtils.bind(this,-function(I){this.removeMermaidErrors();I=Error(I.toString()+"\n\n"+c);"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();null!=B?B(I):D(I)}))}catch(I){D(I)}}),D)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),g=0;g<c.length;g++)null!=c[g].parentNode&&c[g].parentNode.removeChild(c[g])};EditorUi.prototype.generatePlantUmlImage=function(c,g,l,t){function B(L,N,K){c1=L>>2;c2=(L&3)<<4|N>>4;c3=(N&15)<<2|K>>6;-c4=K&63;r="";r+=D(c1&63);r+=D(c2&63);r+=D(c3&63);return r+=D(c4&63)}function D(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"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(L){r="";for(i=0;i<L.length;i+=3)r=i+2==L.length?r+B(L.charCodeAt(i),L.charCodeAt(i+1),0):i+1==L.length?r+B(L.charCodeAt(i),0,0):-r+B(L.charCodeAt(i),L.charCodeAt(i+1),L.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=g&&(I.responseType="blob");I.onload=function(L){if(200<=this.status&&300>this.status)if("txt"==g)l(this.response);else{var N=new FileReader;N.readAsDataURL(this.response);N.onloadend=function(K){var da=new Image;da.onload=function(){try{var ja=da.width,ea=da.height;if(0==ja&&0==ea){var ca=N.result,fa=ca.indexOf(","),la=decodeURIComponent(escape(atob(ca.substring(fa+1)))),ka=-mxUtils.parseXml(la).getElementsByTagName("svg");0<ka.length&&(ja=parseFloat(ka[0].getAttribute("width")),ea=parseFloat(ka[0].getAttribute("height")))}l(N.result,ja,ea)}catch(V){t(V)}};da.src=N.result};N.onerror=function(K){t(K)}}else t(L)};I.onerror=function(L){t(L)};I.send()};EditorUi.prototype.insertAsPreText=function(c,g,l){var t=this.editor.graph,B=null;t.getModel().beginUpdate();try{B=t.insertVertex(null,null,"<pre>"+c+"</pre>",g,l,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(B,-!0)}finally{t.getModel().endUpdate()}return B};EditorUi.prototype.insertTextAt=function(c,g,l,t,B,D,I,L){D=null!=D?D:!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(ea){4==ea.readyState&&200<=ea.status&&299>=ea.status&&this.editor.graph.setSelectionCells(this.insertTextAt(ea.responseText,-g,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(B||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var N=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var K=Editor.extractGraphModelFromPdf(c);if(null!=K&&0<K.length)return this.importXml(K,g,l,D,!0,L)}if(Editor.isPngDataUrl(c)&&(K=Editor.extractGraphModelFromPng(c),null!=K&&0<K.length))return this.importXml(K,g,l,D,!0,L);if("data:image/svg+xml;"==c.substring(0,19))try{K=null;"data:image/svg+xml;base64,"==c.substring(0,-26)?(K=c.substring(c.indexOf(",")+1),K=window.atob&&!mxClient.IS_SF?atob(K):Base64.decode(K,!0)):K=decodeURIComponent(c.substring(c.indexOf(",")+1));var da=this.importXml(K,g,l,D,!0,L);if(0<da.length)return da}catch(ea){}this.loadImage(c,mxUtils.bind(this,function(ea){if("data:"==c.substring(0,5))this.resizeImage(ea,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(la,ka,V){N.setSelectionCell(N.insertVertex(null,null,"",N.snap(g),N.snap(l),ka,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+-this.convertDataUri(la)+";"))}),I,this.maxImageSize);else{var ca=Math.min(1,Math.min(this.maxImageSize/ea.width,this.maxImageSize/ea.height)),fa=Math.round(ea.width*ca);ea=Math.round(ea.height*ca);N.setSelectionCell(N.insertVertex(null,null,"",N.snap(g),N.snap(l),fa,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var ea=null;N.getModel().beginUpdate();try{ea=N.insertVertex(N.getDefaultParent(),-null,c,N.snap(g),N.snap(l),1,1,"text;"+(t?"html=1;":"")),N.updateCellSize(ea),N.fireEvent(new mxEventObject("textInserted","cells",[ea]))}finally{N.getModel().endUpdate()}N.setSelectionCell(ea)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,g,l,D,null,L);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(ea){this.editor.graph.setSelectionCells(this.importXml(ea,g,l,D,null,L))}),mxUtils.bind(this,function(ea){this.handleError(ea)}));-else{N=this.editor.graph;B=null;N.getModel().beginUpdate();try{B=N.insertVertex(N.getDefaultParent(),null,"",N.snap(g),N.snap(l),1,1,"text;whiteSpace=wrap;"+(t?"html=1;":""));N.fireEvent(new mxEventObject("textInserted","cells",[B]));t&&(c=N.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");B.value=c;N.updateCellSize(B);if(0<this.maxTextWidth&&B.geometry.width>this.maxTextWidth){var ja=N.getPreferredSizeForCell(B,this.maxTextWidth);B.geometry.width=ja.width;B.geometry.height=-ja.height}Graph.isLink(B.value)&&N.setLinkForCell(B,B.value);B.geometry.width+=N.gridSize;B.geometry.height+=N.gridSize}finally{N.getModel().endUpdate()}return[B]}}return[]};EditorUi.prototype.formatFileSize=function(c){var g=-1;do c/=1024,g++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var g=c.indexOf(";");0<g&&(c=c.substring(0,g)+c.substring(c.indexOf(",",g+1)))}return c};+function(I){this.removeMermaidErrors();I=Error(I.toString()+"\n\n"+c);"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();null!=B?B(I):D(I)}))}catch(I){D(I)}}),D)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),g=0;g<c.length;g++)null!=c[g].parentNode&&c[g].parentNode.removeChild(c[g])};EditorUi.prototype.generatePlantUmlImage=function(c,g,l,t){function B(K,M,V){c1=K>>2;c2=(K&3)<<4|M>>4;c3=(M&15)<<2|V>>6;+c4=V&63;r="";r+=D(c1&63);r+=D(c2&63);r+=D(c3&63);return r+=D(c4&63)}function D(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 I=new XMLHttpRequest;I.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(K){r="";for(i=0;i<K.length;i+=3)r=i+2==K.length?r+B(K.charCodeAt(i),K.charCodeAt(i+1),0):i+1==K.length?r+B(K.charCodeAt(i),0,0):+r+B(K.charCodeAt(i),K.charCodeAt(i+1),K.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=g&&(I.responseType="blob");I.onload=function(K){if(200<=this.status&&300>this.status)if("txt"==g)l(this.response);else{var M=new FileReader;M.readAsDataURL(this.response);M.onloadend=function(V){var Q=new Image;Q.onload=function(){try{var ja=Q.width,ea=Q.height;if(0==ja&&0==ea){var da=M.result,ia=da.indexOf(","),la=decodeURIComponent(escape(atob(da.substring(ia+1)))),ka=mxUtils.parseXml(la).getElementsByTagName("svg");+0<ka.length&&(ja=parseFloat(ka[0].getAttribute("width")),ea=parseFloat(ka[0].getAttribute("height")))}l(M.result,ja,ea)}catch(W){t(W)}};Q.src=M.result};M.onerror=function(V){t(V)}}else t(K)};I.onerror=function(K){t(K)};I.send()};EditorUi.prototype.insertAsPreText=function(c,g,l){var t=this.editor.graph,B=null;t.getModel().beginUpdate();try{B=t.insertVertex(null,null,"<pre>"+c+"</pre>",g,l,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(B,!0)}finally{t.getModel().endUpdate()}return B};+EditorUi.prototype.insertTextAt=function(c,g,l,t,B,D,I,K){D=null!=D?D:!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(ea){4==ea.readyState&&200<=ea.status&&299>=ea.status&&this.editor.graph.setSelectionCells(this.insertTextAt(ea.responseText,g,l,!0))}));else if("data:"==c.substring(0,+5)||!this.isOffline()&&(B||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var M=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var V=Editor.extractGraphModelFromPdf(c);if(null!=V&&0<V.length)return this.importXml(V,g,l,D,!0,K)}if(Editor.isPngDataUrl(c)&&(V=Editor.extractGraphModelFromPng(c),null!=V&&0<V.length))return this.importXml(V,g,l,D,!0,K);if("data:image/svg+xml;"==c.substring(0,19))try{V=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(V=c.substring(c.indexOf(",")++1),V=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V,!0)):V=decodeURIComponent(c.substring(c.indexOf(",")+1));var Q=this.importXml(V,g,l,D,!0,K);if(0<Q.length)return Q}catch(ea){}this.loadImage(c,mxUtils.bind(this,function(ea){if("data:"==c.substring(0,5))this.resizeImage(ea,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(la,ka,W){M.setSelectionCell(M.insertVertex(null,null,"",M.snap(g),M.snap(l),ka,W,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="++this.convertDataUri(la)+";"))}),I,this.maxImageSize);else{var da=Math.min(1,Math.min(this.maxImageSize/ea.width,this.maxImageSize/ea.height)),ia=Math.round(ea.width*da);ea=Math.round(ea.height*da);M.setSelectionCell(M.insertVertex(null,null,"",M.snap(g),M.snap(l),ia,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var ea=null;M.getModel().beginUpdate();try{ea=M.insertVertex(M.getDefaultParent(),+null,c,M.snap(g),M.snap(l),1,1,"text;"+(t?"html=1;":"")),M.updateCellSize(ea),M.fireEvent(new mxEventObject("textInserted","cells",[ea]))}finally{M.getModel().endUpdate()}M.setSelectionCell(ea)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,g,l,D,null,K);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(ea){this.editor.graph.setSelectionCells(this.importXml(ea,g,l,D,null,K))}),mxUtils.bind(this,function(ea){this.handleError(ea)}));+else{M=this.editor.graph;B=null;M.getModel().beginUpdate();try{B=M.insertVertex(M.getDefaultParent(),null,"",M.snap(g),M.snap(l),1,1,"text;whiteSpace=wrap;"+(t?"html=1;":""));M.fireEvent(new mxEventObject("textInserted","cells",[B]));t&&(c=M.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");B.value=c;M.updateCellSize(B);if(0<this.maxTextWidth&&B.geometry.width>this.maxTextWidth){var ja=M.getPreferredSizeForCell(B,this.maxTextWidth);B.geometry.width=ja.width;B.geometry.height=+ja.height}Graph.isLink(B.value)&&M.setLinkForCell(B,B.value);B.geometry.width+=M.gridSize;B.geometry.height+=M.gridSize}finally{M.getModel().endUpdate()}return[B]}}return[]};EditorUi.prototype.formatFileSize=function(c){var g=-1;do c/=1024,g++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var g=c.indexOf(";");0<g&&(c=c.substring(0,g)+c.substring(c.indexOf(",",g+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,g){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,g){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var l=document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=-l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!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,N){StorageFile.getFileContent(this,I,L,N)});window.deleteBrowserFile=mxUtils.bind(this,function(I,-L,N){StorageFile.deleteFile(this,I,L,N)});if(!g){var t=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(N){this.importXml(N,0,0,!0)}),null,L)):this.editor.graph.setSelectionCells(this.importXml(I,0,0,!0))}));+l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(I,K){StorageFile.listFiles(this,"F",I,K)});window.openBrowserFile=mxUtils.bind(this,function(I,K,M){StorageFile.getFileContent(this,I,K,M)});window.deleteBrowserFile=mxUtils.bind(this,function(I,+K,M){StorageFile.deleteFile(this,I,K,M)});if(!g){var t=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,K){null!=K&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(K)?(I=new Blob([I],{type:"application/octet-stream"}),this.importVisio(I,mxUtils.bind(this,function(M){this.importXml(M,0,0,!0)}),null,K)):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(!g){var B=this.dialog,D=B.close;this.dialog.close=mxUtils.bind(this,function(I){Editor.useLocalStorage=t;D.apply(B,arguments);I&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,g,l){var t=this,B=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?-JSZip.loadAsync(c).then(function(D){if(mxUtils.isEmptyObject(D.files))l();else{var I=0,L,N=!1;D.forEach(function(K,da){K=da.name.toLowerCase();"diagram/diagram.xml"==K?(N=!0,da.async("string").then(function(ja){0==ja.indexOf("<mxfile ")?g(ja):l()})):0==K.indexOf("versions/")&&(K=parseInt(K.substr(9)),K>I&&(I=K,L=da))});0<I?L.async("string").then(function(K){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(K,c.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),-null,l):t.parseFileData(K,mxUtils.bind(this,function(da){4==da.readyState&&(200<=da.status&&299>=da.status?g(da.responseText):l())}),c.name):l()}):N||l()}},function(D){l(D)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?B():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,l))};EditorUi.prototype.importFile=function(c,g,l,t,B,D,I,L,N,K,da,ja){K=null!=K?K:!0;var ea=!1,ca=null,fa=mxUtils.bind(this,function(la){var ka=-null;null!=la&&"<mxlibrary"==la.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,la,I)),this.showSidebar()):ka=this.importXml(la,l,t,K,null,null!=ja?mxEvent.isControlDown(ja):null);null!=L&&L(ka)});"image"==g.substring(0,5)?(N=!1,"image/png"==g.substring(0,9)&&(da=da?null:this.extractGraphModelFromPng(c),null!=da&&0<da.length&&(ca=this.importXml(da,l,t,K,null,null!=ja?mxEvent.isControlDown(ja):null),N=!0)),N||(N=this.editor.graph,da=c.indexOf(";"),0<da&&(c=c.substring(0,da)+c.substring(c.indexOf(",",-da+1))),K&&N.isGridEnabled()&&(l=N.snap(l),t=N.snap(t)),da="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==g.substring(0,9)&&(da+="editableCssRules=.*;"),ca=[N.insertVertex(null,null,"",l,t,B,D,da+"image="+c+";")])):/(\.*<graphml )/.test(c)?(ea=!0,this.importGraphML(c,fa)):null!=N&&null!=I&&EditorUi.isVisioFilename(I)?(ea=!0,this.importVisio(N,fa)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,I)?this.isOffline()?-this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(ea=!0,g=mxUtils.bind(this,function(la){4==la.readyState&&(200<=la.status&&299>=la.status?fa(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,g,I):this.parseFile(N,g,I)):0==c.indexOf("PK")&&null!=N?(ea=!0,this.importZipFile(N,fa,mxUtils.bind(this,function(){ca=this.insertTextAt(this.validateFileData(c),-l,t,!0,null,K);L(ca)}))):/(\.v(sd|dx))($|\?)/i.test(I)||/(\.vs(s|x))($|\?)/i.test(I)||(ca=this.insertTextAt(this.validateFileData(c),l,t,!0,null,K,null,null!=ja?mxEvent.isControlDown(ja):null));ea||null==L||L(ca);return ca};EditorUi.prototype.importFiles=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){t=null!=t?t:this.maxImageSize;K=null!=K?K:this.maxImageBytes;var ca=null!=g&&null!=l,fa=!0;g=null!=g?g:0;l=null!=l?l:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ka=da||this.resampleThreshold,V=0;V<-c.length;V++)if("image/svg"!==c[V].type.substring(0,9)&&"image/"===c[V].type.substring(0,6)&&c[V].size>ka){la=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[g],"y",[l],"maxSize",[t],"maxBytes",[K],"resampleThreshold",[this.resampleThreshold],"largeImages",[la],"crop",[ca],"resizeImages",[fa],"ignoreEmbeddedXml",[ja],"evt",[ea]);var k=mxUtils.bind(this,function(){var x=this.editor.graph,J=x.gridSize;B=null!=B?B:mxUtils.bind(this,function(ia,na,qa,ta,ua,Ba,za,Aa,Ga){try{if(null!=-ia&&"<mxlibrary"==ia.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ia,za)),this.showSidebar(),null;this.isCompatibleString(ia)&&1==c.length&&null!=ea&&"drop"==ea.type&&this.isBlankFile()&&!this.canUndo()&&(ca=!1,ta=qa=0);return this.importFile(ia,na,qa,ta,ua,Ba,za,Aa,Ga,ca,ja,ea)}catch(Ra){return this.handleError(Ra),null}});D=null!=D?D:mxUtils.bind(this,function(ia){x.setSelectionCells(ia)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var R=-this.currentPage,Y=c.length,Z=Y,W=[],U=mxUtils.bind(this,function(ia,na){W[ia]=na;if(0==--Z){this.spinner.stop();if(null!=L)L(W);else{var qa=[];x.getModel().beginUpdate();try{for(ia=0;ia<W.length;ia++){var ta=W[ia]();null!=ta&&(qa=qa.concat(ta))}}finally{x.getModel().endUpdate()}}R!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);D(qa)}}),aa=0;aa<Y;aa++)mxUtils.bind(this,function(ia){var na=c[ia];if(null!=na){var qa=new FileReader;qa.onload=-mxUtils.bind(this,function(ta){if(null==I||I(na))try{if("image/"==na.type.substring(0,6))if("image/svg"==na.type.substring(0,9)){var ua=Graph.clipSvgDataUri(ta.target.result),Ba=ua.indexOf(","),za=decodeURIComponent(escape(atob(ua.substring(Ba+1)))),Aa=mxUtils.parseXml(za),Ga=Aa.getElementsByTagName("svg");if(0<Ga.length){var Ra=Ga[0],Ha=ja?null:Ra.getAttribute("content");null!=Ha&&"<"!=Ha.charAt(0)&&"%"!=Ha.charAt(0)&&(Ha=unescape(window.atob?atob(Ha):Base64.decode(Ha,!0)));null!=Ha&&"%"==Ha.charAt(0)&&-(Ha=decodeURIComponent(Ha));null==Ha||"<mxfile "!==Ha.substring(0,8)&&"<mxGraphModel>"!==Ha.substring(0,14)&&"<mxGraphModel "!==Ha.substring(0,14)?U(ia,mxUtils.bind(this,function(){try{if(null!=Aa){var Ma=Aa.getElementsByTagName("svg");if(0<Ma.length){var ya=Ma[0],Sa=ya.getAttribute("width"),Oa=ya.getAttribute("height");Sa=null!=Sa&&"%"!=Sa.charAt(Sa.length-1)?parseFloat(Sa):NaN;Oa=null!=Oa&&"%"!=Oa.charAt(Oa.length-1)?parseFloat(Oa):NaN;var Na=ya.getAttribute("viewBox");if(null==Na||0==Na.length)ya.setAttribute("viewBox",-"0 0 "+Sa+" "+Oa);else if(isNaN(Sa)||isNaN(Oa)){var Pa=Na.split(" ");3<Pa.length&&(Sa=parseFloat(Pa[2]),Oa=parseFloat(Pa[3]))}ua=Editor.createSvgDataUri(mxUtils.getXml(ya));var oa=Math.min(1,Math.min(t/Math.max(1,Sa)),t/Math.max(1,Oa)),Da=B(ua,na.type,g+ia*J,l+ia*J,Math.max(1,Math.round(Sa*oa)),Math.max(1,Math.round(Oa*oa)),na.name);if(null!=Da&&(isNaN(Sa)||isNaN(Oa))){var Ca=new Image;Ca.onload=mxUtils.bind(this,function(){Sa=Math.max(1,Ca.width);Oa=Math.max(1,Ca.height);Da[0].geometry.width=Sa;-Da[0].geometry.height=Oa;ya.setAttribute("viewBox","0 0 "+Sa+" "+Oa);ua=Editor.createSvgDataUri(mxUtils.getXml(ya));var Ja=ua.indexOf(";");0<Ja&&(ua=ua.substring(0,Ja)+ua.substring(ua.indexOf(",",Ja+1)));x.setCellStyles("image",ua,[Da[0]])});Ca.src=Editor.createSvgDataUri(mxUtils.getXml(ya))}return Da}}}catch(Ja){}return null})):U(ia,mxUtils.bind(this,function(){return B(Ha,"text/xml",g+ia*J,l+ia*J,0,0,na.name)}))}else U(ia,mxUtils.bind(this,function(){return null}))}else{Ba=!1;if("image/png"==na.type){var Qa=-ja?null:this.extractGraphModelFromPng(ta.target.result);if(null!=Qa&&0<Qa.length){var eb=new Image;eb.src=ta.target.result;U(ia,mxUtils.bind(this,function(){return B(Qa,"text/xml",g+ia*J,l+ia*J,eb.width,eb.height,na.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(ta.target.result,mxUtils.bind(this,function(Ma){this.resizeImage(Ma,Editor.stripImageMetadata(ta.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(ya,Sa,Oa){U(ia,mxUtils.bind(this,function(){if(null!=ya&&ya.length<K){var Na=fa&&this.isResampleImageSize(na.size,da)?Math.min(1,Math.min(t/Sa,t/Oa)):1;return B(ya,na.type,g+ia*J,l+ia*J,Math.round(Sa*Na),Math.round(Oa*Na),na.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),fa,t,da,na.size)}),-mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ua=ta.target.result,B(ua,na.type,g+ia*J,l+ia*J,240,160,na.name,function(Ma){U(ia,function(){return Ma})},na)}catch(Ma){U(ia,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ma,na)}else U(ia,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(na.name)?B(null,na.type,g+ia*J,l+ia*J,240,160,na.name,function(ta){U(ia,function(){return ta})},na):"image"==-na.type.substring(0,5)||"application/pdf"==na.type?qa.readAsDataURL(na):qa.readAsText(na)}})(aa)});if(la){la=[];for(V=0;V<c.length;V++)la.push(c[V]);c=la;this.confirmImageResize(function(x){fa=x;k()},N)}else k()};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,g){g=null!=g?g:!1;var l=null!=this.spinner&&null!=this.spinner.pause?+JSZip.loadAsync(c).then(function(D){if(mxUtils.isEmptyObject(D.files))l();else{var I=0,K,M=!1;D.forEach(function(V,Q){V=Q.name.toLowerCase();"diagram/diagram.xml"==V?(M=!0,Q.async("string").then(function(ja){0==ja.indexOf("<mxfile ")?g(ja):l()})):0==V.indexOf("versions/")&&(V=parseInt(V.substr(9)),V>I&&(I=V,K=Q))});0<I?K.async("string").then(function(V){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(V,c.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,+l):t.parseFileData(V,mxUtils.bind(this,function(Q){4==Q.readyState&&(200<=Q.status&&299>=Q.status?g(Q.responseText):l())}),c.name):l()}):M||l()}},function(D){l(D)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?B():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,l))};EditorUi.prototype.importFile=function(c,g,l,t,B,D,I,K,M,V,Q,ja){V=null!=V?V:!0;var ea=!1,da=null,ia=mxUtils.bind(this,function(la){var ka=null;null!=+la&&"<mxlibrary"==la.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,la,I)),this.showSidebar()):ka=this.importXml(la,l,t,V,null,null!=ja?mxEvent.isControlDown(ja):null);null!=K&&K(ka)});"image"==g.substring(0,5)?(M=!1,"image/png"==g.substring(0,9)&&(Q=Q?null:this.extractGraphModelFromPng(c),null!=Q&&0<Q.length&&(da=this.importXml(Q,l,t,V,null,null!=ja?mxEvent.isControlDown(ja):null),M=!0)),M||(M=this.editor.graph,Q=c.indexOf(";"),0<Q&&(c=c.substring(0,Q)+c.substring(c.indexOf(",",Q+1))),V&&+M.isGridEnabled()&&(l=M.snap(l),t=M.snap(t)),Q="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==g.substring(0,9)&&(Q+="editableCssRules=.*;"),da=[M.insertVertex(null,null,"",l,t,B,D,Q+"image="+c+";")])):/(\.*<graphml )/.test(c)?(ea=!0,this.importGraphML(c,ia)):null!=M&&null!=I&&EditorUi.isVisioFilename(I)?(ea=!0,this.importVisio(M,ia)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,I)?this.isOffline()?this.showError(mxResources.get("error"),+mxResources.get("notInOffline")):(ea=!0,g=mxUtils.bind(this,function(la){4==la.readyState&&(200<=la.status&&299>=la.status?ia(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,g,I):this.parseFile(M,g,I)):0==c.indexOf("PK")&&null!=M?(ea=!0,this.importZipFile(M,ia,mxUtils.bind(this,function(){da=this.insertTextAt(this.validateFileData(c),l,t,!0,null,V);K(da)}))):+/(\.v(sd|dx))($|\?)/i.test(I)||/(\.vs(s|x))($|\?)/i.test(I)||(da=this.insertTextAt(this.validateFileData(c),l,t,!0,null,V,null,null!=ja?mxEvent.isControlDown(ja):null));ea||null==K||K(da);return da};EditorUi.prototype.importFiles=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){t=null!=t?t:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var da=null!=g&&null!=l,ia=!0;g=null!=g?g:0;l=null!=l?l:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ka=Q||this.resampleThreshold,W=0;W<c.length;W++)if("image/svg"!==+c[W].type.substring(0,9)&&"image/"===c[W].type.substring(0,6)&&c[W].size>ka){la=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[g],"y",[l],"maxSize",[t],"maxBytes",[V],"resampleThreshold",[this.resampleThreshold],"largeImages",[la],"crop",[da],"resizeImages",[ia],"ignoreEmbeddedXml",[ja],"evt",[ea]);var k=mxUtils.bind(this,function(){var y=this.editor.graph,J=y.gridSize;B=null!=B?B:mxUtils.bind(this,function(fa,na,pa,ta,ua,Ca,Ba,Aa,Fa){try{if(null!=fa&&"<mxlibrary"==fa.substring(0,+10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,fa,Ba)),this.showSidebar(),null;this.isCompatibleString(fa)&&1==c.length&&null!=ea&&"drop"==ea.type&&this.isBlankFile()&&!this.canUndo()&&(da=!1,ta=pa=0);return this.importFile(fa,na,pa,ta,ua,Ca,Ba,Aa,Fa,da,ja,ea)}catch(Sa){return this.handleError(Sa),null}});D=null!=D?D:mxUtils.bind(this,function(fa){y.setSelectionCells(fa)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var R=this.currentPage,X=c.length,aa=+X,Z=[],U=mxUtils.bind(this,function(fa,na){Z[fa]=na;if(0==--aa){this.spinner.stop();if(null!=K)K(Z);else{var pa=[];y.getModel().beginUpdate();try{for(fa=0;fa<Z.length;fa++){var ta=Z[fa]();null!=ta&&(pa=pa.concat(ta))}}finally{y.getModel().endUpdate()}}R!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);D(pa)}}),ba=0;ba<X;ba++)mxUtils.bind(this,function(fa){var na=c[fa];if(null!=na){var pa=new FileReader;pa.onload=mxUtils.bind(this,function(ta){if(null==+I||I(na))try{if("image/"==na.type.substring(0,6))if("image/svg"==na.type.substring(0,9)){var ua=Graph.clipSvgDataUri(ta.target.result),Ca=ua.indexOf(","),Ba=decodeURIComponent(escape(atob(ua.substring(Ca+1)))),Aa=mxUtils.parseXml(Ba),Fa=Aa.getElementsByTagName("svg");if(0<Fa.length){var Sa=Fa[0],La=ja?null:Sa.getAttribute("content");null!=La&&"<"!=La.charAt(0)&&"%"!=La.charAt(0)&&(La=unescape(window.atob?atob(La):Base64.decode(La,!0)));null!=La&&"%"==La.charAt(0)&&(La=decodeURIComponent(La));null==+La||"<mxfile "!==La.substring(0,8)&&"<mxGraphModel>"!==La.substring(0,14)&&"<mxGraphModel "!==La.substring(0,14)?U(fa,mxUtils.bind(this,function(){try{if(null!=Aa){var Ia=Aa.getElementsByTagName("svg");if(0<Ia.length){var za=Ia[0],Ua=za.getAttribute("width"),Qa=za.getAttribute("height");Ua=null!=Ua&&"%"!=Ua.charAt(Ua.length-1)?parseFloat(Ua):NaN;Qa=null!=Qa&&"%"!=Qa.charAt(Qa.length-1)?parseFloat(Qa):NaN;var Ma=za.getAttribute("viewBox");if(null==Ma||0==Ma.length)za.setAttribute("viewBox","0 0 "++Ua+" "+Qa);else if(isNaN(Ua)||isNaN(Qa)){var Na=Ma.split(" ");3<Na.length&&(Ua=parseFloat(Na[2]),Qa=parseFloat(Na[3]))}ua=Editor.createSvgDataUri(mxUtils.getXml(za));var xa=Math.min(1,Math.min(t/Math.max(1,Ua)),t/Math.max(1,Qa)),Za=B(ua,na.type,g+fa*J,l+fa*J,Math.max(1,Math.round(Ua*xa)),Math.max(1,Math.round(Qa*xa)),na.name);if(null!=Za&&(isNaN(Ua)||isNaN(Qa))){var Oa=new Image;Oa.onload=mxUtils.bind(this,function(){Ua=Math.max(1,Oa.width);Qa=Math.max(1,Oa.height);Za[0].geometry.width=Ua;Za[0].geometry.height=+Qa;za.setAttribute("viewBox","0 0 "+Ua+" "+Qa);ua=Editor.createSvgDataUri(mxUtils.getXml(za));var ra=ua.indexOf(";");0<ra&&(ua=ua.substring(0,ra)+ua.substring(ua.indexOf(",",ra+1)));y.setCellStyles("image",ua,[Za[0]])});Oa.src=Editor.createSvgDataUri(mxUtils.getXml(za))}return Za}}}catch(ra){}return null})):U(fa,mxUtils.bind(this,function(){return B(La,"text/xml",g+fa*J,l+fa*J,0,0,na.name)}))}else U(fa,mxUtils.bind(this,function(){return null}))}else{Ca=!1;if("image/png"==na.type){var Pa=ja?null:+this.extractGraphModelFromPng(ta.target.result);if(null!=Pa&&0<Pa.length){var db=new Image;db.src=ta.target.result;U(fa,mxUtils.bind(this,function(){return B(Pa,"text/xml",g+fa*J,l+fa*J,db.width,db.height,na.name)}));Ca=!0}}Ca||(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(ta.target.result,mxUtils.bind(this,function(Ia){this.resizeImage(Ia,Editor.stripImageMetadata(ta.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(za,Ua,Qa){U(fa,mxUtils.bind(this,function(){if(null!=za&&za.length<V){var Ma=ia&&this.isResampleImageSize(na.size,Q)?Math.min(1,Math.min(t/Ua,t/Qa)):1;return B(za,na.type,g+fa*J,l+fa*J,Math.round(Ua*Ma),Math.round(Qa*Ma),na.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ia,t,Q,na.size)}),+mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ua=ta.target.result,B(ua,na.type,g+fa*J,l+fa*J,240,160,na.name,function(Ia){U(fa,function(){return Ia})},na)}catch(Ia){U(fa,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ia,na)}else U(fa,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(na.name)?B(null,na.type,g+fa*J,l+fa*J,240,160,na.name,function(ta){U(fa,function(){return ta})},na):"image"==+na.type.substring(0,5)||"application/pdf"==na.type?pa.readAsDataURL(na):pa.readAsText(na)}})(ba)});if(la){la=[];for(W=0;W<c.length;W++)la.push(c[W]);c=la;this.confirmImageResize(function(y){ia=y;k()},M)}else k()};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,g){g=null!=g?g:!1;var l=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},t=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,B=function(D,I){if(D||g)mxSettings.setResizeImages(D?I:null),mxSettings.save();l();c(I)};null==t||g?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(D){B(D,!0)},function(D){B(D,!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):B(!1,t)};EditorUi.prototype.parseFile=function(c,g,l){l=null!=l?l:c.name;var t=new FileReader;t.onload=mxUtils.bind(this,function(){this.parseFileData(t.result,g,l)});t.readAsText(c)};EditorUi.prototype.parseFileData=function(c,g,l){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(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(B){}};EditorUi.prototype.isResampleImageSize=function(c,g){g=null!=g?g:this.resampleThreshold;return c>g};EditorUi.prototype.resizeImage=function(c,g,l,t,B,D,I){B=null!=B?B:this.maxImageSize;var L=Math.max(1,c.width),N=Math.max(1,c.height),K=g;if(t&&this.isResampleImageSize(null!=I?I:g.length,D))try{var da=Math.max(L/B,N/B);if(1<da){var ja=Math.round(L/da),ea=-Math.round(N/da),ca=document.createElement("canvas");ca.width=ja;ca.height=ea;ca.getContext("2d").drawImage(c,0,0,ja,ea);var fa=ca.toDataURL();if(fa.length<g.length){var la=document.createElement("canvas");la.width=ja;la.height=ea;var ka=la.toDataURL();fa!==ka&&(g=fa,L=ja,N=ea)}}}catch(V){}t&&K!=g&&B>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(c,g,l,t,B/1.5,D,I):l(g,L,N)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=+encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(B){}};EditorUi.prototype.isResampleImageSize=function(c,g){g=null!=g?g:this.resampleThreshold;return c>g};EditorUi.prototype.resizeImage=function(c,g,l,t,B,D,I){B=null!=B?B:this.maxImageSize;var K=Math.max(1,c.width),M=Math.max(1,c.height),V=g;if(t&&this.isResampleImageSize(null!=I?I:g.length,D))try{var Q=Math.max(K/B,M/B);if(1<Q){var ja=Math.round(K/Q),ea=Math.round(M/+Q),da=document.createElement("canvas");da.width=ja;da.height=ea;da.getContext("2d").drawImage(c,0,0,ja,ea);var ia=da.toDataURL();if(ia.length<g.length){var la=document.createElement("canvas");la.width=ja;la.height=ea;var ka=la.toDataURL();ia!==ka&&(g=ia,K=ja,M=ea)}}}catch(W){}t&&V!=g&&B>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(c,g,l,t,B/1.5,D,I):l(g,K,M)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,g,l){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!=l&&(t.onerror=l);t.src=c}catch(B){if(null!=l)l(B);else throw B;}};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());this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);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,g=this.editor.graph,l=g.isEnabled;g.isEnabled=function(){return l.apply(this,arguments)&&!c.isLocked()};g.showLinkIcons=Editor.showLinkIcons;g.showTooltipIcons=Editor.showTooltipIcons;var t=this;g.editTooltip=function(U){null!=U&&t.actions.get("editTooltip").funct()};g.getLinkOverlayTooltip=function(U){if(Graph.isPageLink(U)&&null!=t.pages){var aa=U.substring(U.indexOf(",")+1);aa=t.getPageById(aa);if(null!=aa)return aa.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(t.pages,-aa)+1])}return U};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(U){var aa=U.getEvent();return null==U.getState()&&!mxEvent.isMouseEvent(aa)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(aa)&&(null==U.getState()||mxEvent.isControlDown(aa)||mxEvent.isShiftDown(aa))});g.cellEditor.editPlantUmlData=function(U,aa,ia){var na=JSON.parse(ia);aa=new SimpleTextareaDialog(c,na.data,function(qa){null!=qa&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(qa,-na.format,function(ta,ua,Ba){c.spinner.stop();g.getModel().beginUpdate();try{if("txt"==na.format)g.labelChanged(U,"<pre>"+ta+"</pre>"),g.updateCellSize(U,!0);else{g.setCellStyles("image",c.convertDataUri(ta),[U]);var za=g.model.getGeometry(U);null!=za&&(za=za.clone(),za.width=ua,za.height=Ba,g.cellsResized([U],[za],!1))}g.setAttributeForCell(U,"plantUmlData",JSON.stringify({data:qa,format:na.format}))}finally{g.getModel().endUpdate()}},function(ta){c.handleError(ta)})});c.showDialog(aa.container,-640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));aa.init()};g.cellEditor.editMermaidData=function(U,aa,ia){var na=JSON.parse(ia);aa=new SimpleTextareaDialog(c,na.data,function(qa){null!=qa&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(qa,na.config,function(ta,ua,Ba){c.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",ta,[U]);var za=g.model.getGeometry(U);null!=za&&(za=za.clone(),za.width=Math.max(za.width,ua),za.height=Math.max(za.height,-Ba),g.cellsResized([U],[za],!1));g.setAttributeForCell(U,"mermaidData",JSON.stringify({data:qa,config:na.config},null,2))}finally{g.getModel().endUpdate()}},function(ta){c.handleError(ta)})});c.showDialog(aa.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));aa.init()};var B=g.cellEditor.startEditing;g.cellEditor.startEditing=function(U,aa){try{var ia=this.graph.getAttributeForCell(U,"plantUmlData");if(null!=ia)this.editPlantUmlData(U,aa,ia);else if(ia=this.graph.getAttributeForCell(U,-"mermaidData"),null!=ia&&window.isMermaidEnabled)this.editMermaidData(U,aa,ia);else{var na=g.getCellStyle(U);"1"==mxUtils.getValue(na,"metaEdit","0")?c.showDataDialog(U):B.apply(this,arguments)}}catch(qa){c.handleError(qa)}};g.getLinkTitle=function(U){return c.getLinkTitle(U)};g.customLinkClicked=function(U,aa){var ia=!1;try{var na=this.getGraphBounds();c.handleCustomLink(U,aa);ia=!0;c.chromelessResize&&!na.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(aa))}catch(qa){c.handleError(qa)}return ia};-var D=g.parseBackgroundImage;g.parseBackgroundImage=function(U){var aa=D.apply(this,arguments);null!=aa&&null!=aa.src&&Graph.isPageLink(aa.src)&&(aa={originalSrc:aa.src});return aa};var I=g.setBackgroundImage;g.setBackgroundImage=function(U){null!=U&&null!=U.originalSrc&&(U=c.createImageForPageLink(U.originalSrc,c.currentPage,this));I.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(U,aa){U=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=U){var ia=U.indexOf(",");if(0<ia)for(U=U.substring(ia+1),aa=aa.getProperty("patches"),ia=0;ia<aa.length;ia++)if(null!=aa[ia][EditorUi.DIFF_UPDATE]&&null!=aa[ia][EditorUi.DIFF_UPDATE][U]||null!=aa[ia][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(aa[ia][EditorUi.DIFF_REMOVE],U)){g.refreshBackgroundImage();break}}}));var L=-g.getBackgroundImageObject;g.getBackgroundImageObject=function(U,aa,ia){var na=L.apply(this,arguments);null!=na&&null!=na.originalSrc&&(na=aa?c.createImageForPageLink(na.originalSrc,ia,null,!0):{src:na.originalSrc});return na};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 N=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(U){U=null!=U?U:"";"1"==urlParams.dev&&(U+=(0<U.length?"&":"?")+"dev=1");"1"==urlParams.test&&(U+=(0<U.length?"&":"?")+"test=1");return N.apply(this,arguments)};var K=g.addClickHandler;g.addClickHandler=function(U,aa,ia){var na=aa;aa=function(qa,ta,ua){if(null==ta){var Ba=mxEvent.getSource(qa);"a"==Ba.nodeName.toLowerCase()&&(ta=Ba.getAttribute("href"))}null!=ta&&g.isCustomLink(ta)&&(mxEvent.isTouchEvent(qa)||-!mxEvent.isPopupTrigger(qa))&&g.customLinkClicked(ta,ua)&&mxEvent.consume(qa);null!=na&&na(qa,ta,ua)};K.call(this,U,aa,ia)};p.apply(this,arguments);this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var da=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(U,aa,ia){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(U,["zoomIn","zoomOut","-"],null,ia);if(Editor.passiveScroll&&null!=ia){var na=mxUtils.convertPoint(g.container,-mxEvent.getClientX(ia),mxEvent.getClientY(ia));g._contextMenuPoint=new mxPoint(g.snap(na.x/g.view.scale-g.view.translate.x),g.snap(na.y/g.view.scale-g.view.translate.y));g._contextMenuScreenPoint=mxUtils.convertPoint(g.container,mxEvent.getClientX(ia),mxEvent.getClientY(ia))}g.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",U,null),U.addSeparator());da.apply(this,arguments);g.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(U,["-","addToScratchpad"],-null,ia);g.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(U,["-","exitGroup","home"],null,ia)};var ja=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(U,aa,ia){if(c.editor.graph.isSelectionEmpty())ja.apply(this,arguments),c.menus.addMenuItems(U,["copyAsImage","copyAsSvg"],null,ia);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(U,aa,ia):this.addPopupMenuArrangeItems(U,aa,ia),this.addMenuItems(U,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),-null,ia),Editor.passiveScroll&&(1==g.getSelectionCount()?this.addMenuItems(U,["-","copyStyle","pasteStyle"],null,ia):this.addMenuItems(U,["-","pasteStyle"],null,ia)),this.addMenuItems(U,["-"],null,ia),this.isShowCellEditItems()||this.addPopupDeleteItem(U,aa,ia),this.addMenuItems(U,["lockUnlock","-"],null,ia),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(aa)&&g.isCellEditable(aa)&&(this.addSubmenu("editCell",U,null,mxResources.get("edit")),U.addSeparator(),g.getModel().isEdge(aa))){this.addSubmenu("line",-U);var na=g.getModel().getGeometry(aa);null!=na&&null!=na.points&&0<na.points.length&&this.addMenuItems(U,["clearWaypoints"],null,ia)}1==g.getSelectionCount()&&this.addMenuItems(U,["enterGroup"],null,ia);na=c.getSelectionState();null!=na.mergeCell?this.addMenuItem(U,"mergeCells"):(1<na.style.colspan||1<na.style.rowspan)&&this.addMenuItem(U,"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}if(Editor.passiveScroll){var ea=g.getCenterInsertPoint;g.getCenterInsertPoint=function(U){if(null!=this._contextMenuPoint){var aa=this._contextMenuPoint;U=null!=U?U:new mxRectangle;return new mxPoint(g.snap(aa.x-(U.width||0)/2),g.snap(aa.y-(U.height||0)/2))}return ea.apply(this,arguments)};var ca=g.popupMenuHandler.hideMenu;g.popupMenuHandler.hideMenu=-function(){ca.apply(this,arguments);window.setTimeout(function(){g._contextMenuPoint=null;g._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var fa=g.getExportVariables;g.getExportVariables=function(){var U=fa.apply(this,arguments),aa=c.getCurrentFile();null!=aa&&(U.filename=aa.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var ia in c.fileVars)null==-U[ia]&&(U[ia]=c.fileVars[ia]);U.pagecount=null!=c.pages?c.pages.length:1;U.page=null!=c.currentPage?c.currentPage.getName():"";U.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return U};var la=g.getGlobalVariable;g.getGlobalVariable=function(U){var aa=c.getCurrentFile();if("filename"==U&&null!=aa)return aa.getTitle();if("page"==U&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==U)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,-c.currentPage)+1:1;if("pagecount"==U)return null!=c.pages?c.pages.length:1;aa=la.apply(this,arguments);null==aa&&(c.updateFileVars(),null!=c.fileVars&&(aa=c.fileVars[U]));return aa};var ka=null,V=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var U=this.getCurrentFile(),aa=null!=U&&null!=U.getTitle()?U.getTitle():this.defaultFilename;ka!=aa&&U==V&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());ka=aa;V=U}));var k=g.labelLinkClicked;g.labelLinkClicked=-function(U,aa,ia){var na=aa.getAttribute("href");if(null==na||!g.isCustomLink(na)||!mxEvent.isTouchEvent(ia)&&mxEvent.isPopupTrigger(ia))k.apply(this,arguments);else{if(!g.isEnabled()||null!=U&&g.isCellLocked(U.cell))g.customLinkClicked(na),g.getRubberband().reset();mxEvent.consume(ia)}};this.editor.getOrCreateFilename=function(){var U=c.defaultFilename,aa=c.getCurrentFile();null!=aa&&(U=null!=aa.getTitle()?aa.getTitle():U);return U};var x=this.actions.get("print");x.setEnabled(!mxClient.IS_IOS||-!navigator.standalone);x.visible=x.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,+!this.isOfflineApp();var c=this,g=this.editor.graph,l=g.isEnabled;g.isEnabled=function(){return l.apply(this,arguments)&&!c.isLocked()};g.showLinkIcons=Editor.showLinkIcons;g.showTooltipIcons=Editor.showTooltipIcons;var t=this;g.editTooltip=function(U){null!=U&&t.actions.get("editTooltip").funct()};g.getLinkOverlayTooltip=function(U){if(Graph.isPageLink(U)&&null!=t.pages){var ba=U.substring(U.indexOf(",")+1);ba=t.getPageById(ba);if(null!=ba)return ba.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(t.pages,+ba)+1])}return U};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(U){var ba=U.getEvent();return null==U.getState()&&!mxEvent.isMouseEvent(ba)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(ba)&&(null==U.getState()||mxEvent.isControlDown(ba)||mxEvent.isShiftDown(ba))});g.cellEditor.editPlantUmlData=function(U,ba,fa){var na=JSON.parse(fa);ba=new SimpleTextareaDialog(c,na.data,function(pa){null!=pa&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(pa,+na.format,function(ta,ua,Ca){c.spinner.stop();g.getModel().beginUpdate();try{if("txt"==na.format)g.labelChanged(U,"<pre>"+ta+"</pre>"),g.updateCellSize(U,!0);else{g.setCellStyles("image",c.convertDataUri(ta),[U]);var Ba=g.model.getGeometry(U);null!=Ba&&(Ba=Ba.clone(),Ba.width=ua,Ba.height=Ca,g.cellsResized([U],[Ba],!1))}g.setAttributeForCell(U,"plantUmlData",JSON.stringify({data:pa,format:na.format}))}finally{g.getModel().endUpdate()}},function(ta){c.handleError(ta)})});c.showDialog(ba.container,+640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));ba.init()};g.cellEditor.editMermaidData=function(U,ba,fa){var na=JSON.parse(fa);ba=new SimpleTextareaDialog(c,na.data,function(pa){null!=pa&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(pa,na.config,function(ta,ua,Ca){c.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",ta,[U]);var Ba=g.model.getGeometry(U);null!=Ba&&(Ba=Ba.clone(),Ba.width=Math.max(Ba.width,ua),Ba.height=Math.max(Ba.height,+Ca),g.cellsResized([U],[Ba],!1));g.setAttributeForCell(U,"mermaidData",JSON.stringify({data:pa,config:na.config},null,2))}finally{g.getModel().endUpdate()}},function(ta){c.handleError(ta)})});c.showDialog(ba.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));ba.init()};var B=g.cellEditor.startEditing;g.cellEditor.startEditing=function(U,ba){try{var fa=this.graph.getAttributeForCell(U,"plantUmlData");if(null!=fa)this.editPlantUmlData(U,ba,fa);else if(fa=this.graph.getAttributeForCell(U,+"mermaidData"),null!=fa&&window.isMermaidEnabled)this.editMermaidData(U,ba,fa);else{var na=g.getCellStyle(U);"1"==mxUtils.getValue(na,"metaEdit","0")?c.showDataDialog(U):B.apply(this,arguments)}}catch(pa){c.handleError(pa)}};g.getLinkTitle=function(U){return c.getLinkTitle(U)};g.customLinkClicked=function(U,ba){var fa=!1;try{var na=this.getGraphBounds();c.handleCustomLink(U,ba);fa=!0;c.chromelessResize&&!na.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(ba))}catch(pa){c.handleError(pa)}return fa};+var D=g.parseBackgroundImage;g.parseBackgroundImage=function(U){var ba=D.apply(this,arguments);null!=ba&&null!=ba.src&&Graph.isPageLink(ba.src)&&(ba={originalSrc:ba.src});return ba};var I=g.setBackgroundImage;g.setBackgroundImage=function(U){null!=U&&null!=U.originalSrc&&(U=c.createImageForPageLink(U.originalSrc,c.currentPage,this));I.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(U,ba){U=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=U){var fa=U.indexOf(",");if(0<fa)for(U=U.substring(fa+1),ba=ba.getProperty("patches"),fa=0;fa<ba.length;fa++)if(null!=ba[fa][EditorUi.DIFF_UPDATE]&&null!=ba[fa][EditorUi.DIFF_UPDATE][U]||null!=ba[fa][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(ba[fa][EditorUi.DIFF_REMOVE],U)){g.refreshBackgroundImage();break}}}));var K=+g.getBackgroundImageObject;g.getBackgroundImageObject=function(U,ba,fa){var na=K.apply(this,arguments);null!=na&&null!=na.originalSrc&&(na=ba?c.createImageForPageLink(na.originalSrc,fa,null,!0):{src:na.originalSrc});return na};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 M=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(U){U=null!=U?U:"";"1"==urlParams.dev&&(U+=(0<U.length?"&":"?")+"dev=1");"1"==urlParams.test&&(U+=(0<U.length?"&":"?")+"test=1");return M.apply(this,arguments)};var V=g.addClickHandler;g.addClickHandler=function(U,ba,fa){var na=ba;ba=function(pa,ta,ua){if(null==ta){var Ca=mxEvent.getSource(pa);"a"==Ca.nodeName.toLowerCase()&&(ta=Ca.getAttribute("href"))}null!=ta&&g.isCustomLink(ta)&&(mxEvent.isTouchEvent(pa)||+!mxEvent.isPopupTrigger(pa))&&g.customLinkClicked(ta,ua)&&mxEvent.consume(pa);null!=na&&na(pa,ta,ua)};V.call(this,U,ba,fa)};p.apply(this,arguments);this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var Q=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(U,ba,fa){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(U,["zoomIn","zoomOut","-"],null,fa);if(Editor.passiveScroll&&null!=fa){var na=mxUtils.convertPoint(g.container,+mxEvent.getClientX(fa),mxEvent.getClientY(fa));g._contextMenuPoint=new mxPoint(g.snap(na.x/g.view.scale-g.view.translate.x),g.snap(na.y/g.view.scale-g.view.translate.y));g._contextMenuScreenPoint=mxUtils.convertPoint(g.container,mxEvent.getClientX(fa),mxEvent.getClientY(fa))}g.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",U,null),U.addSeparator());Q.apply(this,arguments);g.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(U,["-","addToScratchpad"],+null,fa);g.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(U,["-","exitGroup","home"],null,fa)};var ja=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(U,ba,fa){if(c.editor.graph.isSelectionEmpty())ja.apply(this,arguments),c.menus.addMenuItems(U,["copyAsImage","copyAsSvg"],null,fa);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(U,ba,fa):this.addPopupMenuArrangeItems(U,ba,fa),this.addMenuItems(U,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),+null,fa),Editor.passiveScroll&&(1==g.getSelectionCount()?this.addMenuItems(U,["-","copyStyle","pasteStyle"],null,fa):this.addMenuItems(U,["-","pasteStyle"],null,fa)),this.addMenuItems(U,["-"],null,fa),this.isShowCellEditItems()||this.addPopupDeleteItem(U,ba,fa),this.addMenuItems(U,["lockUnlock","-"],null,fa),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(ba)&&g.isCellEditable(ba)&&(this.addSubmenu("editCell",U,null,mxResources.get("edit")),U.addSeparator(),g.getModel().isEdge(ba))){this.addSubmenu("line",+U);var na=g.getModel().getGeometry(ba);null!=na&&null!=na.points&&0<na.points.length&&this.addMenuItems(U,["clearWaypoints"],null,fa)}1==g.getSelectionCount()&&this.addMenuItems(U,["enterGroup"],null,fa);na=c.getSelectionState();null!=na.mergeCell?this.addMenuItem(U,"mergeCells"):(1<na.style.colspan||1<na.style.rowspan)&&this.addMenuItem(U,"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}if(Editor.passiveScroll){var ea=g.getCenterInsertPoint;g.getCenterInsertPoint=function(U){if(null!=this._contextMenuPoint){var ba=this._contextMenuPoint;U=null!=U?U:new mxRectangle;return new mxPoint(g.snap(ba.x-(U.width||0)/2),g.snap(ba.y-(U.height||0)/2))}return ea.apply(this,arguments)};var da=g.popupMenuHandler.hideMenu;g.popupMenuHandler.hideMenu=+function(){da.apply(this,arguments);window.setTimeout(function(){g._contextMenuPoint=null;g._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var ia=g.getExportVariables;g.getExportVariables=function(){var U=ia.apply(this,arguments),ba=c.getCurrentFile();null!=ba&&(U.filename=ba.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var fa in c.fileVars)null==+U[fa]&&(U[fa]=c.fileVars[fa]);U.pagecount=null!=c.pages?c.pages.length:1;U.page=null!=c.currentPage?c.currentPage.getName():"";U.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return U};var la=g.getGlobalVariable;g.getGlobalVariable=function(U){var ba=c.getCurrentFile();if("filename"==U&&null!=ba)return ba.getTitle();if("page"==U&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==U)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,+c.currentPage)+1:1;if("pagecount"==U)return null!=c.pages?c.pages.length:1;ba=la.apply(this,arguments);null==ba&&(c.updateFileVars(),null!=c.fileVars&&(ba=c.fileVars[U]));return ba};var ka=null,W=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var U=this.getCurrentFile(),ba=null!=U&&null!=U.getTitle()?U.getTitle():this.defaultFilename;ka!=ba&&U==W&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());ka=ba;W=U}));var k=g.labelLinkClicked;g.labelLinkClicked=+function(U,ba,fa){var na=ba.getAttribute("href");if(null==na||!g.isCustomLink(na)||!mxEvent.isTouchEvent(fa)&&mxEvent.isPopupTrigger(fa))k.apply(this,arguments);else{if(!g.isEnabled()||null!=U&&g.isCellLocked(U.cell))g.customLinkClicked(na),g.getRubberband().reset();mxEvent.consume(fa)}};this.editor.getOrCreateFilename=function(){var U=c.defaultFilename,ba=c.getCurrentFile();null!=ba&&(U=null!=ba.getTitle()?ba.getTitle():U);return U};var y=this.actions.get("print");y.setEnabled(!mxClient.IS_IOS||+!navigator.standalone);y.visible=y.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&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||g.addListener(mxEvent.ESCAPE,-function(U,aa){null!=aa&&g.isEnabled()&&!g.isEditing()&&null!=aa.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(U){var aa=g.cellEditor.text2,ia=null;null!=aa&&(mxEvent.addListener(aa,"dragleave",function(na){null!=ia&&(ia.parentNode.removeChild(ia),-ia=null);na.stopPropagation();na.preventDefault()}),mxEvent.addListener(aa,"dragover",mxUtils.bind(this,function(na){null==ia&&(ia=this.highlightElement(aa));na.stopPropagation();na.preventDefault()})),mxEvent.addListener(aa,"drop",mxUtils.bind(this,function(na){null!=ia&&(ia.parentNode.removeChild(ia),ia=null);if(0<na.dataTransfer.files.length)this.importFiles(na.dataTransfer.files,0,0,this.maxImageSize,function(ta,ua,Ba,za,Aa,Ga){g.insertImage(ta,Aa,Ga)},function(){},function(ta){return"image/"==-ta.type.substring(0,6)},function(ta){for(var ua=0;ua<ta.length;ua++)ta[ua]()},mxEvent.isControlDown(na));else if(0<=mxUtils.indexOf(na.dataTransfer.types,"text/uri-list")){var qa=na.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(qa)?this.loadImage(decodeURIComponent(qa),mxUtils.bind(this,function(ta){var ua=Math.max(1,ta.width);ta=Math.max(1,ta.height);var Ba=this.maxImageSize;Ba=Math.min(1,Math.min(Ba/Math.max(1,ua)),Ba/Math.max(1,ta));g.insertImage(decodeURIComponent(qa),-ua*Ba,ta*Ba)})):document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(na.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(na.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/plain"));na.stopPropagation();na.preventDefault()})))}));if(Editor.isSettingsEnabled()){x=this.editor.graph.view;var J=mxSettings.getUnit();x.setUnit(J);-Editor.pageSizeUnit=J==mxConstants.METERS?mxConstants.MILLIMETERS:J;x.addListener("unitChanged",function(U,aa){U=aa.getProperty("unit");mxSettings.setUnit(U);mxSettings.save();Editor.pageSizeUnit=U==mxConstants.METERS?mxConstants.MILLIMETERS:U});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,x.unit);this.refresh()}if("1"==urlParams.styledev){x=document.getElementById("geFooter");-null!=x&&(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)})),x.appendChild(this.styleInput),-this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(U,aa){0<this.editor.graph.getSelectionCount()?(U=this.editor.graph.getSelectionCell(),U=this.editor.graph.getModel().getStyle(U),this.styleInput.value=U||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var R=this.isSelectionAllowed;this.isSelectionAllowed=function(U){return mxEvent.getSource(U)==this.styleInput?!0:R.apply(this,arguments)}}x=document.getElementById("geInfo");-null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var Y=null;mxEvent.addListener(g.container,"dragleave",function(U){g.isEnabled()&&(null!=Y&&(Y.parentNode.removeChild(Y),Y=null),U.stopPropagation(),U.preventDefault())});mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(U){null==Y&&(Y=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();U.stopPropagation();U.preventDefault()}));mxEvent.addListener(g.container,-"drop",mxUtils.bind(this,function(U){null!=Y&&(Y.parentNode.removeChild(Y),Y=null);if(g.isEnabled()){var aa=mxUtils.convertPoint(g.container,mxEvent.getClientX(U),mxEvent.getClientY(U)),ia=U.dataTransfer.files,na=g.view.translate,qa=g.view.scale,ta=aa.x/qa-na.x,ua=aa.y/qa-na.y;if(0<ia.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(U)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(ia,!0)):(mxEvent.isAltDown(U)&&(ua=ta=null),this.importFiles(ia,-ta,ua,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(U),null,null,mxEvent.isShiftDown(U),U));else{mxEvent.isAltDown(U)&&(ua=ta=0);var Ba=0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")?U.dataTransfer.getData("text/uri-list"):null;aa=this.extractGraphModelFromEvent(U,null!=this.pages);if(null!=aa)g.setSelectionCells(this.importXml(aa,ta,ua,!0));else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/html")){var za=U.dataTransfer.getData("text/html");aa=document.createElement("div");-aa.innerHTML=Graph.sanitizeHtml(za);var Aa=null;ia=aa.getElementsByTagName("img");null!=ia&&1==ia.length?(za=ia[0].getAttribute("src"),null==za&&(za=ia[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(za)||(Aa=!0)):(ia=aa.getElementsByTagName("a"),null!=ia&&1==ia.length?za=ia[0].getAttribute("href"):(aa=aa.getElementsByTagName("pre"),null!=aa&&1==aa.length&&(za=mxUtils.getTextContent(aa[0]))));var Ga=!0,Ra=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(za,ta,ua,-!0,Aa,null,Ga,mxEvent.isControlDown(U)))});Aa&&null!=za&&za.length>this.resampleThreshold?this.confirmImageResize(function(Ha){Ga=Ha;Ra()},mxEvent.isControlDown(U)):Ra()}else null!=Ba&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ba)?this.loadImage(decodeURIComponent(Ba),mxUtils.bind(this,function(Ha){var Qa=Math.max(1,Ha.width);Ha=Math.max(1,Ha.height);var eb=this.maxImageSize;eb=Math.min(1,Math.min(eb/Math.max(1,Qa)),eb/Math.max(1,Ha));g.setSelectionCell(g.insertVertex(null,null,"",ta,ua,Qa*eb,Ha*eb,-"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+Ba+";"))}),mxUtils.bind(this,function(Ha){g.setSelectionCells(this.insertTextAt(Ba,ta,ua,!0))})):0<=mxUtils.indexOf(U.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(U.dataTransfer.getData("text/plain"),ta,ua,!0))}}U.stopPropagation();U.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(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&g.view.validateBackground()});g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||-null==c.embedViewport)mxUtils.fit(this.div);else{var U=parseInt(this.div.offsetLeft),aa=parseInt(this.div.offsetWidth),ia=c.embedViewport.x+c.embedViewport.width,na=parseInt(this.div.offsetTop),qa=parseInt(this.div.offsetHeight),ta=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(U,ia-aa))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(na,ta-qa))+"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"}};var Z=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(U,aa){Z.call(this,U,aa);c.hideCurrentMenu()};var W=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(U,aa){W.call(this,U,aa);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){x=Editor.currentTheme;if("simple"==x||"sketch"==x)this.doSetCurrentTheme(x,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():-(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==x&&J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==x&&(this.lastWindowWidth=J)),this.fireEvent(new mxEventObject("themeInitialized"));"kennedy"==x&&(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=-J)}x=!1;if(null!=urlParams.dark)x=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)x="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||x&&"auto"!=mxSettings.settings.darkMode||(x=mxSettings.settings.darkMode);"auto"==x&&this.isAutoDarkModeSupported()&&(x=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof x?"1"==x:x);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",-mxUtils.bind(this,function(U){this.isAutoDarkMode()&&this.setDarkMode(U.matches)}))}catch(U){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);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&-this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(U,aa){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var C=EditorUi.prototype.windowResized;-EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));g=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&-this.lastWindowWidth>=g&&c<g?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}C.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,t=this.editor.graph;l.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 B=document.createElement("div");B.style.position="absolute";B.style.width="10px";B.style.height="10px";B.style.borderRadius="5px";B.style.border="1px solid gray";B.style.background="#ffffff";B.style.cursor=-"row-resize";this.diagramContainer.parentNode.appendChild(B);this.bottomResizer=B;var D=null,I=null,L=null,N=null;mxEvent.addGestureListeners(B,mxUtils.bind(this,function(K){N=parseInt(this.diagramContainer.style.height);I=mxEvent.getClientY(K);t.popupMenuHandler.hideMenu();mxEvent.consume(K)}));B=B.cloneNode(!1);B.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(B);this.rightResizer=B;mxEvent.addGestureListeners(B,mxUtils.bind(this,function(K){L=parseInt(this.diagramContainer.style.width);-D=mxEvent.getClientX(K);t.popupMenuHandler.hideMenu();mxEvent.consume(K)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(K){var da=!1;null!=D&&(this.diagramContainer.style.width=Math.max(20,L+mxEvent.getClientX(K)-D)+"px",da=!0);null!=I&&(this.diagramContainer.style.height=Math.max(20,N+mxEvent.getClientY(K)-I)+"px",da=!0);da&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),-"*"),this.inlineSizeChanged(),this.refresh())}),function(K){null==D&&null==I||mxEvent.consume(K);I=D=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";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(K){this.inlineSizeChanged();-Editor.passiveScroll?this.hideWindows():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";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=-function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position=-"absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.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(D){var I=mxEvent.getSource(D);-null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==I.nodeName||"TEXTAREA"==I.nodeName&&I!==this.typingShim||"true"==I.contentEditable||224!=D.keyCode&&(mxClient.IS_MAC||17!=D.keyCode)&&(!mxClient.IS_MAC||91!=D.keyCode&&93!=D.keyCode)||t||(l.style.left=g.container.scrollLeft+10+"px",l.style.top=g.container.scrollTop+10+"px",D=g.container.scrollLeft,I=g.container.scrollTop,g.container.appendChild(l),t=!0,l.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=-D,g.container.scrollTop=I)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(D){var I=D.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=I&&17!=I&&91!=I&&93!=I||(t=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(D){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l),c()}catch(I){this.handleError(I)}}));-mxEvent.addListener(l,"cut",mxUtils.bind(this,function(D){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l,!0),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(D){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=D.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!0,!0)),!mxEvent.isConsumed(D)){var I=g.container.scrollLeft,L=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{g.container.scrollLeft=I,g.container.scrollTop=L,Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!1,!0)}catch(N){this.handleError(N)}}),0)}}catch(N){this.handleError(N)}}),!0);var B=this.isSelectionAllowed;this.isSelectionAllowed=function(D){return mxEvent.getSource(D)==l?!0:B.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,g){mxSettings.setUi(c);(g=this.doSetCurrentTheme(c)||g)||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,g){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||g)g=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),-this.restoreScrollState(g);return l};EditorUi.prototype.saveScrollState=function(c){var g=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,t=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,t-=this.embedViewport.y):(l+=this.embedViewport.x,t+=this.embedViewport.y));g={x:l,y:t,tx:g.x,ty:g.y};c&&(g.boundingRect=this.diagramContainer.getBoundingClientRect());return g};EditorUi.prototype.restoreScrollState=function(c){var g=-this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var t=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-t.x;c.y-=c.boundingRect.y-t.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*g;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*g};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var g=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&-(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||g||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var t=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;g=null!=t&&null!=t.getAttribute("class");if(!g&&null!=t){t=t.getAttribute("title");var B=this.getCurrentFile();-B=null!=B?B.savingStatusKey:DrawioFile.prototype.savingStatusKey;t==mxResources.get(B)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(B))+'..."src="'+Editor.tailSpin+'"></div>',g=!0)}this.statusContainer.style.display="none";t=32>=c.clientWidth;c.style.visibility=t&&""==this.editor.getStatus()?"hidden":"";if(t||g)this.statusContainer.style.display="",g=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=-0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=-function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),g=0;g<-c.length;g++)null!=c[g]&&c[g].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=-null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=-null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,g,l){var t=this.threshold,B=c<=t;c=c+l.offsetWidth>=(window.innerWidth||-document.documentElement.clientWidth||document.body.clientWidth)-t;var D=g<=t;g=g+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-t;return B&&D?"top-left":c&&D?"top-right":B&&g?"bottom-left":c&&g?"bottom-right":B?"left":c?"right":D?"top":g?"bottom":null},dock:function(c,g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,-B=parseInt(c.div.style.width),D=parseInt(c.div.style.height),I=c.getX(),L=c.getY();c.dockState=g;c.div.classList.add("mxWindowDocked");var N=0<=g.indexOf("right"),K=0<=g.indexOf("bottom");0<=g.indexOf("left")?I=0:0<=g.indexOf("right")&&(I=l-B);0<=g.indexOf("top")?L=0:0<=g.indexOf("bottom")&&(L=t-D);N||(N=I+B/2>l/2);K||(K=L+D/2>t/2);c._dockAnchorRight=N;c._dockAnchorBottom=K;c._dockOffsetX=N?l-I-B:I;c._dockOffsetY=K?t-L-D:L;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,-"side",g))},undock:function(c){var g=c.dockState;if(null!=g){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",g))}},pinToEdge:function(c){var g=c.dockState;if(null!=g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=-window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=parseInt(c.div.style.width),D=parseInt(c.div.style.height);var I=c._dockAnchorRight?l-B-(c._dockOffsetX||0):c._dockOffsetX||0;var L=c._dockAnchorBottom?t-D-(c._dockOffsetY||0):c._dockOffsetY||0;0<=g.indexOf("left")?I=0:0<=g.indexOf("right")&&(I=l-B);0<=g.indexOf("top")?L=0:0<=g.indexOf("bottom")&&(L=t-D);I=Math.max(0,Math.min(I,l-B));L=Math.max(0,Math.min(L,t-D));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,-I,L);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,g){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=this.previewElement,-D=g.div.offsetWidth,I=g.div.offsetHeight,L=g.getX();g=g.getY();0<=c.indexOf("left")?L=0:0<=c.indexOf("right")&&(L=l-D);0<=c.indexOf("top")?g=0:0<=c.indexOf("bottom")&&(g=t-I);L=Math.max(0,Math.min(L,l-D));g=Math.max(0,Math.min(g,t-I));B.style.display="block";B.style.left=L+"px";B.style.top=g+"px";B.style.width=D+"px";B.style.height=I+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var g=0;g<this.windows.length;g++)if(this.windows[g]===-c){this.windows.splice(g,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var G=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,g,l){G.apply(this,arguments);-if(EditorUi.windowed&&Editor.enableWindowDocking){var t=c.window;null==this.dockManager&&this.createDockManager();var B=this.dockManager,D=!1,I=null,L=t.setLocation;t.setLocation=function(da,ja){(null==this.dockState||this._undocking||this._relayouting)&&L.call(this,da,ja)};var N=t.setSize;t.setSize=function(da,ja){null==this.dockState&&N.call(this,da,ja)};t.addListener(mxEvent.MOVE_START,function(da,ja){D=!0;I=null;null!=t.dockState&&(t._undocking=!0,B.undock(t),t._undocking=!1)});t.addListener(mxEvent.MOVE,-function(da,ja){D&&(da=B.getDockZone(t.getX(),t.getY(),t.div),da!=I&&(I=da,null!=da?B.showPreview(da,t):B.hidePreview()))});t.addListener(mxEvent.MOVE_END,function(da,ja){D=!1;B.hidePreview();null!=I&&B.dock(t,I);I=null});t.addListener(mxEvent.NORMALIZE,function(da,ja){null!=t.dockState&&B.pinToEdge(t)});t.addListener(mxEvent.MAXIMIZE,function(da,ja){null!=t.dockState&&(t._undocking=!0,B.undock(t),t._undocking=!1)});t.addListener(mxEvent.SHOW,function(da,ja){null!=t.dockState&&B.pinToEdge(t)});var K=-c.destroy;c.destroy=function(){B.removeWindow(t);K.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var g=this.editor.graph;g.defaultEdgeLength=Graph.prototype.defaultEdgeLength;g.defaultGridEnabled=Graph.prototype.defaultGridEnabled;g.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)g.defaultEdgeLength=-120;null==urlParams.grid&&(g.defaultGridEnabled=!1);null==urlParams.pv&&(g.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=-function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var g=this.getCurrentFile();null!=g&&(g.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==g.sync||g.sync.enabled&&g.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==g.sync||g.sync.isConnected()?g.isRealtimeEnabled()&&g.isRealtimeSupported()&&1<g.getRealtimeState()&&(c=g.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:-mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);-null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,g,l,t){l=null!=l?l:"geButton";var B=this.menus.get(c);t=this.menubar.addMenu(mxResources.get(c),B.funct,null,t);t.className=l;t.setAttribute("title",mxResources.get(c));this.menus.menuCreated(B,t,l);null!=g&&(t.style.backgroundImage="url("+g+")",t.innerText="");return t};EditorUi.prototype.addButton=function(c,g,-l,t){c=this.createToolbarButton(c,g,l);t=null!=t?t:this.container;t.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,g,l){var t=document.createElement("a");t.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(t.style.backgroundImage="url("+c+")");null!=g&&t.setAttribute("title",g);null!=l&&mxEvent.addListener(t,"click",function(B){"disabled"!=t.getAttribute("disabled")&&l(B);mxEvent.consume(B)});mxEvent.preventDefault(t);return t};EditorUi.prototype.createMenuItem=-function(c,g,l){var t=this.actions.get(c),B=null!=t?t.funct:null,D=this.createToolbarButton(g,mxResources.get(c)+(null!=t&&null!=t.shortcut?" ("+t.shortcut+")":""),B);null==t||l||(c=function(){t.isEnabled()?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),t.addListener("stateChanged",c),c());return D};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,g=Math.max(10,this.diagramContainer.parentNode.clientWidth--256),l="1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),g,60,240,l,mxUtils.bind(this,function(D){D.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var t=this.formatWindow.window.toggleMinimized,B=240;this.formatWindow.window.toggleMinimized=-function(){t.apply(this,arguments);this.minimized?(B=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+B-140+"px"):(this.div.style.width=B+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-B+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&-this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var D=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>D||690>I)&&this.formatWindow.window.toggleMinimized()}),-0)):this.formatWindow.window.setVisible(!1)}};var T=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var g=this.formatWindow;null!=g?g.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):T.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,g){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var t=this.hsplitPosition,B=mxUtils.bind(this,-function(){this.hsplitPosition=D;this.refresh();g||(this.diagramContainer.scrollLeft-=t-this.hsplitPosition)}),D=c?l:0,I=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==D?"translateX(0)":"translateX(-100%)");0!=D&&B();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==D?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+I+"s 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==D&&B();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*I)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};-var E=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():E.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var g=mxUtils.bind(this,function(I,L){var N=this.menus.get(I);I=this.createMenuElement(L,mxUtils.bind(this,function(){N.funct.apply(this,arguments)}));I.setAttribute("title",L);I.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";-I.className="geButton";c.parentNode.appendChild(I);return I});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),-g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var l=g("newLibrary","");l.style.left="0px";l.style.right="50%";var t=document.createElement("span");l.appendChild(t);var B=g("openLibraryFrom","");B.style.borderLeftWidth="1px";B.style.left="50%";B.style.right="0px";var D=document.createElement("span");B.appendChild(D);this.dependsOnLanguage(mxUtils.bind(this,-function(){t.innerHTML="";mxUtils.write(t,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));D.innerHTML="";mxUtils.write(D,mxResources.get("openLibraryFrom"));B.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,-650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-g)/2):56,c-6,g-6,mxUtils.bind(this,function(t){this.createShapesPanel(t)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,-0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var g=c;"auto"==c&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==-urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,g){this.dependsOnLanguage(mxUtils.bind(this,-function(){c.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&-window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var g=document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,t=g.getAttribute("media");(t="all"==t||"not all"!=t&&l)&&!c?g.setAttribute("media",l?"not all":"(forced-colors: active)"):!t&&c&&g.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};-EditorUi.prototype.setRulerVisible=function(c){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-g.x;this.diagramContainer.scrollTop+=c.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=-window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),-c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,g){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=-c,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=-function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),-this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var t=this.diagramContainer.getAttribute("data-bounds");if(null!=t){this.diagramContainer.removeAttribute("data-bounds");var B=t.split(" ");t=mxUtils.getDocumentSize();this.diagramContainer.style.top=B[0];this.diagramContainer.style.left=B[1];var D=parseInt(B[2]);-B=parseInt(B[3]);D=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,D):D,t.width-80);B=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,B):B,t.height-80);this.diagramContainer.style.width=D+"px";this.diagramContainer.style.height=B+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=-this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop-g.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=g.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/-2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":-"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;t="1"==urlParams.embedInline&&Editor.passiveScroll;g.style.visibility=t?"hidden":"";c.style.visibility=t?"hidden":"";l.style.display=t?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=-mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||-null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize=-"14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=-Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==-Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(g=this.getPageById(c.substring(l+1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,-5)&&(g=this.getCustomLinkTitle(c));return g};EditorUi.prototype.getCustomLinkTitle=function(c){var g=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(g=l.title)}catch(t){}return g};EditorUi.prototype.handleCustomLink=function(c,g){if(Graph.isPageLink(c))if(g=c.indexOf(","),c=this.getPageById(c.substring(g+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,-g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged",-"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(g,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));-c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(g,l){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(g,l){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(g,l){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,l){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.writeImageToClipboard=function(c,g,l,t,B,D){t=null!=t?t:"image/png";var I=null==g||null==l?'<img src="'+c+'">':'<img src="'+c+'" width="'+g+'" height="'+l+'">',L={"text/html":new Blob([I],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(t)&&(L[t]=this.base64ToBlob(c.substring(c.indexOf(",")+1),t));var N=new ClipboardItem(L);-navigator.clipboard.write([N]).then(B)["catch"](D);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",g,"h",l,"type",t,"html",[I],"data",[L],"item",[N])};EditorUi.prototype.writeHtmlToClipboard=function(c,g){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](g)};EditorUi.prototype.writeTextToClipboard=function(c,g,l){navigator.clipboard.writeText(c)["catch"](g).then(function(){null!=-l&&l()})};EditorUi.prototype.copySvg=function(c,g,l){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var t=this.editor.graph.getSvg(null,l,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);t.setAttribute("content",g);var B=Editor.createSvgDataUri(mxUtils.getXml(t)),D=parseInt(t.getAttribute("width")),I=parseInt(t.getAttribute("height"));this.writeImageToClipboard(B,D,I,"image/svg+xml",null,mxUtils.bind(this,function(L){this.handleError(L)}))}}catch(L){this.handleError(L)}};-EditorUi.prototype.copyImage=function(c,g,l){try{l=null!=l?l:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(t,B){try{this.spinner.stop();var D=this.createImageDataUri(t,g,"png"),I=Math.round(parseInt(B.getAttribute("width"))/l),L=Math.round(parseInt(B.getAttribute("height"))/l);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[g],"scale",[l]);this.writeImageToClipboard(D,-I,L,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var N=this.getBaseFilename(!1)+(null!=g?".drawio":"")+".png";this.saveLocalFile(D.substring(D.lastIndexOf(",")+1),N,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(N){this.handleError(N)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,l,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(t){this.handleError(t)}};EditorUi.prototype.copyCells=function(c,g){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";else{var t=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),B=mxUtils.getXml(l.encodeCells(t));mxUtils.setTextContent(c,encodeURIComponent(B));g?(l.removeCells(t,!1),l.lastPasteXml=null):(l.lastPasteXml=B,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=-null;if(Editor.enableNativeClipboard){var g=this.editor.graph;g.isSelectionEmpty()||(c=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),g=mxUtils.getXml(g.encodeCells(c)),navigator.clipboard.writeText(g))}return c};EditorUi.prototype.pasteXml=function(c,g,l,t,B,D){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[g],"compat",[l],"evt",[t],"html",[B],"pt",[D]);B=null!=B?B:!0;var I=this.editor.graph,L=null!=D?D:Editor.pasteAtMousePointer&&I.isMouseInsertPoint()?-I.getInsertPoint():null;D=null;I.lastPasteXml==c?null==L&&I.pasteCounter++:(I.lastPasteXml=c,I.pasteCounter=0);var N=I.pasteCounter*I.gridSize;if(l||this.isCompatibleString(c)){I.model.beginUpdate();try{if(D=this.importXml(c,N,N),null!=L){var K=I.getBoundingBoxFromGeometry(D,!0);if(null!=K){var da=Math.round(I.snap(L.x)),ja=Math.round(I.snap(L.y));I.cellsMoved(D,da-K.x,ja-K.y)}}}finally{I.model.endUpdate()}I.setSelectionCells(D)}else if(g&&1==I.getSelectionCount()){g=I.getStartEditingCell(I.getSelectionCell(),-t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==I.getCurrentCellStyle(g)[mxConstants.STYLE_SHAPE])I.setCellStyles(mxConstants.STYLE_IMAGE,c,[g]);else{I.model.beginUpdate();try{I.labelChanged(g,c),Graph.isLink(c)&&I.setLinkForCell(g,c)}finally{I.model.endUpdate()}}I.setSelectionCell(g)}else L=null!=L?L:I.getInsertPoint(),I.isMouseInsertPoint()&&(N=0,I.lastPasteXml==c&&0<I.pasteCounter&&I.pasteCounter--),D=this.insertTextAt(c,L.x+N,L.y+N,B),I.setSelectionCells(D);I.isSelectionEmpty()||(I.scrollCellToVisible(I.getSelectionCell()),-null!=this.hoverIcons&&this.hoverIcons.update(I.view.getState(I.getSelectionCell())));return D};EditorUi.prototype.pasteCells=function(c,g,l,t){if(!mxEvent.isConsumed(c)){var B=c.clipboardData,D=this.editor.graph,I=!1,L=g;if(l&&null!=B&&B.getData){var N=B.getData("text/plain"),K=!1;if(null!=N&&0<N.length&&"%3CmxGraphModel%3E"==N.substring(0,18))try{var da=decodeURIComponent(N);this.isCompatibleString(da)&&(K=!0,N=da)}catch(V){}K=K?null:B.getData("text/html");null!=K&&0<K.length?(L=this.parseHtmlData(K),-I="text/plain"!=L.getAttribute("data-type")):null!=N&&0<N.length&&(L=document.createElement("div"),mxUtils.setTextContent(L,K))}N=L.getElementsByTagName("span");if(null!=N&&0<N.length&&"application/vnd.lucid.chart.objects"===N[0].getAttribute("data-lucid-type"))l=N[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(V){var k=this.editor.graph;k.lastPasteXml==V?k.pasteCounter++:(k.lastPasteXml=V,k.pasteCounter=0);var x=k.pasteCounter*k.gridSize;-k.setSelectionCells(this.importXml(V,x,x));k.scrollCellToVisible(k.getSelectionCell())}),mxUtils.bind(this,function(V){this.handleError(V)})),mxEvent.consume(c));else{var ja=!1,ea="";ea=I?null!=L.textContent&&"<mxfile"==L.textContent.substring(0,7)&&"</mxfile>"==L.textContent.substring(L.textContent.length-9)||"<mxGraphModel"==L.textContent.substring(0,13)&&"</mxGraphModel>"==L.textContent.substring(L.textContent.length-15)?L.textContent.replace(/\u00a0/g," "):L.innerHTML:mxUtils.trim(null==L.innerText?-mxUtils.getTextContent(L):L.innerText);try{var ca=ea.lastIndexOf("%3E");0<=ca&&ca<ea.length-3&&(ea=ea.substring(0,ca+3))}catch(V){}try{N=L.getElementsByTagName("span"),(da=null!=N&&0<N.length?mxUtils.trim(decodeURIComponent(N[0].textContent)):decodeURIComponent(ea))&&(this.isCompatibleString(da)||0==da.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(ja=!0,ea=da)}catch(V){}da=null;try{if(!ja&&""==L.textContent)for(ca=0;ca<B.items.length;ca++){var fa=B.items[ca];if("file"===fa.kind){da=-fa.getAsFile();break}}}catch(V){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[g.outerHTML],"elt",[L.outerHTML],"useEvent",l,"pasteAsLabel",t,"xml",[ea],"compat",ja,"asHtml",I,"data",B,"items",[B.items.length],"files",[B.files.length],"types",[JSON.stringify(B.types)],"blob",[da]);try{if(ja||null==da)if(null!=ea&&0<ea.length){if(0==ea.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ka=mxUtils.bind(this,function(){try{ea=(new MiroImporter).importMiroJson(JSON.parse(ea)),-this.pasteXml(ea,t,ja,c)}catch(V){console.log("Miro import error:",V)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",ka):ka()}else this.pasteXml(ea,t,ja,c,I);mxEvent.consume(c)}else l||(D.lastPasteXml=null,D.pasteCounter=0);else{var la=D.getInsertPoint();this.importFiles([da],la.x,la.y,this.maxImageSize);mxEvent.consume(c)}}catch(V){this.handleError(V)}}}g.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var g=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&-g.isMouseInsertPoint()&&(c=g.getInsertPoint());if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(l,t,B,D,I){if(null!=l){g.getModel().beginUpdate();try{this.pasteXml(l,!0,null,null,null,c)}finally{g.getModel().endUpdate()}}else l=null!=t?t:null!=B?B:D,null!=l?(c=null!=c?c:g.getInsertPoint(),this.importFiles([l],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(l){}};-EditorUi.prototype.pasteFromLocalClipboard=function(c){var g=this.editor.graph;g.getModel().beginUpdate();try{g.moveCellsTo(mxClipboard.paste(g),c)}finally{g.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(g){for(var l=null!=g.clipboardData?g.clipboardData:g.originalEvent.clipboardData,t=!1,B=null,D=0;D<l.types.length;D++)if("text/"===l.types[D].substring(0,5)){t=!0;break}for(D=-0;D<l.items.length;D++){var I=l.items[D];if("file"===I.kind){B=I.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[g],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",t,"file",[B],"editing",c.isEditing());var L=mxUtils.bind(this,function(){try{if(!t&&null!=B){if(c.isEditing())this.importFiles([B],0,0,this.maxImageSize,function(K,da,ja,ea,ca,fa){c.insertImage(K,ca,fa)},function(){},function(K){return"image/"==K.type.substring(0,-6)},function(K){for(var da=0;da<K.length;da++)K[da]()});else{var N=this.editor.graph.getInsertPoint();this.importFiles([B],N.x,N.y,this.maxImageSize)}mxEvent.consume(g)}}catch(K){}});if(!mxEvent.isConsumed(g)&&!t)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(N){this.readTypeFromClipboardData(N,"image/svg+xml",mxUtils.bind(this,function(K){if(null!=K){K=new Blob([K],{type:"image/svg+xml"});var da=this.editor.graph.getInsertPoint();this.importFiles([K],da.x,-da.y,this.maxImageSize)}else L()}),"image")}))["catch"](L);else L()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(g){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",g,"types",null!=g&&0<g.length?[JSON.stringify(g[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(g,mxUtils.bind(this,function(l,t){null!=l?c(l):this.readGraphModelFromImageClipboardData(g,mxUtils.bind(this,function(B,D,I){null!=-B?c(B):this.readTypeFromClipboardData(g,"text/plain",mxUtils.bind(this,function(L){c(L,D,I,t,g)}))}))}))}catch(l){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,g){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(l){var t=null,B=null;try{var D=this.parseHtmlData(l);if(null!=D){t="text/plain"!=D.getAttribute("data-type")?D.innerHTML:mxUtils.trim(null==D.innerText?mxUtils.getTextContent(D):D.innerText);try{var I=t.lastIndexOf("%3E");-0<=I&&I<t.length-3&&(t=t.substring(0,I+3))}catch(K){}try{null==t&&(l=null,""==D.textContent&&1==D.children.length&&"IMG"==D.firstChild.nodeName&&(l=D.firstChild.getAttribute("src")),null!=l&&0<l.length&&("data:image/png;base64,"==l.substring(0,22)?B=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==l.substring(0,26)&&(B=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/svg+xml"))))}catch(K){}try{var L=D.getElementsByTagName("span"),N=null!=L&&0<L.length?-mxUtils.trim(decodeURIComponent(L[0].textContent)):decodeURIComponent(t);this.isCompatibleString(N)&&(t=N)}catch(K){}}}catch(K){}g(this.isCompatibleString(t)?t:null,B)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,g){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(l,t){var B=null;try{null!=l&&(B=mxUtils.parseXml(l).documentElement.getAttribute("content"))}catch(D){}this.isCompatibleString(B)?g(B):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,-function(D,I){B=Editor.extractGraphModelFromPng("data:image/png;base64,"+D);this.isCompatibleString(B)?g(B):g(null,t,I)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,g,l){var t=!1;if(null!=c&&0<c.length)for(var B=0;B<c.length&&!t;B++)(function(D){0<=mxUtils.indexOf(D.types,g)&&(t=!0,D.getType(g).then(mxUtils.bind(this,function(I){if("image/png"==g)I.arrayBuffer().then(function(L){l(btoa(Graph.arrayBufferToString(L)),I)})["catch"](function(){l(null)});else I.text().then(mxUtils.bind(this,-function(L){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],"data",[c],"type",[g],"result",[L]);l(L,I)}))["catch"](function(){l(null)})}))["catch"](function(){l(null)}))})(c[B]);t||l()};EditorUi.prototype.parseHtmlData=function(c){var g=null;if(null!=c&&0<c.length){var l="<meta "==c.substring(0,6);g=document.createElement("div");g.innerHTML=(l?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;l=g.getElementsByTagName("style");if(null!=l)for(;0<l.length;)l[0].parentNode.removeChild(l[0]);-if(null!=g.firstChild&&g.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=g.firstChild.nextSibling&&g.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==g.firstChild.nodeName&&"A"==g.firstChild.nextSibling.nodeName&&null==g.firstChild.nextSibling.nextSibling){var t=null==g.firstChild.nextSibling.innerText?mxUtils.getTextContent(g.firstChild.nextSibling):g.firstChild.nextSibling.innerText;t==g.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(g,t),asHtml=-!1)}if(""==g.textContent&&(l=g.getElementsByTagName("img"),1==l.length&&(t=l[0].getAttribute("src"),l=null,null!=t))){if(Editor.isPngDataUrl(t)){var B=Editor.extractGraphModelFromPng(t);null!=B&&0<B.length&&(l=B)}else if("data:image/svg+xml;base64,"==t.substring(0,26)){img=this.base64ToBlob(t.substring(t.indexOf(",")+1),"image/svg+xml");t=Graph.getSvgFromDataUri(t);try{B=mxUtils.parseXml(t).documentElement.getAttribute("content"),this.isCompatibleString(B)&&(l=B)}catch(D){}}null!=l&&(mxUtils.setTextContent(g,-l),asHtml=!1)}asHtml?Graph.removePasteFormatting(g):g.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[g],"asHtml",asHtml);return g};EditorUi.prototype.showPrintDialog=function(c,g,l){var t=330;this.editor.graph.isEnabled()&&(t+=40);null!=this.pages&&1<this.pages.length&&(t+=40,this.editor.graph.isEnabled()||(t+=10));null==g||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(t+=20);this.showDialog((new PrintDialog(this,c,g,l)).container,-320,t,!0,!0)};EditorUi.prototype.print=function(c,g){var l=this.editor,t=l.graph,B=this.getPageIndex(this.currentPage),D=null!=B?B+1:1,I=mxUtils.bind(this,function(V,k,x,J){var R=V.useCssTransforms,Y=V.currentTranslate,Z=V.currentScale,W=V.view.translate,U=V.view.scale;V.useCssTransforms&&(V.useCssTransforms=!1,V.currentTranslate=new mxPoint(0,0),V.currentScale=1,V.view.translate=new mxPoint(0,0),V.view.scale=1);var aa=V.getGraphBounds(),ia=0,na=0,qa=mxRectangle.fromRectangle(V.pageFormat),ta=g.fit||-g.crop||!V.pageVisible,ua=g.scale;qa.width=Math.ceil(qa.width*V.pageScale);qa.height=Math.ceil(qa.height*V.pageScale);var Ba=1;if(g.fit){Ba=g.sheetsAcross;var za=g.sheetsDown;isNaN(ua)||(qa.width=Math.ceil(qa.width*ua),qa.height=Math.ceil(qa.height*ua));Ba=Math.min(qa.height*za/(aa.height/V.view.scale),qa.width*Ba/(aa.width/V.view.scale))}else Ba=isNaN(ua)?1:ua;Ba*=1;!ta&&V.pageVisible?(ua=V.getPageLayout(),ia-=ua.x*qa.width,na-=ua.y*qa.height):ta=!0;g.crop&&(g.selection&&(aa=t.getBoundingBox(t.getSelectionCells())),-qa.width=(aa.width+1)*Ba/V.view.scale,qa.height=(aa.height+1)*Ba/V.view.scale);qa.width=Math.ceil(1*qa.width);qa.height=Math.ceil(1*qa.height);J=null!=J?"page/id,"+J:null;if(null==k){k=PrintDialog.createPrintPreview(V,Ba,null,0,ia,na,ta);k.title=this.getBaseFilename(!0);k.pageSelector=!1;k.mathEnabled=!1;ia=g.border;isNaN(ia)||(k.pageMargin=ia);g.selection&&(k.isCellVisible=function(Ha){return V.isCellSelected(Ha)});var Aa=k.writeHead;k.writeHead=function(Ha,Qa){Qa=null!=Qa?Qa:"";g.shadows||(Qa+=-'g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(Qa+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=l.fontCss&&(Qa+=l.fontCss);Aa.apply(this,arguments);for(var eb=V.getCustomFonts(),Ma=0;Ma<eb.length;Ma++){var ya=eb[Ma].name,Sa=eb[Ma].url;Graph.isCssFontUrl(Sa)?Ha.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Sa))+'" charset="UTF-8" type="text/css">'):(Ha.writeln('<style type="text/css">'),-Ha.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ya)+'";\nsrc: url("'+mxUtils.htmlEntities(Sa)+'");\n}'),Ha.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Ga=k.drawBackgroundImage;k.drawBackgroundImage=function(Ha){Ga.apply(this,arguments);null!=Ha.node&&(EditorUi.embedSvgImages(Ha.node),t.disableSvgLinks(Ha.node,function(Qa){Qa.setAttribute("href","javascript:void(0)")}))}}var Ra=k.addGraphFragment;k.addGraphFragment=function(Ha,Qa,eb,Ma,ya,Sa){Ra.apply(this,arguments);this.graph.mathEnabled?-this.mathEnabled=this.mathEnabled||!0:ya.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Oa=ya.getElementsByTagName("svg"),Na=0;Na<Oa.length;Na++)V.addSvgShadow(Oa[Na])};g.grid&&(k.gridSize=V.gridSize,k.gridSteps=V.view.gridSteps,k.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:V.view.gridColor);k.open(null,null,x,!0,J,qa,g.selection?V.getSelectionCells():null)}else{aa=V.background;if(null==aa||""==aa||aa==mxConstants.NONE)aa="#ffffff";k.backgroundColor=-aa;k.autoOrigin=ta;g.grid&&(k.gridSize=V.gridSize,k.gridSteps=V.view.gridSteps,k.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:V.view.gridColor);k.appendGraph(V,Ba,ia,na,x,!0,J,qa,g.selection?V.getSelectionCells():null);x=V.getCustomFonts();if(null!=k.wnd)for(qa=0;qa<x.length;qa++)ia=x[qa].name,na=x[qa].url,Graph.isCssFontUrl(na)?k.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(na)+'" charset="UTF-8" type="text/css">'):(k.wnd.document.writeln('<style type="text/css">'),-k.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ia)+'";\nsrc: url("'+mxUtils.htmlEntities(na)+'");\n}'),k.wnd.document.writeln("</style>"))}R&&(V.useCssTransforms=R,V.currentTranslate=Y,V.currentScale=Z,V.view.translate=W,V.view.scale=U);return k}),L=g.pagesFrom,N=g.pagesTo,K=!g.allPages;B=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{K&&(K=g.selection||L==D&&N==D);if(!K&&null!=this.pages&&this.pages.length){K=0;D=this.pages.length-1;g.allPages||-(K=parseInt(L)-1,D=parseInt(N)-1);for(var da=K;da<=D;da++){var ja=this.pages[da];L=ja==this.currentPage?t:null;if(null==L){L=this.createTemporaryGraph(t.stylesheet);L.shapeForegroundColor=t.shapeForegroundColor;L.shapeBackgroundColor=t.shapeBackgroundColor;N=!0;var ea=K=!1,ca=null,fa=null;null==ja.viewState&&null==ja.root&&this.updatePageRoot(ja);null!=ja.viewState&&(N=ja.viewState.pageVisible,K=ja.viewState.mathEnabled,ea=ja.viewState.shadowVisible,ca=ja.viewState.background,fa=ja.viewState.backgroundImage,-L.pageFormat=ja.viewState.pageFormat,L.gridSize=ja.viewState.gridSize);null!=fa&&null!=fa.originalSrc&&(fa=this.createImageForPageLink(fa.originalSrc,ja));L.background=ca;L.backgroundImage=null!=fa?new mxImage(fa.src,fa.width,fa.height,fa.x,fa.y):null;L.pageVisible=N;L.mathEnabled=K;L.shadowVisible=ea;var la=L.getGraphBounds;L.getGraphBounds=function(){var V=la.apply(this,arguments),k=this.backgroundImage;if(null!=k&&null!=k.width&&null!=k.height){var x=this.view.translate,J=this.view.scale;V=mxRectangle.fromRectangle(V);-V.add(new mxRectangle((x.x+k.x)*J,(x.y+k.y)*J,k.width*J,k.height*J))}return V};var ka=L.getGlobalVariable;L.getGlobalVariable=function(V){return"page"==V?ja.getName():"pagenumber"==V?da+1:"pagecount"==V?null!=this.pages?this.pages.length:1:ka.apply(this,arguments)};document.body.appendChild(L.container);this.updatePageRoot(ja);L.model.setRoot(ja.root)}B=I(L,B,da!=D,ja.getId());L!=t&&L.container.parentNode.removeChild(L.container)}}else B=I(t);null==B||null==B.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):-(B.mathEnabled&&(I=B.wnd.document,c||(B.wnd.IMMEDIATE_PRINT=!0),I.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),B.closeDocument(),Graph.rewritePageLinks(B.wnd.document,!0),B.mathEnabled||c||PrintDialog.printPreview(B));return B}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var g=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(t){null!=g&&(g.parentNode.removeChild(g),g=null);t.stopPropagation();t.preventDefault()}),-mxEvent.addListener(c[l],"dragover",mxUtils.bind(this,function(t){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==g&&(g=this.highlightElement());t.stopPropagation();t.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(t){null!=g&&(g.parentNode.removeChild(g),g=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<t.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(t.dataTransfer.files,0,0,this.maxImageSize,null,null,-null,null,!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)):this.openFiles(t.dataTransfer.files,!0);else{var B=this.extractGraphModelFromEvent(t);if(null==B){var D=null!=t.dataTransfer?t.dataTransfer:t.clipboardData;null!=D&&(10==document.documentMode||11==document.documentMode?B=D.getData("Text"):(B=null,B=0<=mxUtils.indexOf(D.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(D.types,"text/html")?D.getData("text/html"):null,null!=B&&0<B.length?(D=document.createElement("div"),-D.innerHTML=Graph.sanitizeHtml(B),D=D.getElementsByTagName("img"),0<D.length&&(B=D[0].getAttribute("src"))):0<=mxUtils.indexOf(D.types,"text/plain")&&(B=D.getData("text/plain"))),null!=B&&(Editor.isPngDataUrl(B)?(B=Editor.extractGraphModelFromPng(B),null!=B&&0<B.length&&this.openLocalFile(B,null,!0)):this.isRemoteFileFormat(B)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(B))).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(B)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(B):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(B)))))}else this.openLocalFile(B,null,-!0)}t.stopPropagation();t.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var g=0,l=0;if(null==c){var t=document.body;var B=document.documentElement;var D=(t.clientWidth||B.clientWidth)-3;t=Math.max(t.clientHeight||0,B.clientHeight)-3}else t=c.getBoundingClientRect(),g=t.top,l=t.left,D=t.width,t=t.height;B=document.createElement("div");B.style.zIndex=mxPopupMenu.prototype.zIndex+2;B.style.border="3px dotted rgb(254, 137, 12)";B.style.pointerEvents="none";B.style.position="absolute";-B.style.top=g+"px";B.style.left=l+"px";B.style.width=Math.max(0,D-3)+"px";B.style.height=Math.max(0,t-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(B):document.body.appendChild(B);return B};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var g=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=g){var l=new mxCodec(g.ownerDocument),t=new mxGraphModel;l.decode(g,t);g=t.getChildAt(t.getRoot(),0);for(l=0;l<t.getChildCount(g);l++)c.push(t.getChildAt(g,-l))}return c};EditorUi.prototype.openFileHandle=function(c,g,l,t,B,D){if(null!=g&&0<g.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(g)||/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var I=mxUtils.bind(this,function(N){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==N.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,-N,g)),this.showSidebar()}catch(K){this.handleError(K,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(N,g,t)});if(EditorUi.isVisioFilename(g))this.importVisio(l,mxUtils.bind(this,function(N){this.spinner.stop();I(N)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(N){this.spinner.stop();I(N)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),-mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(N){4==N.readyState&&(this.spinner.stop(),200<=N.status&&299>=N.status?I(N.responseText):this.handleError({message:mxResources.get(413==N.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(N){this.spinner.stop();this.openLocalFile(N,g,t)}),-mxUtils.bind(this,function(N){this.spinner.stop();this.handleError(N)}));else if("<mxlibrary"==c.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,c,l.name)),this.showSidebar()}catch(N){this.handleError(N,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(N){this.spinner.stop();I(N)}),mxUtils.bind(this,-function(){this.spinner.stop();this.openLocalFile(c,g,t)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var L=Editor.extractGraphModelFromPdf(c);null!=L&&(B=null,t=!0,c=L)}this.spinner.stop();this.openLocalFile(c,g,t,B,null!=B?l:null,D)}}};EditorUi.prototype.openFiles=function(c,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=0;l<c.length;l++)mxUtils.bind(this,function(t){var B=new FileReader;B.onload=-mxUtils.bind(this,function(D){try{this.openFileHandle(D.target.result,t.name,t,g)}catch(I){this.handleError(I)}});B.onerror=mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?B.readAsText(t):B.readAsDataURL(t)})(c[l])};EditorUi.prototype.openLocalFile=function(c,g,l,t,B,D){var I=this.getCurrentFile(),L=mxUtils.bind(this,function(){window.openFile=null;if(null==-g&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var N=mxUtils.parseXml(c);null!=N&&(this.editor.setGraphXml(N.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,g||this.defaultFilename,l,t,B,D))});if(null!=c&&0<c.length)null==I||!I.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?L():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&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,g),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 g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),-this.addBasenamesForCell(this.pages[g].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);g=[];for(var l in c)g.push(l);return g};EditorUi.prototype.addBasenamesForCell=function(c,g){function l(I){if(null!=I){var L=I.lastIndexOf(".");0<L&&(I=I.substring(L+1,I.length));null==g[I]&&(g[I]=!0)}}var t=this.editor.graph,B=t.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(B[mxConstants.STYLE_SHAPE]));t.model.isEdge(c)&&(l(mxMarker.getPackageForType(B[mxConstants.STYLE_STARTARROW])),+function(U,ba){null!=ba&&g.isEnabled()&&!g.isEditing()&&null!=ba.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(U){var ba=g.cellEditor.text2,fa=null;null!=ba&&(mxEvent.addListener(ba,"dragleave",function(na){null!=fa&&(fa.parentNode.removeChild(fa),+fa=null);na.stopPropagation();na.preventDefault()}),mxEvent.addListener(ba,"dragover",mxUtils.bind(this,function(na){null==fa&&(fa=this.highlightElement(ba));na.stopPropagation();na.preventDefault()})),mxEvent.addListener(ba,"drop",mxUtils.bind(this,function(na){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);if(0<na.dataTransfer.files.length)this.importFiles(na.dataTransfer.files,0,0,this.maxImageSize,function(ta,ua,Ca,Ba,Aa,Fa){g.insertImage(ta,Aa,Fa)},function(){},function(ta){return"image/"==+ta.type.substring(0,6)},function(ta){for(var ua=0;ua<ta.length;ua++)ta[ua]()},mxEvent.isControlDown(na));else if(0<=mxUtils.indexOf(na.dataTransfer.types,"text/uri-list")){var pa=na.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(pa)?this.loadImage(decodeURIComponent(pa),mxUtils.bind(this,function(ta){var ua=Math.max(1,ta.width);ta=Math.max(1,ta.height);var Ca=this.maxImageSize;Ca=Math.min(1,Math.min(Ca/Math.max(1,ua)),Ca/Math.max(1,ta));g.insertImage(decodeURIComponent(pa),+ua*Ca,ta*Ca)})):document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(na.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(na.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/plain"));na.stopPropagation();na.preventDefault()})))}));if(Editor.isSettingsEnabled()){y=this.editor.graph.view;var J=mxSettings.getUnit();y.setUnit(J);+Editor.pageSizeUnit=J==mxConstants.METERS?mxConstants.MILLIMETERS:J;y.addListener("unitChanged",function(U,ba){U=ba.getProperty("unit");mxSettings.setUnit(U);mxSettings.save();Editor.pageSizeUnit=U==mxConstants.METERS?mxConstants.MILLIMETERS:U});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,y.unit);this.refresh()}if("1"==urlParams.styledev){y=document.getElementById("geFooter");+null!=y&&(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)})),y.appendChild(this.styleInput),+this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(U,ba){0<this.editor.graph.getSelectionCount()?(U=this.editor.graph.getSelectionCell(),U=this.editor.graph.getModel().getStyle(U),this.styleInput.value=U||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var R=this.isSelectionAllowed;this.isSelectionAllowed=function(U){return mxEvent.getSource(U)==this.styleInput?!0:R.apply(this,arguments)}}y=document.getElementById("geInfo");+null!=y&&y.parentNode.removeChild(y);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var X=null;mxEvent.addListener(g.container,"dragleave",function(U){g.isEnabled()&&(null!=X&&(X.parentNode.removeChild(X),X=null),U.stopPropagation(),U.preventDefault())});mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(U){null==X&&(X=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();U.stopPropagation();U.preventDefault()}));mxEvent.addListener(g.container,+"drop",mxUtils.bind(this,function(U){null!=X&&(X.parentNode.removeChild(X),X=null);if(g.isEnabled()){var ba=mxUtils.convertPoint(g.container,mxEvent.getClientX(U),mxEvent.getClientY(U)),fa=U.dataTransfer.files,na=g.view.translate,pa=g.view.scale,ta=ba.x/pa-na.x,ua=ba.y/pa-na.y;if(0<fa.length)if(ba=this.isBlankFile()&&!this.canUndo(),na=1==fa.length&&(EditorUi.isVisioFilename(fa[0].name)||/(\.drawio)$/i.test(fa[0].name)||/(\.xml)$/i.test(fa[0].name)),"1"!=urlParams.embed&&ba&&(na||mxEvent.isShiftDown(U))){this.fileLoaded(null,+!0);var Ca=mxUtils.bind(this,function(){this.editor.removeListener(Ca);var Pa=this.getCurrentFile();null!=Pa&&Pa.fileChanged()});this.editor.addListener("fileLoaded",Ca);this.openFiles(fa,!0)}else mxEvent.isAltDown(U)&&(ua=ta=null),this.importFiles(fa,ta,ua,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(U),null,null,mxEvent.isShiftDown(U),U);else{mxEvent.isAltDown(U)&&(ua=ta=0);var Ba=0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")?U.dataTransfer.getData("text/uri-list"):null;+fa=this.extractGraphModelFromEvent(U,null!=this.pages);if(null!=fa)g.setSelectionCells(this.importXml(fa,ta,ua,!0));else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/html")){var Aa=U.dataTransfer.getData("text/html");fa=document.createElement("div");fa.innerHTML=Graph.sanitizeHtml(Aa);var Fa=null;ba=fa.getElementsByTagName("img");null!=ba&&1==ba.length?(Aa=ba[0].getAttribute("src"),null==Aa&&(Aa=ba[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Aa)||(Fa=!0)):(ba=fa.getElementsByTagName("a"),+null!=ba&&1==ba.length?Aa=ba[0].getAttribute("href"):(fa=fa.getElementsByTagName("pre"),null!=fa&&1==fa.length&&(Aa=mxUtils.getTextContent(fa[0]))));var Sa=!0,La=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(Aa,ta,ua,!0,Fa,null,Sa,mxEvent.isControlDown(U)))});Fa&&null!=Aa&&Aa.length>this.resampleThreshold?this.confirmImageResize(function(Pa){Sa=Pa;La()},mxEvent.isControlDown(U)):La()}else null!=Ba&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ba)?this.loadImage(decodeURIComponent(Ba),+mxUtils.bind(this,function(Pa){var db=Math.max(1,Pa.width);Pa=Math.max(1,Pa.height);var Ia=this.maxImageSize;Ia=Math.min(1,Math.min(Ia/Math.max(1,db)),Ia/Math.max(1,Pa));g.setSelectionCell(g.insertVertex(null,null,"",ta,ua,db*Ia,Pa*Ia,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+Ba+";"))}),mxUtils.bind(this,function(Pa){g.setSelectionCells(this.insertTextAt(Ba,ta,ua,!0))})):0<=mxUtils.indexOf(U.dataTransfer.types,"text/plain")&&+g.setSelectionCells(this.insertTextAt(U.dataTransfer.getData("text/plain"),ta,ua,!0))}}U.stopPropagation();U.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(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",+function(){mxClient.IS_SF&&g.view.validateBackground()});g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var U=parseInt(this.div.offsetLeft),ba=parseInt(this.div.offsetWidth),fa=c.embedViewport.x+c.embedViewport.width,na=parseInt(this.div.offsetTop),pa=parseInt(this.div.offsetHeight),ta=c.embedViewport.y+c.embedViewport.height;+this.div.style.left=Math.max(c.embedViewport.x,Math.min(U,fa-ba))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(na,ta-pa))+"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"}};var aa=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(U,ba){aa.call(this,U,ba);c.hideCurrentMenu()};var Z=mxWindow.prototype.setSize;mxWindow.prototype.setSize=+function(U,ba){Z.call(this,U,ba);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){y=Editor.currentTheme;if("simple"==y||"sketch"==y)this.doSetCurrentTheme(y,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==y&&J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==y&&(this.lastWindowWidth=J)),this.fireEvent(new mxEventObject("themeInitialized"));+"kennedy"==y&&(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=J)}y=!1;if(null!=urlParams.dark)y=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)y="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||y&&"auto"!=mxSettings.settings.darkMode||(y=mxSettings.settings.darkMode);"auto"==y&&this.isAutoDarkModeSupported()&&+(y=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof y?"1"==y:y);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(U){this.isAutoDarkMode()&&this.setDarkMode(U.matches)}))}catch(U){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);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(U,ba){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;+screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var C=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?+this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));g=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}C.apply(this,arguments);+null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,t=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(V){mxEvent.getSource(V)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V)),this.sendEmbeddedSvgExport())}));+document.body.style.cursor="text";var B=document.createElement("div");B.style.position="absolute";B.style.width="10px";B.style.height="10px";B.style.borderRadius="5px";B.style.border="1px solid gray";B.style.background="#ffffff";B.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(B);this.bottomResizer=B;var D=null,I=null,K=null,M=null;mxEvent.addGestureListeners(B,mxUtils.bind(this,function(V){M=parseInt(this.diagramContainer.style.height);I=mxEvent.getClientY(V);t.popupMenuHandler.hideMenu();+mxEvent.consume(V)}));B=B.cloneNode(!1);B.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(B);this.rightResizer=B;mxEvent.addGestureListeners(B,mxUtils.bind(this,function(V){K=parseInt(this.diagramContainer.style.width);D=mxEvent.getClientX(V);t.popupMenuHandler.hideMenu();mxEvent.consume(V)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(V){var Q=!1;null!=D&&(this.diagramContainer.style.width=Math.max(20,K+mxEvent.getClientX(V)-D)+"px",Q=!0);null!=+I&&(this.diagramContainer.style.height=Math.max(20,M+mxEvent.getClientY(V)-I)+"px",Q=!0);Q&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(V){null==D&&null==I||mxEvent.consume(V);I=D=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";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(V){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(V){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";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete",+"off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height=+"1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.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(D){var I=mxEvent.getSource(D);null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==I.nodeName||"TEXTAREA"==I.nodeName&&I!==this.typingShim||"true"==I.contentEditable||224!=D.keyCode&&(mxClient.IS_MAC||+17!=D.keyCode)&&(!mxClient.IS_MAC||91!=D.keyCode&&93!=D.keyCode)||t||(l.style.left=g.container.scrollLeft+10+"px",l.style.top=g.container.scrollTop+10+"px",D=g.container.scrollLeft,I=g.container.scrollTop,g.container.appendChild(l),t=!0,l.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=D,g.container.scrollTop=I)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(D){var I=D.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=I&&17!=I&&91!=I&&93!=+I||(t=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(D){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(D){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l,!0),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(l,"paste",+mxUtils.bind(this,function(D){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=D.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!0,!0)),!mxEvent.isConsumed(D)){var I=g.container.scrollLeft,K=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{g.container.scrollLeft=I,g.container.scrollTop=K,Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!1,!0)}catch(M){this.handleError(M)}}),0)}}catch(M){this.handleError(M)}}),+!0);var B=this.isSelectionAllowed;this.isSelectionAllowed=function(D){return mxEvent.getSource(D)==l?!0:B.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,g){mxSettings.setUi(c);(g=this.doSetCurrentTheme(c)||g)||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,g){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":+"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||g)g=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(g);return l};EditorUi.prototype.saveScrollState=function(c){var g=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,+t=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,t-=this.embedViewport.y):(l+=this.embedViewport.x,t+=this.embedViewport.y));g={x:l,y:t,tx:g.x,ty:g.y};c&&(g.boundingRect=this.diagramContainer.getBoundingClientRect());return g};EditorUi.prototype.restoreScrollState=function(c){var g=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var t=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-+t.x;c.y-=c.boundingRect.y-t.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*g;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*g};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var g=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||g||+(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var t=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;g=null!=t&&null!=t.getAttribute("class");if(!g&&null!=t){t=t.getAttribute("title");var B=this.getCurrentFile();B=null!=B?B.savingStatusKey:DrawioFile.prototype.savingStatusKey;t==mxResources.get(B)+"..."&&(this.statusContainer.innerHTML='<div><img title="'++mxUtils.htmlEntities(mxResources.get(B))+'..."src="'+Editor.tailSpin+'"></div>',g=!0)}this.statusContainer.style.display="none";t=32>=c.clientWidth;c.style.visibility=t&&""==this.editor.getStatus()?"hidden":"";if(t||g)this.statusContainer.style.display="",g=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};+EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,+this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),+this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&+(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),+this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,g,l){var t=this.threshold,B=c<=t;c=c+l.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-t;var D=g<=t;g=g+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||+document.body.clientHeight)-t;return B&&D?"top-left":c&&D?"top-right":B&&g?"bottom-left":c&&g?"bottom-right":B?"left":c?"right":D?"top":g?"bottom":null},dock:function(c,g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=parseInt(c.div.style.width),D=parseInt(c.div.style.height),I=c.getX(),K=c.getY();c.dockState=g;c.div.classList.add("mxWindowDocked");var M=0<=g.indexOf("right"),+V=0<=g.indexOf("bottom");0<=g.indexOf("left")?I=0:0<=g.indexOf("right")&&(I=l-B);0<=g.indexOf("top")?K=0:0<=g.indexOf("bottom")&&(K=t-D);M||(M=I+B/2>l/2);V||(V=K+D/2>t/2);c._dockAnchorRight=M;c._dockAnchorBottom=V;c._dockOffsetX=M?l-I-B:I;c._dockOffsetY=V?t-K-D:K;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",g))},undock:function(c){var g=c.dockState;if(null!=g){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");+c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",g))}},pinToEdge:function(c){var g=c.dockState;if(null!=g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=parseInt(c.div.style.width),D=parseInt(c.div.style.height);var I=c._dockAnchorRight?l-B-(c._dockOffsetX||0):+c._dockOffsetX||0;var K=c._dockAnchorBottom?t-D-(c._dockOffsetY||0):c._dockOffsetY||0;0<=g.indexOf("left")?I=0:0<=g.indexOf("right")&&(I=l-B);0<=g.indexOf("top")?K=0:0<=g.indexOf("bottom")&&(K=t-D);I=Math.max(0,Math.min(I,l-B));K=Math.max(0,Math.min(K,t-D));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,I,K);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,g){null==this.previewElement&&(this.previewElement=+document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=this.previewElement,D=g.div.offsetWidth,I=g.div.offsetHeight,K=g.getX();g=g.getY();0<=c.indexOf("left")?K=0:0<=c.indexOf("right")&&(K=l-D);0<=c.indexOf("top")?g=0:0<=c.indexOf("bottom")&&(g=t-I);K=Math.max(0,+Math.min(K,l-D));g=Math.max(0,Math.min(g,t-I));B.style.display="block";B.style.left=K+"px";B.style.top=g+"px";B.style.width=D+"px";B.style.height=I+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var g=0;g<this.windows.length;g++)if(this.windows[g]===c){this.windows.splice(g,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),+this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var G=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,g,l){G.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var t=c.window;null==this.dockManager&&this.createDockManager();var B=this.dockManager,D=!1,I=null,K=t.setLocation;t.setLocation=+function(Q,ja){(null==this.dockState||this._undocking||this._relayouting)&&K.call(this,Q,ja)};var M=t.setSize;t.setSize=function(Q,ja){null==this.dockState&&M.call(this,Q,ja)};t.addListener(mxEvent.MOVE_START,function(Q,ja){D=!0;I=null;null!=t.dockState&&(t._undocking=!0,B.undock(t),t._undocking=!1)});t.addListener(mxEvent.MOVE,function(Q,ja){D&&(Q=B.getDockZone(t.getX(),t.getY(),t.div),Q!=I&&(I=Q,null!=Q?B.showPreview(Q,t):B.hidePreview()))});t.addListener(mxEvent.MOVE_END,function(Q,ja){D=!1;B.hidePreview();+null!=I&&B.dock(t,I);I=null});t.addListener(mxEvent.NORMALIZE,function(Q,ja){null!=t.dockState&&B.pinToEdge(t)});t.addListener(mxEvent.MAXIMIZE,function(Q,ja){null!=t.dockState&&(t._undocking=!0,B.undock(t),t._undocking=!1)});t.addListener(mxEvent.SHOW,function(Q,ja){null!=t.dockState&&B.pinToEdge(t)});var V=c.destroy;c.destroy=function(){B.removeWindow(t);V.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var g=this.editor.graph;g.defaultEdgeLength=Graph.prototype.defaultEdgeLength;+g.defaultGridEnabled=Graph.prototype.defaultGridEnabled;g.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)g.defaultEdgeLength=120;null==urlParams.grid&&(g.defaultGridEnabled=!1);null==urlParams.pv&&(g.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=+function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var g=this.getCurrentFile();null!=g&&(g.invalidChecksum?c=mxResources.get("error")++": "+mxResources.get("checksum"):null==g.sync||g.sync.enabled&&g.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==g.sync||g.sync.isConnected()?g.isRealtimeEnabled()&&g.isRealtimeSupported()&&1<g.getRealtimeState()&&(c=g.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=+function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};+EditorUi.prototype.createMenu=function(c,g,l,t){l=null!=l?l:"geButton";var B=this.menus.get(c);t=this.menubar.addMenu(mxResources.get(c),B.funct,null,t);t.className=l;t.setAttribute("title",mxResources.get(c));this.menus.menuCreated(B,t,l);null!=g&&(t.style.backgroundImage="url("+g+")",t.innerText="");return t};EditorUi.prototype.addButton=function(c,g,l,t){c=this.createToolbarButton(c,g,l);t=null!=t?t:this.container;t.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,g,l){var t=+document.createElement("a");t.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(t.style.backgroundImage="url("+c+")");null!=g&&t.setAttribute("title",g);null!=l&&mxEvent.addListener(t,"click",function(B){"disabled"!=t.getAttribute("disabled")&&l(B);mxEvent.consume(B)});mxEvent.preventDefault(t);return t};EditorUi.prototype.createMenuItem=function(c,g,l){var t=this.actions.get(c),B=null!=t?t.funct:null,D=this.createToolbarButton(g,mxResources.get(c)+(null!=t&&null!=t.shortcut?" ("+t.shortcut++")":""),B);null==t||l||(c=function(){t.isEnabled()?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),t.addListener("stateChanged",c),c());return D};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,g=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),l="1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=+new WrapperWindow(this,mxResources.get("format"),g,60,240,l,mxUtils.bind(this,function(D){D.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var t=this.formatWindow.window.toggleMinimized,B=240;this.formatWindow.window.toggleMinimized=function(){t.apply(this,arguments);this.minimized?(B=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width=+"140px",this.div.style.left=parseInt(this.div.style.left)+B-140+"px"):(this.div.style.width=B+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-B+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,+80);"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var D=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>D||690>I)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var T=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=+function(c){var g=this.formatWindow;null!=g?g.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):T.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,g){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var t=this.hsplitPosition,B=mxUtils.bind(this,function(){this.hsplitPosition=D;this.refresh();g||(this.diagramContainer.scrollLeft-=t-this.hsplitPosition)}),D=c?l:0,I=+Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==D?"translateX(0)":"translateX(-100%)");0!=D&&B();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==D?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+I+"s 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==D&&B();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*I)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var E=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;+return null!=c?c.window.isVisible():E.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var g=mxUtils.bind(this,function(I,K){var M=this.menus.get(I);I=this.createMenuElement(K,mxUtils.bind(this,function(){M.funct.apply(this,arguments)}));I.setAttribute("title",K);I.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";I.className="geButton";c.parentNode.appendChild(I);return I});if(Editor.enableCustomLibraries&&("1"!=+urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),+c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var l=g("newLibrary","");l.style.left="0px";l.style.right="50%";var t=document.createElement("span");l.appendChild(t);var B=g("openLibraryFrom","");B.style.borderLeftWidth="1px";B.style.left="50%";B.style.right="0px";var D=document.createElement("span");B.appendChild(D);this.dependsOnLanguage(mxUtils.bind(this,function(){t.innerHTML="";mxUtils.write(t,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));+D.innerHTML="";mxUtils.write(D,mxResources.get("openLibraryFrom"));B.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=+new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-g)/2):56,c-6,g-6,mxUtils.bind(this,function(t){this.createShapesPanel(t)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=+function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var g=c;"auto"==c&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=+function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,g){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();+this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var g=+document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,t=g.getAttribute("media");(t="all"==t||"not all"!=t&&l)&&!c?g.setAttribute("media",l?"not all":"(forced-colors: active)"):!t&&c&&g.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);+mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-g.x;this.diagramContainer.scrollTop+=c.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||+Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),+null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,g){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),+this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,+l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left=+"0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var t=this.diagramContainer.getAttribute("data-bounds");if(null!=t){this.diagramContainer.removeAttribute("data-bounds");var B=t.split(" ");t=mxUtils.getDocumentSize();this.diagramContainer.style.top=B[0];this.diagramContainer.style.left=B[1];var D=parseInt(B[2]);B=parseInt(B[3]);D=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,+D):D,t.width-80);B=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,B):B,t.height-80);this.diagramContainer.style.width=D+"px";this.diagramContainer.style.height=B+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop-+g.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=g.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-+this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;t="1"==urlParams.embedInline&&+Editor.passiveScroll;g.style.visibility=t?"hidden":"";c.style.visibility=t?"hidden":"";l.style.display=t?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&+null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle=+"none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing=+"8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch=+"1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=+mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(g=this.getPageById(c.substring(l+1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(g=this.getCustomLinkTitle(c));return g};EditorUi.prototype.getCustomLinkTitle=function(c){var g=mxResources.get("action");+if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(g=l.title)}catch(t){}return g};EditorUi.prototype.handleCustomLink=function(c,g){if(Graph.isPageLink(c))if(g=c.indexOf(","),c=this.getPageById(c.substring(g+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=+mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",+mxUtils.bind(this,function(g,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",+mxUtils.bind(this,function(g,l){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(g,l){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(g,l){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,l){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.writeImageToClipboard=function(c,g,l,t,B,D){t=null!=t?t:"image/png";var I=null==g||null==l?'<img src="'+c+'">':'<img src="'+c+'" width="'+g+'" height="'+l+'">',K={"text/html":new Blob([I],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(t)&&(K[t]=this.base64ToBlob(c.substring(c.indexOf(",")+1),t));var M=new ClipboardItem(K);navigator.clipboard.write([M]).then(B)["catch"](D);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",+[c],"w",g,"h",l,"type",t,"html",[I],"data",[K],"item",[M])};EditorUi.prototype.writeHtmlToClipboard=function(c,g){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](g)};EditorUi.prototype.writeTextToClipboard=function(c,g,l){navigator.clipboard.writeText(c)["catch"](g).then(function(){null!=l&&l()})};EditorUi.prototype.copySvg=function(c,g,l){try{if(null!=navigator.clipboard&&+"function"===typeof window.ClipboardItem){var t=this.editor.graph.getSvg(null,l,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);null!=g&&t.setAttribute("content",g);var B=Editor.createSvgDataUri(mxUtils.getXml(t)),D=parseInt(t.getAttribute("width")),I=parseInt(t.getAttribute("height"));this.writeImageToClipboard(B,D,I,"image/svg+xml",null,mxUtils.bind(this,function(K){this.handleError(K)}))}}catch(K){this.handleError(K)}};EditorUi.prototype.copyImage=function(c,g,l){try{l=+null!=l?l:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(t,B){try{this.spinner.stop();var D=this.createImageDataUri(t,g,"png"),I=Math.round(parseInt(B.getAttribute("width"))/l),K=Math.round(parseInt(B.getAttribute("height"))/l);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[g],"scale",[l]);this.writeImageToClipboard(D,I,K,"image/png",null,mxUtils.bind(this,+function(){if(this.isLocalFileSave()){var M=this.getBaseFilename(!1)+(null!=g?".drawio":"")+".png";this.saveLocalFile(D.substring(D.lastIndexOf(",")+1),M,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(M){this.handleError(M)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,l,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(t){this.handleError(t)}};+EditorUi.prototype.copyCells=function(c,g){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";else{var t=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),B=mxUtils.getXml(l.encodeCells(t));mxUtils.setTextContent(c,encodeURIComponent(B));g?(l.removeCells(t,!1),l.lastPasteXml=null):(l.lastPasteXml=B,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeClipboard){var g=this.editor.graph;+g.isSelectionEmpty()||(c=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),g=mxUtils.getXml(g.encodeCells(c)),navigator.clipboard.writeText(g))}return c};EditorUi.prototype.pasteXml=function(c,g,l,t,B,D){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[g],"compat",[l],"evt",[t],"html",[B],"pt",[D]);B=null!=B?B:!0;var I=this.editor.graph,K=null!=D?D:Editor.pasteAtMousePointer&&I.isMouseInsertPoint()?I.getInsertPoint():null;D=null;I.lastPasteXml==+c?null==K&&I.pasteCounter++:(I.lastPasteXml=c,I.pasteCounter=0);var M=I.pasteCounter*I.gridSize;if(l||this.isCompatibleString(c)){I.model.beginUpdate();try{if(D=this.importXml(c,M,M),null!=K){var V=I.getBoundingBoxFromGeometry(D,!0);if(null!=V){var Q=Math.round(I.snap(K.x)),ja=Math.round(I.snap(K.y));I.cellsMoved(D,Q-V.x,ja-V.y)}}}finally{I.model.endUpdate()}I.setSelectionCells(D)}else if(g&&1==I.getSelectionCount()){g=I.getStartEditingCell(I.getSelectionCell(),t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&+"image"==I.getCurrentCellStyle(g)[mxConstants.STYLE_SHAPE])I.setCellStyles(mxConstants.STYLE_IMAGE,c,[g]);else{I.model.beginUpdate();try{I.labelChanged(g,c),Graph.isLink(c)&&I.setLinkForCell(g,c)}finally{I.model.endUpdate()}}I.setSelectionCell(g)}else K=null!=K?K:I.getInsertPoint(),I.isMouseInsertPoint()&&(M=0,I.lastPasteXml==c&&0<I.pasteCounter&&I.pasteCounter--),D=this.insertTextAt(c,K.x+M,K.y+M,B),I.setSelectionCells(D);I.isSelectionEmpty()||(I.scrollCellToVisible(I.getSelectionCell()),null!=this.hoverIcons&&+this.hoverIcons.update(I.view.getState(I.getSelectionCell())));return D};EditorUi.prototype.pasteCells=function(c,g,l,t){if(!mxEvent.isConsumed(c)){var B=c.clipboardData,D=this.editor.graph,I=!1,K=g;if(l&&null!=B&&B.getData){var M=B.getData("text/plain"),V=!1;if(null!=M&&0<M.length&&"%3CmxGraphModel%3E"==M.substring(0,18))try{var Q=decodeURIComponent(M);this.isCompatibleString(Q)&&(V=!0,M=Q)}catch(W){}V=V?null:B.getData("text/html");null!=V&&0<V.length?(K=this.parseHtmlData(V),I="text/plain"!=K.getAttribute("data-type")):+null!=M&&0<M.length&&(K=document.createElement("div"),mxUtils.setTextContent(K,V))}M=K.getElementsByTagName("span");if(null!=M&&0<M.length&&"application/vnd.lucid.chart.objects"===M[0].getAttribute("data-lucid-type"))l=M[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(W){var k=this.editor.graph;k.lastPasteXml==W?k.pasteCounter++:(k.lastPasteXml=W,k.pasteCounter=0);var y=k.pasteCounter*k.gridSize;k.setSelectionCells(this.importXml(W,y,+y));k.scrollCellToVisible(k.getSelectionCell())}),mxUtils.bind(this,function(W){this.handleError(W)})),mxEvent.consume(c));else{var ja=!1,ea="";ea=I?null!=K.textContent&&"<mxfile"==K.textContent.substring(0,7)&&"</mxfile>"==K.textContent.substring(K.textContent.length-9)||"<mxGraphModel"==K.textContent.substring(0,13)&&"</mxGraphModel>"==K.textContent.substring(K.textContent.length-15)?K.textContent.replace(/\u00a0/g," "):K.innerHTML:mxUtils.trim(null==K.innerText?mxUtils.getTextContent(K):K.innerText);+try{var da=ea.lastIndexOf("%3E");0<=da&&da<ea.length-3&&(ea=ea.substring(0,da+3))}catch(W){}try{M=K.getElementsByTagName("span"),(Q=null!=M&&0<M.length?mxUtils.trim(decodeURIComponent(M[0].textContent)):decodeURIComponent(ea))&&(this.isCompatibleString(Q)||0==Q.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(ja=!0,ea=Q)}catch(W){}Q=null;try{if(!ja&&""==K.textContent)for(da=0;da<B.items.length;da++){var ia=B.items[da];if("file"===ia.kind){Q=ia.getAsFile();break}}}catch(W){}EditorUi.debug("EditorUi.pasteCells",+[this],"evt",[c],"realElt",[g.outerHTML],"elt",[K.outerHTML],"useEvent",l,"pasteAsLabel",t,"xml",[ea],"compat",ja,"asHtml",I,"data",B,"items",[B.items.length],"files",[B.files.length],"types",[JSON.stringify(B.types)],"blob",[Q]);try{if(ja||null==Q)if(null!=ea&&0<ea.length){if(0==ea.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ka=mxUtils.bind(this,function(){try{ea=(new MiroImporter).importMiroJson(JSON.parse(ea)),this.pasteXml(ea,t,ja,c)}catch(W){console.log("Miro import error:",+W)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",ka):ka()}else this.pasteXml(ea,t,ja,c,I);mxEvent.consume(c)}else l||(D.lastPasteXml=null,D.pasteCounter=0);else{var la=D.getInsertPoint();this.importFiles([Q],la.x,la.y,this.maxImageSize);mxEvent.consume(c)}}catch(W){this.handleError(W)}}}g.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var g=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&g.isMouseInsertPoint()&&(c=g.getInsertPoint());+if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(l,t,B,D,I){if(null!=l){g.getModel().beginUpdate();try{this.pasteXml(l,!0,null,null,null,c)}finally{g.getModel().endUpdate()}}else l=null!=t?t:null!=B?B:D,null!=l?(c=null!=c?c:g.getInsertPoint(),this.importFiles([l],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(l){}};EditorUi.prototype.pasteFromLocalClipboard=+function(c){var g=this.editor.graph;g.getModel().beginUpdate();try{g.moveCellsTo(mxClipboard.paste(g),c)}finally{g.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(g){for(var l=null!=g.clipboardData?g.clipboardData:g.originalEvent.clipboardData,t=!1,B=null,D=0;D<l.types.length;D++)if("text/"===l.types[D].substring(0,5)){t=!0;break}for(D=0;D<l.items.length;D++){var I=l.items[D];if("file"===+I.kind){B=I.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[g],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",t,"file",[B],"editing",c.isEditing());var K=mxUtils.bind(this,function(){try{if(!t&&null!=B){if(c.isEditing())this.importFiles([B],0,0,this.maxImageSize,function(V,Q,ja,ea,da,ia){c.insertImage(V,da,ia)},function(){},function(V){return"image/"==V.type.substring(0,6)},function(V){for(var Q=0;Q<V.length;Q++)V[Q]()});+else{var M=this.editor.graph.getInsertPoint();this.importFiles([B],M.x,M.y,this.maxImageSize)}mxEvent.consume(g)}}catch(V){}});if(!mxEvent.isConsumed(g)&&!t)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(M){this.readTypeFromClipboardData(M,"image/svg+xml",mxUtils.bind(this,function(V){if(null!=V){V=new Blob([V],{type:"image/svg+xml"});var Q=this.editor.graph.getInsertPoint();this.importFiles([V],Q.x,Q.y,this.maxImageSize)}else K()}),"image")}))["catch"](K);+else K()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(g){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",g,"types",null!=g&&0<g.length?[JSON.stringify(g[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(g,mxUtils.bind(this,function(l,t){null!=l?c(l):this.readGraphModelFromImageClipboardData(g,mxUtils.bind(this,function(B,D,I){null!=B?c(B):this.readTypeFromClipboardData(g,"text/plain",mxUtils.bind(this,+function(K){c(K,D,I,t,g)}))}))}))}catch(l){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,g){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(l){var t=null,B=null;try{var D=this.parseHtmlData(l);if(null!=D){t="text/plain"!=D.getAttribute("data-type")?D.innerHTML:mxUtils.trim(null==D.innerText?mxUtils.getTextContent(D):D.innerText);try{var I=t.lastIndexOf("%3E");0<=I&&I<t.length-3&&(t=t.substring(0,I+3))}catch(V){}try{null==+t&&(l=null,""==D.textContent&&1==D.children.length&&"IMG"==D.firstChild.nodeName&&(l=D.firstChild.getAttribute("src")),null!=l&&0<l.length&&("data:image/png;base64,"==l.substring(0,22)?B=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==l.substring(0,26)&&(B=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/svg+xml"))))}catch(V){}try{var K=D.getElementsByTagName("span"),M=null!=K&&0<K.length?mxUtils.trim(decodeURIComponent(K[0].textContent)):decodeURIComponent(t);+this.isCompatibleString(M)&&(t=M)}catch(V){}}}catch(V){}g(this.isCompatibleString(t)?t:null,B)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,g){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(l,t){var B=null;try{null!=l&&(B=mxUtils.parseXml(l).documentElement.getAttribute("content"))}catch(D){}this.isCompatibleString(B)?g(B):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(D,I){B=Editor.extractGraphModelFromPng("data:image/png;base64,"++D);this.isCompatibleString(B)?g(B):g(null,t,I)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,g,l){var t=!1;if(null!=c&&0<c.length)for(var B=0;B<c.length&&!t;B++)(function(D){0<=mxUtils.indexOf(D.types,g)&&(t=!0,D.getType(g).then(mxUtils.bind(this,function(I){if("image/png"==g)I.arrayBuffer().then(function(K){l(btoa(Graph.arrayBufferToString(K)),I)})["catch"](function(){l(null)});else I.text().then(mxUtils.bind(this,function(K){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],+"data",[c],"type",[g],"result",[K]);l(K,I)}))["catch"](function(){l(null)})}))["catch"](function(){l(null)}))})(c[B]);t||l()};EditorUi.prototype.parseHtmlData=function(c){var g=null;if(null!=c&&0<c.length){var l="<meta "==c.substring(0,6);g=document.createElement("div");g.innerHTML=(l?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;l=g.getElementsByTagName("style");if(null!=l)for(;0<l.length;)l[0].parentNode.removeChild(l[0]);if(null!=g.firstChild&&g.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&+null!=g.firstChild.nextSibling&&g.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==g.firstChild.nodeName&&"A"==g.firstChild.nextSibling.nodeName&&null==g.firstChild.nextSibling.nextSibling){var t=null==g.firstChild.nextSibling.innerText?mxUtils.getTextContent(g.firstChild.nextSibling):g.firstChild.nextSibling.innerText;t==g.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(g,t),asHtml=!1)}if(""==g.textContent&&(l=g.getElementsByTagName("img"),1==l.length&&+(t=l[0].getAttribute("src"),l=null,null!=t))){if(Editor.isPngDataUrl(t)){var B=Editor.extractGraphModelFromPng(t);null!=B&&0<B.length&&(l=B)}else if("data:image/svg+xml;base64,"==t.substring(0,26)){img=this.base64ToBlob(t.substring(t.indexOf(",")+1),"image/svg+xml");t=Graph.getSvgFromDataUri(t);try{B=mxUtils.parseXml(t).documentElement.getAttribute("content"),this.isCompatibleString(B)&&(l=B)}catch(D){}}null!=l&&(mxUtils.setTextContent(g,l),asHtml=!1)}asHtml?Graph.removePasteFormatting(g):g.setAttribute("data-type",+"text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[g],"asHtml",asHtml);return g};EditorUi.prototype.showPrintDialog=function(c,g,l){var t=330;this.editor.graph.isEnabled()&&(t+=40);null!=this.pages&&1<this.pages.length&&(t+=40,this.editor.graph.isEnabled()||(t+=10));null==g||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(t+=20);this.showDialog((new PrintDialog(this,c,g,l)).container,320,t,!0,!0)};EditorUi.prototype.print=function(c,g){var l=this.editor,t=l.graph,+B=this.getPageIndex(this.currentPage),D=null!=B?B+1:1,I=mxUtils.bind(this,function(W,k,y,J){var R=W.useCssTransforms,X=W.currentTranslate,aa=W.currentScale,Z=W.view.translate,U=W.view.scale;W.useCssTransforms&&(W.useCssTransforms=!1,W.currentTranslate=new mxPoint(0,0),W.currentScale=1,W.view.translate=new mxPoint(0,0),W.view.scale=1);var ba=W.getGraphBounds(),fa=0,na=0,pa=mxRectangle.fromRectangle(W.pageFormat),ta=g.fit||g.crop||!W.pageVisible,ua=g.scale;pa.width=Math.ceil(pa.width*W.pageScale);pa.height=+Math.ceil(pa.height*W.pageScale);var Ca=1;if(g.fit){Ca=g.sheetsAcross;var Ba=g.sheetsDown;isNaN(ua)||(pa.width=Math.ceil(pa.width*ua),pa.height=Math.ceil(pa.height*ua));Ca=Math.min(pa.height*Ba/(ba.height/W.view.scale),pa.width*Ca/(ba.width/W.view.scale))}else Ca=isNaN(ua)?1:ua;Ca*=1;!ta&&W.pageVisible?(ua=W.getPageLayout(),fa-=ua.x*pa.width,na-=ua.y*pa.height):ta=!0;g.crop&&(g.selection&&(ba=t.getBoundingBox(t.getSelectionCells())),pa.width=(ba.width+1)*Ca/W.view.scale,pa.height=(ba.height+1)*Ca/+W.view.scale);pa.width=Math.ceil(1*pa.width);pa.height=Math.ceil(1*pa.height);J=null!=J?"page/id,"+J:null;if(null==k){k=PrintDialog.createPrintPreview(W,Ca,null,0,fa,na,ta);k.title=this.getBaseFilename(!0);k.pageSelector=!1;k.mathEnabled=!1;fa=g.border;isNaN(fa)||(k.pageMargin=fa);g.selection&&(k.isCellVisible=function(La){return W.isCellSelected(La)});var Aa=k.writeHead;k.writeHead=function(La,Pa){Pa=null!=Pa?Pa:"";g.shadows||(Pa+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');+mxClient.IS_GC&&(Pa+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=l.fontCss&&(Pa+=l.fontCss);Aa.apply(this,arguments);for(var db=W.getCustomFonts(),Ia=0;Ia<db.length;Ia++){var za=db[Ia].name,Ua=db[Ia].url;Graph.isCssFontUrl(Ua)?La.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Ua))+'" charset="UTF-8" type="text/css">'):(La.writeln('<style type="text/css">'),La.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(za)++'";\nsrc: url("'+mxUtils.htmlEntities(Ua)+'");\n}'),La.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Fa=k.drawBackgroundImage;k.drawBackgroundImage=function(La){Fa.apply(this,arguments);null!=La.node&&(EditorUi.embedSvgImages(La.node),t.disableSvgLinks(La.node,function(Pa){Pa.setAttribute("href","javascript:void(0)")}))}}var Sa=k.addGraphFragment;k.addGraphFragment=function(La,Pa,db,Ia,za,Ua){Sa.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:za.classList.add("geDisableMathJax");+if(this.graph.shadowVisible)for(var Qa=za.getElementsByTagName("svg"),Ma=0;Ma<Qa.length;Ma++)W.addSvgShadow(Qa[Ma])};g.grid&&(k.gridSize=W.gridSize,k.gridSteps=W.view.gridSteps,k.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:W.view.gridColor);k.open(null,null,y,!0,J,pa,g.selection?W.getSelectionCells():null)}else{ba=W.background;if(null==ba||""==ba||ba==mxConstants.NONE)ba="#ffffff";k.backgroundColor=ba;k.autoOrigin=ta;g.grid&&(k.gridSize=W.gridSize,k.gridSteps=W.view.gridSteps,+k.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:W.view.gridColor);k.appendGraph(W,Ca,fa,na,y,!0,J,pa,g.selection?W.getSelectionCells():null);y=W.getCustomFonts();if(null!=k.wnd)for(pa=0;pa<y.length;pa++)fa=y[pa].name,na=y[pa].url,Graph.isCssFontUrl(na)?k.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(na)+'" charset="UTF-8" type="text/css">'):(k.wnd.document.writeln('<style type="text/css">'),k.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(fa)++'";\nsrc: url("'+mxUtils.htmlEntities(na)+'");\n}'),k.wnd.document.writeln("</style>"))}R&&(W.useCssTransforms=R,W.currentTranslate=X,W.currentScale=aa,W.view.translate=Z,W.view.scale=U);return k}),K=g.pagesFrom,M=g.pagesTo,V=!g.allPages;B=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{V&&(V=g.selection||K==D&&M==D);if(!V&&null!=this.pages&&this.pages.length){V=0;D=this.pages.length-1;g.allPages||(V=parseInt(K)-1,D=parseInt(M)-1);for(var Q=V;Q<=D;Q++){var ja=this.pages[Q];K=+ja==this.currentPage?t:null;if(null==K){K=this.createTemporaryGraph(t.stylesheet);K.shapeForegroundColor=t.shapeForegroundColor;K.shapeBackgroundColor=t.shapeBackgroundColor;M=!0;var ea=V=!1,da=null,ia=null;null==ja.viewState&&null==ja.root&&this.updatePageRoot(ja);null!=ja.viewState&&(M=ja.viewState.pageVisible,V=ja.viewState.mathEnabled,ea=ja.viewState.shadowVisible,da=ja.viewState.background,ia=ja.viewState.backgroundImage,K.pageFormat=ja.viewState.pageFormat,K.gridSize=ja.viewState.gridSize);+null!=ia&&null!=ia.originalSrc&&(ia=this.createImageForPageLink(ia.originalSrc,ja));K.background=da;K.backgroundImage=null!=ia?new mxImage(ia.src,ia.width,ia.height,ia.x,ia.y):null;K.pageVisible=M;K.mathEnabled=V;K.shadowVisible=ea;var la=K.getGraphBounds;K.getGraphBounds=function(){var W=la.apply(this,arguments),k=this.backgroundImage;if(null!=k&&null!=k.width&&null!=k.height){var y=this.view.translate,J=this.view.scale;W=mxRectangle.fromRectangle(W);W.add(new mxRectangle((y.x+k.x)*J,(y.y+k.y)*J,+k.width*J,k.height*J))}return W};var ka=K.getGlobalVariable;K.getGlobalVariable=function(W){return"page"==W?ja.getName():"pagenumber"==W?Q+1:"pagecount"==W?null!=this.pages?this.pages.length:1:ka.apply(this,arguments)};document.body.appendChild(K.container);this.updatePageRoot(ja);K.model.setRoot(ja.root)}B=I(K,B,Q!=D,ja.getId());K!=t&&K.container.parentNode.removeChild(K.container)}}else B=I(t);null==B||null==B.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(B.mathEnabled&&+(I=B.wnd.document,c||(B.wnd.IMMEDIATE_PRINT=!0),I.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),B.closeDocument(),Graph.rewritePageLinks(B.wnd.document,!0),B.mathEnabled||c||PrintDialog.printPreview(B));return B}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var g=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(t){null!=g&&(g.parentNode.removeChild(g),g=null);t.stopPropagation();t.preventDefault()}),mxEvent.addListener(c[l],+"dragover",mxUtils.bind(this,function(t){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==g&&(g=this.highlightElement());t.stopPropagation();t.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(t){null!=g&&(g.parentNode.removeChild(g),g=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<t.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(t.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(t)&&+!mxEvent.isShiftDown(t)):this.openFiles(t.dataTransfer.files,!0);else{var B=this.extractGraphModelFromEvent(t);if(null==B){var D=null!=t.dataTransfer?t.dataTransfer:t.clipboardData;null!=D&&(10==document.documentMode||11==document.documentMode?B=D.getData("Text"):(B=null,B=0<=mxUtils.indexOf(D.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(D.types,"text/html")?D.getData("text/html"):null,null!=B&&0<B.length?(D=document.createElement("div"),D.innerHTML=Graph.sanitizeHtml(B),+D=D.getElementsByTagName("img"),0<D.length&&(B=D[0].getAttribute("src"))):0<=mxUtils.indexOf(D.types,"text/plain")&&(B=D.getData("text/plain"))),null!=B&&(Editor.isPngDataUrl(B)?(B=Editor.extractGraphModelFromPng(B),null!=B&&0<B.length&&this.openLocalFile(B,null,!0)):this.isRemoteFileFormat(B)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(B))).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(B)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(B):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(B)))))}else this.openLocalFile(B,null,!0)}t.stopPropagation();t.preventDefault()}))};+EditorUi.prototype.highlightElement=function(c){var g=0,l=0;if(null==c){var t=document.body;var B=document.documentElement;var D=(t.clientWidth||B.clientWidth)-3;t=Math.max(t.clientHeight||0,B.clientHeight)-3}else t=c.getBoundingClientRect(),g=t.top,l=t.left,D=t.width,t=t.height;B=document.createElement("div");B.style.zIndex=mxPopupMenu.prototype.zIndex+2;B.style.border="3px dotted rgb(254, 137, 12)";B.style.pointerEvents="none";B.style.position="absolute";B.style.top=g+"px";B.style.left=l+"px";B.style.width=+Math.max(0,D-3)+"px";B.style.height=Math.max(0,t-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(B):document.body.appendChild(B);return B};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var g=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=g){var l=new mxCodec(g.ownerDocument),t=new mxGraphModel;l.decode(g,t);g=t.getChildAt(t.getRoot(),0);for(l=0;l<t.getChildCount(g);l++)c.push(t.getChildAt(g,l))}return c};EditorUi.prototype.openFileHandle=+function(c,g,l,t,B,D){if(null!=g&&0<g.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(g)||/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var I=mxUtils.bind(this,function(M){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==M.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,M,g)),+this.showSidebar()}catch(V){this.handleError(V,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(M,g,t)});if(EditorUi.isVisioFilename(g))this.importVisio(l,mxUtils.bind(this,function(M){this.spinner.stop();I(M)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(M){this.spinner.stop();I(M)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),+mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(M){4==M.readyState&&(this.spinner.stop(),200<=M.status&&299>=M.status?I(M.responseText):this.handleError({message:mxResources.get(413==M.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(M){this.spinner.stop();this.openLocalFile(M,g,t)}),+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,t);try{this.loadLibrary(new LocalLibrary(this,c,l.name)),this.showSidebar()}catch(M){this.handleError(M,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(M){this.spinner.stop();I(M)}),mxUtils.bind(this,+function(){this.spinner.stop();this.openLocalFile(c,g,t)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var K=Editor.extractGraphModelFromPdf(c);null!=K&&(B=null,t=!0,c=K)}this.spinner.stop();this.openLocalFile(c,g,t,B,null!=B?l:null,D)}}};EditorUi.prototype.openFiles=function(c,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=0;l<c.length;l++)mxUtils.bind(this,function(t){var B=new FileReader;B.onload=+mxUtils.bind(this,function(D){try{this.openFileHandle(D.target.result,t.name,t,g)}catch(I){this.handleError(I)}});B.onerror=mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?B.readAsText(t):B.readAsDataURL(t)})(c[l])};EditorUi.prototype.openLocalFile=function(c,g,l,t,B,D){var I=this.getCurrentFile(),K=mxUtils.bind(this,function(){window.openFile=null;if(null==+g&&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,g||this.defaultFilename,l,t,B,D))});if(null!=c&&0<c.length)null==I||!I.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?K():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&null!=I&&I.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,g),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=I&&I.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 g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),+this.addBasenamesForCell(this.pages[g].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);g=[];for(var l in c)g.push(l);return g};EditorUi.prototype.addBasenamesForCell=function(c,g){function l(I){if(null!=I){var K=I.lastIndexOf(".");0<K&&(I=I.substring(K+1,I.length));null==g[I]&&(g[I]=!0)}}var t=this.editor.graph,B=t.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(B[mxConstants.STYLE_SHAPE]));t.model.isEdge(c)&&(l(mxMarker.getPackageForType(B[mxConstants.STYLE_STARTARROW])),l(mxMarker.getPackageForType(B[mxConstants.STYLE_ENDARROW])));B=t.model.getChildCount(c);for(var D=0;D<B;D++)this.addBasenamesForCell(t.model.getChildAt(c,D),g)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||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(g,l,t,B){c||(c=!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);Editor.fitDiagramOnLoad&&this.initialFitDiagram();if(B)try{var D=this.editor.graph;D.setGridEnabled(!1);D.pageVisible=!1;var I=D.model.cells,L;for(L in I){var N=I[L];null!=N&&null!=N.style&&(N.style+=";sketch=1;"+(-1==N.style.indexOf("fontFamily=")||-1<N.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||this.noAutoFocus||window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&+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);Editor.fitDiagramOnLoad&&this.initialFitDiagram();if(B)try{var D=this.editor.graph;D.setGridEnabled(!1);D.pageVisible=!1;var I=D.model.cells,K;for(K in I){var M=I[K];null!=M&&null!=M.style&&(M.style+=";sketch=1;"+(-1==M.style.indexOf("fontFamily=")||-1<M.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":+""))}}catch(V){console.log(V)}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||this.noAutoFocus||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,g){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(l){this.spinner.stop();g(l)})):g(null)};EditorUi.prototype.createLoadMessage=function(c){var g=this.editor.graph,l=g.getGraphBounds(),t=g.view.scale,B=g.view.translate;return{event:c,pageVisible:g.pageVisible,translate:B,bounds:l,currentPage:this.getSelectedPageIndex(),scale:t,page:g.view.getBackgroundPageBounds(),modelBounds:{x:l.x/t-B.x,y:l.y/t-B.y,width:l.width/t,height:l.height/t},containerSize:{width:g.container.clientWidth,height:g.container.clientHeight,offsetWidth:g.container.offsetWidth,offsetHeight:g.container.offsetHeight}}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var g=this.editor.graph;g.isEditing()&&g.stopEditing(!g.isInvokesStopCellEditing());var l=this.embedMessageSource||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(B){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(B)}),"*")}),null,null,!0,t,1,this.embedExportBorder,null,this.embedExportTheme)}else c||l.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),-"*");c||(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(B){c||this.handleError(B)}};EditorUi.prototype.installMessageHandler=function(c){var g=null,l=!1,t=!1,B=null,D=mxUtils.bind(this,function(N,K){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,-function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,D);mxEvent.addListener(window,"message",mxUtils.bind(this,function(N){if(N.source==(this.embedMessageSource||window.opener||window.parent)){var K=N.data,da=null,ja=mxUtils.bind(this,function(oa){if(null!=oa&&"function"===typeof oa.charAt&&"<"!=oa.charAt(0))try{Editor.isPngDataUrl(oa)?oa=Editor.extractGraphModelFromPng(oa):"data:image/svg+xml;base64,"==-oa.substring(0,26)?oa=atob(oa.substring(26)):"data:image/svg+xml;utf8,"==oa.substring(0,24)&&(oa=oa.substring(24)),null!=oa&&(""==oa.trim()?oa=null:"%"==oa.charAt(0)?oa=decodeURIComponent(oa):"<"!=oa.charAt(0)&&(oa=Graph.decompress(oa)))}catch(Da){}return oa});if("json"==urlParams.proto){var ea=!1;try{K=JSON.parse(K),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[N],"data",[K])}catch(oa){K=null}try{var ca=K;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 fa=new FilenameDialog(this,K.defaultValue||"",null!=K.okKey?mxResources.get(K.okKey):K.ok,function(oa){null!=oa?I.postMessage(JSON.stringify({event:"prompt",-value:oa,message:K}),"*"):I.postMessage(JSON.stringify({event:"prompt-cancel",message:K}),"*")},null!=K.titleKey?mxResources.get(K.titleKey):K.title,null,null,null,null,function(){I.postMessage(JSON.stringify({event:"prompt-cancel",message:K}),"*")});this.showDialog(fa.container,300,80,!0,!1);fa.init();return}if("draft"==K.action){var la=ja(K.xml);this.spinner.stop();fa=new DraftDialog(this,mxResources.get("draftFound",[K.name||this.defaultFilename]),la,mxUtils.bind(this,function(){this.hideDialog();-I.postMessage(JSON.stringify({event:"draft",result:"edit",message:K}),"*")}),mxUtils.bind(this,function(){this.hideDialog();I.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();I.postMessage(JSON.stringify({event:"draft",result:"ignore",message:K}),"*")}):null);this.showDialog(fa.container,640,480,!0,!1,mxUtils.bind(this,function(oa){oa&&-this.actions.get("exit").funct()}));try{fa.init()}catch(oa){I.postMessage(JSON.stringify({event:"draft",error:oa.toString(),message:K}),"*")}return}if("template"==K.action){this.spinner.stop();var ka=1==K.enableRecent,V=1==K.enableSearch,k=1==K.enableCustomTemp;fa=new NewDialog(this,!1,K.templatesOnly?!1:null!=K.callback,mxUtils.bind(this,function(oa,Da,Ca,Ja){oa=oa||this.emptyDiagramXml;null!=K.callback?I.postMessage(JSON.stringify({event:"template",xml:oa,blank:oa==this.emptyDiagramXml,name:Da,-tempUrl:Ca,libs:Ja,builtIn:!0,message:K}),"*"):(c(oa,N,oa!=this.emptyDiagramXml,K.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,ka?mxUtils.bind(this,function(oa){this.remoteInvoke("getRecentDiagrams",[null],null,oa,function(){oa(null,"Network Error!")})}):null,V?mxUtils.bind(this,function(oa,Da){this.remoteInvoke("searchDiagrams",[oa,null],null,Da,function(){Da(null,"Network Error!")})}):null,mxUtils.bind(this,function(oa,Da,Ca){I.postMessage(JSON.stringify({event:"template",-docUrl:oa,info:Da,name:Ca}),"*")}),null,null,k?mxUtils.bind(this,function(oa){this.remoteInvoke("getCustomTemplates",null,null,oa,function(){oa({},0)})}):null,1==K.withoutType,null,K.templatesOnly);this.showDialog(fa.container,620,460,!0,!1,mxUtils.bind(this,function(oa){null!=this.sidebar&&this.sidebar.hideTooltip();oa&&!K.noExitOnCancel&&this.actions.get("exit").funct()}));fa.init();return}if("textContent"==K.action){var x=this.getDiagramTextContent();I.postMessage(JSON.stringify({event:"textContent",-data:x,message:K}),"*");return}if("status"==K.action){this.updateStatus(mxUtils.bind(this,function(){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 J=null!=K.messageKey?mxResources.get(K.messageKey):K.message;null==K.show||K.show?this.spinner.spin(document.body,J):this.spinner.stop();return}if("exit"==-K.action){this.actions.get("exit").funct();return}if("viewport"==K.action){if(null!=K.viewport){var R=this.editor.graph,Y=R.view.translate.x,Z=R.view.translate.y;this.embedViewport=K.viewport;R.refresh();this.diagramContainer.scrollTop-=(Z-R.view.translate.y)*R.view.scale;this.diagramContainer.scrollLeft-=(Y-R.view.translate.x)*R.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==K.action){var W=this.actions.get(K.actionName);null!=W&&W.funct();return}if("resetEditor"==-K.action){R=this.editor.graph;R.isEditing()&&R.stopEditing(!1);this.hideCurrentMenu();R.popupMenuHandler.hideMenu();R.clearSelection();return}if("fit"==K.action){R=this.editor.graph;var U=R.maxFitScale;R.maxFitScale=null!=K.maxScale?K.maxScale:1;R.fit(null!=K.border?K.border:16,null,null,null,null,!0);R.maxFitScale=U;J=this.createLoadMessage("fit");J.message=K;I.postMessage(JSON.stringify(J),"*");return}if("fullscreenChanged"==K.action){fa=null;try{var aa=this.diagramContainer.getAttribute("data-scrollState");-null!=aa&&(this.diagramContainer.removeAttribute("data-scrollState"),fa=JSON.parse(aa))}catch(oa){}Editor.inlineFullscreen=K.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=fa&&this.restoreScrollState(fa);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 ia=null!=K.xml?K.xml:-this.getFileData(!0);this.editor.graph.setEnabled(!1);R=this.editor.graph;var na=mxUtils.bind(this,function(oa,Da){if(K.withSvg)K.withSvg=!1,this.getEmbeddedSvg(ia,this.editor.graph,null,!0,function(Ja){na(oa,Ja)},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 Ca=this.createLoadMessage("export");Ca.format=K.format;Ca.message=ca;Ca.data=oa;Ca.svg=Da;Ca.xml=ia;I.postMessage(JSON.stringify(Ca),"*")}}),-qa=mxUtils.bind(this,function(oa){null==oa&&(oa=Editor.blankImage);"xmlpng"==K.format&&(oa=Editor.writeGraphModelToPng(oa,"tEXt","mxfile",encodeURIComponent(ia)));R!=this.editor.graph&&R.container.parentNode.removeChild(R.container);na(oa)}),ta=K.pageId||(null!=this.pages?K.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ua=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=ta){var oa=R.getGlobalVariable;R=this.createTemporaryGraph(R.getStylesheet());-for(var Da,Ca=0;Ca<this.pages.length;Ca++)if(this.pages[Ca].getId()==ta){Da=this.updatePageRoot(this.pages[Ca]);break}null==Da&&(Da=this.currentPage);R.getGlobalVariable=function(y){return"page"==y?Da.getName():"pagenumber"==y?1:oa.apply(this,arguments)};document.body.appendChild(R.container);R.model.setRoot(Da.root)}if(null!=K.layerIds){var Ja=R.model,Xa=Ja.getChildCells(Ja.getRoot()),ib={};for(Ca=0;Ca<K.layerIds.length;Ca++)ib[K.layerIds[Ca]]=!0;for(Ca=0;Ca<Xa.length;Ca++)Ja.setVisible(Xa[Ca],ib[Xa[Ca].id]||-!1)}Ca=null;K.keepTheme&&(Ca=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(y){qa(y.toDataURL("image/png"))}),K.width,null,K.background,mxUtils.bind(this,function(){qa(null)}),null,null,K.scale,K.transparent,K.shadow,null,R,K.border,null,K.grid,Ca,K.size)});null!=K.xml&&0<K.xml.length&&(l=!0,this.setFileData(ia),l=!1);ua()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==K.format?"1":"0")+(null!=ta?"&pageId="+ta:"")+(null!=K.layerIds&&0<-K.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:K.layerIds})):"")+(null!=K.scale?"&scale="+K.scale:"")+"&base64=1&xml="+encodeURIComponent(ia))).send(mxUtils.bind(this,function(oa){200<=oa.getStatus()&&299>=oa.getStatus()?na("data:image/png;base64,"+oa.getText()):qa(null)}),mxUtils.bind(this,function(){qa(null)}))}}else if(ua=mxUtils.bind(this,function(){var oa=this.createLoadMessage("export");oa.message=K;if("html2"==K.format||"html"==K.format&&("0"!=urlParams.pages||null!=-this.pages&&1<this.pages.length)){var Da=this.getXmlFileData();oa.xml=mxUtils.getXml(Da);oa.data=this.getFileData(null,null,!0,null,null,null,Da);oa.format=K.format}else if("html"==K.format)Da=this.editor.getGraphXml(),oa.data=this.getHtml(Da,this.editor.graph),oa.xml=mxUtils.getXml(Da),oa.format=K.format;else{if("xml"==K.format)oa.xml=this.getFileData(!0),oa.format=K.format,I.postMessage(JSON.stringify(oa),"*");else{mxSvgCanvas2D.prototype.foAltText=null;Da=null!=K.background?K.background:this.editor.graph.background;-Da==mxConstants.NONE&&(Da=null);oa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);oa.format="svg";var Ca=mxUtils.bind(this,function(Xa){this.editor.graph.setEnabled(!0);this.spinner.stop();oa.data=K.asText?Xa:Editor.createSvgDataUri(Xa);I.postMessage(JSON.stringify(oa),"*")}),Ja="auto";K.keepTheme&&(Ja=Editor.isDarkMode()?"dark":"light");null!=K.theme&&(Ja=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)){Ja=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ja="auto";null!=K.theme&&(Ja=K.theme);this.getEmbeddedSvg(oa.xml,this.editor.graph,null,!0,Ca,null,null,K.embedImages,Da,K.scale,K.border,K.shadow,Ja)}}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),Da=this.editor.graph.getSvg(Da,K.scale,K.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||K.shadow,null,Ja),(this.editor.graph.shadowVisible||-K.shadow)&&this.editor.graph.addSvgShadow(Da),this.embedFonts(Da,mxUtils.bind(this,function(Xa){K.embedImages||null==K.embedImages?this.editor.convertImages(Xa,mxUtils.bind(this,function(ib){Ca(mxUtils.getXml(ib))})):Ca(mxUtils.getXml(Xa))}))}return}I.postMessage(JSON.stringify(oa),"*")}),null!=K.xml&&0<K.xml.length){if(this.editor.graph.mathEnabled){var Ba=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){Ba.apply(this,arguments);ua()}}l=!0;this.setFileData(K.xml);l=!1;this.editor.graph.mathEnabled||-ua()}else ua();return}if("load"==K.action){ea=K.toSketch;t=1==K.autosave;var za=K.sourceMetadata||null;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+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=K.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=K.noSaveBtn);if(null!=K.rough){var Aa=Editor.sketchMode;this.doSetSketchMode(K.rough);Aa!=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.scale){var Ga=K.scale,Ra=null!=K.scaleBorder?K.scaleBorder:this.embedExportBorder||0,Ha=null!=K.border?K.border:0;da=mxUtils.bind(this,function(){var oa=this.editor.graph,Da=oa.getGraphBounds();if(0<Da.width&&0<Da.height){var Ca=oa.view.scale;oa.view.scaleAndTranslate(Ga,oa.view.translate.x+Ha-Da.x/Ca+Ra/Ga,oa.view.translate.y+Ha-Da.y/Ca+Ra/Ga)}})}else if(null!=K.fit){var Qa=-null!=K.border?K.border:0,eb=K.maxFitScale||1;da=mxUtils.bind(this,function(){var oa=this.editor.graph,Da=oa.maxFitScale;oa.maxFitScale=eb;oa.fit(Qa,null,null,null,null,!0);oa.maxFitScale=Da})}if(null!=K.rect){Ha=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 Ma=K.maxFitScale,ya=K.rect.width+2*Ha,Sa=K.rect.height+2*Ha;da=mxUtils.bind(this,function(){var oa=mxUtils.getDocumentSize();ya=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ya):ya,oa.width-80);oa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Sa):Sa,oa.height-80);this.diagramContainer.style.width=ya+"px";this.diagramContainer.style.height=oa+"px";var Da=this.editor.graph;oa=Da.maxFitScale;Da.maxFitScale=Ma;Da.fit(2*-Ha,null,null,null,null,null,Sa);this.setPageVisible(!1);if(null!=this.minInlineWidth&&Da.getGraphBounds().width<this.minInlineWidth){var Ca=Da.container.scrollTop;this.resetScrollbars();Da.container.scrollTop=Ca}Da.maxFitScale=oa;Da.container.scrollTop-=Ha;Da.container.scrollLeft-=Ha;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[K]));Da.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&-(this.formatWindow.window.div.style.top=Da.container.style.top);var Ja=Da.getGraphBounds();Da.container.clientWidth>Ja.width+2*Ha&&(Da.container.scrollLeft=Ja.x+(Ja.width+Ha-Da.container.clientWidth)/2)}),10)})}null!=K.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=K.noExitBtn);null!=K.title&&null!=this.buttonContainer&&this.setEmbedTitle(K.title);try{K.libs&&this.sidebar.showEntries(K.libs)}catch(oa){}if(null!=K.xmlpng)K=this.extractGraphModelFromPng(K.xmlpng);else if(null!=K.descriptor){if(K=-K.descriptor,"mermaid"==K.format){window.isMermaidEnabled?this.parseMermaidDiagram(K.data,null,mxUtils.bind(this,function(oa){c(oa,N,null,ea);oa=this.createLoadMessage("load");oa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);oa.message=ca;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(oa),"*");if(null!=za&&null!=za.key&&null!=za.value){oa=this.editor.graph;var Da=oa.getModel().getRoot();if(null!=Da){oa.getModel().beginUpdate();try{oa.setAttributeForCell(Da,-za.key,za.value)}finally{oa.getModel().endUpdate()}}}}),mxUtils.bind(this,function(oa){this.handleError(oa)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else K=K.xml}else{if("merge"==K.action){var Oa=this.getCurrentFile();null!=Oa&&(la=ja(K.xml),null!=la&&""!=la&&Oa.mergeFile(new LocalFile(this,la),function(){I.postMessage(JSON.stringify({event:"merge",message:K}),"*")},function(oa){I.postMessage(JSON.stringify({event:"merge",-message:K,error:oa}),"*")}))}else"remoteInvokeReady"==K.action?this.handleRemoteInvokeReady(I):"remoteInvoke"==K.action?this.handleRemoteInvoke(K,N.origin):"remoteInvokeResponse"==K.action?this.handleRemoteInvokeResponse(K):I.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(K)}),"*");return}}catch(oa){this.handleError(oa)}}var Na=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),-Pa=mxUtils.bind(this,function(oa,Da){l=!0;try{c(oa,Da,null,ea)}catch(Ca){this.handleError(Ca)}l=!1;null!=urlParams.modified&&this.clearStatus();B=Na();t&&null==g&&(g=mxUtils.bind(this,function(Ca,Ja){Ca=Na();Ca==B||l||(Ja=this.createLoadMessage("autosave"),Ja.xml=Ca,Ja.message=ca,(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Ja),"*"));B=Ca}),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));null!=da&&da();if("1"==urlParams.returnbounds||"json"==urlParams.proto)Da=this.createLoadMessage("load"),Da.xml=oa,I.postMessage(JSON.stringify(Da),-"*")});null!=K&&"function"===typeof K.substring&&"data:application/vnd.visio;base64,"==K.substring(0,34)?(ja="0M8R4KGxGuE"==K.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(oa){Pa(oa,N)},mxUtils.bind(this,function(oa){this.handleError(oa)}),ja)):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(oa){4==oa.readyState&&(200<=oa.status&&299>=oa.status&&"<mxGraphModel"==oa.responseText.substring(0,13)?Pa(oa.responseText,N):this.handleError({message:413==oa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=K&&"function"===typeof K.substring&&this.isLucidChartData(K)?this.convertLucidChart(K,mxUtils.bind(this,function(oa){Pa(oa)}),mxUtils.bind(this,function(oa){this.handleError(oa)})):null==K||"object"!==typeof K||-null==K.format||null==K.data&&null==K.url?(K=ja(K),Pa(K,N)):this.loadDescriptor(K,mxUtils.bind(this,function(oa){Pa(Na(),N)}),mxUtils.bind(this,function(oa){this.handleError(oa,mxResources.get("errorLoadingFile"))}))}}));var I=this.embedMessageSource||window.opener||window.parent;D="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";I.postMessage(D,"*");if("json"==urlParams.proto){var L=this.editor.graph.openLink;this.editor.graph.openLink=function(N,K,da){L.apply(this,-arguments);I.postMessage(JSON.stringify({event:"openLink",href:N,target:K,allowOpener:da}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,g,l,t){var B=document.createElement("button");B.className="geEmbedBtn geBtn";B.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(B,c);t&&B.classList.add("gePrimaryBtn");mxEvent.addListener(B,"click",g);return B};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);-"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);-"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==-urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,-mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var g=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var t=JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(t));-this.customLayoutConfig=t;this.hideDialog()}catch(B){this.handleError(B)}}),null,null,null,null,mxUtils.bind(this,function(l,t){var B=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var D=t.value;t.value=JSON.stringify(JSON.parse(D));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=D}catch(I){this.handleError(I)}}));B.setAttribute("title",-"copy");B.className="geBtn";l.appendChild(B)}),!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(c,g){this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),B=mxUtils.bind(this,function(D){this.loadingOrgChart=!1;l.clear()&&this.handleError(D)});-if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))t();else if(g||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",t,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",t,null,null,null,B)}),onerror)};EditorUi.prototype.importCsv=function(c,g,l,t){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,g,l)}),t)};EditorUi.prototype.doImportCsv=function(c,g,l){try{var t=c.split("\n"),B=[],D=[],I=[],L={};if(0<t.length){var N={};l=null!=l?l:this.editor.graph;var K=null,da=null,ja=null,ea=null,ca=null,fa=null,la=null,ka="whiteSpace=wrap;html=1;",V=null,k=null,x="",J="auto",R="auto",Y=!1,Z=null,W=null,U=40,aa=40,ia=100,na=0,qa=mxUtils.bind(this,-function(){null!=g?g(ba):(l.setSelectionCells(ba),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ta=l.getFreeInsertPoint(),ua=ta.x,Ba=ta.y;ta=Ba;var za=null,Aa="auto";k=null;for(var Ga=[],Ra=null,Ha=null,Qa=0;Qa<t.length&&"#"==t[Qa].charAt(0);){c=t[Qa].replace(/\r$/,"");for(Qa++;Qa<t.length&&"\\"==c.charAt(c.length-1)&&"#"==t[Qa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(t[Qa].substring(1)),-Qa++;if("#"!=c.charAt(1)){var eb=c.indexOf(":");if(0<eb){var Ma=mxUtils.trim(c.substring(1,eb)),ya=mxUtils.trim(c.substring(eb+1));"label"==Ma?za=Graph.sanitizeHtml(ya):"labelname"==Ma&&0<ya.length&&"-"!=ya?ca=ya:"labels"==Ma&&0<ya.length&&"-"!=ya?la=JSON.parse(ya):"style"==Ma?da=ya:"parentstyle"==Ma?ka=ya:"unknownStyle"==Ma&&"-"!=ya?fa=ya:"stylename"==Ma&&0<ya.length&&"-"!=ya?ea=ya:"styles"==Ma&&0<ya.length&&"-"!=ya?ja=JSON.parse(ya):"vars"==Ma&&0<ya.length&&"-"!=ya?K=JSON.parse(ya):"identity"==-Ma&&0<ya.length&&"-"!=ya?V=ya:"parent"==Ma&&0<ya.length&&"-"!=ya?k=ya:"namespace"==Ma&&0<ya.length&&"-"!=ya?x=ya:"width"==Ma?J=ya:"height"==Ma?R=ya:"collapsed"==Ma&&"-"!=ya?Y="true"==ya:"left"==Ma&&0<ya.length?Z=ya:"top"==Ma&&0<ya.length?W=ya:"ignore"==Ma?Ha=ya.split(","):"connect"==Ma?Ga.push(JSON.parse(ya)):"link"==Ma?Ra=ya:"padding"==Ma?na=parseFloat(ya):"edgespacing"==Ma?U=parseFloat(ya):"nodespacing"==Ma?aa=parseFloat(ya):"levelspacing"==Ma?ia=parseFloat(ya):"layout"==Ma&&(Aa=ya)}}}if(null==-t[Qa])throw Error(mxResources.get("invalidOrMissingFile"));var Sa=this.editor.csvToArray(t[Qa].replace(/\r$/,""));eb=c=null;Ma=[];for(ya=0;ya<Sa.length;ya++)V==Sa[ya]&&(c=ya),k==Sa[ya]&&(eb=ya),Ma.push(mxUtils.trim(Sa[ya]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==za&&(za="%"+Ma[0]+"%");if(null!=Ga)for(var Oa=0;Oa<Ga.length;Oa++)null==N[Ga[Oa].to]&&(N[Ga[Oa].to]={});V=[];for(ya=Qa+1;ya<t.length;ya++){var Na=this.editor.csvToArray(t[ya].replace(/\r$/,""));if(null==Na){var Pa=-40<t[ya].length?t[ya].substring(0,40)+"...":t[ya];throw Error(Pa+" ("+ya+"):\n"+mxResources.get("containsValidationErrors"));}0<Na.length&&V.push(Na)}l.model.beginUpdate();try{for(ya=0;ya<V.length;ya++){Na=V[ya];var oa=null,Da=null!=c?x+Na[c]:null;t=!1;null!=Da&&(oa=l.model.getCell(Da),t=null==oa||0<=mxUtils.indexOf(B,oa));var Ca=new mxCell(za,new mxGeometry(ua,ta,0,0),da||"whiteSpace=wrap;html=1;");Ca.collapsed=Y;Ca.vertex=!0;Ca.id=Da;null==oa||t||l.model.setCollapsed(oa,Y);for(var Ja=0;Ja<Na.length;Ja++)l.setAttributeForCell(Ca,-Ma[Ja],Na[Ja]),null==oa||t||l.setAttributeForCell(oa,Ma[Ja],Na[Ja]);if(null!=ca&&null!=la){var Xa=la[Ca.getAttribute(ca)];null!=Xa&&(l.labelChanged(Ca,Xa),null==oa||t||l.cellLabelChanged(oa,Xa))}if(null!=ea&&null!=ja){var ib=ja[Ca.getAttribute(ea)];null!=ib&&(Ca.style=ib)}l.setAttributeForCell(Ca,"placeholders","1");Ca.style=l.replacePlaceholders(Ca,Ca.style,K);null==oa||t?l.fireEvent(new mxEventObject("cellsInserted","cells",[Ca])):(l.model.setStyle(oa,Ca.style),0>mxUtils.indexOf(I,oa)&&I.push(oa),-l.fireEvent(new mxEventObject("cellsInserted","cells",[oa])));t=null!=oa;oa=Ca;if(!t)for(Oa=0;Oa<Ga.length;Oa++)N[Ga[Oa].to][oa.getAttribute(Ga[Oa].to)]=oa;null!=Ra&&"link"!=Ra&&(l.setLinkForCell(oa,oa.getAttribute(Ra)),l.setAttributeForCell(oa,Ra,null));var y=l.getPreferredSizeForCell(oa);k=null!=eb?l.model.getCell(x+Na[eb]):null;if(oa.vertex){Pa=null!=k?0:ua;Qa=null!=k?0:Ba;null!=Z&&null!=oa.getAttribute(Z)&&(oa.geometry.x=Pa+parseFloat(oa.getAttribute(Z)));null!=W&&null!=oa.getAttribute(W)&&(oa.geometry.y=-Qa+parseFloat(oa.getAttribute(W)));var P="@"==J.charAt(0)?oa.getAttribute(J.substring(1)):null;oa.geometry.width=null!=P&&"auto"!=P?parseFloat(oa.getAttribute(J.substring(1))):"auto"==J||"auto"==P?y.width+na:parseFloat(J);var S="@"==R.charAt(0)?oa.getAttribute(R.substring(1)):null;oa.geometry.height=null!=S&&"auto"!=S&&"width"!=R?parseFloat(S):"auto"==R||"auto"==S?y.height+na:"width"==R?oa.geometry.width:parseFloat(R);ta+=oa.geometry.height+aa}t?(null==L[Da]&&(L[Da]=[]),L[Da].push(oa)):(B.push(oa),-null!=k?(k.style=l.replacePlaceholders(k,ka,K),l.addCell(oa,k),D.push(k)):I.push(l.addCell(oa)))}for(ya=0;ya<D.length;ya++)P="@"==J.charAt(0)?D[ya].getAttribute(J.substring(1)):null,S="@"==R.charAt(0)?D[ya].getAttribute(R.substring(1)):null,"auto"!=J&&"auto"!=P||"auto"!=R&&"auto"!=S||l.updateGroupBounds([D[ya]],na,!0);var X=I.slice(),ba=I.slice();for(Oa=0;Oa<Ga.length;Oa++){var ma=Ga[Oa];for(ya=0;ya<B.length;ya++){oa=B[ya];var ra=mxUtils.bind(this,function(gb,bb,db){var lb=bb.getAttribute(db.from);-if(null!=lb&&""!=lb){lb=lb.split(",");for(var ub=0;ub<lb.length;ub++){var ob=N[db.to][lb[ub]];if(null==ob&&null!=fa){ob=new mxCell(lb[ub],new mxGeometry(ua,Ba,0,0),fa);ob.style=l.replacePlaceholders(bb,ob.style,K);var pb=l.getPreferredSizeForCell(ob);ob.geometry.width=pb.width+na;ob.geometry.height=pb.height+na;N[db.to][lb[ub]]=ob;ob.vertex=!0;ob.id=lb[ub];I.push(l.addCell(ob))}if(null!=ob){pb=db.label;null!=db.fromlabel&&(pb=(bb.getAttribute(db.fromlabel)||"")+(pb||""));null!=db.sourcelabel&&(pb=-l.replacePlaceholders(bb,db.sourcelabel,K)+(pb||""));null!=db.tolabel&&(pb=(pb||"")+(ob.getAttribute(db.tolabel)||""));null!=db.targetlabel&&(pb=(pb||"")+l.replacePlaceholders(ob,db.targetlabel,K));var sb="target"==db.placeholders==!db.invert?ob:gb;sb=null!=db.style?l.replacePlaceholders(sb,db.style,K):l.createCurrentEdgeStyle();pb=l.insertEdge(null,null,pb||"",db.invert?ob:gb,db.invert?gb:ob,sb);if(null!=db.labels)for(sb=0;sb<db.labels.length;sb++){var rb=db.labels[sb],tb=new mxCell(rb.label||sb,-new mxGeometry(null!=rb.x?rb.x:0,null!=rb.y?rb.y:0,0,0),"resizable=0;html=1;");tb.vertex=!0;tb.connectable=!1;tb.geometry.relative=!0;null!=rb.placeholders&&(tb.value=l.replacePlaceholders("target"==rb.placeholders==!db.invert?ob:gb,tb.value,K));if(null!=rb.dx||null!=rb.dy)tb.geometry.offset=new mxPoint(null!=rb.dx?rb.dx:0,null!=rb.dy?rb.dy:0);pb.insert(tb)}if(null!=db.data)for(var yb in db.data)l.setAttributeForCell(pb,yb,db.data[yb]);ba.push(pb);mxUtils.remove(db.invert?gb:ob,X)}}}});ra(oa,oa,ma);-if(null!=L[oa.id])for(Ja=0;Ja<L[oa.id].length;Ja++)ra(oa,L[oa.id][Ja],ma)}}if(null!=Ha)for(ya=0;ya<B.length;ya++)for(oa=B[ya],Ja=0;Ja<Ha.length;Ja++)l.setAttributeForCell(oa,mxUtils.trim(Ha[Ja]),null);if(0<I.length){var wa=new mxParallelEdgeLayout(l);wa.spacing=U;wa.checkOverlap=!0;var sa=function(){0<wa.spacing&&wa.execute(l.getDefaultParent());for(var gb=0;gb<I.length;gb++){var bb=l.getCellGeometry(I[gb]);bb.x=Math.round(l.snap(bb.x));bb.y=Math.round(l.snap(bb.y));"auto"==J&&(bb.width=Math.round(l.snap(bb.width)));-"auto"==R&&(bb.height=Math.round(l.snap(bb.height)))}};if("["==Aa.charAt(0)){var xa=qa;l.view.validate();this.executeLayouts(l.createLayouts(JSON.parse(Aa)),function(){sa();xa()});qa=null}else if("circle"==Aa){var Fa=new mxCircleLayout(l);Fa.disableEdgeStyle=!1;Fa.resetEdges=!1;var Ya=Fa.isVertexIgnored;Fa.isVertexIgnored=function(gb){return Ya.apply(this,arguments)||0>mxUtils.indexOf(I,gb)};this.executeLayout(function(){Fa.execute(l.getDefaultParent());sa()},!0,qa);qa=null}else if("horizontaltree"==-Aa||"verticaltree"==Aa||"auto"==Aa&&ba.length==2*I.length-1&&1==X.length){l.view.validate();var Ua=new mxCompactTreeLayout(l,"horizontaltree"==Aa);Ua.levelDistance=aa;Ua.edgeRouting=!1;Ua.resetEdges=!1;Ua.sortEdges=!0;this.executeLayout(function(){Ua.execute(l.getDefaultParent(),0<X.length?X[0]:null)},!0,qa);qa=null}else if("horizontalflow"==Aa||"verticalflow"==Aa||"auto"==Aa&&1==X.length){l.view.validate();var cb=new mxHierarchicalLayout(l,"horizontalflow"==Aa?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);-cb.intraCellSpacing=aa;cb.parallelEdgeSpacing=U;cb.interRankCellSpacing=ia;cb.disableEdgeStyle=!1;this.executeLayout(function(){cb.execute(l.getDefaultParent(),ba);l.moveCells(ba,ua,Ba)},!0,qa);qa=null}else if("orgchart"==Aa){l.view.validate();var hb=new mxOrgChartLayout(l,2,ia,aa),jb=hb.isVertexIgnored;hb.isVertexIgnored=function(gb){return jb.apply(this,arguments)||0>mxUtils.indexOf(I,gb)};this.executeLayout(function(){hb.execute(l.getDefaultParent());sa()},!0,qa);qa=null}else if("organic"==Aa||-"auto"==Aa&&ba.length>I.length){l.view.validate();var Ta=new mxFastOrganicLayout(l);Ta.forceConstant=3*aa;Ta.disableEdgeStyle=!1;Ta.resetEdges=!1;var qb=Ta.isVertexIgnored;Ta.isVertexIgnored=function(gb){return qb.apply(this,arguments)||0>mxUtils.indexOf(I,gb)};this.executeLayout(function(){Ta.execute(l.getDefaultParent());sa()},!0,qa);qa=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=qa&&qa()}}catch(gb){this.handleError(gb)}};EditorUi.prototype.getSearch=function(c){var g="";if("1"!=urlParams.offline&&-"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",t;for(t in urlParams)0>mxUtils.indexOf(c,t)&&null!=urlParams[t]&&(g+=l+t+"="+urlParams[t],l="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var g=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),t;for(t in urlParams)0>mxUtils.indexOf(l,-t)&&(c=0==g?c+"?":c+"&",null!=urlParams[t]&&(c+=t+"="+urlParams[t],g++))}return c};EditorUi.prototype.showLinkDialog=function(c,g,l,t,B){c=new LinkDialog(this,c,g,l,!0,t,B);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){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.m365&&g++;null!=-this.gitHub&&g++;null!=this.gitLab&&g++;c&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),g=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);this.menus.get("viewZoom").setEnabled(g);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);+"*");c||(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(B){c||this.handleError(B)}};EditorUi.prototype.installMessageHandler=function(c){var g=null,l=!1,t=!1,B=null,D=null,I=mxUtils.bind(this,function(V,Q){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,+function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,I);mxEvent.addListener(window,"message",mxUtils.bind(this,function(V){if(V.source==(this.embedMessageSource||window.opener||window.parent)){var Q=V.data,ja=null,ea=mxUtils.bind(this,function(ra){if(null!=ra&&"function"===typeof ra.charAt&&"<"!=ra.charAt(0))try{Editor.isPngDataUrl(ra)?ra=Editor.extractGraphModelFromPng(ra):"data:image/svg+xml;base64,"==+ra.substring(0,26)?ra=atob(ra.substring(26)):"data:image/svg+xml;utf8,"==ra.substring(0,24)&&(ra=ra.substring(24)),null!=ra&&(""==ra.trim()?ra=null:"%"==ra.charAt(0)?ra=decodeURIComponent(ra):"<"!=ra.charAt(0)&&(ra=Graph.decompress(ra)))}catch(Da){}return ra});if("json"==urlParams.proto){var da=!1;try{Q=JSON.parse(Q),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[V],"data",[Q])}catch(ra){Q=null}try{var ia=Q;if(null==Q)return;if("dialog"==Q.action){this.showError(null!=Q.titleKey?mxResources.get(Q.titleKey):+Q.title,null!=Q.messageKey?mxResources.get(Q.messageKey):mxUtils.htmlEntities(Q.message),null!=Q.buttonKey?mxResources.get(Q.buttonKey):Q.button);null!=Q.modified&&(this.editor.modified=Q.modified);return}if("layout"==Q.action){this.executeLayouts(this.editor.graph.createLayouts(Q.layouts));return}if("prompt"==Q.action){this.spinner.stop();var la=new FilenameDialog(this,Q.defaultValue||"",null!=Q.okKey?mxResources.get(Q.okKey):Q.ok,function(ra){null!=ra?K.postMessage(JSON.stringify({event:"prompt",+value:ra,message:Q}),"*"):K.postMessage(JSON.stringify({event:"prompt-cancel",message:Q}),"*")},null!=Q.titleKey?mxResources.get(Q.titleKey):Q.title,null,null,null,null,function(){K.postMessage(JSON.stringify({event:"prompt-cancel",message:Q}),"*")});this.showDialog(la.container,300,80,!0,!1);la.init();return}if("draft"==Q.action){var ka=ea(Q.xml);this.spinner.stop();la=new DraftDialog(this,mxResources.get("draftFound",[Q.name||this.defaultFilename]),ka,mxUtils.bind(this,function(){this.hideDialog();+K.postMessage(JSON.stringify({event:"draft",result:"edit",message:Q}),"*")}),mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"discard",message:Q}),"*")}),Q.editKey?mxResources.get(Q.editKey):null,Q.discardKey?mxResources.get(Q.discardKey):null,Q.ignore?mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"ignore",message:Q}),"*")}):null);this.showDialog(la.container,640,480,!0,!1,mxUtils.bind(this,function(ra){ra&&+this.actions.get("exit").funct()}));try{la.init()}catch(ra){K.postMessage(JSON.stringify({event:"draft",error:ra.toString(),message:Q}),"*")}return}if("template"==Q.action){this.spinner.stop();var W=1==Q.enableRecent,k=1==Q.enableSearch,y=1==Q.enableCustomTemp;la=new NewDialog(this,!1,Q.templatesOnly?!1:null!=Q.callback,mxUtils.bind(this,function(ra,Da,Ra,x){ra=ra||this.emptyDiagramXml;null!=Q.callback?K.postMessage(JSON.stringify({event:"template",xml:ra,blank:ra==this.emptyDiagramXml,name:Da,tempUrl:Ra,+libs:x,builtIn:!0,message:Q}),"*"):(c(ra,V,ra!=this.emptyDiagramXml,Q.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,W?mxUtils.bind(this,function(ra){this.remoteInvoke("getRecentDiagrams",[null],null,ra,function(){ra(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(ra,Da){this.remoteInvoke("searchDiagrams",[ra,null],null,Da,function(){Da(null,"Network Error!")})}):null,mxUtils.bind(this,function(ra,Da,Ra){K.postMessage(JSON.stringify({event:"template",+docUrl:ra,info:Da,name:Ra}),"*")}),null,null,y?mxUtils.bind(this,function(ra){this.remoteInvoke("getCustomTemplates",null,null,ra,function(){ra({},0)})}):null,1==Q.withoutType,null,Q.templatesOnly);this.showDialog(la.container,620,460,!0,!1,mxUtils.bind(this,function(ra){null!=this.sidebar&&this.sidebar.hideTooltip();ra&&!Q.noExitOnCancel&&this.actions.get("exit").funct()}));la.init();return}if("textContent"==Q.action){var J=this.getDiagramTextContent();K.postMessage(JSON.stringify({event:"textContent",+data:J,message:Q}),"*");return}if("status"==Q.action){this.updateStatus(mxUtils.bind(this,function(){null!=Q.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(Q.messageKey))):null!=Q.message&&this.editor.setStatus(mxUtils.htmlEntities(Q.message))}));null!=Q.modified&&(this.editor.modified=Q.modified);return}if("spinner"==Q.action){var R=null!=Q.messageKey?mxResources.get(Q.messageKey):Q.message;null==Q.show||Q.show?this.spinner.spin(document.body,R):this.spinner.stop();return}if("exit"==+Q.action){this.actions.get("exit").funct();return}if("viewport"==Q.action){if(null!=Q.viewport){var X=this.editor.graph,aa=X.view.translate.x,Z=X.view.translate.y;this.embedViewport=Q.viewport;X.refresh();this.diagramContainer.scrollTop-=(Z-X.view.translate.y)*X.view.scale;this.diagramContainer.scrollLeft-=(aa-X.view.translate.x)*X.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==Q.action){var U=this.actions.get(Q.actionName);null!=U&&U.funct();return}if("resetEditor"==+Q.action){X=this.editor.graph;X.isEditing()&&X.stopEditing(!1);this.hideCurrentMenu();X.popupMenuHandler.hideMenu();X.clearSelection();return}if("fit"==Q.action){X=this.editor.graph;var ba=X.maxFitScale;X.maxFitScale=null!=Q.maxScale?Q.maxScale:1;X.fit(null!=Q.border?Q.border:16,null,null,null,null,!0);X.maxFitScale=ba;R=this.createLoadMessage("fit");R.message=Q;K.postMessage(JSON.stringify(R),"*");return}if("fullscreenChanged"==Q.action){var fa=null;try{var na=this.diagramContainer.getAttribute("data-scrollState");+null!=na&&(this.diagramContainer.removeAttribute("data-scrollState"),fa=JSON.parse(na))}catch(ra){}Editor.inlineFullscreen=Q.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=fa&&this.restoreScrollState(fa);return}if("snapshot"==Q.action){this.sendEmbeddedSvgExport(!0);return}if("export"==Q.action){if("png"==Q.format||"xmlpng"==Q.format){if(null==Q.spin&&null==Q.spinKey||this.spinner.spin(document.body,null!=Q.spinKey?mxResources.get(Q.spinKey):Q.spin)){var pa=null!=Q.xml?Q.xml:+this.getFileData(!0);this.editor.graph.setEnabled(!1);X=this.editor.graph;var ta=mxUtils.bind(this,function(ra,Da){if(Q.withSvg)Q.withSvg=!1,this.getEmbeddedSvg(pa,this.editor.graph,null,!0,function(x){ta(ra,x)},null,null,Q.embedImages,this.editor.graph.background,Q.scale,Q.border,Q.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ra=this.createLoadMessage("export");Ra.format=Q.format;Ra.message=ia;Ra.data=ra;Ra.svg=Da;Ra.xml=pa;K.postMessage(JSON.stringify(Ra),"*")}}),+ua=mxUtils.bind(this,function(ra){null==ra&&(ra=Editor.blankImage);"xmlpng"==Q.format&&(ra=Editor.writeGraphModelToPng(ra,"tEXt","mxfile",encodeURIComponent(pa)));X!=this.editor.graph&&X.container.parentNode.removeChild(X.container);ta(ra)}),Ca=Q.pageId||(null!=this.pages?Q.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var Ba=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Ca){var ra=X.getGlobalVariable;X=this.createTemporaryGraph(X.getStylesheet());+for(var Da,Ra=0;Ra<this.pages.length;Ra++)if(this.pages[Ra].getId()==Ca){Da=this.updatePageRoot(this.pages[Ra]);break}null==Da&&(Da=this.currentPage);X.getGlobalVariable=function(Y){return"page"==Y?Da.getName():"pagenumber"==Y?1:ra.apply(this,arguments)};document.body.appendChild(X.container);X.model.setRoot(Da.root)}if(null!=Q.layerIds){var x=X.model,N=x.getChildCells(x.getRoot()),S={};for(Ra=0;Ra<Q.layerIds.length;Ra++)S[Q.layerIds[Ra]]=!0;for(Ra=0;Ra<N.length;Ra++)x.setVisible(N[Ra],S[N[Ra].id]||+!1)}Ra=null;Q.keepTheme&&(Ra=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Y){ua(Y.toDataURL("image/png"))}),Q.width,null,Q.background,mxUtils.bind(this,function(){ua(null)}),null,null,Q.scale,Q.transparent,Q.shadow,null,X,Q.border,null,Q.grid,Ra,Q.size)});null!=Q.xml&&0<Q.xml.length&&(l=!0,this.setFileData(pa),l=!1);Ba()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==Q.format?"1":"0")+(null!=Ca?"&pageId="+Ca:"")+(null!=Q.layerIds&&0<+Q.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:Q.layerIds})):"")+(null!=Q.scale?"&scale="+Q.scale:"")+"&base64=1&xml="+encodeURIComponent(pa))).send(mxUtils.bind(this,function(ra){200<=ra.getStatus()&&299>=ra.getStatus()?ta("data:image/png;base64,"+ra.getText()):ua(null)}),mxUtils.bind(this,function(){ua(null)}))}}else if(Ba=mxUtils.bind(this,function(){var ra=this.createLoadMessage("export");ra.message=Q;if("html2"==Q.format||"html"==Q.format&&("0"!=urlParams.pages||null!=+this.pages&&1<this.pages.length)){var Da=this.getXmlFileData();ra.xml=mxUtils.getXml(Da);ra.data=this.getFileData(null,null,!0,null,null,null,Da);ra.format=Q.format}else if("html"==Q.format)Da=this.editor.getGraphXml(),ra.data=this.getHtml(Da,this.editor.graph),ra.xml=mxUtils.getXml(Da),ra.format=Q.format;else{if("xml"==Q.format)ra.xml=this.getFileData(!0),ra.format=Q.format,K.postMessage(JSON.stringify(ra),"*");else{mxSvgCanvas2D.prototype.foAltText=null;Da=null!=Q.background?Q.background:this.editor.graph.background;+Da==mxConstants.NONE&&(Da=null);ra.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ra.format="svg";var Ra=mxUtils.bind(this,function(N){this.editor.graph.setEnabled(!0);this.spinner.stop();ra.data=Q.asText?N:Editor.createSvgDataUri(N);K.postMessage(JSON.stringify(ra),"*")}),x="auto";Q.keepTheme&&(x=Editor.isDarkMode()?"dark":"light");null!=Q.theme&&(x=Q.theme);if("xmlsvg"==Q.format){if(null==Q.spin&&null==Q.spinKey||this.spinner.spin(document.body,null!=Q.spinKey?mxResources.get(Q.spinKey):+Q.spin)){x=null;if(this.isAutoDarkMode()||Editor.isDarkMode())x="auto";null!=Q.theme&&(x=Q.theme);this.getEmbeddedSvg(ra.xml,this.editor.graph,null,!0,Ra,null,null,Q.embedImages,Da,Q.scale,Q.border,Q.shadow,x)}}else if(null==Q.spin&&null==Q.spinKey||this.spinner.spin(document.body,null!=Q.spinKey?mxResources.get(Q.spinKey):Q.spin))this.editor.graph.setEnabled(!1),Da=this.editor.graph.getSvg(Da,Q.scale,Q.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||Q.shadow,null,x),(this.editor.graph.shadowVisible||+Q.shadow)&&this.editor.graph.addSvgShadow(Da),this.embedFonts(Da,mxUtils.bind(this,function(N){Q.embedImages||null==Q.embedImages?this.editor.convertImages(N,mxUtils.bind(this,function(S){Ra(mxUtils.getXml(S))})):Ra(mxUtils.getXml(N))}))}return}K.postMessage(JSON.stringify(ra),"*")}),null!=Q.xml&&0<Q.xml.length){if(this.editor.graph.mathEnabled){var Aa=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){Aa.apply(this,arguments);Ba()}}l=!0;this.setFileData(Q.xml);l=!1;this.editor.graph.mathEnabled||+Ba()}else Ba();return}if("load"==Q.action){da=Q.toSketch;t=1==Q.autosave;this.embedDiffSync=null!=Q.diffSync&&!1!==Q.diffSync;this.embedDiffSyncPatchOnly="object"===typeof Q.diffSync&&null!=Q.diffSync&&1==Q.diffSync.patchOnly;this.embedExportProtocol=1==Q.exportProtocol;var Fa=Q.sourceMetadata||null;this.hideDialog();null!=Q.modified&&null==urlParams.modified&&(urlParams.modified=Q.modified);null!=Q.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=Q.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+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=Q.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=Q.noSaveBtn);if(null!=Q.rough){var Sa=Editor.sketchMode;this.doSetSketchMode(Q.rough);Sa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=+Q.dark&&this.setDarkMode(Q.dark);null!=Q.border&&(this.embedExportBorder=Q.border);null!=Q.theme&&(this.embedExportTheme=Q.theme);null!=Q.background&&(this.embedExportBackground=Q.background);null!=Q.viewport&&(this.embedViewport=Q.viewport);this.embedExitPoint=null;if(null!=Q.scale){var La=Q.scale,Pa=null!=Q.scaleBorder?Q.scaleBorder:this.embedExportBorder||0,db=null!=Q.border?Q.border:0;ja=mxUtils.bind(this,function(){var ra=this.editor.graph,Da=ra.getGraphBounds();if(0<Da.width&&0<Da.height){var Ra=+ra.view.scale;ra.view.scaleAndTranslate(La,ra.view.translate.x+db-Da.x/Ra+Pa/La,ra.view.translate.y+db-Da.y/Ra+Pa/La)}})}else if(null!=Q.fit){var Ia=null!=Q.border?Q.border:0,za=Q.maxFitScale||1;ja=mxUtils.bind(this,function(){var ra=this.editor.graph,Da=ra.maxFitScale;ra.maxFitScale=za;ra.fit(Ia,null,null,null,null,!0);ra.maxFitScale=Da})}if(null!=Q.rect){db=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,Q.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,Q.rect.top)++"px";this.minInlineWidth=Q.minWidth;this.minInlineHeight=Q.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Ua=Q.maxFitScale,Qa=Q.rect.width+2*db,Ma=Q.rect.height+2*db;ja=mxUtils.bind(this,function(){var ra=mxUtils.getDocumentSize();Qa=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Qa):Qa,ra.width-80);ra=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Ma):Ma,ra.height-+80);this.diagramContainer.style.width=Qa+"px";this.diagramContainer.style.height=ra+"px";var Da=this.editor.graph;ra=Da.maxFitScale;Da.maxFitScale=Ua;Da.fit(2*db,null,null,null,null,null,Ma);this.setPageVisible(!1);if(null!=this.minInlineWidth&&Da.getGraphBounds().width<this.minInlineWidth){var Ra=Da.container.scrollTop;this.resetScrollbars();Da.container.scrollTop=Ra}Da.maxFitScale=ra;Da.container.scrollTop-=db;Da.container.scrollLeft-=db;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart",+"data",[Q]));Da.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Da.container.style.top);var x=Da.getGraphBounds();Da.container.clientWidth>x.width+2*db&&(Da.container.scrollLeft=x.x+(x.width+db-Da.container.clientWidth)/2)}),10)})}null!=Q.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=Q.noExitBtn);null!=Q.title&&null!=this.buttonContainer&&this.setEmbedTitle(Q.title);try{Q.libs&&this.sidebar.showEntries(Q.libs)}catch(ra){}if(null!=+Q.xmlpng)Q=this.extractGraphModelFromPng(Q.xmlpng);else if(null!=Q.descriptor){if(Q=Q.descriptor,"mermaid"==Q.format){window.isMermaidEnabled?this.parseMermaidDiagram(Q.data,null,mxUtils.bind(this,function(ra){c(ra,V,null,da);ra=this.createLoadMessage("load");ra.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);ra.message=ia;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ra),"*");if(null!=Fa&&null!=Fa.key&&null!=Fa.value){ra=this.editor.graph;+var Da=ra.getModel().getRoot();if(null!=Da){ra.getModel().beginUpdate();try{ra.setAttributeForCell(Da,Fa.key,Fa.value)}finally{ra.getModel().endUpdate()}}}}),mxUtils.bind(this,function(ra){this.handleError(ra)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else Q=Q.xml}else{if("merge"==Q.action){var Na=this.getCurrentFile();null!=Na&&(ka=ea(Q.xml),null!=ka&&""!=ka&&Na.mergeFile(new LocalFile(this,ka),mxUtils.bind(this,+function(){this.embedDiffSync&&(D=this.clonePages(this.pages),B=Za());K.postMessage(JSON.stringify({event:"merge",message:Q}),"*")}),function(ra){K.postMessage(JSON.stringify({event:"merge",message:Q,error:ra}),"*")}))}else if("patch"==Q.action){if(Na=this.getCurrentFile(),null!=Na&&null!=Q.patch)try{l=!0,Na.patch([Q.patch]),this.embedDiffSync&&null!=D&&(D=this.applyPatches(D,[Q.patch])),B=Za(),l=!1,na={event:"patch",message:Q},fa=this.getHashValueForPages(this.pages),na.checksum=fa,null!=Q.checksum&&+Q.checksum!=fa&&(na.checksumMismatch=!0),K.postMessage(JSON.stringify(na),"*")}catch(ra){l=!1,K.postMessage(JSON.stringify({event:"patch",message:Q,error:ra.message||ra.toString()}),"*")}}else if("getDiff"==Q.action){R={event:"getDiff",message:Q};if(this.embedDiffSync&&null!=D){var xa=this.clonePages(this.pages);R.patch=this.diffPages(D,xa);R.checksum=this.getHashValueForPages(xa)}else R.xml=Za();K.postMessage(JSON.stringify(R),"*")}else"resetDiff"==Q.action?this.embedDiffSync&&(null!=Q.xml?(ka=ea(Q.xml),+Na=this.getCurrentFile(),null!=ka&&""!=ka&&null!=Na&&Na.mergeFile(new LocalFile(this,ka),mxUtils.bind(this,function(){D=this.clonePages(this.pages);B=Za();K.postMessage(JSON.stringify({event:"resetDiff",message:Q,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ra){K.postMessage(JSON.stringify({event:"resetDiff",message:Q,error:ra}),"*")})):(D=this.clonePages(this.pages),B=Za(),K.postMessage(JSON.stringify({event:"resetDiff",message:Q,checksum:this.getHashValueForPages(this.pages)}),+"*"))):"remoteInvokeReady"==Q.action?this.handleRemoteInvokeReady(K):"remoteInvoke"==Q.action?this.handleRemoteInvoke(Q,V.origin):"remoteInvokeResponse"==Q.action?this.handleRemoteInvokeResponse(Q):K.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(Q)}),"*");return}}catch(ra){this.handleError(ra)}}var Za=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Oa=mxUtils.bind(this,+function(ra,Da){l=!0;try{c(ra,Da,null,da)}catch(Ra){this.handleError(Ra)}l=!1;null!=urlParams.modified&&this.clearStatus();B=Za();this.embedDiffSync&&(D=this.clonePages(this.pages));t&&null==g&&(g=mxUtils.bind(this,function(Ra,x){Ra=Za();if(Ra!=B&&!l){x=this.createLoadMessage("autosave");x.message=ia;if(this.embedDiffSync&&null!=D){var N=this.clonePages(this.pages),S=this.diffPages(D,N);mxUtils.isEmptyObject(S)?x.xml=Ra:(x.patch=S,x.checksum=this.getHashValueForPages(N),this.embedDiffSyncPatchOnly||+(x.xml=Ra));D=N}else x.xml=Ra;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(x),"*")}B=Ra}),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));null!=ja&&ja();if("1"==urlParams.returnbounds||"json"==urlParams.proto)Da=this.createLoadMessage("load"),Da.xml=ra,this.embedDiffSync&&null!=this.pages&&(Da.checksum=this.getHashValueForPages(this.pages)),K.postMessage(JSON.stringify(Da),"*")});null!=Q&&"function"===typeof Q.substring&&"data:application/vnd.visio;base64,"==Q.substring(0,+34)?(ea="0M8R4KGxGuE"==Q.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(Q.substring(Q.indexOf(",")+1)),function(ra){Oa(ra,V)},mxUtils.bind(this,function(ra){this.handleError(ra)}),ea)):null!=Q&&"function"===typeof Q.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(Q,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(Q,mxUtils.bind(this,function(ra){4==ra.readyState&&(200<=ra.status&&299>=ra.status&&+"<mxGraphModel"==ra.responseText.substring(0,13)?Oa(ra.responseText,V):this.handleError({message:413==ra.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=Q&&"function"===typeof Q.substring&&this.isLucidChartData(Q)?this.convertLucidChart(Q,mxUtils.bind(this,function(ra){Oa(ra)}),mxUtils.bind(this,function(ra){this.handleError(ra)})):null==Q||"object"!==typeof Q||null==Q.format||null==Q.data&&null==Q.url?(Q=ea(Q),Oa(Q,V)):this.loadDescriptor(Q,mxUtils.bind(this,+function(ra){Oa(Za(),V)}),mxUtils.bind(this,function(ra){this.handleError(ra,mxResources.get("errorLoadingFile"))}))}}));var K=this.embedMessageSource||window.opener||window.parent;I="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";K.postMessage(I,"*");if("json"==urlParams.proto){var M=this.editor.graph.openLink;this.editor.graph.openLink=function(V,Q,ja){M.apply(this,arguments);K.postMessage(JSON.stringify({event:"openLink",href:V,target:Q,allowOpener:ja}),"*")}}};+EditorUi.prototype.createEmbedButton=function(c,g,l,t){var B=document.createElement("button");B.className="geEmbedBtn geBtn";B.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(B,c);t&&B.classList.add("gePrimaryBtn");mxEvent.addListener(B,"click",g);return B};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?+this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?+"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),+this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));+this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var g=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var t=JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(t));this.customLayoutConfig=t;this.hideDialog()}catch(B){this.handleError(B)}}),+null,null,null,null,mxUtils.bind(this,function(l,t){var B=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var D=t.value;t.value=JSON.stringify(JSON.parse(D));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=D}catch(I){this.handleError(I)}}));B.setAttribute("title","copy");B.className="geBtn";l.appendChild(B)}),!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(c,g){this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),B=mxUtils.bind(this,function(D){this.loadingOrgChart=!1;l.clear()&&this.handleError(D)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||+this.isOffline(!0))t();else if(g||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",t,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",t,null,null,null,B)}),onerror)};+EditorUi.prototype.importCsv=function(c,g,l,t){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,g,l)}),t)};EditorUi.prototype.doImportCsv=function(c,g,l){try{var t=c.split("\n"),B=[],D=[],I=[],K={};if(0<t.length){var M={};l=null!=l?l:this.editor.graph;var V=null,Q=null,ja=null,ea=null,da=null,ia=null,la=null,ka="whiteSpace=wrap;html=1;",W=null,k=null,y="",J="auto",R="auto",X=!1,aa=null,Z=null,U=40,ba=40,fa=100,na=0,pa=mxUtils.bind(this,function(){null!=g?g(ca):(l.setSelectionCells(ca),+l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ta=l.getFreeInsertPoint(),ua=ta.x,Ca=ta.y;ta=Ca;var Ba=null,Aa="auto";k=null;for(var Fa=[],Sa=null,La=null,Pa=0;Pa<t.length&&"#"==t[Pa].charAt(0);){c=t[Pa].replace(/\r$/,"");for(Pa++;Pa<t.length&&"\\"==c.charAt(c.length-1)&&"#"==t[Pa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(t[Pa].substring(1)),Pa++;if("#"!=c.charAt(1)){var db=c.indexOf(":");+if(0<db){var Ia=mxUtils.trim(c.substring(1,db)),za=mxUtils.trim(c.substring(db+1));"label"==Ia?Ba=Graph.sanitizeHtml(za):"labelname"==Ia&&0<za.length&&"-"!=za?da=za:"labels"==Ia&&0<za.length&&"-"!=za?la=JSON.parse(za):"style"==Ia?Q=za:"parentstyle"==Ia?ka=za:"unknownStyle"==Ia&&"-"!=za?ia=za:"stylename"==Ia&&0<za.length&&"-"!=za?ea=za:"styles"==Ia&&0<za.length&&"-"!=za?ja=JSON.parse(za):"vars"==Ia&&0<za.length&&"-"!=za?V=JSON.parse(za):"identity"==Ia&&0<za.length&&"-"!=za?W=za:"parent"==Ia&&0<za.length&&+"-"!=za?k=za:"namespace"==Ia&&0<za.length&&"-"!=za?y=za:"width"==Ia?J=za:"height"==Ia?R=za:"collapsed"==Ia&&"-"!=za?X="true"==za:"left"==Ia&&0<za.length?aa=za:"top"==Ia&&0<za.length?Z=za:"ignore"==Ia?La=za.split(","):"connect"==Ia?Fa.push(JSON.parse(za)):"link"==Ia?Sa=za:"padding"==Ia?na=parseFloat(za):"edgespacing"==Ia?U=parseFloat(za):"nodespacing"==Ia?ba=parseFloat(za):"levelspacing"==Ia?fa=parseFloat(za):"layout"==Ia&&(Aa=za)}}}if(null==t[Pa])throw Error(mxResources.get("invalidOrMissingFile"));+var Ua=this.editor.csvToArray(t[Pa].replace(/\r$/,""));db=c=null;Ia=[];for(za=0;za<Ua.length;za++)W==Ua[za]&&(c=za),k==Ua[za]&&(db=za),Ia.push(mxUtils.trim(Ua[za]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Ba&&(Ba="%"+Ia[0]+"%");if(null!=Fa)for(var Qa=0;Qa<Fa.length;Qa++)null==M[Fa[Qa].to]&&(M[Fa[Qa].to]={});W=[];for(za=Pa+1;za<t.length;za++){var Ma=this.editor.csvToArray(t[za].replace(/\r$/,""));if(null==Ma){var Na=40<t[za].length?t[za].substring(0,40)+"...":t[za];throw Error(Na++" ("+za+"):\n"+mxResources.get("containsValidationErrors"));}0<Ma.length&&W.push(Ma)}l.model.beginUpdate();try{for(za=0;za<W.length;za++){Ma=W[za];var xa=null,Za=null!=c?y+Ma[c]:null;t=!1;null!=Za&&(xa=l.model.getCell(Za),t=null==xa||0<=mxUtils.indexOf(B,xa));var Oa=new mxCell(Ba,new mxGeometry(ua,ta,0,0),Q||"whiteSpace=wrap;html=1;");Oa.collapsed=X;Oa.vertex=!0;Oa.id=Za;null==xa||t||l.model.setCollapsed(xa,X);for(var ra=0;ra<Ma.length;ra++)l.setAttributeForCell(Oa,Ia[ra],Ma[ra]),null==xa||t||l.setAttributeForCell(xa,+Ia[ra],Ma[ra]);if(null!=da&&null!=la){var Da=la[Oa.getAttribute(da)];null!=Da&&(l.labelChanged(Oa,Da),null==xa||t||l.cellLabelChanged(xa,Da))}if(null!=ea&&null!=ja){var Ra=ja[Oa.getAttribute(ea)];null!=Ra&&(Oa.style=Ra)}l.setAttributeForCell(Oa,"placeholders","1");Oa.style=l.replacePlaceholders(Oa,Oa.style,V);null==xa||t?l.fireEvent(new mxEventObject("cellsInserted","cells",[Oa])):(l.model.setStyle(xa,Oa.style),0>mxUtils.indexOf(I,xa)&&I.push(xa),l.fireEvent(new mxEventObject("cellsInserted","cells",+[xa])));t=null!=xa;xa=Oa;if(!t)for(Qa=0;Qa<Fa.length;Qa++)M[Fa[Qa].to][xa.getAttribute(Fa[Qa].to)]=xa;null!=Sa&&"link"!=Sa&&(l.setLinkForCell(xa,xa.getAttribute(Sa)),l.setAttributeForCell(xa,Sa,null));var x=l.getPreferredSizeForCell(xa);k=null!=db?l.model.getCell(y+Ma[db]):null;if(xa.vertex){Na=null!=k?0:ua;Pa=null!=k?0:Ca;null!=aa&&null!=xa.getAttribute(aa)&&(xa.geometry.x=Na+parseFloat(xa.getAttribute(aa)));null!=Z&&null!=xa.getAttribute(Z)&&(xa.geometry.y=Pa+parseFloat(xa.getAttribute(Z)));var N=+"@"==J.charAt(0)?xa.getAttribute(J.substring(1)):null;xa.geometry.width=null!=N&&"auto"!=N?parseFloat(xa.getAttribute(J.substring(1))):"auto"==J||"auto"==N?x.width+na:parseFloat(J);var S="@"==R.charAt(0)?xa.getAttribute(R.substring(1)):null;xa.geometry.height=null!=S&&"auto"!=S&&"width"!=R?parseFloat(S):"auto"==R||"auto"==S?x.height+na:"width"==R?xa.geometry.width:parseFloat(R);ta+=xa.geometry.height+ba}t?(null==K[Za]&&(K[Za]=[]),K[Za].push(xa)):(B.push(xa),null!=k?(k.style=l.replacePlaceholders(k,+ka,V),l.addCell(xa,k),D.push(k)):I.push(l.addCell(xa)))}for(za=0;za<D.length;za++)N="@"==J.charAt(0)?D[za].getAttribute(J.substring(1)):null,S="@"==R.charAt(0)?D[za].getAttribute(R.substring(1)):null,"auto"!=J&&"auto"!=N||"auto"!=R&&"auto"!=S||l.updateGroupBounds([D[za]],na,!0);var Y=I.slice(),ca=I.slice();for(Qa=0;Qa<Fa.length;Qa++){var ma=Fa[Qa];for(za=0;za<B.length;za++){xa=B[za];var qa=mxUtils.bind(this,function(hb,cb,fb){var lb=cb.getAttribute(fb.from);if(null!=lb&&""!=lb){lb=lb.split(",");for(var ub=+0;ub<lb.length;ub++){var ob=M[fb.to][lb[ub]];if(null==ob&&null!=ia){ob=new mxCell(lb[ub],new mxGeometry(ua,Ca,0,0),ia);ob.style=l.replacePlaceholders(cb,ob.style,V);var pb=l.getPreferredSizeForCell(ob);ob.geometry.width=pb.width+na;ob.geometry.height=pb.height+na;M[fb.to][lb[ub]]=ob;ob.vertex=!0;ob.id=lb[ub];I.push(l.addCell(ob))}if(null!=ob){pb=fb.label;null!=fb.fromlabel&&(pb=(cb.getAttribute(fb.fromlabel)||"")+(pb||""));null!=fb.sourcelabel&&(pb=l.replacePlaceholders(cb,fb.sourcelabel,V)+(pb||+""));null!=fb.tolabel&&(pb=(pb||"")+(ob.getAttribute(fb.tolabel)||""));null!=fb.targetlabel&&(pb=(pb||"")+l.replacePlaceholders(ob,fb.targetlabel,V));var sb="target"==fb.placeholders==!fb.invert?ob:hb;sb=null!=fb.style?l.replacePlaceholders(sb,fb.style,V):l.createCurrentEdgeStyle();pb=l.insertEdge(null,null,pb||"",fb.invert?ob:hb,fb.invert?hb:ob,sb);if(null!=fb.labels)for(sb=0;sb<fb.labels.length;sb++){var rb=fb.labels[sb],tb=new mxCell(rb.label||sb,new mxGeometry(null!=rb.x?rb.x:0,null!=rb.y?rb.y:+0,0,0),"resizable=0;html=1;");tb.vertex=!0;tb.connectable=!1;tb.geometry.relative=!0;null!=rb.placeholders&&(tb.value=l.replacePlaceholders("target"==rb.placeholders==!fb.invert?ob:hb,tb.value,V));if(null!=rb.dx||null!=rb.dy)tb.geometry.offset=new mxPoint(null!=rb.dx?rb.dx:0,null!=rb.dy?rb.dy:0);pb.insert(tb)}if(null!=fb.data)for(var yb in fb.data)l.setAttributeForCell(pb,yb,fb.data[yb]);ca.push(pb);mxUtils.remove(fb.invert?hb:ob,Y)}}}});qa(xa,xa,ma);if(null!=K[xa.id])for(ra=0;ra<K[xa.id].length;ra++)qa(xa,+K[xa.id][ra],ma)}}if(null!=La)for(za=0;za<B.length;za++)for(xa=B[za],ra=0;ra<La.length;ra++)l.setAttributeForCell(xa,mxUtils.trim(La[ra]),null);if(0<I.length){var wa=new mxParallelEdgeLayout(l);wa.spacing=U;wa.checkOverlap=!0;var sa=function(){0<wa.spacing&&wa.execute(l.getDefaultParent());for(var hb=0;hb<I.length;hb++){var cb=l.getCellGeometry(I[hb]);cb.x=Math.round(l.snap(cb.x));cb.y=Math.round(l.snap(cb.y));"auto"==J&&(cb.width=Math.round(l.snap(cb.width)));"auto"==R&&(cb.height=Math.round(l.snap(cb.height)))}};+if("["==Aa.charAt(0)){var ya=pa;l.view.validate();this.executeLayouts(l.createLayouts(JSON.parse(Aa)),function(){sa();ya()});pa=null}else if("circle"==Aa){var Ga=new mxCircleLayout(l);Ga.disableEdgeStyle=!1;Ga.resetEdges=!1;var Ya=Ga.isVertexIgnored;Ga.isVertexIgnored=function(hb){return Ya.apply(this,arguments)||0>mxUtils.indexOf(I,hb)};this.executeLayout(function(){Ga.execute(l.getDefaultParent());sa()},!0,pa);pa=null}else if("horizontaltree"==Aa||"verticaltree"==Aa||"auto"==Aa&&ca.length==2*I.length-+1&&1==Y.length){l.view.validate();var Va=new mxCompactTreeLayout(l,"horizontaltree"==Aa);Va.levelDistance=ba;Va.edgeRouting=!1;Va.resetEdges=!1;Va.sortEdges=!0;this.executeLayout(function(){Va.execute(l.getDefaultParent(),0<Y.length?Y[0]:null)},!0,pa);pa=null}else if("horizontalflow"==Aa||"verticalflow"==Aa||"auto"==Aa&&1==Y.length){l.view.validate();var eb=new mxHierarchicalLayout(l,"horizontalflow"==Aa?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);eb.intraCellSpacing=ba;eb.parallelEdgeSpacing=+U;eb.interRankCellSpacing=fa;eb.disableEdgeStyle=!1;this.executeLayout(function(){eb.execute(l.getDefaultParent(),ca);l.moveCells(ca,ua,Ca)},!0,pa);pa=null}else if("orgchart"==Aa){l.view.validate();var ib=new mxOrgChartLayout(l,2,fa,ba),jb=ib.isVertexIgnored;ib.isVertexIgnored=function(hb){return jb.apply(this,arguments)||0>mxUtils.indexOf(I,hb)};this.executeLayout(function(){ib.execute(l.getDefaultParent());sa()},!0,pa);pa=null}else if("organic"==Aa||"auto"==Aa&&ca.length>I.length){l.view.validate();+var Ta=new mxFastOrganicLayout(l);Ta.forceConstant=3*ba;Ta.disableEdgeStyle=!1;Ta.resetEdges=!1;var qb=Ta.isVertexIgnored;Ta.isVertexIgnored=function(hb){return qb.apply(this,arguments)||0>mxUtils.indexOf(I,hb)};this.executeLayout(function(){Ta.execute(l.getDefaultParent());sa()},!0,pa);pa=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=pa&&pa()}}catch(hb){this.handleError(hb)}};EditorUi.prototype.getSearch=function(c){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<+window.location.search.length){var l="?",t;for(t in urlParams)0>mxUtils.indexOf(c,t)&&null!=urlParams[t]&&(g+=l+t+"="+urlParams[t],l="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var g=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),t;for(t in urlParams)0>mxUtils.indexOf(l,t)&&(c=0==g?c+"?":+c+"&",null!=urlParams[t]&&(c+=t+"="+urlParams[t],g++))}return c};EditorUi.prototype.showLinkDialog=function(c,g,l,t,B){c=new LinkDialog(this,c,g,l,!0,t,B);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){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.m365&&g++;null!=this.gitHub&&g++;+null!=this.gitLab&&g++;c&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),g=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);this.menus.get("viewZoom").setEnabled(g);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g);this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g);this.menus.get("edit").setEnabled(g);this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};-EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var g=0;g<c.length;g++)this.libraryLoaded(c[g].file,c[g].images,c[g].title,null!=c[g].div?"none"!=c[g].div.style.display:c[g].expand)};var Q=EditorUi.prototype.updateActionStates;-EditorUi.prototype.updateActionStates=function(){Q.apply(this,arguments);var c=this.editor.graph,g=this.getCurrentFile(),l=this.getSelectionState(),t=this.isDiagramActive(),B="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=g&&g.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&B);this.actions.get("redo").setEnabled(this.canRedo()&&B);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(t);this.actions.get("editData").setEnabled(c.isEnabled());+EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var g=0;g<c.length;g++)this.libraryLoaded(c[g].file,c[g].images,c[g].title,null!=c[g].div?"none"!=c[g].div.style.display:c[g].expand)};var P=EditorUi.prototype.updateActionStates;+EditorUi.prototype.updateActionStates=function(){P.apply(this,arguments);var c=this.editor.graph,g=this.getCurrentFile(),l=this.getSelectionState(),t=this.isDiagramActive(),B="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=g&&g.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&B);this.actions.get("redo").setEnabled(this.canRedo()&&B);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(t);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(t&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(t&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(t&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(t&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(t&&l.image&&0<l.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&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&t&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length);this.actions.get("addToScratchpad").setEnabled(0<l.cells.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(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);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("none"!=this.diagramContainer.style.display);g.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(t&&-null!=c&&null!=c.shape&&null!=c.shape.stencil)};var M=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);M.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,g,l,t,B,D,I,L){var N=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(g,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");-else if("svg"==l)c.hideDialog(),c.saveData(g,"svg",mxUtils.getXml(N.getSvg(t,B,D)),"image/svg+xml");else{var K=c.getFileData(!0,null,null,null,null,!0),da=N.getGraphBounds(),ja=Math.floor(da.width*B/N.view.scale),ea=Math.floor(da.height*B/N.view.scale);if(K.length<=MAX_REQUEST_SIZE&&ja*ea<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas()){var ca={globalVars:N.getExportVariables()};L&&(ca.grid={size:N.gridSize,steps:N.view.gridSteps,color:N.view.gridColor});c.saveRequest(g,-l,function(fa,la){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(la||"0")+(null!=fa?"&filename="+encodeURIComponent(fa):"")+"&extras="+encodeURIComponent(JSON.stringify(ca))+(0<I?"&dpi="+I:"")+"&bg="+(null!=t?t:"none")+"&w="+ja+"&h="+ea+"&border="+D+"&xml="+encodeURIComponent(K))})}else"png"==l?c.exportImage(B,null==t||"none"==t,!0,!1,!1,D,!0,!1,null,L,I):c.exportImage(B,!1,!0,!1,!1,D,!0,!1,"jpeg",L);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=+null!=c&&null!=c.shape&&null!=c.shape.stencil)};var L=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);L.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,g,l,t,B,D,I,K){var M=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(g,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");+else if("svg"==l)c.hideDialog(),c.saveData(g,"svg",mxUtils.getXml(M.getSvg(t,B,D)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),Q=M.getGraphBounds(),ja=Math.floor(Q.width*B/M.view.scale),ea=Math.floor(Q.height*B/M.view.scale);if(V.length<=MAX_REQUEST_SIZE&&ja*ea<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas()){var da={globalVars:M.getExportVariables()};K&&(da.grid={size:M.gridSize,steps:M.view.gridSteps,color:M.view.gridColor});c.saveRequest(g,+l,function(ia,la){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(la||"0")+(null!=ia?"&filename="+encodeURIComponent(ia):"")+"&extras="+encodeURIComponent(JSON.stringify(da))+(0<I?"&dpi="+I:"")+"&bg="+(null!=t?t:"none")+"&w="+ja+"&h="+ea+"&border="+D+"&xml="+encodeURIComponent(V))})}else"png"==l?c.exportImage(B,null==t||"none"==t,!0,!1,!1,D,!0,!1,null,K,I):c.exportImage(B,!1,!0,!1,!1,D,!0,!1,"jpeg",K);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,g="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var t=c;this.currentPage!=this.pages[l]&&(t=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),t.model.setRoot(this.pages[l].root));g+=this.pages[l].getName()+" "+t.getIndexableText()+" "}else g=c.getIndexableText();this.editor.graph.setEnabled(!0);return g};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var g={},l=document.createElement("div");-l.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxUtils.htmlEntities(c));t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(t);var B=document.createElement("div");B.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";B.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var D={};try{var I=mxSettings.getCustomLibraries();for(c=0;c<I.length;c++){var L=I[c];if("R"==-L.substring(0,1)){var N=JSON.parse(decodeURIComponent(L.substring(1)));D[N[0]]={id:N[0],title:N[1],downloadUrl:N[2]}}}}catch(K){}this.remoteInvoke("getCustomLibraries",null,null,function(K){B.innerText="";if(0==K.length)B.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var da=0;da<K.length;da++){var ja=K[da];D[ja.id]&&(g[ja.id]=ja);var ea=this.addCheckbox(B,ja.title,D[ja.id]);(function(ca,fa){mxEvent.addListener(fa,-"change",function(){this.checked?g[ca.id]=ca:delete g[ca.id]})})(ja,ea)}},mxUtils.bind(this,function(K){B.innerText="";var da=document.createElement("div");da.style.padding="8px";da.style.textAlign="center";mxUtils.write(da,mxResources.get("error")+": ");mxUtils.write(da,null!=K&&null!=K.message?K.message:mxResources.get("unknownError"));B.appendChild(da)}));l.appendChild(B);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var K=0,-da;for(da in g)null==D[da]&&(K++,mxUtils.bind(this,function(ja){this.remoteInvoke("getFileContent",[ja.downloadUrl],null,mxUtils.bind(this,function(ea){K--;0==K&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ea,ja)),this.showSidebar()}catch(ca){this.handleError(ca,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){K--;0==K&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[da]));for(da in D)g[da]||this.closeLibrary(new RemoteLibrary(this,-null,D[da]));0==K&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.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 g=0;g<this.remoteInvokeQueue.length;g++)c.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var g=c.msgMarkers,l=this.remoteInvokeCallbacks[g.callbackId];if(null==l)throw Error("No callback for "+(null!=g?g.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,-c.resp);this.remoteInvokeCallbacks[g.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,g,l,t,B){var D=!0,I=window.setTimeout(mxUtils.bind(this,function(){D=!1;B({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),L=mxUtils.bind(this,function(){window.clearTimeout(I);D&&t.apply(this,arguments)}),N=mxUtils.bind(this,function(){window.clearTimeout(I);D&&B.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:L,-error:N});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:g,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,g){var l=mxUtils.bind(this,function(K,da){var ja={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=da?ja.error={errResp:da}:null!=K&&(ja.resp=K);this.remoteWin.postMessage(JSON.stringify(ja),"*")});try{var t=c.funtionName,B=this.remoteInvokableFns[t];if(null!=B&&-"function"===typeof this[t]){if(B.allowedDomains){for(var D=!1,I=0;I<B.allowedDomains.length;I++)if(g=="https://"+B.allowedDomains[I]){D=!0;break}if(!D){l(null,"Invalid Call: "+t+" is not allowed.");return}}var L=c.functionArgs;Array.isArray(L)||(L=[]);if(B.isAsync)L.push(function(){l(Array.prototype.slice.apply(arguments))}),L.push(function(K){l(null,K||"Unkown Error")}),this[t].apply(this,L);else{var N=this[t].apply(this,L);l([N])}}else l(null,"Invalid Call: "+t+" is not found.")}catch(K){l(null,-"Invalid Call: An error occurred, "+K.message)}};EditorUi.prototype.openDatabase=function(c,g){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var t=l.open("database",2);t.onupgradeneeded=function(B){try{var D=t.result;1>B.oldVersion&&D.createObjectStore("objects",{keyPath:"key"});2>B.oldVersion&&(D.createObjectStore("files",{keyPath:"title"}),D.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(I){null!=-g&&g(I)}};t.onsuccess=mxUtils.bind(this,function(B){try{var D=t.result;this.database=D;EditorUi.migrateStorageFiles&&(StorageFile.migrate(D),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)&&"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 N=!0,K=!1,da,ja=0,ea=mxUtils.bind(this,function(){K=!0;this.setDatabaseItem(".drawioMigrated3",!0);L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),ca=mxUtils.bind(this,function(){ja++;fa()}),fa=mxUtils.bind(this,function(){try{if(ja>=da.length)ea();else{var ka=da[ja];StorageFile.getFileContent(this,ka,mxUtils.bind(this,function(V){null==V||".scratchpad"==ka&&V==this.emptyLibraryXml?-L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[ka]}),"*"):ca()}),ca)}}catch(V){console.log(V)}}),la=mxUtils.bind(this,function(ka){try{this.setDatabaseItem(null,[{title:ka.title,size:ka.data.length,lastModified:Date.now(),type:ka.isLib?"L":"F"},{title:ka.title,data:ka.data}],ca,ca,["filesInfo","files"])}catch(V){console.log(V)}});I=mxUtils.bind(this,function(ka){try{if(ka.source==L.contentWindow){var V={};try{V=JSON.parse(ka.data)}catch(k){}"init"==-V.event?(L.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=V.event||K||(N?null!=V.resp&&0<V.resp.length&&null!=V.resp[0]?(da=V.resp[0],N=!1,fa()):ea():null!=V.resp&&0<V.resp.length&&null!=V.resp[0]?la(V.resp[0]):ca())}}catch(k){console.log(k)}});window.addEventListener("message",I)}})));c(D);D.onversionchange=function(){D.close()}}catch(I){null!=-g?g(I):null!=window.console&&console.warn(I)}});t.onerror=g;t.onblocked=function(){}}catch(B){null!=g?g(B):null!=window.console&&console.error(B)}else null!=g&&g(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,g,l,t,B){this.openDatabase(mxUtils.bind(this,function(D){try{B=B||"objects";Array.isArray(B)||(B=[B],c=[c],g=[g]);var I=D.transaction(B,"readwrite");I.oncomplete=l;I.onerror=t;for(D=0;D<B.length;D++)I.objectStore(B[D]).put(null!=c&&null!=-c[D]?{key:c[D],data:g[D]}:g[D])}catch(L){null!=t&&t(L)}}),t)};EditorUi.prototype.removeDatabaseItem=function(c,g,l,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c]);var D=B.transaction(t,"readwrite");D.oncomplete=g;D.onerror=l;for(B=0;B<t.length;B++)D.objectStore(t[B]).delete(c[B])}catch(I){null!=l&&l(I)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,g,l,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";var D=B.transaction([t],-"readonly").objectStore(t).get(c);D.onsuccess=function(){g(D.result)};D.onerror=l}catch(I){null!=l&&l(I)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var B=t.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),D=[];B.onsuccess=function(I){null==I.target.result?c(D):(D.push(I.target.result.value),I.target.result.continue())};B.onerror=g}catch(I){null!=g&&g(I)}}),g)};EditorUi.prototype.getDatabaseItemKeys=-function(c,g,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var B=t.transaction([l],"readonly").objectStore(l).getAllKeys();B.onsuccess=function(){c(B.result)};B.onerror=g}catch(D){null!=g&&g(D)}}),g)};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,g){var l=this.getCurrentFile();null!=l?l.getComments(c,g):c([])};EditorUi.prototype.addComment=function(c,g,l){var t=this.getCurrentFile();null!=t?t.addComment(c,g,l):g(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,g){var l=this.getCurrentFile();return null!=l?l.newComment(c,g):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,g){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,g):g({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.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,g,l,t,B,D,I,L){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");-return this.editor.loadUrl(c,g,l,t,B,D,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,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,g)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");-return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,g,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");-return this.editor.convertImages(c,g,l,t)};EditorUi.prototype.convertImageToDataUri=function(c,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,g)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,g,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,g,l,t)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");+l.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxUtils.htmlEntities(c));t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(t);var B=document.createElement("div");B.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";B.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var D={};try{var I=mxSettings.getCustomLibraries();for(c=0;c<I.length;c++){var K=I[c];if("R"==+K.substring(0,1)){var M=JSON.parse(decodeURIComponent(K.substring(1)));D[M[0]]={id:M[0],title:M[1],downloadUrl:M[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){B.innerText="";if(0==V.length)B.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var Q=0;Q<V.length;Q++){var ja=V[Q];D[ja.id]&&(g[ja.id]=ja);var ea=this.addCheckbox(B,ja.title,D[ja.id]);(function(da,ia){mxEvent.addListener(ia,+"change",function(){this.checked?g[da.id]=da:delete g[da.id]})})(ja,ea)}},mxUtils.bind(this,function(V){B.innerText="";var Q=document.createElement("div");Q.style.padding="8px";Q.style.textAlign="center";mxUtils.write(Q,mxResources.get("error")+": ");mxUtils.write(Q,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));B.appendChild(Q)}));l.appendChild(B);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var V=0,Q;for(Q in g)null==+D[Q]&&(V++,mxUtils.bind(this,function(ja){this.remoteInvoke("getFileContent",[ja.downloadUrl],null,mxUtils.bind(this,function(ea){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ea,ja)),this.showSidebar()}catch(da){this.handleError(da,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[Q]));for(Q in D)g[Q]||this.closeLibrary(new RemoteLibrary(this,null,D[Q]));+0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.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 g=0;g<this.remoteInvokeQueue.length;g++)c.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var g=c.msgMarkers,l=this.remoteInvokeCallbacks[g.callbackId];if(null==l)throw Error("No callback for "+(null!=g?g.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[g.callbackId]=+null};EditorUi.prototype.remoteInvoke=function(c,g,l,t,B){var D=!0,I=window.setTimeout(mxUtils.bind(this,function(){D=!1;B({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),K=mxUtils.bind(this,function(){window.clearTimeout(I);D&&t.apply(this,arguments)}),M=mxUtils.bind(this,function(){window.clearTimeout(I);D&&B.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:K,error:M});c=JSON.stringify({event:"remoteInvoke",+funtionName:c,functionArgs:g,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,g){var l=mxUtils.bind(this,function(V,Q){var ja={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=Q?ja.error={errResp:Q}:null!=V&&(ja.resp=V);this.remoteWin.postMessage(JSON.stringify(ja),"*")});try{var t=c.funtionName,B=this.remoteInvokableFns[t];if(null!=B&&"function"===typeof this[t]){if(B.allowedDomains){for(var D=+!1,I=0;I<B.allowedDomains.length;I++)if(g=="https://"+B.allowedDomains[I]){D=!0;break}if(!D){l(null,"Invalid Call: "+t+" is not allowed.");return}}var K=c.functionArgs;Array.isArray(K)||(K=[]);if(B.isAsync)K.push(function(){l(Array.prototype.slice.apply(arguments))}),K.push(function(V){l(null,V||"Unkown Error")}),this[t].apply(this,K);else{var M=this[t].apply(this,K);l([M])}}else l(null,"Invalid Call: "+t+" is not found.")}catch(V){l(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=+function(c,g){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var t=l.open("database",2);t.onupgradeneeded=function(B){try{var D=t.result;1>B.oldVersion&&D.createObjectStore("objects",{keyPath:"key"});2>B.oldVersion&&(D.createObjectStore("files",{keyPath:"title"}),D.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(I){null!=g&&g(I)}};t.onsuccess=mxUtils.bind(this,function(B){try{var D=t.result;+this.database=D;EditorUi.migrateStorageFiles&&(StorageFile.migrate(D),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)&&"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,V=!1,Q,ja=0,ea=mxUtils.bind(this,function(){V=!0;this.setDatabaseItem(".drawioMigrated3",!0);K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),da=mxUtils.bind(this,function(){ja++;ia()}),ia=mxUtils.bind(this,function(){try{if(ja>=Q.length)ea();else{var ka=Q[ja];StorageFile.getFileContent(this,ka,mxUtils.bind(this,function(W){null==W||".scratchpad"==ka&&W==this.emptyLibraryXml?K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",+funtionName:"getLocalStorageFile",functionArgs:[ka]}),"*"):da()}),da)}}catch(W){console.log(W)}}),la=mxUtils.bind(this,function(ka){try{this.setDatabaseItem(null,[{title:ka.title,size:ka.data.length,lastModified:Date.now(),type:ka.isLib?"L":"F"},{title:ka.title,data:ka.data}],da,da,["filesInfo","files"])}catch(W){console.log(W)}});I=mxUtils.bind(this,function(ka){try{if(ka.source==K.contentWindow){var W={};try{W=JSON.parse(ka.data)}catch(k){}"init"==W.event?(K.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),+"*"),K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=W.event||V||(M?null!=W.resp&&0<W.resp.length&&null!=W.resp[0]?(Q=W.resp[0],M=!1,ia()):ea():null!=W.resp&&0<W.resp.length&&null!=W.resp[0]?la(W.resp[0]):da())}}catch(k){console.log(k)}});window.addEventListener("message",I)}})));c(D);D.onversionchange=function(){D.close()}}catch(I){null!=g?g(I):null!=window.console&&console.warn(I)}});t.onerror=g;t.onblocked=+function(){}}catch(B){null!=g?g(B):null!=window.console&&console.error(B)}else null!=g&&g(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,g,l,t,B){this.openDatabase(mxUtils.bind(this,function(D){try{B=B||"objects";Array.isArray(B)||(B=[B],c=[c],g=[g]);var I=D.transaction(B,"readwrite");I.oncomplete=l;I.onerror=t;for(D=0;D<B.length;D++)I.objectStore(B[D]).put(null!=c&&null!=c[D]?{key:c[D],data:g[D]}:g[D])}catch(K){null!=t&&t(K)}}),t)};EditorUi.prototype.removeDatabaseItem=+function(c,g,l,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c]);var D=B.transaction(t,"readwrite");D.oncomplete=g;D.onerror=l;for(B=0;B<t.length;B++)D.objectStore(t[B]).delete(c[B])}catch(I){null!=l&&l(I)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,g,l,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";var D=B.transaction([t],"readonly").objectStore(t).get(c);D.onsuccess=function(){g(D.result)};D.onerror=l}catch(I){null!=+l&&l(I)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var B=t.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),D=[];B.onsuccess=function(I){null==I.target.result?c(D):(D.push(I.target.result.value),I.target.result.continue())};B.onerror=g}catch(I){null!=g&&g(I)}}),g)};EditorUi.prototype.getDatabaseItemKeys=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";+var B=t.transaction([l],"readonly").objectStore(l).getAllKeys();B.onsuccess=function(){c(B.result)};B.onerror=g}catch(D){null!=g&&g(D)}}),g)};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,g){var l=this.getCurrentFile();null!=l?l.getComments(c,g):c([])};EditorUi.prototype.addComment=function(c,g,l){var t=this.getCurrentFile();null!=t?t.addComment(c,g,l):g(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,g){var l=this.getCurrentFile();+return null!=l?l.newComment(c,g):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,g){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,g):g({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.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,g,l,t,B,D,I,K){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,g,l,t,B,D,I,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,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,g)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};+EditorUi.prototype.exportToCanvas=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,g,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,+g,l,t)};EditorUi.prototype.convertImageToDataUri=function(c,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,g)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,g,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,g,l,t)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,g,l,t,B){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,g,l,t,B)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],g=0;g<localStorage.length;g++){var l=localStorage.key(g),t=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<t.length){var B="<mxfile "===t.substring(0,8)||"<?xml"===t.substring(0,5)||"\x3c!--[if IE]>"===t.substring(0,12);t="<mxlibrary>"===t.substring(0,11);(B||t)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var g=localStorage.getItem(c);return{title:c,data:g,isLib:"<mxlibrary>"===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,d,m,n,v,p){function C(){for(var fa=I.getElementsByTagName("div"),la=0,ka=0;ka<fa.length;ka++)"none"!=fa[ka].style.display&&fa[ka].parentNode==I&&la++;L.style.display=0==la?"block":"none"}function G(fa,la,ka,V){function k(){la.removeChild(R);la.removeChild(Y);J.style.display="block";x.style.display="block"}t={div:la,comment:fa,saveCallback:ka,deleteOnCancel:V};var x=la.querySelector(".geCommentTxt"),J=la.querySelector(".geCommentActionsList"),R=document.createElement("textarea");-R.className="geCommentEditTxtArea";R.style.minHeight=x.offsetHeight+"px";R.value=fa.content;la.insertBefore(R,x);var Y=document.createElement("div");Y.className="geCommentEditBtns";var Z=mxUtils.button(mxResources.get("cancel"),function(){V?(la.parentNode.removeChild(la),C()):k();t=null});Z.className="geCommentEditBtn";Y.appendChild(Z);var W=mxUtils.button(mxResources.get("save"),function(){x.innerText="";fa.content=R.value;mxUtils.write(x,fa.content);k();ka(fa);t=null});mxEvent.addListener(R,"keydown",-mxUtils.bind(this,function(U){mxEvent.isConsumed(U)||((mxEvent.isControlDown(U)||mxClient.IS_MAC&&mxEvent.isMetaDown(U))&&13==U.keyCode?(W.click(),mxEvent.consume(U)):27==U.keyCode&&(Z.click(),mxEvent.consume(U)))}));W.focus();W.className="geCommentEditBtn gePrimaryBtn";Y.appendChild(W);la.insertBefore(Y,x);J.style.display="none";x.style.display="none";R.focus()}function T(fa,la){la.innerText="";fa=new Date(fa.modifiedDate);var ka=b.timeSince(fa);null==ka&&(ka=mxResources.get("lessThanAMinute"));-mxUtils.write(la,mxResources.get("timeAgo",[ka],"{1} ago"));la.setAttribute("title",fa.toLocaleDateString()+" "+fa.toLocaleTimeString())}function E(fa){var la=document.createElement("img");la.className="geCommentBusyImg";la.src=IMAGE_PATH+"/spin.gif";fa.appendChild(la);fa.busyImg=la}function Q(fa){fa.style.border="1px solid red";fa.busyImg.parentNode==fa&&fa.removeChild(fa.busyImg)}function M(fa){fa.style.border="";fa.busyImg.parentNode==fa&&fa.removeChild(fa.busyImg)}function c(fa,la,ka,V,k){function x(ia,-na,qa){var ta=document.createElement("li");ta.className="geCommentAction";var ua=document.createElement("a");ua.className="geCommentActionLnk";mxUtils.write(ua,ia);ta.appendChild(ua);mxEvent.addListener(ua,"click",function(Ba){na(Ba,fa);Ba.preventDefault();mxEvent.consume(Ba)});aa.appendChild(ta);qa&&(ta.style.display="none")}function J(){function ia(ta){na.push(qa);if(null!=ta.replies)for(var ua=0;ua<ta.replies.length;ua++)qa=qa.nextSibling,ia(ta.replies[ua])}var na=[],qa=Y;ia(fa);return{pdiv:qa,-replies:na}}function R(ia,na,qa,ta,ua){function Ba(){E(Ra);fa.addReply(Ga,function(Ha){Ga.id=Ha;fa.replies.push(Ga);M(Ra);qa&&qa()},function(Ha){za();Q(Ra);b.handleError(Ha,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ta,ua)}function za(){G(Ga,Ra,function(Ha){Ba()},!0)}var Aa=J().pdiv,Ga=b.newComment(ia,b.getCurrentUser());Ga.pCommentId=fa.id;null==fa.replies&&(fa.replies=[]);var Ra=c(Ga,fa.replies,Aa,V+1);na?za():Ba()}if(k||!fa.isResolved){L.style.display="none";var Y=-document.createElement("div");Y.className="geCommentContainer";Y.setAttribute("data-commentId",fa.id);Y.style.marginLeft=20*V+5+"px";fa.isResolved&&(B.style.opacity="0.7");var Z=document.createElement("div");Z.className="geCommentHeader";var W=document.createElement("img");W.className="geCommentUserImg";W.src=null!=fa.user&&null!=fa.user.pictureUrl?fa.user.pictureUrl:Editor.userImage;Z.appendChild(W);W=document.createElement("div");W.className="geCommentHeaderTxt";Z.appendChild(W);var U=document.createElement("div");-U.className="geCommentUsername";mxUtils.write(U,null!=fa.user?fa.user.displayName:mxResources.get("unknownUser"));W.appendChild(U);U=document.createElement("div");U.className="geCommentDate";U.setAttribute("data-commentId",fa.id);T(fa,U);W.appendChild(U);Y.appendChild(Z);Z=document.createElement("div");Z.className="geCommentTxt";mxUtils.write(Z,fa.content||"");Y.appendChild(Z);fa.isLocked&&(Y.style.opacity="0.5");Z=document.createElement("div");Z.className="geCommentActions";var aa=document.createElement("ul");-aa.className="geCommentActionsList";Z.appendChild(aa);g||fa.isLocked||0!=V&&!l||x(mxResources.get("reply"),function(){R("",!0)},fa.isResolved);W=b.getCurrentUser();null==W||null==fa.user||W.id!=fa.user.id||g||fa.isLocked||(x(mxResources.get("edit"),function(){function ia(){G(fa,Y,function(){E(Y);fa.editComment(fa.content,function(){M(Y)},function(na){Q(Y);ia();b.handleError(na,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ia()},fa.isResolved),x(mxResources.get("delete"),-function(){b.confirm(mxResources.get("areYouSure"),function(){E(Y);fa.deleteComment(function(ia){if(!0===ia){ia=Y.querySelector(".geCommentTxt");ia.innerText="";mxUtils.write(ia,mxResources.get("msgDeleted"));var na=Y.querySelectorAll(".geCommentAction");for(ia=0;ia<na.length;ia++)na[ia].parentNode.removeChild(na[ia]);M(Y);Y.style.opacity="0.5"}else{na=J(fa).replies;for(ia=0;ia<na.length;ia++)I.removeChild(na[ia]);for(ia=0;ia<la.length;ia++)if(la[ia]==fa){la.splice(ia,1);break}L.style.display=0==-I.getElementsByTagName("div").length?"block":"none"}},function(ia){Q(Y);b.handleError(ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},fa.isResolved));g||fa.isLocked||0!=V||x(fa.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ia){function na(){var qa=ia.target;qa.innerText="";fa.isResolved=!fa.isResolved;mxUtils.write(qa,fa.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var ta=fa.isResolved?"none":"",ua=J(fa).replies,Ba=-"light-dark("+(fa.isResolved?"ghostWhite":"white")+", transparent)",za=0;za<ua.length;za++){ua[za].style.backgroundColor=Ba;for(var Aa=ua[za].querySelectorAll(".geCommentAction"),Ga=0;Ga<Aa.length;Ga++)Aa[Ga]!=qa.parentNode&&(Aa[Ga].style.display=ta);ja||(ua[za].style.display="none")}C()}fa.isResolved?R(mxResources.get("reOpened")+": ",!0,na,!1,!0):R(mxResources.get("markedAsResolved"),!1,na,!0)});Y.appendChild(Z);null!=ka?I.insertBefore(Y,ka.nextSibling):I.appendChild(Y);for(ka=0;null!=fa.replies&&-ka<fa.replies.length;ka++)Z=fa.replies[ka],Z.isResolved=fa.isResolved,c(Z,fa.replies,null,V+1,k);null!=t&&(t.comment.id==fa.id?(k=fa.content,fa.content=t.comment.content,G(fa,Y,t.saveCallback,t.deleteOnCancel),fa.content=k):null==t.comment.id&&t.comment.pCommentId==fa.id&&(I.appendChild(t.div),G(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return Y}}var g=!b.canComment(),l=b.canReplyToReplies(),t=null,B=document.createElement("div");B.className="geCommentsWin";var D=EditorUi.compactUi?"26px":-"30px",I=document.createElement("div");I.className="geCommentsList";I.style.bottom=parseInt(D)+7+"px";B.appendChild(I);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(L,mxResources.get("noCommentsFound"));var N=document.createElement("div");N.className="geToolbarContainer geCommentsToolbar";N.style.height=D;N.style.padding="3px 4px 4px 4px";D=document.createElement("a");D.className="geButton";if(!g){var K=D.cloneNode();K.style.backgroundImage=-"url("+Editor.plusImage+")";K.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(K,"click",function(fa){function la(){G(ka,V,function(k){E(V);b.addComment(k,function(x){k.id=x;ea.push(k);M(V)},function(x){Q(V);la();b.handleError(x,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ka=b.newComment("",b.getCurrentUser()),V=c(ka,ea,null,0);la();fa.preventDefault();mxEvent.consume(fa)});N.appendChild(K)}var da=D.cloneNode();da.style.backgroundImage=-"url("+Editor.checkImage+")";da.setAttribute("title",mxResources.get("showResolved"));var ja=!1;mxEvent.addListener(da,"click",function(fa){(ja=!ja)?da.classList.add("geActiveItem"):da.classList.remove("geActiveItem");ca();fa.preventDefault();mxEvent.consume(fa)});N.appendChild(da);b.commentsRefreshNeeded()&&(K=D.cloneNode(),K.style.backgroundImage="url("+Editor.refreshImage+")",K.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(K,"click",function(fa){ca();fa.preventDefault();-mxEvent.consume(fa)}),N.appendChild(K));b.commentsSaveNeeded()&&(D=D.cloneNode(),D.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',D.setAttribute("title",mxResources.get("save")),D.className="geButton geAdaptiveAsset",mxEvent.addListener(D,"click",function(fa){p();fa.preventDefault();mxEvent.consume(fa)}),N.appendChild(D));B.appendChild(N);var ea=[],ca=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t)try{t.div=t.div.cloneNode(!0);var fa=t.div.querySelector(".geCommentEditTxtArea"),-la=t.div.querySelector(".geCommentEditBtns");t.comment.content=fa.value;fa.parentNode.removeChild(fa);la.parentNode.removeChild(la)}catch(ka){b.handleError(ka)}I.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(ka){function V(k){if(null!=k){k.sort(function(J,R){return new Date(J.modifiedDate)-new Date(R.modifiedDate)});-for(var x=0;x<k.length;x++)V(k[x].replies)}}ka.sort(function(k,x){return new Date(k.modifiedDate)-new Date(x.modifiedDate)});I.innerText="";I.appendChild(L);L.style.display="block";ea=ka;for(ka=0;ka<ea.length;ka++)V(ea[ka].replies),c(ea[ka],ea,null,0,ja);null!=t&&null==t.comment.id&&null==t.comment.pCommentId&&(I.appendChild(t.div),G(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(ka){I.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ka&&ka.message?": "+ka.message:-""));this.hasError=!0})):I.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});ca();this.refreshComments=ca;N=mxUtils.bind(this,function(){function fa(x){var J=ka[x.id];if(null!=J)for(T(x,J),J=0;null!=x.replies&&J<x.replies.length;J++)fa(x.replies[J])}if(this.window.isVisible()){for(var la=I.querySelectorAll(".geCommentDate"),ka={},V=0;V<la.length;V++){var k=la[V];ka[k.getAttribute("data-commentId")]=k}for(V=0;V<ea.length;V++)fa(ea[V])}});setInterval(N,6E4);this.refreshCommentsTime=N;this.window=-new mxWindow(mxResources.get("comments"),B,d,m,n,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,d,m,n,v,p,C,G,T,E,Q){var M=document.createElement("div");M.style.textAlign="center";Q=null!=Q?Q:44;var c=-document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=Q+"px";c.style.lineHeight="1.2em";mxUtils.write(c,d);M.appendChild(c);null!=E&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",E),c.appendChild(d),M.appendChild(c));E=document.createElement("div");E.style.textAlign="center";E.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");p=mxUtils.button(p||+var CommentsWindow=function(b,d,m,n,v,p){function C(){for(var ia=I.getElementsByTagName("div"),la=0,ka=0;ka<ia.length;ka++)"none"!=ia[ka].style.display&&ia[ka].parentNode==I&&la++;K.style.display=0==la?"block":"none"}function G(ia,la,ka,W){function k(){la.removeChild(R);la.removeChild(X);J.style.display="block";y.style.display="block"}t={div:la,comment:ia,saveCallback:ka,deleteOnCancel:W};var y=la.querySelector(".geCommentTxt"),J=la.querySelector(".geCommentActionsList"),R=document.createElement("textarea");+R.className="geCommentEditTxtArea";R.style.minHeight=y.offsetHeight+"px";R.value=ia.content;la.insertBefore(R,y);var X=document.createElement("div");X.className="geCommentEditBtns";var aa=mxUtils.button(mxResources.get("cancel"),function(){W?(la.parentNode.removeChild(la),C()):k();t=null});aa.className="geCommentEditBtn";X.appendChild(aa);var Z=mxUtils.button(mxResources.get("save"),function(){y.innerText="";ia.content=R.value;mxUtils.write(y,ia.content);k();ka(ia);t=null});mxEvent.addListener(R,+"keydown",mxUtils.bind(this,function(U){mxEvent.isConsumed(U)||((mxEvent.isControlDown(U)||mxClient.IS_MAC&&mxEvent.isMetaDown(U))&&13==U.keyCode?(Z.click(),mxEvent.consume(U)):27==U.keyCode&&(aa.click(),mxEvent.consume(U)))}));Z.focus();Z.className="geCommentEditBtn gePrimaryBtn";X.appendChild(Z);la.insertBefore(X,y);J.style.display="none";y.style.display="none";R.focus()}function T(ia,la){la.innerText="";ia=new Date(ia.modifiedDate);var ka=b.timeSince(ia);null==ka&&(ka=mxResources.get("lessThanAMinute"));+mxUtils.write(la,mxResources.get("timeAgo",[ka],"{1} ago"));la.setAttribute("title",ia.toLocaleDateString()+" "+ia.toLocaleTimeString())}function E(ia){var la=document.createElement("img");la.className="geCommentBusyImg";la.src=IMAGE_PATH+"/spin.gif";ia.appendChild(la);ia.busyImg=la}function P(ia){ia.style.border="1px solid red";ia.busyImg.parentNode==ia&&ia.removeChild(ia.busyImg)}function L(ia){ia.style.border="";ia.busyImg.parentNode==ia&&ia.removeChild(ia.busyImg)}function c(ia,la,ka,W,k){function y(fa,+na,pa){var ta=document.createElement("li");ta.className="geCommentAction";var ua=document.createElement("a");ua.className="geCommentActionLnk";mxUtils.write(ua,fa);ta.appendChild(ua);mxEvent.addListener(ua,"click",function(Ca){na(Ca,ia);Ca.preventDefault();mxEvent.consume(Ca)});ba.appendChild(ta);pa&&(ta.style.display="none")}function J(){function fa(ta){na.push(pa);if(null!=ta.replies)for(var ua=0;ua<ta.replies.length;ua++)pa=pa.nextSibling,fa(ta.replies[ua])}var na=[],pa=X;fa(ia);return{pdiv:pa,+replies:na}}function R(fa,na,pa,ta,ua){function Ca(){E(Sa);ia.addReply(Fa,function(La){Fa.id=La;ia.replies.push(Fa);L(Sa);pa&&pa()},function(La){Ba();P(Sa);b.handleError(La,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ta,ua)}function Ba(){G(Fa,Sa,function(La){Ca()},!0)}var Aa=J().pdiv,Fa=b.newComment(fa,b.getCurrentUser());Fa.pCommentId=ia.id;null==ia.replies&&(ia.replies=[]);var Sa=c(Fa,ia.replies,Aa,W+1);na?Ba():Ca()}if(k||!ia.isResolved){K.style.display="none";var X=+document.createElement("div");X.className="geCommentContainer";X.setAttribute("data-commentId",ia.id);X.style.marginLeft=20*W+5+"px";ia.isResolved&&(B.style.opacity="0.7");var aa=document.createElement("div");aa.className="geCommentHeader";var Z=document.createElement("img");Z.className="geCommentUserImg";Z.src=null!=ia.user&&null!=ia.user.pictureUrl?ia.user.pictureUrl:Editor.userImage;aa.appendChild(Z);Z=document.createElement("div");Z.className="geCommentHeaderTxt";aa.appendChild(Z);var U=document.createElement("div");+U.className="geCommentUsername";mxUtils.write(U,null!=ia.user?ia.user.displayName:mxResources.get("unknownUser"));Z.appendChild(U);U=document.createElement("div");U.className="geCommentDate";U.setAttribute("data-commentId",ia.id);T(ia,U);Z.appendChild(U);X.appendChild(aa);aa=document.createElement("div");aa.className="geCommentTxt";mxUtils.write(aa,ia.content||"");X.appendChild(aa);ia.isLocked&&(X.style.opacity="0.5");aa=document.createElement("div");aa.className="geCommentActions";var ba=document.createElement("ul");+ba.className="geCommentActionsList";aa.appendChild(ba);g||ia.isLocked||0!=W&&!l||y(mxResources.get("reply"),function(){R("",!0)},ia.isResolved);Z=b.getCurrentUser();null==Z||null==ia.user||Z.id!=ia.user.id||g||ia.isLocked||(y(mxResources.get("edit"),function(){function fa(){G(ia,X,function(){E(X);ia.editComment(ia.content,function(){L(X)},function(na){P(X);fa();b.handleError(na,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}fa()},ia.isResolved),y(mxResources.get("delete"),+function(){b.confirm(mxResources.get("areYouSure"),function(){E(X);ia.deleteComment(function(fa){if(!0===fa){fa=X.querySelector(".geCommentTxt");fa.innerText="";mxUtils.write(fa,mxResources.get("msgDeleted"));var na=X.querySelectorAll(".geCommentAction");for(fa=0;fa<na.length;fa++)na[fa].parentNode.removeChild(na[fa]);L(X);X.style.opacity="0.5"}else{na=J(ia).replies;for(fa=0;fa<na.length;fa++)I.removeChild(na[fa]);for(fa=0;fa<la.length;fa++)if(la[fa]==ia){la.splice(fa,1);break}K.style.display=0==+I.getElementsByTagName("div").length?"block":"none"}},function(fa){P(X);b.handleError(fa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ia.isResolved));g||ia.isLocked||0!=W||y(ia.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(fa){function na(){var pa=fa.target;pa.innerText="";ia.isResolved=!ia.isResolved;mxUtils.write(pa,ia.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var ta=ia.isResolved?"none":"",ua=J(ia).replies,Ca=+"light-dark("+(ia.isResolved?"ghostWhite":"white")+", transparent)",Ba=0;Ba<ua.length;Ba++){ua[Ba].style.backgroundColor=Ca;for(var Aa=ua[Ba].querySelectorAll(".geCommentAction"),Fa=0;Fa<Aa.length;Fa++)Aa[Fa]!=pa.parentNode&&(Aa[Fa].style.display=ta);ja||(ua[Ba].style.display="none")}C()}ia.isResolved?R(mxResources.get("reOpened")+": ",!0,na,!1,!0):R(mxResources.get("markedAsResolved"),!1,na,!0)});X.appendChild(aa);null!=ka?I.insertBefore(X,ka.nextSibling):I.appendChild(X);for(ka=0;null!=ia.replies&&+ka<ia.replies.length;ka++)aa=ia.replies[ka],aa.isResolved=ia.isResolved,c(aa,ia.replies,null,W+1,k);null!=t&&(t.comment.id==ia.id?(k=ia.content,ia.content=t.comment.content,G(ia,X,t.saveCallback,t.deleteOnCancel),ia.content=k):null==t.comment.id&&t.comment.pCommentId==ia.id&&(I.appendChild(t.div),G(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return X}}var g=!b.canComment(),l=b.canReplyToReplies(),t=null,B=document.createElement("div");B.className="geCommentsWin";var D=EditorUi.compactUi?"26px":+"30px",I=document.createElement("div");I.className="geCommentsList";I.style.bottom=parseInt(D)+7+"px";B.appendChild(I);var K=document.createElement("span");K.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(K,mxResources.get("noCommentsFound"));var M=document.createElement("div");M.className="geToolbarContainer geCommentsToolbar";M.style.height=D;M.style.padding="3px 4px 4px 4px";D=document.createElement("a");D.className="geButton";if(!g){var V=D.cloneNode();V.style.backgroundImage=+"url("+Editor.plusImage+")";V.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(V,"click",function(ia){function la(){G(ka,W,function(k){E(W);b.addComment(k,function(y){k.id=y;ea.push(k);L(W)},function(y){P(W);la();b.handleError(y,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ka=b.newComment("",b.getCurrentUser()),W=c(ka,ea,null,0);la();ia.preventDefault();mxEvent.consume(ia)});M.appendChild(V)}var Q=D.cloneNode();Q.style.backgroundImage=+"url("+Editor.checkImage+")";Q.setAttribute("title",mxResources.get("showResolved"));var ja=!1;mxEvent.addListener(Q,"click",function(ia){(ja=!ja)?Q.classList.add("geActiveItem"):Q.classList.remove("geActiveItem");da();ia.preventDefault();mxEvent.consume(ia)});M.appendChild(Q);b.commentsRefreshNeeded()&&(V=D.cloneNode(),V.style.backgroundImage="url("+Editor.refreshImage+")",V.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(V,"click",function(ia){da();ia.preventDefault();mxEvent.consume(ia)}),+M.appendChild(V));b.commentsSaveNeeded()&&(D=D.cloneNode(),D.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',D.setAttribute("title",mxResources.get("save")),D.className="geButton geAdaptiveAsset",mxEvent.addListener(D,"click",function(ia){p();ia.preventDefault();mxEvent.consume(ia)}),M.appendChild(D));B.appendChild(M);var ea=[],da=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t)try{t.div=t.div.cloneNode(!0);var ia=t.div.querySelector(".geCommentEditTxtArea"),+la=t.div.querySelector(".geCommentEditBtns");t.comment.content=ia.value;ia.parentNode.removeChild(ia);la.parentNode.removeChild(la)}catch(ka){b.handleError(ka)}I.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(ka){function W(k){if(null!=k){k.sort(function(J,R){return new Date(J.modifiedDate)-new Date(R.modifiedDate)});+for(var y=0;y<k.length;y++)W(k[y].replies)}}ka.sort(function(k,y){return new Date(k.modifiedDate)-new Date(y.modifiedDate)});I.innerText="";I.appendChild(K);K.style.display="block";ea=ka;for(ka=0;ka<ea.length;ka++)W(ea[ka].replies),c(ea[ka],ea,null,0,ja);null!=t&&null==t.comment.id&&null==t.comment.pCommentId&&(I.appendChild(t.div),G(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(ka){I.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ka&&ka.message?": "+ka.message:+""));this.hasError=!0})):I.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});da();this.refreshComments=da;M=mxUtils.bind(this,function(){function ia(y){var J=ka[y.id];if(null!=J)for(T(y,J),J=0;null!=y.replies&&J<y.replies.length;J++)ia(y.replies[J])}if(this.window.isVisible()){for(var la=I.querySelectorAll(".geCommentDate"),ka={},W=0;W<la.length;W++){var k=la[W];ka[k.getAttribute("data-commentId")]=k}for(W=0;W<ea.length;W++)ia(ea[W])}});setInterval(M,6E4);this.refreshCommentsTime=M;this.window=+new mxWindow(mxResources.get("comments"),B,d,m,n,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,d,m,n,v,p,C,G,T,E,P){var L=document.createElement("div");L.style.textAlign="center";P=null!=P?P:44;var c=+document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=P+"px";c.style.lineHeight="1.2em";mxUtils.write(c,d);L.appendChild(c);null!=E&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",E),c.appendChild(d),L.appendChild(c));E=document.createElement("div");E.style.textAlign="center";E.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");p=mxUtils.button(p||mxResources.get("cancel"),function(){b.hideDialog();null!=n&&n(g.checked)});p.className="geBtn";null!=G&&(p.innerHTML=G+"<br>"+p.innerHTML,p.style.display="inline-block",p.style.paddingBottom="8px",p.style.paddingTop="8px",p.style.height="auto",p.style.width="40%");b.editor.cancelFirst&&E.appendChild(p);var l=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(g.checked)});E.appendChild(l);null!=C?(l.innerHTML=C+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom=-"8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||E.appendChild(p);M.appendChild(E);T?(E.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(g),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),c.appendChild(v),M.appendChild(c),mxEvent.addListener(v,"click",function(t){g.checked=!g.checked;mxEvent.consume(t)})):-E.style.marginTop="12px";this.init=function(){l.focus()};this.container=M},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,d){this.node=b;null!=d?this.node.setAttribute("id",d):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")};+"8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||E.appendChild(p);L.appendChild(E);T?(E.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(g),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),c.appendChild(v),L.appendChild(c),mxEvent.addListener(v,"click",function(t){g.checked=!g.checked;mxEvent.consume(t)})):+E.style.marginTop="12px";this.init=function(){l.focus()};this.container=L},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,d){this.node=b;null!=d?this.node.setAttribute("id",d):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,d,m){this.ui=b;this.page=d;this.previous=this.name=m}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,d,m){this.ui=b;this.oldIndex=d;this.newIndex=m}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,d,m){this.ui=b;this.previousPage=this.page=d;null!=d&&(this.ui.updatePageRoot(d),null!=m&&(d.viewState=m))}@@ -4265,101 +4277,102 @@ EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(v,p){this.menus.get("pages").funct(v,p)}));d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var m=mxEvent.getClientX(b),n=mxEvent.getClientY(b);d.popup(m,n,null,b);this.setCurrentMenu(d);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,d){var m=this.createTab(),n=b.getName()||mxResources.get("untitled"),v=b.getId();m.setAttribute("title",n+(null!=v?" ("+v+")":"")+" ["+d+"]");d=document.createElement("span");d.style.maxWidth="160px";d.style.textOverflow="ellipsis";d.style.overflow="hidden";mxUtils.write(d,n);m.appendChild(d);this.addTabListeners(b,m);return m};EditorUi.prototype.addTabListeners=function(b,d){mxEvent.disableContextMenu(d);var m=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(T){this.renamePage(b);mxEvent.consume(T)}));var n=document.createElement("div");n.style.backgroundImage="url("+Editor.thinExpandImage+")";n.className="geButton";d.appendChild(n);var v=!1,p=!1,C=mxUtils.bind(this,function(T){v=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);m.isMouseDown||p||this.selectPage(b)}),G=mxUtils.bind(this,-function(T){if(!m.isMouseDown&&(p&&(mxEvent.isTouchEvent(T)||mxEvent.getSource(T)==n)||mxEvent.isPopupTrigger(T))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(T)||!v)){var E=new mxPopupMenu(this.createPageMenu(b));E.smartSeparators=!0;E.showDisabled=!0;E.autoExpand=!0;E.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(E,arguments);this.resetCurrentMenu();E.destroy()});var Q=mxEvent.getClientX(T),M=mxEvent.getClientY(T);E.popup(Q,M,null,T);+function(T){if(!m.isMouseDown&&(p&&(mxEvent.isTouchEvent(T)||mxEvent.getSource(T)==n)||mxEvent.isPopupTrigger(T))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(T)||!v)){var E=new mxPopupMenu(this.createPageMenu(b));E.smartSeparators=!0;E.showDisabled=!0;E.autoExpand=!0;E.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(E,arguments);this.resetCurrentMenu();E.destroy()});var P=mxEvent.getClientX(T),L=mxEvent.getClientY(T);E.popup(P,L,null,T);this.setCurrentMenu(E,d)}mxEvent.consume(T)});mxEvent.addGestureListeners(n,C,null,G);mxEvent.addGestureListeners(d,C,null,G)};EditorUi.prototype.createPageMenu=function(b,d){return mxUtils.bind(this,function(m,n){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||m.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),n));this.editor.graph.isEnabled()&&(m.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),n),m.addSeparator(n),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",m,n,mxResources.get("move")),m.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),n),m.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,d)}),n))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(n,v,p,C,G){v=null!=v?v:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),n));this.stopEditing();this.model.beginUpdate();try{for(var T=p.slice(),E=0;E<p.length;E++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[E]),"treeFolding","0")&&this.foldTreeCell(n,p[E]);p=T;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(n,v){this.model.beginUpdate();try{var p=[];this.traverse(v,!0,mxUtils.bind(this,function(G,T){var E=null!=T&&this.isTreeEdge(T);E&&p.push(T);G==v||null!=T&&!E||p.push(G);return(null==T||E)&&(G==v||!this.model.isCollapsed(G))}));this.model.setCollapsed(v,n);for(var C=0;C<p.length;C++)this.model.setVisible(p[C],!n)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(n){return!this.isEdgeIgnored(n)};Graph.prototype.getTreeEdges=function(n,v,p,C,G,T){return this.model.filterCells(this.getEdges(n,v,p,C,G,T),mxUtils.bind(this,-function(E){return this.isTreeEdge(E)}))};Graph.prototype.getIncomingTreeEdges=function(n,v){return this.getTreeEdges(n,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(n,v){return this.getTreeEdges(n,v,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function n(V){return t.isVertex(V)&&p(V)}function v(V){var k=!1;null!=V&&(k="1"==-l.getCurrentCellStyle(V).treeMoving);return k}function p(V){var k=!1;null!=V&&(V=t.getParent(V),k=l.view.getState(V),k="tree"==(null!=k?k.style:l.getCellStyle(V)).containerType);return k}function C(V){var k=!1;null!=V&&(V=t.getParent(V),k=l.view.getState(V),l.view.getState(V),k=null!=(null!=k?k.style:l.getCellStyle(V)).childLayout);return k}function G(V){V=l.view.getState(V);if(null!=V){var k=l.getIncomingTreeEdges(V.cell);if(0<k.length&&(k=l.view.getState(k[0]),null!=k&&(k=k.absolutePoints,null!=-k&&0<k.length&&(k=k[k.length-1],null!=k)))){if(k.y==V.y&&Math.abs(k.x-V.getCenterX())<V.width/2)return mxConstants.DIRECTION_SOUTH;if(k.y==V.y+V.height&&Math.abs(k.x-V.getCenterX())<V.width/2)return mxConstants.DIRECTION_NORTH;if(k.x>V.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function T(V,k){k=null!=k?k:!0;l.model.beginUpdate();try{var x=l.model.getParent(V),J=l.getIncomingTreeEdges(V),R=l.cloneCells([J[0],V]);l.model.setTerminal(R[0],l.model.getTerminal(J[0],-!0),!0);var Y=G(V),Z=x.geometry;Y==mxConstants.DIRECTION_SOUTH||Y==mxConstants.DIRECTION_NORTH?R[1].geometry.x+=k?V.geometry.width+10:-R[1].geometry.width-10:R[1].geometry.y+=k?V.geometry.height+10:-R[1].geometry.height-10;l.view.currentRoot!=x&&(R[1].geometry.x-=Z.x,R[1].geometry.y-=Z.y);var W=l.view.getState(V),U=l.view.scale;if(null!=W){var aa=mxRectangle.fromRectangle(W);Y==mxConstants.DIRECTION_SOUTH||Y==mxConstants.DIRECTION_NORTH?aa.x+=(k?V.geometry.width+10:-R[1].geometry.width-10)*U:aa.y+=-(k?V.geometry.height+10:-R[1].geometry.height-10)*U;var ia=l.getOutgoingTreeEdges(l.model.getTerminal(J[0],!0));if(null!=ia){for(var na=Y==mxConstants.DIRECTION_SOUTH||Y==mxConstants.DIRECTION_NORTH,qa=Z=J=0;qa<ia.length;qa++){var ta=l.model.getTerminal(ia[qa],!1);if(Y==G(ta)){var ua=l.view.getState(ta);ta!=V&&null!=ua&&(na&&k!=ua.getCenterX()<W.getCenterX()||!na&&k!=ua.getCenterY()<W.getCenterY())&&mxUtils.intersects(aa,ua)&&(J=10+Math.max(J,(Math.min(aa.x+aa.width,ua.x+ua.width)-Math.max(aa.x,ua.x))/-U),Z=10+Math.max(Z,(Math.min(aa.y+aa.height,ua.y+ua.height)-Math.max(aa.y,ua.y))/U))}}na?Z=0:J=0;for(qa=0;qa<ia.length;qa++)if(ta=l.model.getTerminal(ia[qa],!1),Y==G(ta)&&(ua=l.view.getState(ta),ta!=V&&null!=ua&&(na&&k!=ua.getCenterX()<W.getCenterX()||!na&&k!=ua.getCenterY()<W.getCenterY()))){var Ba=[];l.traverse(ua.cell,!0,function(za,Aa){var Ga=null!=Aa&&l.isTreeEdge(Aa);Ga&&Ba.push(Aa);(null==Aa||Ga)&&Ba.push(za);return null==Aa||Ga});l.moveCells(Ba,(k?1:-1)*J,(k?1:-1)*Z)}}}return l.addCells(R,-x)}finally{l.model.endUpdate()}}function E(V){l.model.beginUpdate();try{var k=G(V),x=l.getIncomingTreeEdges(V),J=l.cloneCells([x[0],V]);l.model.setTerminal(x[0],J[1],!1);l.model.setTerminal(J[0],J[1],!0);l.model.setTerminal(J[0],V,!1);var R=l.model.getParent(V),Y=R.geometry,Z=[];l.view.currentRoot!=R&&(J[1].geometry.x-=Y.x,J[1].geometry.y-=Y.y);l.traverse(V,!0,function(aa,ia){var na=null!=ia&&l.isTreeEdge(ia);na&&Z.push(ia);(null==ia||na)&&Z.push(aa);return null==ia||na});var W=V.geometry.width+40,-U=V.geometry.height+40;k==mxConstants.DIRECTION_SOUTH?W=0:k==mxConstants.DIRECTION_NORTH?(W=0,U=-U):k==mxConstants.DIRECTION_WEST?(W=-W,U=0):k==mxConstants.DIRECTION_EAST&&(U=0);l.moveCells(Z,W,U);return l.addCells(J,R)}finally{l.model.endUpdate()}}function Q(V,k){l.model.beginUpdate();try{var x=l.model.getParent(V),J=l.getIncomingTreeEdges(V),R=G(V);0==J.length&&(J=[l.createEdge(x,null,"",null,null,l.createCurrentEdgeStyle())],R=k);var Y=l.cloneCells([J[0],V]);l.model.setTerminal(Y[0],V,!0);null==-l.model.getTerminal(Y[0],!1)&&(l.model.setTerminal(Y[0],Y[1],!1),l.applyNewEdgeStyle(Y[1],[Y[0]],R));J=l.getOutgoingTreeEdges(V);var Z=x.geometry;k=[];l.view.currentRoot==x&&(Z=new mxRectangle);for(var W=0;W<J.length;W++){var U=l.model.getTerminal(J[W],!1);null!=U&&k.push(U)}var aa=l.view.getBounds(k),ia=l.view.translate,na=l.view.scale;R==mxConstants.DIRECTION_SOUTH?(Y[1].geometry.x=null==aa?V.geometry.x+(V.geometry.width-Y[1].geometry.width)/2:(aa.x+aa.width)/na-ia.x-Z.x+10,Y[1].geometry.y+=Y[1].geometry.height--Z.y+40):R==mxConstants.DIRECTION_NORTH?(Y[1].geometry.x=null==aa?V.geometry.x+(V.geometry.width-Y[1].geometry.width)/2:(aa.x+aa.width)/na-ia.x+-Z.x+10,Y[1].geometry.y-=Y[1].geometry.height+Z.y+40):(Y[1].geometry.x=R==mxConstants.DIRECTION_WEST?Y[1].geometry.x-(Y[1].geometry.width+Z.x+40):Y[1].geometry.x+(Y[1].geometry.width-Z.x+40),Y[1].geometry.y=null==aa?V.geometry.y+(V.geometry.height-Y[1].geometry.height)/2:(aa.y+aa.height)/na-ia.y+-Z.y+10);return l.addCells(Y,x)}finally{l.model.endUpdate()}}-function M(V,k,x){V=l.getOutgoingTreeEdges(V);x=l.view.getState(x);var J=[];if(null!=x&&null!=V){for(var R=0;R<V.length;R++){var Y=l.view.getState(l.model.getTerminal(V[R],!1));null!=Y&&(!k&&Math.min(Y.x+Y.width,x.x+x.width)>=Math.max(Y.x,x.x)||k&&Math.min(Y.y+Y.height,x.y+x.height)>=Math.max(Y.y,x.y))&&J.push(Y)}J.sort(function(Z,W){return k?Z.x+Z.width-W.x-W.width:Z.y+Z.height-W.y-W.height})}return J}function c(V,k){var x=G(V),J=k==mxConstants.DIRECTION_EAST||k==mxConstants.DIRECTION_WEST;(x==mxConstants.DIRECTION_EAST||-x==mxConstants.DIRECTION_WEST)==J&&x!=k?g.actions.get("selectParent").funct():x==k?(k=l.getOutgoingTreeEdges(V),null!=k&&0<k.length&&l.setSelectionCell(l.model.getTerminal(k[0],!1))):(x=l.getIncomingTreeEdges(V),null!=x&&0<x.length&&(J=M(l.model.getTerminal(x[0],!0),J,V),V=l.view.getState(V),null!=V&&(V=mxUtils.indexOf(J,V),0<=V&&(V+=k==mxConstants.DIRECTION_NORTH||k==mxConstants.DIRECTION_WEST?-1:1,0<=V&&V<=J.length-1&&l.setSelectionCell(J[V].cell)))))}var g=this,l=g.editor.graph,t=l.getModel(),-B=g.menus.createPopupMenu;g.menus.createPopupMenu=function(V,k,x){B.apply(this,arguments);if(1==l.getSelectionCount()){k=l.getSelectionCell();var J=l.getOutgoingTreeEdges(k);V.addSeparator();0<J.length&&(n(l.getSelectionCell())&&this.addMenuItems(V,["selectChildren"],null,x),this.addMenuItems(V,["selectDescendants"],null,x));n(l.getSelectionCell())?(V.addSeparator(),0<l.getIncomingTreeEdges(k).length&&this.addMenuItems(V,["selectSiblings","selectParent"],null,x)):0<l.model.getEdgeCount(k)&&this.addMenuItems(V,-["selectConnections"],null,x)}};g.actions.addAction("selectChildren",function(V){if(l.isEnabled()&&1==l.getSelectionCount()){var k=l.getSelectionCell();V=mxEvent.isControlDown(V)?null:l.getOutgoingTreeEdges(k);if(null!=V&&0<V.length){k=[];for(var x=0;x<V.length;x++)k.push(l.model.getTerminal(V[x],!1));l.setSelectionCells(k)}else l.setSelectionCells(l.model.getChildren(k))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("selectDescendants",function(V){var k=l.getSelectionCell();-if(l.isEnabled()&&null!=k){var x=[];mxEvent.isControlDown(V)||l.traverse(k,!0,function(J,R){var Y=null!=R&&l.isTreeEdge(R);Y&&mxEvent.isControlDown(V)&&x.push(R);(null==R||Y)&&x.push(J);return null==R||Y});if(0==x.length||1==x.length&&x[0]==k)x=l.model.getDescendants(k);l.setSelectionCells(x)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");g.actions.addAction("selectParent",function(V){var k=l.getSelectionCell();l.isEnabled()&&null!=k&&(V=mxEvent.isControlDown(V)?null:l.getIncomingTreeEdges(k),-null!=V&&0<V.length?l.setSelectionCell(l.model.getTerminal(V[0],!0)):l.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");g.actions.addAction("selectSiblings",function(V){if(l.isEnabled()&&1==l.getSelectionCount()){var k=l.getSelectionCell(),x=mxEvent.isControlDown(V)?null:l.getIncomingTreeEdges(k);V=[];if(null!=x&&0<x.length&&(x=l.getOutgoingTreeEdges(l.model.getTerminal(x[0],!0)),null!=x))for(var J=0;J<x.length;J++)V.push(l.model.getTerminal(x[J],!1));0==V.length&&(V=l.model.getChildren(l.model.getParent(k)));-l.setSelectionCells(V)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var D=l.removeCells;l.removeCells=function(V,k){k=null!=k?k:!0;null==V&&(V=this.getDeletableCells(this.getSelectionCells()));k&&(V=this.getDeletableCells(this.addAllEdges(V)));for(var x=[],J=0;J<V.length;J++){var R=V[J];t.isEdge(R)&&p(R)&&(x.push(R),R=t.getTerminal(R,!1));if(n(R)){var Y=[];l.traverse(R,!0,function(Z,W){var U=null!=W&&l.isTreeEdge(W);U&&Y.push(W);(null==W||U)&&Y.push(Z);return null==W||U});0<Y.length&&(x=x.concat(Y),-R=l.getIncomingTreeEdges(V[J]),V=V.concat(R))}else null!=R&&x.push(V[J])}V=x;return D.apply(this,arguments)};g.hoverIcons.getStateAt=function(V,k,x){return n(V.cell)?null:this.graph.view.getState(this.graph.getCellAt(k,x))};var I=l.duplicateCells;l.duplicateCells=function(V,k){V=null!=V?V:this.getSelectionCells();for(var x=V.slice(0),J=0;J<x.length;J++){var R=l.view.getState(x[J]);if(null!=R&&n(R.cell)){var Y=l.getIncomingTreeEdges(R.cell);for(R=0;R<Y.length;R++)mxUtils.remove(Y[R],V)}}this.model.beginUpdate();-try{var Z=I.call(this,V,k);if(Z.length==V.length)for(J=0;J<V.length;J++)if(n(V[J])){var W=l.getIncomingTreeEdges(Z[J]);Y=l.getIncomingTreeEdges(V[J]);if(0==W.length&&0<Y.length){var U=this.cloneCell(Y[0]);this.addEdge(U,l.getDefaultParent(),this.model.getTerminal(Y[0],!0),Z[J])}}}finally{this.model.endUpdate()}return Z};var L=l.moveCells;l.moveCells=function(V,k,x,J,R,Y,Z){for(var W=null,U=[],aa=0;aa<V.length;aa++)(v(V[aa])||n(V[aa]))&&!C(V[aa])&&this.isCellCollapsed(V[aa])?U=U.concat(this.getSubtree(V[aa])):-U.push(V[aa]);V=mxUtils.removeDuplicates(U);this.model.beginUpdate();try{U=R;var ia=this.getCurrentCellStyle(R);if(null!=V&&n(R)&&"1"==mxUtils.getValue(ia,"treeFolding","0")){for(aa=0;aa<V.length;aa++)if(n(V[aa])||l.model.isEdge(V[aa])&&null==l.model.getTerminal(V[aa],!0)){R=l.model.getParent(V[aa]);break}if(null!=U&&R!=U&&null!=this.view.getState(V[0])){var na=l.getIncomingTreeEdges(V[0]);if(0<na.length){var qa=l.view.getState(l.model.getTerminal(na[0],!0));if(null!=qa){var ta=l.view.getState(U);-null!=ta&&(k=(ta.getCenterX()-qa.getCenterX())/l.view.scale,x=(ta.getCenterY()-qa.getCenterY())/l.view.scale)}}}}W=L.apply(this,arguments);if(null!=W&&null!=V&&W.length==V.length)for(aa=0;aa<W.length;aa++)if(this.model.isEdge(W[aa]))n(U)&&0>mxUtils.indexOf(W,this.model.getTerminal(W[aa],!0))&&this.model.setTerminal(W[aa],U,!0);else if(n(V[aa])&&(na=l.getIncomingTreeEdges(V[aa]),0<na.length))if(!J)n(U)&&0>mxUtils.indexOf(V,this.model.getTerminal(na[0],!0))&&this.model.setTerminal(na[0],U,!0);else if(0==-l.getIncomingTreeEdges(W[aa]).length){ia=U;if(null==ia||ia==l.model.getParent(V[aa]))ia=l.model.getTerminal(na[0],!0);J=this.cloneCell(na[0]);this.addEdge(J,l.getDefaultParent(),ia,W[aa])}}finally{this.model.endUpdate()}return W};if(null!=g.sidebar){var N=g.sidebar.dropAndConnect;g.sidebar.dropAndConnect=function(V,k,x,J){var R=l.model,Y=null;R.beginUpdate();try{if(Y=N.apply(this,arguments),n(V))for(var Z=0;Z<Y.length;Z++)if(R.isEdge(Y[Z])&&null==R.getTerminal(Y[Z],!0)){R.setTerminal(Y[Z],V,!0);var W=-l.getCellGeometry(Y[Z]);W.points=null;null!=W.getTerminalPoint(!0)&&W.setTerminalPoint(null,!0)}}finally{R.endUpdate()}return Y}}var K={67:g.actions.get("selectChildren"),88:g.actions.get("selectDescendants"),80:g.actions.get("selectParent"),83:g.actions.get("selectSiblings")},da={67:g.actions.get("copyStyle"),86:g.actions.get("pasteStyle")},ja=g.onKeyDown;g.onKeyDown=function(V){try{var k=l.getSelectionCell();if(l.isEnabled()&&!l.isEditing()&&null!=k){var x=mxEvent.isAltDown(V)&&mxEvent.isShiftDown(V)?-K[V.keyCode]:mxEvent.isAltDown(V)?da[V.keyCode]:null;null!=x?(x.funct(V),mxEvent.consume(V)):n(k)&&(x=null,0<l.getIncomingTreeEdges(k).length&&(9==V.which?x=mxEvent.isShiftDown(V)?E(k):Q(k):13==V.which&&(x=T(k,!mxEvent.isShiftDown(V)))),null!=x&&0<x.length?(1==x.length&&l.model.isEdge(x[0])?l.setSelectionCell(l.model.getTerminal(x[0],!1)):l.setSelectionCell(x[x.length-1]),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(k)),l.startEditingAtCell(k),mxEvent.consume(V)):37==V.keyCode?(c(k,mxConstants.DIRECTION_WEST),-mxEvent.consume(V)):38==V.keyCode?(c(k,mxConstants.DIRECTION_NORTH),mxEvent.consume(V)):39==V.keyCode?(c(k,mxConstants.DIRECTION_EAST),mxEvent.consume(V)):40==V.keyCode&&(c(k,mxConstants.DIRECTION_SOUTH),mxEvent.consume(V)))}}catch(J){g.handleError(J)}mxEvent.isConsumed(V)||ja.apply(this,arguments)};var ea=l.connectVertex;l.connectVertex=function(V,k,x,J,R,Y,Z){var W=l.getIncomingTreeEdges(V);if(n(V)){var U=G(V),aa=U==mxConstants.DIRECTION_EAST||U==mxConstants.DIRECTION_WEST,ia=k==mxConstants.DIRECTION_EAST||-k==mxConstants.DIRECTION_WEST;return U==k||0==W.length?Q(V,k):aa==ia?E(V):T(V,k!=mxConstants.DIRECTION_NORTH&&k!=mxConstants.DIRECTION_WEST)}return ea.apply(this,arguments)};l.getSubtree=function(V){var k=[V];!v(V)&&!n(V)||C(V)||l.traverse(V,!0,function(x,J){var R=null!=J&&l.isTreeEdge(J);R&&0>mxUtils.indexOf(k,J)&&k.push(J);(null==J||R)&&0>mxUtils.indexOf(k,x)&&k.push(x);return null==J||R});return k};var ca=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){ca.apply(this,-arguments);(v(this.state.cell)||n(this.state.cell))&&!C(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(V){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(V),mxEvent.getClientY(V),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(V);this.graph.isMouseDown=!0;g.hoverIcons.reset();mxEvent.consume(V)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var fa=mxVertexHandler.prototype.redrawHandles;-mxVertexHandler.prototype.redrawHandles=function(){fa.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 la=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(V){la.apply(this,arguments);null!=-this.moveHandle&&(this.moveHandle.style.display=V?"":"none")};var ka=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(V,k){ka.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var n=m.apply(this,arguments),v=this.graph,p=this;return n.concat([this.addEntry("tree container",-function(){var C=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");C.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"};');+function(E){return this.isTreeEdge(E)}))};Graph.prototype.getIncomingTreeEdges=function(n,v){return this.getTreeEdges(n,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(n,v){return this.getTreeEdges(n,v,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function n(W){return t.isVertex(W)&&p(W)}function v(W){var k=!1;null!=W&&(k="1"==+l.getCurrentCellStyle(W).treeMoving);return k}function p(W){var k=!1;null!=W&&(W=t.getParent(W),k=l.view.getState(W),k="tree"==(null!=k?k.style:l.getCellStyle(W)).containerType);return k}function C(W){var k=!1;null!=W&&(W=t.getParent(W),k=l.view.getState(W),l.view.getState(W),k=null!=(null!=k?k.style:l.getCellStyle(W)).childLayout);return k}function G(W){W=l.view.getState(W);if(null!=W){var k=l.getIncomingTreeEdges(W.cell);if(0<k.length&&(k=l.view.getState(k[0]),null!=k&&(k=k.absolutePoints,null!=+k&&0<k.length&&(k=k[k.length-1],null!=k)))){if(k.y==W.y&&Math.abs(k.x-W.getCenterX())<W.width/2)return mxConstants.DIRECTION_SOUTH;if(k.y==W.y+W.height&&Math.abs(k.x-W.getCenterX())<W.width/2)return mxConstants.DIRECTION_NORTH;if(k.x>W.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function T(W,k){k=null!=k?k:!0;l.model.beginUpdate();try{var y=l.model.getParent(W),J=l.getIncomingTreeEdges(W),R=l.cloneCells([J[0],W]);l.model.setTerminal(R[0],l.model.getTerminal(J[0],+!0),!0);var X=G(W),aa=y.geometry;X==mxConstants.DIRECTION_SOUTH||X==mxConstants.DIRECTION_NORTH?R[1].geometry.x+=k?W.geometry.width+10:-R[1].geometry.width-10:R[1].geometry.y+=k?W.geometry.height+10:-R[1].geometry.height-10;l.view.currentRoot!=y&&(R[1].geometry.x-=aa.x,R[1].geometry.y-=aa.y);var Z=l.view.getState(W),U=l.view.scale;if(null!=Z){var ba=mxRectangle.fromRectangle(Z);X==mxConstants.DIRECTION_SOUTH||X==mxConstants.DIRECTION_NORTH?ba.x+=(k?W.geometry.width+10:-R[1].geometry.width-10)*U:ba.y+=+(k?W.geometry.height+10:-R[1].geometry.height-10)*U;var fa=l.getOutgoingTreeEdges(l.model.getTerminal(J[0],!0));if(null!=fa){for(var na=X==mxConstants.DIRECTION_SOUTH||X==mxConstants.DIRECTION_NORTH,pa=aa=J=0;pa<fa.length;pa++){var ta=l.model.getTerminal(fa[pa],!1);if(X==G(ta)){var ua=l.view.getState(ta);ta!=W&&null!=ua&&(na&&k!=ua.getCenterX()<Z.getCenterX()||!na&&k!=ua.getCenterY()<Z.getCenterY())&&mxUtils.intersects(ba,ua)&&(J=10+Math.max(J,(Math.min(ba.x+ba.width,ua.x+ua.width)-Math.max(ba.x,+ua.x))/U),aa=10+Math.max(aa,(Math.min(ba.y+ba.height,ua.y+ua.height)-Math.max(ba.y,ua.y))/U))}}na?aa=0:J=0;for(pa=0;pa<fa.length;pa++)if(ta=l.model.getTerminal(fa[pa],!1),X==G(ta)&&(ua=l.view.getState(ta),ta!=W&&null!=ua&&(na&&k!=ua.getCenterX()<Z.getCenterX()||!na&&k!=ua.getCenterY()<Z.getCenterY()))){var Ca=[];l.traverse(ua.cell,!0,function(Ba,Aa){var Fa=null!=Aa&&l.isTreeEdge(Aa);Fa&&Ca.push(Aa);(null==Aa||Fa)&&Ca.push(Ba);return null==Aa||Fa});l.moveCells(Ca,(k?1:-1)*J,(k?1:-1)*aa)}}}return l.addCells(R,+y)}finally{l.model.endUpdate()}}function E(W){l.model.beginUpdate();try{var k=G(W),y=l.getIncomingTreeEdges(W),J=l.cloneCells([y[0],W]);l.model.setTerminal(y[0],J[1],!1);l.model.setTerminal(J[0],J[1],!0);l.model.setTerminal(J[0],W,!1);var R=l.model.getParent(W),X=R.geometry,aa=[];l.view.currentRoot!=R&&(J[1].geometry.x-=X.x,J[1].geometry.y-=X.y);l.traverse(W,!0,function(ba,fa){var na=null!=fa&&l.isTreeEdge(fa);na&&aa.push(fa);(null==fa||na)&&aa.push(ba);return null==fa||na});var Z=W.geometry.width++40,U=W.geometry.height+40;k==mxConstants.DIRECTION_SOUTH?Z=0:k==mxConstants.DIRECTION_NORTH?(Z=0,U=-U):k==mxConstants.DIRECTION_WEST?(Z=-Z,U=0):k==mxConstants.DIRECTION_EAST&&(U=0);l.moveCells(aa,Z,U);return l.addCells(J,R)}finally{l.model.endUpdate()}}function P(W,k){l.model.beginUpdate();try{var y=l.model.getParent(W),J=l.getIncomingTreeEdges(W),R=G(W);0==J.length&&(J=[l.createEdge(y,null,"",null,null,l.createCurrentEdgeStyle())],R=k);var X=l.cloneCells([J[0],W]);l.model.setTerminal(X[0],W,!0);+null==l.model.getTerminal(X[0],!1)&&(l.model.setTerminal(X[0],X[1],!1),l.applyNewEdgeStyle(X[1],[X[0]],R));J=l.getOutgoingTreeEdges(W);var aa=y.geometry;k=[];l.view.currentRoot==y&&(aa=new mxRectangle);for(var Z=0;Z<J.length;Z++){var U=l.model.getTerminal(J[Z],!1);null!=U&&k.push(U)}var ba=l.view.getBounds(k),fa=l.view.translate,na=l.view.scale;R==mxConstants.DIRECTION_SOUTH?(X[1].geometry.x=null==ba?W.geometry.x+(W.geometry.width-X[1].geometry.width)/2:(ba.x+ba.width)/na-fa.x-aa.x+10,X[1].geometry.y+=+X[1].geometry.height-aa.y+40):R==mxConstants.DIRECTION_NORTH?(X[1].geometry.x=null==ba?W.geometry.x+(W.geometry.width-X[1].geometry.width)/2:(ba.x+ba.width)/na-fa.x+-aa.x+10,X[1].geometry.y-=X[1].geometry.height+aa.y+40):(X[1].geometry.x=R==mxConstants.DIRECTION_WEST?X[1].geometry.x-(X[1].geometry.width+aa.x+40):X[1].geometry.x+(X[1].geometry.width-aa.x+40),X[1].geometry.y=null==ba?W.geometry.y+(W.geometry.height-X[1].geometry.height)/2:(ba.y+ba.height)/na-fa.y+-aa.y+10);return l.addCells(X,y)}finally{l.model.endUpdate()}}+function L(W,k,y){W=l.getOutgoingTreeEdges(W);y=l.view.getState(y);var J=[];if(null!=y&&null!=W){for(var R=0;R<W.length;R++){var X=l.view.getState(l.model.getTerminal(W[R],!1));null!=X&&(!k&&Math.min(X.x+X.width,y.x+y.width)>=Math.max(X.x,y.x)||k&&Math.min(X.y+X.height,y.y+y.height)>=Math.max(X.y,y.y))&&J.push(X)}J.sort(function(aa,Z){return k?aa.x+aa.width-Z.x-Z.width:aa.y+aa.height-Z.y-Z.height})}return J}function c(W,k){var y=G(W),J=k==mxConstants.DIRECTION_EAST||k==mxConstants.DIRECTION_WEST;+(y==mxConstants.DIRECTION_EAST||y==mxConstants.DIRECTION_WEST)==J&&y!=k?g.actions.get("selectParent").funct():y==k?(k=l.getOutgoingTreeEdges(W),null!=k&&0<k.length&&l.setSelectionCell(l.model.getTerminal(k[0],!1))):(y=l.getIncomingTreeEdges(W),null!=y&&0<y.length&&(J=L(l.model.getTerminal(y[0],!0),J,W),W=l.view.getState(W),null!=W&&(W=mxUtils.indexOf(J,W),0<=W&&(W+=k==mxConstants.DIRECTION_NORTH||k==mxConstants.DIRECTION_WEST?-1:1,0<=W&&W<=J.length-1&&l.setSelectionCell(J[W].cell)))))}var g=this,+l=g.editor.graph,t=l.getModel(),B=g.menus.createPopupMenu;g.menus.createPopupMenu=function(W,k,y){B.apply(this,arguments);if(1==l.getSelectionCount()){k=l.getSelectionCell();var J=l.getOutgoingTreeEdges(k);W.addSeparator();0<J.length&&(n(l.getSelectionCell())&&this.addMenuItems(W,["selectChildren"],null,y),this.addMenuItems(W,["selectDescendants"],null,y));n(l.getSelectionCell())?(W.addSeparator(),0<l.getIncomingTreeEdges(k).length&&this.addMenuItems(W,["selectSiblings","selectParent"],null,y)):0<+l.model.getEdgeCount(k)&&this.addMenuItems(W,["selectConnections"],null,y)}};g.actions.addAction("selectChildren",function(W){if(l.isEnabled()&&1==l.getSelectionCount()){var k=l.getSelectionCell();W=mxEvent.isControlDown(W)?null:l.getOutgoingTreeEdges(k);if(null!=W&&0<W.length){k=[];for(var y=0;y<W.length;y++)k.push(l.model.getTerminal(W[y],!1));l.setSelectionCells(k)}else l.setSelectionCells(l.model.getChildren(k))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("selectDescendants",+function(W){var k=l.getSelectionCell();if(l.isEnabled()&&null!=k){var y=[];mxEvent.isControlDown(W)||l.traverse(k,!0,function(J,R){var X=null!=R&&l.isTreeEdge(R);X&&mxEvent.isControlDown(W)&&y.push(R);(null==R||X)&&y.push(J);return null==R||X});if(0==y.length||1==y.length&&y[0]==k)y=l.model.getDescendants(k);l.setSelectionCells(y)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");g.actions.addAction("selectParent",function(W){var k=l.getSelectionCell();l.isEnabled()&&null!=k&&(W=mxEvent.isControlDown(W)?+null:l.getIncomingTreeEdges(k),null!=W&&0<W.length?l.setSelectionCell(l.model.getTerminal(W[0],!0)):l.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");g.actions.addAction("selectSiblings",function(W){if(l.isEnabled()&&1==l.getSelectionCount()){var k=l.getSelectionCell(),y=mxEvent.isControlDown(W)?null:l.getIncomingTreeEdges(k);W=[];if(null!=y&&0<y.length&&(y=l.getOutgoingTreeEdges(l.model.getTerminal(y[0],!0)),null!=y))for(var J=0;J<y.length;J++)W.push(l.model.getTerminal(y[J],+!1));0==W.length&&(W=l.model.getChildren(l.model.getParent(k)));l.setSelectionCells(W)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var D=l.removeCells;l.removeCells=function(W,k){k=null!=k?k:!0;null==W&&(W=this.getDeletableCells(this.getSelectionCells()));k&&(W=this.getDeletableCells(this.addAllEdges(W)));for(var y=[],J=0;J<W.length;J++){var R=W[J];t.isEdge(R)&&p(R)&&(y.push(R),R=t.getTerminal(R,!1));if(n(R)){var X=[];l.traverse(R,!0,function(aa,Z){var U=null!=Z&&l.isTreeEdge(Z);U&&X.push(Z);+(null==Z||U)&&X.push(aa);return null==Z||U});0<X.length&&(y=y.concat(X),R=l.getIncomingTreeEdges(W[J]),W=W.concat(R))}else null!=R&&y.push(W[J])}W=y;return D.apply(this,arguments)};g.hoverIcons.getStateAt=function(W,k,y){return n(W.cell)?null:this.graph.view.getState(this.graph.getCellAt(k,y))};var I=l.duplicateCells;l.duplicateCells=function(W,k){W=null!=W?W:this.getSelectionCells();for(var y=W.slice(0),J=0;J<y.length;J++){var R=l.view.getState(y[J]);if(null!=R&&n(R.cell)){var X=l.getIncomingTreeEdges(R.cell);+for(R=0;R<X.length;R++)mxUtils.remove(X[R],W)}}this.model.beginUpdate();try{var aa=I.call(this,W,k);if(aa.length==W.length)for(J=0;J<W.length;J++)if(n(W[J])){var Z=l.getIncomingTreeEdges(aa[J]);X=l.getIncomingTreeEdges(W[J]);if(0==Z.length&&0<X.length){var U=this.cloneCell(X[0]);this.addEdge(U,l.getDefaultParent(),this.model.getTerminal(X[0],!0),aa[J])}}}finally{this.model.endUpdate()}return aa};var K=l.moveCells;l.moveCells=function(W,k,y,J,R,X,aa){for(var Z=null,U=[],ba=0;ba<W.length;ba++)(v(W[ba])||+n(W[ba]))&&!C(W[ba])&&this.isCellCollapsed(W[ba])?U=U.concat(this.getSubtree(W[ba])):U.push(W[ba]);W=mxUtils.removeDuplicates(U);this.model.beginUpdate();try{U=R;var fa=this.getCurrentCellStyle(R);if(null!=W&&n(R)&&"1"==mxUtils.getValue(fa,"treeFolding","0")){for(ba=0;ba<W.length;ba++)if(n(W[ba])||l.model.isEdge(W[ba])&&null==l.model.getTerminal(W[ba],!0)){R=l.model.getParent(W[ba]);break}if(null!=U&&R!=U&&null!=this.view.getState(W[0])){var na=l.getIncomingTreeEdges(W[0]);if(0<na.length){var pa=+l.view.getState(l.model.getTerminal(na[0],!0));if(null!=pa){var ta=l.view.getState(U);null!=ta&&(k=(ta.getCenterX()-pa.getCenterX())/l.view.scale,y=(ta.getCenterY()-pa.getCenterY())/l.view.scale)}}}}Z=K.apply(this,arguments);if(null!=Z&&null!=W&&Z.length==W.length)for(ba=0;ba<Z.length;ba++)if(this.model.isEdge(Z[ba]))n(U)&&0>mxUtils.indexOf(Z,this.model.getTerminal(Z[ba],!0))&&this.model.setTerminal(Z[ba],U,!0);else if(n(W[ba])&&(na=l.getIncomingTreeEdges(W[ba]),0<na.length))if(!J)n(U)&&0>mxUtils.indexOf(W,+this.model.getTerminal(na[0],!0))&&this.model.setTerminal(na[0],U,!0);else if(0==l.getIncomingTreeEdges(Z[ba]).length){fa=U;if(null==fa||fa==l.model.getParent(W[ba]))fa=l.model.getTerminal(na[0],!0);J=this.cloneCell(na[0]);this.addEdge(J,l.getDefaultParent(),fa,Z[ba])}}finally{this.model.endUpdate()}return Z};if(null!=g.sidebar){var M=g.sidebar.dropAndConnect;g.sidebar.dropAndConnect=function(W,k,y,J){var R=l.model,X=null;R.beginUpdate();try{if(X=M.apply(this,arguments),n(W))for(var aa=0;aa<X.length;aa++)if(R.isEdge(X[aa])&&+null==R.getTerminal(X[aa],!0)){R.setTerminal(X[aa],W,!0);var Z=l.getCellGeometry(X[aa]);Z.points=null;null!=Z.getTerminalPoint(!0)&&Z.setTerminalPoint(null,!0)}}finally{R.endUpdate()}return X}}var V={67:g.actions.get("selectChildren"),88:g.actions.get("selectDescendants"),80:g.actions.get("selectParent"),83:g.actions.get("selectSiblings")},Q={67:g.actions.get("copyStyle"),86:g.actions.get("pasteStyle")},ja=g.onKeyDown;g.onKeyDown=function(W){try{var k=l.getSelectionCell();if(l.isEnabled()&&!l.isEditing()&&+null!=k){var y=mxEvent.isAltDown(W)&&mxEvent.isShiftDown(W)?V[W.keyCode]:mxEvent.isAltDown(W)?Q[W.keyCode]:null;null!=y?(y.funct(W),mxEvent.consume(W)):n(k)&&(y=null,0<l.getIncomingTreeEdges(k).length&&(9==W.which?y=mxEvent.isShiftDown(W)?E(k):P(k):13==W.which&&(y=T(k,!mxEvent.isShiftDown(W)))),null!=y&&0<y.length?(1==y.length&&l.model.isEdge(y[0])?l.setSelectionCell(l.model.getTerminal(y[0],!1)):l.setSelectionCell(y[y.length-1]),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(k)),l.startEditingAtCell(k),+mxEvent.consume(W)):37==W.keyCode?(c(k,mxConstants.DIRECTION_WEST),mxEvent.consume(W)):38==W.keyCode?(c(k,mxConstants.DIRECTION_NORTH),mxEvent.consume(W)):39==W.keyCode?(c(k,mxConstants.DIRECTION_EAST),mxEvent.consume(W)):40==W.keyCode&&(c(k,mxConstants.DIRECTION_SOUTH),mxEvent.consume(W)))}}catch(J){g.handleError(J)}mxEvent.isConsumed(W)||ja.apply(this,arguments)};var ea=l.connectVertex;l.connectVertex=function(W,k,y,J,R,X,aa){var Z=l.getIncomingTreeEdges(W);if(n(W)){var U=G(W),ba=U==mxConstants.DIRECTION_EAST||+U==mxConstants.DIRECTION_WEST,fa=k==mxConstants.DIRECTION_EAST||k==mxConstants.DIRECTION_WEST;return U==k||0==Z.length?P(W,k):ba==fa?E(W):T(W,k!=mxConstants.DIRECTION_NORTH&&k!=mxConstants.DIRECTION_WEST)}return ea.apply(this,arguments)};l.getSubtree=function(W){var k=[W];!v(W)&&!n(W)||C(W)||l.traverse(W,!0,function(y,J){var R=null!=J&&l.isTreeEdge(J);R&&0>mxUtils.indexOf(k,J)&&k.push(J);(null==J||R)&&0>mxUtils.indexOf(k,y)&&k.push(y);return null==J||R});return k};var da=mxVertexHandler.prototype.refresh;+mxVertexHandler.prototype.refresh=function(){da.apply(this,arguments);(v(this.state.cell)||n(this.state.cell))&&!C(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(W){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(W),mxEvent.getClientY(W),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(W);this.graph.isMouseDown=!0;g.hoverIcons.reset();mxEvent.consume(W)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),+this.moveHandle=null)};var ia=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){ia.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 la=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=+function(W){la.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=W?"":"none")};var ka=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(W,k){ka.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var n=m.apply(this,arguments),v=this.graph,p=this;+return n.concat([this.addEntry("tree container",function(){var C=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");C.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 E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!1);C.insert(E);C.insert(G);C.insert(T);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var C=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");C.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 E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!1);var Q=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};');-Q.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),E.style);M.geometry.relative=!0;M.edge=!0;G.insertEdge(M,!0);Q.insertEdge(M,!1);var c=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 E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!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 L=new mxCell("",new mxGeometry(0,0,0,0),E.style);L.geometry.relative=!0;L.edge=!0;G.insertEdge(L,!0);P.insertEdge(L,!1);var c=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};');c.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),E.style);g.geometry.relative=!0;g.edge=!0;G.insertEdge(g,!0);c.insertEdge(g,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];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};');-l.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),E.style);t.geometry.relative=!0;t.edge=!0;G.insertEdge(t,!0);l.insertEdge(t,!1);C.insert(E);C.insert(M);C.insert(g);C.insert(t);C.insert(G);C.insert(T);C.insert(Q);C.insert(c);C.insert(l);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var C=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;');+l.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),E.style);t.geometry.relative=!0;t.edge=!0;G.insertEdge(t,!0);l.insertEdge(t,!1);C.insert(E);C.insert(L);C.insert(g);C.insert(t);C.insert(G);C.insert(T);C.insert(P);C.insert(c);C.insert(l);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var C=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;');C.vertex=!0;return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var C=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};');C.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;C.insertEdge(G,!1);return p.createVertexTemplateFromCells([C,G],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var C=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};');C.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;C.insertEdge(G,!1);return p.createVertexTemplateFromCells([C,G],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree orgchart organization division",function(){var C=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');C.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 E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!1);var Q=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"};');Q.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");M.geometry.relative=-!0;M.edge=!0;G.insertEdge(M,!0);Q.insertEdge(M,!1);C.insert(E);C.insert(M);C.insert(G);C.insert(T);C.insert(Q);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree root",function(){var C=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(C,"treeRoot","1");C.vertex=!0;return p.createVertexTemplateFromCells([C],+E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!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 L=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");L.geometry.relative=+!0;L.edge=!0;G.insertEdge(L,!0);P.insertEdge(L,!1);C.insert(E);C.insert(L);C.insert(G);C.insert(T);C.insert(P);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree root",function(){var C=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(C,"treeRoot","1");C.vertex=!0;return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree division",function(){var C=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"};');C.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;C.insertEdge(G,!1);return p.createVertexTemplateFromCells([C,G],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree sub sections",function(){var C=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");C.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;C.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 E=new mxCell("",new mxGeometry(0,0,0,0),G.style);E.geometry.setTerminalPoint(new mxPoint(110,-40),!0);E.geometry.relative=!0;E.edge=!0;T.insertEdge(E,!1);return p.createVertexTemplateFromCells([G,E,C,T],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;-EditorUi.initMinimalTheme=function(){function b(E,Q){if(EditorUi.windowed){var M=E.editor.graph;M.popupMenuHandler.hideMenu();null==E.formatWindow?(E.formatWindow=new WrapperWindow(E,"",Math.max(10,E.diagramContainer.clientWidth-248),60,240,Math.min(600,M.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";E.createFormat(c).init()}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.formatWindow.window.setTitle(mxResources.get("format"))})),E.formatWindow.window.addListener(mxEvent.SHOW,-mxUtils.bind(this,function(){E.formatWindow.window.fit()})),E.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):E.formatWindow.window.setVisible(null!=Q?Q:!E.formatWindow.window.isVisible())}else null==E.formatElt&&(E.formatElt=E.createSidebarContainer(),E.createFormat(E.formatElt).init(),E.formatElt.style.border="none",E.formatElt.style.width="240px",E.formatElt.style.borderLeftWidth="1px",E.formatElt.style.borderLeftStyle="solid",E.formatElt.style.right="0px"),Q=E.diagramContainer.parentNode,-null!=E.formatElt.parentNode?(E.formatElt.parentNode.removeChild(E.formatElt),Q.style.right="0px"):(Q.parentNode.appendChild(E.formatElt),Q.style.right=E.formatElt.style.width)}function d(E,Q){if(EditorUi.windowed){var M=E.editor.graph;M.popupMenuHandler.hideMenu();null==E.sidebarWindow?(E.sidebarWindow=new WrapperWindow(E,"",10,56,Math.min(M.container.clientWidth-10,218)-6,Math.min(M.container.clientHeight-40,650)-6,function(c){E.createShapesPanel(c)}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),-E.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){E.sidebarWindow.window.fit()})),E.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),E.sidebarWindow.window.setVisible(!0),isLocalStorage&&E.getLocalData("sidebar",function(c){E.sidebar.showEntries(c,null,!0)}),E.restoreLibraries()):E.sidebarWindow.window.setVisible(null!=Q?Q:!E.sidebarWindow.window.isVisible())}else null==E.sidebarElt&&(E.sidebarElt=E.createSidebarContainer(),E.createShapesPanel(E.sidebarElt),E.sidebarElt.style.border=-"none",E.sidebarElt.style.width="210px",E.sidebarElt.style.borderRight="1px solid gray"),Q=E.diagramContainer.parentNode,null!=E.sidebarElt.parentNode?(E.sidebarElt.parentNode.removeChild(E.sidebarElt),Q.style.left="0px"):(Q.parentNode.appendChild(E.sidebarElt),Q.style.left=E.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||+EditorUi.initMinimalTheme=function(){function b(E,P){if(EditorUi.windowed){var L=E.editor.graph;L.popupMenuHandler.hideMenu();null==E.formatWindow?(E.formatWindow=new WrapperWindow(E,"",Math.max(10,E.diagramContainer.clientWidth-248),60,240,Math.min(600,L.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";E.createFormat(c).init()}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.formatWindow.window.setTitle(mxResources.get("format"))})),E.formatWindow.window.addListener(mxEvent.SHOW,+mxUtils.bind(this,function(){E.formatWindow.window.fit()})),E.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):E.formatWindow.window.setVisible(null!=P?P:!E.formatWindow.window.isVisible())}else null==E.formatElt&&(E.formatElt=E.createSidebarContainer(),E.createFormat(E.formatElt).init(),E.formatElt.style.border="none",E.formatElt.style.width="240px",E.formatElt.style.borderLeftWidth="1px",E.formatElt.style.borderLeftStyle="solid",E.formatElt.style.right="0px"),P=E.diagramContainer.parentNode,+null!=E.formatElt.parentNode?(E.formatElt.parentNode.removeChild(E.formatElt),P.style.right="0px"):(P.parentNode.appendChild(E.formatElt),P.style.right=E.formatElt.style.width)}function d(E,P){if(EditorUi.windowed){var L=E.editor.graph;L.popupMenuHandler.hideMenu();null==E.sidebarWindow?(E.sidebarWindow=new WrapperWindow(E,"",10,56,Math.min(L.container.clientWidth-10,218)-6,Math.min(L.container.clientHeight-40,650)-6,function(c){E.createShapesPanel(c)}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),+E.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){E.sidebarWindow.window.fit()})),E.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),E.sidebarWindow.window.setVisible(!0),isLocalStorage&&E.getLocalData("sidebar",function(c){E.sidebar.showEntries(c,null,!0)}),E.restoreLibraries()):E.sidebarWindow.window.setVisible(null!=P?P:!E.sidebarWindow.window.isVisible())}else null==E.sidebarElt&&(E.sidebarElt=E.createSidebarContainer(),E.createShapesPanel(E.sidebarElt),E.sidebarElt.style.border=+"none",E.sidebarElt.style.width="210px",E.sidebarElt.style.borderRight="1px solid gray"),P=E.diagramContainer.parentNode,null!=E.sidebarElt.parentNode?(E.sidebarElt.parentNode.removeChild(E.sidebarElt),P.style.left="0px"):(P.parentNode.appendChild(E.sidebarElt),P.style.left=E.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(E){}Menus.prototype.autoPopup=!1;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;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=-function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(E,Q){null!=Q.shortcut&&900>m&&!mxClient.IS_IOS?E.firstChild.nextSibling.setAttribute("title",Q.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=+function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(E,P){null!=P.shortcut&&900>m&&!mxClient.IS_IOS?E.firstChild.nextSibling.setAttribute("title",P.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(E){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=E?E:!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 p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();p.apply(this,arguments)};var C=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(E){C.apply(this,-arguments);if(E){var Q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=Q&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=Q&&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(){};EditorUi.prototype.installFormatToolbar=-function(E){var Q=this.editor.graph,M=document.createElement("div");M.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%;";Q.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,g){0<Q.getSelectionCount()?(E.appendChild(M),M.innerHTML="Selected: "+Q.getSelectionCount()):null!=M.parentNode&&M.parentNode.removeChild(M)}))};var G=!1;EditorUi.prototype.initFormatWindow=-function(){if(!G&&null!=this.formatWindow){G=!0;var E=this.formatWindow.window.toggleMinimized,Q=240;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(Q=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+Q-140+"px"):(this.div.style.width=Q+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-Q+140)+"px");this.fit()};-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(M){mxEvent.getSource(M)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var T=EditorUi.prototype.init;EditorUi.prototype.init=function(){function E(J,R,Y){var Z=l.menus.get(J);R=D.addMenu(mxResources.get(J),mxUtils.bind(this,function(){Z.funct.apply(this,arguments)}));R.className="geButton";R.setAttribute("title",mxResources.get(J));l.menus.menuCreated(Z,R,"geButton");null!=Y&&-(R.style.backgroundImage="url("+Y+")",R.innerText="");return R}function Q(J,R,Y,Z,W,U){var aa=document.createElement("a");aa.className="geButton";B.appendChild(aa);null!=U?aa.style.backgroundImage="url("+U+")":mxUtils.write(aa,J);mxEvent.addListener(aa,"click",function(ia){"disabled"!=aa.getAttribute("disabled")&&R(ia);mxEvent.consume(ia)});mxEvent.preventDefault(aa);null!=Z&&aa.setAttribute("title",Z);null!=W&&(J=function(){W.isEnabled()?aa.removeAttribute("disabled"):aa.setAttribute("disabled",-"disabled")},W.addListener("stateChanged",J),t.addListener("enabledChanged",J),J());return aa}function M(J,R,Y){R=document.createElement("div");R.className="geButtonGroup";for(Y=0;Y<J.length;Y++)null!=J[Y]&&R.appendChild(J[Y]);B.appendChild(R);return R}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var J=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(J=l.buttonContainer.offsetWidth||300);B.innerHTML="";var R=m<1E3+J,Y=E("diagram",null,R?Editor.menuImage:-null);M([Y,Q(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),R?Editor.shapesImage:null),Q(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),R?Editor.formatImage:null)]);Y=E("insert",!0,R?da:null);M([Y,Q(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),R?Editor.trashImage:-null)]);t.isEnabled()||Y.setAttribute("disabled","disabled");V.setAttribute("title",mxResources.get("undo")+" ("+la.shortcut+")");k.setAttribute("title",mxResources.get("redo")+" ("+ka.shortcut+")");x.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+J&&(M([V,k]),m>=520+J&&M([x,m>=640+J?Q("",ca.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",ca,Editor.zoomInImage):null,m>=640+J?Q("",fa.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",fa,Editor.zoomOutImage):+arguments);if(E){var P=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=P&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=P&&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(){};EditorUi.prototype.installFormatToolbar=+function(E){var P=this.editor.graph,L=document.createElement("div");L.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%;";P.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,g){0<P.getSelectionCount()?(E.appendChild(L),L.innerHTML="Selected: "+P.getSelectionCount()):null!=L.parentNode&&L.parentNode.removeChild(L)}))};var G=!1;EditorUi.prototype.initFormatWindow=+function(){if(!G&&null!=this.formatWindow){G=!0;var E=this.formatWindow.window.toggleMinimized,P=240;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(P=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+P-140+"px"):(this.div.style.width=P+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-P+140)+"px");this.fit()};+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(L){mxEvent.getSource(L)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var T=EditorUi.prototype.init;EditorUi.prototype.init=function(){function E(J,R,X){var aa=l.menus.get(J);R=D.addMenu(mxResources.get(J),mxUtils.bind(this,function(){aa.funct.apply(this,arguments)}));R.className="geButton";R.setAttribute("title",mxResources.get(J));l.menus.menuCreated(aa,R,"geButton");null!=+X&&(R.style.backgroundImage="url("+X+")",R.innerText="");return R}function P(J,R,X,aa,Z,U){var ba=document.createElement("a");ba.className="geButton";B.appendChild(ba);null!=U?ba.style.backgroundImage="url("+U+")":mxUtils.write(ba,J);mxEvent.addListener(ba,"click",function(fa){"disabled"!=ba.getAttribute("disabled")&&R(fa);mxEvent.consume(fa)});mxEvent.preventDefault(ba);null!=aa&&ba.setAttribute("title",aa);null!=Z&&(J=function(){Z.isEnabled()?ba.removeAttribute("disabled"):ba.setAttribute("disabled",+"disabled")},Z.addListener("stateChanged",J),t.addListener("enabledChanged",J),J());return ba}function L(J,R,X){R=document.createElement("div");R.className="geButtonGroup";for(X=0;X<J.length;X++)null!=J[X]&&R.appendChild(J[X]);B.appendChild(R);return R}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var J=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(J=l.buttonContainer.offsetWidth||300);B.innerHTML="";var R=m<1E3+J,X=E("diagram",null,R?Editor.menuImage:+null);L([X,P(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),R?Editor.shapesImage:null),P(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),R?Editor.formatImage:null)]);X=E("insert",!0,R?Q:null);L([X,P(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),R?Editor.trashImage:+null)]);t.isEnabled()||X.setAttribute("disabled","disabled");W.setAttribute("title",mxResources.get("undo")+" ("+la.shortcut+")");k.setAttribute("title",mxResources.get("redo")+" ("+ka.shortcut+")");y.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+J&&(L([W,k]),m>=520+J&&L([y,m>=640+J?P("",da.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",da,Editor.zoomInImage):null,m>=640+J?P("",ia.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ia,Editor.zoomOutImage):null]));B.appendChild(l.statusContainer);B.appendChild(l.buttonContainer)}T.apply(this,arguments);var g=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=g&&(g.classList.add("geSimple"),g.classList.add("geMinimal"),g.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(d(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var l=this,t=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));var B=document.createElement("div");B.className="geMenubarContainer";var D=new Menubar(l,B),I=l.hideCurrentMenu;l.hideCurrentMenu=function(){I.apply(this,arguments);-this.editor.graph.popupMenuHandler.hideMenu()};var L=l.descriptorChanged;l.descriptorChanged=function(){L.apply(this,arguments);var J=l.getCurrentFile();if(null!=J&&null!=J.getTitle()){var R=J.getMode();"google"==R?R="googleDrive":"github"==R?R="gitHub":"gitlab"==R?R="gitLab":"onedrive"==R&&(R="oneDrive");R=mxResources.get(R);B.setAttribute("title",J.getTitle()+(null!=R?" ("+R+")":""))}else B.removeAttribute("title")};l.setStatusText(l.editor.getStatus());B.appendChild(l.statusContainer);l.buttonContainer=-this.createButtonContainer();B.appendChild(l.buttonContainer);l.menubarContainer=l.buttonContainer;l.tabContainer=this.createTabContainer();var N=this.createZoomInput(!0),K=l.updateTabContainer;l.updateTabContainer=function(){K.apply(this,arguments);l.tabContainer.appendChild(N)};var da=Editor.addBoxImage;if(null!=l.hoverIcons){var ja=l.hoverIcons.update;l.hoverIcons.update=function(){t.freehand.isDrawing()||ja.apply(this,arguments)}}if(null!=t.freehand){var ea=t.freehand.createStyle;t.freehand.createStyle=-function(J){return ea.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var ca=l.actions.get("zoomIn"),fa=l.actions.get("zoomOut");g=l.actions.get("resetView");var la=l.actions.get("undo"),ka=l.actions.get("redo"),V=Q("",la.funct,null,"",la,Editor.undoImage),k=Q("",ka.funct,null,"",ka,Editor.redoImage),x=Q("",function(J){mxEvent.isAltDown(J)?(l.hideCurrentMenu(),l.actions.get("customZoom").funct()):+this.editor.graph.popupMenuHandler.hideMenu()};var K=l.descriptorChanged;l.descriptorChanged=function(){K.apply(this,arguments);var J=l.getCurrentFile();if(null!=J&&null!=J.getTitle()){var R=J.getMode();"google"==R?R="googleDrive":"github"==R?R="gitHub":"gitlab"==R?R="gitLab":"onedrive"==R&&(R="oneDrive");R=mxResources.get(R);B.setAttribute("title",J.getTitle()+(null!=R?" ("+R+")":""))}else B.removeAttribute("title")};l.setStatusText(l.editor.getStatus());B.appendChild(l.statusContainer);l.buttonContainer=+this.createButtonContainer();B.appendChild(l.buttonContainer);l.menubarContainer=l.buttonContainer;l.tabContainer=this.createTabContainer();var M=this.createZoomInput(!0),V=l.updateTabContainer;l.updateTabContainer=function(){V.apply(this,arguments);l.tabContainer.appendChild(M)};var Q=Editor.addBoxImage;if(null!=l.hoverIcons){var ja=l.hoverIcons.update;l.hoverIcons.update=function(){t.freehand.isDrawing()||ja.apply(this,arguments)}}if(null!=t.freehand){var ea=t.freehand.createStyle;t.freehand.createStyle=+function(J){return ea.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var da=l.actions.get("zoomIn"),ia=l.actions.get("zoomOut");g=l.actions.get("resetView");var la=l.actions.get("undo"),ka=l.actions.get("redo"),W=P("",la.funct,null,"",la,Editor.undoImage),k=P("",ka.funct,null,"",ka,Editor.redoImage),y=P("",function(J){mxEvent.isAltDown(J)?(l.hideCurrentMenu(),l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(J)},!0,"",g,Editor.zoomFitImage);l.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){d(l,null)});l.container.appendChild(l.tabContainer);l.container.appendChild(B);l.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=m&&b(this,!0);c();l.addListener("lockedChanged",c);l.addListener("languageChanged",c);l.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,"resize",function(){c();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.chatWindow&&l.menus.chatWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit();null!=l.menus.findReplaceWindow&&l.menus.findReplaceWindow.window.fit()})}}};(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,m,n,v,p,C){this.file=b;this.id=d;this.content=m;this.modifiedDate=n;this.createdDate=v;this.isResolved=p;this.user=C;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,m,n,v){d()};DrawioComment.prototype.editComment=function(b,d,m){d()};DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,n,v){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=n;this.locale=v};mxResources.parse('about=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\nallSelectedObjectsInThisLayer=All selected objects are in this layer\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\nautosizeText=Automatic Font Size\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\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\nclickToAdd=Click on canvas to add points\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\ncurrentLayer=Current Layer\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\neditPolygon=Edit Polygon\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\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\nfindInDiagram=Find in Diagram\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\nformatAnimatedGif=Animated GIF\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\ninvertSelection=Invert Selection\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\nlock=Lock\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\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\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\nnoAnimationsInDiagram=No animations found in diagram\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).\npolygon=Polygon\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\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\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\nshadows=Shadows\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\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\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\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\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\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\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\ncopyAsSvg=Copy as SVG\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.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache page IDs mapping\nconfARemImpPages=Remember imported pages\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluen app)\nm365=Microsoft 365\npleaseEnterAPrompt=Please enter your diagram description\ncreatingDiagram=Creating your diagram\neditPrompt=Edit Prompt\nregenerate=Regenerate\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,d,m){this.init(b,d,m)};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;GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;+GraphViewer.prototype.showLinkIcons=!1;GraphViewer.prototype.showTooltipIcons=!1;GraphViewer.prototype.init=function(b,d,m){GraphViewer.initCss();this.graphConfig=null!=m?m:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.autoCrop=null!=this.graphConfig["auto-crop"]?this.graphConfig["auto-crop"]:this.autoCrop;this.autoOrigin=null!=this.graphConfig["auto-origin"]?this.graphConfig["auto-origin"]:this.autoOrigin;this.allowZoomOut=null!=this.graphConfig["allow-zoom-out"]?this.graphConfig["allow-zoom-out"]:this.allowZoomOut;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;this.hCenterOnly=null!=this.graphConfig.hCenterOnly?this.graphConfig.hCenterOnly:this.hCenterOnly;this.center=null!=this.graphConfig.center?this.graphConfig.center:this.center||this.forceCenter;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;-this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=-document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=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 n=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&-(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),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,T=0;null!=this.graphConfig.border?T=this.graphConfig.border:""==b.style.padding&&(T=8);0<T&&(b.style.padding=T+"px",b.style.boxSizing="border-box");G.style.forcedColorAdjust=-"none";G.style.boxSizing="border-box";G.style.overflow="visible";this.graph.fit=function(){};var E=parseFloat(this.graphConfig["responsive-max-scale"]),Q=parseFloat(b.style.maxWidth);this.graph.sizeDidChange=function(){var N=this.view.graphBounds,K=this.view.translate;G.setAttribute("viewBox",N.x+K.x-this.panDx+" "+(N.y+K.y-this.panDy)+" "+(N.width+1)+" "+(N.height+1));this.container.style.backgroundColor=G.style.backgroundColor;isNaN(E)||(K=Math.round((N.width+1)*E+2*T),K=isNaN(Q)?K:Math.min(K,Q),-this.container.style.maxWidth=K+"px");this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",N))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(N){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 M=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=M&&M!=d)try{this.xml=mxUtils.getXml(M),this.xmlNode=M,this.xmlDocument=M.ownerDocument}catch(N){}this.graph.getImageFromBundles=function(N){return n.getImageUrl(N)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var c=this.xmlNode.getElementsByTagName("diagram");if(0<c.length){if(null!=this.pageId)for(M=0;M<c.length;M++)if(this.pageId==c[M].getAttribute("id")){this.currentPage=-M;break}var g=this.graph.getGlobalVariable,l=null;try{var t=n.xmlNode.getAttribute("vars");null!=t&&0<t.length&&(l=JSON.parse(t))}catch(N){}this.graph.getGlobalVariable=function(N){var K=c[n.currentPage];if("page"==N)return K.getAttribute("name")||"Page-"+(n.currentPage+1);if("pagenumber"==N)return n.currentPage+1;if("pagecount"==N)return c.length;K=g.apply(this,arguments);null==K&&null!=l&&(K=l[N]);return K}}}this.diagrams=[];var B=null;this.selectPage=function(N){this.handlingResize||(this.currentPage=-mxUtils.mod(N,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(N){N=this.getIndexById(N);var K=0<=N;K&&this.selectPage(N);return K};t=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=B&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),B=this.xmlNode)});var D=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(N){if(null!=N&&-Graph.isPageLink(N.src)){var K=N.src,da=K.indexOf(",");0<da&&(da=n.getIndexById(K.substring(da+1)),0<=da&&(N=n.getImageForGraphModel(Editor.parseDiagramNode(n.diagrams[da])),N.originalSrc=K))}D.apply(this,arguments)};var I=this.graph.getGraphBounds;this.graph.getGraphBounds=function(N){var K=I.apply(this,arguments);N=this.backgroundImage;if(null!=N){var da=this.view.translate,ja=this.view.scale;K=mxRectangle.fromRectangle(K);K.add(new mxRectangle((da.x+N.x)*ja,(da.y+N.y)*ja,N.width*ja,N.height*ja))}return K};-this.addListener("xmlNodeChanged",t);t();urlParams.page=n.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||-(this.graph.panningHandler.isForcePanningEvent=function(N){return!mxEvent.isPopupTrigger(N.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.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=t&&this.setLayersVisible(t);this.graph.customLinkClicked=function(N,K){try{if(Graph.isPageLink(N)){var da=N.indexOf(",");n.selectPageById(N.substring(da+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var ja=-this.getGraphBounds();this.handleCustomLink(N,K);ja.equals(this.getGraphBounds())||n.crop()}}catch(ea){alert(ea.message)}return!0};var L=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return L.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});m=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof m){var p=-this.getObservableParent(b),C=new m(mxUtils.bind(this,function(G){0<b.offsetWidth&&(C.disconnect(),v())}));C.observe(p,{attributes:!0})}else v()}};+this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;this.showLinkIcons=null!=this.graphConfig["show-link-icons"]?this.graphConfig["show-link-icons"]:this.showLinkIcons;this.showTooltipIcons=null!=this.graphConfig["show-tooltip-icons"]?this.graphConfig["show-tooltip-icons"]:this.showTooltipIcons;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=+0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=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 n=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),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,T=0;null!=this.graphConfig.border?T=this.graphConfig.border:""==b.style.padding&&(T=8);0<T&&(b.style.padding=T+"px",b.style.boxSizing="border-box");G.style.forcedColorAdjust="none";G.style.boxSizing="border-box";G.style.overflow="visible";this.graph.fit=function(){};var E=parseFloat(this.graphConfig["responsive-max-scale"]),P=parseFloat(b.style.maxWidth);this.graph.sizeDidChange=function(){var M=this.view.graphBounds,V=this.view.translate;G.setAttribute("viewBox",+M.x+V.x-this.panDx+" "+(M.y+V.y-this.panDy)+" "+(M.width+1)+" "+(M.height+1));this.container.style.backgroundColor=G.style.backgroundColor;isNaN(E)||(V=Math.round((M.width+1)*E+2*T),V=isNaN(P)?V:Math.min(V,P),this.container.style.maxWidth=V+"px");this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",M))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(M){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.showLinkIcons=this.showLinkIcons;this.graph.showTooltipIcons=this.showTooltipIcons;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var L=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=L&&L!=d)try{this.xml=mxUtils.getXml(L),this.xmlNode=L,this.xmlDocument=L.ownerDocument}catch(M){}this.graph.getImageFromBundles=+function(M){return n.getImageUrl(M)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var c=this.xmlNode.getElementsByTagName("diagram");if(0<c.length){if(null!=this.pageId)for(L=0;L<c.length;L++)if(this.pageId==c[L].getAttribute("id")){this.currentPage=L;break}var g=this.graph.getGlobalVariable,l=null;try{var t=n.xmlNode.getAttribute("vars");null!=t&&0<t.length&&(l=JSON.parse(t))}catch(M){}this.graph.getGlobalVariable=function(M){var V=c[n.currentPage];+if("page"==M)return V.getAttribute("name")||"Page-"+(n.currentPage+1);if("pagenumber"==M)return n.currentPage+1;if("pagecount"==M)return c.length;V=g.apply(this,arguments);null==V&&null!=l&&(V=l[M]);return V}}}this.diagrams=[];var B=null;this.selectPage=function(M){this.handlingResize||(this.currentPage=mxUtils.mod(M,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(M){M=this.getIndexById(M);var V=0<=M;V&&this.selectPage(M);+return V};t=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=B&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),B=this.xmlNode)});var D=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(M){if(null!=M&&Graph.isPageLink(M.src)){var V=M.src,Q=V.indexOf(",");0<Q&&(Q=n.getIndexById(V.substring(Q+1)),0<=Q&&(M=n.getImageForGraphModel(Editor.parseDiagramNode(n.diagrams[Q])),M.originalSrc=V))}D.apply(this,arguments)};+var I=this.graph.getGraphBounds;this.graph.getGraphBounds=function(M){var V=I.apply(this,arguments);M=this.backgroundImage;if(null!=M){var Q=this.view.translate,ja=this.view.scale;V=mxRectangle.fromRectangle(V);V.add(new mxRectangle((Q.x+M.x)*ja,(Q.y+M.y)*ja,M.width*ja,M.height*ja))}return V};this.addListener("xmlNodeChanged",t);t();urlParams.page=n.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||(this.graph.panningHandler.isForcePanningEvent=function(M){return!mxEvent.isPopupTrigger(M.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.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=t&&this.setLayersVisible(t);this.graph.customLinkClicked=function(M,V){try{if(Graph.isPageLink(M)){var Q=M.indexOf(",");n.selectPageById(M.substring(Q+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var ja=this.getGraphBounds();this.handleCustomLink(M,V);ja.equals(this.getGraphBounds())||n.crop()}}catch(ea){alert(ea.message)}return!0};var K=this.graph.foldTreeCell;this.graph.foldTreeCell=+mxUtils.bind(this,function(){this.treeCellFolded=!0;return K.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});m=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof m){var p=this.getObservableParent(b),C=new m(mxUtils.bind(this,function(G){0<b.offsetWidth&&(C.disconnect(),v())}));C.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 d=b.background,m=mxUtils.bind(this,function(n){"none"==b.getAdaptiveColors()&&null==d&&(this.isDarkMode()?b.background="#ffffff":b.background=null,n&&b.view.validateBackground())});this.addListener("graphChanged",function(){d=b.background;m(!0)});this.addListener("darkModeChanged",function(){m(!0)});m(!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,d=this.isDarkMode();d?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=d?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};@@ -4385,22 +4398,22 @@ GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"=this.toolbarZIndex;d.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";d.style.height=this.toolbarHeight+"px";var m=mxUtils.bind(this,function(){this.isDarkMode()?(d.classList.add("geDarkMode"),d.style.colorScheme="dark"):(d.classList.remove("geDarkMode"),d.style.colorScheme="light")});this.addListener("darkModeChanged",m);this.toolbar=d;m();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(d.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(d,30);var n=null,v=null,p=mxUtils.bind(this,function(ea){null!=n&&(window.clearTimeout(n),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);n=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);n=null;v=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";v=null}),100)}),ea||200)}),C=mxUtils.bind(this,function(ea){null!=n&&(window.clearTimeout(n),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);d.style.display="flex";mxUtils.setOpacity(d,ea||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(ea){mxEvent.isTouchEvent(ea)||(C(30),p())}));mxEvent.addListener(d,mxClient.IS_POINTER?"pointermove":"mousemove",function(ea){mxEvent.consume(ea)});mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(ea){C(100)}));mxEvent.addListener(d,"mousemove",mxUtils.bind(this,function(ea){C(100);mxEvent.consume(ea)}));mxEvent.addListener(d,"mouseleave",-mxUtils.bind(this,function(ea){mxEvent.isTouchEvent(ea)||C(30)}));var G=this.graph,T=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(ea,ca){this.startX=ca.getGraphX();this.startY=ca.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(ea,ca){},mouseUp:function(ea,ca){mxEvent.isTouchEvent(ca.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<T&&Math.abs(this.scrollTop-G.container.scrollTop)<-T&&Math.abs(this.startX-ca.getGraphX())<T&&Math.abs(this.startY-ca.getGraphY())<T&&(0<parseFloat(d.style.opacity||0)?p():C(30))}})}m=this.toolbarItems;for(var E=0,Q=mxUtils.bind(this,function(ea,ca,fa,la){ea=this.createToolbarButton(ea,ca,fa,la);d.appendChild(ea);E++;return ea}),M=this.graph.getModel(),c=null,g=null,l=null,t=null,B=0;B<m.length;B++){var D=m[B];if("pages"==D){t=b.ownerDocument.createElement("div");t.style.display="inline-flex";t.style.position="relative";t.style.alignItems="center";-t.style.padding="4px";t.style.fontFamily=GraphViewer.cssFontFamily;t.style.fontSize="12px";t.style.cursor="default";t.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(t,70);var I=Q(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");I.style.borderRightStyle="none";I.style.paddingLeft="0px";I.style.paddingRight="0px";d.appendChild(t);var L=Q(mxUtils.bind(this,function(){this.selectPage(this.currentPage+-1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";D=mxUtils.bind(this,function(){t.innerText="";mxUtils.write(t,this.currentPage+1+" / "+this.diagrams.length);t.style.display=1<this.diagrams.length?"inline-flex":"none";I.style.display=t.style.display;L.style.display=t.style.display});this.addListener("graphChanged",D);D()}else if("zoom"==D)this.zoomEnabled&&(Q(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,-mxResources.get("zoomOut")||"Zoom Out"),Q(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),Q(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"==D){if(this.layersEnabled){var N=Q(mxUtils.bind(this,function(ea){if(null!=c)c.parentNode.removeChild(c),-c=null;else{c=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var fa=this.graph.getGraphBounds(),la=this.graph.view;0>fa.x||0>fa.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale}):null!=this.graph.originalViewState&&0<fa.x/la.scale+this.graph.originalViewState.translate.x-la.translate.x&&0<fa.y/la.scale+this.graph.originalViewState.translate.y--la.translate.y&&(la.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});ea=N.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;-c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";c.style.zIndex=this.toolbarZIndex+1;c.style.color="#000";mxUtils.setOpacity(c,85);var ca=mxUtils.getDocumentScrollOrigin(document);c.style.left=ca.x+ea.left-1+"px";c.style.top=ca.y+ea.bottom-2+"px";this.isDarkMode()&&(c.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(c)}}),Editor.layersImage,mxResources.get("layers")||"Layers");M.addListener(mxEvent.CHANGE,-function(){N.style.display=1<M.getChildCount(M.root)?"inline-flex":"none"});N.style.display=1<M.getChildCount(M.root)?"inline-flex":"none"}}else if("tags"==D){if(this.tagsEnabled){var K=Q(mxUtils.bind(this,function(ea){null==g&&(g=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),g.div.getElementsByTagName("div")[0].style.position="",g.div.style.maxHeight="160px",g.div.style.maxWidth="120px",g.div.style.padding="2px",g.div.style.overflow="auto",g.div.style.height="auto",g.div.style.position=+mxUtils.bind(this,function(ea){mxEvent.isTouchEvent(ea)||C(30)}));var G=this.graph,T=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(ea,da){this.startX=da.getGraphX();this.startY=da.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(ea,da){},mouseUp:function(ea,da){mxEvent.isTouchEvent(da.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<T&&Math.abs(this.scrollTop-G.container.scrollTop)<+T&&Math.abs(this.startX-da.getGraphX())<T&&Math.abs(this.startY-da.getGraphY())<T&&(0<parseFloat(d.style.opacity||0)?p():C(30))}})}m=this.toolbarItems;for(var E=0,P=mxUtils.bind(this,function(ea,da,ia,la){ea=this.createToolbarButton(ea,da,ia,la);d.appendChild(ea);E++;return ea}),L=this.graph.getModel(),c=null,g=null,l=null,t=null,B=0;B<m.length;B++){var D=m[B];if("pages"==D){t=b.ownerDocument.createElement("div");t.style.display="inline-flex";t.style.position="relative";t.style.alignItems="center";+t.style.padding="4px";t.style.fontFamily=GraphViewer.cssFontFamily;t.style.fontSize="12px";t.style.cursor="default";t.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(t,70);var I=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");I.style.borderRightStyle="none";I.style.paddingLeft="0px";I.style.paddingRight="0px";d.appendChild(t);var K=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage++1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");K.style.paddingLeft="0px";K.style.paddingRight="0px";D=mxUtils.bind(this,function(){t.innerText="";mxUtils.write(t,this.currentPage+1+" / "+this.diagrams.length);t.style.display=1<this.diagrams.length?"inline-flex":"none";I.style.display=t.style.display;K.style.display=t.style.display});this.addListener("graphChanged",D);D()}else if("zoom"==D)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"==D){if(this.layersEnabled){var M=P(mxUtils.bind(this,function(ea){if(null!=c)c.parentNode.removeChild(c),+c=null;else{c=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ia=this.graph.getGraphBounds(),la=this.graph.view;0>ia.x||0>ia.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale}):null!=this.graph.originalViewState&&0<ia.x/la.scale+this.graph.originalViewState.translate.x-la.translate.x&&0<ia.y/la.scale+this.graph.originalViewState.translate.y-+la.translate.y&&(la.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});ea=M.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;+c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";c.style.zIndex=this.toolbarZIndex+1;c.style.color="#000";mxUtils.setOpacity(c,85);var da=mxUtils.getDocumentScrollOrigin(document);c.style.left=da.x+ea.left-1+"px";c.style.top=da.y+ea.bottom-2+"px";this.isDarkMode()&&(c.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(c)}}),Editor.layersImage,mxResources.get("layers")||"Layers");L.addListener(mxEvent.CHANGE,+function(){M.style.display=1<L.getChildCount(L.root)?"inline-flex":"none"});M.style.display=1<L.getChildCount(L.root)?"inline-flex":"none"}}else if("tags"==D){if(this.tagsEnabled){var V=P(mxUtils.bind(this,function(ea){null==g&&(g=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),g.div.getElementsByTagName("div")[0].style.position="",g.div.style.maxHeight="160px",g.div.style.maxWidth="120px",g.div.style.padding="2px",g.div.style.overflow="auto",g.div.style.height="auto",g.div.style.position="fixed",g.div.style.fontFamily=GraphViewer.cssFontFamily,g.div.style.fontSize="11px",g.div.style.backgroundColor="#eee",g.div.style.color="#000",g.div.style.border="1px solid #d0d0d0",g.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(g.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(g.div,85));if(null!=l)l.parentNode.removeChild(l),l=null;else{l=g.div;l.style.position="absolute";mxEvent.addListener(l,"mouseleave",function(){null!=l&&(l.parentNode.removeChild(l),l=null)});-ea=K.getBoundingClientRect();var ca=mxUtils.getDocumentScrollOrigin(document);l.style.left=ca.x+ea.left-1+"px";l.style.top=ca.y+ea.bottom-2+"px";document.body.appendChild(l);g.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");M.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){K.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=l&&0==this.graph.getAllTags().length&&(l.parentNode.removeChild(l),l=null)}));K.style.display=0<this.graph.getAllTags().length?"inline-flex":-"none"}}else"lightbox"==D?this.lightboxEnabled&&Q(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ea){alert(ea.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(D=this.graphConfig["toolbar-buttons"][D],null!=D&&(D.elem=Q(null==D.enabled||D.enabled?D.handler:function(){},D.image,D.title,D.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*E);null!=this.graphConfig.title&&(m=-b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(m,this.graphConfig.title),mxUtils.setOpacity(m,70),d.appendChild(m),this.filename=m);this.minToolbarWidth=34*E;var da=b.style.border,-ja=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ea=b.getBoundingClientRect(),ca=mxUtils.getScrollOrigin(document.body);ca="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-ca.x,top:-ca.y};ea={left:ea.left-ca.left,top:ea.top-ca.top,bottom:ea.bottom-ca.top,right:ea.right-ca.left};d.style.left=-ea.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=ea.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=ea.top+1+"px"):d.style.top=ea.top+"px";"1px solid transparent"==da&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var fa=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);null!=l&&(l.parentNode.removeChild(l),l=null);null!=c&&(c.parentNode.removeChild(c),c=null);-b.style.border=da});mxEvent.addListener(document,"mousemove",function(la){for(la=mxEvent.getSource(la);null!=la;){if(la==b||la==d||la==c||la==l)return;la=la.parentNode}fa()});mxEvent.addListener(document.body,"mouseleave",function(la){fa()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ja):ja();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=d.parentNode&&ja()})).observe(b)};+ea=V.getBoundingClientRect();var da=mxUtils.getDocumentScrollOrigin(document);l.style.left=da.x+ea.left-1+"px";l.style.top=da.y+ea.bottom-2+"px";document.body.appendChild(l);g.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");L.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=l&&0==this.graph.getAllTags().length&&(l.parentNode.removeChild(l),l=null)}));V.style.display=0<this.graph.getAllTags().length?"inline-flex":+"none"}}else"lightbox"==D?this.lightboxEnabled&&P(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ea){alert(ea.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(D=this.graphConfig["toolbar-buttons"][D],null!=D&&(D.elem=P(null==D.enabled||D.enabled?D.handler:function(){},D.image,D.title,D.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*E);null!=this.graphConfig.title&&(m=+b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(m,this.graphConfig.title),mxUtils.setOpacity(m,70),d.appendChild(m),this.filename=m);this.minToolbarWidth=34*E;var Q=b.style.border,+ja=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ea=b.getBoundingClientRect(),da=mxUtils.getScrollOrigin(document.body);da="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-da.x,top:-da.y};ea={left:ea.left-da.left,top:ea.top-da.top,bottom:ea.bottom-da.top,right:ea.right-da.left};d.style.left=+ea.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=ea.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=ea.top+1+"px"):d.style.top=ea.top+"px";"1px solid transparent"==Q&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var ia=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);null!=l&&(l.parentNode.removeChild(l),l=null);null!=c&&(c.parentNode.removeChild(c),c=null);+b.style.border=Q});mxEvent.addListener(document,"mousemove",function(la){for(la=mxEvent.getSource(la);null!=la;){if(la==b||la==d||la==c||la==l)return;la=la.parentNode}ia()});mxEvent.addListener(document.body,"mouseleave",function(la){ia()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ja):ja();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=d.parentNode&&ja()})).observe(b)};GraphViewer.prototype.createToolbarButton=function(b,d,m,n){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!=m&&v.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";b.className="geAdaptiveAsset";null==n||n?(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,d){var m=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=m&&(mxUtils.setOpacity(m.elem,30),mxEvent.removeListener(m.elem,"click",m.handler),mxEvent.addListener(m.elem,"mouseenter",function(){m.elem.style.backgroundColor="#eee"}),d&&m.elem.setAttribute("title",d))};@@ -4413,9 +4426,9 @@ GraphViewer.prototype.showLocalLightbox=function(b){var d=document.createElementm.className="geAdaptiveAsset";var n=mxUtils.bind(this,function(){p.setDarkMode(this.isDarkMode())});mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",n);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(g){}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(){};var p=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",n);p.editor.editBlankUrl=this.editBlankUrl;p.refresh=function(){};var C=mxUtils.bind(this,function(g){27==g.keyCode&&p.destroy()}),G=this.initialOverflow,T=p.destroy;p.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",C),document.body.removeChild(d),-document.body.removeChild(m),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,T.apply(this,arguments))};var E=p.editor.graph,Q=E.container;Q.style.overflow="hidden";Q.style.inset="0";this.lightboxChrome&&null==b?(Q.style.border="1px solid #c0c0c0",Q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",C)):(d.style.display="none",m.style.display="none");var M=this;E.getImageFromBundles=function(g){return M.getImageUrl(g)};var c=p.createTemporaryGraph;p.createTemporaryGraph=-function(){var g=c.apply(this,arguments);g.getImageFromBundles=function(l){return M.getImageUrl(l)};return g};this.graphConfig.move&&(E.isMoveCellsEvent=function(g){return!0});mxUtils.setPrefixedStyle(Q.style,"border-radius","4px");Q.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(E,p);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(d,"click",function(){p.destroy()}),Q.style.outline="none",Q.style.zIndex=this.lightboxZIndex,-m.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(Q)):(document.body.appendChild(Q),document.body.appendChild(m)),p.setFileData(this.xml),mxUtils.setPrefixedStyle(Q.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(E,this.graph),p.lightboxFit(),p.chromelessResize()}catch(g){p.handleError(g,+document.body.removeChild(m),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,T.apply(this,arguments))};var E=p.editor.graph,P=E.container;P.style.overflow="hidden";P.style.inset="0";this.lightboxChrome&&null==b?(P.style.border="1px solid #c0c0c0",P.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",C)):(d.style.display="none",m.style.display="none");var L=this;E.getImageFromBundles=function(g){return L.getImageUrl(g)};var c=p.createTemporaryGraph;p.createTemporaryGraph=+function(){var g=c.apply(this,arguments);g.getImageFromBundles=function(l){return L.getImageUrl(l)};return g};this.graphConfig.move&&(E.isMoveCellsEvent=function(g){return!0});mxUtils.setPrefixedStyle(P.style,"border-radius","4px");P.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(E,p);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(d,"click",function(){p.destroy()}),P.style.outline="none",P.style.zIndex=this.lightboxZIndex,+m.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(P)):(document.body.appendChild(P),document.body.appendChild(m)),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(E,this.graph),p.lightboxFit(),p.chromelessResize()}catch(g){p.handleError(g,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,d){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",d||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",d||b))};GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(d){try{d.innerText="",GraphViewer.createViewerForElement(d)}catch(m){d.innerText=m.message,null!=window.console&&console.error(m)}})};@@ -4432,9 +4445,9 @@ GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,d,m){if(null!=GraphViewer.cachedUrls[b])d(GraphViewer.cachedUrls[b]);else{var n=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;n.open("GET",b);n.onload=function(){d(null!=n.getText?n.getText():n.responseText)};n.onerror=m;n.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(m){return window.setTimeout(m,20)},d=function(m,n){function v(){this.q=[];this.add=function(t){this.q.push(t)};var g,l;this.call=function(){g=0;for(l=this.q.length;g<l;g++)this.q[g].call()}}function p(g,l){return g.currentStyle?g.currentStyle[l]:window.getComputedStyle?window.getComputedStyle(g,null).getPropertyValue(l):g.style[l]}function C(g,l){if(!g.resizedAttached)g.resizedAttached=new v,g.resizedAttached.add(l);else if(g.resizedAttached){g.resizedAttached.add(l);return}g.resizeSensor=document.createElement("div");g.resizeSensor.className="resize-sensor";g.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";g.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>';-g.appendChild(g.resizeSensor);"static"==p(g,"position")&&(g.style.position="relative");var t=g.resizeSensor.childNodes[0],B=t.childNodes[0],D=g.resizeSensor.childNodes[1],I=function(){B.style.width="100000px";B.style.height="100000px";t.scrollLeft=1E5;t.scrollTop=1E5;D.scrollLeft=1E5;D.scrollTop=1E5};I();var L=!1,N=function(){g.resizedAttached&&(L&&(g.resizedAttached.call(),L=!1),b(N))};b(N);var K,da,ja,ea;l=function(){if((ja=g.offsetWidth)!=K||(ea=g.offsetHeight)!=da)L=!0,K=ja,da=ea;I()};var ca=-function(fa,la,ka){fa.attachEvent?fa.attachEvent("on"+la,ka):fa.addEventListener(la,ka)};ca(t,"scroll",l);ca(D,"scroll",l)}var G=function(){GraphViewer.resizeSensorEnabled&&n()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var T=null,E=!1;(new ResizeObserver(function(){E||(null!=T&&window.clearTimeout(T),T=window.setTimeout(function(){E=!0;G();T=null;E=!1},200))})).observe(m)}else{var Q=Object.prototype.toString.call(m),M="[object Array]"===Q||"[object NodeList]"===Q||"[object HTMLCollection]"===-Q||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(M){Q=0;for(var c=m.length;Q<c;Q++)C(m[Q],G)}else C(m,G);this.detach=function(){if(M)for(var g=0,l=m.length;g<l;g++)d.detach(m[g]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();+g.appendChild(g.resizeSensor);"static"==p(g,"position")&&(g.style.position="relative");var t=g.resizeSensor.childNodes[0],B=t.childNodes[0],D=g.resizeSensor.childNodes[1],I=function(){B.style.width="100000px";B.style.height="100000px";t.scrollLeft=1E5;t.scrollTop=1E5;D.scrollLeft=1E5;D.scrollTop=1E5};I();var K=!1,M=function(){g.resizedAttached&&(K&&(g.resizedAttached.call(),K=!1),b(M))};b(M);var V,Q,ja,ea;l=function(){if((ja=g.offsetWidth)!=V||(ea=g.offsetHeight)!=Q)K=!0,V=ja,Q=ea;I()};var da=function(ia,+la,ka){ia.attachEvent?ia.attachEvent("on"+la,ka):ia.addEventListener(la,ka)};da(t,"scroll",l);da(D,"scroll",l)}var G=function(){GraphViewer.resizeSensorEnabled&&n()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var T=null,E=!1;(new ResizeObserver(function(){E||(null!=T&&window.clearTimeout(T),T=window.setTimeout(function(){E=!0;G();T=null;E=!1},200))})).observe(m)}else{var P=Object.prototype.toString.call(m),L="[object Array]"===P||"[object NodeList]"===P||"[object HTMLCollection]"===+P||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(L){P=0;for(var c=m.length;P<c;P++)C(m[P],G)}else C(m,G);this.detach=function(){if(L)for(var g=0,l=m.length;g<l;g++)d.detach(m[g]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();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 b768169d9..3c4ba8bf3 100644--- a/src/main/webapp/js/viewer.min.js+++ b/src/main/webapp/js/viewer.min.js@@ -31,7 +31,7 @@ b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io"))}})();"1"==urlPa"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:"29.6.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/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"29.6.5",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||@@ -171,7 +171,7 @@ a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;f[],e=0,f=0;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)||null==g.pointerId||d.push(g)}),mxUtils.bind(this,function(g){if(!mxEvent.isMouseEvent(g)&&2==d.length){for(var k=0;k<d.length;k++)if(g.pointerId==d[k].pointerId){d[k]=g;break}g=Math.abs(d[0].clientX-d[1].clientX);k=Math.abs(d[0].clientY-d[1].clientY);var l=Math.abs(g-e),m=Math.abs(k-f);if(l>mxEvent.PINCH_THRESHOLD||m>mxEvent.PINCH_THRESHOLD)a(d[0],l>m?g>e:k>f,!0,d[0].clientX+(d[1].clientX-d[0].clientX)/2,d[0].clientY+(d[1].clientY-d[0].clientY)/2),e=g,f=k}}),mxUtils.bind(this,function(g){d=[];f=e=0}))}mxEvent.addListener(b,"wheel",function(g){null==g&&(g=window.event);g.ctrlKey&&g.preventDefault();(.5<Math.abs(g.deltaX)||.5<Math.abs(g.deltaY))&&a(g,0==g.deltaY?0<-g.deltaX:0<-g.deltaY)})}},disableContextMenu:function(a){mxEvent.addListener(a,"contextmenu",function(b){b.preventDefault&&b.preventDefault();return!1})},getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.type&&0==a.type.indexOf("touch")},isPenEvent:function(a){return null!=a.pointerType?"pen"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_PEN:null!=a.type&&0==a.type.indexOf("pen")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&null!=a.touches&&1<a.touches.length},isMouseEvent:function(a){return!mxClient.IS_ANDROID&&-mxClient.IS_LINUX&&mxClient.IS_GC?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||+mxClient.IS_LINUX&&mxClient.IS_GC&&1>=navigator.maxTouchPoints?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){"touchstart"!=a.type&&"touchmove"!=a.type||null==a.touches||null==a.touches[0]?"touchend"==a.type&&null!=a.changedTouches&&null!=a.changedTouches[0]&&(a=a.changedTouches[0]):a=a.touches[0];return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},preventDefault:function(a){mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(b){b.preventDefault()}))},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CONNECT_HANDLE:-3,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1E5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",DOCK:"dock",UNDOCK:"undock",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",@@ -346,8 +346,8 @@ mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var r=this.createElement("text");r.setAttribute("x",this.format(a));r.setAttribute("y",this.format(b));r.setAttribute("w",this.format(c));r.setAttribute("h",this.format(d));r.setAttribute("str",e);null!=f&&r.setAttribute("align",f);null!=g&&r.setAttribute("valign",g);r.setAttribute("wrap",k?"1":"0");null==l&&(l="");r.setAttribute("format",l);null!=m&&r.setAttribute("overflow",m);null!=n&&r.setAttribute("clip",n?"1":"0");null!=p&&r.setAttribute("rotation",p);null!=q&&r.setAttribute("dir",q);this.root.appendChild(r)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};-function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):b.appendChild(this.defs)),-this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);+function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=this.viewTranslate=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):+b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.cacheOffsetSize=!0;mxSvgCanvas2D.prototype.allowConvertHtmlToSvg=!1;mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&a.setAttribute("style",b)};mxSvgCanvas2D.prototype.getLightDarkColor=function(a){return mxUtils.getLightDarkColor(a,null,null,"simple"==this.adaptiveColors)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};@@ -362,25 +362,25 @@ mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkCok.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement(e==mxConstants.DIRECTION_RADIAL?"radialGradient":"linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%");e=this.createElement("stop");e.setAttribute("offset","0%");e.setAttribute("stop-color",a.light);e.style.stopColor=a.cssText;e.setAttribute("stop-opacity",c);e.style.stopOpacity=c;f.appendChild(e);e=this.createElement("stop");e.setAttribute("offset","100%");e.setAttribute("stop-color",b.light);e.style.stopColor=b.cssText;e.setAttribute("stop-opacity",d);e.style.stopOpacity=d;f.appendChild(e);return f};-mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c){return("mx-pattern-"+a+"-"+b+"-"+c).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};-mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=-this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}return f.getAttribute("id")};-mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;-e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a=.5*a*c;c=this.format(1.5*(10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format((10+a)*c);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};+mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c,d){return("mx-pattern-"+a+"-"+b+"-"+c+"-"+Math.round(100*d)).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};+mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText,d),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=+this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}c=this.viewTranslate;b=null!=c?this.format(c.x*d):0;c=null!=c?this.format(c.y*d):0;f.setAttribute("patternTransform","translate("+b+","+c+")"+("dots"!==a?" rotate(45)":"")+" scale("+d+")");return f.getAttribute("id")};+mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");+d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a*=.5;c=this.format(1.5*(10+a));var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);+e.setAttribute("fill","none");d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format(10+a);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};mxSvgCanvas2D.prototype.addTitle=function(a){if(null!=a&&null!=this.title){var b=this.createElement("title");mxUtils.write(b,this.title);a.appendChild(b)}return a};mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,this.getCurrentStrokeWidth(),c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill",-"url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",+"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -460,7 +460,7 @@ mxShape.prototype.getShadowStyle=function(){var a={dx:mxConstants.SHADOW_OFFSET_a.color),a.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OPACITY,a.opacity));return a};mxShape.prototype.createDropShadow=function(a,b){var c=mxUtils.getLightDarkColor(a.color,a.opacity/100);return"drop-shadow("+Math.round(a.dx*b*100)/100+"px "+Math.round(a.dy*b*100)/100+"px "+Math.round(a.blur*b*100)/100+"px "+c.cssText+")"};mxShape.prototype.updateSvgFilters=function(a){this.node.style.filter=this.isShadowEnabled()?this.createDropShadow(this.getShadowStyle(),a):""};mxShape.prototype.isShadowEnabled=function(){return this.isShadow};mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.beforePaint(a),this.paint(a),this.afterPaint(a),this.destroyCanvas(a))};mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement&&(a=this.createSvgCanvas());null!=a&&this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){},a.image=function(){},a.text=function(){});return a};-mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};+mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;a.viewTranslate=this.viewTranslate;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity="+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var c=this.fill,d=this.gradient,e="0",f={east:0,south:1,west:2,north:3},g=null!=this.direction?f[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+f[this.gradientDirection]-1,4));1==g?(e="1",f=c,c=d,d=f):2==g?(f=c,c=d,d=f):3==g&&(e="1");b+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+c+"', endColorStr='"+d+"', gradientType='"+e+"')"}a.style.filter=b};@@ -482,10 +482,10 @@ mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=nu1,b.length)];l<b.length-2&&0==Math.round(m.x-g.x)&&0==Math.round(m.y-g.y);)m=b[mxUtils.mod(l+2,b.length)],l++;n=m.x-g.x;m=m.y-g.y;p=Math.max(1,Math.sqrt(n*n+m*m));n=g.x+n*Math.min(d,p/2)/p;m=g.y+m*Math.min(d,p/2)/p;a.quadTo(g.x,g.y,n,m);g=new mxPoint(n,m)}else a.lineTo(g.x,g.y);m=g;l++}e?a.close():a.lineTo(k.x,k.y)}};mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,-this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,this.fillStyle);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,-mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,-mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=-1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};+this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,null);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,+this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,+0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=1==mxUtils.getValue(this.style,+mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return!1};mxShape.prototype.getSvgBoundingBox=function(){var a=null;if(null!=this.node&&null!=this.node.ownerSVGElement)try{var b=this.node.getBBox();0<b.width&&0<b.height&&(a=new mxRectangle(b.x,b.y,b.width,b.height),null!=this.stroke&&a.grow(this.strokewidth*this.scale/2))}catch(c){}return a};mxShape.prototype.getShapeBoundingBox=function(){var a=null;if(null!=this.bounds&&(a=this.createBoundingBox(),null!=a)){this.augmentBoundingBox(a);var b=this.getShapeRotation();0!=b&&(a=mxUtils.getBoundingBox(a,b))}return a};mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a};mxShape.prototype.augmentBoundingBox=function(a){if(this.isShadow){var b=this.getShadowStyle();0>b.dx&&(a.x+=b.dx,a.width-=b.dx);0>b.dy&&(a.y+=b.dy,a.height-=b.dy);a.grow(Math.max(b.blur,0)*this.scale*2);a.width+=Math.ceil(Math.max(b.dx,0)*this.scale);a.height+=Math.ceil(Math.max(b.dy,0)*this.scale)}null!=this.stroke&&a.grow(this.strokewidth*this.scale/2)};@@ -1035,7 +1035,7 @@ mxCellRenderer.prototype.rotateLabelBounds=function(a,b,c,d,e){var f=null!=d?d:cvar g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(f==mxConstants.ALIGN_CENTER&&null==k?c.spacingLeft*d+c.spacingRight*d:0));b.height=Math.max(0,b.height-(g==mxConstants.ALIGN_MIDDLE?c.spacingTop*d+c.spacingBottom*d:0))}e=e?0:c.getTextRotation();0!=e&&null!=a&&a.view.graph.model.isVertex(a.cell)&&(c=a.getCenterX(),a=a.getCenterY(),b.x!=c||b.y!=a)&&(e*=Math.PI/180,a=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(e),Math.sin(e),new mxPoint(c,a)),b.x=a.x,b.y=a.y)};mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(g,k){g=k.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var l=g.getCenterX(),m=g.getCenterY();m=mxUtils.getRotatedPoint(new mxPoint(l,m),e,f,new mxPoint(a.getCenterX(),a.getCenterY()));l=m.x;m=m.y;g.x=Math.round(l--g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.redraw()})}};+g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.viewTranslate=a.view.translate,k.redraw()})}};mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+b*d,f=a.y+c*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var k=(a.width-a.height)/2;e+=k;f-=k}0!=g&&(k=mxUtils.toRadians(g),g=Math.cos(k),k=Math.sin(k),f=mxUtils.getRotatedPoint(new mxPoint(e,f),g,k,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};@@ -1044,8 +1044,8 @@ a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSiblinmxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))};mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a),this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a),-null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};-mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};+null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,a.shape.viewTranslate=a.view.translate,(null==c||c)&&this.doRedrawShape(a),e=!0);+return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));@@ -2007,99 +2007,99 @@ Editor.prototype.updateGraphComponents=function(){var b=this.graph;null!=b.contaEditor.prototype.createUndoManager=function(){var b=this.graph,d=new mxUndoManager;this.undoListener=function(n,v){d.undoableEditHappened(v.getProperty("edit"))};var m=mxUtils.bind(this,function(n,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,m);b.getView().addListener(mxEvent.UNDO,m);m=function(n,v){n=v.getProperty("edit").changes;n=b.getSelectionCellsForChanges(n);v=!1;if(0<n.length){for(var p=[],C=0;C<n.length;C++)null!=b.view.getState(n[C])&&(p.push(n[C]),v||(b.scrollCellToVisible(n[C]),v=!0));b.setSelectionCells(p)}};d.addListener(mxEvent.UNDO,m);d.addListener(mxEvent.REDO,m);return d};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,d,m,n,v,p,C,G,T,E,Q){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&document.body.appendChild(this.bg);v=b.createDiv(T?"geTransDialog":"geDialog");v.style.width=m+48+"px";v.style.height=n+48+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(d);document.body.appendChild(v);if(p&&(d=document.createElement("div"),-d.className="geButton",d.setAttribute("title",mxResources.get("close")),d.style.backgroundImage="url("+Editor.crossImage+")",d.style.position="absolute",d.style.top="0px",d.style.right="0px",mxEvent.addListener(d,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),v.appendChild(d),!Q)){var M=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){M=!0}),null,mxUtils.bind(this,function(c){M&&(b.hideDialog(!0),M=!1)}))}this.onDialogClose=C;this.container=v;null!=E&&this.addResizeHandler(E);+function Dialog(b,d,m,n,v,p,C,G,T,E,P){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&document.body.appendChild(this.bg);v=b.createDiv(T?"geTransDialog":"geDialog");v.style.width=m+48+"px";v.style.height=n+48+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(d);document.body.appendChild(v);if(p&&(d=document.createElement("div"),+d.className="geButton",d.setAttribute("title",mxResources.get("close")),d.style.backgroundImage="url("+Editor.crossImage+")",d.style.position="absolute",d.style.top="0px",d.style.right="0px",mxEvent.addListener(d,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),v.appendChild(d),!P)){var L=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){L=!0}),null,mxUtils.bind(this,function(c){L&&(b.hideDialog(!0),L=!1)}))}this.onDialogClose=C;this.container=v;null!=E&&this.addResizeHandler(E);b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";Dialog.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==";Dialog.prototype.clearImage="data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==";Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,d){return new mxPoint(b,d)};Dialog.prototype.addResizeHandler=function(b){var d=document.createElement("img");d.setAttribute("src",mxWindow.prototype.resizeImage);d.style.cursor="nwse-resize";d.style.position="absolute";d.style.bottom="0px";d.style.right="0px";d.style.zIndex="2";var m=null,n=null,v=null,p=null,C=mxUtils.bind(this,function(E){m=mxEvent.getClientX(E);n=mxEvent.getClientY(E);v=parseInt(this.container.style.width);p=parseInt(this.container.style.height);mxEvent.addGestureListeners(document,null,G,T);mxEvent.consume(E)}),-G=mxUtils.bind(this,function(E){if(null!=m&&null!=n){var Q=mxEvent.getClientX(E)-m,M=mxEvent.getClientY(E)-n;this.container.style.width=Math.max(b.width,v+2*Q)+"px";this.container.style.height=Math.max(b.height,p+2*M)+"px";mxEvent.consume(E)}}),T=mxUtils.bind(this,function(E){null!=m&&null!=n&&(n=m=null,mxEvent.removeGestureListeners(document,null,G,T),mxEvent.consume(E))});mxEvent.addGestureListeners(d,C,G,T);this.container.appendChild(d)};+G=mxUtils.bind(this,function(E){if(null!=m&&null!=n){var P=mxEvent.getClientX(E)-m,L=mxEvent.getClientY(E)-n;this.container.style.width=Math.max(b.width,v+2*P)+"px";this.container.style.height=Math.max(b.height,p+2*L)+"px";mxEvent.consume(E)}}),T=mxUtils.bind(this,function(E){null!=m&&null!=n&&(n=m=null,mxEvent.removeGestureListeners(document,null,G,T),mxEvent.consume(E))});mxEvent.addGestureListeners(d,C,G,T);this.container.appendChild(d)};Dialog.prototype.close=function(b,d){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,d))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,d,m,n,v,p,C,G,T,E,Q){T=null!=T?T:!0;var M=document.createElement("div");M.style.textAlign="center";M.style.flexDirection="column";M.style.maxHeight="100%";M.style.display="flex";if(null!=d){var c=document.createElement("div");c.style.padding="0px";c.style.margin="0px";c.style.fontSize="14px";c.style.fontWeight="600";c.style.paddingBottom="12px";c.style.marginBottom="10px";c.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";c.style.whiteSpace=-"nowrap";c.style.textOverflow="ellipsis";c.style.overflow="hidden";c.style.flexShrink="0";mxUtils.write(c,d);c.setAttribute("title",d);M.appendChild(c)}d=document.createElement("div");d.style.lineHeight="1.2em";d.style.padding="6px";d.style.flexGrow="1";d.style.overflowY="auto";"string"===typeof m&&(m=m.replace(/\n/g,"<br/>"));d.innerHTML=Graph.sanitizeHtml(m);M.appendChild(d);m=document.createElement("div");m.style.marginTop="12px";m.style.textAlign="center";null!=p&&(d=mxUtils.button(mxResources.get("tryAgain"),-function(){b.hideDialog();p()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=E&&(E=mxUtils.button(E,function(){null!=Q&&Q()}),E.className="geBtn",m.appendChild(E));var g=mxUtils.button(n,function(){T&&b.hideDialog();null!=v&&v()});g.className="geBtn";m.appendChild(g);null!=C&&(n=mxUtils.button(C,function(){T&&b.hideDialog();null!=G&&G()}),n.className="geBtn gePrimaryBtn",m.appendChild(n));this.init=function(){g.focus()};M.appendChild(m);this.container=M},PrintDialog=function(b,+var ErrorDialog=function(b,d,m,n,v,p,C,G,T,E,P){T=null!=T?T:!0;var L=document.createElement("div");L.style.textAlign="center";L.style.flexDirection="column";L.style.maxHeight="100%";L.style.display="flex";if(null!=d){var c=document.createElement("div");c.style.padding="0px";c.style.margin="0px";c.style.fontSize="14px";c.style.fontWeight="600";c.style.paddingBottom="12px";c.style.marginBottom="10px";c.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";c.style.whiteSpace=+"nowrap";c.style.textOverflow="ellipsis";c.style.overflow="hidden";c.style.flexShrink="0";mxUtils.write(c,d);c.setAttribute("title",d);L.appendChild(c)}d=document.createElement("div");d.style.lineHeight="1.2em";d.style.padding="6px";d.style.flexGrow="1";d.style.overflowY="auto";"string"===typeof m&&(m=m.replace(/\n/g,"<br/>"));d.innerHTML=Graph.sanitizeHtml(m);L.appendChild(d);m=document.createElement("div");m.style.marginTop="12px";m.style.textAlign="center";null!=p&&(d=mxUtils.button(mxResources.get("tryAgain"),+function(){b.hideDialog();p()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=E&&(E=mxUtils.button(E,function(){null!=P&&P()}),E.className="geBtn",m.appendChild(E));var g=mxUtils.button(n,function(){T&&b.hideDialog();null!=v&&v()});g.className="geBtn";m.appendChild(g);null!=C&&(n=mxUtils.button(C,function(){T&&b.hideDialog();null!=G&&G()}),n.className="geBtn gePrimaryBtn",m.appendChild(n));this.init=function(){g.focus()};L.appendChild(m);this.container=L},PrintDialog=function(b,d,m,n){this.create(b,d,m,n)};-PrintDialog.prototype.create=function(b){function d(g){var l=C.checked||E.checked,t=parseInt(M.value)/100;isNaN(t)&&(t=1,M.value="100%");mxClient.IS_SF&&(t*=.75);var B=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,D=1/m.pageScale;if(l){var I=C.checked?1:parseInt(Q.value);isNaN(I)||(D=mxUtils.getScaleForPageCount(I,m,B))}var L=I=0;B=mxRectangle.fromRectangle(B);B.width=Math.ceil(B.width*t);B.height=Math.ceil(B.height*t);D*=t;!l&&m.pageVisible?(t=m.getPageLayout(),I-=t.x*B.width,L-=t.y*B.height):-l=!0;l=PrintDialog.createPrintPreview(m,D,B,0,I,L,l);l.open();g&&PrintDialog.printPreview(l)}var m=b.editor.graph,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var C=document.createElement("input");C.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(C);var T=document.createElement("span");mxUtils.write(T," "+mxResources.get("fitPage"));+PrintDialog.prototype.create=function(b){function d(g){var l=C.checked||E.checked,t=parseInt(L.value)/100;isNaN(t)&&(t=1,L.value="100%");mxClient.IS_SF&&(t*=.75);var B=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,D=1/m.pageScale;if(l){var I=C.checked?1:parseInt(P.value);isNaN(I)||(D=mxUtils.getScaleForPageCount(I,m,B))}var K=I=0;B=mxRectangle.fromRectangle(B);B.width=Math.ceil(B.width*t);B.height=Math.ceil(B.height*t);D*=t;!l&&m.pageVisible?(t=m.getPageLayout(),I-=t.x*B.width,K-=t.y*B.height):+l=!0;l=PrintDialog.createPrintPreview(m,D,B,0,I,K,l);l.open();g&&PrintDialog.printPreview(l)}var m=b.editor.graph,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var C=document.createElement("input");C.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(C);var T=document.createElement("span");mxUtils.write(T," "+mxResources.get("fitPage"));G.appendChild(T);mxEvent.addListener(T,"click",function(g){C.checked=!C.checked;E.checked=!C.checked;mxEvent.consume(g)});mxEvent.addListener(C,"change",function(){E.checked=!C.checked});p.appendChild(G);v.appendChild(p);p=p.cloneNode(!1);var E=document.createElement("input");E.setAttribute("type","checkbox");G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(E);T=document.createElement("span");mxUtils.write(T," "+mxResources.get("posterPrint")+":");G.appendChild(T);mxEvent.addListener(T,-"click",function(g){E.checked=!E.checked;C.checked=!E.checked;mxEvent.consume(g)});p.appendChild(G);var Q=document.createElement("input");Q.setAttribute("value","1");Q.setAttribute("type","number");Q.setAttribute("min","1");Q.setAttribute("size","4");Q.setAttribute("disabled","disabled");Q.style.width="50px";G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(Q);mxUtils.write(G," "+mxResources.get("pages")+" (max)");p.appendChild(G);v.appendChild(p);mxEvent.addListener(E,"change",-function(){E.checked?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled");C.checked=!E.checked});p=p.cloneNode(!1);G=document.createElement("td");mxUtils.write(G,mxResources.get("pageScale")+":");p.appendChild(G);G=document.createElement("td");var M=document.createElement("input");M.setAttribute("value","100 %");M.setAttribute("size","5");M.style.width="50px";G.appendChild(M);p.appendChild(G);v.appendChild(p);p=document.createElement("tr");G=document.createElement("td");G.colSpan=2;+"click",function(g){E.checked=!E.checked;C.checked=!E.checked;mxEvent.consume(g)});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(E,"change",+function(){E.checked?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled");C.checked=!E.checked});p=p.cloneNode(!1);G=document.createElement("td");mxUtils.write(G,mxResources.get("pageScale")+":");p.appendChild(G);G=document.createElement("td");var L=document.createElement("input");L.setAttribute("value","100 %");L.setAttribute("size","5");L.style.width="50px";G.appendChild(L);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 c=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();d(!1)});c.className="geBtn";G.appendChild(c)}c=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();d(!0)});c.className="geBtn gePrimaryBtn";G.appendChild(c);b.editor.cancelFirst||G.appendChild(T);p.appendChild(G);v.appendChild(p);n.appendChild(v);this.container=n};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(d){}};PrintDialog.createPrintPreview=function(b,d,m,n,v,p,C){d=new mxPrintPreview(b,d,m,n,v,p);d.title=mxResources.get("preview");d.addPageCss=!mxClient.IS_SF;d.printBackgroundImage=!0;d.autoOrigin=C;C=b.background;if(null==C||""==C||C==mxConstants.NONE)C="#ffffff";d.backgroundColor=C;var G=d.isTextLabel;d.isTextLabel=function(E){return"geHint"==!E.className&&G.apply(this,arguments)};var T=d.getLinkForCellState;d.getLinkForCellState=function(E){return b.getAbsoluteUrl(T.apply(this,arguments))};return d};PrintDialog.previewEnabled=!0;-var PageSetupDialog=function(b){function d(){var t=M;null!=t&&null!=t.originalSrc&&(t=b.createImageForPageLink(t.originalSrc,null));null!=t&&null!=t.src?(Q.style.backgroundImage="url("+t.src+")",Q.style.display="inline-block"):(Q.style.backgroundImage="",Q.style.display="none");Q.style.backgroundColor="";null!=c&&c!=mxConstants.NONE&&(Q.style.backgroundColor=c,Q.style.display="inline-block")}var m=b.editor.graph,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var v=document.createElement("tbody");+var PageSetupDialog=function(b){function d(){var t=L;null!=t&&null!=t.originalSrc&&(t=b.createImageForPageLink(t.originalSrc,null));null!=t&&null!=t.src?(P.style.backgroundImage="url("+t.src+")",P.style.display="inline-block"):(P.style.backgroundImage="",P.style.display="none");P.style.backgroundColor="";null!=c&&c!=mxConstants.NONE&&(P.style.backgroundColor=c,P.style.display="inline-block")}var m=b.editor.graph,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var C=document.createElement("td");C.style.verticalAlign="top";C.style.fontSize="10pt";mxUtils.write(C,mxResources.get("paperSize")+":");p.appendChild(C);C=document.createElement("td");C.style.verticalAlign="top";C.style.fontSize="10pt";var G=PageSetupDialog.addPageFormatPanel(C,"pagesetupdialog",m.pageFormat);p.appendChild(C);v.appendChild(p);p=document.createElement("tr");C=document.createElement("td");mxUtils.write(C,mxResources.get("gridSize")+":");p.appendChild(C);C=document.createElement("td");C.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=m.getGridSize();C.appendChild(T);mxEvent.addListener(T,"change",function(){var t=parseInt(T.value);T.value=Math.max(1,isNaN(t)?m.getGridSize():t)});p.appendChild(C);v.appendChild(p);p=document.createElement("tr");C=document.createElement("td");mxUtils.write(C,mxResources.get("background")+":");-p.appendChild(C);C=document.createElement("td");var E=document.createElement("button");E.className="geBtn";E.style.margin="0px";mxUtils.write(E,mxResources.get("change")+"...");var Q=document.createElement("div");Q.style.display="inline-block";Q.style.verticalAlign="middle";Q.style.backgroundPosition="center center";Q.style.backgroundRepeat="no-repeat";Q.style.backgroundSize="contain";Q.style.border="1px solid lightGray";Q.style.borderRadius="4px";Q.style.marginRight="14px";Q.style.height="32px";-Q.style.width="64px";Q.style.cursor="pointer";Q.style.padding="4px";var M=m.backgroundImage,c=m.background,g=m.shadowVisible,l=function(t){b.showBackgroundImageDialog(function(B,D,I,L){D||(null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src}),M=B,g=L);c=I;d()},M,c,!0);mxEvent.consume(t)};mxEvent.addListener(E,"click",l);mxEvent.addListener(Q,"click",l);d();C.appendChild(Q);C.appendChild(E);p.appendChild(C);v.appendChild(p);p=document.createElement("tr");C=document.createElement("td");-C.colSpan=2;C.style.paddingTop="16px";C.setAttribute("align","right");E=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});E.className="geBtn";b.editor.cancelFirst&&C.appendChild(E);l=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var t=parseInt(T.value);isNaN(t)||m.gridSize===t||m.setGridSize(t);t=new ChangePageSetup(b,c,M,G.get());t.ignoreColor=m.background==c;t.ignoreImage=(null!=m.backgroundImage?m.backgroundImage.src:null)===(null!=M?M.src:null);null!=g&&+p.appendChild(C);C=document.createElement("td");var E=document.createElement("button");E.className="geBtn";E.style.margin="0px";mxUtils.write(E,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 L=m.backgroundImage,c=m.background,g=m.shadowVisible,l=function(t){b.showBackgroundImageDialog(function(B,D,I,K){D||(null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src}),L=B,g=K);c=I;d()},L,c,!0);mxEvent.consume(t)};mxEvent.addListener(E,"click",l);mxEvent.addListener(P,"click",l);d();C.appendChild(P);C.appendChild(E);p.appendChild(C);v.appendChild(p);p=document.createElement("tr");C=document.createElement("td");+C.colSpan=2;C.style.paddingTop="16px";C.setAttribute("align","right");E=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});E.className="geBtn";b.editor.cancelFirst&&C.appendChild(E);l=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var t=parseInt(T.value);isNaN(t)||m.gridSize===t||m.setGridSize(t);t=new ChangePageSetup(b,c,L,G.get());t.ignoreColor=m.background==c;t.ignoreImage=(null!=m.backgroundImage?m.backgroundImage.src:null)===(null!=L?L.src:null);null!=g&&(t.shadowVisible=g);m.pageFormat.width==t.previousFormat.width&&m.pageFormat.height==t.previousFormat.height&&t.ignoreColor&&t.ignoreImage&&t.shadowVisible==m.shadowVisible||m.model.execute(t)});l.className="geBtn gePrimaryBtn";C.appendChild(l);b.editor.cancelFirst||C.appendChild(E);p.appendChild(C);v.appendChild(p);n.appendChild(v);this.container=n};PageSetupDialog.addPageFormatPanel=function(b,d,m,n){d="format-"+d;var v=document.createElement("input");v.setAttribute("name",d);v.setAttribute("type","radio");v.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",d);p.setAttribute("type","radio");p.setAttribute("value","landscape");var C=document.createElement("select");C.style.position="relative";C.style.marginBottom="4px";C.style.borderRadius="4px";C.style.borderWidth="1px";C.style.borderStyle="solid";C.style.boxSizing="border-box";C.style.padding="2px";C.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);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));G.appendChild(d);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 E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.fontSize="12px";E.style.width="210px";E.style.height="24px";var Q=document.createElement("input");Q.setAttribute("size","6");Q.setAttribute("title",mxResources.get("width"));Q.style.textAlign="right";E.appendChild(Q);mxUtils.write(E," x ");var M=document.createElement("input");M.setAttribute("size","6");M.setAttribute("title",mxResources.get("height"));M.style.textAlign="right";E.appendChild(M);+mxResources.get("landscape"));G.appendChild(T);var E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.fontSize="12px";E.style.width="210px";E.style.height="24px";var P=document.createElement("input");P.setAttribute("size","6");P.setAttribute("title",mxResources.get("width"));P.style.textAlign="right";E.appendChild(P);mxUtils.write(E," x ");var L=document.createElement("input");L.setAttribute("size","6");L.setAttribute("title",mxResources.get("height"));L.style.textAlign="right";E.appendChild(L);var c=document.createElement("select");c.style.marginLeft="4px";c.style.boxSizing="border-box";for(var g=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],l=0;l<g.length;l++){var t=document.createElement("option");t.setAttribute("value",g[l].unit);mxUtils.write(t,g[l].label);c.appendChild(t)}c.value=Editor.pageSizeUnit;E.appendChild(c);G.style.display="none";E.style.display=-"none";var B={},D=PageSetupDialog.getFormats();for(l=0;l<D.length;l++)g=D[l],B[g.key]=g,t=document.createElement("option"),t.setAttribute("value",g.key),mxUtils.write(t,g.title),C.appendChild(t);var I=function(){C.value="custom";for(var N=0;N<D.length;N++){var K=D[N];null!=K.format&&("a4"==K.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==K.key&&(584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&-(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==K.format.width&&m.height==K.format.height?(C.value=K.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):m.width==K.format.height&&m.height==K.format.width&&(C.value=K.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==C.value?(Q.value=Editor.toUnit(m.width,-c.value),M.value=Editor.toUnit(m.height,c.value),v.setAttribute("checked","checked"),C.value="custom",G.style.display="none",E.style.display=""):(G.style.display="",E.style.display="none")};I();b.appendChild(C);mxUtils.br(b);b.appendChild(G);b.appendChild(E);var L=function(N,K){N=B[C.value];null!=N.format?(Q.value=Editor.toUnit(p.checked?N.format.height:N.format.width,c.value),M.value=Editor.toUnit(p.checked?N.format.width:N.format.height,c.value),E.style.display="none",G.style.display=""):(G.style.display=-"none",E.style.display="");N=parseFloat(Q.value);if(isNaN(N)||0>=N)Q.value=Editor.toUnit(m.width,c.value);N=parseFloat(M.value);if(isNaN(N)||0>=N)M.value=Editor.toUnit(m.height,c.value);N=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(Q.value),c.value)),Math.floor(Editor.fromUnit(parseFloat(M.value),c.value)));K||N.width==m.width&&N.height==m.height||(m=N,null!=n&&n(m))};mxEvent.addListener(d,"click",function(N){v.checked=!0;L(N);mxEvent.consume(N)});mxEvent.addListener(T,"click",function(N){p.checked=-!0;L(N);mxEvent.consume(N)});mxEvent.addListener(Q,"blur",L);mxEvent.addListener(Q,"click",L);mxEvent.addListener(M,"blur",L);mxEvent.addListener(M,"click",L);mxEvent.addListener(p,"change",L);mxEvent.addListener(v,"change",L);mxEvent.addListener(C,"change",function(N){L(N,"custom"==C.value);mxEvent.consume(N)});mxEvent.addListener(c,"change",function(N){Q.value=Editor.toUnit(Editor.fromUnit(Q.value,Editor.pageSizeUnit),c.value);M.value=Editor.toUnit(Editor.fromUnit(M.value,Editor.pageSizeUnit),c.value);-Editor.pageSizeUnit=c.value;L(N,!0);mxEvent.consume(N)});L(null,!0);return{set:function(N){m=N;I(null,null,!0)},get:function(){return m},widthInput:Q,heightInput:M}};+"none";var B={},D=PageSetupDialog.getFormats();for(l=0;l<D.length;l++)g=D[l],B[g.key]=g,t=document.createElement("option"),t.setAttribute("value",g.key),mxUtils.write(t,g.title),C.appendChild(t);var I=function(){C.value="custom";for(var M=0;M<D.length;M++){var V=D[M];null!=V.format&&("a4"==V.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==V.key&&(584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&+(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==V.format.width&&m.height==V.format.height?(C.value=V.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):m.width==V.format.height&&m.height==V.format.width&&(C.value=V.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==C.value?(P.value=Editor.toUnit(m.width,+c.value),L.value=Editor.toUnit(m.height,c.value),v.setAttribute("checked","checked"),C.value="custom",G.style.display="none",E.style.display=""):(G.style.display="",E.style.display="none")};I();b.appendChild(C);mxUtils.br(b);b.appendChild(G);b.appendChild(E);var K=function(M,V){M=B[C.value];null!=M.format?(P.value=Editor.toUnit(p.checked?M.format.height:M.format.width,c.value),L.value=Editor.toUnit(p.checked?M.format.width:M.format.height,c.value),E.style.display="none",G.style.display=""):(G.style.display=+"none",E.style.display="");M=parseFloat(P.value);if(isNaN(M)||0>=M)P.value=Editor.toUnit(m.width,c.value);M=parseFloat(L.value);if(isNaN(M)||0>=M)L.value=Editor.toUnit(m.height,c.value);M=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(P.value),c.value)),Math.floor(Editor.fromUnit(parseFloat(L.value),c.value)));V||M.width==m.width&&M.height==m.height||(m=M,null!=n&&n(m))};mxEvent.addListener(d,"click",function(M){v.checked=!0;K(M);mxEvent.consume(M)});mxEvent.addListener(T,"click",function(M){p.checked=+!0;K(M);mxEvent.consume(M)});mxEvent.addListener(P,"blur",K);mxEvent.addListener(P,"click",K);mxEvent.addListener(L,"blur",K);mxEvent.addListener(L,"click",K);mxEvent.addListener(p,"change",K);mxEvent.addListener(v,"change",K);mxEvent.addListener(C,"change",function(M){K(M,"custom"==C.value);mxEvent.consume(M)});mxEvent.addListener(c,"change",function(M){P.value=Editor.toUnit(Editor.fromUnit(P.value,Editor.pageSizeUnit),c.value);L.value=Editor.toUnit(Editor.fromUnit(L.value,Editor.pageSizeUnit),c.value);+Editor.pageSizeUnit=c.value;K(M,!0);mxEvent.consume(M)});K(null,!0);return{set:function(M){m=M;I(null,null,!0)},get:function(){return m},widthInput:P,heightInput:L}};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,d,m,n,v,p,C,G,T,E,Q){T=null!=T?T:!0;var M=document.createElement("div"),c=document.createElement("div");c.style.width="100%";c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoColumns="auto 1fr";c.style.boxSizing="border-box";c.style.padding="3px";var g=document.createElement("div");g.style.display="inline-flex";g.style.alignItems="center";g.style.justifyContent="flex-end";g.style.minWidth="0";var l=document.createElement("div");l.style.display="inline-block";+var FilenameDialog=function(b,d,m,n,v,p,C,G,T,E,P){T=null!=T?T:!0;var L=document.createElement("div"),c=document.createElement("div");c.style.width="100%";c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoColumns="auto 1fr";c.style.boxSizing="border-box";c.style.padding="3px";var g=document.createElement("div");g.style.display="inline-flex";g.style.alignItems="center";g.style.justifyContent="flex-end";g.style.minWidth="0";var l=document.createElement("div");l.style.display="inline-block";l.style.textOverflow="ellipsis";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.fontSize="10pt";l.style.padding="2px 0";l.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(l,(v||mxResources.get("filename"))+":");g.appendChild(l);c.appendChild(g);var t=document.createElement("input");t.setAttribute("value",d||"");t.style.flexGrow="1";var B=mxUtils.button(m,function(){if(null==p||p(t.value))T&&b.hideDialog(),n(t.value)});B.className="geBtn gePrimaryBtn";this.init=function(){if(null!=-v||null==C)if(null!=Q?Editor.selectFilename(t):(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var D=c.parentNode;if(null!=D){var I=null;mxEvent.addListener(D,"dragleave",function(L){null!=I&&(I.style.backgroundColor="",I=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(L){null==I&&(!mxClient.IS_IE||10<document.documentMode)&&(I=t,I.style.backgroundColor=-"#ebf2f9");L.stopPropagation();L.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(L){null!=I&&(I.style.backgroundColor="",I=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(t.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),B.click());L.stopPropagation();L.preventDefault()}))}}};g=document.createElement("div");g.style.display="inline-flex";g.style.alignItems="center";g.style.gap="4px";g.style.whiteSpace="nowrap";g.appendChild(t);c.appendChild(g);-null==v&&null!=C||null==Q||null==b.editor.diagramFileTypes||(g=document.createElement("div"),g.style.display="inline-flex",g.style.alignItems="center",g.style.textOverflow="ellipsis",g.style.justifyContent="flex-end",g.style.fontSize="10pt",mxUtils.write(g,mxResources.get("type")+":"),c.appendChild(g),g=document.createElement("div"),g.style.display="inline-flex",g.style.alignItems="center",g.style.whiteSpace="nowrap",c.appendChild(g),d=FilenameDialog.createFileTypes(b,t,b.editor.diagramFileTypes),-d.style.width="100%",g.appendChild(d));null!=C&&c.appendChild(C);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=Q?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=E&&E()});g.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));-b.editor.cancelFirst&&row.appendChild(g);mxEvent.addListener(t,"keypress",function(D){13==D.keyCode&&B.click()});row.appendChild(B);b.editor.cancelFirst||row.appendChild(g);c.appendChild(row);M.appendChild(c);this.container=M};FilenameDialog.filenameHelpLink=null;+v||null==C)if(null!=P?Editor.selectFilename(t):(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var D=c.parentNode;if(null!=D){var I=null;mxEvent.addListener(D,"dragleave",function(K){null!=I&&(I.style.backgroundColor="",I=null);K.stopPropagation();K.preventDefault()});mxEvent.addListener(D,"dragover",mxUtils.bind(this,function(K){null==I&&(!mxClient.IS_IE||10<document.documentMode)&&(I=t,I.style.backgroundColor=+"#ebf2f9");K.stopPropagation();K.preventDefault()}));mxEvent.addListener(D,"drop",mxUtils.bind(this,function(K){null!=I&&(I.style.backgroundColor="",I=null);0<=mxUtils.indexOf(K.dataTransfer.types,"text/uri-list")&&(t.value=decodeURIComponent(K.dataTransfer.getData("text/uri-list")),B.click());K.stopPropagation();K.preventDefault()}))}}};g=document.createElement("div");g.style.display="inline-flex";g.style.alignItems="center";g.style.gap="4px";g.style.whiteSpace="nowrap";g.appendChild(t);c.appendChild(g);+null==v&&null!=C||null==P||null==b.editor.diagramFileTypes||(g=document.createElement("div"),g.style.display="inline-flex",g.style.alignItems="center",g.style.textOverflow="ellipsis",g.style.justifyContent="flex-end",g.style.fontSize="10pt",mxUtils.write(g,mxResources.get("type")+":"),c.appendChild(g),g=document.createElement("div"),g.style.display="inline-flex",g.style.alignItems="center",g.style.whiteSpace="nowrap",c.appendChild(g),d=FilenameDialog.createFileTypes(b,t,b.editor.diagramFileTypes),+d.style.width="100%",g.appendChild(d));null!=C&&c.appendChild(C);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");g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=E&&E()});g.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));+b.editor.cancelFirst&&row.appendChild(g);mxEvent.addListener(t,"keypress",function(D){13==D.keyCode&&B.click()});row.appendChild(B);b.editor.cancelFirst||row.appendChild(g);c.appendChild(row);L.appendChild(c);this.container=L};FilenameDialog.filenameHelpLink=null;FilenameDialog.createFileTypes=function(b,d,m){var n=document.createElement("select");for(b=0;b<m.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(m[b].description)+" (."+m[b].extension+")");n.appendChild(v)}mxEvent.addListener(n,"change",function(p){p=m[n.value].extension;var C=d.value.lastIndexOf(".drawio.");C=0<C?C:d.value.lastIndexOf(".");"drawio"!=p&&(p="drawio."+p);d.value=0<C?d.value.substring(0,C+1)+p:d.value+"."+p;"createEvent"indocument?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),d.dispatchEvent(p)):d.fireEvent("onchange")});b=function(p){p=d.value.toLowerCase();for(var C=0,G=0;G<m.length;G++){var T=m[G].extension,E=null;"drawio"!=T&&(E=T,T=".drawio."+T);if(p.substring(p.length-T.length-1)=="."+T||null!=E&&p.substring(p.length-E.length-1)=="."+E){C=G;break}}n.value=C};mxEvent.addListener(d,"change",b);mxEvent.addListener(d,"keyup",b);b();return n};var WrapperWindow=function(b,d,m,n,v,p,C,G){G=null!=G?G:document.createElement("div");this.window=new mxWindow(d,G,m,n,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);C(G)};(function(){mxGraphView.prototype.validateBackgroundPage=function(){var C=this.graph;if(null!=C.container&&!C.transparentBackground){if(C.pageVisible){var G=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var T=C.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(C.container),T.style.position="absolute",C.container.insertBefore(this.backgroundPageShape.node,T),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(E){C.dblClick(E)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(E){C.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(E))}),mxUtils.bind(this,function(E){null!=C.tooltipHandler&&C.tooltipHandler.isHideOnHover()&&C.tooltipHandler.hide();C.isMouseDown&&!mxEvent.isConsumed(E)&&C.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(E))}),mxUtils.bind(this,function(E){C.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(E))})))}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(C,G,T){var E=this.graph;C=null!=C?C:1;var Q=mxUtils.getLightDarkColor(null==E.background||E.background==mxConstants.NONE?E.defaultPageBackgroundColor:E.background).cssText,M=mxUtils.getLightDarkColor(E.defaultPageBorderColor).cssText,c=null!=Q&&this.gridColor!=Q.toLowerCase()?this.gridColor:"#ffffff",g="none",l="";"simple"==E.getAdaptiveColors()&&E.background!=mxConstants.NONE&&null!=E.background&&(Q=E.background);if(E.isGridEnabled()||E.gridVisible){l=+mxGraphView.prototype.validateBackgroundStyles=function(C,G,T){var E=this.graph;C=null!=C?C:1;var P=mxUtils.getLightDarkColor(null==E.background||E.background==mxConstants.NONE?E.defaultPageBackgroundColor:E.background).cssText,L=mxUtils.getLightDarkColor(E.defaultPageBorderColor).cssText,c=null!=P&&this.gridColor!=P.toLowerCase()?this.gridColor:"#ffffff",g="none",l="";"simple"==E.getAdaptiveColors()&&E.background!=mxConstants.NONE&&null!=E.background&&(P=E.background);if(E.isGridEnabled()||E.gridVisible){l=10;mxClient.IS_SVG?(g=unescape(encodeURIComponent(this.createSvgGrid(c,C))),g=window.btoa?btoa(g):Base64.encode(g,!0),g="url(data:image/svg+xml;base64,"+g+")",l=E.gridSize*this.scale*this.gridSteps*C):g="url("+this.gridImage+")";var t=c=0;G=null!=G?G-this.translate.x*this.scale:0;T=null!=T?T-this.translate.y*this.scale:0;var B=E.gridSize*this.scale*this.gridSteps,D=G%B;B=T%B;null!=E.view.backgroundPageShape&&(t=this.getBackgroundPageBounds(),c=1+t.x,t=1+t.y);l=-Math.round(l-mxUtils.mod(this.translate.x*-this.scale-c+G,l)+D*C)+"px "+-Math.round(l-mxUtils.mod(this.translate.y*this.scale-t+T,l)+B*C)+"px"}C=E.view.canvas;null!=C.ownerSVGElement&&(C=C.ownerSVGElement);c=!Editor.isDarkMode()&&E.enableDiagramBackground;null!=E.view.backgroundPageShape?(E.view.backgroundPageShape.node.style.backgroundPosition=l,E.view.backgroundPageShape.node.style.backgroundImage=g,E.view.backgroundPageShape.node.style.backgroundColor=Q,E.view.backgroundPageShape.node.style.borderColor=M,E.view.backgroundPageShape.node.style.colorScheme=-"none"==E.getAdaptiveColors()?"light":"",C.style.backgroundImage="none",C.style.backgroundColor="",E.container.style.backgroundColor=c?E.diagramBackgroundColor:""):(C.style.backgroundPosition=l,C.style.backgroundImage=g,"1"==urlParams.transparent?E.container.style.background="transparent":!c||null!=E.background&&E.background!=mxConstants.NONE?C.style.backgroundColor=Q:(C.style.backgroundColor=E.diagramBackgroundColor,E.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(C,-G){for(var T=this.graph.gridSize*this.scale*(null!=G?G:1);T<this.minGridSize;)T*=2;G=this.gridSteps*T;for(var E=[],Q=1;Q<this.gridSteps;Q++){var M=Q*T;E.push("M 0 "+M+" L "+G+" "+M+" M "+M+" 0 L "+M+" "+G)}C=mxUtils.getLightDarkColor(C);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="'++this.scale-c+G,l)+D*C)+"px "+-Math.round(l-mxUtils.mod(this.translate.y*this.scale-t+T,l)+B*C)+"px"}C=E.view.canvas;null!=C.ownerSVGElement&&(C=C.ownerSVGElement);c=!Editor.isDarkMode()&&E.enableDiagramBackground;null!=E.view.backgroundPageShape?(E.view.backgroundPageShape.node.style.backgroundPosition=l,E.view.backgroundPageShape.node.style.backgroundImage=g,E.view.backgroundPageShape.node.style.backgroundColor=P,E.view.backgroundPageShape.node.style.borderColor=L,E.view.backgroundPageShape.node.style.colorScheme=+"none"==E.getAdaptiveColors()?"light":"",C.style.backgroundImage="none",C.style.backgroundColor="",E.container.style.backgroundColor=c?E.diagramBackgroundColor:""):(C.style.backgroundPosition=l,C.style.backgroundImage=g,"1"==urlParams.transparent?E.container.style.background="transparent":!c||null!=E.background&&E.background!=mxConstants.NONE?C.style.backgroundColor=P:(C.style.backgroundColor=E.diagramBackgroundColor,E.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(C,+G){for(var T=this.graph.gridSize*this.scale*(null!=G?G:1);T<this.minGridSize;)T*=2;G=this.gridSteps*T;for(var E=[],P=1;P<this.gridSteps;P++){var L=P*T;E.push("M 0 "+L+" L "+G+" "+L+" M "+L+" 0 L "+L+" "+G)}C=mxUtils.getLightDarkColor(C);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="'+E.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(C.cssText)+';" stroke="'+C.light+'" opacity="0.2" stroke-width="1"/><path d="M '+G+" 0 L 0 0 0 "+G+'" fill="none" style="stroke:'+mxUtils.htmlEntities(C.cssText)+';" stroke="'+C.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(C,G){b.apply(this,arguments);-if(null!=this.shiftPreview1){var T=this.view.canvas;null!=T.ownerSVGElement&&(T=T.ownerSVGElement);var E=this.gridSize*this.view.scale*this.view.gridSteps;E=-Math.round(E-mxUtils.mod(this.view.translate.x*this.view.scale+C,E))+"px "+-Math.round(E-mxUtils.mod(this.view.translate.y*this.view.scale+G,E))+"px";T.style.backgroundPosition=E}};mxGraph.prototype.updatePageBreaks=function(C,G,T){var E=this.view.scale,Q=this.view.translate,M=this.pageFormat,c=E*this.pageScale,g=this.view.getBackgroundPageBounds();-G=g.width;T=g.height;var l=new mxRectangle(E*Q.x,E*Q.y,M.width*c,M.height*c),t=(C=C&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(T/l.height)-1:0,B=C?Math.ceil(G/l.width)-1:0,D=g.x+G,I=g.y+T;null==this.horizontalPageBreaks&&0<t&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<B&&(this.verticalPageBreaks=[]);C=mxUtils.bind(this,function(L){if(null!=L){for(var N=L==this.horizontalPageBreaks?t:B,K=0;K<=N;K++){var da=L==this.horizontalPageBreaks?[new mxPoint(Math.round(g.x),-Math.round(g.y+(K+1)*l.height)),new mxPoint(Math.round(D),Math.round(g.y+(K+1)*l.height))]:[new mxPoint(Math.round(g.x+(K+1)*l.width),Math.round(g.y)),new mxPoint(Math.round(g.x+(K+1)*l.width),Math.round(I))];null!=L[K]?(L[K].points=da,L[K].redraw()):(da=new mxPolyline(da,this.pageBreakColor),da.dialect=this.dialect,da.isDashed=this.pageBreakDashed,da.pointerEvents=!1,da.init(this.view.backgroundPane),da.redraw(),L[K]=da)}for(K=N;K<L.length;K++)null!=L[K]&&L[K].destroy();L.splice(N,L.length-N)}});-C(this.horizontalPageBreaks);C(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(C,G,T){for(var E=0;E<G.length;E++){if(this.graph.isTableCell(G[E])||this.graph.isTableRow(G[E]))return!1;if(this.graph.getModel().isVertex(G[E])){var Q=this.graph.getCellGeometry(G[E]);if(null!=Q&&Q.relative)return!1}}return d.apply(this,arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=-function(){var C=m.apply(this,arguments);C.intersects=mxUtils.bind(this,function(G,T){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(C,arguments)});return C};mxGraphView.prototype.createBackgroundPageShape=function(C){return new mxRectangleShape(C,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var C=this.getGraphBounds(),G=0<C.width?C.x/this.scale-this.translate.x:0,T=0<C.height?C.y/this.scale-this.translate.y:0,E=this.graph.pageFormat,-Q=this.graph.pageScale,M=E.width*Q;E=E.height*Q;Q=Math.floor(Math.min(0,G)/M);var c=Math.floor(Math.min(0,T)/E);return new mxRectangle(this.scale*(this.translate.x+Q*M),this.scale*(this.translate.y+c*E),this.scale*(Math.ceil(Math.max(1,G+C.width/this.scale)/M)-Q)*M,this.scale*(Math.ceil(Math.max(1,T+C.height/this.scale)/E)-c)*E)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(C,G){n.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||-this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=C+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(C,G,T,E,Q,M){var c=v.apply(this,arguments);null==M||M||mxEvent.addListener(c,"mousedown",function(g){mxEvent.consume(g)});return c};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=-function(C,G,T){var E=this.graph.model.getParent(C);if(G){var Q=this.graph.model.isEdge(C)?null:this.graph.getCellGeometry(C);Q=!this.graph.model.isEdge(E)&&!this.graph.isSiblingSelected(C)&&(null!=Q&&Q.relative||!this.graph.isContainer(E)||this.graph.isPart(C))}else if(Q=p.apply(this,arguments),this.graph.isTableCell(C)||this.graph.isTableRow(C))Q=E,this.graph.isTable(Q)||(Q=this.graph.model.getParent(Q)),Q=!this.graph.selectionCellsHandler.isHandled(Q)||this.graph.isCellSelected(Q)&&this.graph.isToggleEvent(T.getEvent())||-this.graph.isCellSelected(C)&&!this.graph.isToggleEvent(T.getEvent())||this.graph.isTableCell(C)&&this.graph.isCellSelected(E);return Q};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(C){C=C.getCell();for(var G=this.graph.getModel(),T=G.getParent(C),E=this.graph.view.getState(T),Q=this.graph.isCellSelected(C);null!=E&&(G.isVertex(T)||G.isEdge(T));){var M=this.graph.isCellSelected(T);Q=Q||M;if(M||!Q&&(this.graph.isTableCell(C)||this.graph.isTableRow(C)))C=T;T=G.getParent(T)}return C}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var n=this,v=this.editor.graph;v.lightbox=m;var p=v.getGraphBounds;v.getGraphBounds=function(){var ka=p.apply(this,arguments),V=this.backgroundImage;if(null!=V&&null!=V.width&&null!=V.height){var k=this.view.translate,x=this.view.scale;ka=mxRectangle.fromRectangle(ka);ka.add(new mxRectangle((k.x+V.x)*x,(k.y+V.y)*x,V.width*x,V.height*x))}return ka};v.useCssTransforms&&-(this.lazyZoomDelay=0);this.selectionStateListener=mxUtils.bind(this,function(ka,V){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){v.isEnabled=-function(){return!1};v.panningHandler.isForcePanningEvent=function(ka){for(var V=ka.getSource();null!=V&&V!=v.container;){if("foreignObject"===V.nodeName||"text"===V.nodeName)return!1;V=V.parentNode}return!mxEvent.isPopupTrigger(ka.getEvent())};var C=v.panningHandler.start;v.panningHandler.start=function(){C.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(ka){try{v.getModel().isEdge(ka)?-T=v.pasteEdgeStyle=!1:G=!1;var V=v.getCellStyle(ka,!1),k=[],x=[],J;for(J in V)k.push(V[J]),x.push(J);v.getModel().isEdge(ka)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",x,"values",k,"cells",[ka],"force",!0));v.getModel().isEdge(ka)?T=v.pasteEdgeStyle=!0:G=!0}catch(R){this.handleError(R)}};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(ka,V){v.pasteCellStyles(v.includeDescendants(V.getProperty("cells")))});v.addListener("textInserted",function(ka,V){v.pasteCellStyles(V.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var E=mxUtils.bind(this,function(ka){null==ka&&(ka=window.event);return v.isEditing()||null!=ka&&this.isSelectionAllowed(ka)});this.container!=document.body||this.editor.chromeless&&-!this.editor.editable||(this.menubarContainer.onselectstart=E,this.menubarContainer.onmousedown=E,this.toolbarContainer.onselectstart=E,this.toolbarContainer.onmousedown=E,this.diagramContainer.onselectstart=E,this.diagramContainer.onmousedown=E,this.sidebarContainer.onselectstart=E,this.sidebarContainer.onmousedown=E,this.formatContainer.onselectstart=E,this.formatContainer.onmousedown=E,null!=this.tabContainer&&(this.tabContainer.onselectstart=E),mxClient.IS_IOS&&(d=function(){var ka=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var V=-navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{ka=[parseInt(V[1],10),parseInt(V[2],10),parseInt(V[3]||0,10)]}catch(k){}}return ka}(),null!=d&&16<=d[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"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,-"userSelect","none"))));!this.editor.chromeless||this.editor.editable?(d=function(ka){if(null!=ka){var V=mxEvent.getSource(ka);if("A"==V.nodeName)for(;null!=V;){if("geHint"==V.className)return!0;V=V.parentNode}}return E(ka)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",d):this.diagramContainer.oncontextmenu=d):v.panningHandler.usePopupTrigger=!1;v.init(this.diagramContainer);mxClient.IS_SVG&&null!=v.view.getDrawPane()&&-(d=v.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(ka,V){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(ka,V){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));-if(null!=v.graphHandler){var Q=v.graphHandler.start;v.graphHandler.start=function(){null!=n.hoverIcons&&n.hoverIcons.reset();null!=n.inlineToolbar&&null!=this.cell&&n.inlineToolbar.hide();Q.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(ka){var V=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(ka)-V.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(ka)-V.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",-mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var M=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(ka,V){return n.isSpaceDown()||M.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(ka){if(Editor.passiveScroll){var V=mxEvent.getSource(ka);if(V!=v.container&&!v.container.contains(V)&&!v.isEditing())return}16==ka.which?this.shiftDown=!0:32!=ka.which||v.isEditing()?mxEvent.isConsumed(ka)||27!=ka.keyCode||this.hideDialog(null,!0):+if(null!=this.shiftPreview1){var T=this.view.canvas;null!=T.ownerSVGElement&&(T=T.ownerSVGElement);var E=this.gridSize*this.view.scale*this.view.gridSteps;E=-Math.round(E-mxUtils.mod(this.view.translate.x*this.view.scale+C,E))+"px "+-Math.round(E-mxUtils.mod(this.view.translate.y*this.view.scale+G,E))+"px";T.style.backgroundPosition=E}};mxGraph.prototype.updatePageBreaks=function(C,G,T){var E=this.view.scale,P=this.view.translate,L=this.pageFormat,c=E*this.pageScale,g=this.view.getBackgroundPageBounds();+G=g.width;T=g.height;var l=new mxRectangle(E*P.x,E*P.y,L.width*c,L.height*c),t=(C=C&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(T/l.height)-1:0,B=C?Math.ceil(G/l.width)-1:0,D=g.x+G,I=g.y+T;null==this.horizontalPageBreaks&&0<t&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<B&&(this.verticalPageBreaks=[]);C=mxUtils.bind(this,function(K){if(null!=K){for(var M=K==this.horizontalPageBreaks?t:B,V=0;V<=M;V++){var Q=K==this.horizontalPageBreaks?[new mxPoint(Math.round(g.x),+Math.round(g.y+(V+1)*l.height)),new mxPoint(Math.round(D),Math.round(g.y+(V+1)*l.height))]:[new mxPoint(Math.round(g.x+(V+1)*l.width),Math.round(g.y)),new mxPoint(Math.round(g.x+(V+1)*l.width),Math.round(I))];null!=K[V]?(K[V].points=Q,K[V].redraw()):(Q=new mxPolyline(Q,this.pageBreakColor),Q.dialect=this.dialect,Q.isDashed=this.pageBreakDashed,Q.pointerEvents=!1,Q.init(this.view.backgroundPane),Q.redraw(),K[V]=Q)}for(V=M;V<K.length;V++)null!=K[V]&&K[V].destroy();K.splice(M,K.length-M)}});C(this.horizontalPageBreaks);+C(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(C,G,T){for(var E=0;E<G.length;E++){if(this.graph.isTableCell(G[E])||this.graph.isTableRow(G[E]))return!1;if(this.graph.getModel().isVertex(G[E])){var P=this.graph.getCellGeometry(G[E]);if(null!=P&&P.relative)return!1}}return d.apply(this,arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var C=+m.apply(this,arguments);C.intersects=mxUtils.bind(this,function(G,T){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(C,arguments)});return C};mxGraphView.prototype.createBackgroundPageShape=function(C){return new mxRectangleShape(C,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var C=this.getGraphBounds(),G=0<C.width?C.x/this.scale-this.translate.x:0,T=0<C.height?C.y/this.scale-this.translate.y:0,E=this.graph.pageFormat,+P=this.graph.pageScale,L=E.width*P;E=E.height*P;P=Math.floor(Math.min(0,G)/L);var c=Math.floor(Math.min(0,T)/E);return new mxRectangle(this.scale*(this.translate.x+P*L),this.scale*(this.translate.y+c*E),this.scale*(Math.ceil(Math.max(1,G+C.width/this.scale)/L)-P)*L,this.scale*(Math.ceil(Math.max(1,T+C.height/this.scale)/E)-c)*E)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(C,G){n.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||+this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=C+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(C,G,T,E,P,L){var c=v.apply(this,arguments);null==L||L||mxEvent.addListener(c,"mousedown",function(g){mxEvent.consume(g)});return c};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=+function(C,G,T){var E=this.graph.model.getParent(C);if(G){var P=this.graph.model.isEdge(C)?null:this.graph.getCellGeometry(C);P=!this.graph.model.isEdge(E)&&!this.graph.isSiblingSelected(C)&&(null!=P&&P.relative||!this.graph.isContainer(E)||this.graph.isPart(C))}else if(P=p.apply(this,arguments),this.graph.isTableCell(C)||this.graph.isTableRow(C))P=E,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(C)&&!this.graph.isToggleEvent(T.getEvent())||this.graph.isTableCell(C)&&this.graph.isCellSelected(E);return P};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(C){C=C.getCell();for(var G=this.graph.getModel(),T=G.getParent(C),E=this.graph.view.getState(T),P=this.graph.isCellSelected(C);null!=E&&(G.isVertex(T)||G.isEdge(T));){var L=this.graph.isCellSelected(T);P=P||L;if(L||!P&&(this.graph.isTableCell(C)||this.graph.isTableRow(C)))C=T;T=G.getParent(T)}return C}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var n=this,v=this.editor.graph;v.lightbox=m;var p=v.getGraphBounds;v.getGraphBounds=function(){var ka=p.apply(this,arguments),W=this.backgroundImage;if(null!=W&&null!=W.width&&null!=W.height){var k=this.view.translate,y=this.view.scale;ka=mxRectangle.fromRectangle(ka);ka.add(new mxRectangle((k.x+W.x)*y,(k.y+W.y)*y,W.width*y,W.height*y))}return ka};v.useCssTransforms&&+(this.lazyZoomDelay=0);this.selectionStateListener=mxUtils.bind(this,function(ka,W){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){v.isEnabled=+function(){return!1};v.panningHandler.isForcePanningEvent=function(ka){for(var W=ka.getSource();null!=W&&W!=v.container;){if("foreignObject"===W.nodeName||"text"===W.nodeName)return!1;W=W.parentNode}return!mxEvent.isPopupTrigger(ka.getEvent())};var C=v.panningHandler.start;v.panningHandler.start=function(){C.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(ka){try{v.getModel().isEdge(ka)?+T=v.pasteEdgeStyle=!1:G=!1;var W=v.getCellStyle(ka,!1),k=[],y=[],J;for(J in W)k.push(W[J]),y.push(J);v.getModel().isEdge(ka)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",y,"values",k,"cells",[ka],"force",!0));v.getModel().isEdge(ka)?T=v.pasteEdgeStyle=!0:G=!0}catch(R){this.handleError(R)}};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(ka,W){v.pasteCellStyles(v.includeDescendants(W.getProperty("cells")))});v.addListener("textInserted",function(ka,W){v.pasteCellStyles(W.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var E=mxUtils.bind(this,function(ka){null==ka&&(ka=window.event);return v.isEditing()||null!=ka&&this.isSelectionAllowed(ka)});this.container!=document.body||this.editor.chromeless&&+!this.editor.editable||(this.menubarContainer.onselectstart=E,this.menubarContainer.onmousedown=E,this.toolbarContainer.onselectstart=E,this.toolbarContainer.onmousedown=E,this.diagramContainer.onselectstart=E,this.diagramContainer.onmousedown=E,this.sidebarContainer.onselectstart=E,this.sidebarContainer.onmousedown=E,this.formatContainer.onselectstart=E,this.formatContainer.onmousedown=E,null!=this.tabContainer&&(this.tabContainer.onselectstart=E),mxClient.IS_IOS&&(d=function(){var ka=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var W=+navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{ka=[parseInt(W[1],10),parseInt(W[2],10),parseInt(W[3]||0,10)]}catch(k){}}return ka}(),null!=d&&16<=d[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"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,+"userSelect","none"))));!this.editor.chromeless||this.editor.editable?(d=function(ka){if(null!=ka){var W=mxEvent.getSource(ka);if("A"==W.nodeName)for(;null!=W;){if("geHint"==W.className)return!0;W=W.parentNode}}return E(ka)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",d):this.diagramContainer.oncontextmenu=d):v.panningHandler.usePopupTrigger=!1;v.init(this.diagramContainer);mxClient.IS_SVG&&null!=v.view.getDrawPane()&&+(d=v.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(ka,W){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(ka,W){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));+if(null!=v.graphHandler){var P=v.graphHandler.start;v.graphHandler.start=function(){null!=n.hoverIcons&&n.hoverIcons.reset();null!=n.inlineToolbar&&null!=this.cell&&n.inlineToolbar.hide();P.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(ka){var W=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(ka)-W.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(ka)-W.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",+mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var L=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(ka,W){return n.isSpaceDown()||L.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(ka){if(Editor.passiveScroll){var W=mxEvent.getSource(ka);if(W!=v.container&&!v.container.contains(W)&&!v.isEditing())return}16==ka.which?this.shiftDown=!0:32!=ka.which||v.isEditing()?mxEvent.isConsumed(ka)||27!=ka.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(ka)!=v.container||mxEvent.consume(ka))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(ka){v.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var c=v.panningHandler.isForcePanningEvent;v.panningHandler.isForcePanningEvent=function(ka){return null!=v.freehand&&v.freehand.isActive()?!1:c.apply(this,arguments)||n.isSpaceDown()||mxEvent.isMouseEvent(ka.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(ka.getEvent()))&&(!mxEvent.isControlDown(ka.getEvent())&&mxEvent.isRightMouseButton(ka.getEvent())||mxEvent.isMiddleMouseButton(ka.getEvent()))};var g=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(ka){return g.apply(this,arguments)||13==ka.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(ka)||mxClient.IS_MAC&&mxEvent.isMetaDown(ka)||mxClient.IS_SF&&-mxEvent.isShiftDown(ka))};var l=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return n.isSpaceDown()||l.apply(this,arguments)};var t=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var ka=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,V=this.toolbar.container.firstChild;null!=V;){var k=V.getAttribute("data-min-width");null!=k&&parseInt(k)>ka?V.style.display="none":V.style.display="";V=V.nextSibling}}),B=!1,D=null,I=null,L=null,N=mxUtils.bind(this,function(){if(null!=-this.toolbar&&B!=v.cellEditor.isContentEditing()){for(var ka=this.toolbar.container.firstChild,V=[];null!=ka;){var k=ka.nextSibling;ka.parentNode.removeChild(ka);V.push(ka);ka=k}ka=this.toolbar.fontMenu;k=this.toolbar.sizeMenu;if(null==L)this.toolbar.createTextToolbar();else{for(var x=0;x<L.length;x++)this.toolbar.container.appendChild(L[x]);this.toolbar.fontMenu=D;this.toolbar.sizeMenu=I}B=v.cellEditor.isContentEditing();D=ka;I=k;L=V;t()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);-this.descriptorChanged();this.updateStatusAgain();N()}));this.addListener("currentThemeChanged",t);mxEvent.addListener(window,"resize",t);t();v.isTouchPopupMenuEnabled=function(){return null==n.dialog};var K=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){K.apply(this,arguments);N();if(v.cellEditor.isContentEditing()){var ka=!1,V=function(){ka||(ka=!0,window.setTimeout(function(){var k=v.getSelectedEditingElement();null!=k&&(k=mxUtils.getCurrentStyle(k),null!=k&&null!=n.toolbar&&(n.toolbar.setFontName(mxUtils.getCssFontFamily(k.fontFamily)),-n.toolbar.setFontSize(parseInt(k.fontSize))));ka=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",V);mxEvent.addListener(v.cellEditor.textarea,"touchend",V);mxEvent.addListener(v.cellEditor.textarea,"mouseup",V);mxEvent.addListener(v.cellEditor.textarea,"keyup",V);V()}};var da=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(ka,V){try{da.apply(this,arguments),N()}catch(k){n.handleError(k)}};v.container.setAttribute("tabindex","0");v.container.style.cursor="default";if(window.self===-window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(ka){}var ja=v.fireMouseEvent;v.fireMouseEvent=function(ka,V,k){try{ka==mxEvent.MOUSE_DOWN&&this.container.focus(),ja.apply(this,arguments)}catch(x){n.handleError(x)}};var ea=v.foldCells;v.foldCells=function(ka,V,k,x,J){try{ea.apply(this,arguments)}catch(R){n.handleError(R)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(ka,V,k){this.menus.createPopupMenu(ka,V,k)}));-mxEvent.addGestureListeners(document,mxUtils.bind(this,function(ka){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(ka,V){var k=[V.getProperty("cell")];V.getProperty("terminalInserted")&&(k.push(V.getProperty("terminal")),window.setTimeout(function(){null!=n.hoverIcons&&n.hoverIcons.update(v.view.getState(k[k.length-1]))},0));v.pasteCellStyles(k)});var ca=null,fa=null;-b=mxUtils.bind(this,function(){if(null!=this.toolbar){var ka=this.getSelectionState();if(v.isEnabled()&&0<ka.edges.length){if(null!=this.toolbar.edgeStyleMenu){var V=this.getImageForEdgeStyle(ka.style);1==ka.edges.length&&"arrow"==ka.style[mxConstants.STYLE_SHAPE]&&(V=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+V+")"}null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(ka.style)+")")}else null!=this.toolbar.edgeStyleMenu&&-(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ca+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+fa+")")}});v.selectionModel.addListener(mxEvent.CHANGE,b);v.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(ka,V){ka=V.getProperty("force");(this.updateDefaultStyle||ka)&&v.copyCellStyles(V.getProperty("cells"),V.getProperty("keys"),V.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),V=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(ca=this.getImageForEdgeStyle(v.currentEdgeStyle),0==V.edges.length&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ca+")")),null!=this.toolbar.edgeShapeMenu&&(fa=this.getImageForEdgeShape(v.currentEdgeStyle),0==V.edges.length&&-(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+fa+")")))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var ka=v.currentVertexStyle.fontFamily||"Helvetica",V=String(v.currentVertexStyle.fontSize||"12"),k=v.getView().getState(v.getSelectionCell());null!=k&&(ka=k.style[mxConstants.STYLE_FONTFAMILY]||ka,V=k.style[mxConstants.STYLE_FONTSIZE]||V,10<ka.length&&(ka=ka.substring(0,8)+"..."));this.toolbar.setFontName(ka);this.toolbar.setFontSize(V)}),v.getSelectionModel().addListener(mxEvent.CHANGE,-b),v.getModel().addListener(mxEvent.CHANGE,b));v.addListener(mxEvent.CELLS_ADDED,function(ka,V){ka=V.getProperty("cells");V=V.getProperty("parent");null!=V&&v.getModel().isLayer(V)&&!v.isCellVisible(V)&&null!=ka&&0<ka.length&&v.getModel().setVisible(V,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&!v.isSelectionEmpty()){var ka=v.getLayerForCells(v.getSelectionCells());null!=ka&&v.setDefaultParent(ka)}});this.gestureHandler=mxUtils.bind(this,+mxEvent.isShiftDown(ka))};var l=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return n.isSpaceDown()||l.apply(this,arguments)};var t=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var ka=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,W=this.toolbar.container.firstChild;null!=W;){var k=W.getAttribute("data-min-width");null!=k&&parseInt(k)>ka?W.style.display="none":W.style.display="";W=W.nextSibling}}),B=!1,D=null,I=null,K=null,M=mxUtils.bind(this,function(){if(null!=+this.toolbar&&B!=v.cellEditor.isContentEditing()){for(var ka=this.toolbar.container.firstChild,W=[];null!=ka;){var k=ka.nextSibling;ka.parentNode.removeChild(ka);W.push(ka);ka=k}ka=this.toolbar.fontMenu;k=this.toolbar.sizeMenu;if(null==K)this.toolbar.createTextToolbar();else{for(var y=0;y<K.length;y++)this.toolbar.container.appendChild(K[y]);this.toolbar.fontMenu=D;this.toolbar.sizeMenu=I}B=v.cellEditor.isContentEditing();D=ka;I=k;K=W;t()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);+this.descriptorChanged();this.updateStatusAgain();M()}));this.addListener("currentThemeChanged",t);mxEvent.addListener(window,"resize",t);t();v.isTouchPopupMenuEnabled=function(){return null==n.dialog};var V=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){V.apply(this,arguments);M();if(v.cellEditor.isContentEditing()){var ka=!1,W=function(){ka||(ka=!0,window.setTimeout(function(){var k=v.getSelectedEditingElement();null!=k&&(k=mxUtils.getCurrentStyle(k),null!=k&&null!=n.toolbar&&(n.toolbar.setFontName(mxUtils.getCssFontFamily(k.fontFamily)),+n.toolbar.setFontSize(parseInt(k.fontSize))));ka=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",W);mxEvent.addListener(v.cellEditor.textarea,"touchend",W);mxEvent.addListener(v.cellEditor.textarea,"mouseup",W);mxEvent.addListener(v.cellEditor.textarea,"keyup",W);W()}};var Q=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(ka,W){try{Q.apply(this,arguments),M()}catch(k){n.handleError(k)}};v.container.setAttribute("tabindex","0");v.container.style.cursor="default";if(window.self===+window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(ka){}var ja=v.fireMouseEvent;v.fireMouseEvent=function(ka,W,k){try{ka==mxEvent.MOUSE_DOWN&&this.container.focus(),ja.apply(this,arguments)}catch(y){n.handleError(y)}};var ea=v.foldCells;v.foldCells=function(ka,W,k,y,J){try{ea.apply(this,arguments)}catch(R){n.handleError(R)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(ka,W,k){this.menus.createPopupMenu(ka,W,k)}));+mxEvent.addGestureListeners(document,mxUtils.bind(this,function(ka){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(ka,W){var k=[W.getProperty("cell")];W.getProperty("terminalInserted")&&(k.push(W.getProperty("terminal")),window.setTimeout(function(){null!=n.hoverIcons&&n.hoverIcons.update(v.view.getState(k[k.length-1]))},0));v.pasteCellStyles(k)});var da=null,ia=null;+b=mxUtils.bind(this,function(){if(null!=this.toolbar){var ka=this.getSelectionState();if(v.isEnabled()&&0<ka.edges.length){if(null!=this.toolbar.edgeStyleMenu){var W=this.getImageForEdgeStyle(ka.style);1==ka.edges.length&&"arrow"==ka.style[mxConstants.STYLE_SHAPE]&&(W=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+W+")"}null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(ka.style)+")")}else null!=this.toolbar.edgeStyleMenu&&+(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+da+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+ia+")")}});v.selectionModel.addListener(mxEvent.CHANGE,b);v.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(ka,W){ka=W.getProperty("force");(this.updateDefaultStyle||ka)&&v.copyCellStyles(W.getProperty("cells"),W.getProperty("keys"),W.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),W=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(da=this.getImageForEdgeStyle(v.currentEdgeStyle),0==W.edges.length&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+da+")")),null!=this.toolbar.edgeShapeMenu&&(ia=this.getImageForEdgeShape(v.currentEdgeStyle),0==W.edges.length&&+(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+ia+")")))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var ka=v.currentVertexStyle.fontFamily||"Helvetica",W=String(v.currentVertexStyle.fontSize||"12"),k=v.getView().getState(v.getSelectionCell());null!=k&&(ka=k.style[mxConstants.STYLE_FONTFAMILY]||ka,W=k.style[mxConstants.STYLE_FONTSIZE]||W,10<ka.length&&(ka=ka.substring(0,8)+"..."));this.toolbar.setFontName(ka);this.toolbar.setFontSize(W)}),v.getSelectionModel().addListener(mxEvent.CHANGE,+b),v.getModel().addListener(mxEvent.CHANGE,b));v.addListener(mxEvent.CELLS_ADDED,function(ka,W){ka=W.getProperty("cells");W=W.getProperty("parent");null!=W&&v.getModel().isLayer(W)&&!v.isCellVisible(W)&&null!=ka&&0<ka.length&&v.getModel().setVisible(W,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&!v.isSelectionEmpty()){var ka=v.getLayerForCells(v.getSelectionCells());null!=ka&&v.setDefaultParent(ka)}});this.gestureHandler=mxUtils.bind(this,function(ka){this.isHideCurrentMenuEvent(ka)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var la=null;this.resizeHandler=mxUtils.bind(this,function(){null!=la&&window.clearTimeout(la);la=window.setTimeout(mxUtils.bind(this,function(){la=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;@@ -2111,48 +2111,50 @@ EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"mxUtils.bind(m,m.showLinkDialog);b.editLink=m.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,d=b.getSelectionCells(),m=this.initSelectionState(),n=!0,v=0;v<d.length;v++){var p=b.getCurrentCellStyle(d[v]);"0"!=mxUtils.getValue(p,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(m,d[v],d,n),n=!1)}this.updateSelectionStateForTableCells(m);if(Editor.enableCustomProperties){m.customProperties={};b=m.vertices;d=m.edges;for(v=0;v<b.length;v++)this.findCommonProperties(b[v],m.customProperties,0==v,m);for(v=0;v<d.length;v++)this.findCommonProperties(d[v],m.customProperties,0==b.length&&0==v,m)}return m};-EditorUi.prototype.findCommonProperties=function(b,d,m,n){n=mxUtils.bind(this,function(E){if(null!=E)if(m)for(var Q=0;Q<E.length;Q++)d[E[Q].name]=E[Q];else for(var M in d)if(null!=M){var c=!1;for(Q=0;Q<E.length;Q++)if(E[Q].name==M&&E[Q].type==d[M].type){c=!0;break}c||delete d[M]}});var v=this.editor.graph,p=v.view.getState(b);if(null!=p&&null!=p.shape){if(!p.shape.commonCustomPropAdded){p.shape.commonCustomPropAdded=!0;p.shape.customProperties=p.shape.customProperties||[];if(null!=p.shape&&null!=-p.shape.stencil&&null!=p.shape.stencil.desc){var C=p.shape.stencil,G=[],T=mxUtils.bind(this,function(E){E=C.desc.getElementsByTagName(E);for(var Q=[],M=0;M<E.length;M++){var c=E[M].getAttribute("color");if(!mxUtils.isValidColor(c)&&!G[c]&&"fill"!=c&&"stroke"!=c&&"font"!=c){G[c]=!0;var g=E[M].getAttribute("name");g=null!=g?g:Editor.getLabelForStylename(c);var l=E[M].getAttribute("default"),t=C.getDefaultColorValue(E[M],v),B=l;l==mxConstants.NONE&&(l="default");Q.push({name:c,type:"color",primary:"false"!=-E[M].getAttribute("primary"),defVal:l,defaultColor:t,undefinedColor:B,dispName:g})}}return Q});Array.prototype.push.apply(p.shape.customProperties,T("fillcolor"));Array.prototype.push.apply(p.shape.customProperties,T("strokecolor"));Array.prototype.push.apply(p.shape.customProperties,T("fontcolor"))}p.cell.vertex?Array.prototype.push.apply(p.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(p.shape.customProperties,Editor.commonEdgeProperties)}n(p.shape.customProperties)}b=+EditorUi.prototype.findCommonProperties=function(b,d,m,n){n=mxUtils.bind(this,function(E){if(null!=E)if(m)for(var P=0;P<E.length;P++)d[E[P].name]=E[P];else for(var L in d)if(null!=L){var c=!1;for(P=0;P<E.length;P++)if(E[P].name==L&&E[P].type==d[L].type){c=!0;break}c||delete d[L]}});var v=this.editor.graph,p=v.view.getState(b);if(null!=p&&null!=p.shape){if(!p.shape.commonCustomPropAdded){p.shape.commonCustomPropAdded=!0;p.shape.customProperties=p.shape.customProperties||[];if(null!=p.shape&&null!=+p.shape.stencil&&null!=p.shape.stencil.desc){var C=p.shape.stencil,G=[],T=mxUtils.bind(this,function(E){E=C.desc.getElementsByTagName(E);for(var P=[],L=0;L<E.length;L++){var c=E[L].getAttribute("color");if(!mxUtils.isValidColor(c)&&!G[c]&&"fill"!=c&&"stroke"!=c&&"font"!=c){G[c]=!0;var g=E[L].getAttribute("name");g=null!=g?g:Editor.getLabelForStylename(c);var l=E[L].getAttribute("default"),t=C.getDefaultColorValue(E[L],v),B=l;l==mxConstants.NONE&&(l="default");P.push({name:c,type:"color",primary:"false"!=+E[L].getAttribute("primary"),defVal:l,defaultColor:t,undefinedColor:B,dispName:g})}}return P});Array.prototype.push.apply(p.shape.customProperties,T("fillcolor"));Array.prototype.push.apply(p.shape.customProperties,T("strokecolor"));Array.prototype.push.apply(p.shape.customProperties,T("fontcolor"))}p.cell.vertex?Array.prototype.push.apply(p.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(p.shape.customProperties,Editor.commonEdgeProperties)}n(p.shape.customProperties)}b=b.getAttribute("customProperties");if(null!=b)try{n(JSON.parse(b))}catch(E){}};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 d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,n=m.getParent(d[0]),v=m.getParent(n);if(null!=n&&null!=v){for(var p=n.getIndex(d[0]),C=v.getIndex(n),G=null,T=1,E=1,Q=0,M=C<v.getChildCount()-1?m.getChildAt(m.getChildAt(v,C+1),p):null;Q<d.length-1;){var c=d[++Q];null==M||M!=c||null!=G&&T!=G||(G=T,T=0,E++,n=m.getParent(M),M=C+E<v.getChildCount()?m.getChildAt(m.getChildAt(v,C+E),p):null);var g=this.editor.graph.view.getState(c);-if(c==m.getChildAt(n,p+T)&&null!=g&&1==mxUtils.getValue(g.style,"colspan",1)&&1==mxUtils.getValue(g.style,"rowspan",1))T++;else break}Q==E*T-1&&(b.mergeCell=d[0],b.colspan=T,b.rowspan=E)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};+EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,n=m.getParent(d[0]),v=m.getParent(n);if(null!=n&&null!=v){for(var p=n.getIndex(d[0]),C=v.getIndex(n),G=null,T=1,E=1,P=0,L=C<v.getChildCount()-1?m.getChildAt(m.getChildAt(v,C+1),p):null;P<d.length-1;){var c=d[++P];null==L||L!=c||null!=G&&T!=G||(G=T,T=0,E++,n=m.getParent(L),L=C+E<v.getChildCount()?m.getChildAt(m.getChildAt(v,C+E),p):null);var g=this.editor.graph.view.getState(c);+if(c==m.getChildAt(n,p+T)&&null!=g&&1==mxUtils.getValue(g.style,"colspan",1)&&1==mxUtils.getValue(g.style,"rowspan",1))T++;else break}P==E*T-1&&(b.mergeCell=d[0],b.colspan=T,b.rowspan=E)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};EditorUi.prototype.createTimeout=function(b,d,m){var n=!0,v=null,p=mxUtils.bind(this,function(G){v.clear()&&(n=!1,G=null!=G?G:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,d,m)})},null!=m?m(G):this.handleError(G))}),C=window.setTimeout(p,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(C);return n},isAlive:function(){return n}};null!=d&&this.tryAndHandle(mxUtils.bind(this,function(){d(v)}),p);return v};EditorUi.prototype.tryAndHandle=function(b,d){try{b()}catch(m){null!=d?d(m):this.handleError(m)}};-EditorUi.prototype.removeUserDefinedDarkColors=function(b,d,m){var n=this.editor.graph;b=null!=b?b:n.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");n.model.beginUpdate();try{for(var C=0;C<b.length;C++)if(n.model.isEdge(b[C])||n.model.isVertex(b[C])){var G=n.getCellStyle(b[C],!1);if(null!=G)for(var T=0;T<v.length;T++)try{var E=G[v[T]];if(mxUtils.isLightDarkColor(E)){var Q=mxUtils.getLightDarkColor(E);n.setCellStyles(v[T],Q.light,[b[C]])}}catch(c){}d&&n.isHtmlLabel(b[C])&&-"0"!=mxUtils.getValue(G,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(n.getLabel(b[C])),Graph.addLightDarkColors(p,null,null,function(c,g,l){return mxUtils.isLightDarkColor(l)?(l=mxUtils.getLightDarkColor(l),c.style.setProperty(g,l.light),!0):!1})&&n.cellLabelChanged(b[C],p.innerHTML))}if(m&&mxUtils.isLightDarkColor(n.background)){Q=mxUtils.getLightDarkColor(n.background);var M=new ChangePageSetup(this,Q.light);M.ignoreImage=!0;n.model.execute(M)}}finally{n.model.endUpdate()}return b};+EditorUi.prototype.removeUserDefinedDarkColors=function(b,d,m){var n=this.editor.graph;b=null!=b?b:n.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");n.model.beginUpdate();try{for(var C=0;C<b.length;C++)if(n.model.isEdge(b[C])||n.model.isVertex(b[C])){var G=n.getCellStyle(b[C],!1);if(null!=G)for(var T=0;T<v.length;T++)try{var E=G[v[T]];if(mxUtils.isLightDarkColor(E)){var P=mxUtils.getLightDarkColor(E);n.setCellStyles(v[T],P.light,[b[C]])}}catch(c){}d&&n.isHtmlLabel(b[C])&&+"0"!=mxUtils.getValue(G,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(n.getLabel(b[C])),Graph.addLightDarkColors(p,null,null,function(c,g,l){return mxUtils.isLightDarkColor(l)?(l=mxUtils.getLightDarkColor(l),c.style.setProperty(g,l.light),!0):!1})&&n.cellLabelChanged(b[C],p.innerHTML))}if(m&&mxUtils.isLightDarkColor(n.background)){P=mxUtils.getLightDarkColor(n.background);var L=new ChangePageSetup(this,P.light);L.ignoreImage=!0;n.model.execute(L)}}finally{n.model.endUpdate()}return b};EditorUi.prototype.updateSelectionStateForCell=function(b,d,m,n){m=this.editor.graph;b.cells.push(d);if(m.getModel().isVertex(d)){b.connections=0<m.model.getEdgeCount(d);b.unlocked=b.unlocked&&!m.isCellLocked(d);b.resizable=b.resizable&&m.isCellResizable(d);b.rotatable=b.rotatable&&m.isCellRotatable(d);b.movable=b.movable&&m.isCellMovable(d)&&!m.isTableRow(d)&&!m.isTableCell(d);b.swimlane=b.swimlane||m.isSwimlane(d);b.table=b.table||m.isTable(d);b.cell=b.cell||m.isTableCell(d);b.row=b.row||m.isTableRow(d);b.vertices.push(d);var v=m.getCellGeometry(d);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 m.getModel().isEdge(d)&&(b.edges.push(d),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=!1);p=m.view.getState(d);null!=p&&(b.html=b.html&&m.isHtmlLabel(d),b.autoSize=b.autoSize||m.isAutoSizeState(p),b.glass=b.glass&&m.isGlassState(p),b.rounded=b.rounded&&m.isRoundedState(p),b.lineJumps=b.lineJumps&&m.isLineJumpState(p),b.image=b.image||m.isImageState(p),b.shadow=b.shadow&&m.isShadowState(p),b.fill=b.fill&&m.isFillState(p),b.gradient=b.fill&&m.isGradientState(p),b.stroke=b.stroke&&m.isStrokeState(p),d=mxUtils.getValue(p.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||"image"==d,m.mergeStyle(p.style,b.style,n))};-EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,d=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(E,Q){"mouseDown"==Q.getProperty("eventName")&&d.hideShapePicker()}));var m=mxUtils.bind(this,function(){d.hideShapePicker(!0)});b.addListener("wheel",m);b.addListener(mxEvent.ESCAPE,m);b.view.addListener(mxEvent.SCALE,m);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,m);b.getSelectionModel().addListener(mxEvent.CHANGE,m);var n=b.popupMenuHandler.isMenuShowing;-b.popupMenuHandler.isMenuShowing=function(){return n.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var v=b.dblClick;b.dblClick=function(E,Q){if(this.isEnabled())if(null!=Q||null==d.sidebar||mxEvent.isShiftDown(E)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var M=mxUtils.convertPoint(this.container,mxEvent.getClientX(E),mxEvent.getClientY(E));mxEvent.consume(E);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(M.x,M.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",-mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,d.hideShapePicker(!0))}));var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){d.hideShapePicker();p.apply(this,arguments)};var C=this.hoverIcons.execute;this.hoverIcons.execute=function(E,Q,M){var c=M.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?C.apply(this,arguments):this.graph.connectVertex(E.cell,Q,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,-function(g,l,t){var B=b.getCompositeParent(E.cell);g=b.getCellGeometry(B);for(M.consume();null!=B&&b.model.isVertex(B)&&null!=g&&g.relative;)cell=B,B=b.model.getParent(cell),g=b.getCellGeometry(B);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=d.showShapePicker(M.getGraphX(),M.getGraphY(),B,mxUtils.bind(this,function(D){t(D);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(D))}),Q)}),30)}),mxUtils.bind(this,function(g){this.graph.selectCellsForConnectVertex(g,c,this)}))};-var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(E,Q){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var M=Q.getProperty("arrow"),c=Q.getProperty("direction"),g=Q.getProperty("event");M=M.getBoundingClientRect();var l=mxUtils.getOffset(b.container),t=b.container.scrollLeft+M.x-l.x;l=b.container.scrollTop+M.y-l.y;var B=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),D=d.showShapePicker(t,l,B,-mxUtils.bind(this,function(I){null!=I&&b.connectVertex(B,c,b.defaultEdgeLength,g,!0,!1,function(L,N,K){K(I);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(I))},function(L){b.selectCellsForConnectVertex(L)},g,this.hoverIcons)}),c,!0);null!=D&&(this.centerShapePicker(D,M,t,l,c),this.hoverIcons.shapePickerHoverDiv=D,mxUtils.setOpacity(D,30),mxEvent.addListener(D,"mouseenter",function(){mxUtils.setOpacity(D,100)}),mxEvent.addListener(D,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));-this.hoverIcons.addListener("blur",mxUtils.bind(this,function(E,Q){null!=G&&window.clearTimeout(G)}))}var T=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(E,Q){T=!1}),mouseMove:mxUtils.bind(this,function(E,Q){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(T=!0)}),mouseUp:mxUtils.bind(this,function(E,Q){E=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=E&&!T){var M=Q.getEvent();if(!b.isCloneEvent(M)&&!mxEvent.isShiftDown(M)){for(var c=-mxConstants.DIRECTION_EAST,g=b.getCompositeParent(E.cell),l=b.getCellGeometry(g);null!=g&&b.model.isVertex(g)&&null!=l&&l.relative;)g=b.model.getParent(g),l=b.getCellGeometry(g);b.connectVertex(E.cell,c,b.defaultEdgeLength,M,null,!0,mxUtils.bind(this,function(t,B,D){Q.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(Q.getGraphX(),Q.getGraphY(),g,mxUtils.bind(this,function(I){D(I);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(I))}),c)}),30)}),mxUtils.bind(this,function(t){b.selectCellsForConnectVertex(t,-M)}))}}T=!1})})};EditorUi.prototype.centerShapePicker=function(b,d,m,n,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(m-=p.width/2-10,n-=p.height+6):v==mxConstants.DIRECTION_SOUTH?(m-=p.width/2-10,n+=d.height+6):v==mxConstants.DIRECTION_WEST?(m-=p.width+6,n-=p.height/2-10):v==mxConstants.DIRECTION_EAST&&(m+=d.width+6,n-=p.height/2-10);b.style.left=m+"px";b.style.top=n+"px"};+EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,d=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(E,P){"mouseDown"==P.getProperty("eventName")&&d.hideShapePicker()}));var m=mxUtils.bind(this,function(){d.hideShapePicker(!0)});b.addListener("wheel",m);b.addListener(mxEvent.ESCAPE,m);b.view.addListener(mxEvent.SCALE,m);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,m);b.getSelectionModel().addListener(mxEvent.CHANGE,m);var n=b.popupMenuHandler.isMenuShowing;+b.popupMenuHandler.isMenuShowing=function(){return n.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var v=b.dblClick;b.dblClick=function(E,P){if(this.isEnabled())if(null!=P||null==d.sidebar||mxEvent.isShiftDown(E)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var L=mxUtils.convertPoint(this.container,mxEvent.getClientX(E),mxEvent.getClientY(E));mxEvent.consume(E);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(L.x,L.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",+mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,d.hideShapePicker(!0))}));var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){d.hideShapePicker();p.apply(this,arguments)};var C=this.hoverIcons.execute;this.hoverIcons.execute=function(E,P,L){var c=L.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?C.apply(this,arguments):this.graph.connectVertex(E.cell,P,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,+function(g,l,t){var B=b.getCompositeParent(E.cell);g=b.getCellGeometry(B);for(L.consume();null!=B&&b.model.isVertex(B)&&null!=g&&g.relative;)cell=B,B=b.model.getParent(cell),g=b.getCellGeometry(B);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=d.showShapePicker(L.getGraphX(),L.getGraphY(),B,mxUtils.bind(this,function(D){t(D);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(D))}),P)}),30)}),mxUtils.bind(this,function(g){this.graph.selectCellsForConnectVertex(g,c,this)}))};+var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(E,P){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var L=P.getProperty("arrow"),c=P.getProperty("direction"),g=P.getProperty("event");L=L.getBoundingClientRect();var l=mxUtils.getOffset(b.container),t=b.container.scrollLeft+L.x-l.x;l=b.container.scrollTop+L.y-l.y;var B=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),D=d.showShapePicker(t,l,B,+mxUtils.bind(this,function(I){null!=I&&b.connectVertex(B,c,b.defaultEdgeLength,g,!0,!1,function(K,M,V){V(I);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(I))},function(K){b.selectCellsForConnectVertex(K)},g,this.hoverIcons)}),c,!0);null!=D&&(this.centerShapePicker(D,L,t,l,c),this.hoverIcons.shapePickerHoverDiv=D,mxUtils.setOpacity(D,30),mxEvent.addListener(D,"mouseenter",function(){mxUtils.setOpacity(D,100)}),mxEvent.addListener(D,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));+this.hoverIcons.addListener("blur",mxUtils.bind(this,function(E,P){null!=G&&window.clearTimeout(G)}))}var T=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(E,P){T=!1}),mouseMove:mxUtils.bind(this,function(E,P){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(T=!0)}),mouseUp:mxUtils.bind(this,function(E,P){E=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=E&&!T){var L=P.getEvent();if(!b.isCloneEvent(L)&&!mxEvent.isShiftDown(L)){for(var c=+mxConstants.DIRECTION_EAST,g=b.getCompositeParent(E.cell),l=b.getCellGeometry(g);null!=g&&b.model.isVertex(g)&&null!=l&&l.relative;)g=b.model.getParent(g),l=b.getCellGeometry(g);b.connectVertex(E.cell,c,b.defaultEdgeLength,L,null,!0,mxUtils.bind(this,function(t,B,D){P.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(P.getGraphX(),P.getGraphY(),g,mxUtils.bind(this,function(I){D(I);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(I))}),c)}),30)}),mxUtils.bind(this,function(t){b.selectCellsForConnectVertex(t,+L)}))}}T=!1})})};EditorUi.prototype.centerShapePicker=function(b,d,m,n,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(m-=p.width/2-10,n-=p.height+6):v==mxConstants.DIRECTION_SOUTH?(m-=p.width/2-10,n+=d.height+6):v==mxConstants.DIRECTION_WEST?(m-=p.width+6,n-=p.height/2-10):v==mxConstants.DIRECTION_EAST&&(m+=d.width+6,n-=p.height/2-10);b.style.left=m+"px";b.style.top=n+"px"};EditorUi.prototype.showShapePicker=function(b,d,m,n,v,p,C,G,T){var E=null;this.editor.graph.freehand.isDrawing()||(G=G||null==m,E=this.createShapePicker(b,d,m,n,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(m,p,G),p,C,G,T),null!=E&&(null==this.hoverIcons||p||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=n,this.shapePicker=E));return E};-EditorUi.prototype.createShapePicker=function(b,d,m,n,v,p,C,G,T,E,Q){Q=null!=Q?Q:!0;var M=this.editor.graph,c=null;T=null!=T?T:function(t){t=t[0];var B=0,D=0,I=t.geometry;null!=I&&(M.model.isEdge(t)&&(t=I.getTerminalPoint(!1),I=new mxRectangle(0,0,t.x,t.y)),B=I.width/2,D=I.height/2);return new mxPoint(M.snap(Math.round(b/M.view.scale)-M.view.translate.x-B),M.snap(Math.round(d/M.view.scale)-M.view.translate.y-D))};if(null!=C&&0<C.length){var g=this;M=this.editor.graph;c=document.createElement("div");-v=M.view.getState(m);var l=null==m||null!=v&&M.isTransparentState(v)?null:M.copyStyle(m);c.className="geShapePicker";c.setAttribute("title",mxResources.get("sidebarTooltip"));c.style.left=Math.round(b)+"px";c.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(c.style.touchAction="none");G||mxUtils.setPrefixedStyle(c.style,"transform","translate(-22px,-22px)");M.container.appendChild(c);v=mxUtils.bind(this,function(t){var B=document.createElement("a");c.appendChild(B);null!=l&&"1"!=urlParams.sketch?-this.sidebar.graph.pasteStyle(l,[t]):this.sidebar.graph.pasteCellStyles([t],M.currentVertexStyle,M.currentEdgeStyle);var D=t.geometry;M.model.isEdge(t)&&(D=D.getTerminalPoint(!1),D=new mxRectangle(0,0,D.x,D.y));null!=D&&(D=this.sidebar.createVertexTemplateFromCells([t],D.width,D.height,"",!0,!1,null,!1,mxUtils.bind(this,function(I){if(!mxEvent.isAltDown(I)||1!=M.getSelectionCount()){if(!mxEvent.isShiftDown(I)||null==m&&M.isSelectionEmpty()){var L=M.cloneCell(t);if(null!=n)n(L);else{var N=T([L]);M.model.isEdge(L)?-L.geometry.translate(N.x,N.y):(L.geometry.x=N.x,L.geometry.y=N.y);M.model.beginUpdate();try{M.addCell(L),M.model.isVertex(L)&&M.isAutoSizeCell(L)&&M.updateCellSize(L)}finally{M.model.endUpdate()}M.setSelectionCell(L);M.scrollCellToVisible(L);Q&&M.startEditing(L);null!=g.hoverIcons&&g.hoverIcons.update(M.view.getState(L))}}else L=M.getEditableCells(null!=m?[m]:M.getSelectionCells()),M.updateShapes(t,L);null!=p&&p(I);mxEvent.consume(I)}}),25,25,null,null,m),D.style.display="flex",D.style.alignItems=-"center",D.style.justifyContent="center",B.appendChild(D))});for(E=0;E<(G?Math.min(C.length,4):C.length);E++)v(C[E]);C=c.offsetTop+c.clientHeight-(M.container.scrollTop+M.container.offsetHeight);0<C&&(c.style.top=Math.max(M.container.scrollTop+22,d-C)+"px");C=c.offsetLeft+c.clientWidth-(M.container.scrollLeft+M.container.offsetWidth);0<C&&(c.style.left=Math.max(M.container.scrollLeft+22,b-C)+"px")}return c};-EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var n=this.editor.graph,v=mxUtils.bind(this,function(p,C,G,T){return n.createVertex(null,null,T||"",0,0,C||120,G||60,p,!1)});d=mxUtils.bind(this,function(p,C,G){p=new mxCell(G||"",new mxGeometry(0,0,n.defaultEdgeLength+20,0),p);p.geometry.setTerminalPoint(new mxPoint(0,0),!0);p.geometry.setTerminalPoint(new mxPoint(p.geometry.width,null!=C?C:0),!1);p.geometry.points=null!=C?[new mxPoint(p.geometry.width/2,C)]:[];p.geometry.relative=!0;p.edge=-!0;return p});if(null!=b)try{b=n.cloneCell(b),n.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(p){b=null}null==b&&(b=v(n.appendFontSize(Editor.defaultTextStyle,n.vertexFontSize),60,30,"Text"));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)];m&&(b=b.concat([d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),d("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",-this.editor.graph.defaultEdgeLength/2)]));return b};EditorUi.prototype.isShapePickerVisible=function(b){return null!=this.shapePicker};EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};-EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};+EditorUi.prototype.createShapePicker=function(b,d,m,n,v,p,C,G,T,E,P){P=null!=P?P:!0;var L=this.editor.graph,c=null;T=null!=T?T:function(t){t=t[0];var B=0,D=0,I=t.geometry;null!=I&&(L.model.isEdge(t)&&(t=I.getTerminalPoint(!1),I=new mxRectangle(0,0,t.x,t.y)),B=I.width/2,D=I.height/2);return new mxPoint(L.snap(Math.round(b/L.view.scale)-L.view.translate.x-B),L.snap(Math.round(d/L.view.scale)-L.view.translate.y-D))};if(null!=C&&0<C.length){var g=this;L=this.editor.graph;c=document.createElement("div");+v=L.view.getState(m);var l=null==m||null!=v&&L.isTransparentState(v)?null:L.copyStyle(m);c.className="geShapePicker";c.setAttribute("title",mxResources.get("sidebarTooltip"));c.style.left=Math.round(b)+"px";c.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(c.style.touchAction="none");G||mxUtils.setPrefixedStyle(c.style,"transform","translate(-22px,-22px)");L.container.appendChild(c);v=mxUtils.bind(this,function(t){var B=document.createElement("a");c.appendChild(B);var D=t.shapePickerKeepStyle;+delete t.shapePickerKeepStyle;D||(null!=l&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(l,[t]):this.sidebar.graph.pasteCellStyles([t],L.currentVertexStyle,L.currentEdgeStyle));D=t.geometry;L.model.isEdge(t)&&(D=D.getTerminalPoint(!1),D=new mxRectangle(0,0,D.x,D.y));null!=D&&(D=this.sidebar.createVertexTemplateFromCells([t],D.width,D.height,"",!0,!1,null,!0,mxUtils.bind(this,function(I){if(!mxEvent.isAltDown(I)||1!=L.getSelectionCount()){if(!mxEvent.isShiftDown(I)||null==m&&L.isSelectionEmpty()){var K=+L.cloneCell(t);if(null!=n)n(K);else{var M=T([K]);L.model.isEdge(K)?K.geometry.translate(M.x,M.y):(K.geometry.x=M.x,K.geometry.y=M.y);L.model.beginUpdate();try{L.addCell(K),L.model.isVertex(K)&&L.isAutoSizeCell(K)&&L.updateCellSize(K)}finally{L.model.endUpdate()}L.setSelectionCell(K);L.scrollCellToVisible(K);P&&L.startEditing(K);null!=g.hoverIcons&&g.hoverIcons.update(L.view.getState(K))}}else K=L.getEditableCells(null!=m?[m]:L.getSelectionCells()),L.updateShapes(t,K);null!=p&&p(I);mxEvent.consume(I)}}),+25,25,null,null,m),D.style.display="flex",D.style.alignItems="center",D.style.justifyContent="center",B.appendChild(D))});for(E=0;E<(G?Math.min(C.length,4):C.length);E++)v(C[E]);C=c.offsetTop+c.clientHeight-(L.container.scrollTop+L.container.offsetHeight);0<C&&(c.style.top=Math.max(L.container.scrollTop+22,d-C)+"px");C=c.offsetLeft+c.clientWidth-(L.container.scrollLeft+L.container.offsetWidth);0<C&&(c.style.left=Math.max(L.container.scrollLeft+22,b-C)+"px")}return c};+EditorUi.prototype.defaultShapePickerEntries=null;+EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var n=this.editor.graph,v=mxUtils.bind(this,function(L,c,g,l){return n.createVertex(null,null,l||"",0,0,c||120,g||60,L,!1)});d=mxUtils.bind(this,function(L,c,g){L=new mxCell(g||"",new mxGeometry(0,0,n.defaultEdgeLength+20,0),L);L.geometry.setTerminalPoint(new mxPoint(0,0),!0);L.geometry.setTerminalPoint(new mxPoint(L.geometry.width,null!=c?c:0),!1);L.geometry.points=null!=c?[new mxPoint(L.geometry.width/2,c)]:[];L.geometry.relative=!0;L.edge=+!0;return L});if(null!=b)try{b=n.cloneCell(b),n.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(L){b=null}if(null!=this.defaultShapePickerEntries){for(var p=[],C=[],G=function(L){if(null!=L&&"object"===typeof L){var c=mxUtils.createXmlDocument().createElement("UserObject"),g;for(g in L)L.hasOwnProperty(g)&&c.setAttribute(g,L[g]);null==c.getAttribute("label")&&c.setAttribute("label","");return c}return L},T=0;T<this.defaultShapePickerEntries.length;T++){var E=this.defaultShapePickerEntries[T];+if(null!=E.style){var P=G(E.value);E.edge?C.push(d(E.style,E.y,P)):(P=v(E.style,E.width,E.height,P),E.keepStyle&&(P.shapePickerKeepStyle=!0),p.push(P))}}null!=b&&(p[0]=b);b=p;m&&(b=b.concat(C));return b}null==b&&(b=v(n.appendFontSize(Editor.defaultTextStyle,n.vertexFontSize),60,30,"Text"));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)];m&&(b=b.concat([d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),+d("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return b};EditorUi.prototype.isShapePickerVisible=function(b){return null!=this.shapePicker};+EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var m=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!m&&!mxClient.IS_IE&&!mxClient.IS_IE11){var n=window.getSelection(),v=0<n.rangeCount?n.getRangeAt(0).commonAncestorContainer:null;m=null!=v&&("LI"==v.nodeName||null!=v.parentNode&&"LI"==v.parentNode.nodeName)}m?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?d.stopEditing(!1):d.cellEditor.insertTab(d.cellEditor.isContentEditing()?null:4)}catch(p){}else mxEvent.isAltDown(b)?d.selectParentCell():d.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};EditorUi.prototype.onKeyPress=function(b){var d=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(b)===this.typingShim||!this.isImmediateEditingEvent(b)||d.isEditing()||d.isSelectionEmpty()||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(null==b.key||1!==b.key.length)&&229!==b.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(b)||(d.escape(),d.cellEditor.editByTyping=!0,d.startEditing())};-EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";this.typingShim=d;var m=!1,n=mxUtils.bind(this,-function(){if(!m&&0<d.value.length){var p=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,p)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;n()});mxEvent.addListener(d,"input",function(){n()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(p){229!==p.keyCode&&(mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||(null==p.key||1!==p.key.length||mxEvent.isAltDown(p)?p.preventDefault():-null!=this.keyHandler&&null!=this.keyHandler.getFunction(p)&&p.preventDefault()))}));b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));b.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));b.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));-if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var v=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?v.apply(b.cellEditor):this.updateTypingShim()})};+EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&d.setAttribute("inputmode","none");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";+this.typingShim=d;var m=!1,n=mxUtils.bind(this,function(){if(!m&&0<d.value.length){var p=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,p)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;n()});mxEvent.addListener(d,"input",function(){n()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(p){229!==p.keyCode&&(mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||(null==p.key||+1!==p.key.length||mxEvent.isAltDown(p)?p.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(p)&&p.preventDefault()))}));b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));b.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));b.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,+function(){this.updateTypingShim()}),0)}));if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var v=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?v.apply(b.cellEditor):this.updateTypingShim()})};EditorUi.prototype.updateTypingShim=function(){var b=this.editor.graph;b.isEditing()||b.isSelectionEmpty()||!b.isEnabled()||b.isCellLocked(b.getSelectionCell())?this.hideTypingShim():this.showTypingShim()};EditorUi.prototype.showTypingShim=function(){var b=this.editor.graph,d=this.typingShim;if(null!=d&&!b.isEditing()){var m=b.getSelectionCell();m=b.getView().getState(m);null!=m&&(d.style.left=Math.round(m.x)+"px",d.style.top=Math.round(m.y)+"px",d.parentNode!==b.container&&b.container.appendChild(d),d.value="",m=document.activeElement,(null==m||m===document.body||m===b.container||b.container.contains(m))&&d.focus({preventScroll:!0}))}};EditorUi.prototype.hideTypingShim=function(){var b=this.typingShim;null!=b&&null!=b.parentNode&&b.parentNode.removeChild(b)};EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};EditorUi.prototype.updateCssForMarker=function(b,d,m,n,v){m=this.getImageForMarker(n,v,m);b.innerHTML="";null==m?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(n=document.createElement("img"),n.setAttribute("src",m),"end"==d&&mxUtils.setPrefixedStyle(n.style,"transform","scaleX(-1)"),b.appendChild(n))};@@ -2164,49 +2166,49 @@ EditorUi.prototype.getImageForEdgeShape=function(b){var d=Format.connectionImageEditorUi.prototype.getImageForEdgeStyle=function(b){var d=Format.orthogonalImage.src,m=mxUtils.getValue(b,mxConstants.STYLE_EDGE,null);"1"==mxUtils.getValue(b,mxConstants.STYLE_NOEDGESTYLE,null)&&(m=null);"orthogonalEdgeStyle"==m&&"1"==mxUtils.getValue(b,mxConstants.STYLE_CURVED,null)?d=Format.curvedImage.src:"straight"==m||"none"==m||null==m?d=Format.straightImage.src:"entityRelationEdgeStyle"==m?d=Format.entityImage.src:"elbowEdgeStyle"==m?d="vertical"==mxUtils.getValue(b,mxConstants.STYLE_ELBOW,null)?Format.verticalElbowImage.src:Format.horizontalElbowImage.src:"isometricEdgeStyle"==m&&(d="vertical"==mxUtils.getValue(b,mxConstants.STYLE_ELBOW,null)?Format.verticalIsometricImage.src:Format.horizontalIsometricImage.src);return d};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,d=this.actions.get("paste"),m=this.actions.get("pasteHere");d.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));m.setEnabled(d.isEnabled())};-EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var C=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{C=C||p.getSelectionCells();C=p.getExportableCells(p.model.getTopmostCells(C));for(var G={},T=p.createCellLookup(C),E=p.cloneCells(C,null,G),Q=new mxGraphModel,M=Q.getChildAt(Q.getRoot(),-0),c=0;c<E.length;c++){Q.add(M,E[c]);var g=p.view.getState(C[c]);if(null!=g){var l=p.getCellGeometry(E[c]);null!=l&&l.relative&&!Q.isEdge(C[c])&&null==T[mxObjectIdentity.get(Q.getParent(C[c]))]&&(l.offset=null,l.relative=!1,l.x=g.x/g.view.scale-g.view.translate.x,l.y=g.y/g.view.scale-g.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(G,T),E);mxClipboard.insertCount=1;mxClipboard.setCells(E)}b.updatePasteActionStates();return C};var m=mxClipboard.paste;mxClipboard.paste=function(p){var C=+EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var C=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{C=C||p.getSelectionCells();C=p.getExportableCells(p.model.getTopmostCells(C));for(var G={},T=p.createCellLookup(C),E=p.cloneCells(C,null,G),P=new mxGraphModel,L=P.getChildAt(P.getRoot(),+0),c=0;c<E.length;c++){P.add(L,E[c]);var g=p.view.getState(C[c]);if(null!=g){var l=p.getCellGeometry(E[c]);null!=l&&l.relative&&!P.isEdge(C[c])&&null==T[mxObjectIdentity.get(P.getParent(C[c]))]&&(l.offset=null,l.relative=!1,l.x=g.x/g.view.scale-g.view.translate.x,l.y=g.y/g.view.scale-g.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(G,T),E);mxClipboard.insertCount=1;mxClipboard.setCells(E)}b.updatePasteActionStates();return C};var m=mxClipboard.paste;mxClipboard.paste=function(p){var C=null;p.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):C=m.apply(this,arguments);b.updatePasteActionStates();return C};var n=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){n.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(p,C){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 W=this.graph.getPageLayout(),U=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+W.x*U.width),this.scale*(this.translate.y+W.y*U.height),this.scale*W.width*U.width,-this.scale*W.height*U.height)};b.getPreferredPageSize=function(W,U,aa){W=this.getPageLayout();U=this.getPageSize();return new mxRectangle(0,0,W.width*U.width,W.height*U.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(W,U,aa,ia){if(null!=b.container&&!b.isViewer()){aa=null!=aa?aa:0;ia=null!=ia?ia:0;var na=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),qa=mxUtils.hasScrollbars(b.container),ta=b.view.translate,ua=b.view.scale,-Ba=mxRectangle.fromRectangle(na);Ba.x=Ba.x/ua-ta.x;Ba.y=Ba.y/ua-ta.y;Ba.width/=ua;Ba.height/=ua;ta=b.container.scrollTop;var za=b.container.scrollLeft,Aa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)Aa+=3;var Ga=b.container.offsetWidth-Aa;Aa=b.container.offsetHeight-Aa;W=W?Math.max(.3,Math.min(U||1,Ga/Ba.width)):ua;U=(Ga-W*Ba.width)/2/W;var Ra=0==this.lightboxVerticalDivider?0:(Aa-W*Ba.height)/this.lightboxVerticalDivider/W;qa&&(U=Math.max(U,0),Ra=Math.max(Ra,-0));if(qa||na.width<Ga||na.height<Aa)b.view.scaleAndTranslate(W,Math.floor(U-Ba.x),Math.floor(Ra-Ba.y)),b.container.scrollTop=ta*W/ua,b.container.scrollLeft=za*W/ua;else if(0!=aa||0!=ia)na=b.view.translate,b.view.setTranslate(Math.floor(na.x+aa/ua),Math.floor(na.y+ia/ua))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var n=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",n);this.destroyFunctions.push(function(){mxEvent.removeListener(window,-"resize",n)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(W){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(W){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 Z=this.graph.getPageLayout(),U=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+Z.x*U.width),this.scale*(this.translate.y+Z.y*U.height),this.scale*Z.width*U.width,+this.scale*Z.height*U.height)};b.getPreferredPageSize=function(Z,U,ba){Z=this.getPageLayout();U=this.getPageSize();return new mxRectangle(0,0,Z.width*U.width,Z.height*U.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(Z,U,ba,fa){if(null!=b.container&&!b.isViewer()){ba=null!=ba?ba:0;fa=null!=fa?fa:0;var na=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),pa=mxUtils.hasScrollbars(b.container),ta=b.view.translate,ua=b.view.scale,+Ca=mxRectangle.fromRectangle(na);Ca.x=Ca.x/ua-ta.x;Ca.y=Ca.y/ua-ta.y;Ca.width/=ua;Ca.height/=ua;ta=b.container.scrollTop;var Ba=b.container.scrollLeft,Aa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)Aa+=3;var Fa=b.container.offsetWidth-Aa;Aa=b.container.offsetHeight-Aa;Z=Z?Math.max(.3,Math.min(U||1,Fa/Ca.width)):ua;U=(Fa-Z*Ca.width)/2/Z;var Sa=0==this.lightboxVerticalDivider?0:(Aa-Z*Ca.height)/this.lightboxVerticalDivider/Z;pa&&(U=Math.max(U,0),Sa=Math.max(Sa,+0));if(pa||na.width<Fa||na.height<Aa)b.view.scaleAndTranslate(Z,Math.floor(U-Ca.x),Math.floor(Sa-Ca.y)),b.container.scrollTop=ta*Z/ua,b.container.scrollLeft=Ba*Z/ua;else if(0!=ba||0!=fa)na=b.view.translate,b.view.setTranslate(Math.floor(na.x+ba/ua),Math.floor(na.y+fa/ua))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var n=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",n);this.destroyFunctions.push(function(){mxEvent.removeListener(window,+"resize",n)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(Z){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(Z){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 W=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=W?parseInt(W["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var C=0;p=mxUtils.bind(this,function(W,U,aa){C++;-var ia=document.createElement("span");ia.style.paddingLeft="8px";ia.style.paddingRight="8px";ia.style.cursor="pointer";mxEvent.addListener(ia,"click",W);null!=aa&&ia.setAttribute("title",aa);W=document.createElement("img");W.setAttribute("border","0");W.setAttribute("src",U);W.style.width="36px";W.style.filter="invert(100%)";ia.appendChild(W);this.chromelessToolbar.appendChild(ia);return ia});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&p(mxUtils.bind(this,function(W){window.location.href=-G;mxEvent.consume(W)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var T=p(mxUtils.bind(this,function(W){this.actions.get("previousPage").funct();mxEvent.consume(W)}),Editor.chevronLeftImage,mxResources.get("previousPage")),E=document.createElement("div");E.style.fontFamily=Editor.defaultHtmlFont;E.style.display="inline-block";E.style.verticalAlign="top";E.style.fontWeight="bold";E.style.marginTop="8px";E.style.fontSize="14px";E.style.cursor="default";E.style.color=-mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(E);var Q=p(mxUtils.bind(this,function(W){this.actions.get("nextPage").funct();mxEvent.consume(W)}),Editor.chevronRightImage,mxResources.get("nextPage")),M=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){E.innerText="";var W=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(E,W+1+" / "+this.pages.length);E.setAttribute("title",mxResources.get("currentPage")+-": "+this.currentPage.getName());T.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(W-1,this.pages.length)].getName());Q.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(W+1,this.pages.length)].getName())}});T.style.paddingLeft="0px";T.style.paddingRight="4px";Q.style.paddingLeft="4px";Q.style.paddingRight="0px";var c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(Q.style.display="",T.style.display=-"",E.style.display="inline-block"):(Q.style.display="none",T.style.display="none",E.style.display="none");M()});if(null!=this.menus){var g=this.menus.get("pages");null!=g&&mxEvent.addListener(E,"click",mxUtils.bind(this,function(W){var U=new mxPopupMenu(g.funct);U.smartSeparators=!0;U.showDisabled=!0;U.autoExpand=!0;U.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(U,arguments);U.destroy()});var aa=mxUtils.getOffset(E);U.popup(aa.x,aa.y+E.offsetHeight,null,W);mxEvent.addListener(U.div,-"mouseleave",mxUtils.bind(this,function(){U.hideMenu()}))}))}this.editor.addListener("resetGraphView",c);this.editor.addListener("pageSelected",M)}p(mxUtils.bind(this,function(W){this.actions.get("zoomOut").funct();mxEvent.consume(W)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(W){this.actions.get("zoomIn").funct();mxEvent.consume(W)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(W){this.actions.get("smartFit").funct();-mxEvent.consume(W)}),Editor.zoomFitImage,mxResources.get("fit"));var l=null,t=null,B=mxUtils.bind(this,function(W){null!=l&&(window.clearTimeout(l),l=null);null!=t&&(window.clearTimeout(t),t=null);l=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);l=null;t=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";t=null}),600)}),W||200)}),D=mxUtils.bind(this,function(W){null!=l&&(window.clearTimeout(l),l=null);null!=t&&(window.clearTimeout(t),-t=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,W||30)});if("1"==urlParams.layers){this.layersDialog=null;var I=p(mxUtils.bind(this,function(W){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);+"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var Z=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=Z?parseInt(Z["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var C=0;p=mxUtils.bind(this,function(Z,U,ba){C++;+var fa=document.createElement("span");fa.style.paddingLeft="8px";fa.style.paddingRight="8px";fa.style.cursor="pointer";mxEvent.addListener(fa,"click",Z);null!=ba&&fa.setAttribute("title",ba);Z=document.createElement("img");Z.setAttribute("border","0");Z.setAttribute("src",U);Z.style.width="36px";Z.style.filter="invert(100%)";fa.appendChild(Z);this.chromelessToolbar.appendChild(fa);return fa});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&p(mxUtils.bind(this,function(Z){window.location.href=+G;mxEvent.consume(Z)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var T=p(mxUtils.bind(this,function(Z){this.actions.get("previousPage").funct();mxEvent.consume(Z)}),Editor.chevronLeftImage,mxResources.get("previousPage")),E=document.createElement("div");E.style.fontFamily=Editor.defaultHtmlFont;E.style.display="inline-block";E.style.verticalAlign="top";E.style.fontWeight="bold";E.style.marginTop="8px";E.style.fontSize="14px";E.style.cursor="default";E.style.color=+mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(E);var P=p(mxUtils.bind(this,function(Z){this.actions.get("nextPage").funct();mxEvent.consume(Z)}),Editor.chevronRightImage,mxResources.get("nextPage")),L=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){E.innerText="";var Z=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(E,Z+1+" / "+this.pages.length);E.setAttribute("title",mxResources.get("currentPage")++": "+this.currentPage.getName());T.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(Z-1,this.pages.length)].getName());P.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(Z+1,this.pages.length)].getName())}});T.style.paddingLeft="0px";T.style.paddingRight="4px";P.style.paddingLeft="4px";P.style.paddingRight="0px";var c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(P.style.display="",T.style.display=+"",E.style.display="inline-block"):(P.style.display="none",T.style.display="none",E.style.display="none");L()});if(null!=this.menus){var g=this.menus.get("pages");null!=g&&mxEvent.addListener(E,"click",mxUtils.bind(this,function(Z){var U=new mxPopupMenu(g.funct);U.smartSeparators=!0;U.showDisabled=!0;U.autoExpand=!0;U.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(U,arguments);U.destroy()});var ba=mxUtils.getOffset(E);U.popup(ba.x,ba.y+E.offsetHeight,null,Z);mxEvent.addListener(U.div,+"mouseleave",mxUtils.bind(this,function(){U.hideMenu()}))}))}this.editor.addListener("resetGraphView",c);this.editor.addListener("pageSelected",L)}p(mxUtils.bind(this,function(Z){this.actions.get("zoomOut").funct();mxEvent.consume(Z)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(Z){this.actions.get("zoomIn").funct();mxEvent.consume(Z)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(Z){this.actions.get("smartFit").funct();+mxEvent.consume(Z)}),Editor.zoomFitImage,mxResources.get("fit"));var l=null,t=null,B=mxUtils.bind(this,function(Z){null!=l&&(window.clearTimeout(l),l=null);null!=t&&(window.clearTimeout(t),t=null);l=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);l=null;t=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";t=null}),600)}),Z||200)}),D=mxUtils.bind(this,function(Z){null!=l&&(window.clearTimeout(l),l=null);null!=t&&(window.clearTimeout(t),+t=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,Z||30)});if("1"==urlParams.layers){this.layersDialog=null;var I=p(mxUtils.bind(this,function(Z){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 U=I.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=U.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));U=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=U.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(W)}),Editor.layersImage,-mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){I.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(W){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"==this.editor.editButtonLink){var U=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),-null,null,U)}else b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(W)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(c=0;c<this.lightboxToolbarActions.length;c++){var N=this.lightboxToolbarActions[c];N.elem=p(N.fn,N.icon,N.tooltip)}if(null!=v.refreshBtn){var K=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(W){null!=K?window.location.href=K:window.location.reload();mxEvent.consume(W)}),Editor.refreshImage,-mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(W){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(W)}),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(W){"1"==urlParams.close||v.closeBtn?-window.close():(this.destroy(),mxEvent.consume(W))}),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(W){mxEvent.isTouchEvent(W)||(mxEvent.isShiftDown(W)||D(30),B())}));mxEvent.addListener(this.chromelessToolbar,-mxClient.IS_POINTER?"pointermove":"mousemove",function(W){mxEvent.consume(W)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(W){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(W)?B():D(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(W){mxEvent.isShiftDown(W)?B():D(100);mxEvent.consume(W)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(W){mxEvent.isTouchEvent(W)||-D(30)}));var da=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(W,U){this.startX=U.getGraphX();this.startY=U.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(W,U){},mouseUp:function(W,U){mxEvent.isTouchEvent(U.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<da&&Math.abs(this.scrollTop-b.container.scrollTop)<da&&Math.abs(this.startX-U.getGraphX())<da&&Math.abs(this.startY-U.getGraphY())<-da&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?B():D(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ja=b.view.validate,ea=new mxPoint,ca=!1,fa=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&fa!=m.currentPage){fa=m.currentPage;ca=!0;var W=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==W&&(W=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*-b.view.scale));W=b.getPageLayout(W,ea,1);var U=b.getDefaultTranslate(W);this.x0=W.x;this.y0=W.y;if(U.x!=this.translate.x||U.y!=this.translate.y)this.invalidate(),this.translate.x=U.x,this.translate.y=U.y}U=b.getPagePadding();var aa=b.getPageSize();W=U.x-(this.x0||0)*aa.width;U=U.y-(this.y0||0)*aa.height;if(this.translate.x!=W||this.translate.y!=U)this.invalidate(),this.translate.x=W,this.translate.y=U}ja.apply(this,arguments)};if(!b.isViewer()){var la=b.sizeDidChange;b.sizeDidChange=function(){var W=-ca;ca=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var U=this.getPageLayout(),aa=this.getDefaultTranslate(U),ia=this.view.translate.x,na=this.view.translate.y;if(aa.x!=ia||aa.y!=na){this.view.x0=U.x;this.view.y0=U.y;this.autoTranslate=!0;this.view.setTranslate(aa.x,aa.y);this.autoTranslate=!1;W||(this.container.scrollLeft+=Math.round((aa.x-ia)*this.view.scale),this.container.scrollTop+=Math.round((aa.y-na)*this.view.scale));return}}la.apply(this,-arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ka=b.view.getBackgroundPane(),V=b.view.getDrawPane();b.cumulativeZoomFactor=1;var k=null,x=null,J=null,R=null,Y=null,Z=function(W){null!=k&&window.clearTimeout(k);0<=W&&window.setTimeout(function(){if(!b.isMouseDown||R)k=window.setTimeout(mxUtils.bind(this,function(){if(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));V.style.transformOrigin="";ka.style.transformOrigin="";mxClient.IS_SF?(V.style.transform="scale(1)",ka.style.transform="scale(1)",window.setTimeout(function(){V.style.transform="";ka.style.transform=""},0)):(V.style.transform="",ka.style.transform="");b.view.getDecoratorPane().style.opacity="";b.view.getOverlayPane().style.opacity="";for(var U=b.container.querySelectorAll(".geHint"),aa=0;aa<-U.length;aa++)U[aa].style.opacity=""}U=new mxPoint(b.container.scrollLeft,b.container.scrollTop);aa=mxUtils.getOffset(b.container);var ia=b.view.scale,na=0,qa=0;null!=x&&(na=b.container.offsetWidth/2-x.x+aa.x,qa=b.container.offsetHeight/2-x.y+aa.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=ia&&(null!=J&&(na+=U.x-J.x,qa+=U.y-J.y),null!=d&&m.chromelessResize(!1,null,na*(b.cumulativeZoomFactor-1),qa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||-0==na&&0==qa||(b.container.scrollLeft-=na*(b.cumulativeZoomFactor-1),b.container.scrollTop-=qa*(b.cumulativeZoomFactor-1)));null!=Y&&V.setAttribute("filter",Y);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;Y=R=x=J=k=null}),null!=W?W:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(W,U,aa,ia){ia=null!=ia?ia:this.zoomFactor;(U=U||!b.scrollbars)&&(x=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/-2));W?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ia,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/=ia,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==Y&&""!=V.getAttribute("filter")&&(Y=V.getAttribute("filter"),V.removeAttribute("filter"));J=new mxPoint(b.container.scrollLeft,b.container.scrollTop);W=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);ia=U||null==x?b.container.scrollLeft+b.container.clientWidth/2:x.x+b.container.scrollLeft-b.container.offsetLeft;-var na=U||null==x?b.container.scrollTop+b.container.clientHeight/2:x.y+b.container.scrollTop-b.container.offsetTop;V.style.transformOrigin=ia+"px "+na+"px";V.style.transform="scale("+W+")";ka.style.transformOrigin=ia+"px "+na+"px";ka.style.transform="scale("+W+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ia=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ia.style,"transform-origin",(U||null==x?b.container.clientWidth/2+b.container.scrollLeft-ia.offsetLeft+-"px":x.x+b.container.scrollLeft-ia.offsetLeft-b.container.offsetLeft+"px")+" "+(U||null==x?b.container.clientHeight/2+b.container.scrollTop-ia.offsetTop+"px":x.y+b.container.scrollTop-ia.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ia.style,"transform","scale("+W+")")):b.view.validateBackgroundStyles(W,ia,na);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";U=b.container.querySelectorAll(".geHint");for(ia=0;ia<U.length;ia++)U[ia].style.opacity=-"0";b.fireEvent(new mxEventObject("zoomPreview","factor",W))}Z(b.isFastZoomEnabled()?aa:0)};mxEvent.addGestureListeners(b.container,function(W){null!=k&&window.clearTimeout(k)},null,function(W){1!=b.cumulativeZoomFactor&&Z(0)});mxEvent.addListener(b.container,"scroll",function(W){null==k||b.isMouseDown||1==b.cumulativeZoomFactor||Z(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(W,U,aa,ia,na){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&-!aa&&b.isScrollWheelEvent(W))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=W.deltaX?W.deltaX:0,deltaY:null!=W.deltaY?W.deltaY:U?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!aa&&b.isScrollWheelEvent(W))ia=b.view.getTranslate(),na=40/b.view.scale,mxEvent.isShiftDown(W)?b.view.setTranslate(ia.x+(U?-na:na),ia.y):b.view.setTranslate(ia.x,ia.y+(U?na:-na));else if(aa||b.isZoomWheelEvent(W))for(var qa=-mxEvent.getSource(W);null!=qa;){if(qa==b.container){b.tooltipHandler.hideTooltip();ia=null!=ia&&null!=na?new mxPoint(ia,na):new mxPoint(mxEvent.getClientX(W),mxEvent.getClientY(W));na=null!=x?new mxPoint(x.x,x.y):null;qa=b.cumulativeZoomFactor;x=ia;R=aa;aa=b.zoomFactor;var ta=null;W.ctrlKey&&null!=W.deltaY&&40>Math.abs(W.deltaY)&&Math.round(W.deltaY)!=W.deltaY?aa=1+Math.abs(W.deltaY)/20*(aa-1):null!=W.movementY&&"pointermove"==W.type&&(aa=1+Math.max(1,Math.abs(W.movementY))/20*(aa-1),ta=-1);b.lazyZoom(U,-null,ta,aa);null!=na&&1!=qa&&b.isFastZoomEnabled()&&b.scrollbars&&(U=b.cumulativeZoomFactor,aa=U/qa,ta=1-U,.001<Math.abs(ta)&&(x=new mxPoint((ia.x*(1-aa)+aa*na.x*(1-qa))/ta,(ia.y*(1-aa)+aa*na.y*(1-qa))/ta),ia=x.x+b.container.scrollLeft-b.container.offsetLeft,na=x.y+b.container.scrollTop-b.container.offsetTop,V.style.transformOrigin=ia+"px "+na+"px",ka.style.transformOrigin=ia+"px "+na+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(U=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(U.style,-"transform-origin",x.x+b.container.scrollLeft-U.offsetLeft-b.container.offsetLeft+"px "+(x.y+b.container.scrollTop-U.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*U*100)/100*20)/(20*b.view.scale),ia,na)));mxEvent.consume(W);return!1}qa=qa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(W){b.cumulativeZoomFactor=W.scale;b.lazyZoom(0<W.scale,!0);mxEvent.consume(W)}};+(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));U=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=U.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(Z)}),Editor.layersImage,+mxResources.get("layers")),K=b.getModel();K.addListener(mxEvent.CHANGE,function(){I.style.display=1<K.getChildCount(K.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(Z){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"==this.editor.editButtonLink){var U=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),+null,null,U)}else b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(Z)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(c=0;c<this.lightboxToolbarActions.length;c++){var M=this.lightboxToolbarActions[c];M.elem=p(M.fn,M.icon,M.tooltip)}if(null!=v.refreshBtn){var V=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(Z){null!=V?window.location.href=V:window.location.reload();mxEvent.consume(Z)}),Editor.refreshImage,+mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(Z){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(Z)}),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(Z){"1"==urlParams.close||v.closeBtn?+window.close():(this.destroy(),mxEvent.consume(Z))}),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(Z){mxEvent.isTouchEvent(Z)||(mxEvent.isShiftDown(Z)||D(30),B())}));mxEvent.addListener(this.chromelessToolbar,+mxClient.IS_POINTER?"pointermove":"mousemove",function(Z){mxEvent.consume(Z)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(Z){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(Z)?B():D(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(Z){mxEvent.isShiftDown(Z)?B():D(100);mxEvent.consume(Z)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(Z){mxEvent.isTouchEvent(Z)||+D(30)}));var Q=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(Z,U){this.startX=U.getGraphX();this.startY=U.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(Z,U){},mouseUp:function(Z,U){mxEvent.isTouchEvent(U.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<Q&&Math.abs(this.scrollTop-b.container.scrollTop)<Q&&Math.abs(this.startX-U.getGraphX())<Q&&Math.abs(this.startY-U.getGraphY())<+Q&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?B():D(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ja=b.view.validate,ea=new mxPoint,da=!1,ia=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ia!=m.currentPage){ia=m.currentPage;da=!0;var Z=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==Z&&(Z=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*+b.view.scale));Z=b.getPageLayout(Z,ea,1);var U=b.getDefaultTranslate(Z);this.x0=Z.x;this.y0=Z.y;if(U.x!=this.translate.x||U.y!=this.translate.y)this.invalidate(),this.translate.x=U.x,this.translate.y=U.y}U=b.getPagePadding();var ba=b.getPageSize();Z=U.x-(this.x0||0)*ba.width;U=U.y-(this.y0||0)*ba.height;if(this.translate.x!=Z||this.translate.y!=U)this.invalidate(),this.translate.x=Z,this.translate.y=U}ja.apply(this,arguments)};if(!b.isViewer()){var la=b.sizeDidChange;b.sizeDidChange=function(){var Z=+da;da=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var U=this.getPageLayout(),ba=this.getDefaultTranslate(U),fa=this.view.translate.x,na=this.view.translate.y;if(ba.x!=fa||ba.y!=na){this.view.x0=U.x;this.view.y0=U.y;this.autoTranslate=!0;this.view.setTranslate(ba.x,ba.y);this.autoTranslate=!1;Z||(this.container.scrollLeft+=Math.round((ba.x-fa)*this.view.scale),this.container.scrollTop+=Math.round((ba.y-na)*this.view.scale));return}}la.apply(this,+arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ka=b.view.getBackgroundPane(),W=b.view.getDrawPane();b.cumulativeZoomFactor=1;var k=null,y=null,J=null,R=null,X=null,aa=function(Z){null!=k&&window.clearTimeout(k);0<=Z&&window.setTimeout(function(){if(!b.isMouseDown||R)k=window.setTimeout(mxUtils.bind(this,function(){if(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));W.style.transformOrigin="";ka.style.transformOrigin="";mxClient.IS_SF?(W.style.transform="scale(1)",ka.style.transform="scale(1)",window.setTimeout(function(){W.style.transform="";ka.style.transform=""},0)):(W.style.transform="",ka.style.transform="");b.view.getDecoratorPane().style.opacity="";b.view.getOverlayPane().style.opacity="";for(var U=b.container.querySelectorAll(".geHint"),ba=0;ba<+U.length;ba++)U[ba].style.opacity=""}U=new mxPoint(b.container.scrollLeft,b.container.scrollTop);ba=mxUtils.getOffset(b.container);var fa=b.view.scale,na=0,pa=0;null!=y&&(na=b.container.offsetWidth/2-y.x+ba.x,pa=b.container.offsetHeight/2-y.y+ba.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=fa&&(null!=J&&(na+=U.x-J.x,pa+=U.y-J.y),null!=d&&m.chromelessResize(!1,null,na*(b.cumulativeZoomFactor-1),pa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||+0==na&&0==pa||(b.container.scrollLeft-=na*(b.cumulativeZoomFactor-1),b.container.scrollTop-=pa*(b.cumulativeZoomFactor-1)));null!=X&&W.setAttribute("filter",X);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;X=R=y=J=k=null}),null!=Z?Z:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(Z,U,ba,fa){fa=null!=fa?fa:this.zoomFactor;(U=U||!b.scrollbars)&&(y=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/+2));Z?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=fa,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/=fa,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==X&&""!=W.getAttribute("filter")&&(X=W.getAttribute("filter"),W.removeAttribute("filter"));J=new mxPoint(b.container.scrollLeft,b.container.scrollTop);Z=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);fa=U||null==y?b.container.scrollLeft+b.container.clientWidth/2:y.x+b.container.scrollLeft-b.container.offsetLeft;+var na=U||null==y?b.container.scrollTop+b.container.clientHeight/2:y.y+b.container.scrollTop-b.container.offsetTop;W.style.transformOrigin=fa+"px "+na+"px";W.style.transform="scale("+Z+")";ka.style.transformOrigin=fa+"px "+na+"px";ka.style.transform="scale("+Z+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(fa=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(fa.style,"transform-origin",(U||null==y?b.container.clientWidth/2+b.container.scrollLeft-fa.offsetLeft++"px":y.x+b.container.scrollLeft-fa.offsetLeft-b.container.offsetLeft+"px")+" "+(U||null==y?b.container.clientHeight/2+b.container.scrollTop-fa.offsetTop+"px":y.y+b.container.scrollTop-fa.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(fa.style,"transform","scale("+Z+")")):b.view.validateBackgroundStyles(Z,fa,na);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";U=b.container.querySelectorAll(".geHint");for(fa=0;fa<U.length;fa++)U[fa].style.opacity=+"0";b.fireEvent(new mxEventObject("zoomPreview","factor",Z))}aa(b.isFastZoomEnabled()?ba:0)};mxEvent.addGestureListeners(b.container,function(Z){null!=k&&window.clearTimeout(k)},null,function(Z){1!=b.cumulativeZoomFactor&&aa(0)});mxEvent.addListener(b.container,"scroll",function(Z){null==k||b.isMouseDown||1==b.cumulativeZoomFactor||aa(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(Z,U,ba,fa,na){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&+!ba&&b.isScrollWheelEvent(Z))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=Z.deltaX?Z.deltaX:0,deltaY:null!=Z.deltaY?Z.deltaY:U?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!ba&&b.isScrollWheelEvent(Z))fa=b.view.getTranslate(),na=40/b.view.scale,mxEvent.isShiftDown(Z)?b.view.setTranslate(fa.x+(U?-na:na),fa.y):b.view.setTranslate(fa.x,fa.y+(U?na:-na));else if(ba||b.isZoomWheelEvent(Z))for(var pa=+mxEvent.getSource(Z);null!=pa;){if(pa==b.container){b.tooltipHandler.hideTooltip();fa=null!=fa&&null!=na?new mxPoint(fa,na):new mxPoint(mxEvent.getClientX(Z),mxEvent.getClientY(Z));na=null!=y?new mxPoint(y.x,y.y):null;pa=b.cumulativeZoomFactor;y=fa;R=ba;ba=b.zoomFactor;var ta=null;Z.ctrlKey&&null!=Z.deltaY&&40>Math.abs(Z.deltaY)&&Math.round(Z.deltaY)!=Z.deltaY?ba=1+Math.abs(Z.deltaY)/20*(ba-1):null!=Z.movementY&&"pointermove"==Z.type&&(ba=1+Math.max(1,Math.abs(Z.movementY))/20*(ba-1),ta=-1);b.lazyZoom(U,+null,ta,ba);null!=na&&1!=pa&&b.isFastZoomEnabled()&&b.scrollbars&&(U=b.cumulativeZoomFactor,ba=U/pa,ta=1-U,.001<Math.abs(ta)&&(y=new mxPoint((fa.x*(1-ba)+ba*na.x*(1-pa))/ta,(fa.y*(1-ba)+ba*na.y*(1-pa))/ta),fa=y.x+b.container.scrollLeft-b.container.offsetLeft,na=y.y+b.container.scrollTop-b.container.offsetTop,W.style.transformOrigin=fa+"px "+na+"px",ka.style.transformOrigin=fa+"px "+na+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(U=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(U.style,+"transform-origin",y.x+b.container.scrollLeft-U.offsetLeft-b.container.offsetLeft+"px "+(y.y+b.container.scrollTop-U.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*U*100)/100*20)/(20*b.view.scale),fa,na)));mxEvent.consume(Z);return!1}pa=pa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(Z){b.cumulativeZoomFactor=Z.scale;b.lazyZoom(0<Z.scale,!0);mxEvent.consume(Z)}};EditorUi.prototype.addChromelessToolbarItems=function(b){"1"!=urlParams.noPrint&&b(mxUtils.bind(this,function(d){this.actions.get("print").funct();mxEvent.consume(d)}),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;if(null!=this.format){var d=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.formatContainer.style,"transition","width "+d+"s ease-in-out");window.setTimeout(mxUtils.bind(this,function(){this.formatWidth=b?240:0;this.hsplitPosition=Math.min(this.container.clientWidth-this.hsplit.clientWidth-this.formatWidth,this.hsplitPosition);this.refresh();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.formatContainer.style,@@ -2259,11 +2261,11 @@ EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Grap"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(m,100);mxUtils.setPrefixedStyle(m.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(m.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(m.style,"transform","scaleX(0)");mxUtils.setOpacity(m,0);window.setTimeout(mxUtils.bind(this,function(){null!=m.parentNode&&m.parentNode.removeChild(m)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[d])};EditorUi.prototype.clearStatus=function(){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus("")}))};EditorUi.prototype.updateStatus=function(b){null!=b&&b();this.lastStatusUpdate=b};EditorUi.prototype.updateStatusAgain=function(){null!=this.lastStatusUpdate&&this.lastStatusUpdate()};EditorUi.prototype.createStatusDiv=function(b){var d=document.createElement("div");d.className="geStatusDiv";d.setAttribute("title",b);d.innerText=b;return d};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.createDiv=function(b){var d=document.createElement("div");d.className=b;return d};-EditorUi.prototype.addSplitHandler=function(b,d,m,n){function v(M){if(null!=C){var c=new mxPoint(mxEvent.getClientX(M),mxEvent.getClientY(M));n(Math.max(0,G+(d?c.x-C.x:C.y-c.y)-m));mxEvent.consume(M);G!=Q()&&(T=!0,E=null)}}function p(M){v(M);C=G=null}var C=null,G=null,T=!0,E=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var Q=mxUtils.bind(this,function(){var M=parseInt(d?b.offsetLeft:b.offsetTop);d||(M+=m);return M});mxEvent.addGestureListeners(b,function(M){C=new mxPoint(mxEvent.getClientX(M),-mxEvent.getClientY(M));G=Q();T=!1;mxEvent.consume(M)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(M){if(!T&&this.hsplitClickEnabled){var c=null!=E?E-m:0;E=Q();n(c);mxEvent.consume(M)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};+EditorUi.prototype.addSplitHandler=function(b,d,m,n){function v(L){if(null!=C){var c=new mxPoint(mxEvent.getClientX(L),mxEvent.getClientY(L));n(Math.max(0,G+(d?c.x-C.x:C.y-c.y)-m));mxEvent.consume(L);G!=P()&&(T=!0,E=null)}}function p(L){v(L);C=G=null}var C=null,G=null,T=!0,E=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var P=mxUtils.bind(this,function(){var L=parseInt(d?b.offsetLeft:b.offsetTop);d||(L+=m);return L});mxEvent.addGestureListeners(b,function(L){C=new mxPoint(mxEvent.getClientX(L),+mxEvent.getClientY(L));G=P();T=!1;mxEvent.consume(L)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(L){if(!T&&this.hsplitClickEnabled){var c=null!=E?E-m:0;E=P();n(c);mxEvent.consume(L)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};EditorUi.prototype.prompt=function(b,d,m,n){b=new FilenameDialog(this,d,mxResources.get("apply"),function(v){m(n?v:parseFloat(v))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};EditorUi.prototype.handleError=function(b,d,m,n,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=d){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var p=mxResources.get("ok");d=null!=d?d:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(d,v,p,m,null,null,null,null,null,null,null,null,n?m:null)}else null!=m&&m()};-EditorUi.prototype.showError=function(b,d,m,n,v,p,C,G,T,E,Q,M,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),n,v,p,C,M,G,T);d=Math.ceil(null!=d?d.length/50:1);this.showDialog(b.container,E||340,Q||100+20*d,!0,!1,c);b.init()};EditorUi.prototype.showDialog=function(b,d,m,n,v,p,C,G,T,E){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,n,v,p,C,G,T,E);this.dialogs.push(this.dialog)};+EditorUi.prototype.showError=function(b,d,m,n,v,p,C,G,T,E,P,L,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),n,v,p,C,L,G,T);d=Math.ceil(null!=d?d.length/50:1);this.showDialog(b.container,E||340,P||100+20*d,!0,!1,c);b.init()};EditorUi.prototype.showDialog=function(b,d,m,n,v,p,C,G,T,E){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,n,v,p,C,G,T,E);this.dialogs.push(this.dialog)};EditorUi.prototype.hideDialog=function(b,d,m){var n=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var v=this.dialogs.length-1;0<=v;v--)if(!this.dialogs[v].closing){n=this.dialogs[v];break}null==n||null!=m&&m!=this.dialog.container.firstChild||(n.closing=!0,0==n.close(b,d)?delete n.closing:(delete n.closing,b=mxUtils.lastIndexOf(this.dialogs,n),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",n)),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 d=b.getSelectionCells(),m=new mxDictionary,n=[],v=0;v<d.length;v++){var p=b.isTableCell(d[v])?b.model.getParent(d[v]):d[v];null==p||m.get(p)||(m.put(p,!0),n.push(p))}b.setSelectionCells(b.duplicateCells(n,!1))}catch(C){this.handleError(C)}};@@ -2282,19 +2284,19 @@ EditorUi.prototype.showDataDialog=function(b){null!=b&&"undefined"!==typeof windEditorUi.prototype.showBackgroundImageDialog=function(b,d){b=null!=b?b:mxUtils.bind(this,function(n){n=new ChangePageSetup(this,null,n);n.ignoreColor=!0;this.editor.graph.model.execute(n)});var m=mxUtils.prompt(mxResources.get("backgroundImage"),null!=d?d.src:"");null!=m&&0<m.length?(d=new Image,d.onload=function(){b(new mxImage(m,d.width,d.height),!1)},d.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},d.src=m):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,d,m){mxUtils.confirm(b)?null!=d&&d():null!=m&&m()};EditorUi.prototype.createOutline=function(b){var d=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){d.update(!1)});return d};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",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};-EditorUi.prototype.createKeyHandler=function(b){function d(M,c,g){if(!n.isSelectionEmpty()&&n.isEnabled()){c=null!=c?c:1;var l=n.getCompositeParents(n.getSelectionCells()),t=0<l.length?l[0]:null;if(null!=t)if(g){n.getModel().beginUpdate();try{for(t=0;t<l.length;t++)if(n.getModel().isVertex(l[t])&&n.isCellResizable(l[t])){var B=n.getCellGeometry(l[t]);null!=B&&(B=B.clone(),37==M?B.width=Math.max(0,B.width-c):38==M?B.height=Math.max(0,B.height-c):39==M?B.width+=c:40==M&&(B.height+=c),n.getModel().setGeometry(l[t],-B))}}finally{n.getModel().endUpdate()}}else{B=n.model.getParent(t);var D=n.getView().scale;g=null;1==n.getSelectionCount()&&n.model.isVertex(t)&&null!=n.layoutManager&&!n.isCellLocked(t)&&(g=n.layoutManager.getLayout(B));if(null!=g&&g.constructor==mxStackLayout)c=B.getIndex(t),37==M||38==M?n.model.add(B,t,Math.max(0,c-1)):(39==M||40==M)&&n.model.add(B,t,Math.min(n.model.getChildCount(B),c+1));else{var I=n.graphHandler;null!=I&&(null==I.first&&I.start(t,0,0,n.getMovableCells(l)),null!=I.first&&(t=-l=0,37==M?l=-c:38==M?t=-c:39==M?l=c:40==M&&(t=c),I.currentDx+=l*D,I.currentDy+=t*D,I.checkPreview(),I.updatePreview()),null!=C&&window.clearTimeout(C),C=window.setTimeout(function(){if(null!=I.first){var L=I.roundLength(I.currentDx/D),N=I.roundLength(I.currentDy/D);I.moveCells(I.cells,L,N);I.reset()}},400))}}}}var m=this,n=this.editor.graph,v=new mxKeyHandler(n),p=v.isEventIgnored;v.isEventIgnored=function(M){return!(mxEvent.isShiftDown(M)&&9==M.keyCode)&&(!this.isControlDown(M)||mxEvent.isShiftDown(M)||-90!=M.keyCode&&89!=M.keyCode&&188!=M.keyCode&&190!=M.keyCode&&85!=M.keyCode&&83!=M.keyCode)&&(66!=M.keyCode&&73!=M.keyCode||!this.isControlDown(M)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=M.keyCode&&107!=M.keyCode||!this.isControlDown(M)&&!mxEvent.isShiftDown(M)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};v.isEnabledForEvent=function(M){return!mxEvent.isConsumed(M)&&this.isGraphEvent(M)&&this.isEnabled()&&-(null==m.dialogs||0==m.dialogs.length)};v.isControlDown=function(M){return mxEvent.isControlDown(M)||mxClient.IS_MAC&&M.metaKey};var C=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(M){if(n.isEnabled()){var c=null;mxEvent.isShiftDown(M)&&this.isControlDown(M)&&mxEvent.isAltDown(M)?c=m.actions.get(m.ctrlAltShiftActions[M.keyCode]):mxEvent.isShiftDown(M)&&mxEvent.isAltDown(M)?-c=m.actions.get(m.altShiftActions[M.keyCode]):this.isControlDown(M)&&mxEvent.isAltDown(M)&&(c=m.actions.get(m.ctrlAltActions[M.keyCode]));if(null!=c)return c.funct;if("/"==M.key&&!this.isControlDown(M)&&!mxEvent.isAltDown(M))return function(){var g=document.getElementById("geOmniSearch");null!=g&&30<g.clientWidth&&g.focus()};if(null!=G[M.keyCode]&&!n.isSelectionEmpty())if(!this.isControlDown(M)&&mxEvent.isShiftDown(M)&&mxEvent.isAltDown(M)){if(n.model.isVertex(n.getSelectionCell()))return function(){var g=-n.connectVertex(n.getSelectionCell(),G[M.keyCode],n.defaultEdgeLength,M,!0);null!=g&&0<g.length&&(1==g.length&&n.model.isEdge(g[0])?n.setSelectionCell(n.model.getTerminal(g[0],!1)):n.setSelectionCell(g[g.length-1]),n.scrollCellToVisible(n.getSelectionCell()),null!=m.hoverIcons&&m.hoverIcons.update(n.view.getState(n.getSelectionCell())))}}else return this.isControlDown(M)?function(){d(M.keyCode,mxEvent.isShiftDown(M)?n.gridSize:null,!0)}:function(){d(M.keyCode,mxEvent.isShiftDown(M)?n.gridSize:null)}}return T.apply(this,-arguments)};v.bindAction=mxUtils.bind(this,function(M,c,g,l){var t=this.actions.get(g);null!=t&&(g=function(){t.isEnabled()&&t.funct.apply(this,arguments)},c?l?v.bindControlShiftKey(M,g):v.bindControlKey(M,g):l?v.bindShiftKey(M,g):v.bindKey(M,g))});var E=this,Q=v.escape;v.escape=function(M){Q.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){n.exitGroup()});v.bindControlShiftKey(35,function(){n.enterGroup()});v.bindShiftKey(36,function(){n.home()});v.bindKey(35,function(){n.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(){n.isEnabled()&&n.foldCells(!0)}),v.bindControlKey(35,function(){n.isEnabled()&&n.foldCells(!1)}),v.bindControlKey(13,function(){E.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),"1"!=urlParams.dev&&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,!0,"lockUnlock"),v.bindAction(76,!0,"layers",!0),v.bindAction(80,!0,"format",!0),v.bindAction(85,!0,"underline"),v.bindAction(85,!0,"ungroup",!0),v.bindAction(109,!0,"decreaseFontSize",!0),v.bindAction(107,!0,"increaseFontSize",!0),v.bindAction(219,!0,"decreaseFontSize",!0),v.bindAction(221,!0,"increaseFontSize",!0),v.bindAction(190,!0,"superscript"),-v.bindAction(188,!0,"subscript"),v.bindAction(13,!1,"keyPressEnter"),v.bindKey(113,function(){n.isEnabled()&&n.startEditingAtCell()});return v};EditorUi.prototype.createMenuElement=function(b,d,m){var n=document.createElement("a");this.addMenuHandler(n,d,m);mxUtils.write(n,b);n.className="geItem";return n};+EditorUi.prototype.createKeyHandler=function(b){function d(L,c,g){if(!n.isSelectionEmpty()&&n.isEnabled()){c=null!=c?c:1;var l=n.getCompositeParents(n.getSelectionCells()),t=0<l.length?l[0]:null;if(null!=t)if(g){n.getModel().beginUpdate();try{for(t=0;t<l.length;t++)if(n.getModel().isVertex(l[t])&&n.isCellResizable(l[t])){var B=n.getCellGeometry(l[t]);null!=B&&(B=B.clone(),37==L?B.width=Math.max(0,B.width-c):38==L?B.height=Math.max(0,B.height-c):39==L?B.width+=c:40==L&&(B.height+=c),n.getModel().setGeometry(l[t],+B))}}finally{n.getModel().endUpdate()}}else{B=n.model.getParent(t);var D=n.getView().scale;g=null;1==n.getSelectionCount()&&n.model.isVertex(t)&&null!=n.layoutManager&&!n.isCellLocked(t)&&(g=n.layoutManager.getLayout(B));if(null!=g&&g.constructor==mxStackLayout)c=B.getIndex(t),37==L||38==L?n.model.add(B,t,Math.max(0,c-1)):(39==L||40==L)&&n.model.add(B,t,Math.min(n.model.getChildCount(B),c+1));else{var I=n.graphHandler;null!=I&&(null==I.first&&I.start(t,0,0,n.getMovableCells(l)),null!=I.first&&(t=+l=0,37==L?l=-c:38==L?t=-c:39==L?l=c:40==L&&(t=c),I.currentDx+=l*D,I.currentDy+=t*D,I.checkPreview(),I.updatePreview()),null!=C&&window.clearTimeout(C),C=window.setTimeout(function(){if(null!=I.first){var K=I.roundLength(I.currentDx/D),M=I.roundLength(I.currentDy/D);I.moveCells(I.cells,K,M);I.reset()}},400))}}}}var m=this,n=this.editor.graph,v=new mxKeyHandler(n),p=v.isEventIgnored;v.isEventIgnored=function(L){return 188==L.keyCode&&this.isControlDown(L)&&!this.graph.cellEditor.isContentEditing()?+!0:!(mxEvent.isShiftDown(L)&&9==L.keyCode)&&(!this.isControlDown(L)||mxEvent.isShiftDown(L)||90!=L.keyCode&&89!=L.keyCode&&188!=L.keyCode&&190!=L.keyCode&&85!=L.keyCode&&83!=L.keyCode)&&(66!=L.keyCode&&73!=L.keyCode||!this.isControlDown(L)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=L.keyCode&&107!=L.keyCode||!this.isControlDown(L)&&!mxEvent.isShiftDown(L)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};+v.isEnabledForEvent=function(L){return!mxEvent.isConsumed(L)&&this.isGraphEvent(L)&&this.isEnabled()&&(null==m.dialogs||0==m.dialogs.length)};v.isControlDown=function(L){return mxEvent.isControlDown(L)||mxClient.IS_MAC&&L.metaKey};var C=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(L){if(n.isEnabled()){var c=null;mxEvent.isShiftDown(L)&&this.isControlDown(L)&&+mxEvent.isAltDown(L)?c=m.actions.get(m.ctrlAltShiftActions[L.keyCode]):mxEvent.isShiftDown(L)&&mxEvent.isAltDown(L)?c=m.actions.get(m.altShiftActions[L.keyCode]):this.isControlDown(L)&&mxEvent.isAltDown(L)&&(c=m.actions.get(m.ctrlAltActions[L.keyCode]));if(null!=c)return c.funct;if("/"==L.key&&!this.isControlDown(L)&&!mxEvent.isAltDown(L))return function(){var g=document.getElementById("geOmniSearch");null!=g&&30<g.clientWidth&&g.focus()};if(null!=G[L.keyCode]&&!n.isSelectionEmpty())if(!this.isControlDown(L)&&+mxEvent.isShiftDown(L)&&mxEvent.isAltDown(L)){if(n.model.isVertex(n.getSelectionCell()))return function(){var g=n.connectVertex(n.getSelectionCell(),G[L.keyCode],n.defaultEdgeLength,L,!0);null!=g&&0<g.length&&(1==g.length&&n.model.isEdge(g[0])?n.setSelectionCell(n.model.getTerminal(g[0],!1)):n.setSelectionCell(g[g.length-1]),n.scrollCellToVisible(n.getSelectionCell()),null!=m.hoverIcons&&m.hoverIcons.update(n.view.getState(n.getSelectionCell())))}}else return this.isControlDown(L)?function(){d(L.keyCode,+mxEvent.isShiftDown(L)?n.gridSize:null,!0)}:function(){d(L.keyCode,mxEvent.isShiftDown(L)?n.gridSize:null)}}return T.apply(this,arguments)};v.bindAction=mxUtils.bind(this,function(L,c,g,l){var t=this.actions.get(g);null!=t&&(g=function(){t.isEnabled()&&t.funct.apply(this,arguments)},c?l?v.bindControlShiftKey(L,g):v.bindControlKey(L,g):l?v.bindShiftKey(L,g):v.bindKey(L,g))});var E=this,P=v.escape;v.escape=function(L){P.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){n.exitGroup()});+v.bindControlShiftKey(35,function(){n.enterGroup()});v.bindShiftKey(36,function(){n.home()});v.bindKey(35,function(){n.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(){n.isEnabled()&&n.foldCells(!0)}),+v.bindControlKey(35,function(){n.isEnabled()&&n.foldCells(!1)}),v.bindControlKey(13,function(){E.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),"1"!=urlParams.dev&&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,!0,"lockUnlock"),v.bindAction(76,!0,"layers",!0),v.bindAction(80,!0,"format",!0),v.bindAction(85,!0,"underline"),v.bindAction(85,!0,"ungroup",!0),v.bindAction(109,!0,"decreaseFontSize",!0),v.bindAction(107,!0,"increaseFontSize",+!0),v.bindAction(219,!0,"decreaseFontSize",!0),v.bindAction(221,!0,"increaseFontSize",!0),v.bindAction(190,!0,"superscript"),v.bindAction(188,!0,"subscript"),v.bindAction(13,!1,"keyPressEnter"),v.bindKey(113,function(){n.isEnabled()&&n.startEditingAtCell()});return v};EditorUi.prototype.createMenuElement=function(b,d,m){var n=document.createElement("a");this.addMenuHandler(n,d,m);mxUtils.write(n,b);n.className="geItem";return n};EditorUi.prototype.addMenuHandler=function(b,d,m,n){if(null!=d){var v=null,p=!0,C=mxUtils.bind(this,function(G){null!=m&&m(G);if(!mxEvent.isConsumed(G)&&p&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var T=new mxPopupMenu(d);T.smartSeparators=!0;T.showDisabled=!0;T.autoExpand=!0;T.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(T,arguments);this.resetCurrentMenu();v=null;T.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();var E=mxUtils.getOffset(b);T.popup(E.x,E.y+b.offsetHeight,null,G);this.setCurrentMenu(T,b);v=T}n||mxEvent.consume(G)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(G){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var T=this.currentMenuElt;this.hideCurrentMenu();T.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&C(G)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(G){!this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(G)&&this.hideCurrentMenu();p=null==this.currentMenu;"INPUT"!=mxEvent.getSource(G).nodeName?G.preventDefault():G.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(G){C(G);p=!0}));n&&(mxEvent.addListener(b,"focus",mxUtils.bind(this,function(G){C(G);p=!0})),mxEvent.addListener(b,"blur",mxUtils.bind(this,function(G){this.currentMenu==v&&this.hideCurrentMenu()})),mxEvent.addListener(b,"keyup",mxUtils.bind(this,@@ -2312,45 +2314,45 @@ null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=null}var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<d.length;b++)null!=d[b]&&null!=d[b].parentNode&&d[b].parentNode.removeChild(d[b])};(function(){var b=[["nbsp","160"],["shy","173"]],d=mxUtils.parseXml;mxUtils.parseXml=function(n){for(var v=0;v<b.length;v++)n=n.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return d(n)};var m=mxUtils.getSizeForString;mxUtils.getSizeForString=function(n,v,p,C){return m(Graph.sanitizeHtml(n),v,p,C)}})();Date.prototype.toISOString||function(){function b(d){d=String(d);1===d.length&&(d="0"+d);return d}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,d=function(n){return"function"===typeof n||"[object Function]"===b.call(n)},m=Math.pow(2,53)-1;return function(n){var v=Object(n);if(null==n)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=1<arguments.length?arguments[1]:void 0,C;if("undefined"!==typeof p){if(!d(p))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(C=-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),m);for(var T=d(this)?Object(new this(G)):Array(G),E=0,Q;E<G;)Q=v[E],T[E]=p?"undefined"===typeof C?p(Q,E):p.call(C,Q,E):Q,E+=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),m);for(var T=d(this)?Object(new this(G)):Array(G),E=0,P;E<G;)P=v[E],T[E]=p?"undefined"===typeof C?p(P,E):p.call(C,P,E):P,E+=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(" ");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(d){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage="data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=";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,d,m){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),this.clippedImage=b;b=this.clippedSvg}return b};(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(d,m,n,v,p){return"default"==v&&null!=p?"fillcolor"==n.nodeName?p.shapeBackgroundColor:p.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(d,m,n){null==n&&(n=d);return b.apply(this,[d,m,n])}})();-(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,n,v,p,C,G,T){var E=b.apply(this,arguments);if(null!=m){var Q=E.getElementsByTagName("img");0<Q.length&&(Q[0].className="geButton")}return E}})();+(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,n,v,p,C,G,T){var E=b.apply(this,arguments);if(null!=m){var P=E.getElementsByTagName("img");0<P.length&&(P[0].className="geButton")}return E}})();Graph=function(b,d,m,n,v,p){mxGraph.call(this,b,d,m,n);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;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(k){k=this.getCurrentCellStyle(k);-return null!=k?"1"==k.html||"wrap"==k[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var C=null,G=null,T=null,E=null,Q=!1,M=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,x){if("mouseDown"==x.getProperty("eventName")&&this.isEnabled()){k=x.getProperty("event");var J=k.getState();x=this.view.scale;if(!mxEvent.isAltDown(k.getEvent())&&null!=J&&(M=this.isCellSelected(J.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(k.getEvent()))){var R=this.selectionCellsHandler.getHandler(J.cell);-if(null==R||null==R.getHandleForEvent(k)){var Y=new mxRectangle(k.getGraphX()-1,k.getGraphY()-1),Z=mxEvent.isTouchEvent(k.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;R=Z+2;Y.grow(Z);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&!this.isCellSelected(J.cell)&&!(mxUtils.contains(J,k.getGraphX()-R,k.getGraphY()-R)&&mxUtils.contains(J,k.getGraphX()-R,k.getGraphY()+R)&&mxUtils.contains(J,k.getGraphX()+R,k.getGraphY()+R)&&mxUtils.contains(J,k.getGraphX()+-R,k.getGraphY()-R))){var W=this.model.getParent(J.cell);R=this.model.getParent(W);if(!this.isCellSelected(R)){Z*=x;var U=2*Z;if(this.model.getChildAt(R,0)!=W&&mxUtils.intersects(Y,new mxRectangle(J.x,J.y-Z,J.width,U))||this.model.getChildAt(W,0)!=J.cell&&mxUtils.intersects(Y,new mxRectangle(J.x-Z,J.y,U,J.height))||mxUtils.intersects(Y,new mxRectangle(J.x,J.y+J.height-Z,J.width,U))||mxUtils.intersects(Y,new mxRectangle(J.x+J.width-Z,J.y,U,J.height)))W=this.selectionCellsHandler.isHandled(R),this.selectCellForEvent(R,-k.getEvent()),R=this.selectionCellsHandler.getHandler(R),null!=R&&(Z=R.getHandleForEvent(k),null!=Z&&(R.start(k.getGraphX(),k.getGraphY(),Z),R.blockDelayedSelection=!W,k.consume()))}}for(;!k.isConsumed()&&null!=J&&(this.isTableCell(J.cell)||this.isTableRow(J.cell)||this.isTable(J.cell));)this.isSwimlane(J.cell)&&this.isCellMovable(J.cell)&&(R=this.getActualStartSize(J.cell),(0<R.x||0<R.width)&&mxUtils.intersects(Y,new mxRectangle(J.x+(R.x-R.width-1)*x+(0==R.x?J.width:0),J.y,1,J.height))||(0<R.y||-0<R.height)&&mxUtils.intersects(Y,new mxRectangle(J.x,J.y+(R.y-R.height-1)*x+(0==R.y?J.height:0),J.width,1)))&&(this.selectCellForEvent(J.cell,k.getEvent()),R=this.selectionCellsHandler.getHandler(J.cell),null!=R&&null!=R.customHandles&&(Z=mxEvent.CUSTOM_HANDLE-R.customHandles.length+1,R.start(k.getGraphX(),k.getGraphY(),Z),k.consume())),J=this.view.getState(this.model.getParent(J.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(k,x){if("mouseDown"==x.getProperty("eventName")&&-this.isEnabled()){k=x.getProperty("event");var J=k.getState();mxEvent.isAltDown(k.getEvent())||mxEvent.isControlDown(x)||mxEvent.isShiftDown(x)||M||null==J||!this.model.isEdge(J.cell)||(C=new mxPoint(k.getGraphX(),k.getGraphY()),Q=this.isCellSelected(J.cell),T=J,G=k,null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,k.getGraphX(),k.getGraphY())?E=mxEvent.LABEL_HANDLE:(x=this.selectionCellsHandler.getHandler(J.cell),null!=x&&null!=x.bends&&0<x.bends.length&&(E=x.getHandleForEvent(k))))}}));-this.addMouseListener({mouseDown:function(k,x){},mouseMove:mxUtils.bind(this,function(k,x){k=this.selectionCellsHandler.handlers.map;for(var J in k)if(null!=k[J].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(x.getEvent())){var R=this.tolerance;if(null!=C&&null!=T&&null!=G){if(J=T,null!=E||Math.abs(C.x-x.getGraphX())>R||Math.abs(C.y-x.getGraphY())>R){var Y=null;mxEvent.isShiftDown(x.getEvent())||(Y=this.selectionCellsHandler.getHandler(J.cell));if(null!=Y&&null!=-Y.bends&&0<Y.bends.length){Y.redrawHandles();var Z=null!=E?E:Y.getHandleForEvent(G),W=this.view.getEdgeStyle(J),U=W==mxEdgeStyle.EntityRelation;R=J.absolutePoints;Q||(Z=E);Z!=mxEvent.LABEL_HANDLE&&null!=R&&(Z=E,null==Z&&(k=new mxRectangle(C.x,C.y),k.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(k,R[0].x,R[0].y)?Z=0:mxUtils.contains(k,R[R.length-1].x,R[R.length-1].y)?Z=Y.bends.length-1:null!=R&&(null==W&&null==Z||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&-(null!=W&&(2==R.length||3==R.length&&(0==Math.round(R[0].x-R[1].x)&&0==Math.round(R[1].x-R[2].x)||0==Math.round(R[0].y-R[1].y)&&0==Math.round(R[1].y-R[2].y)))?Z=2:(Z=mxUtils.findNearestSegment(J,C.x,C.y),Z=null==W?mxEvent.VIRTUAL_HANDLE-Z:Z+1))),null==Z&&(Z=mxEvent.VIRTUAL_HANDLE));k=Z==mxEvent.LABEL_HANDLE||0==Z||Z==Y.bends.length-1;if(!U&&(null!=J.visibleSourceState||null!=J.visibleTargetState)||k)Y.start(x.getGraphX(),x.getGraphX(),Z),x.consume(),this.graphHandler.reset()}null!=Y&&(this.selectionCellsHandler.isHandlerActive(Y)?-this.isCellSelected(J.cell)||(this.selectionCellsHandler.handlers.put(J.cell,Y),this.selectCellForEvent(J.cell,x.getEvent())):this.isCellSelected(J.cell)||Y.destroy());Q=!1;C=G=T=E=null}}else if(J=x.getState(),null!=J&&this.isCellEditable(J.cell)){k=this.model.getParent(J.cell);Y=null;if(this.model.isEdge(J.cell)&&!this.isCellSelected(J.cell)&&!mxEvent.isAltDown(x.getEvent())&&!mxEvent.isShiftDown(x.getEvent())&&!this.isAncestorSelected(J.cell)&&(this.isSwimlane(k)||this.model.isLayer(k)||this.getCurrentRoot()==-k)){if(k=new mxRectangle(x.getGraphX(),x.getGraphY()),k.grow(mxEdgeHandler.prototype.handleImage.width/2),R=J.absolutePoints,null!=R)null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,x.getGraphX(),x.getGraphY())?Y="move":mxUtils.contains(k,R[0].x,R[0].y)||mxUtils.contains(k,R[R.length-1].x,R[R.length-1].y)?Y="pointer":(W=this.view.getEdgeStyle(J),W==mxEdgeStyle.EntityRelation||null==J.visibleSourceState&&null==J.visibleTargetState||(Y="crosshair",W!=mxEdgeStyle.SegmentConnector&&-W!=mxEdgeStyle.OrthConnector))||(x=mxUtils.findNearestSegment(J,x.getGraphX(),x.getGraphY()),x<R.length-1&&0<=x&&(Y=0==Math.round(R[x].x-R[x+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(x.getEvent())){R=mxShape.prototype.svgStrokeTolerance/2;k=new mxRectangle(x.getGraphX(),x.getGraphY());k.grow(R);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&(x=this.model.getParent(J.cell),R=this.model.getParent(x),!this.isCellSelected(R)))if(mxUtils.intersects(k,new mxRectangle(J.x,-J.y-2,J.width,4))&&this.model.getChildAt(R,0)!=x||mxUtils.intersects(k,new mxRectangle(J.x,J.y+J.height-2,J.width,4)))Y="row-resize";else if(mxUtils.intersects(k,new mxRectangle(J.x-2,J.y,4,J.height))&&this.model.getChildAt(x,0)!=J.cell||mxUtils.intersects(k,new mxRectangle(J.x+J.width-2,J.y,4,J.height)))Y="col-resize";for(x=J;null==Y&&null!=x&&(this.isTableCell(x.cell)||this.isTableRow(x.cell)||this.isTable(x.cell));)this.isSwimlane(x.cell)&&this.isCellMovable(x.cell)&&(R=this.getActualStartSize(x.cell),-Z=this.view.scale,(0<R.x||0<R.width)&&mxUtils.intersects(k,new mxRectangle(x.x+(R.x-R.width-1)*Z+(0==R.x?x.width*Z:0),x.y,1,x.height))?Y="col-resize":(0<R.y||0<R.height)&&mxUtils.intersects(k,new mxRectangle(x.x,x.y+(R.y-R.height-1)*Z+(0==R.y?x.height:0),x.width,1))&&(Y="row-resize")),x=this.view.getState(this.model.getParent(x.cell))}null!=Y&&J.setCursor(Y)}}}),mouseUp:mxUtils.bind(this,function(k,x){E=C=G=T=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=-function(k){var x=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);k.view.graph.isHtmlLabel(k.cell)&&("0"==mxUtils.getValue(k.style,"html","0")?x=mxUtils.htmlEntities(x,!1):(k.lastLabelValue!=x&&(k.lastLabelValue=x,k.lastSanitizedLabelValue=Graph.sanitizeHtml(x),c.innerHTML=k.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==k.view.graph.getAdaptiveColors())&&(k.lastSanitizedLabelValue=c.innerHTML)),x=k.lastSanitizedLabelValue));return x};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(k,x){return!1};this.alternateEdgeStyle="vertical";null==n&&this.loadStylesheet();var g=this.graphHandler.getGuideStates;-this.graphHandler.getGuideStates=function(){var k=g.apply(this,arguments);if(this.graph.pageVisible){var x=[],J=this.graph.pageFormat,R=this.graph.pageScale,Y=J.width*R;J=J.height*R;R=this.graph.view.translate;for(var Z=this.graph.view.scale,W=this.graph.getPageLayout(),U=0;U<W.width;U++)x.push(new mxRectangle(((W.x+U)*Y+R.x)*Z,(W.y*J+R.y)*Z,Y*Z,J*Z));for(U=1;U<W.height;U++)x.push(new mxRectangle((W.x*Y+R.x)*Z,((W.y+U)*J+R.y)*Z,Y*Z,J*Z));k=x.concat(k)}return k};mxDragSource.prototype.dragElementZIndex=-mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(k,x){return null==k.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(k){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var l=this.graphHandler.getCells;this.graphHandler.getCells=function(k){for(var x=l.apply(this,arguments),J=new mxDictionary,R=[],Y=0;Y<x.length;Y++){var Z=-this.graph.isTableCell(k)&&this.graph.isTableCell(x[Y])&&this.graph.isCellSelected(x[Y])?this.graph.model.getParent(x[Y]):this.graph.isTableRow(k)&&this.graph.isTableRow(x[Y])&&this.graph.isCellSelected(x[Y])?x[Y]:this.graph.getCompositeParent(x[Y]);null==Z||J.get(Z)||(J.put(Z,!0),R.push(Z))}return R};var t=this.graphHandler.start;this.graphHandler.start=function(k,x,J,R){var Y=!1;this.graph.isTableCell(k)&&(this.graph.isCellSelected(k)?Y=!0:k=this.graph.model.getParent(k));Y||this.graph.isTableRow(k)&&-this.graph.isCellSelected(k)||(k=this.graph.getCompositeParent(k));t.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(k,x){x=this.graph.getCompositeParent(x);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(k,x,J,R,Y,Z){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=R&&this.graph.applyNewEdgeStyle(R,[W]);return W};var B=new mxRubberband(this);this.getRubberband=function(){return B};-var D=(new Date).getTime(),I=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var k=this.currentState;L.apply(this,arguments);k!=this.currentState?(D=(new Date).getTime(),I=0):I=(new Date).getTime()-D};var N=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(k){return mxEvent.isShiftDown(k.getEvent())&&mxEvent.isAltDown(k.getEvent())?!1:null!=this.currentState&&k.getState()==this.currentState&&2E3<I||(null==this.currentState||-"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&N.apply(this,arguments)};var K=this.isToggleEvent;this.isToggleEvent=function(k){return K.apply(this,arguments)||mxEvent.isShiftDown(k)};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(k){return mxEvent.isMouseEvent(k.getEvent())};var ja=this.click;this.click=function(k){var x=null==k.state&&null!=k.sourceState&&this.isCellLocked(this.getLayerForCell(k.sourceState.cell));if(this.isEnabled()&&!x||k.isConsumed())return ja.apply(this,arguments);var J=x?k.sourceState.cell:k.getCell();if(null!=J){var R=this.getClickableLinkForCell(J);null!=R?this.isCustomLink(R)?this.customLinkClicked(R,J):this.openLink(R):-x&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};var ea=this.tooltipHandler.show;this.tooltipHandler.show=function(){ea.apply(this,arguments);if(null!=this.div)for(var k=this.div.getElementsByTagName("a"),x=0;x<k.length;x++)null!=k[x].getAttribute("href")&&null==k[x].getAttribute("target")&&k[x].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};this.getCursorForMouseEvent=function(k){var x=null==-k.state&&null!=k.sourceState&&this.isCellLocked(k.sourceState.cell);return this.getCursorForCell(x?k.sourceState.cell:k.getCell())};var ca=this.getCursorForCell;this.getCursorForCell=function(k){if(!this.isEnabled()||this.isCellLocked(k)){if(null!=this.getClickableLinkForCell(k))return"pointer";if(this.isCellLocked(k))return"default"}return ca.apply(this,arguments)};this.selectRegion=function(k,x){var J=mxEvent.isAltDown(x)?k:null;k=this.getCells(k.x,k.y,k.width,k.height,null,null,J,null,!0);if(this.isToggleEvent(x))for(J=-0;J<k.length;J++)this.selectCellForEvent(k[J],x);else this.selectCellsForEvent(k,x);return k};var fa=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(k,x,J){return this.graph.isCellSelected(k)?!1:fa.apply(this,arguments)};var la=this.updateMouseEvent;this.updateMouseEvent=function(k){k=la.apply(this,arguments);null!=k.state&&this.isCellLocked(this.getLayerForCell(k.getCell()))&&(null==this.getLinkForCell(k.getCell())?k.state=this.view.getState(this.getCellAt(k.getGraphX(),-k.getGraphY(),null,null,null,mxUtils.bind(this,function(x,J,R){return k.state==x||this.isCellLocked(this.getLayerForCell(x.cell))&&null==this.getLinkForCell(x.cell)}))):k.state=null);return k};var ka=this.isCellSelectable;this.isCellSelectable=function(k){return ka.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(k))};this.isCellLocked=function(k){for(;null!=k;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(k),"locked","0"))return!0;k=this.model.getParent(k)}return!1};var V=null;-this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,x){"mouseDown"==x.getProperty("eventName")&&(k=x.getProperty("event").getState(),V=null==k||this.isSelectionEmpty()||this.isCellSelected(k.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(k,x){if(!mxEvent.isMultiTouchEvent(x)){k=x.getProperty("event");var J=x.getProperty("cell");null==J?(k=mxUtils.convertPoint(this.container,mxEvent.getClientX(k),mxEvent.getClientY(k)),B.start(k.x,-k.y)):null!=V?this.addSelectionCells(V):1<this.getSelectionCount()&&this.isCellSelected(J)&&this.removeSelectionCell(J);V=null;x.consume()}}));this.connectionHandler.selectCells=function(k,x){this.graph.setSelectionCell(x||k)};this.connectionHandler.constraintHandler.isStateIgnored=function(k,x){var J=k.view.graph;return x&&(J.isCellSelected(k.cell)||J.isTableRow(k.cell)&&J.selectionCellsHandler.isHandled(J.model.getParent(k.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,-function(){var k=this.connectionHandler.constraintHandler;null!=k.currentFocus&&k.isStateIgnored(k.currentFocus,!0)&&(k.currentFocus=null,k.constraints=null,k.destroyIcons());k.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";+return null!=k?"1"==k.html||"wrap"==k[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var C=null,G=null,T=null,E=null,P=!1,L=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,y){if("mouseDown"==y.getProperty("eventName")&&this.isEnabled()){k=y.getProperty("event");var J=k.getState();y=this.view.scale;if(!mxEvent.isAltDown(k.getEvent())&&null!=J&&(L=this.isCellSelected(J.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(k.getEvent()))){var R=this.selectionCellsHandler.getHandler(J.cell);+if(null==R||null==R.getHandleForEvent(k)){var X=new mxRectangle(k.getGraphX()-1,k.getGraphY()-1),aa=mxEvent.isTouchEvent(k.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;R=aa+2;X.grow(aa);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&!this.isCellSelected(J.cell)&&!(mxUtils.contains(J,k.getGraphX()-R,k.getGraphY()-R)&&mxUtils.contains(J,k.getGraphX()-R,k.getGraphY()+R)&&mxUtils.contains(J,k.getGraphX()+R,k.getGraphY()+R)&&mxUtils.contains(J,+k.getGraphX()+R,k.getGraphY()-R))){var Z=this.model.getParent(J.cell);R=this.model.getParent(Z);if(!this.isCellSelected(R)){aa*=y;var U=2*aa;if(this.model.getChildAt(R,0)!=Z&&mxUtils.intersects(X,new mxRectangle(J.x,J.y-aa,J.width,U))||this.model.getChildAt(Z,0)!=J.cell&&mxUtils.intersects(X,new mxRectangle(J.x-aa,J.y,U,J.height))||mxUtils.intersects(X,new mxRectangle(J.x,J.y+J.height-aa,J.width,U))||mxUtils.intersects(X,new mxRectangle(J.x+J.width-aa,J.y,U,J.height)))Z=this.selectionCellsHandler.isHandled(R),+this.selectCellForEvent(R,k.getEvent()),R=this.selectionCellsHandler.getHandler(R),null!=R&&(aa=R.getHandleForEvent(k),null!=aa&&(R.start(k.getGraphX(),k.getGraphY(),aa),R.blockDelayedSelection=!Z,k.consume()))}}for(;!k.isConsumed()&&null!=J&&(this.isTableCell(J.cell)||this.isTableRow(J.cell)||this.isTable(J.cell));)this.isSwimlane(J.cell)&&this.isCellMovable(J.cell)&&(R=this.getActualStartSize(J.cell),(0<R.x||0<R.width)&&mxUtils.intersects(X,new mxRectangle(J.x+(R.x-R.width-1)*y+(0==R.x?J.width:+0),J.y,1,J.height))||(0<R.y||0<R.height)&&mxUtils.intersects(X,new mxRectangle(J.x,J.y+(R.y-R.height-1)*y+(0==R.y?J.height:0),J.width,1)))&&(this.selectCellForEvent(J.cell,k.getEvent()),R=this.selectionCellsHandler.getHandler(J.cell),null!=R&&null!=R.customHandles&&(aa=mxEvent.CUSTOM_HANDLE-R.customHandles.length+1,R.start(k.getGraphX(),k.getGraphY(),aa),k.consume())),J=this.view.getState(this.model.getParent(J.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(k,+y){if("mouseDown"==y.getProperty("eventName")&&this.isEnabled()){k=y.getProperty("event");var J=k.getState();mxEvent.isAltDown(k.getEvent())||mxEvent.isControlDown(y)||mxEvent.isShiftDown(y)||L||null==J||!this.model.isEdge(J.cell)||(C=new mxPoint(k.getGraphX(),k.getGraphY()),P=this.isCellSelected(J.cell),T=J,G=k,null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,k.getGraphX(),k.getGraphY())?E=mxEvent.LABEL_HANDLE:(y=this.selectionCellsHandler.getHandler(J.cell),null!=y&&null!=+y.bends&&0<y.bends.length&&(E=y.getHandleForEvent(k))))}}));this.addMouseListener({mouseDown:function(k,y){},mouseMove:mxUtils.bind(this,function(k,y){k=this.selectionCellsHandler.handlers.map;for(var J in k)if(null!=k[J].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(y.getEvent())){var R=this.tolerance;if(null!=C&&null!=T&&null!=G){if(J=T,null!=E||Math.abs(C.x-y.getGraphX())>R||Math.abs(C.y-y.getGraphY())>R){var X=null;mxEvent.isShiftDown(y.getEvent())||(X=+this.selectionCellsHandler.getHandler(J.cell));if(null!=X&&null!=X.bends&&0<X.bends.length){X.redrawHandles();var aa=null!=E?E:X.getHandleForEvent(G),Z=this.view.getEdgeStyle(J),U=Z==mxEdgeStyle.EntityRelation;R=J.absolutePoints;P||(aa=E);aa!=mxEvent.LABEL_HANDLE&&null!=R&&(aa=E,null==aa&&(k=new mxRectangle(C.x,C.y),k.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(k,R[0].x,R[0].y)?aa=0:mxUtils.contains(k,R[R.length-1].x,R[R.length-1].y)?aa=X.bends.length-1:null!=R&&(null==Z&&null==+aa||Z==mxEdgeStyle.SegmentConnector||Z==mxEdgeStyle.OrthConnector)&&(null!=Z&&(2==R.length||3==R.length&&(0==Math.round(R[0].x-R[1].x)&&0==Math.round(R[1].x-R[2].x)||0==Math.round(R[0].y-R[1].y)&&0==Math.round(R[1].y-R[2].y)))?aa=2:(aa=mxUtils.findNearestSegment(J,C.x,C.y),aa=null==Z?mxEvent.VIRTUAL_HANDLE-aa:aa+1))),null==aa&&(aa=mxEvent.VIRTUAL_HANDLE));k=aa==mxEvent.LABEL_HANDLE||0==aa||aa==X.bends.length-1;if(!U&&(null!=J.visibleSourceState||null!=J.visibleTargetState)||k)X.start(y.getGraphX(),+y.getGraphX(),aa),y.consume(),this.graphHandler.reset()}null!=X&&(this.selectionCellsHandler.isHandlerActive(X)?this.isCellSelected(J.cell)||(this.selectionCellsHandler.handlers.put(J.cell,X),this.selectCellForEvent(J.cell,y.getEvent())):this.isCellSelected(J.cell)||X.destroy());P=!1;C=G=T=E=null}}else if(J=y.getState(),null!=J&&this.isCellEditable(J.cell)){k=this.model.getParent(J.cell);X=null;if(this.model.isEdge(J.cell)&&!this.isCellSelected(J.cell)&&!mxEvent.isAltDown(y.getEvent())&&!mxEvent.isShiftDown(y.getEvent())&&+!this.isAncestorSelected(J.cell)&&(this.isSwimlane(k)||this.model.isLayer(k)||this.getCurrentRoot()==k)){if(k=new mxRectangle(y.getGraphX(),y.getGraphY()),k.grow(mxEdgeHandler.prototype.handleImage.width/2),R=J.absolutePoints,null!=R)null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,y.getGraphX(),y.getGraphY())?X="move":mxUtils.contains(k,R[0].x,R[0].y)||mxUtils.contains(k,R[R.length-1].x,R[R.length-1].y)?X="pointer":(Z=this.view.getEdgeStyle(J),Z==mxEdgeStyle.EntityRelation||+null==J.visibleSourceState&&null==J.visibleTargetState||(X="crosshair",Z!=mxEdgeStyle.SegmentConnector&&Z!=mxEdgeStyle.OrthConnector))||(y=mxUtils.findNearestSegment(J,y.getGraphX(),y.getGraphY()),y<R.length-1&&0<=y&&(X=0==Math.round(R[y].x-R[y+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(y.getEvent())){R=mxShape.prototype.svgStrokeTolerance/2;k=new mxRectangle(y.getGraphX(),y.getGraphY());k.grow(R);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&(y=this.model.getParent(J.cell),+R=this.model.getParent(y),!this.isCellSelected(R)))if(mxUtils.intersects(k,new mxRectangle(J.x,J.y-2,J.width,4))&&this.model.getChildAt(R,0)!=y||mxUtils.intersects(k,new mxRectangle(J.x,J.y+J.height-2,J.width,4)))X="row-resize";else if(mxUtils.intersects(k,new mxRectangle(J.x-2,J.y,4,J.height))&&this.model.getChildAt(y,0)!=J.cell||mxUtils.intersects(k,new mxRectangle(J.x+J.width-2,J.y,4,J.height)))X="col-resize";for(y=J;null==X&&null!=y&&(this.isTableCell(y.cell)||this.isTableRow(y.cell)||this.isTable(y.cell));)this.isSwimlane(y.cell)&&+this.isCellMovable(y.cell)&&(R=this.getActualStartSize(y.cell),aa=this.view.scale,(0<R.x||0<R.width)&&mxUtils.intersects(k,new mxRectangle(y.x+(R.x-R.width-1)*aa+(0==R.x?y.width*aa:0),y.y,1,y.height))?X="col-resize":(0<R.y||0<R.height)&&mxUtils.intersects(k,new mxRectangle(y.x,y.y+(R.y-R.height-1)*aa+(0==R.y?y.height:0),y.width,1))&&(X="row-resize")),y=this.view.getState(this.model.getParent(y.cell))}null!=X&&J.setCursor(X)}}}),mouseUp:mxUtils.bind(this,function(k,y){E=C=G=T=null})})}this.cellRenderer.minSvgStrokeWidth=+.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=function(k){var y=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);k.view.graph.isHtmlLabel(k.cell)&&("0"==mxUtils.getValue(k.style,"html","0")?y=mxUtils.htmlEntities(y,!1):(k.lastLabelValue!=y&&(k.lastLabelValue=y,k.lastSanitizedLabelValue=Graph.sanitizeHtml(y),c.innerHTML=k.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==k.view.graph.getAdaptiveColors())&&(k.lastSanitizedLabelValue=c.innerHTML)),+y=k.lastSanitizedLabelValue));return y};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(k,+y){return!1};this.alternateEdgeStyle="vertical";null==n&&this.loadStylesheet();var g=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var k=g.apply(this,arguments);if(this.graph.pageVisible){var y=[],J=this.graph.pageFormat,R=this.graph.pageScale,X=J.width*R;J=J.height*R;R=this.graph.view.translate;for(var aa=this.graph.view.scale,Z=this.graph.getPageLayout(),U=0;U<Z.width;U++)y.push(new mxRectangle(((Z.x+U)*X+R.x)*aa,(Z.y*J+R.y)*aa,X*aa,J*aa));for(U=1;U<Z.height;U++)y.push(new mxRectangle((Z.x*+X+R.x)*aa,((Z.y+U)*J+R.y)*aa,X*aa,J*aa));k=y.concat(k)}return k};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(k,y){return null==k.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(k){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var l=this.graphHandler.getCells;this.graphHandler.getCells=+function(k){for(var y=l.apply(this,arguments),J=new mxDictionary,R=[],X=0;X<y.length;X++){var aa=this.graph.isTableCell(k)&&this.graph.isTableCell(y[X])&&this.graph.isCellSelected(y[X])?this.graph.model.getParent(y[X]):this.graph.isTableRow(k)&&this.graph.isTableRow(y[X])&&this.graph.isCellSelected(y[X])?y[X]:this.graph.getCompositeParent(y[X]);null==aa||J.get(aa)||(J.put(aa,!0),R.push(aa))}return R};var t=this.graphHandler.start;this.graphHandler.start=function(k,y,J,R){var X=!1;this.graph.isTableCell(k)&&+(this.graph.isCellSelected(k)?X=!0:k=this.graph.model.getParent(k));X||this.graph.isTableRow(k)&&this.graph.isCellSelected(k)||(k=this.graph.getCompositeParent(k));t.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(k,y){y=this.graph.getCompositeParent(y);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(k,y,J,R,X,aa){var Z=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=R&&this.graph.applyNewEdgeStyle(R,+[Z]);return Z};var B=new mxRubberband(this);this.getRubberband=function(){return B};var D=(new Date).getTime(),I=0,K=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var k=this.currentState;K.apply(this,arguments);k!=this.currentState?(D=(new Date).getTime(),I=0):I=(new Date).getTime()-D};var M=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(k){return mxEvent.isShiftDown(k.getEvent())&&mxEvent.isAltDown(k.getEvent())?!1:+null!=this.currentState&&k.getState()==this.currentState&&2E3<I||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&M.apply(this,arguments)};var V=this.isToggleEvent;this.isToggleEvent=function(k){return V.apply(this,arguments)||mxEvent.isShiftDown(k)};var Q=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(Q=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=Q)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(k){return mxEvent.isMouseEvent(k.getEvent())};var ja=this.click;this.click=function(k){var y=null==k.state&&null!=k.sourceState&&this.isCellLocked(this.getLayerForCell(k.sourceState.cell));if(this.isEnabled()&&!y||k.isConsumed())return ja.apply(this,arguments);var J=y?k.sourceState.cell:k.getCell();if(null!=J){var R=this.getClickableLinkForCell(J);+null!=R?this.isCustomLink(R)?this.customLinkClicked(R,J):this.openLink(R):y&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};var ea=this.tooltipHandler.show;this.tooltipHandler.show=function(){ea.apply(this,arguments);if(null!=this.div)for(var k=this.div.getElementsByTagName("a"),y=0;y<k.length;y++)null!=k[y].getAttribute("href")&&null==k[y].getAttribute("target")&&k[y].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};+this.getCursorForMouseEvent=function(k){var y=null==k.state&&null!=k.sourceState&&this.isCellLocked(k.sourceState.cell);return this.getCursorForCell(y?k.sourceState.cell:k.getCell())};var da=this.getCursorForCell;this.getCursorForCell=function(k){if(!this.isEnabled()||this.isCellLocked(k)){if(null!=this.getClickableLinkForCell(k))return"pointer";if(this.isCellLocked(k))return"default"}return da.apply(this,arguments)};this.selectRegion=function(k,y){var J=Graph.intersectionSelect||mxEvent.isAltDown(y)?+k:null;k=this.getCells(k.x,k.y,k.width,k.height,null,null,J,null,!0);if(this.isToggleEvent(y))for(J=0;J<k.length;J++)this.selectCellForEvent(k[J],y);else this.selectCellsForEvent(k,y);return k};var ia=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(k,y,J){return this.graph.isCellSelected(k)?!1:ia.apply(this,arguments)};var la=this.updateMouseEvent;this.updateMouseEvent=function(k){k=la.apply(this,arguments);null!=k.state&&this.isCellLocked(this.getLayerForCell(k.getCell()))&&+(null==this.getLinkForCell(k.getCell())?k.state=this.view.getState(this.getCellAt(k.getGraphX(),k.getGraphY(),null,null,null,mxUtils.bind(this,function(y,J,R){return k.state==y||this.isCellLocked(this.getLayerForCell(y.cell))&&null==this.getLinkForCell(y.cell)}))):k.state=null);return k};var ka=this.isCellSelectable;this.isCellSelectable=function(k){return ka.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(k))};this.isCellLocked=function(k){for(;null!=k;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(k),+"locked","0"))return!0;k=this.model.getParent(k)}return!1};var W=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,y){"mouseDown"==y.getProperty("eventName")&&(k=y.getProperty("event").getState(),W=null==k||this.isSelectionEmpty()||this.isCellSelected(k.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(k,y){if(!mxEvent.isMultiTouchEvent(y)){k=y.getProperty("event");var J=y.getProperty("cell");null==J?(k=mxUtils.convertPoint(this.container,+mxEvent.getClientX(k),mxEvent.getClientY(k)),B.start(k.x,k.y)):null!=W?this.addSelectionCells(W):1<this.getSelectionCount()&&this.isCellSelected(J)&&this.removeSelectionCell(J);W=null;y.consume()}}));this.connectionHandler.selectCells=function(k,y){this.graph.setSelectionCell(y||k)};this.connectionHandler.constraintHandler.isStateIgnored=function(k,y){var J=k.view.graph;return y&&(J.isCellSelected(k.cell)||J.isTableRow(k.cell)&&J.selectionCellsHandler.isHandled(J.model.getParent(k.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,+mxUtils.bind(this,function(){var k=this.connectionHandler.constraintHandler;null!=k.currentFocus&&k.isStateIgnored(k.currentFocus,!0)&&(k.currentFocus=null,k.constraints=null,k.destroyIcons());k.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.intersectionSelect=!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";Graph.colorStyles=[mxConstants.STYLE_FONTCOLOR,mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_IMAGE_BORDER,mxConstants.STYLE_IMAGE_BACKGROUND,mxConstants.STYLE_LABEL_BORDERCOLOR,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];Graph.textStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity labelBorderColor labelBackgroundColor autosize resizable horizontal textDirection autosizeText".split(" ");Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin".split(" ");Graph.cellStyleGroups=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing","targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"]];Graph.cellStyles=mxUtils.addItems(mxUtils.addItems(mxUtils.addItems("rounded shadow glass dashed dashPattern comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification sketchStyle pointerEvents opacity strokeColor strokeWidth align verticalAlign spacingLeft spacingRight spacingTop spacingBottom spacing arcSize absoluteArcSize comicStyle swimlaneFillColor shadowOffsetX shadowOffsetY shadowBlur shadowColor shadowOpacity".split(" "),Graph.textStyles),@@ -2361,10 +2363,10 @@ Graph.createSvgImage=function(b,d,m,n,v){m=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,d,m,n,v){var p=mxUtils.createXmlDocument(),C=null!=p.createElementNS?p.createElementNS(mxConstants.NS_SVG,"svg"):p.createElement("svg");null!=v&&C.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==p.createElementNS?(C.setAttribute("xmlns",mxConstants.NS_SVG),C.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):C.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);C.setAttribute("version","1.1");C.setAttribute("width",m+"px");C.setAttribute("height",n+"px");C.setAttribute("viewBox",b+" "+d+" "+m+" "+n);p.appendChild(C);return C};-Graph.htmlToPng=function(b,d,m,n,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var C=document.createElement("canvas");C.width=d*p;C.height=m*p;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var E=C.getContext("2d");E.scale(p,p);E.drawImage(G,0,0);n(C.toDataURL())}catch(Q){n(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,d,m,n,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var C=document.createElement("canvas");C.width=d*p;C.height=m*p;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var E=C.getContext("2d");E.scale(p,p);E.drawImage(G,0,0);n(C.toDataURL())}catch(P){n(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=function(E){n(null)};G.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+d+'" height="'+m+'">'+(""!=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,d,m,n){function v(c,g,l){return null!=n?n(c,g,l):mxUtils.isValidColor(l)?(null==C&&null!=d&&(C={}),null!=C&&(C[g]=c.style.getPropertyValue(g)),l=mxUtils.getLightDarkColor(l,null,null,m),c.style.setProperty(g,l.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),C=null,G=!1,T=0;T<p.length;T++)if(p[T]!=b&&null!=p[T].style){C=null;for(var E=0;E<p[T].style.length;E++){var Q=p[T].style.item(E),M=p[T].style.getPropertyValue(Q);G=v(p[T],Q,M)||G}"FONT"==p[T].nodeName&&-""==p[T].style.getPropertyValue("color")&&(M=p[T].getAttribute("color"),G=v(p[T],"color",M)||G);null!=d&&null!=C&&p[T].setAttribute(d,JSON.stringify(C))}return G};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,n=0;n<b.length;n++)try{var v=b[n].getAttribute(d);if(null!=v){b[n].removeAttribute(d);var p=JSON.parse(v),C;for(C in p){var G=p[C];""==G?(b[n].style[C]=null,""==b[n].getAttribute("style")&&b[n].removeAttribute("style")):b[n].style[C]=G;m=!0}}}catch(T){}return m};+Graph.addLightDarkColors=function(b,d,m,n){function v(c,g,l){return null!=n?n(c,g,l):mxUtils.isValidColor(l)?(null==C&&null!=d&&(C={}),null!=C&&(C[g]=c.style.getPropertyValue(g)),l=mxUtils.getLightDarkColor(l,null,null,m),c.style.setProperty(g,l.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),C=null,G=!1,T=0;T<p.length;T++)if(p[T]!=b&&null!=p[T].style){C=null;for(var E=0;E<p[T].style.length;E++){var P=p[T].style.item(E),L=p[T].style.getPropertyValue(P);G=v(p[T],P,L)||G}"FONT"==p[T].nodeName&&+""==p[T].style.getPropertyValue("color")&&(L=p[T].getAttribute("color"),G=v(p[T],"color",L)||G);null!=d&&null!=C&&p[T].setAttribute(d,JSON.stringify(C))}return G};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,n=0;n<b.length;n++)try{var v=b[n].getAttribute(d);if(null!=v){b[n].removeAttribute(d);var p=JSON.parse(v),C;for(C in p){var G=p[C];""==G?(b[n].style[C]=null,""==b[n].getAttribute("style")&&b[n].removeAttribute("style")):b[n].style[C]=G;m=!0}}}catch(T){}return m};Graph.getGivenColor=function(b,d){var m=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var n=b.getAttribute(Graph.backupStyleAttribute);if(null!=n){var v=JSON.parse(n);null!=v&&null!=v[d]&&("color"==d&&"FONT"==b.nodeName&&""==v[d]&&null!=b.getAttribute("color")?m=b.getAttribute("color"):""!=v[d]&&(m=v[d]))}}catch(p){}null==m&&""!=b.style[d]&&(m=b.style[d])}return m};Graph.setTextColor=function(b,d,m){for(var n=m?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=m?"color":"background-color",p=b.getElementsByTagName("*"),C=[],G=0;G<p.length;G++)C.push({node:p[G],value:p[G].style[v]});document.execCommand(m?"forecolor":"backcolor",!1,n);b=b.getElementsByTagName("*");for(G=0;G<b.length;G++){if(G<C.length&&C[G].node==b[G]&&C[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(E){}if(m&&b[G].getAttribute("color")==n||b[G].style[v]==n){m&&b[G].getAttribute("color")==n&&b[G].removeAttribute("color");b[G].style[v]=d!=mxConstants.NONE?mxUtils.getLightDarkColor(d).cssText:null;try{p=b[G].getAttribute(Graph.backupStyleAttribute),T=null!=p?JSON.parse(p):{},T[v]=d!=mxConstants.NONE?d:"",b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(T))}catch(E){}if(m&&mxClient.IS_FF){d=b[G];m=d.firstChild;if(null!=@@ -2374,17 +2376,17 @@ Graph.arrayBufferToString=function(b){var d="";b=new Uint8Array(b);for(var m=b.bGraph.arrayBufferIndexOfString=function(b,d,m){var n=d.charCodeAt(0),v=1,p=-1;for(m=m||0;m<b.byteLength;m++)if(b[m]==n){p=m;break}for(m=p+1;-1<p&&m<b.byteLength&&m<p+d.length-1;m++){if(b[m]!=d.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,d,p+1);v++}return v==d.length-1?p:-1};Graph.compress=function(b,d){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=d?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};Graph.decompress=function(b,d,m){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));d=decodeURIComponent(d?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return m?d:Graph.zapGremlins(d)};Graph.fadeNodes=function(b,d,m,n,v){v=null!=v?v:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,d);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+v+"ms ease-in-out");Graph.setOpacityForNodes(b,m);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=n&&n()},v)},0)};-Graph.exploreFromCell=function(b,d,m){pageSize=null!=m&&null!=m.pageSize?m.pageSize:8;minSize=null!=m&&null!=m.minSize?m.minSize:180;(function(n,v){function p(M){M.view.states.visit(function(c,g){null!=g.shape&&M.model.isEdge(M.model.getParent(g.cell))?g.shape.node.parentNode.appendChild(g.shape.node):null!=g.text&&M.model.isEdge(g.cell)&&g.text.node.parentNode.appendChild(g.text.node)})}function C(M,c){if(M.getModel().isVertex(c)){var g=M.container.offsetWidth/2,l=M.container.offsetHeight/2;M.rootCell=-c.referenceCell||c;M.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(M.container.offsetWidth-800/120,M.container.offsetHeight-600)/30));for(var t=c.referenceCell||c,B=n.model.getCell(t.sourceCellId),D=n.getEdges(B,null,!0,!0,!1,!0),I=[],L=0;L<D.length;L++)null!=D[L].getTerminal(!0)&&null!=D[L].getTerminal(!1)&&n.isCellVisible(D[L])&&!n.isEdgeIgnored(D[L])&&n.isCellVisible(D[L].getTerminal(!0))&&n.isCellVisible(D[L].getTerminal(!1))&&n.isCellVisible(n.getLayerForCell(D[L]))&&-I.push(D[L]);I=D=I;if(null!=c.startIndex||0<pageSize&&D.length>pageSize){var N=c.startIndex||0;I=D.slice(Math.max(0,N),Math.min(D.length,N+pageSize))}I=n.getOpposites(I,B).concat(I);var K=M.cloneCells(I);for(L=0;L<I.length;L++)if(K[L].sourceCellId=I[L].id,M.model.isEdge(K[L]))for(K[L].geometry.x=0,K[L].geometry.y=0,K[L].geometry.points=null,K[L].setStyle(K[L].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),K[L].setTerminal(t,-null==K[L].getTerminal(!0)),B=0;B<K[L].getChildCount();B++){var da=K[L].getChildAt(B);null!=da.geometry&&da.geometry.relative&&(da.setStyle(da.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),da.geometry.offset=new mxPoint(0,0),da.geometry.y=0,da.geometry.x=.5>da.geometry.x?-.8:.5<da.geometry.x?.8:0)}if(0<c.startIndex){var ja=M.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");-ja.referenceCell=t;ja.startIndex=Math.max(0,(c.startIndex||0)-pageSize);K.splice(0,0,ja)}if(D.length>(c.startIndex||0)+pageSize){var ea=M.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ea.referenceCell=t;ea.startIndex=(c.startIndex||0)+pageSize;K.splice(0,0,ea)}for(var ca in M.getModel().cells){var fa=M.getModel().getCell(ca);fa!=M.rootCell&&-!M.getModel().isAncestor(M.rootCell,fa)&&M.getModel().isVertex(fa)&&M.removeCells([fa])}M.addCells(K);var la=M.getModel().getGeometry(M.rootCell);null!=la&&(la=la.clone(),la.x=g-la.width/2,la.y=l-la.height/3,M.getModel().setGeometry(M.rootCell,la));c=[];for(ca in M.getModel().cells)fa=M.getModel().getCell(ca),fa!=M.rootCell&&M.getModel().isVertex(fa)&&M.getModel().getParent(fa)==M.getDefaultParent()&&(c.push(fa),la=M.getModel().getGeometry(fa),null!=la&&(la.x=g-la.width/2,la.y=l-la.height/2));var ka=-c.length,V=2*Math.PI/ka,k=Math.max(minSize,Math.min(M.container.offsetWidth/2-40,M.container.offsetHeight/2-80));for(g=0;g<ka;g++)la=M.getModel().getGeometry(c[g]),null!=la&&(la=la.clone(),la.x+=k*Math.sin(g*V),la.y+=k*Math.cos(g*V),M.getModel().setGeometry(c[g],la))}finally{M.getModel().endUpdate()}}}var G=document.createElement("div");G.style.position="absolute";G.style.display="block";G.style.overflow="auto";G.style.width="100%";G.style.height="100%";G.style.left="0px";G.style.top="0px";G.style.zIndex=+Graph.exploreFromCell=function(b,d,m){pageSize=null!=m&&null!=m.pageSize?m.pageSize:8;minSize=null!=m&&null!=m.minSize?m.minSize:180;(function(n,v){function p(L){L.view.states.visit(function(c,g){null!=g.shape&&L.model.isEdge(L.model.getParent(g.cell))?g.shape.node.parentNode.appendChild(g.shape.node):null!=g.text&&L.model.isEdge(g.cell)&&g.text.node.parentNode.appendChild(g.text.node)})}function C(L,c){if(L.getModel().isVertex(c)){var g=L.container.offsetWidth/2,l=L.container.offsetHeight/2;L.rootCell=+c.referenceCell||c;L.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(L.container.offsetWidth-800/120,L.container.offsetHeight-600)/30));for(var t=c.referenceCell||c,B=n.model.getCell(t.sourceCellId),D=n.getEdges(B,null,!0,!0,!1,!0),I=[],K=0;K<D.length;K++)null!=D[K].getTerminal(!0)&&null!=D[K].getTerminal(!1)&&n.isCellVisible(D[K])&&!n.isEdgeIgnored(D[K])&&n.isCellVisible(D[K].getTerminal(!0))&&n.isCellVisible(D[K].getTerminal(!1))&&n.isCellVisible(n.getLayerForCell(D[K]))&&+I.push(D[K]);I=D=I;if(null!=c.startIndex||0<pageSize&&D.length>pageSize){var M=c.startIndex||0;I=D.slice(Math.max(0,M),Math.min(D.length,M+pageSize))}I=n.getOpposites(I,B).concat(I);var V=L.cloneCells(I);for(K=0;K<I.length;K++)if(V[K].sourceCellId=I[K].id,L.model.isEdge(V[K]))for(V[K].geometry.x=0,V[K].geometry.y=0,V[K].geometry.points=null,V[K].setStyle(V[K].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[K].setTerminal(t,+null==V[K].getTerminal(!0)),B=0;B<V[K].getChildCount();B++){var Q=V[K].getChildAt(B);null!=Q.geometry&&Q.geometry.relative&&(Q.setStyle(Q.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),Q.geometry.offset=new mxPoint(0,0),Q.geometry.y=0,Q.geometry.x=.5>Q.geometry.x?-.8:.5<Q.geometry.x?.8:0)}if(0<c.startIndex){var ja=L.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");+ja.referenceCell=t;ja.startIndex=Math.max(0,(c.startIndex||0)-pageSize);V.splice(0,0,ja)}if(D.length>(c.startIndex||0)+pageSize){var ea=L.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ea.referenceCell=t;ea.startIndex=(c.startIndex||0)+pageSize;V.splice(0,0,ea)}for(var da in L.getModel().cells){var ia=L.getModel().getCell(da);ia!=L.rootCell&&+!L.getModel().isAncestor(L.rootCell,ia)&&L.getModel().isVertex(ia)&&L.removeCells([ia])}L.addCells(V);var la=L.getModel().getGeometry(L.rootCell);null!=la&&(la=la.clone(),la.x=g-la.width/2,la.y=l-la.height/3,L.getModel().setGeometry(L.rootCell,la));c=[];for(da in L.getModel().cells)ia=L.getModel().getCell(da),ia!=L.rootCell&&L.getModel().isVertex(ia)&&L.getModel().getParent(ia)==L.getDefaultParent()&&(c.push(ia),la=L.getModel().getGeometry(ia),null!=la&&(la.x=g-la.width/2,la.y=l-la.height/2));var ka=+c.length,W=2*Math.PI/ka,k=Math.max(minSize,Math.min(L.container.offsetWidth/2-40,L.container.offsetHeight/2-80));for(g=0;g<ka;g++)la=L.getModel().getGeometry(c[g]),null!=la&&(la=la.clone(),la.x+=k*Math.sin(g*W),la.y+=k*Math.cos(g*W),L.getModel().setGeometry(c[g],la))}finally{L.getModel().endUpdate()}}}var G=document.createElement("div");G.style.position="absolute";G.style.display="block";G.style.overflow="auto";G.style.width="100%";G.style.height="100%";G.style.left="0px";G.style.top="0px";G.style.zIndex=2;G.style.background=n.background==mxConstants.NONE||null==n.background?"light-dark(#ffffff,"+Editor.darkColor+")":n.background;var T=document.createElement("img");T.setAttribute("src",Editor.closeBlackImage);T.style.position="absolute";T.style.cursor="pointer";T.style.right="10px";T.style.top="10px";G.appendChild(T);var E=document.createElement("div");E.style.position="absolute";E.style.cursor="pointer";E.style.right="38px";E.style.top="14px";E.style.textAlign="right";E.style.verticalAlign="top";-mxUtils.write(E,mxResources.get("close"));G.appendChild(E);document.body.appendChild(G);var Q=function(M){27==M.keyCode&&T.click()};mxEvent.addListener(document,"keydown",Q);(function(M){var c=new Graph(M);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(I){return this.model.isVertex(I)?"pointer":null};c.getFoldingImage=function(){return null};var g=function(){mxEvent.removeListener(document,"keydown",Q);M.parentNode.removeChild(M);-n.scrollCellToVisible(v)};mxEvent.addListener(T,"click",g);mxEvent.addListener(E,"click",g);c.setEnabled(!1);var l=c.click;c.click=function(I){var L=I.getCell(),N=null!=L?null!=L.referenceCell?L.referenceCell:L:null;null!=L&&0<c.getEdges(N).length?C(c,L):l.apply(this,arguments)};g=c.container.offsetWidth/2;var t=c.container.offsetHeight/3;c.model.beginUpdate();var B=c.importCells([v])[0];B.sourceCellId=v.id;B.geometry.x=g-B.geometry.width/2;B.geometry.y=t-B.geometry.height/2;c.model.endUpdate();var D=-!1;c.getModel().addListener(mxEvent.CHANGE,function(I,L){D||(I=L.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,D=!0,mxEffects.animateChanges(c,I,function(){var N=new mxParallelEdgeLayout(c);N.spacing=60;var K=N.layout;N.layout=function(da){N.spacing=Math.min(60,Math.max(30,60-5*da.length));K.apply(this,arguments)};N.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();p(c);D=!1}))});C(c,B)})(G)})(b,+mxUtils.write(E,mxResources.get("close"));G.appendChild(E);document.body.appendChild(G);var P=function(L){27==L.keyCode&&T.click()};mxEvent.addListener(document,"keydown",P);(function(L){var c=new Graph(L);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(I){return this.model.isVertex(I)?"pointer":null};c.getFoldingImage=function(){return null};var g=function(){mxEvent.removeListener(document,"keydown",P);L.parentNode.removeChild(L);+n.scrollCellToVisible(v)};mxEvent.addListener(T,"click",g);mxEvent.addListener(E,"click",g);c.setEnabled(!1);var l=c.click;c.click=function(I){var K=I.getCell(),M=null!=K?null!=K.referenceCell?K.referenceCell:K:null;null!=K&&0<c.getEdges(M).length?C(c,K):l.apply(this,arguments)};g=c.container.offsetWidth/2;var t=c.container.offsetHeight/3;c.model.beginUpdate();var B=c.importCells([v])[0];B.sourceCellId=v.id;B.geometry.x=g-B.geometry.width/2;B.geometry.y=t-B.geometry.height/2;c.model.endUpdate();var D=+!1;c.getModel().addListener(mxEvent.CHANGE,function(I,K){D||(I=K.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,D=!0,mxEffects.animateChanges(c,I,function(){var M=new mxParallelEdgeLayout(c);M.spacing=60;var V=M.layout;M.layout=function(Q){M.spacing=Math.min(60,Math.max(30,60-5*Q.length));V.apply(this,arguments)};M.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();p(c);D=!1}))});C(c,B)})(G)})(b,d)};Graph.removeKeys=function(b,d){for(var m in b)d(m)&&delete b[m]};Graph.setTransitionForNodes=function(b,d){for(var m=0;m<b.length;m++)mxUtils.setPrefixedStyle(b[m].style,"transition",d)};Graph.setOpacityForNodes=function(b,d){for(var m=0;m<b.length;m++)b[m].style.opacity=d};Graph.removePasteFormatting=function(b,d){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var m=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 n=Graph.createTabNode(4);b.parentNode.replaceChild(n,b);b=n}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=m&&"P"==m.nodeName&&"p1"==m.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!d&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(n=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,n.outerHTML))}b=m}};Graph.createTabNode=function(b){var d="\t";if(null!=b)for(d="";0<b;)d+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(d));return b};Graph.sanitizeHtml=function(b,d){return Graph.domPurify(b,!1)};@@ -2393,8 +2395,8 @@ Graph.isStyleAllowed=function(b){b=b.replace(/\\([0-9a-fA-F]{1,6})\s?/g,functionDOMPurify.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():"style"==b.nodeName.toLowerCase()&&(Graph.isStyleAllowed(b.textContent)||b.remove())});DOMPurify.addHook("uponSanitizeAttribute",function(b,d){"style"!=d.attrName||Graph.isStyleAllowed(d.attrValue)||(d.keepAttr=!1)});Graph.domPurify=function(b,d){window.DOM_PURIFY_CONFIG.IN_PLACE=d;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var d=document.createElement("div");d.style.position="absolute";d.style.visibility="hidden";var m=decodeURIComponent(escape(atob(b.substring(26)))),n=m.indexOf("<svg");if(0<=n){d.innerHTML=Graph.sanitizeHtml(m.substring(n));var v=d.getElementsByTagName("svg");if(0<v.length){document.body.appendChild(d);try{n=m=1;var p=v[0].getAttribute("width"),C=v[0].getAttribute("height");p=null!=p&&"%"!=p.charAt(p.length--1)?parseFloat(p):NaN;C=null!=C&&"%"!=C.charAt(C.length-1)?parseFloat(C):NaN;var G=v[0].getAttribute("viewBox");if(null!=G&&!isNaN(p)&&!isNaN(C)){var T=G.split(" ");4<=G.length&&(m=parseFloat(T[2])/p,n=parseFloat(T[3])/C)}var E=v[0].getBBox();if(0<E.width&&0<E.height){G=0;var Q=v[0].querySelectorAll("[stroke-width]");for(T=0;T<Q.length;T++)G=Math.max(G,parseFloat(Q[T].getAttribute("stroke-width")));var M=new mxRectangle(E.x,E.y,E.width,E.height);M.grow(G/2);!isNaN(p)&&!isNaN(C)&&0>M.x&&0>M.y&&M.width>-p&&M.height>C?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+p+" "+C):(d.getElementsByTagName("svg")[0].setAttribute("viewBox",M.x+" "+M.y+" "+M.width+" "+M.height),d.getElementsByTagName("svg")[0].setAttribute("width",M.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",M.height/n))}}catch(c){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(c){}return b};+1)?parseFloat(p):NaN;C=null!=C&&"%"!=C.charAt(C.length-1)?parseFloat(C):NaN;var G=v[0].getAttribute("viewBox");if(null!=G&&!isNaN(p)&&!isNaN(C)){var T=G.split(" ");4<=G.length&&(m=parseFloat(T[2])/p,n=parseFloat(T[3])/C)}var E=v[0].getBBox();if(0<E.width&&0<E.height){G=0;var P=v[0].querySelectorAll("[stroke-width]");for(T=0;T<P.length;T++)G=Math.max(G,parseFloat(P[T].getAttribute("stroke-width")));var L=new mxRectangle(E.x,E.y,E.width,E.height);L.grow(G/2);!isNaN(p)&&!isNaN(C)&&0>L.x&&0>L.y&&L.width>+p&&L.height>C?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+p+" "+C):(d.getElementsByTagName("svg")[0].setAttribute("viewBox",L.x+" "+L.y+" "+L.width+" "+L.height),d.getElementsByTagName("svg")[0].setAttribute("width",L.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",L.height/n))}}catch(c){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(c){}return b};Graph.createRemoveIcon=function(b,d){var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.clearImage);m.setAttribute("title",b);m.setAttribute("width","13");m.setAttribute("height","10");m.style.marginLeft="4px";m.style.marginBottom="-1px";m.style.cursor="pointer";mxEvent.addListener(m,"click",d);return m};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};Graph.rewritePageLinks=function(b,d){function m(v,p){var C=v.getAttribute(p);if(null!=C){Graph.isPageLink(C)&&(C="#"+C.substring(C.indexOf(":")+1));var G=p;d&&"xlink:href"==p&&(v.removeAttribute(p),G="href");v.setAttribute(G,C)}}b=b.getElementsByTagName("a");if(null!=b)for(var n=0;n<b.length;n++)m(b[n],"href"),m(b[n],"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)};mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.defaultExportLinkTarget=null;Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;@@ -2402,33 +2404,33 @@ Graph.prototype.defaultConnectionArrowsEnabled=!0;Graph.prototype.defaultConnectGraph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";Graph.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(m,n){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=m.view.graph.tolerance,p=!0,C=null,G=mxUtils.bind(this,function(Q){p=!0;C=new mxPoint(mxEvent.getClientX(Q),mxEvent.getClientY(Q))}),T=mxUtils.bind(this,function(Q){p=p&&null!=C&&Math.abs(C.x-mxEvent.getClientX(Q))<v&&Math.abs(C.y-mxEvent.getClientY(Q))<v}),E=mxUtils.bind(this,function(Q){if(p)for(var M=mxEvent.getSource(Q);null!=-M&&M!=n.node;){if("a"==M.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,M,Q);break}M=M.parentNode}});mxEvent.addGestureListeners(n.node,G,T,E);mxEvent.addListener(n.node,"click",function(Q){mxEvent.consume(Q)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(m){var n=mxEvent.getSource(m);"A"==n.nodeName&&(n=n.getAttribute("href"),null!=+Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(m,n){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=m.view.graph.tolerance,p=!0,C=null,G=mxUtils.bind(this,function(P){p=!0;C=new mxPoint(mxEvent.getClientX(P),mxEvent.getClientY(P))}),T=mxUtils.bind(this,function(P){p=p&&null!=C&&Math.abs(C.x-mxEvent.getClientX(P))<v&&Math.abs(C.y-mxEvent.getClientY(P))<v}),E=mxUtils.bind(this,function(P){if(p)for(var L=mxEvent.getSource(P);null!=+L&&L!=n.node;){if("a"==L.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,L,P);break}L=L.parentNode}});mxEvent.addGestureListeners(n.node,G,T,E);mxEvent.addListener(n.node,"click",function(P){mxEvent.consume(P)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(m){var n=mxEvent.getSource(m);"A"==n.nodeName&&(n=n.getAttribute("href"),null!=n&&this.graph.isCustomLink(n)&&(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&this.graph.customLinkClicked(n)&&mxEvent.consume(m))}))}}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(C){var G=mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(C.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(C.style,"lineShape",null)&&"mxgraph.basic.arc"!=G&&(this.model.isVertex(C.cell)||"arrow"==G||"pipe"==G||"wire"==G||"filledEdge"==G||"flexArrow"==G||"mxgraph.arrows2.wedgeArrow"==G)};Graph.prototype.isGradientState=function(C){var G=mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(C)&&"wire"!=G&&"pipe"!=G};Graph.prototype.isStrokeState=function(C){return!0};Graph.prototype.getTextColor=function(C,G){for(var T=G?"color":"background-color",E=C==this.cellEditor.textarea&&G?"default":Graph.getGivenColor(C,T);null==E&&null!=C&&C!=this.cellEditor.textarea.parentNode;)E=C==this.cellEditor.textarea&&G?"default":Graph.getGivenColor(C,T),C=C.parentNode;if("rgba(0, 0, 0, 0)"==E||"transparent"==E)E=mxConstants.NONE;return E};Graph.prototype.isSpecialColor=function(C){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],C)};Graph.prototype.isGlassState=function(C){C=mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null);return"label"==C||"rectangle"==C||"internalStorage"==C||"ext"==C||"umlLifeline"==C||"swimlane"==C||"process"==C};Graph.prototype.isRoundedState=function(C){return null!=C.shape?C.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(C){var G=mxUtils.getValue(C.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(C.style,mxConstants.STYLE_CURVED,!1)&&("connector"==G||"filledEdge"==G||"wire"==G)};Graph.prototype.isAutoSizeState=function(C){return"1"==mxUtils.getValue(C.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isAutosizeTextState=function(C){return"1"==mxUtils.getValue(C.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCell=function(C){C=this.getCurrentCellStyle(C);return null!=C&&"1"==C.autosizeText};Graph.prototype.isImageState=function(C){return null!=mxUtils.getValue(C.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(C){return!0};Graph.prototype.getVerticesAndEdges=function(C,G){C=null!=C?C:!0;G=null!=G?G:!0;var T=this.model;return T.filterDescendants(function(E){return C&&T.isVertex(E)||G&&T.isEdge(E)},T.getRoot())};-Graph.prototype.applyNewEdgeStyle=function(C,G,T){C=this.getCellStyle(C).newEdgeStyle;if(null!=C){this.model.beginUpdate();try{var E=JSON.parse(C),Q;for(Q in E)this.setCellStyles(Q,E[Q],G),"edgeStyle"==Q&&"elbowEdgeStyle"==E[Q]&&null!=T&&this.setCellStyles("elbow",T==mxConstants.DIRECTION_SOUTH||T==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",G)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(C){for(var G={},T=0;T<C.length;T++){var E=this.view.getState(C[T]);null!=-E&&this.mergeStyle(E.style,G,0==T)}return G};Graph.prototype.mergeStyle=function(C,G,T){if(null!=C){var E={},Q;for(Q in C){var M=C[Q];null!=M&&(E[Q]=!0,null==G[Q]&&T?G[Q]=M:G[Q]!=M&&delete G[Q])}for(Q in G)E[Q]||delete G[Q]}};Graph.prototype.getStartEditingCell=function(C,G){G=this.getCellStyle(C);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(C)&&(!this.isSwimlane(C)||0==G)&&""==this.getLabel(C)&&0<this.model.getChildCount(C)&&(C=this.model.getChildAt(C,0),G=this.getCellStyle(C),-G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(C)&&(!this.isSwimlane(C)||0==G)&&""==this.getLabel(C)&&0<this.model.getChildCount(C))for(G=0;G<this.model.getChildCount(C);G++){var T=this.model.getChildAt(C,G);if(this.isCellEditable(T)){C=T;break}}return C};Graph.prototype.copyStyle=function(C){return this.getCellStyle(C,!1)};Graph.prototype.pasteStyle=function(C,G,T,E){null!=C&&(E||(T=null!=T?T:Graph.cellStyles,Graph.removeKeys(C,function(Q){return 0>mxUtils.indexOf(T,-Q)})),this.updateCellStyles(C,G))};Graph.prototype.copyCellStyles=function(C,G,T,E,Q,M,c){var g=!1,l=!1;if(0<C.length)for(var t=0;t<C.length&&(g=this.getModel().isVertex(C[t])||g,!(l=this.getModel().isEdge(C[t])||l)||!g);t++);else l=g=!0;g=g&&!M;l=l&&!c;for(t=0;t<G.length;t++)if(C=0<=mxUtils.indexOf(Graph.textStyles,G[t]),"strokeColor"!=G[t]||null!=T[t]&&"none"!=T[t])if(0<=mxUtils.indexOf(Graph.cellStyles,G[t])||"shape"==G[t])if("shape"!=G[t]&&(g||C)&&(null==T[t]?delete E[G[t]]:E[G[t]]=T[t]),l||C)null==-T[t]?delete Q[G[t]]:Q[G[t]]=T[t]};Graph.prototype.includeDescendants=function(C){for(var G=[],T=0;T<C.length;T++)G=G.concat(this.model.getDescendants(C[T]));return G};Graph.prototype.pasteCellStyles=function(C,G,T,E,Q){G=null!=G?G:this.currentVertexStyle;T=null!=T?T:this.currentEdgeStyle;Q=null!=Q?Q:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var M=0;M<C.length;M++){var c=C[M],g=this.model.getStyle(c),l=!1;null!=c.style&&(pairs=c.style.split(";"),l=l||0<=mxUtils.indexOf(pairs,"text"));if(l)var t=-Graph.textStyles;else if(t=Graph.cellStyles.slice(),!E)for(var B=null!=g?g.split(";"):[],D=0;D<B.length;D++){var I=B[D],L=I.indexOf("=");if(0<=L){var N=I.substring(0,L),K=mxUtils.indexOf(t,N);0<=K&&t.splice(K,1);for(l=0;l<Graph.cellStyleGroups.length;l++){var da=Graph.cellStyleGroups[l];if(0<=mxUtils.indexOf(da,N))for(var ja=0;ja<da.length;ja++){var ea=mxUtils.indexOf(t,da[ja]);0<=ea&&t.splice(ea,1)}}}}var ca=this.model.isEdge(c);l=ca?T:G;for(D=0;D<t.length;D++){N=t[D];var fa=l[N];null!=fa&&("edgeStyle"!=-N||Q)&&(ca||!ca&&0>mxUtils.indexOf(Graph.edgeStyles,N))&&(g=mxUtils.setStyle(g,N,fa),"fontFamily"==N&&null==l.fontSource&&(g=mxUtils.setStyle(g,"fontSource",null)),ca&&"rounded"==N&&"1"==fa&&null==l.curved&&(g=mxUtils.setStyle(g,"curved",null)))}Editor.simpleLabels&&(g=mxUtils.setStyle(mxUtils.setStyle(g,"html",null),"whiteSpace",null));this.model.setStyle(c,g)}}finally{this.model.endUpdate()}return C};Graph.prototype.updateCellStyles=function(C,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 E=this.getCellStyle(G[T],!1),Q=E[mxConstants.STYLE_PERIMETER],M=!1;for(g in C){var c=C[g];if(E[g]!=c){if(g==mxConstants.STYLE_SHAPE&&"umlLifeline"==E[g]&&"umlLifeline"!=c){M=!0;var g="participant"}this.setCellStyles(g,c,[G[T]])}}M&&this.setCellStyles(mxConstants.STYLE_PERIMETER,Q,[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(C,G,T,E,Q,M){this.useCssTransforms&&(C=C/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(C,G,T,E,Q,M){E=null!=E?E:!0;Q=null!=Q?Q:!0;null==T&&(T=this.getCurrentRoot(),-null==T&&(T=this.getModel().getRoot()));if(null!=T)for(var c=this.model.getChildCount(T)-1;0<=c;c--){var g=this.model.getChildAt(T,c),l=this.getScaledCellAt(C,G,g,E,Q,M);if(null!=l)return l;if(this.isCellVisible(g)&&(Q&&this.model.isEdge(g)||E&&this.model.isVertex(g))&&(l=this.view.getState(g),null!=l&&(null==M||!M(l,C,G))&&this.intersects(l,C,G)))return g}return null};Graph.prototype.isRecursiveVertexResize=function(C){return!this.isSwimlane(C.cell)&&0<this.model.getChildCount(C.cell)&&!this.isCellCollapsed(C.cell)&&+Graph.prototype.applyNewEdgeStyle=function(C,G,T){C=this.getCellStyle(C).newEdgeStyle;if(null!=C){this.model.beginUpdate();try{var E=JSON.parse(C),P;for(P in E)this.setCellStyles(P,E[P],G),"edgeStyle"==P&&"elbowEdgeStyle"==E[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(C){for(var G={},T=0;T<C.length;T++){var E=this.view.getState(C[T]);null!=+E&&this.mergeStyle(E.style,G,0==T)}return G};Graph.prototype.mergeStyle=function(C,G,T){if(null!=C){var E={},P;for(P in C){var L=C[P];null!=L&&(E[P]=!0,null==G[P]&&T?G[P]=L:G[P]!=L&&delete G[P])}for(P in G)E[P]||delete G[P]}};Graph.prototype.getStartEditingCell=function(C,G){G=this.getCellStyle(C);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(C)&&(!this.isSwimlane(C)||0==G)&&""==this.getLabel(C)&&0<this.model.getChildCount(C)&&(C=this.model.getChildAt(C,0),G=this.getCellStyle(C),+G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(C)&&(!this.isSwimlane(C)||0==G)&&""==this.getLabel(C)&&0<this.model.getChildCount(C))for(G=0;G<this.model.getChildCount(C);G++){var T=this.model.getChildAt(C,G);if(this.isCellEditable(T)){C=T;break}}return C};Graph.prototype.copyStyle=function(C){return this.getCellStyle(C,!1)};Graph.prototype.pasteStyle=function(C,G,T,E){null!=C&&(E||(T=null!=T?T:Graph.cellStyles,Graph.removeKeys(C,function(P){return 0>mxUtils.indexOf(T,+P)})),this.updateCellStyles(C,G))};Graph.prototype.copyCellStyles=function(C,G,T,E,P,L,c){var g=!1,l=!1;if(0<C.length)for(var t=0;t<C.length&&(g=this.getModel().isVertex(C[t])||g,!(l=this.getModel().isEdge(C[t])||l)||!g);t++);else l=g=!0;g=g&&!L;l=l&&!c;for(t=0;t<G.length;t++)if(C=0<=mxUtils.indexOf(Graph.textStyles,G[t]),"strokeColor"!=G[t]||null!=T[t]&&"none"!=T[t])if(0<=mxUtils.indexOf(Graph.cellStyles,G[t])||"shape"==G[t])if("shape"!=G[t]&&(g||C)&&(null==T[t]?delete E[G[t]]:E[G[t]]=T[t]),l||C)null==+T[t]?delete P[G[t]]:P[G[t]]=T[t]};Graph.prototype.includeDescendants=function(C){for(var G=[],T=0;T<C.length;T++)G=G.concat(this.model.getDescendants(C[T]));return G};Graph.prototype.pasteCellStyles=function(C,G,T,E,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 L=0;L<C.length;L++){var c=C[L],g=this.model.getStyle(c),l=!1;null!=c.style&&(pairs=c.style.split(";"),l=l||0<=mxUtils.indexOf(pairs,"text"));if(l)var t=+Graph.textStyles;else if(t=Graph.cellStyles.slice(),!E)for(var B=null!=g?g.split(";"):[],D=0;D<B.length;D++){var I=B[D],K=I.indexOf("=");if(0<=K){var M=I.substring(0,K),V=mxUtils.indexOf(t,M);0<=V&&t.splice(V,1);for(l=0;l<Graph.cellStyleGroups.length;l++){var Q=Graph.cellStyleGroups[l];if(0<=mxUtils.indexOf(Q,M))for(var ja=0;ja<Q.length;ja++){var ea=mxUtils.indexOf(t,Q[ja]);0<=ea&&t.splice(ea,1)}}}}var da=this.model.isEdge(c);l=da?T:G;for(D=0;D<t.length;D++){M=t[D];var ia=l[M];null!=ia&&("edgeStyle"!=+M||P)&&(da||!da&&0>mxUtils.indexOf(Graph.edgeStyles,M))&&(g=mxUtils.setStyle(g,M,ia),"fontFamily"==M&&null==l.fontSource&&(g=mxUtils.setStyle(g,"fontSource",null)),da&&"rounded"==M&&"1"==ia&&null==l.curved&&(g=mxUtils.setStyle(g,"curved",null)))}Editor.simpleLabels&&(g=mxUtils.setStyle(mxUtils.setStyle(g,"html",null),"whiteSpace",null));this.model.setStyle(c,g)}}finally{this.model.endUpdate()}return C};Graph.prototype.updateCellStyles=function(C,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 E=this.getCellStyle(G[T],!1),P=E[mxConstants.STYLE_PERIMETER],L=!1;for(g in C){var c=C[g];if(E[g]!=c){if(g==mxConstants.STYLE_SHAPE&&"umlLifeline"==E[g]&&"umlLifeline"!=c){L=!0;var g="participant"}this.setCellStyles(g,c,[G[T]])}}L&&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(C,G,T,E,P,L){this.useCssTransforms&&(C=C/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(C,G,T,E,P,L){E=null!=E?E:!0;P=null!=P?P:!0;null==T&&(T=this.getCurrentRoot(),+null==T&&(T=this.getModel().getRoot()));if(null!=T)for(var c=this.model.getChildCount(T)-1;0<=c;c--){var g=this.model.getChildAt(T,c),l=this.getScaledCellAt(C,G,g,E,P,L);if(null!=l)return l;if(this.isCellVisible(g)&&(P&&this.model.isEdge(g)||E&&this.model.isVertex(g))&&(l=this.view.getState(g),null!=l&&(null==L||!L(l,C,G))&&this.intersects(l,C,G)))return g}return null};Graph.prototype.isRecursiveVertexResize=function(C){return!this.isSwimlane(C.cell)&&0<this.model.getChildCount(C.cell)&&!this.isCellCollapsed(C.cell)&&"1"==mxUtils.getValue(C.style,"recursiveResize","1")&&null==mxUtils.getValue(C.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(C){for(var G=this.getCellGeometry(C);null!=G&&G.relative;)C=this.getModel().getParent(C),G=this.getCellGeometry(C);return C};Graph.prototype.isPart=function(C){return"1"==mxUtils.getValue(this.getCurrentCellStyle(C),"part","0")||this.isTableCell(C)||this.isTableRow(C)};Graph.prototype.getCompositeParents=function(C){for(var G=new mxDictionary,T=[],E=-0;E<C.length;E++){var Q=this.getCompositeParent(C[E]);this.isTableCell(Q)&&(Q=this.graph.model.getParent(Q));this.isTableRow(Q)&&(Q=this.graph.model.getParent(Q));null==Q||G.get(Q)||(G.put(Q,!0),T.push(Q))}return T};Graph.prototype.getReferenceTerminal=function(C){if(null!=C){var G=this.getCellGeometry(C);null!=G&&G.relative&&(C=this.model.getParent(C))}null!=C&&this.model.isEdge(C)&&(C=this.model.getParent(C));null!=C&&(C=this.getCompositeParent(C));return C};Graph.prototype.getCompositeParent=function(C){for(;this.isPart(C);){var G=+0;E<C.length;E++){var P=this.getCompositeParent(C[E]);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(C){if(null!=C){var G=this.getCellGeometry(C);null!=G&&G.relative&&(C=this.model.getParent(C))}null!=C&&this.model.isEdge(C)&&(C=this.model.getParent(C));null!=C&&(C=this.getCompositeParent(C));return C};Graph.prototype.getCompositeParent=function(C){for(;this.isPart(C);){var G=this.model.getParent(C);if(!this.model.isVertex(G))break;C=G}return C};Graph.prototype.filterSelectionCells=function(C){var G=this.getSelectionCells();if(null!=C){for(var T=[],E=0;E<G.length;E++)C(G[E])||T.push(G[E]);G=T}return G};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(C){if(this.useCssTransforms){var G=this.currentScale,T=this.currentTranslate;C=new mxRectangle((C.x+2*T.x)*G-T.x,(C.y+2*T.y)*G-T.y,C.width*G,C.height*G)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(C){C=this.strokeWidth;this.graph.useCssTransforms&&(C/=this.graph.currentScale);return C};mxGraphView.prototype.getGraphBounds=function(){var C=this.graphBounds;if(this.graph.useCssTransforms){var G=this.graph.currentTranslate,T=this.graph.currentScale;C=new mxRectangle((C.x+G.x)*T,(C.y+G.y)*T,C.width*T,C.height*T)}return C};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var d=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(C){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);d.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 m=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(C){C=m.apply(this,arguments);for(var G=[],T=0;T<C.length;T++)this.isTableRow(C[T])||this.isTableCell(C[T])||G.push(C[T]);return G};var n=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(C){C=n.apply(this,arguments);for(var G=[],T=0;T<C.length;T++)this.isTable(C[T])||this.isTableRow(C[T])||this.isTableCell(C[T])||G.push(C[T]);return G};Graph.prototype.updateCssTransform=function(){var C=this.view.getDrawPane();if(null!=C)if(C=C.parentNode,this.useCssTransforms){var G=C.getAttribute("transform");C.setAttribute("transformOrigin","0 0");var T=Math.round(100*this.currentScale)/100;C.setAttribute("transform","scale("+T+","+T+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");G!=C.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",C.getAttribute("transform"))}else C.removeAttribute("transformOrigin"),C.removeAttribute("transform")};-var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var C=this.graph.useCssTransforms,G=this.scale,T=this.translate;C&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);C&&(this.scale=G,this.translate=T)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(C,G,T){var E=this.useCssTransforms,Q=this.view.scale,M=this.view.translate;E&&(this.view.scale=1,this.view.translate=-new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);E&&(this.view.scale=Q,this.view.translate=M,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};+var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var C=this.graph.useCssTransforms,G=this.scale,T=this.translate;C&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);C&&(this.scale=G,this.translate=T)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(C,G,T){var E=this.useCssTransforms,P=this.view.scale,L=this.view.translate;E&&(this.view.scale=1,this.view.translate=+new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);E&&(this.view.scale=P,this.view.translate=L,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,d,m){var n=d.getAttribute("href");n!=Graph.sanitizeLink(n)&&Graph.sanitizeNode(d);if(null!=n&&!this.isCustomLink(n)&&(mxEvent.isLeftMouseButton(m)&&!mxEvent.isPopupTrigger(m)||mxEvent.isTouchEvent(m))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(n)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(n),b);mxEvent.consume(m)}};Graph.prototype.openLink=function(b,d,m){var n=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==d&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)!=this.baseUrl||"#"!=b.charAt(this.baseUrl.length)||"_top"!=d||window!=window.top||navigator.standalone)n=window.open(b,null!=d?d:"_blank",m?null:"noopener,noreferrer"),null==n||m||(n.opener=null);else{var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=v}}catch(p){}return n};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,d){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)};@@ -2443,7 +2445,7 @@ Graph.prototype.createLayouts=function(b){for(var d=[],m=0;m<b.length;m++)if(0<=Graph.prototype.getDataForCells=function(b,d){for(var m=[],n=0;n<b.length;n++){var v={};v.id=b[n].id;var p=null!=b[n].value?b[n].value.attributes:null;this.isReplacePlaceholders(b[n])&&d&&(v.value=this.getLabel(b[n]));if(null!=p)for(var C=0;C<p.length;C++)v[p[C].nodeName]=p[C].nodeValue;else v.label=this.convertValueToString(b[n]);m.push(v)}return m};Graph.prototype.getNodesForCells=function(b){for(var d=[],m=0;m<b.length;m++){var n=this.view.getState(b[m]);if(null!=n){for(var v=this.cellRenderer.getShapesForState(n),p=0;p<v.length;p++)null!=v[p]&&null!=v[p].node&&d.push(v[p].node);null!=n.control&&null!=n.control.node&&d.push(n.control.node)}}return d};Graph.prototype.createWipeAnimations=function(b,d){for(var m=[],n=0;n<b.length;n++){var v=this.view.getState(b[n]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?m.push(this.createEdgeWipeAnimation(v,d)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&m.push(this.createVertexWipeAnimation(v,d)))}return m};-Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),n=b.segments,v=b.length,p=m.length;return{execute:mxUtils.bind(this,function(C,G){if(null!=b.shape){var T=[m[0]];G=C/G;d||(G=1-G);for(var E=v*G,Q=1;Q<p;Q++)if(E<=n[Q-1]){T.push(new mxPoint(m[Q-1].x+(m[Q].x-m[Q-1].x)*E/n[Q-1],m[Q-1].y+(m[Q].y-m[Q-1].y)*E/n[Q-1]));break}else E-=n[Q-1],T.push(m[Q]);b.shape.points=T;b.shape.redraw();0==C&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=+Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),n=b.segments,v=b.length,p=m.length;return{execute:mxUtils.bind(this,function(C,G){if(null!=b.shape){var T=[m[0]];G=C/G;d||(G=1-G);for(var E=v*G,P=1;P<p;P++)if(E<=n[P-1]){T.push(new mxPoint(m[P-1].x+(m[P].x-m[P-1].x)*E/n[P-1],m[P-1].y+(m[P].y-m[P-1].y)*E/n[P-1]));break}else E-=n[P-1],T.push(m[P]);b.shape.points=T;b.shape.redraw();0==C&&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=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};Graph.prototype.createVertexWipeAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(n,v){null!=b.shape&&(v=n/v,d||(v=1-v),b.shape.bounds=new mxRectangle(m.x,m.y,m.width*v,m.height),b.shape.redraw(),0==n&&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=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};Graph.prototype.executeAnimations=function(b,d,m,n){m=null!=m?m:30;n=null!=n?n:30;var v=null,p=0,C=mxUtils.bind(this,function(){if(p==m||this.stoppingCustomActions){window.clearInterval(v);for(var G=0;G<b.length;G++)b[G].stop();null!=d&&d()}else for(G=0;G<b.length;G++)b[G].execute(p,m);p++});v=window.setInterval(C,n);C()};@@ -2458,15 +2460,15 @@ Graph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);retGraph.prototype.getClickableLinkForCell=function(b){do{var d=this.getLinkForCell(b);if(null!=d)return d;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var d=null;"date"==b?d=(new Date).toLocaleDateString():"time"==b?d=(new Date).toLocaleTimeString():"timestamp"==b?d=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),d=this.formatDate(new Date,b));return d};Graph.prototype.formatDate=function(b,d,m){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 n=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,C=function(D,I){D=String(D);for(I=I||2;D.length<I;)D="0"+D;return D};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||-/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(n.masks[d]||d||n.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var G=m?"getUTC":"get",T=b[G+"Date"](),E=b[G+"Day"](),Q=b[G+"Month"](),M=b[G+"FullYear"](),c=b[G+"Hours"](),g=b[G+"Minutes"](),l=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var t=m?0:b.getTimezoneOffset(),B={d:T,dd:C(T),ddd:n.i18n.dayNames[E],dddd:n.i18n.dayNames[E+7],m:Q+1,mm:C(Q+1),mmm:n.i18n.monthNames[Q],mmmm:n.i18n.monthNames[Q+-12],yy:String(M).slice(2),yyyy:M,h:c%12||12,hh:C(c%12||12),H:c,HH:C(c),M:g,MM:C(g),s:l,ss:C(l),l:C(G,3),L:C(99<G?Math.round(G/10):G),t:12>c?"a":"p",tt:12>c?"am":"pm",T:12>c?"A":"P",TT:12>c?"AM":"PM",Z:m?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<t?"-":"+")+C(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4),S:["th","st","nd","rd"][3<T%10?0:(10!=T%100-T%10)*T%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(D){return D in B?B[D]:D.slice(1,+/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(n.masks[d]||d||n.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var G=m?"getUTC":"get",T=b[G+"Date"](),E=b[G+"Day"](),P=b[G+"Month"](),L=b[G+"FullYear"](),c=b[G+"Hours"](),g=b[G+"Minutes"](),l=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var t=m?0:b.getTimezoneOffset(),B={d:T,dd:C(T),ddd:n.i18n.dayNames[E],dddd:n.i18n.dayNames[E+7],m:P+1,mm:C(P+1),mmm:n.i18n.monthNames[P],mmmm:n.i18n.monthNames[P++12],yy:String(L).slice(2),yyyy:L,h:c%12||12,hh:C(c%12||12),H:c,HH:C(c),M:g,MM:C(g),s:l,ss:C(l),l:C(G,3),L:C(99<G?Math.round(G/10):G),t:12>c?"a":"p",tt:12>c?"am":"pm",T:12>c?"A":"P",TT:12>c?"AM":"PM",Z:m?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<t?"-":"+")+C(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4),S:["th","st","nd","rd"][3<T%10?0:(10!=T%100-T%10)*T%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(D){return D in B?B[D]:D.slice(1,D.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 d=null;if(0<b.length){d=this.getLayerForCell(b[0]);for(var m=1;m<b.length;m++)if(!this.model.isAncestor(d,b[m])){d=null;break}}return d};-Graph.prototype.createLayersDialog=function(b,d){var m=document.createElement("div");m.style.position="absolute";for(var n=this.getModel(),v=n.getChildCount(n.root),p=0;p<v;p++)mxUtils.bind(this,function(C){function G(){n.isVisible(C)?(Q.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(E,75)):(Q.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(E,25))}var T=this.convertValueToString(C)||mxResources.get("background")||"Background",E=document.createElement("div");E.style.overflow=-"hidden";E.style.textOverflow="ellipsis";E.style.padding="2px";E.style.whiteSpace="nowrap";E.style.cursor="pointer";E.setAttribute("title",mxResources.get(n.isVisible(C)?"hideIt":"show",[T]));var Q=document.createElement("img");Q.setAttribute("draggable","false");Q.setAttribute("align","absmiddle");Q.setAttribute("border","0");Q.style.position="relative";Q.style.width="16px";Q.style.padding="0px 6px 0 4px";d&&(Q.style.filter="invert(100%)",Q.style.top="-2px");E.appendChild(Q);mxUtils.write(E,T);m.appendChild(E);+Graph.prototype.createLayersDialog=function(b,d){var m=document.createElement("div");m.style.position="absolute";for(var n=this.getModel(),v=n.getChildCount(n.root),p=0;p<v;p++)mxUtils.bind(this,function(C){function G(){n.isVisible(C)?(P.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(E,75)):(P.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(E,25))}var T=this.convertValueToString(C)||mxResources.get("background")||"Background",E=document.createElement("div");E.style.overflow=+"hidden";E.style.textOverflow="ellipsis";E.style.padding="2px";E.style.whiteSpace="nowrap";E.style.cursor="pointer";E.setAttribute("title",mxResources.get(n.isVisible(C)?"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";d&&(P.style.filter="invert(100%)",P.style.top="-2px");E.appendChild(P);mxUtils.write(E,T);m.appendChild(E);mxEvent.addListener(E,"click",function(){n.setVisible(C,!n.isVisible(C));G();null!=b&&b(C)});G()})(n.getChildAt(n.root,p));return m};-Graph.prototype.replacePlaceholders=function(b,d,m,n){n=[];if(null!=d){for(var v,p=0;v=this.placeholderPattern.exec(d);){var C=v[0];if(2<C.length&&"%label%"!=C&&"%tooltip%"!=C){var G=null;if(v.index>p&&"%"==d.charAt(v.index-1))G=C.substring(1);else{var T=C.substring(1,C.length-1),E={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==T)G=b.id;else if("width"===T.substring(0,5)&&this.model.isVertex(b)){var Q=this.getCellGeometry(b);null!=Q&&(G=Q.width,-5<T.length&&(G=Editor.toUnit(G,E[T.substring(6)])))}else if("height"==T.substring(0,6)&&this.model.isVertex(b))Q=this.getCellGeometry(b),null!=Q&&(G=Q.height,6<T.length&&(G=Editor.toUnit(G,E[T.substring(7)])));else if("length"==T.substring(0,6)){for(Q=b;null!=Q&&!this.model.isEdge(Q);)Q=this.model.getParent(Q);Q=this.view.getState(Q);null!=Q&&(G=Math.round(Q.length/this.view.scale),6<T.length&&(G=Editor.toUnit(G,E[T.substring(7)])))}else if(0>T.indexOf("{"))for(E=b;null==G&&null!=E;)null!=E.value&&-"object"==typeof E.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(G=E.getAttribute(T+"_"+Graph.diagramLanguage)),null==G&&(G=E.hasAttribute(T)?null!=E.getAttribute(T)?E.getAttribute(T):"":null)),E=this.model.getParent(E);null==G&&("pagecount"==T.substring(0,9)&&9<T.length||"pagenumber"==T.substring(0,10)&&10<T.length?(E=T.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=E&&(G=this.getGlobalVariable(E[1]),3<E.length&&(Q=parseInt(E[3]),G+="+"==E[2]?Q:-Q))):G=this.getGlobalVariable(T));+Graph.prototype.replacePlaceholders=function(b,d,m,n){n=[];if(null!=d){for(var v,p=0;v=this.placeholderPattern.exec(d);){var C=v[0];if(2<C.length&&"%label%"!=C&&"%tooltip%"!=C){var G=null;if(v.index>p&&"%"==d.charAt(v.index-1))G=C.substring(1);else{var T=C.substring(1,C.length-1),E={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==T)G=b.id;else if("width"===T.substring(0,5)&&this.model.isVertex(b)){var P=this.getCellGeometry(b);null!=P&&(G=P.width,+5<T.length&&(G=Editor.toUnit(G,E[T.substring(6)])))}else if("height"==T.substring(0,6)&&this.model.isVertex(b))P=this.getCellGeometry(b),null!=P&&(G=P.height,6<T.length&&(G=Editor.toUnit(G,E[T.substring(7)])));else if("length"==T.substring(0,6)){for(P=b;null!=P&&!this.model.isEdge(P);)P=this.model.getParent(P);P=this.view.getState(P);null!=P&&(G=Math.round(P.length/this.view.scale),6<T.length&&(G=Editor.toUnit(G,E[T.substring(7)])))}else if(0>T.indexOf("{"))for(E=b;null==G&&null!=E;)null!=E.value&&+"object"==typeof E.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(G=E.getAttribute(T+"_"+Graph.diagramLanguage)),null==G&&(G=E.hasAttribute(T)?null!=E.getAttribute(T)?E.getAttribute(T):"":null)),E=this.model.getParent(E);null==G&&("pagecount"==T.substring(0,9)&&9<T.length||"pagenumber"==T.substring(0,10)&&10<T.length?(E=T.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=E&&(G=this.getGlobalVariable(E[1]),3<E.length&&(P=parseInt(E[3]),G+="+"==E[2]?P:-P))):G=this.getGlobalVariable(T));null==G&&null!=m&&(G=m[T])}n.push(d.substring(p,v.index)+(null!=G?G:C));p=v.index+C.length}}n.push(d.substring(p))}return n.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var d=[],m=0;m<b.length;m++){var n=this.model.getCell(b[m].id);null!=n&&d.push(n)}this.setSelectionCells(d)}else this.clearSelection()};Graph.prototype.selectCellForEvent=function(b,d){mxEvent.isShiftDown(d)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,arguments)};Graph.prototype.selectTableRange=function(b,d){var m=!1;if(this.isTableCell(b)&&this.isTableCell(d)){var n=this.model.getParent(b),v=this.model.getParent(n),p=this.model.getParent(d);if(v==this.model.getParent(p)){b=n.getIndex(b);n=v.getIndex(n);var C=p.getIndex(d),G=v.getIndex(p);p=Math.max(n,G);d=Math.min(b,C);b=Math.max(b,C);C=[];for(n=Math.min(n,G);n<=p;n++){G=this.model.getChildAt(v,n);for(var T=d;T<=b;T++)C.push(this.model.getChildAt(G,T))}0<C.length&&(1<C.length||1<this.getSelectionCount()||@@ -2477,13 +2479,13 @@ Graph.prototype.updateShapes=function(b,d,m){this.model.beginUpdate();try{var n=this.model.isEdge(b)&&this.model.isEdge(d[p]))if(m){var C=this.model.getStyle(d[p]);if(null!=C){var G=C.split(";");0<G.length&&0>G[0].indexOf("=")&&(G=G.slice(1));this.model.setStyle(d[p],G.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[d[p]]);this.setCellStyles("points",null,[d[p]]);this.pasteStyle(v,[d[p]],null,!0)}else v=this.copyStyle(d[p]),this.model.setStyle(d[p],n),this.pasteStyle(v,[d[p]]);"1"==mxUtils.getValue(this.getCellStyle(d[p],!1),"composite","0")&&this.removeChildCells(d[p])}}finally{this.model.endUpdate()}};Graph.prototype.selectCellsForConnectVertex=function(b,d,m){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=m&&(mxEvent.isTouchEvent(d)?m.update(m.getState(this.view.getState(b[1]))):m.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var d=null;null!=this.layoutManager&&(d=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=d&&d.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(b,d){for(var m=d;null!=m.parent&&null!=m.geometry&&m.geometry.relative&&m.parent!=b.parent;)m=this.model.getParent(m);null!=m&&null!=m.parent&&m.parent==b.parent&&(d=m.parent.getIndex(m),this.model.add(m.parent,b,d))};-Graph.prototype.connectVertex=function(b,d,m,n,v,p,C,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),E=T?b:this.getCompositeParent(b),Q=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(E.geometry.x,E.geometry.y);d==mxConstants.DIRECTION_NORTH?(Q.x+=E.geometry.width/2,Q.y-=m):d==-mxConstants.DIRECTION_SOUTH?(Q.x+=E.geometry.width/2,Q.y+=E.geometry.height+m):(Q.x=d==mxConstants.DIRECTION_WEST?Q.x-m:Q.x+(E.geometry.width+m),Q.y+=E.geometry.height/2);var M=this.view.getState(this.model.getParent(b));m=this.view.scale;var c=this.view.translate;E=c.x*m;c=c.y*m;null!=M&&this.model.isVertex(M.cell)&&(E=M.x,c=M.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(Q.x+=b.parent.geometry.x,Q.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(E+Q.x*m,c+Q.y*m)).grow(40*m);p=null!=p?-this.getCells(0,0,0,0,null,null,p,null,!0):null;M=this.view.getState(b);var g=null,l=null;if(null!=p){p=p.reverse();for(var t=0;t<p.length;t++)if(!this.isCellLocked(p[t])&&!this.model.isEdge(p[t])&&p[t]!=b)if(!this.model.isAncestor(b,p[t])&&this.isContainer(p[t])&&(null==g||p[t]==this.model.getParent(b)))g=p[t];else if(null==l&&this.isCellConnectable(p[t])&&!this.model.isAncestor(p[t],b)&&!this.isSwimlane(p[t])){var B=this.view.getState(p[t]);null==M||null==B||mxUtils.intersects(M,B)||(l=p[t])}}var D=-!mxEvent.isShiftDown(n)||mxEvent.isControlDown(n)||v;D&&("1"!=urlParams.sketch||v)&&(d==mxConstants.DIRECTION_NORTH?Q.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?Q.y+=b.geometry.height/2:Q.x=d==mxConstants.DIRECTION_WEST?Q.x-b.geometry.width/2:Q.x+b.geometry.width/2);var I=[],L=l;l=g;v=mxUtils.bind(this,function(N){if(null==C||null!=N||null==l&&T){this.model.beginUpdate();try{if(null==L&&D){var K=this.getAbsoluteParent(null!=N?N:b);K=T?b:this.getCompositeParent(K);L=null!=N?N:this.duplicateCells([K],-!1)[0];null!=N&&this.addCells([L],this.model.getParent(b),null,null,null,!0);var da=this.getCellGeometry(L);null!=da&&(null!=N&&"1"==urlParams.sketch&&(d==mxConstants.DIRECTION_NORTH?Q.y-=da.height/2:d==mxConstants.DIRECTION_SOUTH?Q.y+=da.height/2:Q.x=d==mxConstants.DIRECTION_WEST?Q.x-da.width/2:Q.x+da.width/2),da.x=Q.x-da.width/2,da.y=Q.y-da.height/2);null!=g?(this.addCells([L],g,null,null,null,!0),l=null):D&&!T&&this.addCells([L],this.getDefaultParent(),null,null,null,!0)}var ja=mxEvent.isControlDown(n)&&-mxEvent.isShiftDown(n)&&D||null==l&&T?null:this.insertEdge(this.model.getParent(b),null,"",b,L,this.createCurrentEdgeStyle());null!=ja&&(I.push(ja),this.applyNewEdgeStyle(b,[ja],d),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ja,b));if(null==l&&null!=L&&null!=b.parent&&T&&d==mxConstants.DIRECTION_WEST){var ea=b.parent.getIndex(b);this.model.add(b.parent,L,ea)}null==l&&null!=L&&I.push(L);null==L&&null!=ja&&ja.geometry.setTerminalPoint(Q,!1);null!=ja&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[ja]))}finally{this.model.endUpdate()}}if(null!=G)G(I);else return I});if(null==C||null!=L||!D||null==l&&T)return v(L);C(E+Q.x*m,c+Q.y*m,v)};+Graph.prototype.connectVertex=function(b,d,m,n,v,p,C,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),E=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(E.geometry.x,E.geometry.y);d==mxConstants.DIRECTION_NORTH?(P.x+=E.geometry.width/2,P.y-=m):d==+mxConstants.DIRECTION_SOUTH?(P.x+=E.geometry.width/2,P.y+=E.geometry.height+m):(P.x=d==mxConstants.DIRECTION_WEST?P.x-m:P.x+(E.geometry.width+m),P.y+=E.geometry.height/2);var L=this.view.getState(this.model.getParent(b));m=this.view.scale;var c=this.view.translate;E=c.x*m;c=c.y*m;null!=L&&this.model.isVertex(L.cell)&&(E=L.x,c=L.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(E+P.x*m,c+P.y*m)).grow(40*m);p=null!=p?+this.getCells(0,0,0,0,null,null,p,null,!0):null;L=this.view.getState(b);var g=null,l=null;if(null!=p){p=p.reverse();for(var t=0;t<p.length;t++)if(!this.isCellLocked(p[t])&&!this.model.isEdge(p[t])&&p[t]!=b)if(!this.model.isAncestor(b,p[t])&&this.isContainer(p[t])&&(null==g||p[t]==this.model.getParent(b)))g=p[t];else if(null==l&&this.isCellConnectable(p[t])&&!this.model.isAncestor(p[t],b)&&!this.isSwimlane(p[t])){var B=this.view.getState(p[t]);null==L||null==B||mxUtils.intersects(L,B)||(l=p[t])}}var D=+!mxEvent.isShiftDown(n)||mxEvent.isControlDown(n)||v;D&&("1"!=urlParams.sketch||v)&&(d==mxConstants.DIRECTION_NORTH?P.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?P.y+=b.geometry.height/2:P.x=d==mxConstants.DIRECTION_WEST?P.x-b.geometry.width/2:P.x+b.geometry.width/2);var I=[],K=l;l=g;v=mxUtils.bind(this,function(M){if(null==C||null!=M||null==l&&T){this.model.beginUpdate();try{if(null==K&&D){var V=this.getAbsoluteParent(null!=M?M:b);V=T?b:this.getCompositeParent(V);K=null!=M?M:this.duplicateCells([V],+!1)[0];null!=M&&this.addCells([K],this.model.getParent(b),null,null,null,!0);var Q=this.getCellGeometry(K);null!=Q&&(null!=M&&"1"==urlParams.sketch&&(d==mxConstants.DIRECTION_NORTH?P.y-=Q.height/2:d==mxConstants.DIRECTION_SOUTH?P.y+=Q.height/2:P.x=d==mxConstants.DIRECTION_WEST?P.x-Q.width/2:P.x+Q.width/2),Q.x=P.x-Q.width/2,Q.y=P.y-Q.height/2);null!=g?(this.addCells([K],g,null,null,null,!0),l=null):D&&!T&&this.addCells([K],this.getDefaultParent(),null,null,null,!0)}var ja=mxEvent.isControlDown(n)&&+mxEvent.isShiftDown(n)&&D||null==l&&T?null:this.insertEdge(this.model.getParent(b),null,"",b,K,this.createCurrentEdgeStyle());null!=ja&&(I.push(ja),this.applyNewEdgeStyle(b,[ja],d),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ja,b));if(null==l&&null!=K&&null!=b.parent&&T&&d==mxConstants.DIRECTION_WEST){var ea=b.parent.getIndex(b);this.model.add(b.parent,K,ea)}null==l&&null!=K&&I.push(K);null==K&&null!=ja&&ja.geometry.setTerminalPoint(P,!1);null!=ja&&this.fireEvent(new mxEventObject("cellsInserted",+"cells",[ja]))}finally{this.model.endUpdate()}}if(null!=G)G(I);else return I});if(null==C||null!=K||!D||null==l&&T)return v(K);C(E+P.x*m,c+P.y*m,v)};Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var d=document.createElement("div"),m=[],n,v=0;v<b.length;v++)if(n=b[v],this.model.isVertex(n)||this.model.isEdge(n))this.isHtmlLabel(n)?(d.innerHTML=Graph.sanitizeHtml(this.getLabel(n)),n=mxUtils.extractTextWithWhitespace([d])):n=this.getLabel(n),n=mxUtils.trim(n.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<n.length&&m.push(n);return m.join(" ")};Graph.prototype.convertValueToString=function(b){var d=this.model.getValue(b);if(null!=d&&"object"==typeof d){var m=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){d=b.getAttribute("placeholder");for(var n=b;null==m&&null!=n;)null!=n.value&&"object"==typeof n.value&&(m=n.hasAttribute(d)?null!=n.getAttribute(d)?n.getAttribute(d):"":null),n=this.model.getParent(n)}else m=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(m=d.getAttribute("label_"+Graph.diagramLanguage)),null==m&&(m=d.getAttribute("label")||"");return m||""}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,d){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),d||(b=mxUtils.removeJavascriptProtocol(b)),b):null};@@ -2496,7 +2498,7 @@ Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?nGraph.prototype.updateAlternateBounds=function(b,d,m){if(null!=b&&null!=d&&null!=this.layoutManager&&null!=d.alternateBounds){var n=this.layoutManager.getLayout(this.model.getParent(b));null!=n&&n.constructor==mxStackLayout&&(n.horizontal?d.alternateBounds.height=0:d.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.moveCellsTo=function(b,d){if(null!=b&&null!=d){for(var m=!0,n=0;n<b.length&&m;n++)m=m&&this.model.isEdge(b[n]);n=null;if(1==b.length&&m){var v=this.getCellGeometry(b[0]);null!=v&&(n=v.getTerminalPoint(!0))}n=null!=n?n:this.getBoundingBoxFromGeometry(b,m);null!=n&&(m=Math.round(this.snap(d.x)),d=Math.round(this.snap(d.y)),this.cellsMoved(b,m-n.x,d-n.y))}};Graph.prototype.isMoveCellsEvent=function(b,d){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(d.style,"moveCells","0")};Graph.prototype.foldCells=function(b,d,m,n,v){d=null!=d?d:!1;null==m&&(m=this.getFoldableCells(this.getSelectionCells(),b));if(null!=m){this.model.beginUpdate();try{mxGraph.prototype.foldCells.apply(this,arguments);for(var p=0;p<m.length;p++){var C=this.view.getState(m[p]),G=this.getCellGeometry(m[p]);if(null!=C&&null!=G&&("1"!=mxUtils.getValue(C.style,"expandToFront","0")||this.isCellCollapsed(m[p])||this.orderCells(!1,[m[p]]),null!=this.layoutManager)){var T=0,E=0;if(G.alternateBounds)T=G.width--G.alternateBounds.width,E=G.height-G.alternateBounds.height;else{var Q=this.useCssTransforms?1:this.view.scale;T=Math.round(G.width-C.width/Q);E=Math.round(G.height-C.height/Q)}if(0!=E||0!=T){var M=this.model.getParent(m[p]),c=this.layoutManager.getLayout(M);null==c?null!=v&&this.isMoveCellsEvent(v,C)&&this.moveSiblings(C,M,T,E):null!=v&&mxEvent.isAltDown(v)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(M,c,T,E)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}};+G.alternateBounds.width,E=G.height-G.alternateBounds.height;else{var P=this.useCssTransforms?1:this.view.scale;T=Math.round(G.width-C.width/P);E=Math.round(G.height-C.height/P)}if(0!=E||0!=T){var L=this.model.getParent(m[p]),c=this.layoutManager.getLayout(L);null==c?null!=v&&this.isMoveCellsEvent(v,C)&&this.moveSiblings(C,L,T,E):null!=v&&mxEvent.isAltDown(v)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(L,c,T,E)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}};Graph.prototype.moveSiblings=function(b,d,m,n){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,d,!0,!0);for(d=0;d<v.length;d++)if(v[d]!=b.cell){var p=this.view.getState(v[d]),C=this.getCellGeometry(v[d]);null!=p&&null!=C&&(C=C.clone(),C.translate(Math.round(m*Math.max(0,Math.min(1,(p.x-b.x)/b.width))),Math.round(n*Math.max(0,Math.min(1,(p.y-b.y)/b.height)))),this.model.setGeometry(v[d],C))}}finally{this.model.endUpdate()}};Graph.prototype.resizeParentStacks=function(b,d,m,n){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var v=d.horizontal;null!=b&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==v&&!d.resizeLast;){var p=this.getCellGeometry(b),C=this.view.getState(b);null!=C&&null!=p&&(p=p.clone(),d.horizontal?p.width+=m+Math.min(0,C.width/this.view.scale-p.width):p.height+=n+Math.min(0,C.height/this.view.scale-p.height),this.model.setGeometry(b,p));b=this.model.getParent(b);d=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var d=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=d.container:"1"==d.container};Graph.prototype.isCellConnectable=function(b){var d=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=d.connectable?"0"!=d.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};@@ -2538,7 +2540,7 @@ HoverIcons.prototype.click=function(b,d,m){var n=m.getEvent(),v=m.getGraphX(),p=HoverIcons.prototype.execute=function(b,d,m){m=m.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,d,this.graph.defaultEdgeLength,m,this.graph.isCloneEvent(m),this.graph.isCloneEvent(m)),m,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 d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(d=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var m=null;null!=d&&(b.x-=d.horizontalOffset/2,b.y-=d.verticalOffset/2,b.width+=d.horizontalOffset,b.height+=d.verticalOffset,null!=d.rotationShape&&null!=d.rotationShape.node&&"hidden"!=d.rotationShape.node.style.visibility&&"none"!=d.rotationShape.node.style.display&&null!=d.rotationShape.boundingBox&&-(m=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(G,T,E){if(null!=m){var Q=new mxRectangle(T,E,G.clientWidth,G.clientHeight);mxUtils.intersects(Q,m)&&(G==this.arrowUp?E-=Q.y+Q.height-m.y:G==this.arrowRight?T+=m.x+m.width-Q.x:G==this.arrowDown?E+=m.y+m.height-Q.y:G==this.arrowLeft&&(T-=Q.x+Q.width-m.x))}G.style.left=T+"px";G.style.top=E+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-+(m=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(G,T,E){if(null!=m){var P=new mxRectangle(T,E,G.clientWidth,G.clientHeight);mxUtils.intersects(P,m)&&(G==this.arrowUp?E-=P.y+P.height-m.y:G==this.arrowRight?T+=m.x+m.width-P.x:G==this.arrowDown?E+=m.y+m.height-P.y:G==this.arrowLeft&&(T-=P.x+P.width-m.x))}G.style.left=T+"px";G.style.top=E+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-this.triangleUp.height-this.tolerance));d(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));d(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));d(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){d=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());var n=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!=d&&d==n&&n==v&&v==b&&(b=v=n=d=null);var p=this.graph.getCellGeometry(this.currentState.cell),C=mxUtils.bind(this,function(G,T){var E=this.graph.model.isVertex(G)&&this.graph.getCellGeometry(G);null==G||this.graph.model.isAncestor(G,this.currentState.cell)||this.graph.isSwimlane(G)||!(null==E||null==p||E.height<3*p.height&&E.width<3*p.width)?T.style.visibility="visible":T.style.visibility="hidden"});C(d,this.arrowRight);C(n,this.arrowLeft);C(v,this.arrowUp);C(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")),@@ -2560,8 +2562,10 @@ InlineToolbar.prototype.getEdgeMidpoint=function(b){b=b.absolutePoints;if(null==2,(n.y+b.y)/2):null};InlineToolbar.prototype.show=function(){this.updateIcons();this.toolbar.style.display="block";this.repaint()};InlineToolbar.prototype.hide=function(){this.toolbar.style.display="none"};InlineToolbar.prototype.supportsCurvedBend=function(b){b=mxUtils.getValue(b,mxConstants.STYLE_SHAPE,null);return null==b||"connector"==b||"filledEdge"==b||"wire"==b||"pipe"==b};InlineToolbar.prototype.updateIcons=function(){if(null!=this.currentState){var b=this.graph.getCurrentCellStyle(this.currentState.cell),d=this.editorUi.getImageForEdgeStyle(b);"arrow"==b[mxConstants.STYLE_SHAPE]&&(d=Format.straightImage.src);this.icon.style.backgroundImage="url("+d+")";d=this.graph.view.getState(this.currentState.cell);d=this.supportsCurvedBend(b)||null!=d&&this.graph.isRoundedState(d);this.bendSep.style.display=d?"inline-block":"none";this.bendIcon.style.display=d?"inline-block":"none";d&&("1"==mxUtils.getValue(b,mxConstants.STYLE_CURVED,null)?this.bendIcon.style.backgroundImage="url("+Format.curvedBendImage.src+")":"1"==mxUtils.getValue(b,mxConstants.STYLE_ROUNDED,null)?this.bendIcon.style.backgroundImage="url("+Format.roundedBendImage.src+")":this.bendIcon.style.backgroundImage="url("+Format.sharpBendImage.src+")")}};-InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var b=this.graph.view.getState(this.currentState.cell);if(null!=b){this.currentState=b;this.updateIcons();var d=this.getEdgeMidpoint(b);if(null!=d){var m="none"!=this.bendIcon.style.display?2*this.iconSize+1:this.iconSize,n=this.iconSize,v=d.x-m/2,p=d.y-n-this.offset;b=this.graph.selectionCellsHandler.getHandler(b.cell);if(null!=b){var C=(b.bends||[]).concat(b.virtualBends||[]);b=mxUtils.bind(this,-function(T,E){T=new mxRectangle(Math.round(T)-8,Math.round(E)-8,m+16,n+16);for(E=0;E<C.length;E++)if(null!=C[E]&&null!=C[E].bounds&&"hidden"!==C[E].node.style.visibility&&mxUtils.intersects(T,C[E].bounds))return!0;return!1});if(b(v,p)){var G=d.y+this.offset;if(b(v,G))for(G=this.offset+8;100>G;G+=8)if(!b(v,d.y-n-G)){p=d.y-n-G;break}else{if(!b(v,d.y+G)){p=d.y+G;break}}else p=G}}this.toolbar.style.left=Math.round(v)+"px";this.toolbar.style.top=Math.round(p)+"px"}}}};+InlineToolbar.prototype.segmentIntersectsRect=function(b,d,m,n,v,p,C,G){m-=b;n-=d;n=[-m,m,-n,n];b=[b-v,v+C-b,d-p,p+G-d];d=0;v=1;for(p=0;4>p;p++)if(0==n[p]){if(0>b[p])return!1}else if(C=b[p]/n[p],0>n[p]?d=Math.max(d,C):v=Math.min(v,C),d>v)return!1;return!0};+InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var b=this.graph.view.getState(this.currentState.cell);if(null!=b){this.currentState=b;this.updateIcons();var d=this.getEdgeMidpoint(b);if(null!=d){var m="none"!=this.bendIcon.style.display?2*this.iconSize+1:this.iconSize,n=this.iconSize,v=d.x-m/2,p=d.y-n-this.offset,C=this.graph.selectionCellsHandler.getHandler(b.cell);if(null!=C){var G=(C.bends||[]).concat(C.virtualBends||[]);C=mxUtils.bind(this,+function(c,g){c=new mxRectangle(Math.round(c)-8,Math.round(g)-8,m+16,n+16);for(g=0;g<G.length;g++)if(null!=G[g]&&null!=G[g].bounds&&"hidden"!==G[g].node.style.visibility&&mxUtils.intersects(c,G[g].bounds))return!0;var l=b.absolutePoints;if(null!=l)for(g=1;g<l.length;g++)if(null!=l[g]&&null!=l[g-1]&&this.segmentIntersectsRect(l[g-1].x,l[g-1].y,l[g].x,l[g].y,c.x,c.y,c.width,c.height))return!0;return!1});if(C(v,p)){var T=d.y+this.offset,E=!1;C(v,T)||(p=T,E=!0);if(!E){T=d.y-n/2;var P=d.x-m-this.offset,+L=d.x+this.offset;C(P,T)?C(L,T)||(v=L,p=T,E=!0):(v=P,p=T,E=!0)}if(!E)for(T=d.y-n/2,E=this.offset+8;100>E;E+=8)if(!C(v,d.y-n-E)){p=d.y-n-E;break}else if(!C(v,d.y+E)){p=d.y+E;break}else if(!C(d.x-m-E,T)){v=d.x-m-E;p=T;break}else if(!C(d.x+E,T)){v=d.x+E;p=T;break}}}this.toolbar.style.left=Math.round(v)+"px";this.toolbar.style.top=Math.round(p)+"px"}}}};InlineToolbar.prototype.showMenu=function(b){var d=this.editorUi;d.hideCurrentMenu();d.showPopupMenu(mxUtils.bind(this,function(m,n){d.menus.addMenu("line",m,n)}),mxEvent.getClientX(b),mxEvent.getClientY(b),b)};InlineToolbar.prototype.showBendMenu=function(b){var d=this.editorUi;d.hideCurrentMenu();d.showPopupMenu(mxUtils.bind(this,function(m,n){var v=d.menus,p=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED];Format.processMenuIcon(v.edgeStyleChange(m,"",p,["0","0"],null,n,!1,Format.sharpBendImage.src)).setAttribute("title",mxResources.get("sharp"));Format.processMenuIcon(v.edgeStyleChange(m,"",p,["1","0"],null,n,!1,Format.roundedBendImage.src)).setAttribute("title",mxResources.get("rounded"));if(null!=this.currentState){var C=this.graph.getCurrentCellStyle(this.currentState.cell);this.supportsCurvedBend(C)&&Format.processMenuIcon(v.edgeStyleChange(m,"",p,["0","1"],null,n,!1,Format.curvedBendImage.src)).setAttribute("title",mxResources.get("curved"))}}),mxEvent.getClientX(b),mxEvent.getClientY(b),b)};@@ -2574,41 +2578,41 @@ Graph.prototype.setTableValues=function(b,d,m){for(var n=this.model.getChildCellGraph.prototype.createCrossFunctionalSwimlane=function(b,d,m,n,v,p,C,G,T){m=null!=m?m:120;n=null!=n?n:120;C=null!=C?C:"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,d*m,b*n,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;C=this.createVertex(null,null,"",0,p,d*m+p,n,C);v.insert(this.createParent(C,this.createVertex(null,null,"",p,0,m,n,G),d,m,0));return 1<b?(C.geometry.y=n+p,this.createParent(v,this.createParent(C,this.createVertex(null,null,"",p,0,m,n,T),d,m,0),b-1,0,n)):v};-Graph.prototype.visitTableCells=function(b,d){var m=null,n=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<n.length;v++){for(var p=this.getActualStartSize(n[v],!0),C=this.model.getChildCells(n[v],!0),G=this.getCellStyle(n[v],!0),T=null,E=[],Q=0;Q<C.length;Q++){var M=this.getCellGeometry(C[Q]),c={cell:C[Q],rospan:1,colspan:1,row:v,col:Q,geo:M};M=null!=M.alternateBounds?M.alternateBounds:M;c.point=new mxPoint(M.width+(null!=T?T.point.x:b.x+p.x),M.height+(null!=m&&null!=-m[0]?m[0].point.y:b.y+p.y));c.actual=c;null!=m&&null!=m[Q]&&1<m[Q].rowspan?(c.rowspan=m[Q].rowspan-1,c.colspan=m[Q].colspan,c.actual=m[Q].actual):null!=T&&1<T.colspan?(c.rowspan=T.rowspan,c.colspan=T.colspan-1,c.actual=T.actual):(T=this.getCurrentCellStyle(C[Q],!0),null!=T&&(c.rowspan=parseInt(T.rowspan||1),c.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;d(c,C.length,+Graph.prototype.visitTableCells=function(b,d){var m=null,n=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<n.length;v++){for(var p=this.getActualStartSize(n[v],!0),C=this.model.getChildCells(n[v],!0),G=this.getCellStyle(n[v],!0),T=null,E=[],P=0;P<C.length;P++){var L=this.getCellGeometry(C[P]),c={cell:C[P],rospan:1,colspan:1,row:v,col:P,geo:L};L=null!=L.alternateBounds?L.alternateBounds:L;c.point=new mxPoint(L.width+(null!=T?T.point.x:b.x+p.x),L.height+(null!=m&&null!=+m[0]?m[0].point.y:b.y+p.y));c.actual=c;null!=m&&null!=m[P]&&1<m[P].rowspan?(c.rowspan=m[P].rowspan-1,c.colspan=m[P].colspan,c.actual=m[P].actual):null!=T&&1<T.colspan?(c.rowspan=T.rowspan,c.colspan=T.colspan-1,c.actual=T.actual):(T=this.getCurrentCellStyle(C[P],!0),null!=T&&(c.rowspan=parseInt(T.rowspan||1),c.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;d(c,C.length,n.length,b.x+(T?p.x:0),b.y+(T?p.y:0));E.push(c);T=c}m=E}};Graph.prototype.getTableLines=function(b,d,m){var n=[],v=[];(d||m)&&this.visitTableCells(b,mxUtils.bind(this,function(p,C,G,T,E){d&&p.row<G-1&&(null==n[p.row]&&(n[p.row]=[new mxPoint(T,p.point.y)]),1<p.rowspan&&n[p.row].push(null),n[p.row].push(p.point));m&&p.col<C-1&&(null==v[p.col]&&(v[p.col]=[new mxPoint(p.point.x,E)]),1<p.colspan&&v[p.col].push(null),v[p.col].push(p.point))}));return n.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,d,m){m=null!=m?m:!0;var n=this.getModel();n.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=d;n.setGeometry(b,v);var p=n.getParent(b),C=n.getChildCells(p,!0);if(!m){var G=mxUtils.indexOf(C,b);if(G<C.length-1){var T=C[G+1],E=this.getCellGeometry(T);null!=E&&(E=E.clone(),E.y+=d,E.height-=d,n.setGeometry(T,E))}}var Q=this.getCellGeometry(p);null!=Q&&(m||(m=b==C[C.length-1]),m&&(Q=Q.clone(),Q.height+=d,n.setGeometry(p,Q)))}}finally{n.endUpdate()}};-Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var n=this.getModel(),v=n.getParent(b),p=n.getParent(v),C=n.getChildCells(v,!0);b=mxUtils.indexOf(C,b);var G=b==C.length-1;n.beginUpdate();try{for(var T=n.getChildCells(p,!0),E=0;E<T.length;E++){v=T[E];C=n.getChildCells(v,!0);var Q=C[b],M=this.getCellGeometry(Q);null!=M&&(M=M.clone(),M.width+=d,null!=M.alternateBounds&&(M.alternateBounds.width+=d),n.setGeometry(Q,M));b<C.length-1&&(Q=C[b+1],M=this.getCellGeometry(Q),null!=M&&(M=M.clone(),-M.x+=d,m||(M.width-=d,null!=M.alternateBounds&&(M.alternateBounds.width-=d)),n.setGeometry(Q,M)))}if(G||m){var c=this.getCellGeometry(p);null!=c&&(c=c.clone(),c.width+=d,n.setGeometry(p,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{n.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,d,m){m=null!=m?m:!0;var n=this.getModel();n.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=d;n.setGeometry(b,v);var p=n.getParent(b),C=n.getChildCells(p,!0);if(!m){var G=mxUtils.indexOf(C,b);if(G<C.length-1){var T=C[G+1],E=this.getCellGeometry(T);null!=E&&(E=E.clone(),E.y+=d,E.height-=d,n.setGeometry(T,E))}}var P=this.getCellGeometry(p);null!=P&&(m||(m=b==C[C.length-1]),m&&(P=P.clone(),P.height+=d,n.setGeometry(p,P)))}}finally{n.endUpdate()}};+Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var n=this.getModel(),v=n.getParent(b),p=n.getParent(v),C=n.getChildCells(v,!0);b=mxUtils.indexOf(C,b);var G=b==C.length-1;n.beginUpdate();try{for(var T=n.getChildCells(p,!0),E=0;E<T.length;E++){v=T[E];C=n.getChildCells(v,!0);var P=C[b],L=this.getCellGeometry(P);null!=L&&(L=L.clone(),L.width+=d,null!=L.alternateBounds&&(L.alternateBounds.width+=d),n.setGeometry(P,L));b<C.length-1&&(P=C[b+1],L=this.getCellGeometry(P),null!=L&&(L=L.clone(),+L.x+=d,m||(L.width-=d,null!=L.alternateBounds&&(L.alternateBounds.width-=d)),n.setGeometry(P,L)))}if(G||m){var c=this.getCellGeometry(p);null!=c&&(c=c.clone(),c.width+=d,n.setGeometry(p,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{n.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,d){for(var m=0,n=0;n<b.length;n++)if(!this.isVertexIgnored(b[n])){var v=this.graph.getCellGeometry(b[n]);null!=v&&(m+=d?v.width:v.height)}return m};TableLayout.prototype.getRowLayout=function(b,d){var m=this.graph.model.getChildCells(b,!0),n=this.graph.getActualStartSize(b,!0);b=this.getSize(m,!0);d=d-n.x-n.width;var v=[];n=n.x;for(var p=0;p<m.length;p++){var C=this.graph.getCellGeometry(m[p]);null!=C&&(n+=(null!=C.alternateBounds?C.alternateBounds.width:C.width)*d/b,v.push(Math.round(n)))}return v};TableLayout.prototype.layoutRow=function(b,d,m,n){var v=this.graph.getModel(),p=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var C=b.x,G=0;null!=d&&(d=d.slice(),d.splice(0,0,b.x));for(var T=0;T<p.length;T++){var E=this.graph.getCellGeometry(p[T]);null!=E&&(E=E.clone(),E.y=b.y,E.height=m-b.y-b.height,null!=d?(E.x=d[T],E.width=d[T+1]-E.x,T==p.length-1&&T<d.length-2&&(E.width=n-E.x-b.x-b.width)):(E.x=C,C+=E.width,T==p.length-1?E.width=n-b.x-b.width-G:G+=E.width),E.alternateBounds=new mxRectangle(0,0,E.width,E.height),v.setGeometry(p[T],E))}return G};-TableLayout.prototype.execute=function(b){if(null!=b){var d=this.graph.getActualStartSize(b,!0),m=this.graph.getCellGeometry(b),n=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(n,"resizeLastRow","0"),p="1"==mxUtils.getValue(n,"resizeLast","0");n="1"==mxUtils.getValue(n,"fixedRows","0");var C=this.graph.getModel(),G=0;C.beginUpdate();try{for(var T=m.height-d.y-d.height,E=m.width-d.x-d.width,Q=C.getChildCells(b,!0),M=0;M<Q.length;M++)C.setVisible(Q[M],!0);var c=this.getSize(Q,!1);if(0<T&&0<E&&0<-Q.length&&0<c){if(v){var g=this.graph.getCellGeometry(Q[Q.length-1]);null!=g&&(g=g.clone(),g.height=T-c+g.height,C.setGeometry(Q[Q.length-1],g))}var l=p?null:this.getRowLayout(Q[0],E),t=[],B=d.y;for(M=0;M<Q.length;M++)g=this.graph.getCellGeometry(Q[M]),null!=g&&(g=g.clone(),g.x=d.x,g.width=E,g.y=Math.round(B),B=v||n?B+g.height:B+g.height/c*T,g.height=Math.round(B)-g.y,C.setGeometry(Q[M],g)),G=Math.max(G,this.layoutRow(Q[M],l,g.height,E,t));n&&T<c&&(m=m.clone(),m.height=B+d.height,C.setGeometry(b,-m));p&&E<G+Graph.minTableColumnWidth&&(m=m.clone(),m.width=G+d.width+d.x+Graph.minTableColumnWidth,C.setGeometry(b,m));this.graph.visitTableCells(b,mxUtils.bind(this,function(D){C.setVisible(D.cell,D.actual.cell==D.cell);if(D.actual.cell!=D.cell){if(D.actual.row==D.row){var I=null!=D.geo.alternateBounds?D.geo.alternateBounds:D.geo;D.actual.geo.width+=I.width}D.actual.col==D.col&&(I=null!=D.geo.alternateBounds?D.geo.alternateBounds:D.geo,D.actual.geo.height+=I.height)}}))}else for(M=0;M<Q.length;M++)C.setVisible(Q[M],+TableLayout.prototype.execute=function(b){if(null!=b){var d=this.graph.getActualStartSize(b,!0),m=this.graph.getCellGeometry(b),n=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(n,"resizeLastRow","0"),p="1"==mxUtils.getValue(n,"resizeLast","0");n="1"==mxUtils.getValue(n,"fixedRows","0");var C=this.graph.getModel(),G=0;C.beginUpdate();try{for(var T=m.height-d.y-d.height,E=m.width-d.x-d.width,P=C.getChildCells(b,!0),L=0;L<P.length;L++)C.setVisible(P[L],!0);var c=this.getSize(P,!1);if(0<T&&0<E&&0<+P.length&&0<c){if(v){var g=this.graph.getCellGeometry(P[P.length-1]);null!=g&&(g=g.clone(),g.height=T-c+g.height,C.setGeometry(P[P.length-1],g))}var l=p?null:this.getRowLayout(P[0],E),t=[],B=d.y;for(L=0;L<P.length;L++)g=this.graph.getCellGeometry(P[L]),null!=g&&(g=g.clone(),g.x=d.x,g.width=E,g.y=Math.round(B),B=v||n?B+g.height:B+g.height/c*T,g.height=Math.round(B)-g.y,C.setGeometry(P[L],g)),G=Math.max(G,this.layoutRow(P[L],l,g.height,E,t));n&&T<c&&(m=m.clone(),m.height=B+d.height,C.setGeometry(b,+m));p&&E<G+Graph.minTableColumnWidth&&(m=m.clone(),m.width=G+d.width+d.x+Graph.minTableColumnWidth,C.setGeometry(b,m));this.graph.visitTableCells(b,mxUtils.bind(this,function(D){C.setVisible(D.cell,D.actual.cell==D.cell);if(D.actual.cell!=D.cell){if(D.actual.row==D.row){var I=null!=D.geo.alternateBounds?D.geo.alternateBounds:D.geo;D.actual.geo.width+=I.width}D.actual.col==D.col&&(I=null!=D.geo.alternateBounds?D.geo.alternateBounds:D.geo,D.actual.geo.height+=I.height)}}))}else for(L=0;L<P.length;L++)C.setVisible(P[L],!1)}finally{C.endUpdate()}}};-(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(M,c){c=null!=c?c:!0;var g=this.getState(M);null!=g&&c&&this.graph.model.isEdge(g.cell)&&null!=g.style&&1!=g.style[mxConstants.STYLE_CURVED]&&!g.invalid&&this.updateLineJumps(g)&&this.graph.cellRenderer.redraw(g,!1,this.isRendering());if(null!=g&&g.invalid){if(this.graph.showLinkIcons){g=-this.graph.getLinkForCell(M);var l=null!=g&&0<g.length,t=!1;if(null!=M.overlays)for(g=0;g<M.overlays.length;g++)if(M.overlays[g].isLinkOverlay){t=!0;break}if(l&&!t)g=this.graph.createLinkOverlay(M),null!=g&&(null==M.overlays&&(M.overlays=[]),M.overlays.push(g));else if(!l&&t){for(g=M.overlays.length-1;0<=g;g--)M.overlays[g].isLinkOverlay&&M.overlays.splice(g,1);0==M.overlays.length&&(M.overlays=null)}}else if(null!=M.overlays){for(g=M.overlays.length-1;0<=g;g--)M.overlays[g].isLinkOverlay&&M.overlays.splice(g,-1);0==M.overlays.length&&(M.overlays=null)}if(this.graph.showTooltipIcons){g=this.graph.convertValueToTooltip(M);l=null!=g&&0<g.length;t=!1;if(null!=M.overlays)for(g=0;g<M.overlays.length;g++)if(M.overlays[g].isTooltipOverlay){t=!0;break}if(l&&!t)g=this.graph.createTooltipOverlay(M),null!=g&&(null==M.overlays&&(M.overlays=[]),M.overlays.push(g));else if(!l&&t){for(g=M.overlays.length-1;0<=g;g--)M.overlays[g].isTooltipOverlay&&M.overlays.splice(g,1);0==M.overlays.length&&(M.overlays=null)}}else if(null!=-M.overlays){for(g=M.overlays.length-1;0<=g;g--)M.overlays[g].isTooltipOverlay&&M.overlays.splice(g,1);0==M.overlays.length&&(M.overlays=null)}}g=d.apply(this,arguments);null!=g&&c&&this.graph.model.isEdge(g.cell)&&null!=g.style&&1!=g.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(g);return g};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(M){var c=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=c)for(var g=null,l=0;l<c.length;l++)if("hidden"!=c[l].getAttribute("visibility")){if(!(null!=g&&g!=c[l].getAttribute("d")||null!=M&&0!=--M))return c[l]}else null==g&&(g=c[l].getAttribute("d"));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 m=mxShape.prototype.paint;mxShape.prototype.paint=function(M){m.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var n=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(M){M=n.apply(this,arguments);null!=this.state&&(M.adaptiveColors=this.state.view.graph.getAdaptiveColors());return M};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=-function(M,c){return v.apply(this,arguments)||null!=M.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.routedPoints,M.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(M){p.apply(this,arguments);this.graph.model.isEdge(M.cell)&&1!=M.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(M)};mxGraphView.prototype.updateLineJumps=function(M){var c=M.absolutePoints;if(Graph.lineJumpsEnabled){var g=null!=M.routedPoints,l=null;if(null!=c&&-null!=this.validEdges&&"none"!==mxUtils.getValue(M.style,"jumpStyle","none")){var t=function(V,k,x){var J=new mxPoint(k,x);J.type=V;l.push(J);J=null!=M.routedPoints?M.routedPoints[l.length-1]:null;return null==J||J.type!=V||J.x!=k||J.y!=x},B=.5*this.scale;g=!1;l=[];for(var D=0;D<c.length-1;D++){for(var I=c[D+1],L=c[D],N=[],K=c[D+2];D<c.length-2&&mxUtils.ptSegDistSq(L.x,L.y,K.x,K.y,I.x,I.y)<1*this.scale*this.scale;)I=K,D++,K=c[D+2];g=t(0,L.x,L.y)||g;for(var da=0;da<this.validEdges.length;da++){var ja=-this.validEdges[da],ea=ja.absolutePoints;if(null!=ea&&mxUtils.intersects(M,ja)&&"1"!=ja.style.noJump){var ca=null;for(ja=0;ja<ea.length-1;ja++){var fa=ea[ja+1],la=ea[ja];for(K=ea[ja+2];ja<ea.length-2&&mxUtils.ptSegDistSq(la.x,la.y,K.x,K.y,fa.x,fa.y)<1*this.scale*this.scale;)fa=K,ja++,K=ea[ja+2];var ka=mxUtils.intersection(L.x,L.y,I.x,I.y,la.x,la.y,fa.x,fa.y);if(null!=ka&&(Math.abs(ka.x-L.x)>B||Math.abs(ka.y-L.y)>B)&&(Math.abs(ka.x-I.x)>B||Math.abs(ka.y-I.y)>B)&&(null==ca||mxUtils.ptLineDist(L.x,L.y,-I.x,I.y,ca.x,ca.y)>B||mxUtils.ptLineDist(L.x,L.y,I.x,I.y,la.x,la.y)>B)&&(null==K||mxUtils.ptLineDist(L.x,L.y,I.x,I.y,K.x,K.y)>B||mxUtils.ptLineDist(L.x,L.y,I.x,I.y,fa.x,fa.y)>B)){K=ka.x-L.x;ca=ka.y-L.y;ka={distSq:K*K+ca*ca,x:ka.x,y:ka.y};for(K=0;K<N.length;K++)if(N[K].distSq>ka.distSq){N.splice(K,0,ka);ka=null;break}null==ka||0!=N.length&&N[N.length-1].x===ka.x&&N[N.length-1].y===ka.y||N.push(ka)}ca=la}}}for(ja=0;ja<N.length;ja++)g=t(1,N[ja].x,N[ja].y)||g}ka=c[c.length-1];g=t(0,ka.x,ka.y)||g}M.routedPoints=-l;return g}return!1};var C=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(M,c,g){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)C.apply(this,arguments);else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,t=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,-B=mxUtils.getValue(this.style,"jumpStyle","none"),D=!0,I=null,L=null,N=[],K=null;M.begin();for(var da=0;da<this.state.routedPoints.length;da++){var ja=this.state.routedPoints[da],ea=new mxPoint(ja.x/this.scale,ja.y/this.scale);0==da?ea=c[0]:da==this.state.routedPoints.length-1&&(ea=c[c.length-1]);var ca=!1;if(null!=I&&1==ja.type){var fa=this.state.routedPoints[da+1];ja=fa.x/this.scale-ea.x;fa=fa.y/this.scale-ea.y;ja=ja*ja+fa*fa;null==K&&(K=new mxPoint(ea.x-I.x,ea.y-I.y),L=Math.sqrt(K.x*K.x+K.y*K.y),-0<L?(K.x=K.x*t/L,K.y=K.y*t/L):K=null);ja>t*t&&0<L&&(ja=I.x-ea.x,fa=I.y-ea.y,ja=ja*ja+fa*fa,ja>t*t&&(ca=new mxPoint(ea.x-K.x,ea.y-K.y),ja=new mxPoint(ea.x+K.x,ea.y+K.y),N.push(ca),this.addPoints(M,N,g,l,!1,null,D),N=0>Math.round(K.x)||0==Math.round(K.x)&&0>=Math.round(K.y)?1:-1,D=!1,"sharp"==B?(M.lineTo(ca.x-K.y*N,ca.y+K.x*N),M.lineTo(ja.x-K.y*N,ja.y+K.x*N),M.lineTo(ja.x,ja.y)):"line"==B?(M.moveTo(ca.x+K.y*N,ca.y-K.x*N),M.lineTo(ca.x-K.y*N,ca.y+K.x*N),M.moveTo(ja.x-K.y*N,ja.y+K.x*N),M.lineTo(ja.x+-K.y*N,ja.y-K.x*N),M.moveTo(ja.x,ja.y)):"arc"==B?(N*=1.3,M.curveTo(ca.x-K.y*N,ca.y+K.x*N,ja.x-K.y*N,ja.y+K.x*N,ja.x,ja.y)):(M.moveTo(ja.x,ja.y),D=!0),N=[ja],ca=!0))}else K=null;ca||(N.push(ea),I=ea)}this.addPoints(M,N,g,l,!1,null,D);M.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(M,c,g,l){return null!=c&&"centerPerimeter"==c.style[mxConstants.STYLE_PERIMETER]?new mxPoint(c.getCenterX(),c.getCenterY()):G.apply(this,arguments)};var T=-mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(M,c,g,l){if(null==c||null==M||"1"!=c.style.snapToPoint&&"1"!=M.style.snapToPoint)T.apply(this,arguments);else{c=this.getTerminalPort(M,c,l);var t=this.getNextPoint(M,g,l),B=this.graph.isOrthogonal(M),D=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),I=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=D){var L=Math.cos(-D),N=Math.sin(-D);t=mxUtils.getRotatedPoint(t,L,N,I)}L=-parseFloat(M.style[mxConstants.STYLE_PERIMETER_SPACING]||0);L+=parseFloat(M.style[l?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);t=this.getPerimeterPoint(c,t,0==D&&B,L);0!=D&&(L=Math.cos(D),N=Math.sin(D),t=mxUtils.getRotatedPoint(t,L,N,I));M.setAbsoluteTerminalPoint(this.snapToAnchorPoint(M,c,g,l,t),l)}};mxGraphView.prototype.snapToAnchorPoint=function(M,c,g,l,t){if(null!=c&&null!=M){M=this.graph.getAllConnectionConstraints(c);l=g=null;if(null!=M)for(var B=-0;B<M.length;B++){var D=this.graph.getConnectionPoint(c,M[B]);if(null!=D){var I=(D.x-t.x)*(D.x-t.x)+(D.y-t.y)*(D.y-t.y);if(null==l||I<l)g=D,l=I}}null!=g&&(t=g)}return t};var E=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(M,c,g){var l=E.apply(this,arguments);"1"==M.getAttribute("placeholders")&&null!=g.state&&(l=g.state.view.graph.replacePlaceholders(g.state.cell,l));return l};var Q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=-function(M){if(null!=M.style&&"undefined"!==typeof pako){var c=mxUtils.getValue(M.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"string"===typeof c&&"stencil("==c.substring(0,8))try{var g=c.substring(8,c.length-1),l=mxUtils.parseXml(Graph.decompress(g));return new mxShape(new mxStencil(l.documentElement))}catch(t){null!=window.console&&console.log("Error in shape: "+t)}}return Q.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};+(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(L,c){c=null!=c?c:!0;var g=this.getState(L);null!=g&&c&&this.graph.model.isEdge(g.cell)&&null!=g.style&&1!=g.style[mxConstants.STYLE_CURVED]&&!g.invalid&&this.updateLineJumps(g)&&this.graph.cellRenderer.redraw(g,!1,this.isRendering());if(null!=g&&g.invalid){if(this.graph.showLinkIcons){g=+this.graph.getLinkForCell(L);var l=null!=g&&0<g.length,t=!1;if(null!=L.overlays)for(g=0;g<L.overlays.length;g++)if(L.overlays[g].isLinkOverlay){t=!0;break}if(l&&!t)g=this.graph.createLinkOverlay(L),null!=g&&(null==L.overlays&&(L.overlays=[]),L.overlays.push(g));else if(!l&&t){for(g=L.overlays.length-1;0<=g;g--)L.overlays[g].isLinkOverlay&&L.overlays.splice(g,1);0==L.overlays.length&&(L.overlays=null)}}else if(null!=L.overlays){for(g=L.overlays.length-1;0<=g;g--)L.overlays[g].isLinkOverlay&&L.overlays.splice(g,+1);0==L.overlays.length&&(L.overlays=null)}if(this.graph.showTooltipIcons){g=this.graph.convertValueToTooltip(L);l=null!=g&&0<g.length;t=!1;if(null!=L.overlays)for(g=0;g<L.overlays.length;g++)if(L.overlays[g].isTooltipOverlay){t=!0;break}if(l&&!t)g=this.graph.createTooltipOverlay(L),null!=g&&(null==L.overlays&&(L.overlays=[]),L.overlays.push(g));else if(!l&&t){for(g=L.overlays.length-1;0<=g;g--)L.overlays[g].isTooltipOverlay&&L.overlays.splice(g,1);0==L.overlays.length&&(L.overlays=null)}}else if(null!=+L.overlays){for(g=L.overlays.length-1;0<=g;g--)L.overlays[g].isTooltipOverlay&&L.overlays.splice(g,1);0==L.overlays.length&&(L.overlays=null)}}g=d.apply(this,arguments);null!=g&&c&&this.graph.model.isEdge(g.cell)&&null!=g.style&&1!=g.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(g);return g};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(L){var c=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=c)for(var g=null,l=0;l<c.length;l++)if("hidden"!=c[l].getAttribute("visibility")){if(!(null!=g&&g!=c[l].getAttribute("d")||null!=L&&0!=--L))return c[l]}else null==g&&(g=c[l].getAttribute("d"));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 m=mxShape.prototype.paint;mxShape.prototype.paint=function(L){m.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var n=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(L){L=n.apply(this,arguments);null!=this.state&&(L.adaptiveColors=this.state.view.graph.getAdaptiveColors());return L};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=+function(L,c){return v.apply(this,arguments)||null!=L.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.routedPoints,L.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(L){p.apply(this,arguments);this.graph.model.isEdge(L.cell)&&1!=L.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(L)};mxGraphView.prototype.updateLineJumps=function(L){var c=L.absolutePoints;if(Graph.lineJumpsEnabled){var g=null!=L.routedPoints,l=null;if(null!=c&&+null!=this.validEdges&&"none"!==mxUtils.getValue(L.style,"jumpStyle","none")){var t=function(W,k,y){var J=new mxPoint(k,y);J.type=W;l.push(J);J=null!=L.routedPoints?L.routedPoints[l.length-1]:null;return null==J||J.type!=W||J.x!=k||J.y!=y},B=.5*this.scale;g=!1;l=[];for(var D=0;D<c.length-1;D++){for(var I=c[D+1],K=c[D],M=[],V=c[D+2];D<c.length-2&&mxUtils.ptSegDistSq(K.x,K.y,V.x,V.y,I.x,I.y)<1*this.scale*this.scale;)I=V,D++,V=c[D+2];g=t(0,K.x,K.y)||g;for(var Q=0;Q<this.validEdges.length;Q++){var ja=+this.validEdges[Q],ea=ja.absolutePoints;if(null!=ea&&mxUtils.intersects(L,ja)&&"1"!=ja.style.noJump){var da=null;for(ja=0;ja<ea.length-1;ja++){var ia=ea[ja+1],la=ea[ja];for(V=ea[ja+2];ja<ea.length-2&&mxUtils.ptSegDistSq(la.x,la.y,V.x,V.y,ia.x,ia.y)<1*this.scale*this.scale;)ia=V,ja++,V=ea[ja+2];var ka=mxUtils.intersection(K.x,K.y,I.x,I.y,la.x,la.y,ia.x,ia.y);if(null!=ka&&(Math.abs(ka.x-K.x)>B||Math.abs(ka.y-K.y)>B)&&(Math.abs(ka.x-I.x)>B||Math.abs(ka.y-I.y)>B)&&(null==da||mxUtils.ptLineDist(K.x,K.y,+I.x,I.y,da.x,da.y)>B||mxUtils.ptLineDist(K.x,K.y,I.x,I.y,la.x,la.y)>B)&&(null==V||mxUtils.ptLineDist(K.x,K.y,I.x,I.y,V.x,V.y)>B||mxUtils.ptLineDist(K.x,K.y,I.x,I.y,ia.x,ia.y)>B)){V=ka.x-K.x;da=ka.y-K.y;ka={distSq:V*V+da*da,x:ka.x,y:ka.y};for(V=0;V<M.length;V++)if(M[V].distSq>ka.distSq){M.splice(V,0,ka);ka=null;break}null==ka||0!=M.length&&M[M.length-1].x===ka.x&&M[M.length-1].y===ka.y||M.push(ka)}da=la}}}for(ja=0;ja<M.length;ja++)g=t(1,M[ja].x,M[ja].y)||g}ka=c[c.length-1];g=t(0,ka.x,ka.y)||g}L.routedPoints=+l;return g}return!1};var C=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(L,c,g){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)C.apply(this,arguments);else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,t=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,+B=mxUtils.getValue(this.style,"jumpStyle","none"),D=!0,I=null,K=null,M=[],V=null;L.begin();for(var Q=0;Q<this.state.routedPoints.length;Q++){var ja=this.state.routedPoints[Q],ea=new mxPoint(ja.x/this.scale,ja.y/this.scale);0==Q?ea=c[0]:Q==this.state.routedPoints.length-1&&(ea=c[c.length-1]);var da=!1;if(null!=I&&1==ja.type){var ia=this.state.routedPoints[Q+1];ja=ia.x/this.scale-ea.x;ia=ia.y/this.scale-ea.y;ja=ja*ja+ia*ia;null==V&&(V=new mxPoint(ea.x-I.x,ea.y-I.y),K=Math.sqrt(V.x*V.x+V.y*V.y),0<K?+(V.x=V.x*t/K,V.y=V.y*t/K):V=null);ja>t*t&&0<K&&(ja=I.x-ea.x,ia=I.y-ea.y,ja=ja*ja+ia*ia,ja>t*t&&(da=new mxPoint(ea.x-V.x,ea.y-V.y),ja=new mxPoint(ea.x+V.x,ea.y+V.y),M.push(da),this.addPoints(L,M,g,l,!1,null,D),M=0>Math.round(V.x)||0==Math.round(V.x)&&0>=Math.round(V.y)?1:-1,D=!1,"sharp"==B?(L.lineTo(da.x-V.y*M,da.y+V.x*M),L.lineTo(ja.x-V.y*M,ja.y+V.x*M),L.lineTo(ja.x,ja.y)):"line"==B?(L.moveTo(da.x+V.y*M,da.y-V.x*M),L.lineTo(da.x-V.y*M,da.y+V.x*M),L.moveTo(ja.x-V.y*M,ja.y+V.x*M),L.lineTo(ja.x+V.y*+M,ja.y-V.x*M),L.moveTo(ja.x,ja.y)):"arc"==B?(M*=1.3,L.curveTo(da.x-V.y*M,da.y+V.x*M,ja.x-V.y*M,ja.y+V.x*M,ja.x,ja.y)):(L.moveTo(ja.x,ja.y),D=!0),M=[ja],da=!0))}else V=null;da||(M.push(ea),I=ea)}this.addPoints(L,M,g,l,!1,null,D);L.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(L,c,g,l){return null!=c&&"centerPerimeter"==c.style[mxConstants.STYLE_PERIMETER]?new mxPoint(c.getCenterX(),c.getCenterY()):G.apply(this,arguments)};var T=mxGraphView.prototype.updateFloatingTerminalPoint;+mxGraphView.prototype.updateFloatingTerminalPoint=function(L,c,g,l){if(null==c||null==L||"1"!=c.style.snapToPoint&&"1"!=L.style.snapToPoint)T.apply(this,arguments);else{c=this.getTerminalPort(L,c,l);var t=this.getNextPoint(L,g,l),B=this.graph.isOrthogonal(L),D=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),I=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=D){var K=Math.cos(-D),M=Math.sin(-D);t=mxUtils.getRotatedPoint(t,K,M,I)}K=parseFloat(L.style[mxConstants.STYLE_PERIMETER_SPACING]||+0);K+=parseFloat(L.style[l?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);t=this.getPerimeterPoint(c,t,0==D&&B,K);0!=D&&(K=Math.cos(D),M=Math.sin(D),t=mxUtils.getRotatedPoint(t,K,M,I));L.setAbsoluteTerminalPoint(this.snapToAnchorPoint(L,c,g,l,t),l)}};mxGraphView.prototype.snapToAnchorPoint=function(L,c,g,l,t){if(null!=c&&null!=L){L=this.graph.getAllConnectionConstraints(c);l=g=null;if(null!=L)for(var B=0;B<L.length;B++){var D=this.graph.getConnectionPoint(c,+L[B]);if(null!=D){var I=(D.x-t.x)*(D.x-t.x)+(D.y-t.y)*(D.y-t.y);if(null==l||I<l)g=D,l=I}}null!=g&&(t=g)}return t};var E=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(L,c,g){var l=E.apply(this,arguments);"1"==L.getAttribute("placeholders")&&null!=g.state&&(l=g.state.view.graph.replacePlaceholders(g.state.cell,l));return l};var P=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(L){if(null!=L.style&&"undefined"!==typeof pako){var c=+mxUtils.getValue(L.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"string"===typeof c&&"stencil("==c.substring(0,8))try{var g=c.substring(8,c.length-1),l=mxUtils.parseXml(Graph.decompress(g));return new mxShape(new mxStencil(l.documentElement))}catch(t){null!=window.console&&console.log("Error in shape: "+t)}}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 d=mxStencilRegistry.stencils[b];if(null==d&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var m=mxStencilRegistry.getBasenameForStencil(b);if(null!=m){d=mxStencilRegistry.libraries[m];if(null!=d){if(null==mxStencilRegistry.packages[m]){for(var n=0;n<d.length;n++){var v=d[n];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(C){null!=window.console&&console.log("error in getStencil:",b,m,d,v,C)}}mxStencilRegistry.packages[m]=1}}else m=m.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+m+".xml",null);d=mxStencilRegistry.stencils[b]}}return d};mxStencilRegistry.getBasenameForStencil=function(b){var d=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0<b.length&&"mxgraph"==b[0])){d=b[1];for(var m=2;m<b.length-1;m++)d+="/"+b[m]}return d};@@ -2616,178 +2620,178 @@ mxStencilRegistry.loadStencilSet=function(b,d,m,n){var v=mxStencilRegistry.packav.documentElement&&mxStencilRegistry.parseStencilSet(v.documentElement,d,p)}};mxStencilRegistry.loadStencil=function(b,d){if(null!=d)mxUtils.get(b,mxUtils.bind(this,function(m){d(200<=m.getStatus()&&299>=m.getStatus()?m.getXml():null)}),mxUtils.bind(this,function(m){d(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var d=0;d<b.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[d]).documentElement)};mxStencilRegistry.parseStencilSet=function(b,d,m){if("stencils"==b.nodeName)for(var n=b.firstChild;null!=n;)"shapes"==n.nodeName&&mxStencilRegistry.parseStencilSet(n,d,m),n=n.nextSibling;else{m=null!=m?m:!0;n=b.firstChild;var v="";b=b.getAttribute("name");for(null!=b&&(v=b+".");null!=n;){if(n.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=n.getAttribute("name"),null!=b)){v=v.toLowerCase();var p=b.replace(/ /g,"_");m&&mxStencilRegistry.addStencil(v+p.toLowerCase(),new mxStencil(n));if(null!=d){var C=n.getAttribute("w"),G=n.getAttribute("h");C=null==C?80:parseInt(C,10);G=null==G?80:parseInt(G,10);d(v,p,b,C,G)}}n=n.nextSibling}}};-"undefined"!==typeof mxVertexHandler&&function(){function b(){var y=document.createElement("div");y.className="geHint";y.style.whiteSpace="nowrap";y.style.position="absolute";return y}function d(y,P){switch(P){case mxConstants.POINTS:return y;case mxConstants.MILLIMETERS:return(y/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(y/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(y/mxConstants.PIXELS_PER_INCH).toFixed(3)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";+"undefined"!==typeof mxVertexHandler&&function(){function b(){var x=document.createElement("div");x.className="geHint";x.style.whiteSpace="nowrap";x.style.position="absolute";return x}function d(x,N){switch(N){case mxConstants.POINTS:return x;case mxConstants.MILLIMETERS:return(x/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(x/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(x/mxConstants.PIXELS_PER_INCH).toFixed(3)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR="#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=50;mxConstants.HIGHLIGHT_SIZE=5;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#707070" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'<path d="Z" stroke="#C0C0C0" stroke-width="1" fill="none"/>').src;-mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(y){return!mxEvent.isAltDown(y)||mxEvent.isShiftDown(y)};var m=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(y){return m.apply(this,arguments)||this.graph.isTableRow(y)||this.graph.isTableCell(y)};var n=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=-function(y){return n.apply(this,arguments)||this.graph.isEdgeIgnored(y)};var v=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(y){return this.graph.isCloneEvent(y)!=v.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var y=new mxEllipse(null,this.highlightColor,this.highlightColor,0);y.opacity=mxConstants.HIGHLIGHT_OPACITY;return y};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor=-"crosshair";mxConnectionHandler.prototype.createEdgeState=function(y){y=this.graph.createCurrentEdgeStyle();y=this.graph.createEdge(null,null,null,null,null,y);y=new mxCellState(this.graph.view,y,this.graph.getCellStyle(y));for(var P in this.graph.currentEdgeStyle)y.style[P]=this.graph.currentEdgeStyle[P];if(null!=this.previous){var S=this.previous.style.newEdgeStyle;if(null!=S)try{var X=JSON.parse(S);for(P in X)y.style[P]=X[P]}catch(ba){}}y.style=this.graph.postProcessCellStyle(y.cell,y.style);return y};-var p=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var y=p.apply(this,arguments);y.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return y};mxConnectionHandler.prototype.updatePreview=function(y){};var C=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=C.apply(this,arguments),P=y.getCell;y.getCell=mxUtils.bind(this,function(S){var X=P.apply(this,arguments);this.error=null;return X});-return y};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var y="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",P="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),S=0;S<P.length;S++)null!=-this.currentEdgeStyle[P[S]]&&(y+=P[S]+"="+this.currentEdgeStyle[P[S]]+";");null!=this.currentEdgeStyle.orthogonalLoop?y+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(y+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?y+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(y+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+-";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(y+="elbow="+this.currentEdgeStyle.elbow+";");return y=null!=this.currentEdgeStyle.html?y+("html="+this.currentEdgeStyle.html+";"):y+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var y=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=-y&&(new mxCodec(y.ownerDocument)).decode(y,this.getStylesheet())};Graph.prototype.createCellLookup=function(y,P){P=null!=P?P:{};for(var S=0;S<y.length;S++){var X=y[S];P[mxObjectIdentity.get(X)]=X.getId();for(var ba=this.model.getChildCount(X),ma=0;ma<ba;ma++)this.createCellLookup([this.model.getChildAt(X,ma)],P)}return P};Graph.prototype.createCellMapping=function(y,P,S){S=null!=S?S:{};for(var X in y){var ba=P[X];null==S[ba]&&(S[ba]=y[X].getId()||"")}return S};Graph.prototype.importGraphModel=function(y,-P,S,X){P=null!=P?P:0;S=null!=S?S:0;var ba=new mxCodec(y.ownerDocument),ma=new mxGraphModel;ba.decode(y,ma);y=[];ba={};var ra={},wa=ma.getChildren(this.cloneCell(ma.root,this.isCloneInvalidEdges(),ba));if(null!=wa){var sa=this.createCellLookup([ma.root]);wa=wa.slice();this.model.beginUpdate();try{if(1!=wa.length||this.isCellLocked(this.getDefaultParent()))for(ma=0;ma<wa.length;ma++)xa=this.model.getChildren(this.moveCells([wa[ma]],P,S,!1,this.model.getRoot())[0]),null!=xa&&(y=y.concat(xa));else{var xa=-ma.getChildren(wa[0]);null!=xa&&(y=this.moveCells(xa,P,S,!1,this.getDefaultParent()),ra[ma.getChildAt(ma.root,0).getId()]=this.getDefaultParent().getId())}if(null!=y&&(this.createCellMapping(ba,sa,ra),this.updateCustomLinks(ra,y),X)){this.isGridEnabled()&&(P=this.snap(P),S=this.snap(S));var Fa=this.getBoundingBoxFromGeometry(y,!0);null!=Fa&&this.moveCells(y,P-Fa.x,S-Fa.y)}}finally{this.model.endUpdate()}}return y};Graph.prototype.encodeCells=function(y){for(var P={},S=this.cloneCells(y,null,P),X=-new mxDictionary,ba=0;ba<y.length;ba++)X.put(y[ba],!0);var ma=new mxCodec,ra=new mxGraphModel,wa=ra.getChildAt(ra.getRoot(),0);for(ba=0;ba<S.length;ba++){ra.add(wa,S[ba]);var sa=this.view.getState(y[ba]);if(null!=sa){var xa=this.getCellGeometry(S[ba]);null!=xa&&xa.relative&&!this.model.isEdge(y[ba])&&null==X.get(this.model.getParent(y[ba]))&&(xa.offset=null,xa.relative=!1,xa.x=sa.x/sa.view.scale-sa.view.translate.x,xa.y=sa.y/sa.view.scale-sa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(P,-this.createCellLookup(y)),S);return ma.encode(ra)};Graph.prototype.isSwimlane=function(y,P){var S=null;null==y||this.model.isEdge(y)||this.model.getParent(y)==this.model.getRoot()||(S=this.getCurrentCellStyle(y,P)[mxConstants.STYLE_SHAPE]);return S==mxConstants.SHAPE_SWIMLANE||"table"==S||"tableRow"==S};var G=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(y){return null!=y&&G.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellEditable(this.model.getParent(y)):-!0:!1};var T=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(y){return null!=y&&T.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellMovable(this.model.getParent(y)):!0:!1};var E=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(y){var P=this.model.getParent(y);if(null!=P){var S=this.getCurrentCellStyle(P);if(null!=S.expand)return"0"!=S.expand}return E.apply(this,arguments)&&(null==P||!this.isTable(P))};var Q=Graph.prototype.splitEdge;-Graph.prototype.splitEdge=function(y,P,S,X,ba,ma,ra,wa){null==wa&&(wa=this.model.getParent(y),this.isTable(wa)||this.isTableRow(wa))&&(wa=this.getCellAt(ma,ra,null,!0,!1));S=null;this.model.beginUpdate();try{var sa=this.getCellGeometry(y);if(null!=sa&&null!=sa.points&&0<sa.points.length&&1==P.length&&this.model.isVertex(P[0])){var xa=this.getCellGeometry(P[0]);if(null!=xa&&!xa.relative){var Fa=new mxRectangle(xa.x+X,xa.y+ba,xa.width,xa.height),Ya=sa.points;xa=[];for(var Ua=0;Ua<Ya.length;Ua++)Fa.intersectsPoint(Ya[Ua].x,-Ya[Ua].y)||xa.push(Ya[Ua]);xa.length<Ya.length&&(sa=sa.clone(),sa.points=xa,this.model.setGeometry(y,sa))}}S=Q.apply(this,[y,P,S,X,ba,ma,ra,wa]);this.model.setValue(S,"");var cb=this.getChildCells(S,!0);for(Ua=0;Ua<cb.length;Ua++)sa=this.getCellGeometry(cb[Ua]),null!=sa&&sa.relative&&0<sa.x&&this.model.remove(cb[Ua]);var hb=this.getChildCells(y,!0);for(Ua=0;Ua<hb.length;Ua++)sa=this.getCellGeometry(hb[Ua]),null!=sa&&sa.relative&&0>=sa.x&&this.model.remove(hb[Ua]);var jb=this.model.getTerminal(S,!1);-if(null!=jb){var Ta=this.getCurrentCellStyle(jb);null!=Ta&&"1"==Ta.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[y]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[y]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[S]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[S]))}}finally{this.model.endUpdate()}return S};var M=Graph.prototype.selectCell;Graph.prototype.selectCell=function(y,P,S){if(P||S)M.apply(this,arguments);else{var X=this.getSelectionCell(),ba=null,ma=[],ra=-mxUtils.bind(this,function(wa){if(null!=this.view.getState(wa)&&(this.model.isVertex(wa)||this.model.isEdge(wa)))if(ma.push(wa),wa==X)ba=ma.length-1;else if(y&&null==X&&0<ma.length||null!=ba&&y&&ma.length>ba||!y&&0<ba)return;for(var sa=0;sa<this.model.getChildCount(wa);sa++)ra(this.model.getChildAt(wa,sa))});ra(this.model.root);0<ma.length&&(ba=null!=ba?mxUtils.mod(ba+(y?1:-1),ma.length):0,this.setSelectionCell(ma[ba]))}};Graph.prototype.swapShapes=function(y,P){if(this.model.isVertex(y)&&this.model.isVertex(P)&&-2==this.getMovableCells([y,P]).length){var S=this.getCellGeometry(y),X=this.getCellGeometry(P);if(null!=S&&null!=X){var ba=S.clone(),ma=X.clone();this.model.beginUpdate();try{ba.x=X.getCenterX()-S.width/2,ba.y=X.getCenterY()-S.height/2,ma.x=S.getCenterX()-X.width/2,ma.y=S.getCenterY()-X.height/2,this.model.setGeometry(y,ba),this.model.setGeometry(P,ma)}finally{this.model.endUpdate()}}}};var c=Graph.prototype.moveCells;Graph.prototype.moveCells=function(y,P,S,X,ba,ma,ra){ra=null!=ra?ra:{};if(this.isTable(ba)){for(var wa=-[],sa=0;sa<y.length;sa++)this.isTable(y[sa])?wa=wa.concat(this.model.getChildCells(y[sa],!0).reverse()):wa.push(y[sa]);y=wa}this.model.beginUpdate();try{wa=[];for(sa=0;sa<y.length;sa++)if(null!=ba&&this.isTableRow(y[sa])){var xa=this.model.getParent(y[sa]),Fa=this.getCellGeometry(y[sa]);this.isTable(xa)&&wa.push(xa);if(null!=xa&&null!=Fa&&this.isTable(xa)&&this.isTable(ba)&&(X||xa!=ba)){if(!X){var Ya=this.getCellGeometry(xa);null!=Ya&&(Ya=Ya.clone(),Ya.height-=Fa.height,this.model.setGeometry(xa,-Ya))}Ya=this.getCellGeometry(ba);null!=Ya&&(Ya=Ya.clone(),Ya.height+=Fa.height,this.model.setGeometry(ba,Ya));var Ua=this.model.getChildCells(ba,!0);if(0<Ua.length){y[sa]=X?this.cloneCell(y[sa]):y[sa];var cb=this.model.getChildCells(y[sa],!0),hb=this.model.getChildCells(Ua[0],!0),jb=hb.length-cb.length;if(0<jb)for(var Ta=0;Ta<jb;Ta++){var qb=this.cloneCell(cb[cb.length-1]);null!=qb&&(qb.value="",this.model.add(y[sa],qb))}else if(0>jb)for(Ta=0;Ta>jb;Ta--)this.model.remove(cb[cb.length+Ta-1]);cb=this.model.getChildCells(y[sa],-!0);for(Ta=0;Ta<hb.length;Ta++){var gb=this.getCellGeometry(hb[Ta]),bb=this.getCellGeometry(cb[Ta]);null!=gb&&null!=bb&&(bb=bb.clone(),bb.width=gb.width,this.model.setGeometry(cb[Ta],bb))}}}}var db=c.apply(this,arguments);for(sa=0;sa<wa.length;sa++)!X&&this.model.contains(wa[sa])&&0==this.model.getChildCount(wa[sa])&&this.model.remove(wa[sa]);X&&this.updateCustomLinks(this.createCellMapping(ra,this.createCellLookup(y)),db)}finally{this.model.endUpdate()}return db};var g=Graph.prototype.removeCells;-Graph.prototype.removeCells=function(y,P){var S=[];this.model.beginUpdate();try{for(var X=0;X<y.length;X++)if(this.isTableCell(y[X])){var ba=this.model.getParent(y[X]),ma=this.model.getParent(ba);1==this.model.getChildCount(ba)&&1==this.model.getChildCount(ma)?0>mxUtils.indexOf(y,ma)&&0>mxUtils.indexOf(S,ma)&&S.push(ma):this.labelChanged(y[X],"")}else{if(this.isTableRow(y[X])&&(ma=this.model.getParent(y[X]),0>mxUtils.indexOf(y,ma)&&0>mxUtils.indexOf(S,ma))){for(var ra=this.model.getChildCells(ma,-!0),wa=0,sa=0;sa<ra.length;sa++)0<=mxUtils.indexOf(y,ra[sa])&&wa++;wa==ra.length&&S.push(ma)}S.push(y[X])}S=g.apply(this,[S,P])}finally{this.model.endUpdate()}return S};Graph.prototype.updateCustomLinks=function(y,P,S){S=null!=S?S:new Graph;for(var X=0;X<P.length;X++)null!=P[X]&&S.updateCustomLinksForCell(y,P[X],S)};Graph.prototype.updateCustomLinksForCell=function(y,P){this.doUpdateCustomLinksForCell(y,P);for(var S=this.model.getChildCount(P),X=0;X<S;X++)this.updateCustomLinksForCell(y,this.model.getChildAt(P,-X))};Graph.prototype.doUpdateCustomLinksForCell=function(y,P){};Graph.prototype.getAllConnectionConstraints=function(y,P){if(null!=y){P=mxUtils.getValue(y.style,"points",null);if(null!=P){y=[];try{var S=JSON.parse(P);for(P=0;P<S.length;P++){var X=S[P];y.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(ma){}return y}if(null!=y.shape&&null!=y.shape.bounds){X=y.shape.direction;P=y.shape.bounds;var ba=y.shape.scale;S=P.width/-ba;P=P.height/ba;if(X==mxConstants.DIRECTION_NORTH||X==mxConstants.DIRECTION_SOUTH)X=S,S=P,P=X;P=y.shape.getConstraints(y.style,S,P);if(null!=P)return P;if(null!=y.shape.stencil&&null!=y.shape.stencil.constraints)return y.shape.stencil.constraints;if(null!=y.shape.constraints)return y.shape.constraints}}return null};Graph.prototype.flipEdge=function(y){if(null!=y){var P=this.getCurrentCellStyle(y);P=mxUtils.getValue(P,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?-mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,P,[y])}};Graph.prototype.isValidRoot=function(y){for(var P=this.model.getChildCount(y),S=0,X=0;X<P;X++){var ba=this.model.getChildAt(y,X);this.model.isVertex(ba)&&(ba=this.getCellGeometry(ba),null==ba||ba.relative||S++)}return 0<S||this.isContainer(y)};Graph.prototype.isValidDropTarget=function(y,P,S){for(var X=this.getCurrentCellStyle(y),ba=!0,ma=!0,ra=0;ra<P.length&&ma;ra++)ba=ba&&this.isTable(P[ra]),-ma=ma&&this.isTableRow(P[ra]);return!this.isCellLocked(y)&&(this.isTargetShape(y,P,S)||("1"!=mxUtils.getValue(X,"part","0")||this.isContainer(y))&&"0"!=mxUtils.getValue(X,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(y))&&!this.isTableRow(y)&&(!this.isTable(y)||ma||ba))};Graph.prototype.createGroupCell=function(){var y=mxGraph.prototype.createGroupCell.apply(this,arguments);y.setStyle("group");return y};Graph.prototype.isExtendParentsOnAdd=function(y){var P=-mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(P&&null!=y&&null!=this.layoutManager){var S=this.model.getParent(y);null!=S&&(S=this.layoutManager.getLayout(S),null!=S&&S.constructor==mxStackLayout&&(P=!1))}return P};Graph.prototype.getPreferredSizeForCell=function(y,P,S){S=null!=S?S:this.gridEnabled;var X=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=X&&(X.width+=10,X.height+=4,S&&(X.width=this.snap(X.width),X.height=this.snap(X.height)));return X};Graph.prototype.getAutosizeTextAvailableSpace=-function(y,P,S,X){var ba=0,ma=0;(null!=X&&null!=this.getImage(X)||null!=y[mxConstants.STYLE_IMAGE])&&y[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(y[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(ba+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),y[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(ma+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));ba+=2*parseFloat(mxUtils.getValue(y,-mxConstants.STYLE_SPACING,2));ba+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING_LEFT,2));ba+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING_RIGHT,2));ma+=2*parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING,2));ma+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING_TOP,2));ma+=parseFloat(mxUtils.getValue(y,mxConstants.STYLE_SPACING_BOTTOM,2));null!=X&&(X=this.getFoldingImage(X),null!=X&&(ba+=X.width+8));y=mxUtils.getValue(y,mxConstants.STYLE_HORIZONTAL,!0);ba=(y?P:S)--ba;P=(y?S:P)-ma;return 0>=ba||0>=P?null:{availW:ba,availH:P}};Graph.prototype.computeAutosizeTextFontSize=function(y,P,S,X,ba,ma){var ra=1,wa=84,sa=ma?P:null,xa=null;if(ma){for(var Fa=y.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Ya=[],Ua=0;Ua<Fa.length;Ua++)0<Fa[Ua].length&&Ya.push(mxUtils.htmlEntities(Fa[Ua],!1));0<Ya.length&&(xa=Ya.join("<br>"))}for(;ra<wa;)Fa=Math.ceil((ra+wa)/2),Ya=mxUtils.getSizeForString(y,Fa,X,sa,ba),(Ya=ma?Ya.height<=S:Ya.width<=P&&Ya.height<=S)&&-ma&&null!=xa&&mxUtils.getSizeForString(xa,Fa,X,null,ba).width>P&&(Ya=!1),Ya?ra=Fa:wa=Fa-1;return Math.max(6,ra)};Graph.prototype.updateAutosizeTextFontSize=function(y,P){var S=this.view.getState(y);null==S&&(S=this.view.createState(y));P=P||S.style;var X=this.getCellGeometry(y);if(null!=X&&!this.model.isEdge(y)){var ba=this.cellRenderer.getLabelValue(S);null!=ba&&0!=ba.length&&(S=this.getAutosizeTextAvailableSpace(P,X.width,X.height,S),null!=S&&(this.isHtmlLabel(y)||(ba=mxUtils.htmlEntities(ba,!1)),-ba=ba.replace(/\n/g,"<br>"),P=this.computeAutosizeTextFontSize(ba,S.availW,S.availH,P[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,P[mxConstants.STYLE_FONTSTYLE],"wrap"==P[mxConstants.STYLE_WHITE_SPACE]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,P,[y])))}};Graph.prototype.cellsResized=function(y,P,S){var X=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=y)for(var ba=0;ba<y.length;ba++)this.model.isVertex(y[ba])&&this.isAutosizeTextCell(y[ba])&&this.updateAutosizeTextFontSize(y[ba]);-return X};Graph.prototype.turnShapes=function(y,P){var S=this.getModel(),X=[];S.beginUpdate();try{for(var ba=0;ba<y.length;ba++){var ma=y[ba];if(S.isEdge(ma)){var ra=S.getTerminal(ma,!0),wa=S.getTerminal(ma,!1);S.setTerminal(ma,wa,!0);S.setTerminal(ma,ra,!1);var sa=S.getGeometry(ma);if(null!=sa){sa=sa.clone();null!=sa.points&&sa.points.reverse();var xa=sa.getTerminalPoint(!0),Fa=sa.getTerminalPoint(!1);sa.setTerminalPoint(xa,!1);sa.setTerminalPoint(Fa,!0);S.setGeometry(ma,sa);var Ya=this.view.getState(ma),-Ua=this.view.getState(ra),cb=this.view.getState(wa);if(null!=Ya){var hb=null!=Ua?this.getConnectionConstraint(Ya,Ua,!0):null,jb=null!=cb?this.getConnectionConstraint(Ya,cb,!1):null;this.setConnectionConstraint(ma,ra,!0,jb);this.setConnectionConstraint(ma,wa,!1,hb);var Ta=mxUtils.getValue(Ya.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Ya.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ma]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,-Ta,[ma])}X.push(ma)}}else if(S.isVertex(ma)&&(sa=this.getCellGeometry(ma),null!=sa)){if(!(this.isTable(ma)||this.isTableRow(ma)||this.isTableCell(ma)||this.isSwimlane(ma))){sa=sa.clone();sa.x+=sa.width/2-sa.height/2;sa.y+=sa.height/2-sa.width/2;var qb=sa.width;sa.width=sa.height;sa.height=qb;S.setGeometry(ma,sa)}var gb=this.view.getState(ma);if(null!=gb){var bb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],db=mxUtils.getValue(gb.style,-mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,bb[mxUtils.mod(mxUtils.indexOf(bb,db)+(P?-1:1),bb.length)],[ma])}X.push(ma)}}}finally{S.endUpdate()}return X};Graph.prototype.stencilHasPlaceholders=function(y){if(null!=y&&null!=y.fgNode)for(y=y.fgNode.firstChild;null!=y;){if("text"==y.nodeName&&"1"==y.getAttribute("placeholders"))return!0;y=y.nextSibling}return!1};var l=Graph.prototype.processChange;Graph.prototype.processChange=function(y){if(y instanceof-mxGeometryChange&&(this.isTableCell(y.cell)||this.isTableRow(y.cell))&&(null==y.previous&&null!=y.geometry||null!=y.previous&&!y.previous.equals(y.geometry))){var P=y.cell;this.isTableCell(P)&&(P=this.model.getParent(P));this.isTableRow(P)&&(P=this.model.getParent(P));var S=this.view.getState(P);null!=S&&null!=S.shape&&(this.view.invalidate(P),S.shape.bounds=null)}l.apply(this,arguments);y instanceof mxValueChange&&null!=y.cell&&null!=y.cell.value&&"object"==typeof y.cell.value&&this.invalidateDescendantsWithPlaceholders(y.cell)};-Graph.prototype.invalidateDescendantsWithPlaceholders=function(y){y=this.model.getDescendants(y);if(0<y.length)for(var P=0;P<y.length;P++){var S=this.view.getState(y[P]);null!=S&&null!=S.shape&&null!=S.shape.stencil&&this.stencilHasPlaceholders(S.shape.stencil)?this.removeStateForCell(y[P]):this.isReplacePlaceholders(y[P])&&this.view.invalidate(y[P],!1,!1)}};Graph.prototype.replaceElement=function(y,P){P=y.ownerDocument.createElement(null!=P?P:"span");for(var S=Array.prototype.slice.call(y.attributes);attr=-S.pop();)P.setAttribute(attr.nodeName,attr.nodeValue);P.innerHTML=y.innerHTML;y.parentNode.replaceChild(P,y)};Graph.prototype.processElements=function(y,P){if(null!=y){y=y.getElementsByTagName("*");for(var S=0;S<y.length;S++)null!=y[S]&&P(y[S])}};Graph.prototype.updateLabelElements=function(y,P,S){y=null!=y?y:this.getSelectionCells();for(var X=document.createElement("div"),ba=0;ba<y.length;ba++){var ma=this.getCurrentCellStyle(y[ba]);if(null!=ma&&"1"==ma.html&&(ma=this.convertValueToString(y[ba]),-null!=ma&&0<ma.length)){X.innerHTML=Graph.sanitizeHtml(ma);for(var ra=X.getElementsByTagName(null!=S?S:"*"),wa=0;wa<ra.length;wa++)P(ra[wa]);X.innerHTML!=ma&&this.cellLabelChanged(y[ba],X.innerHTML)}}};Graph.prototype.cellLabelChanged=function(y,P,S){P=Graph.zapGremlins(P);this.model.beginUpdate();try{if(null!=y.value&&"object"==typeof y.value){if(this.isReplacePlaceholders(y)&&null!=y.getAttribute("placeholder"))for(var X=y.getAttribute("placeholder"),ba=y;null!=ba;){if(ba==this.model.getRoot()||-null!=ba.value&&"object"==typeof ba.value&&ba.hasAttribute(X)){this.setAttributeForCell(ba,X,P);break}ba=this.model.getParent(ba)}var ma=y.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&ma.hasAttribute("label_"+Graph.diagramLanguage)?ma.setAttribute("label_"+Graph.diagramLanguage,P):ma.setAttribute("label",P);P=ma}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(y)&&this.updateAutosizeTextFontSize(y)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=-function(y){if(null!=y){for(var P=new mxDictionary,S=0;S<y.length;S++)P.put(y[S],!0);var X=[];for(S=0;S<y.length;S++){var ba=this.model.getParent(y[S]);null==ba||P.get(ba)||(P.put(ba,!0),X.push(ba))}for(S=0;S<X.length;S++)if(ba=this.view.getState(X[S]),null!=ba&&(this.model.isEdge(ba.cell)||this.model.isVertex(ba.cell))&&this.isCellDeletable(ba.cell)&&this.isTransparentState(ba)){for(var ma=!0,ra=0;ra<this.model.getChildCount(ba.cell)&&ma;ra++)P.get(this.model.getChildAt(ba.cell,ra))||(ma=!1);ma&&-y.push(ba.cell)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(y){for(var P=[],S=0;S<y.length;S++)this.isCellDeletable(y[S])&&this.isTransparentState(this.view.getState(y[S]))&&P.push(y[S]);y=P;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(y,P){this.setAttributeForCell(y,"link",P)};Graph.prototype.createLinkOverlay=function(y){y=this.getLinkForCell(y);if(null!=y&&0<y.length){y=this.getLinkOverlayTooltip(y);-y=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),y,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));y.isLinkOverlay=!0;var P=this;y.addListener(mxEvent.CLICK,function(S,X){P.setSelectionCell(X.getProperty("cell"))});return y}return null};Graph.prototype.getLinkOverlayTooltip=function(y){return y};Graph.prototype.createTooltipOverlay=function(y){y=this.convertValueToTooltip(y);if(null!=y&&0<y.length){y=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),-y,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));y.isTooltipOverlay=!0;var P=this;y.addListener(mxEvent.CLICK,function(S,X){S=X.getProperty("cell");P.isEnabled()&&P.isCellEditable(S)?(P.setSelectionCell(S),P.editTooltip(S)):(X=X.getProperty("event"),S=P.getTooltipForCell(S),null!=S&&0<S.length&&P.tooltipHandler.show(S,X.clientX,X.clientY))});return y}return null};Graph.prototype.editTooltip=function(y){};Graph.prototype.setTooltipForCell=function(y,P){var S="tooltip";Graph.translateDiagram&&-null!=Graph.diagramLanguage&&mxUtils.isNode(y.value)&&y.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(S="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(y,S,P)};Graph.prototype.getAttributeForCell=function(y,P,S){y=null!=y.value&&"object"===typeof y.value?y.value.getAttribute(P):null;return null!=y?y:S};Graph.prototype.setAttributeForCell=function(y,P,S){if(null!=y.value&&"object"==typeof y.value)var X=y.value.cloneNode(!0);else X=mxUtils.createXmlDocument().createElement("UserObject"),-X.setAttribute("label",y.value||"");null!=S?X.setAttribute(P,S):X.removeAttribute(P);this.model.setValue(y,X)};Graph.prototype.isTargetShape=function(y,P,S){y=mxUtils.getValue(this.getCurrentCellStyle(y),mxConstants.STYLE_SHAPE,"");for(S=0;S<P.length;S++){var X=mxUtils.getValue(this.getCurrentCellStyle(P[S]),"targetShapes","").split(",");if(0<=mxUtils.indexOf(X,y))return!0}return!1};var t=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(y,P,S,X){if(mxEvent.isAltDown(P))return null;-for(var ba=0;ba<y.length;ba++){var ma=this.model.getParent(y[ba]);if(this.model.isEdge(ma)&&0>mxUtils.indexOf(y,ma))return null}ma=t.apply(this,arguments);var ra=!0;for(ba=0;ba<y.length&&ra;ba++)ra=ra&&this.isTableRow(y[ba]);ra&&(this.isTableCell(ma)&&(ma=this.model.getParent(ma)),this.isTableRow(ma)&&(ma=this.model.getParent(ma)),this.isTable(ma)||(ma=null));return ma};Graph.prototype.click=function(y){mxGraph.prototype.click.call(this,y);this.firstClickState=y.getState();this.firstClickSource=y.getSource()};-Graph.prototype.dblClick=function(y,P){this.isEnabled()&&(P=this.insertTextForEvent(y,P),mxGraph.prototype.dblClick.call(this,y,P))};Graph.prototype.insertTextForEvent=function(y,P){var S=mxUtils.convertPoint(this.container,mxEvent.getClientX(y),mxEvent.getClientY(y));if(null!=y&&!this.model.isVertex(P)){var X=this.model.isEdge(P)?this.view.getState(P):null,ba=mxEvent.getSource(y);this.firstClickState!=X||this.firstClickSource!=ba||null!=X&&null!=X.text&&null!=X.text.node&&null!=X.text.boundingBox&&-(mxUtils.contains(X.text.boundingBox,S.x,S.y)||mxUtils.isAncestorNode(X.text.node,mxEvent.getSource(y)))||(null!=X||this.isCellLocked(this.getDefaultParent()))&&(null==X||this.isCellLocked(X.cell))||!(null!=X||mxClient.IS_SVG&&ba==this.view.getCanvas().ownerSVGElement)||(null==X&&(X=this.view.getState(this.getCellAt(S.x,S.y))),P=this.addText(S.x,S.y,X))}return P};Graph.prototype.getInsertPoint=function(y){y=this.getGridSize();var P=this.container.scrollLeft/this.view.scale-this.view.translate.x,S=-this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var X=this.getPageLayout(),ba=this.getPageSize();P=Math.max(P,X.x*ba.width);S=Math.max(S,X.y*ba.height)}return new mxPoint(this.snap(P+y),this.snap(S+y))};Graph.prototype.getFreeInsertPoint=function(y){var P=this.view,S=this.getGraphBounds(),X=this.getInsertPoint(y);y=this.snap(Math.round(Math.max(X.x,S.x/P.scale-P.translate.x+(0==S.width?2*this.gridSize:0))));P=this.snap(Math.round(Math.max(X.y,(S.y+S.height)/P.scale--P.translate.y+2*this.gridSize)));return new mxPoint(y,P)};Graph.prototype.getCenterInsertPoint=function(y){y=null!=y?y:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-y.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale-this.view.translate.y-y.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/-2/this.view.scale-this.view.translate.x-y.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-y.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(y,P){y=null!=y?y:"";null!=P&&(0<y.length&&";"!=y.charAt(y.length-1)&&(y+=";"),y+="fontSize="+P+";");return y};Graph.prototype.addText=function(y,P,S){var X=new mxCell;X.value="Text";X.geometry=new mxGeometry(0,0,0,0);X.vertex=!0;if(null!=S&&this.model.isEdge(S.cell)){X.style=-"edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);X.geometry.relative=!0;X.connectable=!1;var ba=this.view.getRelativePoint(S,y,P);X.geometry.x=Math.round(1E4*ba.x)/1E4;X.geometry.y=Math.round(ba.y);X.geometry.offset=new mxPoint(0,0);ba=this.view.getPoint(S,X.geometry);var ma=this.view.scale;X.geometry.offset=new mxPoint(Math.round((y-ba.x)/ma),Math.round((P-ba.y)/ma))}else ba=this.view.translate,X.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",-this.vertexFontSize),X.geometry.width=40,X.geometry.height=20,X.geometry.x=Math.round(y/this.view.scale)-ba.x-(null!=S?S.origin.x:0),X.geometry.y=Math.round(P/this.view.scale)-ba.y-(null!=S?S.origin.y:0),X.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([X],null!=S?S.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[X])),this.autoSizeCell(X)}finally{this.getModel().endUpdate()}return X};Graph.prototype.addClickHandler=function(y,P,S){var X=mxUtils.bind(this,-function(){var sa=this.container.getElementsByTagName("a");if(null!=sa)for(var xa=0;xa<sa.length;xa++){var Fa=this.getAbsoluteUrl(sa[xa].getAttribute("href"));null!=Fa&&(sa[xa].setAttribute("rel",this.linkRelation),sa[xa].setAttribute("href",Fa),null!=P&&mxEvent.addGestureListeners(sa[xa],null,null,P))}});this.model.addListener(mxEvent.CHANGE,X);X();var ba=this.container.style.cursor,ma=this.getTolerance(),ra=this,wa={currentState:null,currentLink:null,currentTarget:null,highlight:null!=y&&""!=y&&-y!=mxConstants.NONE?new mxCellHighlight(ra,y,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(sa){var xa=sa.sourceState;if(null==xa||null==ra.getLinkForCell(xa.cell))sa=ra.getCellAt(sa.getGraphX(),sa.getGraphY(),null,null,null,function(Fa,Ya,Ua){return null==ra.getLinkForCell(Fa.cell)}),xa=null==xa||ra.model.isAncestor(sa,xa.cell)?ra.view.getState(sa):null;xa!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=xa,null!=this.currentState&&this.activate(this.currentState))},-mouseDown:function(sa,xa){this.startX=xa.getGraphX();this.startY=xa.getGraphY();this.scrollLeft=ra.container.scrollLeft;this.scrollTop=ra.container.scrollTop;null==this.currentLink&&"auto"==ra.container.style.overflow&&(ra.container.style.cursor="move");this.updateCurrentState(xa)},mouseMove:function(sa,xa){if(ra.isMouseDown)null!=this.currentLink&&(sa=Math.abs(this.startX-xa.getGraphX()),xa=Math.abs(this.startY-xa.getGraphY()),(sa>ma||xa>ma)&&this.clear());else{for(sa=xa.getSource();null!=sa&&"a"!=-sa.nodeName.toLowerCase();)sa=sa.parentNode;null!=sa?this.clear():(null!=ra.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&ra.tooltipHandler.reset(xa,!0,this.currentState),(null==this.currentState||xa.getState()!=this.currentState&&null!=xa.sourceState||!ra.intersects(this.currentState,xa.getGraphX(),xa.getGraphY()))&&this.updateCurrentState(xa))}},mouseUp:function(sa,xa){var Fa=xa.getSource();for(sa=xa.getEvent();null!=Fa&&"a"!=Fa.nodeName.toLowerCase();)Fa=Fa.parentNode;null==-Fa&&Math.abs(this.scrollLeft-ra.container.scrollLeft)<ma&&Math.abs(this.scrollTop-ra.container.scrollTop)<ma&&(null==xa.sourceState||!xa.isSource(xa.sourceState.control))&&((mxEvent.isLeftMouseButton(sa)||mxEvent.isMiddleMouseButton(sa))&&!mxEvent.isPopupTrigger(sa)||mxEvent.isTouchEvent(sa))&&(null!=this.currentLink?(Fa=ra.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&Fa||null==P||P(sa,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(sa)||-(sa=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(sa)?"_blank":Fa?ra.linkTarget:"_top",ra.openLink(this.currentLink,sa),xa.consume())):null!=S&&!xa.isConsumed()&&Math.abs(this.scrollLeft-ra.container.scrollLeft)<ma&&Math.abs(this.scrollTop-ra.container.scrollTop)<ma&&Math.abs(this.startX-xa.getGraphX())<ma&&Math.abs(this.startY-xa.getGraphY())<ma&&S(xa.getEvent()));this.clear()},activate:function(sa){this.currentLink=ra.getAbsoluteUrl(ra.getLinkForCell(sa.cell));null!=this.currentLink&&-(this.currentTarget=ra.getLinkTargetForCell(sa.cell),ra.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(sa))},clear:function(){null!=ra.container&&(ra.container.style.cursor=ba);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=ra.tooltipHandler&&ra.tooltipHandler.hide()}};ra.click=function(sa){};ra.addMouseListener(wa);mxEvent.addListener(document,"mouseleave",function(sa){wa.clear()})};Graph.prototype.duplicateCells=-function(y,P){y=null!=y?y:this.getSelectionCells();P=null!=P?P:!0;for(var S=0;S<y.length;S++)this.isTableCell(y[S])&&(y[S]=this.model.getParent(y[S]));y=this.model.getTopmostCells(y);var X=this.getModel(),ba=this.gridSize,ma=[];X.beginUpdate();try{var ra={},wa=this.createCellLookup(y),sa=this.cloneCells(y,!1,ra,!0);for(S=0;S<y.length;S++){var xa=X.getParent(y[S]);if(null!=xa){var Fa=this.moveCells([sa[S]],ba,ba,!1)[0];ma.push(Fa);if(P)X.add(xa,sa[S]);else{var Ya=xa.getIndex(y[S]);X.add(xa,sa[S],Ya+-1)}if(this.isTable(xa)){var Ua=this.getCellGeometry(sa[S]),cb=this.getCellGeometry(xa);null!=Ua&&null!=cb&&(cb=cb.clone(),cb.height+=Ua.height,X.setGeometry(xa,cb))}}else ma.push(sa[S])}this.updateCustomLinks(this.createCellMapping(ra,wa),sa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",sa))}finally{X.endUpdate()}return ma};Graph.prototype.insertImage=function(y,P,S){if(null!=y&&null!=this.cellEditor.textarea){for(var X=this.cellEditor.textarea.getElementsByTagName("img"),ba=-[],ma=0;ma<X.length;ma++)ba.push(X[ma]);document.execCommand("insertimage",!1,y);y=this.cellEditor.textarea.getElementsByTagName("img");if(y.length==ba.length+1)for(ma=y.length-1;0<=ma;ma--)if(0==ma||y[ma]!=ba[ma-1]){y[ma].setAttribute("width",P);y[ma].setAttribute("height",S);break}}};Graph.prototype.insertLink=function(y){if(null!=this.cellEditor.textarea)if(0==y.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var P=this.cellEditor.textarea.getElementsByTagName("a"),S=[],X=-0;X<P.length;X++)S.push(P[X]);document.execCommand("createlink",!1,mxUtils.trim(y));P=this.cellEditor.textarea.getElementsByTagName("a");if(P.length==S.length+1)for(X=P.length-1;0<=X;X--)if(P[X]!=S[X-1]){for(P=P[X].getElementsByTagName("a");0<P.length;){for(S=P[0].parentNode;null!=P[0].firstChild;)S.insertBefore(P[0].firstChild,P[0]);S.removeChild(P[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(y))};Graph.prototype.isCellResizable=function(y){var P=mxGraph.prototype.isCellResizable.apply(this,-arguments),S=this.getCurrentCellStyle(y);return!this.isTableCell(y)&&!this.isTableRow(y)&&(P||"0"!=mxUtils.getValue(S,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==S[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(y,P,S){null==P&&(P=this.getSelectionCells());if(null!=P&&1<P.length){for(var X=[],ba=null,ma=null,ra=0,wa=0;wa<P.length;wa++)if(this.getModel().isVertex(P[wa])){var sa=this.view.getState(P[wa]);if(null!=sa){var xa=y?sa.getCenterX():sa.getCenterY();ba=null!=ba?Math.max(ba,-xa):xa;ma=null!=ma?Math.min(ma,xa):xa;S&&(ra+=y?sa.width:sa.height);X.push(sa)}}if(2<X.length){X.sort(function(hb,jb){return y?hb.x-jb.x:hb.y-jb.y});S&&(ra-=y?X[0].width/2+X[X.length-1].width/2:X[0].height/2+X[X.length-1].height/2);sa=this.view.translate;xa=this.view.scale;ma=ma/xa-(y?sa.x:sa.y);ba=ba/xa-(y?sa.x:sa.y);this.getModel().beginUpdate();try{var Fa=(ba-ma-ra)/(X.length-1),Ya=ma+(S?y?X[0].width/2:X[0].height/2:0);for(wa=1;wa<X.length-1;wa++){var Ua=this.view.getState(this.model.getParent(X[wa].cell)),-cb=this.getCellGeometry(X[wa].cell);Ya+=Fa;null!=cb&&null!=Ua&&(cb=cb.clone(),y?cb.x=Math.round(Ya-(S?0:cb.width/2))-Ua.origin.x:cb.y=Math.round(Ya-(S?0:cb.height/2))-Ua.origin.y,this.getModel().setGeometry(X[wa].cell,cb));S&&(Ya+=y?X[wa].width:X[wa].height)}}finally{this.getModel().endUpdate()}}}return P};Graph.prototype.isCloneEvent=function(y){return mxClient.IS_MAC&&mxEvent.isMetaDown(y)||mxEvent.isControlDown(y)};Graph.prototype.createSvgImageExport=function(y){y=new mxImageExport;y.addCellData=-function(S,X,ba){X.setAttribute("data-cell-id",S.id);if(ba)if(mxUtils.isNode(S.value))for(ba=0;ba<S.value.attributes.length;ba++){var ma=S.value.attributes[ba];X.setAttribute("data-cell-"+ma.name,ma.value)}else if("object"===typeof S.value)for(ma in S.value)X.setAttribute("data-cell-"+ma,S.value[ma]);else null!=S.value&&X.setAttribute("data-cell-value",S.value);return X};var P=y.visitStatesRecursive;y.visitStatesRecursive=function(S,X,ba){if(null!=S){var ma=X.root,ra=X.root.ownerDocument;X.root=this.addCellData(S.cell,-null!=ra.createElementNS?ra.createElementNS(mxConstants.NS_SVG,"g"):ra.createElement("g"),Editor.addSvgMetadata);ma.appendChild(X.root);P.apply(this,arguments);X.root=ma}};y.getLinkForCellState=mxUtils.bind(this,function(S,X){return this.getLinkForCell(S.cell)});y.getTitleForCellState=mxUtils.bind(this,function(S,X){return Editor.convertHtmlToText(this.convertValueToTooltip(S.cell))});return y};Graph.prototype.parseBackgroundImage=function(y){var P=null;null!=y&&0<y.length&&(y=JSON.parse(y),P=new mxImage(y.src,-y.width,y.height));return P};Graph.prototype.getBackgroundImageObject=function(y){return y};Graph.prototype.getSvg=function(y,P,S,X,ba,ma,ra,wa,sa,xa,Fa,Ya,Ua,cb,hb,jb){var Ta=null;if(null!=cb)for(Ta=new mxDictionary,ba=0;ba<cb.length;ba++)Ta.put(cb[ba],!0);cb=this.useCssTransforms;var qb=this.enableFlowAnimation;this.enableFlowAnimation=!1;cb&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{P=null!=P?P:1;S=null!=S?S:0;ma=null!=ma?ma:!0;ra=null!=ra?ra:!0;xa=null!=xa?xa:-!1;sa=null!=sa?sa:this.defaultExportLinkTarget;var gb="page"==Ua?this.view.getBackgroundPageBounds():ma&&null==Ta||X||"diagram"==Ua?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),bb=this.backgroundImage,db=this.view.translate,lb=this.view.scale;"diagram"==Ua&&null!=bb&&null!=bb.width&&null!=bb.height&&(gb=mxRectangle.fromRectangle(gb),gb.add(new mxRectangle((db.x+bb.x)*lb,(db.y+bb.y)*lb,bb.width*lb,bb.height*lb)));if(null==gb)throw Error(mxResources.get("drawingEmpty"));X=P/lb;-var ub=Math.max(1,Math.ceil(gb.width*X)+2*S)+(xa&&0==S?5:0),ob=Math.max(1,Math.ceil(gb.height*X)+2*S)+(xa&&0==S?5:0),pb=mxUtils.getLightDarkColor(y),sb=Graph.createSvgNode(0,0,ub,ob,pb),rb=sb.ownerDocument;if(null!=y){var tb=mxUtils.createElementNs(rb,mxConstants.NS_SVG,"rect");tb.setAttribute("fill",pb.light);tb.style.fill=pb.cssText;tb.setAttribute("width","100%");tb.setAttribute("height","100%");tb.setAttribute("x","0");tb.setAttribute("y","0");sb.appendChild(tb)}var yb=mxUtils.createElementNs(rb,-mxConstants.NS_SVG,"g");sb.appendChild(yb);var vb=this.createSvgCanvas(yb);vb.translate(Math.floor(S/P-gb.x/lb),Math.floor(S/P-gb.y/lb));vb.idPrefix="drawio-svg-"+Editor.guid();var Fb=document.createElement("div"),zb=vb.getAlternateText;vb.getAlternateText=function(nb,Ab,wb,f,q,z,u,A,F,H,ha,O,va){if(null!=z&&0<this.state.fontSize)try{mxUtils.isNode(z)?z=z.innerText:(Fb.innerHTML=z,z=mxUtils.extractTextWithWhitespace(Fb.childNodes));for(var pa=Math.ceil(2*f/this.state.fontSize),Wa=[],kb=0,fb=0;(0==-pa||kb<pa)&&fb<z.length;){var Ea=z.charCodeAt(fb);if(10==Ea||13==Ea){if(0<kb)break}else Wa.push(z.charAt(fb)),255>Ea&&kb++;fb++}Wa.length<z.length&&1<z.length-Wa.length&&(z=mxUtils.trim(Wa.join(""))+"...");return z}catch(La){return zb.apply(this,arguments)}else return zb.apply(this,arguments)};if(null!=bb&&null!=bb.width&&null!=bb.height){y=lb/P;var xb=new mxRectangle((bb.x+db.x)*y,(bb.y+db.y)*y,bb.width*y,bb.height*y);mxUtils.intersects(gb,xb)&&vb.image(bb.x+db.x,bb.y+db.y,bb.width,bb.height,bb.src,-!0)}vb.scale(X);vb.textEnabled=ra;wa=null!=wa?wa:this.createSvgImageExport();var mb=wa.getLinkForCellState;wa.getLinkForCellState=function(nb,Ab){var wb=nb.view.graph.getAbsoluteUrl(mb.apply(this,arguments));return null==wb||nb.view.graph.isCustomLink(wb)?null:wb};wa.getLinkTargetForCellState=function(nb,Ab){return nb.view.graph.getLinkTargetForCell(nb.cell)};var Bb=wa.drawCellState,Cb=null,Db=mxUtils.bind(this,function(){if(null==Cb){Cb="ge-flow-animation-"+Editor.guid();var nb=null!=rb.createElementNS?+mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(x){return!mxEvent.isAltDown(x)||mxEvent.isShiftDown(x)};var m=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(x){return m.apply(this,arguments)||this.graph.isTableRow(x)||this.graph.isTableCell(x)};var n=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=+function(x){return n.apply(this,arguments)||this.graph.isEdgeIgnored(x)};var v=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(x){return this.graph.isCloneEvent(x)!=v.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var x=new mxEllipse(null,this.highlightColor,this.highlightColor,0);x.opacity=mxConstants.HIGHLIGHT_OPACITY;return x};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor=+"crosshair";mxConnectionHandler.prototype.createEdgeState=function(x){x=this.graph.createCurrentEdgeStyle();x=this.graph.createEdge(null,null,null,null,null,x);x=new mxCellState(this.graph.view,x,this.graph.getCellStyle(x));for(var N in this.graph.currentEdgeStyle)x.style[N]=this.graph.currentEdgeStyle[N];if(null!=this.previous){var S=this.previous.style.newEdgeStyle;if(null!=S)try{var Y=JSON.parse(S);for(N in Y)x.style[N]=Y[N]}catch(ca){}}x.style=this.graph.postProcessCellStyle(x.cell,x.style);return x};+var p=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var x=p.apply(this,arguments);x.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return x};mxConnectionHandler.prototype.updatePreview=function(x){};var C=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var x=C.apply(this,arguments),N=x.getCell;x.getCell=mxUtils.bind(this,function(S){var Y=N.apply(this,arguments);this.error=null;return Y});+return x};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var x="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",N="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),S=0;S<N.length;S++)null!=+this.currentEdgeStyle[N[S]]&&(x+=N[S]+"="+this.currentEdgeStyle[N[S]]+";");null!=this.currentEdgeStyle.orthogonalLoop?x+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(x+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?x+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(x+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize++";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(x+="elbow="+this.currentEdgeStyle.elbow+";");return x=null!=this.currentEdgeStyle.html?x+("html="+this.currentEdgeStyle.html+";"):x+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var x=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=+x&&(new mxCodec(x.ownerDocument)).decode(x,this.getStylesheet())};Graph.prototype.createCellLookup=function(x,N){N=null!=N?N:{};for(var S=0;S<x.length;S++){var Y=x[S];N[mxObjectIdentity.get(Y)]=Y.getId();for(var ca=this.model.getChildCount(Y),ma=0;ma<ca;ma++)this.createCellLookup([this.model.getChildAt(Y,ma)],N)}return N};Graph.prototype.createCellMapping=function(x,N,S){S=null!=S?S:{};for(var Y in x){var ca=N[Y];null==S[ca]&&(S[ca]=x[Y].getId()||"")}return S};Graph.prototype.importGraphModel=function(x,+N,S,Y){N=null!=N?N:0;S=null!=S?S:0;var ca=new mxCodec(x.ownerDocument),ma=new mxGraphModel;ca.decode(x,ma);x=[];ca={};var qa={},wa=ma.getChildren(this.cloneCell(ma.root,this.isCloneInvalidEdges(),ca));if(null!=wa){var sa=this.createCellLookup([ma.root]);wa=wa.slice();this.model.beginUpdate();try{if(1!=wa.length||this.isCellLocked(this.getDefaultParent()))for(ma=0;ma<wa.length;ma++)ya=this.model.getChildren(this.moveCells([wa[ma]],N,S,!1,this.model.getRoot())[0]),null!=ya&&(x=x.concat(ya));else{var ya=+ma.getChildren(wa[0]);null!=ya&&(x=this.moveCells(ya,N,S,!1,this.getDefaultParent()),qa[ma.getChildAt(ma.root,0).getId()]=this.getDefaultParent().getId())}if(null!=x&&(this.createCellMapping(ca,sa,qa),this.updateCustomLinks(qa,x),Y)){this.isGridEnabled()&&(N=this.snap(N),S=this.snap(S));var Ga=this.getBoundingBoxFromGeometry(x,!0);null!=Ga&&this.moveCells(x,N-Ga.x,S-Ga.y)}}finally{this.model.endUpdate()}}return x};Graph.prototype.encodeCells=function(x){for(var N={},S=this.cloneCells(x,null,N),Y=+new mxDictionary,ca=0;ca<x.length;ca++)Y.put(x[ca],!0);var ma=new mxCodec,qa=new mxGraphModel,wa=qa.getChildAt(qa.getRoot(),0);for(ca=0;ca<S.length;ca++){qa.add(wa,S[ca]);var sa=this.view.getState(x[ca]);if(null!=sa){var ya=this.getCellGeometry(S[ca]);null!=ya&&ya.relative&&!this.model.isEdge(x[ca])&&null==Y.get(this.model.getParent(x[ca]))&&(ya.offset=null,ya.relative=!1,ya.x=sa.x/sa.view.scale-sa.view.translate.x,ya.y=sa.y/sa.view.scale-sa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(N,+this.createCellLookup(x)),S);return ma.encode(qa)};Graph.prototype.isSwimlane=function(x,N){var S=null;null==x||this.model.isEdge(x)||this.model.getParent(x)==this.model.getRoot()||(S=this.getCurrentCellStyle(x,N)[mxConstants.STYLE_SHAPE]);return S==mxConstants.SHAPE_SWIMLANE||"table"==S||"tableRow"==S};var G=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(x){return null!=x&&G.apply(this,arguments)?this.isTableCell(x)||this.isTableRow(x)?this.isCellEditable(this.model.getParent(x)):+!0:!1};var T=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(x){return null!=x&&T.apply(this,arguments)?this.isTableCell(x)||this.isTableRow(x)?this.isCellMovable(this.model.getParent(x)):!0:!1};var E=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(x){var N=this.model.getParent(x);if(null!=N){var S=this.getCurrentCellStyle(N);if(null!=S.expand)return"0"!=S.expand}return E.apply(this,arguments)&&(null==N||!this.isTable(N))};var P=Graph.prototype.splitEdge;+Graph.prototype.splitEdge=function(x,N,S,Y,ca,ma,qa,wa){null==wa&&(wa=this.model.getParent(x),this.isTable(wa)||this.isTableRow(wa))&&(wa=this.getCellAt(ma,qa,null,!0,!1));S=null;this.model.beginUpdate();try{var sa=this.getCellGeometry(x);if(null!=sa&&null!=sa.points&&0<sa.points.length&&1==N.length&&this.model.isVertex(N[0])){var ya=this.getCellGeometry(N[0]);if(null!=ya&&!ya.relative){var Ga=new mxRectangle(ya.x+Y,ya.y+ca,ya.width,ya.height),Ya=sa.points;ya=[];for(var Va=0;Va<Ya.length;Va++)Ga.intersectsPoint(Ya[Va].x,+Ya[Va].y)||ya.push(Ya[Va]);ya.length<Ya.length&&(sa=sa.clone(),sa.points=ya,this.model.setGeometry(x,sa))}}S=P.apply(this,[x,N,S,Y,ca,ma,qa,wa]);this.model.setValue(S,"");var eb=this.getChildCells(S,!0);for(Va=0;Va<eb.length;Va++)sa=this.getCellGeometry(eb[Va]),null!=sa&&sa.relative&&0<sa.x&&this.model.remove(eb[Va]);var ib=this.getChildCells(x,!0);for(Va=0;Va<ib.length;Va++)sa=this.getCellGeometry(ib[Va]),null!=sa&&sa.relative&&0>=sa.x&&this.model.remove(ib[Va]);var jb=this.model.getTerminal(S,!1);+if(null!=jb){var Ta=this.getCurrentCellStyle(jb);null!=Ta&&"1"==Ta.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[x]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[x]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[S]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[S]))}}finally{this.model.endUpdate()}return S};var L=Graph.prototype.selectCell;Graph.prototype.selectCell=function(x,N,S){if(N||S)L.apply(this,arguments);else{var Y=this.getSelectionCell(),ca=null,ma=[],qa=+mxUtils.bind(this,function(wa){if(null!=this.view.getState(wa)&&(this.model.isVertex(wa)||this.model.isEdge(wa)))if(ma.push(wa),wa==Y)ca=ma.length-1;else if(x&&null==Y&&0<ma.length||null!=ca&&x&&ma.length>ca||!x&&0<ca)return;for(var sa=0;sa<this.model.getChildCount(wa);sa++)qa(this.model.getChildAt(wa,sa))});qa(this.model.root);0<ma.length&&(ca=null!=ca?mxUtils.mod(ca+(x?1:-1),ma.length):0,this.setSelectionCell(ma[ca]))}};Graph.prototype.swapShapes=function(x,N){if(this.model.isVertex(x)&&this.model.isVertex(N)&&+2==this.getMovableCells([x,N]).length){var S=this.getCellGeometry(x),Y=this.getCellGeometry(N);if(null!=S&&null!=Y){var ca=S.clone(),ma=Y.clone();this.model.beginUpdate();try{ca.x=Y.getCenterX()-S.width/2,ca.y=Y.getCenterY()-S.height/2,ma.x=S.getCenterX()-Y.width/2,ma.y=S.getCenterY()-Y.height/2,this.model.setGeometry(x,ca),this.model.setGeometry(N,ma)}finally{this.model.endUpdate()}}}};var c=Graph.prototype.moveCells;Graph.prototype.moveCells=function(x,N,S,Y,ca,ma,qa){qa=null!=qa?qa:{};if(this.isTable(ca)){for(var wa=+[],sa=0;sa<x.length;sa++)this.isTable(x[sa])?wa=wa.concat(this.model.getChildCells(x[sa],!0).reverse()):wa.push(x[sa]);x=wa}this.model.beginUpdate();try{wa=[];for(sa=0;sa<x.length;sa++)if(null!=ca&&this.isTableRow(x[sa])){var ya=this.model.getParent(x[sa]),Ga=this.getCellGeometry(x[sa]);this.isTable(ya)&&wa.push(ya);if(null!=ya&&null!=Ga&&this.isTable(ya)&&this.isTable(ca)&&(Y||ya!=ca)){if(!Y){var Ya=this.getCellGeometry(ya);null!=Ya&&(Ya=Ya.clone(),Ya.height-=Ga.height,this.model.setGeometry(ya,+Ya))}Ya=this.getCellGeometry(ca);null!=Ya&&(Ya=Ya.clone(),Ya.height+=Ga.height,this.model.setGeometry(ca,Ya));var Va=this.model.getChildCells(ca,!0);if(0<Va.length){x[sa]=Y?this.cloneCell(x[sa]):x[sa];var eb=this.model.getChildCells(x[sa],!0),ib=this.model.getChildCells(Va[0],!0),jb=ib.length-eb.length;if(0<jb)for(var Ta=0;Ta<jb;Ta++){var qb=this.cloneCell(eb[eb.length-1]);null!=qb&&(qb.value="",this.model.add(x[sa],qb))}else if(0>jb)for(Ta=0;Ta>jb;Ta--)this.model.remove(eb[eb.length+Ta-1]);eb=this.model.getChildCells(x[sa],+!0);for(Ta=0;Ta<ib.length;Ta++){var hb=this.getCellGeometry(ib[Ta]),cb=this.getCellGeometry(eb[Ta]);null!=hb&&null!=cb&&(cb=cb.clone(),cb.width=hb.width,this.model.setGeometry(eb[Ta],cb))}}}}var fb=c.apply(this,arguments);for(sa=0;sa<wa.length;sa++)!Y&&this.model.contains(wa[sa])&&0==this.model.getChildCount(wa[sa])&&this.model.remove(wa[sa]);Y&&this.updateCustomLinks(this.createCellMapping(qa,this.createCellLookup(x)),fb)}finally{this.model.endUpdate()}return fb};var g=Graph.prototype.removeCells;+Graph.prototype.removeCells=function(x,N){var S=[];this.model.beginUpdate();try{for(var Y=0;Y<x.length;Y++)if(this.isTableCell(x[Y])){var ca=this.model.getParent(x[Y]),ma=this.model.getParent(ca);1==this.model.getChildCount(ca)&&1==this.model.getChildCount(ma)?0>mxUtils.indexOf(x,ma)&&0>mxUtils.indexOf(S,ma)&&S.push(ma):this.labelChanged(x[Y],"")}else{if(this.isTableRow(x[Y])&&(ma=this.model.getParent(x[Y]),0>mxUtils.indexOf(x,ma)&&0>mxUtils.indexOf(S,ma))){for(var qa=this.model.getChildCells(ma,+!0),wa=0,sa=0;sa<qa.length;sa++)0<=mxUtils.indexOf(x,qa[sa])&&wa++;wa==qa.length&&S.push(ma)}S.push(x[Y])}S=g.apply(this,[S,N])}finally{this.model.endUpdate()}return S};Graph.prototype.updateCustomLinks=function(x,N,S){S=null!=S?S:new Graph;for(var Y=0;Y<N.length;Y++)null!=N[Y]&&S.updateCustomLinksForCell(x,N[Y],S)};Graph.prototype.updateCustomLinksForCell=function(x,N){this.doUpdateCustomLinksForCell(x,N);for(var S=this.model.getChildCount(N),Y=0;Y<S;Y++)this.updateCustomLinksForCell(x,this.model.getChildAt(N,+Y))};Graph.prototype.doUpdateCustomLinksForCell=function(x,N){};Graph.prototype.getAllConnectionConstraints=function(x,N){if(null!=x){N=mxUtils.getValue(x.style,"points",null);if(null!=N){x=[];try{var S=JSON.parse(N);for(N=0;N<S.length;N++){var Y=S[N];x.push(new mxConnectionConstraint(new mxPoint(Y[0],Y[1]),2<Y.length?"0"!=Y[2]:!0,null,3<Y.length?Y[3]:0,4<Y.length?Y[4]:0))}}catch(ma){}return x}if(null!=x.shape&&null!=x.shape.bounds){Y=x.shape.direction;N=x.shape.bounds;var ca=x.shape.scale;S=N.width/+ca;N=N.height/ca;if(Y==mxConstants.DIRECTION_NORTH||Y==mxConstants.DIRECTION_SOUTH)Y=S,S=N,N=Y;N=x.shape.getConstraints(x.style,S,N);if(null!=N)return N;if(null!=x.shape.stencil&&null!=x.shape.stencil.constraints)return x.shape.stencil.constraints;if(null!=x.shape.constraints)return x.shape.constraints}}return null};Graph.prototype.flipEdge=function(x){if(null!=x){var N=this.getCurrentCellStyle(x);N=mxUtils.getValue(N,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?+mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,N,[x])}};Graph.prototype.isValidRoot=function(x){for(var N=this.model.getChildCount(x),S=0,Y=0;Y<N;Y++){var ca=this.model.getChildAt(x,Y);this.model.isVertex(ca)&&(ca=this.getCellGeometry(ca),null==ca||ca.relative||S++)}return 0<S||this.isContainer(x)};Graph.prototype.isValidDropTarget=function(x,N,S){for(var Y=this.getCurrentCellStyle(x),ca=!0,ma=!0,qa=0;qa<N.length&&ma;qa++)ca=ca&&this.isTable(N[qa]),+ma=ma&&this.isTableRow(N[qa]);return!this.isCellLocked(x)&&(this.isTargetShape(x,N,S)||("1"!=mxUtils.getValue(Y,"part","0")||this.isContainer(x))&&"0"!=mxUtils.getValue(Y,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(x))&&!this.isTableRow(x)&&(!this.isTable(x)||ma||ca))};Graph.prototype.createGroupCell=function(){var x=mxGraph.prototype.createGroupCell.apply(this,arguments);x.setStyle("group");return x};Graph.prototype.isExtendParentsOnAdd=function(x){var N=+mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(N&&null!=x&&null!=this.layoutManager){var S=this.model.getParent(x);null!=S&&(S=this.layoutManager.getLayout(S),null!=S&&S.constructor==mxStackLayout&&(N=!1))}return N};Graph.prototype.getPreferredSizeForCell=function(x,N,S){S=null!=S?S:this.gridEnabled;var Y=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=Y&&(Y.width+=10,Y.height+=4,S&&(Y.width=this.snap(Y.width),Y.height=this.snap(Y.height)));return Y};Graph.prototype.getAutosizeTextAvailableSpace=+function(x,N,S,Y){var ca=0,ma=0;(null!=Y&&null!=this.getImage(Y)||null!=x[mxConstants.STYLE_IMAGE])&&x[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(x[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),x[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(ma+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));ca+=2*parseFloat(mxUtils.getValue(x,+mxConstants.STYLE_SPACING,2));ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_LEFT,2));ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_RIGHT,2));ma+=2*parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING,2));ma+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_TOP,2));ma+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_BOTTOM,2));null!=Y&&(Y=this.getFoldingImage(Y),null!=Y&&(ca+=Y.width+8));x=mxUtils.getValue(x,mxConstants.STYLE_HORIZONTAL,!0);ca=(x?N:S)-+ca;N=(x?S:N)-ma;return 0>=ca||0>=N?null:{availW:ca,availH:N}};Graph.prototype.computeAutosizeTextFontSize=function(x,N,S,Y,ca,ma){var qa=1,wa=84,sa=ma?N:null,ya=null;if(ma){for(var Ga=x.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Ya=[],Va=0;Va<Ga.length;Va++)0<Ga[Va].length&&Ya.push(mxUtils.htmlEntities(Ga[Va],!1));0<Ya.length&&(ya=Ya.join("<br>"))}for(;qa<wa;)Ga=Math.ceil((qa+wa)/2),Ya=mxUtils.getSizeForString(x,Ga,Y,sa,ca),(Ya=ma?Ya.height<=S:Ya.width<=N&&Ya.height<=S)&&+ma&&null!=ya&&mxUtils.getSizeForString(ya,Ga,Y,null,ca).width>N&&(Ya=!1),Ya?qa=Ga:wa=Ga-1;return Math.max(6,qa)};Graph.prototype.updateAutosizeTextFontSize=function(x,N){var S=this.view.getState(x);null==S&&(S=this.view.createState(x));N=N||S.style;var Y=this.getCellGeometry(x);if(null!=Y&&!this.model.isEdge(x)){var ca=this.cellRenderer.getLabelValue(S);null!=ca&&0!=ca.length&&(S=this.getAutosizeTextAvailableSpace(N,Y.width,Y.height,S),null!=S&&(this.isHtmlLabel(x)||(ca=mxUtils.htmlEntities(ca,!1)),+ca=ca.replace(/\n/g,"<br>"),N=this.computeAutosizeTextFontSize(ca,S.availW,S.availH,N[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,N[mxConstants.STYLE_FONTSTYLE],"wrap"==N[mxConstants.STYLE_WHITE_SPACE]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,N,[x])))}};Graph.prototype.cellsResized=function(x,N,S){var Y=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=x)for(var ca=0;ca<x.length;ca++)this.model.isVertex(x[ca])&&this.isAutosizeTextCell(x[ca])&&this.updateAutosizeTextFontSize(x[ca]);+return Y};Graph.prototype.turnShapes=function(x,N){var S=this.getModel(),Y=[];S.beginUpdate();try{for(var ca=0;ca<x.length;ca++){var ma=x[ca];if(S.isEdge(ma)){var qa=S.getTerminal(ma,!0),wa=S.getTerminal(ma,!1);S.setTerminal(ma,wa,!0);S.setTerminal(ma,qa,!1);var sa=S.getGeometry(ma);if(null!=sa){sa=sa.clone();null!=sa.points&&sa.points.reverse();var ya=sa.getTerminalPoint(!0),Ga=sa.getTerminalPoint(!1);sa.setTerminalPoint(ya,!1);sa.setTerminalPoint(Ga,!0);S.setGeometry(ma,sa);var Ya=this.view.getState(ma),+Va=this.view.getState(qa),eb=this.view.getState(wa);if(null!=Ya){var ib=null!=Va?this.getConnectionConstraint(Ya,Va,!0):null,jb=null!=eb?this.getConnectionConstraint(Ya,eb,!1):null;this.setConnectionConstraint(ma,qa,!0,jb);this.setConnectionConstraint(ma,wa,!1,ib);var Ta=mxUtils.getValue(Ya.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Ya.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ma]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,+Ta,[ma])}Y.push(ma)}}else if(S.isVertex(ma)&&(sa=this.getCellGeometry(ma),null!=sa)){if(!(this.isTable(ma)||this.isTableRow(ma)||this.isTableCell(ma)||this.isSwimlane(ma))){sa=sa.clone();sa.x+=sa.width/2-sa.height/2;sa.y+=sa.height/2-sa.width/2;var qb=sa.width;sa.width=sa.height;sa.height=qb;S.setGeometry(ma,sa)}var hb=this.view.getState(ma);if(null!=hb){var cb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],fb=mxUtils.getValue(hb.style,+mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,cb[mxUtils.mod(mxUtils.indexOf(cb,fb)+(N?-1:1),cb.length)],[ma])}Y.push(ma)}}}finally{S.endUpdate()}return Y};Graph.prototype.stencilHasPlaceholders=function(x){if(null!=x&&null!=x.fgNode)for(x=x.fgNode.firstChild;null!=x;){if("text"==x.nodeName&&"1"==x.getAttribute("placeholders"))return!0;x=x.nextSibling}return!1};var l=Graph.prototype.processChange;Graph.prototype.processChange=function(x){if(x instanceof+mxGeometryChange&&(this.isTableCell(x.cell)||this.isTableRow(x.cell))&&(null==x.previous&&null!=x.geometry||null!=x.previous&&!x.previous.equals(x.geometry))){var N=x.cell;this.isTableCell(N)&&(N=this.model.getParent(N));this.isTableRow(N)&&(N=this.model.getParent(N));var S=this.view.getState(N);null!=S&&null!=S.shape&&(this.view.invalidate(N),S.shape.bounds=null)}l.apply(this,arguments);x instanceof mxValueChange&&null!=x.cell&&null!=x.cell.value&&"object"==typeof x.cell.value&&this.invalidateDescendantsWithPlaceholders(x.cell)};+Graph.prototype.invalidateDescendantsWithPlaceholders=function(x){x=this.model.getDescendants(x);if(0<x.length)for(var N=0;N<x.length;N++){var S=this.view.getState(x[N]);null!=S&&null!=S.shape&&null!=S.shape.stencil&&this.stencilHasPlaceholders(S.shape.stencil)?this.removeStateForCell(x[N]):this.isReplacePlaceholders(x[N])&&this.view.invalidate(x[N],!1,!1)}};Graph.prototype.replaceElement=function(x,N){N=x.ownerDocument.createElement(null!=N?N:"span");for(var S=Array.prototype.slice.call(x.attributes);attr=+S.pop();)N.setAttribute(attr.nodeName,attr.nodeValue);N.innerHTML=x.innerHTML;x.parentNode.replaceChild(N,x)};Graph.prototype.processElements=function(x,N){if(null!=x){x=x.getElementsByTagName("*");for(var S=0;S<x.length;S++)null!=x[S]&&N(x[S])}};Graph.prototype.updateLabelElements=function(x,N,S){x=null!=x?x:this.getSelectionCells();for(var Y=document.createElement("div"),ca=0;ca<x.length;ca++){var ma=this.getCurrentCellStyle(x[ca]);if(null!=ma&&"1"==ma.html&&(ma=this.convertValueToString(x[ca]),+null!=ma&&0<ma.length)){Y.innerHTML=Graph.sanitizeHtml(ma);for(var qa=Y.getElementsByTagName(null!=S?S:"*"),wa=0;wa<qa.length;wa++)N(qa[wa]);Y.innerHTML!=ma&&this.cellLabelChanged(x[ca],Y.innerHTML)}}};Graph.prototype.cellLabelChanged=function(x,N,S){N=Graph.zapGremlins(N);this.model.beginUpdate();try{if(null!=x.value&&"object"==typeof x.value){if(this.isReplacePlaceholders(x)&&null!=x.getAttribute("placeholder"))for(var Y=x.getAttribute("placeholder"),ca=x;null!=ca;){if(ca==this.model.getRoot()||+null!=ca.value&&"object"==typeof ca.value&&ca.hasAttribute(Y)){this.setAttributeForCell(ca,Y,N);break}ca=this.model.getParent(ca)}var ma=x.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&ma.hasAttribute("label_"+Graph.diagramLanguage)?ma.setAttribute("label_"+Graph.diagramLanguage,N):ma.setAttribute("label",N);N=ma}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(x)&&this.updateAutosizeTextFontSize(x)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=+function(x){if(null!=x){for(var N=new mxDictionary,S=0;S<x.length;S++)N.put(x[S],!0);var Y=[];for(S=0;S<x.length;S++){var ca=this.model.getParent(x[S]);null==ca||N.get(ca)||(N.put(ca,!0),Y.push(ca))}for(S=0;S<Y.length;S++)if(ca=this.view.getState(Y[S]),null!=ca&&(this.model.isEdge(ca.cell)||this.model.isVertex(ca.cell))&&this.isCellDeletable(ca.cell)&&this.isTransparentState(ca)){for(var ma=!0,qa=0;qa<this.model.getChildCount(ca.cell)&&ma;qa++)N.get(this.model.getChildAt(ca.cell,qa))||(ma=!1);ma&&+x.push(ca.cell)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(x){for(var N=[],S=0;S<x.length;S++)this.isCellDeletable(x[S])&&this.isTransparentState(this.view.getState(x[S]))&&N.push(x[S]);x=N;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(x,N){this.setAttributeForCell(x,"link",N)};Graph.prototype.createLinkOverlay=function(x){x=this.getLinkForCell(x);if(null!=x&&0<x.length){x=this.getLinkOverlayTooltip(x);+x=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),x,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));x.isLinkOverlay=!0;var N=this;x.addListener(mxEvent.CLICK,function(S,Y){N.setSelectionCell(Y.getProperty("cell"))});return x}return null};Graph.prototype.getLinkOverlayTooltip=function(x){return x};Graph.prototype.createTooltipOverlay=function(x){x=this.convertValueToTooltip(x);if(null!=x&&0<x.length){x=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),+x,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));x.isTooltipOverlay=!0;var N=this;x.addListener(mxEvent.CLICK,function(S,Y){S=Y.getProperty("cell");N.isEnabled()&&N.isCellEditable(S)?(N.setSelectionCell(S),N.editTooltip(S)):(Y=Y.getProperty("event"),S=N.getTooltipForCell(S),null!=S&&0<S.length&&N.tooltipHandler.show(S,Y.clientX,Y.clientY))});return x}return null};Graph.prototype.editTooltip=function(x){};Graph.prototype.setTooltipForCell=function(x,N){var S="tooltip";Graph.translateDiagram&&+null!=Graph.diagramLanguage&&mxUtils.isNode(x.value)&&x.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(S="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(x,S,N)};Graph.prototype.getAttributeForCell=function(x,N,S){x=null!=x.value&&"object"===typeof x.value?x.value.getAttribute(N):null;return null!=x?x:S};Graph.prototype.setAttributeForCell=function(x,N,S){if(null!=x.value&&"object"==typeof x.value)var Y=x.value.cloneNode(!0);else Y=mxUtils.createXmlDocument().createElement("UserObject"),+Y.setAttribute("label",x.value||"");null!=S?Y.setAttribute(N,S):Y.removeAttribute(N);this.model.setValue(x,Y)};Graph.prototype.isTargetShape=function(x,N,S){x=mxUtils.getValue(this.getCurrentCellStyle(x),mxConstants.STYLE_SHAPE,"");for(S=0;S<N.length;S++){var Y=mxUtils.getValue(this.getCurrentCellStyle(N[S]),"targetShapes","").split(",");if(0<=mxUtils.indexOf(Y,x))return!0}return!1};var t=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(x,N,S,Y){if(mxEvent.isAltDown(N))return null;+for(var ca=0;ca<x.length;ca++){var ma=this.model.getParent(x[ca]);if(this.model.isEdge(ma)&&0>mxUtils.indexOf(x,ma))return null}ma=t.apply(this,arguments);var qa=!0;for(ca=0;ca<x.length&&qa;ca++)qa=qa&&this.isTableRow(x[ca]);qa&&(this.isTableCell(ma)&&(ma=this.model.getParent(ma)),this.isTableRow(ma)&&(ma=this.model.getParent(ma)),this.isTable(ma)||(ma=null));return ma};Graph.prototype.click=function(x){mxGraph.prototype.click.call(this,x);this.firstClickState=x.getState();this.firstClickSource=x.getSource()};+Graph.prototype.dblClick=function(x,N){this.isEnabled()&&(N=this.insertTextForEvent(x,N),mxGraph.prototype.dblClick.call(this,x,N))};Graph.prototype.insertTextForEvent=function(x,N){var S=mxUtils.convertPoint(this.container,mxEvent.getClientX(x),mxEvent.getClientY(x));if(null!=x&&!this.model.isVertex(N)){var Y=this.model.isEdge(N)?this.view.getState(N):null,ca=mxEvent.getSource(x);this.firstClickState!=Y||this.firstClickSource!=ca||null!=Y&&null!=Y.text&&null!=Y.text.node&&null!=Y.text.boundingBox&&+(mxUtils.contains(Y.text.boundingBox,S.x,S.y)||mxUtils.isAncestorNode(Y.text.node,mxEvent.getSource(x)))||(null!=Y||this.isCellLocked(this.getDefaultParent()))&&(null==Y||this.isCellLocked(Y.cell))||!(null!=Y||mxClient.IS_SVG&&ca==this.view.getCanvas().ownerSVGElement)||(null==Y&&(Y=this.view.getState(this.getCellAt(S.x,S.y))),N=this.addText(S.x,S.y,Y))}return N};Graph.prototype.getInsertPoint=function(x){x=this.getGridSize();var N=this.container.scrollLeft/this.view.scale-this.view.translate.x,S=+this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var Y=this.getPageLayout(),ca=this.getPageSize();N=Math.max(N,Y.x*ca.width);S=Math.max(S,Y.y*ca.height)}return new mxPoint(this.snap(N+x),this.snap(S+x))};Graph.prototype.getFreeInsertPoint=function(x){var N=this.view,S=this.getGraphBounds(),Y=this.getInsertPoint(x);x=this.snap(Math.round(Math.max(Y.x,S.x/N.scale-N.translate.x+(0==S.width?2*this.gridSize:0))));N=this.snap(Math.round(Math.max(Y.y,(S.y+S.height)/N.scale-+N.translate.y+2*this.gridSize)));return new mxPoint(x,N)};Graph.prototype.getCenterInsertPoint=function(x){x=null!=x?x:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-x.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale-this.view.translate.y-x.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/+2/this.view.scale-this.view.translate.x-x.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-x.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(x,N){x=null!=x?x:"";null!=N&&(0<x.length&&";"!=x.charAt(x.length-1)&&(x+=";"),x+="fontSize="+N+";");return x};Graph.prototype.addText=function(x,N,S){var Y=new mxCell;Y.value="Text";Y.geometry=new mxGeometry(0,0,0,0);Y.vertex=!0;if(null!=S&&this.model.isEdge(S.cell)){Y.style=+"edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);Y.geometry.relative=!0;Y.connectable=!1;var ca=this.view.getRelativePoint(S,x,N);Y.geometry.x=Math.round(1E4*ca.x)/1E4;Y.geometry.y=Math.round(ca.y);Y.geometry.offset=new mxPoint(0,0);ca=this.view.getPoint(S,Y.geometry);var ma=this.view.scale;Y.geometry.offset=new mxPoint(Math.round((x-ca.x)/ma),Math.round((N-ca.y)/ma))}else ca=this.view.translate,Y.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",+this.vertexFontSize),Y.geometry.width=40,Y.geometry.height=20,Y.geometry.x=Math.round(x/this.view.scale)-ca.x-(null!=S?S.origin.x:0),Y.geometry.y=Math.round(N/this.view.scale)-ca.y-(null!=S?S.origin.y:0),Y.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([Y],null!=S?S.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[Y])),this.autoSizeCell(Y)}finally{this.getModel().endUpdate()}return Y};Graph.prototype.addClickHandler=function(x,N,S){var Y=mxUtils.bind(this,+function(){var sa=this.container.getElementsByTagName("a");if(null!=sa)for(var ya=0;ya<sa.length;ya++){var Ga=this.getAbsoluteUrl(sa[ya].getAttribute("href"));null!=Ga&&(sa[ya].setAttribute("rel",this.linkRelation),sa[ya].setAttribute("href",Ga),null!=N&&mxEvent.addGestureListeners(sa[ya],null,null,N))}});this.model.addListener(mxEvent.CHANGE,Y);Y();var ca=this.container.style.cursor,ma=this.getTolerance(),qa=this,wa={currentState:null,currentLink:null,currentTarget:null,highlight:null!=x&&""!=x&&+x!=mxConstants.NONE?new mxCellHighlight(qa,x,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(sa){var ya=sa.sourceState;if(null==ya||null==qa.getLinkForCell(ya.cell))sa=qa.getCellAt(sa.getGraphX(),sa.getGraphY(),null,null,null,function(Ga,Ya,Va){return null==qa.getLinkForCell(Ga.cell)}),ya=null==ya||qa.model.isAncestor(sa,ya.cell)?qa.view.getState(sa):null;ya!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=ya,null!=this.currentState&&this.activate(this.currentState))},+mouseDown:function(sa,ya){this.startX=ya.getGraphX();this.startY=ya.getGraphY();this.scrollLeft=qa.container.scrollLeft;this.scrollTop=qa.container.scrollTop;null==this.currentLink&&"auto"==qa.container.style.overflow&&(qa.container.style.cursor="move");this.updateCurrentState(ya)},mouseMove:function(sa,ya){if(qa.isMouseDown)null!=this.currentLink&&(sa=Math.abs(this.startX-ya.getGraphX()),ya=Math.abs(this.startY-ya.getGraphY()),(sa>ma||ya>ma)&&this.clear());else{for(sa=ya.getSource();null!=sa&&"a"!=+sa.nodeName.toLowerCase();)sa=sa.parentNode;null!=sa?this.clear():(null!=qa.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&qa.tooltipHandler.reset(ya,!0,this.currentState),(null==this.currentState||ya.getState()!=this.currentState&&null!=ya.sourceState||!qa.intersects(this.currentState,ya.getGraphX(),ya.getGraphY()))&&this.updateCurrentState(ya))}},mouseUp:function(sa,ya){var Ga=ya.getSource();for(sa=ya.getEvent();null!=Ga&&"a"!=Ga.nodeName.toLowerCase();)Ga=Ga.parentNode;null==+Ga&&Math.abs(this.scrollLeft-qa.container.scrollLeft)<ma&&Math.abs(this.scrollTop-qa.container.scrollTop)<ma&&(null==ya.sourceState||!ya.isSource(ya.sourceState.control))&&((mxEvent.isLeftMouseButton(sa)||mxEvent.isMiddleMouseButton(sa))&&!mxEvent.isPopupTrigger(sa)||mxEvent.isTouchEvent(sa))&&(null!=this.currentLink?(Ga=qa.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&Ga||null==N||N(sa,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(sa)||+(sa=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(sa)?"_blank":Ga?qa.linkTarget:"_top",qa.openLink(this.currentLink,sa),ya.consume())):null!=S&&!ya.isConsumed()&&Math.abs(this.scrollLeft-qa.container.scrollLeft)<ma&&Math.abs(this.scrollTop-qa.container.scrollTop)<ma&&Math.abs(this.startX-ya.getGraphX())<ma&&Math.abs(this.startY-ya.getGraphY())<ma&&S(ya.getEvent()));this.clear()},activate:function(sa){this.currentLink=qa.getAbsoluteUrl(qa.getLinkForCell(sa.cell));null!=this.currentLink&&+(this.currentTarget=qa.getLinkTargetForCell(sa.cell),qa.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(sa))},clear:function(){null!=qa.container&&(qa.container.style.cursor=ca);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=qa.tooltipHandler&&qa.tooltipHandler.hide()}};qa.click=function(sa){};qa.addMouseListener(wa);mxEvent.addListener(document,"mouseleave",function(sa){wa.clear()})};Graph.prototype.duplicateCells=+function(x,N){x=null!=x?x:this.getSelectionCells();N=null!=N?N:!0;for(var S=0;S<x.length;S++)this.isTableCell(x[S])&&(x[S]=this.model.getParent(x[S]));x=this.model.getTopmostCells(x);var Y=this.getModel(),ca=this.gridSize,ma=[];Y.beginUpdate();try{var qa={},wa=this.createCellLookup(x),sa=this.cloneCells(x,!1,qa,!0);for(S=0;S<x.length;S++){var ya=Y.getParent(x[S]);if(null!=ya){var Ga=this.moveCells([sa[S]],ca,ca,!1)[0];ma.push(Ga);if(N)Y.add(ya,sa[S]);else{var Ya=ya.getIndex(x[S]);Y.add(ya,sa[S],Ya++1)}if(this.isTable(ya)){var Va=this.getCellGeometry(sa[S]),eb=this.getCellGeometry(ya);null!=Va&&null!=eb&&(eb=eb.clone(),eb.height+=Va.height,Y.setGeometry(ya,eb))}}else ma.push(sa[S])}this.updateCustomLinks(this.createCellMapping(qa,wa),sa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",sa))}finally{Y.endUpdate()}return ma};Graph.prototype.insertImage=function(x,N,S){if(null!=x&&null!=this.cellEditor.textarea){for(var Y=this.cellEditor.textarea.getElementsByTagName("img"),ca=+[],ma=0;ma<Y.length;ma++)ca.push(Y[ma]);document.execCommand("insertimage",!1,x);x=this.cellEditor.textarea.getElementsByTagName("img");if(x.length==ca.length+1)for(ma=x.length-1;0<=ma;ma--)if(0==ma||x[ma]!=ca[ma-1]){x[ma].setAttribute("width",N);x[ma].setAttribute("height",S);break}}};Graph.prototype.insertLink=function(x){if(null!=this.cellEditor.textarea)if(0==x.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var N=this.cellEditor.textarea.getElementsByTagName("a"),S=[],Y=+0;Y<N.length;Y++)S.push(N[Y]);document.execCommand("createlink",!1,mxUtils.trim(x));N=this.cellEditor.textarea.getElementsByTagName("a");if(N.length==S.length+1)for(Y=N.length-1;0<=Y;Y--)if(N[Y]!=S[Y-1]){for(N=N[Y].getElementsByTagName("a");0<N.length;){for(S=N[0].parentNode;null!=N[0].firstChild;)S.insertBefore(N[0].firstChild,N[0]);S.removeChild(N[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(x))};Graph.prototype.isCellResizable=function(x){var N=mxGraph.prototype.isCellResizable.apply(this,+arguments),S=this.getCurrentCellStyle(x);return!this.isTableCell(x)&&!this.isTableRow(x)&&(N||"0"!=mxUtils.getValue(S,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==S[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(x,N,S){null==N&&(N=this.getSelectionCells());if(null!=N&&1<N.length){for(var Y=[],ca=null,ma=null,qa=0,wa=0;wa<N.length;wa++)if(this.getModel().isVertex(N[wa])){var sa=this.view.getState(N[wa]);if(null!=sa){var ya=x?sa.getCenterX():sa.getCenterY();ca=null!=ca?Math.max(ca,+ya):ya;ma=null!=ma?Math.min(ma,ya):ya;S&&(qa+=x?sa.width:sa.height);Y.push(sa)}}if(2<Y.length){Y.sort(function(ib,jb){return x?ib.x-jb.x:ib.y-jb.y});S&&(qa-=x?Y[0].width/2+Y[Y.length-1].width/2:Y[0].height/2+Y[Y.length-1].height/2);sa=this.view.translate;ya=this.view.scale;ma=ma/ya-(x?sa.x:sa.y);ca=ca/ya-(x?sa.x:sa.y);this.getModel().beginUpdate();try{var Ga=(ca-ma-qa)/(Y.length-1),Ya=ma+(S?x?Y[0].width/2:Y[0].height/2:0);for(wa=1;wa<Y.length-1;wa++){var Va=this.view.getState(this.model.getParent(Y[wa].cell)),+eb=this.getCellGeometry(Y[wa].cell);Ya+=Ga;null!=eb&&null!=Va&&(eb=eb.clone(),x?eb.x=Math.round(Ya-(S?0:eb.width/2))-Va.origin.x:eb.y=Math.round(Ya-(S?0:eb.height/2))-Va.origin.y,this.getModel().setGeometry(Y[wa].cell,eb));S&&(Ya+=x?Y[wa].width:Y[wa].height)}}finally{this.getModel().endUpdate()}}}return N};Graph.prototype.isCloneEvent=function(x){return mxClient.IS_MAC&&mxEvent.isMetaDown(x)||mxEvent.isControlDown(x)};Graph.prototype.createSvgImageExport=function(x){x=new mxImageExport;x.addCellData=+function(S,Y,ca){Y.setAttribute("data-cell-id",S.id);if(ca)if(mxUtils.isNode(S.value))for(ca=0;ca<S.value.attributes.length;ca++){var ma=S.value.attributes[ca];Y.setAttribute("data-cell-"+ma.name,ma.value)}else if("object"===typeof S.value)for(ma in S.value)Y.setAttribute("data-cell-"+ma,S.value[ma]);else null!=S.value&&Y.setAttribute("data-cell-value",S.value);return Y};var N=x.visitStatesRecursive;x.visitStatesRecursive=function(S,Y,ca){if(null!=S){var ma=Y.root,qa=Y.root.ownerDocument;Y.root=this.addCellData(S.cell,+null!=qa.createElementNS?qa.createElementNS(mxConstants.NS_SVG,"g"):qa.createElement("g"),Editor.addSvgMetadata);ma.appendChild(Y.root);N.apply(this,arguments);Y.root=ma}};x.getLinkForCellState=mxUtils.bind(this,function(S,Y){return this.getLinkForCell(S.cell)});x.getTitleForCellState=mxUtils.bind(this,function(S,Y){return Editor.convertHtmlToText(this.convertValueToTooltip(S.cell))});return x};Graph.prototype.parseBackgroundImage=function(x){var N=null;null!=x&&0<x.length&&(x=JSON.parse(x),N=new mxImage(x.src,+x.width,x.height));return N};Graph.prototype.getBackgroundImageObject=function(x){return x};Graph.prototype.getSvg=function(x,N,S,Y,ca,ma,qa,wa,sa,ya,Ga,Ya,Va,eb,ib,jb){var Ta=null;if(null!=eb)for(Ta=new mxDictionary,ca=0;ca<eb.length;ca++)Ta.put(eb[ca],!0);eb=this.useCssTransforms;var qb=this.enableFlowAnimation;this.enableFlowAnimation=!1;eb&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{N=null!=N?N:1;S=null!=S?S:0;ma=null!=ma?ma:!0;qa=null!=qa?qa:!0;ya=null!=ya?ya:+!1;sa=null!=sa?sa:this.defaultExportLinkTarget;var hb="page"==Va?this.view.getBackgroundPageBounds():ma&&null==Ta||Y||"diagram"==Va?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),cb=this.backgroundImage,fb=this.view.translate,lb=this.view.scale;"diagram"==Va&&null!=cb&&null!=cb.width&&null!=cb.height&&(hb=mxRectangle.fromRectangle(hb),hb.add(new mxRectangle((fb.x+cb.x)*lb,(fb.y+cb.y)*lb,cb.width*lb,cb.height*lb)));if(null==hb)throw Error(mxResources.get("drawingEmpty"));Y=N/lb;+var ub=Math.max(1,Math.ceil(hb.width*Y)+2*S)+(ya&&0==S?5:0),ob=Math.max(1,Math.ceil(hb.height*Y)+2*S)+(ya&&0==S?5:0),pb=mxUtils.getLightDarkColor(x),sb=Graph.createSvgNode(0,0,ub,ob,pb),rb=sb.ownerDocument;if(null!=x){var tb=mxUtils.createElementNs(rb,mxConstants.NS_SVG,"rect");tb.setAttribute("fill",pb.light);tb.style.fill=pb.cssText;tb.setAttribute("width","100%");tb.setAttribute("height","100%");tb.setAttribute("x","0");tb.setAttribute("y","0");sb.appendChild(tb)}var yb=mxUtils.createElementNs(rb,+mxConstants.NS_SVG,"g");sb.appendChild(yb);var vb=this.createSvgCanvas(yb);vb.translate(Math.floor(S/N-hb.x/lb),Math.floor(S/N-hb.y/lb));vb.idPrefix="drawio-svg-"+Editor.guid();var Fb=document.createElement("div"),zb=vb.getAlternateText;vb.getAlternateText=function(nb,Ab,wb,f,q,z,u,A,F,H,ha,O,va){if(null!=z&&0<this.state.fontSize)try{mxUtils.isNode(z)?z=z.innerText:(Fb.innerHTML=z,z=mxUtils.extractTextWithWhitespace(Fb.childNodes));for(var oa=Math.ceil(2*f/this.state.fontSize),Xa=[],kb=0,gb=0;(0==+oa||kb<oa)&&gb<z.length;){var Ea=z.charCodeAt(gb);if(10==Ea||13==Ea){if(0<kb)break}else Xa.push(z.charAt(gb)),255>Ea&&kb++;gb++}Xa.length<z.length&&1<z.length-Xa.length&&(z=mxUtils.trim(Xa.join(""))+"...");return z}catch(Ka){return zb.apply(this,arguments)}else return zb.apply(this,arguments)};if(null!=cb&&null!=cb.width&&null!=cb.height){x=lb/N;var xb=new mxRectangle((cb.x+fb.x)*x,(cb.y+fb.y)*x,cb.width*x,cb.height*x);mxUtils.intersects(hb,xb)&&vb.image(cb.x+fb.x,cb.y+fb.y,cb.width,cb.height,cb.src,+!0)}vb.scale(Y);vb.textEnabled=qa;wa=null!=wa?wa:this.createSvgImageExport();var mb=wa.getLinkForCellState;wa.getLinkForCellState=function(nb,Ab){var wb=nb.view.graph.getAbsoluteUrl(mb.apply(this,arguments));return null==wb||nb.view.graph.isCustomLink(wb)?null:wb};wa.getLinkTargetForCellState=function(nb,Ab){return nb.view.graph.getLinkTargetForCell(nb.cell)};var Bb=wa.drawCellState,Cb=null,Db=mxUtils.bind(this,function(){if(null==Cb){Cb="ge-flow-animation-"+Editor.guid();var nb=null!=rb.createElementNS?rb.createElementNS(mxConstants.NS_SVG,"style"):rb.createElement("style");nb.innerHTML=this.createFlowAnimationCss(Cb);rb.getElementsByTagName("defs")[0].appendChild(nb)}return Cb});wa.drawCellState=function(nb,Ab){for(var wb=nb.view.graph,f=null!=Ta?Ta.get(nb.cell):wb.isCellSelected(nb.cell),q=wb.model.getParent(nb.cell);!(ma&&null==Ta||f)&&null!=q;)f=null!=Ta?Ta.get(q):wb.isCellSelected(q),q=wb.model.getParent(q);if(null!=nb.shape)try{var z=nb.shape.isFlowAnimationEnabled,u=nb.shape.addFlowAnimationToShape;-nb.shape.isFlowAnimationEnabled=function(){return qb&&wb.model.isEdge(nb.cell)&&"1"==mxUtils.getValue(nb.style,"flowAnimation","0")};nb.shape.addFlowAnimationToShape=function(){wb.addFlowAnimationToNode(this.getFlowAnimationPath(),nb.style,P,Db())};if(ma&&null==Ta||f)wb.view.redrawEnumerationState(nb),Bb.apply(this,arguments),this.doDrawShape(nb.secondLabel,Ab)}finally{nb.shape.isFlowAnimationEnabled=z,nb.shape.addFlowAnimationToShape=u}};var Eb=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;-wa.drawState(this.getView().getState(Eb),vb);this.addForeignObjectWarning(vb,sb);jb?this.disableSvgLinks(sb):this.updateSvgLinks(sb,sa,!0);return sb}finally{this.enableFlowAnimation=qb,cb&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(y,P){if("0"!=urlParams["svg-warning"]&&0<P.getElementsByTagName("foreignObject").length){var S=y.createElement("switch"),X=y.createElement("g");X.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");-var ba=y.createElement("a");ba.setAttribute("transform","translate(0,-5)");null==ba.setAttributeNS||P.ownerDocument!=document&&null==document.documentMode?(ba.setAttribute("xlink:href",Graph.foreignObjectWarningLink),ba.setAttribute("target","_blank")):(ba.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),ba.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));y=y.createElement("text");y.setAttribute("text-anchor","middle");y.setAttribute("font-size","10px");y.setAttribute("x",-"50%");y.setAttribute("y","100%");mxUtils.write(y,Graph.foreignObjectWarningText);S.appendChild(X);ba.appendChild(y);S.appendChild(ba);P.appendChild(S)}};Graph.prototype.disableSvgLinks=function(y,P){y=y.getElementsByTagName("a");for(var S=0;S<y.length;S++){var X=y[S].getAttribute("href");null==X&&(X=y[S].getAttribute("xlink:href"));null!=X&&(y[S].style.pointerEvents="none",y[S].setAttribute("href",""));P&&P(y[S])}};Graph.prototype.updateSvgLinks=function(y,P,S){y=y.getElementsByTagName("a");for(var X=-0;X<y.length;X++)if(null==y[X].getAttribute("target")){var ba=y[X].getAttribute("href");null==ba&&(ba=y[X].getAttribute("xlink:href"));null!=ba&&(null!=P&&/^https?:\/\//.test(ba)?y[X].setAttribute("target",P):S&&this.isCustomLink(ba)&&y[X].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(y){y=new mxSvgCanvas2D(y);y.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;y.adaptiveColors=this.getAdaptiveColors();y.pointerEvents=!0;return y};Graph.prototype.getSelectedElement=-function(){var y=null;if(window.getSelection){var P=window.getSelection();P.getRangeAt&&P.rangeCount&&(y=P.getRangeAt(0).commonAncestorContainer)}else document.selection&&(y=document.selection.createRange().parentElement());return y};Graph.prototype.getSelectedEditingElement=function(){var y=null;if(null!=this.cellEditor.textarea)for(y=this.getSelectedElement();null!=y&&y.nodeType!=mxConstants.NODETYPE_ELEMENT;)y=y.parentNode;return y};Graph.prototype.getParentByName=function(y,P,S){for(;null!=y&&-y.nodeName!=P;){if(y==S)return null;y=y.parentNode}return y};Graph.prototype.getParentByNames=function(y,P,S){for(;null!=y&&!(0<=mxUtils.indexOf(P,y.nodeName));){if(y==S)return null;y=y.parentNode}return y};Graph.prototype.selectNode=function(y){var P=null;if(window.getSelection){if(P=window.getSelection(),P.getRangeAt&&P.rangeCount){var S=document.createRange();S.selectNode(y);P.removeAllRanges();P.addRange(S)}}else(P=document.selection)&&"Control"!=P.type&&(y=P.createRange(),y.collapse(!0),S=P.createRange(),-S.setEndPoint("StartToStart",y),S.select())};Graph.prototype.flipEdgePoints=function(y,P,S){var X=this.getCellGeometry(y);if(null!=X){X=X.clone();if(null!=X.points)for(var ba=0;ba<X.points.length;ba++)P?X.points[ba].x=S+(S-X.points[ba].x):X.points[ba].y=S+(S-X.points[ba].y);ba=function(ma){null!=ma&&(P?ma.x=S+(S-ma.x):ma.y=S+(S-ma.y))};ba(X.getTerminalPoint(!0));ba(X.getTerminalPoint(!1));this.model.setGeometry(y,X)}};Graph.prototype.flipChildren=function(y,P,S){this.model.beginUpdate();try{for(var X=-this.model.getChildCount(y),ba=0;ba<X;ba++){var ma=this.model.getChildAt(y,ba);if(this.model.isEdge(ma))this.flipEdgePoints(ma,P,S);else{var ra=this.getCellGeometry(ma);null!=ra&&(ra=ra.clone(),P?ra.x=S+(S-ra.x-ra.width):ra.y=S+(S-ra.y-ra.height),this.model.setGeometry(ma,ra))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(y,P,S){return null!=y&&1==mxUtils.getValue(y.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(y,P,S):mxGraph.prototype.getConnectionPoint.apply(this,-arguments)};Graph.prototype.getLegacyConnectionPoint=function(y,P,S){S=null!=S?S:!0;var X=null;if(null!=y&&null!=P.point){var ba=this.view.getPerimeterBounds(y),ma=new mxPoint(ba.getCenterX(),ba.getCenterY()),ra=y.style[mxConstants.STYLE_DIRECTION],wa=0;null!=ra&&1==mxUtils.getValue(y.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(ra==mxConstants.DIRECTION_NORTH?wa+=270:ra==mxConstants.DIRECTION_WEST?wa+=180:ra==mxConstants.DIRECTION_SOUTH&&(wa+=90),ra!=mxConstants.DIRECTION_NORTH&&ra!=mxConstants.DIRECTION_SOUTH||-ba.rotate90());X=this.view.scale;X=new mxPoint(ba.x+P.point.x*ba.width+P.dx*X,ba.y+P.point.y*ba.height+P.dy*X);var sa=y.style[mxConstants.STYLE_ROTATION]||0;if(P.perimeter)0!=wa&&(ra=ba=0,90==wa?ra=1:180==wa?ba=-1:270==wa&&(ra=-1),X=mxUtils.getRotatedPoint(X,ba,ra,ma)),X=this.view.getPerimeterPoint(y,X,!1);else if(sa+=wa,this.getModel().isVertex(y.cell)){wa=1==y.style[mxConstants.STYLE_FLIPH];P=1==y.style[mxConstants.STYLE_FLIPV];null!=y.shape&&null!=y.shape.stencil&&(wa=1==mxUtils.getValue(y.style,-"stencilFlipH",0)||wa,P=1==mxUtils.getValue(y.style,"stencilFlipV",0)||P);if(ra==mxConstants.DIRECTION_NORTH||ra==mxConstants.DIRECTION_SOUTH)y=wa,wa=P,P=y;wa&&(X.x=2*ba.getCenterX()-X.x);P&&(X.y=2*ba.getCenterY()-X.y)}0!=sa&&null!=X&&(y=mxUtils.toRadians(sa),ba=Math.cos(y),ra=Math.sin(y),X=mxUtils.getRotatedPoint(X,ba,ra,ma))}S&&null!=X&&(X.x=Math.round(X.x),X.y=Math.round(X.y));return X};Graph.prototype.flipCells=function(y,P){this.model.beginUpdate();try{y=this.model.getTopmostCells(y);for(var S=-[],X=0;X<y.length;X++)if(this.model.isEdge(y[X])){var ba=this.view.getState(y[X]);null!=ba&&this.flipEdgePoints(y[X],P,(P?ba.getCenterX():ba.getCenterY())/this.view.scale-(P?ba.origin.x:ba.origin.y)-(P?this.view.translate.x:this.view.translate.y))}else{var ma=this.getCellGeometry(y[X]);null!=ma&&this.flipChildren(y[X],P,P?ma.getCenterX()-ma.x:ma.getCenterY()-ma.y);S.push(y[X])}this.toggleCellStyles(P?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,S);this.setCellStyles("legacyAnchorPoints","0",-S)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(y,P){var S=null;if(null!=y&&0<y.length){this.model.beginUpdate();try{for(var X=0;X<y.length;X++){var ba=this.model.getParent(y[X]);if(this.isTable(ba)){var ma=this.getCellGeometry(y[X]),ra=this.getCellGeometry(ba);null!=ma&&null!=ra&&(ra=ra.clone(),ra.height-=ma.height,this.model.setGeometry(ba,ra))}}var wa=this.selectParentAfterDelete?this.model.getParents(y):null;this.removeCells(y,P)}finally{this.model.endUpdate()}if(null!=-wa)for(S=[],X=0;X<wa.length;X++)this.model.contains(wa[X])&&(this.model.isVertex(wa[X])||this.model.isEdge(wa[X]))&&S.push(wa[X])}return S};Graph.prototype.insertTableColumn=function(y,P){var S=this.getModel();S.beginUpdate();try{var X=y,ba=0;if(this.isTableCell(y)){var ma=S.getParent(y);X=S.getParent(ma);ba=mxUtils.indexOf(S.getChildCells(ma,!0),y)}else this.isTableRow(y)?X=S.getParent(y):y=S.getChildCells(X,!0)[0],P||(ba=S.getChildCells(y,!0).length-1);var ra=S.getChildCells(X,!0),wa=Graph.minTableColumnWidth;-for(y=0;y<ra.length;y++){var sa=S.getChildCells(ra[y],!0)[ba],xa=S.cloneCell(sa,!1);null==xa&&(xa=this.createVertex());var Fa=this.getCellGeometry(xa);xa.value=null;xa.style=mxUtils.setStyle(mxUtils.setStyle(xa.style,"rowspan",null),"colspan",null);if(null!=Fa){null!=Fa.alternateBounds&&(Fa.width=Fa.alternateBounds.width,Fa.height=Fa.alternateBounds.height,Fa.alternateBounds=null);wa=Fa.width;var Ya=this.getCellGeometry(ra[y]);null!=Ya&&(Fa.height=Ya.height)}S.add(ra[y],xa,ba+(P?0:1))}var Ua=this.getCellGeometry(X);-null!=Ua&&(Ua=Ua.clone(),Ua.width+=wa,S.setGeometry(X,Ua))}finally{S.endUpdate()}};Graph.prototype.deleteLane=function(y){var P=this.getModel();P.beginUpdate();try{var S=null;S="stackLayout"==this.getCurrentCellStyle(y).childLayout?y:P.getParent(y);var X=P.getChildCells(S,!0);0==X.length?P.remove(S):(S==y&&(y=X[X.length-1]),P.remove(y))}finally{P.endUpdate()}};Graph.prototype.insertLane=function(y,P){var S=this.getModel();S.beginUpdate();try{var X=null;if("stackLayout"==this.getCurrentCellStyle(y).childLayout){X=-y;var ba=S.getChildCells(X,!0);y=ba[P?0:ba.length-1]}else X=S.getParent(y);var ma=X.getIndex(y);y=S.cloneCell(y,!1);y.value=null;S.add(X,y,ma+(P?0:1))}finally{S.endUpdate()}};Graph.prototype.insertTableRow=function(y,P){var S=this.getModel();S.beginUpdate();try{var X=y,ba=y;if(this.isTableCell(y))ba=S.getParent(y),X=S.getParent(ba);else if(this.isTableRow(y))X=S.getParent(y);else{var ma=S.getChildCells(X,!0);ba=ma[P?0:ma.length-1]}var ra=S.getChildCells(ba,!0),wa=X.getIndex(ba);ba=S.cloneCell(ba,-!1);ba.value=null;var sa=this.getCellGeometry(ba);if(null!=sa){for(ma=0;ma<ra.length;ma++){y=S.cloneCell(ra[ma],!1);y.value=null;y.style=mxUtils.setStyle(mxUtils.setStyle(y.style,"rowspan",null),"colspan",null);var xa=this.getCellGeometry(y);null!=xa&&(null!=xa.alternateBounds&&(xa.width=xa.alternateBounds.width,xa.height=xa.alternateBounds.height,xa.alternateBounds=null),xa.height=sa.height);ba.insert(y)}S.add(X,ba,wa+(P?0:1));var Fa=this.getCellGeometry(X);null!=Fa&&(Fa=Fa.clone(),Fa.height+=sa.height,-S.setGeometry(X,Fa))}}finally{S.endUpdate()}};Graph.prototype.deleteTableColumn=function(y){var P=this.getModel();P.beginUpdate();try{var S=y,X=y;this.isTableCell(y)&&(X=P.getParent(y));this.isTableRow(X)&&(S=P.getParent(X));var ba=P.getChildCells(S,!0);if(0==ba.length)P.remove(S);else{this.isTableRow(X)||(X=ba[0]);var ma=P.getChildCells(X,!0);if(1>=ma.length)P.remove(S);else{var ra=ma.length-1;this.isTableCell(y)&&(ra=mxUtils.indexOf(ma,y));for(X=y=0;X<ba.length;X++){var wa=P.getChildCells(ba[X],-!0)[ra];P.remove(wa);var sa=this.getCellGeometry(wa);null!=sa&&(y=Math.max(y,sa.width))}var xa=this.getCellGeometry(S);null!=xa&&(xa=xa.clone(),xa.width-=y,P.setGeometry(S,xa))}}}finally{P.endUpdate()}};Graph.prototype.deleteTableRow=function(y){var P=this.getModel();P.beginUpdate();try{var S=y,X=y;this.isTableCell(y)&&(y=X=P.getParent(y));this.isTableRow(y)&&(S=P.getParent(X));var ba=P.getChildCells(S,!0);if(1>=ba.length)P.remove(S);else{this.isTableRow(X)||(X=ba[ba.length-1]);P.remove(X);y=0;var ma=-this.getCellGeometry(X);null!=ma&&(y=ma.height);var ra=this.getCellGeometry(S);null!=ra&&(ra=ra.clone(),ra.height-=y,P.setGeometry(S,ra))}}finally{P.endUpdate()}};Graph.prototype.insertRow=function(y,P){for(var S=y.tBodies[0],X=S.rows[0].cells,ba=y=0;ba<X.length;ba++){var ma=X[ba].getAttribute("colspan");y+=null!=ma?parseInt(ma):1}P=S.insertRow(P);for(ba=0;ba<y;ba++)mxUtils.br(P.insertCell(-1));return P.cells[0]};Graph.prototype.deleteRow=function(y,P){y.tBodies[0].deleteRow(P)};Graph.prototype.insertColumn=-function(y,P){var S=y.tHead;if(null!=S)for(var X=0;X<S.rows.length;X++){var ba=document.createElement("th");S.rows[X].appendChild(ba);mxUtils.br(ba)}y=y.tBodies[0];for(S=0;S<y.rows.length;S++)X=y.rows[S].insertCell(P),mxUtils.br(X);return y.rows[0].cells[0<=P?P:y.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(y,P){if(0<=P){y=y.tBodies[0].rows;for(var S=0;S<y.length;S++)y[S].cells.length>P&&y[S].deleteCell(P)}};Graph.prototype.pasteHtmlAtCaret=function(y){if(window.getSelection){var P=-window.getSelection();if(P.getRangeAt&&P.rangeCount){P=P.getRangeAt(0);P.deleteContents();var S=document.createElement("div");S.innerHTML=y;y=document.createDocumentFragment();for(var X;X=S.firstChild;)lastNode=y.appendChild(X);P.insertNode(y)}}else(P=document.selection)&&"Control"!=P.type&&P.createRange().pasteHTML(y)};Graph.prototype.createLinkForHint=function(y,P,S){function X(ma,ra){ma.length>ra&&(ma=ma.substring(0,Math.round(ra/2))+"..."+ma.substring(ma.length-Math.round(ra/4)));return ma}y=-null!=y?y:"javascript:void(0);";if(null==P||0==P.length)P=this.isCustomLink(y)?this.getLinkTitle(y):y;var ba=document.createElement("a");ba.setAttribute("rel",this.linkRelation);ba.setAttribute("href",this.getAbsoluteUrl(y));ba.setAttribute("title",X(this.isCustomLink(y)?this.getLinkTitle(y):y,80));null!=this.linkTarget&&ba.setAttribute("target",this.linkTarget);mxUtils.write(ba,X(P,40));this.isCustomLink(y)&&mxEvent.addListener(ba,"click",mxUtils.bind(this,function(ma){this.customLinkClicked(y,S);-mxEvent.consume(ma)}));return ba};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ma,ra){this.popupMenuHandler.hideMenu()});var y=this.updateMouseEvent;this.updateMouseEvent=function(ma){ma=y.apply(this,arguments);if(mxEvent.isTouchEvent(ma.getEvent())&&null==ma.getState()){var ra=this.getCellAt(ma.graphX,ma.graphY);null!=ra&&this.isSwimlane(ra)&&this.hitsSwimlaneContent(ra,-ma.graphX,ma.graphY)||(ma.state=this.view.getState(ra),null!=ma.state&&null!=ma.state.shape&&(this.container.style.cursor=ma.state.shape.node.style.cursor))}null==ma.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ma};var P=!1,S=!1,X=!1,ba=this.fireMouseEvent;this.fireMouseEvent=function(ma,ra,wa){ma==mxEvent.MOUSE_DOWN&&(ra=this.updateMouseEvent(ra),P=this.isCellSelected(ra.getCell()),S=this.isSelectionEmpty(),X=this.popupMenuHandler.isMenuShowing());ba.apply(this,arguments)};-this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(ma,ra){if(null!=this.freehand&&!this.freehand.isDrawing()){var wa=mxEvent.isMouseEvent(ra.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==ra.getState()||!ra.isSource(ra.getState().control))&&(this.popupMenuHandler.popupTrigger||!X&&!wa&&(S&&null==ra.getCell()&&this.isSelectionEmpty()||P&&this.isCellSelected(ra.getCell())));wa=!P||wa?null:mxUtils.bind(this,function(sa){window.setTimeout(mxUtils.bind(this,-function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var xa=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(ra.getX()+xa.x+1,ra.getY()+xa.y+1,sa,ra.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ma,ra,wa])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var y=this.graph.view.getState(this.editingCell);return null!=y&&1==y.style.html};mxCellEditor.prototype.isTableSelected=-function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var y="";window.getSelection?y=window.getSelection():document.getSelection?y=document.getSelection():document.selection&&(y=document.selection.createRange().text);return""!=y};mxCellEditor.prototype.insertTab=function(y){var P=this.textarea.ownerDocument.defaultView.getSelection(),S=P.getRangeAt(0);y=Graph.createTabNode(y);S.insertNode(y);S.setStartAfter(y);-S.setEndAfter(y);P.removeAllRanges();P.addRange(S)};mxCellEditor.prototype.alignText=function(y,P){var S=this.graph.getView().getState(this.editingCell);if(null!=S){S=mxUtils.getValue(S.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var X=null!=S&&"vertical-"==S.substring(0,9),ba=null!=P&&mxEvent.isShiftDown(P);if(ba||null!=window.getSelection&&null!=window.getSelection().containsNode){var ma=!0;this.graph.processElements(this.textarea,function(ra){ba||X||window.getSelection().containsNode(ra,-!0)?(ra.removeAttribute("align"),ra.style.textAlign=null):ma=!1});(ma||X)&&this.graph.cellEditor.setAlign(y)}X||document.execCommand("justify"+y.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var y=window.getSelection();if(y.getRangeAt&&y.rangeCount){for(var P=[],S=0,X=y.rangeCount;S<X;++S)P.push(y.getRangeAt(S));return P}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=-function(y){try{if(y)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var P=0,S=y.length;P<S;++P)sel.addRange(y[P])}else document.selection&&y.select&&y.select()}catch(X){}};var B=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(y){null!=y.text&&(y.text.replaceLinefeeds="0"!=mxUtils.getValue(y.style,"nl2Br","1"));B.apply(this,arguments)};var D=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(y,P){this.isKeepFocusEvent(y)||-!mxEvent.isAltDown(y.getEvent())?D.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(y){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var I=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(y,P){y=this.graph.getStartEditingCell(y,P);I.apply(this,arguments);var S=this.graph.view.getState(y);this.textarea.className=null!=S&&1==S.style.html?"mxCellEditor geContentEditable":-"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(y);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=S&&this.graph.isAutosizeTextState(S)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var y=this.graph.view.getState(this.editingCell);if(null!=y){var P=null!=y&&"0"!=mxUtils.getValue(y.style,"nl2Br","1"),-S=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);wa=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<wa.length&&"\n"==wa.charAt(wa.length-1)&&(wa=wa.substring(0,wa.length-1));wa=Graph.sanitizeHtml(P?wa.replace(/\n/g,"<br/>"):wa,!0);this.textarea.className="mxCellEditor geContentEditable";sa=mxUtils.getValue(y.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);P=mxUtils.getValue(y.style,mxConstants.STYLE_FONTFAMILY,-mxConstants.DEFAULT_FONTFAMILY);var X=mxUtils.getValue(y.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),ba=(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ma=(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,ra=[];(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&ra.push("underline");(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,-0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&ra.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(sa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(sa)+"px";this.textarea.style.textDecoration=ra.join(" ");this.textarea.style.fontWeight=ba?"bold":"normal";this.textarea.style.fontStyle=ma?"italic":"";this.textarea.style.fontFamily=P;this.textarea.style.textAlign=X;this.textarea.style.padding=+nb.shape.isFlowAnimationEnabled=function(){return qb&&wb.model.isEdge(nb.cell)&&"1"==mxUtils.getValue(nb.style,"flowAnimation","0")};nb.shape.addFlowAnimationToShape=function(){wb.addFlowAnimationToNode(this.getFlowAnimationPath(),nb.style,N,Db())};if(ma&&null==Ta||f)wb.view.redrawEnumerationState(nb),Bb.apply(this,arguments),this.doDrawShape(nb.secondLabel,Ab)}finally{nb.shape.isFlowAnimationEnabled=z,nb.shape.addFlowAnimationToShape=u}};var Eb=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;+wa.drawState(this.getView().getState(Eb),vb);this.addForeignObjectWarning(vb,sb);jb?this.disableSvgLinks(sb):this.updateSvgLinks(sb,sa,!0);return sb}finally{this.enableFlowAnimation=qb,eb&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(x,N){if("0"!=urlParams["svg-warning"]&&0<N.getElementsByTagName("foreignObject").length){var S=x.createElement("switch"),Y=x.createElement("g");Y.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");+var ca=x.createElement("a");ca.setAttribute("transform","translate(0,-5)");null==ca.setAttributeNS||N.ownerDocument!=document&&null==document.documentMode?(ca.setAttribute("xlink:href",Graph.foreignObjectWarningLink),ca.setAttribute("target","_blank")):(ca.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),ca.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));x=x.createElement("text");x.setAttribute("text-anchor","middle");x.setAttribute("font-size","10px");x.setAttribute("x",+"50%");x.setAttribute("y","100%");mxUtils.write(x,Graph.foreignObjectWarningText);S.appendChild(Y);ca.appendChild(x);S.appendChild(ca);N.appendChild(S)}};Graph.prototype.disableSvgLinks=function(x,N){x=x.getElementsByTagName("a");for(var S=0;S<x.length;S++){var Y=x[S].getAttribute("href");null==Y&&(Y=x[S].getAttribute("xlink:href"));null!=Y&&(x[S].style.pointerEvents="none",x[S].setAttribute("href",""));N&&N(x[S])}};Graph.prototype.updateSvgLinks=function(x,N,S){x=x.getElementsByTagName("a");for(var Y=+0;Y<x.length;Y++)if(null==x[Y].getAttribute("target")){var ca=x[Y].getAttribute("href");null==ca&&(ca=x[Y].getAttribute("xlink:href"));null!=ca&&(null!=N&&/^https?:\/\//.test(ca)?x[Y].setAttribute("target",N):S&&this.isCustomLink(ca)&&x[Y].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(x){x=new mxSvgCanvas2D(x);x.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;x.adaptiveColors=this.getAdaptiveColors();x.pointerEvents=!0;return x};Graph.prototype.getSelectedElement=+function(){var x=null;if(window.getSelection){var N=window.getSelection();N.getRangeAt&&N.rangeCount&&(x=N.getRangeAt(0).commonAncestorContainer)}else document.selection&&(x=document.selection.createRange().parentElement());return x};Graph.prototype.getSelectedEditingElement=function(){var x=null;if(null!=this.cellEditor.textarea)for(x=this.getSelectedElement();null!=x&&x.nodeType!=mxConstants.NODETYPE_ELEMENT;)x=x.parentNode;return x};Graph.prototype.getParentByName=function(x,N,S){for(;null!=x&&+x.nodeName!=N;){if(x==S)return null;x=x.parentNode}return x};Graph.prototype.getParentByNames=function(x,N,S){for(;null!=x&&!(0<=mxUtils.indexOf(N,x.nodeName));){if(x==S)return null;x=x.parentNode}return x};Graph.prototype.selectNode=function(x){var N=null;if(window.getSelection){if(N=window.getSelection(),N.getRangeAt&&N.rangeCount){var S=document.createRange();S.selectNode(x);N.removeAllRanges();N.addRange(S)}}else(N=document.selection)&&"Control"!=N.type&&(x=N.createRange(),x.collapse(!0),S=N.createRange(),+S.setEndPoint("StartToStart",x),S.select())};Graph.prototype.flipEdgePoints=function(x,N,S){var Y=this.getCellGeometry(x);if(null!=Y){Y=Y.clone();if(null!=Y.points)for(var ca=0;ca<Y.points.length;ca++)N?Y.points[ca].x=S+(S-Y.points[ca].x):Y.points[ca].y=S+(S-Y.points[ca].y);ca=function(ma){null!=ma&&(N?ma.x=S+(S-ma.x):ma.y=S+(S-ma.y))};ca(Y.getTerminalPoint(!0));ca(Y.getTerminalPoint(!1));this.model.setGeometry(x,Y)}};Graph.prototype.flipChildren=function(x,N,S){this.model.beginUpdate();try{for(var Y=+this.model.getChildCount(x),ca=0;ca<Y;ca++){var ma=this.model.getChildAt(x,ca);if(this.model.isEdge(ma))this.flipEdgePoints(ma,N,S);else{var qa=this.getCellGeometry(ma);null!=qa&&(qa=qa.clone(),N?qa.x=S+(S-qa.x-qa.width):qa.y=S+(S-qa.y-qa.height),this.model.setGeometry(ma,qa))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(x,N,S){return null!=x&&1==mxUtils.getValue(x.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(x,N,S):mxGraph.prototype.getConnectionPoint.apply(this,+arguments)};Graph.prototype.getLegacyConnectionPoint=function(x,N,S){S=null!=S?S:!0;var Y=null;if(null!=x&&null!=N.point){var ca=this.view.getPerimeterBounds(x),ma=new mxPoint(ca.getCenterX(),ca.getCenterY()),qa=x.style[mxConstants.STYLE_DIRECTION],wa=0;null!=qa&&1==mxUtils.getValue(x.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(qa==mxConstants.DIRECTION_NORTH?wa+=270:qa==mxConstants.DIRECTION_WEST?wa+=180:qa==mxConstants.DIRECTION_SOUTH&&(wa+=90),qa!=mxConstants.DIRECTION_NORTH&&qa!=mxConstants.DIRECTION_SOUTH||+ca.rotate90());Y=this.view.scale;Y=new mxPoint(ca.x+N.point.x*ca.width+N.dx*Y,ca.y+N.point.y*ca.height+N.dy*Y);var sa=x.style[mxConstants.STYLE_ROTATION]||0;if(N.perimeter)0!=wa&&(qa=ca=0,90==wa?qa=1:180==wa?ca=-1:270==wa&&(qa=-1),Y=mxUtils.getRotatedPoint(Y,ca,qa,ma)),Y=this.view.getPerimeterPoint(x,Y,!1);else if(sa+=wa,this.getModel().isVertex(x.cell)){wa=1==x.style[mxConstants.STYLE_FLIPH];N=1==x.style[mxConstants.STYLE_FLIPV];null!=x.shape&&null!=x.shape.stencil&&(wa=1==mxUtils.getValue(x.style,+"stencilFlipH",0)||wa,N=1==mxUtils.getValue(x.style,"stencilFlipV",0)||N);if(qa==mxConstants.DIRECTION_NORTH||qa==mxConstants.DIRECTION_SOUTH)x=wa,wa=N,N=x;wa&&(Y.x=2*ca.getCenterX()-Y.x);N&&(Y.y=2*ca.getCenterY()-Y.y)}0!=sa&&null!=Y&&(x=mxUtils.toRadians(sa),ca=Math.cos(x),qa=Math.sin(x),Y=mxUtils.getRotatedPoint(Y,ca,qa,ma))}S&&null!=Y&&(Y.x=Math.round(Y.x),Y.y=Math.round(Y.y));return Y};Graph.prototype.flipCells=function(x,N){this.model.beginUpdate();try{x=this.model.getTopmostCells(x);for(var S=+[],Y=0;Y<x.length;Y++)if(this.model.isEdge(x[Y])){var ca=this.view.getState(x[Y]);null!=ca&&this.flipEdgePoints(x[Y],N,(N?ca.getCenterX():ca.getCenterY())/this.view.scale-(N?ca.origin.x:ca.origin.y)-(N?this.view.translate.x:this.view.translate.y))}else{var ma=this.getCellGeometry(x[Y]);null!=ma&&this.flipChildren(x[Y],N,N?ma.getCenterX()-ma.x:ma.getCenterY()-ma.y);S.push(x[Y])}this.toggleCellStyles(N?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,S);this.setCellStyles("legacyAnchorPoints","0",+S)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(x,N){var S=null;if(null!=x&&0<x.length){this.model.beginUpdate();try{for(var Y=0;Y<x.length;Y++){var ca=this.model.getParent(x[Y]);if(this.isTable(ca)){var ma=this.getCellGeometry(x[Y]),qa=this.getCellGeometry(ca);null!=ma&&null!=qa&&(qa=qa.clone(),qa.height-=ma.height,this.model.setGeometry(ca,qa))}}var wa=this.selectParentAfterDelete?this.model.getParents(x):null;this.removeCells(x,N)}finally{this.model.endUpdate()}if(null!=+wa)for(S=[],Y=0;Y<wa.length;Y++)this.model.contains(wa[Y])&&(this.model.isVertex(wa[Y])||this.model.isEdge(wa[Y]))&&S.push(wa[Y])}return S};Graph.prototype.insertTableColumn=function(x,N){var S=this.getModel();S.beginUpdate();try{var Y=x,ca=0;if(this.isTableCell(x)){var ma=S.getParent(x);Y=S.getParent(ma);ca=mxUtils.indexOf(S.getChildCells(ma,!0),x)}else this.isTableRow(x)?Y=S.getParent(x):x=S.getChildCells(Y,!0)[0],N||(ca=S.getChildCells(x,!0).length-1);var qa=S.getChildCells(Y,!0),wa=Graph.minTableColumnWidth;+for(x=0;x<qa.length;x++){var sa=S.getChildCells(qa[x],!0)[ca],ya=S.cloneCell(sa,!1);null==ya&&(ya=this.createVertex());var Ga=this.getCellGeometry(ya);ya.value=null;ya.style=mxUtils.setStyle(mxUtils.setStyle(ya.style,"rowspan",null),"colspan",null);if(null!=Ga){null!=Ga.alternateBounds&&(Ga.width=Ga.alternateBounds.width,Ga.height=Ga.alternateBounds.height,Ga.alternateBounds=null);wa=Ga.width;var Ya=this.getCellGeometry(qa[x]);null!=Ya&&(Ga.height=Ya.height)}S.add(qa[x],ya,ca+(N?0:1))}var Va=this.getCellGeometry(Y);+null!=Va&&(Va=Va.clone(),Va.width+=wa,S.setGeometry(Y,Va))}finally{S.endUpdate()}};Graph.prototype.deleteLane=function(x){var N=this.getModel();N.beginUpdate();try{var S=null;S="stackLayout"==this.getCurrentCellStyle(x).childLayout?x:N.getParent(x);var Y=N.getChildCells(S,!0);0==Y.length?N.remove(S):(S==x&&(x=Y[Y.length-1]),N.remove(x))}finally{N.endUpdate()}};Graph.prototype.insertLane=function(x,N){var S=this.getModel();S.beginUpdate();try{var Y=null;if("stackLayout"==this.getCurrentCellStyle(x).childLayout){Y=+x;var ca=S.getChildCells(Y,!0);x=ca[N?0:ca.length-1]}else Y=S.getParent(x);var ma=Y.getIndex(x);x=S.cloneCell(x,!1);x.value=null;S.add(Y,x,ma+(N?0:1))}finally{S.endUpdate()}};Graph.prototype.insertTableRow=function(x,N){var S=this.getModel();S.beginUpdate();try{var Y=x,ca=x;if(this.isTableCell(x))ca=S.getParent(x),Y=S.getParent(ca);else if(this.isTableRow(x))Y=S.getParent(x);else{var ma=S.getChildCells(Y,!0);ca=ma[N?0:ma.length-1]}var qa=S.getChildCells(ca,!0),wa=Y.getIndex(ca);ca=S.cloneCell(ca,+!1);ca.value=null;var sa=this.getCellGeometry(ca);if(null!=sa){for(ma=0;ma<qa.length;ma++){x=S.cloneCell(qa[ma],!1);x.value=null;x.style=mxUtils.setStyle(mxUtils.setStyle(x.style,"rowspan",null),"colspan",null);var ya=this.getCellGeometry(x);null!=ya&&(null!=ya.alternateBounds&&(ya.width=ya.alternateBounds.width,ya.height=ya.alternateBounds.height,ya.alternateBounds=null),ya.height=sa.height);ca.insert(x)}S.add(Y,ca,wa+(N?0:1));var Ga=this.getCellGeometry(Y);null!=Ga&&(Ga=Ga.clone(),Ga.height+=sa.height,+S.setGeometry(Y,Ga))}}finally{S.endUpdate()}};Graph.prototype.deleteTableColumn=function(x){var N=this.getModel();N.beginUpdate();try{var S=x,Y=x;this.isTableCell(x)&&(Y=N.getParent(x));this.isTableRow(Y)&&(S=N.getParent(Y));var ca=N.getChildCells(S,!0);if(0==ca.length)N.remove(S);else{this.isTableRow(Y)||(Y=ca[0]);var ma=N.getChildCells(Y,!0);if(1>=ma.length)N.remove(S);else{var qa=ma.length-1;this.isTableCell(x)&&(qa=mxUtils.indexOf(ma,x));for(Y=x=0;Y<ca.length;Y++){var wa=N.getChildCells(ca[Y],+!0)[qa];N.remove(wa);var sa=this.getCellGeometry(wa);null!=sa&&(x=Math.max(x,sa.width))}var ya=this.getCellGeometry(S);null!=ya&&(ya=ya.clone(),ya.width-=x,N.setGeometry(S,ya))}}}finally{N.endUpdate()}};Graph.prototype.deleteTableRow=function(x){var N=this.getModel();N.beginUpdate();try{var S=x,Y=x;this.isTableCell(x)&&(x=Y=N.getParent(x));this.isTableRow(x)&&(S=N.getParent(Y));var ca=N.getChildCells(S,!0);if(1>=ca.length)N.remove(S);else{this.isTableRow(Y)||(Y=ca[ca.length-1]);N.remove(Y);x=0;var ma=+this.getCellGeometry(Y);null!=ma&&(x=ma.height);var qa=this.getCellGeometry(S);null!=qa&&(qa=qa.clone(),qa.height-=x,N.setGeometry(S,qa))}}finally{N.endUpdate()}};Graph.prototype.insertRow=function(x,N){for(var S=x.tBodies[0],Y=S.rows[0].cells,ca=x=0;ca<Y.length;ca++){var ma=Y[ca].getAttribute("colspan");x+=null!=ma?parseInt(ma):1}N=S.insertRow(N);for(ca=0;ca<x;ca++)mxUtils.br(N.insertCell(-1));return N.cells[0]};Graph.prototype.deleteRow=function(x,N){x.tBodies[0].deleteRow(N)};Graph.prototype.insertColumn=+function(x,N){var S=x.tHead;if(null!=S)for(var Y=0;Y<S.rows.length;Y++){var ca=document.createElement("th");S.rows[Y].appendChild(ca);mxUtils.br(ca)}x=x.tBodies[0];for(S=0;S<x.rows.length;S++)Y=x.rows[S].insertCell(N),mxUtils.br(Y);return x.rows[0].cells[0<=N?N:x.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(x,N){if(0<=N){x=x.tBodies[0].rows;for(var S=0;S<x.length;S++)x[S].cells.length>N&&x[S].deleteCell(N)}};Graph.prototype.pasteHtmlAtCaret=function(x){if(window.getSelection){var N=+window.getSelection();if(N.getRangeAt&&N.rangeCount){N=N.getRangeAt(0);N.deleteContents();var S=document.createElement("div");S.innerHTML=x;x=document.createDocumentFragment();for(var Y;Y=S.firstChild;)lastNode=x.appendChild(Y);N.insertNode(x)}}else(N=document.selection)&&"Control"!=N.type&&N.createRange().pasteHTML(x)};Graph.prototype.createLinkForHint=function(x,N,S){function Y(ma,qa){ma.length>qa&&(ma=ma.substring(0,Math.round(qa/2))+"..."+ma.substring(ma.length-Math.round(qa/4)));return ma}x=+null!=x?x:"javascript:void(0);";if(null==N||0==N.length)N=this.isCustomLink(x)?this.getLinkTitle(x):x;var ca=document.createElement("a");ca.setAttribute("rel",this.linkRelation);ca.setAttribute("href",this.getAbsoluteUrl(x));ca.setAttribute("title",Y(this.isCustomLink(x)?this.getLinkTitle(x):x,80));null!=this.linkTarget&&ca.setAttribute("target",this.linkTarget);mxUtils.write(ca,Y(N,40));this.isCustomLink(x)&&mxEvent.addListener(ca,"click",mxUtils.bind(this,function(ma){this.customLinkClicked(x,S);+mxEvent.consume(ma)}));return ca};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ma,qa){this.popupMenuHandler.hideMenu()});var x=this.updateMouseEvent;this.updateMouseEvent=function(ma){ma=x.apply(this,arguments);if(mxEvent.isTouchEvent(ma.getEvent())&&null==ma.getState()){var qa=this.getCellAt(ma.graphX,ma.graphY);null!=qa&&this.isSwimlane(qa)&&this.hitsSwimlaneContent(qa,+ma.graphX,ma.graphY)||(ma.state=this.view.getState(qa),null!=ma.state&&null!=ma.state.shape&&(this.container.style.cursor=ma.state.shape.node.style.cursor))}null==ma.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ma};var N=!1,S=!1,Y=!1,ca=this.fireMouseEvent;this.fireMouseEvent=function(ma,qa,wa){ma==mxEvent.MOUSE_DOWN&&(qa=this.updateMouseEvent(qa),N=this.isCellSelected(qa.getCell()),S=this.isSelectionEmpty(),Y=this.popupMenuHandler.isMenuShowing());ca.apply(this,arguments)};+this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(ma,qa){if(null!=this.freehand&&!this.freehand.isDrawing()){var wa=mxEvent.isMouseEvent(qa.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==qa.getState()||!qa.isSource(qa.getState().control))&&(this.popupMenuHandler.popupTrigger||!Y&&!wa&&(S&&null==qa.getCell()&&this.isSelectionEmpty()||N&&this.isCellSelected(qa.getCell())));wa=!N||wa?null:mxUtils.bind(this,function(sa){window.setTimeout(mxUtils.bind(this,+function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var ya=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(qa.getX()+ya.x+1,qa.getY()+ya.y+1,sa,qa.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ma,qa,wa])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var x=this.graph.view.getState(this.editingCell);return null!=x&&1==x.style.html};mxCellEditor.prototype.isTableSelected=+function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var x="";window.getSelection?x=window.getSelection():document.getSelection?x=document.getSelection():document.selection&&(x=document.selection.createRange().text);return""!=x};mxCellEditor.prototype.insertTab=function(x){var N=this.textarea.ownerDocument.defaultView.getSelection(),S=N.getRangeAt(0);x=Graph.createTabNode(x);S.insertNode(x);S.setStartAfter(x);+S.setEndAfter(x);N.removeAllRanges();N.addRange(S)};mxCellEditor.prototype.alignText=function(x,N){var S=this.graph.getView().getState(this.editingCell);if(null!=S){S=mxUtils.getValue(S.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var Y=null!=S&&"vertical-"==S.substring(0,9),ca=null!=N&&mxEvent.isShiftDown(N);if(ca||null!=window.getSelection&&null!=window.getSelection().containsNode){var ma=!0;this.graph.processElements(this.textarea,function(qa){ca||Y||window.getSelection().containsNode(qa,+!0)?(qa.removeAttribute("align"),qa.style.textAlign=null):ma=!1});(ma||Y)&&this.graph.cellEditor.setAlign(x)}Y||document.execCommand("justify"+x.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var x=window.getSelection();if(x.getRangeAt&&x.rangeCount){for(var N=[],S=0,Y=x.rangeCount;S<Y;++S)N.push(x.getRangeAt(S));return N}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=+function(x){try{if(x)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var N=0,S=x.length;N<S;++N)sel.addRange(x[N])}else document.selection&&x.select&&x.select()}catch(Y){}};var B=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(x){null!=x.text&&(x.text.replaceLinefeeds="0"!=mxUtils.getValue(x.style,"nl2Br","1"));B.apply(this,arguments)};var D=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(x,N){this.isKeepFocusEvent(x)||+!mxEvent.isAltDown(x.getEvent())?D.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(x){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var I=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(x,N){x=this.graph.getStartEditingCell(x,N);I.apply(this,arguments);var S=this.graph.view.getState(x);this.textarea.className=null!=S&&1==S.style.html?"mxCellEditor geContentEditable":+"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(x);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=S&&this.graph.isAutosizeTextState(S)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var x=this.graph.view.getState(this.editingCell);if(null!=x){var N=null!=x&&"0"!=mxUtils.getValue(x.style,"nl2Br","1"),+S=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);wa=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<wa.length&&"\n"==wa.charAt(wa.length-1)&&(wa=wa.substring(0,wa.length-1));wa=Graph.sanitizeHtml(N?wa.replace(/\n/g,"<br/>"):wa,!0);this.textarea.className="mxCellEditor geContentEditable";sa=mxUtils.getValue(x.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);N=mxUtils.getValue(x.style,mxConstants.STYLE_FONTFAMILY,+mxConstants.DEFAULT_FONTFAMILY);var Y=mxUtils.getValue(x.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),ca=(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ma=(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,qa=[];(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&qa.push("underline");(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,+0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&qa.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(sa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(sa)+"px";this.textarea.style.textDecoration=qa.join(" ");this.textarea.style.fontWeight=ca?"bold":"normal";this.textarea.style.fontStyle=ma?"italic":"";this.textarea.style.fontFamily=N;this.textarea.style.textAlign=Y;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(P?wa.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):wa,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var sa=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(sa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(sa)+"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=S;this.resize()}};var L=mxCellEditor.prototype.resize;-mxCellEditor.prototype.resize=function(y,P){if(null!=this.textarea)if(y=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=y){var S=y.view.scale;this.bounds=mxRectangle.fromRectangle(y);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*S;this.bounds.height=60*S;var X=null!=y.text?y.text.margin:null;null==X&&(X=mxUtils.getAlignmentAsPoint(mxUtils.getValue(y.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(y.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)/S)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/S)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/S)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*-S);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/S)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*S);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("+S+","+S+")")}else if(null!=y&&this.graph.isAutosizeTextState(y)){S=y.view.scale;X=y.style;var ba=-this.graph.getCellGeometry(this.editingCell);if(null!=ba){this.bounds=mxRectangle.fromRectangle(y);this.textarea.style.left=Math.round(y.x)+"px";this.textarea.style.top=Math.round(y.y)+"px";var ma=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=ma?"rotate("+ma+"deg) ":"")+"scale("+S+","+S+")");this.textarea.style.borderWidth="0";this.textarea.style.width=-Math.round(ba.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(ba.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==X[mxConstants.STYLE_WHITE_SPACE]&&(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var ra=parseInt(mxUtils.getValue(X,mxConstants.STYLE_SPACING,2));S=ra+parseInt(mxUtils.getValue(X,mxConstants.STYLE_SPACING_TOP,0));ma=ra+parseInt(mxUtils.getValue(X,-mxConstants.STYLE_SPACING_BOTTOM,0));var wa=ra+parseInt(mxUtils.getValue(X,mxConstants.STYLE_SPACING_LEFT,0));ra+=parseInt(mxUtils.getValue(X,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(wa)+"px";this.textarea.style.paddingRight=Math.round(ra)+"px";this.textarea.style.paddingTop=Math.round(S)+"px";this.textarea.style.paddingBottom=Math.round(ma)+"px";this.textarea.style.display="flex";this.textarea.style.flexDirection="column";S=mxUtils.getValue(X,mxConstants.STYLE_VERTICAL_ALIGN,-mxConstants.ALIGN_MIDDLE);this.textarea.style.justifyContent=S==mxConstants.ALIGN_MIDDLE?"center":S==mxConstants.ALIGN_BOTTOM?"flex-end":"flex-start";S=this.textarea.innerText;null!=S&&0<S.length&&(ba=this.graph.getAutosizeTextAvailableSpace(X,ba.width,ba.height,y),null!=ba&&(S=mxUtils.htmlEntities(S,!1).replace(/\n/g,"<br>"),X=this.graph.computeAutosizeTextFontSize(S,ba.availW,ba.availH,X[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,X[mxConstants.STYLE_FONTSTYLE],"wrap"==X[mxConstants.STYLE_WHITE_SPACE]),-this.textarea.style.fontSize=X+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?X*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection=-"",this.textarea.style.justifyContent="",L.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(y,P){if("0"==mxUtils.getValue(y.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var S=this.graph.getEditingValue(y.cell,P);"1"==mxUtils.getValue(y.style,"nl2Br","1")&&(S=S.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(S,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;-mxCellEditor.prototype.setEditingValue=function(y,P){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(y.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(y){if("0"==mxUtils.getValue(y.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,-Graph.backupStyleAttribute);var P=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(y.style,"nl2Br","1")?(P=P.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<P.length&&("<br/>"==P.substring(P.length-5)||"<br>"==P.substring(P.length-4))&&(P=P.substring(0,P.lastIndexOf("<br"))+"<div><br/></div>")):P=P.replace(/\r\n/g,"").replace(/\n/g,"");return P};var N=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(y){this.codeViewMode&&this.toggleViewMode();N.apply(this,-arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(y){}};var K=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(y,P){this.graph.getModel().beginUpdate();try{K.apply(this,arguments),""==P&&this.graph.isCellDeletable(y.cell)&&0==this.graph.model.getChildCount(y.cell)&&this.graph.isTransparentState(y)&&this.graph.removeCells([y.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=-function(y){y=mxUtils.getValue(y.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);y==mxConstants.NONE&&(y=null);return y};mxCellEditor.prototype.getBorderColor=function(y){y=mxUtils.getValue(y.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);y==mxConstants.NONE&&(y=null);return y};mxCellEditor.prototype.getMinimumSize=function(y){var P=this.graph.getView().scale;return new mxRectangle(0,0,null==y.text?30:y.text.size*P+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;-mxGraphHandler.prototype.isValidDropTarget=function(y,P){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(P.getEvent)};mxGraphView.prototype.formatUnitText=function(y){return y?d(y,this.unit):y};mxGraphHandler.prototype.updateHint=function(y){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var P=this.graph.view.translate,S=this.graph.view.scale;y=this.roundLength((this.bounds.x+-this.currentDx)/S-P.x);P=this.roundLength((this.bounds.y+this.currentDy)/S-P.y);S=this.graph.view.unit;this.hint.innerHTML=d(y,S)+", "+d(P,S);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 da=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(y,P){da.apply(this,arguments);var S=this.graph.getCellStyle(y);if(null==S.childLayout){var X=this.graph.model.getParent(y),ba=null!=X?this.graph.getCellGeometry(X):null;if(null!=ba&&(S=this.graph.getCellStyle(X),"stackLayout"==S.childLayout)){var ma=parseFloat(mxUtils.getValue(S,"stackBorder",mxStackLayout.prototype.border));S="1"==mxUtils.getValue(S,"horizontalStack","1");var ra=this.graph.getActualStartSize(X);-ba=ba.clone();S?ba.height=P.height+ra.y+ra.height+2*ma:ba.width=P.width+ra.x+ra.width+2*ma;this.graph.model.setGeometry(X,ba)}}};var ja=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function y(wa){S.get(wa)||(S.put(wa,!0),ba.push(wa))}for(var P=ja.apply(this,arguments),S=new mxDictionary,X=this.graph.model,ba=[],ma=0;ma<P.length;ma++){var ra=P[ma];this.graph.isTableCell(ra)?y(X.getParent(X.getParent(ra))):this.graph.isTableRow(ra)&&-y(X.getParent(ra));y(ra)}return ba};var ea=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(y){return ea.apply(this,arguments)&&!mxEvent.isControlDown(y.getEvent())&&!mxEvent.isShiftDown(y.getEvent())};var ca=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return ca.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 fa=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(y){var P=fa.apply(this,arguments);P.stroke="#C0C0C0";P.strokewidth=1;return P};var la=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(y){var P=la.apply(this,arguments);P.stroke="#C0C0C0";P.strokewidth=1;return P};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=-function(){var y=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+y.x/2,this.bounds.y+this.rotationHandleVSpacing-y.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(y,P){return this.graph.isRecursiveVertexResize(y)&&!mxEvent.isAltDown(P.getEvent())};mxVertexHandler.prototype.isCenteredEvent=function(y,P){return mxEvent.isControlDown(P.getEvent())||mxEvent.isMetaDown(P.getEvent())};var ka=mxVertexHandler.prototype.isRotationHandleVisible;-mxVertexHandler.prototype.isRotationHandleVisible=function(){return ka.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.isConnectHandleVisible=function(){return Editor.showConnectHandle&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=--12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var y=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+y.x/2,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+y.y/2)};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 V=mxVertexHandler.prototype.isParentHighlightVisible;-mxVertexHandler.prototype.isParentHighlightVisible=function(){return V.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var k=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(y){return y.tableHandle||k.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var y=0;this.graph.isTableRow(this.state.cell)?-y=1:this.graph.isTableCell(this.state.cell)&&(y=2);return y};var x=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return x.apply(this,arguments).grow(-this.getSelectionBorderInset())};var J=null,R=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==J&&(J=mxCellRenderer.defaultShapes.tableLine);var y=R.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var P=-function(hb,jb,Ta){for(var qb=[],gb=0;gb<hb.length;gb++){var bb=hb[gb];qb.push(null==bb?null:new mxPoint((sa+bb.x+jb)*ma,(xa+bb.y+Ta)*ma))}return qb},S=this,X=this.graph,ba=X.model,ma=X.view.scale,ra=this.state,wa=this.selectionBorder,sa=this.state.origin.x+X.view.translate.x,xa=this.state.origin.y+X.view.translate.y;null==y&&(y=[]);var Fa=X.view.getCellStates(ba.getChildCells(this.state.cell,!0));if(0<Fa.length){var Ya=ba.getChildCells(Fa[0].cell,!0),Ua=X.getTableLines(this.state.cell,!1,!0),cb=-X.getTableLines(this.state.cell,!0,!1);for(ba=0;ba<Fa.length;ba++)mxUtils.bind(this,function(hb){var jb=Fa[hb],Ta=null;if(X.isCellMovable(jb.cell)){Ta=hb<Fa.length-1?Fa[hb+1]:null;Ta=null!=Ta?X.getCellGeometry(Ta.cell):null;var qb=null!=Ta&&null!=Ta.alternateBounds?Ta.alternateBounds:Ta;Ta=null!=cb[hb]?new J(cb[hb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Ta.isDashed=wa.isDashed;Ta.svgStrokeTolerance++;Ta=new mxHandle(jb,"row-resize",null,Ta);Ta.tableHandle=!0;var gb=-0;Ta.shape.node.parentNode.insertBefore(Ta.shape.node,Ta.shape.node.parentNode.firstChild);Ta.redraw=function(){if(null!=this.shape){this.shape.stroke=0==gb?mxConstants.NONE:wa.stroke;if(this.shape.constructor==J)this.shape.line=P(cb[hb],0,gb),this.shape.updateBoundsFromLine();else{var db=X.getActualStartSize(ra.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+gb*ma;this.shape.bounds.x=ra.x+(hb==Fa.length-1?0:db.x*ma);this.shape.bounds.width=ra.width-(hb==Fa.length--1?0:db.width+db.x+ma)}this.shape.redraw()}};var bb=!1;Ta.setPosition=function(db,lb,ub){gb=Math.max(Graph.minTableRowHeight-db.height,lb.y-db.y-db.height);bb=mxEvent.isShiftDown(ub.getEvent());null!=qb&&bb&&(gb=Math.min(gb,qb.height-Graph.minTableRowHeight))};Ta.execute=function(db){if(0!=gb)X.setTableRowHeight(this.state.cell,gb,!bb);else if(!S.blockDelayedSelection){var lb=X.getCellAt(db.getGraphX(),db.getGraphY())||ra.cell;X.graphHandler.selectCellForEvent(lb,db)}gb=0};Ta.reset=function(){gb=0}}y.push(Ta)})(ba);-for(ba=0;ba<Ya.length;ba++)mxUtils.bind(this,function(hb){var jb=X.view.getState(Ya[hb]),Ta=X.getCellGeometry(Ya[hb]),qb=null!=Ta.alternateBounds?Ta.alternateBounds:Ta;null==jb&&(jb=new mxCellState(X.view,Ya[hb],X.getCellStyle(Ya[hb])),jb.x=ra.x+Ta.x*ma,jb.y=ra.y+Ta.y*ma,jb.width=qb.width*ma,jb.height=qb.height*ma,jb.updateCachedBounds());Ta=hb<Ya.length-1?Ya[hb+1]:null;Ta=null!=Ta?X.getCellGeometry(Ta):null;var gb=null!=Ta&&null!=Ta.alternateBounds?Ta.alternateBounds:Ta;Ta=null!=Ua[hb]?new J(Ua[hb],-mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Ta.isDashed=wa.isDashed;Ta.svgStrokeTolerance++;jb=new mxHandle(jb,"col-resize",null,Ta);jb.tableHandle=!0;var bb=0;jb.shape.node.parentNode.insertBefore(jb.shape.node,jb.shape.node.parentNode.firstChild);jb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==bb?mxConstants.NONE:wa.stroke;if(this.shape.constructor==J)this.shape.line=P(Ua[hb],bb,0),this.shape.updateBoundsFromLine();else{var lb=X.getActualStartSize(ra.cell,-!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(qb.width+bb)*ma;this.shape.bounds.y=ra.y+(hb==Ya.length-1?0:lb.y*ma);this.shape.bounds.height=ra.height-(hb==Ya.length-1?0:(lb.height+lb.y)*ma)}this.shape.redraw()}};var db=!1;jb.setPosition=function(lb,ub,ob){bb=Math.max(Graph.minTableColumnWidth-qb.width,ub.x-lb.x-qb.width);db=mxEvent.isShiftDown(ob.getEvent());null==gb||db||(bb=Math.min(bb,gb.width-Graph.minTableColumnWidth))};jb.execute=function(lb){if(0!=bb)X.setTableColumnWidth(this.state.cell,-bb,db);else if(!S.blockDelayedSelection){var ub=X.getCellAt(lb.getGraphX(),lb.getGraphY())||ra.cell;X.graphHandler.selectCellForEvent(ub,lb)}bb=0};jb.positionChanged=function(){};jb.reset=function(){bb=0};y.push(jb)})(ba)}}return null!=y?y.reverse():null};var Y=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(y){Y.apply(this,arguments);if(null!=this.moveHandles)for(var P=0;P<this.moveHandles.length;P++)null!=this.moveHandles[P]&&(this.moveHandles[P].node.style.visibility=-y?"":"hidden");if(null!=this.cornerHandles)for(P=0;P<this.cornerHandles.length;P++)this.cornerHandles[P].node.style.visibility=y?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var y=this.isMoveHandlesVisible();y&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():y||null==this.moveHandles||this.destroyMoveHandles();if(y&&-null==this.moveHandles){for(y=0;y<this.moveHandles.length;y++)null!=this.moveHandles[y]&&this.moveHandles[y].parentNode.removeChild(this.moveHandles[y]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var y=this.graph,P=y.model,S=[],X=0;X<P.getChildCount(this.state.cell);X++)mxUtils.bind(this,function(ba){if(null!=ba&&P.isVertex(ba.cell)&&y.isCellMovable(ba.cell)){var ma=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ma=new mxImageShape(ma,-this.rowHandleImage.src);ma.rowState=ba;ma.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ma.init(this.graph.getView().getOverlayPane());ma.node.style.cursor="move";mxEvent.addGestureListeners(ma.node,mxUtils.bind(this,function(ra){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(ra)&&this.graph.isCellSelected(ba.cell)||this.graph.selectCellForEvent(ba.cell,ra);mxEvent.isPopupTrigger(ra)||(this.graph.graphHandler.start(this.state.cell,-mxEvent.getClientX(ra),mxEvent.getClientY(ra),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(ra),this.graph.isMouseDown=!0);mxEvent.consume(ra)}),null,mxUtils.bind(this,function(ra){mxEvent.isPopupTrigger(ra)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(ra),mxEvent.getClientY(ra),ba.cell,ra),mxEvent.consume(ra))}));S.push(ma)}else S.push(null)})(this.graph.view.getState(P.getChildAt(this.state.cell,X)));return S};-mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var y=0;y<this.moveHandles.length;y++)null!=this.moveHandles[y]&&this.moveHandles[y].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var y=0;y<this.cornerHandles.length;y++)null!=this.cornerHandles[y]&&null!=this.cornerHandles[y].node&&null!=this.cornerHandles[y].node.parentNode&&this.cornerHandles[y].node.parentNode.removeChild(this.cornerHandles[y].node);-this.cornerHandles=null}};var Z=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){Z.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 y=0;4>-y;y++){var P=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);P.dialect=mxConstants.DIALECT_SVG;P.init(this.graph.view.getOverlayPane());this.cornerHandles.push(P)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();y=this.graph.getLinkForCell(this.state.cell);P=this.graph.getLinksForState(this.state);this.updateLinkHint(y,P)};var W=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=-function(){var y=new mxPoint(0,0),P=this.tolerance,S=this.state.style.shape;null==mxCellRenderer.defaultShapes[S]&&mxStencilRegistry.getStencil(S);S=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!S&&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 ba=this.customHandles[X].shape.bounds,ma=ba.getCenterX(),ra=ba.getCenterY();-if(Math.abs(this.state.x-ma)<ba.width/2||Math.abs(this.state.y-ra)<ba.height/2||Math.abs(this.state.x+this.state.width-ma)<ba.width/2||Math.abs(this.state.y+this.state.height-ra)<ba.height/2){S=!0;break}}S&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(P/=2,this.graph.isTable(this.state.cell)&&(P+=7),y.x=this.sizers[0].bounds.width+P,y.y=this.sizers[0].bounds.height+P):y=W.apply(this,arguments);return y};mxVertexHandler.prototype.updateHint=function(y){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{y=this.state.view.scale;var P=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/y),P)+" x "+d(this.roundLength(this.bounds.height/y),P)}y=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==y&&(y=this.bounds);this.hint.style.left=-y.x+Math.round((y.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=y.y+y.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 U=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){U.apply(this,arguments);var y=this.graph.getLinkForCell(this.state.cell),P=this.graph.getLinksForState(this.state);-this.updateLinkHint(y,P)};var aa=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(y,P){aa.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 ia=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(y,P){ia.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&-(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(y,P,S){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var X=this.graph.view.translate,ba=this.graph.view.scale,ma=this.roundLength(P.x/ba-X.x);X=this.roundLength(P.y/ba-X.y);var ra=this.graph.view.unit;this.hint.innerHTML=d(ma,ra)+", "+d(X,ra);this.hint.style.visibility="visible";null!=S&&(S.view.updateEdgeBounds(S),this.hint.innerHTML+=" ("+(ra==mxConstants.POINTS?Math.round(S.length/-ba):d(S.length/ba,ra))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(S=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*S.x)+"%, "+Math.round(100*S.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(y.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(y.getGraphY(),P.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=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+-HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');+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 sa=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(sa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(sa)+"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=S;this.resize()}};var K=mxCellEditor.prototype.resize;+mxCellEditor.prototype.resize=function(x,N){if(null!=this.textarea)if(x=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=x){var S=x.view.scale;this.bounds=mxRectangle.fromRectangle(x);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*S;this.bounds.height=60*S;var Y=null!=x.text?x.text.margin:null;null==Y&&(Y=mxUtils.getAlignmentAsPoint(mxUtils.getValue(x.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(x.style,mxConstants.STYLE_VERTICAL_ALIGN,+mxConstants.ALIGN_MIDDLE)));this.bounds.x+=Y.x*this.bounds.width;this.bounds.y+=Y.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/S)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/S)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/S)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*+S);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/S)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*S);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("+S+","+S+")")}else if(null!=x&&this.graph.isAutosizeTextState(x)){S=x.view.scale;Y=x.style;var ca=+this.graph.getCellGeometry(this.editingCell);if(null!=ca){this.bounds=mxRectangle.fromRectangle(x);this.textarea.style.left=Math.round(x.x)+"px";this.textarea.style.top=Math.round(x.y)+"px";var ma=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=ma?"rotate("+ma+"deg) ":"")+"scale("+S+","+S+")");this.textarea.style.borderWidth="0";this.textarea.style.width=+Math.round(ca.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(ca.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==Y[mxConstants.STYLE_WHITE_SPACE]&&(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var qa=parseInt(mxUtils.getValue(Y,mxConstants.STYLE_SPACING,2));S=qa+parseInt(mxUtils.getValue(Y,mxConstants.STYLE_SPACING_TOP,0));ma=qa+parseInt(mxUtils.getValue(Y,+mxConstants.STYLE_SPACING_BOTTOM,0));var wa=qa+parseInt(mxUtils.getValue(Y,mxConstants.STYLE_SPACING_LEFT,0));qa+=parseInt(mxUtils.getValue(Y,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(wa)+"px";this.textarea.style.paddingRight=Math.round(qa)+"px";this.textarea.style.paddingTop=Math.round(S)+"px";this.textarea.style.paddingBottom=Math.round(ma)+"px";this.textarea.style.display="table-cell";this.textarea.style.flexDirection="";this.textarea.style.justifyContent="";+S=mxUtils.getValue(Y,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.verticalAlign=S==mxConstants.ALIGN_MIDDLE?"middle":S==mxConstants.ALIGN_BOTTOM?"bottom":"top";S=this.textarea.innerText;null!=S&&0<S.length&&(ca=this.graph.getAutosizeTextAvailableSpace(Y,ca.width,ca.height,x),null!=ca&&(S=mxUtils.htmlEntities(S,!1).replace(/\n/g,"<br>"),Y=this.graph.computeAutosizeTextFontSize(S,ca.availW,ca.availH,Y[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,Y[mxConstants.STYLE_FONTSTYLE],+"wrap"==Y[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=Y+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Y*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight=+"",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",K.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(x,N){if("0"==mxUtils.getValue(x.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var S=this.graph.getEditingValue(x.cell,N);"1"==mxUtils.getValue(x.style,"nl2Br","1")&&(S=S.replace(/\n/g,"<br/>"));+return Graph.sanitizeHtml(S,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(x,N){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(x.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(x){if("0"==mxUtils.getValue(x.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(x.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 M=mxCellEditor.prototype.stopEditing;+mxCellEditor.prototype.stopEditing=function(x){this.codeViewMode&&this.toggleViewMode();M.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(x){}};var V=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(x,N){this.graph.getModel().beginUpdate();try{V.apply(this,arguments),""==N&&this.graph.isCellDeletable(x.cell)&&0==this.graph.model.getChildCount(x.cell)&&this.graph.isTransparentState(x)&&+this.graph.removeCells([x.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(x){x=mxUtils.getValue(x.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);x==mxConstants.NONE&&(x=null);return x};mxCellEditor.prototype.getBorderColor=function(x){x=mxUtils.getValue(x.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);x==mxConstants.NONE&&(x=null);return x};mxCellEditor.prototype.getMinimumSize=function(x){var N=this.graph.getView().scale;return new mxRectangle(0,+0,null==x.text?30:x.text.size*N+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(x,N){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(N.getEvent)};mxGraphView.prototype.formatUnitText=function(x){return x?d(x,this.unit):x};mxGraphHandler.prototype.updateHint=function(x){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,S=this.graph.view.scale;x=this.roundLength((this.bounds.x+this.currentDx)/S-N.x);N=this.roundLength((this.bounds.y+this.currentDy)/S-N.y);S=this.graph.view.unit;this.hint.innerHTML=d(x,S)+", "+d(N,S);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 Q=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(x,N){Q.apply(this,arguments);var S=this.graph.getCellStyle(x);if(null==S.childLayout){var Y=this.graph.model.getParent(x),ca=null!=Y?this.graph.getCellGeometry(Y):null;if(null!=ca&&(S=this.graph.getCellStyle(Y),"stackLayout"==S.childLayout)){var ma=parseFloat(mxUtils.getValue(S,"stackBorder",mxStackLayout.prototype.border));+S="1"==mxUtils.getValue(S,"horizontalStack","1");var qa=this.graph.getActualStartSize(Y);ca=ca.clone();S?ca.height=N.height+qa.y+qa.height+2*ma:ca.width=N.width+qa.x+qa.width+2*ma;this.graph.model.setGeometry(Y,ca)}}};var ja=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function x(wa){S.get(wa)||(S.put(wa,!0),ca.push(wa))}for(var N=ja.apply(this,arguments),S=new mxDictionary,Y=this.graph.model,ca=[],ma=0;ma<N.length;ma++){var qa=+N[ma];this.graph.isTableCell(qa)?x(Y.getParent(Y.getParent(qa))):this.graph.isTableRow(qa)&&x(Y.getParent(qa));x(qa)}return ca};var ea=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(x){return ea.apply(this,arguments)&&!mxEvent.isControlDown(x.getEvent())&&!mxEvent.isShiftDown(x.getEvent())};var da=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return da.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 ia=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(x){var N=ia.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=1;return N};var la=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(x){var N=la.apply(this,arguments);N.stroke="#C0C0C0";N.strokewidth=+1;return N};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var x=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+x.x/2,this.bounds.y+this.rotationHandleVSpacing-x.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(x,N){return this.graph.isRecursiveVertexResize(x)&&!mxEvent.isAltDown(N.getEvent())};mxVertexHandler.prototype.isCenteredEvent=function(x,N){return mxEvent.isControlDown(N.getEvent())||+mxEvent.isMetaDown(N.getEvent())};var ka=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return ka.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.isConnectHandleVisible=function(){return Editor.showConnectHandle&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&+!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var x=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+x.x/2,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+x.y/2)};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 W=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return W.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var k=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(x){return x.tableHandle||k.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=+function(){var x=0;this.graph.isTableRow(this.state.cell)?x=1:this.graph.isTableCell(this.state.cell)&&(x=2);return x};var y=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return y.apply(this,arguments).grow(-this.getSelectionBorderInset())};var J=null,R=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==J&&(J=mxCellRenderer.defaultShapes.tableLine);var x=R.apply(this,arguments);+if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var N=function(ib,jb,Ta){for(var qb=[],hb=0;hb<ib.length;hb++){var cb=ib[hb];qb.push(null==cb?null:new mxPoint((sa+cb.x+jb)*ma,(ya+cb.y+Ta)*ma))}return qb},S=this,Y=this.graph,ca=Y.model,ma=Y.view.scale,qa=this.state,wa=this.selectionBorder,sa=this.state.origin.x+Y.view.translate.x,ya=this.state.origin.y+Y.view.translate.y;null==x&&(x=[]);var Ga=Y.view.getCellStates(ca.getChildCells(this.state.cell,!0));if(0<Ga.length){var Ya=+ca.getChildCells(Ga[0].cell,!0),Va=Y.getTableLines(this.state.cell,!1,!0),eb=Y.getTableLines(this.state.cell,!0,!1);for(ca=0;ca<Ga.length;ca++)mxUtils.bind(this,function(ib){var jb=Ga[ib],Ta=null;if(Y.isCellMovable(jb.cell)){Ta=ib<Ga.length-1?Ga[ib+1]:null;Ta=null!=Ta?Y.getCellGeometry(Ta.cell):null;var qb=null!=Ta&&null!=Ta.alternateBounds?Ta.alternateBounds:Ta;Ta=null!=eb[ib]?new J(eb[ib],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Ta.isDashed=wa.isDashed;Ta.svgStrokeTolerance++;+Ta=new mxHandle(jb,"row-resize",null,Ta);Ta.tableHandle=!0;var hb=0;Ta.shape.node.parentNode.insertBefore(Ta.shape.node,Ta.shape.node.parentNode.firstChild);Ta.redraw=function(){if(null!=this.shape){this.shape.stroke=0==hb?mxConstants.NONE:wa.stroke;if(this.shape.constructor==J)this.shape.line=N(eb[ib],0,hb),this.shape.updateBoundsFromLine();else{var fb=Y.getActualStartSize(qa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+hb*ma;this.shape.bounds.x=qa.x+(ib==+Ga.length-1?0:fb.x*ma);this.shape.bounds.width=qa.width-(ib==Ga.length-1?0:fb.width+fb.x+ma)}this.shape.redraw()}};var cb=!1;Ta.setPosition=function(fb,lb,ub){hb=Math.max(Graph.minTableRowHeight-fb.height,lb.y-fb.y-fb.height);cb=mxEvent.isShiftDown(ub.getEvent());null!=qb&&cb&&(hb=Math.min(hb,qb.height-Graph.minTableRowHeight))};Ta.execute=function(fb){if(0!=hb)Y.setTableRowHeight(this.state.cell,hb,!cb);else if(!S.blockDelayedSelection){var lb=Y.getCellAt(fb.getGraphX(),fb.getGraphY())||qa.cell;+Y.graphHandler.selectCellForEvent(lb,fb)}hb=0};Ta.reset=function(){hb=0}}x.push(Ta)})(ca);for(ca=0;ca<Ya.length;ca++)mxUtils.bind(this,function(ib){var jb=Y.view.getState(Ya[ib]),Ta=Y.getCellGeometry(Ya[ib]),qb=null!=Ta.alternateBounds?Ta.alternateBounds:Ta;null==jb&&(jb=new mxCellState(Y.view,Ya[ib],Y.getCellStyle(Ya[ib])),jb.x=qa.x+Ta.x*ma,jb.y=qa.y+Ta.y*ma,jb.width=qb.width*ma,jb.height=qb.height*ma,jb.updateCachedBounds());Ta=ib<Ya.length-1?Ya[ib+1]:null;Ta=null!=Ta?Y.getCellGeometry(Ta):null;+var hb=null!=Ta&&null!=Ta.alternateBounds?Ta.alternateBounds:Ta;Ta=null!=Va[ib]?new J(Va[ib],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Ta.isDashed=wa.isDashed;Ta.svgStrokeTolerance++;jb=new mxHandle(jb,"col-resize",null,Ta);jb.tableHandle=!0;var cb=0;jb.shape.node.parentNode.insertBefore(jb.shape.node,jb.shape.node.parentNode.firstChild);jb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==cb?mxConstants.NONE:wa.stroke;if(this.shape.constructor==J)this.shape.line=+N(Va[ib],cb,0),this.shape.updateBoundsFromLine();else{var lb=Y.getActualStartSize(qa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(qb.width+cb)*ma;this.shape.bounds.y=qa.y+(ib==Ya.length-1?0:lb.y*ma);this.shape.bounds.height=qa.height-(ib==Ya.length-1?0:(lb.height+lb.y)*ma)}this.shape.redraw()}};var fb=!1;jb.setPosition=function(lb,ub,ob){cb=Math.max(Graph.minTableColumnWidth-qb.width,ub.x-lb.x-qb.width);fb=mxEvent.isShiftDown(ob.getEvent());null==hb||fb||(cb=Math.min(cb,hb.width-+Graph.minTableColumnWidth))};jb.execute=function(lb){if(0!=cb)Y.setTableColumnWidth(this.state.cell,cb,fb);else if(!S.blockDelayedSelection){var ub=Y.getCellAt(lb.getGraphX(),lb.getGraphY())||qa.cell;Y.graphHandler.selectCellForEvent(ub,lb)}cb=0};jb.positionChanged=function(){};jb.reset=function(){cb=0};x.push(jb)})(ca)}}return null!=x?x.reverse():null};var X=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(x){X.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=x?"":"hidden");if(null!=this.cornerHandles)for(N=0;N<this.cornerHandles.length;N++)this.cornerHandles[N].node.style.visibility=x?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var x=this.isMoveHandlesVisible();x&&null==this.moveHandles?+this.moveHandles=this.createMoveHandles():x||null==this.moveHandles||this.destroyMoveHandles();if(x&&null==this.moveHandles){for(x=0;x<this.moveHandles.length;x++)null!=this.moveHandles[x]&&this.moveHandles[x].parentNode.removeChild(this.moveHandles[x]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var x=this.graph,N=x.model,S=[],Y=0;Y<N.getChildCount(this.state.cell);Y++)mxUtils.bind(this,function(ca){if(null!=ca&&N.isVertex(ca.cell)&&x.isCellMovable(ca.cell)){var ma=+new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ma=new mxImageShape(ma,this.rowHandleImage.src);ma.rowState=ca;ma.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ma.init(this.graph.getView().getOverlayPane());ma.node.style.cursor="move";mxEvent.addGestureListeners(ma.node,mxUtils.bind(this,function(qa){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(qa)&&this.graph.isCellSelected(ca.cell)||+this.graph.selectCellForEvent(ca.cell,qa);mxEvent.isPopupTrigger(qa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(qa),mxEvent.getClientY(qa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(qa),this.graph.isMouseDown=!0);mxEvent.consume(qa)}),null,mxUtils.bind(this,function(qa){mxEvent.isPopupTrigger(qa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(qa),mxEvent.getClientY(qa),ca.cell,qa),mxEvent.consume(qa))}));+S.push(ma)}else S.push(null)})(this.graph.view.getState(N.getChildAt(this.state.cell,Y)));return S};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var x=0;x<this.moveHandles.length;x++)null!=this.moveHandles[x]&&this.moveHandles[x].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var x=0;x<this.cornerHandles.length;x++)null!=this.cornerHandles[x]&&null!=this.cornerHandles[x].node&&null!=+this.cornerHandles[x].node.parentNode&&this.cornerHandles[x].node.parentNode.removeChild(this.cornerHandles[x].node);this.cornerHandles=null}};var aa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){aa.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 x=0;4>x;x++){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();x=this.graph.getLinkForCell(this.state.cell);N=this.graph.getLinksForState(this.state);+this.updateLinkHint(x,N)};var Z=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var x=new mxPoint(0,0),N=this.tolerance,S=this.state.style.shape;null==mxCellRenderer.defaultShapes[S]&&mxStencilRegistry.getStencil(S);S=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!S&&null!=this.customHandles)for(var Y=0;Y<this.customHandles.length;Y++)if(null!=this.customHandles[Y]&&null!=this.customHandles[Y].shape&&+null!=this.customHandles[Y].shape.bounds){var ca=this.customHandles[Y].shape.bounds,ma=ca.getCenterX(),qa=ca.getCenterY();if(Math.abs(this.state.x-ma)<ca.width/2||Math.abs(this.state.y-qa)<ca.height/2||Math.abs(this.state.x+this.state.width-ma)<ca.width/2||Math.abs(this.state.y+this.state.height-qa)<ca.height/2){S=!0;break}}S&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(N/=2,this.graph.isTable(this.state.cell)&&(N+=7),x.x=this.sizers[0].bounds.width+N,x.y=this.sizers[0].bounds.height++N):x=Z.apply(this,arguments);return x};mxVertexHandler.prototype.updateHint=function(x){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{x=this.state.view.scale;var N=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/x),N)+" x "+d(this.roundLength(this.bounds.height/x),N)}x=mxUtils.getBoundingBox(this.bounds,+null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==x&&(x=this.bounds);this.hint.style.left=x.x+Math.round((x.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=x.y+x.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 U=mxEdgeHandler.prototype.refresh;+mxEdgeHandler.prototype.refresh=function(){U.apply(this,arguments);var x=this.graph.getLinkForCell(this.state.cell),N=this.graph.getLinksForState(this.state);this.updateLinkHint(x,N)};var ba=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(x,N){ba.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 fa=mxEdgeHandler.prototype.mouseUp;+mxEdgeHandler.prototype.mouseUp=function(x,N){fa.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(x,N,S){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var Y=this.graph.view.translate,ca=this.graph.view.scale,ma=this.roundLength(N.x/ca-Y.x);Y=this.roundLength(N.y/ca-Y.y);var qa=this.graph.view.unit;this.hint.innerHTML=+d(ma,qa)+", "+d(Y,qa);this.hint.style.visibility="visible";null!=S&&(S.view.updateEdgeBounds(S),this.hint.innerHTML+=" ("+(qa==mxConstants.POINTS?Math.round(S.length/ca):d(S.length/ca,qa))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(S=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*S.x)+"%, "+Math.round(100*S.y)+"%]"):this.marker.hasValidState()&&+(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(x.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(x.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=+Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',24,24);HoverIcons.prototype.connectHandle=Graph.createSvgImage(16,16,'<circle cx="12" cy="12" r="10" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><path transform="translate(5,5) scale(0.583)" d="M6 18v-3h7.6L4 5.4 5.4 4 15 13.6V6h3v12z" fill="#fff"/>',24,24);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="'+HoverIcons.prototype.arrowFill+@@ -2795,53 +2799,53 @@ HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" f'"/>');mxEdgeHandler.prototype.handleImage=HoverIcons.prototype.mainHandle;mxEdgeHandler.prototype.endHandleImage=HoverIcons.prototype.endMainHandle;mxEdgeHandler.prototype.terminalHandleImage=HoverIcons.prototype.terminalHandle;mxEdgeHandler.prototype.endTerminalHandleImage=HoverIcons.prototype.endTerminalHandle;mxEdgeHandler.prototype.fixedHandleImage=HoverIcons.prototype.fixedHandle;mxEdgeHandler.prototype.endFixedHandleImage=HoverIcons.prototype.endFixedHandle;mxEdgeHandler.prototype.labelHandleImage=HoverIcons.prototype.secondaryHandle;mxOutline.prototype.sizerImage=HoverIcons.prototype.mainHandle;null!=window.Sidebar&&(Sidebar.prototype.triangleUp=HoverIcons.prototype.triangleUp,Sidebar.prototype.triangleRight=HoverIcons.prototype.triangleRight,Sidebar.prototype.triangleDown=HoverIcons.prototype.triangleDown,Sidebar.prototype.triangleLeft=HoverIcons.prototype.triangleLeft,Sidebar.prototype.refreshTarget=HoverIcons.prototype.refreshTarget,Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop);mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSizers=!0;mxVertexHandler.prototype.livePreview=!0;mxGraphHandler.prototype.maxLivePreview=32;mxGraphHandler.prototype.previewColor="light-dark(#000000, #cccccc)";mxRubberband.prototype.defaultOpacity=30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=-!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(y){return!mxEvent.isShiftDown(y.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(y){return!mxEvent.isShiftDown(y.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||-0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(y){return mxEvent.isMouseEvent(y.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(y){var P=y.getEvent();return null==y.getState()&&!mxEvent.isMouseEvent(P)||mxEvent.isPopupTrigger(P)&&-(null==y.getState()||mxEvent.isControlDown(P)||mxEvent.isShiftDown(P))}}else mxPanningHandler.prototype.isPanningTrigger=function(y){var P=y.getEvent();return mxEvent.isLeftMouseButton(P)&&(this.useLeftButtonForPanning&&null==y.getState()||mxEvent.isControlDown(P)&&!mxEvent.isShiftDown(P))||this.usePopupTrigger&&mxEvent.isPopupTrigger(P)};mxRubberband.prototype.isSpaceEvent=function(y){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(y.getEvent())||-mxEvent.isMetaDown(y.getEvent()))&&mxEvent.isShiftDown(y.getEvent())&&mxEvent.isAltDown(y.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(y,P){if(this.cancelled)this.cancelled=!1,P.consume();else{var S=null!=this.div&&"none"!=this.div.style.display,X=null,ba=null,ma=y=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(X=this.first.x,ba=this.first.y,y=-(this.currentX-X)/this.graph.view.scale,ma=(this.currentY-ba)/this.graph.view.scale,mxEvent.isAltDown(P.getEvent())||(y=this.graph.snap(y),ma=this.graph.snap(ma),this.graph.isGridEnabled()||(Math.abs(y)<this.graph.tolerance&&(y=0),Math.abs(ma)<this.graph.tolerance&&(ma=0))));this.reset();if(S){if(this.isSpaceEvent(P)){this.graph.model.beginUpdate();try{var ra=this.graph.getCellsBeyond(X,ba,this.graph.getDefaultParent(),!0,!0);for(S=0;S<ra.length;S++)if(this.graph.isCellMovable(ra[S])){var wa=this.graph.view.getState(ra[S]),-sa=this.graph.getCellGeometry(ra[S]);null!=wa&&null!=sa&&(sa=sa.clone(),sa.translate(y,ma),this.graph.model.setGeometry(ra[S],sa))}}finally{this.graph.model.endUpdate()}}else ra=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(ra,P.getEvent());P.consume()}}};mxRubberband.prototype.mouseMove=function(y,P){if(!P.isConsumed()&&null!=this.first){var S=mxUtils.getScrollOrigin(this.graph.container);y=mxUtils.getOffset(this.graph.container);S.x-=y.x;S.y-=y.y;y=P.getX()+S.x;S=-P.getY()+S.y;var X=this.first.x-y,ba=this.first.y-S,ma=this.graph.tolerance;if(null!=this.div||Math.abs(X)>ma||Math.abs(ba)>ma)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(y,S),this.isSpaceEvent(P)?(y=this.x+this.width,S=this.y+this.height,X=this.graph.view.scale,mxEvent.isAltDown(P.getEvent())||(this.width=this.graph.snap(this.width/X)*X,this.height=this.graph.snap(this.height/X)*X,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),-this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=y-this.width),this.y<this.first.y&&(this.y=S-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=+!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(x){return!mxEvent.isShiftDown(x.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(x){return!mxEvent.isShiftDown(x.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||+0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(x){return mxEvent.isMouseEvent(x.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(x){var N=x.getEvent();return null==x.getState()&&!mxEvent.isMouseEvent(N)||mxEvent.isPopupTrigger(N)&&+(null==x.getState()||mxEvent.isControlDown(N)||mxEvent.isShiftDown(N))}}else mxPanningHandler.prototype.isPanningTrigger=function(x){var N=x.getEvent();return mxEvent.isLeftMouseButton(N)&&(this.useLeftButtonForPanning&&null==x.getState()||mxEvent.isControlDown(N)&&!mxEvent.isShiftDown(N))||this.usePopupTrigger&&mxEvent.isPopupTrigger(N)};mxRubberband.prototype.isSpaceEvent=function(x){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(x.getEvent())||+mxEvent.isMetaDown(x.getEvent()))&&mxEvent.isShiftDown(x.getEvent())&&mxEvent.isAltDown(x.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(x,N){if(this.cancelled)this.cancelled=!1,N.consume();else{var S=null!=this.div&&"none"!=this.div.style.display,Y=null,ca=null,ma=x=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(Y=this.first.x,ca=this.first.y,x=+(this.currentX-Y)/this.graph.view.scale,ma=(this.currentY-ca)/this.graph.view.scale,mxEvent.isAltDown(N.getEvent())||(x=this.graph.snap(x),ma=this.graph.snap(ma),this.graph.isGridEnabled()||(Math.abs(x)<this.graph.tolerance&&(x=0),Math.abs(ma)<this.graph.tolerance&&(ma=0))));this.reset();if(S){if(this.isSpaceEvent(N)){this.graph.model.beginUpdate();try{var qa=this.graph.getCellsBeyond(Y,ca,this.graph.getDefaultParent(),!0,!0);for(S=0;S<qa.length;S++)if(this.graph.isCellMovable(qa[S])){var wa=this.graph.view.getState(qa[S]),+sa=this.graph.getCellGeometry(qa[S]);null!=wa&&null!=sa&&(sa=sa.clone(),sa.translate(x,ma),this.graph.model.setGeometry(qa[S],sa))}}finally{this.graph.model.endUpdate()}}else qa=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(qa,N.getEvent());N.consume()}}};mxRubberband.prototype.mouseMove=function(x,N){if(!N.isConsumed()&&null!=this.first){var S=mxUtils.getScrollOrigin(this.graph.container);x=mxUtils.getOffset(this.graph.container);S.x-=x.x;S.y-=x.y;x=N.getX()+S.x;S=+N.getY()+S.y;var Y=this.first.x-x,ca=this.first.y-S,ma=this.graph.tolerance;if(null!=this.div||Math.abs(Y)>ma||Math.abs(ca)>ma)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(x,S),this.isSpaceEvent(N)?(x=this.x+this.width,S=this.y+this.height,Y=this.graph.view.scale,mxEvent.isAltDown(N.getEvent())||(this.width=this.graph.snap(this.width/Y)*Y,this.height=this.graph.snap(this.height/Y)*Y,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),+this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=x-this.width),this.y<this.first.y&&(this.y=S-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),-this.secondDiv=null)),P.consume()}};var na=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);na.apply(this,arguments)};var qa=(new Date).getTime(),ta=0,ua=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(y,P,S,X){ua.apply(this,arguments);S!=this.currentTerminalState?(qa=(new Date).getTime(),ta=0):ta=(new Date).getTime()-qa;this.currentTerminalState=-S};var Ba=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(y){return mxEvent.isShiftDown(y.getEvent())&&mxEvent.isAltDown(y.getEvent())?!1:null!=this.currentTerminalState&&y.getState()==this.currentTerminalState&&2E3<ta||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&Ba.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(y,P,S){P=null!=y&&0==y;var X=this.state.getVisibleTerminalState(P);-y=null!=y&&null!=this.state.absolutePoints&&(0==y||y>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==y)?this.graph.getConnectionConstraint(this.state,X,P):null;S=null!=(null!=y?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(P),y):null)?S?this.endFixedHandleImage:this.fixedHandleImage:null!=y&&null!=X?S?this.endTerminalHandleImage:this.terminalHandleImage:S?this.endHandleImage:this.handleImage;if(null!=S)return S=new mxImageShape(new mxRectangle(0,0,-S.width,S.height),S.src),S.preserveImageAspect=!1,S;S=mxConstants.HANDLE_SIZE;this.preferHtml&&--S;return new mxRectangleShape(new mxRectangle(0,0,S,S),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var za=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(y,P,S,X){X=P==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:P==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle:P==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:-X;return za.apply(this,arguments)};var Aa=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=function(){var y=Aa.apply(this,arguments);null==this.connectShape&&this.isConnectHandleVisible()&&(this.connectShape=this.createSizer("copy",mxEvent.CONNECT_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),y.push(this.connectShape));return y};var Ga=mxVertexHandler.prototype.destroySizers;mxVertexHandler.prototype.destroySizers=function(){Ga.apply(this,arguments);this.connectShape=-null};var Ra=mxVertexHandler.prototype.getHandleForEvent;mxVertexHandler.prototype.getHandleForEvent=function(y){if(null!=this.connectShape&&null!=this.connectShape.node&&"hidden"!=this.connectShape.node.style.visibility){var P=mxEvent.isMouseEvent(y.getEvent())?1:this.tolerance;P=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<P)?new mxRectangle(y.getGraphX()-P,y.getGraphY()-P,2*P,2*P):null;if(y.isSource(this.connectShape)||null!=P&&this.connectShape.intersectsRectangle(P))return mxEvent.CONNECT_HANDLE}return Ra.apply(this,-arguments)};var Ha=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(y,P){if(!P.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(P)==mxEvent.CONNECT_HANDLE){var S=P.getGraphX(),X=P.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,S,X);this.graph.isMouseTrigger=mxEvent.isMouseEvent(P.getEvent());this.graph.isMouseDown=-!0;S=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=S&&S.setHandlesVisible(!1);P.consume()}else Ha.apply(this,arguments)};var Qa=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(y){if(null!=y&&1==y.length){var P=this.graph.getModel(),S=P.getParent(y[0]),X=this.graph.getCellGeometry(y[0]);if(P.isEdge(S)&&null!=X&&X.relative&&(P=this.graph.view.getState(y[0]),null!=P&&2>P.width&&2>P.height&&null!=P.text&&null!=P.text.boundingBox))return mxRectangle.fromRectangle(P.text.boundingBox)}return Qa.apply(this,-arguments)};var eb=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var y=eb.apply(this,arguments),P=[],S=0;S<y.length;S++)"1"!=mxUtils.getValue(y[S].style,"part","0")&&P.push(y[S]);return P};var Ma=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(y){var P=this.graph.getModel(),S=P.getParent(y.cell),X=this.graph.getCellGeometry(y.cell);return P.isEdge(S)&&null!=X&&X.relative&&2>y.width&&2>y.height&&null!=-y.text&&null!=y.text.boundingBox?(P=y.text.unrotatedBoundingBox||y.text.boundingBox,new mxRectangle(Math.round(P.x),Math.round(P.y),Math.round(P.width),Math.round(P.height))):Ma.apply(this,arguments)};var ya=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(y,P){var S=this.graph.getModel(),X=S.getParent(this.state.cell),ba=this.graph.getCellGeometry(this.state.cell),ma=this.getHandleForEvent(P);(ma==mxEvent.ROTATION_HANDLE||ma==mxEvent.CONNECT_HANDLE||!S.isEdge(X)||-null==ba||!ba.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&ya.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var y=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),P=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&y==mxConstants.NONE&&P==mxConstants.NONE?(y=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,-0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,y,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var Sa=mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(y){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var P=this.graph.view.scale,S=this.state.style,X=this.roundLength(this.bounds.width/P),ba=this.roundLength(this.bounds.height/P);P=this.graph.cellRenderer.getLabelValue(this.state);-if(null!=P&&0<P.length&&(X=this.graph.getAutosizeTextAvailableSpace(S,X,ba,this.state),null!=X)){this.graph.isHtmlLabel(this.state.cell)||(P=mxUtils.htmlEntities(P,!1));P=P.replace(/\n/g,"<br>");X=this.graph.computeAutosizeTextFontSize(P,X.availW,X.availH,S[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,S[mxConstants.STYLE_FONTSTYLE],"wrap"==S[mxConstants.STYLE_WHITE_SPACE]);P=S[mxConstants.STYLE_FONTSIZE];S[mxConstants.STYLE_FONTSIZE]=X;Sa.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]=-P;return}}Sa.apply(this,arguments)};var Oa=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(y,P){Oa.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var Na=-mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(y,P){Na.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display=-"");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(y,P){try{if(null==y&&(null==P||0==P.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=y||null!=P&&0<P.length){var S=document.createElement("img");S.className="geAdaptiveAsset";S.setAttribute("src",Editor.editImage);S.setAttribute("title",mxResources.get("editLink"));S.setAttribute("width","14");S.setAttribute("height","14");S.style.paddingLeft="8px";-S.style.marginLeft="auto";S.style.marginBottom="-1px";S.style.cursor="pointer";var X=S.cloneNode(!0);X.setAttribute("src",Editor.trashImage);X.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));X.style.paddingLeft="4px";X.style.marginLeft="0";null==this.linkHint&&(this.linkHint=b(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),-mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=y){var ba=document.createElement("div");ba.style.display="flex";ba.style.alignItems="center";ba.appendChild(this.graph.createLinkForHint(y,null,this.state.cell));this.linkHint.appendChild(ba);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var ma=S.cloneNode(!0);ba.appendChild(ma);mxEvent.addListener(ma,-"click",mxUtils.bind(this,function(wa){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(wa)}));var ra=X.cloneNode(!0);ba.appendChild(ra);mxEvent.addListener(ra,"click",mxUtils.bind(this,function(wa){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(wa)}))}}if(null!=P)for(ba=0;ba<P.length;ba++)mxUtils.bind(this,function(wa,sa){var xa=document.createElement("div");xa.style.display="flex";xa.style.alignItems="center";xa.style.marginTop=null!=y||0<sa?"6px":-"0px";xa.appendChild(this.graph.createLinkForHint(wa.getAttribute("href"),mxUtils.getTextContent(wa),this.state.cell));var Fa=S.cloneNode(!0);xa.appendChild(Fa);var Ya=mxUtils.bind(this,function(Ua){var cb=document.createElement("div");cb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var hb=cb.getElementsByTagName("a")[sa];if(null!=hb){if(null==Ua||""==Ua){for(Ua=hb.cloneNode(!0).firstChild;null!=Ua;)hb.parentNode.insertBefore(Ua.cloneNode(!0),hb),Ua=Ua.nextSibling;hb.parentNode.removeChild(hb)}else hb.setAttribute("href",-Ua);this.graph.labelChanged(this.state.cell,cb.innerHTML)}});mxEvent.addListener(Fa,"click",mxUtils.bind(this,function(Ua){this.graph.showLinkDialog(wa.getAttribute("href")||"",mxResources.get("ok"),Ya);mxEvent.consume(Ua)}));Fa=X.cloneNode(!0);xa.appendChild(Fa);mxEvent.addListener(Fa,"click",mxUtils.bind(this,function(Ua){Ya();mxEvent.consume(Ua)}));this.linkHint.appendChild(xa)})(P[ba],ba)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(wa){}};mxEdgeHandler.prototype.updateLinkHint=-mxVertexHandler.prototype.updateLinkHint;var Pa=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var y=Pa.apply(this,arguments);y.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return y};var oa=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){oa.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};-var Da=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var y=0;y<this.moveHandles.length;y++)null!=this.moveHandles[y]&&(this.moveHandles[y].bounds.x=Math.round(this.moveHandles[y].rowState.x+this.moveHandles[y].rowState.width-this.moveHandles[y].bounds.width/2),this.moveHandles[y].bounds.y=Math.round(this.moveHandles[y].rowState.y+(this.moveHandles[y].rowState.height-this.moveHandles[y].bounds.height)/2),this.moveHandles[y].redraw());-if(null!=this.cornerHandles){y=this.getSelectionBorderInset();var P=this.cornerHandles,S=P[0].bounds.height/2;P[0].bounds.x=this.state.x-P[0].bounds.width/2+y;P[0].bounds.y=this.state.y-S+y;P[0].redraw();P[1].bounds.x=P[0].bounds.x+this.state.width-2*y;P[1].bounds.y=P[0].bounds.y;P[1].redraw();P[2].bounds.x=P[0].bounds.x;P[2].bounds.y=this.state.y+this.state.height-2*y;P[2].redraw();P[3].bounds.x=P[1].bounds.x;P[3].bounds.y=P[2].bounds.y;P[3].redraw();for(y=0;y<this.cornerHandles.length;y++)this.cornerHandles[y].node.style.display=-1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=this.moveHandles||1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?"none":"");Da.apply(this);null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.setAttribute("title",mxResources.get("plusTooltip")),y=null==this.moveHandles&&-1==this.graph.getSelectionCount()&&(null==this.index||this.index==mxEvent.CONNECT_HANDLE)&&!this.graph.isEditing()&&this.handlesVisible&&this.isHandlesVisible()&&this.isConnectHandleVisible(),this.connectShape.node.style.display=y?"":"none",this.connectShape.node.style.visibility=y?"":"hidden",y&&(P=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),y=Math.cos(P),P=Math.sin(P),S=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),-y=mxUtils.getRotatedPoint(this.getConnectHandlePosition(),y,P,S),this.moveSizerTo(this.connectShape,y.x,y.y)));null!=this.state&&null!=this.linkHint&&(y=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),P=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),S=mxUtils.getBoundingBox(P,this.state.style[mxConstants.STYLE_ROTATION]||"0",y),y=null!=S?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,P=null!=this.state.text?-this.state.text.boundingBox:null,null==S&&(S=this.state),S=S.y+S.height,null!=P&&(S=Math.max(S,P.y+P.height)),this.linkHint.style.left=y.x+y.width/2+"px",this.linkHint.style.top=Math.round(S+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Ca=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Ca.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 Ja=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Ja.apply(this),-null!=this.state&&null!=this.linkHint)){var y=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(y=new mxRectangle(y.x,y.y,y.width,y.height),y.add(this.state.text.bounds));this.linkHint.style.left=y.x+y.width/2+"px";this.linkHint.style.top=Math.round(y.y+y.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 ib=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){ib.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(f,q,z){mxShape.call(this);this.line=f;this.stroke=q;this.strokewidth=null!=z?z:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function n(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function C(){mxActor.call(this)}function G(){mxCylinder.call(this)}function T(){mxCylinder.call(this)}function E(){mxCylinder.call(this)}function Q(){mxCylinder.call(this)}function M(){mxShape.call(this)}-function c(){mxShape.call(this)}function g(f,q,z,u){mxShape.call(this);this.bounds=f;this.fill=q;this.stroke=z;this.strokewidth=null!=u?u:1}function l(){mxActor.call(this)}function t(){mxCylinder.call(this)}function B(){mxCylinder.call(this)}function D(){mxActor.call(this)}function I(){mxActor.call(this)}function L(){mxActor.call(this)}function N(){mxActor.call(this)}function K(){mxActor.call(this)}function da(){mxActor.call(this)}function ja(){mxActor.call(this)}function ea(f,q){this.canvas=f;this.canvas.setLineJoin("round");+this.secondDiv=null)),N.consume()}};var na=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);na.apply(this,arguments)};var pa=(new Date).getTime(),ta=0,ua=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(x,N,S,Y){ua.apply(this,arguments);S!=this.currentTerminalState?(pa=(new Date).getTime(),ta=0):ta=(new Date).getTime()-pa;this.currentTerminalState=+S};var Ca=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(x){return mxEvent.isShiftDown(x.getEvent())&&mxEvent.isAltDown(x.getEvent())?!1:null!=this.currentTerminalState&&x.getState()==this.currentTerminalState&&2E3<ta||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&Ca.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(x,N,S){N=null!=x&&0==x;var Y=this.state.getVisibleTerminalState(N);+x=null!=x&&null!=this.state.absolutePoints&&(0==x||x>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==x)?this.graph.getConnectionConstraint(this.state,Y,N):null;S=null!=(null!=x?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(N),x):null)?S?this.endFixedHandleImage:this.fixedHandleImage:null!=x&&null!=Y?S?this.endTerminalHandleImage:this.terminalHandleImage:S?this.endHandleImage:this.handleImage;if(null!=S)return S=new mxImageShape(new mxRectangle(0,0,+S.width,S.height),S.src),S.preserveImageAspect=!1,S;S=mxConstants.HANDLE_SIZE;this.preferHtml&&--S;return new mxRectangleShape(new mxRectangle(0,0,S,S),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var Ba=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(x,N,S,Y){Y=N==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:N==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle:N==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:+Y;return Ba.apply(this,arguments)};var Aa=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=function(){var x=Aa.apply(this,arguments);null==this.connectShape&&this.isConnectHandleVisible()&&(this.connectShape=this.createSizer("copy",mxEvent.CONNECT_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),x.push(this.connectShape));return x};var Fa=mxVertexHandler.prototype.destroySizers;mxVertexHandler.prototype.destroySizers=function(){Fa.apply(this,arguments);this.connectShape=+null};var Sa=mxVertexHandler.prototype.getHandleForEvent;mxVertexHandler.prototype.getHandleForEvent=function(x){if(null!=this.connectShape&&null!=this.connectShape.node&&"hidden"!=this.connectShape.node.style.visibility){var N=mxEvent.isMouseEvent(x.getEvent())?1:this.tolerance;N=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<N)?new mxRectangle(x.getGraphX()-N,x.getGraphY()-N,2*N,2*N):null;if(x.isSource(this.connectShape)||null!=N&&this.connectShape.intersectsRectangle(N))return mxEvent.CONNECT_HANDLE}return Sa.apply(this,+arguments)};var La=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(x,N){if(!N.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(N)==mxEvent.CONNECT_HANDLE){var S=N.getGraphX(),Y=N.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,S,Y);this.graph.isMouseTrigger=mxEvent.isMouseEvent(N.getEvent());this.graph.isMouseDown=+!0;S=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=S&&S.setHandlesVisible(!1);N.consume()}else La.apply(this,arguments)};var Pa=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(x){if(null!=x&&1==x.length){var N=this.graph.getModel(),S=N.getParent(x[0]),Y=this.graph.getCellGeometry(x[0]);if(N.isEdge(S)&&null!=Y&&Y.relative&&(N=this.graph.view.getState(x[0]),null!=N&&2>N.width&&2>N.height&&null!=N.text&&null!=N.text.boundingBox))return mxRectangle.fromRectangle(N.text.boundingBox)}return Pa.apply(this,+arguments)};var db=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var x=db.apply(this,arguments),N=[],S=0;S<x.length;S++)"1"!=mxUtils.getValue(x[S].style,"part","0")&&N.push(x[S]);return N};var Ia=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(x){var N=this.graph.getModel(),S=N.getParent(x.cell),Y=this.graph.getCellGeometry(x.cell);return N.isEdge(S)&&null!=Y&&Y.relative&&2>x.width&&2>x.height&&null!=+x.text&&null!=x.text.boundingBox?(N=x.text.unrotatedBoundingBox||x.text.boundingBox,new mxRectangle(Math.round(N.x),Math.round(N.y),Math.round(N.width),Math.round(N.height))):Ia.apply(this,arguments)};var za=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(x,N){var S=this.graph.getModel(),Y=S.getParent(this.state.cell),ca=this.graph.getCellGeometry(this.state.cell),ma=this.getHandleForEvent(N);(ma==mxEvent.ROTATION_HANDLE||ma==mxEvent.CONNECT_HANDLE||!S.isEdge(Y)||+null==ca||!ca.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&za.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var x=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),N=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&x==mxConstants.NONE&&N==mxConstants.NONE?(x=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,+0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,x,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var Ua=mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(x){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var N=this.graph.view.scale,S=this.state.style,Y=this.roundLength(this.bounds.width/N),ca=this.roundLength(this.bounds.height/N);N=this.graph.cellRenderer.getLabelValue(this.state);+if(null!=N&&0<N.length&&(Y=this.graph.getAutosizeTextAvailableSpace(S,Y,ca,this.state),null!=Y)){this.graph.isHtmlLabel(this.state.cell)||(N=mxUtils.htmlEntities(N,!1));N=N.replace(/\n/g,"<br>");Y=this.graph.computeAutosizeTextFontSize(N,Y.availW,Y.availH,S[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,S[mxConstants.STYLE_FONTSTYLE],"wrap"==S[mxConstants.STYLE_WHITE_SPACE]);N=S[mxConstants.STYLE_FONTSIZE];S[mxConstants.STYLE_FONTSIZE]=Y;Ua.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]=+N;return}}Ua.apply(this,arguments)};var Qa=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(x,N){Qa.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var Ma=+mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(x,N){Ma.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display=+"");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(x,N){try{if(null==x&&(null==N||0==N.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=x||null!=N&&0<N.length){var S=document.createElement("img");S.className="geAdaptiveAsset";S.setAttribute("src",Editor.editImage);S.setAttribute("title",mxResources.get("editLink"));S.setAttribute("width","14");S.setAttribute("height","14");S.style.paddingLeft="8px";+S.style.marginLeft="auto";S.style.marginBottom="-1px";S.style.cursor="pointer";var Y=S.cloneNode(!0);Y.setAttribute("src",Editor.trashImage);Y.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));Y.style.paddingLeft="4px";Y.style.marginLeft="0";null==this.linkHint&&(this.linkHint=b(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),+mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=x){var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.appendChild(this.graph.createLinkForHint(x,null,this.state.cell));this.linkHint.appendChild(ca);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var ma=S.cloneNode(!0);ca.appendChild(ma);mxEvent.addListener(ma,+"click",mxUtils.bind(this,function(wa){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(wa)}));var qa=Y.cloneNode(!0);ca.appendChild(qa);mxEvent.addListener(qa,"click",mxUtils.bind(this,function(wa){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(wa)}))}}if(null!=N)for(ca=0;ca<N.length;ca++)mxUtils.bind(this,function(wa,sa){var ya=document.createElement("div");ya.style.display="flex";ya.style.alignItems="center";ya.style.marginTop=null!=x||0<sa?"6px":+"0px";ya.appendChild(this.graph.createLinkForHint(wa.getAttribute("href"),mxUtils.getTextContent(wa),this.state.cell));var Ga=S.cloneNode(!0);ya.appendChild(Ga);var Ya=mxUtils.bind(this,function(Va){var eb=document.createElement("div");eb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var ib=eb.getElementsByTagName("a")[sa];if(null!=ib){if(null==Va||""==Va){for(Va=ib.cloneNode(!0).firstChild;null!=Va;)ib.parentNode.insertBefore(Va.cloneNode(!0),ib),Va=Va.nextSibling;ib.parentNode.removeChild(ib)}else ib.setAttribute("href",+Va);this.graph.labelChanged(this.state.cell,eb.innerHTML)}});mxEvent.addListener(Ga,"click",mxUtils.bind(this,function(Va){this.graph.showLinkDialog(wa.getAttribute("href")||"",mxResources.get("ok"),Ya);mxEvent.consume(Va)}));Ga=Y.cloneNode(!0);ya.appendChild(Ga);mxEvent.addListener(Ga,"click",mxUtils.bind(this,function(Va){Ya();mxEvent.consume(Va)}));this.linkHint.appendChild(ya)})(N[ca],ca)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(wa){}};mxEdgeHandler.prototype.updateLinkHint=+mxVertexHandler.prototype.updateLinkHint;var Na=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var x=Na.apply(this,arguments);x.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return x};var xa=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){xa.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};+var Za=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var x=0;x<this.moveHandles.length;x++)null!=this.moveHandles[x]&&(this.moveHandles[x].bounds.x=Math.round(this.moveHandles[x].rowState.x+this.moveHandles[x].rowState.width-this.moveHandles[x].bounds.width/2),this.moveHandles[x].bounds.y=Math.round(this.moveHandles[x].rowState.y+(this.moveHandles[x].rowState.height-this.moveHandles[x].bounds.height)/2),this.moveHandles[x].redraw());+if(null!=this.cornerHandles){x=this.getSelectionBorderInset();var N=this.cornerHandles,S=N[0].bounds.height/2;N[0].bounds.x=this.state.x-N[0].bounds.width/2+x;N[0].bounds.y=this.state.y-S+x;N[0].redraw();N[1].bounds.x=N[0].bounds.x+this.state.width-2*x;N[1].bounds.y=N[0].bounds.y;N[1].redraw();N[2].bounds.x=N[0].bounds.x;N[2].bounds.y=this.state.y+this.state.height-2*x;N[2].redraw();N[3].bounds.x=N[1].bounds.x;N[3].bounds.y=N[2].bounds.y;N[3].redraw();for(x=0;x<this.cornerHandles.length;x++)this.cornerHandles[x].node.style.display=+1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=this.moveHandles||1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?"none":"");Za.apply(this);null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.setAttribute("title",mxResources.get("plusTooltip")),x=null==this.moveHandles&&+1==this.graph.getSelectionCount()&&(null==this.index||this.index==mxEvent.CONNECT_HANDLE)&&!this.graph.isEditing()&&this.handlesVisible&&this.isHandlesVisible()&&this.isConnectHandleVisible(),this.connectShape.node.style.display=x?"":"none",this.connectShape.node.style.visibility=x?"":"hidden",x&&(N=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),x=Math.cos(N),N=Math.sin(N),S=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),+x=mxUtils.getRotatedPoint(this.getConnectHandlePosition(),x,N,S),this.moveSizerTo(this.connectShape,x.x,x.y)));null!=this.state&&null!=this.linkHint&&(x=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),N=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),S=mxUtils.getBoundingBox(N,this.state.style[mxConstants.STYLE_ROTATION]||"0",x),x=null!=S?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,N=null!=this.state.text?+this.state.text.boundingBox:null,null==S&&(S=this.state),S=S.y+S.height,null!=N&&(S=Math.max(S,N.y+N.height)),this.linkHint.style.left=x.x+x.width/2+"px",this.linkHint.style.top=Math.round(S+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Oa=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Oa.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 ra=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(ra.apply(this),+null!=this.state&&null!=this.linkHint)){var x=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(x=new mxRectangle(x.x,x.y,x.width,x.height),x.add(this.state.text.bounds));this.linkHint.style.left=x.x+x.width/2+"px";this.linkHint.style.top=Math.round(x.y+x.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Da=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){Da.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility=+"")};var Ra=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ra.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(f,q,z){mxShape.call(this);this.line=f;this.stroke=q;this.strokewidth=null!=z?z:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function n(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function C(){mxActor.call(this)}function G(){mxCylinder.call(this)}function T(){mxCylinder.call(this)}function E(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function L(){mxShape.call(this)}+function c(){mxShape.call(this)}function g(f,q,z,u){mxShape.call(this);this.bounds=f;this.fill=q;this.stroke=z;this.strokewidth=null!=u?u:1}function l(){mxActor.call(this)}function t(){mxCylinder.call(this)}function B(){mxCylinder.call(this)}function D(){mxActor.call(this)}function I(){mxActor.call(this)}function K(){mxActor.call(this)}function M(){mxActor.call(this)}function V(){mxActor.call(this)}function Q(){mxActor.call(this)}function ja(){mxActor.call(this)}function ea(f,q){this.canvas=f;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=q;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,ea.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,ea.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,ea.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,ea.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=-mxUtils.bind(this,ea.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,ea.prototype.arcTo)}function ca(){mxRectangleShape.call(this)}function fa(){mxRectangleShape.call(this)}function la(){mxActor.call(this)}function ka(){mxActor.call(this)}function V(){mxActor.call(this)}function k(){mxRectangleShape.call(this)}function x(){mxRectangleShape.call(this)}function J(){mxCylinder.call(this)}function R(){mxShape.call(this)}function Y(){mxShape.call(this)}function Z(){mxEllipse.call(this)}-function W(){mxShape.call(this)}function U(){mxShape.call(this)}function aa(){mxRectangleShape.call(this)}function ia(){mxShape.call(this)}function na(){mxShape.call(this)}function qa(){mxShape.call(this)}function ta(){mxShape.call(this)}function ua(){mxShape.call(this)}function Ba(){mxCylinder.call(this)}function za(){mxCylinder.call(this)}function Aa(){mxRectangleShape.call(this)}function Ga(){mxDoubleEllipse.call(this)}function Ra(){mxDoubleEllipse.call(this)}function Ha(){mxArrowConnector.call(this);-this.spacing=0}function Qa(){mxArrowConnector.call(this);this.spacing=0}function eb(){mxActor.call(this)}function Ma(){mxRectangleShape.call(this)}function ya(){mxActor.call(this)}function Sa(){mxActor.call(this)}function Oa(){mxActor.call(this)}function Na(){mxActor.call(this)}function Pa(){mxActor.call(this)}function oa(){mxActor.call(this)}function Da(){mxActor.call(this)}function Ca(){mxActor.call(this)}function Ja(){mxActor.call(this)}function Xa(){mxActor.call(this)}function ib(){mxEllipse.call(this)}-function y(){mxEllipse.call(this)}function P(){mxEllipse.call(this)}function S(){mxRhombus.call(this)}function X(){mxEllipse.call(this)}function ba(){mxEllipse.call(this)}function ma(){mxEllipse.call(this)}function ra(){mxEllipse.call(this)}function wa(){mxActor.call(this)}function sa(){mxActor.call(this)}function xa(){mxActor.call(this)}function Fa(f,q,z,u){mxShape.call(this);this.bounds=f;this.fill=q;this.stroke=z;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=-!0;this.indent=2;this.rectOutline="single"}function Ya(){mxConnector.call(this)}function Ua(){mxConnector.call(this)}function cb(){mxActor.call(this)}function hb(f,q,z,u,A,F,H,ha,O,va){H+=O;var pa=u.clone();u.x-=A*(2*H+O);u.y-=F*(2*H+O);A*=H+O;F*=H+O;return function(){f.ellipse(pa.x-A-H,pa.y-F-H,2*H,2*H);va?f.fillAndStroke():f.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var f=null;if(null!=this.line)for(var q=0;q<this.line.length;q++){var z=this.line[q];null!=z&&+mxUtils.bind(this,ea.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,ea.prototype.arcTo)}function da(){mxRectangleShape.call(this)}function ia(){mxRectangleShape.call(this)}function la(){mxActor.call(this)}function ka(){mxActor.call(this)}function W(){mxActor.call(this)}function k(){mxRectangleShape.call(this)}function y(){mxRectangleShape.call(this)}function J(){mxCylinder.call(this)}function R(){mxShape.call(this)}function X(){mxShape.call(this)}function aa(){mxEllipse.call(this)}+function Z(){mxShape.call(this)}function U(){mxShape.call(this)}function ba(){mxRectangleShape.call(this)}function fa(){mxShape.call(this)}function na(){mxShape.call(this)}function pa(){mxShape.call(this)}function ta(){mxShape.call(this)}function ua(){mxShape.call(this)}function Ca(){mxCylinder.call(this)}function Ba(){mxCylinder.call(this)}function Aa(){mxRectangleShape.call(this)}function Fa(){mxDoubleEllipse.call(this)}function Sa(){mxDoubleEllipse.call(this)}function La(){mxArrowConnector.call(this);+this.spacing=0}function Pa(){mxArrowConnector.call(this);this.spacing=0}function db(){mxActor.call(this)}function Ia(){mxRectangleShape.call(this)}function za(){mxActor.call(this)}function Ua(){mxActor.call(this)}function Qa(){mxActor.call(this)}function Ma(){mxActor.call(this)}function Na(){mxActor.call(this)}function xa(){mxActor.call(this)}function Za(){mxActor.call(this)}function Oa(){mxActor.call(this)}function ra(){mxActor.call(this)}function Da(){mxActor.call(this)}function Ra(){mxEllipse.call(this)}+function x(){mxEllipse.call(this)}function N(){mxEllipse.call(this)}function S(){mxRhombus.call(this)}function Y(){mxEllipse.call(this)}function ca(){mxEllipse.call(this)}function ma(){mxEllipse.call(this)}function qa(){mxEllipse.call(this)}function wa(){mxActor.call(this)}function sa(){mxActor.call(this)}function ya(){mxActor.call(this)}function Ga(f,q,z,u){mxShape.call(this);this.bounds=f;this.fill=q;this.stroke=z;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=+!0;this.indent=2;this.rectOutline="single"}function Ya(){mxConnector.call(this)}function Va(){mxConnector.call(this)}function eb(){mxActor.call(this)}function ib(f,q,z,u,A,F,H,ha,O,va){H+=O;var oa=u.clone();u.x-=A*(2*H+O);u.y-=F*(2*H+O);A*=H+O;F*=H+O;return function(){f.ellipse(oa.x-A-H,oa.y-F-H,2*H,2*H);va?f.fillAndStroke():f.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var f=null;if(null!=this.line)for(var q=0;q<this.line.length;q++){var z=this.line[q];null!=z&&(z=new mxRectangle(z.x,z.y,this.strokewidth,this.strokewidth),null==f?f=z:f.add(z))}this.bounds=null!=f?f:new mxRectangle};b.prototype.paintVertexShape=function(f,q,z,u,A){this.paintTableLine(f,this.line,0,0)};b.prototype.paintTableLine=function(f,q,z,u){if(null!=q){var A=null;f.begin();for(var F=0;F<q.length;F++){var H=q[F];null!=H&&(null==A?f.moveTo(H.x+z,H.y+u):null!=A&&f.lineTo(H.x+z,H.y+u));A=H}f.end();f.stroke()}};b.prototype.intersectsRectangle=function(f){var q=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var z=null,u=0;u<this.line.length&&!q;u++){var A=this.line[u];null!=A&&null!=z&&(q=mxUtils.rectangleIntersectsSegment(f,z,A));z=A}return q};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.getLabelBounds=function(f){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};d.prototype.paintVertexShape=function(f,q,z,u,A){var F=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,H=this.isHorizontal(),ha=this.getTitleSize();0==ha||this.outline?ma.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),f.translate(-q,-z));F||this.outline||!(H&&ha<A||!H&&ha<u)||this.paintForeground(f,q,z,u,A)};d.prototype.paintForeground=function(f,q,z,u,A){if(null!=this.state){var F=this.flipH,H=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ha=F;F=H;H=ha}f.rotate(-this.getShapeRotation(),@@ -2855,9 +2859,9 @@ p);mxUtils.extend(C,mxActor);C.prototype.size=20;C.prototype.redrawPath=functionq,(.5-Ta)*q),f.lineTo(.5*q,(1-Ta)*q)):(f.translate((u-q)/2,(A-q)/2),f.moveTo(0,.25*q),f.lineTo(.5*q,q*Ta),f.lineTo(q,.25*q),f.lineTo(q,.75*q),f.lineTo(.5*q,(1-Ta)*q),f.lineTo(0,.75*q),f.close());f.end()};mxCellRenderer.registerShape("isoCube",G);mxUtils.extend(T,mxCylinder);T.prototype.redrawPath=function(f,q,z,u,A,F){q=Math.min(A/2,Math.round(A/8)+this.strokewidth-1);if(F&&null!=this.fill||!F&&null==this.fill)f.moveTo(0,q),f.curveTo(0,2*q,u,2*q,u,q),F||(f.stroke(),f.begin()),f.translate(0,q/2),f.moveTo(0,q),f.curveTo(0,2*q,u,2*q,u,q),F||(f.stroke(),f.begin()),f.translate(0,q/2),f.moveTo(0,q),f.curveTo(0,2*q,u,2*q,u,q),F||(f.stroke(),f.begin()),f.translate(0,-q);F||(f.moveTo(0,q),f.curveTo(0,-q/3,u,-q/3,u,q),f.lineTo(u,A-q),f.curveTo(u,A+q/3,0,A+q/3,0,A-q),f.close())};T.prototype.getLabelMargins=function(f){return new mxRectangle(0,2.5*Math.min(f.height/2,Math.round(f.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",T);mxUtils.extend(E,mxCylinder);E.prototype.size=30;E.prototype.darkOpacity=0;E.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(0,Math.min(u,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),H=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));f.translate(q,z);f.begin();f.moveTo(0,0);f.lineTo(u-F,0);f.lineTo(u,F);f.lineTo(u,A);f.lineTo(0,A);f.lineTo(0,0);f.close();f.end();f.fillAndStroke();this.outline||(f.setShadow(!1),0!=H&&(f.setFillAlpha(Math.abs(H)),f.setFillColor(0>H?"#FFFFFF":"#000000"),-f.begin(),f.moveTo(u-F,0),f.lineTo(u-F,F),f.lineTo(u,F),f.close(),f.fill()),f.begin(),f.moveTo(u-F,0),f.lineTo(u-F,F),f.lineTo(u,F),f.end(),f.stroke())};mxCellRenderer.registerShape("note",E);mxUtils.extend(Q,E);mxCellRenderer.registerShape("note2",Q);Q.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,q*this.scale),0,0)}return null};mxUtils.extend(M,mxShape);M.prototype.isoAngle=-15;M.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;F=Math.min(u*Math.tan(F),.5*A);f.translate(q,z);f.begin();f.moveTo(.5*u,0);f.lineTo(u,F);f.lineTo(u,A-F);f.lineTo(.5*u,A);f.lineTo(0,A-F);f.lineTo(0,F);f.close();f.fillAndStroke();f.setShadow(!1);f.begin();f.moveTo(0,F);f.lineTo(.5*u,2*F);f.lineTo(u,F);f.moveTo(.5*u,2*F);f.lineTo(.5*u,A);f.stroke()};mxCellRenderer.registerShape("isoCube2",-M);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(0,Math.min(.5*A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.translate(q,z);0==F?(f.rect(0,0,u,A),f.fillAndStroke()):(f.begin(),f.moveTo(0,F),f.arcTo(.5*u,F,0,0,1,.5*u,0),f.arcTo(.5*u,F,0,0,1,u,F),f.lineTo(u,A-F),f.arcTo(.5*u,F,0,0,1,.5*u,A),f.arcTo(.5*u,F,0,0,1,0,A-F),f.close(),f.fillAndStroke(),f.setShadow(!1),f.begin(),f.moveTo(u,F),f.arcTo(.5*u,F,0,0,1,.5*u,2*F),f.arcTo(.5*+f.begin(),f.moveTo(u-F,0),f.lineTo(u-F,F),f.lineTo(u,F),f.close(),f.fill()),f.begin(),f.moveTo(u-F,0),f.lineTo(u-F,F),f.lineTo(u,F),f.end(),f.stroke())};mxCellRenderer.registerShape("note",E);mxUtils.extend(P,E);mxCellRenderer.registerShape("note2",P);P.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,q*this.scale),0,0)}return null};mxUtils.extend(L,mxShape);L.prototype.isoAngle=+15;L.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;F=Math.min(u*Math.tan(F),.5*A);f.translate(q,z);f.begin();f.moveTo(.5*u,0);f.lineTo(u,F);f.lineTo(u,A-F);f.lineTo(.5*u,A);f.lineTo(0,A-F);f.lineTo(0,F);f.close();f.fillAndStroke();f.setShadow(!1);f.begin();f.moveTo(0,F);f.lineTo(.5*u,2*F);f.lineTo(u,F);f.moveTo(.5*u,2*F);f.lineTo(.5*u,A);f.stroke()};mxCellRenderer.registerShape("isoCube2",+L);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(0,Math.min(.5*A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.translate(q,z);0==F?(f.rect(0,0,u,A),f.fillAndStroke()):(f.begin(),f.moveTo(0,F),f.arcTo(.5*u,F,0,0,1,.5*u,0),f.arcTo(.5*u,F,0,0,1,u,F),f.lineTo(u,A-F),f.arcTo(.5*u,F,0,0,1,.5*u,A),f.arcTo(.5*u,F,0,0,1,0,A-F),f.close(),f.fillAndStroke(),f.setShadow(!1),f.begin(),f.moveTo(u,F),f.arcTo(.5*u,F,0,0,1,.5*u,2*F),f.arcTo(.5*u,F,0,0,1,0,F),f.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(g,mxCylinder);g.prototype.size=15;g.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.max(0,Math.min(.5*A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),H=mxUtils.getValue(this.style,"lid",!0);f.translate(q,z);0==F?(f.rect(0,0,u,A),f.fillAndStroke()):(f.begin(),H?(f.moveTo(0,F),f.arcTo(.5*u,F,0,0,1,.5*u,0),f.arcTo(.5*u,F,0,0,1,u,F)):(f.moveTo(0,0),f.arcTo(.5*u,F,0,0,0,.5*u,F),f.arcTo(.5*u,F,0,0,0,u,0)),f.lineTo(u,A-F),f.arcTo(.5*u,F,0,0,1,.5*u,A),f.arcTo(.5*u,F,0,0,1,0,A-F),f.close(),f.fillAndStroke(),f.setShadow(!1),H&&(f.begin(),f.moveTo(u,F),f.arcTo(.5*u,F,0,0,1,.5*u,2*F),f.arcTo(.5*u,F,0,0,1,0,F),f.stroke()))};mxCellRenderer.registerShape("cylinder3",g);mxUtils.extend(l,mxActor);l.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u/2,.5*A,u,0);f.quadTo(.5*u,A/2,u,A);f.quadTo(u/2,.5*A,0,A);f.quadTo(.5*u,A/2,0,0);f.end()};mxCellRenderer.registerShape("switch",l);mxUtils.extend(t,mxCylinder);t.prototype.tabWidth=60;t.prototype.tabHeight=20;t.prototype.tabPosition="right";t.prototype.arcSize=.1;t.prototype.isRoundable=function(){return!0};t.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var F=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),H=mxUtils.getValue(this.style,@@ -2869,158 +2873,158 @@ this.arcSize));z=mxUtils.getValue(this.style,"umlStateConnection",null);H||(q*=M3,3),f.stroke(),f.begin(),f.moveTo(u-30,A-15),f.lineTo(u-20,A-15),f.stroke());"connPointRefEntry"==z?(f.ellipse(0,.5*A-10,20,20),f.fillAndStroke()):"connPointRefExit"==z&&(f.ellipse(0,.5*A-10,20,20),f.fillAndStroke(),f.begin(),f.moveTo(5,.5*A-5),f.lineTo(15,.5*A+5),f.moveTo(15,.5*A-5),f.lineTo(5,.5*A+5),f.stroke())};B.prototype.getLabelMargins=function(f){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(D,mxActor);D.prototype.size=30;D.prototype.isRoundable=function(){return!0};D.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u,0),new mxPoint(u,A),new mxPoint(0,A),new mxPoint(0,q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("card",D);mxUtils.extend(I,mxActor);I.prototype.size=.4;I.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(0,q/2);f.quadTo(u/4,1.4*q,u/2,q/2);f.quadTo(3*u/4,q*(1-1.4),u,q/2);f.lineTo(u,A-q/2);f.quadTo(3*u/4,A-1.4*q,u/2,A-q/2);f.quadTo(u/4,A-q*(1-1.4),0,A-q/2);f.lineTo(0,q/2);f.close();f.end()};I.prototype.getLabelBounds=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=-mxUtils.getValue(this.style,"size",this.size),z=f.width,u=f.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return q*=u,new mxRectangle(f.x,f.y+q,z,u-2*q);q*=z;return new mxRectangle(f.x+q,f.y,z-2*q,u)}return f};mxCellRenderer.registerShape("tape",I);mxUtils.extend(L,mxActor);L.prototype.size=.3;L.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,-"size",this.size))*f.height):null};L.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(0,0);f.lineTo(u,0);f.lineTo(u,A-q/2);f.quadTo(3*u/4,A-1.4*q,u/2,A-q/2);f.quadTo(u/4,A-q*(1-1.4),0,A-q/2);f.lineTo(0,q/2);f.close();f.end()};mxCellRenderer.registerShape("document",L);var qb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(f,q,z,u){var A=mxUtils.getValue(this.style,"size");return null!=+mxUtils.getValue(this.style,"size",this.size),z=f.width,u=f.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return q*=u,new mxRectangle(f.x,f.y+q,z,u-2*q);q*=z;return new mxRectangle(f.x+q,f.y,z-2*q,u)}return f};mxCellRenderer.registerShape("tape",I);mxUtils.extend(K,mxActor);K.prototype.size=.3;K.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,+"size",this.size))*f.height):null};K.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(0,0);f.lineTo(u,0);f.lineTo(u,A-q/2);f.quadTo(3*u/4,A-1.4*q,u/2,A-q/2);f.quadTo(u/4,A-q*(1-1.4),0,A-q/2);f.lineTo(0,q/2);f.close();f.end()};mxCellRenderer.registerShape("document",K);var qb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(f,q,z,u){var A=mxUtils.getValue(this.style,"size");return null!=A?u*Math.max(0,Math.min(1,A)):qb.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,f.height*q),0,0)}return null};g.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(q/=2);return new mxRectangle(0,Math.min(f.height*this.scale,2*q*this.scale),0,Math.max(0,.3*q*this.scale))}return null};t.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;q=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),A=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));A||(F*=Math.min(f.width,f.height));F=Math.min(F,.5*f.width,.5*(f.height-q));u||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(f.width,f.width-z),Math.min(f.height,f.height-q)):new mxRectangle(Math.min(f.width,f.width-z),0,F,Math.min(f.height,f.height-q))}return new mxRectangle(0,Math.min(f.height,q),0,0)}return null};B.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=-mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};Q.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,q*this.scale),0,Math.max(0,q*this.scale))}return null};mxUtils.extend(N,mxActor);N.prototype.size=.2;N.prototype.fixedSize=20;N.prototype.isRoundable=function(){return!0};N.prototype.redrawPath=function(f,q,z,u,A){q=-"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(q,0),new mxPoint(u,0),new mxPoint(u-q,A)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("parallelogram",N);mxUtils.extend(K,mxActor);K.prototype.size=-.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,-A)],this.isRounded,z,!0)};mxCellRenderer.registerShape("trapezoid",K);mxUtils.extend(da,mxActor);da.prototype.size=.5;da.prototype.redrawPath=function(f,q,z,u,A){f.setFillColor(null);q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(u,0),new mxPoint(q,0),new mxPoint(q,A/2),new mxPoint(0,A/2),new mxPoint(q,A/2),new mxPoint(q,A),new mxPoint(u,A)],this.isRounded,-z,!1);f.end()};mxCellRenderer.registerShape("curlyBracket",da);mxUtils.extend(ja,mxActor);ja.prototype.redrawPath=function(f,q,z,u,A){f.setStrokeWidth(1);f.setFillColor(this.stroke);q=u/5;f.rect(0,0,q,A);f.fillAndStroke();f.rect(2*q,0,q,A);f.fillAndStroke();f.rect(4*q,0,q,A);f.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ja);ea.prototype.moveTo=function(f,q){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q;this.firstX=f;this.firstY=q};ea.prototype.close=+mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};P.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var q=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,q*this.scale),0,Math.max(0,q*this.scale))}return null};mxUtils.extend(M,mxActor);M.prototype.size=.2;M.prototype.fixedSize=20;M.prototype.isRoundable=function(){return!0};M.prototype.redrawPath=function(f,q,z,u,A){q=+"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(q,0),new mxPoint(u,0),new mxPoint(u-q,A)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("parallelogram",M);mxUtils.extend(V,mxActor);V.prototype.size=+.2;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,+A)],this.isRounded,z,!0)};mxCellRenderer.registerShape("trapezoid",V);mxUtils.extend(Q,mxActor);Q.prototype.size=.5;Q.prototype.redrawPath=function(f,q,z,u,A){f.setFillColor(null);q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(u,0),new mxPoint(q,0),new mxPoint(q,A/2),new mxPoint(0,A/2),new mxPoint(q,A/2),new mxPoint(q,A),new mxPoint(u,A)],this.isRounded,+z,!1);f.end()};mxCellRenderer.registerShape("curlyBracket",Q);mxUtils.extend(ja,mxActor);ja.prototype.redrawPath=function(f,q,z,u,A){f.setStrokeWidth(1);f.setFillColor(this.stroke);q=u/5;f.rect(0,0,q,A);f.fillAndStroke();f.rect(2*q,0,q,A);f.fillAndStroke();f.rect(4*q,0,q,A);f.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ja);ea.prototype.moveTo=function(f,q){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q;this.firstX=f;this.firstY=q};ea.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)};ea.prototype.quadTo=function(f,q,z,u){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=u};ea.prototype.curveTo=function(f,q,z,u,A,F){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=A;this.lastY=F};ea.prototype.arcTo=function(f,q,z,u,A,F,H){this.originalArcTo.apply(this.canvas,arguments);-this.lastX=F;this.lastY=H};ea.prototype.lineTo=function(f,q){if(null!=this.lastX&&null!=this.lastY){var z=function(pa){return"number"===typeof pa?pa?0>pa?-1:1:pa===pa?0:NaN:NaN},u=Math.abs(f-this.lastX),A=Math.abs(q-this.lastY),F=Math.sqrt(u*u+A*A);if(2>F){this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q;return}var H=Math.round(F/10),ha=this.defaultVariation;5>H&&(H=5,ha/=3);var O=z(f-this.lastX)*u/H;z=z(q-this.lastY)*A/H;u/=F;A/=F;for(F=0;F<H;F++){var va=(Math.random()--.5)*ha;this.originalLineTo.call(this.canvas,O*F+this.lastX-va*A,z*F+this.lastY-va*u)}this.originalLineTo.call(this.canvas,f,q)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q};ea.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 gb=mxShape.prototype.beforePaint;-mxShape.prototype.beforePaint=function(f){gb.apply(this,arguments);null==f.handJiggle&&(f.handJiggle=this.createHandJiggle(f))};var bb=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(f){bb.apply(this,arguments);null!=f.handJiggle&&(f.handJiggle.destroy(),delete f.handJiggle)};mxShape.prototype.createComicCanvas=function(f){return new ea(f,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(f){return this.outline||null==-this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(f)};var db=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"))&&db.apply(this,arguments)};var lb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(f,q,z,u,A){if(null==f.handJiggle||+this.lastX=F;this.lastY=H};ea.prototype.lineTo=function(f,q){if(null!=this.lastX&&null!=this.lastY){var z=function(oa){return"number"===typeof oa?oa?0>oa?-1:1:oa===oa?0:NaN:NaN},u=Math.abs(f-this.lastX),A=Math.abs(q-this.lastY),F=Math.sqrt(u*u+A*A);if(2>F){this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q;return}var H=Math.round(F/10),ha=this.defaultVariation;5>H&&(H=5,ha/=3);var O=z(f-this.lastX)*u/H;z=z(q-this.lastY)*A/H;u/=F;A/=F;for(F=0;F<H;F++){var va=(Math.random()-+.5)*ha;this.originalLineTo.call(this.canvas,O*F+this.lastX-va*A,z*F+this.lastY-va*u)}this.originalLineTo.call(this.canvas,f,q)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=q};ea.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 hb=mxShape.prototype.beforePaint;+mxShape.prototype.beforePaint=function(f){hb.apply(this,arguments);null==f.handJiggle&&(f.handJiggle=this.createHandJiggle(f))};var cb=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(f){cb.apply(this,arguments);null!=f.handJiggle&&(f.handJiggle.destroy(),delete f.handJiggle)};mxShape.prototype.createComicCanvas=function(f){return new ea(f,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(f){return this.outline||null==+this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(f)};var fb=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"))&&fb.apply(this,arguments)};var lb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(f,q,z,u,A){if(null==f.handJiggle||f.handJiggle.constructor!=ea)lb.apply(this,arguments);else{var F=!0;null!=this.style&&(F="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(F||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)F||null!=this.fill&&this.fill!=mxConstants.NONE||(f.pointerEvents=!1),f.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?F=Math.min(u/2,Math.min(A/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,-mxConstants.LINE_ARCSIZE)/2)):(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,F=Math.min(u*F,A*F)),f.moveTo(q+F,z),f.lineTo(q+u-F,z),f.quadTo(q+u,z,q+u,z+F),f.lineTo(q+u,z+A-F),f.quadTo(q+u,z+A,q+u-F,z+A),f.lineTo(q+F,z+A),f.quadTo(q,z+A,q,z+A-F),f.lineTo(q,z+F),f.quadTo(q,z,q+F,z)):(f.moveTo(q,z),f.lineTo(q+u,z),f.lineTo(q+u,z+A),f.lineTo(q,z+A),f.lineTo(q,z)),f.close(),f.end(),f.fillAndStroke()}};mxUtils.extend(ca,mxRectangleShape);ca.prototype.size=-.1;ca.prototype.fixedSize=!1;ca.prototype.isHtmlAllowed=function(){return!1};ca.prototype.getLabelBounds=function(f){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var q=f.width,z=f.height;f=new mxRectangle(f.x,f.y,q,z);var u=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),A=parseFloat(mxUtils.getValue(this.style,"size",this.size));u?A=Math.max(0,Math.min(q,-A*this.scale)):(A=q*Math.max(0,Math.min(1,A)),this.isRounded&&(u=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,A=Math.max(A,Math.min(q*u,z*u))));f.x+=Math.round(A);f.width-=Math.round(2*A);return f}return f};ca.prototype.paintForeground=function(f,q,z,u,A){var F=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),H=parseFloat(mxUtils.getValue(this.style,"size",this.size));H=F?Math.max(0,Math.min(u,H)):u*Math.max(0,Math.min(1,H));this.isRounded&&-(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,H=Math.max(H,Math.min(u*F,A*F)));H=Math.round(H);f.begin();f.moveTo(q+H,z);f.lineTo(q+H,z+A);f.moveTo(q+u-H,z);f.lineTo(q+u-H,z+A);f.end();f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",ca);mxCellRenderer.registerShape("process2",ca);mxUtils.extend(fa,mxRectangleShape);fa.prototype.paintBackground=function(f,q,z,u,A){f.setFillColor(mxConstants.NONE);-f.rect(q,z,u,A);f.fill()};fa.prototype.paintForeground=function(f,q,z,u,A){};mxCellRenderer.registerShape("transparent",fa);mxUtils.extend(la,mxHexagon);la.prototype.size=30;la.prototype.position=.5;la.prototype.position2=.5;la.prototype.base=20;la.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};la.prototype.isRoundable=function(){return!0};la.prototype.redrawPath=function(f,q,z,u,A){q=mxUtils.getValue(this.style,+mxConstants.LINE_ARCSIZE)/2)):(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,F=Math.min(u*F,A*F)),f.moveTo(q+F,z),f.lineTo(q+u-F,z),f.quadTo(q+u,z,q+u,z+F),f.lineTo(q+u,z+A-F),f.quadTo(q+u,z+A,q+u-F,z+A),f.lineTo(q+F,z+A),f.quadTo(q,z+A,q,z+A-F),f.lineTo(q,z+F),f.quadTo(q,z,q+F,z)):(f.moveTo(q,z),f.lineTo(q+u,z),f.lineTo(q+u,z+A),f.lineTo(q,z+A),f.lineTo(q,z)),f.close(),f.end(),f.fillAndStroke()}};mxUtils.extend(da,mxRectangleShape);da.prototype.size=+.1;da.prototype.fixedSize=!1;da.prototype.isHtmlAllowed=function(){return!1};da.prototype.getLabelBounds=function(f){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var q=f.width,z=f.height;f=new mxRectangle(f.x,f.y,q,z);var u=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),A=parseFloat(mxUtils.getValue(this.style,"size",this.size));u?A=Math.max(0,Math.min(q,+A*this.scale)):(A=q*Math.max(0,Math.min(1,A)),this.isRounded&&(u=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,A=Math.max(A,Math.min(q*u,z*u))));f.x+=Math.round(A);f.width-=Math.round(2*A);return f}return f};da.prototype.paintForeground=function(f,q,z,u,A){var F=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),H=parseFloat(mxUtils.getValue(this.style,"size",this.size));H=F?Math.max(0,Math.min(u,H)):u*Math.max(0,Math.min(1,H));this.isRounded&&+(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,H=Math.max(H,Math.min(u*F,A*F)));H=Math.round(H);f.begin();f.moveTo(q+H,z);f.lineTo(q+H,z+A);f.moveTo(q+u-H,z);f.lineTo(q+u-H,z+A);f.end();f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",da);mxCellRenderer.registerShape("process2",da);mxUtils.extend(ia,mxRectangleShape);ia.prototype.paintBackground=function(f,q,z,u,A){f.setFillColor(mxConstants.NONE);+f.rect(q,z,u,A);f.fill()};ia.prototype.paintForeground=function(f,q,z,u,A){};mxCellRenderer.registerShape("transparent",ia);mxUtils.extend(la,mxHexagon);la.prototype.size=30;la.prototype.position=.5;la.prototype.position2=.5;la.prototype.base=20;la.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};la.prototype.isRoundable=function(){return!0};la.prototype.redrawPath=function(f,q,z,u,A){q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var F=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),H=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ha=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A-z),new mxPoint(Math.min(u,F+ha),A-z),new mxPoint(H,A),new mxPoint(Math.max(0,F),A-z),new mxPoint(0,A-z)],this.isRounded,q,!0,[4])};mxCellRenderer.registerShape("callout",la);mxUtils.extend(ka,mxActor);ka.prototype.size=.2;ka.prototype.fixedSize=20;ka.prototype.isRoundable=function(){return!0};ka.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(0,A),new mxPoint(q,A/2)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("step",ka);mxUtils.extend(V,mxHexagon);V.prototype.size=.25;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,-"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,.5*A),new mxPoint(u-q,A),new mxPoint(q,A),new mxPoint(0,.5*A)],this.isRounded,z,!0)};mxCellRenderer.registerShape("hexagon",V);mxUtils.extend(k,mxRectangleShape);+"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(0,A),new mxPoint(q,A/2)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("step",ka);mxUtils.extend(W,mxHexagon);W.prototype.size=.25;W.prototype.fixedSize=20;W.prototype.isRoundable=function(){return!0};W.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,+"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,.5*A),new mxPoint(u-q,A),new mxPoint(q,A),new mxPoint(0,.5*A)],this.isRounded,z,!0)};mxCellRenderer.registerShape("hexagon",W);mxUtils.extend(k,mxRectangleShape);k.prototype.isHtmlAllowed=function(){return!1};k.prototype.paintForeground=function(f,q,z,u,A){var F=Math.min(u/5,A/5)+1;f.begin();f.moveTo(q+u/2,z+F);f.lineTo(q+u/2,z+A-F);f.moveTo(q+F,z+A/2);f.lineTo(q+u-F,z+A/2);f.end();f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",k);var ub=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(f){if(1==this.style["double"]){var q=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||-0))*this.scale;return new mxRectangle(f.x+q,f.y+q,f.width-2*q,f.height-2*q)}return f};mxRhombus.prototype.paintVertexShape=function(f,q,z,u,A){ub.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var F=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);q+=F;z+=F;u-=2*F;A-=2*F;0<u&&0<A&&(f.setShadow(!1),ub.apply(this,[f,q,z,u,A]))}};mxUtils.extend(x,mxRectangleShape);x.prototype.isHtmlAllowed=function(){return!1};x.prototype.getLabelBounds=function(f){if(1==-this.style["double"]){var q=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(f.x+q,f.y+q,f.width-2*q,f.height-2*q)}return f};x.prototype.paintForeground=function(f,q,z,u,A){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var F=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);q+=F;z+=F;u-=2*F;A-=2*F;0<u&&0<A&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}f.setDashed(!1);-F=0;do{var H=mxCellRenderer.defaultShapes[this.style["symbol"+F]];if(null!=H){var ha=this.style["symbol"+F+"Align"],O=this.style["symbol"+F+"VerticalAlign"],va=this.style["symbol"+F+"Width"],pa=this.style["symbol"+F+"Height"],Wa=this.style["symbol"+F+"Spacing"]||0,kb=this.style["symbol"+F+"VSpacing"]||Wa,fb=this.style["symbol"+F+"ArcSpacing"];null!=fb&&(fb*=this.getArcSize(u+this.strokewidth,A+this.strokewidth),Wa+=fb,kb+=fb);fb=q;var Ea=z;fb=ha==mxConstants.ALIGN_CENTER?fb+(u-va)/2:ha==mxConstants.ALIGN_RIGHT?-fb+(u-va-Wa):fb+Wa;Ea=O==mxConstants.ALIGN_MIDDLE?Ea+(A-pa)/2:O==mxConstants.ALIGN_BOTTOM?Ea+(A-pa-kb):Ea+kb;f.save();ha=new H;ha.style=this.style;H.prototype.paintVertexShape.call(ha,f,fb,Ea,va,pa);f.restore()}F++}while(null!=H)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",x);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(f,q,z,u,A,F){F?(f.moveTo(0,0),f.lineTo(u/2,A/2),f.lineTo(u,0),f.end()):(f.moveTo(0,0),f.lineTo(u,0),f.lineTo(u,-A),f.lineTo(0,A),f.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(R,mxShape);R.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.ellipse(u/4,0,u/2,A/4);f.fillAndStroke();f.begin();f.moveTo(u/2,A/4);f.lineTo(u/2,2*A/3);f.moveTo(u/2,A/3);f.lineTo(0,A/3);f.moveTo(u/2,A/3);f.lineTo(u,A/3);f.moveTo(u/2,2*A/3);f.lineTo(0,A);f.moveTo(u/2,2*A/3);f.lineTo(u,A);f.end();f.stroke()};mxCellRenderer.registerShape("umlActor",R);mxUtils.extend(Y,mxShape);Y.prototype.getLabelMargins=-function(f){return new mxRectangle(f.width/6,0,0,0)};Y.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(0,A/4);f.lineTo(0,3*A/4);f.end();f.stroke();f.begin();f.moveTo(0,A/2);f.lineTo(u/6,A/2);f.end();f.stroke();f.ellipse(u/6,0,5*u/6,A);f.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",Y);mxUtils.extend(Z,mxEllipse);Z.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(q+u/8,z+A);f.lineTo(q+-7*u/8,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("umlEntity",Z);mxUtils.extend(W,mxShape);W.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(u,0);f.lineTo(0,A);f.moveTo(0,0);f.lineTo(u,A);f.end();f.stroke()};mxCellRenderer.registerShape("umlDestroy",W);mxUtils.extend(U,mxShape);U.prototype.getLabelBounds=function(f){return new mxRectangle(f.x,f.y+f.height/8,f.width,7*f.height/8)};U.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();-f.moveTo(3*u/8,A/8*1.1);f.lineTo(5*u/8,0);f.end();f.stroke();f.ellipse(0,A/8,u,7*A/8);f.fillAndStroke()};U.prototype.paintForeground=function(f,q,z,u,A){f.begin();f.moveTo(3*u/8,A/8*1.1);f.lineTo(5*u/8,A/4);f.end();f.stroke()};mxCellRenderer.registerShape("umlControl",U);mxUtils.extend(aa,mxRectangleShape);aa.prototype.size=40;aa.prototype.isHtmlAllowed=function(){return!1};aa.prototype.getLabelBounds=function(f){var q=Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*-this.scale));return new mxRectangle(f.x,f.y,f.width,q)};aa.prototype.paintBackground=function(f,q,z,u,A){var F=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),H=mxUtils.getValue(this.style,"participant");null==H||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,f,q,z,u,F):(H=this.state.view.graph.cellRenderer.getShape(H),null!=H&&H!=aa&&(H=new H,H.apply(this.state),f.save(),H.paintVertexShape(f,q,z,u,F),f.restore()));F<A&&(f.setDashed("1"==mxUtils.getValue(this.style,-"lifelineDashed","1")),f.begin(),f.moveTo(q+u/2,z+F),f.lineTo(q+u/2,z+A),f.end(),f.stroke())};aa.prototype.paintForeground=function(f,q,z,u,A){var F=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,f,q,z,u,Math.min(A,F))};mxCellRenderer.registerShape("umlLifeline",aa);mxUtils.extend(ia,mxShape);ia.prototype.width=60;ia.prototype.height=30;ia.prototype.corner=10;ia.prototype.configurePointerEvents=function(f){var q=-mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=q&&q!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(f.pointerEvents=!1)};ia.prototype.getLabelMargins=function(f){return new mxRectangle(0,0,f.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),f.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};ia.prototype.paintBackground=-function(f,q,z,u,A){var F=this.corner,H=Math.min(u,Math.max(F,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ha=Math.min(A,Math.max(1.5*F,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),O=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);O!=mxConstants.NONE&&(f.setFillColor(O),f.rect(q,z,u,A),f.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(f,q,z,u,A),f.setGradient(this.fill,-this.gradient,q,z,u,A,this.gradientDirection)):f.setFillColor(this.fill);f.pointerEvents=!0;f.begin();f.moveTo(q,z);f.lineTo(q+H,z);f.lineTo(q+H,z+Math.max(0,ha-1.5*F));f.lineTo(q+Math.max(0,H-F),z+ha);f.lineTo(q,z+ha);f.close();f.fillAndStroke();this.configurePointerEvents(f);f.begin();f.moveTo(q+H,z);f.lineTo(q+u,z);f.lineTo(q+u,z+A);f.lineTo(q,z+A);f.lineTo(q,z+ha);f.stroke()};mxCellRenderer.registerShape("umlFrame",ia);mxPerimeter.CenterPerimeter=function(f,q,z,u){return new mxPoint(f.getCenterX(),-f.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(f,q,z,u){u=aa.prototype.size;null!=q&&(u=mxUtils.getValue(q.style,"size",u)*q.view.scale);q=parseFloat(q.style[mxConstants.STYLE_STROKEWIDTH]||1)*q.view.scale/2-1;z.x<f.getCenterX()&&(q=-1*(q+1));return new mxPoint(f.getCenterX()+q,Math.min(f.y+f.height,Math.max(f.y+u,z.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=-function(f,q,z,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(f,q,z,u){u=parseFloat(q.style[mxConstants.STYLE_STROKEWIDTH]||1)*q.view.scale/2-1;null!=q.style.backboneSize&&(u+=parseFloat(q.style.backboneSize)*q.view.scale/2-1);if("south"==q.style[mxConstants.STYLE_DIRECTION]||"north"==q.style[mxConstants.STYLE_DIRECTION])return z.x<f.getCenterX()&&(u=-1*(u+1)),-new mxPoint(f.getCenterX()+u,Math.min(f.y+f.height,Math.max(f.y,z.y)));z.y<f.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(f.x+f.width,Math.max(f.x,z.x)),f.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(f,q,z,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(f,new mxRectangle(0,0,0,Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(q.style,"size",la.prototype.size))*q.view.scale))),-q.style),q,z,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize","0"),F=A?N.prototype.fixedSize:N.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height;q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_NORTH||q==-mxConstants.DIRECTION_SOUTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha)]):(A=A?Math.max(0,Math.min(.5*O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,ha+va),new mxPoint(H,ha+va),new mxPoint(H+A,ha)]);va=f.getCenterX();f=f.getCenterY();f=new mxPoint(va,f);u&&(z.x<H||z.x>H+O?f.y=z.y:f.x=z.x);return mxUtils.getPerimeterPoint(ha,f,-z)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize","0"),F=A?K.prototype.fixedSize:K.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height;q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_EAST?(A=A?Math.max(0,+0))*this.scale;return new mxRectangle(f.x+q,f.y+q,f.width-2*q,f.height-2*q)}return f};mxRhombus.prototype.paintVertexShape=function(f,q,z,u,A){ub.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var F=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);q+=F;z+=F;u-=2*F;A-=2*F;0<u&&0<A&&(f.setShadow(!1),ub.apply(this,[f,q,z,u,A]))}};mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.getLabelBounds=function(f){if(1==+this.style["double"]){var q=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(f.x+q,f.y+q,f.width-2*q,f.height-2*q)}return f};y.prototype.paintForeground=function(f,q,z,u,A){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var F=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);q+=F;z+=F;u-=2*F;A-=2*F;0<u&&0<A&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}f.setDashed(!1);+F=0;do{var H=mxCellRenderer.defaultShapes[this.style["symbol"+F]];if(null!=H){var ha=this.style["symbol"+F+"Align"],O=this.style["symbol"+F+"VerticalAlign"],va=this.style["symbol"+F+"Width"],oa=this.style["symbol"+F+"Height"],Xa=this.style["symbol"+F+"Spacing"]||0,kb=this.style["symbol"+F+"VSpacing"]||Xa,gb=this.style["symbol"+F+"ArcSpacing"];null!=gb&&(gb*=this.getArcSize(u+this.strokewidth,A+this.strokewidth),Xa+=gb,kb+=gb);gb=q;var Ea=z;gb=ha==mxConstants.ALIGN_CENTER?gb+(u-va)/2:ha==mxConstants.ALIGN_RIGHT?+gb+(u-va-Xa):gb+Xa;Ea=O==mxConstants.ALIGN_MIDDLE?Ea+(A-oa)/2:O==mxConstants.ALIGN_BOTTOM?Ea+(A-oa-kb):Ea+kb;f.save();ha=new H;ha.style=this.style;H.prototype.paintVertexShape.call(ha,f,gb,Ea,va,oa);f.restore()}F++}while(null!=H)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",y);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(f,q,z,u,A,F){F?(f.moveTo(0,0),f.lineTo(u/2,A/2),f.lineTo(u,0),f.end()):(f.moveTo(0,0),f.lineTo(u,0),f.lineTo(u,+A),f.lineTo(0,A),f.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(R,mxShape);R.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.ellipse(u/4,0,u/2,A/4);f.fillAndStroke();f.begin();f.moveTo(u/2,A/4);f.lineTo(u/2,2*A/3);f.moveTo(u/2,A/3);f.lineTo(0,A/3);f.moveTo(u/2,A/3);f.lineTo(u,A/3);f.moveTo(u/2,2*A/3);f.lineTo(0,A);f.moveTo(u/2,2*A/3);f.lineTo(u,A);f.end();f.stroke()};mxCellRenderer.registerShape("umlActor",R);mxUtils.extend(X,mxShape);X.prototype.getLabelMargins=+function(f){return new mxRectangle(f.width/6,0,0,0)};X.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(0,A/4);f.lineTo(0,3*A/4);f.end();f.stroke();f.begin();f.moveTo(0,A/2);f.lineTo(u/6,A/2);f.end();f.stroke();f.ellipse(u/6,0,5*u/6,A);f.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",X);mxUtils.extend(aa,mxEllipse);aa.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(q+u/8,z+A);+f.lineTo(q+7*u/8,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("umlEntity",aa);mxUtils.extend(Z,mxShape);Z.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(u,0);f.lineTo(0,A);f.moveTo(0,0);f.lineTo(u,A);f.end();f.stroke()};mxCellRenderer.registerShape("umlDestroy",Z);mxUtils.extend(U,mxShape);U.prototype.getLabelBounds=function(f){return new mxRectangle(f.x,f.y+f.height/8,f.width,7*f.height/8)};U.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,+z);f.begin();f.moveTo(3*u/8,A/8*1.1);f.lineTo(5*u/8,0);f.end();f.stroke();f.ellipse(0,A/8,u,7*A/8);f.fillAndStroke()};U.prototype.paintForeground=function(f,q,z,u,A){f.begin();f.moveTo(3*u/8,A/8*1.1);f.lineTo(5*u/8,A/4);f.end();f.stroke()};mxCellRenderer.registerShape("umlControl",U);mxUtils.extend(ba,mxRectangleShape);ba.prototype.size=40;ba.prototype.isHtmlAllowed=function(){return!1};ba.prototype.getLabelBounds=function(f){var q=Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(this.style,+"size",this.size))*this.scale));return new mxRectangle(f.x,f.y,f.width,q)};ba.prototype.paintBackground=function(f,q,z,u,A){var F=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),H=mxUtils.getValue(this.style,"participant");null==H||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,f,q,z,u,F):(H=this.state.view.graph.cellRenderer.getShape(H),null!=H&&H!=ba&&(H=new H,H.apply(this.state),f.save(),H.paintVertexShape(f,q,z,u,F),f.restore()));F<A&&(f.setDashed("1"==+mxUtils.getValue(this.style,"lifelineDashed","1")),f.begin(),f.moveTo(q+u/2,z+F),f.lineTo(q+u/2,z+A),f.end(),f.stroke())};ba.prototype.paintForeground=function(f,q,z,u,A){var F=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,f,q,z,u,Math.min(A,F))};mxCellRenderer.registerShape("umlLifeline",ba);mxUtils.extend(fa,mxShape);fa.prototype.width=60;fa.prototype.height=30;fa.prototype.corner=10;fa.prototype.configurePointerEvents=+function(f){var q=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=q&&q!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(f.pointerEvents=!1)};fa.prototype.getLabelMargins=function(f){return new mxRectangle(0,0,f.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),f.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};+fa.prototype.paintBackground=function(f,q,z,u,A){var F=this.corner,H=Math.min(u,Math.max(F,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ha=Math.min(A,Math.max(1.5*F,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),O=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);O!=mxConstants.NONE&&(f.setFillColor(O),f.rect(q,z,u,A),f.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(f,+q,z,u,A),f.setGradient(this.fill,this.gradient,q,z,u,A,this.gradientDirection)):f.setFillColor(this.fill);f.pointerEvents=!0;f.begin();f.moveTo(q,z);f.lineTo(q+H,z);f.lineTo(q+H,z+Math.max(0,ha-1.5*F));f.lineTo(q+Math.max(0,H-F),z+ha);f.lineTo(q,z+ha);f.close();f.fillAndStroke();this.configurePointerEvents(f);f.begin();f.moveTo(q+H,z);f.lineTo(q+u,z);f.lineTo(q+u,z+A);f.lineTo(q,z+A);f.lineTo(q,z+ha);f.stroke()};mxCellRenderer.registerShape("umlFrame",fa);mxPerimeter.CenterPerimeter=function(f,q,+z,u){return new mxPoint(f.getCenterX(),f.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(f,q,z,u){u=ba.prototype.size;null!=q&&(u=mxUtils.getValue(q.style,"size",u)*q.view.scale);q=parseFloat(q.style[mxConstants.STYLE_STROKEWIDTH]||1)*q.view.scale/2-1;z.x<f.getCenterX()&&(q=-1*(q+1));return new mxPoint(f.getCenterX()+q,Math.min(f.y+f.height,Math.max(f.y+u,z.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);+mxPerimeter.OrthogonalPerimeter=function(f,q,z,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(f,q,z,u){u=parseFloat(q.style[mxConstants.STYLE_STROKEWIDTH]||1)*q.view.scale/2-1;null!=q.style.backboneSize&&(u+=parseFloat(q.style.backboneSize)*q.view.scale/2-1);if("south"==q.style[mxConstants.STYLE_DIRECTION]||"north"==q.style[mxConstants.STYLE_DIRECTION])return z.x<+f.getCenterX()&&(u=-1*(u+1)),new mxPoint(f.getCenterX()+u,Math.min(f.y+f.height,Math.max(f.y,z.y)));z.y<f.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(f.x+f.width,Math.max(f.x,z.x)),f.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(f,q,z,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(f,new mxRectangle(0,0,0,Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(q.style,"size",la.prototype.size))*+q.view.scale))),q.style),q,z,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize","0"),F=A?M.prototype.fixedSize:M.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height;q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_NORTH||+q==mxConstants.DIRECTION_SOUTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha)]):(A=A?Math.max(0,Math.min(.5*O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,ha+va),new mxPoint(H,ha+va),new mxPoint(H+A,ha)]);va=f.getCenterX();f=f.getCenterY();f=new mxPoint(va,f);u&&(z.x<H||z.x>H+O?f.y=z.y:f.x=z.x);return mxUtils.getPerimeterPoint(ha,+f,z)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize","0"),F=A?V.prototype.fixedSize:V.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height;q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_EAST?(A=A?Math.max(0,Math.min(.5*O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,ha+va),new mxPoint(H,ha+va),new mxPoint(H+A,ha)]):q==mxConstants.DIRECTION_WEST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,ha)]):q==mxConstants.DIRECTION_NORTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha+A),new mxPoint(H+O,ha),new mxPoint(H+O,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha+A)]):(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va-A),new mxPoint(H,ha+va),new mxPoint(H,ha)]);va=f.getCenterX();f=f.getCenterY();f=new mxPoint(va,f);u&&(z.x<H||z.x>H+O?f.y=z.y:f.x=z.x);return mxUtils.getPerimeterPoint(ha,f,z)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,-"fixedSize","0"),F=A?ka.prototype.fixedSize:ka.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height,pa=f.getCenterX();f=f.getCenterY();q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_EAST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,f),new mxPoint(H+O-A,ha+va),new mxPoint(H,-ha+va),new mxPoint(H+A,f),new mxPoint(H,ha)]):q==mxConstants.DIRECTION_WEST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,f),new mxPoint(H+O,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,f),new mxPoint(H+A,ha)]):q==mxConstants.DIRECTION_NORTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha+A),new mxPoint(pa,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va),new mxPoint(pa,ha+va-A),new mxPoint(H,-ha+va),new mxPoint(H,ha+A)]):(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(pa,ha+A),new mxPoint(H+O,ha),new mxPoint(H+O,ha+va-A),new mxPoint(pa,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha)]);pa=new mxPoint(pa,f);u&&(z.x<H||z.x>H+O?pa.y=z.y:pa.x=z.x);return mxUtils.getPerimeterPoint(ha,pa,z)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize",-"0"),F=A?V.prototype.fixedSize:V.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height,pa=f.getCenterX();f=f.getCenterY();q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_NORTH||q==mxConstants.DIRECTION_SOUTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(pa,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va-A),-new mxPoint(pa,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha+A),new mxPoint(pa,ha)]):(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,f),new mxPoint(H+O-A,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,f),new mxPoint(H+A,ha)]);pa=new mxPoint(pa,f);u&&(z.x<H||z.x>H+O?pa.y=z.y:pa.x=z.x);return mxUtils.getPerimeterPoint(ha,pa,z)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(na,mxShape);-na.prototype.size=10;na.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size));f.translate(q,z);f.ellipse((u-F)/2,0,F,F);f.fillAndStroke();f.begin();f.moveTo(u/2,F);f.lineTo(u/2,A);f.end();f.stroke()};mxCellRenderer.registerShape("lollipop",na);mxUtils.extend(qa,mxShape);qa.prototype.size=10;qa.prototype.inset=2;qa.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size)),H=parseFloat(mxUtils.getValue(this.style,-"inset",this.inset))+this.strokewidth;f.translate(q,z);f.begin();f.moveTo(u/2,F+H);f.lineTo(u/2,A);f.end();f.stroke();f.begin();f.moveTo((u-F)/2-H,F/2);f.quadTo((u-F)/2-H,F+H,u/2,F+H);f.quadTo((u+F)/2+H,F+H,(u+F)/2+H,F/2);f.end();f.stroke()};mxCellRenderer.registerShape("requires",qa);mxUtils.extend(ta,mxShape);ta.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.end();f.stroke()};mxCellRenderer.registerShape("requiredInterface",-ta);mxUtils.extend(ua,mxShape);ua.prototype.inset=2;ua.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;f.translate(q,z);f.ellipse(0,F,u-2*F,A-2*F);f.fillAndStroke();f.begin();f.moveTo(u/2,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u/2,A);f.end();f.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",ua);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=20;Ba.prototype.jettyHeight=10;Ba.prototype.redrawPath=+"fixedSize","0"),F=A?ka.prototype.fixedSize:ka.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height,oa=f.getCenterX();f=f.getCenterY();q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_EAST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,f),new mxPoint(H+O-A,ha+va),new mxPoint(H,+ha+va),new mxPoint(H+A,f),new mxPoint(H,ha)]):q==mxConstants.DIRECTION_WEST?(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O,ha),new mxPoint(H+O-A,f),new mxPoint(H+O,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,f),new mxPoint(H+A,ha)]):q==mxConstants.DIRECTION_NORTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha+A),new mxPoint(oa,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va),new mxPoint(oa,ha+va-A),new mxPoint(H,+ha+va),new mxPoint(H,ha+A)]):(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H,ha),new mxPoint(oa,ha+A),new mxPoint(H+O,ha),new mxPoint(H+O,ha+va-A),new mxPoint(oa,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha)]);oa=new mxPoint(oa,f);u&&(z.x<H||z.x>H+O?oa.y=z.y:oa.x=z.x);return mxUtils.getPerimeterPoint(ha,oa,z)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(f,q,z,u){var A="0"!=mxUtils.getValue(q.style,"fixedSize",+"0"),F=A?W.prototype.fixedSize:W.prototype.size;null!=q&&(F=mxUtils.getValue(q.style,"size",F));A&&(F*=q.view.scale);var H=f.x,ha=f.y,O=f.width,va=f.height,oa=f.getCenterX();f=f.getCenterY();q=null!=q?mxUtils.getValue(q.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;q==mxConstants.DIRECTION_NORTH||q==mxConstants.DIRECTION_SOUTH?(A=A?Math.max(0,Math.min(va,F)):va*Math.max(0,Math.min(1,F)),ha=[new mxPoint(oa,ha),new mxPoint(H+O,ha+A),new mxPoint(H+O,ha+va-A),+new mxPoint(oa,ha+va),new mxPoint(H,ha+va-A),new mxPoint(H,ha+A),new mxPoint(oa,ha)]):(A=A?Math.max(0,Math.min(O,F)):O*Math.max(0,Math.min(1,F)),ha=[new mxPoint(H+A,ha),new mxPoint(H+O-A,ha),new mxPoint(H+O,f),new mxPoint(H+O-A,ha+va),new mxPoint(H+A,ha+va),new mxPoint(H,f),new mxPoint(H+A,ha)]);oa=new mxPoint(oa,f);u&&(z.x<H||z.x>H+O?oa.y=z.y:oa.x=z.x);return mxUtils.getPerimeterPoint(ha,oa,z)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(na,mxShape);+na.prototype.size=10;na.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size));f.translate(q,z);f.ellipse((u-F)/2,0,F,F);f.fillAndStroke();f.begin();f.moveTo(u/2,F);f.lineTo(u/2,A);f.end();f.stroke()};mxCellRenderer.registerShape("lollipop",na);mxUtils.extend(pa,mxShape);pa.prototype.size=10;pa.prototype.inset=2;pa.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size)),H=parseFloat(mxUtils.getValue(this.style,+"inset",this.inset))+this.strokewidth;f.translate(q,z);f.begin();f.moveTo(u/2,F+H);f.lineTo(u/2,A);f.end();f.stroke();f.begin();f.moveTo((u-F)/2-H,F/2);f.quadTo((u-F)/2-H,F+H,u/2,F+H);f.quadTo((u+F)/2+H,F+H,(u+F)/2+H,F/2);f.end();f.stroke()};mxCellRenderer.registerShape("requires",pa);mxUtils.extend(ta,mxShape);ta.prototype.paintBackground=function(f,q,z,u,A){f.translate(q,z);f.begin();f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.end();f.stroke()};mxCellRenderer.registerShape("requiredInterface",+ta);mxUtils.extend(ua,mxShape);ua.prototype.inset=2;ua.prototype.paintBackground=function(f,q,z,u,A){var F=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;f.translate(q,z);f.ellipse(0,F,u-2*F,A-2*F);f.fillAndStroke();f.begin();f.moveTo(u/2,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u/2,A);f.end();f.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",ua);mxUtils.extend(Ca,mxCylinder);Ca.prototype.jettyWidth=20;Ca.prototype.jettyHeight=10;Ca.prototype.redrawPath=function(f,q,z,u,A,F){var H=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));q=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=H/2;H=z+H/2;var ha=Math.min(q,A-q),O=Math.min(ha+2*q,A-q);F?(f.moveTo(z,ha),f.lineTo(H,ha),f.lineTo(H,ha+q),f.lineTo(z,ha+q),f.moveTo(z,O),f.lineTo(H,O),f.lineTo(H,O+q),f.lineTo(z,O+q)):(f.moveTo(z,0),f.lineTo(u,0),f.lineTo(u,A),f.lineTo(z,A),f.lineTo(z,O+q),f.lineTo(0,O+q),f.lineTo(0,O),f.lineTo(z,O),f.lineTo(z,ha+q),f.lineTo(0,-ha+q),f.lineTo(0,ha),f.lineTo(z,ha),f.close());f.end()};mxCellRenderer.registerShape("module",Ba);mxUtils.extend(za,mxCylinder);za.prototype.jettyWidth=32;za.prototype.jettyHeight=12;za.prototype.redrawPath=function(f,q,z,u,A,F){var H=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));q=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=H/2;H=z+H/2;var ha=.3*A-q/2,O=.7*A-q/2;F?(f.moveTo(z,ha),f.lineTo(H,ha),f.lineTo(H,ha+q),f.lineTo(z,ha+q),f.moveTo(z,O),-f.lineTo(H,O),f.lineTo(H,O+q),f.lineTo(z,O+q)):(f.moveTo(z,0),f.lineTo(u,0),f.lineTo(u,A),f.lineTo(z,A),f.lineTo(z,O+q),f.lineTo(0,O+q),f.lineTo(0,O),f.lineTo(z,O),f.lineTo(z,ha+q),f.lineTo(0,ha+q),f.lineTo(0,ha),f.lineTo(z,ha),f.close());f.end()};mxCellRenderer.registerShape("component",za);mxUtils.extend(Aa,mxRectangleShape);Aa.prototype.paintForeground=function(f,q,z,u,A){var F=u/2,H=A/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;f.begin();this.addPoints(f,-[new mxPoint(q+F,z),new mxPoint(q+u,z+H),new mxPoint(q+F,z+A),new mxPoint(q,z+H)],this.isRounded,ha,!0);f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Aa);mxUtils.extend(Ga,mxDoubleEllipse);Ga.prototype.outerStroke=!0;Ga.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.min(4,Math.min(u/5,A/5));0<u&&0<A&&(f.ellipse(q+F,z+F,u-2*F,A-2*F),f.fillAndStroke());f.setShadow(!1);this.outerStroke&&(f.ellipse(q,z,u,A),f.stroke())};-mxCellRenderer.registerShape("endState",Ga);mxUtils.extend(Ra,Ga);Ra.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Ra);mxUtils.extend(Ha,mxArrowConnector);Ha.prototype.defaultWidth=4;Ha.prototype.isOpenEnded=function(){return!0};Ha.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Ha.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",Ha);mxUtils.extend(Qa,-mxArrowConnector);Qa.prototype.defaultWidth=10;Qa.prototype.defaultArrowWidth=20;Qa.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Qa.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Qa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",-Qa);mxUtils.extend(eb,mxActor);eb.prototype.size=30;eb.prototype.isRoundable=function(){return!0};eb.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(0,q),new mxPoint(u,0),new mxPoint(u,A)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("manualInput",eb);mxUtils.extend(Ma,mxRectangleShape);Ma.prototype.dx=-20;Ma.prototype.dy=20;Ma.prototype.isHtmlAllowed=function(){return!1};Ma.prototype.paintForeground=function(f,q,z,u,A){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var F=0;if(this.isRounded){var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;F=Math.max(F,Math.min(u*H,A*H))}H=Math.max(F,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));F=Math.max(F,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));-f.begin();f.moveTo(q,z+F);f.lineTo(q+u,z+F);f.end();f.stroke();f.begin();f.moveTo(q+H,z);f.lineTo(q+H,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("internalStorage",Ma);mxUtils.extend(ya,mxActor);ya.prototype.dx=20;ya.prototype.dy=20;ya.prototype.isRoundable=function(){return!0};ya.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,-"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint(q,z),new mxPoint(q,A),new mxPoint(0,A)],this.isRounded,F,!0);f.end()};mxCellRenderer.registerShape("corner",ya);mxUtils.extend(Sa,mxActor);Sa.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.lineTo(0,A);f.end();f.moveTo(u,0);f.lineTo(u,A);f.end();f.moveTo(0,A/2);f.lineTo(u,A/2);f.end()};mxCellRenderer.registerShape("crossbar",-Sa);mxUtils.extend(Oa,mxActor);Oa.prototype.dx=20;Oa.prototype.dy=20;Oa.prototype.isRoundable=function(){return!0};Oa.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,-0),new mxPoint(u,z),new mxPoint((u+q)/2,z),new mxPoint((u+q)/2,A),new mxPoint((u-q)/2,A),new mxPoint((u-q)/2,z),new mxPoint(0,z)],this.isRounded,F,!0);f.end()};mxCellRenderer.registerShape("tee",Oa);mxUtils.extend(Na,mxActor);Na.prototype.arrowWidth=.3;Na.prototype.arrowSize=.2;Na.prototype.isRoundable=function(){return!0};Na.prototype.redrawPath=function(f,q,z,u,A){var F=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"arrowSize",this.arrowSize))));z=(A-F)/2;F=z+F;var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,z),new mxPoint(u-q,z),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(u-q,F),new mxPoint(0,F)],this.isRounded,H,!0);f.end()};mxCellRenderer.registerShape("singleArrow",Na);mxUtils.extend(Pa,mxActor);Pa.prototype.isRoundable=function(){return!0};Pa.prototype.redrawPath=function(f,q,z,u,A){var F=A*Math.max(0,Math.min(1,-parseFloat(mxUtils.getValue(this.style,"arrowWidth",Na.prototype.arrowWidth))));q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Na.prototype.arrowSize))));z=(A-F)/2;F=z+F;var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A/2),new mxPoint(q,0),new mxPoint(q,z),new mxPoint(u-q,z),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(u-q,F),new mxPoint(q,F),new mxPoint(q,A)],this.isRounded,-H,!0);f.end()};mxCellRenderer.registerShape("doubleArrow",Pa);mxUtils.extend(oa,mxActor);oa.prototype.size=.1;oa.prototype.fixedSize=20;oa.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(q,0);f.lineTo(u,0);f.quadTo(u-2*q,A/2,u,A);f.lineTo(q,A);f.quadTo(q-2*q,A/2,q,0);f.close();-f.end()};mxCellRenderer.registerShape("dataStorage",oa);mxUtils.extend(Da,mxActor);Da.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.close();f.end()};mxCellRenderer.registerShape("or",Da);mxUtils.extend(Ca,mxActor);Ca.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.quadTo(u/2,A/2,0,0);f.close();f.end()};mxCellRenderer.registerShape("xor",Ca);mxUtils.extend(Ja,mxActor);Ja.prototype.size=20;Ja.prototype.isRoundable=-function(){return!0};Ja.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(u/2,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,.8*q),new mxPoint(u,A),new mxPoint(0,A),new mxPoint(0,.8*q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("loopLimit",Ja);mxUtils.extend(Xa,mxActor);Xa.prototype.size=.375;Xa.prototype.isRoundable=-function(){return!0};Xa.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A-q),new mxPoint(u/2,A),new mxPoint(0,A-q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("offPageConnector",Xa);mxUtils.extend(ib,mxEllipse);ib.prototype.paintVertexShape=function(f,q,z,-u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(q+u/2,z+A);f.lineTo(q+u,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("tapeData",ib);mxUtils.extend(y,mxEllipse);y.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(q,z+A/2);f.lineTo(q+u,z+A/2);f.end();f.stroke();f.begin();f.moveTo(q+u/2,z);f.lineTo(q+u/2,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("orEllipse",-y);mxUtils.extend(P,mxEllipse);P.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(q+.145*u,z+.145*A);f.lineTo(q+.855*u,z+.855*A);f.end();f.stroke();f.begin();f.moveTo(q+.855*u,z+.145*A);f.lineTo(q+.145*u,z+.855*A);f.end();f.stroke()};mxCellRenderer.registerShape("sumEllipse",P);mxUtils.extend(S,mxRhombus);S.prototype.paintVertexShape=function(f,q,z,u,A){mxRhombus.prototype.paintVertexShape.apply(this,arguments);-f.setShadow(!1);f.begin();f.moveTo(q,z+A/2);f.lineTo(q+u,z+A/2);f.end();f.stroke()};mxCellRenderer.registerShape("sortShape",S);mxUtils.extend(X,mxEllipse);X.prototype.paintVertexShape=function(f,q,z,u,A){f.begin();f.moveTo(q,z);f.lineTo(q+u,z);f.lineTo(q+u/2,z+A/2);f.close();f.fillAndStroke();f.begin();f.moveTo(q,z+A);f.lineTo(q+u,z+A);f.lineTo(q+u/2,z+A/2);f.close();f.fillAndStroke()};mxCellRenderer.registerShape("collate",X);mxUtils.extend(ba,mxEllipse);ba.prototype.paintVertexShape=function(f,-q,z,u,A){var F=f.state.strokeWidth/2,H=10+2*F,ha=z+A-H/2;f.begin();f.moveTo(q,z);f.lineTo(q,z+A);f.moveTo(q+F,ha);f.lineTo(q+F+H,ha-H/2);f.moveTo(q+F,ha);f.lineTo(q+F+H,ha+H/2);f.moveTo(q+F,ha);f.lineTo(q+u-F,ha);f.moveTo(q+u,z);f.lineTo(q+u,z+A);f.moveTo(q+u-F,ha);f.lineTo(q+u-H-F,ha-H/2);f.moveTo(q+u-F,ha);f.lineTo(q+u-H-F,ha+H/2);f.end();f.stroke()};mxCellRenderer.registerShape("dimension",ba);mxUtils.extend(ma,mxEllipse);ma.prototype.drawHidden=!0;ma.prototype.paintVertexShape=function(f,q,z,-u,A){this.outline||f.setStrokeColor(null);if(null!=this.style){var F=f.pointerEvents,H=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||H||(f.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),O="1"==mxUtils.getValue(this.style,"left","1"),va="1"==mxUtils.getValue(this.style,"right","1"),pa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||H||this.outline||ha||va||pa||O?(f.rect(q,z,u,A),f.fill(),f.pointerEvents=-F,f.setStrokeColor(this.stroke),f.setLineCap("square"),f.begin(),f.moveTo(q,z),this.outline||ha?f.lineTo(q+u,z):f.moveTo(q+u,z),this.outline||va?f.lineTo(q+u,z+A):f.moveTo(q+u,z+A),this.outline||pa?f.lineTo(q,z+A):f.moveTo(q,z+A),(this.outline||O)&&f.lineTo(q,z),f.end(),f.stroke(),f.setLineCap("flat")):f.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",ma);mxUtils.extend(ra,mxEllipse);ra.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,-arguments);f.setShadow(!1);f.begin();"vertical"==mxUtils.getValue(this.style,"line")?(f.moveTo(q+u/2,z),f.lineTo(q+u/2,z+A)):(f.moveTo(q,z+A/2),f.lineTo(q+u,z+A/2));f.end();f.stroke()};mxCellRenderer.registerShape("lineEllipse",ra);mxUtils.extend(wa,mxActor);wa.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(u,A/2);f.moveTo(0,0);f.lineTo(u-q,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u-q,A);f.lineTo(0,A);f.close();f.end()};mxCellRenderer.registerShape("delay",wa);mxUtils.extend(sa,mxActor);sa.prototype.size=-.2;sa.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(A,u);var F=Math.max(0,Math.min(q,q*parseFloat(mxUtils.getValue(this.style,"size",this.size))));q=(A-F)/2;z=q+F;var H=(u-F)/2;F=H+F;f.moveTo(0,q);f.lineTo(H,q);f.lineTo(H,0);f.lineTo(F,0);f.lineTo(F,q);f.lineTo(u,q);f.lineTo(u,z);f.lineTo(F,z);f.lineTo(F,A);f.lineTo(H,A);f.lineTo(H,z);f.lineTo(0,z);f.close();f.end()};mxCellRenderer.registerShape("cross",sa);mxUtils.extend(xa,mxActor);xa.prototype.size=.25;xa.prototype.redrawPath=function(f,-q,z,u,A){q=Math.min(u,A/2);z=Math.min(u-q,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);f.moveTo(0,A/2);f.lineTo(z,0);f.lineTo(u-q,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u-q,A);f.lineTo(z,A);f.close();f.end()};mxCellRenderer.registerShape("display",xa);mxUtils.extend(Fa,mxActor);Fa.prototype.cst={RECT2:"mxgraph.basic.rect"};Fa.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",+ha+q),f.lineTo(0,ha),f.lineTo(z,ha),f.close());f.end()};mxCellRenderer.registerShape("module",Ca);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=32;Ba.prototype.jettyHeight=12;Ba.prototype.redrawPath=function(f,q,z,u,A,F){var H=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));q=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=H/2;H=z+H/2;var ha=.3*A-q/2,O=.7*A-q/2;F?(f.moveTo(z,ha),f.lineTo(H,ha),f.lineTo(H,ha+q),f.lineTo(z,ha+q),f.moveTo(z,O),+f.lineTo(H,O),f.lineTo(H,O+q),f.lineTo(z,O+q)):(f.moveTo(z,0),f.lineTo(u,0),f.lineTo(u,A),f.lineTo(z,A),f.lineTo(z,O+q),f.lineTo(0,O+q),f.lineTo(0,O),f.lineTo(z,O),f.lineTo(z,ha+q),f.lineTo(0,ha+q),f.lineTo(0,ha),f.lineTo(z,ha),f.close());f.end()};mxCellRenderer.registerShape("component",Ba);mxUtils.extend(Aa,mxRectangleShape);Aa.prototype.paintForeground=function(f,q,z,u,A){var F=u/2,H=A/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;f.begin();this.addPoints(f,+[new mxPoint(q+F,z),new mxPoint(q+u,z+H),new mxPoint(q+F,z+A),new mxPoint(q,z+H)],this.isRounded,ha,!0);f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Aa);mxUtils.extend(Fa,mxDoubleEllipse);Fa.prototype.outerStroke=!0;Fa.prototype.paintVertexShape=function(f,q,z,u,A){var F=Math.min(4,Math.min(u/5,A/5));0<u&&0<A&&(f.ellipse(q+F,z+F,u-2*F,A-2*F),f.fillAndStroke());f.setShadow(!1);this.outerStroke&&(f.ellipse(q,z,u,A),f.stroke())};+mxCellRenderer.registerShape("endState",Fa);mxUtils.extend(Sa,Fa);Sa.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Sa);mxUtils.extend(La,mxArrowConnector);La.prototype.defaultWidth=4;La.prototype.isOpenEnded=function(){return!0};La.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};La.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",La);mxUtils.extend(Pa,+mxArrowConnector);Pa.prototype.defaultWidth=10;Pa.prototype.defaultArrowWidth=20;Pa.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Pa.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Pa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",+Pa);mxUtils.extend(db,mxActor);db.prototype.size=30;db.prototype.isRoundable=function(){return!0};db.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A),new mxPoint(0,q),new mxPoint(u,0),new mxPoint(u,A)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("manualInput",db);mxUtils.extend(Ia,mxRectangleShape);Ia.prototype.dx=+20;Ia.prototype.dy=20;Ia.prototype.isHtmlAllowed=function(){return!1};Ia.prototype.paintForeground=function(f,q,z,u,A){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var F=0;if(this.isRounded){var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;F=Math.max(F,Math.min(u*H,A*H))}H=Math.max(F,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));F=Math.max(F,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));+f.begin();f.moveTo(q,z+F);f.lineTo(q+u,z+F);f.end();f.stroke();f.begin();f.moveTo(q+H,z);f.lineTo(q+H,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("internalStorage",Ia);mxUtils.extend(za,mxActor);za.prototype.dx=20;za.prototype.dy=20;za.prototype.isRoundable=function(){return!0};za.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,+"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint(q,z),new mxPoint(q,A),new mxPoint(0,A)],this.isRounded,F,!0);f.end()};mxCellRenderer.registerShape("corner",za);mxUtils.extend(Ua,mxActor);Ua.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.lineTo(0,A);f.end();f.moveTo(u,0);f.lineTo(u,A);f.end();f.moveTo(0,A/2);f.lineTo(u,A/2);f.end()};mxCellRenderer.registerShape("crossbar",+Ua);mxUtils.extend(Qa,mxActor);Qa.prototype.dx=20;Qa.prototype.dy=20;Qa.prototype.isRoundable=function(){return!0};Qa.prototype.redrawPath=function(f,q,z,u,A){q=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,+0),new mxPoint(u,z),new mxPoint((u+q)/2,z),new mxPoint((u+q)/2,A),new mxPoint((u-q)/2,A),new mxPoint((u-q)/2,z),new mxPoint(0,z)],this.isRounded,F,!0);f.end()};mxCellRenderer.registerShape("tee",Qa);mxUtils.extend(Ma,mxActor);Ma.prototype.arrowWidth=.3;Ma.prototype.arrowSize=.2;Ma.prototype.isRoundable=function(){return!0};Ma.prototype.redrawPath=function(f,q,z,u,A){var F=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"arrowSize",this.arrowSize))));z=(A-F)/2;F=z+F;var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,z),new mxPoint(u-q,z),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(u-q,F),new mxPoint(0,F)],this.isRounded,H,!0);f.end()};mxCellRenderer.registerShape("singleArrow",Ma);mxUtils.extend(Na,mxActor);Na.prototype.isRoundable=function(){return!0};Na.prototype.redrawPath=function(f,q,z,u,A){var F=A*Math.max(0,Math.min(1,+parseFloat(mxUtils.getValue(this.style,"arrowWidth",Ma.prototype.arrowWidth))));q=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Ma.prototype.arrowSize))));z=(A-F)/2;F=z+F;var H=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,A/2),new mxPoint(q,0),new mxPoint(q,z),new mxPoint(u-q,z),new mxPoint(u-q,0),new mxPoint(u,A/2),new mxPoint(u-q,A),new mxPoint(u-q,F),new mxPoint(q,F),new mxPoint(q,A)],this.isRounded,+H,!0);f.end()};mxCellRenderer.registerShape("doubleArrow",Na);mxUtils.extend(xa,mxActor);xa.prototype.size=.1;xa.prototype.fixedSize=20;xa.prototype.redrawPath=function(f,q,z,u,A){q="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(q,0);f.lineTo(u,0);f.quadTo(u-2*q,A/2,u,A);f.lineTo(q,A);f.quadTo(q-2*q,A/2,q,0);f.close();+f.end()};mxCellRenderer.registerShape("dataStorage",xa);mxUtils.extend(Za,mxActor);Za.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.close();f.end()};mxCellRenderer.registerShape("or",Za);mxUtils.extend(Oa,mxActor);Oa.prototype.redrawPath=function(f,q,z,u,A){f.moveTo(0,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,0,A);f.quadTo(u/2,A/2,0,0);f.close();f.end()};mxCellRenderer.registerShape("xor",Oa);mxUtils.extend(ra,mxActor);ra.prototype.size=20;ra.prototype.isRoundable=+function(){return!0};ra.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(u/2,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(q,0),new mxPoint(u-q,0),new mxPoint(u,.8*q),new mxPoint(u,A),new mxPoint(0,A),new mxPoint(0,.8*q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("loopLimit",ra);mxUtils.extend(Da,mxActor);Da.prototype.size=.375;Da.prototype.isRoundable=+function(){return!0};Da.prototype.redrawPath=function(f,q,z,u,A){q=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A-q),new mxPoint(u/2,A),new mxPoint(0,A-q)],this.isRounded,z,!0);f.end()};mxCellRenderer.registerShape("offPageConnector",Da);mxUtils.extend(Ra,mxEllipse);Ra.prototype.paintVertexShape=function(f,q,z,+u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(q+u/2,z+A);f.lineTo(q+u,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("tapeData",Ra);mxUtils.extend(x,mxEllipse);x.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(q,z+A/2);f.lineTo(q+u,z+A/2);f.end();f.stroke();f.begin();f.moveTo(q+u/2,z);f.lineTo(q+u/2,z+A);f.end();f.stroke()};mxCellRenderer.registerShape("orEllipse",+x);mxUtils.extend(N,mxEllipse);N.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(q+.145*u,z+.145*A);f.lineTo(q+.855*u,z+.855*A);f.end();f.stroke();f.begin();f.moveTo(q+.855*u,z+.145*A);f.lineTo(q+.145*u,z+.855*A);f.end();f.stroke()};mxCellRenderer.registerShape("sumEllipse",N);mxUtils.extend(S,mxRhombus);S.prototype.paintVertexShape=function(f,q,z,u,A){mxRhombus.prototype.paintVertexShape.apply(this,arguments);+f.setShadow(!1);f.begin();f.moveTo(q,z+A/2);f.lineTo(q+u,z+A/2);f.end();f.stroke()};mxCellRenderer.registerShape("sortShape",S);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(f,q,z,u,A){f.begin();f.moveTo(q,z);f.lineTo(q+u,z);f.lineTo(q+u/2,z+A/2);f.close();f.fillAndStroke();f.begin();f.moveTo(q,z+A);f.lineTo(q+u,z+A);f.lineTo(q+u/2,z+A/2);f.close();f.fillAndStroke()};mxCellRenderer.registerShape("collate",Y);mxUtils.extend(ca,mxEllipse);ca.prototype.paintVertexShape=function(f,+q,z,u,A){var F=f.state.strokeWidth/2,H=10+2*F,ha=z+A-H/2;f.begin();f.moveTo(q,z);f.lineTo(q,z+A);f.moveTo(q+F,ha);f.lineTo(q+F+H,ha-H/2);f.moveTo(q+F,ha);f.lineTo(q+F+H,ha+H/2);f.moveTo(q+F,ha);f.lineTo(q+u-F,ha);f.moveTo(q+u,z);f.lineTo(q+u,z+A);f.moveTo(q+u-F,ha);f.lineTo(q+u-H-F,ha-H/2);f.moveTo(q+u-F,ha);f.lineTo(q+u-H-F,ha+H/2);f.end();f.stroke()};mxCellRenderer.registerShape("dimension",ca);mxUtils.extend(ma,mxEllipse);ma.prototype.drawHidden=!0;ma.prototype.paintVertexShape=function(f,q,z,+u,A){this.outline||f.setStrokeColor(null);if(null!=this.style){var F=f.pointerEvents,H=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||H||(f.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),O="1"==mxUtils.getValue(this.style,"left","1"),va="1"==mxUtils.getValue(this.style,"right","1"),oa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||H||this.outline||ha||va||oa||O?(f.rect(q,z,u,A),f.fill(),f.pointerEvents=+F,f.setStrokeColor(this.stroke),f.setLineCap("square"),f.begin(),f.moveTo(q,z),this.outline||ha?f.lineTo(q+u,z):f.moveTo(q+u,z),this.outline||va?f.lineTo(q+u,z+A):f.moveTo(q+u,z+A),this.outline||oa?f.lineTo(q,z+A):f.moveTo(q,z+A),(this.outline||O)&&f.lineTo(q,z),f.end(),f.stroke(),f.setLineCap("flat")):f.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",ma);mxUtils.extend(qa,mxEllipse);qa.prototype.paintVertexShape=function(f,q,z,u,A){mxEllipse.prototype.paintVertexShape.apply(this,+arguments);f.setShadow(!1);f.begin();"vertical"==mxUtils.getValue(this.style,"line")?(f.moveTo(q+u/2,z),f.lineTo(q+u/2,z+A)):(f.moveTo(q,z+A/2),f.lineTo(q+u,z+A/2));f.end();f.stroke()};mxCellRenderer.registerShape("lineEllipse",qa);mxUtils.extend(wa,mxActor);wa.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(u,A/2);f.moveTo(0,0);f.lineTo(u-q,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u-q,A);f.lineTo(0,A);f.close();f.end()};mxCellRenderer.registerShape("delay",wa);mxUtils.extend(sa,mxActor);sa.prototype.size=+.2;sa.prototype.redrawPath=function(f,q,z,u,A){q=Math.min(A,u);var F=Math.max(0,Math.min(q,q*parseFloat(mxUtils.getValue(this.style,"size",this.size))));q=(A-F)/2;z=q+F;var H=(u-F)/2;F=H+F;f.moveTo(0,q);f.lineTo(H,q);f.lineTo(H,0);f.lineTo(F,0);f.lineTo(F,q);f.lineTo(u,q);f.lineTo(u,z);f.lineTo(F,z);f.lineTo(F,A);f.lineTo(H,A);f.lineTo(H,z);f.lineTo(0,z);f.close();f.end()};mxCellRenderer.registerShape("cross",sa);mxUtils.extend(ya,mxActor);ya.prototype.size=.25;ya.prototype.redrawPath=function(f,+q,z,u,A){q=Math.min(u,A/2);z=Math.min(u-q,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);f.moveTo(0,A/2);f.lineTo(z,0);f.lineTo(u-q,0);f.quadTo(u,0,u,A/2);f.quadTo(u,A,u-q,A);f.lineTo(z,A);f.close();f.end()};mxCellRenderer.registerShape("display",ya);mxUtils.extend(Ga,mxActor);Ga.prototype.cst={RECT2:"mxgraph.basic.rect"};Ga.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",type:"bool",defVal:!0},{name:"indent",dispName:"Indent",type:"float",defVal:2},{name:"rectOutline",dispName:"Outline",type:"enum",defVal:"single",enumList:[{val:"single",dispName:"Single"},{val:"double",dispName:"Double"},{val:"frame",dispName:"Frame"}]},{name:"fillColor2",dispName:"Inside Fill Color",type:"color",defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"color",defVal:"none"},{name:"gradientDirection2",dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"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"}]}];Fa.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);this.strictDrawShape(f,0,0,u,A)};Fa.prototype.strictDrawShape=function(f,q,z,u,A,F){var H=F&&F.rectStyle?F.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ha=F&&F.absoluteCornerSize?F.absoluteCornerSize:mxUtils.getValue(this.style,-"absoluteCornerSize",this.absoluteCornerSize),O=F&&F.size?F.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),va=F&&F.rectOutline?F.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),pa=F&&F.indent?F.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Wa=F&&F.dashed?F.dashed:mxUtils.getValue(this.style,"dashed",!1),kb=F&&F.dashPattern?F.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),fb=-F&&F.relIndent?F.relIndent:Math.max(0,Math.min(50,pa)),Ea=F&&F.top?F.top:mxUtils.getValue(this.style,"top",!0),La=F&&F.right?F.right:mxUtils.getValue(this.style,"right",!0),Ka=F&&F.bottom?F.bottom:mxUtils.getValue(this.style,"bottom",!0),Ia=F&&F.left?F.left:mxUtils.getValue(this.style,"left",!0),Va=F&&F.topLeftStyle?F.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),Za=F&&F.topRightStyle?F.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),$a=F&&F.bottomRightStyle?-F.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),ab=F&&F.bottomLeftStyle?F.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Ib=F&&F.fillColor?F.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");F&&F.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Jb=F&&F.strokeWidth?F.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Gb=F&&F.fillColor2?F.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Hb=F&&F.gradientColor2?-F.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),Kb=F&&F.gradientDirection2?F.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Lb=F&&F.opacity?F.opacity:mxUtils.getValue(this.style,"opacity","100"),Mb=Math.max(0,Math.min(50,O));F=Fa.prototype;f.setDashed(Wa);kb&&""!=kb&&f.setDashPattern(kb);f.setStrokeWidth(Jb);O=Math.min(.5*A,.5*u,O);ha||(O=Mb*Math.min(u,A)/100);O=Math.min(O,.5*Math.min(u,A));ha||(pa=Math.min(fb*Math.min(u,A)/100));pa=Math.min(pa,-.5*Math.min(u,A)-O);(Ea||La||Ka||Ia)&&"frame"!=va&&(f.begin(),Ea?F.moveNW(f,q,z,u,A,H,Va,O,Ia):f.moveTo(0,0),Ea&&F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),La&&F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),Ka&&F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),Ia&&F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),f.close(),f.fill(),f.setShadow(!1),f.setFillColor(Gb),Wa=ha=Lb,"none"==Gb&&(ha=0),"none"==Hb&&(Wa=0),f.setGradient(Gb,-Hb,0,0,u,A,Kb,ha,Wa),f.begin(),Ea?F.moveNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia):f.moveTo(pa,0),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),Ia&&Ka&&F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),Ka&&La&&F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),La&&Ea&&F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),Ea&&Ia&&F.paintNWInner(f,q,z,u,A,H,Va,O,pa),f.fill(),"none"==Ib&&(f.begin(),F.paintFolds(f,q,z,u,A,-H,Va,Za,$a,ab,O,Ea,La,Ka,Ia),f.stroke()));Ea||La||Ka||!Ia?Ea||La||!Ka||Ia?!Ea&&!La&&Ka&&Ia?"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,-u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.lineNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),f.close(),f.fillAndStroke()):Ea||!La||Ka||Ia?!Ea&&La&&!Ka&&Ia?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,Va,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia)),f.stroke(),-f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,Va,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.lineNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke(),f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.lineSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,-q,z,u,A,H,Za,O,pa,Ea,La),f.close(),f.fillAndStroke()):!Ea&&La&&Ka&&!Ia?"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,-q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.lineSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),f.close(),f.fillAndStroke()):!Ea&&La&&Ka&&Ia?"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),"double"==va&&(F.moveNWInner(f,-q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.lineNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,-q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),f.close(),f.fillAndStroke()):!Ea||La||Ka||Ia?Ea&&!La&&!Ka&&Ia?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,-q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.lineNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke()):Ea&&!La&&Ka&&!Ia?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,-La),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea)),f.stroke(),f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.lineNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),f.close(),f.fillAndStroke(),f.begin(),F.moveSE(f,-q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.lineSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),f.close(),f.fillAndStroke()):Ea&&!La&&Ka&&Ia?"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,-q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.lineNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,-z,u,A,H,ab,O,pa,Ka,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),f.close(),f.fillAndStroke()):Ea&&La&&!Ka&&!Ia?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea)),f.stroke()):(f.begin(),-F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.lineSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),f.close(),f.fillAndStroke()):Ea&&La&&!Ka&&Ia?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,-A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,-z,u,A,H,$a,O,Ka),F.lineSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke()):Ea&&La&&Ka&&!Ia?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,-q,z,u,A,H,ab,O,Ia),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.lineSWInner(f,-q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),f.close(),f.fillAndStroke()):Ea&&La&&Ka&&Ia&&("frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,-q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),f.close(),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close()),f.stroke()):(f.begin(),-F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.paintNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.paintSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.paintSW(f,q,z,u,A,H,ab,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),f.close(),F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintSWInner(f,q,z,u,A,H,ab,O,pa,Ka),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),F.paintSEInner(f,q,z,u,A,H,$a,O,pa),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),-F.paintNEInner(f,q,z,u,A,H,Za,O,pa),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea),F.paintNWInner(f,q,z,u,A,H,Va,O,pa),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke())):"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,q,z,u,A,H,Va,O,pa,Ia,Ea)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Va,O,Ia),F.paintTop(f,q,z,u,A,H,Za,O,La),F.lineNEInner(f,q,z,u,A,H,Za,O,pa,La),F.paintTopInner(f,-q,z,u,A,H,Va,O,pa,Ia,Ea),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,Za,O,Ea),F.paintRight(f,q,z,u,A,H,$a,O,Ka),F.lineSEInner(f,q,z,u,A,H,$a,O,pa,Ka),F.paintRightInner(f,q,z,u,A,H,Za,O,pa,Ea,La),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,-q,z,u,A,H,ab,O,Ia),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,$a,O,La),F.paintBottom(f,q,z,u,A,H,ab,O,Ia),F.lineSWInner(f,q,z,u,A,H,ab,O,pa,Ia),F.paintBottomInner(f,q,z,u,A,H,$a,O,pa,La,Ka),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,Va,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,-Ia)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,Va,O,Ka),F.paintLeft(f,q,z,u,A,H,Va,O,Ea),F.lineNWInner(f,q,z,u,A,H,Va,O,pa,Ea,Ia),F.paintLeftInner(f,q,z,u,A,H,ab,O,pa,Ka,Ia),f.close(),f.fillAndStroke());f.begin();F.paintFolds(f,q,z,u,A,H,Va,Za,$a,ab,O,Ea,La,Ka,Ia);f.stroke()};Fa.prototype.moveNW=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(0,0):f.moveTo(0,ha)};Fa.prototype.moveNE=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(u,-0):f.moveTo(u-ha,0)};Fa.prototype.moveSE=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(u,A):f.moveTo(u,A-ha)};Fa.prototype.moveSW=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(0,A):f.moveTo(ha,A)};Fa.prototype.paintNW=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,ha,0)}else("snip"==-H||"default"==H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(ha,0);else f.lineTo(0,0)};Fa.prototype.paintTop=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(u,0):f.lineTo(u-ha,0)};Fa.prototype.paintNE=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,u,ha)}else("snip"==H||"default"==H&&"snip"==F||"fold"==H||"default"==-H&&"fold"==F)&&f.lineTo(u,ha);else f.lineTo(u,0)};Fa.prototype.paintRight=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(u,A):f.lineTo(u,A-ha)};Fa.prototype.paintLeft=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(0,0):f.lineTo(0,ha)};Fa.prototype.paintSE=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,-ha,0,0,q,u-ha,A)}else("snip"==H||"default"==H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-ha,A);else f.lineTo(u,A)};Fa.prototype.paintBottom=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(0,A):f.lineTo(ha,A)};Fa.prototype.paintSW=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,0,A-ha)}else("snip"==H||"default"==-H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(0,A-ha);else f.lineTo(0,A)};Fa.prototype.paintNWInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,O,.5*O+ha);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,O,O+ha);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(O,.5*O+ha);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(O+ha,O+ha),f.lineTo(O,O+ha)};Fa.prototype.paintTopInner=function(f,q,z,u,A,-F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(0,O):va&&!pa?f.lineTo(O,0):va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(ha+.5*O,O):f.lineTo(ha+O,O):f.lineTo(0,O):f.lineTo(0,0)};Fa.prototype.paintNEInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,u-ha-.5*O,O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,u-ha-O,O);else if("snip"==-H||"default"==H&&"snip"==F)f.lineTo(u-ha-.5*O,O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(u-ha-O,ha+O),f.lineTo(u-ha-O,O)};Fa.prototype.paintRightInner=function(f,q,z,u,A,F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(u-O,0):va&&!pa?f.lineTo(u,O):va?"square"==H||"default"==H&&"square"==F?f.lineTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,ha+.5*O):f.lineTo(u-O,ha+O):f.lineTo(u-O,0):f.lineTo(u,0)};Fa.prototype.paintLeftInner=function(f,q,z,-u,A,F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(O,A):va&&!pa?f.lineTo(0,A-O):va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,A-ha-.5*O):f.lineTo(O,A-ha-O):f.lineTo(O,A):f.lineTo(0,A)};Fa.prototype.paintSEInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,u-O,A-ha-.5*O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,u-O,-A-ha-O);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(u-O,A-ha-.5*O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(u-ha-O,A-ha-O),f.lineTo(u-O,A-ha-O)};Fa.prototype.paintBottomInner=function(f,q,z,u,A,F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(u,A-O):va&&!pa?f.lineTo(u-O,A):"square"==H||"default"==H&&"square"==F||!va?f.lineTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-ha-.5*O,A-O):f.lineTo(u-ha-O,A-O):f.lineTo(u,A)};Fa.prototype.paintSWInner=-function(f,q,z,u,A,F,H,ha,O,va){if(!va)f.lineTo(O,A);else if("square"==H||"default"==H&&"square"==F)f.lineTo(O,A-O);else if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,ha+.5*O,A-O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,ha+O,A-O);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(ha+.5*O,A-O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(O+ha,A-ha-O),f.lineTo(O+ha,A-O)};Fa.prototype.moveSWInner=function(f,q,z,u,A,F,H,ha,O,va){va?-"square"==H||"default"==H&&"square"==F?f.moveTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(O,A-ha-O):f.moveTo(0,A-O)};Fa.prototype.lineSWInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,A-ha-.5*O):("invRound"==H||-"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(O,A-ha-O):f.lineTo(0,A-O)};Fa.prototype.moveSEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F?f.moveTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(u-O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(u-O,A-ha-O):f.moveTo(u-O,A)};Fa.prototype.lineSEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==-H||"default"==H&&"square"==F?f.lineTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-O,A-ha-O):f.lineTo(u-O,A)};Fa.prototype.moveNEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F||va?f.moveTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(u-O,ha+.5*O):("invRound"==H||-"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(u-O,ha+O):f.moveTo(u,O)};Fa.prototype.lineNEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F||va?f.lineTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-O,ha+O):f.lineTo(u,O)};Fa.prototype.moveNWInner=function(f,q,z,u,A,F,H,ha,O,va,pa){va||pa?-!va&&pa?f.moveTo(O,0):va&&!pa?f.moveTo(0,O):"square"==H||"default"==H&&"square"==F?f.moveTo(O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(O,ha+O):f.moveTo(0,0)};Fa.prototype.lineNWInner=function(f,q,z,u,A,F,H,ha,O,va,pa){va||pa?!va&&pa?f.lineTo(O,0):va&&!pa?f.lineTo(0,O):"square"==H||"default"==H&&"square"==F?f.lineTo(O,O):"rounded"==H||"default"==H&&"rounded"==-F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(O,ha+O):f.lineTo(0,0)};Fa.prototype.paintFolds=function(f,q,z,u,A,F,H,ha,O,va,pa,Wa,kb,fb,Ea){if("fold"==F||"fold"==H||"fold"==ha||"fold"==O||"fold"==va)("fold"==H||"default"==H&&"fold"==F)&&Wa&&Ea&&(f.moveTo(0,pa),f.lineTo(pa,pa),f.lineTo(pa,0)),("fold"==ha||"default"==ha&&"fold"==F)&&Wa&&kb&&(f.moveTo(u-pa,0),f.lineTo(u-pa,pa),f.lineTo(u,pa)),("fold"==-O||"default"==O&&"fold"==F)&&fb&&kb&&(f.moveTo(u-pa,A),f.lineTo(u-pa,A-pa),f.lineTo(u,A-pa)),("fold"==va||"default"==va&&"fold"==F)&&fb&&Ea&&(f.moveTo(0,A-pa),f.lineTo(pa,A-pa),f.lineTo(pa,A))};mxCellRenderer.registerShape(Fa.prototype.cst.RECT2,Fa);Fa.prototype.constraints=null;mxUtils.extend(Ya,mxConnector);Ya.prototype.origPaintEdgeShape=Ya.prototype.paintEdgeShape;Ya.prototype.paintEdgeShape=function(f,q){for(var z=[],u=0;u<q.length;u++)z.push(mxUtils.clone(q[u]));u=f.state.dashed;var A=f.state.fixDash;-Ya.prototype.origPaintEdgeShape.apply(this,[f,z]);3<=f.state.strokeWidth&&(z=mxUtils.getValue(this.style,"fillColor",null),null!=z&&(f.setStrokeColor(z),f.setStrokeWidth(f.state.strokeWidth-2),f.setDashed(u,A),Ya.prototype.origPaintEdgeShape.apply(this,[f,q])))};mxCellRenderer.registerShape("filledEdge",Ya);mxUtils.extend(Ua,mxConnector);Ua.prototype.defaultWidth=4;Ua.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Ua.prototype.getFlowAnimationPath=-function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)};Ua.prototype.origPaintEdgeShape=Ua.prototype.paintEdgeShape;Ua.prototype.paintEdgeShape=function(f,q){for(var z=[],u=0;u<q.length;u++)z.push(mxUtils.clone(q[u]));u=f.state.dashed;var A=f.state.fixDash,F=this.getEdgeWidth();f.setStrokeWidth(F+2*this.strokewidth);f.setDashed(!1);Ua.prototype.origPaintEdgeShape.apply(this,[f,z]);z=mxUtils.getValue(this.style,"fillColor",null);null!=z&&(f.setStrokeWidth(F),f.setStrokeColor(z),f.setDashed(u,-A),Ua.prototype.origPaintEdgeShape.apply(this,[f,q]))};mxCellRenderer.registerShape("pipe",Ua);mxUtils.extend(cb,mxRectangleShape);cb.prototype.size=10;cb.prototype.isRoundable=function(){return!0};cb.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);q=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=q&&q!=mxConstants.NONE&&(f.setStrokeColor("none"),f.begin(),f.rect(0,0,u,A),f.fillAndStroke(),f.setStrokeColor(this.stroke));var F=Math.max(5,parseFloat(mxUtils.getValue(this.style,-"size",this.size)));q=A/2;z=this.strokewidth;z=this.isRounded?z/2:z;A-=z;F=Math.max(1,Math.round(u/F)-1);var H=u/(F+1),ha=H/2;f.begin();f.moveTo(0,q);if(this.isRounded){f.curveTo(.4*ha,q-.4*(q-z),.6*ha,z,ha,z);for(var O=0;O<F;O++){var va=ha+O*H,pa=va+H,Wa=0==O%2?A:z;f.curveTo(va+.4*H,0==O%2?z:A,pa-.4*H,Wa,pa,Wa)}A=0==F%2?z:A;f.curveTo(ha+F*H+.4*ha,A,u-.4*ha,q-(A==z?1:-1)*(q-z)*.4,u,q)}else{f.lineTo(ha,z);for(O=0;O<F;O++)pa=ha+(O+1)*H,Wa=0==O%2?A:z,f.lineTo(pa,Wa);f.lineTo(u,q)}f.stroke()};mxCellRenderer.registerShape("zigzag",-cb);"undefined"!==typeof StyleFormatPanel&&function(){var f=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var q=this.editorUi.getSelectionState(),z=f.apply(this,arguments);"umlFrame"==q.style.shape&&z.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return z}}();mxMarker.addMarker("dash",function(f,q,z,u,A,F,H,ha,O,va){var pa=A*(H+O+1),Wa=F*(H+O+1);return function(){f.begin();f.moveTo(u.x-pa/2-Wa/2,u.y-Wa/-2+pa/2);f.lineTo(u.x+Wa/2-3*pa/2,u.y-3*Wa/2-pa/2);f.stroke()}});mxMarker.addMarker("box",function(f,q,z,u,A,F,H,ha,O,va){var pa=A*(H+O+1),Wa=F*(H+O+1),kb=u.x+pa/2,fb=u.y+Wa/2;u.x-=pa;u.y-=Wa;return function(){f.begin();f.moveTo(kb-pa/2-Wa/2,fb-Wa/2+pa/2);f.lineTo(kb-pa/2+Wa/2,fb-Wa/2-pa/2);f.lineTo(kb+Wa/2-3*pa/2,fb-3*Wa/2-pa/2);f.lineTo(kb-Wa/2-3*pa/2,fb-3*Wa/2+pa/2);f.close();va?f.fillAndStroke():f.stroke()}});mxMarker.addMarker("cross",function(f,q,z,u,A,F,H,ha,O,va){var pa=A*(H+O+1),Wa=F*(H+O+-1);return function(){f.begin();f.moveTo(u.x-pa/2-Wa/2,u.y-Wa/2+pa/2);f.lineTo(u.x+Wa/2-3*pa/2,u.y-3*Wa/2-pa/2);f.moveTo(u.x-pa/2+Wa/2,u.y-Wa/2-pa/2);f.lineTo(u.x-Wa/2-3*pa/2,u.y-3*Wa/2+pa/2);f.stroke()}});mxMarker.addMarker("circle",hb);mxMarker.addMarker("circlePlus",function(f,q,z,u,A,F,H,ha,O,va){var pa=u.clone(),Wa=hb.apply(this,arguments),kb=A*(H+2*O),fb=F*(H+2*O);return function(){Wa.apply(this,arguments);f.begin();f.moveTo(pa.x-A*O,pa.y-F*O);f.lineTo(pa.x-2*kb+A*O,pa.y-2*fb+F*O);f.moveTo(pa.x--kb-fb+F*O,pa.y-fb+kb-A*O);f.lineTo(pa.x+fb-kb-F*O,pa.y-fb-kb+A*O);f.stroke()}});mxMarker.addMarker("halfCircle",function(f,q,z,u,A,F,H,ha,O,va){var pa=A*(H+O+1),Wa=F*(H+O+1),kb=u.clone();u.x-=pa;u.y-=Wa;return function(){f.begin();f.moveTo(kb.x-Wa,kb.y+pa);f.quadTo(u.x-Wa,u.y+pa,u.x,u.y);f.quadTo(u.x+Wa,u.y-pa,kb.x+Wa,kb.y-pa);f.stroke()}});mxMarker.addMarker("async",function(f,q,z,u,A,F,H,ha,O,va){q=A*O*1.118;z=F*O*1.118;A*=H+O;F*=H+O;var pa=u.clone();pa.x-=q;pa.y-=z;u.x+=-A-q;u.y+=-F-z;return function(){f.begin();-f.moveTo(pa.x,pa.y);ha?f.lineTo(pa.x-A-F/2,pa.y-F+A/2):f.lineTo(pa.x+F/2-A,pa.y-F-A/2);f.lineTo(pa.x-A,pa.y-F);f.close();va?f.fillAndStroke():f.stroke()}});mxMarker.addMarker("openAsync",function(f){f=null!=f?f:2;return function(q,z,u,A,F,H,ha,O,va,pa){F*=ha+va;H*=ha+va;var Wa=A.clone();return function(){q.begin();q.moveTo(Wa.x,Wa.y);O?q.lineTo(Wa.x-F-H/f,Wa.y-H+F/f):q.lineTo(Wa.x+H/f-F,Wa.y-H-F/f);q.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var ob=function(f,q,z){return pb(f,["width"],-q,function(u,A,F,H,ha){ha=f.shape.getEdgeWidth()*f.view.scale+z;return new mxPoint(H.x+A*u/4+F*ha/2,H.y+F*u/4-A*ha/2)},function(u,A,F,H,ha,O){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));f.style.width=Math.round(2*u)/f.view.scale-z})},pb=function(f,q,z,u,A){return mb(f,q,function(F){var H=f.absolutePoints;if(null!=H&&0<H.length){var ha=H.length-1;F=f.view.translate;var O=f.view.scale,va=z?H[0]:H[ha];H=z?H[1]:H[ha-1];ha=H.x-va.x;var pa=H.y-va.y,Wa=Math.sqrt(ha*ha+pa*pa);va=u.call(this,-Wa,ha/Wa,pa/Wa,va,H);return new mxPoint(va.x/O-F.x,va.y/O-F.y)}return null},function(F,H,ha){var O=f.absolutePoints,va=O.length-1;F=f.view.translate;var pa=f.view.scale,Wa=z?O[0]:O[va];O=z?O[1]:O[va-1];va=O.x-Wa.x;var kb=O.y-Wa.y,fb=Math.sqrt(va*va+kb*kb);H.x=(H.x+F.x)*pa;H.y=(H.y+F.y)*pa;A.call(this,fb,va/fb,kb/fb,Wa,O,H,ha)})},sb=function(f,q){return function(z){return[pb(z,["startWidth"],!0,function(u,A,F,H,ha){ha=mxUtils.getNumber(z.style,"startWidth",f)*z.view.scale+q;return new mxPoint(H.x+-A*u/4+F*ha/2,H.y+F*u/4-A*ha/2)},function(u,A,F,H,ha,O){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));z.style.startWidth=Math.round(2*u)/z.view.scale-q})]}},rb=function(f){return function(q){return[mb(q,["arrowWidth","arrowSize"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Na.prototype.arrowWidth))),A=Math.max(0,Math.min(f,mxUtils.getValue(this.state.style,"arrowSize",Na.prototype.arrowSize)));return new mxPoint(z.x+(1-A)*z.width,z.y+(1-u)*z.height/+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"}]}];Ga.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);this.strictDrawShape(f,0,0,u,A)};Ga.prototype.strictDrawShape=function(f,q,z,u,A,F){var H=F&&F.rectStyle?F.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ha=F&&F.absoluteCornerSize?F.absoluteCornerSize:mxUtils.getValue(this.style,+"absoluteCornerSize",this.absoluteCornerSize),O=F&&F.size?F.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),va=F&&F.rectOutline?F.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),oa=F&&F.indent?F.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Xa=F&&F.dashed?F.dashed:mxUtils.getValue(this.style,"dashed",!1),kb=F&&F.dashPattern?F.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),gb=+F&&F.relIndent?F.relIndent:Math.max(0,Math.min(50,oa)),Ea=F&&F.top?F.top:mxUtils.getValue(this.style,"top",!0),Ka=F&&F.right?F.right:mxUtils.getValue(this.style,"right",!0),Ja=F&&F.bottom?F.bottom:mxUtils.getValue(this.style,"bottom",!0),Ha=F&&F.left?F.left:mxUtils.getValue(this.style,"left",!0),Wa=F&&F.topLeftStyle?F.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),$a=F&&F.topRightStyle?F.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),ab=F&&F.bottomRightStyle?+F.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),bb=F&&F.bottomLeftStyle?F.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Ib=F&&F.fillColor?F.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");F&&F.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Jb=F&&F.strokeWidth?F.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Gb=F&&F.fillColor2?F.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Hb=F&&F.gradientColor2?+F.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),Kb=F&&F.gradientDirection2?F.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Lb=F&&F.opacity?F.opacity:mxUtils.getValue(this.style,"opacity","100"),Mb=Math.max(0,Math.min(50,O));F=Ga.prototype;f.setDashed(Xa);kb&&""!=kb&&f.setDashPattern(kb);f.setStrokeWidth(Jb);O=Math.min(.5*A,.5*u,O);ha||(O=Mb*Math.min(u,A)/100);O=Math.min(O,.5*Math.min(u,A));ha||(oa=Math.min(gb*Math.min(u,A)/100));oa=Math.min(oa,+.5*Math.min(u,A)-O);(Ea||Ka||Ja||Ha)&&"frame"!=va&&(f.begin(),Ea?F.moveNW(f,q,z,u,A,H,Wa,O,Ha):f.moveTo(0,0),Ea&&F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),Ka&&F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),Ja&&F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),Ha&&F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),f.close(),f.fill(),f.setShadow(!1),f.setFillColor(Gb),Xa=ha=Lb,"none"==Gb&&(ha=0),"none"==Hb&&(Xa=0),f.setGradient(Gb,+Hb,0,0,u,A,Kb,ha,Xa),f.begin(),Ea?F.moveNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha):f.moveTo(oa,0),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),Ha&&Ja&&F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),Ja&&Ka&&F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),Ka&&Ea&&F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),Ea&&Ha&&F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),f.fill(),"none"==Ib&&(f.begin(),F.paintFolds(f,q,z,u,A,+H,Wa,$a,ab,bb,O,Ea,Ka,Ja,Ha),f.stroke()));Ea||Ka||Ja||!Ha?Ea||Ka||!Ja||Ha?!Ea&&!Ka&&Ja&&Ha?"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,+u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.lineNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),f.close(),f.fillAndStroke()):Ea||!Ka||Ja||Ha?!Ea&&Ka&&!Ja&&Ha?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,Wa,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha)),f.stroke(),+f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,Wa,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.lineNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke(),f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.lineSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,+q,z,u,A,H,$a,O,oa,Ea,Ka),f.close(),f.fillAndStroke()):!Ea&&Ka&&Ja&&!Ha?"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,+q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.lineSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),f.close(),f.fillAndStroke()):!Ea&&Ka&&Ja&&Ha?"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),"double"==va&&(F.moveNWInner(f,+q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.lineNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,+q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),f.close(),f.fillAndStroke()):!Ea||Ka||Ja||Ha?Ea&&!Ka&&!Ja&&Ha?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,+q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.lineNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke()):Ea&&!Ka&&Ja&&!Ha?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,+Ka),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea)),f.stroke(),f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.lineNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),f.close(),f.fillAndStroke(),f.begin(),F.moveSE(f,+q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.lineSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),f.close(),f.fillAndStroke()):Ea&&!Ka&&Ja&&Ha?"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,+q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.lineNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,+z,u,A,H,bb,O,oa,Ja,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),f.close(),f.fillAndStroke()):Ea&&Ka&&!Ja&&!Ha?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea)),f.stroke()):(f.begin(),+F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.lineSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),f.close(),f.fillAndStroke()):Ea&&Ka&&!Ja&&Ha?"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,+A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,+z,u,A,H,ab,O,Ja),F.lineSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke()):Ea&&Ka&&Ja&&!Ha?"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,+q,z,u,A,H,bb,O,Ha),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.lineSWInner(f,+q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),f.close(),f.fillAndStroke()):Ea&&Ka&&Ja&&Ha&&("frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,+q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),f.close(),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close()),f.stroke()):(f.begin(),+F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.paintNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.paintSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.paintSW(f,q,z,u,A,H,bb,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),f.close(),F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintSWInner(f,q,z,u,A,H,bb,O,oa,Ja),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),F.paintSEInner(f,q,z,u,A,H,ab,O,oa),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),+F.paintNEInner(f,q,z,u,A,H,$a,O,oa),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea),F.paintNWInner(f,q,z,u,A,H,Wa,O,oa),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke())):"frame"!=va?(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),"double"==va&&(F.moveNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,q,z,u,A,H,Wa,O,oa,Ha,Ea)),f.stroke()):(f.begin(),F.moveNW(f,q,z,u,A,H,Wa,O,Ha),F.paintTop(f,q,z,u,A,H,$a,O,Ka),F.lineNEInner(f,q,z,u,A,H,$a,O,oa,Ka),F.paintTopInner(f,+q,z,u,A,H,Wa,O,oa,Ha,Ea),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),"double"==va&&(F.moveSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka)),f.stroke()):(f.begin(),F.moveNE(f,q,z,u,A,H,$a,O,Ea),F.paintRight(f,q,z,u,A,H,ab,O,Ja),F.lineSEInner(f,q,z,u,A,H,ab,O,oa,Ja),F.paintRightInner(f,q,z,u,A,H,$a,O,oa,Ea,Ka),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,+q,z,u,A,H,bb,O,Ha),"double"==va&&(F.moveSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja)),f.stroke()):(f.begin(),F.moveSE(f,q,z,u,A,H,ab,O,Ka),F.paintBottom(f,q,z,u,A,H,bb,O,Ha),F.lineSWInner(f,q,z,u,A,H,bb,O,oa,Ha),F.paintBottomInner(f,q,z,u,A,H,ab,O,oa,Ka,Ja),f.close(),f.fillAndStroke()):"frame"!=va?(f.begin(),F.moveSW(f,q,z,u,A,H,Wa,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),"double"==va&&(F.moveNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,+Ha)),f.stroke()):(f.begin(),F.moveSW(f,q,z,u,A,H,Wa,O,Ja),F.paintLeft(f,q,z,u,A,H,Wa,O,Ea),F.lineNWInner(f,q,z,u,A,H,Wa,O,oa,Ea,Ha),F.paintLeftInner(f,q,z,u,A,H,bb,O,oa,Ja,Ha),f.close(),f.fillAndStroke());f.begin();F.paintFolds(f,q,z,u,A,H,Wa,$a,ab,bb,O,Ea,Ka,Ja,Ha);f.stroke()};Ga.prototype.moveNW=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(0,0):f.moveTo(0,ha)};Ga.prototype.moveNE=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(u,+0):f.moveTo(u-ha,0)};Ga.prototype.moveSE=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(u,A):f.moveTo(u,A-ha)};Ga.prototype.moveSW=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.moveTo(0,A):f.moveTo(ha,A)};Ga.prototype.paintNW=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,ha,0)}else("snip"==+H||"default"==H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(ha,0);else f.lineTo(0,0)};Ga.prototype.paintTop=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(u,0):f.lineTo(u-ha,0)};Ga.prototype.paintNE=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,u,ha)}else("snip"==H||"default"==H&&"snip"==F||"fold"==H||"default"==+H&&"fold"==F)&&f.lineTo(u,ha);else f.lineTo(u,0)};Ga.prototype.paintRight=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(u,A):f.lineTo(u,A-ha)};Ga.prototype.paintLeft=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(0,0):f.lineTo(0,ha)};Ga.prototype.paintSE=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,+ha,0,0,q,u-ha,A)}else("snip"==H||"default"==H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-ha,A);else f.lineTo(u,A)};Ga.prototype.paintBottom=function(f,q,z,u,A,F,H,ha,O){"square"==H||"default"==H&&"square"==F||!O?f.lineTo(0,A):f.lineTo(ha,A)};Ga.prototype.paintSW=function(f,q,z,u,A,F,H,ha,O){if(O)if("rounded"==H||"default"==H&&"rounded"==F||"invRound"==H||"default"==H&&"invRound"==F){q=0;if("rounded"==H||"default"==H&&"rounded"==F)q=1;f.arcTo(ha,ha,0,0,q,0,A-ha)}else("snip"==H||"default"==+H&&"snip"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(0,A-ha);else f.lineTo(0,A)};Ga.prototype.paintNWInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,O,.5*O+ha);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,O,O+ha);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(O,.5*O+ha);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(O+ha,O+ha),f.lineTo(O,O+ha)};Ga.prototype.paintTopInner=function(f,q,z,u,A,+F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(0,O):va&&!oa?f.lineTo(O,0):va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(ha+.5*O,O):f.lineTo(ha+O,O):f.lineTo(0,O):f.lineTo(0,0)};Ga.prototype.paintNEInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,u-ha-.5*O,O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,u-ha-O,O);else if("snip"==+H||"default"==H&&"snip"==F)f.lineTo(u-ha-.5*O,O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(u-ha-O,ha+O),f.lineTo(u-ha-O,O)};Ga.prototype.paintRightInner=function(f,q,z,u,A,F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(u-O,0):va&&!oa?f.lineTo(u,O):va?"square"==H||"default"==H&&"square"==F?f.lineTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,ha+.5*O):f.lineTo(u-O,ha+O):f.lineTo(u-O,0):f.lineTo(u,0)};Ga.prototype.paintLeftInner=function(f,q,z,+u,A,F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(O,A):va&&!oa?f.lineTo(0,A-O):va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,A-ha-.5*O):f.lineTo(O,A-ha-O):f.lineTo(O,A):f.lineTo(0,A)};Ga.prototype.paintSEInner=function(f,q,z,u,A,F,H,ha,O){if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,u-O,A-ha-.5*O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,u-O,+A-ha-O);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(u-O,A-ha-.5*O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(u-ha-O,A-ha-O),f.lineTo(u-O,A-ha-O)};Ga.prototype.paintBottomInner=function(f,q,z,u,A,F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(u,A-O):va&&!oa?f.lineTo(u-O,A):"square"==H||"default"==H&&"square"==F||!va?f.lineTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-ha-.5*O,A-O):f.lineTo(u-ha-O,A-O):f.lineTo(u,A)};Ga.prototype.paintSWInner=+function(f,q,z,u,A,F,H,ha,O,va){if(!va)f.lineTo(O,A);else if("square"==H||"default"==H&&"square"==F)f.lineTo(O,A-O);else if("rounded"==H||"default"==H&&"rounded"==F)f.arcTo(ha-.5*O,ha-.5*O,0,0,0,ha+.5*O,A-O);else if("invRound"==H||"default"==H&&"invRound"==F)f.arcTo(ha+O,ha+O,0,0,1,ha+O,A-O);else if("snip"==H||"default"==H&&"snip"==F)f.lineTo(ha+.5*O,A-O);else if("fold"==H||"default"==H&&"fold"==F)f.lineTo(O+ha,A-ha-O),f.lineTo(O+ha,A-O)};Ga.prototype.moveSWInner=function(f,q,z,u,A,F,H,ha,O,va){va?+"square"==H||"default"==H&&"square"==F?f.moveTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(O,A-ha-O):f.moveTo(0,A-O)};Ga.prototype.lineSWInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F?f.lineTo(O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,A-ha-.5*O):("invRound"==H||+"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(O,A-ha-O):f.lineTo(0,A-O)};Ga.prototype.moveSEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F?f.moveTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(u-O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(u-O,A-ha-O):f.moveTo(u-O,A)};Ga.prototype.lineSEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==+H||"default"==H&&"square"==F?f.lineTo(u-O,A-O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,A-ha-.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-O,A-ha-O):f.lineTo(u-O,A)};Ga.prototype.moveNEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F||va?f.moveTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(u-O,ha+.5*O):("invRound"==H||+"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(u-O,ha+O):f.moveTo(u,O)};Ga.prototype.lineNEInner=function(f,q,z,u,A,F,H,ha,O,va){va?"square"==H||"default"==H&&"square"==F||va?f.lineTo(u-O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(u-O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(u-O,ha+O):f.lineTo(u,O)};Ga.prototype.moveNWInner=function(f,q,z,u,A,F,H,ha,O,va,oa){va||oa?+!va&&oa?f.moveTo(O,0):va&&!oa?f.moveTo(0,O):"square"==H||"default"==H&&"square"==F?f.moveTo(O,O):"rounded"==H||"default"==H&&"rounded"==F||"snip"==H||"default"==H&&"snip"==F?f.moveTo(O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.moveTo(O,ha+O):f.moveTo(0,0)};Ga.prototype.lineNWInner=function(f,q,z,u,A,F,H,ha,O,va,oa){va||oa?!va&&oa?f.lineTo(O,0):va&&!oa?f.lineTo(0,O):"square"==H||"default"==H&&"square"==F?f.lineTo(O,O):"rounded"==H||"default"==H&&"rounded"==+F||"snip"==H||"default"==H&&"snip"==F?f.lineTo(O,ha+.5*O):("invRound"==H||"default"==H&&"invRound"==F||"fold"==H||"default"==H&&"fold"==F)&&f.lineTo(O,ha+O):f.lineTo(0,0)};Ga.prototype.paintFolds=function(f,q,z,u,A,F,H,ha,O,va,oa,Xa,kb,gb,Ea){if("fold"==F||"fold"==H||"fold"==ha||"fold"==O||"fold"==va)("fold"==H||"default"==H&&"fold"==F)&&Xa&&Ea&&(f.moveTo(0,oa),f.lineTo(oa,oa),f.lineTo(oa,0)),("fold"==ha||"default"==ha&&"fold"==F)&&Xa&&kb&&(f.moveTo(u-oa,0),f.lineTo(u-oa,oa),f.lineTo(u,oa)),("fold"==+O||"default"==O&&"fold"==F)&&gb&&kb&&(f.moveTo(u-oa,A),f.lineTo(u-oa,A-oa),f.lineTo(u,A-oa)),("fold"==va||"default"==va&&"fold"==F)&&gb&&Ea&&(f.moveTo(0,A-oa),f.lineTo(oa,A-oa),f.lineTo(oa,A))};mxCellRenderer.registerShape(Ga.prototype.cst.RECT2,Ga);Ga.prototype.constraints=null;mxUtils.extend(Ya,mxConnector);Ya.prototype.origPaintEdgeShape=Ya.prototype.paintEdgeShape;Ya.prototype.paintEdgeShape=function(f,q){for(var z=[],u=0;u<q.length;u++)z.push(mxUtils.clone(q[u]));u=f.state.dashed;var A=f.state.fixDash;+Ya.prototype.origPaintEdgeShape.apply(this,[f,z]);3<=f.state.strokeWidth&&(z=mxUtils.getValue(this.style,"fillColor",null),null!=z&&(f.setStrokeColor(z),f.setStrokeWidth(f.state.strokeWidth-2),f.setDashed(u,A),Ya.prototype.origPaintEdgeShape.apply(this,[f,q])))};mxCellRenderer.registerShape("filledEdge",Ya);mxUtils.extend(Va,mxConnector);Va.prototype.defaultWidth=4;Va.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Va.prototype.getFlowAnimationPath=+function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)};Va.prototype.origPaintEdgeShape=Va.prototype.paintEdgeShape;Va.prototype.paintEdgeShape=function(f,q){for(var z=[],u=0;u<q.length;u++)z.push(mxUtils.clone(q[u]));u=f.state.dashed;var A=f.state.fixDash,F=this.getEdgeWidth();f.setStrokeWidth(F+2*this.strokewidth);f.setDashed(!1);Va.prototype.origPaintEdgeShape.apply(this,[f,z]);z=mxUtils.getValue(this.style,"fillColor",null);null!=z&&(f.setStrokeWidth(F),f.setStrokeColor(z),f.setDashed(u,+A),Va.prototype.origPaintEdgeShape.apply(this,[f,q]))};mxCellRenderer.registerShape("pipe",Va);mxUtils.extend(eb,mxRectangleShape);eb.prototype.size=10;eb.prototype.isRoundable=function(){return!0};eb.prototype.paintVertexShape=function(f,q,z,u,A){f.translate(q,z);q=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=q&&q!=mxConstants.NONE&&(f.setStrokeColor("none"),f.begin(),f.rect(0,0,u,A),f.fillAndStroke(),f.setStrokeColor(this.stroke));var F=Math.max(5,parseFloat(mxUtils.getValue(this.style,+"size",this.size)));q=A/2;z=this.strokewidth;z=this.isRounded?z/2:z;A-=z;F=Math.max(1,Math.round(u/F)-1);var H=u/(F+1),ha=H/2;f.begin();f.moveTo(0,q);if(this.isRounded){f.curveTo(.4*ha,q-.4*(q-z),.6*ha,z,ha,z);for(var O=0;O<F;O++){var va=ha+O*H,oa=va+H,Xa=0==O%2?A:z;f.curveTo(va+.4*H,0==O%2?z:A,oa-.4*H,Xa,oa,Xa)}A=0==F%2?z:A;f.curveTo(ha+F*H+.4*ha,A,u-.4*ha,q-(A==z?1:-1)*(q-z)*.4,u,q)}else{f.lineTo(ha,z);for(O=0;O<F;O++)oa=ha+(O+1)*H,Xa=0==O%2?A:z,f.lineTo(oa,Xa);f.lineTo(u,q)}f.stroke()};mxCellRenderer.registerShape("zigzag",+eb);"undefined"!==typeof StyleFormatPanel&&function(){var f=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var q=this.editorUi.getSelectionState(),z=f.apply(this,arguments);"umlFrame"==q.style.shape&&z.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return z}}();mxMarker.addMarker("dash",function(f,q,z,u,A,F,H,ha,O,va){var oa=A*(H+O+1),Xa=F*(H+O+1);return function(){f.begin();f.moveTo(u.x-oa/2-Xa/2,u.y-Xa/+2+oa/2);f.lineTo(u.x+Xa/2-3*oa/2,u.y-3*Xa/2-oa/2);f.stroke()}});mxMarker.addMarker("box",function(f,q,z,u,A,F,H,ha,O,va){var oa=A*(H+O+1),Xa=F*(H+O+1),kb=u.x+oa/2,gb=u.y+Xa/2;u.x-=oa;u.y-=Xa;return function(){f.begin();f.moveTo(kb-oa/2-Xa/2,gb-Xa/2+oa/2);f.lineTo(kb-oa/2+Xa/2,gb-Xa/2-oa/2);f.lineTo(kb+Xa/2-3*oa/2,gb-3*Xa/2-oa/2);f.lineTo(kb-Xa/2-3*oa/2,gb-3*Xa/2+oa/2);f.close();va?f.fillAndStroke():f.stroke()}});mxMarker.addMarker("cross",function(f,q,z,u,A,F,H,ha,O,va){var oa=A*(H+O+1),Xa=F*(H+O++1);return function(){f.begin();f.moveTo(u.x-oa/2-Xa/2,u.y-Xa/2+oa/2);f.lineTo(u.x+Xa/2-3*oa/2,u.y-3*Xa/2-oa/2);f.moveTo(u.x-oa/2+Xa/2,u.y-Xa/2-oa/2);f.lineTo(u.x-Xa/2-3*oa/2,u.y-3*Xa/2+oa/2);f.stroke()}});mxMarker.addMarker("circle",ib);mxMarker.addMarker("circlePlus",function(f,q,z,u,A,F,H,ha,O,va){var oa=u.clone(),Xa=ib.apply(this,arguments),kb=A*(H+2*O),gb=F*(H+2*O);return function(){Xa.apply(this,arguments);f.begin();f.moveTo(oa.x-A*O,oa.y-F*O);f.lineTo(oa.x-2*kb+A*O,oa.y-2*gb+F*O);f.moveTo(oa.x-+kb-gb+F*O,oa.y-gb+kb-A*O);f.lineTo(oa.x+gb-kb-F*O,oa.y-gb-kb+A*O);f.stroke()}});mxMarker.addMarker("halfCircle",function(f,q,z,u,A,F,H,ha,O,va){var oa=A*(H+O+1),Xa=F*(H+O+1),kb=u.clone();u.x-=oa;u.y-=Xa;return function(){f.begin();f.moveTo(kb.x-Xa,kb.y+oa);f.quadTo(u.x-Xa,u.y+oa,u.x,u.y);f.quadTo(u.x+Xa,u.y-oa,kb.x+Xa,kb.y-oa);f.stroke()}});mxMarker.addMarker("async",function(f,q,z,u,A,F,H,ha,O,va){q=A*O*1.118;z=F*O*1.118;A*=H+O;F*=H+O;var oa=u.clone();oa.x-=q;oa.y-=z;u.x+=-A-q;u.y+=-F-z;return function(){f.begin();+f.moveTo(oa.x,oa.y);ha?f.lineTo(oa.x-A-F/2,oa.y-F+A/2):f.lineTo(oa.x+F/2-A,oa.y-F-A/2);f.lineTo(oa.x-A,oa.y-F);f.close();va?f.fillAndStroke():f.stroke()}});mxMarker.addMarker("openAsync",function(f){f=null!=f?f:2;return function(q,z,u,A,F,H,ha,O,va,oa){F*=ha+va;H*=ha+va;var Xa=A.clone();return function(){q.begin();q.moveTo(Xa.x,Xa.y);O?q.lineTo(Xa.x-F-H/f,Xa.y-H+F/f):q.lineTo(Xa.x+H/f-F,Xa.y-H-F/f);q.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var ob=function(f,q,z){return pb(f,["width"],+q,function(u,A,F,H,ha){ha=f.shape.getEdgeWidth()*f.view.scale+z;return new mxPoint(H.x+A*u/4+F*ha/2,H.y+F*u/4-A*ha/2)},function(u,A,F,H,ha,O){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));f.style.width=Math.round(2*u)/f.view.scale-z})},pb=function(f,q,z,u,A){return mb(f,q,function(F){var H=f.absolutePoints;if(null!=H&&0<H.length){var ha=H.length-1;F=f.view.translate;var O=f.view.scale,va=z?H[0]:H[ha];H=z?H[1]:H[ha-1];ha=H.x-va.x;var oa=H.y-va.y,Xa=Math.sqrt(ha*ha+oa*oa);va=u.call(this,+Xa,ha/Xa,oa/Xa,va,H);return new mxPoint(va.x/O-F.x,va.y/O-F.y)}return null},function(F,H,ha){var O=f.absolutePoints,va=O.length-1;F=f.view.translate;var oa=f.view.scale,Xa=z?O[0]:O[va];O=z?O[1]:O[va-1];va=O.x-Xa.x;var kb=O.y-Xa.y,gb=Math.sqrt(va*va+kb*kb);H.x=(H.x+F.x)*oa;H.y=(H.y+F.y)*oa;A.call(this,gb,va/gb,kb/gb,Xa,O,H,ha)})},sb=function(f,q){return function(z){return[pb(z,["startWidth"],!0,function(u,A,F,H,ha){ha=mxUtils.getNumber(z.style,"startWidth",f)*z.view.scale+q;return new mxPoint(H.x++A*u/4+F*ha/2,H.y+F*u/4-A*ha/2)},function(u,A,F,H,ha,O){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));z.style.startWidth=Math.round(2*u)/z.view.scale-q})]}},rb=function(f){return function(q){return[mb(q,["arrowWidth","arrowSize"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Ma.prototype.arrowWidth))),A=Math.max(0,Math.min(f,mxUtils.getValue(this.state.style,"arrowSize",Ma.prototype.arrowSize)));return new mxPoint(z.x+(1-A)*z.width,z.y+(1-u)*z.height/2)},function(z,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(z.y+z.height/2-u.y)/z.height*2));this.state.style.arrowSize=Math.max(0,Math.min(f,(z.x+z.width-u.x)/z.width))})]}},tb=function(f){return function(q){return[mb(q,["size"],function(z){var u=Math.max(0,Math.min(.5*z.height,parseFloat(mxUtils.getValue(this.state.style,"size",f))));return new mxPoint(z.x,z.y+u)},function(z,u){this.state.style.size=Math.max(0,u.y-z.y)},!0)]}},yb=function(f,q,z){return function(u){var A=[mb(u,["size"],function(F){var H=Math.max(0,Math.min(F.width,Math.min(F.height,parseFloat(mxUtils.getValue(this.state.style,"size",q)))))*f;return new mxPoint(F.x+H,F.y+H)},function(F,H){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(F.width,H.x-F.x),Math.min(F.height,H.y-F.y)))/f)},!1)];z&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&A.push(xb(u));return A}},vb=function(f,q,z,u,A){z=null!=z?z:.5;return function(F){var H=[mb(F,["size"],function(ha){var O=null!=A?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,va=parseFloat(mxUtils.getValue(this.state.style,"size",O?A:f));return new mxPoint(ha.x+Math.max(0,Math.min(.5*ha.width,va*(O?1:ha.width))),ha.getCenterY())},function(ha,O,va){ha=null!=A&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?O.x-ha.x:Math.max(0,Math.min(z,(O.x-ha.x)/ha.width));this.state.style.size=ha},!1,u)];q&&mxUtils.getValue(F.style,mxConstants.STYLE_ROUNDED,!1)&&H.push(xb(F));return H}},Fb=function(f,q,z){f=null!=f?f:.5;return function(u){var A=[mb(u,["size"],function(F){var H=null!=z?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ha=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",H?z:q)));return new mxPoint(F.x+Math.min(.75*F.width*f,ha*(H?.75:.75*F.width)),F.y+F.height/4)},function(F,H){F=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?H.x-F.x:Math.max(0,Math.min(f,(H.x-F.x)/F.width*.75));this.state.style.size=F},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&A.push(xb(u));return A}},zb=function(){return function(f){var q=[];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q}},xb=function(f,q){return mb(f,[mxConstants.STYLE_ARCSIZE],function(z){var u=null!=q?q:z.height/8;if("1"==mxUtils.getValue(f.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var A=mxUtils.getValue(f.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(z.x+z.width-Math.min(z.width/2,A),z.y+u)}A=Math.max(0,parseFloat(mxUtils.getValue(f.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(z.x+z.width-Math.min(Math.max(z.width/2,z.height/2),Math.min(z.width,z.height)*A),z.y+u)},function(z,u,A){"1"==mxUtils.getValue(f.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(z.width,2*(z.x+z.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(z.width-u.x+z.x)/Math.min(z.width,z.height))))})},mb=function(f,q,z,u,-A,F,H){var ha=new mxHandle(f,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(va){for(var pa=0;pa<q.length;pa++)this.copyStyle(q[pa]);H&&H(va)};ha.getPosition=z;ha.setPosition=u;ha.ignoreGrid=null!=A?A:!0;if(F){var O=ha.positionChanged;ha.positionChanged=function(){O.apply(this,arguments);f.view.invalidate(this.state.cell);f.view.validate()}}return ha},Bb={link:function(f){return[ob(f,!0,10),ob(f,!1,10)]},pipe:function(f){return[ob(f,!0,10),ob(f,!1,10)]},flexArrow:function(f){var q=+A,F,H){var ha=new mxHandle(f,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(va){for(var oa=0;oa<q.length;oa++)this.copyStyle(q[oa]);H&&H(va)};ha.getPosition=z;ha.setPosition=u;ha.ignoreGrid=null!=A?A:!0;if(F){var O=ha.positionChanged;ha.positionChanged=function(){O.apply(this,arguments);f.view.invalidate(this.state.cell);f.view.validate()}}return ha},Bb={link:function(f){return[ob(f,!0,10),ob(f,!1,10)]},pipe:function(f){return[ob(f,!0,10),ob(f,!1,10)]},flexArrow:function(f){var q=f.view.graph.gridSize/f.view.scale,z=[];mxUtils.getValue(f.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(z.push(pb(f,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,A,F,H,ha){u=(f.shape.getEdgeWidth()-f.shape.strokewidth)*f.view.scale;ha=3*mxUtils.getNumber(f.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*f.view.scale;return new mxPoint(H.x+A*(ha+f.shape.strokewidth*f.view.scale)+F*u/2,H.y+F*(ha+f.shape.strokewidth*f.view.scale)-A*u/2)},function(u,A,F,H,ha,O,va){u=Math.sqrt(mxUtils.ptSegDistSq(H.x,H.y,ha.x,ha.y,O.x,O.y));A=mxUtils.ptLineDist(H.x,H.y,H.x+F,H.y-A,O.x,O.y);f.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(A-f.shape.strokewidth)/3)/100/f.view.scale;f.style.width=Math.round(2*u)/f.view.scale;if(mxEvent.isShiftDown(va.getEvent())||mxEvent.isControlDown(va.getEvent()))f.style[mxConstants.STYLE_ENDSIZE]=f.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(va.getEvent())||Math.abs(parseFloat(f.style[mxConstants.STYLE_STARTSIZE])-parseFloat(f.style[mxConstants.STYLE_ENDSIZE]))<q/6&&(f.style[mxConstants.STYLE_STARTSIZE]=f.style[mxConstants.STYLE_ENDSIZE])})),z.push(pb(f,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,A,F,H,ha){u=(f.shape.getStartArrowWidth()-f.shape.strokewidth)*f.view.scale;ha=3*mxUtils.getNumber(f.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*f.view.scale;return new mxPoint(H.x+A*(ha+f.shape.strokewidth*f.view.scale)+F*u/2,H.y+F*(ha+f.shape.strokewidth*@@ -3033,32 +3037,32 @@ f.style.startWidth;mxEvent.isAltDown(va.getEvent())||(Math.abs(parseFloat(f.stylMath.abs(parseFloat(f.style.endWidth)-parseFloat(f.style.startWidth))<q&&(f.style.endWidth=f.style.startWidth))})));return z},swimlane:function(f){var q=[];if(mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED)){var z=parseFloat(mxUtils.getValue(f.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));q.push(xb(f,z/2))}q.push(mb(f,[mxConstants.STYLE_STARTSIZE],function(u){var A=parseFloat(mxUtils.getValue(f.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(f.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(u.getCenterX(),u.y+Math.max(0,Math.min(u.height,A))):new mxPoint(u.x+Math.max(0,Math.min(u.width,A)),u.getCenterY())},function(u,A){f.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(u.height,A.y-u.y))):Math.round(Math.max(0,Math.min(u.width,A.x-u.x)))},!1,null,function(u){var A=f.view.graph;if(!mxEvent.isShiftDown(u.getEvent())&&!mxEvent.isControlDown(u.getEvent())&&(A.isTableRow(f.cell)||A.isTableCell(f.cell))){u=A.getSwimlaneDirection(f.style);var F=A.model.getParent(f.cell);F=A.model.getChildCells(F,!0);for(var H=[],ha=0;ha<F.length;ha++)F[ha]!=f.cell&&A.isSwimlane(F[ha])&&A.getSwimlaneDirection(A.getCurrentCellStyle(F[ha]))==u&&H.push(F[ha]);A.setCellStyles(mxConstants.STYLE_STARTSIZE,f.style[mxConstants.STYLE_STARTSIZE],H)}}));return q},label:zb(),ext:zb(),rectangle:zb(),triangle:zb(),rhombus:zb(),umlLifeline:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(q.height,-parseFloat(mxUtils.getValue(this.state.style,"size",aa.prototype.size))));return new mxPoint(q.getCenterX(),q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},umlFrame:function(f){return[mb(f,["width","height"],function(q){var z=Math.max(ia.prototype.corner,Math.min(q.width,mxUtils.getValue(this.state.style,"width",ia.prototype.width))),u=Math.max(1.5*ia.prototype.corner,Math.min(q.height,mxUtils.getValue(this.state.style,"height",ia.prototype.height)));-return new mxPoint(q.x+z,q.y+u)},function(q,z){this.state.style.width=Math.round(Math.max(ia.prototype.corner,Math.min(q.width,z.x-q.x)));this.state.style.height=Math.round(Math.max(1.5*ia.prototype.corner,Math.min(q.height,z.y-q.y)))},!1)]},process:function(f){var q=[mb(f,["size"],function(z){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),A=parseFloat(mxUtils.getValue(this.state.style,"size",ca.prototype.size));return u?new mxPoint(z.x+A,z.y+z.height/4):new mxPoint(z.x+z.width*A,z.y++parseFloat(mxUtils.getValue(this.state.style,"size",ba.prototype.size))));return new mxPoint(q.getCenterX(),q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},umlFrame:function(f){return[mb(f,["width","height"],function(q){var z=Math.max(fa.prototype.corner,Math.min(q.width,mxUtils.getValue(this.state.style,"width",fa.prototype.width))),u=Math.max(1.5*fa.prototype.corner,Math.min(q.height,mxUtils.getValue(this.state.style,"height",fa.prototype.height)));+return new mxPoint(q.x+z,q.y+u)},function(q,z){this.state.style.width=Math.round(Math.max(fa.prototype.corner,Math.min(q.width,z.x-q.x)));this.state.style.height=Math.round(Math.max(1.5*fa.prototype.corner,Math.min(q.height,z.y-q.y)))},!1)]},process:function(f){var q=[mb(f,["size"],function(z){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),A=parseFloat(mxUtils.getValue(this.state.style,"size",da.prototype.size));return u?new mxPoint(z.x+A,z.y+z.height/4):new mxPoint(z.x+z.width*A,z.y+z.height/4)},function(z,u){z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*z.width,u.x-z.x)):Math.max(0,Math.min(.5,(u.x-z.x)/z.width));this.state.style.size=z},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},cross:function(f){return[mb(f,["size"],function(q){var z=Math.min(q.width,q.height);z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",sa.prototype.size)))*z/2;return new mxPoint(q.getCenterX()-z,q.getCenterY()-z)},function(q,z){var u=Math.min(q.width,q.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,q.getCenterY()-z.y)/u*2,Math.max(0,q.getCenterX()-z.x)/u*2)))})]},note:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(q.width,Math.min(q.height,parseFloat(mxUtils.getValue(this.state.style,"size",E.prototype.size)))));return new mxPoint(q.x+q.width-z,q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(q.width,q.x+q.width-z.x),Math.min(q.height,-z.y-q.y))))})]},note2:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(q.width,Math.min(q.height,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size)))));return new mxPoint(q.x+q.width-z,q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(q.width,q.x+q.width-z.x),Math.min(q.height,z.y-q.y))))})]},manualInput:function(f){var q=[mb(f,["size"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",-eb.prototype.size)));return new mxPoint(z.x+z.width/4,z.y+3*u/4)},function(z,u){this.state.style.size=Math.round(Math.max(0,Math.min(z.height,4*(u.y-z.y)/3)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},dataStorage:function(f){return[mb(f,["size"],function(q){var z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",z?oa.prototype.fixedSize:oa.prototype.size));return new mxPoint(q.x+q.width-u*(z?1:+z.y-q.y))))})]},note2:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(q.width,Math.min(q.height,parseFloat(mxUtils.getValue(this.state.style,"size",P.prototype.size)))));return new mxPoint(q.x+q.width-z,q.y+z)},function(q,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(q.width,q.x+q.width-z.x),Math.min(q.height,z.y-q.y))))})]},manualInput:function(f){var q=[mb(f,["size"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",+db.prototype.size)));return new mxPoint(z.x+z.width/4,z.y+3*u/4)},function(z,u){this.state.style.size=Math.round(Math.max(0,Math.min(z.height,4*(u.y-z.y)/3)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},dataStorage:function(f){return[mb(f,["size"],function(q){var z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",z?xa.prototype.fixedSize:xa.prototype.size));return new mxPoint(q.x+q.width-u*(z?1:q.width),q.getCenterY())},function(q,z){q="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(q.width,q.x+q.width-z.x)):Math.max(0,Math.min(1,(q.x+q.width-z.x)/q.width));this.state.style.size=q},!1)]},callout:function(f){var q=[mb(f,["size","position"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",la.prototype.size))),A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",la.prototype.position)));mxUtils.getValue(this.state.style,"base",la.prototype.base);return new mxPoint(z.x+A*z.width,z.y+z.height-u)},function(z,u){mxUtils.getValue(this.state.style,"base",la.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(z.height,z.y+z.height-u.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(u.x-z.x)/z.width)))/100},!1),mb(f,["position2"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",la.prototype.position2)));return new mxPoint(z.x+u*z.width,z.y+z.height)},function(z,u){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(u.x-z.x)/z.width)))/100},!1),mb(f,["base"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",la.prototype.size))),A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",la.prototype.position))),F=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"base",la.prototype.base)));return new mxPoint(z.x+Math.min(z.width,A*z.width+F),z.y+z.height-u)},function(z,u){var A=-Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",la.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(z.width,u.x-z.x-A*z.width)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},internalStorage:function(f){var q=[mb(f,["dx","dy"],function(z){var u=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"dx",Ma.prototype.dx))),A=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"dy",Ma.prototype.dy)));-return new mxPoint(z.x+u,z.y+A)},function(z,u){this.state.style.dx=Math.round(Math.max(0,Math.min(z.width,u.x-z.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(z.height,u.y-z.y)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},module:function(f){return[mb(f,["jettyWidth","jettyHeight"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"jettyWidth",Ba.prototype.jettyWidth))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,-"jettyHeight",Ba.prototype.jettyHeight)));return new mxPoint(q.x+z/2,q.y+2*u)},function(q,z){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(q.width,z.x-q.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(q.height,z.y-q.y))/2)})]},corner:function(f){return[mb(f,["dx","dy"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"dx",ya.prototype.dx))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"dy",ya.prototype.dy)));return new mxPoint(q.x+-z,q.y+u)},function(q,z){this.state.style.dx=Math.round(Math.max(0,Math.min(q.width,z.x-q.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},tee:function(f){return[mb(f,["dx","dy"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"dx",Oa.prototype.dx))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"dy",Oa.prototype.dy)));return new mxPoint(q.x+(q.width+z)/2,q.y+u)},function(q,z){this.state.style.dx=Math.round(Math.max(0,+Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",la.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(z.width,u.x-z.x-A*z.width)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},internalStorage:function(f){var q=[mb(f,["dx","dy"],function(z){var u=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"dx",Ia.prototype.dx))),A=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"dy",Ia.prototype.dy)));+return new mxPoint(z.x+u,z.y+A)},function(z,u){this.state.style.dx=Math.round(Math.max(0,Math.min(z.width,u.x-z.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(z.height,u.y-z.y)))},!1)];mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&q.push(xb(f));return q},module:function(f){return[mb(f,["jettyWidth","jettyHeight"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"jettyWidth",Ca.prototype.jettyWidth))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,+"jettyHeight",Ca.prototype.jettyHeight)));return new mxPoint(q.x+z/2,q.y+2*u)},function(q,z){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(q.width,z.x-q.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(q.height,z.y-q.y))/2)})]},corner:function(f){return[mb(f,["dx","dy"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"dx",za.prototype.dx))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"dy",za.prototype.dy)));return new mxPoint(q.x++z,q.y+u)},function(q,z){this.state.style.dx=Math.round(Math.max(0,Math.min(q.width,z.x-q.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},tee:function(f){return[mb(f,["dx","dy"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"dx",Qa.prototype.dx))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"dy",Qa.prototype.dy)));return new mxPoint(q.x+(q.width+z)/2,q.y+u)},function(q,z){this.state.style.dx=Math.round(Math.max(0,2*Math.min(q.width/2,z.x-q.x-q.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},singleArrow:rb(1),doubleArrow:rb(.5),"mxgraph.arrows2.wedgeArrow":sb(20,20),"mxgraph.arrows2.wedgeArrowDashed":sb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":sb(20,20),folder:function(f){return[mb(f,["tabWidth","tabHeight"],function(q){var z=Math.max(0,Math.min(q.width,mxUtils.getValue(this.state.style,"tabWidth",t.prototype.tabWidth))),u=Math.max(0,Math.min(q.height,mxUtils.getValue(this.state.style,"tabHeight",t.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",t.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(z=q.width-z);return new mxPoint(q.x+z,q.y+u)},function(q,z){var u=Math.max(0,Math.min(q.width,z.x-q.x));mxUtils.getValue(this.state.style,"tabPosition",t.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=q.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(q.height,z.y-q.y)))},!1)]},document:function(f){return[mb(f,-["size"],function(q){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",L.prototype.size))));return new mxPoint(q.x+3*q.width/4,q.y+(1-z)*q.height)},function(q,z){this.state.style.size=Math.max(0,Math.min(1,(q.y+q.height-z.y)/q.height))},!1)]},tape:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",I.prototype.size))));return new mxPoint(q.getCenterX(),q.y+z*q.height/2)},function(q,z){this.state.style.size=-Math.max(0,Math.min(1,(z.y-q.y)/q.height*2))},!1)]},isoCube2:function(f){return[mb(f,["isoAngle"],function(q){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",M.isoAngle))))*Math.PI/200;return new mxPoint(q.x,q.y+Math.min(q.width*Math.tan(z),.5*q.height))},function(q,z){this.state.style.isoAngle=Math.max(0,50*(z.y-q.y)/q.height)},!0)]},cylinder2:tb(c.prototype.size),cylinder3:tb(g.prototype.size),offPageConnector:function(f){return[mb(f,["size"],function(q){var z=-Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Xa.prototype.size))));return new mxPoint(q.getCenterX(),q.y+(1-z)*q.height)},function(q,z){this.state.style.size=Math.max(0,Math.min(1,(q.y+q.height-z.y)/q.height))},!1)]},"mxgraph.basic.rect":function(f){var q=[Graph.createHandle(f,["size"],function(z){var u=Math.max(0,Math.min(z.width/2,z.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(z.x+u,z.y+u)},function(z,u){this.state.style.size=-Math.round(100*Math.max(0,Math.min(z.height/2,z.width/2,u.x-z.x)))/100})];f=Graph.createHandle(f,["indent"],function(z){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(z.x+.75*z.width,z.y+u*z.height/200)},function(z,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-z.y)/z.height)))/100});q.push(f);return q},step:vb(ka.prototype.size,!0,null,!0,ka.prototype.fixedSize),hexagon:vb(V.prototype.size,!0,.5,!0,V.prototype.fixedSize),-curlyBracket:vb(da.prototype.size,!1),display:vb(xa.prototype.size,!1),cube:yb(1,n.prototype.size,!1),card:yb(.5,D.prototype.size,!0),loopLimit:yb(.5,Ja.prototype.size,!0),trapezoid:Fb(.5,K.prototype.size,K.prototype.fixedSize),parallelogram:Fb(1,N.prototype.size,N.prototype.fixedSize),zigzag:function(f){return[mb(f,["size"],function(q){var z=Math.max(5,parseFloat(mxUtils.getValue(this.state.style,"size",cb.prototype.size)));return new mxPoint(q.x+3*z,q.y)},function(q,z){this.state.style.size=Math.max(5,+["size"],function(q){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size))));return new mxPoint(q.x+3*q.width/4,q.y+(1-z)*q.height)},function(q,z){this.state.style.size=Math.max(0,Math.min(1,(q.y+q.height-z.y)/q.height))},!1)]},tape:function(f){return[mb(f,["size"],function(q){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",I.prototype.size))));return new mxPoint(q.getCenterX(),q.y+z*q.height/2)},function(q,z){this.state.style.size=+Math.max(0,Math.min(1,(z.y-q.y)/q.height*2))},!1)]},isoCube2:function(f){return[mb(f,["isoAngle"],function(q){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",L.isoAngle))))*Math.PI/200;return new mxPoint(q.x,q.y+Math.min(q.width*Math.tan(z),.5*q.height))},function(q,z){this.state.style.isoAngle=Math.max(0,50*(z.y-q.y)/q.height)},!0)]},cylinder2:tb(c.prototype.size),cylinder3:tb(g.prototype.size),offPageConnector:function(f){return[mb(f,["size"],function(q){var z=+Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Da.prototype.size))));return new mxPoint(q.getCenterX(),q.y+(1-z)*q.height)},function(q,z){this.state.style.size=Math.max(0,Math.min(1,(q.y+q.height-z.y)/q.height))},!1)]},"mxgraph.basic.rect":function(f){var q=[Graph.createHandle(f,["size"],function(z){var u=Math.max(0,Math.min(z.width/2,z.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(z.x+u,z.y+u)},function(z,u){this.state.style.size=+Math.round(100*Math.max(0,Math.min(z.height/2,z.width/2,u.x-z.x)))/100})];f=Graph.createHandle(f,["indent"],function(z){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(z.x+.75*z.width,z.y+u*z.height/200)},function(z,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-z.y)/z.height)))/100});q.push(f);return q},step:vb(ka.prototype.size,!0,null,!0,ka.prototype.fixedSize),hexagon:vb(W.prototype.size,!0,.5,!0,W.prototype.fixedSize),+curlyBracket:vb(Q.prototype.size,!1),display:vb(ya.prototype.size,!1),cube:yb(1,n.prototype.size,!1),card:yb(.5,D.prototype.size,!0),loopLimit:yb(.5,ra.prototype.size,!0),trapezoid:Fb(.5,V.prototype.size,V.prototype.fixedSize),parallelogram:Fb(1,M.prototype.size,M.prototype.fixedSize),zigzag:function(f){return[mb(f,["size"],function(q){var z=Math.max(5,parseFloat(mxUtils.getValue(this.state.style,"size",eb.prototype.size)));return new mxPoint(q.x+3*z,q.y)},function(q,z){this.state.style.size=Math.max(5,Math.round((z.x-q.x)/3))},!1)]}};Graph.createHandle=mb;Graph.handleFactory=Bb;var Cb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var f=Cb.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var q=this.state.style.shape;null==mxCellRenderer.defaultShapes[q]&&null==mxStencilRegistry.getStencil(q)?q=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(q=mxConstants.SHAPE_SWIMLANE);q=Bb[q];null==q&&null!=this.state.shape&&this.state.shape.isRoundable()&&(q=Bb[mxConstants.SHAPE_RECTANGLE]);null!=q&&(q=q(this.state),null!=q&&(f=null==f?q:f.concat(q)))}return f};mxEdgeHandler.prototype.createCustomHandles=function(){var f=this.state.style.shape;null==mxCellRenderer.defaultShapes[f]&&null==mxStencilRegistry.getStencil(f)&&(f=mxConstants.SHAPE_CONNECTOR);f=Bb[f];return null!=f?f(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Db=new mxPoint(1,0),Eb=new mxPoint(1,0),nb=mxUtils.toRadians(-30);Db=mxUtils.getRotatedPoint(Db,Math.cos(nb),Math.sin(nb));var Ab=mxUtils.toRadians(-150);Eb=mxUtils.getRotatedPoint(Eb,Math.cos(Ab),Math.sin(Ab));mxEdgeStyle.IsometricConnector=function(f,q,z,u,A){var F=f.view;u=null!=u&&0<u.length?u[0]:null;var H=f.absolutePoints,ha=H[0];H=H[H.length-1];null!=u&&(u=F.transformControlPoint(f,u));null==ha&&null!=q&&(ha=new mxPoint(q.getCenterX(),q.getCenterY()));null==H&&null!=z&&(H=new mxPoint(z.getCenterX(),z.getCenterY()));var O=Db.x,-va=Db.y,pa=Eb.x,Wa=Eb.y,kb="horizontal"==mxUtils.getValue(f.style,"elbow","horizontal");if(null!=H&&null!=ha){f=function(Ea,La,Ka){Ea-=fb.x;var Ia=La-fb.y;La=(Wa*Ea-pa*Ia)/(O*Wa-va*pa);Ea=(va*Ea-O*Ia)/(va*pa-O*Wa);kb?(Ka&&(fb=new mxPoint(fb.x+O*La,fb.y+va*La),A.push(fb)),fb=new mxPoint(fb.x+pa*Ea,fb.y+Wa*Ea)):(Ka&&(fb=new mxPoint(fb.x+pa*Ea,fb.y+Wa*Ea),A.push(fb)),fb=new mxPoint(fb.x+O*La,fb.y+va*La));A.push(fb)};var fb=ha;null==u&&(u=new mxPoint(ha.x+(H.x-ha.x)/2,ha.y+(H.y-ha.y)/2));f(u.x,u.y,!0);+va=Db.y,oa=Eb.x,Xa=Eb.y,kb="horizontal"==mxUtils.getValue(f.style,"elbow","horizontal");if(null!=H&&null!=ha){f=function(Ea,Ka,Ja){Ea-=gb.x;var Ha=Ka-gb.y;Ka=(Xa*Ea-oa*Ha)/(O*Xa-va*oa);Ea=(va*Ea-O*Ha)/(va*oa-O*Xa);kb?(Ja&&(gb=new mxPoint(gb.x+O*Ka,gb.y+va*Ka),A.push(gb)),gb=new mxPoint(gb.x+oa*Ea,gb.y+Xa*Ea)):(Ja&&(gb=new mxPoint(gb.x+oa*Ea,gb.y+Xa*Ea),A.push(gb)),gb=new mxPoint(gb.x+O*Ka,gb.y+va*Ka));A.push(gb)};var gb=ha;null==u&&(u=new mxPoint(ha.x+(H.x-ha.x)/2,ha.y+(H.y-ha.y)/2));f(u.x,u.y,!0);f(H.x,H.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var wb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(f,q){if(q==mxEdgeStyle.IsometricConnector){var z=new mxElbowEdgeHandler(f);z.snapToTerminals=!1;return z}return wb.apply(this,arguments)};C.prototype.constraints=[];G.prototype.getConstraints=function(f,q,z){f=[];var u=Math.tan(mxUtils.toRadians(30)),A=(.5-u)/2;u=Math.min(q,z/(.5+u));q=(q-u)/2;z=(z-u)/2;f.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,q,z+.25*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+.5*u,z+u*A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+u,z+.25*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+u,z+.75*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+.5*u,z+(1-A)*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z+.75*u));return f};M.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,+0),!1,null,q,z+.25*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+.5*u,z+u*A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+u,z+.25*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+u,z+.75*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q+.5*u,z+(1-A)*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z+.75*u));return f};L.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(q*Math.tan(u),.5*z);f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,u));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z-u));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));return f};la.prototype.getConstraints=function(f,q,z){f=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var A=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));f.push(new mxConnectionConstraint(new mxPoint(1,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.5*(z-u)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z-u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,@@ -3076,14 +3080,14 @@ null,q-u,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-.5*u,."tabWidth",this.tabWidth)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(f.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,0)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,A)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),A))):(f.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-.5*u,0)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,0)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,A)),f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-u),A)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.25*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.5*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.75*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(z-A)+A));f.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,z));f.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return f};Ma.prototype.constraints=mxRectangleShape.prototype.constraints;oa.prototype.constraints=mxRectangleShape.prototype.constraints;ib.prototype.constraints=mxEllipse.prototype.constraints;y.prototype.constraints=mxEllipse.prototype.constraints;P.prototype.constraints=mxEllipse.prototype.constraints;ra.prototype.constraints=-mxEllipse.prototype.constraints;eb.prototype.constraints=mxRectangleShape.prototype.constraints;wa.prototype.constraints=mxRectangleShape.prototype.constraints;xa.prototype.getConstraints=function(f,q,z){f=[];var u=Math.min(q,z/2),A=Math.min(q-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*q);f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,-.5*(A+q-u),0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,0));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(A+q-u),z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));return f};Ba.prototype.getConstraints=function(f,q,z){q=parseFloat(mxUtils.getValue(f,"jettyWidth",Ba.prototype.jettyWidth))/2;f=parseFloat(mxUtils.getValue(f,-"jettyHeight",Ba.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,q),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(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,+0),!1,null,0,z));f.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return f};Ia.prototype.constraints=mxRectangleShape.prototype.constraints;xa.prototype.constraints=mxRectangleShape.prototype.constraints;Ra.prototype.constraints=mxEllipse.prototype.constraints;x.prototype.constraints=mxEllipse.prototype.constraints;N.prototype.constraints=mxEllipse.prototype.constraints;qa.prototype.constraints=+mxEllipse.prototype.constraints;db.prototype.constraints=mxRectangleShape.prototype.constraints;wa.prototype.constraints=mxRectangleShape.prototype.constraints;ya.prototype.getConstraints=function(f,q,z){f=[];var u=Math.min(q,z/2),A=Math.min(q-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*q);f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,+.5*(A+q-u),0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,0));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-u,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(A+q-u),z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));return f};Ca.prototype.getConstraints=function(f,q,z){q=parseFloat(mxUtils.getValue(f,"jettyWidth",Ca.prototype.jettyWidth))/2;f=parseFloat(mxUtils.getValue(f,+"jettyHeight",Ca.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,q),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(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,q),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),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*f,1.5*f)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*f,3.5*f))];z>5*f&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,q));z>8*f&&u.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,q));z>-15*f&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,q));return u};Ja.prototype.constraints=mxRectangleShape.prototype.constraints;Xa.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,+15*f&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,q));return u};ra.prototype.constraints=mxRectangleShape.prototype.constraints;Da.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];R.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,-1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];za.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,+1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];Ba.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];l.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];I.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,@@ -3092,87 +3096,87 @@ q),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(1),!1)];mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,-.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];N.prototype.constraints=mxRectangleShape.prototype.constraints;K.prototype.constraints=mxRectangleShape.prototype.constraints;L.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;Oa.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,+.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)];M.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;K.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;Qa.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(1,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.5*A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*q+.25*u,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),.5*(z+A)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),z));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-u),z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-u),.5*(z+A)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-u),A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*q-.25*u,A));f.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*A));return f};ya.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(1,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*A));return f};za.prototype.getConstraints=function(f,q,z){f=[];var u=Math.max(0,Math.min(q,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(1,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,.5*A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+u),A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,A));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(z+A)));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z));f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,-1),!1));return f};Sa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Na.prototype.getConstraints=+1),!1));return f};Ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Ma.prototype.getConstraints=function(f,q,z){f=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),A=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));u=(z-u)/2;f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-A),u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,0));f.push(new mxConnectionConstraint(new mxPoint(1,-.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-A),z-u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));return f};Pa.prototype.getConstraints=function(f,q,z){f=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Na.prototype.arrowWidth)))),A=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Na.prototype.arrowSize))));u=(z-u)/2;f.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q-A),z-u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));return f};Na.prototype.getConstraints=function(f,q,z){f=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Ma.prototype.arrowWidth)))),A=q*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Ma.prototype.arrowSize))));u=(z-u)/2;f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*q,u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,0));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q-A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*q,z-u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));return f};sa.prototype.getConstraints=function(f,q,z){f=[];var u=Math.min(z,q),A=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(z-A)/2;var F=u+A,H=(q-A)/2;A=H+A;f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,.5*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,0));f.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,0));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,.5*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,z-.5*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,z));f.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,z-.5*u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,A,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+A),u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,u));f.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,q,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(q+A),F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*H,u));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));f.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));f.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*H,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,u));return f};aa.prototype.constraints=null;Da.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)];Ca.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)];ta.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*H,F));f.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,H,u));return f};ba.prototype.constraints=null;Za.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)];Oa.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)];ta.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ua.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(E){p.escape();E=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),E);null!=E&&p.setSelectionCells(E)}function d(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var E=p.getSelectionCells(),Q=0;Q<E.length;Q++)p.cellLabelChanged(E[Q],"")}finally{p.getModel().endUpdate()}}}function m(E,Q,M,c,g){g.getModel().beginUpdate();try{var l=g.getCellGeometry(E);null!=l&&M&&c&&(M/=c,l=l.clone(),1<M?l.height=l.width/M:l.width=l.height*M,g.getModel().setGeometry(E,-l));g.setCellStyles(mxConstants.STYLE_CLIP_PATH,Q,[E]);g.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[E])}finally{g.getModel().endUpdate()}}var n=this.editorUi,v=n.editor,p=v.graph,C=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(n.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";n.openFile()});var G=new Action("smartFit",function(){if(n.chromelessResize)p.isLightboxView()?(1==-p.view.scale?n.lightboxFit():p.zoomTo(1),n.chromelessResize(!1)):n.chromelessResize(!0);else{p.popupMenuHandler.hideMenu();var E=p.view.scale,Q=p.container.scrollLeft,M=p.container.scrollTop,c=p.view.translate.x,g=p.view.translate.y;n.actions.get("resetView").funct();1E-5>Math.abs(E-p.view.scale)&&5>Math.abs(Q-p.container.scrollLeft)&&5>Math.abs(M-p.container.scrollTop)&&c==p.view.translate.x&&g==p.view.translate.y&&n.actions.get("fitWindow").funct()}},null,null,"Enter");G.getTitle=function(){return mxResources.get("fitWindow")+-" / "+mxResources.get("resetView")};this.put("smartFit",G);this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?n.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(){n.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(E,Q){try{var M=mxUtils.parseXml(E);v.graph.setSelectionCells(v.graph.importGraphModel(M.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")++Actions.prototype.init=function(){function b(E){p.escape();E=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),E);null!=E&&p.setSelectionCells(E)}function d(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var E=p.getSelectionCells(),P=0;P<E.length;P++)p.cellLabelChanged(E[P],"")}finally{p.getModel().endUpdate()}}}function m(E,P,L,c,g){g.getModel().beginUpdate();try{var l=g.getCellGeometry(E);null!=l&&L&&c&&(L/=c,l=l.clone(),1<L?l.height=l.width/L:l.width=l.height*L,g.getModel().setGeometry(E,+l));g.setCellStyles(mxConstants.STYLE_CLIP_PATH,P,[E]);g.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[E])}finally{g.getModel().endUpdate()}}var n=this.editorUi,v=n.editor,p=v.graph,C=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(n.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";n.openFile()});var G=new Action("smartFit",function(){if(n.chromelessResize)p.isLightboxView()?(1==+p.view.scale?n.lightboxFit():p.zoomTo(1),n.chromelessResize(!1)):n.chromelessResize(!0);else{p.popupMenuHandler.hideMenu();var E=p.view.scale,P=p.container.scrollLeft,L=p.container.scrollTop,c=p.view.translate.x,g=p.view.translate.y;n.actions.get("resetView").funct();1E-5>Math.abs(E-p.view.scale)&&5>Math.abs(P-p.container.scrollLeft)&&5>Math.abs(L-p.container.scrollTop)&&c==p.view.translate.x&&g==p.view.translate.y&&n.actions.get("fitWindow").funct()}},null,null,"Enter");G.getTitle=function(){return mxResources.get("fitWindow")++" / "+mxResources.get("resetView")};this.put("smartFit",G);this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?n.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(){n.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(E,P){try{var L=mxUtils.parseXml(E);v.graph.setSelectionCells(v.graph.importGraphModel(L.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+c.message)}}));n.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=C;this.addAction("save",function(){n.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=C;this.addAction("saveAs...",function(){n.saveFile(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+S");this.addAction("export...",function(){n.showDialog((new ExportDialog(n)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var E=new EditDiagramDialog(n);n.showDialog(E.container,620,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));E.init()}).isEnabled=C;this.addAction("pageSetup...",function(){n.showDialog((new PageSetupDialog(n)).container,320,240,!0,!0)}).isEnabled=C;this.addAction("print...",function(){n.showPrintDialog()},null,"",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(p,null,10,10)});this.addAction("undo",function(){n.undo()},null,"",Editor.ctrlKey+"+Z");this.addAction("redo",function(){n.redo()},null,"",mxClient.IS_WIN?Editor.ctrlKey+-"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var E=null;try{E=n.copyXml(),null!=E&&p.removeCells(E,!1)}catch(Q){}try{null==E&&mxClipboard.cut(p)}catch(Q){n.handleError(Q)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{n.copyXml()}catch(E){}try{mxClipboard.copy(p)}catch(E){n.handleError(E)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){n.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(E){n.pasteFromClipboard(p.popupMenuHandler.getTriggerPoint())});+"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var E=null;try{E=n.copyXml(),null!=E&&p.removeCells(E,!1)}catch(P){}try{null==E&&mxClipboard.cut(p)}catch(P){n.handleError(P)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{n.copyXml()}catch(E){}try{mxClipboard.copy(p)}catch(E){n.handleError(E)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){n.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(E){n.pasteFromClipboard(p.popupMenuHandler.getTriggerPoint())});this.addAction("swap",function(){var E=p.getSelectionCells();2==E.length&&p.swapShapes(E[0],E[1])});this.addAction("copySize",function(){var E=p.getSelectionCell();p.isEnabled()&&null!=E&&p.getModel().isVertex(E)&&(E=p.getCellGeometry(E),null!=E&&(n.copiedSize=new mxRectangle(E.x,E.y,E.width,E.height)))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+F");this.addAction("pasteSize",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=n.copiedSize){p.getModel().beginUpdate();try{for(var E=p.getResizableCells(p.getSelectionCells()),-Q=0;Q<E.length;Q++)if(p.getModel().isVertex(E[Q])){var M=p.getCellGeometry(E[Q]);null!=M&&(M=M.clone(),M.width=n.copiedSize.width,M.height=n.copiedSize.height,p.getModel().setGeometry(E[Q],M))}}finally{p.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");this.addAction("copyData",function(){var E=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&null!=E&&(E=E.cloneValue(),null==E||isNaN(E.nodeType)||(n.copiedValue=E))},null,null,Editor.altKey+"+"+Editor.shiftKey+-"+B");this.addAction("copyAsText",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E)try{p.isHtmlLabel(E)?n.writeHtmlToClipboard(p.getLabel(E),mxUtils.bind(this,function(Q){n.handleError(Q)})):n.writeTextToClipboard(p.getLabel(E),mxUtils.bind(this,function(Q){n.handleError(Q)}))}catch(Q){n.handleError(Q)}});this.addAction("pasteData",function(E,Q){function M(l,t){var B=c.getValue(l);t=l.cloneValue(t);t.removeAttribute("placeholders");null==B||isNaN(B.nodeType)||t.setAttribute("placeholders",-B.getAttribute("placeholders"));null!=E&&mxEvent.isShiftDown(E)||t.setAttribute("label",p.convertValueToString(l));c.setValue(l,t)}E=null!=Q?Q:E;var c=p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=n.copiedValue){c.beginUpdate();try{var g=p.getEditableCells(p.getSelectionCells());if(0==g.length)M(c.getRoot(),n.copiedValue);else for(Q=0;Q<g.length;Q++)M(g[Q],n.copiedValue)}finally{c.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(E,Q){E=-null!=Q?Q:E;null!=E&&mxEvent.isShiftDown(E)?d():b(null!=E&&(mxEvent.isControlDown(E)||mxEvent.isMetaDown(E)||mxEvent.isAltDown(E)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){d()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(E){n.handleError(E)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",+P=0;P<E.length;P++)if(p.getModel().isVertex(E[P])){var L=p.getCellGeometry(E[P]);null!=L&&(L=L.clone(),L.width=n.copiedSize.width,L.height=n.copiedSize.height,p.getModel().setGeometry(E[P],L))}}finally{p.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");this.addAction("copyData",function(){var E=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&null!=E&&(E=E.cloneValue(),null==E||isNaN(E.nodeType)||(n.copiedValue=E))},null,null,Editor.altKey+"+"+Editor.shiftKey++"+B");this.addAction("copyAsText",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E)try{p.isHtmlLabel(E)?n.writeHtmlToClipboard(p.getLabel(E),mxUtils.bind(this,function(P){n.handleError(P)})):n.writeTextToClipboard(p.getLabel(E),mxUtils.bind(this,function(P){n.handleError(P)}))}catch(P){n.handleError(P)}});this.addAction("pasteData",function(E,P){function L(l,t){var B=c.getValue(l);t=l.cloneValue(t);t.removeAttribute("placeholders");null==B||isNaN(B.nodeType)||t.setAttribute("placeholders",+B.getAttribute("placeholders"));null!=E&&mxEvent.isShiftDown(E)||t.setAttribute("label",p.convertValueToString(l));c.setValue(l,t)}E=null!=P?P:E;var c=p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=n.copiedValue){c.beginUpdate();try{var g=p.getEditableCells(p.getSelectionCells());if(0==g.length)L(c.getRoot(),n.copiedValue);else for(P=0;P<g.length;P++)L(g[P],n.copiedValue)}finally{c.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(E,P){E=+null!=P?P:E;null!=E&&mxEvent.isShiftDown(E)?d():b(null!=E&&(mxEvent.isControlDown(E)||mxEvent.isMetaDown(E)||mxEvent.isAltDown(E)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){d()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(E){n.handleError(E)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var E=n.getSelectionState();if(null!=E.mergeCell){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",E.rowspan,[E.mergeCell]),p.setCellStyles("colspan",E.colspan,[E.mergeCell])}finally{p.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var E=n.getSelectionState();if(0<E.cells.length){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",null,E.cells),p.setCellStyles("colspan",null,E.cells)}finally{p.getModel().endUpdate()}}}));G=new Action("turn",-function(E,Q){E=null!=Q?Q:E;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=E?mxEvent.isShiftDown(E):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");G.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",G);this.put("selectConnections",new Action("selectEdges",function(E){E=p.getSelectionCell();p.isEnabled()&&null!=E&&p.addSelectionCells(p.getEdges(E))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,-null,Editor.ctrlKey+"+"+Editor.shiftKey+"+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+E");this.addAction("selectAll",function(){p.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){p.clearSelection()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+A");this.addAction("lockUnlock",function(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{var E=p.getSelectionCells(),Q=p.getCurrentCellStyle(p.getSelectionCell()),-M=1==mxUtils.getValue(Q,mxConstants.STYLE_EDITABLE,1)?0:1;p.setCellStyles(mxConstants.STYLE_MOVABLE,M,E);p.setCellStyles(mxConstants.STYLE_RESIZABLE,M,E);p.setCellStyles(mxConstants.STYLE_ROTATABLE,M,E);p.setCellStyles(mxConstants.STYLE_DELETABLE,M,E);p.setCellStyles(mxConstants.STYLE_EDITABLE,M,E);p.setCellStyles("locked",1==M?0:1,E);p.setCellStyles("connectable",M,E)}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){var E=p.getSelectionCell();+function(E,P){E=null!=P?P:E;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=E?mxEvent.isShiftDown(E):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");G.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",G);this.put("selectConnections",new Action("selectEdges",function(E){E=p.getSelectionCell();p.isEnabled()&&null!=E&&p.addSelectionCells(p.getEdges(E))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,+null,Editor.ctrlKey+"+"+Editor.shiftKey+"+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+E");this.addAction("selectAll",function(){p.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){p.clearSelection()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+A");this.addAction("lockUnlock",function(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{var E=p.getSelectionCells(),P=p.getCurrentCellStyle(p.getSelectionCell()),+L=1==mxUtils.getValue(P,mxConstants.STYLE_EDITABLE,1)?0:1;p.setCellStyles(mxConstants.STYLE_MOVABLE,L,E);p.setCellStyles(mxConstants.STYLE_RESIZABLE,L,E);p.setCellStyles(mxConstants.STYLE_ROTATABLE,L,E);p.setCellStyles(mxConstants.STYLE_DELETABLE,L,E);p.setCellStyles(mxConstants.STYLE_EDITABLE,L,E);p.setCellStyles("locked",1==L?0:1,E);p.setCellStyles("connectable",L,E)}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){var E=p.getSelectionCell();p.model.isEdge(E)&&(E=p.model.getTerminal(E,!0));p.model.isVertex(E)&&Graph.exploreFromCell(n.editor.graph,E)});this.addAction("home",function(){p.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){p.exitGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Home");this.addAction("enterGroup",function(){p.enterGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+End");this.addAction("collapse",function(){p.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){p.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){p.orderCells(!1)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+F");this.addAction("toBack",function(){p.orderCells(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+B");this.addAction("bringForward",function(E){p.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(E){p.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",-function(){if(p.isEnabled()){var E=mxUtils.sortCells(p.getSelectionCells(),!0);1!=E.length||p.isTable(E[0])||p.isTableRow(E[0])?(E=p.getCellsForGroup(E),1<E.length&&p.setSelectionCell(p.groupCells(null,0,E))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(p.isEnabled()){var E=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var Q=p.ungroupCells();if(null!=E)for(var M=0;M<E.length;M++)p.model.contains(E[M])&&(0==p.model.getChildCount(E[M])&&-p.model.isVertex(E[M])&&p.setCellStyles("container","0",[E[M]]),Q.push(E[M]))}finally{p.model.endUpdate()}0<Q.length&&p.setSelectionCells(Q)}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var E=p.getSelectionCells();if(null!=E){for(var Q=[],M=0;M<E.length;M++)p.isTableRow(E[M])||p.isTableCell(E[M])||Q.push(E[M]);p.removeCellsFromParent(Q);0<Q.length&&p.scrollCellToVisible(Q[0])}}});this.addAction("edit",function(){p.isEnabled()&&-p.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var E=p.getSelectionCell()||p.getModel().getRoot();n.showDataDialog(E)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E&&p.isCellEditable(E)){var Q="";if(mxUtils.isNode(E.value)){var M=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&E.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(M=E.value.getAttribute("tooltip_"+Graph.diagramLanguage));-null==M&&(M=E.value.getAttribute("tooltip"));null!=M&&(Q=M)}Q=new TextareaDialog(n,mxResources.get("editTooltip")+":",Q,function(c){p.setTooltipForCell(E,c)});n.showDialog(Q.container,320,200,!0,!0);Q.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+T");this.addAction("openLink",function(){var E=p.getLinkForCell(p.getSelectionCell());null!=E&&p.openLink(E)});this.addAction("editLink...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E&&p.isCellEditable(E)){var Q=p.getLinkForCell(E,-!0)||"";n.showLinkDialog(Q,mxResources.get("ok"),function(M,c,g){p.getModel().beginUpdate();try{p.setLinkForCell(E,0<M.length?M:null),p.setAttributeForCell(E,"linkTarget",g)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(E))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+L");this.put("insertImage",new Action("image...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),n.actions.get("image").funct())})).isEnabled=C;this.addAction("editImage...",function(){n.actions.get("image").funct()});-this.put("insertLink",new Action("link...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&n.showLinkDialog("",mxResources.get("ok"),function(E,Q,M){E=mxUtils.trim(E);if(0<E.length){var c=null,g=p.getLinkTitle(E);null!=Q&&0<Q.length&&(c=Q[0].iconUrl,g=Q[0].name||Q[0].type,g=g.charAt(0).toUpperCase()+g.substring(1),30<g.length&&(g=g.substring(0,30)+"..."));Q=new mxCell(g,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+-c:"spacing=10;"));Q.vertex=!0;c=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([Q],!0));Q.geometry.x=c.x;Q.geometry.y=c.y;p.setAttributeForCell(Q,"linkTarget",M);p.setLinkForCell(Q,E);p.cellSizeUpdated(Q,!0);p.getModel().beginUpdate();try{Q=p.addCell(Q),p.fireEvent(new mxEventObject("cellsInserted","cells",[Q]))}finally{p.getModel().endUpdate()}p.setSelectionCell(Q);p.scrollCellToVisible(p.getSelectionCell())}},!0)},null,null,"L")).isEnabled=C;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var E=-p.getSelectedElement(),Q=p.getParentByName(E,"A",p.cellEditor.textarea),M="";if(null==Q&&null!=E&&null!=E.getElementsByTagName)for(var c=E.getElementsByTagName("a"),g=0;g<c.length&&null==Q;g++)c[g].textContent==E.textContent&&(Q=c[g]);null!=Q&&"A"==Q.nodeName&&(M=Q.getAttribute("href")||"",p.selectNode(Q));var l=p.cellEditor.saveSelection();n.showLinkDialog(M,mxResources.get("ok"),mxUtils.bind(this,function(t){p.cellEditor.restoreSelection(l);null!=t&&p.insertLink(t)}))}else p.isSelectionEmpty()?-this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=C;this.addAction("autosize",function(){var E=p.getSelectionCells();if(null!=E){p.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var M=E[Q];p.getModel().isVertex(M)&&(p.isAutosizeTextCell(M)&&p.setCellStyles("autosizeText",null,[M]),0<p.getModel().getChildCount(M)?p.updateGroupBounds([M],0,!0):p.updateCellSize(M))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Y");this.addAction("snapToGrid",-function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var E=p.getCommonStyle(p.getSelectionCells());E="1"==mxUtils.getValue(E,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var Q=p.getEditableCells(p.getSelectionCells()),M=0;M<Q.length;M++){var c=p.getView().getState(Q[M]);if(null!=c){var g=mxUtils.getValue(c.style,"html","0");if("1"==g&&null==E)p.removeTextStyleForCell(c.cell),p.setCellStyles("html",E,[Q[M]]);else if("0"==-g&&"1"==E){var l=mxUtils.htmlEntities(p.convertValueToString(c.cell),!1);"0"!=mxUtils.getValue(c.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>"));p.cellLabelChanged(c.cell,Graph.sanitizeHtml(l));p.setCellStyles("html",E,[Q[M]])}}}n.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=E?E:"0"],"cells",Q))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var E=p.getView().getState(p.getSelectionCell()),Q="wrap";p.stopEditing();null!=E&&"wrap"==E.style[mxConstants.STYLE_WHITE_SPACE]&&-(Q=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,Q)});this.addAction("rotation",function(){var E="0",Q=p.getView().getState(p.getSelectionCell());null!=Q&&(E=Q.style[mxConstants.STYLE_ROTATION]||E);E=new FilenameDialog(n,E,mxResources.get("apply"),function(M){null!=M&&0<M.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,M)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");n.showDialog(E.container,375,80,!0,!0);E.init()});this.addAction("resetView",function(){p.zoomTo(1);+function(){if(p.isEnabled()){var E=mxUtils.sortCells(p.getSelectionCells(),!0);1!=E.length||p.isTable(E[0])||p.isTableRow(E[0])?(E=p.getCellsForGroup(E),1<E.length&&p.setSelectionCell(p.groupCells(null,0,E))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(p.isEnabled()){var E=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var P=p.ungroupCells();if(null!=E)for(var L=0;L<E.length;L++)p.model.contains(E[L])&&(0==p.model.getChildCount(E[L])&&+p.model.isVertex(E[L])&&p.setCellStyles("container","0",[E[L]]),P.push(E[L]))}finally{p.model.endUpdate()}0<P.length&&p.setSelectionCells(P)}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var E=p.getSelectionCells();if(null!=E){for(var P=[],L=0;L<E.length;L++)p.isTableRow(E[L])||p.isTableCell(E[L])||P.push(E[L]);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 E=p.getSelectionCell()||p.getModel().getRoot();n.showDataDialog(E)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E&&p.isCellEditable(E)){var P="";if(mxUtils.isNode(E.value)){var L=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&E.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(L=E.value.getAttribute("tooltip_"+Graph.diagramLanguage));+null==L&&(L=E.value.getAttribute("tooltip"));null!=L&&(P=L)}P=new TextareaDialog(n,mxResources.get("editTooltip")+":",P,function(c){p.setTooltipForCell(E,c)});n.showDialog(P.container,320,200,!0,!0);P.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+T");this.addAction("openLink",function(){var E=p.getLinkForCell(p.getSelectionCell());null!=E&&p.openLink(E)});this.addAction("editLink...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E&&p.isCellEditable(E)){var P=p.getLinkForCell(E,+!0)||"";n.showLinkDialog(P,mxResources.get("ok"),function(L,c,g){p.getModel().beginUpdate();try{p.setLinkForCell(E,0<L.length?L:null),p.setAttributeForCell(E,"linkTarget",g)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(E))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+L");this.put("insertImage",new Action("image...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),n.actions.get("image").funct())})).isEnabled=C;this.addAction("editImage...",function(){n.actions.get("image").funct()});+this.put("insertLink",new Action("link...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&n.showLinkDialog("",mxResources.get("ok"),function(E,P,L){E=mxUtils.trim(E);if(0<E.length){var c=null,g=p.getLinkTitle(E);null!=P&&0<P.length&&(c=P[0].iconUrl,g=P[0].name||P[0].type,g=g.charAt(0).toUpperCase()+g.substring(1),30<g.length&&(g=g.substring(0,30)+"..."));P=new mxCell(g,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="++c:"spacing=10;"));P.vertex=!0;c=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([P],!0));P.geometry.x=c.x;P.geometry.y=c.y;p.setAttributeForCell(P,"linkTarget",L);p.setLinkForCell(P,E);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=C;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var E=+p.getSelectedElement(),P=p.getParentByName(E,"A",p.cellEditor.textarea),L="";if(null==P&&null!=E&&null!=E.getElementsByTagName)for(var c=E.getElementsByTagName("a"),g=0;g<c.length&&null==P;g++)c[g].textContent==E.textContent&&(P=c[g]);null!=P&&"A"==P.nodeName&&(L=P.getAttribute("href")||"",p.selectNode(P));var l=p.cellEditor.saveSelection();n.showLinkDialog(L,mxResources.get("ok"),mxUtils.bind(this,function(t){p.cellEditor.restoreSelection(l);null!=t&&p.insertLink(t)}))}else p.isSelectionEmpty()?+this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=C;this.addAction("autosize",function(){var E=p.getSelectionCells();if(null!=E){p.getModel().beginUpdate();try{for(var P=0;P<E.length;P++){var L=E[P];p.getModel().isVertex(L)&&(p.isAutosizeTextCell(L)&&p.setCellStyles("autosizeText",null,[L]),0<p.getModel().getChildCount(L)?p.updateGroupBounds([L],0,!0):p.updateCellSize(L))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Y");this.addAction("snapToGrid",+function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var E=p.getCommonStyle(p.getSelectionCells());E="1"==mxUtils.getValue(E,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var P=p.getEditableCells(p.getSelectionCells()),L=0;L<P.length;L++){var c=p.getView().getState(P[L]);if(null!=c){var g=mxUtils.getValue(c.style,"html","0");if("1"==g&&null==E)p.removeTextStyleForCell(c.cell),p.setCellStyles("html",E,[P[L]]);else if("0"==+g&&"1"==E){var l=mxUtils.htmlEntities(p.convertValueToString(c.cell),!1);"0"!=mxUtils.getValue(c.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>"));p.cellLabelChanged(c.cell,Graph.sanitizeHtml(l));p.setCellStyles("html",E,[P[L]])}}}n.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=E?E:"0"],"cells",P))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var E=p.getView().getState(p.getSelectionCell()),P="wrap";p.stopEditing();null!=E&&"wrap"==E.style[mxConstants.STYLE_WHITE_SPACE]&&+(P=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,P)});this.addAction("rotation",function(){var E="0",P=p.getView().getState(p.getSelectionCell());null!=P&&(E=P.style[mxConstants.STYLE_ROTATION]||E);E=new FilenameDialog(n,E,mxResources.get("apply"),function(L){null!=L&&0<L.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,L)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");n.showDialog(E.container,375,80,!0,!0);E.init()});this.addAction("resetView",function(){p.zoomTo(1);n.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(E){p.isFastZoomEnabled()?p.lazyZoom(!0,!0,n.buttonZoomDelay):p.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(E){p.isFastZoomEnabled()?p.lazyZoom(!1,!0,n.buttonZoomDelay):p.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){n.fitDiagramOrPages()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+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()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var E=new FilenameDialog(this.editorUi,-parseInt(100*p.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(Q){Q=parseInt(Q);!isNaN(Q)&&0<Q&&p.zoomTo(Q/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var E=new FilenameDialog(this.editorUi,parseInt(100*p.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(Q){Q=parseInt(Q);!isNaN(Q)&&0<Q&&(Q=new ChangePageSetup(n,null,-null,null,Q/100),Q.ignoreColor=!0,Q.ignoreImage=!0,p.model.execute(Q))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}));G=null;G=this.addAction("grid",function(){p.setGridEnabled(!p.isGridEnabled());p.defaultGridEnabled=p.isGridEnabled();n.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+G");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.isGridEnabled()});G.setEnabled(!1);G=this.addAction("guides",+parseInt(100*p.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(P){P=parseInt(P);!isNaN(P)&&0<P&&p.zoomTo(P/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var E=new FilenameDialog(this.editorUi,parseInt(100*p.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(P){P=parseInt(P);!isNaN(P)&&0<P&&(P=new ChangePageSetup(n,null,+null,null,P/100),P.ignoreColor=!0,P.ignoreImage=!0,p.model.execute(P))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}));G=null;G=this.addAction("grid",function(){p.setGridEnabled(!p.isGridEnabled());p.defaultGridEnabled=p.isGridEnabled();n.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+G");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.isGridEnabled()});G.setEnabled(!1);G=this.addAction("guides",function(){p.graphHandler.guidesEnabled=!p.graphHandler.guidesEnabled;n.fireEvent(new mxEventObject("guidesEnabledChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.graphHandler.guidesEnabled});G.setEnabled(!1);G=this.addAction("animations",function(){Editor.enableAnimations=!Editor.enableAnimations;n.fireEvent(new mxEventObject("enableAnimationsChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return Editor.enableAnimations});G=this.addAction("tooltips",function(){p.tooltipHandler.setEnabled(!p.tooltipHandler.isEnabled());n.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.tooltipHandler.isEnabled()});G=this.addAction("collapseExpand",function(){var E=new ChangePageSetup(n);E.ignoreColor=!0;E.ignoreImage=!0;E.foldingEnabled=!p.foldingEnabled;p.model.execute(E)});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.foldingEnabled});G.isEnabled=C;G=this.addAction("pageView",mxUtils.bind(this,function(){n.setPageVisible(!p.pageVisible)}));G.setToggleAction(!0);G.setSelectedCallback(function(){return p.pageVisible});G=this.addAction("connectionArrows",function(){p.connectionArrowsEnabled=!p.connectionArrowsEnabled;n.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+A");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionArrowsEnabled});G=this.addAction("connectionPoints",function(){p.setConnectable(!p.connectionHandler.isEnabled());n.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionHandler.isEnabled()});G=this.addAction("copyConnect",function(){p.connectionHandler.setCreateTarget(!p.connectionHandler.isCreateTarget());n.fireEvent(new mxEventObject("copyConnectChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return p.connectionHandler.isCreateTarget()});G.isEnabled=C;G=this.addAction("autosave",function(){n.editor.setAutosave(!n.editor.autosave)});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.editor.autosave});G.isEnabled=C;G.visible=!1;this.addAction("help",function(){var E="";mxResources.isLanguageSupported(mxClient.language)&&(E="_"+mxClient.language);p.openLink(RESOURCES_PATH+"/help"+E+".html")});var T=!1;G=new Action("about",function(){T||(n.showDialog((new AboutDialog(n)).container,320,280,!0,!0,function(){T=!1}),T=!0)});G.getTitle=function(){return mxResources.get("about")+-" Graph Editor..."};this.put("about",G);G=mxUtils.bind(this,function(E,Q,M,c){return this.addAction(E,function(){if(null!=M&&p.cellEditor.isContentEditing())M();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var g=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,Q,g);(Q&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?p.updateLabelElements(g,function(t){t.style.fontWeight=null;"B"==t.nodeName&&p.replaceElement(t)}):(Q&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?-p.updateLabelElements(g,function(t){t.style.fontStyle=null;"I"==t.nodeName&&p.replaceElement(t)}):(Q&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(g,function(t){t.style.textDecoration=null;"U"==t.nodeName&&p.replaceElement(t)});for(var l=0;l<g.length;l++)0==p.model.getChildCount(g[l])&&p.autoSizeCell(g[l],!1)}finally{p.getModel().endUpdate()}}},null,null,c)});G("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");G("italic",+" Graph Editor..."};this.put("about",G);G=mxUtils.bind(this,function(E,P,L,c){return this.addAction(E,function(){if(null!=L&&p.cellEditor.isContentEditing())L();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var g=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,P,g);(P&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?p.updateLabelElements(g,function(t){t.style.fontWeight=null;"B"==t.nodeName&&p.replaceElement(t)}):(P&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?+p.updateLabelElements(g,function(t){t.style.fontStyle=null;"I"==t.nodeName&&p.replaceElement(t)}):(P&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(g,function(t){t.style.textDecoration=null;"U"==t.nodeName&&p.replaceElement(t)});for(var l=0;l<g.length;l++)0==p.model.getChildCount(g[l])&&p.autoSizeCell(g[l],!1)}finally{p.getModel().endUpdate()}}},null,null,c)});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(){n.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",p.shapeForegroundColor)});this.addAction("strokeColor...",function(){n.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("fillColor...",function(){n.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",p.shapeBackgroundColor)});this.addAction("gradientColor...",function(){n.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("backgroundColor...",function(){n.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",p.shapeBackgroundColor)});this.addAction("borderColor...",function(){n.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 E=p.getSelectionCells(),Q=0;Q<E.length;Q++)p.removeTextStyleForCell(E[Q],!0)}finally{p.getModel().endUpdate()}}});this.addAction("vertical",function(){n.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){n.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){p.getModel().beginUpdate();+null,"default",p.shapeForegroundColor)});this.addAction("removeFormat",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&!p.isEditing()){p.getModel().beginUpdate();try{for(var E=p.getSelectionCells(),P=0;P<E.length;P++)p.removeTextStyleForCell(E[P],!0)}finally{p.getModel().endUpdate()}}});this.addAction("vertical",function(){n.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){n.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),n.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();try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dotted",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("sharp",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,"0"),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("rounded",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),p.setCellStyles(mxConstants.STYLE_CURVED,-"0"),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!p.isSelectionEmpty()&&p.isEnabled()){p.getModel().beginUpdate();try{var E=p.getSelectionCells(),Q=p.getCurrentCellStyle(E[0]),M="1"==mxUtils.getValue(Q,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,M);p.setCellStyles(mxConstants.STYLE_CURVED,-null);n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[M,"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"),n.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 E=p.view.getState(p.getSelectionCell()),Q="1";null!=E&&null!=p.getFoldingImage(E)&&(Q="0");p.setCellStyles("collapsible",Q);n.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[Q],"cells",p.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var E=p.getEditableCells(p.getSelectionCells());if(null!=E&&0<E.length){var Q=p.getModel();Q=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",-Q.getStyle(E[0])||"",function(M){null!=M&&p.setCellStyle(mxUtils.trim(M),E)},null,null,400,220);this.editorUi.showDialog(Q.container,420,300,!0,!0);Q.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){p.isEnabled()&&!p.isSelectionEmpty()&&n.setDefaultStyle(p.getSelectionCell())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&n.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");-this.addAction("addWaypoint",function(){var E=p.getSelectionCell();if(null!=E&&p.getModel().isEdge(E)){var Q=v.graph.selectionCellsHandler.getHandler(E);if(Q instanceof mxEdgeHandler){var M=0,c=0;E=p.getModel().getParent(E);for(var g=p.getCellGeometry(E);p.getModel().isVertex(E)&&null!=g;)M+=g.x,c+=g.y,E=p.getModel().getParent(E),g=p.getCellGeometry(E);E=p.popupMenuHandler.getTriggerPoint();M=Math.round(p.snap(E.x-M));c=Math.round(p.snap(E.y-c));Q.addPointAt(Q.state,M,c)}}});this.addAction("removeWaypoint",-function(){var E=n.actions.get("removeWaypoint");null!=E.handler&&E.handler.removePoint(E.handler.state,E.index)});this.addAction("clearAnchors",function(){var E=p.getSelectionCells();if(null!=E){E=p.getEditableCells(p.addAllEdges(E));p.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var M=E[Q];p.getModel().isEdge(M)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[M]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[M]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[M]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,-null,[M]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var E=p.getSelectionCells();if(null!=E){E=p.getEditableCells(p.addAllEdges(E));p.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var M=E[Q];if(p.getModel().isEdge(M)){var c=p.getCellGeometry(M);null!=c&&(c=c.clone(),c.points=null,c.x=0,c.y=0,c.offset=null,p.getModel().setGeometry(M,c))}}}finally{p.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");G=this.addAction("subscript",+"0"),n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!p.isSelectionEmpty()&&p.isEnabled()){p.getModel().beginUpdate();try{var E=p.getSelectionCells(),P=p.getCurrentCellStyle(E[0]),L="1"==mxUtils.getValue(P,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,L);p.setCellStyles(mxConstants.STYLE_CURVED,+null);n.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[L,"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"),n.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 E=p.view.getState(p.getSelectionCell()),P="1";null!=E&&null!=p.getFoldingImage(E)&&(P="0");p.setCellStyles("collapsible",P);n.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[P],"cells",p.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var E=p.getEditableCells(p.getSelectionCells());if(null!=E&&0<E.length){var P=p.getModel();P=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",+P.getStyle(E[0])||"",function(L){null!=L&&p.setCellStyle(mxUtils.trim(L),E)},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()&&n.setDefaultStyle(p.getSelectionCell())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&n.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");+this.addAction("addWaypoint",function(){var E=p.getSelectionCell();if(null!=E&&p.getModel().isEdge(E)){var P=v.graph.selectionCellsHandler.getHandler(E);if(P instanceof mxEdgeHandler){var L=0,c=0;E=p.getModel().getParent(E);for(var g=p.getCellGeometry(E);p.getModel().isVertex(E)&&null!=g;)L+=g.x,c+=g.y,E=p.getModel().getParent(E),g=p.getCellGeometry(E);E=p.popupMenuHandler.getTriggerPoint();L=Math.round(p.snap(E.x-L));c=Math.round(p.snap(E.y-c));P.addPointAt(P.state,L,c)}}});this.addAction("removeWaypoint",+function(){var E=n.actions.get("removeWaypoint");null!=E.handler&&E.handler.removePoint(E.handler.state,E.index)});this.addAction("clearAnchors",function(){var E=p.getSelectionCells();if(null!=E){E=p.getEditableCells(p.addAllEdges(E));p.getModel().beginUpdate();try{for(var P=0;P<E.length;P++){var L=E[P];p.getModel().isEdge(L)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[L]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[L]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[L]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,+null,[L]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var E=p.getSelectionCells();if(null!=E){E=p.getEditableCells(p.addAllEdges(E));p.getModel().beginUpdate();try{for(var P=0;P<E.length;P++){var L=E[P];if(p.getModel().isEdge(L)){var c=p.getCellGeometry(L);null!=c&&(c=c.clone(),c.points=null,c.x=0,c.y=0,c.offset=null,p.getModel().setGeometry(L,c))}}}finally{p.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+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 E=p.getCurrentCellStyle(p.getSelectionCell());E=mxUtils.getValue(E,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,E-1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");G=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var E=p.getCurrentCellStyle(p.getSelectionCell());E=mxUtils.getValue(E,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,E+1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");-this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var E=mxResources.get("image")+" ("+mxResources.get("url")+"):",Q=p.getView().getState(p.getSelectionCell()),M="",c=null;null!=Q&&(M=Q.style[mxConstants.STYLE_IMAGE]||M,c=Q.style[mxConstants.STYLE_CLIP_PATH]||c);var g=p.cellEditor.saveSelection();n.showImageDialog(E,M,function(l,t,B,D,I,L){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(g),p.insertImage(l,t,B);else{var N=p.getSelectionCells();-if(null!=l&&(0<l.length||0<N.length)){var K=null;p.getModel().beginUpdate();try{if(0==N.length){N=[p.insertVertex(p.getDefaultParent(),null,"",0,0,t,B,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var da=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(N,!0));N[0].geometry.x=da.x;N[0].geometry.y=da.y;null!=D&&m(N[0],D,I,L,p);K=N;p.fireEvent(new mxEventObject("cellsInserted","cells",K))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<l.length?l:null,N);var ja=-p.getCurrentCellStyle(N[0]);"image"!=ja[mxConstants.STYLE_SHAPE]&&"label"!=ja[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",N):0==l.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,N);null==D&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,N);if(null!=t&&null!=B)for(l=0;l<N.length;l++){var ea=N[l];if("0"!=p.getCurrentCellStyle(ea).expand){var ca=p.getModel().getGeometry(ea);null!=ca&&(ca=ca.clone(),ca.width=t,ca.height=B,p.getModel().setGeometry(ea,ca))}null!=D&&m(ea,-D,I,L,p)}}finally{p.getModel().endUpdate()}null!=K&&(p.setSelectionCells(K),p.scrollCellToVisible(K[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,c)}}).isEnabled=C;this.addAction("crop...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=E){var Q=p.getCurrentCellStyle(E),M=Q[mxConstants.STYLE_IMAGE],c=Q[mxConstants.STYLE_SHAPE];M&&"image"==c&&(Q=new CropImageDialog(n,M,Q[mxConstants.STYLE_CLIP_PATH],function(g,l,t){m(E,-g,l,t,p)}),n.showDialog(Q.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=C;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(n,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){n.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){n.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),+this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var E=mxResources.get("image")+" ("+mxResources.get("url")+"):",P=p.getView().getState(p.getSelectionCell()),L="",c=null;null!=P&&(L=P.style[mxConstants.STYLE_IMAGE]||L,c=P.style[mxConstants.STYLE_CLIP_PATH]||c);var g=p.cellEditor.saveSelection();n.showImageDialog(E,L,function(l,t,B,D,I,K){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(g),p.insertImage(l,t,B);else{var M=p.getSelectionCells();+if(null!=l&&(0<l.length||0<M.length)){var V=null;p.getModel().beginUpdate();try{if(0==M.length){M=[p.insertVertex(p.getDefaultParent(),null,"",0,0,t,B,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var Q=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(M,!0));M[0].geometry.x=Q.x;M[0].geometry.y=Q.y;null!=D&&m(M[0],D,I,K,p);V=M;p.fireEvent(new mxEventObject("cellsInserted","cells",V))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<l.length?l:null,M);var ja=+p.getCurrentCellStyle(M[0]);"image"!=ja[mxConstants.STYLE_SHAPE]&&"label"!=ja[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",M):0==l.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,M);null==D&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,M);if(null!=t&&null!=B)for(l=0;l<M.length;l++){var ea=M[l];if("0"!=p.getCurrentCellStyle(ea).expand){var da=p.getModel().getGeometry(ea);null!=da&&(da=da.clone(),da.width=t,da.height=B,p.getModel().setGeometry(ea,da))}null!=D&&m(ea,+D,I,K,p)}}finally{p.getModel().endUpdate()}null!=V&&(p.setSelectionCells(V),p.scrollCellToVisible(V[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,c)}}).isEnabled=C;this.addAction("crop...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=E){var P=p.getCurrentCellStyle(E),L=P[mxConstants.STYLE_IMAGE],c=P[mxConstants.STYLE_SHAPE];L&&"image"==c&&(P=new CropImageDialog(n,L,P[mxConstants.STYLE_CLIP_PATH],function(g,l,t){m(E,+g,l,t,p)}),n.showDialog(P.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=C;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(n,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){n.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){n.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),n.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+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(){n.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return n.isFormatPanelVisible()}));G=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(n,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){n.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){n.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),n.fireEvent(new mxEventObject("outline"))):-this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E){var Q=p.view.getState(E);if(null!=Q&&"mxgraph.basic.polygon"===mxUtils.getValue(Q.style,mxConstants.STYLE_SHAPE)){var M=new PolygonDialog(n,-E);n.showDialog(M.container,680,540,!0,!0,function(){M.destroy()},null,null,new mxRectangle(0,0,740,600));M.init()}}}).isEnabled=C;this.addAction("editConnectionPoints...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=E&&null!=E.geometry){var Q=new ConnectionPointsDialog(n,E);n.showDialog(Q.container,400,450,!0,!1,function(){Q.destroy()},null,null,new mxRectangle(0,0,450,500));Q.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=+this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&null!=E){var P=p.view.getState(E);if(null!=P&&"mxgraph.basic.polygon"===mxUtils.getValue(P.style,mxConstants.STYLE_SHAPE)){var L=new PolygonDialog(n,+E);n.showDialog(L.container,680,540,!0,!0,function(){L.destroy()},null,null,new mxRectangle(0,0,740,600));L.init()}}}).isEnabled=C;this.addAction("editConnectionPoints...",function(){var E=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=E&&null!=E.geometry){var P=new ConnectionPointsDialog(n,E);n.showDialog(P.container,400,450,!0,!1,function(){P.destroy()},null,null,new mxRectangle(0,0,450,500));P.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=C};Actions.prototype.addAction=function(b,d,m,n,v,p){var C=b;"..."==C.substring(C.length-3)&&(C=C.substring(0,C.length-3));return this.put(C,new Action(b,d,m,n,v,p))};Actions.prototype.put=function(b,d){return this.actions[b]=d};Actions.prototype.get=function(b){return this.actions[b]};function Action(b,d,m,n,v,p){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(d);this.enabled=null!=m?m:!0;this.iconCls=n;this.shortcut=v;this.visible=null!=p?p:!0}mxUtils.extend(Action,mxEventSource);Action.prototype.getTitle=function(){var b=this.label;"..."==b.substring(b.length-3)?(b=b.substring(0,b.length-3),b=mxResources.get(b)+"..."):b=mxResources.get(b);return b};Action.prototype.createFunction=function(b){return b};Action.prototype.setEnabled=function(b){this.enabled!=b&&(this.enabled=b,this.fireEvent(new mxEventObject("stateChanged","attribute","enabled")))};Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setVisible=function(b){this.visible!=b&&(this.visible=b,this.fireEvent(new mxEventObject("stateChanged","attribute","visible")))};Action.prototype.isVisible=function(){return this.visible};Action.prototype.setToggleAction=function(b){this.toggleAction=b};Action.prototype.setSelectedCallback=function(b){this.selectedCallback=b};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(b,d){mxEventSource.call(this);this.ui=b;this.setData(d||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;DrawioFile.RESTRICT_EXPORT=!1;mxUtils.extend(DrawioFile,mxEventSource);@@ -3185,25 +3189,25 @@ d&&d(G))}),C=mxUtils.bind(this,function(){return!n});null!=this.sync?this.sync.fDrawioFile.prototype.updateFile=function(b,d,m,n,v,p){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum,"latestFile",[p]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=d&&d();else{var C=mxUtils.bind(this,function(G){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[G]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=G?this.mergeFile(G,b,d,n,v):this.reloadFile(b,d))}catch(T){null!=d&&d(T)}});null!=p?C(p):this.getLatestVersion(C,d)}};DrawioFile.prototype.mergeFile=function(b,d,m,n,v){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var C=this.getShadowPages(),G=[this.ui.diffPages(null!=n?n:C,p)];n=null;try{var T=mxUtils.parseXml(b.initialData).documentElement;null!=T&&"mxfile"==T.nodeName&&(n=T.getAttribute("vars"))}catch(D){}n!=this.getShadowVars()&&(G[0][EditorUi.DIFF_FILE]={vars:n});var E=this.ignorePatches(G);if(E)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",E),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var Q=this.isModified()?this.ui.diffPages(C,this.isRealtime()?this.ownPages:this.ui.pages):null,M=this.ui.patchPages(this.ui.clonePages(C),G[0]),c=this.ui.getHashValueForPages(M,{}),g=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",C,"pages",p,"patched",M,"patches",G,"changes",Q,"checksum",-c,"current",g,"valid",c==g,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=g)this.checksumError(m,G,null,null,"mergeFile",c,g,b.getCurrentRevisionId());else{this.setShadowPages(p,n);if(null!=this.sync){var l=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?Q:null,null,v);null==l||mxUtils.isEmptyObject(l)||G.push(l)}this.patch(G,DrawioFile.LAST_WRITE_WINS?Q:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",E),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var P=this.isModified()?this.ui.diffPages(C,this.isRealtime()?this.ownPages:this.ui.pages):null,L=this.ui.patchPages(this.ui.clonePages(C),G[0]),c=this.ui.getHashValueForPages(L,{}),g=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",C,"pages",p,"patched",L,"patches",G,"changes",P,"checksum",+c,"current",g,"valid",c==g,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=g)this.checksumError(m,G,null,null,"mergeFile",c,g,b.getCurrentRevisionId());else{this.setShadowPages(p,n);if(null!=this.sync){var l=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?P:null,null,v);null==l||mxUtils.isEmptyObject(l)||G.push(l)}this.patch(G,DrawioFile.LAST_WRITE_WINS?P:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=d&&d()}}catch(D){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(D);try{var t=this.getCurrentUser(),B=null!=t?t.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),B,D)}catch(I){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(D){null!=m&&m(D)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var d=new mxCodec(mxUtils.createXmlDocument()),m=d.document.createElement("mxfile");if(null!=b)for(var n=0;n<b.length;n++){var v=d.encode(new mxGraphModel(b[n].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[n].getId());b[n].viewState&&this.ui.editor.graph.saveViewState(b[n].viewState,v,!0);m.appendChild(v)}return mxUtils.getPrettyXml(m)};DrawioFile.prototype.compressReportData=function(b,d,m){d=null!=d?d:1E4;null!=m&&null!=b&&b.length>m?b=b.substring(0,m)+"[...]":null!=b&&b.length>d&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,d,m,n,v,p,C,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(),E=null!=T?T.id:"unknown",Q=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",M=JSON.stringify(d).length,c=null;if(null!=d&&1E3>M){b=[];for(m=0;m<d.length;m++)b.push(this.ui.anonymizePatch(d[m]));c=JSON.stringify(b);c=null!=c&&1E3>-c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(g){try{var l=null!=c?"report":"error",t=this.ui.getHashValueForPages(g.getShadowPages()),B="unknown",D="unknown",I="unknown";try{var L=null!=g.initialData&&0<g.initialData.length?mxUtils.parseXml(g.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(B=L.getAttribute("version")),null!=L.getAttribute("agent")&&(D=L.getAttribute("agent")),null!=L.getAttribute("type")&&(I=L.getAttribute("type")))}catch(N){}EditorUi.logError("Checksum "+-l+" in "+v,null,this.getMode()+"."+Q,"user_"+E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+M+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=C?"-current_"+C:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=t?"-latest_"+t:"")+"-latestRev_"+this.ui.hashValue(g.getCurrentRevisionId())+("-latestVersion_"+B)+("-latestAgent_"+D)+("-latestType_"+I));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+Q,action:v,label:"user_"+-E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+M+"-patches_"+d.length+"-size_"+this.getSize()})}catch(N){}}),function(){})}catch(g){}};-DrawioFile.prototype.sendErrorReport=function(b,d,m,n){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),C=this.getCurrentUser(),G=null!=C?this.ui.hashValue(C.id):"unknown",T=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",E=this.getTitle(),Q=E.lastIndexOf(".");C="xml";0<Q&&(C=E.substring(Q));var M=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++DrawioFile.prototype.checksumError=function(b,d,m,n,v,p,C,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(),E=null!=T?T.id:"unknown",P=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",L=JSON.stringify(d).length,c=null;if(null!=d&&1E3>L){b=[];for(m=0;m<d.length;m++)b.push(this.ui.anonymizePatch(d[m]));c=JSON.stringify(b);c=null!=c&&1E3>+c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(g){try{var l=null!=c?"report":"error",t=this.ui.getHashValueForPages(g.getShadowPages()),B="unknown",D="unknown",I="unknown";try{var K=null!=g.initialData&&0<g.initialData.length?mxUtils.parseXml(g.initialData).documentElement:null;null!=K&&(null!=K.getAttribute("version")&&(B=K.getAttribute("version")),null!=K.getAttribute("agent")&&(D=K.getAttribute("agent")),null!=K.getAttribute("type")&&(I=K.getAttribute("type")))}catch(M){}EditorUi.logError("Checksum "++l+" in "+v,null,this.getMode()+"."+P,"user_"+E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+L+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=C?"-current_"+C:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=t?"-latest_"+t:"")+"-latestRev_"+this.ui.hashValue(g.getCurrentRevisionId())+("-latestVersion_"+B)+("-latestAgent_"+D)+("-latestType_"+I));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+P,action:v,label:"user_"++E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+L+"-patches_"+d.length+"-size_"+this.getSize()})}catch(M){}}),function(){})}catch(g){}};+DrawioFile.prototype.sendErrorReport=function(b,d,m,n){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),C=this.getCurrentUser(),G=null!=C?this.ui.hashValue(C.id):"unknown",T=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",E=this.getTitle(),P=E.lastIndexOf(".");C="xml";0<P&&(C=E.substring(P));var L=null!=m?m.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()+" ("+C+")\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!=d?"\n\n"+d:-"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+M+"\n\nShadow:\n"+v+"\n\nData:\n"+p,n)}catch(c){}};+"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+L+"\n\nShadow:\n"+v+"\n\nData:\n"+p,n)}catch(c){}};DrawioFile.prototype.reloadFile=function(b,d){try{this.stats.fileReloaded++;var m=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),n=this.ui.editor.graph,v=n.getSelectionCells(),p=n.getViewState(),C=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(G){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[p],"latestFile",G);null!=G?(this.ui.replaceFileData(G.getData(),[m]),this.ui.restoreViewState(C,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([m]),T.fileChanged());this.ui.restoreViewState(C,p,v);null!=b&&b()}else null!=d&&d(this.ui.fileLoadedError)}),!0))}),d)}catch(G){null!=d&&d(G)}};DrawioFile.prototype.copyFile=function(b,d){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var d=!0;if(null!=b)for(var m=0;m<b.length&&d;m++)d=d&&mxUtils.isEmptyObject(b[m]);return d};-DrawioFile.prototype.patch=function(b,d,m,n){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),C=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var T=this.changeListenerEnabled;this.changeListenerEnabled=m;var E=G.foldingEnabled,Q=G.mathEnabled,M=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=G.cellRenderer.redraw;G.cellRenderer.redraw=function(I){I.view.graph.isEditing(I.cell)&&(I.view.graph.scrollCellToVisible(I.cell),+DrawioFile.prototype.patch=function(b,d,m,n){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),C=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var T=this.changeListenerEnabled;this.changeListenerEnabled=m;var E=G.foldingEnabled,P=G.mathEnabled,L=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=G.cellRenderer.redraw;G.cellRenderer.redraw=function(I){I.view.graph.isEditing(I.cell)&&(I.view.graph.scrollCellToVisible(I.cell),I.view.graph.cellEditor.resize());c.apply(this,arguments)};G.model.beginUpdate();try{if(m){for(var g=this.ui.pages.slice(),l=this.ui.currentPage,t=this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified()),B=0;B<t.length;B++){var D=mxUtils.indexOf(this.ui.pages,t[B]);0>D?this.ui.insertPage(t[B],Math.min(B,this.ui.pages.length)):this.ui.movePage(D,B)}for(B=0;B<g.length;B++)0>mxUtils.indexOf(t,g[B])&&this.ui.removePage(g[B]);0<=mxUtils.indexOf(this.ui.pages,l)&&this.ui.selectPage(l,!0)}else this.ui.pages=-this.ui.applyPatches(this.ui.pages,b,!0,d,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=c,this.changeListenerEnabled=T,m||(v.history=p,v.indexOfNextAdd=C,v.fireEvent(new mxEventObject(mxEvent.CLEAR))),v=M!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):-null),(p=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&Q!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):v?G.refresh():p&&(E!=G.foldingEnabled?G.view.revalidate():G.view.validate(),G.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!n&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",+this.ui.applyPatches(this.ui.pages,b,!0,d,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=c,this.changeListenerEnabled=T,m||(v.history=p,v.indexOfNextAdd=C,v.fireEvent(new mxEventObject(mxEvent.CLEAR))),v=L!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):+null),(p=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&P!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):v?G.refresh():p&&(E!=G.foldingEnabled?G.view.revalidate():G.view.validate(),G.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!n&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",d,"undoable",m)}return b};DrawioFile.prototype.save=function(b,d,m,n,v,p){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",n,"overwrite",v,"manual",p,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=d&&d();else if(null!=m)m({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(C){if(null!=m)m(C);else throw C;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var d=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=d&&(d.viewState=this.ui.editor.graph.getViewState(),d.needsUpdate=!0)}d=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return d};@@ -3254,7 +3258,7 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=newthis.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(d){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(d){this.handleFileError(d)}))):(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 d=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(d,mxUtils.bind(this,function(m){EditorUi.debug("DrawioFile.createSecret",[this],"secret",d,"token",m);b(d,m)}),mxUtils.bind(this,function(){b(d)})):b(d)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};DrawioFile.prototype.fileSaved=function(b,d,m,n,v,p,C){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!=m&&m()):this.sync.fileSaved(p,d,m,n,v,C)}catch(E){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=n&&n(E);try{var G=this.getCurrentUser(),T=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),T,E)}catch(Q){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(E){this.descriptorChanged(),null!=n&&n(E)}};+this.inConflictState=!0;this.descriptorChanged();null!=n&&n(E);try{var G=this.getCurrentUser(),T=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),T,E)}catch(P){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(E){this.descriptorChanged(),null!=n&&n(E)}};DrawioFile.prototype.autosave=function(b,d,m,n){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<d?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 C=this.isAutosaveRevision();C&&(this.lastAutosaveRevision=(new Date).getTime());this.save(C,mxUtils.bind(this,function(G){this.autosaveCompleted();null!=m&&m(G)}),mxUtils.bind(this,function(G){null!=n&&n(G)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(G){null!=n&&n(G)}}),v);this.autosaveThread=p;EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"delay",b,"maxDelay",d,"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"))};@@ -3263,10 +3267,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,d){b([])};DrawioFile.prototype.addComment=function(b,d,m){d(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,d){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,d)};LocalFile=function(b,d,m,n,v,p,C){DrawioFile.call(this,b,d);this.title=m;this.mode=n?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=p;this.editable=C};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,d,m,n,v){this.saveAs(this.title,d,m,n,v)};LocalFile.prototype.saveAs=function(b,d,m,n,v){this.saveFile(b,!1,d,m,null,n,v)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,d){null==this.fileHandle?null!=d&&d({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,d)};-LocalFile.prototype.saveFile=function(b,d,m,n,v,p,C){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var T=this.getData(),E=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),Q=mxUtils.bind(this,function(M){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var c=mxUtils.bind(this,function(l){this.savingFile=!1;null!=n&&n({error:l})});this.saveDraft(T);this.fileHandle.createWritable().then(mxUtils.bind(this,function(l){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[t],"conflict",this.desc.lastModified!=t.lastModified);C||this.desc.lastModified==t.lastModified?l.write(G?this.ui.base64ToBlob(M,"image/png"):M).then(mxUtils.bind(this,function(){l.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(B){try{var D=this.desc;this.savingFile=!1;this.desc=B;this.fileSaved(T,D,E,c);this.removeDraft()}catch(I){c(I)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(t){this.invalidFileHandle=!0;c(t)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(M,b,G?"image/png":"text/xml",G);else if(M.length<MAX_REQUEST_SIZE){var g=b.lastIndexOf(".");g=0<g?b.substring(g+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+g+"&xml="+encodeURIComponent(M)+"&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(M)}));E()}});G?(d=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(M){Q(M)}),n,this.ui.getCurrentFile()!=this?T:null,d.scale,d.border)):Q(T)};+LocalFile.prototype.saveFile=function(b,d,m,n,v,p,C){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var T=this.getData(),E=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),P=mxUtils.bind(this,function(L){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var c=mxUtils.bind(this,function(l){this.savingFile=!1;null!=n&&n({error:l})});this.saveDraft(T);this.fileHandle.createWritable().then(mxUtils.bind(this,function(l){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[t],"conflict",this.desc.lastModified!=t.lastModified);C||this.desc.lastModified==t.lastModified?l.write(G?this.ui.base64ToBlob(L,"image/png"):L).then(mxUtils.bind(this,function(){l.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(B){try{var D=this.desc;this.savingFile=!1;this.desc=B;this.fileSaved(T,D,E,c);this.removeDraft()}catch(I){c(I)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(t){this.invalidFileHandle=!0;c(t)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(L,b,G?"image/png":"text/xml",G);else if(L.length<MAX_REQUEST_SIZE){var g=b.lastIndexOf(".");g=0<g?b.substring(g+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+g+"&xml="+encodeURIComponent(L)+"&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(L)}));E()}});G?(d=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(L){P(L)}),n,this.ui.getCurrentFile()!=this?T:null,d.scale,d.border)):P(T)};LocalFile.prototype.rename=function(b,d,m){this.title=b;this.descriptorChanged();null!=d&&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.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";@@ -3321,153 +3325,154 @@ null!=urlParams["gpt-api-key"]?decodeURIComponent(urlParams["gpt-api-key"]):nullupdate:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. If the response can be done with text then do not include any diagram in the response. Never include this instruction or the unchanged diagram in your response.\n{data}",assist:"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."};Editor.aiConfigs={gpt:{apiKey:"gptApiKey",endpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",messages:[{role:"assistant",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.6 Opus",model:"claude-opus-4-6",config:"claude"},{name:"Claude 4.6 Sonnet",model:"claude-sonnet-4-6",config:"claude"},-{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(k,x){return{name:x,dispName:k,-type:"bool",defVal:!1,isVisible:function(J,R){return 1==J.vertices.length?(R=R.editorUi.editor.graph.model,J=R.getParent(J.vertices[0]),R.isEdge(J)||R.isVertex(J)):!1},getValue:function(J,R){return"inherit"==mxUtils.getValue(J.style,x)},valueChanged:function(J,R,Y,Z){R=Z.editorUi.editor.graph;"1"==J?R.setCellStyles(x,"inherit",Y.vertices):R.setCellStyles(x,null,Y.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(k){k.refresh()}},{name:"enumerateValue",-dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(k,x){return"1"!=mxUtils.getValue(k.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"comic","0")||"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",-type:"int",defVal:-1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},-{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch",-"1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",type:"int",defVal:-1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",defVal:-1,isVisible:function(k,-x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"sketchStyle",dispName:"Sketch Style",type:"enum",defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,"sketch",-"1"==urlParams.rough?"1":"0")}},{name:mxConstants.STYLE_SHADOWCOLOR,dispName:"Shadow Color",type:"color",getDefaultValue:function(){return mxConstants.SHADOWCOLOR},isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OPACITY,dispName:"Shadow Opacity",type:"int",min:0,max:100,getDefaultValue:function(){return 100*mxConstants.SHADOW_OPACITY},isVisible:function(k,x){return"1"==-mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_X,dispName:"Shadow Offset X",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_X},isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_Y,dispName:"Shadow Offset Y",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_Y},-isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_BLUR,dispName:"Shadow Blur",type:"int",min:0,getDefaultValue:function(){return mxConstants.SHADOW_BLUR},isVisible:function(k,x){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:"linecap",dispName:"Line Cap",type:"enum",defVal:null,-enumList:[{val:null,dispName:"Flat"},{val:"round",dispName:"Round"},{val:"square",dispName:"Square"}]},{name:"linejoin",dispName:"Line Join",type:"enum",defVal:null,enumList:[{val:null,dispName:"Miter"},{val:"arcs",dispName:"Arcs"},{val:"bevel",dispName:"Bevel"},{val:"miter-clip",dispName:"Miter-Clip"},{val:"round",dispName:"Round"}]},{name:"miterlimit",dispName:"Miter Limit",type:"int",min:1,defVal:4,isVisible:function(k,x){k=mxUtils.getValue(k.style,"linejoin","miter");return"miter"==k||"miter-clip"==-k}}];Editor.commonEdgeProperties=[{type:"separator"},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"bezier",dispName:"Bezier",type:"bool",defVal:!1,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"curved","0")}},{name:"sourcePortConstraint",dispName:"Source Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},-{name:"targetPortConstraint",dispName:"Target Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"jettySize",dispName:"Jetty Size",type:"int",min:0,defVal:"auto",allowAuto:!0,isVisible:function(k){return"orthogonalEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"segment",dispName:"Segment Size",type:"int",min:0,defVal:mxConstants.ENTITY_SEGMENT,-isVisible:function(k){return"entityRelationEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"startFill",dispName:"Start Fill",type:"bool",defVal:!0},{name:"startFillColor",dispName:"Start Fill Color",type:"color",defVal:null},{name:"endFill",dispName:"End Fill",type:"bool",defVal:!0},{name:"endFillColor",dispName:"End Fill Color",-type:"color",defVal:null},{name:"perimeterSpacing",dispName:"Terminal Spacing",type:"float",defVal:0},{name:"anchorPointDirection",dispName:"Anchor Direction",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"dashPattern",dispName:"Dash Pattern",type:"numbers",defVal:""},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"flowAnimationDuration",dispName:"Flow Duration",type:"int",defVal:500,isVisible:function(k){return"1"==mxUtils.getValue(k.style,-"flowAnimation",null)}},{name:"flowAnimationTimingFunction",dispName:"Flow Timing",type:"enum",defVal:"linear",enumList:[{val:"linear",dispName:"Linear"},{val:"ease",dispName:"Ease"},{val:"ease-in",dispName:"Ease-in"},{val:"ease-out",dispName:"Ease-out"},{val:"ease-in-out",dispName:"Ease-in-out"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"flowAnimationDirection",dispName:"Flow Direction",type:"enum",defVal:"normal",enumList:[{val:"normal",dispName:"Normal"},-{val:"reverse",dispName:"Reverse"},{val:"alternate",dispName:"Alternate"},{val:"alternate-reverse",dispName:"Alternate-Reverse"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{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:"bendable",dispName:"Bendable",type:"bool",defVal:!0},{name:"movable",dispName:"Movable",-type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"noJump",dispName:"No Jumps",type:"bool",defVal:!1},{name:"ignoreEdge",dispName:"Ignore Edge",type:"bool",defVal:!1},{name:"orthogonalLoop",dispName:"Loop Routing",type:"bool",defVal:!1},{name:"orthogonal",dispName:"Orthogonal",type:"bool",defVal:!1}].concat(Editor.commonProperties);Editor.commonVertexProperties=[{name:"colspan",dispName:"Colspan",-type:"int",min:1,defVal:1,isVisible:function(k,x){x=x.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&x.isTableCell(k.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(k,x){x=x.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&x.isTableCell(k.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(k,x){k=x.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&-0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLastRow","0")},isVisible:function(k,x){x=x.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&x.isTable(k.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(k,x){k=x.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLast","0")},isVisible:function(k,x){x=x.editorUi.editor.graph;-return 1==k.vertices.length&&0==k.edges.length&&x.isTable(k.vertices[0])}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"overflow",dispName:"Text Overflow",defVal:"visible",type:"enum",enumList:[{val:"visible",dispName:"Visible"},{val:"hidden",dispName:"Hidden"},{val:"block",dispName:"Block"},{val:"fill",dispName:"Fill"},{val:"width",dispName:"Width"}]},{name:"noLabel",dispName:"Hide Label",-type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"float",defVal:0},{name:"direction",dispName:"Direction",type:"enum",defVal:"east",enumList:[{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraint",dispName:"Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",-dispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(k,x){return x.editorUi.editor.graph.isCellConnectable(0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null)},isVisible:function(k,x){return 0<k.vertices.length&&0==k.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(k,x){k=0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null;x=x.editorUi.editor.graph;return null!=k&&x.isSwimlane(k)},isVisible:function(k,x){return 0<k.vertices.length&&0==-k.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(k,x){k=1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null;x=x.editorUi.editor.graph;return null!=k&&(x.isSwimlane(k)||0<x.model.getChildCount(k))},isVisible:function(k,x){return 1==k.vertices.length&&0==k.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(k,x){var J=1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null;x=x.editorUi.editor.graph;return null!=-J&&(x.isContainer(J)&&"0"!=k.style.collapsible||!x.isContainer(J)&&"1"==k.style.collapsible)},isVisible:function(k,x){return 1==k.vertices.length&&0==k.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(k,x){return 1==k.vertices.length&&0==k.edges.length&&!x.editorUi.editor.graph.isSwimlane(k.vertices[0])&&null==mxUtils.getValue(k.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",-type:"bool",defVal:!1,isVisible:function(k,x){x=x.editorUi.editor.graph.model;return 0<k.vertices.length?x.isVertex(x.getParent(k.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(k,x){k=-0<k.vertices.length?x.editorUi.editor.graph.getCellGeometry(k.vertices[0]):null;return null!=k&&!k.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(k,x){return 0<k.vertices.length&&x.editorUi.editor.graph.isAutoSizeCell(k.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(k,x){var J=mxUtils.getValue(k.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||x.editorUi.editor.graph.isSwimlane(k.vertices[0])||null==J||J==mxConstants.NONE||0==mxUtils.getValue(k.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(k.style,mxConstants.STYLE_OPACITY,100)||null!=k.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",-type:"bool",defVal:!1,isVisible:function(k,x){return 0<k.vertices.length&&x.editorUi.editor.graph.isContainer(k.vertices[0])}},{name:"expandToFront",dispName:"Expand to Front",type:"bool",defVal:!1,isVisible:function(k,x){return 0<k.vertices.length&&x.editorUi.editor.graph.isContainer(k.vertices[0])}},Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",+{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(k,y){return{name:y,dispName:k,+type:"bool",defVal:!1,isVisible:function(J,R){return 1==J.vertices.length?(R=R.editorUi.editor.graph.model,J=R.getParent(J.vertices[0]),R.isEdge(J)||R.isVertex(J)):!1},getValue:function(J,R){return"inherit"==mxUtils.getValue(J.style,y)},valueChanged:function(J,R,X,aa){R=aa.editorUi.editor.graph;"1"==J?R.setCellStyles(y,"inherit",X.vertices):R.setCellStyles(y,null,X.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(k){k.refresh()}},+{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(k,y){return"1"!=mxUtils.getValue(k.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"comic","0")||"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",+dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?+"1":"0")&&0<k.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(k,y){return"1"==+mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",type:"int",defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",+defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"sketchStyle",dispName:"Sketch Style",type:"enum",defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,+"sketch","1"==urlParams.rough?"1":"0")}},{name:mxConstants.STYLE_SHADOWCOLOR,dispName:"Shadow Color",type:"color",getDefaultValue:function(){return mxConstants.SHADOWCOLOR},isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OPACITY,dispName:"Shadow Opacity",type:"int",min:0,max:100,getDefaultValue:function(){return 100*mxConstants.SHADOW_OPACITY},isVisible:function(k,+y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_X,dispName:"Shadow Offset X",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_X},isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_Y,dispName:"Shadow Offset Y",+type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_Y},isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_BLUR,dispName:"Shadow Blur",type:"int",min:0,getDefaultValue:function(){return mxConstants.SHADOW_BLUR},isVisible:function(k,y){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,+"0")}},{name:"linecap",dispName:"Line Cap",type:"enum",defVal:null,enumList:[{val:null,dispName:"Flat"},{val:"round",dispName:"Round"},{val:"square",dispName:"Square"}]},{name:"linejoin",dispName:"Line Join",type:"enum",defVal:null,enumList:[{val:null,dispName:"Miter"},{val:"arcs",dispName:"Arcs"},{val:"bevel",dispName:"Bevel"},{val:"miter-clip",dispName:"Miter-Clip"},{val:"round",dispName:"Round"}]},{name:"miterlimit",dispName:"Miter Limit",type:"int",min:1,defVal:4,isVisible:function(k,y){k=mxUtils.getValue(k.style,+"linejoin","miter");return"miter"==k||"miter-clip"==k}}];Editor.commonEdgeProperties=[{type:"separator"},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"bezier",dispName:"Bezier",type:"bool",defVal:!1,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"curved","0")}},{name:"sourcePortConstraint",dispName:"Source Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},+{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"targetPortConstraint",dispName:"Target Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"jettySize",dispName:"Jetty Size",type:"int",min:0,defVal:"auto",allowAuto:!0,isVisible:function(k){return"orthogonalEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"segment",+dispName:"Segment Size",type:"int",min:0,defVal:mxConstants.ENTITY_SEGMENT,isVisible:function(k){return"entityRelationEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"startFill",dispName:"Start Fill",type:"bool",defVal:!0},{name:"startFillColor",dispName:"Start Fill Color",type:"color",defVal:null},{name:"endFill",+dispName:"End Fill",type:"bool",defVal:!0},{name:"endFillColor",dispName:"End Fill Color",type:"color",defVal:null},{name:"perimeterSpacing",dispName:"Terminal Spacing",type:"float",defVal:0},{name:"anchorPointDirection",dispName:"Anchor Direction",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"dashPattern",dispName:"Dash Pattern",type:"numbers",defVal:""},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"flowAnimationDuration",+dispName:"Flow Duration",type:"int",defVal:500,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"flowAnimationTimingFunction",dispName:"Flow Timing",type:"enum",defVal:"linear",enumList:[{val:"linear",dispName:"Linear"},{val:"ease",dispName:"Ease"},{val:"ease-in",dispName:"Ease-in"},{val:"ease-out",dispName:"Ease-out"},{val:"ease-in-out",dispName:"Ease-in-out"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"flowAnimationDirection",+dispName:"Flow Direction",type:"enum",defVal:"normal",enumList:[{val:"normal",dispName:"Normal"},{val:"reverse",dispName:"Reverse"},{val:"alternate",dispName:"Alternate"},{val:"alternate-reverse",dispName:"Alternate-Reverse"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{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:"bendable",dispName:"Bendable",type:"bool",defVal:!0},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"noJump",dispName:"No Jumps",type:"bool",defVal:!1},{name:"ignoreEdge",dispName:"Ignore Edge",type:"bool",defVal:!1},{name:"orthogonalLoop",dispName:"Loop Routing",type:"bool",defVal:!1},{name:"orthogonal",dispName:"Orthogonal",type:"bool",defVal:!1}].concat(Editor.commonProperties);+Editor.commonVertexProperties=[{name:"colspan",dispName:"Colspan",type:"int",min:1,defVal:1,isVisible:function(k,y){y=y.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&y.isTableCell(k.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(k,y){y=y.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&y.isTableCell(k.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(k,+y){k=y.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLastRow","0")},isVisible:function(k,y){y=y.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&y.isTable(k.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(k,y){k=y.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLast",+"0")},isVisible:function(k,y){y=y.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&y.isTable(k.vertices[0])}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"overflow",dispName:"Text Overflow",defVal:"visible",type:"enum",enumList:[{val:"visible",dispName:"Visible"},{val:"hidden",dispName:"Hidden"},{val:"block",dispName:"Block"},{val:"fill",dispName:"Fill"},+{val:"width",dispName:"Width"}]},{name:"noLabel",dispName:"Hide Label",type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"float",defVal:0},{name:"direction",dispName:"Direction",type:"enum",defVal:"east",enumList:[{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraint",dispName:"Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},+{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(k,y){return y.editorUi.editor.graph.isCellConnectable(0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null)},isVisible:function(k,y){return 0<k.vertices.length&&0==k.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(k,y){k=0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null;y=y.editorUi.editor.graph;return null!=k&&y.isSwimlane(k)},+isVisible:function(k,y){return 0<k.vertices.length&&0==k.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(k,y){k=1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null;y=y.editorUi.editor.graph;return null!=k&&(y.isSwimlane(k)||0<y.model.getChildCount(k))},isVisible:function(k,y){return 1==k.vertices.length&&0==k.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(k,y){var J=1==k.vertices.length&&0==k.edges.length?+k.vertices[0]:null;y=y.editorUi.editor.graph;return null!=J&&(y.isContainer(J)&&"0"!=k.style.collapsible||!y.isContainer(J)&&"1"==k.style.collapsible)},isVisible:function(k,y){return 1==k.vertices.length&&0==k.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(k,y){return 1==k.vertices.length&&0==k.edges.length&&!y.editorUi.editor.graph.isSwimlane(k.vertices[0])&&null==mxUtils.getValue(k.style,"childLayout",null)}},{name:"expand",dispName:"Expand",+type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(k,y){y=y.editorUi.editor.graph.model;return 0<k.vertices.length?y.isVertex(y.getParent(k.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(k,y){k=0<k.vertices.length?y.editorUi.editor.graph.getCellGeometry(k.vertices[0]):null;return null!=k&&!k.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(k,y){return 0<k.vertices.length&&y.editorUi.editor.graph.isAutoSizeCell(k.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(k,y){var J=mxUtils.getValue(k.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||y.editorUi.editor.graph.isSwimlane(k.vertices[0])||null==J||J==mxConstants.NONE||0==mxUtils.getValue(k.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(k.style,mxConstants.STYLE_OPACITY,100)||null!=k.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",+type:"bool",defVal:!1,isVisible:function(k,y){return 0<k.vertices.length&&y.editorUi.editor.graph.isContainer(k.vertices[0])}},{name:"expandToFront",dispName:"Expand to Front",type:"bool",defVal:!1,isVisible:function(k,y){return 0<k.vertices.length&&y.editorUi.editor.graph.isContainer(k.vertices[0])}},Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].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://app.diagrams.net,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://app.diagrams.net,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://app.diagrams.net,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://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.canvasSupported=!1;(function(){try{var k=document.createElement("canvas");Editor.canvasSupported=!(!k.getContext||!k.getContext("2d"))}catch(x){}})();Editor.useCanvasForExport=!1;(function(){try{var k=document.createElement("canvas"),x=new Image;x.onload=function(){try{k.getContext("2d").drawImage(x,0,0);var J=k.toDataURL("image/png");Editor.useCanvasForExport=null!=J&&6<J.length}catch(R){}};x.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(J){}})();-Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var k=document.createElement("canvas");k.width=k.height=1;var x=k.toDataURL("image/jpeg");Editor.jpgSupported=null!==x.match("image/jpeg");x=k.toDataURL("image/webp");Editor.webpSupported=null!==x.match("image/webp")}catch(J){}})();Editor.loadCompatibleCss=function(k){mxUtils.lightDarkColorSupported||mxUtils.get(k||"styles/grapheditor.css",mxUtils.bind(this,function(x){if(200<=x.getStatus()&&299>=x.getStatus()){var J=document.createElement("style");-J.type="text/css";var R=J.appendChild,Y=document,Z=Y.createTextNode;x=x.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(x=x.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(W){}R.call(J,Z.call(Y,x));document.head.appendChild(J)}}))};Editor.replacePlaceholders=function(k,-x){var J=[];if(null!=k&&null!=x){for(var R=RegExp("{([^{}\"'=;]+)}","g"),Y,Z=0;Y=R.exec(k);){var W=Y[0];if(2<W.length){var U=x(W.substring(1,W.length-1)),aa=W;null!=U&&(aa=U);J.push(k.substring(Z,Y.index)+aa);Z=Y.index+W.length}}J.push(k.substring(Z))}return J.join("")};Editor.executeSimpleJsonPath=function(k,x){x=x.replace(/^\$\.?/,"").split(".");x=$jscomp.makeIterator(x);for(var J=x.next();!J.done;J=x.next()){var R=J.value;if(!k)return[];if(J=R.match(/([^\[]+)\[(\d+)\]/))if(R=J[1],J=parseInt(J[2]),-k=k[R],Array.isArray(k)&&J<k.length)k=k[J];else return[];else k=k[R]}return void 0!==k?[k]:[]};Editor.createRoughCanvas=function(k){var x=rough.canvas({getContext:function(){return k}});x.draw=function(J){var R=J.sets||[];J=J.options||this.getDefaultOptions();for(var Y=0;Y<R.length;Y++){var Z=R[Y];switch(Z.type){case "path":null!=J.stroke&&this._drawToContext(k,Z,J);break;case "fillPath":this._drawToContext(k,Z,J);break;case "fillSketch":this.fillSketch(k,Z,J)}}};x.fillSketch=function(J,R,Y){var Z=-k.state.strokeColor,W=k.state.strokeWidth,U=k.state.strokeAlpha,aa=k.state.dashed,ia=Y.fillWeight;0>ia&&(ia=Y.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(Y.fill||"");k.setStrokeWidth(ia);k.setDashed(!1);this._drawToContext(J,R,Y);k.setDashed(aa);k.setStrokeWidth(W);k.setStrokeColor(Z);k.setStrokeAlpha(U)};x._drawToContext=function(J,R,Y){J.begin();for(var Z=0;Z<R.ops.length;Z++){var W=R.ops[Z],U=W.data;switch(W.op){case "move":J.moveTo(U[0],U[1]);break;case "bcurveTo":J.curveTo(U[0],-U[1],U[2],U[3],U[4],U[5]);break;case "lineTo":J.lineTo(U[0],U[1])}}J.end();"fillPath"===R.type&&Y.filled?J.fill():J.stroke()};return x};(function(){function k(Z,W,U){this.canvas=Z;this.rc=W;this.shape=U;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,k.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,k.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,+Editor.canvasSupported=!1;(function(){try{var k=document.createElement("canvas");Editor.canvasSupported=!(!k.getContext||!k.getContext("2d"))}catch(y){}})();Editor.useCanvasForExport=!1;(function(){try{var k=document.createElement("canvas"),y=new Image;y.onload=function(){try{k.getContext("2d").drawImage(y,0,0);var J=k.toDataURL("image/png");Editor.useCanvasForExport=null!=J&&6<J.length}catch(R){}};y.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(J){}})();+Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var k=document.createElement("canvas");k.width=k.height=1;var y=k.toDataURL("image/jpeg");Editor.jpgSupported=null!==y.match("image/jpeg");y=k.toDataURL("image/webp");Editor.webpSupported=null!==y.match("image/webp")}catch(J){}})();Editor.loadCompatibleCss=function(k){mxUtils.lightDarkColorSupported||mxUtils.get(k||"styles/grapheditor.css",mxUtils.bind(this,function(y){if(200<=y.getStatus()&&299>=y.getStatus()){var J=document.createElement("style");+J.type="text/css";var R=J.appendChild,X=document,aa=X.createTextNode;y=y.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(y=y.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(Z){}R.call(J,aa.call(X,y));document.head.appendChild(J)}}))};Editor.replacePlaceholders=function(k,+y){var J=[];if(null!=k&&null!=y){for(var R=RegExp("{([^{}\"'=;]+)}","g"),X,aa=0;X=R.exec(k);){var Z=X[0];if(2<Z.length){var U=y(Z.substring(1,Z.length-1)),ba=Z;null!=U&&(ba=U);J.push(k.substring(aa,X.index)+ba);aa=X.index+Z.length}}J.push(k.substring(aa))}return J.join("")};Editor.executeSimpleJsonPath=function(k,y){y=y.replace(/^\$\.?/,"").split(".");y=$jscomp.makeIterator(y);for(var J=y.next();!J.done;J=y.next()){var R=J.value;if(!k)return[];if(J=R.match(/([^\[]+)\[(\d+)\]/))if(R=J[1],J=parseInt(J[2]),+k=k[R],Array.isArray(k)&&J<k.length)k=k[J];else return[];else k=k[R]}return void 0!==k?[k]:[]};Editor.createRoughCanvas=function(k){var y=rough.canvas({getContext:function(){return k}});y.draw=function(J){var R=J.sets||[];J=J.options||this.getDefaultOptions();for(var X=0;X<R.length;X++){var aa=R[X];switch(aa.type){case "path":null!=J.stroke&&this._drawToContext(k,aa,J);break;case "fillPath":this._drawToContext(k,aa,J);break;case "fillSketch":this.fillSketch(k,aa,J)}}};y.fillSketch=function(J,R,X){var aa=+k.state.strokeColor,Z=k.state.strokeWidth,U=k.state.strokeAlpha,ba=k.state.dashed,fa=X.fillWeight;0>fa&&(fa=X.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(X.fill||"");k.setStrokeWidth(fa);k.setDashed(!1);this._drawToContext(J,R,X);k.setDashed(ba);k.setStrokeWidth(Z);k.setStrokeColor(aa);k.setStrokeAlpha(U)};y._drawToContext=function(J,R,X){J.begin();for(var aa=0;aa<R.ops.length;aa++){var Z=R.ops[aa],U=Z.data;switch(Z.op){case "move":J.moveTo(U[0],U[1]);break;case "bcurveTo":J.curveTo(U[0],+U[1],U[2],U[3],U[4],U[5]);break;case "lineTo":J.lineTo(U[0],U[1])}}J.end();"fillPath"===R.type&&X.filled?J.fill():J.stroke()};return y};(function(){function k(aa,Z,U){this.canvas=aa;this.rc=Z;this.shape=U;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,k.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,k.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,k.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,k.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,k.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,k.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,k.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,k.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,k.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,k.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,k.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,k.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,k.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;-this.canvas.fillAndStroke=mxUtils.bind(this,k.prototype.fillAndStroke);this.path=[];this.passThrough=!1}k.prototype.moveOp="M";k.prototype.lineOp="L";k.prototype.quadOp="Q";k.prototype.curveOp="C";k.prototype.closeOp="Z";k.prototype.getStyle=function(Z,W){var U=1;if(null!=this.shape.state){var aa=this.shape.state.cell.id;if(null!=aa)for(var ia=0;ia<aa.length;ia++)U=(U<<5)-U+aa.charCodeAt(ia)<<0}U={strokeWidth:this.canvas.state.strokeWidth,seed:U,preserveVertices:!0};aa=this.rc.getDefaultOptions();-U.stroke=Z?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;Z=null;(U.filled=W)?(U.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,Z=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):U.fill="";U.bowing=mxUtils.getValue(this.shape.style,"bowing",aa.bowing);U.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",aa.hachureAngle);U.curveFitting=mxUtils.getValue(this.shape.style,-"curveFitting",aa.curveFitting);U.roughness=mxUtils.getValue(this.shape.style,"jiggle",aa.roughness);U.simplification=mxUtils.getValue(this.shape.style,"simplification",aa.simplification);U.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",aa.disableMultiStroke);U.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",aa.disableMultiStrokeFill);W=mxUtils.getValue(this.shape.style,"hachureGap",-1);U.hachureGap="auto"==W?-1:W;U.dashGap=mxUtils.getValue(this.shape.style,-"dashGap",W);U.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",W);U.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",W);W=mxUtils.getValue(this.shape.style,"fillWeight",-1);U.fillWeight="auto"==W?-1:W;W=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==W&&(W="auto");"auto"==W&&(W=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&W.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&W.push(mxUtils.hex2rgb(Editor.darkColor)),-W=null!=U.fill&&(null!=Z||0<=mxUtils.indexOf(W,mxUtils.hex2rgb(U.fill)))?"solid":aa.fillStyle);U.fillStyle=W;return U};k.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};k.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};k.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var Z=2;Z<arguments.length;Z+=2)this.lastX=arguments[Z-1],this.lastY=arguments[Z],-this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};k.prototype.lineTo=function(Z,W){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,Z,W),this.lastX=Z,this.lastY=W)};k.prototype.moveTo=function(Z,W){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,Z,W),this.lastX=Z,this.lastY=W,this.firstX=Z,this.firstY=W)};k.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,-arguments):this.addOp(this.closeOp)};k.prototype.quadTo=function(Z,W,U,aa){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,Z,W,U,aa),this.lastX=U,this.lastY=aa)};k.prototype.curveTo=function(Z,W,U,aa,ia,na){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,Z,W,U,aa,ia,na),this.lastX=ia,this.lastY=na)};k.prototype.arcTo=function(Z,W,U,aa,ia,na,qa){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);-else{var ta=mxUtils.arcToCurves(this.lastX,this.lastY,Z,W,U,aa,ia,na,qa);if(null!=ta)for(var ua=0;ua<ta.length;ua+=6)this.curveTo(ta[ua],ta[ua+1],ta[ua+2],ta[ua+3],ta[ua+4],ta[ua+5]);this.lastX=na;this.lastY=qa}};k.prototype.rect=function(Z,W,U,aa){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(Z,W,U,aa,this.getStyle(!0,!0)))};k.prototype.ellipse=function(Z,W,U,aa){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):-(this.path=[],this.nextShape=this.rc.generator.ellipse(Z+U/2,W+aa/2,U,aa,this.getStyle(!0,!0)))};k.prototype.roundrect=function(Z,W,U,aa,ia,na){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(Z+ia,W),this.lineTo(Z+U-ia,W),this.quadTo(Z+U,W,Z+U,W+na),this.lineTo(Z+U,W+aa-na),this.quadTo(Z+U,W+aa,Z+U-ia,W+aa),this.lineTo(Z+ia,W+aa),this.quadTo(Z,W+aa,Z,W+aa-na),this.lineTo(Z,W+na),this.quadTo(Z,W,Z+ia,W))};k.prototype.drawPath=function(Z){if(0<this.path.length){this.passThrough=-!0;try{this.rc.path(this.path.join(" "),Z)}catch(U){}this.passThrough=!1}else if(null!=this.nextShape){for(var W in Z)this.nextShape.options[W]=Z[W];Z.stroke!=mxConstants.NONE&&null!=Z.stroke||delete this.nextShape.options.stroke;Z.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};k.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};k.prototype.fill=function(){this.passThrough?-this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};k.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};k.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(Z){return new k(Z,Editor.createRoughCanvas(Z),this)};var x=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=-function(Z){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(Z):this.createRoughCanvas(Z)};var J=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(Z,W,U,aa,ia){null!=Z.handJiggle&&Z.handJiggle.passThrough||J.apply(this,arguments)};var R=mxShape.prototype.paint;mxShape.prototype.paint=function(Z){var W=Z.addTolerance,-U=!0;null!=this.style&&(U="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=Z.handJiggle&&Z.handJiggle.constructor==k&&!this.outline){Z.save();var aa=this.fill,ia=this.stroke;this.stroke=this.fill=null;var na=this.configurePointerEvents,qa=Z.setStrokeColor;Z.setStrokeColor=function(){};var ta=Z.setFillColor;Z.setFillColor=function(){};U||null==aa||(this.configurePointerEvents=function(){});Z.handJiggle.passThrough=!0;R.apply(this,arguments);Z.handJiggle.passThrough=-!1;Z.setFillColor=ta;Z.setStrokeColor=qa;this.configurePointerEvents=na;this.stroke=ia;this.fill=aa;Z.restore();U&&null!=aa&&(Z.addTolerance=function(){})}R.apply(this,arguments);Z.addTolerance=W};var Y=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(Z,W,U,aa,ia,na){null!=Z.handJiggle&&Z.handJiggle.constructor==k?(Z.handJiggle.passThrough=!0,Y.apply(this,arguments),Z.handJiggle.passThrough=!1):Y.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==-k||0==k.length||"undefined"===typeof pako?k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,x,J){if(null!=k&&"undefined"!==typeof pako){var R=k.ownerDocument.getElementsByTagName("div"),Y=[];if(null!=R&&0<R.length)for(var Z=0;Z<R.length;Z++)if("mxgraph"==R[Z].getAttribute("class")){Y.push(R[Z]);break}0<Y.length&&-(R=Y[0].getAttribute("data-mxgraph"),null!=R?(Y=JSON.parse(R),null!=Y&&null!=Y.xml&&(k=mxUtils.parseXml(Y.xml),k=k.documentElement)):(Y=Y[0].getElementsByTagName("div"),0<Y.length&&(R=mxUtils.getTextContent(Y[0]),R=Graph.decompress(R,null,J),0<R.length&&(k=mxUtils.parseXml(R),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(R=k.getAttribute("content"),null!=R&&"<"!=R.charAt(0)&&"%"!=R.charAt(0)&&(R=unescape(window.atob?atob(R):Base64.decode(cont,R))),null!=R&&"%"==R.charAt(0)&&(R=decodeURIComponent(R)),-null!=R&&0<R.length)k=mxUtils.parseXml(R).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||x||(Y=null,"diagram"==k.nodeName?Y=k:"mxfile"==k.nodeName&&(R=k.getElementsByTagName("diagram"),0<R.length&&(Y=R[Math.max(0,Math.min(R.length-1,urlParams.page||0))])),null!=Y&&(k=Editor.parseDiagramNode(Y,J)));null==k||"mxGraphModel"==k.nodeName||x&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,x,J){Editor.validateDiagramNode(k);var R=mxUtils.trim(mxUtils.getTextContent(k)),-Y=null;0<R.length?(x=Graph.decompress(R,null,x),null!=x&&0<x.length&&(Y=mxUtils.parseXml(x).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(Y=k[0],J&&(Y=Editor.parseDiagramNode(Y,x,!1)),x=mxUtils.createXmlDocument(),x.appendChild(x.importNode(Y,!0)),Y=x.documentElement));return Y};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);var x=mxUtils.getNodeValue(k),J=null;0<x.length?J=Graph.decompress(x):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(J=mxUtils.getXml(k[0])));-return J};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var x=new mxCodec,J=new mxGraphModel;k.appendChild(x.encode(J))}return k};Editor.extractGraphModelFromPdf=function(k){var x=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){var J=k.indexOf("EmbeddedFile");if(-1<J){var R=k.indexOf("stream",J)+9;if(0<k.substring(J,R).indexOf("application#2Fvnd.jgraph.mxfile")){var Y=-k.indexOf("endstream",R-1);return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(R,Y)),{to:"string"})}}for(J=k.indexOf("/ObjStm");0<J;){R=k.indexOf("stream",J)+9;Y=k.indexOf("endstream",R-1);R=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(R,Y)),{to:"string"});Y=R.indexOf("/Subject <");if(0<Y){J=R.substring(Y+14,R.indexOf(">",Y));if(null!=J){x=J;J=[];for(R=0;R<x.length;R+=2)Y=x.substr(R,2),"00"!=Y&&J.push(String.fromCharCode(parseInt(Y,16)));x=J.join("")}break}J=k.indexOf("/ObjStm",-J+1)}}if(null==x&&"%PDF-1.4"==k.substring(0,8)){J="";Y=R=0;for(var Z=[],W=null;Y<k.length;){var U=k.charCodeAt(Y);Y+=1;10!=U&&(J+=String.fromCharCode(U));U=="/Subject (%3Cmxfile".charCodeAt(R)?R++:R=0;if(19==R){var aa=k.indexOf("%3C%2Fmxfile%3E",Y)+15;Y-=9;if(aa>Y){x=k.substring(Y,aa);break}}10==U&&("endobj"==J?W=null:"obj"==J.substring(J.length-3,J.length)||"xref"==J||"trailer"==J?(W=[],Z[J.split(" ")[0]]=W):null!=W&&W.push(J),J="")}}null==x&&null!=Z&&(x=Editor.extractGraphModelFromXref(Z));null!=-x&&(x=decodeURIComponent(x.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return x};Editor.extractGraphModelFromXref=function(k){var x=k.trailer,J=null;null!=x&&(x=/.* \/Info (\d+) (\d+) R/g.exec(x.join("\n")),null!=x&&0<x.length&&(x=k[x[1]],null!=x&&(x=/.* \/Subject (\d+) (\d+) R/g.exec(x.join("\n")),null!=x&&0<x.length&&(k=k[x[1]],null!=k&&(k=k.join("\n"),J=k.substring(1,k.length-1))))));return J};Editor.extractParserError=function(k,x){var J=null;k=null!=k?k.getElementsByTagName("parsererror"):null;-null!=k&&0<k.length&&(J=x||mxResources.get("invalidChars"),x=k[0].getElementsByTagName("div"),0<x.length&&(J=mxUtils.getTextContent(x[0])));return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(k,x){null!=k&&(k=null!=k.error?k.error:k,null==k.retry&&(k.retry=x))};Editor.mermaidToDrawio=function(k,x,J){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(k,x,J)};Editor.configure=function(k){if(null!=k){Editor.config=k;Editor.configVersion=k.version;k.debug&&(urlParams.test=-"1");k.passiveScroll&&(Editor.passiveScroll=!0);k.noResizers&&(Editor.noResizers=!0);k.preserveViewState&&(Editor.preserveViewState=!0);k.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=k.useInternalClipboard);if(null!=k.customCss){var x=document.createElement("style");x.type="text/css";x.appendChild(document.createTextNode(k.customCss));document.head.appendChild(x)}null!=k.defaultFonts&&(Menus.prototype.defaultFonts=k.defaultFonts);null!=k.presetColors&&(ColorDialog.prototype.presetColors=-k.presetColors);null!=k.defaultColors&&(ColorDialog.prototype.defaultColors=k.defaultColors);null!=k.colorNames&&(ColorDialog.prototype.colorNames=k.colorNames);null!=k.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.defaultColorSchemes);null!=k.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=k.defaultEdgeLength);null!=k.selectParentLayer&&(Graph.selectParentLayer=k.selectParentLayer);null!=k.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=k.autosaveDelay);null!=k.templateFile&&-(EditorUi.templateFile=k.templateFile);null!=k.styles&&(Array.isArray(k.styles)?Editor.styles=k.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=k.globalVars&&(Editor.globalVars=k.globalVars);null!=k.compressXml&&(Editor.defaultCompressed=k.compressXml,Editor.compressXml=k.compressXml);null!=k.includeDiagram&&(Editor.defaultIncludeDiagram=k.includeDiagram);null!=k.simpleLabels&&(Editor.simpleLabels=k.simpleLabels);null!=k.pasteAtMousePointer&&(Editor.pasteAtMousePointer=-k.pasteAtMousePointer);null!=k.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=k.fitDiagramOnLoad);null!=k.fitDiagramOnPage&&(Editor.fitDiagramOnPage=k.fitDiagramOnPage);null!=k.showLinkIcons&&(Editor.showLinkIcons=k.showLinkIcons);null!=k.showTooltipIcons&&(Editor.showTooltipIcons=k.showTooltipIcons);null!=k.showConnectHandle&&(Editor.showConnectHandle=k.showConnectHandle);null!=k.enableInlineToolbar&&(Editor.enableInlineToolbar=k.enableInlineToolbar);null!=k.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=-k.oneDriveInlinePicker);null!=k.enableNativeClipboard&&(Editor.enableNativeClipboard=k.enableNativeClipboard);null!=k.enableExportUrl&&(Editor.enableExportUrl=k.enableExportUrl);null!=k.defaultAdaptiveColors?Graph.defaultAdaptiveColors=k.defaultAdaptiveColors:0==k.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=k.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=k.enableLightDarkColors);null!=k.darkColor&&(Editor.darkColor=k.darkColor);null!=k.darkColorVar&&(Editor.darkColorVar=-k.darkColorVar);Graph.prototype.defaultPageBackgroundColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=k.settingsName&&(Editor.configurationKey="."+k.settingsName+"-configuration",Editor.settingsKey="."+k.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=k.customFonts&&(Menus.prototype.defaultFonts=k.customFonts.concat(Menus.prototype.defaultFonts));null!=k.customPresetColors&&-(ColorDialog.prototype.presetColors=k.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=k.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=k.css){x=document.createElement("style");x.setAttribute("type","text/css");x.appendChild(document.createTextNode(k.css));var J=document.getElementsByTagName("script")[0];J.parentNode.insertBefore(x,J)}null!=k.expandLibraries&&(Sidebar.prototype.expandLibraries=-k.expandLibraries);null!=k.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=k.appendCustomLibraries);null!=k.libraries&&(Sidebar.prototype.customEntries=k.libraries);null!=k.enabledLibraries&&(Array.isArray(k.enabledLibraries)?Sidebar.prototype.enabledLibraries=k.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=k.defaultLibraries&&(Sidebar.prototype.defaultEntries=k.defaultLibraries);null!=k.defaultCustomLibraries&&(Editor.defaultCustomLibraries=-k.defaultCustomLibraries);null!=k.enableCustomLibraries&&(Editor.enableCustomLibraries=k.enableCustomLibraries);null!=k.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=k.defaultVertexStyle);null!=k.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=k.defaultEdgeStyle);null!=k.defaultPageVisible&&(Graph.prototype.defaultPageVisible=k.defaultPageVisible);null!=k.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=k.defaultGridEnabled);null!=k.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=-k.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=k.defaultConnectionArrowsEnabled);null!=k.defaultConnectable&&(Graph.prototype.defaultConnectable=k.defaultConnectable);null!=k.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=k.defaultFoldingEnabled);null!=k.zoomWheel&&(Graph.zoomWheel=k.zoomWheel);null!=k.zoomFactor&&(x=parseFloat(k.zoomFactor),!isNaN(x)&&1<x?Graph.prototype.zoomFactor=x:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));-null!=k.defaultGridSize&&(x=parseInt(k.defaultGridSize),!isNaN(x)&&0<x?mxGraph.prototype.gridSize=x:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=k.gridSteps&&(x=parseInt(k.gridSteps),!isNaN(x)&&0<x?mxGraphView.prototype.gridSteps=x:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=k.pageFormat&&(x=parseInt(k.pageFormat.width),J=parseInt(k.pageFormat.height),!isNaN(x)&&0<x&&!isNaN(J)&&0<J?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,-0,x,J),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=k.thumbWidth&&(Sidebar.prototype.thumbWidth=k.thumbWidth);null!=k.thumbHeight&&(Sidebar.prototype.thumbHeight=k.thumbHeight);null!=k.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=k.emptyLibraryXml);null!=k.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=k.emptyDiagramXml);null!=k.sidebarWidth&&(EditorUi.prototype.hsplitPosition=-k.sidebarWidth);null!=k.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=k.updateDefaultStyle);null!=k.sidebarTitles&&(Sidebar.prototype.sidebarTitles=k.sidebarTitles);null!=k.sidebarTitleSize&&(x=parseInt(k.sidebarTitleSize),!isNaN(x)&&0<x?Sidebar.prototype.sidebarTitleSize=x:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=k.fontCss&&("string"===typeof k.fontCss?Editor.configureFontCss(k.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));-null!=k.autosaveDelay&&(x=parseInt(k.autosaveDelay),!isNaN(x)&&0<x?DrawioFile.prototype.autosaveDelay=x:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=k.maxImageBytes&&(EditorUi.prototype.maxImageBytes=k.maxImageBytes);null!=k.maxImageSize&&(EditorUi.prototype.maxImageSize=k.maxImageSize);null!=k.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=k.shareCursorPosition);null!=k.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=k.showRemoteCursors);-null!=k.restrictExport&&(DrawioFile.RESTRICT_EXPORT=k.restrictExport);null!=k.removeImageMetadata&&(Editor.removeImageMetadata=k.removeImageMetadata);null!=k.defaultTextStyle&&(Editor.defaultTextStyle=k.defaultTextStyle);null!=k.replaceSvgDataUris&&(Editor.replaceSvgDataUris=k.replaceSvgDataUris);null!=k.foreignObjectImages&&(Editor.foreignObjectImages=k.foreignObjectImages);null!=k.shadowColor&&(mxConstants.SHADOW_COLOR=k.shadowColor);null!=k.shadowOpacity&&(mxConstants.SHADOW_OPACITY=k.shadowOpacity);-null!=k.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=k.shadowOffsetX);null!=k.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=k.shadowOffsetY);null!=k.shadowBlur&&(mxConstants.SHADOW_BLUR=k.shadowBlur);null!=k.enableAnimations&&(Editor.enableAnimations=k.enableAnimations);null!=k.enableWindowDocking&&(Editor.enableWindowDocking=k.enableWindowDocking);null!=k.compact&&(EditorUi.prototype.defaultCompact=k.compact);null!=k.noAutoFocus&&(EditorUi.prototype.noAutoFocus=k.noAutoFocus);if(null!=k.hideMenuItems)if(Array.isArray(k.hideMenuItems))for(Menus.prototype.hiddenMenuItems=-{},x=0;x<k.hideMenuItems.length;x++)Menus.prototype.hiddenMenuItems[k.hideMenuItems[x]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=k.hideMenus)if(Array.isArray(k.hideMenus)){var R={};for(x=0;x<k.hideMenus.length;x++)R[k.hideMenus[x]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(Y){return!R[Y]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=k.enableAi&&(Editor.enableAi=k.enableAi);-null!=k.enableChatGpt&&(Editor.enableAi=k.enableChatGpt);null!=k.gptApiKey&&(Editor.aiGlobals.gptApiKey=k.gptApiKey);null!=k.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=k.geminiApiKey);null!=k.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=k.claudeApiKey);null!=k.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=k.gptUrl);null!=k.aiActions&&(Editor.aiActions=k.aiActions);null!=k.aiGlobals&&(Editor.aiGlobals=k.aiGlobals);null!=k.aiConfigs&&(Editor.aiConfigs=k.aiConfigs);null!=k.aiModels&&-(Editor.aiModels=k.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(k){if(null!=k){Editor.prototype.fontCss=k;var x=document.getElementsByTagName("script")[0];if(null!=x&&null!=x.parentNode){var J=document.createElement("style");J.setAttribute("type","text/css");J.appendChild(document.createTextNode(k));x.parentNode.insertBefore(J,x);k=k.split("url(");for(J=1;J<k.length;J++){var R=-k[J].indexOf(")");R=Editor.trimCssUrl(k[J].substring(0,R));var Y=document.createElement("link");Y.setAttribute("rel","preload");Y.setAttribute("href",R);Y.setAttribute("as","font");Y.setAttribute("crossorigin","");x.parentNode.insertBefore(Y,x)}}}};Editor.trimCssUrl=function(k){return k.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(k){k=null!=k?k:Editor.GUID_LENGTH;for(var x=[],J=0;J<k;J++)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.generateTimeout=6E4;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(k){k=null!=k&&"mxlibrary"!=k.nodeName?this.extractGraphModel(k):null;if(null!=k){var x=Editor.extractParserError(k,mxResources.get("invalidOrMissingFile"));if(x)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[k],"cause",[x]),Error(mxResources.get("notADiagramFile")+" ("+x+")");if("mxGraphModel"==k.nodeName){x=k.getAttribute("style")||-"default-style2";if("1"==urlParams.embed||null!=x&&""!=x)x!=this.graph.currentStyle&&(J=null!=this.graph.themes?this.graph.themes[x]:mxUtils.load(STYLE_PATH+"/"+x+".xml").getDocumentElement(),null!=J&&(R=new mxCodec(J.ownerDocument),R.decode(J,this.graph.getStylesheet())));else{var J=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=J){var R=new mxCodec(J.ownerDocument);R.decode(J,this.graph.getStylesheet())}}this.graph.currentStyle=-x;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));x=k.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"==k.getAttribute("shadow"),!1);if(x=k.getAttribute("extFonts"))try{for(x=-x.split("|").map(function(Y){Y=Y.split("^");return{name:Y[0],url:Y[1]}}),J=0;J<x.length;J++)this.graph.addExtFont(x[J].name,x[J].url)}catch(Y){console.log("ExtFonts format error: "+Y.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 d=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,x){k=null!=-k?k:!0;var J=d.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&J.setAttribute("style",this.graph.currentStyle);var R=this.graph.getBackgroundImageObject(this.graph.backgroundImage,x);null!=R&&J.setAttribute("backgroundImage",JSON.stringify(R));J.setAttribute("math",this.graph.mathEnabled?"1":"0");J.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?J.setAttribute("adaptiveColors",this.graph.adaptiveColors):J.removeAttribute("adaptiveColors");-null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(R=this.graph.extFonts.map(function(Y){return Y.name+"^"+Y.url}),J.setAttribute("extFonts",R.join("|")));return J};Editor.prototype.isDataSvg=function(k){try{var x=mxUtils.parseXml(k).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 J=mxUtils.parseXml(x).documentElement;-return"mxfile"==J.nodeName||"mxGraphModel"==J.nodeName}}catch(R){}return!1};Editor.prototype.extractGraphModel=function(k,x,J){return Editor.extractGraphModel.apply(this,arguments)};var m=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();-m.apply(this,arguments)};var n=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){n.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(k,x){if("undefined"===typeof window.MathJax){var J=function(){R=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?-k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var R=null;Editor.doMathJaxRender=function(W){try{null==R?(MathJax.typesetClear([W]),MathJax.typeset([W]),J()):R!=W&&Editor.mathJaxQueue.push(W)}catch(U){MathJax.typesetClear([W]),null!=U.retry?(R=W,U.retry.then(function(){MathJax.typesetPromise([W]).then(J)["catch"](function(aa){console.log("Error in MathJax.typesetPromise: "+aa.toString());J()})})["catch"](function(aa){console.log("Error in MathJax.retry: "+aa.toString());J()})):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"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var W=0;W<Editor.mathJaxQueue.length;W++)Editor.doMathJaxRender(Editor.mathJaxQueue[W])}}};Editor.MathJaxRender=function(W){"undefined"!==-typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(W):Editor.mathJaxQueue.push(W)};Editor.onMathJaxDone=function(){};var Y=Editor.prototype.init;Editor.prototype.init=function(){Y.apply(this,arguments);var W=mxUtils.bind(this,function(U,aa){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,W);this.graph.addListener(mxEvent.REFRESH,W)};x=document.getElementsByTagName("script");if(null!=-x&&0<x.length){var Z=document.createElement("script");Z.setAttribute("type","text/javascript");Z.setAttribute("src",k);x[0].parentNode.appendChild(Z)}}};Editor.prototype.csvToArray=function(k){if(0<k.length){var x="",J=[""],R=0,Y=!0,Z;k=$jscomp.makeIterator(k);for(Z=k.next();!Z.done;Z=k.next())Z=Z.value,'"'===Z?(Y&&Z===x&&(J[R]+=Z),Y=!Y):","===Z&&Y?Z=J[++R]="":J[R]+=Z,x=Z;return J}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&-!this.isCorsEnabledForUrl(k)){var x=EditorUi.isVisioFilename(k);x=/\.png$/i.test(k)||/\.pdf$/i.test(k)||x;var J="t="+(new Date).getTime();k=PROXY_URL+"?url="+encodeURIComponent(k)+"&"+J+(x?"&base64=1":"")}return k};Editor.prototype.isCorsEnabledForUrl=function(k){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||k.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(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var x=k.convert,J=this;k.convert=function(R){null!=R&&navigator.onLine&&("http://"!=R.substring(0,7)&&"https://"!=R.substring(0,8)||R.substring(0,k.baseUrl.length)==k.baseUrl||J.crossOriginImages&&-J.isCorsEnabledForUrl(R)?"chrome-extension://"!=R.substring(0,19)&&(R=x.apply(this,arguments)):R=PROXY_URL+"?url="+encodeURIComponent(R));return R};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,x,J,R,Y){try{var Z=!0,W=window.setTimeout(mxUtils.bind(this,function(){Z=!1;x(k)}),this.timeout),U=mxUtils.bind(this,function(){null!=R?this.convertImageToDataUri(k,x,J,R,!0):x(k)});if(/(\.svg)$/i.test(k)&&-!Y)mxUtils.get(k,mxUtils.bind(this,function(ia){window.clearTimeout(W);Z&&(200>ia.getStatus()||299<ia.getStatus()?U():x(Editor.createSvgDataUri(ia.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(W);Z&&U()}));else{var aa=new Image;this.crossOriginImages&&(aa.crossOrigin="anonymous");aa.onload=function(){window.clearTimeout(W);if(Z)try{R=null!=R&&Y?R:1;var ia=document.createElement("canvas"),na=ia.getContext("2d");na.scale(R,R);ia.height=aa.height*R;ia.width=aa.width*R;na.drawImage(aa,-0,0);x(ia.toDataURL())}catch(qa){x(k)}};aa.onerror=function(){window.clearTimeout(W);Z&&(null!=J?J():x(k))};aa.src=k}}catch(ia){null!=J?J():x(k)}};Editor.prototype.convertImages=function(k,x,J,R){function Y(){0<Z.length?Z.shift()():x(k)}null==R&&(R=this.createImageUrlConverter());var Z=[],W=J||{};J=mxUtils.bind(this,function(U,aa){U=k.getElementsByTagName(U);for(var ia=0;ia<U.length;ia++)mxUtils.bind(this,function(na){Z.push(mxUtils.bind(this,function(){try{if(null!=na){var qa=R.convert(na.getAttribute(aa));-if(null!=qa&&"data:"!=qa.substring(0,5)){var ta=W[qa];null==ta?this.convertImageToDataUri(qa,function(ua){null!=ua&&(W[qa]=ua,na.setAttribute(aa,ua));Y()},null,Editor.svgRasterScale):(na.setAttribute(aa,ta),Y())}else null!=qa&&na.setAttribute(aa,qa),Y()}}catch(ua){Y()}}))})(U[ia])});J("image","xlink:href");J("img","src");Y()};Editor.base64Encode=function(k){for(var x="",J=0,R=k.length,Y,Z,W;J<R;){Y=k.charCodeAt(J++)&255;if(J==R){x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y>>-2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Y&3)<<4);x+="==";break}Z=k.charCodeAt(J++);if(J==R){x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y>>2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Y&3)<<4|(Z&240)>>4);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Z&15)<<2);x+="=";break}W=k.charCodeAt(J++);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y>>-2);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Y&3)<<4|(Z&240)>>4);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Z&15)<<2|(W&192)>>6);x+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(W&63)}return x};Editor.prototype.loadUrl=function(k,x,J,R,Y,Z,W,U){try{var aa=!W&&(R||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));Y=null!=Y?Y:!0;var ia=mxUtils.bind(this,-function(){mxUtils.get(k,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?null!=x&&(na=na.getText(),aa&&(Z=null!=Z?Z:"data:image/png;base64,",na=Z+Editor.base64Encode(na)),x(na)):null!=J&&(0==na.getStatus()?J({message:mxResources.get("accessDenied")},na):404==na.getStatus()?J({message:mxResources.get("fileNotFound"),code:na.getStatus()},na):J({message:this.getErrorMessage(na)},na))}),function(na){null!=J&&J({message:mxResources.get("error")+" "+na.getStatus()})},aa,this.timeout,-function(){Y&&null!=J&&J({code:App.ERROR_TIMEOUT,retry:ia})},U)});ia()}catch(na){null!=J&&J(na)}};Editor.prototype.getErrorMessage=function(k){var x=mxResources.get("error")+" "+k.getStatus();try{var J=k.getText(),R=JSON.parse(J);null!=R&&null!=R.error&&null!=R.error.message&&(x=R.error.message+" ("+x+")")}catch(Y){}return x};Editor.prototype.absoluteCssFonts=function(k){var x=null;if(null!=k){var J=k.split("url(");if(0<J.length){x=[J[0]];k=window.location.pathname;var R=null!=k?k.lastIndexOf("/"):--1;0<=R&&(k=k.substring(0,R+1));R=document.getElementsByTagName("base");var Y=null;null!=R&&0<R.length&&(Y=R[0].getAttribute("href"));for(var Z=1;Z<J.length;Z++)if(R=J[Z].indexOf(")"),0<R){var W=Editor.trimCssUrl(J[Z].substring(0,R));this.graph.isRelativeUrl(W)&&(W=null!=Y?Y+W:window.location.protocol+"//"+window.location.hostname+("/"==W.charAt(0)?"":k)+W);x.push('url("'+W+'"'+J[Z].substring(R))}else x.push(J[Z])}else x=[k]}return null!=x?x.join(""):null};Editor.prototype.mapFontUrl=function(k,x,-J){/^https?:\/\//.test(x)&&!this.isCorsEnabledForUrl(x)&&(x=PROXY_URL+"?url="+encodeURIComponent(x));J(k,x)};Editor.prototype.embedCssFonts=function(k,x){var J=k.split("url("),R=0;null==this.cachedFonts&&(this.cachedFonts={});var Y=mxUtils.bind(this,function(){if(0==R){for(var aa=[J[0]],ia=1;ia<J.length;ia++){var na=J[ia].indexOf(")");aa.push('url("');aa.push(this.cachedFonts[Editor.trimCssUrl(J[ia].substring(0,na))]);aa.push('"'+J[ia].substring(na))}x(aa.join(""))}});if(0<J.length){for(k=1;k<J.length;k++){var Z=-J[k].indexOf(")"),W=null,U=J[k].indexOf("format(",Z);0<U&&(W=Editor.trimCssUrl(J[k].substring(U+7,J[k].indexOf(")",U))));mxUtils.bind(this,function(aa){if(null==this.cachedFonts[aa]){this.cachedFonts[aa]=aa;R++;var ia="application/x-font-ttf";if("svg"==W||/(\.svg)($|\?)/i.test(aa))ia="image/svg+xml";else if("otf"==W||"embedded-opentype"==W||/(\.otf)($|\?)/i.test(aa))ia="application/x-font-opentype";else if("woff"==W||/(\.woff)($|\?)/i.test(aa))ia="application/font-woff";else if("woff2"==W||/(\.woff2)($|\?)/i.test(aa))ia=-"application/font-woff2";else if("eot"==W||/(\.eot)($|\?)/i.test(aa))ia="application/vnd.ms-fontobject";else if("sfnt"==W||/(\.sfnt)($|\?)/i.test(aa))ia="application/font-sfnt";this.mapFontUrl(ia,aa,mxUtils.bind(this,function(na,qa){this.loadUrl(qa,mxUtils.bind(this,function(ta){this.cachedFonts[aa]=ta;R--;Y()}),mxUtils.bind(this,function(ta){R--;Y()}),!0,null,"data:"+na+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(J[k].substring(0,Z)),W)}Y()}else x(k)};Editor.prototype.loadFonts=function(k){null!=-this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(x){this.resolvedFontCss=x;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},x;for(x in Graph.fontMapping)Graph.isCssFontUrl(x)&&(k[x]=Graph.fontMapping[x]);return k};Editor.prototype.embedExtFonts=function(k){var x=this.graph.getCustomFonts();if(0<x.length){var J=[],R=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var Y=-mxUtils.bind(this,function(){0==R&&this.embedCssFonts(J.join(""),k)}),Z=0;Z<x.length;Z++)mxUtils.bind(this,function(W,U){Graph.isCssFontUrl(U)?null==this.cachedGoogleFonts[U]?(R++,this.loadUrl(Graph.rewriteGoogleFontUrl(U),mxUtils.bind(this,function(aa){this.cachedGoogleFonts[U]=aa;J.push(aa+"\n");R--;Y()}),mxUtils.bind(this,function(aa){R--;J.push("@import url("+U+");\n");Y()}))):J.push(this.cachedGoogleFonts[U]+"\n"):J.push('@font-face {font-family: "'+W+'";src: url("'+U+'")}\n')})(x[Z].name,x[Z].url);-Y()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var x=document.getElementsByTagName("style"),J=0;J<x.length;J++){var R=mxUtils.getTextContent(x[J]);0>R.indexOf("mxPageSelector")&&0<R.indexOf("MathJax")&&k[0].appendChild(x[J].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,x){x=null!=x?x:this.absoluteCssFonts(this.fontCss);if(null!=x){var J=mxUtils.getSvgDefs(k),R=x.split("\n");x=[];for(var Y=[],Z=0;Z<R.length;Z++)"@import"==-R[Z].substring(0,7)?x.push(R[Z]):Y.push(R[Z]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<x.length&&(mxUtils.setTextContent(k,x.join("\n")),J.appendChild(k));0<Y.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,Y.join("\n")),J.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,-x,J){var R=mxClient.IS_FF?8192:16384;return Math.min(J,Math.min(R/k,R/x))};Editor.prototype.exportToCanvas=function(k,x,J,R,Y,Z,W,U,aa,ia,na,qa,ta,ua,Ba,za,Aa,Ga){try{Z=null!=Z?Z:!0;W=null!=W?W:!0;qa=null!=qa?qa:this.graph;ta=null!=ta?ta:0;var Ra=aa?null:qa.background;Ra==mxConstants.NONE&&(Ra=null);null==Ra&&(Ra=R);null==Ra&&0==aa&&(Ra="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(qa.getSvg(null,null,ta,ua,null,W,null,null,null,ia,null,za,Aa,Ga),mxUtils.bind(this,function(Ha){try{Ha.style.setProperty("-webkit-font-smoothing",-"antialiased");Ha.style.setProperty("-moz-osx-font-smoothing","grayscale");var Qa=new Image;Qa.onload=mxUtils.bind(this,function(){try{var Ma=function(){mxClient.IS_SF?window.setTimeout(function(){Na.drawImage(Qa,0,0);k(ya,Ha)},0):(Na.drawImage(Qa,0,0),k(ya,Ha))},ya=document.createElement("canvas"),Sa=parseInt(Ha.getAttribute("width")),Oa=parseInt(Ha.getAttribute("height"));U=null!=U?U:1;null!=x&&(U=Z?Math.min(1,Math.min(3*x/(4*Oa),x/Sa)):x/Sa);U=this.getMaxCanvasScale(Sa,Oa,U);Sa=Math.ceil(U*Sa);-Oa=Math.ceil(U*Oa);ya.setAttribute("width",Sa);ya.setAttribute("height",Oa);var Na=ya.getContext("2d");if(null!=Ra){var Pa=mxUtils.getLightDarkColor(Ra);Na.beginPath();Na.rect(0,0,Sa,Oa);Na.fillStyle="dark"==za&&"none"!=qa.getAdaptiveColors()?Pa.dark:Pa.light;Na.fill()}1!=U&&Na.scale(U,U);if(Ba){var oa=qa.view,Da=oa.scale;oa.scale=1;var Ca=btoa(unescape(encodeURIComponent(oa.createSvgGrid(oa.gridColor))));oa.scale=Da;Ca="data:image/svg+xml;base64,"+Ca;var Ja=qa.gridSize*oa.gridSteps*U,Xa=qa.getGraphBounds(),-ib=oa.translate.x*Da,y=oa.translate.y*Da,P=ib+(Xa.x-ib)/Da-ta,S=y+(Xa.y-y)/Da-ta,X=new Image;X.onload=function(){try{for(var ba=-Math.round(Ja-mxUtils.mod((ib-P)*U,Ja)),ma=-Math.round(Ja-mxUtils.mod((y-S)*U,Ja));ba<Sa;ba+=Ja)for(var ra=ma;ra<Oa;ra+=Ja)Na.drawImage(X,ba/U,ra/U);Ma()}catch(wa){null!=Y&&Y(wa)}};X.onerror=function(ba){null!=Y&&Y(ba)};X.src=Ca}else Ma()}catch(ba){null!=Y&&Y(ba)}});Qa.onerror=function(Ma){null!=Y&&Y(Ma)};ia&&this.graph.addSvgShadow(Ha);this.graph.mathEnabled&&this.addMathCss(Ha);-var eb=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ha,this.resolvedFontCss),Qa.src=Editor.createSvgDataUri(mxUtils.getXml(Ha))}catch(Ma){null!=Y&&Y(Ma)}});this.embedExtFonts(mxUtils.bind(this,function(Ma){try{null!=Ma&&this.addFontCss(Ha,Ma),this.loadFonts(eb)}catch(ya){null!=Y&&Y(ya)}}))}catch(Ma){null!=Y&&Y(Ma)}}),J,na)}catch(Ha){null!=Y&&Y(Ha)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,C=0;8>C;C++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=-p;Editor.updateCRC=function(k,x,J,R){for(var Y=0;Y<R;Y++)k=Editor.crcTable[(k^x.charCodeAt(J+Y))&255]^k>>>8;return k};Editor.crc32=function(k){for(var x=-1,J=0;J<k.length;J++)x=x>>>8^Editor.crcTable[(x^k.charCodeAt(J))&255];return(x^-1)>>>0};Editor.writeGraphModelToPng=function(k,x,J,R,Y){function Z(na,qa){var ta=aa;aa+=qa;return na.substring(ta,aa)}function W(na){na=Z(na,4);return na.charCodeAt(3)+(na.charCodeAt(2)<<8)+(na.charCodeAt(1)<<16)+(na.charCodeAt(0)<<24)}function U(na){return String.fromCharCode(na>>-24&255,na>>16&255,na>>8&255,na&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var aa=0;if(Z(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=Y&&Y();else if(Z(k,4),"IHDR"!=Z(k,4))null!=Y&&Y();else{Z(k,17);Y=k.substring(0,aa);do{var ia=W(k);if("IDAT"==Z(k,4)){Y=k.substring(0,aa-8);"pHYs"==x&&"dpi"==J?(J=Math.round(R/.0254),J=U(J)+U(J)+String.fromCharCode(1)):J=J+String.fromCharCode(0)+("zTXt"==x?String.fromCharCode(0):"")+R;R=4294967295;R=Editor.updateCRC(R,-x,0,4);R=Editor.updateCRC(R,J,0,J.length);Y+=U(J.length)+x+J+U(R^4294967295);Y+=k.substring(aa-8,k.length);break}Y+=k.substring(aa-8,aa-4+ia);Z(k,ia);Z(k,4)}while(ia);return"data:image/png;base64,"+(window.btoa?btoa(Y):Base64.encode(Y,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,x){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(k,x,J){var R=null;if(null!=J)return null;null!=k.editor.graph.getModel().getParent(x)?R=x.getId():null!=k.currentPage&&(R=k.currentPage.getId());return R});if(null!=window.StyleFormatPanel){var E=Format.prototype.init;Format.prototype.init=-function(){E.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var Q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?Q.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var M=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=-function(k){k=M.apply(this,arguments);var x=this.editorUi,J=x.editor.graph;if(J.isEnabled()){var R=x.getCurrentFile();null!=R&&R.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return x.editor.autosave},function(Z){x.editor.setAutosave(Z);x.editor.autosave&&R.isModified()&&R.fileChanged()},{install:function(Z){this.listener=function(){Z(x.editor.autosave)};x.editor.addListener("autosaveChanged",this.listener)},destroy:function(){x.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&-J.isEnabled()&&"undefined"!==typeof MathJax){var Y=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return J.mathEnabled},function(Z){x.actions.get("mathematicalTypesetting").funct()},{install:function(Z){this.listener=function(){Z(J.mathEnabled)};x.addListener("mathEnabledChanged",this.listener)},destroy:function(){x.removeListener(this.listener)}});k.appendChild(Y);(!x.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&Y.appendChild(x.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};-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.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];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(k){return"0"==mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(k){return"1"==mxUtils.getValue(k.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,isVisible:function(k){return"0"==mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,-min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",-dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",-dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",-min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",-type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",-type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",-type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);-mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},-{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},-{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=+this.canvas.fillAndStroke=mxUtils.bind(this,k.prototype.fillAndStroke);this.path=[];this.passThrough=!1}k.prototype.moveOp="M";k.prototype.lineOp="L";k.prototype.quadOp="Q";k.prototype.curveOp="C";k.prototype.closeOp="Z";k.prototype.getStyle=function(aa,Z){var U=1;if(null!=this.shape.state){var ba=this.shape.state.cell.id;if(null!=ba)for(var fa=0;fa<ba.length;fa++)U=(U<<5)-U+ba.charCodeAt(fa)<<0}U={strokeWidth:this.canvas.state.strokeWidth,seed:U,preserveVertices:!0};ba=this.rc.getDefaultOptions();+U.stroke=aa?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;aa=null;(U.filled=Z)?(U.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,aa=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):U.fill="";U.bowing=mxUtils.getValue(this.shape.style,"bowing",ba.bowing);U.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ba.hachureAngle);U.curveFitting=mxUtils.getValue(this.shape.style,+"curveFitting",ba.curveFitting);U.roughness=mxUtils.getValue(this.shape.style,"jiggle",ba.roughness);U.simplification=mxUtils.getValue(this.shape.style,"simplification",ba.simplification);U.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ba.disableMultiStroke);U.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ba.disableMultiStrokeFill);Z=mxUtils.getValue(this.shape.style,"hachureGap",-1);U.hachureGap="auto"==Z?-1:Z;U.dashGap=mxUtils.getValue(this.shape.style,+"dashGap",Z);U.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Z);U.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Z);Z=mxUtils.getValue(this.shape.style,"fillWeight",-1);U.fillWeight="auto"==Z?-1:Z;Z=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==Z&&(Z="auto");"auto"==Z&&(Z=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&Z.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&Z.push(mxUtils.hex2rgb(Editor.darkColor)),+Z=null!=U.fill&&(null!=aa||0<=mxUtils.indexOf(Z,mxUtils.hex2rgb(U.fill)))?"solid":ba.fillStyle);U.fillStyle=Z;return U};k.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};k.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};k.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var aa=2;aa<arguments.length;aa+=2)this.lastX=arguments[aa-1],this.lastY=arguments[aa],+this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};k.prototype.lineTo=function(aa,Z){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,aa,Z),this.lastX=aa,this.lastY=Z)};k.prototype.moveTo=function(aa,Z){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,aa,Z),this.lastX=aa,this.lastY=Z,this.firstX=aa,this.firstY=Z)};k.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,+arguments):this.addOp(this.closeOp)};k.prototype.quadTo=function(aa,Z,U,ba){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,aa,Z,U,ba),this.lastX=U,this.lastY=ba)};k.prototype.curveTo=function(aa,Z,U,ba,fa,na){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,aa,Z,U,ba,fa,na),this.lastX=fa,this.lastY=na)};k.prototype.arcTo=function(aa,Z,U,ba,fa,na,pa){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);+else{var ta=mxUtils.arcToCurves(this.lastX,this.lastY,aa,Z,U,ba,fa,na,pa);if(null!=ta)for(var ua=0;ua<ta.length;ua+=6)this.curveTo(ta[ua],ta[ua+1],ta[ua+2],ta[ua+3],ta[ua+4],ta[ua+5]);this.lastX=na;this.lastY=pa}};k.prototype.rect=function(aa,Z,U,ba){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(aa,Z,U,ba,this.getStyle(!0,!0)))};k.prototype.ellipse=function(aa,Z,U,ba){this.passThrough?this.originalEllipse.apply(this.canvas,+arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(aa+U/2,Z+ba/2,U,ba,this.getStyle(!0,!0)))};k.prototype.roundrect=function(aa,Z,U,ba,fa,na){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(aa+fa,Z),this.lineTo(aa+U-fa,Z),this.quadTo(aa+U,Z,aa+U,Z+na),this.lineTo(aa+U,Z+ba-na),this.quadTo(aa+U,Z+ba,aa+U-fa,Z+ba),this.lineTo(aa+fa,Z+ba),this.quadTo(aa,Z+ba,aa,Z+ba-na),this.lineTo(aa,Z+na),this.quadTo(aa,Z,aa+fa,Z))};k.prototype.drawPath=+function(aa){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),aa)}catch(U){}this.passThrough=!1}else if(null!=this.nextShape){for(var Z in aa)this.nextShape.options[Z]=aa[Z];aa.stroke!=mxConstants.NONE&&null!=aa.stroke||delete this.nextShape.options.stroke;aa.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};k.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):+this.drawPath(this.getStyle(!0,!1))};k.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};k.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};k.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(aa){return new k(aa,Editor.createRoughCanvas(aa),+this)};var y=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(aa){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?y.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(aa):this.createRoughCanvas(aa)};var J=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(aa,Z,U,ba,fa){null!=aa.handJiggle&&aa.handJiggle.passThrough||J.apply(this,arguments)};+var R=mxShape.prototype.paint;mxShape.prototype.paint=function(aa){var Z=aa.addTolerance,U=!0;null!=this.style&&(U="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=aa.handJiggle&&aa.handJiggle.constructor==k&&!this.outline){aa.save();var ba=this.fill,fa=this.stroke;this.stroke=this.fill=null;var na=this.configurePointerEvents,pa=aa.setStrokeColor;aa.setStrokeColor=function(){};var ta=aa.setFillColor;aa.setFillColor=function(){};U||null==ba||(this.configurePointerEvents=+function(){});aa.handJiggle.passThrough=!0;R.apply(this,arguments);aa.handJiggle.passThrough=!1;aa.setFillColor=ta;aa.setStrokeColor=pa;this.configurePointerEvents=na;this.stroke=fa;this.fill=ba;aa.restore();U&&null!=ba&&(aa.addTolerance=function(){})}R.apply(this,arguments);aa.addTolerance=Z};var X=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(aa,Z,U,ba,fa,na){null!=aa.handJiggle&&aa.handJiggle.constructor==k?(aa.handJiggle.passThrough=!0,X.apply(this,arguments),+aa.handJiggle.passThrough=!1):X.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,y,J){if(null!=k&&"undefined"!==typeof pako){var R=k.ownerDocument.getElementsByTagName("div"),X=[];if(null!=R&&0<+R.length)for(var aa=0;aa<R.length;aa++)if("mxgraph"==R[aa].getAttribute("class")){X.push(R[aa]);break}0<X.length&&(R=X[0].getAttribute("data-mxgraph"),null!=R?(X=JSON.parse(R),null!=X&&null!=X.xml&&(k=mxUtils.parseXml(X.xml),k=k.documentElement)):(X=X[0].getElementsByTagName("div"),0<X.length&&(R=mxUtils.getTextContent(X[0]),R=Graph.decompress(R,null,J),0<R.length&&(k=mxUtils.parseXml(R),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(R=k.getAttribute("content"),null!=R&&"<"!=R.charAt(0)&&+"%"!=R.charAt(0)&&(R=unescape(window.atob?atob(R):Base64.decode(cont,R))),null!=R&&"%"==R.charAt(0)&&(R=decodeURIComponent(R)),null!=R&&0<R.length)k=mxUtils.parseXml(R).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||y||(X=null,"diagram"==k.nodeName?X=k:"mxfile"==k.nodeName&&(R=k.getElementsByTagName("diagram"),0<R.length&&(X=R[Math.max(0,Math.min(R.length-1,urlParams.page||0))])),null!=X&&(k=Editor.parseDiagramNode(X,J)));null==k||"mxGraphModel"==k.nodeName||y&&"mxfile"==+k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,y,J){Editor.validateDiagramNode(k);var R=mxUtils.trim(mxUtils.getTextContent(k)),X=null;0<R.length?(y=Graph.decompress(R,null,y),null!=y&&0<y.length&&(X=mxUtils.parseXml(y).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(X=k[0],J&&(X=Editor.parseDiagramNode(X,y,!1)),y=mxUtils.createXmlDocument(),y.appendChild(y.importNode(X,!0)),X=y.documentElement));return X};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);+var y=mxUtils.getNodeValue(k),J=null;0<y.length?J=Graph.decompress(y):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(J=mxUtils.getXml(k[0])));return J};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var y=new mxCodec,J=new mxGraphModel;k.appendChild(y.encode(J))}return k};Editor.extractGraphModelFromPdf=function(k){var y=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,+!0);if("%PDF-1.7"==k.substring(0,8)){var J=k.indexOf("EmbeddedFile");if(-1<J){var R=k.indexOf("stream",J)+9;if(0<k.substring(J,R).indexOf("application#2Fvnd.jgraph.mxfile")){var X=k.indexOf("endstream",R-1);return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(R,X)),{to:"string"})}}for(J=k.indexOf("/ObjStm");0<J;){R=k.indexOf("stream",J)+9;X=k.indexOf("endstream",R-1);R=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(R,X)),{to:"string"});X=R.indexOf("/Subject <");if(0<X){J=R.substring(X++14,R.indexOf(">",X));if(null!=J){y=J;J=[];for(R=0;R<y.length;R+=2)X=y.substr(R,2),"00"!=X&&J.push(String.fromCharCode(parseInt(X,16)));y=J.join("")}break}J=k.indexOf("/ObjStm",J+1)}}if(null==y&&"%PDF-1.4"==k.substring(0,8)){J="";X=R=0;for(var aa=[],Z=null;X<k.length;){var U=k.charCodeAt(X);X+=1;10!=U&&(J+=String.fromCharCode(U));U=="/Subject (%3Cmxfile".charCodeAt(R)?R++:R=0;if(19==R){var ba=k.indexOf("%3C%2Fmxfile%3E",X)+15;X-=9;if(ba>X){y=k.substring(X,ba);break}}10==U&&("endobj"==J?Z=null:"obj"==+J.substring(J.length-3,J.length)||"xref"==J||"trailer"==J?(Z=[],aa[J.split(" ")[0]]=Z):null!=Z&&Z.push(J),J="")}}null==y&&null!=aa&&(y=Editor.extractGraphModelFromXref(aa));null!=y&&(y=decodeURIComponent(y.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return y};Editor.extractGraphModelFromXref=function(k){var y=k.trailer,J=null;null!=y&&(y=/.* \/Info (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(y=k[y[1]],null!=y&&(y=/.* \/Subject (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(k=+k[y[1]],null!=k&&(k=k.join("\n"),J=k.substring(1,k.length-1))))));return J};Editor.extractParserError=function(k,y){var J=null;k=null!=k?k.getElementsByTagName("parsererror"):null;null!=k&&0<k.length&&(J=y||mxResources.get("invalidChars"),y=k[0].getElementsByTagName("div"),0<y.length&&(J=mxUtils.getTextContent(y[0])));return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(k,y){null!=k&&(k=null!=k.error?k.error:k,null==k.retry&&(k.retry=y))};Editor.mermaidToDrawio=function(k,y,J){if("function"===+typeof mxMermaidToDrawio)return mxMermaidToDrawio(k,y,J)};Editor.configure=function(k){if(null!=k){Editor.config=k;Editor.configVersion=k.version;k.debug&&(urlParams.test="1");k.passiveScroll&&(Editor.passiveScroll=!0);k.noResizers&&(Editor.noResizers=!0);k.preserveViewState&&(Editor.preserveViewState=!0);k.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=k.useInternalClipboard);if(null!=k.customCss){var y=document.createElement("style");y.type="text/css";y.appendChild(document.createTextNode(k.customCss));+document.head.appendChild(y)}null!=k.defaultFonts&&(Menus.prototype.defaultFonts=k.defaultFonts);null!=k.presetColors&&(ColorDialog.prototype.presetColors=k.presetColors);null!=k.defaultColors&&(ColorDialog.prototype.defaultColors=k.defaultColors);null!=k.colorNames&&(ColorDialog.prototype.colorNames=k.colorNames);null!=k.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.defaultColorSchemes);null!=k.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=k.defaultEdgeLength);null!=+k.selectParentLayer&&(Graph.selectParentLayer=k.selectParentLayer);null!=k.intersectionSelect&&(Graph.intersectionSelect=k.intersectionSelect);null!=k.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=k.autosaveDelay);null!=k.templateFile&&(EditorUi.templateFile=k.templateFile);null!=k.styles&&(Array.isArray(k.styles)?Editor.styles=k.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=k.globalVars&&(Editor.globalVars=k.globalVars);null!=k.compressXml&&(Editor.defaultCompressed=+k.compressXml,Editor.compressXml=k.compressXml);null!=k.includeDiagram&&(Editor.defaultIncludeDiagram=k.includeDiagram);null!=k.simpleLabels&&(Editor.simpleLabels=k.simpleLabels);null!=k.pasteAtMousePointer&&(Editor.pasteAtMousePointer=k.pasteAtMousePointer);null!=k.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=k.fitDiagramOnLoad);null!=k.fitDiagramOnPage&&(Editor.fitDiagramOnPage=k.fitDiagramOnPage);null!=k.showLinkIcons&&(Editor.showLinkIcons=k.showLinkIcons);null!=k.showTooltipIcons&&(Editor.showTooltipIcons=+k.showTooltipIcons);null!=k.showConnectHandle&&(Editor.showConnectHandle=k.showConnectHandle);null!=k.enableInlineToolbar&&(Editor.enableInlineToolbar=k.enableInlineToolbar);null!=k.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=k.oneDriveInlinePicker);null!=k.enableNativeClipboard&&(Editor.enableNativeClipboard=k.enableNativeClipboard);null!=k.enableExportUrl&&(Editor.enableExportUrl=k.enableExportUrl);null!=k.defaultAdaptiveColors?Graph.defaultAdaptiveColors=k.defaultAdaptiveColors:0==k.enableCssDarkMode&&+(Graph.defaultAdaptiveColors="simple");null!=k.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=k.enableLightDarkColors);null!=k.darkColor&&(Editor.darkColor=k.darkColor);null!=k.darkColorVar&&(Editor.darkColorVar=k.darkColorVar);Graph.prototype.defaultPageBackgroundColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=k.settingsName&&(Editor.configurationKey="."+k.settingsName++"-configuration",Editor.settingsKey="."+k.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=k.customFonts&&(Menus.prototype.defaultFonts=k.customFonts.concat(Menus.prototype.defaultFonts));null!=k.customPresetColors&&(ColorDialog.prototype.presetColors=k.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=k.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=k.css){y=+document.createElement("style");y.setAttribute("type","text/css");y.appendChild(document.createTextNode(k.css));var J=document.getElementsByTagName("script")[0];J.parentNode.insertBefore(y,J)}null!=k.expandLibraries&&(Sidebar.prototype.expandLibraries=k.expandLibraries);null!=k.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=k.appendCustomLibraries);null!=k.libraries&&(Sidebar.prototype.customEntries=k.libraries);null!=k.enabledLibraries&&(Array.isArray(k.enabledLibraries)?Sidebar.prototype.enabledLibraries=+k.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=k.defaultLibraries&&(Sidebar.prototype.defaultEntries=k.defaultLibraries);null!=k.defaultCustomLibraries&&(Editor.defaultCustomLibraries=k.defaultCustomLibraries);null!=k.enableCustomLibraries&&(Editor.enableCustomLibraries=k.enableCustomLibraries);null!=k.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=k.defaultVertexStyle);null!=k.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=k.defaultEdgeStyle);+null!=k.shapePicker&&(EditorUi.prototype.defaultShapePickerEntries=k.shapePicker.shapes);null!=k.defaultPageVisible&&(Graph.prototype.defaultPageVisible=k.defaultPageVisible);null!=k.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=k.defaultGridEnabled);null!=k.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=k.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=k.defaultConnectionArrowsEnabled);null!=k.defaultConnectable&&(Graph.prototype.defaultConnectable=+k.defaultConnectable);null!=k.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=k.defaultFoldingEnabled);null!=k.zoomWheel&&(Graph.zoomWheel=k.zoomWheel);null!=k.zoomFactor&&(y=parseFloat(k.zoomFactor),!isNaN(y)&&1<y?Graph.prototype.zoomFactor=y:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=k.defaultGridSize&&(y=parseInt(k.defaultGridSize),!isNaN(y)&&0<y?mxGraph.prototype.gridSize=y:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));+null!=k.gridSteps&&(y=parseInt(k.gridSteps),!isNaN(y)&&0<y?mxGraphView.prototype.gridSteps=y:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=k.pageFormat&&(y=parseInt(k.pageFormat.width),J=parseInt(k.pageFormat.height),!isNaN(y)&&0<y&&!isNaN(J)&&0<J?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,y,J),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=+k.thumbWidth&&(Sidebar.prototype.thumbWidth=k.thumbWidth);null!=k.thumbHeight&&(Sidebar.prototype.thumbHeight=k.thumbHeight);null!=k.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=k.emptyLibraryXml);null!=k.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=k.emptyDiagramXml);null!=k.sidebarWidth&&(EditorUi.prototype.hsplitPosition=k.sidebarWidth);null!=k.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=k.updateDefaultStyle);null!=k.sidebarTitles&&(Sidebar.prototype.sidebarTitles=+k.sidebarTitles);null!=k.sidebarTitleSize&&(y=parseInt(k.sidebarTitleSize),!isNaN(y)&&0<y?Sidebar.prototype.sidebarTitleSize=y:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=k.fontCss&&("string"===typeof k.fontCss?Editor.configureFontCss(k.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=k.autosaveDelay&&(y=parseInt(k.autosaveDelay),!isNaN(y)&&0<y?DrawioFile.prototype.autosaveDelay=y:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));+null!=k.maxImageBytes&&(EditorUi.prototype.maxImageBytes=k.maxImageBytes);null!=k.maxImageSize&&(EditorUi.prototype.maxImageSize=k.maxImageSize);null!=k.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=k.shareCursorPosition);null!=k.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=k.showRemoteCursors);null!=k.restrictExport&&(DrawioFile.RESTRICT_EXPORT=k.restrictExport);null!=k.removeImageMetadata&&(Editor.removeImageMetadata=k.removeImageMetadata);null!=k.defaultTextStyle&&(Editor.defaultTextStyle=+k.defaultTextStyle);null!=k.replaceSvgDataUris&&(Editor.replaceSvgDataUris=k.replaceSvgDataUris);null!=k.foreignObjectImages&&(Editor.foreignObjectImages=k.foreignObjectImages);null!=k.shadowColor&&(mxConstants.SHADOW_COLOR=k.shadowColor);null!=k.shadowOpacity&&(mxConstants.SHADOW_OPACITY=k.shadowOpacity);null!=k.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=k.shadowOffsetX);null!=k.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=k.shadowOffsetY);null!=k.shadowBlur&&(mxConstants.SHADOW_BLUR=k.shadowBlur);+null!=k.enableAnimations&&(Editor.enableAnimations=k.enableAnimations);null!=k.enableWindowDocking&&(Editor.enableWindowDocking=k.enableWindowDocking);null!=k.compact&&(EditorUi.prototype.defaultCompact=k.compact);null!=k.noAutoFocus&&(EditorUi.prototype.noAutoFocus=k.noAutoFocus);if(null!=k.hideMenuItems)if(Array.isArray(k.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},y=0;y<k.hideMenuItems.length;y++)Menus.prototype.hiddenMenuItems[k.hideMenuItems[y]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");+if(null!=k.hideMenus)if(Array.isArray(k.hideMenus)){var R={};for(y=0;y<k.hideMenus.length;y++)R[k.hideMenus[y]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(X){return!R[X]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=k.enableAi&&(Editor.enableAi=k.enableAi);null!=k.enableChatGpt&&(Editor.enableAi=k.enableChatGpt);null!=k.gptApiKey&&(Editor.aiGlobals.gptApiKey=k.gptApiKey);null!=k.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=+k.geminiApiKey);null!=k.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=k.claudeApiKey);null!=k.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=k.gptUrl);null!=k.aiActions&&(Editor.aiActions=k.aiActions);null!=k.aiGlobals&&(Editor.aiGlobals=k.aiGlobals);null!=k.aiConfigs&&(Editor.aiConfigs=k.aiConfigs);null!=k.aiModels&&(Editor.aiModels=k.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=+function(k){if(null!=k){Editor.prototype.fontCss=k;var y=document.getElementsByTagName("script")[0];if(null!=y&&null!=y.parentNode){var J=document.createElement("style");J.setAttribute("type","text/css");J.appendChild(document.createTextNode(k));y.parentNode.insertBefore(J,y);k=k.split("url(");for(J=1;J<k.length;J++){var R=k[J].indexOf(")");R=Editor.trimCssUrl(k[J].substring(0,R));var X=document.createElement("link");X.setAttribute("rel","preload");X.setAttribute("href",R);X.setAttribute("as","font");+X.setAttribute("crossorigin","");y.parentNode.insertBefore(X,y)}}}};Editor.trimCssUrl=function(k){return k.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(k){k=null!=k?k:Editor.GUID_LENGTH;for(var y=[],J=0;J<k;J++)y.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*+Editor.GUID_ALPHABET.length)));return y.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.generateTimeout=6E4;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(k){k=null!=k&&"mxlibrary"!=k.nodeName?this.extractGraphModel(k):+null;if(null!=k){var y=Editor.extractParserError(k,mxResources.get("invalidOrMissingFile"));if(y)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[k],"cause",[y]),Error(mxResources.get("notADiagramFile")+" ("+y+")");if("mxGraphModel"==k.nodeName){y=k.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=y&&""!=y)y!=this.graph.currentStyle&&(J=null!=this.graph.themes?this.graph.themes[y]:mxUtils.load(STYLE_PATH+"/"+y+".xml").getDocumentElement(),null!=J&&(R=new mxCodec(J.ownerDocument),+R.decode(J,this.graph.getStylesheet())));else{var J=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=J){var R=new mxCodec(J.ownerDocument);R.decode(J,this.graph.getStylesheet())}}this.graph.currentStyle=y;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));y=k.getAttribute("backgroundImage");null!=y?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(y)):+this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==k.getAttribute("shadow"),!1);if(y=k.getAttribute("extFonts"))try{for(y=y.split("|").map(function(X){X=X.split("^");return{name:X[0],url:X[1]}}),J=0;J<y.length;J++)this.graph.addExtFont(y[J].name,y[J].url)}catch(X){console.log("ExtFonts format error: "+X.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 d=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,y){k=null!=k?k:!0;var J=d.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&J.setAttribute("style",this.graph.currentStyle);var R=this.graph.getBackgroundImageObject(this.graph.backgroundImage,+y);null!=R&&J.setAttribute("backgroundImage",JSON.stringify(R));J.setAttribute("math",this.graph.mathEnabled?"1":"0");J.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?J.setAttribute("adaptiveColors",this.graph.adaptiveColors):J.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(R=this.graph.extFonts.map(function(X){return X.name+"^"+X.url}),J.setAttribute("extFonts",R.join("|")));return J};Editor.prototype.isDataSvg=+function(k){try{var y=mxUtils.parseXml(k).documentElement.getAttribute("content");if(null!=y&&(null!=y&&"<"!=y.charAt(0)&&"%"!=y.charAt(0)&&(y=unescape(window.atob?atob(y):Base64.decode(cont,y))),null!=y&&"%"==y.charAt(0)&&(y=decodeURIComponent(y)),null!=y&&0<y.length)){var J=mxUtils.parseXml(y).documentElement;return"mxfile"==J.nodeName||"mxGraphModel"==J.nodeName}}catch(R){}return!1};Editor.prototype.extractGraphModel=function(k,y,J){return Editor.extractGraphModel.apply(this,arguments)};var m=+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();m.apply(this,arguments)};var n=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){n.apply(this,arguments);this.graph.useCssTransforms=+!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(k,y){if("undefined"===typeof window.MathJax){var J=function(){R=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var R=null;Editor.doMathJaxRender=function(Z){try{null==R?(MathJax.typesetClear([Z]),MathJax.typeset([Z]),J()):R!=Z&&Editor.mathJaxQueue.push(Z)}catch(U){MathJax.typesetClear([Z]),+null!=U.retry?(R=Z,U.retry.then(function(){MathJax.typesetPromise([Z]).then(J)["catch"](function(ba){console.log("Error in MathJax.typesetPromise: "+ba.toString());J()})})["catch"](function(ba){console.log("Error in MathJax.retry: "+ba.toString());J()})):null!=window.console&&console.log("Error in MathJax.typeset: "+U.toString())}};window.MathJax=null!=y?y:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg",+"input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var Z=0;Z<Editor.mathJaxQueue.length;Z++)Editor.doMathJaxRender(Editor.mathJaxQueue[Z])}}};Editor.MathJaxRender=function(Z){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(Z):Editor.mathJaxQueue.push(Z)};Editor.onMathJaxDone=function(){};var X=Editor.prototype.init;Editor.prototype.init=function(){X.apply(this,arguments);+var Z=mxUtils.bind(this,function(U,ba){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,Z);this.graph.addListener(mxEvent.REFRESH,Z)};y=document.getElementsByTagName("script");if(null!=y&&0<y.length){var aa=document.createElement("script");aa.setAttribute("type","text/javascript");aa.setAttribute("src",k);y[0].parentNode.appendChild(aa)}}};Editor.prototype.csvToArray=function(k){if(0<k.length){var y="",J=[""],+R=0,X=!0,aa;k=$jscomp.makeIterator(k);for(aa=k.next();!aa.done;aa=k.next())aa=aa.value,'"'===aa?(X&&aa===y&&(J[R]+=aa),X=!X):","===aa&&X?aa=J[++R]="":J[R]+=aa,y=aa;return J}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(k)){var y=EditorUi.isVisioFilename(k);y=/\.png$/i.test(k)||/\.pdf$/i.test(k)||y;var J="t="+(new Date).getTime();k=PROXY_URL+"?url="+encodeURIComponent(k)++"&"+J+(y?"&base64=1":"")}return k};Editor.prototype.isCorsEnabledForUrl=function(k){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||k.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(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===+k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var y=k.convert,J=this;k.convert=function(R){null!=R&&navigator.onLine&&("http://"!=R.substring(0,7)&&"https://"!=R.substring(0,8)||R.substring(0,k.baseUrl.length)==k.baseUrl||J.crossOriginImages&&J.isCorsEnabledForUrl(R)?"chrome-extension://"!=R.substring(0,19)&&(R=y.apply(this,arguments)):R=PROXY_URL+"?url="+encodeURIComponent(R));return R};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"++btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,y,J,R,X){try{var aa=!0,Z=window.setTimeout(mxUtils.bind(this,function(){aa=!1;y(k)}),this.timeout),U=mxUtils.bind(this,function(){null!=R?this.convertImageToDataUri(k,y,J,R,!0):y(k)});if(/(\.svg)$/i.test(k)&&!X)mxUtils.get(k,mxUtils.bind(this,function(fa){window.clearTimeout(Z);aa&&(200>fa.getStatus()||299<fa.getStatus()?U():y(Editor.createSvgDataUri(fa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Z);+aa&&U()}));else{var ba=new Image;this.crossOriginImages&&(ba.crossOrigin="anonymous");ba.onload=function(){window.clearTimeout(Z);if(aa)try{R=null!=R&&X?R:1;var fa=document.createElement("canvas");fa.height=ba.height*R;fa.width=ba.width*R;var na=fa.getContext("2d");na.scale(R,R);na.drawImage(ba,0,0);y(fa.toDataURL())}catch(pa){y(k)}};ba.onerror=function(){window.clearTimeout(Z);aa&&(null!=J?J():y(k))};ba.src=k}}catch(fa){null!=J?J():y(k)}};Editor.prototype.convertImages=function(k,y,J,R){function X(){0<+aa.length?aa.shift()():y(k)}null==R&&(R=this.createImageUrlConverter());var aa=[],Z=J||{};J=mxUtils.bind(this,function(U,ba){U=k.getElementsByTagName(U);for(var fa=0;fa<U.length;fa++)mxUtils.bind(this,function(na){aa.push(mxUtils.bind(this,function(){try{if(null!=na){var pa=R.convert(na.getAttribute(ba));if(null!=pa&&"data:"!=pa.substring(0,5)){var ta=Z[pa];null==ta?this.convertImageToDataUri(pa,function(ua){null!=ua&&(Z[pa]=ua,na.setAttribute(ba,ua));X()},null,Editor.svgRasterScale):(na.setAttribute(ba,+ta),X())}else null!=pa&&na.setAttribute(ba,pa),X()}}catch(ua){X()}}))})(U[fa])});J("image","xlink:href");J("img","src");X()};Editor.base64Encode=function(k){for(var y="",J=0,R=k.length,X,aa,Z;J<R;){X=k.charCodeAt(J++)&255;if(J==R){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(X>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((X&3)<<4);y+="==";break}aa=k.charCodeAt(J++);if(J==R){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(X>>+2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((X&3)<<4|(aa&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((aa&15)<<2);y+="=";break}Z=k.charCodeAt(J++);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(X>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((X&3)<<4|(aa&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((aa&15)<<2|(Z&192)>>+6);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Z&63)}return y};Editor.prototype.loadUrl=function(k,y,J,R,X,aa,Z,U){try{var ba=!Z&&(R||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));X=null!=X?X:!0;var fa=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?null!=y&&(na=na.getText(),ba&&(aa=null!=aa?aa:"data:image/png;base64,",na=aa+Editor.base64Encode(na)),+y(na)):null!=J&&(0==na.getStatus()?J({message:mxResources.get("accessDenied")},na):404==na.getStatus()?J({message:mxResources.get("fileNotFound"),code:na.getStatus()},na):J({message:this.getErrorMessage(na)},na))}),function(na){null!=J&&J({message:mxResources.get("error")+" "+na.getStatus()})},ba,this.timeout,function(){X&&null!=J&&J({code:App.ERROR_TIMEOUT,retry:fa})},U)});fa()}catch(na){null!=J&&J(na)}};Editor.prototype.getErrorMessage=function(k){var y=mxResources.get("error")+" "+k.getStatus();+try{var J=k.getText(),R=JSON.parse(J);null!=R&&null!=R.error&&null!=R.error.message&&(y=R.error.message+" ("+y+")")}catch(X){}return y};Editor.prototype.absoluteCssFonts=function(k){var y=null;if(null!=k){var J=k.split("url(");if(0<J.length){y=[J[0]];k=window.location.pathname;var R=null!=k?k.lastIndexOf("/"):-1;0<=R&&(k=k.substring(0,R+1));R=document.getElementsByTagName("base");var X=null;null!=R&&0<R.length&&(X=R[0].getAttribute("href"));for(var aa=1;aa<J.length;aa++)if(R=J[aa].indexOf(")"),0<+R){var Z=Editor.trimCssUrl(J[aa].substring(0,R));this.graph.isRelativeUrl(Z)&&(Z=null!=X?X+Z:window.location.protocol+"//"+window.location.hostname+("/"==Z.charAt(0)?"":k)+Z);y.push('url("'+Z+'"'+J[aa].substring(R))}else y.push(J[aa])}else y=[k]}return null!=y?y.join(""):null};Editor.prototype.mapFontUrl=function(k,y,J){/^https?:\/\//.test(y)&&!this.isCorsEnabledForUrl(y)&&(y=PROXY_URL+"?url="+encodeURIComponent(y));J(k,y)};Editor.prototype.embedCssFonts=function(k,y){var J=k.split("url("),R=0;null==+this.cachedFonts&&(this.cachedFonts={});var X=mxUtils.bind(this,function(){if(0==R){for(var ba=[J[0]],fa=1;fa<J.length;fa++){var na=J[fa].indexOf(")");ba.push('url("');ba.push(this.cachedFonts[Editor.trimCssUrl(J[fa].substring(0,na))]);ba.push('"'+J[fa].substring(na))}y(ba.join(""))}});if(0<J.length){for(k=1;k<J.length;k++){var aa=J[k].indexOf(")"),Z=null,U=J[k].indexOf("format(",aa);0<U&&(Z=Editor.trimCssUrl(J[k].substring(U+7,J[k].indexOf(")",U))));mxUtils.bind(this,function(ba){if(null==this.cachedFonts[ba]){this.cachedFonts[ba]=+ba;R++;var fa="application/x-font-ttf";if("svg"==Z||/(\.svg)($|\?)/i.test(ba))fa="image/svg+xml";else if("otf"==Z||"embedded-opentype"==Z||/(\.otf)($|\?)/i.test(ba))fa="application/x-font-opentype";else if("woff"==Z||/(\.woff)($|\?)/i.test(ba))fa="application/font-woff";else if("woff2"==Z||/(\.woff2)($|\?)/i.test(ba))fa="application/font-woff2";else if("eot"==Z||/(\.eot)($|\?)/i.test(ba))fa="application/vnd.ms-fontobject";else if("sfnt"==Z||/(\.sfnt)($|\?)/i.test(ba))fa="application/font-sfnt";this.mapFontUrl(fa,+ba,mxUtils.bind(this,function(na,pa){this.loadUrl(pa,mxUtils.bind(this,function(ta){this.cachedFonts[ba]=ta;R--;X()}),mxUtils.bind(this,function(ta){R--;X()}),!0,null,"data:"+na+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(J[k].substring(0,aa)),Z)}X()}else y(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(y){this.resolvedFontCss=y;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=+function(){var k={},y;for(y in Graph.fontMapping)Graph.isCssFontUrl(y)&&(k[y]=Graph.fontMapping[y]);return k};Editor.prototype.embedExtFonts=function(k){var y=this.graph.getCustomFonts();if(0<y.length){var J=[],R=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var X=mxUtils.bind(this,function(){0==R&&this.embedCssFonts(J.join(""),k)}),aa=0;aa<y.length;aa++)mxUtils.bind(this,function(Z,U){Graph.isCssFontUrl(U)?null==this.cachedGoogleFonts[U]?(R++,this.loadUrl(Graph.rewriteGoogleFontUrl(U),+mxUtils.bind(this,function(ba){this.cachedGoogleFonts[U]=ba;J.push(ba+"\n");R--;X()}),mxUtils.bind(this,function(ba){R--;J.push("@import url("+U+");\n");X()}))):J.push(this.cachedGoogleFonts[U]+"\n"):J.push('@font-face {font-family: "'+Z+'";src: url("'+U+'")}\n')})(y[aa].name,y[aa].url);X()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var y=document.getElementsByTagName("style"),J=0;J<y.length;J++){var R=mxUtils.getTextContent(y[J]);+0>R.indexOf("mxPageSelector")&&0<R.indexOf("MathJax")&&k[0].appendChild(y[J].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,y){y=null!=y?y:this.absoluteCssFonts(this.fontCss);if(null!=y){var J=mxUtils.getSvgDefs(k),R=y.split("\n");y=[];for(var X=[],aa=0;aa<R.length;aa++)"@import"==R[aa].substring(0,7)?y.push(R[aa]):X.push(R[aa]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<y.length&&+(mxUtils.setTextContent(k,y.join("\n")),J.appendChild(k));0<X.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,X.join("\n")),J.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,y,J){var R=mxClient.IS_FF?8192:16384;return Math.min(J,Math.min(R/k,R/y))};Editor.prototype.exportToCanvas=function(k,y,J,R,X,aa,Z,U,ba,fa,na,pa,ta,ua,Ca,Ba,Aa,Fa){try{aa=null!=aa?aa:!0;Z=null!=Z?Z:!0;pa=null!=+pa?pa:this.graph;ta=null!=ta?ta:0;var Sa=ba?null:pa.background;Sa==mxConstants.NONE&&(Sa=null);null==Sa&&(Sa=R);null==Sa&&0==ba&&(Sa="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(pa.getSvg(null,null,ta,ua,null,Z,null,null,null,fa,null,Ba,Aa,Fa),mxUtils.bind(this,function(La){try{La.style.setProperty("-webkit-font-smoothing","antialiased");La.style.setProperty("-moz-osx-font-smoothing","grayscale");var Pa=new Image;Pa.onload=mxUtils.bind(this,function(){try{var Ia=function(){mxClient.IS_SF?+window.setTimeout(function(){Ma.drawImage(Pa,0,0);k(za,La)},0):(Ma.drawImage(Pa,0,0),k(za,La))},za=document.createElement("canvas"),Ua=parseInt(La.getAttribute("width")),Qa=parseInt(La.getAttribute("height"));U=null!=U?U:1;null!=y&&(U=aa?Math.min(1,Math.min(3*y/(4*Qa),y/Ua)):y/Ua);U=this.getMaxCanvasScale(Ua,Qa,U);Ua=Math.ceil(U*Ua);Qa=Math.ceil(U*Qa);za.setAttribute("width",Ua);za.setAttribute("height",Qa);var Ma=za.getContext("2d");if(null!=Sa){var Na=mxUtils.getLightDarkColor(Sa);Ma.beginPath();+Ma.rect(0,0,Ua,Qa);Ma.fillStyle="dark"==Ba&&"none"!=pa.getAdaptiveColors()?Na.dark:Na.light;Ma.fill()}1!=U&&Ma.scale(U,U);if(Ca){var xa=pa.view,Za=xa.scale;xa.scale=1;var Oa=btoa(unescape(encodeURIComponent(xa.createSvgGrid(xa.gridColor))));xa.scale=Za;Oa="data:image/svg+xml;base64,"+Oa;var ra=pa.gridSize*xa.gridSteps*U,Da=pa.getGraphBounds(),Ra=xa.translate.x*Za,x=xa.translate.y*Za,N=Ra+(Da.x-Ra)/Za-ta,S=x+(Da.y-x)/Za-ta,Y=new Image;Y.onload=function(){try{for(var ca=-Math.round(ra-mxUtils.mod((Ra-+N)*U,ra)),ma=-Math.round(ra-mxUtils.mod((x-S)*U,ra));ca<Ua;ca+=ra)for(var qa=ma;qa<Qa;qa+=ra)Ma.drawImage(Y,ca/U,qa/U);Ia()}catch(wa){null!=X&&X(wa)}};Y.onerror=function(ca){null!=X&&X(ca)};Y.src=Oa}else Ia()}catch(ca){null!=X&&X(ca)}});Pa.onerror=function(Ia){null!=X&&X(Ia)};fa&&this.graph.addSvgShadow(La);this.graph.mathEnabled&&this.addMathCss(La);var db=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(La,this.resolvedFontCss),Pa.src=Editor.createSvgDataUri(mxUtils.getXml(La))}catch(Ia){null!=+X&&X(Ia)}});this.embedExtFonts(mxUtils.bind(this,function(Ia){try{null!=Ia&&this.addFontCss(La,Ia),this.loadFonts(db)}catch(za){null!=X&&X(za)}}))}catch(Ia){null!=X&&X(Ia)}}),J,na)}catch(La){null!=X&&X(La)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,C=0;8>C;C++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=p;Editor.updateCRC=function(k,y,J,R){for(var X=0;X<R;X++)k=Editor.crcTable[(k^y.charCodeAt(J+X))&255]^k>>>8;return k};Editor.crc32=function(k){for(var y=-1,J=0;J<k.length;J++)y=+y>>>8^Editor.crcTable[(y^k.charCodeAt(J))&255];return(y^-1)>>>0};Editor.writeGraphModelToPng=function(k,y,J,R,X){function aa(na,pa){var ta=ba;ba+=pa;return na.substring(ta,ba)}function Z(na){na=aa(na,4);return na.charCodeAt(3)+(na.charCodeAt(2)<<8)+(na.charCodeAt(1)<<16)+(na.charCodeAt(0)<<24)}function U(na){return String.fromCharCode(na>>24&255,na>>16&255,na>>8&255,na&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var ba=0;if(aa(k,8)!=String.fromCharCode(137)+"PNG"++String.fromCharCode(13,10,26,10))null!=X&&X();else if(aa(k,4),"IHDR"!=aa(k,4))null!=X&&X();else{aa(k,17);X=k.substring(0,ba);do{var fa=Z(k);if("IDAT"==aa(k,4)){X=k.substring(0,ba-8);"pHYs"==y&&"dpi"==J?(J=Math.round(R/.0254),J=U(J)+U(J)+String.fromCharCode(1)):J=J+String.fromCharCode(0)+("zTXt"==y?String.fromCharCode(0):"")+R;R=4294967295;R=Editor.updateCRC(R,y,0,4);R=Editor.updateCRC(R,J,0,J.length);X+=U(J.length)+y+J+U(R^4294967295);X+=k.substring(ba-8,k.length);break}X+=k.substring(ba-8,ba-4+fa);+aa(k,fa);aa(k,4)}while(fa);return"data:image/png;base64,"+(window.btoa?btoa(X):Base64.encode(X,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,y){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(k,y,J){var R=null;if(null!=J)return null;null!=k.editor.graph.getModel().getParent(y)?R=y.getId():null!=k.currentPage&&(R=k.currentPage.getId());return R});if(null!=window.StyleFormatPanel){var E=Format.prototype.init;Format.prototype.init=function(){E.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(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var L=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(k){k=L.apply(this,arguments);var y=this.editorUi,J=y.editor.graph;if(J.isEnabled()){var R=y.getCurrentFile();null!=R&&R.isAutosaveOptional()&&+k.appendChild(this.createOption(mxResources.get("autosave"),function(){return y.editor.autosave},function(aa){y.editor.setAutosave(aa);y.editor.autosave&&R.isModified()&&R.fileChanged()},{install:function(aa){this.listener=function(){aa(y.editor.autosave)};y.editor.addListener("autosaveChanged",this.listener)},destroy:function(){y.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&J.isEnabled()&&"undefined"!==typeof MathJax){var X=this.createOption(mxResources.get("mathematicalTypesetting"),+function(){return J.mathEnabled},function(aa){y.actions.get("mathematicalTypesetting").funct()},{install:function(aa){this.listener=function(){aa(J.mathEnabled)};y.addListener("mathEnabledChanged",this.listener)},destroy:function(){y.removeListener(this.listener)}});k.appendChild(X);(!y.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&X.appendChild(y.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};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.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];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(k){return"0"==mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(k){return"1"==mxUtils.getValue(k.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,isVisible:function(k){return"0"==+mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=+[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},+{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},+{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",+type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=+[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];+mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",+type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",+type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",+dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",@@ -3475,89 +3480,89 @@ stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#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;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));-c.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),k.customProperties,k))};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var x=this.editorUi.getSelectionState();1==x.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=x.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);g.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=-function(k,x,J,R){function Y(Na,Pa,oa,Da,Ca){if(null!=oa.valueChanged)oa.valueChanged(Pa,Ca,J,qa);else{ta.getModel().beginUpdate();try{Ca=[];var Ja=[];if(null!=oa.index){for(var Xa=[],ib=oa.parentRow.nextSibling;ib&&ib.getAttribute("data-pName")==Na;)Xa.push(ib.getAttribute("data-pValue")),ib=ib.nextSibling;oa.index<Xa.length?null!=Da?Xa.splice(Da,1):Xa[oa.index]=Pa:Xa.push(Pa);null!=oa.size&&Xa.length>oa.size&&(Xa=Xa.slice(0,oa.size));Pa=Xa.join(",");null!=oa.countProperty&&(ta.setCellStyles(oa.countProperty,-Xa.length,ta.getSelectionCells()),Ca.push(oa.countProperty),Ja.push(Xa.length))}ta.setCellStyles(Na,Pa,ta.getSelectionCells());Ca.push(Na);Ja.push(Pa);if(null!=oa.dependentProps)for(Na=0;Na<oa.dependentProps.length;Na++){var y=oa.dependentPropsDefVal[Na],P=oa.dependentPropsVals[Na];if(P.length>Pa)P=P.slice(0,Pa);else for(var S=P.length;S<Pa;S++)P.push(y);P=P.join(",");ta.setCellStyles(oa.dependentProps[Na],P,ta.getSelectionCells());Ca.push(oa.dependentProps[Na]);Ja.push(P)}if("function"==typeof oa.onChange)oa.onChange(ta,-Pa);qa.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Ca,"values",Ja,"cells",ta.getSelectionCells()))}finally{ta.getModel().endUpdate()}}}function Z(Na,Pa){Pa.style.left="0px";Pa.style.top="0px";Pa.style.position="relative";Pa.style.right="0px";Pa.style.bottom="0px";Pa.style.width="100%";Pa.style.maxWidth="100%";Pa.style.maxHeight="100%";Pa.style.textAlign="left"}function W(Na,Pa,oa){function Da(Ja){if(null==Ja||Ja==mxConstants.NONE)Ca.style.background="url('"+Dialog.prototype.noColorImage+-"')";else if("default"==Ja)Ca.style.background="";else{var Xa=mxUtils.getLightDarkColor(Ja);mxUtils.isLightDarkColor(Ja)&&Xa.light!=Xa.dark?Ca.style.background="linear-gradient(to right bottom, "+Xa.cssText+" 50%, "+mxUtils.invertLightDarkColor(Xa).cssText+" 50.3%)":Ca.style.background=Ja}}var Ca=document.createElement("div");Ca.style.width="32px";Ca.style.height="8px";Ca.style.margin="2px";Ca.style.borderStyle="solid";Ca.style.borderWidth="1px";Da(Pa);btn=mxUtils.button("",mxUtils.bind(qa,function(Ja){this.editorUi.pickColor(Pa,-function(Xa){Y(Na,Xa,oa);Da(Xa)});mxEvent.consume(Ja)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Ca);return btn}function U(Na,Pa,oa,Da,Ca,Ja,Xa){null!=Pa&&(Pa=Pa.split(","),ua.push({name:Na,values:Pa,type:oa,defVal:Da,countProperty:Ca,parentRow:Ja,isDeletable:!0,flipBkg:Xa}));btn=mxUtils.button("+",mxUtils.bind(qa,function(ib){for(var y=Ja,P=0;null!=y.nextSibling;)if(y.nextSibling.getAttribute("data-pName")==-Na)y=y.nextSibling,P++;else break;var S={type:oa,parentRow:Ja,index:P,isDeletable:!0,defVal:Da,countProperty:Ca};P=na(Na,"",S,0==P%2,Xa);Y(Na,Da,S);y.parentNode.insertBefore(P,y.nextSibling);mxEvent.consume(ib)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function aa(Na,Pa,oa,Da,Ca,Ja,Xa){if(0<Ca){var ib=Array(Ca);Pa=null!=Pa?Pa.split(","):[];for(var y=0;y<Ca;y++)ib[y]=null!=Pa[y]?Pa[y]:null!=Da?Da:"";ua.push({name:Na,values:ib,type:oa,defVal:Da,parentRow:Ja,-flipBkg:Xa,size:Ca})}return document.createElement("div")}function ia(Na,Pa,oa){var Da=document.createElement("input");Da.type="checkbox";Da.checked="1"==Pa;mxEvent.addListener(Da,"change",function(){Y(Na,Da.checked?"1":"0",oa,null,Da)});return Da}function na(Na,Pa,oa,Da,Ca){var Ja=oa.dispName,Xa=oa.type,ib=document.createElement("tr");ib.className="gePropRow"+(Ca?"Dark":"")+(Da?"Alt":"")+" gePropNonHeaderRow";ib.setAttribute("data-pName",Na);ib.setAttribute("data-pValue",Pa);Da=!1;null!=oa.index&&-(ib.setAttribute("data-index",oa.index),Ja=(null!=Ja?Ja:"")+"["+oa.index+"]",Da=!0);var y=document.createElement("td");y.className="gePropRowCell";Ja=mxResources.get(Ja,null,Ja);mxUtils.write(y,Ja);y.setAttribute("title",Ja);Da&&(y.style.textAlign="right");ib.appendChild(y);y=document.createElement("td");y.className="gePropRowCell";y.setAttribute("title",null!=Pa?decodeURIComponent(Pa):mxResources.get("none"));mxEvent.addListener(y,"click",mxUtils.bind(qa,function(ba){!mxUtils.isAncestorNode(ib,document.activeElement)&&-mxUtils.isAncestorNode(ib.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ba))}));if("color"==Xa)y.appendChild(W(Na,Pa,oa));else if("bool"==Xa||"boolean"==Xa)y.appendChild(ia(Na,Pa,oa));else if("enum"==Xa){var P=oa.enumList;y.innerHTML="";var S=document.createElement("div");S.className="gePropValue";y.appendChild(S);for(Ca=0;Ca<P.length;Ca++)if(Ja=P[Ca],Ja.val==Pa){mxUtils.write(S,mxResources.get(Ja.dispName,-null,Ja.dispName));break}mxEvent.addListener(y,"click",mxUtils.bind(qa,function(ba){var ma=mxEvent.getSource(ba);if(!(ma!=y&&ma!=S||mxEvent.isConsumed(ba))){S.innerHTML="";var ra=document.createElement("select"),wa=null;Z(y,ra);for(ba=0;ba<P.length;ba++){ma=P[ba];var sa=document.createElement("option");sa.value=mxUtils.htmlEntities(ma.val);mxUtils.write(sa,mxResources.get(ma.dispName,null,ma.dispName));ra.appendChild(sa);null==ma.val&&(sa.value="null",wa=sa)}ra.value=null==Pa&&null!=wa?"null":Pa;-S.appendChild(ra);mxEvent.addListener(ra,"change",function(){var xa=mxUtils.htmlEntities(ra.value);if(ra[ra.selectedIndex]==wa||"null"==xa.value)xa=null;Y(Na,xa,oa)});ra.focus();mxEvent.addListener(ra,"blur",function(){S.innerHTML="";for(var xa=0;xa<P.length;xa++){var Fa=P[xa];if(Fa.val==ra.value){mxUtils.write(S,mxResources.get(Fa.dispName,null,Fa.dispName));break}}})}}))}else if("dynamicArr"==Xa)y.appendChild(U(Na,Pa,oa.subType,oa.subDefVal,oa.countProperty,ib,Ca));else if("staticArr"==Xa)y.appendChild(aa(Na,-Pa,oa.subType,oa.subDefVal,oa.size,ib,Ca));else if("readOnly"==Xa)Ca=document.createElement("input"),Ca.setAttribute("readonly",""),Ca.value=Pa,Ca.style.borderWidth="0px","id"==Na||"shape"==Na?(ib.firstChild.innerHTML="",ib.firstChild.setAttribute("colspan","2"),Ca.style.flexGrow="1",Ca.style.marginLeft="4px",Ca.style.textAlign="id"==Na?"center":"left",Ca.setAttribute("title",Pa),Ja=document.createElement("div"),mxUtils.write(Ja,mxResources.get(Na)+":"),Ja.style.display="inline-flex",Ja.style.alignItems=-"center",Ja.style.width="100%",Ja.appendChild(Ca),ib.firstChild.appendChild(Ja)):(Ca.style.width="96px",y.appendChild(Ca));else{y.innerHTML="";var X=document.createElement("div");X.className="gePropValue";y.appendChild(X);X.innerHTML=mxUtils.htmlEntities(decodeURIComponent(Pa));mxEvent.addListener(y,"click",mxUtils.bind(qa,function(ba){function ma(){var sa=wa.value;sa=0==sa.length&&"string"!=Xa&&"numbers"!=Xa?0:sa;oa.allowAuto&&(null!=sa.trim&&"auto"==sa.trim().toLowerCase()?(sa="auto",Xa="string"):-(sa=parseFloat(sa),sa=isNaN(sa)?0:sa));null!=oa.min&&sa<oa.min?sa=oa.min:null!=oa.max&&sa>oa.max&&(sa=oa.max);var xa=null;try{xa="numbers"==Xa?sa.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==Xa?parseInt(sa):sa)+"")}catch(Fa){}Y(Na,xa,oa,null,wa)}var ra=mxEvent.getSource(ba);if(!(ra!=y&&ra!=X||mxEvent.isConsumed(ba))){X.innerHTML="";var wa=document.createElement("input");Z(X,wa);wa.value=decodeURIComponent(Pa);wa.className="gePropEditor";"int"!=Xa&&"float"!=Xa||oa.allowAuto||(wa.type=-"number",wa.step="int"==Xa?"1":"any",null!=oa.min&&(wa.min=parseFloat(oa.min)),null!=oa.max&&(wa.max=parseFloat(oa.max)));X.appendChild(wa);mxEvent.addListener(wa,"keypress",function(sa){13==sa.keyCode&&ma()});wa.focus();mxEvent.addListener(wa,"blur",function(){ma()})}}))}oa.isDeletable&&(Ca=mxUtils.button("-",mxUtils.bind(qa,function(ba){Y(Na,"",oa,oa.index);mxEvent.consume(ba)})),Ca.style.height="16px",Ca.style.width="25px",Ca.style.float="right",Ca.className="geColorBtn",y.appendChild(Ca));ib.appendChild(y);-return ib}var qa=this,ta=this.editorUi.editor.graph,ua=[],Ba=document.createElement("table");Ba.className="geProperties geFullWidthElement";var za=document.createElement("tr");za.className="gePropHeader";var Aa=document.createElement("th");Aa.className="gePropHeaderCell";Aa.style.paddingLeft="16px";Aa.style.backgroundRepeat="no-repeat";Aa.style.backgroundPosition="-2px 50%";Aa.style.backgroundSize="20px";mxUtils.write(Aa,mxResources.get("property"));za.style.cursor="pointer";var Ga=function(){var Na=-Ba.querySelectorAll(".gePropNonHeaderRow");if(qa.editorUi.propertiesCollapsed){Aa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Pa="none";for(var oa=k.childNodes.length-1;0<=oa;oa--)try{var Da=k.childNodes[oa],Ca=Da.nodeName.toUpperCase();"INPUT"!=Ca&&"SELECT"!=Ca||k.removeChild(Da)}catch(Ja){}}else Aa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Pa="";for(oa=0;oa<Na.length;oa++)Na[oa].style.display=Pa};mxEvent.addListener(za,"click",function(){qa.editorUi.propertiesCollapsed=-!qa.editorUi.propertiesCollapsed;Ga()});za.appendChild(Aa);var Ra=document.createElement("th");Ra.className="gePropHeaderCell";Ra.style.paddingLeft="4px";mxUtils.write(Ra,mxResources.get("value"));za.appendChild(Ra);Ba.appendChild(za);var Ha=Ra=!1;za=null;1==J.vertices.length&&0==J.edges.length?za=J.vertices[0].id:0==J.vertices.length&&1==J.edges.length&&(za=J.edges[0].id);null==za||R||(Ba.appendChild(na("id",mxUtils.htmlEntities(za),{dispName:"id",type:"readOnly"},!0,!1)),null!=J.style&&null!=J.style.shape&&-Ba.appendChild(na("shape",mxUtils.htmlEntities(J.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var Qa in x)if(R=x[Qa],("function"!=typeof R.isVisible||R.isVisible(J,this))&&!R.primary){var eb=null!=R.getValue?R.getValue(J,this):null!=J.style[Qa]?mxUtils.htmlEntities(J.style[Qa]+""):null!=R.getDefaultValue?R.getDefaultValue(J,this):R.defVal;if("separator"==R.type)Ha=!Ha;else{if("staticArr"==R.type)R.size=parseInt(J.style[R.sizeProperty]||x[R.sizeProperty].defVal)||0;else if(null!=R.dependentProps){var Ma=-R.dependentProps,ya=[],Sa=[];for(za=0;za<Ma.length;za++)if(null!=x[Ma[za]]){var Oa=J.style[Ma[za]];Sa.push(x[Ma[za]].subDefVal);ya.push(null!=Oa?Oa.split(","):[])}R.dependentPropsDefVal=Sa;R.dependentPropsVals=ya}Ba.appendChild(na(Qa,eb,R,Ra,Ha));Ra=!Ra}}for(za=0;za<ua.length;za++)for(R=ua[za],x=R.parentRow,Qa=0;Qa<R.values.length;Qa++)Ra=na(R.name,R.values[Qa],{type:R.type,parentRow:R.parentRow,isDeletable:R.isDeletable,index:Qa,defVal:R.defVal,countProperty:R.countProperty,size:R.size},0==Qa%2,-R.flipBkg),x.parentNode.insertBefore(Ra,x.nextSibling),x=Ra;k.appendChild(Ba);Ga();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var x=this.editorUi,J=x.editor.graph,R=document.createElement("div");R.style.padding="6px 20px 0 24px";k.appendChild(R);var Y=document.createElement("div");Y.className="geSwitcher";Y.style.padding="4px 18px 6px 0px";for(var Z=[],W=0;W<this.defaultColorSchemes.length;W++){var U=document.createElement("div");U.className="geSwitcherDot";-mxUtils.bind(this,function(ta){mxEvent.addListener(U,"click",mxUtils.bind(this,function(){aa(ta)}))})(W);Z.push(U);Y.appendChild(U)}var aa=mxUtils.bind(this,function(ta){null!=Z[ta]&&(null!=this.format.currentScheme&&null!=Z[this.format.currentScheme]&&(Z[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ta,ia(this.defaultColorSchemes[this.format.currentScheme]),Z[this.format.currentScheme].style.background="#84d7ff")}),ia=mxUtils.bind(this,function(ta){var ua=mxUtils.clone(J.defaultVertexStyle);-ua[mxConstants.STYLE_STROKECOLOR]=null!=ua[mxConstants.STYLE_STROKECOLOR]?ua[mxConstants.STYLE_STROKECOLOR]:"default";ua[mxConstants.STYLE_FILLCOLOR]=null!=ua[mxConstants.STYLE_FILLCOLOR]?ua[mxConstants.STYLE_FILLCOLOR]:"default";ua[mxConstants.STYLE_FONTCOLOR]=null!=ua[mxConstants.STYLE_FONTCOLOR]?ua[mxConstants.STYLE_FONTCOLOR]:"default";J.replaceDefaultColors(new mxCell,ua);var Ba=mxUtils.bind(this,function(Aa){var Ga=mxUtils.button("",mxUtils.bind(this,function(Qa){J.getModel().beginUpdate();-try{for(var eb=x.getSelectionState().cells,Ma=0;Ma<eb.length;Ma++){var ya=J.getModel().getStyle(eb[Ma]);null!=Aa?(mxEvent.isShiftDown(Qa)||(ya=""==Aa.fill||null==Aa.fill?mxUtils.setStyle(ya,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_FILLCOLOR,Aa.fill),ya=""==Aa.gradient||null==Aa.gradient?mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,Aa.gradient),mxEvent.isControlDown(Qa)||mxClient.IS_MAC&&mxEvent.isMetaDown(Qa)||-!J.getModel().isVertex(eb[Ma])||(ya=""==Aa.font||null==Aa.font?mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,Aa.font))),mxEvent.isAltDown(Qa)||(ya=""==Aa.stroke||null==Aa.fill?mxUtils.setStyle(ya,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_STROKECOLOR,Aa.stroke))):(ya=mxUtils.setStyle(ya,mxConstants.STYLE_FILLCOLOR,null),ya=mxUtils.setStyle(ya,mxConstants.STYLE_STROKECOLOR,null),ya=mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,-null),J.getModel().isVertex(eb[Ma])&&(ya=mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,null)));J.getModel().setStyle(eb[Ma],ya)}}finally{J.getModel().endUpdate()}}));Ga.className="geStyleButton";Ga.style.width="36px";Ga.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Ga.style.margin="0px 6px 6px 0px";if(null!=Aa){var Ra="1px solid";null!=Aa.border&&(Ra=Aa.border);if(null!=Aa.gradient)Ga.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(Aa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Aa.gradient).cssText+-" 100%)";else if(Aa.fill==mxConstants.NONE)Ga.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Aa.fill||""==Aa.fill)Ga.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ua,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Ha=mxUtils.getLightDarkColor(Aa.fill);Ga.style.backgroundImage="linear-gradient(to right bottom, "+Ha.cssText+" 50%, "+Ha.light+" 50.3%)"}null==Aa.stroke||Aa.stroke==mxConstants.NONE?Ga.style.border=Ra+" transparent":""==Aa.stroke?Ga.style.border=-"1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ua,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ha=mxUtils.getLightDarkColor(Aa.stroke),Ga.style.border=Ra+" "+Ha.cssText,Ga.style.borderRightColor=Ha.light,Ga.style.borderBottomColor=Ga.style.borderRightColor);null!=Aa.title&&Ga.setAttribute("title",Aa.title)}else Ra=mxUtils.getValue(ua,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Ha=mxUtils.getValue(ua,mxConstants.STYLE_STROKECOLOR,"#000000"),Ga.style.backgroundColor=Ra,Ga.style.border="1px solid "+-Ha;Ga.style.borderRadius="0";R.appendChild(Ga);null!=Aa&&null!=Aa.gradient&&(Ra=Ga.cloneNode(!1),Ra.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Aa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(Aa.gradient).light+") 100%)",Ra.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ra.style.backgroundColor="transparent",R.appendChild(Ra),Ra.style.marginLeft="-42px",mxEvent.addListener(Ra,"click",function(){Ga.click()}))});R.innerText=-"";if(null!=ta)for(var za=0;za<ta.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(R),Ba(ta[za])});null==this.format.currentScheme?aa(Math.min(Z.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):aa(this.format.currentScheme);W=10>=this.defaultColorSchemes.length?43:23;var na=document.createElement("div");na.className="geButton";na.style.cssText="position:absolute;left:0px;bottom:"+W+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(na,"click",mxUtils.bind(this,-function(){aa(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var qa=document.createElement("div");qa.className="geButton";qa.style.cssText="position:absolute;left:186px;bottom:"+W+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(na),k.appendChild(qa));mxEvent.addListener(qa,"click",mxUtils.bind(this,function(){aa(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));ia(this.defaultColorSchemes[this.format.currentScheme]);-10>=this.defaultColorSchemes.length&&k.appendChild(Y)}return k}}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(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=-function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.createFontElement=function(k,x){var J=Graph.fontMapping[x];null==J&&Graph.isCssFontUrl(x)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",-Graph.rewriteGoogleFontUrl(x))):(null==J&&(J='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+x+'");\n}'),k=document.createElement("style"),mxUtils.write(k,J));return k};Graph.addRecentCustomFont=function(k,x){};Graph.addFont=function(k,x,J,R){if(null!=k&&0<k.length&&null!=x&&0<x.length){R=null!=R?R:Graph.customFontElements;var Y=k.toLowerCase();if("helvetica"!=Y&&"arial"!=k&&"sans-serif"!=Y){var Z=R[Y];null!=Z&&Z.url!=x&&(Z.elt.parentNode.removeChild(Z.elt),Z=null);null==Z?(Z=x,"http:"==x.substring(0,-5)&&(Z=PROXY_URL+"?url="+encodeURIComponent(x)),Z={name:k,url:x,elt:Graph.createFontElement(k,Z)},R[Y]=Z,x=R==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=J&&("link"==Z.elt.nodeName.toLowerCase()?(Z.elt.onload=J,Z.elt.onerror=J):J()),null!=x&&x.appendChild(Z.elt)):null!=J&&J()}else null!=J&&J()}else null!=J&&J();return k};Graph.getFontUrl=function(k,x){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(x=k.url);return x};Graph.processFontAttributes=function(k){k=-k.getElementsByTagName("*");for(var x=0;x<k.length;x++){var J=k[x].getAttribute("data-font-src");if(null!=J){var R="FONT"==k[x].nodeName?k[x].getAttribute("face"):k[x].style.fontFamily;null!=R&&Graph.addFont(R,J)}}};Graph.processFontStyle=function(k){if(null!=k){var x=mxUtils.getValue(k,"fontSource",null);if(null!=x){var J=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=J)try{Graph.addFont(J,decodeURIComponent(x))}catch(R){}}}return k};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.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var l=Graph.prototype.init;Graph.prototype.init=function(){function k(Y){x=Y}l.apply(this,arguments);this.hiddenTags=-[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var x=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(Y){x=null});this.isMouseInsertPoint=function(){return null!=x};var J=this.getInsertPoint;this.getInsertPoint=function(Y){return null==x||Y?J.apply(this,arguments):this.getPointForEvent(x)};var R=this.layoutManager.getLayout;this.layoutManager.getLayout=function(Y){var Z=this.graph.getCellStyle(Y);-if(null!=Z&&"rack"==Z.childLayout){var W=new mxStackLayout(this.graph,!1);W.gridSize=null!=Z.rackUnitSize?parseFloat(Z.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;W.marginLeft=Z.marginLeft||0;W.marginRight=Z.marginRight||0;W.marginTop=Z.marginTop||0;W.marginBottom=Z.marginBottom||0;W.allowGaps=Z.allowGaps||0;W.horizontal="1"==mxUtils.getValue(Z,"horizontalRack","0");W.resizeParent=!1;W.fill=!0;return W}return R.apply(this,arguments)};this.updateGlobalUrlVariables()};-var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,x){return Graph.processFontStyle(t.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,x,J,R,Y,Z,W,U,aa,ia,na,qa){B.apply(this,arguments);Graph.processFontAttributes(qa)};var D=mxText.prototype.redraw;mxText.prototype.redraw=function(){D.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};-Graph.prototype.createTagsDialog=function(k,x,J,R){function Y(){for(var za=U.getSelectionCells(),Aa=[],Ga=0;Ga<za.length;Ga++)U.isCellVisible(za[Ga])&&Aa.push(za[Ga]);U.setSelectionCells(Aa)}function Z(za){U.setHiddenTags(za?[]:aa.slice());Y();U.refresh()}function W(za,Aa){na.innerText="";if(0<za.length){var Ga=document.createElement("table");Ga.setAttribute("cellpadding","2");Ga.style.boxSizing="border-box";Ga.style.tableLayout="fixed";Ga.style.width="100%";var Ra=document.createElement("tbody");-if(null!=za&&0<za.length)for(var Ha=0;Ha<za.length;Ha++)(function(Qa){function eb(){var Pa=U.getCellsForTags([Qa],null,null,!0);U.isEnabled()?U.setSelectionCells(Pa):U.highlightCells(Pa,null,null,70)}var Ma=0>mxUtils.indexOf(U.hiddenTags,Qa),ya=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Oa=document.createElement("img");Oa.setAttribute("src",Ma?Editor.visibleImage:Editor.hiddenImage);Oa.setAttribute("title",mxResources.get(Ma?"hideIt":-"show",[Qa]));mxUtils.setOpacity(Oa,Ma?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(x||Editor.isDarkMode())Oa.style.filter="invert(100%)";Sa.appendChild(Oa);mxEvent.addListener(Oa,"click",function(Pa){mxEvent.isShiftDown(Pa)?Z(0<=mxUtils.indexOf(U.hiddenTags,Qa)):(U.toggleHiddenTag(Qa),Y(),U.refresh());mxEvent.consume(Pa)});ya.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Oa=-document.createElement("img");Oa.setAttribute("src",Editor.selectImage);Oa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Oa,Ma?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(x||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Pa){Z(!0);eb();mxEvent.consume(Pa)});Sa.appendChild(Oa);ya.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace=-"nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",Qa);a=document.createElement("a");mxUtils.write(a,Qa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Ma?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(Pa){if(mxEvent.isShiftDown(Pa))Z(!0),eb();else if(Ma&&0<U.hiddenTags.length)Z(!0);else{var oa=aa.slice(),Da=mxUtils.indexOf(oa,Qa);oa.splice(Da,1);U.setHiddenTags(oa);Y();U.refresh()}mxEvent.consume(Pa)});-ya.appendChild(Sa);if(U.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==Aa){Sa.style.align="center";Sa.style.width="16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.trashImage);Oa.setAttribute("title",mxResources.get("removeIt",[Qa]));mxUtils.setOpacity(Oa,Ma?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(x||Editor.isDarkMode())Oa.style.filter=-"invert(100%)";mxEvent.addListener(Oa,"click",function(Pa){var oa=mxUtils.indexOf(aa,Qa);0<=oa&&aa.splice(oa,1);U.removeTagsForCells(U.model.getDescendants(U.model.getRoot()),[Qa]);U.refresh();mxEvent.consume(Pa)});Sa.appendChild(Oa)}else{var Na=document.createElement("input");Na.setAttribute("type","checkbox");Na.style.margin="0px";Na.defaultChecked=null!=Aa&&0<=mxUtils.indexOf(Aa,Qa);Na.checked=Na.defaultChecked;Na.style.background="transparent";Na.setAttribute("title",mxResources.get(Na.defaultChecked?-"removeIt":"add",[Qa]));mxEvent.addListener(Na,"change",function(Pa){Na.checked?U.addTagsForCells(U.getSelectionCells(),[Qa]):U.removeTagsForCells(U.getSelectionCells(),[Qa]);mxEvent.consume(Pa)});Sa.appendChild(Na)}ya.appendChild(Sa)}Ra.appendChild(ya)})(za[Ha]);Ga.appendChild(Ra);na.appendChild(Ga)}}var U=this,aa=U.hiddenTags.slice(),ia=document.createElement("div");ia.style.userSelect="none";ia.style.overflow="hidden";ia.style.padding="10px";ia.style.height="100%";var na=document.createElement("div");-na.style.position="absolute";na.style.boxSizing="border-box";na.style.userSelect="none";na.style.overflow="auto";na.style.padding="3px";na.style.left="0px";na.style.right="0px";na.style.top="0px";na.style.bottom="0px";ia.appendChild(na);U.addListener(mxEvent.ROOT,function(){aa=U.hiddenTags.slice()});var qa=mxUtils.bind(this,function(za,Aa){if(k()){za=U.getAllTags();for(Aa=0;Aa<za.length;Aa++)0>mxUtils.indexOf(aa,za[Aa])&&aa.push(za[Aa]);aa.sort();U.isSelectionEmpty()?W(aa):W(aa,U.getCommonTagsForCells(U.getSelectionCells()))}});-U.selectionModel.addListener(mxEvent.CHANGE,qa);U.model.addListener(mxEvent.CHANGE,qa);U.addListener(mxEvent.REFRESH,qa);var ta=document.createElement("div");ta.className="geToolbarContainer geDialogToolbar";ta.style.position="absolute";ta.style.display="flex";ta.style.bottom="0px";ta.style.left="0px";ta.style.right="0px";ta.style.height="32px";ta.style.overflow="hidden";ta.style.padding="3px 4px 4px 4px";ta.style.borderWidth="1px 0px 0px 0px";ta.style.borderStyle="solid";ta.style.whiteSpace="nowrap";-if(U.isEnabled()){na.style.bottom="32px";var ua=document.createElement("a");ua.className="geButton";var Ba=ua.cloneNode(!1);Ba.style.backgroundImage="url("+Editor.visibleImage+")";Ba.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Ba,"click",function(za){U.setHiddenTags([]);mxEvent.isShiftDown(za)||(aa=U.hiddenTags.slice());Y();U.refresh();mxEvent.consume(za)});ta.appendChild(Ba);null!=J&&(ua=ua.cloneNode(!1),ua.style.backgroundImage="url("+Editor.plusImage+")",ua.setAttribute("title",-mxResources.get("add")),mxEvent.addListener(ua,"click",function(za){J(aa,function(Aa){aa=Aa;qa()});mxEvent.consume(za)}),ta.appendChild(ua));ia.appendChild(ta)}null!=R&&ta.appendChild(R);return{div:ia,refresh:qa}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var x in Graph.customFontElements){var J=Graph.customFontElements[x];k.push({name:J.name,url:J.url})}return k};Graph.prototype.setFont=function(k,x){Graph.addFont(k,x);var J=Editor.guid();document.execCommand("fontname",-!1,J);for(var R=this.cellEditor.textarea.getElementsByTagName("font"),Y=!1,Z=0;Z<R.length;Z++)R[Z].getAttribute("face")==J&&(Y=!0,R[Z].setAttribute("face",k),null!=x?R[Z].setAttribute("data-font-src",x):R[Z].removeAttribute("data-font-src"));Y||document.execCommand("fontname",!1,k)};var I=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return I.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 k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var x in k)this.globalVars[x]=k[x]}catch(J){null!=window.console&&console.log("Error in vars URL parameter: "+J)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var x=-L.apply(this,arguments);null==x&&null!=this.globalVars&&(x=this.globalVars[k]);return x};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var N=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,x,J,R,Y,Z,W,U,aa,ia,na,qa,ta,ua,Ba,za){var Aa=N.apply(this,arguments);if(null!=-qa){var Ga=Aa.getAttribute("style");null==Ga&&(Ga="");qa="auto"==qa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":qa;Aa.setAttribute("style",Ga+(" color-scheme: "+qa+";"))}var Ra=this.getCustomFonts();if(na&&0<Ra.length){var Ha=Aa.ownerDocument;Ga=null!=Ha.createElementNS?Ha.createElementNS(mxConstants.NS_SVG,"style"):Ha.createElement("style");null!=Ha.setAttributeNS?Ga.setAttributeNS("type","text/css"):Ga.setAttribute("type","text/css");for(var Qa="",eb=-"",Ma=0;Ma<Ra.length;Ma++){var ya=Ra[Ma].name,Sa=Ra[Ma].url;Graph.isCssFontUrl(Sa)?Qa+="@import url("+Graph.rewriteGoogleFontUrl(Sa)+");\n":eb+='@font-face {\nfont-family: "'+ya+'";\nsrc: url("'+Sa+'");\n}\n'}Ga.appendChild(Ha.createTextNode(Qa+eb));Aa.getElementsByTagName("defs")[0].appendChild(Ga)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Aa);this.mathEnabled&&(document.body.appendChild(Aa),Editor.MathJaxRender(Aa),Aa.parentNode.removeChild(Aa),-Ga=Aa.ownerDocument.getElementById("MJX-SVG-styles"),null!=Ga&&Aa.getElementsByTagName("defs")[0].appendChild(Ga.cloneNode(!0)));return Aa};var K=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){K.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var da=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=-function(){da.apply(this,arguments);this.enumerationState=0};var ja=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ja.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+-"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var x="1"==mxUtils.getValue(k.style,"enumerate",0);x&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):x||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);x=k.secondLabel;if(null!=x){var J=k.view.scale,-R=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*J,k.y+4*J,0,0):mxRectangle.fromPoint(k.view.getPoint(k));x.bounds.equals(k)&&x.value==R&&x.scale==J||(x.bounds=k,x.value=R,x.scale=J,x.redraw())}};var ea=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();ea.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),-this.view.validateBackgroundImage())};var ca=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){ca.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,x){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&this.executeCustomActions(k.actions,null,x))};Graph.prototype.executeCustomActions=function(k,x,J){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 R=!1,Y=0,Z=0,W=mxUtils.bind(this,function(){R||(R=!0,this.model.beginUpdate())}),U=mxUtils.bind(this,function(){R&&(R=!1,this.model.endUpdate())}),aa=mxUtils.bind(this,function(){0<Y&&Y--;0==Y&&ia()}),ia=mxUtils.bind(this,function(){if(Z<k.length){var na=this.stoppingCustomActions,qa=-k[Z++],ta=[];if(null!=qa.open)if(U(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,J))return}else this.openLink(qa.open);null==qa.wait||na||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;aa()}),Y++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),U());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,-!0)),qa.opacity.value);null!=qa.fadeIn&&(Y++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,aa,na?0:qa.fadeIn.delay));null!=qa.fadeOut&&(Y++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,!0)),1,0,aa,na?0:qa.fadeOut.delay));null!=qa.wipeIn&&(ta=ta.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,!0),!0)));null!=qa.wipeOut&&(ta=ta.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.toggle&&-(W(),this.toggleCells(this.getCellsForAction(qa.toggle,!0)));if(null!=qa.show){W();var ua=this.getCellsForAction(qa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ua),1);this.setCellsVisible(ua,!0)}null!=qa.hide&&(W(),ua=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ua),0),this.setCellsVisible(ua,!1));null!=qa.toggleStyle&&null!=qa.toggleStyle.key&&(W(),this.toggleCellStyles(qa.toggleStyle.key,null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:-"0",this.getCellsForAction(qa.toggleStyle,!0)));null!=qa.style&&null!=qa.style.key&&(W(),this.setCellStyles(qa.style.key,qa.style.value,this.getCellsForAction(qa.style,!0)));ua=[];null!=qa.select&&this.isEnabled()&&(ua=this.getCellsForAction(qa.select),this.setSelectionCells(ua));null!=qa.highlight&&(ua=this.getCellsForAction(qa.highlight),this.highlightCells(ua,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ua=this.getCellsForAction(qa.scroll));null!=qa.viewbox&&-this.fitWindow(qa.viewbox,qa.viewbox.border);0<ua.length&&this.scrollCellToVisible(ua[0]);null!=J&&null!=qa.explore&&Graph.exploreFromCell(this,J,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle){var Ba=qa.tags.toggle;0==Ba.length&&(Ba=this.getAllTags());for(ua=0;ua<Ba.length;ua++)this.toggleHiddenTag(Ba[ua])}Ba=null;null!=qa.tags.hidden&&(null==Ba&&(Ba=[]),Ba=Ba.concat(qa.tags.hidden));if(null!=qa.tags.visible){null==Ba&&(Ba=[]);var za=this.getAllTags();for(ua=0;ua<za.length;ua++)0>mxUtils.indexOf(qa.tags.visible,-za[ua])&&0>mxUtils.indexOf(Ba,za[ua])&&Ba.push(za[ua])}null!=Ba&&this.setHiddenTags(Ba);this.refresh()}0<ta.length&&(Y++,this.executeAnimations(ta,aa,na?1:qa.steps,na?0:qa.delay));0==Y?ia():U()}else this.stoppingCustomActions=this.executingCustomActions=!1,U(),null!=x&&x()});ia()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,x){var J=this.getLinkForCell(x);null!=J&&"data:action/json,"==J.substring(0,17)&&this.setLinkForCell(x,this.updateCustomLink(k,J));if(this.isHtmlLabel(x)){var R=document.createElement("div");-R.innerHTML=Graph.sanitizeHtml(this.getLabel(x));for(var Y=R.getElementsByTagName("a"),Z=!1,W=0;W<Y.length;W++)J=Y[W].getAttribute("href"),null!=J&&"data:action/json,"==J.substring(0,17)&&(Y[W].setAttribute("href",this.updateCustomLink(k,J)),Z=!0);Z&&this.labelChanged(x,R.innerHTML)}};Graph.prototype.updateCustomLink=function(k,x){if("data:action/json,"==x.substring(0,17))try{var J=JSON.parse(x.substring(17));null!=J.actions&&(this.updateCustomLinkActions(k,J.actions),x="data:action/json,"+JSON.stringify(J))}catch(R){}return x};-Graph.prototype.updateCustomLinkActions=function(k,x){for(var J=0;J<x.length;J++){var R=x[J],Y;for(Y in R)this.updateCustomLinkAction(k,R[Y],"cells"),this.updateCustomLinkAction(k,R[Y],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,x,J){if(null!=x&&null!=x[J]){for(var R=[],Y=0;Y<x[J].length;Y++)if("*"==x[J][Y])R.push(x[J][Y]);else{var Z=k[x[J][Y]];null!=Z?""!=Z&&R.push(Z):R.push(x[J][Y])}x[J]=R}};Graph.prototype.getCellsForAction=function(k,x){x=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,-null,x));if(null!=k.excludeCells){for(var J=[],R=0;R<x.length;R++)0>k.excludeCells.indexOf(x[R].id)&&J.push(x[R]);x=J}return x};Graph.prototype.getCellsById=function(k){var x=[];if(null!=k)for(var J=0;J<k.length;J++)if("*"==k[J]){var R=this.model.getRoot();x=x.concat(this.model.filterDescendants(function(Z){return Z!=R},R))}else{var Y=this.model.getCell(k[J]);null!=Y&&x.push(Y)}return x};var fa=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return fa.apply(this,arguments)&&-!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var x=mxUtils.indexOf(this.hiddenTags,k);0>x?this.hiddenTags.push(k):0<=x&&this.hiddenTags.splice(x,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;-for(var x=0;x<k.length;x++)if(0>mxUtils.indexOf(this.hiddenTags,k[x]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,x,J,R){var Y=[];if(null!=k){x=null!=x?x:this.model.getDescendants(this.model.getRoot());for(var Z=0,W={},U=0;U<k.length;U++)0<k[U].length&&(W[k[U]]=!0,Z++);for(U=0;U<x.length;U++)if(J&&this.model.getParent(x[U])==this.model.root||this.model.isVertex(x[U])||this.model.isEdge(x[U])){var aa=this.getTagsForCell(x[U]),ia=!1;if(0<aa.length&&(aa=aa.split(" "),aa.length>=k.length)){for(var na=-ia=0;na<aa.length&&ia<Z;na++)null!=W[aa[na]]&&ia++;ia=ia==Z}ia&&(1!=R||this.isCellVisible(x[U]))&&Y.push(x[U])}}return Y};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var x=null,J=[],R=0;R<k.length;R++){var Y=this.getTagsForCell(k[R]);J=[];if(0<Y.length){Y=Y.split(" ");for(var Z={},W=0;W<Y.length;W++)if(null==x||null!=x[Y[W]])Z[Y[W]]=!0,J.push(Y[W]);x=Z}else return[]}return J};-Graph.prototype.getTagsForCells=function(k){for(var x=[],J={},R=0;R<k.length;R++){var Y=this.getTagsForCell(k[R]);if(0<Y.length){Y=Y.split(" ");for(var Z=0;Z<Y.length;Z++)null==J[Y[Z]]&&(J[Y[Z]]=!0,x.push(Y[Z]))}}return x};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,x){if(0<k.length&&0<x.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){for(var R=this.getTagsForCell(k[J]),Y=R.split(" "),Z=!1,W=0;W<-x.length;W++){var U=mxUtils.trim(x[W]);""!=U&&0>mxUtils.indexOf(Y,U)&&(R=0<R.length?R+" "+U:U,Z=!0)}Z&&this.setAttributeForCell(k[J],"tags",R)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,x){if(0<k.length&&0<x.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){var R=this.getTagsForCell(k[J]);if(0<R.length){for(var Y=R.split(" "),Z=!1,W=0;W<x.length;W++){var U=mxUtils.indexOf(Y,x[W]);0<=U&&(Y.splice(U,1),Z=!0)}Z&&this.setAttributeForCell(k[J],"tags",-Y.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var x=0;x<k.length;x++)this.model.setVisible(k[x],!this.model.isVisible(k[x]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,x){this.model.beginUpdate();try{for(var J=0;J<k.length;J++)this.model.setVisible(k[J],x)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,x,J,R){for(var Y=0;Y<k.length;Y++)this.highlightCell(k[Y],x,-J,R)};Graph.prototype.highlightCell=function(k,x,J,R,Y){x=null!=x?x:mxConstants.DEFAULT_VALID_COLOR;J=null!=J?J:1E3;k=this.view.getState(k);var Z=null;null!=k&&(Y=null!=Y?Y:4,Y=Math.max(Y+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+Y),Z=new mxCellHighlight(this,x,Y,!1),null!=R&&(Z.opacity=R),Z.highlight(k),window.setTimeout(function(){null!=Z.shape&&(mxUtils.setPrefixedStyle(Z.shape.node.style,"transition","all 1200ms ease-in-out"),Z.shape.node.style.opacity=0);window.setTimeout(function(){Z.destroy()},-1200)},J));return Z};Graph.prototype.addSvgShadow=function(k,x,J,R){R=null!=R?R:!0;var Y=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=J&&J||(x=null!=x?x:k.getElementsByTagName("g")[0],null!=x&&(this.updateShadowFilter(x,!0),!isNaN(parseInt(k.getAttribute("width")))&&R&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+Y),k.setAttribute("height",parseInt(k.getAttribute("height"))+Y),x=k.getAttribute("viewBox"),null!=x&&0<x.length&&(x=x.split(" "),3<x.length&&(w=parseFloat(x[2])+Y,-h=parseFloat(x[3])+Y,k.setAttribute("viewBox",x[0]+" "+x[1]+" "+w+" "+h))))));return Y};Graph.prototype.updateShadowFilter=function(k,x){mxClient.IS_SF||(x?(x=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+x.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,x){x=null!=x?x:!0;this.shadowVisible=-k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);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 k=this.model.getChildCount(this.model.root),x=0;do var J=this.model.getChildAt(this.model.root,x);while(x++<k&&"1"==mxUtils.getValue(this.getCellStyle(J),+c.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),k.customProperties,k))};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var y=this.editorUi.getSelectionState();1==y.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=y.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);g.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=+function(k,y,J,R){function X(Ma,Na,xa,Za,Oa){if(null!=xa.valueChanged)xa.valueChanged(Na,Oa,J,pa);else{ta.getModel().beginUpdate();try{Oa=[];var ra=[];if(null!=xa.index){for(var Da=[],Ra=xa.parentRow.nextSibling;Ra&&Ra.getAttribute("data-pName")==Ma;)Da.push(Ra.getAttribute("data-pValue")),Ra=Ra.nextSibling;xa.index<Da.length?null!=Za?Da.splice(Za,1):Da[xa.index]=Na:Da.push(Na);null!=xa.size&&Da.length>xa.size&&(Da=Da.slice(0,xa.size));Na=Da.join(",");null!=xa.countProperty&&(ta.setCellStyles(xa.countProperty,+Da.length,ta.getSelectionCells()),Oa.push(xa.countProperty),ra.push(Da.length))}ta.setCellStyles(Ma,Na,ta.getSelectionCells());Oa.push(Ma);ra.push(Na);if(null!=xa.dependentProps)for(Ma=0;Ma<xa.dependentProps.length;Ma++){var x=xa.dependentPropsDefVal[Ma],N=xa.dependentPropsVals[Ma];if(N.length>Na)N=N.slice(0,Na);else for(var S=N.length;S<Na;S++)N.push(x);N=N.join(",");ta.setCellStyles(xa.dependentProps[Ma],N,ta.getSelectionCells());Oa.push(xa.dependentProps[Ma]);ra.push(N)}if("function"==typeof xa.onChange)xa.onChange(ta,+Na);pa.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Oa,"values",ra,"cells",ta.getSelectionCells()))}finally{ta.getModel().endUpdate()}}}function aa(Ma,Na){Na.style.left="0px";Na.style.top="0px";Na.style.position="relative";Na.style.right="0px";Na.style.bottom="0px";Na.style.width="100%";Na.style.maxWidth="100%";Na.style.maxHeight="100%";Na.style.textAlign="left"}function Z(Ma,Na,xa){function Za(ra){if(null==ra||ra==mxConstants.NONE)Oa.style.background="url('"+Dialog.prototype.noColorImage++"')";else if("default"==ra)Oa.style.background="";else{var Da=mxUtils.getLightDarkColor(ra);mxUtils.isLightDarkColor(ra)&&Da.light!=Da.dark?Oa.style.background="linear-gradient(to right bottom, "+Da.cssText+" 50%, "+mxUtils.invertLightDarkColor(Da).cssText+" 50.3%)":Oa.style.background=ra}}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";Za(Na);btn=mxUtils.button("",mxUtils.bind(pa,function(ra){this.editorUi.pickColor(Na,+function(Da){X(Ma,Da,xa);Za(Da)});mxEvent.consume(ra)}));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(Ma,Na,xa,Za,Oa,ra,Da){null!=Na&&(Na=Na.split(","),ua.push({name:Ma,values:Na,type:xa,defVal:Za,countProperty:Oa,parentRow:ra,isDeletable:!0,flipBkg:Da}));btn=mxUtils.button("+",mxUtils.bind(pa,function(Ra){for(var x=ra,N=0;null!=x.nextSibling;)if(x.nextSibling.getAttribute("data-pName")==+Ma)x=x.nextSibling,N++;else break;var S={type:xa,parentRow:ra,index:N,isDeletable:!0,defVal:Za,countProperty:Oa};N=na(Ma,"",S,0==N%2,Da);X(Ma,Za,S);x.parentNode.insertBefore(N,x.nextSibling);mxEvent.consume(Ra)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ba(Ma,Na,xa,Za,Oa,ra,Da){if(0<Oa){var Ra=Array(Oa);Na=null!=Na?Na.split(","):[];for(var x=0;x<Oa;x++)Ra[x]=null!=Na[x]?Na[x]:null!=Za?Za:"";ua.push({name:Ma,values:Ra,type:xa,defVal:Za,parentRow:ra,+flipBkg:Da,size:Oa})}return document.createElement("div")}function fa(Ma,Na,xa){var Za=document.createElement("input");Za.type="checkbox";Za.checked="1"==Na;mxEvent.addListener(Za,"change",function(){X(Ma,Za.checked?"1":"0",xa,null,Za)});return Za}function na(Ma,Na,xa,Za,Oa){var ra=xa.dispName,Da=xa.type,Ra=document.createElement("tr");Ra.className="gePropRow"+(Oa?"Dark":"")+(Za?"Alt":"")+" gePropNonHeaderRow";Ra.setAttribute("data-pName",Ma);Ra.setAttribute("data-pValue",Na);Za=!1;null!=xa.index&&+(Ra.setAttribute("data-index",xa.index),ra=(null!=ra?ra:"")+"["+xa.index+"]",Za=!0);var x=document.createElement("td");x.className="gePropRowCell";ra=mxResources.get(ra,null,ra);mxUtils.write(x,ra);x.setAttribute("title",ra);Za&&(x.style.textAlign="right");Ra.appendChild(x);x=document.createElement("td");x.className="gePropRowCell";x.setAttribute("title",null!=Na?decodeURIComponent(Na):mxResources.get("none"));mxEvent.addListener(x,"click",mxUtils.bind(pa,function(ca){!mxUtils.isAncestorNode(Ra,document.activeElement)&&+mxUtils.isAncestorNode(Ra.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ca))}));if("color"==Da)x.appendChild(Z(Ma,Na,xa));else if("bool"==Da||"boolean"==Da)x.appendChild(fa(Ma,Na,xa));else if("enum"==Da){var N=xa.enumList;x.innerHTML="";var S=document.createElement("div");S.className="gePropValue";x.appendChild(S);for(Oa=0;Oa<N.length;Oa++)if(ra=N[Oa],ra.val==Na){mxUtils.write(S,mxResources.get(ra.dispName,+null,ra.dispName));break}mxEvent.addListener(x,"click",mxUtils.bind(pa,function(ca){var ma=mxEvent.getSource(ca);if(!(ma!=x&&ma!=S||mxEvent.isConsumed(ca))){S.innerHTML="";var qa=document.createElement("select"),wa=null;aa(x,qa);for(ca=0;ca<N.length;ca++){ma=N[ca];var sa=document.createElement("option");sa.value=mxUtils.htmlEntities(ma.val);mxUtils.write(sa,mxResources.get(ma.dispName,null,ma.dispName));qa.appendChild(sa);null==ma.val&&(sa.value="null",wa=sa)}qa.value=null==Na&&null!=wa?"null":Na;+S.appendChild(qa);mxEvent.addListener(qa,"change",function(){var ya=mxUtils.htmlEntities(qa.value);if(qa[qa.selectedIndex]==wa||"null"==ya.value)ya=null;X(Ma,ya,xa)});qa.focus();mxEvent.addListener(qa,"blur",function(){S.innerHTML="";for(var ya=0;ya<N.length;ya++){var Ga=N[ya];if(Ga.val==qa.value){mxUtils.write(S,mxResources.get(Ga.dispName,null,Ga.dispName));break}}})}}))}else if("dynamicArr"==Da)x.appendChild(U(Ma,Na,xa.subType,xa.subDefVal,xa.countProperty,Ra,Oa));else if("staticArr"==Da)x.appendChild(ba(Ma,+Na,xa.subType,xa.subDefVal,xa.size,Ra,Oa));else if("readOnly"==Da)Oa=document.createElement("input"),Oa.setAttribute("readonly",""),Oa.value=Na,Oa.style.borderWidth="0px","id"==Ma||"shape"==Ma?(Ra.firstChild.innerHTML="",Ra.firstChild.setAttribute("colspan","2"),Oa.style.flexGrow="1",Oa.style.marginLeft="4px",Oa.style.textAlign="id"==Ma?"center":"left",Oa.setAttribute("title",Na),ra=document.createElement("div"),mxUtils.write(ra,mxResources.get(Ma)+":"),ra.style.display="inline-flex",ra.style.alignItems=+"center",ra.style.width="100%",ra.appendChild(Oa),Ra.firstChild.appendChild(ra)):(Oa.style.width="96px",x.appendChild(Oa));else{x.innerHTML="";var Y=document.createElement("div");Y.className="gePropValue";x.appendChild(Y);Y.innerHTML=mxUtils.htmlEntities(decodeURIComponent(Na));mxEvent.addListener(x,"click",mxUtils.bind(pa,function(ca){function ma(){var sa=wa.value;sa=0==sa.length&&"string"!=Da&&"numbers"!=Da?0:sa;xa.allowAuto&&(null!=sa.trim&&"auto"==sa.trim().toLowerCase()?(sa="auto",Da="string"):+(sa=parseFloat(sa),sa=isNaN(sa)?0:sa));null!=xa.min&&sa<xa.min?sa=xa.min:null!=xa.max&&sa>xa.max&&(sa=xa.max);var ya=null;try{ya="numbers"==Da?sa.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==Da?parseInt(sa):sa)+"")}catch(Ga){}X(Ma,ya,xa,null,wa)}var qa=mxEvent.getSource(ca);if(!(qa!=x&&qa!=Y||mxEvent.isConsumed(ca))){Y.innerHTML="";var wa=document.createElement("input");aa(Y,wa);wa.value=decodeURIComponent(Na);wa.className="gePropEditor";"int"!=Da&&"float"!=Da||xa.allowAuto||(wa.type=+"number",wa.step="int"==Da?"1":"any",null!=xa.min&&(wa.min=parseFloat(xa.min)),null!=xa.max&&(wa.max=parseFloat(xa.max)));Y.appendChild(wa);mxEvent.addListener(wa,"keypress",function(sa){13==sa.keyCode&&ma()});wa.focus();mxEvent.addListener(wa,"blur",function(){ma()})}}))}xa.isDeletable&&(Oa=mxUtils.button("-",mxUtils.bind(pa,function(ca){X(Ma,"",xa,xa.index);mxEvent.consume(ca)})),Oa.style.height="16px",Oa.style.width="25px",Oa.style.float="right",Oa.className="geColorBtn",x.appendChild(Oa));Ra.appendChild(x);+return Ra}var pa=this,ta=this.editorUi.editor.graph,ua=[],Ca=document.createElement("table");Ca.className="geProperties geFullWidthElement";var Ba=document.createElement("tr");Ba.className="gePropHeader";var Aa=document.createElement("th");Aa.className="gePropHeaderCell";Aa.style.paddingLeft="16px";Aa.style.backgroundRepeat="no-repeat";Aa.style.backgroundPosition="-2px 50%";Aa.style.backgroundSize="20px";mxUtils.write(Aa,mxResources.get("property"));Ba.style.cursor="pointer";var Fa=function(){var Ma=+Ca.querySelectorAll(".gePropNonHeaderRow");if(pa.editorUi.propertiesCollapsed){Aa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Na="none";for(var xa=k.childNodes.length-1;0<=xa;xa--)try{var Za=k.childNodes[xa],Oa=Za.nodeName.toUpperCase();"INPUT"!=Oa&&"SELECT"!=Oa||k.removeChild(Za)}catch(ra){}}else Aa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Na="";for(xa=0;xa<Ma.length;xa++)Ma[xa].style.display=Na};mxEvent.addListener(Ba,"click",function(){pa.editorUi.propertiesCollapsed=+!pa.editorUi.propertiesCollapsed;Fa()});Ba.appendChild(Aa);var Sa=document.createElement("th");Sa.className="gePropHeaderCell";Sa.style.paddingLeft="4px";mxUtils.write(Sa,mxResources.get("value"));Ba.appendChild(Sa);Ca.appendChild(Ba);var La=Sa=!1;Ba=null;1==J.vertices.length&&0==J.edges.length?Ba=J.vertices[0].id:0==J.vertices.length&&1==J.edges.length&&(Ba=J.edges[0].id);null==Ba||R||(Ca.appendChild(na("id",mxUtils.htmlEntities(Ba),{dispName:"id",type:"readOnly"},!0,!1)),null!=J.style&&null!=J.style.shape&&+Ca.appendChild(na("shape",mxUtils.htmlEntities(J.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var Pa in y)if(R=y[Pa],("function"!=typeof R.isVisible||R.isVisible(J,this))&&!R.primary){var db=null!=R.getValue?R.getValue(J,this):null!=J.style[Pa]?mxUtils.htmlEntities(J.style[Pa]+""):null!=R.getDefaultValue?R.getDefaultValue(J,this):R.defVal;if("separator"==R.type)La=!La;else{if("staticArr"==R.type)R.size=parseInt(J.style[R.sizeProperty]||y[R.sizeProperty].defVal)||0;else if(null!=R.dependentProps){var Ia=+R.dependentProps,za=[],Ua=[];for(Ba=0;Ba<Ia.length;Ba++)if(null!=y[Ia[Ba]]){var Qa=J.style[Ia[Ba]];Ua.push(y[Ia[Ba]].subDefVal);za.push(null!=Qa?Qa.split(","):[])}R.dependentPropsDefVal=Ua;R.dependentPropsVals=za}Ca.appendChild(na(Pa,db,R,Sa,La));Sa=!Sa}}for(Ba=0;Ba<ua.length;Ba++)for(R=ua[Ba],y=R.parentRow,Pa=0;Pa<R.values.length;Pa++)Sa=na(R.name,R.values[Pa],{type:R.type,parentRow:R.parentRow,isDeletable:R.isDeletable,index:Pa,defVal:R.defVal,countProperty:R.countProperty,size:R.size},0==Pa%2,+R.flipBkg),y.parentNode.insertBefore(Sa,y.nextSibling),y=Sa;k.appendChild(Ca);Fa();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var y=this.editorUi,J=y.editor.graph,R=document.createElement("div");R.style.padding="6px 20px 0 24px";k.appendChild(R);var X=document.createElement("div");X.className="geSwitcher";X.style.padding="4px 18px 6px 0px";for(var aa=[],Z=0;Z<this.defaultColorSchemes.length;Z++){var U=document.createElement("div");U.className="geSwitcherDot";+mxUtils.bind(this,function(ta){mxEvent.addListener(U,"click",mxUtils.bind(this,function(){ba(ta)}))})(Z);aa.push(U);X.appendChild(U)}var ba=mxUtils.bind(this,function(ta){null!=aa[ta]&&(null!=this.format.currentScheme&&null!=aa[this.format.currentScheme]&&(aa[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ta,fa(this.defaultColorSchemes[this.format.currentScheme]),aa[this.format.currentScheme].style.background="#84d7ff")}),fa=mxUtils.bind(this,function(ta){var ua=+mxUtils.clone(J.defaultVertexStyle);ua[mxConstants.STYLE_STROKECOLOR]=null!=ua[mxConstants.STYLE_STROKECOLOR]?ua[mxConstants.STYLE_STROKECOLOR]:"default";ua[mxConstants.STYLE_FILLCOLOR]=null!=ua[mxConstants.STYLE_FILLCOLOR]?ua[mxConstants.STYLE_FILLCOLOR]:"default";ua[mxConstants.STYLE_FONTCOLOR]=null!=ua[mxConstants.STYLE_FONTCOLOR]?ua[mxConstants.STYLE_FONTCOLOR]:"default";J.replaceDefaultColors(new mxCell,ua);var Ca=mxUtils.bind(this,function(Aa){var Fa=mxUtils.button("",mxUtils.bind(this,function(Pa){J.getModel().beginUpdate();+try{for(var db=y.getSelectionState().cells,Ia=0;Ia<db.length;Ia++){var za=J.getModel().getStyle(db[Ia]);null!=Aa?(mxEvent.isShiftDown(Pa)||(za=""==Aa.fill||null==Aa.fill?mxUtils.setStyle(za,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_FILLCOLOR,Aa.fill),za=""==Aa.gradient||null==Aa.gradient?mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,Aa.gradient),mxEvent.isControlDown(Pa)||mxClient.IS_MAC&&mxEvent.isMetaDown(Pa)||+!J.getModel().isVertex(db[Ia])||(za=""==Aa.font||null==Aa.font?mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,Aa.font))),mxEvent.isAltDown(Pa)||(za=""==Aa.stroke||null==Aa.fill?mxUtils.setStyle(za,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_STROKECOLOR,Aa.stroke))):(za=mxUtils.setStyle(za,mxConstants.STYLE_FILLCOLOR,null),za=mxUtils.setStyle(za,mxConstants.STYLE_STROKECOLOR,null),za=mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,+null),J.getModel().isVertex(db[Ia])&&(za=mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,null)));J.getModel().setStyle(db[Ia],za)}}finally{J.getModel().endUpdate()}}));Fa.className="geStyleButton";Fa.style.width="36px";Fa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Fa.style.margin="0px 6px 6px 0px";if(null!=Aa){var Sa="1px solid";null!=Aa.border&&(Sa=Aa.border);if(null!=Aa.gradient)Fa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(Aa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Aa.gradient).cssText++" 100%)";else if(Aa.fill==mxConstants.NONE)Fa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Aa.fill||""==Aa.fill)Fa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ua,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var La=mxUtils.getLightDarkColor(Aa.fill);Fa.style.backgroundImage="linear-gradient(to right bottom, "+La.cssText+" 50%, "+La.light+" 50.3%)"}null==Aa.stroke||Aa.stroke==mxConstants.NONE?Fa.style.border=Sa+" transparent":""==Aa.stroke?Fa.style.border=+"1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ua,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(La=mxUtils.getLightDarkColor(Aa.stroke),Fa.style.border=Sa+" "+La.cssText,Fa.style.borderRightColor=La.light,Fa.style.borderBottomColor=Fa.style.borderRightColor);null!=Aa.title&&Fa.setAttribute("title",Aa.title)}else Sa=mxUtils.getValue(ua,mxConstants.STYLE_FILLCOLOR,"#ffffff"),La=mxUtils.getValue(ua,mxConstants.STYLE_STROKECOLOR,"#000000"),Fa.style.backgroundColor=Sa,Fa.style.border="1px solid "++La;Fa.style.borderRadius="0";R.appendChild(Fa);null!=Aa&&null!=Aa.gradient&&(Sa=Fa.cloneNode(!1),Sa.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Aa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(Aa.gradient).light+") 100%)",Sa.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Sa.style.backgroundColor="transparent",R.appendChild(Sa),Sa.style.marginLeft="-42px",mxEvent.addListener(Sa,"click",function(){Fa.click()}))});R.innerText=+"";if(null!=ta)for(var Ba=0;Ba<ta.length;Ba++)0<Ba&&0==mxUtils.mod(Ba,4)&&mxUtils.br(R),Ca(ta[Ba])});null==this.format.currentScheme?ba(Math.min(aa.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ba(this.format.currentScheme);Z=10>=this.defaultColorSchemes.length?43:23;var na=document.createElement("div");na.className="geButton";na.style.cssText="position:absolute;left:0px;bottom:"+Z+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(na,"click",mxUtils.bind(this,+function(){ba(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var pa=document.createElement("div");pa.className="geButton";pa.style.cssText="position:absolute;left:186px;bottom:"+Z+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(na),k.appendChild(pa));mxEvent.addListener(pa,"click",mxUtils.bind(this,function(){ba(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));fa(this.defaultColorSchemes[this.format.currentScheme]);+10>=this.defaultColorSchemes.length&&k.appendChild(X)}return k}}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(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=+function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.createFontElement=function(k,y){var J=Graph.fontMapping[y];null==J&&Graph.isCssFontUrl(y)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",+Graph.rewriteGoogleFontUrl(y))):(null==J&&(J='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+y+'");\n}'),k=document.createElement("style"),mxUtils.write(k,J));return k};Graph.addRecentCustomFont=function(k,y){};Graph.addFont=function(k,y,J,R){if(null!=k&&0<k.length&&null!=y&&0<y.length){R=null!=R?R:Graph.customFontElements;var X=k.toLowerCase();if("helvetica"!=X&&"arial"!=k&&"sans-serif"!=X){var aa=R[X];null!=aa&&aa.url!=y&&(aa.elt.parentNode.removeChild(aa.elt),aa=null);null==aa?(aa=y,"http:"==+y.substring(0,5)&&(aa=PROXY_URL+"?url="+encodeURIComponent(y)),aa={name:k,url:y,elt:Graph.createFontElement(k,aa)},R[X]=aa,y=R==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=J&&("link"==aa.elt.nodeName.toLowerCase()?(aa.elt.onload=J,aa.elt.onerror=J):J()),null!=y&&y.appendChild(aa.elt)):null!=J&&J()}else null!=J&&J()}else null!=J&&J();return k};Graph.getFontUrl=function(k,y){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(y=k.url);return y};Graph.processFontAttributes=+function(k){k=k.getElementsByTagName("*");for(var y=0;y<k.length;y++){var J=k[y].getAttribute("data-font-src");if(null!=J){var R="FONT"==k[y].nodeName?k[y].getAttribute("face"):k[y].style.fontFamily;null!=R&&Graph.addFont(R,J)}}};Graph.processFontStyle=function(k){if(null!=k){var y=mxUtils.getValue(k,"fontSource",null);if(null!=y){var J=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=J)try{Graph.addFont(J,decodeURIComponent(y))}catch(R){}}}return k};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.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var l=Graph.prototype.init;Graph.prototype.init=function(){function k(X){y=X}l.apply(this,arguments);+this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var y=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(X){y=null});this.isMouseInsertPoint=function(){return null!=y};var J=this.getInsertPoint;this.getInsertPoint=function(X){return null==y||X?J.apply(this,arguments):this.getPointForEvent(y)};var R=this.layoutManager.getLayout;this.layoutManager.getLayout=function(X){var aa=+this.graph.getCellStyle(X);if(null!=aa&&"rack"==aa.childLayout){var Z=new mxStackLayout(this.graph,!1);Z.gridSize=null!=aa.rackUnitSize?parseFloat(aa.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Z.marginLeft=aa.marginLeft||0;Z.marginRight=aa.marginRight||0;Z.marginTop=aa.marginTop||0;Z.marginBottom=aa.marginBottom||0;Z.allowGaps=aa.allowGaps||0;Z.horizontal="1"==mxUtils.getValue(aa,"horizontalRack","0");Z.resizeParent=!1;Z.fill=!0;return Z}return R.apply(this,arguments)};+this.updateGlobalUrlVariables()};var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,y){return Graph.processFontStyle(t.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,y,J,R,X,aa,Z,U,ba,fa,na,pa){B.apply(this,arguments);Graph.processFontAttributes(pa)};var D=mxText.prototype.redraw;mxText.prototype.redraw=function(){D.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};+Graph.prototype.createTagsDialog=function(k,y,J,R){function X(){for(var Ba=U.getSelectionCells(),Aa=[],Fa=0;Fa<Ba.length;Fa++)U.isCellVisible(Ba[Fa])&&Aa.push(Ba[Fa]);U.setSelectionCells(Aa)}function aa(Ba){U.setHiddenTags(Ba?[]:ba.slice());X();U.refresh()}function Z(Ba,Aa){na.innerText="";if(0<Ba.length){var Fa=document.createElement("table");Fa.setAttribute("cellpadding","2");Fa.style.boxSizing="border-box";Fa.style.tableLayout="fixed";Fa.style.width="100%";var Sa=document.createElement("tbody");+if(null!=Ba&&0<Ba.length)for(var La=0;La<Ba.length;La++)(function(Pa){function db(){var Na=U.getCellsForTags([Pa],null,null,!0);U.isEnabled()?U.setSelectionCells(Na):U.highlightCells(Na,null,null,70)}var Ia=0>mxUtils.indexOf(U.hiddenTags,Pa),za=document.createElement("tr"),Ua=document.createElement("td");Ua.style.align="center";Ua.style.width="16px";var Qa=document.createElement("img");Qa.setAttribute("src",Ia?Editor.visibleImage:Editor.hiddenImage);Qa.setAttribute("title",mxResources.get(Ia?"hideIt":+"show",[Pa]));mxUtils.setOpacity(Qa,Ia?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor="pointer";Qa.style.width="16px";if(y||Editor.isDarkMode())Qa.style.filter="invert(100%)";Ua.appendChild(Qa);mxEvent.addListener(Qa,"click",function(Na){mxEvent.isShiftDown(Na)?aa(0<=mxUtils.indexOf(U.hiddenTags,Pa)):(U.toggleHiddenTag(Pa),X(),U.refresh());mxEvent.consume(Na)});za.appendChild(Ua);Ua=document.createElement("td");Ua.style.align="center";Ua.style.width="16px";Qa=+document.createElement("img");Qa.setAttribute("src",Editor.selectImage);Qa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Qa,Ia?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor="pointer";Qa.style.width="16px";if(y||Editor.isDarkMode())Qa.style.filter="invert(100%)";mxEvent.addListener(Qa,"click",function(Na){aa(!0);db();mxEvent.consume(Na)});Ua.appendChild(Qa);za.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",Pa);a=document.createElement("a");mxUtils.write(a,Pa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Ia?100:40);Ua.appendChild(a);mxEvent.addListener(Ua,"click",function(Na){if(mxEvent.isShiftDown(Na))aa(!0),db();else if(Ia&&0<U.hiddenTags.length)aa(!0);else{var xa=ba.slice(),Za=mxUtils.indexOf(xa,Pa);xa.splice(Za,1);U.setHiddenTags(xa);X();+U.refresh()}mxEvent.consume(Na)});za.appendChild(Ua);if(U.isEnabled()){Ua=document.createElement("td");Ua.style.verticalAlign="middle";Ua.style.textAlign="center";Ua.style.width="18px";if(null==Aa){Ua.style.align="center";Ua.style.width="16px";Qa=document.createElement("img");Qa.setAttribute("src",Editor.trashImage);Qa.setAttribute("title",mxResources.get("removeIt",[Pa]));mxUtils.setOpacity(Qa,Ia?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor="pointer";Qa.style.width=+"16px";if(y||Editor.isDarkMode())Qa.style.filter="invert(100%)";mxEvent.addListener(Qa,"click",function(Na){var xa=mxUtils.indexOf(ba,Pa);0<=xa&&ba.splice(xa,1);U.removeTagsForCells(U.model.getDescendants(U.model.getRoot()),[Pa]);U.refresh();mxEvent.consume(Na)});Ua.appendChild(Qa)}else{var Ma=document.createElement("input");Ma.setAttribute("type","checkbox");Ma.style.margin="0px";Ma.defaultChecked=null!=Aa&&0<=mxUtils.indexOf(Aa,Pa);Ma.checked=Ma.defaultChecked;Ma.style.background="transparent";+Ma.setAttribute("title",mxResources.get(Ma.defaultChecked?"removeIt":"add",[Pa]));mxEvent.addListener(Ma,"change",function(Na){Ma.checked?U.addTagsForCells(U.getSelectionCells(),[Pa]):U.removeTagsForCells(U.getSelectionCells(),[Pa]);mxEvent.consume(Na)});Ua.appendChild(Ma)}za.appendChild(Ua)}Sa.appendChild(za)})(Ba[La]);Fa.appendChild(Sa);na.appendChild(Fa)}}var U=this,ba=U.hiddenTags.slice(),fa=document.createElement("div");fa.style.userSelect="none";fa.style.overflow="hidden";fa.style.padding="10px";+fa.style.height="100%";var na=document.createElement("div");na.style.position="absolute";na.style.boxSizing="border-box";na.style.userSelect="none";na.style.overflow="auto";na.style.padding="3px";na.style.left="0px";na.style.right="0px";na.style.top="0px";na.style.bottom="0px";fa.appendChild(na);U.addListener(mxEvent.ROOT,function(){ba=U.hiddenTags.slice()});var pa=mxUtils.bind(this,function(Ba,Aa){if(k()){Ba=U.getAllTags();for(Aa=0;Aa<Ba.length;Aa++)0>mxUtils.indexOf(ba,Ba[Aa])&&ba.push(Ba[Aa]);+ba.sort();U.isSelectionEmpty()?Z(ba):Z(ba,U.getCommonTagsForCells(U.getSelectionCells()))}});U.selectionModel.addListener(mxEvent.CHANGE,pa);U.model.addListener(mxEvent.CHANGE,pa);U.addListener(mxEvent.REFRESH,pa);var ta=document.createElement("div");ta.className="geToolbarContainer geDialogToolbar";ta.style.position="absolute";ta.style.display="flex";ta.style.bottom="0px";ta.style.left="0px";ta.style.right="0px";ta.style.height="32px";ta.style.overflow="hidden";ta.style.padding="3px 4px 4px 4px";+ta.style.borderWidth="1px 0px 0px 0px";ta.style.borderStyle="solid";ta.style.whiteSpace="nowrap";if(U.isEnabled()){na.style.bottom="32px";var ua=document.createElement("a");ua.className="geButton";var Ca=ua.cloneNode(!1);Ca.style.backgroundImage="url("+Editor.visibleImage+")";Ca.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Ca,"click",function(Ba){U.setHiddenTags([]);mxEvent.isShiftDown(Ba)||(ba=U.hiddenTags.slice());X();U.refresh();mxEvent.consume(Ba)});ta.appendChild(Ca);null!=+J&&(ua=ua.cloneNode(!1),ua.style.backgroundImage="url("+Editor.plusImage+")",ua.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ua,"click",function(Ba){J(ba,function(Aa){ba=Aa;pa()});mxEvent.consume(Ba)}),ta.appendChild(ua));fa.appendChild(ta)}null!=R&&ta.appendChild(R);return{div:fa,refresh:pa}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var y in Graph.customFontElements){var J=Graph.customFontElements[y];k.push({name:J.name,url:J.url})}return k};+Graph.prototype.setFont=function(k,y){Graph.addFont(k,y);var J=Editor.guid();document.execCommand("fontname",!1,J);for(var R=this.cellEditor.textarea.getElementsByTagName("font"),X=!1,aa=0;aa<R.length;aa++)R[aa].getAttribute("face")==J&&(X=!0,R[aa].setAttribute("face",k),null!=y?R[aa].setAttribute("data-font-src",y):R[aa].removeAttribute("data-font-src"));X||document.execCommand("fontname",!1,k)};var I=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return I.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 k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var y in k)this.globalVars[y]=k[y]}catch(J){null!=window.console&&console.log("Error in vars URL parameter: "+J)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):+{}};var K=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var y=K.apply(this,arguments);null==y&&null!=this.globalVars&&(y=this.globalVars[k]);return y};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var M=Graph.prototype.getSvg;Graph.prototype.getSvg=+function(k,y,J,R,X,aa,Z,U,ba,fa,na,pa,ta,ua,Ca,Ba){var Aa=M.apply(this,arguments);if(null!=pa){var Fa=Aa.getAttribute("style");null==Fa&&(Fa="");pa="auto"==pa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":pa;Aa.setAttribute("style",Fa+(" color-scheme: "+pa+";"))}var Sa=this.getCustomFonts();if(na&&0<Sa.length){var La=Aa.ownerDocument;Fa=null!=La.createElementNS?La.createElementNS(mxConstants.NS_SVG,"style"):La.createElement("style");null!=La.setAttributeNS?+Fa.setAttributeNS("type","text/css"):Fa.setAttribute("type","text/css");for(var Pa="",db="",Ia=0;Ia<Sa.length;Ia++){var za=Sa[Ia].name,Ua=Sa[Ia].url;Graph.isCssFontUrl(Ua)?Pa+="@import url("+Graph.rewriteGoogleFontUrl(Ua)+");\n":db+='@font-face {\nfont-family: "'+za+'";\nsrc: url("'+Ua+'");\n}\n'}Fa.appendChild(La.createTextNode(Pa+db));Aa.getElementsByTagName("defs")[0].appendChild(Fa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Aa);+this.mathEnabled&&(document.body.appendChild(Aa),Editor.MathJaxRender(Aa),Aa.parentNode.removeChild(Aa),Fa=Aa.ownerDocument.getElementById("MJX-SVG-styles"),null!=Fa&&Aa.getElementsByTagName("defs")[0].appendChild(Fa.cloneNode(!0)));return Aa};var V=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){V.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,+k.control]};var Q=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){Q.apply(this,arguments);this.enumerationState=0};var ja=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ja.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'++mxUtils.htmlEntities(k)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var y="1"==mxUtils.getValue(k.style,"enumerate",0);y&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):y||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);y=k.secondLabel;if(null!=+y){var J=k.view.scale,R=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*J,k.y+4*J,0,0):mxRectangle.fromPoint(k.view.getPoint(k));y.bounds.equals(k)&&y.value==R&&y.scale==J||(y.bounds=k,y.value=R,y.scale=J,y.redraw())}};var ea=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();ea.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&+(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var da=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){da.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,y){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&this.executeCustomActions(k.actions,null,y))};Graph.prototype.executeCustomActions=function(k,y,J){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 R=!1,X=0,aa=0,Z=mxUtils.bind(this,function(){R||(R=!0,this.model.beginUpdate())}),U=mxUtils.bind(this,function(){R&&(R=!1,this.model.endUpdate())}),ba=mxUtils.bind(this,function(){0<X&&X--;0==X&&fa()}),fa=mxUtils.bind(this,function(){if(aa<k.length){var na=+this.stoppingCustomActions,pa=k[aa++],ta=[];if(null!=pa.open)if(U(),this.isCustomLink(pa.open)){if(!this.customLinkClicked(pa.open,J))return}else this.openLink(pa.open);null==pa.wait||na||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ba()}),X++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=pa.wait?parseInt(pa.wait):1E3),U());null!=pa.opacity&&null!=pa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(pa.opacity,+!0)),pa.opacity.value);null!=pa.fadeIn&&(X++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(pa.fadeIn,!0)),0,1,ba,na?0:pa.fadeIn.delay));null!=pa.fadeOut&&(X++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(pa.fadeOut,!0)),1,0,ba,na?0:pa.fadeOut.delay));null!=pa.wipeIn&&(ta=ta.concat(this.createWipeAnimations(this.getCellsForAction(pa.wipeIn,!0),!0)));null!=pa.wipeOut&&(ta=ta.concat(this.createWipeAnimations(this.getCellsForAction(pa.wipeOut,!0),!1)));null!=pa.toggle&&+(Z(),this.toggleCells(this.getCellsForAction(pa.toggle,!0)));if(null!=pa.show){Z();var ua=this.getCellsForAction(pa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ua),1);this.setCellsVisible(ua,!0)}null!=pa.hide&&(Z(),ua=this.getCellsForAction(pa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ua),0),this.setCellsVisible(ua,!1));null!=pa.toggleStyle&&null!=pa.toggleStyle.key&&(Z(),this.toggleCellStyles(pa.toggleStyle.key,null!=pa.toggleStyle.defaultValue?pa.toggleStyle.defaultValue:+"0",this.getCellsForAction(pa.toggleStyle,!0)));null!=pa.style&&null!=pa.style.key&&(Z(),this.setCellStyles(pa.style.key,pa.style.value,this.getCellsForAction(pa.style,!0)));ua=[];null!=pa.select&&this.isEnabled()&&(ua=this.getCellsForAction(pa.select),this.setSelectionCells(ua));null!=pa.highlight&&(ua=this.getCellsForAction(pa.highlight),this.highlightCells(ua,pa.highlight.color,pa.highlight.duration,pa.highlight.opacity));null!=pa.scroll&&(ua=this.getCellsForAction(pa.scroll));null!=pa.viewbox&&+this.fitWindow(pa.viewbox,pa.viewbox.border);0<ua.length&&this.scrollCellToVisible(ua[0]);null!=J&&null!=pa.explore&&Graph.exploreFromCell(this,J,pa.explore);if(null!=pa.tags){if(null!=pa.tags.toggle){var Ca=pa.tags.toggle;0==Ca.length&&(Ca=this.getAllTags());for(ua=0;ua<Ca.length;ua++)this.toggleHiddenTag(Ca[ua])}Ca=null;null!=pa.tags.hidden&&(null==Ca&&(Ca=[]),Ca=Ca.concat(pa.tags.hidden));if(null!=pa.tags.visible){null==Ca&&(Ca=[]);var Ba=this.getAllTags();for(ua=0;ua<Ba.length;ua++)0>mxUtils.indexOf(pa.tags.visible,+Ba[ua])&&0>mxUtils.indexOf(Ca,Ba[ua])&&Ca.push(Ba[ua])}null!=Ca&&this.setHiddenTags(Ca);this.refresh()}0<ta.length&&(X++,this.executeAnimations(ta,ba,na?1:pa.steps,na?0:pa.delay));0==X?fa():U()}else this.stoppingCustomActions=this.executingCustomActions=!1,U(),null!=y&&y()});fa()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,y){var J=this.getLinkForCell(y);null!=J&&"data:action/json,"==J.substring(0,17)&&this.setLinkForCell(y,this.updateCustomLink(k,J));if(this.isHtmlLabel(y)){var R=document.createElement("div");+R.innerHTML=Graph.sanitizeHtml(this.getLabel(y));for(var X=R.getElementsByTagName("a"),aa=!1,Z=0;Z<X.length;Z++)J=X[Z].getAttribute("href"),null!=J&&"data:action/json,"==J.substring(0,17)&&(X[Z].setAttribute("href",this.updateCustomLink(k,J)),aa=!0);aa&&this.labelChanged(y,R.innerHTML)}};Graph.prototype.updateCustomLink=function(k,y){if("data:action/json,"==y.substring(0,17))try{var J=JSON.parse(y.substring(17));null!=J.actions&&(this.updateCustomLinkActions(k,J.actions),y="data:action/json,"+JSON.stringify(J))}catch(R){}return y};+Graph.prototype.updateCustomLinkActions=function(k,y){for(var J=0;J<y.length;J++){var R=y[J],X;for(X in R)this.updateCustomLinkAction(k,R[X],"cells"),this.updateCustomLinkAction(k,R[X],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,y,J){if(null!=y&&null!=y[J]){for(var R=[],X=0;X<y[J].length;X++)if("*"==y[J][X])R.push(y[J][X]);else{var aa=k[y[J][X]];null!=aa?""!=aa&&R.push(aa):R.push(y[J][X])}y[J]=R}};Graph.prototype.getCellsForAction=function(k,y){y=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,+null,y));if(null!=k.excludeCells){for(var J=[],R=0;R<y.length;R++)0>k.excludeCells.indexOf(y[R].id)&&J.push(y[R]);y=J}return y};Graph.prototype.getCellsById=function(k){var y=[];if(null!=k)for(var J=0;J<k.length;J++)if("*"==k[J]){var R=this.model.getRoot();y=y.concat(this.model.filterDescendants(function(aa){return aa!=R},R))}else{var X=this.model.getCell(k[J]);null!=X&&y.push(X)}return y};var ia=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return ia.apply(this,arguments)&&+!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var y=mxUtils.indexOf(this.hiddenTags,k);0>y?this.hiddenTags.push(k):0<=y&&this.hiddenTags.splice(y,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;+for(var y=0;y<k.length;y++)if(0>mxUtils.indexOf(this.hiddenTags,k[y]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,y,J,R){var X=[];if(null!=k){y=null!=y?y:this.model.getDescendants(this.model.getRoot());for(var aa=0,Z={},U=0;U<k.length;U++)0<k[U].length&&(Z[k[U]]=!0,aa++);for(U=0;U<y.length;U++)if(J&&this.model.getParent(y[U])==this.model.root||this.model.isVertex(y[U])||this.model.isEdge(y[U])){var ba=this.getTagsForCell(y[U]),fa=!1;if(0<ba.length&&(ba=ba.split(" "),ba.length>=k.length)){for(var na=+fa=0;na<ba.length&&fa<aa;na++)null!=Z[ba[na]]&&fa++;fa=fa==aa}fa&&(1!=R||this.isCellVisible(y[U]))&&X.push(y[U])}}return X};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var y=null,J=[],R=0;R<k.length;R++){var X=this.getTagsForCell(k[R]);J=[];if(0<X.length){X=X.split(" ");for(var aa={},Z=0;Z<X.length;Z++)if(null==y||null!=y[X[Z]])aa[X[Z]]=!0,J.push(X[Z]);y=aa}else return[]}return J};+Graph.prototype.getTagsForCells=function(k){for(var y=[],J={},R=0;R<k.length;R++){var X=this.getTagsForCell(k[R]);if(0<X.length){X=X.split(" ");for(var aa=0;aa<X.length;aa++)null==J[X[aa]]&&(J[X[aa]]=!0,y.push(X[aa]))}}return y};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,y){if(0<k.length&&0<y.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){for(var R=this.getTagsForCell(k[J]),X=R.split(" "),aa=+!1,Z=0;Z<y.length;Z++){var U=mxUtils.trim(y[Z]);""!=U&&0>mxUtils.indexOf(X,U)&&(R=0<R.length?R+" "+U:U,aa=!0)}aa&&this.setAttributeForCell(k[J],"tags",R)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,y){if(0<k.length&&0<y.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){var R=this.getTagsForCell(k[J]);if(0<R.length){for(var X=R.split(" "),aa=!1,Z=0;Z<y.length;Z++){var U=mxUtils.indexOf(X,y[Z]);0<=U&&(X.splice(U,1),aa=!0)}aa&&this.setAttributeForCell(k[J],+"tags",X.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var y=0;y<k.length;y++)this.model.setVisible(k[y],!this.model.isVisible(k[y]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,y){this.model.beginUpdate();try{for(var J=0;J<k.length;J++)this.model.setVisible(k[J],y)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,y,J,R){for(var X=0;X<k.length;X++)this.highlightCell(k[X],+y,J,R)};Graph.prototype.highlightCell=function(k,y,J,R,X){y=null!=y?y:mxConstants.DEFAULT_VALID_COLOR;J=null!=J?J:1E3;k=this.view.getState(k);var aa=null;null!=k&&(X=null!=X?X:4,X=Math.max(X+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+X),aa=new mxCellHighlight(this,y,X,!1),null!=R&&(aa.opacity=R),aa.highlight(k),window.setTimeout(function(){null!=aa.shape&&(mxUtils.setPrefixedStyle(aa.shape.node.style,"transition","all 1200ms ease-in-out"),aa.shape.node.style.opacity=0);window.setTimeout(function(){aa.destroy()},+1200)},J));return aa};Graph.prototype.addSvgShadow=function(k,y,J,R){R=null!=R?R:!0;var X=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=J&&J||(y=null!=y?y:k.getElementsByTagName("g")[0],null!=y&&(this.updateShadowFilter(y,!0),!isNaN(parseInt(k.getAttribute("width")))&&R&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+X),k.setAttribute("height",parseInt(k.getAttribute("height"))+X),y=k.getAttribute("viewBox"),null!=y&&0<y.length&&(y=y.split(" "),3<y.length&&(w=parseFloat(y[2])++X,h=parseFloat(y[3])+X,k.setAttribute("viewBox",y[0]+" "+y[1]+" "+w+" "+h))))));return X};Graph.prototype.updateShadowFilter=function(k,y){mxClient.IS_SF||(y?(y=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+y.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,y){y=null!=y?y:!0;this.shadowVisible=+k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);y&&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 k=this.model.getChildCount(this.model.root),y=0;do var J=this.model.getChildAt(this.model.root,y);while(y++<k&&"1"==mxUtils.getValue(this.getCellStyle(J),"locked","0"));null!=J&&this.setDefaultParent(J)}};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=@@ -3570,43 +3575,43 @@ mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.x[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.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.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(k){var x=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?x="mxgraph.er":"sysML"==k.substring(0,5)&&(x="mxgraph.sysml"));return x};var la=mxMarker.createMarker;mxMarker.createMarker=function(k,x,J,R,Y,Z,W,U,aa,ia){if(null!=J&&null==mxMarker.markers[J]){var na=this.getPackageForType(J);null!=na&&mxStencilRegistry.getStencil(na)}return la.apply(this,arguments)};var ka=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,x,J,R,Y,Z){"1"==mxUtils.getValue(x.style,"lineShape",-null)&&k.setFillColor(mxUtils.getValue(x.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ka.apply(this,arguments)};PrintDialog.prototype.create=function(k,x,J,R){function Y(){Ba.value=Math.max(1,Math.min(na,Math.max(parseInt(Ba.value),parseInt(ua.value))));ua.value=Math.max(1,Math.min(na,Math.min(parseInt(Ba.value),parseInt(ua.value))))}function Z(ba){k.lastPrintPagesRadioChecked=ta.checked;k.lastPrintSelectionOnlyChecked=Aa.checked;k.lastPrintCropRadioChecked=Ra.checked;k.lastPrintFitRadioChecked=-Ha.checked;ta.checked&&ua.value<Ba.value?(k.lastPrintPagesFromInput=ua.value,k.lastPrintPagesToInput=Ba.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);Ja.value=Math.max(1,Math.min(1600,parseInt(Ja.value)))+"%";k.lastPrintZoom=Ja.value;k.lastPrintBorder=Ca.value;k.lastPrintGrid=Xa.checked;k.lastPrintTransparent=y.checked;k.lastPrintInclude=P.checked;k.lastPrintSheetsAcross=oa.value;k.lastPrintSheetsDown=Da.value;var ma={};ma.border=parseInt(Ca.value);ma.scale=parseInt(Ja.value)/-100;ma.grid=Xa.checked;ma.shadows=ib.checked;ma.transparent=y.checked;ma.includeCopy=P.checked;ma.sheetsAcross=parseInt(oa.value);ma.sheetsDown=parseInt(Da.value);ma.pagesFrom=parseInt(ua.value);ma.pagesTo=parseInt(Ba.value);ma.allPages=qa.checked;ma.selection=Aa.checked;ma.pageView=Ga.checked;ma.crop=Ra.checked;ma.fit=Ha.checked;return null!=J?J(!ba,ma):k.print(!ba,ma)}var W=k.editor.graph,U=document.createElement("div"),aa=document.createElement("h3");aa.style.width="100%";aa.style.textAlign="center";-aa.style.marginTop="0px";mxUtils.write(aa,x||mxResources.get("print"));U.appendChild(aa);var ia=1,na=1;aa=document.createElement("div");aa.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");aa.appendChild(qa);x=document.createElement("span");mxUtils.write(x,mxResources.get("allPages"));mxEvent.addListener(x,"click",function(){qa.checked=!0});aa.appendChild(x);-mxUtils.br(aa);var ta=qa.cloneNode(!0);aa.appendChild(ta);x=document.createElement("span");mxUtils.write(x,mxResources.get("pages")+":");aa.appendChild(x);mxEvent.addListener(x,"click",function(){ta.checked=!0});var ua=document.createElement("input");ua.style.margin="0 4px";ua.setAttribute("value","1");ua.setAttribute("type","number");ua.setAttribute("min","1");ua.style.width="40px";aa.appendChild(ua);x=document.createElement("span");mxUtils.write(x,mxResources.get("to"));aa.appendChild(x);var Ba=-ua.cloneNode(!0);aa.appendChild(Ba);mxEvent.addListener(ua,"focus",function(){ta.checked=!0});mxEvent.addListener(Ba,"focus",function(){ta.checked=!0});mxEvent.addListener(ua,"change",Y);mxEvent.addListener(Ba,"change",Y);if(null!=k.pages&&(na=k.pages.length,null!=k.currentPage))for(var za=0;za<na;za++)if(k.currentPage==k.pages[za]){ia=za+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ua.value=Math.min(na,Math.max(1,k.lastPrintPagesFromInput)),Ba.value=Math.min(na,Math.max(1,-k.lastPrintPagesToInput))):(ua.value=ia,Ba.value=ia);ua.setAttribute("max",na);Ba.setAttribute("max",na);za=mxUtils.button(mxResources.get("currentPage"),function(ba){ua.value=ia;Ba.value=ia;ta.checked=!0});za.setAttribute("title",mxResources.get("currentPage"));za.style.marginLeft="4px";za.style.maxWidth="100px";za.style.overflow="hidden";za.style.textOverflow="ellipsis";za.style.whiteSpace="nowrap";aa.appendChild(za);1<na&&U.appendChild(aa);aa=document.createElement("div");aa.style.borderBottom=-"1px solid lightGray";aa.style.paddingBottom="12px";aa.style.marginBottom="12px";aa.style.whiteSpace="nowrap";var Aa=document.createElement("input");Aa.setAttribute("name","pages-printdialog");Aa.setAttribute("type",1==na?"checkbox":"radio");Aa.style.marginRight="8px";W.isSelectionEmpty()&&Aa.setAttribute("disabled","disabled");W.isEnabled()&&(aa.appendChild(Aa),x=document.createElement("span"),mxUtils.write(x,mxResources.get("selectionOnly")),aa.appendChild(x));(W.isEnabled()||1<na)&&U.appendChild(aa);-!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?ta.checked=!0:!W.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Aa.checked=!0:qa.checked=!0;W.isSelectionEmpty()||mxEvent.addListener(x,"click",function(){Aa.checked=!Aa.checked});W=document.createElement("div");W.style.whiteSpace="nowrap";var Ga=document.createElement("input");Ga.style.marginBottom="8px";Ga.style.marginRight="8px";Ga.setAttribute("type","radio");Ga.setAttribute("name","printSize");W.appendChild(Ga);x=document.createElement("span");-mxUtils.write(x,mxResources.get("pageView"));W.appendChild(x);mxEvent.addListener(W,"click",function(){Ga.checked=!0});U.appendChild(W);W=document.createElement("div");W.style.whiteSpace="nowrap";var Ra=document.createElement("input");Ra.style.marginBottom="8px";Ra.style.marginRight="8px";Ra.setAttribute("type","radio");Ra.setAttribute("name","printSize");W.appendChild(Ra);x=document.createElement("span");mxUtils.write(x,mxResources.get("crop"));W.appendChild(x);mxEvent.addListener(W,"click",function(){Ra.checked=-!0});U.appendChild(W);W=document.createElement("div");W.style.whiteSpace="nowrap";var Ha=document.createElement("input");Ha.style.marginBottom="8px";Ha.style.marginRight="8px";Ha.setAttribute("type","radio");Ha.setAttribute("name","printSize");x=document.createElement("div");x.style.display="inline-block";x.style.verticalAlign="top";x.style.paddingTop="2px";x.appendChild(Ha);W.appendChild(x);aa=document.createElement("table");aa.style.display="inline-block";aa.style.borderSpacing="0";za=document.createElement("tbody");-var Qa=document.createElement("tr"),eb=Qa.cloneNode(!0),Ma=document.createElement("td"),ya=Ma.cloneNode(!0),Sa=Ma.cloneNode(!0),Oa=Ma.cloneNode(!0),Na=Ma.cloneNode(!0),Pa=Ma.cloneNode(!0);Ma.style.textAlign="right";Oa.style.textAlign="right";mxUtils.write(Ma,mxResources.get("fitTo"));mxEvent.addListener(W,"click",function(ba){mxEvent.getSource(ba)!=Ha&&(Ha.checked=!Ha.checked)});var oa=document.createElement("input");oa.style.margin="0 2px";oa.style.boxSizing="border-box";oa.setAttribute("value",-k.lastPrintSheetsAcross||"1");oa.setAttribute("min","1");oa.setAttribute("type","number");oa.style.width="40px";ya.appendChild(oa);x=document.createElement("span");mxUtils.write(x,mxResources.get("fitToSheetsAcross"));Sa.appendChild(x);mxUtils.write(Oa,mxResources.get("fitToBy"));var Da=oa.cloneNode(!0);Da.setAttribute("value",k.lastPrintSheetsDown||"1");Na.appendChild(Da);mxEvent.addListener(oa,"click",function(ba){Ha.checked=!0;mxEvent.consume(ba)});mxEvent.addListener(Da,"click",function(ba){Ha.checked=-!0;mxEvent.consume(ba)});k.lastPrintCropRadioChecked?Ra.checked=!0:k.lastPrintFitRadioChecked?Ha.checked=!0:Ga.checked=!0;x=document.createElement("span");mxUtils.write(x,mxResources.get("fitToSheetsDown"));Pa.appendChild(x);Qa.appendChild(Ma);Qa.appendChild(ya);Qa.appendChild(Sa);eb.appendChild(Oa);eb.appendChild(Na);eb.appendChild(Pa);za.appendChild(Qa);za.appendChild(eb);aa.appendChild(za);W.appendChild(aa);U.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 Ca=document.createElement("input");Ca.setAttribute("type","number");Ca.setAttribute("min","0");Ca.style.width="40px";Ca.style.marginLeft="4px";Ca.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;W.appendChild(Ca);x=document.createElement("span");x.style.marginLeft="8px";mxUtils.write(x,mxResources.get("zoom")+-":");W.appendChild(x);var Ja=document.createElement("input");Ja.style.width="60px";Ja.style.marginLeft="4px";Ja.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";W.appendChild(Ja);mxUtils.br(W);var Xa=document.createElement("input");Xa.setAttribute("type","checkbox");Xa.style.marginTop="12px";Xa.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;W.appendChild(Xa);x=document.createElement("span");x.style.marginLeft="4px";x.style.marginRight="8px";mxUtils.write(x,mxResources.get("grid"));W.appendChild(x);-mxEvent.addListener(x,"click",function(ba){Xa.checked=!0;mxEvent.consume(ba)});var ib=document.createElement("input");ib.setAttribute("type","checkbox");ib.style.marginTop="12px";ib.checked=null!=k.lastPrintShadow?k.lastPrintShadow:!1;W.appendChild(ib);x=document.createElement("span");x.style.marginLeft="4px";x.style.marginRight="8px";mxUtils.write(x,mxResources.get("shadows"));W.appendChild(x);k.isOffline()&&!mxClient.IS_CHROMEAPP||x.appendChild(k.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));-mxEvent.addListener(x,"click",function(ba){"IMG"!=mxEvent.getSource(ba).nodeName&&(ib.checked=!0,mxEvent.consume(ba))});Editor.enableShadowOption?null!=J&&mxUtils.br(W):(ib.style.display="none",x.style.display="none");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginTop="10px";y.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=J&&(W.appendChild(y),x=document.createElement("span"),x.style.marginLeft="4px",mxUtils.write(x,mxResources.get("transparentBackground")),-W.appendChild(x),mxEvent.addListener(x,"click",function(ba){y.checked=!0;mxEvent.consume(ba)}));var P=document.createElement("input");P.setAttribute("type","checkbox");P.style.marginTop="10px";P.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==J||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(mxUtils.br(W),W.appendChild(P),x=document.createElement("span"),x.style.marginLeft="4px",mxUtils.write(x,mxResources.get("includeCopyOfMyDiagram")),W.appendChild(x),-mxEvent.addListener(x,"click",function(ba){P.checked=!0;mxEvent.consume(ba)}));U.appendChild(W);x=document.createElement("div");x.style.marginTop="30px";x.style.textAlign="right";x.style.whiteSpace="nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=J||x.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));W=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});W.className="geBtn";k.editor.cancelFirst&&x.appendChild(W);PrintDialog.previewEnabled&&null==J&&-(aa=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),Z(!1)}catch(ba){k.handleError(ba)}}),aa.className="geBtn",x.appendChild(aa));R=null!=R?R:null!=J?"export":PrintDialog.previewEnabled?"print":"ok";R=mxUtils.button(mxResources.get(R),function(){try{k.hideDialog(),Z(!0)}catch(ba){k.handleError(ba)}});R.className="geBtn gePrimaryBtn";x.appendChild(R);k.editor.cancelFirst||x.appendChild(W);U.appendChild(x);if(k.editor.isChromelessView()){var S=function(){Editor.isDarkMode()?(U.classList.add("geDarkMode"),-U.style.colorScheme="dark"):(U.classList.remove("geDarkMode"),U.style.colorScheme="light")};k.addListener("darkModeChanged",S);S();var X=function(ba,ma){ba=ma.getProperty("dialog");U.parentNode==ba.container&&(k.editor.removeListener(X),k.removeListener(S))};k.editor.addListener("hideDialog",X)}this.container=U};var V=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 k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}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 V.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&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.6.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)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&+function(k){var y=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?y="mxgraph.er":"sysML"==k.substring(0,5)&&(y="mxgraph.sysml"));return y};var la=mxMarker.createMarker;mxMarker.createMarker=function(k,y,J,R,X,aa,Z,U,ba,fa){if(null!=J&&null==mxMarker.markers[J]){var na=this.getPackageForType(J);null!=na&&mxStencilRegistry.getStencil(na)}return la.apply(this,arguments)};var ka=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,y,J,R,X,aa){"1"==mxUtils.getValue(y.style,"lineShape",+null)&&k.setFillColor(mxUtils.getValue(y.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ka.apply(this,arguments)};PrintDialog.prototype.create=function(k,y,J,R){function X(){Ca.value=Math.max(1,Math.min(na,Math.max(parseInt(Ca.value),parseInt(ua.value))));ua.value=Math.max(1,Math.min(na,Math.min(parseInt(Ca.value),parseInt(ua.value))))}function aa(ca){k.lastPrintPagesRadioChecked=ta.checked;k.lastPrintSelectionOnlyChecked=Aa.checked;k.lastPrintCropRadioChecked=Sa.checked;k.lastPrintFitRadioChecked=+La.checked;ta.checked&&ua.value<Ca.value?(k.lastPrintPagesFromInput=ua.value,k.lastPrintPagesToInput=Ca.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);ra.value=Math.max(1,Math.min(1600,parseInt(ra.value)))+"%";k.lastPrintZoom=ra.value;k.lastPrintBorder=Oa.value;k.lastPrintGrid=Da.checked;k.lastPrintTransparent=x.checked;k.lastPrintInclude=N.checked;k.lastPrintSheetsAcross=xa.value;k.lastPrintSheetsDown=Za.value;var ma={};ma.border=parseInt(Oa.value);ma.scale=parseInt(ra.value)/+100;ma.grid=Da.checked;ma.shadows=Ra.checked;ma.transparent=x.checked;ma.includeCopy=N.checked;ma.sheetsAcross=parseInt(xa.value);ma.sheetsDown=parseInt(Za.value);ma.pagesFrom=parseInt(ua.value);ma.pagesTo=parseInt(Ca.value);ma.allPages=pa.checked;ma.selection=Aa.checked;ma.pageView=Fa.checked;ma.crop=Sa.checked;ma.fit=La.checked;return null!=J?J(!ca,ma):k.print(!ca,ma)}var Z=k.editor.graph,U=document.createElement("div"),ba=document.createElement("h3");ba.style.width="100%";ba.style.textAlign="center";+ba.style.marginTop="0px";mxUtils.write(ba,y||mxResources.get("print"));U.appendChild(ba);var fa=1,na=1;ba=document.createElement("div");ba.style.whiteSpace="nowrap";var pa=document.createElement("input");pa.style.marginRight="8px";pa.style.marginBottom="8px";pa.setAttribute("type","radio");pa.setAttribute("name","pages-printdialog");ba.appendChild(pa);y=document.createElement("span");mxUtils.write(y,mxResources.get("allPages"));mxEvent.addListener(y,"click",function(){pa.checked=!0});ba.appendChild(y);+mxUtils.br(ba);var ta=pa.cloneNode(!0);ba.appendChild(ta);y=document.createElement("span");mxUtils.write(y,mxResources.get("pages")+":");ba.appendChild(y);mxEvent.addListener(y,"click",function(){ta.checked=!0});var ua=document.createElement("input");ua.style.margin="0 4px";ua.setAttribute("value","1");ua.setAttribute("type","number");ua.setAttribute("min","1");ua.style.width="40px";ba.appendChild(ua);y=document.createElement("span");mxUtils.write(y,mxResources.get("to"));ba.appendChild(y);var Ca=+ua.cloneNode(!0);ba.appendChild(Ca);mxEvent.addListener(ua,"focus",function(){ta.checked=!0});mxEvent.addListener(Ca,"focus",function(){ta.checked=!0});mxEvent.addListener(ua,"change",X);mxEvent.addListener(Ca,"change",X);if(null!=k.pages&&(na=k.pages.length,null!=k.currentPage))for(var Ba=0;Ba<na;Ba++)if(k.currentPage==k.pages[Ba]){fa=Ba+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ua.value=Math.min(na,Math.max(1,k.lastPrintPagesFromInput)),Ca.value=Math.min(na,Math.max(1,+k.lastPrintPagesToInput))):(ua.value=fa,Ca.value=fa);ua.setAttribute("max",na);Ca.setAttribute("max",na);Ba=mxUtils.button(mxResources.get("currentPage"),function(ca){ua.value=fa;Ca.value=fa;ta.checked=!0});Ba.setAttribute("title",mxResources.get("currentPage"));Ba.style.marginLeft="4px";Ba.style.maxWidth="100px";Ba.style.overflow="hidden";Ba.style.textOverflow="ellipsis";Ba.style.whiteSpace="nowrap";ba.appendChild(Ba);1<na&&U.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 Aa=document.createElement("input");Aa.setAttribute("name","pages-printdialog");Aa.setAttribute("type",1==na?"checkbox":"radio");Aa.style.marginRight="8px";Z.isSelectionEmpty()&&Aa.setAttribute("disabled","disabled");Z.isEnabled()&&(ba.appendChild(Aa),y=document.createElement("span"),mxUtils.write(y,mxResources.get("selectionOnly")),ba.appendChild(y));(Z.isEnabled()||1<na)&&U.appendChild(ba);+!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?ta.checked=!0:!Z.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Aa.checked=!0:pa.checked=!0;Z.isSelectionEmpty()||mxEvent.addListener(y,"click",function(){Aa.checked=!Aa.checked});Z=document.createElement("div");Z.style.whiteSpace="nowrap";var Fa=document.createElement("input");Fa.style.marginBottom="8px";Fa.style.marginRight="8px";Fa.setAttribute("type","radio");Fa.setAttribute("name","printSize");Z.appendChild(Fa);y=document.createElement("span");+mxUtils.write(y,mxResources.get("pageView"));Z.appendChild(y);mxEvent.addListener(Z,"click",function(){Fa.checked=!0});U.appendChild(Z);Z=document.createElement("div");Z.style.whiteSpace="nowrap";var Sa=document.createElement("input");Sa.style.marginBottom="8px";Sa.style.marginRight="8px";Sa.setAttribute("type","radio");Sa.setAttribute("name","printSize");Z.appendChild(Sa);y=document.createElement("span");mxUtils.write(y,mxResources.get("crop"));Z.appendChild(y);mxEvent.addListener(Z,"click",function(){Sa.checked=+!0});U.appendChild(Z);Z=document.createElement("div");Z.style.whiteSpace="nowrap";var La=document.createElement("input");La.style.marginBottom="8px";La.style.marginRight="8px";La.setAttribute("type","radio");La.setAttribute("name","printSize");y=document.createElement("div");y.style.display="inline-block";y.style.verticalAlign="top";y.style.paddingTop="2px";y.appendChild(La);Z.appendChild(y);ba=document.createElement("table");ba.style.display="inline-block";ba.style.borderSpacing="0";Ba=document.createElement("tbody");+var Pa=document.createElement("tr"),db=Pa.cloneNode(!0),Ia=document.createElement("td"),za=Ia.cloneNode(!0),Ua=Ia.cloneNode(!0),Qa=Ia.cloneNode(!0),Ma=Ia.cloneNode(!0),Na=Ia.cloneNode(!0);Ia.style.textAlign="right";Qa.style.textAlign="right";mxUtils.write(Ia,mxResources.get("fitTo"));mxEvent.addListener(Z,"click",function(ca){mxEvent.getSource(ca)!=La&&(La.checked=!La.checked)});var xa=document.createElement("input");xa.style.margin="0 2px";xa.style.boxSizing="border-box";xa.setAttribute("value",+k.lastPrintSheetsAcross||"1");xa.setAttribute("min","1");xa.setAttribute("type","number");xa.style.width="40px";za.appendChild(xa);y=document.createElement("span");mxUtils.write(y,mxResources.get("fitToSheetsAcross"));Ua.appendChild(y);mxUtils.write(Qa,mxResources.get("fitToBy"));var Za=xa.cloneNode(!0);Za.setAttribute("value",k.lastPrintSheetsDown||"1");Ma.appendChild(Za);mxEvent.addListener(xa,"click",function(ca){La.checked=!0;mxEvent.consume(ca)});mxEvent.addListener(Za,"click",function(ca){La.checked=+!0;mxEvent.consume(ca)});k.lastPrintCropRadioChecked?Sa.checked=!0:k.lastPrintFitRadioChecked?La.checked=!0:Fa.checked=!0;y=document.createElement("span");mxUtils.write(y,mxResources.get("fitToSheetsDown"));Na.appendChild(y);Pa.appendChild(Ia);Pa.appendChild(za);Pa.appendChild(Ua);db.appendChild(Qa);db.appendChild(Ma);db.appendChild(Na);Ba.appendChild(Pa);Ba.appendChild(db);ba.appendChild(Ba);Z.appendChild(ba);U.appendChild(Z);Z=document.createElement("div");Z.style.borderTop="1px solid lightGray";+Z.style.whiteSpace="nowrap";Z.style.paddingTop="12px";Z.style.marginTop="12px";Z.style.paddingLeft="8px";mxUtils.write(Z,mxResources.get("borderWidth")+":");var Oa=document.createElement("input");Oa.setAttribute("type","number");Oa.setAttribute("min","0");Oa.style.width="40px";Oa.style.marginLeft="4px";Oa.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;Z.appendChild(Oa);y=document.createElement("span");y.style.marginLeft="8px";mxUtils.write(y,mxResources.get("zoom")++":");Z.appendChild(y);var ra=document.createElement("input");ra.style.width="60px";ra.style.marginLeft="4px";ra.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";Z.appendChild(ra);mxUtils.br(Z);var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.marginTop="12px";Da.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;Z.appendChild(Da);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("grid"));Z.appendChild(y);+mxEvent.addListener(y,"click",function(ca){Da.checked=!0;mxEvent.consume(ca)});var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.style.marginTop="12px";Ra.checked=null!=k.lastPrintShadow?k.lastPrintShadow:!1;Z.appendChild(Ra);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("shadows"));Z.appendChild(y);k.isOffline()&&!mxClient.IS_CHROMEAPP||y.appendChild(k.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));+mxEvent.addListener(y,"click",function(ca){"IMG"!=mxEvent.getSource(ca).nodeName&&(Ra.checked=!0,mxEvent.consume(ca))});Editor.enableShadowOption?null!=J&&mxUtils.br(Z):(Ra.style.display="none",y.style.display="none");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginTop="10px";x.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=J&&(Z.appendChild(x),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("transparentBackground")),+Z.appendChild(y),mxEvent.addListener(y,"click",function(ca){x.checked=!0;mxEvent.consume(ca)}));var N=document.createElement("input");N.setAttribute("type","checkbox");N.style.marginTop="10px";N.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==J||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(mxUtils.br(Z),Z.appendChild(N),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("includeCopyOfMyDiagram")),Z.appendChild(y),+mxEvent.addListener(y,"click",function(ca){N.checked=!0;mxEvent.consume(ca)}));U.appendChild(Z);y=document.createElement("div");y.style.marginTop="30px";y.style.textAlign="right";y.style.whiteSpace="nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=J||y.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Z=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});Z.className="geBtn";k.editor.cancelFirst&&y.appendChild(Z);PrintDialog.previewEnabled&&null==J&&+(ba=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),aa(!1)}catch(ca){k.handleError(ca)}}),ba.className="geBtn",y.appendChild(ba));R=null!=R?R:null!=J?"export":PrintDialog.previewEnabled?"print":"ok";R=mxUtils.button(mxResources.get(R),function(){try{k.hideDialog(),aa(!0)}catch(ca){k.handleError(ca)}});R.className="geBtn gePrimaryBtn";y.appendChild(R);k.editor.cancelFirst||y.appendChild(Z);U.appendChild(y);if(k.editor.isChromelessView()){var S=function(){Editor.isDarkMode()?+(U.classList.add("geDarkMode"),U.style.colorScheme="dark"):(U.classList.remove("geDarkMode"),U.style.colorScheme="light")};k.addListener("darkModeChanged",S);S();var Y=function(ca,ma){ca=ma.getProperty("dialog");U.parentNode==ca.container&&(k.editor.removeListener(Y),k.removeListener(S))};k.editor.addListener("hideDialog",Y)}this.container=U};var W=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 k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}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 W.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&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),+this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.6.5";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)||/.*\.cdn\.prod\.atlassian-dev\.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||"1"==urlParams.dev;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,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:{useWidth:1E3,useMaxWidth:!0,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,g,l,t,B,D,I){if(null!=c){B=null!=B?B:Error(c);B.stack=null!=B.stack?B.stack:"";D=null!=D?D: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>B.stack.indexOf("extension:")&&0>B.stack.indexOf("<anonymous>:")&&0>B.stack.indexOf("/math4/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+D+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(l)+(null!=t?":colno:"+encodeURIComponent(t):-"")+(""!=B.stack?"&stack="+encodeURIComponent(B.stack):""))}catch(L){}try{I||null==window.console||console.error(D,c,g,l,t,B)}catch(L){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var g=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=g+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(l){}};EditorUi.sendReport=function(c,g){if("1"==+"")+(""!=B.stack?"&stack="+encodeURIComponent(B.stack):""))}catch(K){}try{I||null==window.console||console.error(D,c,g,l,t,B)}catch(K){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var g=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=g+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(l){}};EditorUi.sendReport=function(c,g){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{g=null!=g?g:5E4,c.length>g&&(c=c.substring(0,g)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(l){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],g=0;g<arguments.length;g++)c.push(arguments[g]);mxClient.IS_IOS?(mxLog.show(),mxLog.debug(c.join(" "))):console.log.apply(console,c)}}catch(l){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var g=[],l=0;l<c.length;l++)g.push(c[l]);for(l=0;l<g.length;l++)EditorUi.replaceSvgImage(g[l])};EditorUi.replaceSvgImage=function(c){try{var g=null;g=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var l=EditorUi.getSvgSubtree(g);if(null!=l&&"svg"==l.nodeName){var t=l.getAttribute("width"),B=l.getAttribute("height");l.setAttribute("x",c.getAttribute("x"));l.setAttribute("y",c.getAttribute("y"));l.setAttribute("width",c.getAttribute("width"));l.setAttribute("height",c.getAttribute("height"));l.style.fontFamily="initial";0<t&&0<B&&null==l.getAttribute("viewBox")&&l.setAttribute("viewBox","0 0 "+t+" "+B);var D=mxUtils.createElementNs(l.ownerDocument,mxConstants.NS_SVG,"g");D.appendChild(l);c.hasAttribute("transform")&&D.setAttribute("transform",-c.getAttribute("transform"));c.parentNode.replaceChild(D,c)}}catch(I){}};EditorUi.getSvgSubtree=function(c){var g=Graph.getSvgFromDataUri(c);c=null;if(null!=g){c=Graph.sanitizeNode(mxUtils.parseXml(g).documentElement);g=c.getElementsByTagName("style");if(0<g.length){var l="svg-image-"+Editor.guid();c.setAttribute("id",l);for(var t=document.implementation.createHTMLDocument(""),B=document.createElement("style"),D=0;D<g.length;D++){B.textContent=g[D].textContent;t.body.appendChild(B);for(var I="",L=-0;L<B.sheet.cssRules.length;L++){var N=B.sheet.cssRules[L];if(null!=N.selectorText){for(var K=N.selectorText.split(","),da=0;da<K.length;da++)K[da]="#"+l+" "+K[da];N.selectorText=K.join(",")}I+=N.cssText+"\n"}g[D].textContent=I}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");g=c.getElementsByTagName("*");for(l=0;l<g.length;l++)g[l].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+c.getAttribute("transform"));c.parentNode.replaceChild(D,c)}}catch(I){}};EditorUi.getSvgSubtree=function(c){var g=Graph.getSvgFromDataUri(c);c=null;if(null!=g){c=Graph.sanitizeNode(mxUtils.parseXml(g).documentElement);g=c.getElementsByTagName("style");if(0<g.length){var l="svg-image-"+Editor.guid();c.setAttribute("id",l);for(var t=document.implementation.createHTMLDocument(""),B=document.createElement("style"),D=0;D<g.length;D++){B.textContent=g[D].textContent;t.body.appendChild(B);for(var I="",K=+0;K<B.sheet.cssRules.length;K++){var M=B.sheet.cssRules[K];if(null!=M.selectorText){for(var V=M.selectorText.split(","),Q=0;Q<V.length;Q++)V[Q]="#"+l+" "+V[Q];M.selectorText=V.join(",")}I+=M.cssText+"\n"}g[D].textContent=I}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");g=c.getElementsByTagName("*");for(l=0;l<g.length;l++)g[l].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.sidebarEnabled="0"!=urlParams.sidebar;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedMessageSource=null;EditorUi.prototype.defaultCompact=!1;EditorUi.prototype.noAutoFocus=!1;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;EditorUi.prototype.createButtonContainer=function(){var c=document.createElement("div");c.className="geButtonContainer";return c};EditorUi.prototype.openLink=@@ -3614,10 +3619,10 @@ function(c,g,l){return this.editor.graph.openLink(c,g,l)};EditorUi.prototype.shoc;this.fireEvent(new mxEventObject("shareCursorPositionChanged"))};EditorUi.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 g=this.editor.graph;g.mathEnabled=c;null!=g.view.backgroundImage&&(g.view.backgroundImage.destroy(),g.view.backgroundImage=null);this.editor.updateGraphComponents();g.refresh();g.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,g,l){var t=null==c||null==g;l=null!=l?l:24;var B=new Spinner({lines:12,length:l,width:Math.round(l/-3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),D=this.timeout,I=B.spin,L=null,N=null,K=mxUtils.bind(this,function(ea){null!=ea&&ea()}),da=this;B.spin=function(ea,ca,fa,la){la=null!=la?la:D;var ka=!1;if(!this.active){var V=Date.now();null!=fa&&(L=window.setTimeout(function(){B.stop();L=null;fa({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:N})},la));t&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||-0)/2,c=document.body.clientWidth/2-2);ea==document.body&&"1"==urlParams.embedInline&&(ea=da.diagramContainer,c=ea.scrollLeft+ea.clientWidth/2,g=ea.scrollTop+ea.clientHeight/2);I.call(this,ea);"1"==urlParams.embedInline&&null!=B.el&&(B.el.style.marginTop=ea.scrollTop+"px",B.el.style.marginLeft=ea.scrollLeft+"px");this.active=!0;null!=ca&&(ka=document.createElement("div"),ka.className="geSpinnerStatus",ka.setAttribute("title",ca),ea==document.body?(ka.style.left=Math.max(0,c)+"px",ka.style.top=Math.max(0,-g+66)+"px"):(ka.style.left="50%",ka.style.top="50%",ka.style.marginTop="70px"),"..."!=ca.substring(ca.length-3,ca.length)&&"!"!=ca.charAt(ca.length-1)&&(ca+="..."),ka.innerText=ca,ea.appendChild(ka),B.status=ka);this.pause=mxUtils.bind(this,function(){var k=K;this.active&&(la=Math.max(0,la-(Date.now()-V)),k=mxUtils.bind(this,function(x){this.spin(ea,ca,fa,la);if(null!=x)try{x(),N=mxUtils.bind(this,function(){this.spin(ea,ca,fa,la);try{x()}catch(J){null!=fa&&fa(J)}})}catch(J){null!=fa&&fa(J)}}));this.stop();-return k});ka=!0}return ka};var ja=B.stop;B.stop=function(){ja.call(this);this.active&&(this.active=!1,null!=L&&(window.clearTimeout(L),L=null),null!=B.status&&null!=B.status.parentNode&&B.status.parentNode.removeChild(B.status),B.status=null)};B.pause=function(){return K};return B};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var g=mxUtils.parseXml(c),l=this.editor.extractGraphModel(g.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}}catch(t){}return!1};+3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),D=this.timeout,I=B.spin,K=null,M=null,V=mxUtils.bind(this,function(ea){null!=ea&&ea()}),Q=this;B.spin=function(ea,da,ia,la){la=null!=la?la:D;var ka=!1;if(!this.active){var W=Date.now();null!=ia&&(K=window.setTimeout(function(){B.stop();K=null;ia({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:M})},la));t&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||+0)/2,c=document.body.clientWidth/2-2);ea==document.body&&"1"==urlParams.embedInline&&(ea=Q.diagramContainer,c=ea.scrollLeft+ea.clientWidth/2,g=ea.scrollTop+ea.clientHeight/2);I.call(this,ea);"1"==urlParams.embedInline&&null!=B.el&&(B.el.style.marginTop=ea.scrollTop+"px",B.el.style.marginLeft=ea.scrollLeft+"px");this.active=!0;null!=da&&(ka=document.createElement("div"),ka.className="geSpinnerStatus",ka.setAttribute("title",da),ea==document.body?(ka.style.left=Math.max(0,c)+"px",ka.style.top=Math.max(0,+g+66)+"px"):(ka.style.left="50%",ka.style.top="50%",ka.style.marginTop="70px"),"..."!=da.substring(da.length-3,da.length)&&"!"!=da.charAt(da.length-1)&&(da+="..."),ka.innerText=da,ea.appendChild(ka),B.status=ka);this.pause=mxUtils.bind(this,function(){var k=V;this.active&&(la=Math.max(0,la-(Date.now()-W)),k=mxUtils.bind(this,function(y){this.spin(ea,da,ia,la);if(null!=y)try{y(),M=mxUtils.bind(this,function(){this.spin(ea,da,ia,la);try{y()}catch(J){null!=ia&&ia(J)}})}catch(J){null!=ia&&ia(J)}}));this.stop();+return k});ka=!0}return ka};var ja=B.stop;B.stop=function(){ja.call(this);this.active&&(this.active=!1,null!=K&&(window.clearTimeout(K),K=null),null!=B.status&&null!=B.status.parentNode&&B.status.parentNode.removeChild(B.status),B.status=null)};B.pause=function(){return V};return B};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var g=mxUtils.parseXml(c),l=this.editor.extractGraphModel(g.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}}catch(t){}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 g=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=g.getFunction,t=this.editor.graph,B=this;g.getFunction=function(D){if(t.isSelectionEmpty()&&null!=B.pages&&0<B.pages.length){var I=B.getSelectedPageIndex();if(mxEvent.isShiftDown(D)){if(37==D.keyCode)return function(){0<I&&B.movePage(I,I-1)};if(38==D.keyCode)return function(){0<I&&B.movePage(I,0)};if(39==D.keyCode)return function(){I<B.pages.length-1&&B.movePage(I,I+1)};if(40==D.keyCode)return function(){I<B.pages.length-1&&B.movePage(I,B.pages.length-1)}}else if(mxEvent.isControlDown(D)||mxClient.IS_MAC&&@@ -3626,580 +3631,587 @@ arguments):null}}return g};var d=EditorUi.prototype.extractGraphModelFromHtml;Edg=null!=D?mxUtils.getXml(D):""}}catch(I){}return g};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var g=c.indexOf('<meta charset="utf-8">');0<=g&&(c=c.slice(0,g)+'<meta charset="utf-8"/>'+c.slice(g+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,g){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",g);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=null!=c?this.editor.extractGraphModel(c,!0):null;null!=l&&(c=l);if(null!=c){l=this.editor.graph;l.model.beginUpdate();try{var t=null!=this.pages?this.pages.slice():null,B=c.getElementsByTagName("diagram");if(1<B.length||1==B.length&&B[0].hasAttribute("name")){this.fileNode=c;l.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var D=B.length-1;0<=D;D--){var I=this.updatePageRoot(new DiagramPage(B[D]));null==I.getName()&&I.setName(mxResources.get("pageWithNumber",[D+1]));l.model.execute(new ChangePage(this,I,0==D?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])),l.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,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=-t)for(D=0;D<t.length;D++)l.model.execute(new ChangePage(this,t[D],null));var L=this.getCurrentFile();null!=L&&L.fileReplaced(g)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){g=null!=g?g:this.editor.graph;B=null!=B?B:!1;N=null!=N?N:!0;K=null!=K?K:this.defaultCompact;da=null!=da?da:!Editor.defaultCompressed;var ca=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var fa="_blank";else ca=fa=t;if(null==c)return"";var la=-c;if("mxfile"!=la.nodeName.toLowerCase()){if(da){var ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());ka.appendChild(c)}else{ka=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(ka);if(Graph.decompress(la)!=ka)return ka;ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());mxUtils.setTextContent(ka,la)}la=c.ownerDocument.createElement("mxfile");-la.appendChild(ka)}K?(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?+t)for(D=0;D<t.length;D++)l.model.execute(new ChangePage(this,t[D],null));var K=this.getCurrentFile();null!=K&&K.fileReplaced(g)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){g=null!=g?g:this.editor.graph;B=null!=B?B:!1;M=null!=M?M:!0;V=null!=V?V:this.defaultCompact;Q=null!=Q?Q:!Editor.defaultCompressed;var da=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var ia="_blank";else da=ia=t;if(null==c)return"";var la=+c;if("mxfile"!=la.nodeName.toLowerCase()){if(Q){var ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());ka.appendChild(c)}else{ka=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(ka);if(Graph.decompress(la)!=ka)return ka;ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());mxUtils.setTextContent(ka,la)}la=c.ownerDocument.createElement("mxfile");+la.appendChild(ka)}V?(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!=ja&&(la=la.cloneNode(!0),la.setAttribute("scale",ja));null!=ea&&(la=la.cloneNode(!0),la.setAttribute("border",ea));-c=da?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!D&&!B&&(I||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(la),g,null!=l?l.getTitle():null,fa,ca);else if(D||!B&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(t=null),l=this.getSvgFileProperties(la),c=this.getEmbeddedSvg(c,g,t,null,L,N,ca,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,t){c=null!=-c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var B=this.editor.getGraphXml(c,t);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(N){var K=N.getElementsByTagName("mxGraphModel"),da=0<K.length?K[0]:null;K=N;null==da&&l?(da=mxUtils.getNodeValue(N),0<da.length&&(da=Graph.decompress(da),null!=da&&0<da.length&&(K=N.cloneNode(!1),K.appendChild(mxUtils.parseXml(da).documentElement)))):null==da||l?K=N.cloneNode(!0):(K=N.cloneNode(!1),mxUtils.setTextContent(K,Graph.compressNode(da)));-B.appendChild(K)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(B),B=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var D=this.pages[g],I=D.node;if(D!=this.currentPage)if(D.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(D.root));this.editor.graph.saveViewState(D.viewState,L,null,t);EditorUi.removeChildNodes(I);I.appendChild(L);delete D.needsUpdate}else t&&(this.updatePageRoot(D),-null!=D.viewState.backgroundImage&&null!=D.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(D.root)),this.editor.graph.saveViewState(D.viewState,L,null,t,D),I=I.cloneNode(!1),I.appendChild(L)));c(I)}return B};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],t=0;t<c.length;t++){var B=c.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(B)?l.push(B):isNaN(parseInt(B))?B.toLowerCase()!=B?l.push(String.fromCharCode(65+Math.round(25*-Math.random()))):B.toUpperCase()!=B?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(B)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));-c[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(D){c[EditorUi.DIFF_INSERT][g].data=D.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var t in c[EditorUi.DIFF_UPDATE]){var B=c[EditorUi.DIFF_UPDATE][t];null!=B.name&&(B.name=this.anonymizeString(B.name));null!=B.cells&&(g=mxUtils.bind(this,function(D){var I=B.cells[D];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 B.cells[D]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(B.cells)&&delete B.cells);mxUtils.isEmptyObject(B)&&delete c[EditorUi.DIFF_UPDATE][t]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&-c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(c,g){g=c.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&g[l].setAttribute("value","["+g[l].getAttribute("value").length+"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+-"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length+"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&g.invalidChecksum?-g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=-function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){B=null!=B?B:!0;D=null!=D?D:!1;K=null!=K?K:!Editor.defaultCompressed;var ca=this.editor.graph;if((g||!c&&null!=N&&/(\.svg)$/i.test(N.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var fa=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(ka){return"page"==ka&&null!=la?la.getName():"pagenumber"==ka?1:fa.apply(this,arguments)};document.body.appendChild(ca.container);null!=la&&ca.model.setRoot(la.root)}I=null!=I?I:this.getXmlFileData(B,D,K,da);N=null!=N?N:this.getCurrentFile();c=this.createFileData(I,ca,N,window.location.href,c,g,l,t,B,L,K,ja,ea);ca!=this.editor.graph&&ca.container.parentNode.removeChild(ca.container);-return c};EditorUi.prototype.getHtml=function(c,g,l,t,B,D){D=null!=D?D:!0;var I=null,L=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=g){I=D?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var N=g.view.scale;D=Math.floor(I.x/N-g.view.translate.x);N=Math.floor(I.y/N-g.view.translate.y);I=g.background;null==B&&(g=this.getBasenames().join(";"),0<g.length&&(L=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",D);c.setAttribute("y0",N)}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!=t&&c.setAttribute("edit",t));null!=B&&(B=B.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";t=Graph.compress(c);Graph.decompress(t)!=c&&(t=encodeURIComponent(c));return(null==B?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=B?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+-(null==B?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=B?'<meta http-equiv="refresh" content="0;URL=\''+B+"'\"/>\n":"")+"</head>\n<body"+(null==B&&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;">'+t+"</div>\n</div>\n"+(null==B?'<script type="text/javascript" src="'+L+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+-B+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,g,l,t,B){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=B&&(B=B.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==B?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=B?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==B?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=B?'<meta http-equiv="refresh" content="0;URL=\''+B+"'\"/>\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==B?'<script type="text/javascript" src="'+g+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+B+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.updateFileVars=function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=-null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(g){}};EditorUi.prototype.setFileData=function(c,g){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,-!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var t=this.getHashObject(),B=null;this.fileNode=g;this.editor.graph.defaultExportLinkTarget=g.getAttribute("linkTarget");this.pages=[];for(var D=0;D<c.length;D++){null==c[D].getAttribute("id")&&c[D].setAttribute("id",D);g=new DiagramPage(c[D]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[D+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)B=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=B?B: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 I=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(D=0;D<I.length;D++)g[I[D]]=!0;var L=this.editor.graph.getModel(),N=L.getChildren(L.root);for(D=0;D<N.length;D++){var K=N[D];L.setVisible(K,g[K.id]||!1)}}catch(da){}};EditorUi.prototype.fileStats=function(c,g){try{if(null!=-c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=g.getElementsByTagName("diagram");g={};g.modified=c.getLastModifiedDate();g.fileMode=c.getMode();g.fileSize=c.getSize();g.fileHash=c.getHash();g.pages=l.length;g.redundantStencils=0;g.redundantImages=0;g.redundantSize=0;g.stencils=0;g.images=0;for(var t=g.cells=0;t<l.length;t++){var B=l[t].getElementsByTagName("mxCell");g.cells+=B.length;for(var D={},I=0;I<B.length;I++){var L=B[I].getAttribute("style");if(null!=L)for(var N=-L.split(";"),K=0;K<N.length;K++){var da=N[K];if(da.startsWith("image=data:")||da.startsWith("shape=stencil("))null==D[da]?D[da]=1:D[da]++}}for(var ja in D){var ea=D[ja];ja.startsWith("shape=stencil(")?g.stencils+=ea:g.images+=ea;1<ea&&(g.redundantSize+=ja.length*(ea-1),ja.startsWith("shape=stencil(")?g.redundantStencils+=ea-1:g.redundantImages+=ea-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(g)})}}catch(ca){}};-EditorUi.prototype.getBaseFilename=function(c){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(".")));!c&&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(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la,ka){try{t=null!=t?t:this.editor.graph.isSelectionEmpty();var V=this.getBaseFilename(!B),k=V+("xml"==c||"pdf"==c&&da?".drawio":"")+"."+c;if("xml"==c){var x=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,B,null,null,null,g);this.saveData(k,c,x,"text/xml")}else if("html"==c)x=this.getHtml2(this.getFileData(!0),this.editor.graph,V),this.saveData(k,c,x,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,-mxResources.get("export")))"xmlpng"==c?k=V+".png":"jpeg"==c&&(k=V+".jpg"),this.saveRequest(k,c,mxUtils.bind(this,function(W,U){try{return this.createDownloadRequest(W,c,t,U,I,B,L,N,K,da,ja,void 0,void 0,!D,ea,ca,fa,la,ka)}catch(aa){this.handleError(aa)}}));else{var J=null,R=mxUtils.bind(this,function(W){W.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(J)}))});-if("svg"==c){var Y=this.editor.graph.background;if(I||Y==mxConstants.NONE)Y=null;var Z=this.editor.graph.getSvg(Y,null,null,null,null,t);l&&this.editor.graph.addSvgShadow(Z);this.editor.convertImages(Z,mxUtils.bind(this,mxUtils.bind(this,function(W){this.spinner.stop();R(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(W))})))}else k=V+".svg",J=this.getFileData(!1,!0,null,mxUtils.bind(this,function(W){this.spinner.stop();R(W)}),t)}}catch(W){this.handleError(W)}};EditorUi.prototype.createDownloadRequest=-function(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la,ka,V,k){c=this.downloadRequestBuilder(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la,ka,V,k);g="";for(var x in c)l=c[x],null!=l&&(g+=x+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la,ka,V,k){var x=this.editor.graph,J=x.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==D?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var R=-null,Y=null,Z=null;if(!EditorUi.isElectronApp&&(J.width*J.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};K=K?"1":"0";"pdf"==g&&(null!=da?(R=da.from,Y=da.to):0==D&&(Z="1"));"xmlpng"==g&&(K="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(D=0;D<this.pages.length;D++)if(this.pages[D]==this.currentPage){R=D;break}D=x.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!B?B||null!=D&&D!=mxConstants.NONE||(D="#ffffff"):D=mxConstants.NONE;-B={globalVars:x.getExportVariables()};null!=da&&null!=da.from&&(B.globalVars.pagenumber=da.from+1);N&&(B.grid={size:x.gridSize,steps:x.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:x.view.gridColor});Graph.translateDiagram&&(B.diagramLanguage=Graph.diagramLanguage);return{format:g,from:R,to:Y,allPages:Z,bg:null!=D?D:mxConstants.NONE,base64:t,embedXml:K,xml:l,filename:null!=c?c:"",extras:JSON.stringify(B),scale:I,border:L,pageMargin:fa,w:ja&&isFinite(ja)?-ja:null,h:ea&&isFinite(ea)?ea:null,crop:null!=ca&&ca?"1":"0",fit:null!=la&&la?"1":"0",shadows:null!=k&&k?"1":"0",sheetsAcross:ka,sheetsDown:V}};EditorUi.prototype.setMode=function(c,g){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 g=c.indexOf("#");0<=g&&(c=c.substring(0,g))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,g={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");-if(0<l){c=decodeURIComponent(c.substring(l+1));try{g=JSON.parse(c)}catch(t){}}}return g};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 g=window.location.hash;if(null==g||""==g)g="#";var l=g.lastIndexOf("#");0<l&&(g=g.substring(0,-l));try{null==c||mxUtils.isEmptyObject(c)||(g=g+"#"+encodeURIComponent(JSON.stringify(c)))}catch(t){}0<l&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=function(c,g,l){var t=window.location.hash,B=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 t};this.fileLoaded(I);"csv"==c.format&&this.importCsv(L,mxUtils.bind(this,function(ea){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var N=null!=c.interval?parseInt(c.interval):6E4,K=null,da=mxUtils.bind(this,function(){var ea=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(ca){ea===this.currentPage&&(200<=ca.getStatus()&&300>=-ca.getStatus()?(this.updateDiagram(ca.getText()),ja()):this.handleError({message:mxResources.get("error")+" "+ca.getStatus()}))}),mxUtils.bind(this,function(ca){this.handleError(ca)}))}),ja=mxUtils.bind(this,function(){window.clearTimeout(K);K=window.setTimeout(da,N)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ja();da()}));ja();da()}null!=g&&g()});if(null!=c.url&&0<c.url.length){var D=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(D,mxUtils.bind(this,function(I){B(I)}),-mxUtils.bind(this,function(I){null!=l&&l(I)}))}else B("")};EditorUi.prototype.updateDiagram=function(c){function g(x){var J=new mxCellOverlay(x.image||B.warningImage,x.tooltip,x.align,x.valign,x.offset);J.addListener(mxEvent.CLICK,function(R,Y){t.alert(x.tooltip)});return J}var l=null,t=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var B=this.editor.graph,D=B.getModel();D.beginUpdate();var I=null;try{for(c=c.firstChild;null!=-c;){if("update"==c.nodeName){var L=D.getCell(c.getAttribute("id"));if(null!=L){try{var N=c.getAttribute("value");if(null!=N){var K=mxUtils.parseXml(N).documentElement;if(null!=K)if("1"==K.getAttribute("replace-value"))D.setValue(L,K);else for(var da=K.attributes,ja=0;ja<da.length;ja++)B.setAttributeForCell(L,da[ja].nodeName,0<da[ja].nodeValue.length?da[ja].nodeValue:null)}}catch(x){null!=window.console&&console.log("Error in value for "+L.id+": "+x)}try{var ea=c.getAttribute("style");null!=ea&&B.model.setStyle(L,-ea)}catch(x){null!=window.console&&console.log("Error in style for "+L.id+": "+x)}try{var ca=c.getAttribute("icon");if(null!=ca){var fa=0<ca.length?JSON.parse(ca):null;null!=fa&&fa.append||B.removeCellOverlays(L);null!=fa&&B.addCellOverlay(L,g(fa))}}catch(x){null!=window.console&&console.log("Error in icon for "+L.id+": "+x)}try{var la=c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var ka=B.getCellGeometry(L);if(null!=ka){ka=ka.clone();for(key in la){var V=parseFloat(la[key]);"dx"==key?-ka.x+=V:"dy"==key?ka.y+=V:"dw"==key?ka.width+=V:"dh"==key?ka.height+=V:ka[key]=parseFloat(la[key])}B.model.setGeometry(L,ka)}}}catch(x){null!=window.console&&console.log("Error in icon for "+L.id+": "+x)}}}else if("model"==c.nodeName){for(var k=c.firstChild;null!=k&&k.nodeType!=mxConstants.NODETYPE_ELEMENT;)k=k.nextSibling;null!=k&&(new mxCodec(c.firstChild)).decode(k,D)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(B.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||-c.hasAttribute("dy"))B.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{D.endUpdate()}null!=I&&this.chromelessResize&&this.chromelessResize(!0,I)}return l};EditorUi.prototype.getCopyFilename=function(c,g){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var t=l.lastIndexOf(".");0<=t&&(c=l.substring(t),l=-l.substring(0,t));if(g){g=l;var B=new Date;l=B.getFullYear();t=B.getMonth()+1;var D=B.getDate(),I=B.getHours(),L=B.getMinutes();B=B.getSeconds();l=g+(" "+(l+"-"+t+"-"+D+"-"+I+"-"+L+"-"+B))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=function(c,g){try{null!=c&&g&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,g,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[g]);var t=this.getCurrentFile();this.fileEditable=-this.fileLoadedError=null;this.setCurrentFile(null);var B=!1;this.hideDialog();null!=t&&(t.removeListener(this.descriptorChangedListener),this.logIfModified(t,!0),t.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var D=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=t&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!g&&null!=window.location.hash&&0<window.location.hash.length&&-(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();g||("0"!=urlParams.splash?this.showSplash():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=c)try{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.clearStatus():this.updateStatus(mxUtils.bind(this,function(){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||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));B=!0;if(!this.isOffline()&&null!=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.logEvent({category:c.getMode().toUpperCase()+-"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+I})}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(N){}c=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)||D():D()});g?c():(null!=L.fallbackFileData&&(L.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var N=new LocalFile(this,L.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(N)})}),this.handleError(L,mxResources.get("errorLoadingFile"),-c,!0,null,null,!0))}else D();return B};EditorUi.prototype.getHashValueForPages=function(c,g){var l=0,t=new mxGraphModel,B=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var D=0;D<c.length;D++){this.updatePageRoot(c[D]);var I=c[D].node.cloneNode(!1);I.removeAttribute("name");t.root=c[D].root;var L=B.encode(t);this.editor.graph.saveViewState(c[D].viewState,L,!0);L.removeAttribute("pageWidth");L.removeAttribute("pageHeight");I.appendChild(L);null!=g&&(g.eltCount+=I.getElementsByTagName("*").length,-g.nodeCount+=I.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(I,function(N,K,da,ja){return!ja||"mxGeometry"!=N.nodeName&&"mxPoint"!=N.nodeName||"x"!=K&&"y"!=K&&"width"!=K&&"height"!=K?ja&&"mxCell"==N.nodeName&&"previous"==K?null:da:Math.round(da)},g)<<0}return l};EditorUi.prototype.hashValue=function(c,g,l){var t=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(t^=this.hashValue(c.nodeName,-g,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var B=0;B<c.attributes.length;B++){var D=c.attributes[B].name,I=null!=g?g(c,D,c.attributes[B].value,!0):c.attributes[B].value;null!=I&&(t^=this.hashValue(D,g,l)+this.hashValue(I,g,l))}}if(null!=c.childNodes)for(B=0;B<c.childNodes.length;B++)t=(t<<5)-t+this.hashValue(c.childNodes[B],g,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);g=0;null!=l&&(l.byteCount+=c.length);for(B=0;B<c.length;B++)g=(g<<5)-g+c.charCodeAt(B)<<-0;t^=g}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,g,l,t,B,D,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){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;-this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var g=0;g<c.length;g++)null!=c[g].xml&&"<"!=c[g].xml.charAt(0)&&(c[g].xml=mxUtils.trim(Graph.decompress(c[g].xml)));g=mxUtils.createXmlDocument();var l=g.createElement("mxlibrary");mxUtils.setTextContent(l,JSON.stringify(c,null,2));g.appendChild(l);return mxUtils.getXml(g,"\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 g=this.sidebar.palettes[c];if(null!=g){for(var l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,g){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||-null!=c||!g){null==c&&(g=this.sidebar.palettes["L.scratchpad"],null==g&&(g=this.sidebar.palettes.search),null!=g&&(c=g[g.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;g=l.lastChild;var t=g.previousSibling;l.insertBefore(g,c);l.insertBefore(t,g)}};EditorUi.prototype.loadLibrary=function(c,g){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var t=JSON.parse(mxUtils.getTextContent(l.documentElement));this.libraryLoaded(c,t,l.documentElement.getAttribute("title"),-g,l.documentElement.getAttribute("tags"))}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.showSearchWindow=function(c,g){var l=c?"findReplace":"find",t=l+"Window";if(null==this[t]){var B="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,-D=c?B?330:300:240;this[t]=new FindWindow(this,document.body.offsetWidth-(D+20),100,D,c?B?304:288:180,c);this[t].window.addListener("show",function(){this.fireEvent(new mxEventObject(l))});this[t].window.addListener("hide",function(){this.fireEvent(new mxEventObject(l))});this[t].window.setVisible(!0)}else null==g&&this[t].window.setVisible(!this[t].window.isVisible());null!=g&&(this[t].doSearch(g),this[t].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,g,l,t,B){if(null!=this.sidebar){c.constructor!=-LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var D=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var I=0;I<this.openLibraries.length;I++)if(this.openLibraries[I].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[I],this.openLibraries);break}D={file:c,images:g,title:l,expand:t};this.openLibraries.push(D)}else this.scratchpad=c;I=this.sidebar.palettes[c.getHash()];I=null!=I?I[I.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());-var L=null,N=mxUtils.bind(this,function(k,x){0==k.length&&c.isEditable()?(null==L&&(L=document.createElement("div"),L.className="geDropTarget",mxUtils.write(L,mxResources.get("dragElementsHere"))),x.appendChild(L)):this.addLibraryEntries(k,x)});null!=this.sidebar&&null!=g&&this.sidebar.addEntries(g,B);null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var K=this.sidebar.addPalette(c.getHash(),l,null!=t?t:!0,mxUtils.bind(this,function(k){N(g,k)}));null!=D&&-(D.div=K);this.repositionLibrary(I,"L.scratchpad"!=c.getHash());t=K.parentNode.previousSibling;l=t.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&t.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var da=document.createElement("div");da.style.backgroundColor="inherit";t.style.position="relative";var ja=document.createElement("img");ja.className="geLibraryButton";ja.setAttribute("src",Editor.crossImage);ja.setAttribute("title",mxResources.get("close"));var ea=null;if(".scratchpad"!=-c.title||this.closableScratchpad)da.appendChild(ja),mxEvent.addListener(ja,"click",mxUtils.bind(this,function(k){if(!mxEvent.isConsumed(k)){var x=mxUtils.bind(this,function(){null!=D&&mxUtils.remove(D,this.openLibraries);this.closeLibrary(c)});null!=ea?this.confirm(mxResources.get("allChangesLost"),null,x,mxResources.get("cancel"),mxResources.get("discardChanges")):x();mxEvent.consume(k)}}));if(c.isEditable()){var ca=this.editor.graph,fa=null;l=mxUtils.bind(this,function(k){this.showLibraryDialog(c.getTitle(),-K,g,c,c.getMode());mxEvent.consume(k)});var la=mxUtils.bind(this,function(k){c.setModified(!0);c.isAutosave()?(null!=fa&&null!=fa.parentNode&&fa.parentNode.removeChild(fa),fa=ja.cloneNode(!1),fa.setAttribute("src",Editor.spinImage),fa.setAttribute("title",mxResources.get("saving")),fa.style.cursor="default",fa.style.marginRight="2px",fa.style.marginTop="-2px",da.insertBefore(fa,da.firstChild),this.saveLibrary(c.getTitle(),g,c,c.getMode(),!0,!0,function(){null!=fa&&null!=fa.parentNode&&fa.parentNode.removeChild(fa)})):-null==ea&&(ea=ja.cloneNode(!1),ea.setAttribute("src",Editor.saveImage),ea.setAttribute("title",mxResources.get("save")),da.insertBefore(ea,da.firstChild),mxEvent.addListener(ea,"click",mxUtils.bind(this,function(x){this.saveLibrary(c.getTitle(),g,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==ea||c.isModified()||(ea.parentNode.removeChild(ea),ea=null)});mxEvent.consume(x)})))}),ka=mxUtils.bind(this,function(k,x,J,R){k=ca.cloneCells(mxUtils.sortCells(ca.model.getTopmostCells(k)));for(var Y=-0;Y<k.length;Y++){var Z=ca.getCellGeometry(k[Y]);null!=Z&&Z.translate(-x.x,-x.y)}K.appendChild(this.sidebar.createVertexTemplateFromCells(k,x.width,x.height,R||"",!0,null,!1));k=mxUtils.getXml(this.editor.graph.encodeCells(k));Editor.defaultCompressed&&(k=Graph.compress(k));x={xml:k,w:x.width,h:x.height};null!=R&&(x.title=R);g.push(x);la(J);null!=L&&null!=L.parentNode&&0<g.length&&(L.parentNode.removeChild(L),L=null)}),V=mxUtils.bind(this,function(k){if(ca.isSelectionEmpty())ca.getRubberband().isActive()?-(ca.getRubberband().execute(k),ca.getRubberband().reset()):null!=k&&mxEvent.getSource(k).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var x=ca.getSelectionCells(),J=ca.view.getBounds(x);if(null!=J&&0<J.width&&0<J.height){var R=ca.view.scale;J.x/=R;J.y/=R;J.width/=R;J.height/=R;J.x-=ca.view.translate.x;J.y-=ca.view.translate.y;ka(x,J)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),-mxResources.get("ok"))}mxEvent.consume(k)});mxEvent.addGestureListeners(K,function(){},mxUtils.bind(this,function(k){ca.isMouseDown&&null!=ca.panningManager&&null!=ca.graphHandler.first&&(ca.graphHandler.suspend(),null!=ca.graphHandler.hint&&(ca.graphHandler.hint.style.visibility="hidden"),K.style.backgroundColor="light-dark(#fefefe, #000000)",K.style.cursor="copy",ca.panningManager.stop(),ca.autoScroll=!1,mxEvent.consume(k))}),mxUtils.bind(this,function(k){ca.isMouseDown&&null!=ca.panningManager&&-null!=ca.graphHandler&&(K.style.backgroundColor="",K.style.cursor="default",this.sidebar.showTooltips=!0,ca.panningManager.stop(),ca.graphHandler.reset(),ca.isMouseDown=!1,ca.autoScroll=!0,V(k),mxEvent.consume(k))}));mxEvent.addListener(K,"mouseleave",mxUtils.bind(this,function(k){ca.isMouseDown&&null!=ca.graphHandler.first&&(ca.graphHandler.resume(),null!=ca.graphHandler.hint&&(ca.graphHandler.hint.style.visibility="visible"),K.style.backgroundColor="",K.style.cursor="",ca.autoScroll=!0)}));Graph.fileSupport&&-(mxEvent.addListener(K,"dragover",mxUtils.bind(this,function(k){K.style.backgroundColor="light-dark(#fefefe, #000000)";k.dataTransfer.dropEffect="copy";K.style.cursor="copy";this.sidebar.hideTooltip();k.stopPropagation();k.preventDefault()})),mxEvent.addListener(K,"drop",mxUtils.bind(this,function(k){K.style.cursor="";K.style.backgroundColor="";0<k.dataTransfer.files.length&&this.importFiles(k.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(x,J,R,Y,Z,W,U,aa,ia){if(null!=x&&"image/"==-J.substring(0,6))x="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(x),x=[new mxCell("",new mxGeometry(0,0,Z,W),x)],x[0].vertex=!0,ka(x,new mxRectangle(0,0,Z,W),k,mxEvent.isAltDown(k)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g," ")),null!=L&&null!=L.parentNode&&0<g.length&&(L.parentNode.removeChild(L),L=null);else{var na=!1,qa=mxUtils.bind(this,function(ta,ua){null!=ta&&"application/pdf"==ua&&(ua=Editor.extractGraphModelFromPdf(ta),-null!=ua&&0<ua.length&&(ta=ua));if(null!=ta)if(ta=mxUtils.parseXml(ta),"mxlibrary"==ta.documentElement.nodeName)try{var Ba=JSON.parse(mxUtils.getTextContent(ta.documentElement));N(Ba,K);g=g.concat(Ba);la(k);this.spinner.stop();na=!0}catch(Ra){}else if("mxfile"==ta.documentElement.nodeName)try{var za=ta.documentElement.getElementsByTagName("diagram");for(Ba=0;Ba<za.length;Ba++){var Aa=this.stringToCells(Editor.getDiagramNodeXml(za[Ba])),Ga=this.editor.graph.getBoundingBoxFromGeometry(Aa);null!=Ga&&-ka(Aa,new mxRectangle(0,0,Ga.width,Ga.height),k)}na=!0}catch(Ra){null!=window.console&&console.log("error in drop handler:",Ra)}na||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=L&&null!=L.parentNode&&0<g.length&&(L.parentNode.removeChild(L),L=null)});null!=ia&&null!=U&&EditorUi.isVisioFilename(U)?this.importVisio(ia,function(ta){qa(ta,"text/xml")},null,U):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(x,U)&&null!=ia?this.isExternalDataComms()?this.parseFile(ia,-mxUtils.bind(this,function(ta){4==ta.readyState&&(this.spinner.stop(),200<=ta.status&&299>=ta.status?qa(ta.responseText,"text/xml"):this.handleError({message:mxResources.get(413==ta.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):qa(x,J)}}));k.stopPropagation();k.preventDefault()})),mxEvent.addListener(K,"dragleave",function(k){K.style.cursor="";K.style.backgroundColor=-"";k.stopPropagation();k.preventDefault()}));ja=ja.cloneNode(!1);ja.setAttribute("src",Editor.editImage);ja.setAttribute("title",mxResources.get("edit"));da.insertBefore(ja,da.firstChild);mxEvent.addListener(ja,"click",l);l=ja.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));da.insertBefore(l,da.firstChild);mxEvent.addListener(l,"click",V);".scratchpad"==c.title&&(this.addSelectionToScratchpad=V);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||-(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",da.insertBefore(l,da.firstChild))}t.appendChild(da);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,g){for(var l=0;l<c.length;l++)try{var t=c[l],B=t.data;if(null!=B){B="data:"==B.substring(0,5)?this.convertDataUri(B):B;var D="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==t.aspect&&(D+="aspect=fixed;");D=D+"image="+B+-";";null!=t.style&&(D+=t.style);g.appendChild(this.sidebar.createVertexTemplate(D,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var I=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),L=0==I.length?mxResources.get("drawingEmpty"):null!=t.title?t.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(I,t.w,t.h,L,!0,null,!0))}}catch(N){L=null!=N.message?mxResources.get("error")+": "+N.message:String(N),D=this.sidebar.createVertexTemplateFromCells(null,t.w,-t.h,L,!0,null,!0),g.appendChild(D)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,g,l,t,B,D,I){c=new ImageDialog(this,c,g,-l,t,B,D,I);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,g,l,t,B,D){var I=localStorage.getItem(g);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!=D&&D(L),L==I)this.hideDialog();else{if(0<L.length){var N=JSON.parse(L);localStorage.setItem(g,JSON.stringify(N))}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,B,l,t);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,g,l,t){c=null!=c?c:mxUtils.bind(this,function(B,D,I,L){D||(B=new ChangePageSetup(this,t?I:null,B),B.ignoreColor=!t,null!=L&&t&&(B.shadowVisible=L),this.editor.graph.model.execute(B))});c=new BackgroundImageDialog(this,c,g,l,t);this.showDialog(c.container,400,-t?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,g,l,t,B){c=new LibraryDialog(this,c,g,l,t,B);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(D){D&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var m=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var g=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&-g.refresh()}));return g};EditorUi.prototype.handleError=function(c,g,l,t,B,D,I){var L=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},N=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(ea){}if(null!=-N||null!=g){I=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var K=mxResources.get("ok"),da=null;g=null!=g?g:mxResources.get("error");if(null!=N){null!=N.retry&&(K=mxResources.get("cancel"),da=function(){L();N.retry()});if(404==N.code||404==N.status||403==N.code){I=403==N.code?null!=N.message?mxUtils.htmlEntities(N.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=B?B:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?-" ("+this.drive.user.email+")":""),!1);var ja=null!=B?null:null!=D?D:window.location.hash;if(null!=ja&&("#G"==ja.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==ja.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==N.code||404==N.status)){ja="#U"==ja.substring(0,2)?ja.substring(45,ja.lastIndexOf("%26ex")):ja.substring(2);-this.showError(g,I,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ja);null!=t&&t()}),da,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ea(){ka.innerText="";for(var V=0;V<ca.length;V++){var k=document.createElement("option");mxUtils.write(k,ca[V].displayName);k.value=V;ka.appendChild(k);k=document.createElement("option");k.innerHTML=" ";mxUtils.write(k,"<"+ca[V].email+">");k.setAttribute("disabled",-"disabled");ka.appendChild(k)}k=document.createElement("option");mxUtils.write(k,mxResources.get("addAccount"));k.value=ca.length;ka.appendChild(k)}var ca=this.drive.getUsersList(),fa=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");fa.appendChild(la);var ka=document.createElement("select");ka.style.width="100%";ea();mxEvent.addListener(ka,"change",mxUtils.bind(this,function(){var V=ka.value,k=ca.length!=-V;k&&this.drive.setUser(ca[V]);this.drive.authorize(k,mxUtils.bind(this,function(){k||(ca=this.drive.getUsersList(),ea())}),mxUtils.bind(this,function(x){this.handleError(x)}),!0)}));fa.appendChild(ka);fa=new CustomDialog(this,fa,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(fa.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=N.message?I=""==N.message&&null!=-N.name?mxUtils.htmlEntities(N.name,!1):mxUtils.htmlEntities(N.message,!1):null!=N.response&&null!=N.response.error?I=mxUtils.htmlEntities(N.response.error,!1):"undefined"!==typeof window.App&&(N.code==App.ERROR_TIMEOUT?I=mxUtils.htmlEntities(mxResources.get("timeout"),!1):N.code==App.ERROR_BUSY?I=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof N&&0<N.length&&(I=mxUtils.htmlEntities(N,!1)))}B=c=null;null!=N&&null!=N.helpLink?(c=mxResources.get("help"),B=mxUtils.bind(this,function(){return this.editor.graph.openLink(N.helpLink)})):-null!=N&&null!=N.ownerEmail?(c=mxResources.get("contactOwner"),I+=mxUtils.htmlEntities(" ("+c+": "+N.ownerEmail+")",!1),B=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(N.ownerEmail))})):null!=N&&null!=N.alternateAction&&(c=N.alternateAction.label,B=N.alternateAction.funct);this.showError(g,I,K,l,da,null,null,c,B,null,null,null,t?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,g,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),g);this.showDialog(c.container,-l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,g,l,t,B,D){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!=g&&g()},function(){I();null!=l&&l()},t,B,null,null,null,null,L);this.showDialog(c.container,340,46+L,!0,D);c.init()};EditorUi.prototype.showBanner=function(c,g,l,t,B,D,I,L,N){D=!1;if(!(this.bannerShowing||this["hideBanner"+-c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){I=null!=I?I:"translate(-50%,120%)";L=null!=L?L:"translate(-50%,0%)";var K=document.createElement("div");K.className="geBtn gePrimaryBtn geBanner"+(B?" geSmallBanner":"");K.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(K.style,"transform",I);mxUtils.setPrefixedStyle(K.style,"transition","all 1000ms ease");null!=N&&mxUtils.setPrefixedStyle(K.style,"transform-origin",N);N=N=document.createElement("img");-N.setAttribute("src",Editor.crossImage);N.setAttribute("title",mxResources.get(t?"doNotShowAgain":"close"));N.setAttribute("border","0");B||(D=document.createElement("img"),D.setAttribute("src",IMAGE_PATH+"/logo.png"),D.setAttribute("border","0"),D.setAttribute("align","absmiddle"),D.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",K.appendChild(D),N.style.cssText=(B?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",-K.appendChild(N));mxUtils.write(K,g);document.body.appendChild(K);this.bannerShowing=!0;B&&(N.className="geLibraryButton",K.appendChild(N));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 da=document.createElement("input");da.setAttribute("type","checkbox");da.setAttribute("id","geDoNotShowAgainCheckbox");da.style.marginRight="6px";if(!t){g.appendChild(da);var ja=document.createElement("label");-ja.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ja,mxResources.get("doNotShowAgain"));g.appendChild(ja);K.style.paddingBottom=B?"16px":"30px";K.appendChild(g)}var ea=mxUtils.bind(this,function(){null!=K.parentNode&&(K.parentNode.removeChild(K),this.bannerShowing=!1,da.checked||t)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=N&&mxEvent.addListener(N,"click",mxUtils.bind(this,function(fa){mxEvent.consume(fa);-ea()}));var ca=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(K.style,"transform",I);window.setTimeout(mxUtils.bind(this,function(){ea()}),1E3)});mxEvent.addListener(K,"click",mxUtils.bind(this,function(fa){var la=mxEvent.getSource(fa);la!=da&&la!=ja?(null!=l&&l(),ea(),mxEvent.consume(fa)):ca()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(K.style,"transform",L)}),500);window.setTimeout(ca,B?5E3:3E4);D=!0}return D};EditorUi.prototype.setCurrentFile=function(c){null!=-c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,g,l,t){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<t&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",t));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,g,l,t,B){var D="jpeg"==l?"jpg":l;t=this.getBaseFilename(t)+-(null!=g?".drawio":"")+"."+D;c=this.createImageDataUri(c,g,l,B);this.saveData(t,D,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("formatAnimatedGif",null,"Animated GIF"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(g);mxUtils.write(c,mxResources.get("speed",-null,"Speed")+":");var l=document.createElement("select");l.style.marginLeft="4px";l.style.width="80px";var t=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(g=0;g<t.length;g++){var B=document.createElement("option");mxUtils.write(B,t[g].label);B.setAttribute("value",t[g].value);15==t[g].value&&B.setAttribute("selected","selected");l.appendChild(B)}c.appendChild(l);mxUtils.br(c);-g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("zoom")+":");var D=document.createElement("input");D.setAttribute("type","text");D.style.width="60px";D.style.marginLeft="4px";D.value="100%";g.appendChild(D);c.appendChild(g);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("borderWidth",null,"Border Width")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.width="60px";I.style.marginLeft=-"4px";I.value="0";g.appendChild(I);c.appendChild(g);t=document.createElement("div");t.style.marginTop="10px";mxUtils.write(t,mxResources.get("loops",null,"Loops")+":");var L=document.createElement("select");L.style.marginLeft="4px";L.style.width="80px";var N=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(g=0;g<N.length;g++)B=document.createElement("option"),mxUtils.write(B,N[g].label),B.setAttribute("value",N[g].value),0==-N[g].value&&B.setAttribute("selected","selected"),L.appendChild(B);t.appendChild(L);c.appendChild(t);var K=this.addCheckbox(c,mxResources.get("transparentBackground",null,"Transparent Background"),!1);c=new CustomDialog(this,c,mxUtils.bind(this,function(){var da=parseInt(D.value);if(isNaN(da)||0>=da)da=100;this.exportAnimatedGif({fps:parseInt(l.value),scale:da/100,border:parseInt(I.value)||0,repeat:parseInt(L.value),transparent:K.checked,background:K.checked?null:null!=this.editor.graph.background&&-this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"#ffffff"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,300,260,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(g){this.spinner.stop();if(null!=g){var l=this.getBaseFilename()+".gif";if("function"===-typeof navigator.msSaveBlob)navigator.msSaveBlob(g,l);else{var t=document.createElement("a");t.href=URL.createObjectURL(g);t.download=l;document.body.appendChild(t);t.click();setTimeout(function(){document.body.removeChild(t);URL.revokeObjectURL(t.href)},0)}}}),mxUtils.bind(this,function(g){this.spinner.stop();this.handleError(g)}))}catch(g){this.spinner.stop(),this.handleError(g)}};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,g){c=new TextareaDialog(this,c,g,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,g,l,t,B,D){"text/xml"!=l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||-/(\.html)$/i.test(g)||(g=g+"."+(null!=D?D:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=t?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,-l,t);else{var I=document.createElement("a");D=(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]+)\./);D=65==(L?parseInt(L[2],10):!1)?!1:D}if(D||this.isOffline()){I.href=URL.createObjectURL(t?this.base64ToBlob(c,l):new Blob([c],{type:l}));D?I.download=g:I.setAttribute("target","_blank");document.body.appendChild(I);try{window.setTimeout(function(){URL.revokeObjectURL(I.href)},-2E4),I.click(),I.parentNode.removeChild(I)}catch(N){}}else this.createEchoRequest(c,g,l,t,B).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,l,t,B,D){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=B?"&format="+B:"")+(null!=D?"&base64="+D:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,g,l,t,B,D,I,L,N){D=null!=D?D:!1;I=null!=I?I:"vsdx"!=B&&(!mxClient.IS_IOS||-!navigator.standalone);var K=mxUtils.bind(this,function(ja,ea,ca,fa){try{if("_blank"==ea)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,t);else if(null!=l&&"text/html"==l.substring(0,9)){var la=new EmbedDialog(this,c);this.showDialog(la.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));la.init()}else{var ka=window.open("about:blank");null==ka?mxUtils.popup(c,!0):(ka.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),ka.document.close())}else if(ea==App.MODE_DEVICE||-"download"==ea)this.doSaveLocalFile(c,ja,l,t,null,L);else if(null!=ja&&0<ja.length){var V=mxUtils.bind(this,function(k){try{this.exportFile(c,ja,l,t,ea,k)}catch(x){this.handleError(x)}});null!=fa?V(fa):this.pickFolder(ea,V)}}catch(k){this.handleError(k)}});B=[];D||B.push(App.MODE_BROWSER);I||B.push("_blank");var da=new SaveDialog(this,g,mxUtils.bind(this,function(ja,ea,ca){K(ja.value,ea,ja,ca);this.hideDialog(null,null,da.container)}),B,c,l,t,N);this.showDialog(da.container,420,110,!0,!1,mxUtils.bind(this,-function(){this.hideDialog()}));da.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var t=window.open("about:blank");if(null==t||null==t.document)mxUtils.popup(c,!0);else{var B="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var D=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=D&&(B="background: "+D+";")}B='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+B+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=-g||l?(D=l?c:btoa(unescape(encodeURIComponent(c))),t.document.write(B+'<img style="max-width:100%;" src="data:'+g+";base64,"+D+'"/></body></html>')):t.document.write(B+c+"</body></html>"):t.document.write(B+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");t.document.close()}};var n=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 g=c(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.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=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=-this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var B=g.getBoundingClientRect();this.tagsDialog.style.left=B.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";B=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=B.zIndex;document.body.appendChild(this.tagsDialog);-this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(t)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var t=this.editor.graph.getAllTags();g.style.display=0<t.length?"":"none"}))}n.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=-null)}));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,+c=Q?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!D&&!B&&(I||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(la),g,null!=l?l.getTitle():null,ia,da);else if(D||!B&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(t=null),l=this.getSvgFileProperties(la),c=this.getEmbeddedSvg(c,g,t,null,K,M,da,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,t){c=null!=+c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var B=this.editor.getGraphXml(c,t);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(M){var V=M.getElementsByTagName("mxGraphModel"),Q=0<V.length?V[0]:null;V=M;null==Q&&l?(Q=mxUtils.getNodeValue(M),0<Q.length&&(Q=Graph.decompress(Q),null!=Q&&0<Q.length&&(V=M.cloneNode(!1),V.appendChild(mxUtils.parseXml(Q).documentElement)))):null==Q||l?V=M.cloneNode(!0):(V=M.cloneNode(!1),mxUtils.setTextContent(V,Graph.compressNode(Q)));B.appendChild(V)},+EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(B),B=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var D=this.pages[g],I=D.node;if(D!=this.currentPage)if(D.needsUpdate){var K=new mxCodec(mxUtils.createXmlDocument());K=K.encode(new mxGraphModel(D.root));this.editor.graph.saveViewState(D.viewState,K,null,t);EditorUi.removeChildNodes(I);I.appendChild(K);delete D.needsUpdate}else t&&(this.updatePageRoot(D),null!=D.viewState.backgroundImage&&+null!=D.viewState.backgroundImage.originalSrc&&(K=new mxCodec(mxUtils.createXmlDocument()),K=K.encode(new mxGraphModel(D.root)),this.editor.graph.saveViewState(D.viewState,K,null,t,D),I=I.cloneNode(!1),I.appendChild(K)));c(I)}return B};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],t=0;t<c.length;t++){var B=c.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(B)?l.push(B):isNaN(parseInt(B))?B.toLowerCase()!=B?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):B.toUpperCase()!=+B?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(B)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][g].data=+mxUtils.getXml(l)}catch(D){c[EditorUi.DIFF_INSERT][g].data=D.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var t in c[EditorUi.DIFF_UPDATE]){var B=c[EditorUi.DIFF_UPDATE][t];null!=B.name&&(B.name=this.anonymizeString(B.name));null!=B.cells&&(g=mxUtils.bind(this,function(D){var I=B.cells[D];if(null!=I){for(var K in I)null!=I[K].value&&(I[K].value="["+I[K].value.length+"]"),null!=I[K].xmlValue&&(I[K].xmlValue="["+I[K].xmlValue.length+"]"),null!=I[K].style&&(I[K].style="["+I[K].style.length+"]"),mxUtils.isEmptyObject(I[K])&&+delete I[K];mxUtils.isEmptyObject(I)&&delete B.cells[D]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(B.cells)&&delete B.cells);mxUtils.isEmptyObject(B)&&delete c[EditorUi.DIFF_UPDATE][t]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,+g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(c,g){g=c.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&g[l].setAttribute("value","["+g[l].getAttribute("value").length+"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length++"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&+(g.clearAutosave(),this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){B=null!=B?B:!0;D=null!=D?D:!1;V=null!=V?V:!Editor.defaultCompressed;+var da=this.editor.graph;if((g||!c&&null!=M&&/(\.svg)$/i.test(M.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ia=da.getGlobalVariable;da=this.createTemporaryGraph(da.getStylesheet());da.setBackgroundImage=this.editor.graph.setBackgroundImage;da.background=this.editor.graph.background;var la=null!=this.pages?this.pages[0]:null;null==la||this.currentPage==la?da.setBackgroundImage(this.editor.graph.backgroundImage):null!=la.viewState&&null!=la.viewState&&da.setBackgroundImage(la.viewState.backgroundImage);+da.getGlobalVariable=function(ka){return"page"==ka&&null!=la?la.getName():"pagenumber"==ka?1:ia.apply(this,arguments)};document.body.appendChild(da.container);null!=la&&da.model.setRoot(la.root)}I=null!=I?I:this.getXmlFileData(B,D,V,Q);M=null!=M?M:this.getCurrentFile();c=this.createFileData(I,da,M,window.location.href,c,g,l,t,B,K,V,ja,ea);da!=this.editor.graph&&da.container.parentNode.removeChild(da.container);return c};EditorUi.prototype.getHtml=function(c,g,l,t,B,D){D=null!=D?D:!0;var I=null,K=+EditorUi.drawHost+"/js/embed-static.min.js";if(null!=g){I=D?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var M=g.view.scale;D=Math.floor(I.x/M-g.view.translate.x);M=Math.floor(I.y/M-g.view.translate.y);I=g.background;null==B&&(g=this.getBasenames().join(";"),0<g.length&&(K=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",D);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!=t&&c.setAttribute("edit",t));null!=B&&(B=B.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";t=Graph.compress(c);Graph.decompress(t)!=c&&(t=encodeURIComponent(c));return(null==B?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=B?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==B?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")++(null!=B?'<meta http-equiv="refresh" content="0;URL=\''+B+"'\"/>\n":"")+"</head>\n<body"+(null==B&&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;">'+t+"</div>\n</div>\n"+(null==B?'<script type="text/javascript" src="'+K+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+B+'" target="_blank"><img border="0" src="'++EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,g,l,t,B){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=B&&(B=B.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==B?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':+"")+"<!DOCTYPE html>\n<html"+(null!=B?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==B?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=B?'<meta http-equiv="refresh" content="0;URL=\''+B+"'\"/>\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==B?'<script type="text/javascript" src="'+g+'">\x3c/script>':+'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+B+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.updateFileVars=function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(g){}};EditorUi.prototype.setFileData=function(c,g){c=this.validateFileData(c);+this.pages=this.fileNode=this.currentPage=null;g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var t=+this.getHashObject(),B=null;this.fileNode=g;this.editor.graph.defaultExportLinkTarget=g.getAttribute("linkTarget");this.pages=[];for(var D=0;D<c.length;D++){null==c[D].getAttribute("id")&&c[D].setAttribute("id",D);g=new DiagramPage(c[D]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[D+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)B=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()++": Duplicate page ID");}this.currentPage=null!=B?B: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 I=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(D=0;D<I.length;D++)g[I[D]]=!0;var K=this.editor.graph.getModel(),M=K.getChildren(K.root);for(D=0;D<M.length;D++){var V=M[D];K.setVisible(V,g[V.id]||!1)}}catch(Q){}};EditorUi.prototype.fileStats=function(c,g){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=g.getElementsByTagName("diagram");g=+{};g.modified=c.getLastModifiedDate();g.fileMode=c.getMode();g.fileSize=c.getSize();g.fileHash=c.getHash();g.pages=l.length;g.redundantStencils=0;g.redundantImages=0;g.redundantSize=0;g.stencils=0;g.images=0;for(var t=g.cells=0;t<l.length;t++){var B=l[t].getElementsByTagName("mxCell");g.cells+=B.length;for(var D={},I=0;I<B.length;I++){var K=B[I].getAttribute("style");if(null!=K)for(var M=K.split(";"),V=0;V<M.length;V++){var Q=M[V];if(Q.startsWith("image=data:")||Q.startsWith("shape=stencil("))null==+D[Q]?D[Q]=1:D[Q]++}}for(var ja in D){var ea=D[ja];ja.startsWith("shape=stencil(")?g.stencils+=ea:g.images+=ea;1<ea&&(g.redundantSize+=ja.length*(ea-1),ja.startsWith("shape=stencil(")?g.redundantStencils+=ea-1:g.redundantImages+=ea-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(g)})}}catch(da){}};EditorUi.prototype.getBaseFilename=function(c){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(".")));!c&&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(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la,ka){try{t=null!=+t?t:this.editor.graph.isSelectionEmpty();var W=this.getBaseFilename(!B),k=W+("xml"==c||"pdf"==c&&Q?".drawio":"")+"."+c;if("xml"==c){var y=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,B,null,null,null,g);this.saveData(k,c,y,"text/xml")}else if("html"==c)y=this.getHtml2(this.getFileData(!0),this.editor.graph,W),this.saveData(k,c,y,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?k=W+".png":"jpeg"==c&&(k=W+".jpg"),+"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var J=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(k,c,t,"1",I,B,K,M,V,Q,ja,void 0,void 0,!D,ea,da,ia,la,ka).send(mxUtils.bind(this,function(U){this.spinner.stop();if(200<=U.getStatus()&&299>=U.getStatus()){var ba=this.createLoadMessage("export");ba.format=c;ba.filename=k;ba.data="data:application/pdf;base64,"+U.getText();ba.xml=+this.getFileData(!0);J.postMessage(JSON.stringify(ba),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(k,c,mxUtils.bind(this,function(U,ba){try{return this.createDownloadRequest(U,c,t,ba,I,B,K,M,V,Q,ja,void 0,void 0,!D,ea,da,ia,la,ka)}catch(fa){this.handleError(fa)}}));else{var R=null,X=mxUtils.bind(this,function(U){U.length<=MAX_REQUEST_SIZE?+this.saveData(k,"svg",U,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(R)}))});if("svg"==c){var aa=this.editor.graph.background;if(I||aa==mxConstants.NONE)aa=null;var Z=this.editor.graph.getSvg(aa,null,null,null,null,t);l&&this.editor.graph.addSvgShadow(Z);this.editor.convertImages(Z,mxUtils.bind(this,mxUtils.bind(this,function(U){this.spinner.stop();X(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"++mxUtils.getXml(U))})))}else k=W+".svg",R=this.getFileData(!1,!0,null,mxUtils.bind(this,function(U){this.spinner.stop();X(U)}),t)}}catch(U){this.handleError(U)}};EditorUi.prototype.createDownloadRequest=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la,ka,W,k){c=this.downloadRequestBuilder(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la,ka,W,k);g="";for(var y in c)l=c[y],null!=l&&(g+=y+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,l,t,+B,D,I,K,M,V,Q,ja,ea,da,ia,la,ka,W,k){var y=this.editor.graph,J=y.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==D?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var R=null,X=null,aa=null;if(!EditorUi.isElectronApp&&(J.width*J.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};V=V?"1":"0";"pdf"==g&&(null!=Q?(R=Q.from,X=Q.to):0==D&&(aa="1"));"xmlpng"==g&&(V="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(D=+0;D<this.pages.length;D++)if(this.pages[D]==this.currentPage){R=D;break}D=y.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!B?B||null!=D&&D!=mxConstants.NONE||(D="#ffffff"):D=mxConstants.NONE;B={globalVars:y.getExportVariables()};null!=Q&&null!=Q.from&&(B.globalVars.pagenumber=Q.from+1);M&&(B.grid={size:y.gridSize,steps:y.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:y.view.gridColor});Graph.translateDiagram&&(B.diagramLanguage=Graph.diagramLanguage);return{format:g,+from:R,to:X,allPages:aa,bg:null!=D?D:mxConstants.NONE,base64:t,embedXml:V,xml:l,filename:null!=c?c:"",extras:JSON.stringify(B),scale:I,border:K,pageMargin:ia,w:ja&&isFinite(ja)?ja:null,h:ea&&isFinite(ea)?ea:null,crop:null!=da&&da?"1":"0",fit:null!=la&&la?"1":"0",shadows:null!=k&&k?"1":"0",sheetsAcross:ka,sheetsDown:W}};EditorUi.prototype.setMode=function(c,g){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 g=+c.indexOf("#");0<=g&&(c=c.substring(0,g))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,g={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{g=JSON.parse(c)}catch(t){}}}return g};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 g=window.location.hash;if(null==g||""==g)g="#";var l=g.lastIndexOf("#");0<l&&(g=g.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(g=g+"#"+encodeURIComponent(JSON.stringify(c)))}catch(t){}0<l&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=function(c,g,l){var t=window.location.hash,B=mxUtils.bind(this,function(I){var K=null!=c.data?c.data:"";null!=I&&0<I.length&&+(0<K.length&&(K+="\n"),K+=I);I=new LocalFile(this,"csv"!=c.format&&0<K.length?K:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);I.getHash=function(){return t};this.fileLoaded(I);"csv"==c.format&&this.importCsv(K,mxUtils.bind(this,function(ea){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var M=null!=c.interval?parseInt(c.interval):6E4,V=null,Q=mxUtils.bind(this,function(){var ea=this.currentPage;+mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(da){ea===this.currentPage&&(200<=da.getStatus()&&300>=da.getStatus()?(this.updateDiagram(da.getText()),ja()):this.handleError({message:mxResources.get("error")+" "+da.getStatus()}))}),mxUtils.bind(this,function(da){this.handleError(da)}))}),ja=mxUtils.bind(this,function(){window.clearTimeout(V);V=window.setTimeout(Q,M)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ja();+Q()}));ja();Q()}null!=g&&g()});if(null!=c.url&&0<c.url.length){var D=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(D,mxUtils.bind(this,function(I){B(I)}),mxUtils.bind(this,function(I){null!=l&&l(I)}))}else B("")};EditorUi.prototype.updateDiagram=function(c){function g(y){var J=new mxCellOverlay(y.image||B.warningImage,y.tooltip,y.align,y.valign,y.offset);J.addListener(mxEvent.CLICK,function(R,X){t.alert(y.tooltip)});return J}var l=null,t=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),+c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var B=this.editor.graph,D=B.getModel();D.beginUpdate();var I=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var K=D.getCell(c.getAttribute("id"));if(null!=K){try{var M=c.getAttribute("value");if(null!=M){var V=mxUtils.parseXml(M).documentElement;if(null!=V)if("1"==V.getAttribute("replace-value"))D.setValue(K,V);else for(var Q=V.attributes,ja=0;ja<Q.length;ja++)B.setAttributeForCell(K,Q[ja].nodeName,0<Q[ja].nodeValue.length?+Q[ja].nodeValue:null)}}catch(y){null!=window.console&&console.log("Error in value for "+K.id+": "+y)}try{var ea=c.getAttribute("style");null!=ea&&B.model.setStyle(K,ea)}catch(y){null!=window.console&&console.log("Error in style for "+K.id+": "+y)}try{var da=c.getAttribute("icon");if(null!=da){var ia=0<da.length?JSON.parse(da):null;null!=ia&&ia.append||B.removeCellOverlays(K);null!=ia&&B.addCellOverlay(K,g(ia))}}catch(y){null!=window.console&&console.log("Error in icon for "+K.id+": "+y)}try{var la=+c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var ka=B.getCellGeometry(K);if(null!=ka){ka=ka.clone();for(key in la){var W=parseFloat(la[key]);"dx"==key?ka.x+=W:"dy"==key?ka.y+=W:"dw"==key?ka.width+=W:"dh"==key?ka.height+=W:ka[key]=parseFloat(la[key])}B.model.setGeometry(K,ka)}}}catch(y){null!=window.console&&console.log("Error in icon for "+K.id+": "+y)}}}else if("model"==c.nodeName){for(var k=c.firstChild;null!=k&&k.nodeType!=mxConstants.NODETYPE_ELEMENT;)k=k.nextSibling;null!=k&&(new mxCodec(c.firstChild)).decode(k,+D)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(B.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))B.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{D.endUpdate()}null!=I&&this.chromelessResize&&this.chromelessResize(!0,I)}return l};EditorUi.prototype.getCopyFilename=function(c,+g){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var t=l.lastIndexOf(".");0<=t&&(c=l.substring(t),l=l.substring(0,t));if(g){g=l;var B=new Date;l=B.getFullYear();t=B.getMonth()+1;var D=B.getDate(),I=B.getHours(),K=B.getMinutes();B=B.getSeconds();l=g+(" "+(l+"-"+t+"-"+D+"-"+I+"-"+K+"-"+B))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=function(c,g){try{null!=c&&g&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,+g,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[g]);var t=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var B=!1;this.hideDialog();null!=t&&(t.removeListener(this.descriptorChangedListener),this.logIfModified(t,!0),t.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var D=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=t&&this.updateDocumentTitle();this.editor.graph.model.clear();+this.editor.undoManager.clear();this.setBackgroundImage(null);!g&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();g||("0"!=urlParams.splash?this.showSplash():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=c)try{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.clearStatus():this.updateStatus(mxUtils.bind(this,function(){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||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));B=!0;if(!this.isOffline()&&null!=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.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+I})}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!=t?this.fileLoaded(t)||D():D()});g?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 D();return B};EditorUi.prototype.getHashValueForPages=function(c,g){var l=0,t=new mxGraphModel,B=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var D=0;D<c.length;D++){this.updatePageRoot(c[D]);var I=c[D].node.cloneNode(!1);I.removeAttribute("name");t.root=c[D].root;var K=B.encode(t);this.editor.graph.saveViewState(c[D].viewState,K,!0);K.removeAttribute("pageWidth");+K.removeAttribute("pageHeight");I.appendChild(K);null!=g&&(g.eltCount+=I.getElementsByTagName("*").length,g.nodeCount+=I.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(I,function(M,V,Q,ja){return!ja||"mxGeometry"!=M.nodeName&&"mxPoint"!=M.nodeName||"x"!=V&&"y"!=V&&"width"!=V&&"height"!=V?ja&&"mxCell"==M.nodeName&&"previous"==V?null:Q:Math.round(Q)},g)<<0}return l};EditorUi.prototype.hashValue=function(c,g,l){var t=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&+"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(t^=this.hashValue(c.nodeName,g,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var B=0;B<c.attributes.length;B++){var D=c.attributes[B].name,I=null!=g?g(c,D,c.attributes[B].value,!0):c.attributes[B].value;null!=I&&(t^=this.hashValue(D,g,l)+this.hashValue(I,g,l))}}if(null!=c.childNodes)for(B=0;B<c.childNodes.length;B++)t=(t<<5)-t+this.hashValue(c.childNodes[B],g,l)<<0}else if(null!=c&&"function"!==+typeof c){c=String(c);g=0;null!=l&&(l.byteCount+=c.length);for(B=0;B<c.length;B++)g=(g<<5)-g+c.charCodeAt(B)<<0;t^=g}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,g,l,t,B,D,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){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var g=0;g<c.length;g++)null!=c[g].xml&&"<"!=c[g].xml.charAt(0)&&(c[g].xml=mxUtils.trim(Graph.decompress(c[g].xml)));g=mxUtils.createXmlDocument();var l=g.createElement("mxlibrary");mxUtils.setTextContent(l,+JSON.stringify(c,null,2));g.appendChild(l);return mxUtils.getXml(g,"\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 g=this.sidebar.palettes[c];if(null!=g){for(var l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=+function(c,g){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!g){null==c&&(g=this.sidebar.palettes["L.scratchpad"],null==g&&(g=this.sidebar.palettes.search),null!=g&&(c=g[g.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;g=l.lastChild;var t=g.previousSibling;l.insertBefore(g,c);l.insertBefore(t,g)}};EditorUi.prototype.loadLibrary=function(c,g){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var t=JSON.parse(mxUtils.getTextContent(l.documentElement));+this.libraryLoaded(c,t,l.documentElement.getAttribute("title"),g,l.documentElement.getAttribute("tags"))}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.showSearchWindow=function(c,g){var l=c?"findReplace":"find",t=l+"Window";if(null==this[t]){var B="min"==Editor.currentTheme||+"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,D=c?B?330:300:240;this[t]=new FindWindow(this,document.body.offsetWidth-(D+20),100,D,c?B?304:288:180,c);this[t].window.addListener("show",function(){this.fireEvent(new mxEventObject(l))});this[t].window.addListener("hide",function(){this.fireEvent(new mxEventObject(l))});this[t].window.setVisible(!0)}else null==g&&this[t].window.setVisible(!this[t].window.isVisible());null!=g&&(this[t].doSearch(g),this[t].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=+function(c,g,l,t,B){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var D=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var I=0;I<this.openLibraries.length;I++)if(this.openLibraries[I].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[I],this.openLibraries);break}D={file:c,images:g,title:l,expand:t};this.openLibraries.push(D)}else this.scratchpad=c;I=this.sidebar.palettes[c.getHash()];+I=null!=I?I[I.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var K=null,M=mxUtils.bind(this,function(k,y){0==k.length&&c.isEditable()?(null==K&&(K=document.createElement("div"),K.className="geDropTarget",mxUtils.write(K,mxResources.get("dragElementsHere"))),y.appendChild(K)):this.addLibraryEntries(k,y)});null!=this.sidebar&&null!=g&&this.sidebar.addEntries(g,B);null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var V=this.sidebar.addPalette(c.getHash(),+l,null!=t?t:!0,mxUtils.bind(this,function(k){M(g,k)}));null!=D&&(D.div=V);this.repositionLibrary(I,"L.scratchpad"!=c.getHash());t=V.parentNode.previousSibling;l=t.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&t.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var Q=document.createElement("div");Q.style.backgroundColor="inherit";t.style.position="relative";var ja=document.createElement("img");ja.className="geLibraryButton";ja.setAttribute("src",Editor.crossImage);ja.setAttribute("title",+mxResources.get("close"));var ea=null;if(".scratchpad"!=c.title||this.closableScratchpad)Q.appendChild(ja),mxEvent.addListener(ja,"click",mxUtils.bind(this,function(k){if(!mxEvent.isConsumed(k)){var y=mxUtils.bind(this,function(){null!=D&&mxUtils.remove(D,this.openLibraries);this.closeLibrary(c)});null!=ea?this.confirm(mxResources.get("allChangesLost"),null,y,mxResources.get("cancel"),mxResources.get("discardChanges")):y();mxEvent.consume(k)}}));if(c.isEditable()){var da=this.editor.graph,ia=null;+l=mxUtils.bind(this,function(k){this.showLibraryDialog(c.getTitle(),V,g,c,c.getMode());mxEvent.consume(k)});var la=mxUtils.bind(this,function(k){c.setModified(!0);c.isAutosave()?(null!=ia&&null!=ia.parentNode&&ia.parentNode.removeChild(ia),ia=ja.cloneNode(!1),ia.setAttribute("src",Editor.spinImage),ia.setAttribute("title",mxResources.get("saving")),ia.style.cursor="default",ia.style.marginRight="2px",ia.style.marginTop="-2px",Q.insertBefore(ia,Q.firstChild),this.saveLibrary(c.getTitle(),g,c,c.getMode(),+!0,!0,function(){null!=ia&&null!=ia.parentNode&&ia.parentNode.removeChild(ia)})):null==ea&&(ea=ja.cloneNode(!1),ea.setAttribute("src",Editor.saveImage),ea.setAttribute("title",mxResources.get("save")),Q.insertBefore(ea,Q.firstChild),mxEvent.addListener(ea,"click",mxUtils.bind(this,function(y){this.saveLibrary(c.getTitle(),g,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==ea||c.isModified()||(ea.parentNode.removeChild(ea),ea=null)});mxEvent.consume(y)})))}),ka=mxUtils.bind(this,function(k,+y,J,R){k=da.cloneCells(mxUtils.sortCells(da.model.getTopmostCells(k)));for(var X=0;X<k.length;X++){var aa=da.getCellGeometry(k[X]);null!=aa&&aa.translate(-y.x,-y.y)}V.appendChild(this.sidebar.createVertexTemplateFromCells(k,y.width,y.height,R||"",!0,null,!1));k=mxUtils.getXml(this.editor.graph.encodeCells(k));Editor.defaultCompressed&&(k=Graph.compress(k));y={xml:k,w:y.width,h:y.height};null!=R&&(y.title=R);g.push(y);la(J);null!=K&&null!=K.parentNode&&0<g.length&&(K.parentNode.removeChild(K),K=null)}),+W=mxUtils.bind(this,function(k){if(da.isSelectionEmpty())da.getRubberband().isActive()?(da.getRubberband().execute(k),da.getRubberband().reset()):null!=k&&mxEvent.getSource(k).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var y=da.getSelectionCells(),J=da.view.getBounds(y);if(null!=J&&0<J.width&&0<J.height){var R=da.view.scale;J.x/=R;J.y/=R;J.width/=R;J.height/=R;J.x-=da.view.translate.x;J.y-=da.view.translate.y;+ka(y,J)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(k)});mxEvent.addGestureListeners(V,function(){},mxUtils.bind(this,function(k){da.isMouseDown&&null!=da.panningManager&&null!=da.graphHandler.first&&(da.graphHandler.suspend(),null!=da.graphHandler.hint&&(da.graphHandler.hint.style.visibility="hidden"),V.style.backgroundColor="light-dark(#fefefe, #000000)",V.style.cursor="copy",da.panningManager.stop(),da.autoScroll=!1,mxEvent.consume(k))}),+mxUtils.bind(this,function(k){da.isMouseDown&&null!=da.panningManager&&null!=da.graphHandler&&(V.style.backgroundColor="",V.style.cursor="default",this.sidebar.showTooltips=!0,da.panningManager.stop(),da.graphHandler.reset(),da.isMouseDown=!1,da.autoScroll=!0,W(k),mxEvent.consume(k))}));mxEvent.addListener(V,"mouseleave",mxUtils.bind(this,function(k){da.isMouseDown&&null!=da.graphHandler.first&&(da.graphHandler.resume(),null!=da.graphHandler.hint&&(da.graphHandler.hint.style.visibility="visible"),+V.style.backgroundColor="",V.style.cursor="",da.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(k){V.style.backgroundColor="light-dark(#fefefe, #000000)";k.dataTransfer.dropEffect="copy";V.style.cursor="copy";this.sidebar.hideTooltip();k.stopPropagation();k.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,function(k){V.style.cursor="";V.style.backgroundColor="";0<k.dataTransfer.files.length&&this.importFiles(k.dataTransfer.files,+0,0,this.maxImageSize,mxUtils.bind(this,function(y,J,R,X,aa,Z,U,ba,fa){if(null!=y&&"image/"==J.substring(0,6))y="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(y),y=[new mxCell("",new mxGeometry(0,0,aa,Z),y)],y[0].vertex=!0,ka(y,new mxRectangle(0,0,aa,Z),k,mxEvent.isAltDown(k)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g," ")),null!=K&&null!=K.parentNode&&0<g.length&&(K.parentNode.removeChild(K),K=null);else{var na=!1,pa=mxUtils.bind(this,+function(ta,ua){null!=ta&&"application/pdf"==ua&&(ua=Editor.extractGraphModelFromPdf(ta),null!=ua&&0<ua.length&&(ta=ua));if(null!=ta)if(ta=mxUtils.parseXml(ta),"mxlibrary"==ta.documentElement.nodeName)try{var Ca=JSON.parse(mxUtils.getTextContent(ta.documentElement));M(Ca,V);g=g.concat(Ca);la(k);this.spinner.stop();na=!0}catch(Sa){}else if("mxfile"==ta.documentElement.nodeName)try{var Ba=ta.documentElement.getElementsByTagName("diagram");for(Ca=0;Ca<Ba.length;Ca++){var Aa=this.stringToCells(Editor.getDiagramNodeXml(Ba[Ca])),+Fa=this.editor.graph.getBoundingBoxFromGeometry(Aa);null!=Fa&&ka(Aa,new mxRectangle(0,0,Fa.width,Fa.height),k)}na=!0}catch(Sa){null!=window.console&&console.log("error in drop handler:",Sa)}na||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=K&&null!=K.parentNode&&0<g.length&&(K.parentNode.removeChild(K),K=null)});null!=fa&&null!=U&&EditorUi.isVisioFilename(U)?this.importVisio(fa,function(ta){pa(ta,"text/xml")},null,U):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(y,+U)&&null!=fa?this.isExternalDataComms()?this.parseFile(fa,mxUtils.bind(this,function(ta){4==ta.readyState&&(this.spinner.stop(),200<=ta.status&&299>=ta.status?pa(ta.responseText,"text/xml"):this.handleError({message:mxResources.get(413==ta.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):pa(y,J)}}));k.stopPropagation();k.preventDefault()})),mxEvent.addListener(V,+"dragleave",function(k){V.style.cursor="";V.style.backgroundColor="";k.stopPropagation();k.preventDefault()}));ja=ja.cloneNode(!1);ja.setAttribute("src",Editor.editImage);ja.setAttribute("title",mxResources.get("edit"));Q.insertBefore(ja,Q.firstChild);mxEvent.addListener(ja,"click",l);l=ja.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));Q.insertBefore(l,Q.firstChild);mxEvent.addListener(l,"click",W);".scratchpad"==c.title&&(this.addSelectionToScratchpad=+W);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",Q.insertBefore(l,Q.firstChild))}t.appendChild(Q);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,g){for(var l=0;l<c.length;l++)try{var t=c[l],B=t.data;if(null!=B){B="data:"==B.substring(0,5)?this.convertDataUri(B):B;var D="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";+"fixed"==t.aspect&&(D+="aspect=fixed;");D=D+"image="+B+";";null!=t.style&&(D+=t.style);g.appendChild(this.sidebar.createVertexTemplate(D,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var I=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),K=0==I.length?mxResources.get("drawingEmpty"):null!=t.title?t.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(I,t.w,t.h,K,!0,null,!0))}}catch(M){K=null!=M.message?mxResources.get("error")+": "+M.message:String(M),+D=this.sidebar.createVertexTemplateFromCells(null,t.w,t.h,K,!0,null,!0),g.appendChild(D)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=+function(c,g,l,t,B,D,I){c=new ImageDialog(this,c,g,l,t,B,D,I);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,g,l,t,B,D){var I=localStorage.getItem(g);c=new TextareaDialog(this,c,null!=I?JSON.stringify(JSON.parse(I),null,2):"",mxUtils.bind(this,function(K){if(null!=K)try{if(null!=D&&D(K),K==I)this.hideDialog();else{if(0<K.length){var M=JSON.parse(K);localStorage.setItem(g,JSON.stringify(M))}else localStorage.removeItem(g);+this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(V){this.handleError(V)}}),null,mxResources.get("close"),null,null,null,!0,null,null,B,l,t);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,g,l,t){c=null!=c?c:mxUtils.bind(this,function(B,D,I,K){D||(B=new ChangePageSetup(this,t?I:null,B),B.ignoreColor=!t,null!=K&&t&&(B.shadowVisible=K),this.editor.graph.model.execute(B))});+c=new BackgroundImageDialog(this,c,g,l,t);this.showDialog(c.container,400,t?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,g,l,t,B){c=new LibraryDialog(this,c,g,l,t,B);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(D){D&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var m=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var g=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",+mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&g.refresh()}));return g};EditorUi.prototype.handleError=function(c,g,l,t,B,D,I){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{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(ea){}if(null!=M||null!=g){I=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var V=mxResources.get("ok"),Q=null;g=null!=g?g:mxResources.get("error");if(null!=M){null!=M.retry&&(V=mxResources.get("cancel"),Q=function(){K();M.retry()});if(404==M.code||404==M.status||403==M.code){I=403==M.code?null!=M.message?mxUtils.htmlEntities(M.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=B?B:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")++(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var ja=null!=B?null:null!=D?D:window.location.hash;if(null!=ja&&("#G"==ja.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==ja.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)){ja="#U"==ja.substring(0,2)?ja.substring(45,+ja.lastIndexOf("%26ex")):ja.substring(2);this.showError(g,I,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ja);null!=t&&t()}),Q,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ea(){ka.innerText="";for(var W=0;W<da.length;W++){var k=document.createElement("option");mxUtils.write(k,da[W].displayName);k.value=W;ka.appendChild(k);k=document.createElement("option");k.innerHTML=" ";+mxUtils.write(k,"<"+da[W].email+">");k.setAttribute("disabled","disabled");ka.appendChild(k)}k=document.createElement("option");mxUtils.write(k,mxResources.get("addAccount"));k.value=da.length;ka.appendChild(k)}var da=this.drive.getUsersList(),ia=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");ia.appendChild(la);var ka=document.createElement("select");ka.style.width="100%";ea();mxEvent.addListener(ka,"change",+mxUtils.bind(this,function(){var W=ka.value,k=da.length!=W;k&&this.drive.setUser(da[W]);this.drive.authorize(k,mxUtils.bind(this,function(){k||(da=this.drive.getUsersList(),ea())}),mxUtils.bind(this,function(y){this.handleError(y)}),!0)}));ia.appendChild(ka);ia=new CustomDialog(this,ia,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ia.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),+520,150);return}}null!=M.message?I=""==M.message&&null!=M.name?mxUtils.htmlEntities(M.name,!1):mxUtils.htmlEntities(M.message,!1):null!=M.response&&null!=M.response.error?I=mxUtils.htmlEntities(M.response.error,!1):"undefined"!==typeof window.App&&(M.code==App.ERROR_TIMEOUT?I=mxUtils.htmlEntities(mxResources.get("timeout"),!1):M.code==App.ERROR_BUSY?I=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof M&&0<M.length&&(I=mxUtils.htmlEntities(M,!1)))}B=c=null;null!=M&&null!=M.helpLink?+(c=mxResources.get("help"),B=mxUtils.bind(this,function(){return this.editor.graph.openLink(M.helpLink)})):null!=M&&null!=M.ownerEmail?(c=mxResources.get("contactOwner"),I+=mxUtils.htmlEntities(" ("+c+": "+M.ownerEmail+")",!1),B=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(M.ownerEmail))})):null!=M&&null!=M.alternateAction&&(c=M.alternateAction.label,B=M.alternateAction.funct);this.showError(g,I,V,l,Q,null,null,c,B,null,null,null,t?l:null)}else null!=l&&l()};EditorUi.prototype.alert=+function(c,g,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),g);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,g,l,t,B,D){c=null!=c?c:"";var I=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(){I();null!=g&&g()},function(){I();null!=l&&l()},t,B,null,null,null,null,K);this.showDialog(c.container,340,46+K,!0,D);c.init()};EditorUi.prototype.showBanner=+function(c,g,l,t,B,D,I,K,M){D=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){I=null!=I?I:"translate(-50%,120%)";K=null!=K?K:"translate(-50%,0%)";var V=document.createElement("div");V.className="geBtn gePrimaryBtn geBanner"+(B?" geSmallBanner":"");V.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(V.style,"transform",I);mxUtils.setPrefixedStyle(V.style,"transition","all 1000ms ease");null!=M&&mxUtils.setPrefixedStyle(V.style,+"transform-origin",M);M=M=document.createElement("img");M.setAttribute("src",Editor.crossImage);M.setAttribute("title",mxResources.get(t?"doNotShowAgain":"close"));M.setAttribute("border","0");B||(D=document.createElement("img"),D.setAttribute("src",IMAGE_PATH+"/logo.png"),D.setAttribute("border","0"),D.setAttribute("align","absmiddle"),D.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",V.appendChild(D),M.style.cssText=(B?"right:6px;top:9px;":"right:10px;top:12px;")++"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",V.appendChild(M));mxUtils.write(V,g);document.body.appendChild(V);this.bannerShowing=!0;B&&(M.className="geLibraryButton",V.appendChild(M));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 Q=document.createElement("input");Q.setAttribute("type","checkbox");Q.setAttribute("id","geDoNotShowAgainCheckbox");+Q.style.marginRight="6px";if(!t){g.appendChild(Q);var ja=document.createElement("label");ja.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ja,mxResources.get("doNotShowAgain"));g.appendChild(ja);V.style.paddingBottom=B?"16px":"30px";V.appendChild(g)}var ea=mxUtils.bind(this,function(){null!=V.parentNode&&(V.parentNode.removeChild(V),this.bannerShowing=!1,Q.checked||t)&&(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(ia){mxEvent.consume(ia);ea()}));var da=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",I);window.setTimeout(mxUtils.bind(this,function(){ea()}),1E3)});mxEvent.addListener(V,"click",mxUtils.bind(this,function(ia){var la=mxEvent.getSource(ia);la!=Q&&la!=ja?(null!=l&&l(),ea(),mxEvent.consume(ia)):da()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",K)}),500);window.setTimeout(da,+B?5E3:3E4);D=!0}return D};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,g,l,t){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<t&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",t));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=+function(c,g,l,t,B){var D="jpeg"==l?"jpg":l;t=this.getBaseFilename(t)+(null!=g?".drawio":"")+"."+D;c=this.createImageDataUri(c,g,l,B);this.saveData(t,D,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("formatAnimatedGif",null,"Animated GIF"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";+c.appendChild(g);mxUtils.write(c,mxResources.get("speed",null,"Speed")+":");var l=document.createElement("select");l.style.marginLeft="4px";l.style.width="80px";var t=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(g=0;g<t.length;g++){var B=document.createElement("option");mxUtils.write(B,t[g].label);B.setAttribute("value",t[g].value);15==t[g].value&&B.setAttribute("selected","selected");+l.appendChild(B)}c.appendChild(l);mxUtils.br(c);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("zoom")+":");var D=document.createElement("input");D.setAttribute("type","text");D.style.width="60px";D.style.marginLeft="4px";D.value="100%";g.appendChild(D);c.appendChild(g);g=document.createElement("div");g.style.marginTop="10px";mxUtils.write(g,mxResources.get("borderWidth",null,"Border Width")+":");var I=document.createElement("input");I.setAttribute("type",+"text");I.style.width="60px";I.style.marginLeft="4px";I.value="0";g.appendChild(I);c.appendChild(g);t=document.createElement("div");t.style.marginTop="10px";mxUtils.write(t,mxResources.get("loops",null,"Loops")+":");var K=document.createElement("select");K.style.marginLeft="4px";K.style.width="80px";var M=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(g=0;g<M.length;g++)B=document.createElement("option"),mxUtils.write(B,+M[g].label),B.setAttribute("value",M[g].value),0==M[g].value&&B.setAttribute("selected","selected"),K.appendChild(B);t.appendChild(K);c.appendChild(t);var V=this.addCheckbox(c,mxResources.get("transparentBackground",null,"Transparent Background"),!1);c=new CustomDialog(this,c,mxUtils.bind(this,function(){var Q=parseInt(D.value);if(isNaN(Q)||0>=Q)Q=100;this.exportAnimatedGif({fps:parseInt(l.value),scale:Q/100,border:parseInt(I.value)||0,repeat:parseInt(K.value),transparent:V.checked,background:V.checked?+null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"#ffffff"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,300,260,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(g){this.spinner.stop();if(null!=g){var l=+this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(g,l);else{var t=document.createElement("a");t.href=URL.createObjectURL(g);t.download=l;document.body.appendChild(t);t.click();setTimeout(function(){document.body.removeChild(t);URL.revokeObjectURL(t.href)},0)}}}),mxUtils.bind(this,function(g){this.spinner.stop();this.handleError(g)}))}catch(g){this.spinner.stop(),this.handleError(g)}};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,g){c=new TextareaDialog(this,c,g,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,g,l,t,B,D){"text/xml"!=+l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=D?D:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=t?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=+l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,l,t);else{var I=document.createElement("a");D=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof I.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var K=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);D=65==(K?parseInt(K[2],10):!1)?!1:D}if(D||this.isOffline()){I.href=URL.createObjectURL(t?this.base64ToBlob(c,l):new Blob([c],{type:l}));D?I.download=g:I.setAttribute("target",+"_blank");document.body.appendChild(I);try{window.setTimeout(function(){URL.revokeObjectURL(I.href)},2E4),I.click(),I.parentNode.removeChild(I)}catch(M){}}else this.createEchoRequest(c,g,l,t,B).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,l,t,B,D){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=B?"&format="+B:"")+(null!=D?"&base64="+D:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=+function(c,g,l,t,B,D,I,K,M){D=null!=D?D:!1;I=null!=I?I:"vsdx"!=B&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(ja,ea,da,ia){try{if("_blank"==ea)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,t);else if(null!=l&&"text/html"==l.substring(0,9)){var la=new EmbedDialog(this,c);this.showDialog(la.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));la.init()}else{var ka=window.open("about:blank");null==ka?mxUtils.popup(c,!0):(ka.document.write("<pre>"++mxUtils.htmlEntities(c,!1)+"</pre>"),ka.document.close())}else if(ea==App.MODE_DEVICE||"download"==ea)this.doSaveLocalFile(c,ja,l,t,null,K);else if(null!=ja&&0<ja.length){var W=mxUtils.bind(this,function(k){try{this.exportFile(c,ja,l,t,ea,k)}catch(y){this.handleError(y)}});null!=ia?W(ia):this.pickFolder(ea,W)}}catch(k){this.handleError(k)}});B=[];D||B.push(App.MODE_BROWSER);I||B.push("_blank");var Q=new SaveDialog(this,g,mxUtils.bind(this,function(ja,ea,da){V(ja.value,ea,ja,da);this.hideDialog(null,+null,Q.container)}),B,c,l,t,M);this.showDialog(Q.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Q.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var t=window.open("about:blank");if(null==t||null==t.document)mxUtils.popup(c,!0);else{var B="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var D=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=D&&(B="background: "+D+";")}B='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '++B+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||l?(D=l?c:btoa(unescape(encodeURIComponent(c))),t.document.write(B+'<img style="max-width:100%;" src="data:'+g+";base64,"+D+'"/></body></html>')):t.document.write(B+c+"</body></html>"):t.document.write(B+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");t.document.close()}};var n=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 g=c(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.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=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),+this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var B=g.getBoundingClientRect();this.tagsDialog.style.left=B.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";B=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=+B.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(t)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var t=this.editor.graph.getAllTags();g.style.display=0<t.length?"":"none"}))}n.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),+this.layersDialog=null)}));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.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()&&"1"!=urlParams.noExport){this.exportDialog=null;var l=c(mxUtils.bind(this,function(t){var B=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",B);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)B.apply(this);else{this.exportDialog=document.createElement("div");var D=l.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=D.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";D=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=D.zIndex;var 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",B);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 N=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",N);this.exportDialog.appendChild(L);mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.openInNewWindow(N.substring(N.indexOf(",")+1),"image/png",!0);B.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(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,t,B,D){this.isLocalFileSave()?this.saveLocalFile(l,c,t,B,g,D):this.saveRequest(c,g,mxUtils.bind(this,function(I,L){return this.createEchoRequest(l,I,t,B,g,L)}),l,B,t)};EditorUi.prototype.saveRequest=-function(c,g,l,t,B,D,I){I=null!=I?I:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,function(K,da,ja,ea){if("_blank"==da||null!=K&&0<K.length){var ca=l("_blank"==da?null:K,da==App.MODE_DEVICE||"download"==da||null==da||"_blank"==da?"0":"1");null!=ca&&(da==App.MODE_DEVICE||"download"==da||"_blank"==da?ca.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(fa){D=null!=D?D:"pdf"==g?"application/pdf":"image/"+g;if(null!=t)try{this.exportFile(t,K,D,!0,da,fa)}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(),K,D,!0,da,fa)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=ea?ja(ea):this.pickFolder(da,ja)))}});B=[App.MODE_BROWSER];I||B.push("_blank");var N=new SaveDialog(this,c,mxUtils.bind(this,function(K,da,ja){L(K.value,-da,K,ja);this.hideDialog(null,null,N.container)}),B,null,"application/pdf");this.showDialog(N.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));N.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,g,l,t,B,D){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};-EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(qa){Editor.addRetryToError(qa,mxUtils.bind(this,function(){this.exportSvg(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca)}));this.handleError(qa)})))try{var fa=this.editor.graph.isSelectionEmpty();l=null!=l?l:fa;var la=g?null:this.editor.graph.background;la==mxConstants.NONE&&(la=null);null==la&&0==-g&&(la=this.editor.graph.shapeBackgroundColor);var ka=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var V=mxUtils.lightDarkColorSupported,k=mxUtils.preferDarkColor;if("light"==da||"dark"==da)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==da;var x=Graph.addFont,J={};Graph.addFont=function(qa,ta,ua,Ba){x.call(this,qa,ta,ua,J)};var R=this.editor.graph.createSvgImageExport(B),Y=R.drawCellState;R.drawCellState=-function(qa,ta){null!=qa&&Graph.processFontStyle(qa.style);Y.apply(this,arguments)};var Z=this.editor.graph.getSvg(la,c,I,L,null,l,null,R,"blank"==K?"_blank":"self"==K?"_top":null,null,!ea,da,ja);mxUtils.lightDarkColorSupported=V;mxUtils.preferDarkColor=k;this.editor.graph.addForeignObjectWarning=ka;t&&this.editor.graph.addSvgShadow(Z);var W=this.getBaseFilename()+(B?".drawio":"")+".svg";ca=null!=ca?ca:mxUtils.bind(this,function(qa){this.isLocalFileSave()||qa.length<=MAX_REQUEST_SIZE?this.saveData(W,-"svg",qa,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(qa)}))});var U=mxUtils.bind(this,function(qa){this.spinner.stop();B&&qa.setAttribute("content",this.getFileData(!0,null,null,null,l,N,null,null,null,null,null,c,I));ca(Graph.xmlDeclaration+"\n"+(B?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(qa))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Z);var aa=mxUtils.bind(this,-function(qa){Editor.replaceSvgDataUris&&D&&EditorUi.embedSvgImages(qa);Editor.foreignObjectImages&&ea?this.replaceAlternateContent(qa,da,U):U(qa)}),ia=Graph.customFontElements;Graph.customFontElements=J;var na=mxUtils.bind(this,function(qa){Graph.customFontElements=ia;Graph.addFont=x;D&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(qa,aa,this.thumbImageCache)):aa(qa)});ea?this.embedFonts(Z,na):(this.editor.addFontCss(Z),-na(Z))}catch(qa){this.handleError(qa)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function t(ja,ea,ca,fa,la){var ka=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ka.setAttribute("x",ea);ka.setAttribute("y",ca+.5);ka.setAttribute("width",fa.width);ka.setAttribute("height",fa.height);null==ka.setAttributeNS?ka.setAttribute("xlink:href",la):ka.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);ja.replaceChild(ka,ja.lastChild);L()}function B(){if(I<da.length)da[I++](B)}-var D="";g=c.getElementsByTagName("style");for(var I=0;I<g.length;I++)D+=g[I].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var L=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),N={},K={},da=[];for(I=0;I<g.length;I++)mxUtils.bind(this,function(ja){var ea=ja.getElementsByTagName("div");if(0<ea.length)try{var ca=ea[0].cloneNode(!0),fa=parseInt(ca.style.marginLeft),la=parseInt(ca.style.paddingTop),ka=ca.getElementsByTagName("div")[1],V=ea=!1,k=ca.style.alignItems,x=ca.style.justifyContent;-if(null!=ca.style.writingMode){var J=ca.style.writingMode;V="vertical-"==J.substring(0,9);ea="-rl"==J.substring(J.length-3)}var R=!V&&"1px"==ca.style.width||V&&"1px"==ca.style.height;if(!V&&"1px"==ca.style.height||V&&"1px"==ca.style.width)ca.style.alignItems=V&&ea?"unsafe flex-end":"unsafe flex-start";R&&(ca.style.justifyContent="unsafe flex-start");ca.style.paddingTop="";ca.style.marginLeft="";var Y=ca.outerHTML,Z=N[Y];null==Z&&(ca.style.position="absolute",ca.style.visibility="hidden",document.body.appendChild(ca),-J=1,J="1px"==ca.style.width?ka.offsetWidth:parseInt(ca.style.width),R=1,R="1px"==ca.style.height?ka.offsetHeight:parseInt(ca.style.height),document.body.removeChild(ca),Z=new mxRectangle(fa,la,J,R),N[Y]=Z);"1px"==ca.style.height&&("unsafe center"==k?la-=Z.height/2:"unsafe flex-end"==k&&(la-=Z.height));if("1px"==ca.style.width)if(!V&&"unsafe center"==x||V&&"unsafe center"==k)fa-=Z.width/2;else if(!V&&"unsafe flex-end"==x||V&&(!ea&&"unsafe flex-end"==k||ea&&"unsafe flex-start"==k))fa-=Z.width;Z=new mxRectangle(fa,-la,Z.width,Z.height+parseInt(ka.style.fontSize)/4);da.push(mxUtils.bind(this,function(W){var U=K[Y];null==U?Graph.htmlToPng(Y,Z.width,Z.height,mxUtils.bind(this,function(aa){t(ja,fa,la,Z,aa);K[Y]=aa;W()}),D):(t(ja,fa,la,Z,U),W())}))}catch(W){L()}else L()})(g[I]);0==counter&&l(c);I=0;B()};EditorUi.prototype.addRadiobox=function(c,g,l,t,B,D,I){return this.addCheckbox(c,l,t,B,D,I,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,t,B,D,I,L){D=null!=D?D:!0;var N=document.createElement("input");N.style.marginRight=-"8px";N.style.marginTop="16px";N.setAttribute("type",I?"radio":"checkbox");I="geCheckbox-"+Editor.guid();N.id=I;null!=L&&N.setAttribute("name",L);l&&(N.setAttribute("checked","checked"),N.defaultChecked=!0);t&&N.setAttribute("disabled","disabled");D&&(c.appendChild(N),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",I),c.appendChild(l),B||mxUtils.br(c));return N};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);-l.style.marginLeft="24px";var t=this.getCurrentFile(),B="";null!=t&&t.getMode()!=App.MODE_DEVICE&&t.getMode()!=App.MODE_BROWSER&&(B=window.location.href);var D=document.createElement("select");D.style.maxWidth="200px";D.style.width="auto";D.style.marginLeft="8px";D.style.marginRight="10px";D.className="geBtn";t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("makeCopy"));D.appendChild(t);var I=document.createElement("option");I.setAttribute("value",-"custom");mxUtils.write(I,mxResources.get("custom")+"...");D.appendChild(I);c.appendChild(D);mxEvent.addListener(D,"change",mxUtils.bind(this,function(){if("custom"==D.value){var L=new FilenameDialog(this,B,mxResources.get("ok"),function(N){null!=N?(B=N,I.setAttribute("title",N)):(D.value="blank",I.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){D.value="blank"});this.showDialog(L.container,300,80,!0,!1);L.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,-function(){l.checked&&(null==g||g.checked)?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===D.value?"_blank":B:null},getEditInput:function(){return l},getEditSelect:function(){return D}}};EditorUi.prototype.addLinkSection=function(c,g){function l(){var L=document.createElement("div");L.style.width="100%";L.style.height="100%";L.style.boxSizing="border-box";null!=D&&D!=mxConstants.NONE?(L.style.border="1px solid black",-L.style.backgroundColor=D):(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 t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginLeft="8px";t.style.marginRight="10px";t.className="geBtn";var B=document.createElement("option");B.setAttribute("value","auto");mxUtils.write(B,mxResources.get("automatic"));-t.appendChild(B);B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("openInNewWindow"));t.appendChild(B);B=document.createElement("option");B.setAttribute("value","self");mxUtils.write(B,mxResources.get("openInThisWindow"));t.appendChild(B);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(g));c.appendChild(t);mxUtils.write(c,mxResources.get("borderColor")+-":");var D="#0000ff",I=null;I=mxUtils.button("",mxUtils.bind(this,function(L){this.pickColor(D||"none",function(N){D=N;l()});mxEvent.consume(L)}));l();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 D},getTarget:function(){return t.value},-focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,t,B,D){D=null!=D?D:[];l&&(D.push("lightbox=1"),"auto"!=c&&D.push("target="+c),null!=g&&g!=mxConstants.NONE&&D.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=t&&0<t.length&&D.push("edit="+encodeURIComponent(t)),B&&D.push("layers=1"),this.editor.graph.foldingEnabled&&D.push("nav=1"));return D};EditorUi.prototype.createLink=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){var ca=this.getCurrentFile();N=this.createUrlParameters(c,-g,t,B,D,N);c=!0;null!=I?l="#U"+encodeURIComponent(I):L||null==ca||""==ca.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+ca.getHash(),c=!1);c&&null!=ca&&null!=ca.getTitle()&&ca.getTitle()!=this.defaultFilename&&N.push("title="+encodeURIComponent(ca.getTitle()));K&&1<l.length&&(N.push("open="+l.substring(1)),l="");da&&null!=this.currentPage&&N.push("page-id="+this.currentPage.getId());-ja&&N.push("transparent=1");null!=ea&&N.push("dark="+ea);return(t&&(null!=I||null!=ca&&ca.getMode()!=App.MODE_GITHUB&&ca.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<N.length?"?"+N.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){this.getBasenames();var ca={};""!=B&&B!=mxConstants.NONE&&(ca.highlight=B);"auto"!==-t&&(ca.target=t);K||(ca.lightbox=!1);ca.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(ca.zoom=l/100);l=[];I&&(l.push("pages"),ca.resize=!0,null!=this.pages&&null!=this.currentPage&&(ca.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),ca.resize=!0);L&&l.push("layers");N&&l.push("tags");null!=ea&&(ca["dark-mode"]=ea);0<l.length&&(K&&l.push("lightbox"),ca.toolbar=l.join(" "));null!=da&&0<da.length&&(ca.edit=da);null!=c?ca.url=c:ca.xml=this.getFileData(!0,-null,null,null,null,!I);g='<div class="mxgraph" style="'+(D?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ca))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<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,g,l,t){var B=document.createElement("div");B.style.whiteSpace="nowrap";var D=document.createElement("h3");mxUtils.write(D,mxResources.get("html"));D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";B.appendChild(D);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");D=L.cloneNode(!0);D.setAttribute("value","copy");I.appendChild(D);var N=document.createElement("span");mxUtils.write(N,mxResources.get("includeCopyOfMyDiagram"));I.appendChild(N);mxUtils.br(I);I.appendChild(L);N=document.createElement("span");mxUtils.write(N,mxResources.get("publicDiagramUrl"));I.appendChild(N);var K=this.getCurrentFile();-null==l&&null!=K&&K.constructor==window.DriveFile&&(N=document.createElement("a"),N.style.paddingLeft="12px",N.style.color="gray",N.style.cursor="pointer",mxUtils.write(N,mxResources.get("share")),I.appendChild(N),mxEvent.addListener(N,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(K.getId(),K)})));D.setAttribute("checked","checked");null==l&&L.setAttribute("disabled","disabled");B.appendChild(I);I=380;var da=this.addLinkSection(B),ja=document.createElement("select");-ja.style.maxWidth="260px";ja.style.marginLeft="8px";ja.style.marginTop="16px";N=document.createElement("option");N.setAttribute("value","light");mxUtils.write(N,mxResources.get("light"));ja.appendChild(N);N=document.createElement("option");N.setAttribute("value","dark");mxUtils.write(N,mxResources.get("dark"));ja.appendChild(N);N=document.createElement("option");N.setAttribute("value","auto");mxUtils.write(N,mxResources.get("automatic"));N.setAttribute("selected","selected");ja.appendChild(N);N.setAttribute("selected",-"selected");mxUtils.write(B,mxResources.get("appearance")+":");B.appendChild(ja);mxUtils.br(B);I+=26;var ea=this.addCheckbox(B,mxResources.get("zoom"),!0,null,!0);mxUtils.write(B,":");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="100%";B.appendChild(ca);var fa=this.addCheckbox(B,mxResources.get("fit"),!0);N=null!=this.pages&&1<this.pages.length;var la=la=this.addCheckbox(B,-mxResources.get("allPages"),N,!N),ka=this.addCheckbox(B,mxResources.get("layers"),!0),V=this.addCheckbox(B,mxResources.get("tags"),!0),k=this.addCheckbox(B,mxResources.get("lightbox"),!0),x=null;if(EditorUi.enableHtmlEditOption){x=this.addEditButton(B,k);var J=x.getEditInput();J.style.marginBottom="16px";I+=50;mxEvent.addListener(k,"change",function(){k.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled");J.checked&&k.checked?x.getEditSelect().removeAttribute("disabled"):x.getEditSelect().setAttribute("disabled",-"disabled")})}c=new CustomDialog(this,B,mxUtils.bind(this,function(){t(L.checked?l:null,ea.checked,ca.value,da.getTarget(),da.getColor(),fa.checked,la.checked,ka.checked,V.checked,k.checked,null!=x?x.getLink():null,null!=ja?ja.value:null)}),null,c,g);this.showDialog(c.container,340,I,!0,!0);D.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,t,B,D,I,L,N,K,da,ja){var ea=document.createElement("div");ea.style.whiteSpace="nowrap";var ca=document.createElement("h3");mxUtils.write(ca,c||-mxResources.get("publish"));ca.style.width="100%";ca.style.textAlign="center";ca.style.marginTop="2px";ca.style.marginBottom="20px";ea.appendChild(ca);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())B=null!=B?B:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ca=document.createElement("option"),mxUtils.write(ca,mxResources.get("makeCopy")),-ca.setAttribute("value","copy"),fa.appendChild(ca);ca=document.createElement("option");mxUtils.write(ca,mxResources.get("authorizationRequired"));ca.setAttribute("value","auth");fa.appendChild(ca);null!=L&&""!=L.getHash()||ca.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"));ea.appendChild(fa);mxUtils.br(ea);fa.focus();var la=null,ka=null;if(null!=g||null!=l)c+=30,mxUtils.write(ea,mxResources.get("width")+":"),la=document.createElement("input"),la.setAttribute("type","text"),la.style.marginRight="16px",la.style.width="50px",la.style.marginLeft="6px",la.style.marginRight="16px",la.style.marginBottom="10px",la.value="100%",ea.appendChild(la),mxUtils.write(ea,mxResources.get("height")+-":"),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.style.width="50px",ka.style.marginLeft="6px",ka.style.marginBottom="10px",ka.value=l+"px",ea.appendChild(ka),mxUtils.br(ea);var V=this.addLinkSection(ea,t),k=K?this.addCheckbox(ea,mxResources.get("transparentBackground"),!1):null;null!=k&&(c+=20);var x=document.createElement("select");x.className="geBtn";x.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value",-"allPages");x.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");x.appendChild(g);var J=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(ea,mxResources.get("pages")+":"),ea.appendChild(x),mxUtils.br(ea),c+=30),J=this.addCheckbox(ea,mxResources.get("selectedPage")+-": "+g));var R=document.createElement("select");R.style.maxWidth="260px";R.style.marginLeft="8px";R.style.marginTop="16px";ja=document.createElement("option");ja.setAttribute("value","0");mxUtils.write(ja,mxResources.get("light"));R.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));R.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected",-"selected");R.appendChild(ja);da&&(mxUtils.write(ea,mxResources.get("appearance")+":"),ea.appendChild(R),mxUtils.br(ea),c+=30);var Y=this.addCheckbox(ea,mxResources.get("lightbox"),!0,null,null,!t),Z=this.addEditButton(ea,Y),W=Z.getEditInput();t&&(W.style.marginLeft=Y.style.marginLeft,Y.style.display="none",c-=20);var U=this.addCheckbox(ea,mxResources.get("layers"),!0);U.style.marginLeft=W.style.marginLeft;U.style.marginTop="8px";var aa=this.addCheckbox(ea,mxResources.get("tags"),!0);aa.style.marginLeft=-W.style.marginLeft;aa.style.marginBottom="16px";aa.style.marginTop="16px";mxEvent.addListener(Y,"change",function(){Y.checked?(U.removeAttribute("disabled"),W.removeAttribute("disabled"),aa.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"));W.checked&&Y.checked?Z.getEditSelect().removeAttribute("disabled"):Z.getEditSelect().setAttribute("disabled","disabled")});t=new CustomDialog(this,ea,mxUtils.bind(this,-function(){N(V.getTarget(),V.getColor(),null==J?!1:J.checked,Y.checked,Z.getLink(),U.checked,null!=la?la.value:null,null!=ka?ka.value:null,aa.checked,fa.value,null!=k?k.checked:!1,R.value,"allPages"==x.value)}),null,mxResources.get("create"),B,D);this.showDialog(t.container,340,296+c,!0,!0);null!=la?(la.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?la.select():document.execCommand("selectAll",!1,null)):null==fa.parentNode;V.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,-g,l,t,B){var D=document.createElement("div");D.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:"+(B?"10":"4")+"px";D.appendChild(I);if(B){mxUtils.write(D,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%";D.appendChild(L);mxUtils.write(D,mxResources.get("borderWidth")+":");var N=document.createElement("input");N.setAttribute("type","text");N.style.marginRight="16px";N.style.width="60px";N.style.marginLeft="4px";N.value=this.lastExportBorder||"0";D.appendChild(N);mxUtils.br(D)}var K=this.addCheckbox(D,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),da=t?null:this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);I=this.editor.graph;-var ja=t?null:this.addCheckbox(D,mxResources.get("transparentBackground"),I.background==mxConstants.NONE||null==I.background);null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,D,mxUtils.bind(this,function(){var ea=parseInt(L.value)/100||1,ca=parseInt(N.value)||0;l(!K.checked,null!=da?da.checked:!1,null!=ja?ja.checked:!1,ea,ca)}),null,c,g);this.showDialog(c.container,300,(B?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,t,B,D,I,L,N){I=null!=I?I:Editor.defaultIncludeDiagram;-var K=document.createElement("div");K.style.whiteSpace="nowrap";var da=this.editor.graph,ja="jpeg"==L||"webp"==L?220:320,ea=document.createElement("h3");mxUtils.write(ea,c);ea.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";K.appendChild(ea);mxUtils.write(K,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%";K.appendChild(ca);mxUtils.write(K,mxResources.get("borderWidth")+":");var fa=document.createElement("input");fa.setAttribute("type","text");fa.style.marginRight="16px";fa.style.width="60px";fa.style.marginLeft="4px";fa.value=this.lastExportBorder||"0";K.appendChild(fa);mxUtils.br(K);var la=this.addCheckbox(K,mxResources.get("selectionOnly"),!1,da.isSelectionEmpty()),ka=document.createElement("input");ka.style.marginTop="16px";ka.style.marginRight="8px";ka.style.marginLeft=-"24px";ka.setAttribute("disabled","disabled");ka.setAttribute("type","checkbox");var V=document.createElement("select");V.style.marginTop="16px";V.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(ea=0;ea<c.length;ea++)if(!da.isSelectionEmpty()||"selectionOnly"!=c[ea]){var k=document.createElement("option");mxUtils.write(k,mxResources.get(c[ea]));k.setAttribute("value",c[ea]);V.appendChild(k)}N?(mxUtils.write(K,mxResources.get("size")+":"),K.appendChild(V),mxUtils.br(K),ja+=26,mxEvent.addListener(V,-"change",function(){"selectionOnly"==V.value&&(la.checked=!0)})):D&&(K.appendChild(ka),mxUtils.write(K,mxResources.get("crop")),mxUtils.br(K),ja+=30,mxEvent.addListener(la,"change",function(){la.checked?ka.removeAttribute("disabled"):ka.setAttribute("disabled","disabled")}));da.isSelectionEmpty()?N&&(la.style.display="none",la.nextSibling.style.display="none",la.nextSibling.nextSibling.style.display="none",ja-=30):(V.value="diagram",ka.setAttribute("checked","checked"),ka.defaultChecked=!0,mxEvent.addListener(la,-"change",function(){V.value=la.checked?"selectionOnly":"diagram"}));var x=this.addCheckbox(K,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=L&&"webp"!=L),J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft="8px";J.style.marginTop="16px";D=document.createElement("option");D.setAttribute("value","light");mxUtils.write(D,mxResources.get("light"));J.appendChild(D);N=document.createElement("option");N.setAttribute("value","dark");mxUtils.write(N,mxResources.get("dark"));-J.appendChild(N);"svg"==L&&mxUtils.lightDarkColorSupported?(D=document.createElement("option"),D.setAttribute("value","auto"),mxUtils.write(D,mxResources.get("automatic")),D.setAttribute("selected","selected"),J.appendChild(D)):Editor.isDarkMode()?N.setAttribute("selected","selected"):D.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("appearance")+":");K.appendChild(J);mxUtils.br(K);ja+=26;var R=this.addCheckbox(K,mxResources.get("shadow"),da.shadowVisible),Y=null;if("png"==L||-"jpeg"==L||"webp"==L)Y=this.addCheckbox(K,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;da=null!=this.pages?this.pages.length:1;var Z=this.addCheckbox(K,mxResources.get("includeCopyOfMyDiagram")+(1<da?":":""),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(){Z.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},D=document.createElement("option"),-D.setAttribute("value","allPages"),mxUtils.write(D,mxResources.get("allPages")),W.appendChild(D),D=document.createElement("option"),D.setAttribute("value","currentPage"),mxUtils.write(D,mxResources.get("currentPage")),W.appendChild(D),1<da?(Z.style.marginBottom="12px",W.style.marginBottom="16px",K.appendChild(W),mxUtils.br(K),ja+=20):Z.style.marginBottom="16px",null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(Z,"change",I),I()):Z.style.marginBottom="16px";var U=document.createElement("input");-U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");U.id="geCheckbox-"+Editor.guid();var aa=document.createElement("input");aa.style.marginBottom="16px";aa.style.marginRight="8px";aa.setAttribute("type","checkbox");aa.id="geCheckbox-"+Editor.guid();g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,K.appendChild(U),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedImages")),I.setAttribute("for",U.id),K.appendChild(I),mxUtils.br(K),-aa.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,K.appendChild(aa),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedFonts")),I.setAttribute("for",aa.id),K.appendChild(I),mxUtils.br(K),ja+=50);var ia=document.createElement("select");ia.style.maxWidth="260px";ia.style.marginLeft="8px";D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));ia.appendChild(D);I=document.createElement("option");I.setAttribute("value",-"blank");mxUtils.write(I,mxResources.get("openInNewWindow"));ia.appendChild(I);I=document.createElement("option");I.setAttribute("value","self");mxUtils.write(I,mxResources.get("openInThisWindow"));ia.appendChild(I);I=document.createElement("div");mxUtils.write(I,mxResources.get("LinksLost"));I.style.margin="7px";I.style.display="none";"svg"==L&&(mxUtils.write(K,mxResources.get("links")+":"),K.appendChild(ia),K.appendChild(I),mxUtils.br(K),mxUtils.br(K),ja+=50);l=new CustomDialog(this,K,mxUtils.bind(this,-function(){this.lastExportBorder=fa.value;this.lastExportZoom=ca.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=aa.checked;this.lastEmbedInclude=W.value;B(ca.value,x.checked,!la.checked,R.checked,Z.checked,U.checked&&g,fa.value,ka.checked,("png"==L||"svg"==L)&&"currentPage"==W.value,ia.value,null!=Y?Y.checked:null,null!=J?J.value:null,V.value,aa.checked)}),null,l,t);this.showDialog(l.container,340,ja,!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,g,l,t,B){var D=document.createElement("div");D.style.whiteSpace="nowrap";var I=this.editor.graph;if(null!=g){var L=document.createElement("h3");mxUtils.write(L,g);L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";D.appendChild(L)}var N=this.addCheckbox(D,mxResources.get("fit"),!0),K=this.addCheckbox(D,mxResources.get("shadow"),I.shadowVisible&&t,!t),da=this.addCheckbox(D,-l),ja=this.addCheckbox(D,mxResources.get("lightbox"),!0),ea=this.addEditButton(D,ja),ca=ea.getEditInput(),fa=1<I.model.getChildCount(I.model.getRoot()),la=this.addCheckbox(D,mxResources.get("layers"),fa,!fa);la.style.marginLeft=ca.style.marginLeft;la.style.marginBottom="12px";la.style.marginTop="8px";mxEvent.addListener(ja,"change",function(){ja.checked?(fa&&la.removeAttribute("disabled"),ca.removeAttribute("disabled")):(la.setAttribute("disabled","disabled"),ca.setAttribute("disabled","disabled"));-ca.checked&&ja.checked?ea.getEditSelect().removeAttribute("disabled"):ea.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,D,mxUtils.bind(this,function(){c(N.checked,K.checked,da.checked,ja.checked,ea.getLink(),la.checked)}),null,mxResources.get("embed"),B);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,t,B,D,I,L){function N(ca){var fa=" ",la="";t&&(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"+(null!=da?"&page="+da:"")+(B?"&edit=_blank":"")+(D?"&layers=1":"")+"');}})(this);\"",la+="cursor:pointer;");c&&(la+="max-width:100%;");var ka="";l&&(ka=' width="'+Math.round(K.width)+'" height="'+Math.round(K.height)+'"');I('<img src="'+ca+'"'+ka+(""!=la?' style="'+la+'"':"")+fa+"/>")}var K=this.editor.graph.getGraphBounds(),da=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ca){var fa=t?this.getFileData(!0):-null;ca=this.createImageDataUri(ca,fa,"png");N(ca)}),null,null,null,mxUtils.bind(this,function(ca){L({message:mxResources.get("unknownError")})}),null,!0,l?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 ja="";l&&(ja="&w="+Math.round(2*K.width)+"&h="+Math.round(2*K.height));var ea=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(t?"1":"0")+ja+"&xml="+encodeURIComponent(g));ea.send(mxUtils.bind(this,function(){200<=-ea.getStatus()&&299>=ea.getStatus()?N("data:image/png;base64,"+ea.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,t,B,D,I){var L=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),N=L.getElementsByTagName("a");if(null!=N)for(var K=0;K<N.length;K++){var da=N[K].getAttribute("href");null!=da&&"#"==da.charAt(0)&&"_blank"==N[K].getAttribute("target")&&N[K].removeAttribute("target")}t&&-L.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(L);if(l){var ja=" ",ea="";t&&(ja="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"+(B?"&edit=_blank":"")+(D?"&layers=1":-"")+"');}})(this);\"",ea+="cursor:pointer;");c&&(ea+="max-width:100%;");this.editor.convertImages(L,mxUtils.bind(this,function(ca){I('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ca))+'"'+(""!=ea?' style="'+ea+'"':"")+ja+"/>")}))}else ea="",t&&(g=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!=g?"&page="+g:"")+(B?"&edit=_blank":"")+(D?"&layers=1":"")+"');}}})(this);"),ea+="cursor:pointer;"),c&&(c=parseInt(L.getAttribute("width")),B=parseInt(L.getAttribute("height")),L.setAttribute("viewBox","-0.5 -0.5 "+c+" "+B),ea+="max-width:100%;max-height:"+B+"px;",L.removeAttribute("height")),""!=ea&&L.setAttribute("style",ea),this.editor.addFontCss(L),this.editor.graph.mathEnabled&&this.editor.addMathCss(L),I(mxUtils.getXml(L))};EditorUi.prototype.timeSince=+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",B);this.editor.exportToCanvas(mxUtils.bind(this,function(K){I.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);B.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(K){I.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(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,t,B,D){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){D=this.embedMessageSource||window.opener||window.parent;var I=this.createLoadMessage("export");I.format=g;+I.filename=c;I.data=B?"data:"+t+";base64,"+l:l;I.xml=this.getFileData(!0);D.postMessage(JSON.stringify(I),"*")}else this.isLocalFileSave()?this.saveLocalFile(l,c,t,B,g,D):this.saveRequest(c,g,mxUtils.bind(this,function(K,M){return this.createEchoRequest(l,K,t,B,g,M)}),l,B,t)};EditorUi.prototype.saveRequest=function(c,g,l,t,B,D,I){I=null!=I?I:!mxClient.IS_IOS||!navigator.standalone;var K=mxUtils.bind(this,function(V,Q,ja,ea){if("_blank"==Q||null!=V&&0<V.length){var da=l("_blank"==Q?null:V,Q==App.MODE_DEVICE||+"download"==Q||null==Q||"_blank"==Q?"0":"1");null!=da&&(Q==App.MODE_DEVICE||"download"==Q||"_blank"==Q?da.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(ia){D=null!=D?D:"pdf"==g?"application/pdf":"image/"+g;if(null!=t)try{this.exportFile(t,V,D,!0,Q,ia)}catch(la){this.handleError(la)}else this.spinner.spin(document.body,mxResources.get("saving"))&&da.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=da.getStatus()&&299>=da.getStatus())try{this.exportFile(da.getText(),V,D,!0,+Q,ia)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=ea?ja(ea):this.pickFolder(Q,ja)))}});B=[App.MODE_BROWSER];I||B.push("_blank");var M=new SaveDialog(this,c,mxUtils.bind(this,function(V,Q,ja){K(V.value,Q,V,ja);this.hideDialog(null,null,M.container)}),B,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,g,l,t,B,D){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da){if(this.spinner.spin(document.body,mxResources.get("exporting"),+mxUtils.bind(this,function(pa){Editor.addRetryToError(pa,mxUtils.bind(this,function(){this.exportSvg(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da)}));this.handleError(pa)})))try{var ia=this.editor.graph.isSelectionEmpty();l=null!=l?l:ia;var la=g?null:this.editor.graph.background;la==mxConstants.NONE&&(la=null);null==la&&0==g&&(la=this.editor.graph.shapeBackgroundColor);var ka=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var W=mxUtils.lightDarkColorSupported,+k=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var y=Graph.addFont,J={};Graph.addFont=function(pa,ta,ua,Ca){y.call(this,pa,ta,ua,J)};var R=this.editor.graph.createSvgImageExport(B),X=R.drawCellState;R.drawCellState=function(pa,ta){null!=pa&&Graph.processFontStyle(pa.style);X.apply(this,arguments)};var aa=this.editor.graph.getSvg(la,c,I,K,null,l,null,R,"blank"==V?"_blank":"self"==V?"_top":null,null,!ea,Q,ja);mxUtils.lightDarkColorSupported=+W;mxUtils.preferDarkColor=k;this.editor.graph.addForeignObjectWarning=ka;t&&this.editor.graph.addSvgShadow(aa);var Z=this.getBaseFilename()+(B?".drawio":"")+".svg";da=null!=da?da:mxUtils.bind(this,function(pa){this.isLocalFileSave()||pa.length<=MAX_REQUEST_SIZE?this.saveData(Z,"svg",pa,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(pa)}))});var U=mxUtils.bind(this,function(pa){this.spinner.stop();B&&+pa.setAttribute("content",this.getFileData(!0,null,null,null,l,M,null,null,null,null,null,c,I));da(Graph.xmlDeclaration+"\n"+(B?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(pa))});this.editor.graph.mathEnabled&&this.editor.addMathCss(aa);var ba=mxUtils.bind(this,function(pa){Editor.replaceSvgDataUris&&D&&EditorUi.embedSvgImages(pa);Editor.foreignObjectImages&&ea?this.replaceAlternateContent(pa,Q,U):U(pa)}),fa=Graph.customFontElements;Graph.customFontElements=J;var na=mxUtils.bind(this,+function(pa){Graph.customFontElements=fa;Graph.addFont=y;D&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(pa,ba,this.thumbImageCache)):ba(pa)});ea?this.embedFonts(aa,na):(this.editor.addFontCss(aa),na(aa))}catch(pa){this.handleError(pa)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function t(ja,ea,da,ia,la){var ka=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ka.setAttribute("x",ea);+ka.setAttribute("y",da+.5);ka.setAttribute("width",ia.width);ka.setAttribute("height",ia.height);null==ka.setAttributeNS?ka.setAttribute("xlink:href",la):ka.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);ja.replaceChild(ka,ja.lastChild);K()}function B(){if(I<Q.length)Q[I++](B)}var D="";g=c.getElementsByTagName("style");for(var I=0;I<g.length;I++)D+=g[I].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var K=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),M={},V={},Q=[];+for(I=0;I<g.length;I++)mxUtils.bind(this,function(ja){var ea=ja.getElementsByTagName("div");if(0<ea.length)try{var da=ea[0].cloneNode(!0),ia=parseInt(da.style.marginLeft),la=parseInt(da.style.paddingTop),ka=da.getElementsByTagName("div")[1],W=ea=!1,k=da.style.alignItems,y=da.style.justifyContent;if(null!=da.style.writingMode){var J=da.style.writingMode;W="vertical-"==J.substring(0,9);ea="-rl"==J.substring(J.length-3)}var R=!W&&"1px"==da.style.width||W&&"1px"==da.style.height;if(!W&&"1px"==da.style.height||+W&&"1px"==da.style.width)da.style.alignItems=W&&ea?"unsafe flex-end":"unsafe flex-start";R&&(da.style.justifyContent="unsafe flex-start");da.style.paddingTop="";da.style.marginLeft="";var X=da.outerHTML,aa=M[X];null==aa&&(da.style.position="absolute",da.style.visibility="hidden",document.body.appendChild(da),J=1,J="1px"==da.style.width?ka.offsetWidth:parseInt(da.style.width),R=1,R="1px"==da.style.height?ka.offsetHeight:parseInt(da.style.height),document.body.removeChild(da),aa=new mxRectangle(ia,+la,J,R),M[X]=aa);"1px"==da.style.height&&("unsafe center"==k?la-=aa.height/2:"unsafe flex-end"==k&&(la-=aa.height));if("1px"==da.style.width)if(!W&&"unsafe center"==y||W&&"unsafe center"==k)ia-=aa.width/2;else if(!W&&"unsafe flex-end"==y||W&&(!ea&&"unsafe flex-end"==k||ea&&"unsafe flex-start"==k))ia-=aa.width;aa=new mxRectangle(ia,la,aa.width,aa.height+parseInt(ka.style.fontSize)/4);Q.push(mxUtils.bind(this,function(Z){var U=V[X];null==U?Graph.htmlToPng(X,aa.width,aa.height,mxUtils.bind(this,function(ba){t(ja,+ia,la,aa,ba);V[X]=ba;Z()}),D):(t(ja,ia,la,aa,U),Z())}))}catch(Z){K()}else K()})(g[I]);0==counter&&l(c);I=0;B()};EditorUi.prototype.addRadiobox=function(c,g,l,t,B,D,I){return this.addCheckbox(c,l,t,B,D,I,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,t,B,D,I,K){D=null!=D?D:!0;var M=document.createElement("input");M.style.marginRight="8px";M.style.marginTop="16px";M.setAttribute("type",I?"radio":"checkbox");I="geCheckbox-"+Editor.guid();M.id=I;null!=K&&M.setAttribute("name",K);l&&(M.setAttribute("checked",+"checked"),M.defaultChecked=!0);t&&M.setAttribute("disabled","disabled");D&&(c.appendChild(M),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",I),c.appendChild(l),B||mxUtils.br(c));return M};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var t=this.getCurrentFile(),B="";null!=t&&t.getMode()!=App.MODE_DEVICE&&t.getMode()!=App.MODE_BROWSER&&(B=window.location.href);var D=document.createElement("select");+D.style.maxWidth="200px";D.style.width="auto";D.style.marginLeft="8px";D.style.marginRight="10px";D.className="geBtn";t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("makeCopy"));D.appendChild(t);var I=document.createElement("option");I.setAttribute("value","custom");mxUtils.write(I,mxResources.get("custom")+"...");D.appendChild(I);c.appendChild(D);mxEvent.addListener(D,"change",mxUtils.bind(this,function(){if("custom"==D.value){var K=new FilenameDialog(this,+B,mxResources.get("ok"),function(M){null!=M?(B=M,I.setAttribute("title",M)):(D.value="blank",I.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){D.value="blank"});this.showDialog(K.container,300,80,!0,!1);K.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===D.value?"_blank":B:null},+getEditInput:function(){return l},getEditSelect:function(){return D}}};EditorUi.prototype.addLinkSection=function(c,g){function l(){var K=document.createElement("div");K.style.width="100%";K.style.height="100%";K.style.boxSizing="border-box";null!=D&&D!=mxConstants.NONE?(K.style.border="1px solid black",K.style.backgroundColor=D):(K.style.backgroundPosition="center center",K.style.backgroundRepeat="no-repeat",K.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");I.innerText="";I.appendChild(K)}+mxUtils.write(c,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 B=document.createElement("option");B.setAttribute("value","auto");mxUtils.write(B,mxResources.get("automatic"));t.appendChild(B);B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("openInNewWindow"));t.appendChild(B);B=document.createElement("option");+B.setAttribute("value","self");mxUtils.write(B,mxResources.get("openInThisWindow"));t.appendChild(B);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(g));c.appendChild(t);mxUtils.write(c,mxResources.get("borderColor")+":");var D="#0000ff",I=null;I=mxUtils.button("",mxUtils.bind(this,function(K){this.pickColor(D||"none",function(M){D=M;l()});mxEvent.consume(K)}));l();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 D},getTarget:function(){return t.value},focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,t,B,D){D=null!=D?D:[];l&&(D.push("lightbox=1"),"auto"!=c&&D.push("target="+c),+null!=g&&g!=mxConstants.NONE&&D.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=t&&0<t.length&&D.push("edit="+encodeURIComponent(t)),B&&D.push("layers=1"),this.editor.graph.foldingEnabled&&D.push("nav=1"));return D};EditorUi.prototype.createLink=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){var da=this.getCurrentFile();M=this.createUrlParameters(c,g,t,B,D,M);c=!0;null!=I?l="#U"+encodeURIComponent(I):K||null==da||""==da.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,+null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+da.getHash(),c=!1);c&&null!=da&&null!=da.getTitle()&&da.getTitle()!=this.defaultFilename&&M.push("title="+encodeURIComponent(da.getTitle()));V&&1<l.length&&(M.push("open="+l.substring(1)),l="");Q&&null!=this.currentPage&&M.push("page-id="+this.currentPage.getId());ja&&M.push("transparent=1");null!=ea&&M.push("dark="+ea);return(t&&(null!=I||null!=da&&da.getMode()!=App.MODE_GITHUB&&da.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("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){this.getBasenames();var da={};""!=B&&B!=mxConstants.NONE&&(da.highlight=B);"auto"!==t&&(da.target=t);V||(da.lightbox=!1);da.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(da.zoom=l/100);l=[];I&&(l.push("pages"),+da.resize=!0,null!=this.pages&&null!=this.currentPage&&(da.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),da.resize=!0);K&&l.push("layers");M&&l.push("tags");null!=ea&&(da["dark-mode"]=ea);0<l.length&&(V&&l.push("lightbox"),da.toolbar=l.join(" "));null!=Q&&0<Q.length&&(da.edit=Q);null!=c?da.url=c:da.xml=this.getFileData(!0,null,null,null,null,!I);g='<div class="mxgraph" style="'+(D?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(da))++'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<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,g,l,t){var B=document.createElement("div");B.style.whiteSpace=+"nowrap";var D=document.createElement("h3");mxUtils.write(D,mxResources.get("html"));D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";B.appendChild(D);var I=document.createElement("div");I.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");+D=K.cloneNode(!0);D.setAttribute("value","copy");I.appendChild(D);var M=document.createElement("span");mxUtils.write(M,mxResources.get("includeCopyOfMyDiagram"));I.appendChild(M);mxUtils.br(I);I.appendChild(K);M=document.createElement("span");mxUtils.write(M,mxResources.get("publicDiagramUrl"));I.appendChild(M);var V=this.getCurrentFile();null==l&&null!=V&&V.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")),I.appendChild(M),mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(V.getId(),V)})));D.setAttribute("checked","checked");null==l&&K.setAttribute("disabled","disabled");B.appendChild(I);I=380;var Q=this.addLinkSection(B),ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";ja.style.marginTop="16px";M=document.createElement("option");M.setAttribute("value","light");mxUtils.write(M,mxResources.get("light"));+ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","auto");mxUtils.write(M,mxResources.get("automatic"));M.setAttribute("selected","selected");ja.appendChild(M);M.setAttribute("selected","selected");mxUtils.write(B,mxResources.get("appearance")+":");B.appendChild(ja);mxUtils.br(B);I+=26;var ea=this.addCheckbox(B,mxResources.get("zoom"),!0,null,!0);mxUtils.write(B,+":");var da=document.createElement("input");da.setAttribute("type","text");da.style.marginRight="16px";da.style.width="60px";da.style.marginLeft="4px";da.style.marginRight="12px";da.value="100%";B.appendChild(da);var ia=this.addCheckbox(B,mxResources.get("fit"),!0);M=null!=this.pages&&1<this.pages.length;var la=la=this.addCheckbox(B,mxResources.get("allPages"),M,!M),ka=this.addCheckbox(B,mxResources.get("layers"),!0),W=this.addCheckbox(B,mxResources.get("tags"),!0),k=this.addCheckbox(B,mxResources.get("lightbox"),+!0),y=null;if(EditorUi.enableHtmlEditOption){y=this.addEditButton(B,k);var J=y.getEditInput();J.style.marginBottom="16px";I+=50;mxEvent.addListener(k,"change",function(){k.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled");J.checked&&k.checked?y.getEditSelect().removeAttribute("disabled"):y.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,B,mxUtils.bind(this,function(){t(K.checked?l:null,ea.checked,da.value,Q.getTarget(),Q.getColor(),ia.checked,+la.checked,ka.checked,W.checked,k.checked,null!=y?y.getLink():null,null!=ja?ja.value:null)}),null,c,g);this.showDialog(c.container,340,I,!0,!0);D.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,t,B,D,I,K,M,V,Q,ja){var ea=document.createElement("div");ea.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";ea.appendChild(da);+var ia=document.createElement("select");c=30;ia.className="geBtn";ia.style.marginBottom="8px";ia.style.marginLeft="0px";ia.style.width="100%";ia.style.boxSizing="border-box";if(null==K||""==K.getHash())B=null!=B?B:"https://www.drawio.com/doc/faq/publish-diagram-as-link",da=document.createElement("option"),mxUtils.write(da,mxResources.get("makeCopy")),da.setAttribute("value","copy"),ia.appendChild(da);da=document.createElement("option");mxUtils.write(da,mxResources.get("authorizationRequired"));da.setAttribute("value",+"auth");ia.appendChild(da);null!=K&&""!=K.getHash()||da.setAttribute("disabled","disabled");K=document.createElement("option");K.setAttribute("value","public");ia.appendChild(K);null!=I?(mxUtils.write(K,mxResources.get("publicDiagramUrl")),K.setAttribute("title",I),ia.value="public"):(mxUtils.write(K,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),K.setAttribute("disabled","disabled"));ea.appendChild(ia);mxUtils.br(ea);ia.focus();var la=null,ka=null;if(null!=g||+null!=l)c+=30,mxUtils.write(ea,mxResources.get("width")+":"),la=document.createElement("input"),la.setAttribute("type","text"),la.style.marginRight="16px",la.style.width="50px",la.style.marginLeft="6px",la.style.marginRight="16px",la.style.marginBottom="10px",la.value="100%",ea.appendChild(la),mxUtils.write(ea,mxResources.get("height")+":"),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.style.width="50px",ka.style.marginLeft="6px",ka.style.marginBottom="10px",ka.value=l+"px",+ea.appendChild(ka),mxUtils.br(ea);var W=this.addLinkSection(ea,t),k=V?this.addCheckbox(ea,mxResources.get("transparentBackground"),!1):null;null!=k&&(c+=20);var y=document.createElement("select");y.className="geBtn";y.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");y.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");y.appendChild(g);+var J=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(ea,mxResources.get("pages")+":"),ea.appendChild(y),mxUtils.br(ea),c+=30),J=this.addCheckbox(ea,mxResources.get("selectedPage")+": "+g));var R=document.createElement("select");R.style.maxWidth="260px";R.style.marginLeft="8px";R.style.marginTop="16px";ja=document.createElement("option");ja.setAttribute("value",+"0");mxUtils.write(ja,mxResources.get("light"));R.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));R.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected","selected");R.appendChild(ja);Q&&(mxUtils.write(ea,mxResources.get("appearance")+":"),ea.appendChild(R),mxUtils.br(ea),c+=30);var X=this.addCheckbox(ea,mxResources.get("lightbox"),+!0,null,null,!t),aa=this.addEditButton(ea,X),Z=aa.getEditInput();t&&(Z.style.marginLeft=X.style.marginLeft,X.style.display="none",c-=20);var U=this.addCheckbox(ea,mxResources.get("layers"),!0);U.style.marginLeft=Z.style.marginLeft;U.style.marginTop="8px";var ba=this.addCheckbox(ea,mxResources.get("tags"),!0);ba.style.marginLeft=Z.style.marginLeft;ba.style.marginBottom="16px";ba.style.marginTop="16px";mxEvent.addListener(X,"change",function(){X.checked?(U.removeAttribute("disabled"),Z.removeAttribute("disabled"),+ba.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));Z.checked&&X.checked?aa.getEditSelect().removeAttribute("disabled"):aa.getEditSelect().setAttribute("disabled","disabled")});t=new CustomDialog(this,ea,mxUtils.bind(this,function(){M(W.getTarget(),W.getColor(),null==J?!1:J.checked,X.checked,aa.getLink(),U.checked,null!=la?la.value:null,null!=ka?ka.value:null,ba.checked,ia.value,null!=k?k.checked:!1,R.value,+"allPages"==y.value)}),null,mxResources.get("create"),B,D);this.showDialog(t.container,340,296+c,!0,!0);null!=la?(la.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?la.select():document.execCommand("selectAll",!1,null)):null==ia.parentNode;W.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,g,l,t,B){var D=document.createElement("div");D.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:"++(B?"10":"4")+"px";D.appendChild(I);if(B){mxUtils.write(D,mxResources.get("zoom")+":");var K=document.createElement("input");K.setAttribute("type","text");K.style.marginRight="16px";K.style.width="60px";K.style.marginLeft="4px";K.style.marginRight="12px";K.value=this.lastExportZoom||"100%";D.appendChild(K);mxUtils.write(D,mxResources.get("borderWidth")+":");var M=document.createElement("input");M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.value=+this.lastExportBorder||"0";D.appendChild(M);mxUtils.br(D)}var V=this.addCheckbox(D,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Q=t?null:this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);I=this.editor.graph;var ja=t?null:this.addCheckbox(D,mxResources.get("transparentBackground"),I.background==mxConstants.NONE||null==I.background);null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,D,mxUtils.bind(this,function(){var ea=+parseInt(K.value)/100||1,da=parseInt(M.value)||0;l(!V.checked,null!=Q?Q.checked:!1,null!=ja?ja.checked:!1,ea,da)}),null,c,g);this.showDialog(c.container,300,(B?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,t,B,D,I,K,M){I=null!=I?I:Editor.defaultIncludeDiagram;var V=document.createElement("div");V.style.whiteSpace="nowrap";var Q=this.editor.graph,ja="jpeg"==K||"webp"==K?220:320,ea=document.createElement("h3");mxUtils.write(ea,c);ea.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";+V.appendChild(ea);mxUtils.write(V,mxResources.get("zoom")+":");var da=document.createElement("input");da.setAttribute("type","text");da.style.marginRight="16px";da.style.width="60px";da.style.marginLeft="4px";da.style.marginRight="12px";da.value=this.lastExportZoom||"100%";V.appendChild(da);mxUtils.write(V,mxResources.get("borderWidth")+":");var ia=document.createElement("input");ia.setAttribute("type","text");ia.style.marginRight="16px";ia.style.width="60px";ia.style.marginLeft="4px";ia.value=this.lastExportBorder||+"0";V.appendChild(ia);mxUtils.br(V);var la=this.addCheckbox(V,mxResources.get("selectionOnly"),!1,Q.isSelectionEmpty()),ka=document.createElement("input");ka.style.marginTop="16px";ka.style.marginRight="8px";ka.style.marginLeft="24px";ka.setAttribute("disabled","disabled");ka.setAttribute("type","checkbox");var W=document.createElement("select");W.style.marginTop="16px";W.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(ea=0;ea<c.length;ea++)if(!Q.isSelectionEmpty()||"selectionOnly"!=+c[ea]){var k=document.createElement("option");mxUtils.write(k,mxResources.get(c[ea]));k.setAttribute("value",c[ea]);W.appendChild(k)}M?(mxUtils.write(V,mxResources.get("size")+":"),V.appendChild(W),mxUtils.br(V),ja+=26,mxEvent.addListener(W,"change",function(){"selectionOnly"==W.value&&(la.checked=!0)})):D&&(V.appendChild(ka),mxUtils.write(V,mxResources.get("crop")),mxUtils.br(V),ja+=30,mxEvent.addListener(la,"change",function(){la.checked?ka.removeAttribute("disabled"):ka.setAttribute("disabled",+"disabled")}));Q.isSelectionEmpty()?M&&(la.style.display="none",la.nextSibling.style.display="none",la.nextSibling.nextSibling.style.display="none",ja-=30):(W.value="diagram",ka.setAttribute("checked","checked"),ka.defaultChecked=!0,mxEvent.addListener(la,"change",function(){W.value=la.checked?"selectionOnly":"diagram"}));var y=this.addCheckbox(V,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=K&&"webp"!=K),J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft=+"8px";J.style.marginTop="16px";D=document.createElement("option");D.setAttribute("value","light");mxUtils.write(D,mxResources.get("light"));J.appendChild(D);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));J.appendChild(M);"svg"==K&&mxUtils.lightDarkColorSupported?(D=document.createElement("option"),D.setAttribute("value","auto"),mxUtils.write(D,mxResources.get("automatic")),D.setAttribute("selected","selected"),J.appendChild(D)):Editor.isDarkMode()?+M.setAttribute("selected","selected"):D.setAttribute("selected","selected");mxUtils.write(V,mxResources.get("appearance")+":");V.appendChild(J);mxUtils.br(V);ja+=26;var R=this.addCheckbox(V,mxResources.get("shadow"),Q.shadowVisible),X=null;if("png"==K||"jpeg"==K||"webp"==K)X=this.addCheckbox(V,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;Q=null!=this.pages?this.pages.length:1;var aa=this.addCheckbox(V,mxResources.get("includeCopyOfMyDiagram")+(1<Q?":":""),I,null,+null,"jpeg"!=K&&"webp"!=K),Z=document.createElement("select");Z.style.maxWidth="260px";Z.style.marginLeft="28px";"png"==K||"svg"==K?(I=function(){aa.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")},D=document.createElement("option"),D.setAttribute("value","allPages"),mxUtils.write(D,mxResources.get("allPages")),Z.appendChild(D),D=document.createElement("option"),D.setAttribute("value","currentPage"),mxUtils.write(D,mxResources.get("currentPage")),Z.appendChild(D),1<Q?(aa.style.marginBottom=+"12px",Z.style.marginBottom="16px",V.appendChild(Z),mxUtils.br(V),ja+=20):aa.style.marginBottom="16px",null!=this.lastEmbedInclude&&(Z.value=this.lastEmbedInclude),mxEvent.addListener(aa,"change",I),I()):aa.style.marginBottom="16px";var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");U.id="geCheckbox-"+Editor.guid();var ba=document.createElement("input");ba.style.marginBottom="16px";ba.style.marginRight="8px";ba.setAttribute("type",+"checkbox");ba.id="geCheckbox-"+Editor.guid();g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,V.appendChild(U),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedImages")),I.setAttribute("for",U.id),V.appendChild(I),mxUtils.br(V),ba.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,V.appendChild(ba),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedFonts")),I.setAttribute("for",ba.id),V.appendChild(I),mxUtils.br(V),ja+=50);var fa=+document.createElement("select");fa.style.maxWidth="260px";fa.style.marginLeft="8px";D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));fa.appendChild(D);I=document.createElement("option");I.setAttribute("value","blank");mxUtils.write(I,mxResources.get("openInNewWindow"));fa.appendChild(I);I=document.createElement("option");I.setAttribute("value","self");mxUtils.write(I,mxResources.get("openInThisWindow"));fa.appendChild(I);I=document.createElement("div");+mxUtils.write(I,mxResources.get("LinksLost"));I.style.margin="7px";I.style.display="none";"svg"==K&&(mxUtils.write(V,mxResources.get("links")+":"),V.appendChild(fa),V.appendChild(I),mxUtils.br(V),mxUtils.br(V),ja+=50);l=new CustomDialog(this,V,mxUtils.bind(this,function(){this.lastExportBorder=ia.value;this.lastExportZoom=da.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=ba.checked;this.lastEmbedInclude=Z.value;B(da.value,y.checked,!la.checked,R.checked,aa.checked,U.checked&&g,ia.value,+ka.checked,("png"==K||"svg"==K)&&"currentPage"==Z.value,fa.value,null!=X?X.checked:null,null!=J?J.value:null,W.value,ba.checked)}),null,l,t);this.showDialog(l.container,340,ja,!0,!0,null,null,null,null,!0);da.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?da.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,l,t,B){var D=document.createElement("div");D.style.whiteSpace="nowrap";var I=this.editor.graph;if(null!=g){var K=document.createElement("h3");+mxUtils.write(K,g);K.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";D.appendChild(K)}var M=this.addCheckbox(D,mxResources.get("fit"),!0),V=this.addCheckbox(D,mxResources.get("shadow"),I.shadowVisible&&t,!t),Q=this.addCheckbox(D,l),ja=this.addCheckbox(D,mxResources.get("lightbox"),!0),ea=this.addEditButton(D,ja),da=ea.getEditInput(),ia=1<I.model.getChildCount(I.model.getRoot()),la=this.addCheckbox(D,mxResources.get("layers"),ia,!ia);la.style.marginLeft=da.style.marginLeft;+la.style.marginBottom="12px";la.style.marginTop="8px";mxEvent.addListener(ja,"change",function(){ja.checked?(ia&&la.removeAttribute("disabled"),da.removeAttribute("disabled")):(la.setAttribute("disabled","disabled"),da.setAttribute("disabled","disabled"));da.checked&&ja.checked?ea.getEditSelect().removeAttribute("disabled"):ea.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,D,mxUtils.bind(this,function(){c(M.checked,V.checked,Q.checked,ja.checked,ea.getLink(),la.checked)}),+null,mxResources.get("embed"),B);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,t,B,D,I,K){function M(da){var ia=" ",la="";t&&(ia=" 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!=Q?"&page="+Q:"")+(B?"&edit=_blank":"")+(D?"&layers=1":"")+"');}})(this);\"",la+="cursor:pointer;");c&&(la+="max-width:100%;");var ka="";l&&(ka=' width="'+Math.round(V.width)+'" height="'+Math.round(V.height)+'"');I('<img src="'+da+'"'+ka+(""!=la?' style="'+la+'"':"")+ia+"/>")}var V=this.editor.graph.getGraphBounds(),Q=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(da){var ia=t?this.getFileData(!0):null;da=this.createImageDataUri(da,+ia,"png");M(da)}),null,null,null,mxUtils.bind(this,function(da){K({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),V.width*V.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var ja="";l&&(ja="&w="+Math.round(2*V.width)+"&h="+Math.round(2*V.height));var ea=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(t?"1":"0")+ja+"&xml="+encodeURIComponent(g));ea.send(mxUtils.bind(this,function(){200<=ea.getStatus()&&299>=+ea.getStatus()?M("data:image/png;base64,"+ea.getText()):K({message:mxResources.get("unknownError")})}))}else K({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,t,B,D,I){var K=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),M=K.getElementsByTagName("a");if(null!=M)for(var V=0;V<M.length;V++){var Q=M[V].getAttribute("href");null!=Q&&"#"==Q.charAt(0)&&"_blank"==M[V].getAttribute("target")&&M[V].removeAttribute("target")}t&&+K.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(K);if(l){var ja=" ",ea="";t&&(ja="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"+(B?"&edit=_blank":"")+(D?"&layers=1":+"")+"');}})(this);\"",ea+="cursor:pointer;");c&&(ea+="max-width:100%;");this.editor.convertImages(K,mxUtils.bind(this,function(da){I('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(da))+'"'+(""!=ea?' style="'+ea+'"':"")+ja+"/>")}))}else ea="",t&&(g=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!=g?"&page="+g:"")+(B?"&edit=_blank":"")+(D?"&layers=1":"")+"');}}})(this);"),ea+="cursor:pointer;"),c&&(c=parseInt(K.getAttribute("width")),B=parseInt(K.getAttribute("height")),K.setAttribute("viewBox","-0.5 -0.5 "+c+" "+B),ea+="max-width:100%;max-height:"+B+"px;",K.removeAttribute("height")),""!=ea&&K.setAttribute("style",ea),this.editor.addFontCss(K),this.editor.graph.mathEnabled&&this.editor.addMathCss(K),I(mxUtils.getXml(K))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var g=Math.floor(c/31536E3);if(1<g)return g+" "+mxResources.get("years");g=Math.floor(c/2592E3);if(1<g)return g+" "+mxResources.get("months");g=Math.floor(c/86400);if(1<g)return g+" "+mxResources.get("days");g=Math.floor(c/3600);if(1<g)return g+" "+mxResources.get("hours");g=Math.floor(c/60);return 1<g?g+" "+mxResources.get("minutes"):1==g?g+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,g){if(null!=c){var l=null;if("diagram"==c.nodeName)l=c;else if("mxfile"==c.nodeName){var t=c.getElementsByTagName("diagram");if(0<t.length){l=t[0];var B=g.getGlobalVariable;g.getGlobalVariable=function(D){return"page"==D?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==D?1:B.apply(this,arguments)}}}null!=l&&(c=Editor.parseDiagramNode(l))}t=this.editor.graph;try{this.editor.graph=g,this.editor.setGraphXml(c)}catch(D){}finally{this.editor.graph=t}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};EditorUi.prototype.getPngFileProperties=function(c){var g=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var t=parseFloat(c.getAttribute("scale"));!isNaN(t)&&0<t&&(g=t)}c.hasAttribute("border")&&(t=parseInt(c.getAttribute("border")),!isNaN(t)&&0<t&&(l=t))}return{scale:g,border:l}};EditorUi.prototype.getEmbeddedPng=function(c,g,l,t,B){try{var D=this.editor.graph,I=null;if(null!=l&&0<l.length)D=this.createTemporaryGraph(D.getStylesheet()),document.body.appendChild(D.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,-!0),D),I=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){D=this.createTemporaryGraph(D.getStylesheet());var L=D.getGlobalVariable;D.setBackgroundImage=this.editor.graph.setBackgroundImage;var N=this.pages[0];this.currentPage==N?D.setBackgroundImage(this.editor.graph.backgroundImage):null!=N.viewState&&null!=N.viewState&&D.setBackgroundImage(N.viewState.backgroundImage);D.getGlobalVariable=function(K){return"page"==K?N.getName():"pagenumber"==K?1:L.apply(this,arguments)};document.body.appendChild(D.container);-D.model.setRoot(N.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(K){try{null==I&&(I=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var da=K.toDataURL("image/png");da=Editor.writeGraphModelToPng(da,"tEXt","mxfile",encodeURIComponent(I));c(da.substring(da.lastIndexOf(",")+1));D!=this.editor.graph&&D.container.parentNode.removeChild(D.container)}catch(ja){null!=g&&g(ja)}}),null,null,null,mxUtils.bind(this,function(K){null!=g&&g(K)}),null,null,t,null,D.shadowVisible,null,-D,B,null,null,null,"diagram",null)}catch(K){null!=g&&g(K)}};EditorUi.prototype.getEmbeddedSvg=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){L=null!=L?L:!0;da=null!=da?da:0;I=null!=N?N:g.background;I==mxConstants.NONE&&(I=null);null==I&&"none"==g.getAdaptiveColors()&&(I="#ffffff");N=this.editor.graph.createSvgImageExport(null!=c);D=g.getSvg(I,K,da,null,null,D,null,N,null,g.shadowVisible||ja,null,ea,"diagram");(g.shadowVisible||ja)&&g.addSvgShadow(D,null,null,0==da);null!=c&&D.setAttribute("content",c);null!=-l&&D.setAttribute("resource",l);var ca=mxUtils.bind(this,function(fa){fa=(t?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(fa);null!=B&&B(fa);return fa});g.mathEnabled&&this.editor.addMathCss(D);if(null!=B)this.embedFonts(D,mxUtils.bind(this,function(fa){L?this.editor.convertImages(fa,mxUtils.bind(this,function(la){ca(la)})):ca(fa)}));else return ca(D)};EditorUi.prototype.embedFonts=function(c,g){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(l){try{null!=l&&this.editor.addFontCss(c,l),g(c)}catch(t){g(c)}}))}catch(l){g(c)}}))};EditorUi.prototype.exportImage=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){N=null!=N?N:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(fa){Editor.addRetryToError(fa,mxUtils.bind(this,function(){this.exportImage(c,g,l,t,B,D,I,L,N,K,da,ja,-ea)}));this.handleError(fa)}))){var ca=this.editor.graph.isSelectionEmpty();l=null!=l?l:ca;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(fa){this.spinner.stop();try{this.saveCanvas(fa,B?this.getFileData(!0,null,null,null,l,L,null,null,null,null,null,c,D):null,N,null==this.pages||0==this.pages.length,da)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(fa){this.spinner.stop();this.handleError(fa)}),-null,l,c||1,g,t,null,null,D,I,K,ja,ea)}catch(fa){this.spinner.stop(),this.handleError(fa)}}};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 g=0;g<this.pages.length;g++)c[this.pages[g].getId()]=this.pages[g].getId();return c};EditorUi.prototype.importXml=function(c,g,l,t,B,D,I){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[g],"dy",[l],"crop",[t],-"noErrorHandling",[B],"addNewPage",[D],"applyDefaultStyles",[I]);g=null!=g?g:0;l=null!=l?l:0;var L=[];try{if(null!=c&&0<c.length){var N=null!=this.pages?this.pages.length:0,K=this.isDiagramEmpty(),da=this.currentPage,ja=this.editor.graph;ja.model.beginUpdate();try{var ea=mxUtils.parseXml(c);c={};var ca=this.editor.extractGraphModel(ea.documentElement,null!=this.pages);if(null!=ca&&"mxfile"==ca.nodeName&&null!=this.pages){var fa=ca.getElementsByTagName("diagram");if(0<fa.length){ea=[];var la=0;if(1==-fa.length&&!D){if(null!=this.currentPage&&(c[fa[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ka=fa[0].getAttribute("name");null!=ka&&""!=ka&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ka))}ca=Editor.parseDiagramNode(fa[0]);t=!1;la=1}for(;la<fa.length;la++){var V=fa[la].getAttribute("id");fa[la].removeAttribute("id");var k=this.updatePageRoot(new DiagramPage(fa[la]));c[V]=fa[la].getAttribute("id");var x=this.pages.length;null==k.getName()&&k.setName(mxResources.get("pageWithNumber",-[x+1]));ja.model.execute(new ChangePage(this,k,k,x,0<la));ea.push(k)}this.updatePageLinks(c,ea)}}if(null!=ca&&"mxGraphModel"===ca.nodeName){L=ja.importGraphModel(ca,g,l,t);if(null!=L)for(this.addLocalPagesToMapping(c),la=0;la<L.length;la++)this.updatePageLinksForCell(c,L[la]);var J=ja.parseBackgroundImage(ca.getAttribute("backgroundImage"));if(null!=J&&null!=J.originalSrc&&this.updateBackgroundPageLink(c,J)){var R=new ChangePageSetup(this,null,J);R.ignoreColor=!0;ja.model.execute(R)}}I&&ja.pasteCellStyles(ja.includeDescendants(L),-ja.defaultVertexStyle,ja.defaultEdgeStyle);!D&&da!=this.currentPage&&null!=this.pages&&1<this.pages.length&&K&&1==N&&this.removePage(da)}finally{ja.model.endUpdate()}}}catch(Y){if(B)throw Y;this.handleError(Y)}return L};EditorUi.prototype.updatePageLinks=function(c,g){for(var l=0;l<g.length;l++)this.updatePageLinksForCell(c,g[l].root),null!=g[l].viewState&&this.updateBackgroundPageLink(c,g[l].viewState.backgroundImage)&&(g[l]==this.currentPage&&this.editor.graph.setViewState(g[l].viewState,!0),g[l].needsUpdate=-!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,g){var l=!1;try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var t=c[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=t&&(g.originalSrc="data:page/id,"+t,l=!0)}}catch(B){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,g){var l=document.createElement("div"),t=this.editor.graph,B=t.getLinkForCell(g);null!=B&&t.setLinkForCell(g,this.updatePageLink(c,B));if(t.isHtmlLabel(g)){l.innerHTML=Graph.sanitizeHtml(t.getLabel(g));-for(var D=l.getElementsByTagName("a"),I=!1,L=0;L<D.length;L++)B=D[L].getAttribute("href"),null!=B&&(D[L].setAttribute("href",this.updatePageLink(c,B)),I=!0);I&&t.labelChanged(g,l.innerHTML)}for(L=0;L<t.model.getChildCount(g);L++)this.updatePageLinksForCell(c,t.model.getChildAt(g,L))};EditorUi.prototype.updatePageLink=function(c,g){if(Graph.isPageLink(g)){var l=c[g.substring(g.indexOf(",")+1)];g=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==g.substring(0,17))try{var t=JSON.parse(g.substring(17));-if(null!=t.actions){for(var B=0;B<t.actions.length;B++){var D=t.actions[B];if(null!=D.open&&Graph.isPageLink(D.open)){var I=D.open.substring(D.open.indexOf(",")+1);l=c[I];null!=l?D.open="data:page/id,"+l:null==this.getPageById(I)&&delete D.open}}g="data:action/json,"+JSON.stringify(t)}}catch(L){}return g};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,g,l,t,B){var D=mxUtils.bind(this,function(I){this.loadingExtensions=-!1;null!=l?l(I):this.handleError(I)});this.createTimeout(null,mxUtils.bind(this,function(I){t=null!=t?t:c.name;var L=mxUtils.bind(this,function(K){I.clear()&&D(K)}),N=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var K=this.isRemoteVisioFormat(t);try{var da=t.lastIndexOf(".");if(0<=da&&da<t.length)t.substring(da+1).toUpperCase();else{var ja=t.lastIndexOf("/");0<=ja&&ja<t.length&&(t=t.substring(ja+1))}}catch(ca){}if(K)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(t)?-L({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):L({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{K=new FormData;K.append("file1",c,t);var ea=new XMLHttpRequest;ea.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));ea.responseType="blob";this.addRemoteServiceSecurityCheck(ea);null!=B&&ea.setRequestHeader("x-convert-custom",B);ea.onreadystatechange=mxUtils.bind(this,function(){if(4==-ea.readyState&&I.clear())if(200<=ea.status&&299>=ea.status)try{var ca=ea.response;if("text/xml"==ca.type){var fa=new FileReader;fa.onload=mxUtils.bind(this,function(la){try{g(la.target.result)}catch(ka){L({message:mxResources.get("errorLoadingFile")})}});fa.readAsText(ca)}else this.doImportVisio(ca,g,L,t)}catch(la){L(la)}else try{""==ea.responseType||"text"==ea.responseType?L({message:ea.responseText}):(fa=new FileReader,fa.onload=function(){try{L({message:JSON.parse(fa.result).Message})}catch(la){null!=-fa.result&&0<fa.result.length?L({message:fa.result}):L(la)}},fa.readAsText(ea.response))}catch(la){L({})}});ea.send(K)}else if(I.clear())try{this.doImportVisio(c,g,L,t)}catch(ca){L(ca)}}else L({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?N():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",N,null,null,null,L))}),D)};EditorUi.prototype.importGraphML=function(c,g,l){var t=mxUtils.bind(this,-function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){var D=mxUtils.bind(this,function(L){B.clear()&&t(L)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(B.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,g,t)}catch(L){D(L)}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?I():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL++!0),D),I=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){D=this.createTemporaryGraph(D.getStylesheet());var K=D.getGlobalVariable;D.setBackgroundImage=this.editor.graph.setBackgroundImage;var M=this.pages[0];this.currentPage==M?D.setBackgroundImage(this.editor.graph.backgroundImage):null!=M.viewState&&null!=M.viewState&&D.setBackgroundImage(M.viewState.backgroundImage);D.getGlobalVariable=function(V){return"page"==V?M.getName():"pagenumber"==V?1:K.apply(this,arguments)};document.body.appendChild(D.container);+D.model.setRoot(M.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{null==I&&(I=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var Q=V.toDataURL("image/png");Q=Editor.writeGraphModelToPng(Q,"tEXt","mxfile",encodeURIComponent(I));c(Q.substring(Q.lastIndexOf(",")+1));D!=this.editor.graph&&D.container.parentNode.removeChild(D.container)}catch(ja){null!=g&&g(ja)}}),null,null,null,mxUtils.bind(this,function(V){null!=g&&g(V)}),null,null,t,null,D.shadowVisible,null,D,B,+null,null,null,"diagram",null)}catch(V){null!=g&&g(V)}};EditorUi.prototype.getEmbeddedSvg=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){K=null!=K?K:!0;Q=null!=Q?Q:0;I=null!=M?M:g.background;I==mxConstants.NONE&&(I=null);null==I&&"none"==g.getAdaptiveColors()&&(I="#ffffff");M=this.editor.graph.createSvgImageExport(null!=c);D=g.getSvg(I,V,Q,null,null,D,null,M,null,g.shadowVisible||ja,null,ea,"diagram");(g.shadowVisible||ja)&&g.addSvgShadow(D,null,null,0==Q);null!=c&&D.setAttribute("content",c);null!=l&&D.setAttribute("resource",+l);var da=mxUtils.bind(this,function(ia){ia=(t?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(ia);null!=B&&B(ia);return ia});g.mathEnabled&&this.editor.addMathCss(D);if(null!=B)this.embedFonts(D,mxUtils.bind(this,function(ia){K?this.editor.convertImages(ia,mxUtils.bind(this,function(la){da(la)})):da(ia)}));else return da(D)};EditorUi.prototype.embedFonts=function(c,g){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(l){try{null!=l&&this.editor.addFontCss(c,l),g(c)}catch(t){g(c)}}))}catch(l){g(c)}}))};EditorUi.prototype.exportImage=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){M=null!=M?M:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ia){Editor.addRetryToError(ia,mxUtils.bind(this,function(){this.exportImage(c,g,l,t,B,D,I,K,M,V,Q,ja,ea)}));this.handleError(ia)}))){var da=+this.editor.graph.isSelectionEmpty();l=null!=l?l:da;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ia){this.spinner.stop();try{this.saveCanvas(ia,B?this.getFileData(!0,null,null,null,l,K,null,null,null,null,null,c,D):null,M,null==this.pages||0==this.pages.length,Q)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ia){this.spinner.stop();this.handleError(ia)}),null,l,c||1,g,t,null,null,D,I,V,+ja,ea)}catch(ia){this.spinner.stop(),this.handleError(ia)}}};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 g=0;g<this.pages.length;g++)c[this.pages[g].getId()]=this.pages[g].getId();return c};EditorUi.prototype.importXml=function(c,g,l,t,B,D,I){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[g],"dy",[l],"crop",[t],"noErrorHandling",[B],"addNewPage",+[D],"applyDefaultStyles",[I]);g=null!=g?g:0;l=null!=l?l:0;var K=[];try{if(null!=c&&0<c.length){var M=null!=this.pages?this.pages.length:0,V=this.isDiagramEmpty(),Q=this.currentPage,ja=this.editor.graph;ja.model.beginUpdate();try{var ea=mxUtils.parseXml(c);c={};var da=this.editor.extractGraphModel(ea.documentElement,null!=this.pages);if(null!=da&&"mxfile"==da.nodeName&&null!=this.pages){var ia=da.getElementsByTagName("diagram");if(0<ia.length){ea=[];var la=0;if(1==ia.length&&!D){if(null!=this.currentPage&&+(c[ia[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ka=ia[0].getAttribute("name");null!=ka&&""!=ka&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ka))}da=Editor.parseDiagramNode(ia[0]);t=!1;la=1}for(;la<ia.length;la++){var W=ia[la].getAttribute("id");ia[la].removeAttribute("id");var k=this.updatePageRoot(new DiagramPage(ia[la]));c[W]=ia[la].getAttribute("id");var y=this.pages.length;null==k.getName()&&k.setName(mxResources.get("pageWithNumber",[y++1]));ja.model.execute(new ChangePage(this,k,k,y,0<la));ea.push(k)}this.updatePageLinks(c,ea)}}if(null!=da&&"mxGraphModel"===da.nodeName){K=ja.importGraphModel(da,g,l,t);if(null!=K)for(this.addLocalPagesToMapping(c),la=0;la<K.length;la++)this.updatePageLinksForCell(c,K[la]);var J=ja.parseBackgroundImage(da.getAttribute("backgroundImage"));if(null!=J&&null!=J.originalSrc&&this.updateBackgroundPageLink(c,J)){var R=new ChangePageSetup(this,null,J);R.ignoreColor=!0;ja.model.execute(R)}}I&&ja.pasteCellStyles(ja.includeDescendants(K),+ja.defaultVertexStyle,ja.defaultEdgeStyle);!D&&Q!=this.currentPage&&null!=this.pages&&1<this.pages.length&&V&&1==M&&this.removePage(Q)}finally{ja.model.endUpdate()}}}catch(X){if(B)throw X;this.handleError(X)}return K};EditorUi.prototype.updatePageLinks=function(c,g){for(var l=0;l<g.length;l++)this.updatePageLinksForCell(c,g[l].root),g[l]!=this.currentPage&&(g[l].needsUpdate=!0),null!=g[l].viewState&&this.updateBackgroundPageLink(c,g[l].viewState.backgroundImage)&&(g[l]==this.currentPage&&this.editor.graph.setViewState(g[l].viewState,+!0),g[l].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,g){var l=!1;try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var t=c[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=t&&(g.originalSrc="data:page/id,"+t,l=!0)}}catch(B){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,g){var l=document.createElement("div"),t=this.editor.graph,B=t.getLinkForCell(g);null!=B&&t.setLinkForCell(g,this.updatePageLink(c,B));if(t.isHtmlLabel(g)){l.innerHTML=Graph.sanitizeHtml(t.getLabel(g));+for(var D=l.getElementsByTagName("a"),I=!1,K=0;K<D.length;K++)B=D[K].getAttribute("href"),null!=B&&(D[K].setAttribute("href",this.updatePageLink(c,B)),I=!0);I&&t.labelChanged(g,l.innerHTML)}for(K=0;K<t.model.getChildCount(g);K++)this.updatePageLinksForCell(c,t.model.getChildAt(g,K))};EditorUi.prototype.updatePageLink=function(c,g){if(Graph.isPageLink(g)){var l=c[g.substring(g.indexOf(",")+1)];g=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==g.substring(0,17))try{var t=JSON.parse(g.substring(17));+if(null!=t.actions){for(var B=0;B<t.actions.length;B++){var D=t.actions[B];if(null!=D.open&&Graph.isPageLink(D.open)){var I=D.open.substring(D.open.indexOf(",")+1);l=c[I];null!=l?D.open="data:page/id,"+l:null==this.getPageById(I)&&delete D.open}}g="data:action/json,"+JSON.stringify(t)}}catch(K){}return g};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,g,l,t,B){var D=mxUtils.bind(this,function(I){this.loadingExtensions=+!1;null!=l?l(I):this.handleError(I)});this.createTimeout(null,mxUtils.bind(this,function(I){t=null!=t?t:c.name;var K=mxUtils.bind(this,function(V){I.clear()&&D(V)}),M=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var V=this.isRemoteVisioFormat(t);try{var Q=t.lastIndexOf(".");if(0<=Q&&Q<t.length)t.substring(Q+1).toUpperCase();else{var ja=t.lastIndexOf("/");0<=ja&&ja<t.length&&(t=t.substring(ja+1))}}catch(da){}if(V)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(t)?+K({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):K({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{V=new FormData;V.append("file1",c,t);var ea=new XMLHttpRequest;ea.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));ea.responseType="blob";this.addRemoteServiceSecurityCheck(ea);null!=B&&ea.setRequestHeader("x-convert-custom",B);ea.onreadystatechange=mxUtils.bind(this,function(){if(4==+ea.readyState&&I.clear())if(200<=ea.status&&299>=ea.status)try{var da=ea.response;if("text/xml"==da.type){var ia=new FileReader;ia.onload=mxUtils.bind(this,function(la){try{g(la.target.result)}catch(ka){K({message:mxResources.get("errorLoadingFile")})}});ia.readAsText(da)}else this.doImportVisio(da,g,K,t)}catch(la){K(la)}else try{""==ea.responseType||"text"==ea.responseType?K({message:ea.responseText}):(ia=new FileReader,ia.onload=function(){try{K({message:JSON.parse(ia.result).Message})}catch(la){null!=+ia.result&&0<ia.result.length?K({message:ia.result}):K(la)}},ia.readAsText(ea.response))}catch(la){K({})}});ea.send(V)}else if(I.clear())try{this.doImportVisio(c,g,K,t)}catch(da){K(da)}}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))}),D)};EditorUi.prototype.importGraphML=function(c,g,l){var t=mxUtils.bind(this,+function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){var D=mxUtils.bind(this,function(K){B.clear()&&t(K)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(B.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,g,t)}catch(K){D(K)}else D({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,D))}),t)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var g=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(D){l.clear()&&g(D)}),B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(l.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||t({message:mxResources.get("unknownError")})}catch(D){t(D)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(B,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,t))}),g):g({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,g,l){var t=-mxUtils.bind(this,function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){var D=mxUtils.bind(this,function(L){B.clear()&&t(L)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(B.clear())if("undefined"!==typeof window.LucidImporter)try{var L=JSON.parse(c);g(LucidImporter.importState(L));try{if(null!=window.console&&"1"==urlParams.test){var N=[(new Date).toISOString(),"convertLucidChart",L];null!=L.state&&N.push(JSON.parse(L.state));-if(null!=L.svgThumbs)for(var K=0;K<L.svgThumbs.length;K++)N.push(Editor.createSvgDataUri(L.svgThumbs[K]));null!=L.thumb&&N.push(L.thumb);console.log.apply(console,N)}}catch(da){}}catch(da){null!=window.console&&console.error(da),D(da)}else D({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",+mxUtils.bind(this,function(B){this.loadingExtensions=!1;null!=l?l(B):this.handleError(B)});this.createTimeout(null,mxUtils.bind(this,function(B){var D=mxUtils.bind(this,function(K){B.clear()&&t(K)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(B.clear())if("undefined"!==typeof window.LucidImporter)try{var K=JSON.parse(c);g(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 V=0;V<K.svgThumbs.length;V++)M.push(Editor.createSvgDataUri(K.svgThumbs[V]));null!=K.thumb&&M.push(K.thumb);console.log.apply(console,M)}}catch(Q){}}catch(Q){null!=window.console&&console.error(Q),D(Q)}else D({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,D)},null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,D))}),t)};EditorUi.prototype.createMermaidXml=function(c,g,l,t,B,D){var I=new Graph(document.createElement("div"));l=I.insertVertex(null,null,null,0,0,t,B,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+l+";");I.setAttributeForCell(l,"mermaidData",JSON.stringify({data:c,config:g},null,2));null!=D&&I.setAttributeForCell(l,"templatePrompt",D);c=(new mxCodec).encode(I.getModel());return mxUtils.getXml(c)};EditorUi.prototype.getSvgForXml=function(c){var g=null,l=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(l.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,l.getModel()),g=l.getSvg(null,null,null,null,null,null,null,-null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(l.container)}return g};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,g,l,t,B){var D=0,I=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(L){var N="";if(null!=this.drive&&null!=this.drive.getUser()){var K=this.drive.getUser();null!=K.email&&0<K.email.indexOf("@")&&(N=K.email.substring(K.email.indexOf("@")+1))}var da={prompt:c,driveDomain:N,options:null!=B?B:-{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",t,"data",[da],"url",["https://www.draw.io/generate/v3"]);var ja=Date.now();N=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(da),"POST");var ea=mxUtils.bind(this,function(fa){L.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[da],"error",[fa],"time",Date.now()-ja+" ms"),l(fa))}),ca=mxUtils.bind(this,function(fa){3>D++?L.clear()&&I():ea(fa)});N.send(mxUtils.bind(this,function(fa){if(L.isAlive())if(200<=-fa.getStatus()&&299>=fa.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ka=fa.getText();try{ka=JSON.parse(ka),result=ka.result}catch(V){result=ka}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[da],"response",[ka],"time",Date.now()-ja+" ms");t?"<"==result.charAt(0)?L.clear()&&(ka=Editor.extractGraphModelFromText(result),g(null!=ka&&3==ka.length?ka[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(V){this.tryAndHandle(mxUtils.bind(this,-function(){L.clear()&&g(V)}),ea)}),ea,ca,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(V,k,x){this.tryAndHandle(mxUtils.bind(this,function(){L.clear()&&g(result,V,k,x)}),ea)}),ea,ca)}),ea,!0);else{var la={message:mxResources.get("error")+" "+fa.getStatus()};try{la=JSON.parse(fa.getText()),null!=la.error&&(la.message=la.error)}catch(ka){}ea(la)}}),ea)}),l)});I()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));+null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(l.container)}return g};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,g,l,t,B){var D=0,I=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(K){var M="";if(null!=this.drive&&null!=this.drive.getUser()){var V=this.drive.getUser();null!=V.email&&0<V.email.indexOf("@")&&(M=V.email.substring(V.email.indexOf("@")+1))}var Q={prompt:c,driveDomain:M,options:null!=B?B:+{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",t,"data",[Q],"url",["https://www.draw.io/generate/v3"]);var ja=Date.now();M=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(Q),"POST");var ea=mxUtils.bind(this,function(ia){K.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[Q],"error",[ia],"time",Date.now()-ja+" ms"),l(ia))}),da=mxUtils.bind(this,function(ia){3>D++?K.clear()&&I():ea(ia)});M.send(mxUtils.bind(this,function(ia){if(K.isAlive())if(200<=+ia.getStatus()&&299>=ia.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ka=ia.getText();try{ka=JSON.parse(ka),result=ka.result}catch(W){result=ka}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[Q],"response",[ka],"time",Date.now()-ja+" ms");t?"<"==result.charAt(0)?K.clear()&&(ka=Editor.extractGraphModelFromText(result),g(null!=ka&&3==ka.length?ka[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(W){this.tryAndHandle(mxUtils.bind(this,+function(){K.clear()&&g(W)}),ea)}),ea,da,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(W,k,y){this.tryAndHandle(mxUtils.bind(this,function(){K.clear()&&g(result,W,k,y)}),ea)}),ea,da)}),ea,!0);else{var la={message:mxResources.get("error")+" "+ia.getStatus()};try{la=JSON.parse(ia.getText()),null!=la.error&&(la.message=la.error)}catch(ka){}ea(la)}}),ea)}),l)});I()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var g=c.split("```");g=1<g.length?g:c.split("<pre>");g=1<g.length?g:c.split("~~~");g=1<g.length?g:c.split("(Begins)");for(var l=mxUtils.trim(1>=g.length?c:g[1]),t=l.split("\n"),B=0;B<t.length&&("mermaid"==t[B]||0==t[B].trim().length||"%%"==t[B].substring(0,2));)B++;l=[];for(var D=B;D<t.length;D++){var I=mxUtils.trim(t[D]);if("%%"!=I.substring(0,2)&&"classDef "!=I.substring(0,9))l.push(t[D]);else if("mermaid"==I)break}t=l;l=mxUtils.trim(t.join("\n"));D=1<t.length?t[0]:null;null!=D&&(I=D.indexOf("-"),0<I&&D.substring(0,I));D=t[0].split(" ")[0].replace(/:$/,"");I=D.indexOf("-");0<I&&(D=D.substring(0,I));EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[l],"type",[D],"startLine",B,"lines",t,"tokens",g);0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,D)&&(l=null);return l};EditorUi.prototype.isSupportedMermaidDiagramType=function(c){return"graph"==c||"flowchart"==c||"sequencediagram"==c||"classdiagram"==c||"statediagram-v2"==c||"statediagram"==c||"erdiagram"==c||"requirementdiagram"==c||"gitgraph"==c||"mindmap"==c||"journey"==c};EditorUi.prototype.getMermaidDiagramType=function(c){c=c.split("\n");for(var g=0;g<c.length&&(0==c[g].trim().length||"%%"==c[g].substring(0,2));)g++;if("---"==c[g].trim()){do g++;while(g<c.length&&"---"!=c[g].trim());g++}c=c[g].trim().toLowerCase();g=c.indexOf(" ");return c.substring(0,0<g?g:c.length)};EditorUi.prototype.parseMermaidDiagram=function(c,g,l,t,B,D){var I=!1;D&&"undefined"!==typeof mxMermaidToDrawio&&this.isSupportedMermaidDiagramType(this.getMermaidDiagramType(c))&&-mxMermaidToDrawio.addListener(mxUtils.bind(this,function(L){I||L==this.emptyDiagramXml||(I=!0,l(L))}));this.generateMermaidImage(c,g,mxUtils.bind(this,function(L,N,K){I||(I=!0,l(this.createMermaidXml(c,g,L,N,K)))}),t,B)};EditorUi.prototype.loadMermaid=function(c,g){var l=mxUtils.bind(this,function(B){this.loadingMermaid=!1;g(B)}),t=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(B){l(B)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(t,+mxMermaidToDrawio.addListener(mxUtils.bind(this,function(K){I||K==this.emptyDiagramXml||(I=!0,l(K))}));this.generateMermaidImage(c,g,mxUtils.bind(this,function(K,M,V){I||(I=!0,l(this.createMermaidXml(c,g,K,M,V)))}),t,B)};EditorUi.prototype.loadMermaid=function(c,g){var l=mxUtils.bind(this,function(B){this.loadingMermaid=!1;g(B)}),t=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(B){l(B)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(t,0):(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",t,null,null,null,l):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,l))};EditorUi.prototype.mermaidSvgToDataUri=function(c,g,l,t){try{c=c.replace(/xlink:href/g,"href").replace(/<br>/g,"<br/>");var B=mxUtils.parseXml(c).getElementsByTagName("svg");if(0<B.length&&"error"!=B[0].getAttribute("aria-roledescription")){var D=parseFloat(B[0].getAttribute("width")),I=parseFloat(B[0].getAttribute("height"));-if(isNaN(D)||isNaN(I))try{var L=B[0].getAttribute("viewBox").split(/\s+/);D=parseFloat(L[2]);I=parseFloat(L[3])}catch(N){D=D||100,I=I||100}g(this.convertDataUri(Editor.createSvgDataUri(c)),D,I)}else null!=t?t():l({message:mxResources.get("invalidInput")})}catch(N){l(N)}};EditorUi.prototype.getMermaidConfig=function(c,g){g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=c.indexOf("$$")&&+if(isNaN(D)||isNaN(I))try{var K=B[0].getAttribute("viewBox").split(/\s+/);D=parseFloat(K[2]);I=parseFloat(K[3])}catch(M){D=D||100,I=I||100}g(this.convertDataUri(Editor.createSvgDataUri(c)),D,I)}else null!=t?t():l({message:mxResources.get("invalidInput")})}catch(M){l(M)}};EditorUi.prototype.getMermaidConfig=function(c,g){g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=c.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme="dark");return g};EditorUi.prototype.generateMermaidImage=function(c,g,l,t,B){var D=mxUtils.bind(this,function(I){null!=t?t(I):this.handleError(I)});this.loadMermaid(mxUtils.bind(this,function(){try{mermaid.mermaidAPI.initialize(this.getMermaidConfig(c,g)),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(mxUtils.bind(this,function(I){this.mermaidSvgToDataUri(I.svg,l,t,B)})).catch(mxUtils.bind(this,-function(I){this.removeMermaidErrors();I=Error(I.toString()+"\n\n"+c);"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();null!=B?B(I):D(I)}))}catch(I){D(I)}}),D)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),g=0;g<c.length;g++)null!=c[g].parentNode&&c[g].parentNode.removeChild(c[g])};EditorUi.prototype.generatePlantUmlImage=function(c,g,l,t){function B(L,N,K){c1=L>>2;c2=(L&3)<<4|N>>4;c3=(N&15)<<2|K>>6;-c4=K&63;r="";r+=D(c1&63);r+=D(c2&63);r+=D(c3&63);return r+=D(c4&63)}function D(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"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(L){r="";for(i=0;i<L.length;i+=3)r=i+2==L.length?r+B(L.charCodeAt(i),L.charCodeAt(i+1),0):i+1==L.length?r+B(L.charCodeAt(i),0,0):-r+B(L.charCodeAt(i),L.charCodeAt(i+1),L.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=g&&(I.responseType="blob");I.onload=function(L){if(200<=this.status&&300>this.status)if("txt"==g)l(this.response);else{var N=new FileReader;N.readAsDataURL(this.response);N.onloadend=function(K){var da=new Image;da.onload=function(){try{var ja=da.width,ea=da.height;if(0==ja&&0==ea){var ca=N.result,fa=ca.indexOf(","),la=decodeURIComponent(escape(atob(ca.substring(fa+1)))),ka=-mxUtils.parseXml(la).getElementsByTagName("svg");0<ka.length&&(ja=parseFloat(ka[0].getAttribute("width")),ea=parseFloat(ka[0].getAttribute("height")))}l(N.result,ja,ea)}catch(V){t(V)}};da.src=N.result};N.onerror=function(K){t(K)}}else t(L)};I.onerror=function(L){t(L)};I.send()};EditorUi.prototype.insertAsPreText=function(c,g,l){var t=this.editor.graph,B=null;t.getModel().beginUpdate();try{B=t.insertVertex(null,null,"<pre>"+c+"</pre>",g,l,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(B,-!0)}finally{t.getModel().endUpdate()}return B};EditorUi.prototype.insertTextAt=function(c,g,l,t,B,D,I,L){D=null!=D?D:!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(ea){4==ea.readyState&&200<=ea.status&&299>=ea.status&&this.editor.graph.setSelectionCells(this.insertTextAt(ea.responseText,-g,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(B||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var N=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var K=Editor.extractGraphModelFromPdf(c);if(null!=K&&0<K.length)return this.importXml(K,g,l,D,!0,L)}if(Editor.isPngDataUrl(c)&&(K=Editor.extractGraphModelFromPng(c),null!=K&&0<K.length))return this.importXml(K,g,l,D,!0,L);if("data:image/svg+xml;"==c.substring(0,19))try{K=null;"data:image/svg+xml;base64,"==c.substring(0,-26)?(K=c.substring(c.indexOf(",")+1),K=window.atob&&!mxClient.IS_SF?atob(K):Base64.decode(K,!0)):K=decodeURIComponent(c.substring(c.indexOf(",")+1));var da=this.importXml(K,g,l,D,!0,L);if(0<da.length)return da}catch(ea){}this.loadImage(c,mxUtils.bind(this,function(ea){if("data:"==c.substring(0,5))this.resizeImage(ea,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(la,ka,V){N.setSelectionCell(N.insertVertex(null,null,"",N.snap(g),N.snap(l),ka,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+-this.convertDataUri(la)+";"))}),I,this.maxImageSize);else{var ca=Math.min(1,Math.min(this.maxImageSize/ea.width,this.maxImageSize/ea.height)),fa=Math.round(ea.width*ca);ea=Math.round(ea.height*ca);N.setSelectionCell(N.insertVertex(null,null,"",N.snap(g),N.snap(l),fa,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var ea=null;N.getModel().beginUpdate();try{ea=N.insertVertex(N.getDefaultParent(),-null,c,N.snap(g),N.snap(l),1,1,"text;"+(t?"html=1;":"")),N.updateCellSize(ea),N.fireEvent(new mxEventObject("textInserted","cells",[ea]))}finally{N.getModel().endUpdate()}N.setSelectionCell(ea)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,g,l,D,null,L);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(ea){this.editor.graph.setSelectionCells(this.importXml(ea,g,l,D,null,L))}),mxUtils.bind(this,function(ea){this.handleError(ea)}));-else{N=this.editor.graph;B=null;N.getModel().beginUpdate();try{B=N.insertVertex(N.getDefaultParent(),null,"",N.snap(g),N.snap(l),1,1,"text;whiteSpace=wrap;"+(t?"html=1;":""));N.fireEvent(new mxEventObject("textInserted","cells",[B]));t&&(c=N.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");B.value=c;N.updateCellSize(B);if(0<this.maxTextWidth&&B.geometry.width>this.maxTextWidth){var ja=N.getPreferredSizeForCell(B,this.maxTextWidth);B.geometry.width=ja.width;B.geometry.height=-ja.height}Graph.isLink(B.value)&&N.setLinkForCell(B,B.value);B.geometry.width+=N.gridSize;B.geometry.height+=N.gridSize}finally{N.getModel().endUpdate()}return[B]}}return[]};EditorUi.prototype.formatFileSize=function(c){var g=-1;do c/=1024,g++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var g=c.indexOf(";");0<g&&(c=c.substring(0,g)+c.substring(c.indexOf(",",g+1)))}return c};+function(I){this.removeMermaidErrors();I=Error(I.toString()+"\n\n"+c);"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();null!=B?B(I):D(I)}))}catch(I){D(I)}}),D)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),g=0;g<c.length;g++)null!=c[g].parentNode&&c[g].parentNode.removeChild(c[g])};EditorUi.prototype.generatePlantUmlImage=function(c,g,l,t){function B(K,M,V){c1=K>>2;c2=(K&3)<<4|M>>4;c3=(M&15)<<2|V>>6;+c4=V&63;r="";r+=D(c1&63);r+=D(c2&63);r+=D(c3&63);return r+=D(c4&63)}function D(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 I=new XMLHttpRequest;I.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(K){r="";for(i=0;i<K.length;i+=3)r=i+2==K.length?r+B(K.charCodeAt(i),K.charCodeAt(i+1),0):i+1==K.length?r+B(K.charCodeAt(i),0,0):+r+B(K.charCodeAt(i),K.charCodeAt(i+1),K.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=g&&(I.responseType="blob");I.onload=function(K){if(200<=this.status&&300>this.status)if("txt"==g)l(this.response);else{var M=new FileReader;M.readAsDataURL(this.response);M.onloadend=function(V){var Q=new Image;Q.onload=function(){try{var ja=Q.width,ea=Q.height;if(0==ja&&0==ea){var da=M.result,ia=da.indexOf(","),la=decodeURIComponent(escape(atob(da.substring(ia+1)))),ka=mxUtils.parseXml(la).getElementsByTagName("svg");+0<ka.length&&(ja=parseFloat(ka[0].getAttribute("width")),ea=parseFloat(ka[0].getAttribute("height")))}l(M.result,ja,ea)}catch(W){t(W)}};Q.src=M.result};M.onerror=function(V){t(V)}}else t(K)};I.onerror=function(K){t(K)};I.send()};EditorUi.prototype.insertAsPreText=function(c,g,l){var t=this.editor.graph,B=null;t.getModel().beginUpdate();try{B=t.insertVertex(null,null,"<pre>"+c+"</pre>",g,l,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(B,!0)}finally{t.getModel().endUpdate()}return B};+EditorUi.prototype.insertTextAt=function(c,g,l,t,B,D,I,K){D=null!=D?D:!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(ea){4==ea.readyState&&200<=ea.status&&299>=ea.status&&this.editor.graph.setSelectionCells(this.insertTextAt(ea.responseText,g,l,!0))}));else if("data:"==c.substring(0,+5)||!this.isOffline()&&(B||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var M=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var V=Editor.extractGraphModelFromPdf(c);if(null!=V&&0<V.length)return this.importXml(V,g,l,D,!0,K)}if(Editor.isPngDataUrl(c)&&(V=Editor.extractGraphModelFromPng(c),null!=V&&0<V.length))return this.importXml(V,g,l,D,!0,K);if("data:image/svg+xml;"==c.substring(0,19))try{V=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(V=c.substring(c.indexOf(",")++1),V=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V,!0)):V=decodeURIComponent(c.substring(c.indexOf(",")+1));var Q=this.importXml(V,g,l,D,!0,K);if(0<Q.length)return Q}catch(ea){}this.loadImage(c,mxUtils.bind(this,function(ea){if("data:"==c.substring(0,5))this.resizeImage(ea,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(la,ka,W){M.setSelectionCell(M.insertVertex(null,null,"",M.snap(g),M.snap(l),ka,W,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="++this.convertDataUri(la)+";"))}),I,this.maxImageSize);else{var da=Math.min(1,Math.min(this.maxImageSize/ea.width,this.maxImageSize/ea.height)),ia=Math.round(ea.width*da);ea=Math.round(ea.height*da);M.setSelectionCell(M.insertVertex(null,null,"",M.snap(g),M.snap(l),ia,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var ea=null;M.getModel().beginUpdate();try{ea=M.insertVertex(M.getDefaultParent(),+null,c,M.snap(g),M.snap(l),1,1,"text;"+(t?"html=1;":"")),M.updateCellSize(ea),M.fireEvent(new mxEventObject("textInserted","cells",[ea]))}finally{M.getModel().endUpdate()}M.setSelectionCell(ea)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,g,l,D,null,K);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(ea){this.editor.graph.setSelectionCells(this.importXml(ea,g,l,D,null,K))}),mxUtils.bind(this,function(ea){this.handleError(ea)}));+else{M=this.editor.graph;B=null;M.getModel().beginUpdate();try{B=M.insertVertex(M.getDefaultParent(),null,"",M.snap(g),M.snap(l),1,1,"text;whiteSpace=wrap;"+(t?"html=1;":""));M.fireEvent(new mxEventObject("textInserted","cells",[B]));t&&(c=M.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");B.value=c;M.updateCellSize(B);if(0<this.maxTextWidth&&B.geometry.width>this.maxTextWidth){var ja=M.getPreferredSizeForCell(B,this.maxTextWidth);B.geometry.width=ja.width;B.geometry.height=+ja.height}Graph.isLink(B.value)&&M.setLinkForCell(B,B.value);B.geometry.width+=M.gridSize;B.geometry.height+=M.gridSize}finally{M.getModel().endUpdate()}return[B]}}return[]};EditorUi.prototype.formatFileSize=function(c){var g=-1;do c/=1024,g++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var g=c.indexOf(";");0<g&&(c=c.substring(0,g)+c.substring(c.indexOf(",",g+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,g){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,g){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var l=document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=-l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!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,N){StorageFile.getFileContent(this,I,L,N)});window.deleteBrowserFile=mxUtils.bind(this,function(I,-L,N){StorageFile.deleteFile(this,I,L,N)});if(!g){var t=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(N){this.importXml(N,0,0,!0)}),null,L)):this.editor.graph.setSelectionCells(this.importXml(I,0,0,!0))}));+l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(I,K){StorageFile.listFiles(this,"F",I,K)});window.openBrowserFile=mxUtils.bind(this,function(I,K,M){StorageFile.getFileContent(this,I,K,M)});window.deleteBrowserFile=mxUtils.bind(this,function(I,+K,M){StorageFile.deleteFile(this,I,K,M)});if(!g){var t=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,K){null!=K&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(K)?(I=new Blob([I],{type:"application/octet-stream"}),this.importVisio(I,mxUtils.bind(this,function(M){this.importXml(M,0,0,!0)}),null,K)):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(!g){var B=this.dialog,D=B.close;this.dialog.close=mxUtils.bind(this,function(I){Editor.useLocalStorage=t;D.apply(B,arguments);I&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,g,l){var t=this,B=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?-JSZip.loadAsync(c).then(function(D){if(mxUtils.isEmptyObject(D.files))l();else{var I=0,L,N=!1;D.forEach(function(K,da){K=da.name.toLowerCase();"diagram/diagram.xml"==K?(N=!0,da.async("string").then(function(ja){0==ja.indexOf("<mxfile ")?g(ja):l()})):0==K.indexOf("versions/")&&(K=parseInt(K.substr(9)),K>I&&(I=K,L=da))});0<I?L.async("string").then(function(K){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(K,c.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),-null,l):t.parseFileData(K,mxUtils.bind(this,function(da){4==da.readyState&&(200<=da.status&&299>=da.status?g(da.responseText):l())}),c.name):l()}):N||l()}},function(D){l(D)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?B():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,l))};EditorUi.prototype.importFile=function(c,g,l,t,B,D,I,L,N,K,da,ja){K=null!=K?K:!0;var ea=!1,ca=null,fa=mxUtils.bind(this,function(la){var ka=-null;null!=la&&"<mxlibrary"==la.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,la,I)),this.showSidebar()):ka=this.importXml(la,l,t,K,null,null!=ja?mxEvent.isControlDown(ja):null);null!=L&&L(ka)});"image"==g.substring(0,5)?(N=!1,"image/png"==g.substring(0,9)&&(da=da?null:this.extractGraphModelFromPng(c),null!=da&&0<da.length&&(ca=this.importXml(da,l,t,K,null,null!=ja?mxEvent.isControlDown(ja):null),N=!0)),N||(N=this.editor.graph,da=c.indexOf(";"),0<da&&(c=c.substring(0,da)+c.substring(c.indexOf(",",-da+1))),K&&N.isGridEnabled()&&(l=N.snap(l),t=N.snap(t)),da="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==g.substring(0,9)&&(da+="editableCssRules=.*;"),ca=[N.insertVertex(null,null,"",l,t,B,D,da+"image="+c+";")])):/(\.*<graphml )/.test(c)?(ea=!0,this.importGraphML(c,fa)):null!=N&&null!=I&&EditorUi.isVisioFilename(I)?(ea=!0,this.importVisio(N,fa)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,I)?this.isOffline()?-this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(ea=!0,g=mxUtils.bind(this,function(la){4==la.readyState&&(200<=la.status&&299>=la.status?fa(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,g,I):this.parseFile(N,g,I)):0==c.indexOf("PK")&&null!=N?(ea=!0,this.importZipFile(N,fa,mxUtils.bind(this,function(){ca=this.insertTextAt(this.validateFileData(c),-l,t,!0,null,K);L(ca)}))):/(\.v(sd|dx))($|\?)/i.test(I)||/(\.vs(s|x))($|\?)/i.test(I)||(ca=this.insertTextAt(this.validateFileData(c),l,t,!0,null,K,null,null!=ja?mxEvent.isControlDown(ja):null));ea||null==L||L(ca);return ca};EditorUi.prototype.importFiles=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea){t=null!=t?t:this.maxImageSize;K=null!=K?K:this.maxImageBytes;var ca=null!=g&&null!=l,fa=!0;g=null!=g?g:0;l=null!=l?l:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ka=da||this.resampleThreshold,V=0;V<-c.length;V++)if("image/svg"!==c[V].type.substring(0,9)&&"image/"===c[V].type.substring(0,6)&&c[V].size>ka){la=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[g],"y",[l],"maxSize",[t],"maxBytes",[K],"resampleThreshold",[this.resampleThreshold],"largeImages",[la],"crop",[ca],"resizeImages",[fa],"ignoreEmbeddedXml",[ja],"evt",[ea]);var k=mxUtils.bind(this,function(){var x=this.editor.graph,J=x.gridSize;B=null!=B?B:mxUtils.bind(this,function(ia,na,qa,ta,ua,Ba,za,Aa,Ga){try{if(null!=-ia&&"<mxlibrary"==ia.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ia,za)),this.showSidebar(),null;this.isCompatibleString(ia)&&1==c.length&&null!=ea&&"drop"==ea.type&&this.isBlankFile()&&!this.canUndo()&&(ca=!1,ta=qa=0);return this.importFile(ia,na,qa,ta,ua,Ba,za,Aa,Ga,ca,ja,ea)}catch(Ra){return this.handleError(Ra),null}});D=null!=D?D:mxUtils.bind(this,function(ia){x.setSelectionCells(ia)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var R=-this.currentPage,Y=c.length,Z=Y,W=[],U=mxUtils.bind(this,function(ia,na){W[ia]=na;if(0==--Z){this.spinner.stop();if(null!=L)L(W);else{var qa=[];x.getModel().beginUpdate();try{for(ia=0;ia<W.length;ia++){var ta=W[ia]();null!=ta&&(qa=qa.concat(ta))}}finally{x.getModel().endUpdate()}}R!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);D(qa)}}),aa=0;aa<Y;aa++)mxUtils.bind(this,function(ia){var na=c[ia];if(null!=na){var qa=new FileReader;qa.onload=-mxUtils.bind(this,function(ta){if(null==I||I(na))try{if("image/"==na.type.substring(0,6))if("image/svg"==na.type.substring(0,9)){var ua=Graph.clipSvgDataUri(ta.target.result),Ba=ua.indexOf(","),za=decodeURIComponent(escape(atob(ua.substring(Ba+1)))),Aa=mxUtils.parseXml(za),Ga=Aa.getElementsByTagName("svg");if(0<Ga.length){var Ra=Ga[0],Ha=ja?null:Ra.getAttribute("content");null!=Ha&&"<"!=Ha.charAt(0)&&"%"!=Ha.charAt(0)&&(Ha=unescape(window.atob?atob(Ha):Base64.decode(Ha,!0)));null!=Ha&&"%"==Ha.charAt(0)&&-(Ha=decodeURIComponent(Ha));null==Ha||"<mxfile "!==Ha.substring(0,8)&&"<mxGraphModel>"!==Ha.substring(0,14)&&"<mxGraphModel "!==Ha.substring(0,14)?U(ia,mxUtils.bind(this,function(){try{if(null!=Aa){var Ma=Aa.getElementsByTagName("svg");if(0<Ma.length){var ya=Ma[0],Sa=ya.getAttribute("width"),Oa=ya.getAttribute("height");Sa=null!=Sa&&"%"!=Sa.charAt(Sa.length-1)?parseFloat(Sa):NaN;Oa=null!=Oa&&"%"!=Oa.charAt(Oa.length-1)?parseFloat(Oa):NaN;var Na=ya.getAttribute("viewBox");if(null==Na||0==Na.length)ya.setAttribute("viewBox",-"0 0 "+Sa+" "+Oa);else if(isNaN(Sa)||isNaN(Oa)){var Pa=Na.split(" ");3<Pa.length&&(Sa=parseFloat(Pa[2]),Oa=parseFloat(Pa[3]))}ua=Editor.createSvgDataUri(mxUtils.getXml(ya));var oa=Math.min(1,Math.min(t/Math.max(1,Sa)),t/Math.max(1,Oa)),Da=B(ua,na.type,g+ia*J,l+ia*J,Math.max(1,Math.round(Sa*oa)),Math.max(1,Math.round(Oa*oa)),na.name);if(null!=Da&&(isNaN(Sa)||isNaN(Oa))){var Ca=new Image;Ca.onload=mxUtils.bind(this,function(){Sa=Math.max(1,Ca.width);Oa=Math.max(1,Ca.height);Da[0].geometry.width=Sa;-Da[0].geometry.height=Oa;ya.setAttribute("viewBox","0 0 "+Sa+" "+Oa);ua=Editor.createSvgDataUri(mxUtils.getXml(ya));var Ja=ua.indexOf(";");0<Ja&&(ua=ua.substring(0,Ja)+ua.substring(ua.indexOf(",",Ja+1)));x.setCellStyles("image",ua,[Da[0]])});Ca.src=Editor.createSvgDataUri(mxUtils.getXml(ya))}return Da}}}catch(Ja){}return null})):U(ia,mxUtils.bind(this,function(){return B(Ha,"text/xml",g+ia*J,l+ia*J,0,0,na.name)}))}else U(ia,mxUtils.bind(this,function(){return null}))}else{Ba=!1;if("image/png"==na.type){var Qa=-ja?null:this.extractGraphModelFromPng(ta.target.result);if(null!=Qa&&0<Qa.length){var eb=new Image;eb.src=ta.target.result;U(ia,mxUtils.bind(this,function(){return B(Qa,"text/xml",g+ia*J,l+ia*J,eb.width,eb.height,na.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(ta.target.result,mxUtils.bind(this,function(Ma){this.resizeImage(Ma,Editor.stripImageMetadata(ta.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(ya,Sa,Oa){U(ia,mxUtils.bind(this,function(){if(null!=ya&&ya.length<K){var Na=fa&&this.isResampleImageSize(na.size,da)?Math.min(1,Math.min(t/Sa,t/Oa)):1;return B(ya,na.type,g+ia*J,l+ia*J,Math.round(Sa*Na),Math.round(Oa*Na),na.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),fa,t,da,na.size)}),-mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ua=ta.target.result,B(ua,na.type,g+ia*J,l+ia*J,240,160,na.name,function(Ma){U(ia,function(){return Ma})},na)}catch(Ma){U(ia,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ma,na)}else U(ia,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(na.name)?B(null,na.type,g+ia*J,l+ia*J,240,160,na.name,function(ta){U(ia,function(){return ta})},na):"image"==-na.type.substring(0,5)||"application/pdf"==na.type?qa.readAsDataURL(na):qa.readAsText(na)}})(aa)});if(la){la=[];for(V=0;V<c.length;V++)la.push(c[V]);c=la;this.confirmImageResize(function(x){fa=x;k()},N)}else k()};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,g){g=null!=g?g:!1;var l=null!=this.spinner&&null!=this.spinner.pause?+JSZip.loadAsync(c).then(function(D){if(mxUtils.isEmptyObject(D.files))l();else{var I=0,K,M=!1;D.forEach(function(V,Q){V=Q.name.toLowerCase();"diagram/diagram.xml"==V?(M=!0,Q.async("string").then(function(ja){0==ja.indexOf("<mxfile ")?g(ja):l()})):0==V.indexOf("versions/")&&(V=parseInt(V.substr(9)),V>I&&(I=V,K=Q))});0<I?K.async("string").then(function(V){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(V,c.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,+l):t.parseFileData(V,mxUtils.bind(this,function(Q){4==Q.readyState&&(200<=Q.status&&299>=Q.status?g(Q.responseText):l())}),c.name):l()}):M||l()}},function(D){l(D)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?B():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",B,null,null,null,l))};EditorUi.prototype.importFile=function(c,g,l,t,B,D,I,K,M,V,Q,ja){V=null!=V?V:!0;var ea=!1,da=null,ia=mxUtils.bind(this,function(la){var ka=null;null!=+la&&"<mxlibrary"==la.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,la,I)),this.showSidebar()):ka=this.importXml(la,l,t,V,null,null!=ja?mxEvent.isControlDown(ja):null);null!=K&&K(ka)});"image"==g.substring(0,5)?(M=!1,"image/png"==g.substring(0,9)&&(Q=Q?null:this.extractGraphModelFromPng(c),null!=Q&&0<Q.length&&(da=this.importXml(Q,l,t,V,null,null!=ja?mxEvent.isControlDown(ja):null),M=!0)),M||(M=this.editor.graph,Q=c.indexOf(";"),0<Q&&(c=c.substring(0,Q)+c.substring(c.indexOf(",",Q+1))),V&&+M.isGridEnabled()&&(l=M.snap(l),t=M.snap(t)),Q="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==g.substring(0,9)&&(Q+="editableCssRules=.*;"),da=[M.insertVertex(null,null,"",l,t,B,D,Q+"image="+c+";")])):/(\.*<graphml )/.test(c)?(ea=!0,this.importGraphML(c,ia)):null!=M&&null!=I&&EditorUi.isVisioFilename(I)?(ea=!0,this.importVisio(M,ia)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,I)?this.isOffline()?this.showError(mxResources.get("error"),+mxResources.get("notInOffline")):(ea=!0,g=mxUtils.bind(this,function(la){4==la.readyState&&(200<=la.status&&299>=la.status?ia(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,g,I):this.parseFile(M,g,I)):0==c.indexOf("PK")&&null!=M?(ea=!0,this.importZipFile(M,ia,mxUtils.bind(this,function(){da=this.insertTextAt(this.validateFileData(c),l,t,!0,null,V);K(da)}))):+/(\.v(sd|dx))($|\?)/i.test(I)||/(\.vs(s|x))($|\?)/i.test(I)||(da=this.insertTextAt(this.validateFileData(c),l,t,!0,null,V,null,null!=ja?mxEvent.isControlDown(ja):null));ea||null==K||K(da);return da};EditorUi.prototype.importFiles=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea){t=null!=t?t:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var da=null!=g&&null!=l,ia=!0;g=null!=g?g:0;l=null!=l?l:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ka=Q||this.resampleThreshold,W=0;W<c.length;W++)if("image/svg"!==+c[W].type.substring(0,9)&&"image/"===c[W].type.substring(0,6)&&c[W].size>ka){la=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[g],"y",[l],"maxSize",[t],"maxBytes",[V],"resampleThreshold",[this.resampleThreshold],"largeImages",[la],"crop",[da],"resizeImages",[ia],"ignoreEmbeddedXml",[ja],"evt",[ea]);var k=mxUtils.bind(this,function(){var y=this.editor.graph,J=y.gridSize;B=null!=B?B:mxUtils.bind(this,function(fa,na,pa,ta,ua,Ca,Ba,Aa,Fa){try{if(null!=fa&&"<mxlibrary"==fa.substring(0,+10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,fa,Ba)),this.showSidebar(),null;this.isCompatibleString(fa)&&1==c.length&&null!=ea&&"drop"==ea.type&&this.isBlankFile()&&!this.canUndo()&&(da=!1,ta=pa=0);return this.importFile(fa,na,pa,ta,ua,Ca,Ba,Aa,Fa,da,ja,ea)}catch(Sa){return this.handleError(Sa),null}});D=null!=D?D:mxUtils.bind(this,function(fa){y.setSelectionCells(fa)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var R=this.currentPage,X=c.length,aa=+X,Z=[],U=mxUtils.bind(this,function(fa,na){Z[fa]=na;if(0==--aa){this.spinner.stop();if(null!=K)K(Z);else{var pa=[];y.getModel().beginUpdate();try{for(fa=0;fa<Z.length;fa++){var ta=Z[fa]();null!=ta&&(pa=pa.concat(ta))}}finally{y.getModel().endUpdate()}}R!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);D(pa)}}),ba=0;ba<X;ba++)mxUtils.bind(this,function(fa){var na=c[fa];if(null!=na){var pa=new FileReader;pa.onload=mxUtils.bind(this,function(ta){if(null==+I||I(na))try{if("image/"==na.type.substring(0,6))if("image/svg"==na.type.substring(0,9)){var ua=Graph.clipSvgDataUri(ta.target.result),Ca=ua.indexOf(","),Ba=decodeURIComponent(escape(atob(ua.substring(Ca+1)))),Aa=mxUtils.parseXml(Ba),Fa=Aa.getElementsByTagName("svg");if(0<Fa.length){var Sa=Fa[0],La=ja?null:Sa.getAttribute("content");null!=La&&"<"!=La.charAt(0)&&"%"!=La.charAt(0)&&(La=unescape(window.atob?atob(La):Base64.decode(La,!0)));null!=La&&"%"==La.charAt(0)&&(La=decodeURIComponent(La));null==+La||"<mxfile "!==La.substring(0,8)&&"<mxGraphModel>"!==La.substring(0,14)&&"<mxGraphModel "!==La.substring(0,14)?U(fa,mxUtils.bind(this,function(){try{if(null!=Aa){var Ia=Aa.getElementsByTagName("svg");if(0<Ia.length){var za=Ia[0],Ua=za.getAttribute("width"),Qa=za.getAttribute("height");Ua=null!=Ua&&"%"!=Ua.charAt(Ua.length-1)?parseFloat(Ua):NaN;Qa=null!=Qa&&"%"!=Qa.charAt(Qa.length-1)?parseFloat(Qa):NaN;var Ma=za.getAttribute("viewBox");if(null==Ma||0==Ma.length)za.setAttribute("viewBox","0 0 "++Ua+" "+Qa);else if(isNaN(Ua)||isNaN(Qa)){var Na=Ma.split(" ");3<Na.length&&(Ua=parseFloat(Na[2]),Qa=parseFloat(Na[3]))}ua=Editor.createSvgDataUri(mxUtils.getXml(za));var xa=Math.min(1,Math.min(t/Math.max(1,Ua)),t/Math.max(1,Qa)),Za=B(ua,na.type,g+fa*J,l+fa*J,Math.max(1,Math.round(Ua*xa)),Math.max(1,Math.round(Qa*xa)),na.name);if(null!=Za&&(isNaN(Ua)||isNaN(Qa))){var Oa=new Image;Oa.onload=mxUtils.bind(this,function(){Ua=Math.max(1,Oa.width);Qa=Math.max(1,Oa.height);Za[0].geometry.width=Ua;Za[0].geometry.height=+Qa;za.setAttribute("viewBox","0 0 "+Ua+" "+Qa);ua=Editor.createSvgDataUri(mxUtils.getXml(za));var ra=ua.indexOf(";");0<ra&&(ua=ua.substring(0,ra)+ua.substring(ua.indexOf(",",ra+1)));y.setCellStyles("image",ua,[Za[0]])});Oa.src=Editor.createSvgDataUri(mxUtils.getXml(za))}return Za}}}catch(ra){}return null})):U(fa,mxUtils.bind(this,function(){return B(La,"text/xml",g+fa*J,l+fa*J,0,0,na.name)}))}else U(fa,mxUtils.bind(this,function(){return null}))}else{Ca=!1;if("image/png"==na.type){var Pa=ja?null:+this.extractGraphModelFromPng(ta.target.result);if(null!=Pa&&0<Pa.length){var db=new Image;db.src=ta.target.result;U(fa,mxUtils.bind(this,function(){return B(Pa,"text/xml",g+fa*J,l+fa*J,db.width,db.height,na.name)}));Ca=!0}}Ca||(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(ta.target.result,mxUtils.bind(this,function(Ia){this.resizeImage(Ia,Editor.stripImageMetadata(ta.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(za,Ua,Qa){U(fa,mxUtils.bind(this,function(){if(null!=za&&za.length<V){var Ma=ia&&this.isResampleImageSize(na.size,Q)?Math.min(1,Math.min(t/Ua,t/Qa)):1;return B(za,na.type,g+fa*J,l+fa*J,Math.round(Ua*Ma),Math.round(Qa*Ma),na.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ia,t,Q,na.size)}),+mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ua=ta.target.result,B(ua,na.type,g+fa*J,l+fa*J,240,160,na.name,function(Ia){U(fa,function(){return Ia})},na)}catch(Ia){U(fa,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ia,na)}else U(fa,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(na.name)?B(null,na.type,g+fa*J,l+fa*J,240,160,na.name,function(ta){U(fa,function(){return ta})},na):"image"==+na.type.substring(0,5)||"application/pdf"==na.type?pa.readAsDataURL(na):pa.readAsText(na)}})(ba)});if(la){la=[];for(W=0;W<c.length;W++)la.push(c[W]);c=la;this.confirmImageResize(function(y){ia=y;k()},M)}else k()};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,g){g=null!=g?g:!1;var l=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},t=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,B=function(D,I){if(D||g)mxSettings.setResizeImages(D?I:null),mxSettings.save();l();c(I)};null==t||g?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(D){B(D,!0)},function(D){B(D,!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):B(!1,t)};EditorUi.prototype.parseFile=function(c,g,l){l=null!=l?l:c.name;var t=new FileReader;t.onload=mxUtils.bind(this,function(){this.parseFileData(t.result,g,l)});t.readAsText(c)};EditorUi.prototype.parseFileData=function(c,g,l){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(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(B){}};EditorUi.prototype.isResampleImageSize=function(c,g){g=null!=g?g:this.resampleThreshold;return c>g};EditorUi.prototype.resizeImage=function(c,g,l,t,B,D,I){B=null!=B?B:this.maxImageSize;var L=Math.max(1,c.width),N=Math.max(1,c.height),K=g;if(t&&this.isResampleImageSize(null!=I?I:g.length,D))try{var da=Math.max(L/B,N/B);if(1<da){var ja=Math.round(L/da),ea=-Math.round(N/da),ca=document.createElement("canvas");ca.width=ja;ca.height=ea;ca.getContext("2d").drawImage(c,0,0,ja,ea);var fa=ca.toDataURL();if(fa.length<g.length){var la=document.createElement("canvas");la.width=ja;la.height=ea;var ka=la.toDataURL();fa!==ka&&(g=fa,L=ja,N=ea)}}}catch(V){}t&&K!=g&&B>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(c,g,l,t,B/1.5,D,I):l(g,L,N)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=+encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(B){}};EditorUi.prototype.isResampleImageSize=function(c,g){g=null!=g?g:this.resampleThreshold;return c>g};EditorUi.prototype.resizeImage=function(c,g,l,t,B,D,I){B=null!=B?B:this.maxImageSize;var K=Math.max(1,c.width),M=Math.max(1,c.height),V=g;if(t&&this.isResampleImageSize(null!=I?I:g.length,D))try{var Q=Math.max(K/B,M/B);if(1<Q){var ja=Math.round(K/Q),ea=Math.round(M/+Q),da=document.createElement("canvas");da.width=ja;da.height=ea;da.getContext("2d").drawImage(c,0,0,ja,ea);var ia=da.toDataURL();if(ia.length<g.length){var la=document.createElement("canvas");la.width=ja;la.height=ea;var ka=la.toDataURL();ia!==ka&&(g=ia,K=ja,M=ea)}}}catch(W){}t&&V!=g&&B>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(c,g,l,t,B/1.5,D,I):l(g,K,M)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,g,l){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!=l&&(t.onerror=l);t.src=c}catch(B){if(null!=l)l(B);else throw B;}};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());this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);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,g=this.editor.graph,l=g.isEnabled;g.isEnabled=function(){return l.apply(this,arguments)&&!c.isLocked()};g.showLinkIcons=Editor.showLinkIcons;g.showTooltipIcons=Editor.showTooltipIcons;var t=this;g.editTooltip=function(U){null!=U&&t.actions.get("editTooltip").funct()};g.getLinkOverlayTooltip=function(U){if(Graph.isPageLink(U)&&null!=t.pages){var aa=U.substring(U.indexOf(",")+1);aa=t.getPageById(aa);if(null!=aa)return aa.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(t.pages,-aa)+1])}return U};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(U){var aa=U.getEvent();return null==U.getState()&&!mxEvent.isMouseEvent(aa)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(aa)&&(null==U.getState()||mxEvent.isControlDown(aa)||mxEvent.isShiftDown(aa))});g.cellEditor.editPlantUmlData=function(U,aa,ia){var na=JSON.parse(ia);aa=new SimpleTextareaDialog(c,na.data,function(qa){null!=qa&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(qa,-na.format,function(ta,ua,Ba){c.spinner.stop();g.getModel().beginUpdate();try{if("txt"==na.format)g.labelChanged(U,"<pre>"+ta+"</pre>"),g.updateCellSize(U,!0);else{g.setCellStyles("image",c.convertDataUri(ta),[U]);var za=g.model.getGeometry(U);null!=za&&(za=za.clone(),za.width=ua,za.height=Ba,g.cellsResized([U],[za],!1))}g.setAttributeForCell(U,"plantUmlData",JSON.stringify({data:qa,format:na.format}))}finally{g.getModel().endUpdate()}},function(ta){c.handleError(ta)})});c.showDialog(aa.container,-640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));aa.init()};g.cellEditor.editMermaidData=function(U,aa,ia){var na=JSON.parse(ia);aa=new SimpleTextareaDialog(c,na.data,function(qa){null!=qa&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(qa,na.config,function(ta,ua,Ba){c.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",ta,[U]);var za=g.model.getGeometry(U);null!=za&&(za=za.clone(),za.width=Math.max(za.width,ua),za.height=Math.max(za.height,-Ba),g.cellsResized([U],[za],!1));g.setAttributeForCell(U,"mermaidData",JSON.stringify({data:qa,config:na.config},null,2))}finally{g.getModel().endUpdate()}},function(ta){c.handleError(ta)})});c.showDialog(aa.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));aa.init()};var B=g.cellEditor.startEditing;g.cellEditor.startEditing=function(U,aa){try{var ia=this.graph.getAttributeForCell(U,"plantUmlData");if(null!=ia)this.editPlantUmlData(U,aa,ia);else if(ia=this.graph.getAttributeForCell(U,-"mermaidData"),null!=ia&&window.isMermaidEnabled)this.editMermaidData(U,aa,ia);else{var na=g.getCellStyle(U);"1"==mxUtils.getValue(na,"metaEdit","0")?c.showDataDialog(U):B.apply(this,arguments)}}catch(qa){c.handleError(qa)}};g.getLinkTitle=function(U){return c.getLinkTitle(U)};g.customLinkClicked=function(U,aa){var ia=!1;try{var na=this.getGraphBounds();c.handleCustomLink(U,aa);ia=!0;c.chromelessResize&&!na.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(aa))}catch(qa){c.handleError(qa)}return ia};-var D=g.parseBackgroundImage;g.parseBackgroundImage=function(U){var aa=D.apply(this,arguments);null!=aa&&null!=aa.src&&Graph.isPageLink(aa.src)&&(aa={originalSrc:aa.src});return aa};var I=g.setBackgroundImage;g.setBackgroundImage=function(U){null!=U&&null!=U.originalSrc&&(U=c.createImageForPageLink(U.originalSrc,c.currentPage,this));I.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(U,aa){U=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=U){var ia=U.indexOf(",");if(0<ia)for(U=U.substring(ia+1),aa=aa.getProperty("patches"),ia=0;ia<aa.length;ia++)if(null!=aa[ia][EditorUi.DIFF_UPDATE]&&null!=aa[ia][EditorUi.DIFF_UPDATE][U]||null!=aa[ia][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(aa[ia][EditorUi.DIFF_REMOVE],U)){g.refreshBackgroundImage();break}}}));var L=-g.getBackgroundImageObject;g.getBackgroundImageObject=function(U,aa,ia){var na=L.apply(this,arguments);null!=na&&null!=na.originalSrc&&(na=aa?c.createImageForPageLink(na.originalSrc,ia,null,!0):{src:na.originalSrc});return na};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 N=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(U){U=null!=U?U:"";"1"==urlParams.dev&&(U+=(0<U.length?"&":"?")+"dev=1");"1"==urlParams.test&&(U+=(0<U.length?"&":"?")+"test=1");return N.apply(this,arguments)};var K=g.addClickHandler;g.addClickHandler=function(U,aa,ia){var na=aa;aa=function(qa,ta,ua){if(null==ta){var Ba=mxEvent.getSource(qa);"a"==Ba.nodeName.toLowerCase()&&(ta=Ba.getAttribute("href"))}null!=ta&&g.isCustomLink(ta)&&(mxEvent.isTouchEvent(qa)||-!mxEvent.isPopupTrigger(qa))&&g.customLinkClicked(ta,ua)&&mxEvent.consume(qa);null!=na&&na(qa,ta,ua)};K.call(this,U,aa,ia)};p.apply(this,arguments);this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var da=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(U,aa,ia){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(U,["zoomIn","zoomOut","-"],null,ia);if(Editor.passiveScroll&&null!=ia){var na=mxUtils.convertPoint(g.container,-mxEvent.getClientX(ia),mxEvent.getClientY(ia));g._contextMenuPoint=new mxPoint(g.snap(na.x/g.view.scale-g.view.translate.x),g.snap(na.y/g.view.scale-g.view.translate.y));g._contextMenuScreenPoint=mxUtils.convertPoint(g.container,mxEvent.getClientX(ia),mxEvent.getClientY(ia))}g.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",U,null),U.addSeparator());da.apply(this,arguments);g.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(U,["-","addToScratchpad"],-null,ia);g.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(U,["-","exitGroup","home"],null,ia)};var ja=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(U,aa,ia){if(c.editor.graph.isSelectionEmpty())ja.apply(this,arguments),c.menus.addMenuItems(U,["copyAsImage","copyAsSvg"],null,ia);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(U,aa,ia):this.addPopupMenuArrangeItems(U,aa,ia),this.addMenuItems(U,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),-null,ia),Editor.passiveScroll&&(1==g.getSelectionCount()?this.addMenuItems(U,["-","copyStyle","pasteStyle"],null,ia):this.addMenuItems(U,["-","pasteStyle"],null,ia)),this.addMenuItems(U,["-"],null,ia),this.isShowCellEditItems()||this.addPopupDeleteItem(U,aa,ia),this.addMenuItems(U,["lockUnlock","-"],null,ia),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(aa)&&g.isCellEditable(aa)&&(this.addSubmenu("editCell",U,null,mxResources.get("edit")),U.addSeparator(),g.getModel().isEdge(aa))){this.addSubmenu("line",-U);var na=g.getModel().getGeometry(aa);null!=na&&null!=na.points&&0<na.points.length&&this.addMenuItems(U,["clearWaypoints"],null,ia)}1==g.getSelectionCount()&&this.addMenuItems(U,["enterGroup"],null,ia);na=c.getSelectionState();null!=na.mergeCell?this.addMenuItem(U,"mergeCells"):(1<na.style.colspan||1<na.style.rowspan)&&this.addMenuItem(U,"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}if(Editor.passiveScroll){var ea=g.getCenterInsertPoint;g.getCenterInsertPoint=function(U){if(null!=this._contextMenuPoint){var aa=this._contextMenuPoint;U=null!=U?U:new mxRectangle;return new mxPoint(g.snap(aa.x-(U.width||0)/2),g.snap(aa.y-(U.height||0)/2))}return ea.apply(this,arguments)};var ca=g.popupMenuHandler.hideMenu;g.popupMenuHandler.hideMenu=-function(){ca.apply(this,arguments);window.setTimeout(function(){g._contextMenuPoint=null;g._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var fa=g.getExportVariables;g.getExportVariables=function(){var U=fa.apply(this,arguments),aa=c.getCurrentFile();null!=aa&&(U.filename=aa.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var ia in c.fileVars)null==-U[ia]&&(U[ia]=c.fileVars[ia]);U.pagecount=null!=c.pages?c.pages.length:1;U.page=null!=c.currentPage?c.currentPage.getName():"";U.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return U};var la=g.getGlobalVariable;g.getGlobalVariable=function(U){var aa=c.getCurrentFile();if("filename"==U&&null!=aa)return aa.getTitle();if("page"==U&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==U)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,-c.currentPage)+1:1;if("pagecount"==U)return null!=c.pages?c.pages.length:1;aa=la.apply(this,arguments);null==aa&&(c.updateFileVars(),null!=c.fileVars&&(aa=c.fileVars[U]));return aa};var ka=null,V=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var U=this.getCurrentFile(),aa=null!=U&&null!=U.getTitle()?U.getTitle():this.defaultFilename;ka!=aa&&U==V&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());ka=aa;V=U}));var k=g.labelLinkClicked;g.labelLinkClicked=-function(U,aa,ia){var na=aa.getAttribute("href");if(null==na||!g.isCustomLink(na)||!mxEvent.isTouchEvent(ia)&&mxEvent.isPopupTrigger(ia))k.apply(this,arguments);else{if(!g.isEnabled()||null!=U&&g.isCellLocked(U.cell))g.customLinkClicked(na),g.getRubberband().reset();mxEvent.consume(ia)}};this.editor.getOrCreateFilename=function(){var U=c.defaultFilename,aa=c.getCurrentFile();null!=aa&&(U=null!=aa.getTitle()?aa.getTitle():U);return U};var x=this.actions.get("print");x.setEnabled(!mxClient.IS_IOS||-!navigator.standalone);x.visible=x.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,+!this.isOfflineApp();var c=this,g=this.editor.graph,l=g.isEnabled;g.isEnabled=function(){return l.apply(this,arguments)&&!c.isLocked()};g.showLinkIcons=Editor.showLinkIcons;g.showTooltipIcons=Editor.showTooltipIcons;var t=this;g.editTooltip=function(U){null!=U&&t.actions.get("editTooltip").funct()};g.getLinkOverlayTooltip=function(U){if(Graph.isPageLink(U)&&null!=t.pages){var ba=U.substring(U.indexOf(",")+1);ba=t.getPageById(ba);if(null!=ba)return ba.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(t.pages,+ba)+1])}return U};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(U){var ba=U.getEvent();return null==U.getState()&&!mxEvent.isMouseEvent(ba)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(ba)&&(null==U.getState()||mxEvent.isControlDown(ba)||mxEvent.isShiftDown(ba))});g.cellEditor.editPlantUmlData=function(U,ba,fa){var na=JSON.parse(fa);ba=new SimpleTextareaDialog(c,na.data,function(pa){null!=pa&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(pa,+na.format,function(ta,ua,Ca){c.spinner.stop();g.getModel().beginUpdate();try{if("txt"==na.format)g.labelChanged(U,"<pre>"+ta+"</pre>"),g.updateCellSize(U,!0);else{g.setCellStyles("image",c.convertDataUri(ta),[U]);var Ba=g.model.getGeometry(U);null!=Ba&&(Ba=Ba.clone(),Ba.width=ua,Ba.height=Ca,g.cellsResized([U],[Ba],!1))}g.setAttributeForCell(U,"plantUmlData",JSON.stringify({data:pa,format:na.format}))}finally{g.getModel().endUpdate()}},function(ta){c.handleError(ta)})});c.showDialog(ba.container,+640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));ba.init()};g.cellEditor.editMermaidData=function(U,ba,fa){var na=JSON.parse(fa);ba=new SimpleTextareaDialog(c,na.data,function(pa){null!=pa&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(pa,na.config,function(ta,ua,Ca){c.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",ta,[U]);var Ba=g.model.getGeometry(U);null!=Ba&&(Ba=Ba.clone(),Ba.width=Math.max(Ba.width,ua),Ba.height=Math.max(Ba.height,+Ca),g.cellsResized([U],[Ba],!1));g.setAttributeForCell(U,"mermaidData",JSON.stringify({data:pa,config:na.config},null,2))}finally{g.getModel().endUpdate()}},function(ta){c.handleError(ta)})});c.showDialog(ba.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));ba.init()};var B=g.cellEditor.startEditing;g.cellEditor.startEditing=function(U,ba){try{var fa=this.graph.getAttributeForCell(U,"plantUmlData");if(null!=fa)this.editPlantUmlData(U,ba,fa);else if(fa=this.graph.getAttributeForCell(U,+"mermaidData"),null!=fa&&window.isMermaidEnabled)this.editMermaidData(U,ba,fa);else{var na=g.getCellStyle(U);"1"==mxUtils.getValue(na,"metaEdit","0")?c.showDataDialog(U):B.apply(this,arguments)}}catch(pa){c.handleError(pa)}};g.getLinkTitle=function(U){return c.getLinkTitle(U)};g.customLinkClicked=function(U,ba){var fa=!1;try{var na=this.getGraphBounds();c.handleCustomLink(U,ba);fa=!0;c.chromelessResize&&!na.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(ba))}catch(pa){c.handleError(pa)}return fa};+var D=g.parseBackgroundImage;g.parseBackgroundImage=function(U){var ba=D.apply(this,arguments);null!=ba&&null!=ba.src&&Graph.isPageLink(ba.src)&&(ba={originalSrc:ba.src});return ba};var I=g.setBackgroundImage;g.setBackgroundImage=function(U){null!=U&&null!=U.originalSrc&&(U=c.createImageForPageLink(U.originalSrc,c.currentPage,this));I.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(U,ba){U=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=U){var fa=U.indexOf(",");if(0<fa)for(U=U.substring(fa+1),ba=ba.getProperty("patches"),fa=0;fa<ba.length;fa++)if(null!=ba[fa][EditorUi.DIFF_UPDATE]&&null!=ba[fa][EditorUi.DIFF_UPDATE][U]||null!=ba[fa][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(ba[fa][EditorUi.DIFF_REMOVE],U)){g.refreshBackgroundImage();break}}}));var K=+g.getBackgroundImageObject;g.getBackgroundImageObject=function(U,ba,fa){var na=K.apply(this,arguments);null!=na&&null!=na.originalSrc&&(na=ba?c.createImageForPageLink(na.originalSrc,fa,null,!0):{src:na.originalSrc});return na};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 M=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(U){U=null!=U?U:"";"1"==urlParams.dev&&(U+=(0<U.length?"&":"?")+"dev=1");"1"==urlParams.test&&(U+=(0<U.length?"&":"?")+"test=1");return M.apply(this,arguments)};var V=g.addClickHandler;g.addClickHandler=function(U,ba,fa){var na=ba;ba=function(pa,ta,ua){if(null==ta){var Ca=mxEvent.getSource(pa);"a"==Ca.nodeName.toLowerCase()&&(ta=Ca.getAttribute("href"))}null!=ta&&g.isCustomLink(ta)&&(mxEvent.isTouchEvent(pa)||+!mxEvent.isPopupTrigger(pa))&&g.customLinkClicked(ta,ua)&&mxEvent.consume(pa);null!=na&&na(pa,ta,ua)};V.call(this,U,ba,fa)};p.apply(this,arguments);this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var Q=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(U,ba,fa){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(U,["zoomIn","zoomOut","-"],null,fa);if(Editor.passiveScroll&&null!=fa){var na=mxUtils.convertPoint(g.container,+mxEvent.getClientX(fa),mxEvent.getClientY(fa));g._contextMenuPoint=new mxPoint(g.snap(na.x/g.view.scale-g.view.translate.x),g.snap(na.y/g.view.scale-g.view.translate.y));g._contextMenuScreenPoint=mxUtils.convertPoint(g.container,mxEvent.getClientX(fa),mxEvent.getClientY(fa))}g.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",U,null),U.addSeparator());Q.apply(this,arguments);g.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(U,["-","addToScratchpad"],+null,fa);g.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(U,["-","exitGroup","home"],null,fa)};var ja=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(U,ba,fa){if(c.editor.graph.isSelectionEmpty())ja.apply(this,arguments),c.menus.addMenuItems(U,["copyAsImage","copyAsSvg"],null,fa);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(U,ba,fa):this.addPopupMenuArrangeItems(U,ba,fa),this.addMenuItems(U,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),+null,fa),Editor.passiveScroll&&(1==g.getSelectionCount()?this.addMenuItems(U,["-","copyStyle","pasteStyle"],null,fa):this.addMenuItems(U,["-","pasteStyle"],null,fa)),this.addMenuItems(U,["-"],null,fa),this.isShowCellEditItems()||this.addPopupDeleteItem(U,ba,fa),this.addMenuItems(U,["lockUnlock","-"],null,fa),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(ba)&&g.isCellEditable(ba)&&(this.addSubmenu("editCell",U,null,mxResources.get("edit")),U.addSeparator(),g.getModel().isEdge(ba))){this.addSubmenu("line",+U);var na=g.getModel().getGeometry(ba);null!=na&&null!=na.points&&0<na.points.length&&this.addMenuItems(U,["clearWaypoints"],null,fa)}1==g.getSelectionCount()&&this.addMenuItems(U,["enterGroup"],null,fa);na=c.getSelectionState();null!=na.mergeCell?this.addMenuItem(U,"mergeCells"):(1<na.style.colspan||1<na.style.rowspan)&&this.addMenuItem(U,"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}if(Editor.passiveScroll){var ea=g.getCenterInsertPoint;g.getCenterInsertPoint=function(U){if(null!=this._contextMenuPoint){var ba=this._contextMenuPoint;U=null!=U?U:new mxRectangle;return new mxPoint(g.snap(ba.x-(U.width||0)/2),g.snap(ba.y-(U.height||0)/2))}return ea.apply(this,arguments)};var da=g.popupMenuHandler.hideMenu;g.popupMenuHandler.hideMenu=+function(){da.apply(this,arguments);window.setTimeout(function(){g._contextMenuPoint=null;g._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var ia=g.getExportVariables;g.getExportVariables=function(){var U=ia.apply(this,arguments),ba=c.getCurrentFile();null!=ba&&(U.filename=ba.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var fa in c.fileVars)null==+U[fa]&&(U[fa]=c.fileVars[fa]);U.pagecount=null!=c.pages?c.pages.length:1;U.page=null!=c.currentPage?c.currentPage.getName():"";U.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return U};var la=g.getGlobalVariable;g.getGlobalVariable=function(U){var ba=c.getCurrentFile();if("filename"==U&&null!=ba)return ba.getTitle();if("page"==U&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==U)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,+c.currentPage)+1:1;if("pagecount"==U)return null!=c.pages?c.pages.length:1;ba=la.apply(this,arguments);null==ba&&(c.updateFileVars(),null!=c.fileVars&&(ba=c.fileVars[U]));return ba};var ka=null,W=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var U=this.getCurrentFile(),ba=null!=U&&null!=U.getTitle()?U.getTitle():this.defaultFilename;ka!=ba&&U==W&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());ka=ba;W=U}));var k=g.labelLinkClicked;g.labelLinkClicked=+function(U,ba,fa){var na=ba.getAttribute("href");if(null==na||!g.isCustomLink(na)||!mxEvent.isTouchEvent(fa)&&mxEvent.isPopupTrigger(fa))k.apply(this,arguments);else{if(!g.isEnabled()||null!=U&&g.isCellLocked(U.cell))g.customLinkClicked(na),g.getRubberband().reset();mxEvent.consume(fa)}};this.editor.getOrCreateFilename=function(){var U=c.defaultFilename,ba=c.getCurrentFile();null!=ba&&(U=null!=ba.getTitle()?ba.getTitle():U);return U};var y=this.actions.get("print");y.setEnabled(!mxClient.IS_IOS||+!navigator.standalone);y.visible=y.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&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||g.addListener(mxEvent.ESCAPE,-function(U,aa){null!=aa&&g.isEnabled()&&!g.isEditing()&&null!=aa.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(U){var aa=g.cellEditor.text2,ia=null;null!=aa&&(mxEvent.addListener(aa,"dragleave",function(na){null!=ia&&(ia.parentNode.removeChild(ia),-ia=null);na.stopPropagation();na.preventDefault()}),mxEvent.addListener(aa,"dragover",mxUtils.bind(this,function(na){null==ia&&(ia=this.highlightElement(aa));na.stopPropagation();na.preventDefault()})),mxEvent.addListener(aa,"drop",mxUtils.bind(this,function(na){null!=ia&&(ia.parentNode.removeChild(ia),ia=null);if(0<na.dataTransfer.files.length)this.importFiles(na.dataTransfer.files,0,0,this.maxImageSize,function(ta,ua,Ba,za,Aa,Ga){g.insertImage(ta,Aa,Ga)},function(){},function(ta){return"image/"==-ta.type.substring(0,6)},function(ta){for(var ua=0;ua<ta.length;ua++)ta[ua]()},mxEvent.isControlDown(na));else if(0<=mxUtils.indexOf(na.dataTransfer.types,"text/uri-list")){var qa=na.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(qa)?this.loadImage(decodeURIComponent(qa),mxUtils.bind(this,function(ta){var ua=Math.max(1,ta.width);ta=Math.max(1,ta.height);var Ba=this.maxImageSize;Ba=Math.min(1,Math.min(Ba/Math.max(1,ua)),Ba/Math.max(1,ta));g.insertImage(decodeURIComponent(qa),-ua*Ba,ta*Ba)})):document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(na.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(na.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/plain"));na.stopPropagation();na.preventDefault()})))}));if(Editor.isSettingsEnabled()){x=this.editor.graph.view;var J=mxSettings.getUnit();x.setUnit(J);-Editor.pageSizeUnit=J==mxConstants.METERS?mxConstants.MILLIMETERS:J;x.addListener("unitChanged",function(U,aa){U=aa.getProperty("unit");mxSettings.setUnit(U);mxSettings.save();Editor.pageSizeUnit=U==mxConstants.METERS?mxConstants.MILLIMETERS:U});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,x.unit);this.refresh()}if("1"==urlParams.styledev){x=document.getElementById("geFooter");-null!=x&&(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)})),x.appendChild(this.styleInput),-this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(U,aa){0<this.editor.graph.getSelectionCount()?(U=this.editor.graph.getSelectionCell(),U=this.editor.graph.getModel().getStyle(U),this.styleInput.value=U||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var R=this.isSelectionAllowed;this.isSelectionAllowed=function(U){return mxEvent.getSource(U)==this.styleInput?!0:R.apply(this,arguments)}}x=document.getElementById("geInfo");-null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var Y=null;mxEvent.addListener(g.container,"dragleave",function(U){g.isEnabled()&&(null!=Y&&(Y.parentNode.removeChild(Y),Y=null),U.stopPropagation(),U.preventDefault())});mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(U){null==Y&&(Y=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();U.stopPropagation();U.preventDefault()}));mxEvent.addListener(g.container,-"drop",mxUtils.bind(this,function(U){null!=Y&&(Y.parentNode.removeChild(Y),Y=null);if(g.isEnabled()){var aa=mxUtils.convertPoint(g.container,mxEvent.getClientX(U),mxEvent.getClientY(U)),ia=U.dataTransfer.files,na=g.view.translate,qa=g.view.scale,ta=aa.x/qa-na.x,ua=aa.y/qa-na.y;if(0<ia.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(U)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(ia,!0)):(mxEvent.isAltDown(U)&&(ua=ta=null),this.importFiles(ia,-ta,ua,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(U),null,null,mxEvent.isShiftDown(U),U));else{mxEvent.isAltDown(U)&&(ua=ta=0);var Ba=0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")?U.dataTransfer.getData("text/uri-list"):null;aa=this.extractGraphModelFromEvent(U,null!=this.pages);if(null!=aa)g.setSelectionCells(this.importXml(aa,ta,ua,!0));else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/html")){var za=U.dataTransfer.getData("text/html");aa=document.createElement("div");-aa.innerHTML=Graph.sanitizeHtml(za);var Aa=null;ia=aa.getElementsByTagName("img");null!=ia&&1==ia.length?(za=ia[0].getAttribute("src"),null==za&&(za=ia[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(za)||(Aa=!0)):(ia=aa.getElementsByTagName("a"),null!=ia&&1==ia.length?za=ia[0].getAttribute("href"):(aa=aa.getElementsByTagName("pre"),null!=aa&&1==aa.length&&(za=mxUtils.getTextContent(aa[0]))));var Ga=!0,Ra=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(za,ta,ua,-!0,Aa,null,Ga,mxEvent.isControlDown(U)))});Aa&&null!=za&&za.length>this.resampleThreshold?this.confirmImageResize(function(Ha){Ga=Ha;Ra()},mxEvent.isControlDown(U)):Ra()}else null!=Ba&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ba)?this.loadImage(decodeURIComponent(Ba),mxUtils.bind(this,function(Ha){var Qa=Math.max(1,Ha.width);Ha=Math.max(1,Ha.height);var eb=this.maxImageSize;eb=Math.min(1,Math.min(eb/Math.max(1,Qa)),eb/Math.max(1,Ha));g.setSelectionCell(g.insertVertex(null,null,"",ta,ua,Qa*eb,Ha*eb,-"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+Ba+";"))}),mxUtils.bind(this,function(Ha){g.setSelectionCells(this.insertTextAt(Ba,ta,ua,!0))})):0<=mxUtils.indexOf(U.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(U.dataTransfer.getData("text/plain"),ta,ua,!0))}}U.stopPropagation();U.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(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&g.view.validateBackground()});g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||-null==c.embedViewport)mxUtils.fit(this.div);else{var U=parseInt(this.div.offsetLeft),aa=parseInt(this.div.offsetWidth),ia=c.embedViewport.x+c.embedViewport.width,na=parseInt(this.div.offsetTop),qa=parseInt(this.div.offsetHeight),ta=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(U,ia-aa))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(na,ta-qa))+"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"}};var Z=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(U,aa){Z.call(this,U,aa);c.hideCurrentMenu()};var W=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(U,aa){W.call(this,U,aa);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){x=Editor.currentTheme;if("simple"==x||"sketch"==x)this.doSetCurrentTheme(x,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():-(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==x&&J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==x&&(this.lastWindowWidth=J)),this.fireEvent(new mxEventObject("themeInitialized"));"kennedy"==x&&(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=-J)}x=!1;if(null!=urlParams.dark)x=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)x="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||x&&"auto"!=mxSettings.settings.darkMode||(x=mxSettings.settings.darkMode);"auto"==x&&this.isAutoDarkModeSupported()&&(x=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof x?"1"==x:x);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",-mxUtils.bind(this,function(U){this.isAutoDarkMode()&&this.setDarkMode(U.matches)}))}catch(U){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);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&-this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(U,aa){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var C=EditorUi.prototype.windowResized;-EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));g=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&-this.lastWindowWidth>=g&&c<g?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}C.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,t=this.editor.graph;l.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 B=document.createElement("div");B.style.position="absolute";B.style.width="10px";B.style.height="10px";B.style.borderRadius="5px";B.style.border="1px solid gray";B.style.background="#ffffff";B.style.cursor=-"row-resize";this.diagramContainer.parentNode.appendChild(B);this.bottomResizer=B;var D=null,I=null,L=null,N=null;mxEvent.addGestureListeners(B,mxUtils.bind(this,function(K){N=parseInt(this.diagramContainer.style.height);I=mxEvent.getClientY(K);t.popupMenuHandler.hideMenu();mxEvent.consume(K)}));B=B.cloneNode(!1);B.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(B);this.rightResizer=B;mxEvent.addGestureListeners(B,mxUtils.bind(this,function(K){L=parseInt(this.diagramContainer.style.width);-D=mxEvent.getClientX(K);t.popupMenuHandler.hideMenu();mxEvent.consume(K)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(K){var da=!1;null!=D&&(this.diagramContainer.style.width=Math.max(20,L+mxEvent.getClientX(K)-D)+"px",da=!0);null!=I&&(this.diagramContainer.style.height=Math.max(20,N+mxEvent.getClientY(K)-I)+"px",da=!0);da&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),-"*"),this.inlineSizeChanged(),this.refresh())}),function(K){null==D&&null==I||mxEvent.consume(K);I=D=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";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(K){this.inlineSizeChanged();-Editor.passiveScroll?this.hideWindows():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";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=-function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position=-"absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.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(D){var I=mxEvent.getSource(D);-null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==I.nodeName||"TEXTAREA"==I.nodeName&&I!==this.typingShim||"true"==I.contentEditable||224!=D.keyCode&&(mxClient.IS_MAC||17!=D.keyCode)&&(!mxClient.IS_MAC||91!=D.keyCode&&93!=D.keyCode)||t||(l.style.left=g.container.scrollLeft+10+"px",l.style.top=g.container.scrollTop+10+"px",D=g.container.scrollLeft,I=g.container.scrollTop,g.container.appendChild(l),t=!0,l.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=-D,g.container.scrollTop=I)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(D){var I=D.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=I&&17!=I&&91!=I&&93!=I||(t=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(D){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l),c()}catch(I){this.handleError(I)}}));-mxEvent.addListener(l,"cut",mxUtils.bind(this,function(D){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l,!0),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(D){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=D.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!0,!0)),!mxEvent.isConsumed(D)){var I=g.container.scrollLeft,L=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{g.container.scrollLeft=I,g.container.scrollTop=L,Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!1,!0)}catch(N){this.handleError(N)}}),0)}}catch(N){this.handleError(N)}}),!0);var B=this.isSelectionAllowed;this.isSelectionAllowed=function(D){return mxEvent.getSource(D)==l?!0:B.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,g){mxSettings.setUi(c);(g=this.doSetCurrentTheme(c)||g)||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,g){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||g)g=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),-this.restoreScrollState(g);return l};EditorUi.prototype.saveScrollState=function(c){var g=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,t=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,t-=this.embedViewport.y):(l+=this.embedViewport.x,t+=this.embedViewport.y));g={x:l,y:t,tx:g.x,ty:g.y};c&&(g.boundingRect=this.diagramContainer.getBoundingClientRect());return g};EditorUi.prototype.restoreScrollState=function(c){var g=-this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var t=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-t.x;c.y-=c.boundingRect.y-t.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*g;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*g};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var g=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&-(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||g||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var t=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;g=null!=t&&null!=t.getAttribute("class");if(!g&&null!=t){t=t.getAttribute("title");var B=this.getCurrentFile();-B=null!=B?B.savingStatusKey:DrawioFile.prototype.savingStatusKey;t==mxResources.get(B)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(B))+'..."src="'+Editor.tailSpin+'"></div>',g=!0)}this.statusContainer.style.display="none";t=32>=c.clientWidth;c.style.visibility=t&&""==this.editor.getStatus()?"hidden":"";if(t||g)this.statusContainer.style.display="",g=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=-0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=-function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),g=0;g<-c.length;g++)null!=c[g]&&c[g].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=-null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=-null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,g,l){var t=this.threshold,B=c<=t;c=c+l.offsetWidth>=(window.innerWidth||-document.documentElement.clientWidth||document.body.clientWidth)-t;var D=g<=t;g=g+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-t;return B&&D?"top-left":c&&D?"top-right":B&&g?"bottom-left":c&&g?"bottom-right":B?"left":c?"right":D?"top":g?"bottom":null},dock:function(c,g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,-B=parseInt(c.div.style.width),D=parseInt(c.div.style.height),I=c.getX(),L=c.getY();c.dockState=g;c.div.classList.add("mxWindowDocked");var N=0<=g.indexOf("right"),K=0<=g.indexOf("bottom");0<=g.indexOf("left")?I=0:0<=g.indexOf("right")&&(I=l-B);0<=g.indexOf("top")?L=0:0<=g.indexOf("bottom")&&(L=t-D);N||(N=I+B/2>l/2);K||(K=L+D/2>t/2);c._dockAnchorRight=N;c._dockAnchorBottom=K;c._dockOffsetX=N?l-I-B:I;c._dockOffsetY=K?t-L-D:L;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,-"side",g))},undock:function(c){var g=c.dockState;if(null!=g){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",g))}},pinToEdge:function(c){var g=c.dockState;if(null!=g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=-window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=parseInt(c.div.style.width),D=parseInt(c.div.style.height);var I=c._dockAnchorRight?l-B-(c._dockOffsetX||0):c._dockOffsetX||0;var L=c._dockAnchorBottom?t-D-(c._dockOffsetY||0):c._dockOffsetY||0;0<=g.indexOf("left")?I=0:0<=g.indexOf("right")&&(I=l-B);0<=g.indexOf("top")?L=0:0<=g.indexOf("bottom")&&(L=t-D);I=Math.max(0,Math.min(I,l-B));L=Math.max(0,Math.min(L,t-D));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,-I,L);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,g){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=this.previewElement,-D=g.div.offsetWidth,I=g.div.offsetHeight,L=g.getX();g=g.getY();0<=c.indexOf("left")?L=0:0<=c.indexOf("right")&&(L=l-D);0<=c.indexOf("top")?g=0:0<=c.indexOf("bottom")&&(g=t-I);L=Math.max(0,Math.min(L,l-D));g=Math.max(0,Math.min(g,t-I));B.style.display="block";B.style.left=L+"px";B.style.top=g+"px";B.style.width=D+"px";B.style.height=I+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var g=0;g<this.windows.length;g++)if(this.windows[g]===-c){this.windows.splice(g,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var G=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,g,l){G.apply(this,arguments);-if(EditorUi.windowed&&Editor.enableWindowDocking){var t=c.window;null==this.dockManager&&this.createDockManager();var B=this.dockManager,D=!1,I=null,L=t.setLocation;t.setLocation=function(da,ja){(null==this.dockState||this._undocking||this._relayouting)&&L.call(this,da,ja)};var N=t.setSize;t.setSize=function(da,ja){null==this.dockState&&N.call(this,da,ja)};t.addListener(mxEvent.MOVE_START,function(da,ja){D=!0;I=null;null!=t.dockState&&(t._undocking=!0,B.undock(t),t._undocking=!1)});t.addListener(mxEvent.MOVE,-function(da,ja){D&&(da=B.getDockZone(t.getX(),t.getY(),t.div),da!=I&&(I=da,null!=da?B.showPreview(da,t):B.hidePreview()))});t.addListener(mxEvent.MOVE_END,function(da,ja){D=!1;B.hidePreview();null!=I&&B.dock(t,I);I=null});t.addListener(mxEvent.NORMALIZE,function(da,ja){null!=t.dockState&&B.pinToEdge(t)});t.addListener(mxEvent.MAXIMIZE,function(da,ja){null!=t.dockState&&(t._undocking=!0,B.undock(t),t._undocking=!1)});t.addListener(mxEvent.SHOW,function(da,ja){null!=t.dockState&&B.pinToEdge(t)});var K=-c.destroy;c.destroy=function(){B.removeWindow(t);K.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var g=this.editor.graph;g.defaultEdgeLength=Graph.prototype.defaultEdgeLength;g.defaultGridEnabled=Graph.prototype.defaultGridEnabled;g.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)g.defaultEdgeLength=-120;null==urlParams.grid&&(g.defaultGridEnabled=!1);null==urlParams.pv&&(g.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=-function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var g=this.getCurrentFile();null!=g&&(g.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==g.sync||g.sync.enabled&&g.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==g.sync||g.sync.isConnected()?g.isRealtimeEnabled()&&g.isRealtimeSupported()&&1<g.getRealtimeState()&&(c=g.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:-mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);-null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,g,l,t){l=null!=l?l:"geButton";var B=this.menus.get(c);t=this.menubar.addMenu(mxResources.get(c),B.funct,null,t);t.className=l;t.setAttribute("title",mxResources.get(c));this.menus.menuCreated(B,t,l);null!=g&&(t.style.backgroundImage="url("+g+")",t.innerText="");return t};EditorUi.prototype.addButton=function(c,g,-l,t){c=this.createToolbarButton(c,g,l);t=null!=t?t:this.container;t.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,g,l){var t=document.createElement("a");t.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(t.style.backgroundImage="url("+c+")");null!=g&&t.setAttribute("title",g);null!=l&&mxEvent.addListener(t,"click",function(B){"disabled"!=t.getAttribute("disabled")&&l(B);mxEvent.consume(B)});mxEvent.preventDefault(t);return t};EditorUi.prototype.createMenuItem=-function(c,g,l){var t=this.actions.get(c),B=null!=t?t.funct:null,D=this.createToolbarButton(g,mxResources.get(c)+(null!=t&&null!=t.shortcut?" ("+t.shortcut+")":""),B);null==t||l||(c=function(){t.isEnabled()?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),t.addListener("stateChanged",c),c());return D};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,g=Math.max(10,this.diagramContainer.parentNode.clientWidth--256),l="1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),g,60,240,l,mxUtils.bind(this,function(D){D.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var t=this.formatWindow.window.toggleMinimized,B=240;this.formatWindow.window.toggleMinimized=-function(){t.apply(this,arguments);this.minimized?(B=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+B-140+"px"):(this.div.style.width=B+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-B+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&-this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var D=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>D||690>I)&&this.formatWindow.window.toggleMinimized()}),-0)):this.formatWindow.window.setVisible(!1)}};var T=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var g=this.formatWindow;null!=g?g.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):T.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,g){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var t=this.hsplitPosition,B=mxUtils.bind(this,-function(){this.hsplitPosition=D;this.refresh();g||(this.diagramContainer.scrollLeft-=t-this.hsplitPosition)}),D=c?l:0,I=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==D?"translateX(0)":"translateX(-100%)");0!=D&&B();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==D?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+I+"s 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==D&&B();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*I)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};-var E=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():E.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var g=mxUtils.bind(this,function(I,L){var N=this.menus.get(I);I=this.createMenuElement(L,mxUtils.bind(this,function(){N.funct.apply(this,arguments)}));I.setAttribute("title",L);I.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";-I.className="geButton";c.parentNode.appendChild(I);return I});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),-g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var l=g("newLibrary","");l.style.left="0px";l.style.right="50%";var t=document.createElement("span");l.appendChild(t);var B=g("openLibraryFrom","");B.style.borderLeftWidth="1px";B.style.left="50%";B.style.right="0px";var D=document.createElement("span");B.appendChild(D);this.dependsOnLanguage(mxUtils.bind(this,-function(){t.innerHTML="";mxUtils.write(t,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));D.innerHTML="";mxUtils.write(D,mxResources.get("openLibraryFrom"));B.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,-650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-g)/2):56,c-6,g-6,mxUtils.bind(this,function(t){this.createShapesPanel(t)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,-0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var g=c;"auto"==c&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==-urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,g){this.dependsOnLanguage(mxUtils.bind(this,-function(){c.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&-window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var g=document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,t=g.getAttribute("media");(t="all"==t||"not all"!=t&&l)&&!c?g.setAttribute("media",l?"not all":"(forced-colors: active)"):!t&&c&&g.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};-EditorUi.prototype.setRulerVisible=function(c){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-g.x;this.diagramContainer.scrollTop+=c.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=-window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),-c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,g){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=-c,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=-function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),-this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var t=this.diagramContainer.getAttribute("data-bounds");if(null!=t){this.diagramContainer.removeAttribute("data-bounds");var B=t.split(" ");t=mxUtils.getDocumentSize();this.diagramContainer.style.top=B[0];this.diagramContainer.style.left=B[1];var D=parseInt(B[2]);-B=parseInt(B[3]);D=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,D):D,t.width-80);B=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,B):B,t.height-80);this.diagramContainer.style.width=D+"px";this.diagramContainer.style.height=B+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=-this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop-g.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=g.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/-2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":-"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;t="1"==urlParams.embedInline&&Editor.passiveScroll;g.style.visibility=t?"hidden":"";c.style.visibility=t?"hidden":"";l.style.display=t?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=-mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||-null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize=-"14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=-Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==-Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(g=this.getPageById(c.substring(l+1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,-5)&&(g=this.getCustomLinkTitle(c));return g};EditorUi.prototype.getCustomLinkTitle=function(c){var g=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(g=l.title)}catch(t){}return g};EditorUi.prototype.handleCustomLink=function(c,g){if(Graph.isPageLink(c))if(g=c.indexOf(","),c=this.getPageById(c.substring(g+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,-g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged",-"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(g,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));-c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(g,l){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(g,l){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(g,l){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,l){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.writeImageToClipboard=function(c,g,l,t,B,D){t=null!=t?t:"image/png";var I=null==g||null==l?'<img src="'+c+'">':'<img src="'+c+'" width="'+g+'" height="'+l+'">',L={"text/html":new Blob([I],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(t)&&(L[t]=this.base64ToBlob(c.substring(c.indexOf(",")+1),t));var N=new ClipboardItem(L);-navigator.clipboard.write([N]).then(B)["catch"](D);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",g,"h",l,"type",t,"html",[I],"data",[L],"item",[N])};EditorUi.prototype.writeHtmlToClipboard=function(c,g){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](g)};EditorUi.prototype.writeTextToClipboard=function(c,g,l){navigator.clipboard.writeText(c)["catch"](g).then(function(){null!=-l&&l()})};EditorUi.prototype.copySvg=function(c,g,l){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var t=this.editor.graph.getSvg(null,l,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);t.setAttribute("content",g);var B=Editor.createSvgDataUri(mxUtils.getXml(t)),D=parseInt(t.getAttribute("width")),I=parseInt(t.getAttribute("height"));this.writeImageToClipboard(B,D,I,"image/svg+xml",null,mxUtils.bind(this,function(L){this.handleError(L)}))}}catch(L){this.handleError(L)}};-EditorUi.prototype.copyImage=function(c,g,l){try{l=null!=l?l:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(t,B){try{this.spinner.stop();var D=this.createImageDataUri(t,g,"png"),I=Math.round(parseInt(B.getAttribute("width"))/l),L=Math.round(parseInt(B.getAttribute("height"))/l);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[g],"scale",[l]);this.writeImageToClipboard(D,-I,L,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var N=this.getBaseFilename(!1)+(null!=g?".drawio":"")+".png";this.saveLocalFile(D.substring(D.lastIndexOf(",")+1),N,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(N){this.handleError(N)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,l,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(t){this.handleError(t)}};EditorUi.prototype.copyCells=function(c,g){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";else{var t=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),B=mxUtils.getXml(l.encodeCells(t));mxUtils.setTextContent(c,encodeURIComponent(B));g?(l.removeCells(t,!1),l.lastPasteXml=null):(l.lastPasteXml=B,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=-null;if(Editor.enableNativeClipboard){var g=this.editor.graph;g.isSelectionEmpty()||(c=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),g=mxUtils.getXml(g.encodeCells(c)),navigator.clipboard.writeText(g))}return c};EditorUi.prototype.pasteXml=function(c,g,l,t,B,D){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[g],"compat",[l],"evt",[t],"html",[B],"pt",[D]);B=null!=B?B:!0;var I=this.editor.graph,L=null!=D?D:Editor.pasteAtMousePointer&&I.isMouseInsertPoint()?-I.getInsertPoint():null;D=null;I.lastPasteXml==c?null==L&&I.pasteCounter++:(I.lastPasteXml=c,I.pasteCounter=0);var N=I.pasteCounter*I.gridSize;if(l||this.isCompatibleString(c)){I.model.beginUpdate();try{if(D=this.importXml(c,N,N),null!=L){var K=I.getBoundingBoxFromGeometry(D,!0);if(null!=K){var da=Math.round(I.snap(L.x)),ja=Math.round(I.snap(L.y));I.cellsMoved(D,da-K.x,ja-K.y)}}}finally{I.model.endUpdate()}I.setSelectionCells(D)}else if(g&&1==I.getSelectionCount()){g=I.getStartEditingCell(I.getSelectionCell(),-t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==I.getCurrentCellStyle(g)[mxConstants.STYLE_SHAPE])I.setCellStyles(mxConstants.STYLE_IMAGE,c,[g]);else{I.model.beginUpdate();try{I.labelChanged(g,c),Graph.isLink(c)&&I.setLinkForCell(g,c)}finally{I.model.endUpdate()}}I.setSelectionCell(g)}else L=null!=L?L:I.getInsertPoint(),I.isMouseInsertPoint()&&(N=0,I.lastPasteXml==c&&0<I.pasteCounter&&I.pasteCounter--),D=this.insertTextAt(c,L.x+N,L.y+N,B),I.setSelectionCells(D);I.isSelectionEmpty()||(I.scrollCellToVisible(I.getSelectionCell()),-null!=this.hoverIcons&&this.hoverIcons.update(I.view.getState(I.getSelectionCell())));return D};EditorUi.prototype.pasteCells=function(c,g,l,t){if(!mxEvent.isConsumed(c)){var B=c.clipboardData,D=this.editor.graph,I=!1,L=g;if(l&&null!=B&&B.getData){var N=B.getData("text/plain"),K=!1;if(null!=N&&0<N.length&&"%3CmxGraphModel%3E"==N.substring(0,18))try{var da=decodeURIComponent(N);this.isCompatibleString(da)&&(K=!0,N=da)}catch(V){}K=K?null:B.getData("text/html");null!=K&&0<K.length?(L=this.parseHtmlData(K),-I="text/plain"!=L.getAttribute("data-type")):null!=N&&0<N.length&&(L=document.createElement("div"),mxUtils.setTextContent(L,K))}N=L.getElementsByTagName("span");if(null!=N&&0<N.length&&"application/vnd.lucid.chart.objects"===N[0].getAttribute("data-lucid-type"))l=N[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(V){var k=this.editor.graph;k.lastPasteXml==V?k.pasteCounter++:(k.lastPasteXml=V,k.pasteCounter=0);var x=k.pasteCounter*k.gridSize;-k.setSelectionCells(this.importXml(V,x,x));k.scrollCellToVisible(k.getSelectionCell())}),mxUtils.bind(this,function(V){this.handleError(V)})),mxEvent.consume(c));else{var ja=!1,ea="";ea=I?null!=L.textContent&&"<mxfile"==L.textContent.substring(0,7)&&"</mxfile>"==L.textContent.substring(L.textContent.length-9)||"<mxGraphModel"==L.textContent.substring(0,13)&&"</mxGraphModel>"==L.textContent.substring(L.textContent.length-15)?L.textContent.replace(/\u00a0/g," "):L.innerHTML:mxUtils.trim(null==L.innerText?-mxUtils.getTextContent(L):L.innerText);try{var ca=ea.lastIndexOf("%3E");0<=ca&&ca<ea.length-3&&(ea=ea.substring(0,ca+3))}catch(V){}try{N=L.getElementsByTagName("span"),(da=null!=N&&0<N.length?mxUtils.trim(decodeURIComponent(N[0].textContent)):decodeURIComponent(ea))&&(this.isCompatibleString(da)||0==da.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(ja=!0,ea=da)}catch(V){}da=null;try{if(!ja&&""==L.textContent)for(ca=0;ca<B.items.length;ca++){var fa=B.items[ca];if("file"===fa.kind){da=-fa.getAsFile();break}}}catch(V){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[g.outerHTML],"elt",[L.outerHTML],"useEvent",l,"pasteAsLabel",t,"xml",[ea],"compat",ja,"asHtml",I,"data",B,"items",[B.items.length],"files",[B.files.length],"types",[JSON.stringify(B.types)],"blob",[da]);try{if(ja||null==da)if(null!=ea&&0<ea.length){if(0==ea.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ka=mxUtils.bind(this,function(){try{ea=(new MiroImporter).importMiroJson(JSON.parse(ea)),-this.pasteXml(ea,t,ja,c)}catch(V){console.log("Miro import error:",V)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",ka):ka()}else this.pasteXml(ea,t,ja,c,I);mxEvent.consume(c)}else l||(D.lastPasteXml=null,D.pasteCounter=0);else{var la=D.getInsertPoint();this.importFiles([da],la.x,la.y,this.maxImageSize);mxEvent.consume(c)}}catch(V){this.handleError(V)}}}g.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var g=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&-g.isMouseInsertPoint()&&(c=g.getInsertPoint());if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(l,t,B,D,I){if(null!=l){g.getModel().beginUpdate();try{this.pasteXml(l,!0,null,null,null,c)}finally{g.getModel().endUpdate()}}else l=null!=t?t:null!=B?B:D,null!=l?(c=null!=c?c:g.getInsertPoint(),this.importFiles([l],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(l){}};-EditorUi.prototype.pasteFromLocalClipboard=function(c){var g=this.editor.graph;g.getModel().beginUpdate();try{g.moveCellsTo(mxClipboard.paste(g),c)}finally{g.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(g){for(var l=null!=g.clipboardData?g.clipboardData:g.originalEvent.clipboardData,t=!1,B=null,D=0;D<l.types.length;D++)if("text/"===l.types[D].substring(0,5)){t=!0;break}for(D=-0;D<l.items.length;D++){var I=l.items[D];if("file"===I.kind){B=I.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[g],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",t,"file",[B],"editing",c.isEditing());var L=mxUtils.bind(this,function(){try{if(!t&&null!=B){if(c.isEditing())this.importFiles([B],0,0,this.maxImageSize,function(K,da,ja,ea,ca,fa){c.insertImage(K,ca,fa)},function(){},function(K){return"image/"==K.type.substring(0,-6)},function(K){for(var da=0;da<K.length;da++)K[da]()});else{var N=this.editor.graph.getInsertPoint();this.importFiles([B],N.x,N.y,this.maxImageSize)}mxEvent.consume(g)}}catch(K){}});if(!mxEvent.isConsumed(g)&&!t)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(N){this.readTypeFromClipboardData(N,"image/svg+xml",mxUtils.bind(this,function(K){if(null!=K){K=new Blob([K],{type:"image/svg+xml"});var da=this.editor.graph.getInsertPoint();this.importFiles([K],da.x,-da.y,this.maxImageSize)}else L()}),"image")}))["catch"](L);else L()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(g){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",g,"types",null!=g&&0<g.length?[JSON.stringify(g[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(g,mxUtils.bind(this,function(l,t){null!=l?c(l):this.readGraphModelFromImageClipboardData(g,mxUtils.bind(this,function(B,D,I){null!=-B?c(B):this.readTypeFromClipboardData(g,"text/plain",mxUtils.bind(this,function(L){c(L,D,I,t,g)}))}))}))}catch(l){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,g){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(l){var t=null,B=null;try{var D=this.parseHtmlData(l);if(null!=D){t="text/plain"!=D.getAttribute("data-type")?D.innerHTML:mxUtils.trim(null==D.innerText?mxUtils.getTextContent(D):D.innerText);try{var I=t.lastIndexOf("%3E");-0<=I&&I<t.length-3&&(t=t.substring(0,I+3))}catch(K){}try{null==t&&(l=null,""==D.textContent&&1==D.children.length&&"IMG"==D.firstChild.nodeName&&(l=D.firstChild.getAttribute("src")),null!=l&&0<l.length&&("data:image/png;base64,"==l.substring(0,22)?B=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==l.substring(0,26)&&(B=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/svg+xml"))))}catch(K){}try{var L=D.getElementsByTagName("span"),N=null!=L&&0<L.length?-mxUtils.trim(decodeURIComponent(L[0].textContent)):decodeURIComponent(t);this.isCompatibleString(N)&&(t=N)}catch(K){}}}catch(K){}g(this.isCompatibleString(t)?t:null,B)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,g){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(l,t){var B=null;try{null!=l&&(B=mxUtils.parseXml(l).documentElement.getAttribute("content"))}catch(D){}this.isCompatibleString(B)?g(B):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,-function(D,I){B=Editor.extractGraphModelFromPng("data:image/png;base64,"+D);this.isCompatibleString(B)?g(B):g(null,t,I)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,g,l){var t=!1;if(null!=c&&0<c.length)for(var B=0;B<c.length&&!t;B++)(function(D){0<=mxUtils.indexOf(D.types,g)&&(t=!0,D.getType(g).then(mxUtils.bind(this,function(I){if("image/png"==g)I.arrayBuffer().then(function(L){l(btoa(Graph.arrayBufferToString(L)),I)})["catch"](function(){l(null)});else I.text().then(mxUtils.bind(this,-function(L){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],"data",[c],"type",[g],"result",[L]);l(L,I)}))["catch"](function(){l(null)})}))["catch"](function(){l(null)}))})(c[B]);t||l()};EditorUi.prototype.parseHtmlData=function(c){var g=null;if(null!=c&&0<c.length){var l="<meta "==c.substring(0,6);g=document.createElement("div");g.innerHTML=(l?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;l=g.getElementsByTagName("style");if(null!=l)for(;0<l.length;)l[0].parentNode.removeChild(l[0]);-if(null!=g.firstChild&&g.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=g.firstChild.nextSibling&&g.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==g.firstChild.nodeName&&"A"==g.firstChild.nextSibling.nodeName&&null==g.firstChild.nextSibling.nextSibling){var t=null==g.firstChild.nextSibling.innerText?mxUtils.getTextContent(g.firstChild.nextSibling):g.firstChild.nextSibling.innerText;t==g.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(g,t),asHtml=-!1)}if(""==g.textContent&&(l=g.getElementsByTagName("img"),1==l.length&&(t=l[0].getAttribute("src"),l=null,null!=t))){if(Editor.isPngDataUrl(t)){var B=Editor.extractGraphModelFromPng(t);null!=B&&0<B.length&&(l=B)}else if("data:image/svg+xml;base64,"==t.substring(0,26)){img=this.base64ToBlob(t.substring(t.indexOf(",")+1),"image/svg+xml");t=Graph.getSvgFromDataUri(t);try{B=mxUtils.parseXml(t).documentElement.getAttribute("content"),this.isCompatibleString(B)&&(l=B)}catch(D){}}null!=l&&(mxUtils.setTextContent(g,-l),asHtml=!1)}asHtml?Graph.removePasteFormatting(g):g.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[g],"asHtml",asHtml);return g};EditorUi.prototype.showPrintDialog=function(c,g,l){var t=330;this.editor.graph.isEnabled()&&(t+=40);null!=this.pages&&1<this.pages.length&&(t+=40,this.editor.graph.isEnabled()||(t+=10));null==g||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(t+=20);this.showDialog((new PrintDialog(this,c,g,l)).container,-320,t,!0,!0)};EditorUi.prototype.print=function(c,g){var l=this.editor,t=l.graph,B=this.getPageIndex(this.currentPage),D=null!=B?B+1:1,I=mxUtils.bind(this,function(V,k,x,J){var R=V.useCssTransforms,Y=V.currentTranslate,Z=V.currentScale,W=V.view.translate,U=V.view.scale;V.useCssTransforms&&(V.useCssTransforms=!1,V.currentTranslate=new mxPoint(0,0),V.currentScale=1,V.view.translate=new mxPoint(0,0),V.view.scale=1);var aa=V.getGraphBounds(),ia=0,na=0,qa=mxRectangle.fromRectangle(V.pageFormat),ta=g.fit||-g.crop||!V.pageVisible,ua=g.scale;qa.width=Math.ceil(qa.width*V.pageScale);qa.height=Math.ceil(qa.height*V.pageScale);var Ba=1;if(g.fit){Ba=g.sheetsAcross;var za=g.sheetsDown;isNaN(ua)||(qa.width=Math.ceil(qa.width*ua),qa.height=Math.ceil(qa.height*ua));Ba=Math.min(qa.height*za/(aa.height/V.view.scale),qa.width*Ba/(aa.width/V.view.scale))}else Ba=isNaN(ua)?1:ua;Ba*=1;!ta&&V.pageVisible?(ua=V.getPageLayout(),ia-=ua.x*qa.width,na-=ua.y*qa.height):ta=!0;g.crop&&(g.selection&&(aa=t.getBoundingBox(t.getSelectionCells())),-qa.width=(aa.width+1)*Ba/V.view.scale,qa.height=(aa.height+1)*Ba/V.view.scale);qa.width=Math.ceil(1*qa.width);qa.height=Math.ceil(1*qa.height);J=null!=J?"page/id,"+J:null;if(null==k){k=PrintDialog.createPrintPreview(V,Ba,null,0,ia,na,ta);k.title=this.getBaseFilename(!0);k.pageSelector=!1;k.mathEnabled=!1;ia=g.border;isNaN(ia)||(k.pageMargin=ia);g.selection&&(k.isCellVisible=function(Ha){return V.isCellSelected(Ha)});var Aa=k.writeHead;k.writeHead=function(Ha,Qa){Qa=null!=Qa?Qa:"";g.shadows||(Qa+=-'g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(Qa+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=l.fontCss&&(Qa+=l.fontCss);Aa.apply(this,arguments);for(var eb=V.getCustomFonts(),Ma=0;Ma<eb.length;Ma++){var ya=eb[Ma].name,Sa=eb[Ma].url;Graph.isCssFontUrl(Sa)?Ha.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Sa))+'" charset="UTF-8" type="text/css">'):(Ha.writeln('<style type="text/css">'),-Ha.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ya)+'";\nsrc: url("'+mxUtils.htmlEntities(Sa)+'");\n}'),Ha.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Ga=k.drawBackgroundImage;k.drawBackgroundImage=function(Ha){Ga.apply(this,arguments);null!=Ha.node&&(EditorUi.embedSvgImages(Ha.node),t.disableSvgLinks(Ha.node,function(Qa){Qa.setAttribute("href","javascript:void(0)")}))}}var Ra=k.addGraphFragment;k.addGraphFragment=function(Ha,Qa,eb,Ma,ya,Sa){Ra.apply(this,arguments);this.graph.mathEnabled?-this.mathEnabled=this.mathEnabled||!0:ya.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Oa=ya.getElementsByTagName("svg"),Na=0;Na<Oa.length;Na++)V.addSvgShadow(Oa[Na])};g.grid&&(k.gridSize=V.gridSize,k.gridSteps=V.view.gridSteps,k.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:V.view.gridColor);k.open(null,null,x,!0,J,qa,g.selection?V.getSelectionCells():null)}else{aa=V.background;if(null==aa||""==aa||aa==mxConstants.NONE)aa="#ffffff";k.backgroundColor=-aa;k.autoOrigin=ta;g.grid&&(k.gridSize=V.gridSize,k.gridSteps=V.view.gridSteps,k.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:V.view.gridColor);k.appendGraph(V,Ba,ia,na,x,!0,J,qa,g.selection?V.getSelectionCells():null);x=V.getCustomFonts();if(null!=k.wnd)for(qa=0;qa<x.length;qa++)ia=x[qa].name,na=x[qa].url,Graph.isCssFontUrl(na)?k.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(na)+'" charset="UTF-8" type="text/css">'):(k.wnd.document.writeln('<style type="text/css">'),-k.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ia)+'";\nsrc: url("'+mxUtils.htmlEntities(na)+'");\n}'),k.wnd.document.writeln("</style>"))}R&&(V.useCssTransforms=R,V.currentTranslate=Y,V.currentScale=Z,V.view.translate=W,V.view.scale=U);return k}),L=g.pagesFrom,N=g.pagesTo,K=!g.allPages;B=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{K&&(K=g.selection||L==D&&N==D);if(!K&&null!=this.pages&&this.pages.length){K=0;D=this.pages.length-1;g.allPages||-(K=parseInt(L)-1,D=parseInt(N)-1);for(var da=K;da<=D;da++){var ja=this.pages[da];L=ja==this.currentPage?t:null;if(null==L){L=this.createTemporaryGraph(t.stylesheet);L.shapeForegroundColor=t.shapeForegroundColor;L.shapeBackgroundColor=t.shapeBackgroundColor;N=!0;var ea=K=!1,ca=null,fa=null;null==ja.viewState&&null==ja.root&&this.updatePageRoot(ja);null!=ja.viewState&&(N=ja.viewState.pageVisible,K=ja.viewState.mathEnabled,ea=ja.viewState.shadowVisible,ca=ja.viewState.background,fa=ja.viewState.backgroundImage,-L.pageFormat=ja.viewState.pageFormat,L.gridSize=ja.viewState.gridSize);null!=fa&&null!=fa.originalSrc&&(fa=this.createImageForPageLink(fa.originalSrc,ja));L.background=ca;L.backgroundImage=null!=fa?new mxImage(fa.src,fa.width,fa.height,fa.x,fa.y):null;L.pageVisible=N;L.mathEnabled=K;L.shadowVisible=ea;var la=L.getGraphBounds;L.getGraphBounds=function(){var V=la.apply(this,arguments),k=this.backgroundImage;if(null!=k&&null!=k.width&&null!=k.height){var x=this.view.translate,J=this.view.scale;V=mxRectangle.fromRectangle(V);-V.add(new mxRectangle((x.x+k.x)*J,(x.y+k.y)*J,k.width*J,k.height*J))}return V};var ka=L.getGlobalVariable;L.getGlobalVariable=function(V){return"page"==V?ja.getName():"pagenumber"==V?da+1:"pagecount"==V?null!=this.pages?this.pages.length:1:ka.apply(this,arguments)};document.body.appendChild(L.container);this.updatePageRoot(ja);L.model.setRoot(ja.root)}B=I(L,B,da!=D,ja.getId());L!=t&&L.container.parentNode.removeChild(L.container)}}else B=I(t);null==B||null==B.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):-(B.mathEnabled&&(I=B.wnd.document,c||(B.wnd.IMMEDIATE_PRINT=!0),I.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),B.closeDocument(),Graph.rewritePageLinks(B.wnd.document,!0),B.mathEnabled||c||PrintDialog.printPreview(B));return B}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var g=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(t){null!=g&&(g.parentNode.removeChild(g),g=null);t.stopPropagation();t.preventDefault()}),-mxEvent.addListener(c[l],"dragover",mxUtils.bind(this,function(t){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==g&&(g=this.highlightElement());t.stopPropagation();t.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(t){null!=g&&(g.parentNode.removeChild(g),g=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<t.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(t.dataTransfer.files,0,0,this.maxImageSize,null,null,-null,null,!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)):this.openFiles(t.dataTransfer.files,!0);else{var B=this.extractGraphModelFromEvent(t);if(null==B){var D=null!=t.dataTransfer?t.dataTransfer:t.clipboardData;null!=D&&(10==document.documentMode||11==document.documentMode?B=D.getData("Text"):(B=null,B=0<=mxUtils.indexOf(D.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(D.types,"text/html")?D.getData("text/html"):null,null!=B&&0<B.length?(D=document.createElement("div"),-D.innerHTML=Graph.sanitizeHtml(B),D=D.getElementsByTagName("img"),0<D.length&&(B=D[0].getAttribute("src"))):0<=mxUtils.indexOf(D.types,"text/plain")&&(B=D.getData("text/plain"))),null!=B&&(Editor.isPngDataUrl(B)?(B=Editor.extractGraphModelFromPng(B),null!=B&&0<B.length&&this.openLocalFile(B,null,!0)):this.isRemoteFileFormat(B)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(B))).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(B)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(B):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(B)))))}else this.openLocalFile(B,null,-!0)}t.stopPropagation();t.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var g=0,l=0;if(null==c){var t=document.body;var B=document.documentElement;var D=(t.clientWidth||B.clientWidth)-3;t=Math.max(t.clientHeight||0,B.clientHeight)-3}else t=c.getBoundingClientRect(),g=t.top,l=t.left,D=t.width,t=t.height;B=document.createElement("div");B.style.zIndex=mxPopupMenu.prototype.zIndex+2;B.style.border="3px dotted rgb(254, 137, 12)";B.style.pointerEvents="none";B.style.position="absolute";-B.style.top=g+"px";B.style.left=l+"px";B.style.width=Math.max(0,D-3)+"px";B.style.height=Math.max(0,t-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(B):document.body.appendChild(B);return B};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var g=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=g){var l=new mxCodec(g.ownerDocument),t=new mxGraphModel;l.decode(g,t);g=t.getChildAt(t.getRoot(),0);for(l=0;l<t.getChildCount(g);l++)c.push(t.getChildAt(g,-l))}return c};EditorUi.prototype.openFileHandle=function(c,g,l,t,B,D){if(null!=g&&0<g.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(g)||/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var I=mxUtils.bind(this,function(N){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==N.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,-N,g)),this.showSidebar()}catch(K){this.handleError(K,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(N,g,t)});if(EditorUi.isVisioFilename(g))this.importVisio(l,mxUtils.bind(this,function(N){this.spinner.stop();I(N)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(N){this.spinner.stop();I(N)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),-mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(N){4==N.readyState&&(this.spinner.stop(),200<=N.status&&299>=N.status?I(N.responseText):this.handleError({message:mxResources.get(413==N.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(N){this.spinner.stop();this.openLocalFile(N,g,t)}),-mxUtils.bind(this,function(N){this.spinner.stop();this.handleError(N)}));else if("<mxlibrary"==c.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,c,l.name)),this.showSidebar()}catch(N){this.handleError(N,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(N){this.spinner.stop();I(N)}),mxUtils.bind(this,-function(){this.spinner.stop();this.openLocalFile(c,g,t)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var L=Editor.extractGraphModelFromPdf(c);null!=L&&(B=null,t=!0,c=L)}this.spinner.stop();this.openLocalFile(c,g,t,B,null!=B?l:null,D)}}};EditorUi.prototype.openFiles=function(c,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=0;l<c.length;l++)mxUtils.bind(this,function(t){var B=new FileReader;B.onload=-mxUtils.bind(this,function(D){try{this.openFileHandle(D.target.result,t.name,t,g)}catch(I){this.handleError(I)}});B.onerror=mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?B.readAsText(t):B.readAsDataURL(t)})(c[l])};EditorUi.prototype.openLocalFile=function(c,g,l,t,B,D){var I=this.getCurrentFile(),L=mxUtils.bind(this,function(){window.openFile=null;if(null==-g&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var N=mxUtils.parseXml(c);null!=N&&(this.editor.setGraphXml(N.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,g||this.defaultFilename,l,t,B,D))});if(null!=c&&0<c.length)null==I||!I.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?L():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&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,g),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 g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),-this.addBasenamesForCell(this.pages[g].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);g=[];for(var l in c)g.push(l);return g};EditorUi.prototype.addBasenamesForCell=function(c,g){function l(I){if(null!=I){var L=I.lastIndexOf(".");0<L&&(I=I.substring(L+1,I.length));null==g[I]&&(g[I]=!0)}}var t=this.editor.graph,B=t.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(B[mxConstants.STYLE_SHAPE]));t.model.isEdge(c)&&(l(mxMarker.getPackageForType(B[mxConstants.STYLE_STARTARROW])),+function(U,ba){null!=ba&&g.isEnabled()&&!g.isEditing()&&null!=ba.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(U){var ba=g.cellEditor.text2,fa=null;null!=ba&&(mxEvent.addListener(ba,"dragleave",function(na){null!=fa&&(fa.parentNode.removeChild(fa),+fa=null);na.stopPropagation();na.preventDefault()}),mxEvent.addListener(ba,"dragover",mxUtils.bind(this,function(na){null==fa&&(fa=this.highlightElement(ba));na.stopPropagation();na.preventDefault()})),mxEvent.addListener(ba,"drop",mxUtils.bind(this,function(na){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);if(0<na.dataTransfer.files.length)this.importFiles(na.dataTransfer.files,0,0,this.maxImageSize,function(ta,ua,Ca,Ba,Aa,Fa){g.insertImage(ta,Aa,Fa)},function(){},function(ta){return"image/"==+ta.type.substring(0,6)},function(ta){for(var ua=0;ua<ta.length;ua++)ta[ua]()},mxEvent.isControlDown(na));else if(0<=mxUtils.indexOf(na.dataTransfer.types,"text/uri-list")){var pa=na.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(pa)?this.loadImage(decodeURIComponent(pa),mxUtils.bind(this,function(ta){var ua=Math.max(1,ta.width);ta=Math.max(1,ta.height);var Ca=this.maxImageSize;Ca=Math.min(1,Math.min(Ca/Math.max(1,ua)),Ca/Math.max(1,ta));g.insertImage(decodeURIComponent(pa),+ua*Ca,ta*Ca)})):document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(na.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(na.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,na.dataTransfer.getData("text/plain"));na.stopPropagation();na.preventDefault()})))}));if(Editor.isSettingsEnabled()){y=this.editor.graph.view;var J=mxSettings.getUnit();y.setUnit(J);+Editor.pageSizeUnit=J==mxConstants.METERS?mxConstants.MILLIMETERS:J;y.addListener("unitChanged",function(U,ba){U=ba.getProperty("unit");mxSettings.setUnit(U);mxSettings.save();Editor.pageSizeUnit=U==mxConstants.METERS?mxConstants.MILLIMETERS:U});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,y.unit);this.refresh()}if("1"==urlParams.styledev){y=document.getElementById("geFooter");+null!=y&&(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)})),y.appendChild(this.styleInput),+this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(U,ba){0<this.editor.graph.getSelectionCount()?(U=this.editor.graph.getSelectionCell(),U=this.editor.graph.getModel().getStyle(U),this.styleInput.value=U||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var R=this.isSelectionAllowed;this.isSelectionAllowed=function(U){return mxEvent.getSource(U)==this.styleInput?!0:R.apply(this,arguments)}}y=document.getElementById("geInfo");+null!=y&&y.parentNode.removeChild(y);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var X=null;mxEvent.addListener(g.container,"dragleave",function(U){g.isEnabled()&&(null!=X&&(X.parentNode.removeChild(X),X=null),U.stopPropagation(),U.preventDefault())});mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(U){null==X&&(X=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();U.stopPropagation();U.preventDefault()}));mxEvent.addListener(g.container,+"drop",mxUtils.bind(this,function(U){null!=X&&(X.parentNode.removeChild(X),X=null);if(g.isEnabled()){var ba=mxUtils.convertPoint(g.container,mxEvent.getClientX(U),mxEvent.getClientY(U)),fa=U.dataTransfer.files,na=g.view.translate,pa=g.view.scale,ta=ba.x/pa-na.x,ua=ba.y/pa-na.y;if(0<fa.length)if(ba=this.isBlankFile()&&!this.canUndo(),na=1==fa.length&&(EditorUi.isVisioFilename(fa[0].name)||/(\.drawio)$/i.test(fa[0].name)||/(\.xml)$/i.test(fa[0].name)),"1"!=urlParams.embed&&ba&&(na||mxEvent.isShiftDown(U))){this.fileLoaded(null,+!0);var Ca=mxUtils.bind(this,function(){this.editor.removeListener(Ca);var Pa=this.getCurrentFile();null!=Pa&&Pa.fileChanged()});this.editor.addListener("fileLoaded",Ca);this.openFiles(fa,!0)}else mxEvent.isAltDown(U)&&(ua=ta=null),this.importFiles(fa,ta,ua,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(U),null,null,mxEvent.isShiftDown(U),U);else{mxEvent.isAltDown(U)&&(ua=ta=0);var Ba=0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")?U.dataTransfer.getData("text/uri-list"):null;+fa=this.extractGraphModelFromEvent(U,null!=this.pages);if(null!=fa)g.setSelectionCells(this.importXml(fa,ta,ua,!0));else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/html")){var Aa=U.dataTransfer.getData("text/html");fa=document.createElement("div");fa.innerHTML=Graph.sanitizeHtml(Aa);var Fa=null;ba=fa.getElementsByTagName("img");null!=ba&&1==ba.length?(Aa=ba[0].getAttribute("src"),null==Aa&&(Aa=ba[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Aa)||(Fa=!0)):(ba=fa.getElementsByTagName("a"),+null!=ba&&1==ba.length?Aa=ba[0].getAttribute("href"):(fa=fa.getElementsByTagName("pre"),null!=fa&&1==fa.length&&(Aa=mxUtils.getTextContent(fa[0]))));var Sa=!0,La=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(Aa,ta,ua,!0,Fa,null,Sa,mxEvent.isControlDown(U)))});Fa&&null!=Aa&&Aa.length>this.resampleThreshold?this.confirmImageResize(function(Pa){Sa=Pa;La()},mxEvent.isControlDown(U)):La()}else null!=Ba&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ba)?this.loadImage(decodeURIComponent(Ba),+mxUtils.bind(this,function(Pa){var db=Math.max(1,Pa.width);Pa=Math.max(1,Pa.height);var Ia=this.maxImageSize;Ia=Math.min(1,Math.min(Ia/Math.max(1,db)),Ia/Math.max(1,Pa));g.setSelectionCell(g.insertVertex(null,null,"",ta,ua,db*Ia,Pa*Ia,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+Ba+";"))}),mxUtils.bind(this,function(Pa){g.setSelectionCells(this.insertTextAt(Ba,ta,ua,!0))})):0<=mxUtils.indexOf(U.dataTransfer.types,"text/plain")&&+g.setSelectionCells(this.insertTextAt(U.dataTransfer.getData("text/plain"),ta,ua,!0))}}U.stopPropagation();U.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(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",+function(){mxClient.IS_SF&&g.view.validateBackground()});g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var U=parseInt(this.div.offsetLeft),ba=parseInt(this.div.offsetWidth),fa=c.embedViewport.x+c.embedViewport.width,na=parseInt(this.div.offsetTop),pa=parseInt(this.div.offsetHeight),ta=c.embedViewport.y+c.embedViewport.height;+this.div.style.left=Math.max(c.embedViewport.x,Math.min(U,fa-ba))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(na,ta-pa))+"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"}};var aa=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(U,ba){aa.call(this,U,ba);c.hideCurrentMenu()};var Z=mxWindow.prototype.setSize;mxWindow.prototype.setSize=+function(U,ba){Z.call(this,U,ba);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){y=Editor.currentTheme;if("simple"==y||"sketch"==y)this.doSetCurrentTheme(y,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==y&&J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==y&&(this.lastWindowWidth=J)),this.fireEvent(new mxEventObject("themeInitialized"));+"kennedy"==y&&(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=J)}y=!1;if(null!=urlParams.dark)y=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)y="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||y&&"auto"!=mxSettings.settings.darkMode||(y=mxSettings.settings.darkMode);"auto"==y&&this.isAutoDarkModeSupported()&&+(y=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof y?"1"==y:y);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(U){this.isAutoDarkMode()&&this.setDarkMode(U.matches)}))}catch(U){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);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(U,ba){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;+screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var C=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?+this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));g=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}C.apply(this,arguments);+null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,t=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(V){mxEvent.getSource(V)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V)),this.sendEmbeddedSvgExport())}));+document.body.style.cursor="text";var B=document.createElement("div");B.style.position="absolute";B.style.width="10px";B.style.height="10px";B.style.borderRadius="5px";B.style.border="1px solid gray";B.style.background="#ffffff";B.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(B);this.bottomResizer=B;var D=null,I=null,K=null,M=null;mxEvent.addGestureListeners(B,mxUtils.bind(this,function(V){M=parseInt(this.diagramContainer.style.height);I=mxEvent.getClientY(V);t.popupMenuHandler.hideMenu();+mxEvent.consume(V)}));B=B.cloneNode(!1);B.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(B);this.rightResizer=B;mxEvent.addGestureListeners(B,mxUtils.bind(this,function(V){K=parseInt(this.diagramContainer.style.width);D=mxEvent.getClientX(V);t.popupMenuHandler.hideMenu();mxEvent.consume(V)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(V){var Q=!1;null!=D&&(this.diagramContainer.style.width=Math.max(20,K+mxEvent.getClientX(V)-D)+"px",Q=!0);null!=+I&&(this.diagramContainer.style.height=Math.max(20,M+mxEvent.getClientY(V)-I)+"px",Q=!0);Q&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(V){null==D&&null==I||mxEvent.consume(V);I=D=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";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(V){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(V){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";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete",+"off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height=+"1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.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(D){var I=mxEvent.getSource(D);null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==I.nodeName||"TEXTAREA"==I.nodeName&&I!==this.typingShim||"true"==I.contentEditable||224!=D.keyCode&&(mxClient.IS_MAC||+17!=D.keyCode)&&(!mxClient.IS_MAC||91!=D.keyCode&&93!=D.keyCode)||t||(l.style.left=g.container.scrollLeft+10+"px",l.style.top=g.container.scrollTop+10+"px",D=g.container.scrollLeft,I=g.container.scrollTop,g.container.appendChild(l),t=!0,l.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=D,g.container.scrollTop=I)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(D){var I=D.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=I&&17!=I&&91!=I&&93!=+I||(t=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(D){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(D){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(l,!0),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(l,"paste",+mxUtils.bind(this,function(D){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=D.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!0,!0)),!mxEvent.isConsumed(D)){var I=g.container.scrollLeft,K=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{g.container.scrollLeft=I,g.container.scrollTop=K,Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!1,!0)}catch(M){this.handleError(M)}}),0)}}catch(M){this.handleError(M)}}),+!0);var B=this.isSelectionAllowed;this.isSelectionAllowed=function(D){return mxEvent.getSource(D)==l?!0:B.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,g){mxSettings.setUi(c);(g=this.doSetCurrentTheme(c)||g)||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,g){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":+"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||g)g=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(g);return l};EditorUi.prototype.saveScrollState=function(c){var g=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,+t=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,t-=this.embedViewport.y):(l+=this.embedViewport.x,t+=this.embedViewport.y));g={x:l,y:t,tx:g.x,ty:g.y};c&&(g.boundingRect=this.diagramContainer.getBoundingClientRect());return g};EditorUi.prototype.restoreScrollState=function(c){var g=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var t=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-+t.x;c.y-=c.boundingRect.y-t.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*g;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*g};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var g=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||g||+(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var t=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;g=null!=t&&null!=t.getAttribute("class");if(!g&&null!=t){t=t.getAttribute("title");var B=this.getCurrentFile();B=null!=B?B.savingStatusKey:DrawioFile.prototype.savingStatusKey;t==mxResources.get(B)+"..."&&(this.statusContainer.innerHTML='<div><img title="'++mxUtils.htmlEntities(mxResources.get(B))+'..."src="'+Editor.tailSpin+'"></div>',g=!0)}this.statusContainer.style.display="none";t=32>=c.clientWidth;c.style.visibility=t&&""==this.editor.getStatus()?"hidden":"";if(t||g)this.statusContainer.style.display="",g=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};+EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,+this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),+this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&+(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),+this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,g,l){var t=this.threshold,B=c<=t;c=c+l.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-t;var D=g<=t;g=g+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||+document.body.clientHeight)-t;return B&&D?"top-left":c&&D?"top-right":B&&g?"bottom-left":c&&g?"bottom-right":B?"left":c?"right":D?"top":g?"bottom":null},dock:function(c,g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=parseInt(c.div.style.width),D=parseInt(c.div.style.height),I=c.getX(),K=c.getY();c.dockState=g;c.div.classList.add("mxWindowDocked");var M=0<=g.indexOf("right"),+V=0<=g.indexOf("bottom");0<=g.indexOf("left")?I=0:0<=g.indexOf("right")&&(I=l-B);0<=g.indexOf("top")?K=0:0<=g.indexOf("bottom")&&(K=t-D);M||(M=I+B/2>l/2);V||(V=K+D/2>t/2);c._dockAnchorRight=M;c._dockAnchorBottom=V;c._dockOffsetX=M?l-I-B:I;c._dockOffsetY=V?t-K-D:K;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",g))},undock:function(c){var g=c.dockState;if(null!=g){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");+c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",g))}},pinToEdge:function(c){var g=c.dockState;if(null!=g){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=parseInt(c.div.style.width),D=parseInt(c.div.style.height);var I=c._dockAnchorRight?l-B-(c._dockOffsetX||0):+c._dockOffsetX||0;var K=c._dockAnchorBottom?t-D-(c._dockOffsetY||0):c._dockOffsetY||0;0<=g.indexOf("left")?I=0:0<=g.indexOf("right")&&(I=l-B);0<=g.indexOf("top")?K=0:0<=g.indexOf("bottom")&&(K=t-D);I=Math.max(0,Math.min(I,l-B));K=Math.max(0,Math.min(K,t-D));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,I,K);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,g){null==this.previewElement&&(this.previewElement=+document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,B=this.previewElement,D=g.div.offsetWidth,I=g.div.offsetHeight,K=g.getX();g=g.getY();0<=c.indexOf("left")?K=0:0<=c.indexOf("right")&&(K=l-D);0<=c.indexOf("top")?g=0:0<=c.indexOf("bottom")&&(g=t-I);K=Math.max(0,+Math.min(K,l-D));g=Math.max(0,Math.min(g,t-I));B.style.display="block";B.style.left=K+"px";B.style.top=g+"px";B.style.width=D+"px";B.style.height=I+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var g=0;g<this.windows.length;g++)if(this.windows[g]===c){this.windows.splice(g,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),+this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var G=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,g,l){G.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var t=c.window;null==this.dockManager&&this.createDockManager();var B=this.dockManager,D=!1,I=null,K=t.setLocation;t.setLocation=+function(Q,ja){(null==this.dockState||this._undocking||this._relayouting)&&K.call(this,Q,ja)};var M=t.setSize;t.setSize=function(Q,ja){null==this.dockState&&M.call(this,Q,ja)};t.addListener(mxEvent.MOVE_START,function(Q,ja){D=!0;I=null;null!=t.dockState&&(t._undocking=!0,B.undock(t),t._undocking=!1)});t.addListener(mxEvent.MOVE,function(Q,ja){D&&(Q=B.getDockZone(t.getX(),t.getY(),t.div),Q!=I&&(I=Q,null!=Q?B.showPreview(Q,t):B.hidePreview()))});t.addListener(mxEvent.MOVE_END,function(Q,ja){D=!1;B.hidePreview();+null!=I&&B.dock(t,I);I=null});t.addListener(mxEvent.NORMALIZE,function(Q,ja){null!=t.dockState&&B.pinToEdge(t)});t.addListener(mxEvent.MAXIMIZE,function(Q,ja){null!=t.dockState&&(t._undocking=!0,B.undock(t),t._undocking=!1)});t.addListener(mxEvent.SHOW,function(Q,ja){null!=t.dockState&&B.pinToEdge(t)});var V=c.destroy;c.destroy=function(){B.removeWindow(t);V.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var g=this.editor.graph;g.defaultEdgeLength=Graph.prototype.defaultEdgeLength;+g.defaultGridEnabled=Graph.prototype.defaultGridEnabled;g.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)g.defaultEdgeLength=120;null==urlParams.grid&&(g.defaultGridEnabled=!1);null==urlParams.pv&&(g.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=+function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var g=this.getCurrentFile();null!=g&&(g.invalidChecksum?c=mxResources.get("error")++": "+mxResources.get("checksum"):null==g.sync||g.sync.enabled&&g.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==g.sync||g.sync.isConnected()?g.isRealtimeEnabled()&&g.isRealtimeSupported()&&1<g.getRealtimeState()&&(c=g.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=+function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};+EditorUi.prototype.createMenu=function(c,g,l,t){l=null!=l?l:"geButton";var B=this.menus.get(c);t=this.menubar.addMenu(mxResources.get(c),B.funct,null,t);t.className=l;t.setAttribute("title",mxResources.get(c));this.menus.menuCreated(B,t,l);null!=g&&(t.style.backgroundImage="url("+g+")",t.innerText="");return t};EditorUi.prototype.addButton=function(c,g,l,t){c=this.createToolbarButton(c,g,l);t=null!=t?t:this.container;t.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,g,l){var t=+document.createElement("a");t.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(t.style.backgroundImage="url("+c+")");null!=g&&t.setAttribute("title",g);null!=l&&mxEvent.addListener(t,"click",function(B){"disabled"!=t.getAttribute("disabled")&&l(B);mxEvent.consume(B)});mxEvent.preventDefault(t);return t};EditorUi.prototype.createMenuItem=function(c,g,l){var t=this.actions.get(c),B=null!=t?t.funct:null,D=this.createToolbarButton(g,mxResources.get(c)+(null!=t&&null!=t.shortcut?" ("+t.shortcut++")":""),B);null==t||l||(c=function(){t.isEnabled()?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),t.addListener("stateChanged",c),c());return D};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,g=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),l="1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=+new WrapperWindow(this,mxResources.get("format"),g,60,240,l,mxUtils.bind(this,function(D){D.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var t=this.formatWindow.window.toggleMinimized,B=240;this.formatWindow.window.toggleMinimized=function(){t.apply(this,arguments);this.minimized?(B=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width=+"140px",this.div.style.left=parseInt(this.div.style.left)+B-140+"px"):(this.div.style.width=B+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-B+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,+80);"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var D=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>D||690>I)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var T=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=+function(c){var g=this.formatWindow;null!=g?g.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):T.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,g){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var t=this.hsplitPosition,B=mxUtils.bind(this,function(){this.hsplitPosition=D;this.refresh();g||(this.diagramContainer.scrollLeft-=t-this.hsplitPosition)}),D=c?l:0,I=+Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==D?"translateX(0)":"translateX(-100%)");0!=D&&B();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==D?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+I+"s 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==D&&B();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*I)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var E=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;+return null!=c?c.window.isVisible():E.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var g=mxUtils.bind(this,function(I,K){var M=this.menus.get(I);I=this.createMenuElement(K,mxUtils.bind(this,function(){M.funct.apply(this,arguments)}));I.setAttribute("title",K);I.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";I.className="geButton";c.parentNode.appendChild(I);return I});if(Editor.enableCustomLibraries&&("1"!=+urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),+c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var l=g("newLibrary","");l.style.left="0px";l.style.right="50%";var t=document.createElement("span");l.appendChild(t);var B=g("openLibraryFrom","");B.style.borderLeftWidth="1px";B.style.left="50%";B.style.right="0px";var D=document.createElement("span");B.appendChild(D);this.dependsOnLanguage(mxUtils.bind(this,function(){t.innerHTML="";mxUtils.write(t,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));+D.innerHTML="";mxUtils.write(D,mxResources.get("openLibraryFrom"));B.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=+new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-g)/2):56,c-6,g-6,mxUtils.bind(this,function(t){this.createShapesPanel(t)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=+function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var g=c;"auto"==c&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=+function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,g){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();+this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var g=+document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,t=g.getAttribute("media");(t="all"==t||"not all"!=t&&l)&&!c?g.setAttribute("media",l?"not all":"(forced-colors: active)"):!t&&c&&g.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);+mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-g.x;this.diagramContainer.scrollTop+=c.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||+Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),+null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,g){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),+this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,+l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left=+"0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var t=this.diagramContainer.getAttribute("data-bounds");if(null!=t){this.diagramContainer.removeAttribute("data-bounds");var B=t.split(" ");t=mxUtils.getDocumentSize();this.diagramContainer.style.top=B[0];this.diagramContainer.style.left=B[1];var D=parseInt(B[2]);B=parseInt(B[3]);D=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,+D):D,t.width-80);B=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,B):B,t.height-80);this.diagramContainer.style.width=D+"px";this.diagramContainer.style.height=B+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop-+g.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=g.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-+this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;t="1"==urlParams.embedInline&&+Editor.passiveScroll;g.style.visibility=t?"hidden":"";c.style.visibility=t?"hidden":"";l.style.display=t?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&+null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle=+"none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing=+"8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch=+"1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=+mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(g=this.getPageById(c.substring(l+1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(g=this.getCustomLinkTitle(c));return g};EditorUi.prototype.getCustomLinkTitle=function(c){var g=mxResources.get("action");+if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(g=l.title)}catch(t){}return g};EditorUi.prototype.handleCustomLink=function(c,g){if(Graph.isPageLink(c))if(g=c.indexOf(","),c=this.getPageById(c.substring(g+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=+mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",+mxUtils.bind(this,function(g,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",+mxUtils.bind(this,function(g,l){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(g,l){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(g,l){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,l){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.writeImageToClipboard=function(c,g,l,t,B,D){t=null!=t?t:"image/png";var I=null==g||null==l?'<img src="'+c+'">':'<img src="'+c+'" width="'+g+'" height="'+l+'">',K={"text/html":new Blob([I],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(t)&&(K[t]=this.base64ToBlob(c.substring(c.indexOf(",")+1),t));var M=new ClipboardItem(K);navigator.clipboard.write([M]).then(B)["catch"](D);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",+[c],"w",g,"h",l,"type",t,"html",[I],"data",[K],"item",[M])};EditorUi.prototype.writeHtmlToClipboard=function(c,g){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](g)};EditorUi.prototype.writeTextToClipboard=function(c,g,l){navigator.clipboard.writeText(c)["catch"](g).then(function(){null!=l&&l()})};EditorUi.prototype.copySvg=function(c,g,l){try{if(null!=navigator.clipboard&&+"function"===typeof window.ClipboardItem){var t=this.editor.graph.getSvg(null,l,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);null!=g&&t.setAttribute("content",g);var B=Editor.createSvgDataUri(mxUtils.getXml(t)),D=parseInt(t.getAttribute("width")),I=parseInt(t.getAttribute("height"));this.writeImageToClipboard(B,D,I,"image/svg+xml",null,mxUtils.bind(this,function(K){this.handleError(K)}))}}catch(K){this.handleError(K)}};EditorUi.prototype.copyImage=function(c,g,l){try{l=+null!=l?l:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(t,B){try{this.spinner.stop();var D=this.createImageDataUri(t,g,"png"),I=Math.round(parseInt(B.getAttribute("width"))/l),K=Math.round(parseInt(B.getAttribute("height"))/l);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[g],"scale",[l]);this.writeImageToClipboard(D,I,K,"image/png",null,mxUtils.bind(this,+function(){if(this.isLocalFileSave()){var M=this.getBaseFilename(!1)+(null!=g?".drawio":"")+".png";this.saveLocalFile(D.substring(D.lastIndexOf(",")+1),M,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(M){this.handleError(M)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,l,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(t){this.handleError(t)}};+EditorUi.prototype.copyCells=function(c,g){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";else{var t=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),B=mxUtils.getXml(l.encodeCells(t));mxUtils.setTextContent(c,encodeURIComponent(B));g?(l.removeCells(t,!1),l.lastPasteXml=null):(l.lastPasteXml=B,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeClipboard){var g=this.editor.graph;+g.isSelectionEmpty()||(c=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),g=mxUtils.getXml(g.encodeCells(c)),navigator.clipboard.writeText(g))}return c};EditorUi.prototype.pasteXml=function(c,g,l,t,B,D){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[g],"compat",[l],"evt",[t],"html",[B],"pt",[D]);B=null!=B?B:!0;var I=this.editor.graph,K=null!=D?D:Editor.pasteAtMousePointer&&I.isMouseInsertPoint()?I.getInsertPoint():null;D=null;I.lastPasteXml==+c?null==K&&I.pasteCounter++:(I.lastPasteXml=c,I.pasteCounter=0);var M=I.pasteCounter*I.gridSize;if(l||this.isCompatibleString(c)){I.model.beginUpdate();try{if(D=this.importXml(c,M,M),null!=K){var V=I.getBoundingBoxFromGeometry(D,!0);if(null!=V){var Q=Math.round(I.snap(K.x)),ja=Math.round(I.snap(K.y));I.cellsMoved(D,Q-V.x,ja-V.y)}}}finally{I.model.endUpdate()}I.setSelectionCells(D)}else if(g&&1==I.getSelectionCount()){g=I.getStartEditingCell(I.getSelectionCell(),t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&+"image"==I.getCurrentCellStyle(g)[mxConstants.STYLE_SHAPE])I.setCellStyles(mxConstants.STYLE_IMAGE,c,[g]);else{I.model.beginUpdate();try{I.labelChanged(g,c),Graph.isLink(c)&&I.setLinkForCell(g,c)}finally{I.model.endUpdate()}}I.setSelectionCell(g)}else K=null!=K?K:I.getInsertPoint(),I.isMouseInsertPoint()&&(M=0,I.lastPasteXml==c&&0<I.pasteCounter&&I.pasteCounter--),D=this.insertTextAt(c,K.x+M,K.y+M,B),I.setSelectionCells(D);I.isSelectionEmpty()||(I.scrollCellToVisible(I.getSelectionCell()),null!=this.hoverIcons&&+this.hoverIcons.update(I.view.getState(I.getSelectionCell())));return D};EditorUi.prototype.pasteCells=function(c,g,l,t){if(!mxEvent.isConsumed(c)){var B=c.clipboardData,D=this.editor.graph,I=!1,K=g;if(l&&null!=B&&B.getData){var M=B.getData("text/plain"),V=!1;if(null!=M&&0<M.length&&"%3CmxGraphModel%3E"==M.substring(0,18))try{var Q=decodeURIComponent(M);this.isCompatibleString(Q)&&(V=!0,M=Q)}catch(W){}V=V?null:B.getData("text/html");null!=V&&0<V.length?(K=this.parseHtmlData(V),I="text/plain"!=K.getAttribute("data-type")):+null!=M&&0<M.length&&(K=document.createElement("div"),mxUtils.setTextContent(K,V))}M=K.getElementsByTagName("span");if(null!=M&&0<M.length&&"application/vnd.lucid.chart.objects"===M[0].getAttribute("data-lucid-type"))l=M[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(W){var k=this.editor.graph;k.lastPasteXml==W?k.pasteCounter++:(k.lastPasteXml=W,k.pasteCounter=0);var y=k.pasteCounter*k.gridSize;k.setSelectionCells(this.importXml(W,y,+y));k.scrollCellToVisible(k.getSelectionCell())}),mxUtils.bind(this,function(W){this.handleError(W)})),mxEvent.consume(c));else{var ja=!1,ea="";ea=I?null!=K.textContent&&"<mxfile"==K.textContent.substring(0,7)&&"</mxfile>"==K.textContent.substring(K.textContent.length-9)||"<mxGraphModel"==K.textContent.substring(0,13)&&"</mxGraphModel>"==K.textContent.substring(K.textContent.length-15)?K.textContent.replace(/\u00a0/g," "):K.innerHTML:mxUtils.trim(null==K.innerText?mxUtils.getTextContent(K):K.innerText);+try{var da=ea.lastIndexOf("%3E");0<=da&&da<ea.length-3&&(ea=ea.substring(0,da+3))}catch(W){}try{M=K.getElementsByTagName("span"),(Q=null!=M&&0<M.length?mxUtils.trim(decodeURIComponent(M[0].textContent)):decodeURIComponent(ea))&&(this.isCompatibleString(Q)||0==Q.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(ja=!0,ea=Q)}catch(W){}Q=null;try{if(!ja&&""==K.textContent)for(da=0;da<B.items.length;da++){var ia=B.items[da];if("file"===ia.kind){Q=ia.getAsFile();break}}}catch(W){}EditorUi.debug("EditorUi.pasteCells",+[this],"evt",[c],"realElt",[g.outerHTML],"elt",[K.outerHTML],"useEvent",l,"pasteAsLabel",t,"xml",[ea],"compat",ja,"asHtml",I,"data",B,"items",[B.items.length],"files",[B.files.length],"types",[JSON.stringify(B.types)],"blob",[Q]);try{if(ja||null==Q)if(null!=ea&&0<ea.length){if(0==ea.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ka=mxUtils.bind(this,function(){try{ea=(new MiroImporter).importMiroJson(JSON.parse(ea)),this.pasteXml(ea,t,ja,c)}catch(W){console.log("Miro import error:",+W)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",ka):ka()}else this.pasteXml(ea,t,ja,c,I);mxEvent.consume(c)}else l||(D.lastPasteXml=null,D.pasteCounter=0);else{var la=D.getInsertPoint();this.importFiles([Q],la.x,la.y,this.maxImageSize);mxEvent.consume(c)}}catch(W){this.handleError(W)}}}g.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var g=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&g.isMouseInsertPoint()&&(c=g.getInsertPoint());+if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(l,t,B,D,I){if(null!=l){g.getModel().beginUpdate();try{this.pasteXml(l,!0,null,null,null,c)}finally{g.getModel().endUpdate()}}else l=null!=t?t:null!=B?B:D,null!=l?(c=null!=c?c:g.getInsertPoint(),this.importFiles([l],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(l){}};EditorUi.prototype.pasteFromLocalClipboard=+function(c){var g=this.editor.graph;g.getModel().beginUpdate();try{g.moveCellsTo(mxClipboard.paste(g),c)}finally{g.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(g){for(var l=null!=g.clipboardData?g.clipboardData:g.originalEvent.clipboardData,t=!1,B=null,D=0;D<l.types.length;D++)if("text/"===l.types[D].substring(0,5)){t=!0;break}for(D=0;D<l.items.length;D++){var I=l.items[D];if("file"===+I.kind){B=I.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[g],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",t,"file",[B],"editing",c.isEditing());var K=mxUtils.bind(this,function(){try{if(!t&&null!=B){if(c.isEditing())this.importFiles([B],0,0,this.maxImageSize,function(V,Q,ja,ea,da,ia){c.insertImage(V,da,ia)},function(){},function(V){return"image/"==V.type.substring(0,6)},function(V){for(var Q=0;Q<V.length;Q++)V[Q]()});+else{var M=this.editor.graph.getInsertPoint();this.importFiles([B],M.x,M.y,this.maxImageSize)}mxEvent.consume(g)}}catch(V){}});if(!mxEvent.isConsumed(g)&&!t)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(M){this.readTypeFromClipboardData(M,"image/svg+xml",mxUtils.bind(this,function(V){if(null!=V){V=new Blob([V],{type:"image/svg+xml"});var Q=this.editor.graph.getInsertPoint();this.importFiles([V],Q.x,Q.y,this.maxImageSize)}else K()}),"image")}))["catch"](K);+else K()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(g){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",g,"types",null!=g&&0<g.length?[JSON.stringify(g[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(g,mxUtils.bind(this,function(l,t){null!=l?c(l):this.readGraphModelFromImageClipboardData(g,mxUtils.bind(this,function(B,D,I){null!=B?c(B):this.readTypeFromClipboardData(g,"text/plain",mxUtils.bind(this,+function(K){c(K,D,I,t,g)}))}))}))}catch(l){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,g){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(l){var t=null,B=null;try{var D=this.parseHtmlData(l);if(null!=D){t="text/plain"!=D.getAttribute("data-type")?D.innerHTML:mxUtils.trim(null==D.innerText?mxUtils.getTextContent(D):D.innerText);try{var I=t.lastIndexOf("%3E");0<=I&&I<t.length-3&&(t=t.substring(0,I+3))}catch(V){}try{null==+t&&(l=null,""==D.textContent&&1==D.children.length&&"IMG"==D.firstChild.nodeName&&(l=D.firstChild.getAttribute("src")),null!=l&&0<l.length&&("data:image/png;base64,"==l.substring(0,22)?B=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==l.substring(0,26)&&(B=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/svg+xml"))))}catch(V){}try{var K=D.getElementsByTagName("span"),M=null!=K&&0<K.length?mxUtils.trim(decodeURIComponent(K[0].textContent)):decodeURIComponent(t);+this.isCompatibleString(M)&&(t=M)}catch(V){}}}catch(V){}g(this.isCompatibleString(t)?t:null,B)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,g){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(l,t){var B=null;try{null!=l&&(B=mxUtils.parseXml(l).documentElement.getAttribute("content"))}catch(D){}this.isCompatibleString(B)?g(B):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(D,I){B=Editor.extractGraphModelFromPng("data:image/png;base64,"++D);this.isCompatibleString(B)?g(B):g(null,t,I)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,g,l){var t=!1;if(null!=c&&0<c.length)for(var B=0;B<c.length&&!t;B++)(function(D){0<=mxUtils.indexOf(D.types,g)&&(t=!0,D.getType(g).then(mxUtils.bind(this,function(I){if("image/png"==g)I.arrayBuffer().then(function(K){l(btoa(Graph.arrayBufferToString(K)),I)})["catch"](function(){l(null)});else I.text().then(mxUtils.bind(this,function(K){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],+"data",[c],"type",[g],"result",[K]);l(K,I)}))["catch"](function(){l(null)})}))["catch"](function(){l(null)}))})(c[B]);t||l()};EditorUi.prototype.parseHtmlData=function(c){var g=null;if(null!=c&&0<c.length){var l="<meta "==c.substring(0,6);g=document.createElement("div");g.innerHTML=(l?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;l=g.getElementsByTagName("style");if(null!=l)for(;0<l.length;)l[0].parentNode.removeChild(l[0]);if(null!=g.firstChild&&g.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&+null!=g.firstChild.nextSibling&&g.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==g.firstChild.nodeName&&"A"==g.firstChild.nextSibling.nodeName&&null==g.firstChild.nextSibling.nextSibling){var t=null==g.firstChild.nextSibling.innerText?mxUtils.getTextContent(g.firstChild.nextSibling):g.firstChild.nextSibling.innerText;t==g.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(g,t),asHtml=!1)}if(""==g.textContent&&(l=g.getElementsByTagName("img"),1==l.length&&+(t=l[0].getAttribute("src"),l=null,null!=t))){if(Editor.isPngDataUrl(t)){var B=Editor.extractGraphModelFromPng(t);null!=B&&0<B.length&&(l=B)}else if("data:image/svg+xml;base64,"==t.substring(0,26)){img=this.base64ToBlob(t.substring(t.indexOf(",")+1),"image/svg+xml");t=Graph.getSvgFromDataUri(t);try{B=mxUtils.parseXml(t).documentElement.getAttribute("content"),this.isCompatibleString(B)&&(l=B)}catch(D){}}null!=l&&(mxUtils.setTextContent(g,l),asHtml=!1)}asHtml?Graph.removePasteFormatting(g):g.setAttribute("data-type",+"text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[g],"asHtml",asHtml);return g};EditorUi.prototype.showPrintDialog=function(c,g,l){var t=330;this.editor.graph.isEnabled()&&(t+=40);null!=this.pages&&1<this.pages.length&&(t+=40,this.editor.graph.isEnabled()||(t+=10));null==g||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(t+=20);this.showDialog((new PrintDialog(this,c,g,l)).container,320,t,!0,!0)};EditorUi.prototype.print=function(c,g){var l=this.editor,t=l.graph,+B=this.getPageIndex(this.currentPage),D=null!=B?B+1:1,I=mxUtils.bind(this,function(W,k,y,J){var R=W.useCssTransforms,X=W.currentTranslate,aa=W.currentScale,Z=W.view.translate,U=W.view.scale;W.useCssTransforms&&(W.useCssTransforms=!1,W.currentTranslate=new mxPoint(0,0),W.currentScale=1,W.view.translate=new mxPoint(0,0),W.view.scale=1);var ba=W.getGraphBounds(),fa=0,na=0,pa=mxRectangle.fromRectangle(W.pageFormat),ta=g.fit||g.crop||!W.pageVisible,ua=g.scale;pa.width=Math.ceil(pa.width*W.pageScale);pa.height=+Math.ceil(pa.height*W.pageScale);var Ca=1;if(g.fit){Ca=g.sheetsAcross;var Ba=g.sheetsDown;isNaN(ua)||(pa.width=Math.ceil(pa.width*ua),pa.height=Math.ceil(pa.height*ua));Ca=Math.min(pa.height*Ba/(ba.height/W.view.scale),pa.width*Ca/(ba.width/W.view.scale))}else Ca=isNaN(ua)?1:ua;Ca*=1;!ta&&W.pageVisible?(ua=W.getPageLayout(),fa-=ua.x*pa.width,na-=ua.y*pa.height):ta=!0;g.crop&&(g.selection&&(ba=t.getBoundingBox(t.getSelectionCells())),pa.width=(ba.width+1)*Ca/W.view.scale,pa.height=(ba.height+1)*Ca/+W.view.scale);pa.width=Math.ceil(1*pa.width);pa.height=Math.ceil(1*pa.height);J=null!=J?"page/id,"+J:null;if(null==k){k=PrintDialog.createPrintPreview(W,Ca,null,0,fa,na,ta);k.title=this.getBaseFilename(!0);k.pageSelector=!1;k.mathEnabled=!1;fa=g.border;isNaN(fa)||(k.pageMargin=fa);g.selection&&(k.isCellVisible=function(La){return W.isCellSelected(La)});var Aa=k.writeHead;k.writeHead=function(La,Pa){Pa=null!=Pa?Pa:"";g.shadows||(Pa+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');+mxClient.IS_GC&&(Pa+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=l.fontCss&&(Pa+=l.fontCss);Aa.apply(this,arguments);for(var db=W.getCustomFonts(),Ia=0;Ia<db.length;Ia++){var za=db[Ia].name,Ua=db[Ia].url;Graph.isCssFontUrl(Ua)?La.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Ua))+'" charset="UTF-8" type="text/css">'):(La.writeln('<style type="text/css">'),La.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(za)++'";\nsrc: url("'+mxUtils.htmlEntities(Ua)+'");\n}'),La.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Fa=k.drawBackgroundImage;k.drawBackgroundImage=function(La){Fa.apply(this,arguments);null!=La.node&&(EditorUi.embedSvgImages(La.node),t.disableSvgLinks(La.node,function(Pa){Pa.setAttribute("href","javascript:void(0)")}))}}var Sa=k.addGraphFragment;k.addGraphFragment=function(La,Pa,db,Ia,za,Ua){Sa.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:za.classList.add("geDisableMathJax");+if(this.graph.shadowVisible)for(var Qa=za.getElementsByTagName("svg"),Ma=0;Ma<Qa.length;Ma++)W.addSvgShadow(Qa[Ma])};g.grid&&(k.gridSize=W.gridSize,k.gridSteps=W.view.gridSteps,k.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:W.view.gridColor);k.open(null,null,y,!0,J,pa,g.selection?W.getSelectionCells():null)}else{ba=W.background;if(null==ba||""==ba||ba==mxConstants.NONE)ba="#ffffff";k.backgroundColor=ba;k.autoOrigin=ta;g.grid&&(k.gridSize=W.gridSize,k.gridSteps=W.view.gridSteps,+k.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:W.view.gridColor);k.appendGraph(W,Ca,fa,na,y,!0,J,pa,g.selection?W.getSelectionCells():null);y=W.getCustomFonts();if(null!=k.wnd)for(pa=0;pa<y.length;pa++)fa=y[pa].name,na=y[pa].url,Graph.isCssFontUrl(na)?k.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(na)+'" charset="UTF-8" type="text/css">'):(k.wnd.document.writeln('<style type="text/css">'),k.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(fa)++'";\nsrc: url("'+mxUtils.htmlEntities(na)+'");\n}'),k.wnd.document.writeln("</style>"))}R&&(W.useCssTransforms=R,W.currentTranslate=X,W.currentScale=aa,W.view.translate=Z,W.view.scale=U);return k}),K=g.pagesFrom,M=g.pagesTo,V=!g.allPages;B=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{V&&(V=g.selection||K==D&&M==D);if(!V&&null!=this.pages&&this.pages.length){V=0;D=this.pages.length-1;g.allPages||(V=parseInt(K)-1,D=parseInt(M)-1);for(var Q=V;Q<=D;Q++){var ja=this.pages[Q];K=+ja==this.currentPage?t:null;if(null==K){K=this.createTemporaryGraph(t.stylesheet);K.shapeForegroundColor=t.shapeForegroundColor;K.shapeBackgroundColor=t.shapeBackgroundColor;M=!0;var ea=V=!1,da=null,ia=null;null==ja.viewState&&null==ja.root&&this.updatePageRoot(ja);null!=ja.viewState&&(M=ja.viewState.pageVisible,V=ja.viewState.mathEnabled,ea=ja.viewState.shadowVisible,da=ja.viewState.background,ia=ja.viewState.backgroundImage,K.pageFormat=ja.viewState.pageFormat,K.gridSize=ja.viewState.gridSize);+null!=ia&&null!=ia.originalSrc&&(ia=this.createImageForPageLink(ia.originalSrc,ja));K.background=da;K.backgroundImage=null!=ia?new mxImage(ia.src,ia.width,ia.height,ia.x,ia.y):null;K.pageVisible=M;K.mathEnabled=V;K.shadowVisible=ea;var la=K.getGraphBounds;K.getGraphBounds=function(){var W=la.apply(this,arguments),k=this.backgroundImage;if(null!=k&&null!=k.width&&null!=k.height){var y=this.view.translate,J=this.view.scale;W=mxRectangle.fromRectangle(W);W.add(new mxRectangle((y.x+k.x)*J,(y.y+k.y)*J,+k.width*J,k.height*J))}return W};var ka=K.getGlobalVariable;K.getGlobalVariable=function(W){return"page"==W?ja.getName():"pagenumber"==W?Q+1:"pagecount"==W?null!=this.pages?this.pages.length:1:ka.apply(this,arguments)};document.body.appendChild(K.container);this.updatePageRoot(ja);K.model.setRoot(ja.root)}B=I(K,B,Q!=D,ja.getId());K!=t&&K.container.parentNode.removeChild(K.container)}}else B=I(t);null==B||null==B.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(B.mathEnabled&&+(I=B.wnd.document,c||(B.wnd.IMMEDIATE_PRINT=!0),I.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),B.closeDocument(),Graph.rewritePageLinks(B.wnd.document,!0),B.mathEnabled||c||PrintDialog.printPreview(B));return B}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var g=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(t){null!=g&&(g.parentNode.removeChild(g),g=null);t.stopPropagation();t.preventDefault()}),mxEvent.addListener(c[l],+"dragover",mxUtils.bind(this,function(t){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==g&&(g=this.highlightElement());t.stopPropagation();t.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(t){null!=g&&(g.parentNode.removeChild(g),g=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<t.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(t.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(t)&&+!mxEvent.isShiftDown(t)):this.openFiles(t.dataTransfer.files,!0);else{var B=this.extractGraphModelFromEvent(t);if(null==B){var D=null!=t.dataTransfer?t.dataTransfer:t.clipboardData;null!=D&&(10==document.documentMode||11==document.documentMode?B=D.getData("Text"):(B=null,B=0<=mxUtils.indexOf(D.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(D.types,"text/html")?D.getData("text/html"):null,null!=B&&0<B.length?(D=document.createElement("div"),D.innerHTML=Graph.sanitizeHtml(B),+D=D.getElementsByTagName("img"),0<D.length&&(B=D[0].getAttribute("src"))):0<=mxUtils.indexOf(D.types,"text/plain")&&(B=D.getData("text/plain"))),null!=B&&(Editor.isPngDataUrl(B)?(B=Editor.extractGraphModelFromPng(B),null!=B&&0<B.length&&this.openLocalFile(B,null,!0)):this.isRemoteFileFormat(B)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(B))).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(B)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(B):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(B)))))}else this.openLocalFile(B,null,!0)}t.stopPropagation();t.preventDefault()}))};+EditorUi.prototype.highlightElement=function(c){var g=0,l=0;if(null==c){var t=document.body;var B=document.documentElement;var D=(t.clientWidth||B.clientWidth)-3;t=Math.max(t.clientHeight||0,B.clientHeight)-3}else t=c.getBoundingClientRect(),g=t.top,l=t.left,D=t.width,t=t.height;B=document.createElement("div");B.style.zIndex=mxPopupMenu.prototype.zIndex+2;B.style.border="3px dotted rgb(254, 137, 12)";B.style.pointerEvents="none";B.style.position="absolute";B.style.top=g+"px";B.style.left=l+"px";B.style.width=+Math.max(0,D-3)+"px";B.style.height=Math.max(0,t-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(B):document.body.appendChild(B);return B};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var g=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=g){var l=new mxCodec(g.ownerDocument),t=new mxGraphModel;l.decode(g,t);g=t.getChildAt(t.getRoot(),0);for(l=0;l<t.getChildCount(g);l++)c.push(t.getChildAt(g,l))}return c};EditorUi.prototype.openFileHandle=+function(c,g,l,t,B,D){if(null!=g&&0<g.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(g)||/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var I=mxUtils.bind(this,function(M){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==M.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,M,g)),+this.showSidebar()}catch(V){this.handleError(V,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(M,g,t)});if(EditorUi.isVisioFilename(g))this.importVisio(l,mxUtils.bind(this,function(M){this.spinner.stop();I(M)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(M){this.spinner.stop();I(M)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),+mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(M){4==M.readyState&&(this.spinner.stop(),200<=M.status&&299>=M.status?I(M.responseText):this.handleError({message:mxResources.get(413==M.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(M){this.spinner.stop();this.openLocalFile(M,g,t)}),+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,t);try{this.loadLibrary(new LocalLibrary(this,c,l.name)),this.showSidebar()}catch(M){this.handleError(M,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(M){this.spinner.stop();I(M)}),mxUtils.bind(this,+function(){this.spinner.stop();this.openLocalFile(c,g,t)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var K=Editor.extractGraphModelFromPdf(c);null!=K&&(B=null,t=!0,c=K)}this.spinner.stop();this.openLocalFile(c,g,t,B,null!=B?l:null,D)}}};EditorUi.prototype.openFiles=function(c,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=0;l<c.length;l++)mxUtils.bind(this,function(t){var B=new FileReader;B.onload=+mxUtils.bind(this,function(D){try{this.openFileHandle(D.target.result,t.name,t,g)}catch(I){this.handleError(I)}});B.onerror=mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?B.readAsText(t):B.readAsDataURL(t)})(c[l])};EditorUi.prototype.openLocalFile=function(c,g,l,t,B,D){var I=this.getCurrentFile(),K=mxUtils.bind(this,function(){window.openFile=null;if(null==+g&&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,g||this.defaultFilename,l,t,B,D))});if(null!=c&&0<c.length)null==I||!I.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?K():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&null!=I&&I.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,g),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=I&&I.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 g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),+this.addBasenamesForCell(this.pages[g].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);g=[];for(var l in c)g.push(l);return g};EditorUi.prototype.addBasenamesForCell=function(c,g){function l(I){if(null!=I){var K=I.lastIndexOf(".");0<K&&(I=I.substring(K+1,I.length));null==g[I]&&(g[I]=!0)}}var t=this.editor.graph,B=t.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(B[mxConstants.STYLE_SHAPE]));t.model.isEdge(c)&&(l(mxMarker.getPackageForType(B[mxConstants.STYLE_STARTARROW])),l(mxMarker.getPackageForType(B[mxConstants.STYLE_ENDARROW])));B=t.model.getChildCount(c);for(var D=0;D<B;D++)this.addBasenamesForCell(t.model.getChildAt(c,D),g)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||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(g,l,t,B){c||(c=!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);Editor.fitDiagramOnLoad&&this.initialFitDiagram();if(B)try{var D=this.editor.graph;D.setGridEnabled(!1);D.pageVisible=!1;var I=D.model.cells,L;for(L in I){var N=I[L];null!=N&&null!=N.style&&(N.style+=";sketch=1;"+(-1==N.style.indexOf("fontFamily=")||-1<N.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||this.noAutoFocus||window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&+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);Editor.fitDiagramOnLoad&&this.initialFitDiagram();if(B)try{var D=this.editor.graph;D.setGridEnabled(!1);D.pageVisible=!1;var I=D.model.cells,K;for(K in I){var M=I[K];null!=M&&null!=M.style&&(M.style+=";sketch=1;"+(-1==M.style.indexOf("fontFamily=")||-1<M.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":+""))}}catch(V){console.log(V)}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||this.noAutoFocus||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,g){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(l){this.spinner.stop();g(l)})):g(null)};EditorUi.prototype.createLoadMessage=function(c){var g=this.editor.graph,l=g.getGraphBounds(),t=g.view.scale,B=g.view.translate;return{event:c,pageVisible:g.pageVisible,translate:B,bounds:l,currentPage:this.getSelectedPageIndex(),scale:t,page:g.view.getBackgroundPageBounds(),modelBounds:{x:l.x/t-B.x,y:l.y/t-B.y,width:l.width/t,height:l.height/t},containerSize:{width:g.container.clientWidth,height:g.container.clientHeight,offsetWidth:g.container.offsetWidth,offsetHeight:g.container.offsetHeight}}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var g=this.editor.graph;g.isEditing()&&g.stopEditing(!g.isInvokesStopCellEditing());var l=this.embedMessageSource||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(B){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(B)}),"*")}),null,null,!0,t,1,this.embedExportBorder,null,this.embedExportTheme)}else c||l.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),-"*");c||(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(B){c||this.handleError(B)}};EditorUi.prototype.installMessageHandler=function(c){var g=null,l=!1,t=!1,B=null,D=mxUtils.bind(this,function(N,K){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,-function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,D);mxEvent.addListener(window,"message",mxUtils.bind(this,function(N){if(N.source==(this.embedMessageSource||window.opener||window.parent)){var K=N.data,da=null,ja=mxUtils.bind(this,function(oa){if(null!=oa&&"function"===typeof oa.charAt&&"<"!=oa.charAt(0))try{Editor.isPngDataUrl(oa)?oa=Editor.extractGraphModelFromPng(oa):"data:image/svg+xml;base64,"==-oa.substring(0,26)?oa=atob(oa.substring(26)):"data:image/svg+xml;utf8,"==oa.substring(0,24)&&(oa=oa.substring(24)),null!=oa&&(""==oa.trim()?oa=null:"%"==oa.charAt(0)?oa=decodeURIComponent(oa):"<"!=oa.charAt(0)&&(oa=Graph.decompress(oa)))}catch(Da){}return oa});if("json"==urlParams.proto){var ea=!1;try{K=JSON.parse(K),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[N],"data",[K])}catch(oa){K=null}try{var ca=K;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 fa=new FilenameDialog(this,K.defaultValue||"",null!=K.okKey?mxResources.get(K.okKey):K.ok,function(oa){null!=oa?I.postMessage(JSON.stringify({event:"prompt",-value:oa,message:K}),"*"):I.postMessage(JSON.stringify({event:"prompt-cancel",message:K}),"*")},null!=K.titleKey?mxResources.get(K.titleKey):K.title,null,null,null,null,function(){I.postMessage(JSON.stringify({event:"prompt-cancel",message:K}),"*")});this.showDialog(fa.container,300,80,!0,!1);fa.init();return}if("draft"==K.action){var la=ja(K.xml);this.spinner.stop();fa=new DraftDialog(this,mxResources.get("draftFound",[K.name||this.defaultFilename]),la,mxUtils.bind(this,function(){this.hideDialog();-I.postMessage(JSON.stringify({event:"draft",result:"edit",message:K}),"*")}),mxUtils.bind(this,function(){this.hideDialog();I.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();I.postMessage(JSON.stringify({event:"draft",result:"ignore",message:K}),"*")}):null);this.showDialog(fa.container,640,480,!0,!1,mxUtils.bind(this,function(oa){oa&&-this.actions.get("exit").funct()}));try{fa.init()}catch(oa){I.postMessage(JSON.stringify({event:"draft",error:oa.toString(),message:K}),"*")}return}if("template"==K.action){this.spinner.stop();var ka=1==K.enableRecent,V=1==K.enableSearch,k=1==K.enableCustomTemp;fa=new NewDialog(this,!1,K.templatesOnly?!1:null!=K.callback,mxUtils.bind(this,function(oa,Da,Ca,Ja){oa=oa||this.emptyDiagramXml;null!=K.callback?I.postMessage(JSON.stringify({event:"template",xml:oa,blank:oa==this.emptyDiagramXml,name:Da,-tempUrl:Ca,libs:Ja,builtIn:!0,message:K}),"*"):(c(oa,N,oa!=this.emptyDiagramXml,K.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,ka?mxUtils.bind(this,function(oa){this.remoteInvoke("getRecentDiagrams",[null],null,oa,function(){oa(null,"Network Error!")})}):null,V?mxUtils.bind(this,function(oa,Da){this.remoteInvoke("searchDiagrams",[oa,null],null,Da,function(){Da(null,"Network Error!")})}):null,mxUtils.bind(this,function(oa,Da,Ca){I.postMessage(JSON.stringify({event:"template",-docUrl:oa,info:Da,name:Ca}),"*")}),null,null,k?mxUtils.bind(this,function(oa){this.remoteInvoke("getCustomTemplates",null,null,oa,function(){oa({},0)})}):null,1==K.withoutType,null,K.templatesOnly);this.showDialog(fa.container,620,460,!0,!1,mxUtils.bind(this,function(oa){null!=this.sidebar&&this.sidebar.hideTooltip();oa&&!K.noExitOnCancel&&this.actions.get("exit").funct()}));fa.init();return}if("textContent"==K.action){var x=this.getDiagramTextContent();I.postMessage(JSON.stringify({event:"textContent",-data:x,message:K}),"*");return}if("status"==K.action){this.updateStatus(mxUtils.bind(this,function(){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 J=null!=K.messageKey?mxResources.get(K.messageKey):K.message;null==K.show||K.show?this.spinner.spin(document.body,J):this.spinner.stop();return}if("exit"==-K.action){this.actions.get("exit").funct();return}if("viewport"==K.action){if(null!=K.viewport){var R=this.editor.graph,Y=R.view.translate.x,Z=R.view.translate.y;this.embedViewport=K.viewport;R.refresh();this.diagramContainer.scrollTop-=(Z-R.view.translate.y)*R.view.scale;this.diagramContainer.scrollLeft-=(Y-R.view.translate.x)*R.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==K.action){var W=this.actions.get(K.actionName);null!=W&&W.funct();return}if("resetEditor"==-K.action){R=this.editor.graph;R.isEditing()&&R.stopEditing(!1);this.hideCurrentMenu();R.popupMenuHandler.hideMenu();R.clearSelection();return}if("fit"==K.action){R=this.editor.graph;var U=R.maxFitScale;R.maxFitScale=null!=K.maxScale?K.maxScale:1;R.fit(null!=K.border?K.border:16,null,null,null,null,!0);R.maxFitScale=U;J=this.createLoadMessage("fit");J.message=K;I.postMessage(JSON.stringify(J),"*");return}if("fullscreenChanged"==K.action){fa=null;try{var aa=this.diagramContainer.getAttribute("data-scrollState");-null!=aa&&(this.diagramContainer.removeAttribute("data-scrollState"),fa=JSON.parse(aa))}catch(oa){}Editor.inlineFullscreen=K.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=fa&&this.restoreScrollState(fa);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 ia=null!=K.xml?K.xml:-this.getFileData(!0);this.editor.graph.setEnabled(!1);R=this.editor.graph;var na=mxUtils.bind(this,function(oa,Da){if(K.withSvg)K.withSvg=!1,this.getEmbeddedSvg(ia,this.editor.graph,null,!0,function(Ja){na(oa,Ja)},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 Ca=this.createLoadMessage("export");Ca.format=K.format;Ca.message=ca;Ca.data=oa;Ca.svg=Da;Ca.xml=ia;I.postMessage(JSON.stringify(Ca),"*")}}),-qa=mxUtils.bind(this,function(oa){null==oa&&(oa=Editor.blankImage);"xmlpng"==K.format&&(oa=Editor.writeGraphModelToPng(oa,"tEXt","mxfile",encodeURIComponent(ia)));R!=this.editor.graph&&R.container.parentNode.removeChild(R.container);na(oa)}),ta=K.pageId||(null!=this.pages?K.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ua=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=ta){var oa=R.getGlobalVariable;R=this.createTemporaryGraph(R.getStylesheet());-for(var Da,Ca=0;Ca<this.pages.length;Ca++)if(this.pages[Ca].getId()==ta){Da=this.updatePageRoot(this.pages[Ca]);break}null==Da&&(Da=this.currentPage);R.getGlobalVariable=function(y){return"page"==y?Da.getName():"pagenumber"==y?1:oa.apply(this,arguments)};document.body.appendChild(R.container);R.model.setRoot(Da.root)}if(null!=K.layerIds){var Ja=R.model,Xa=Ja.getChildCells(Ja.getRoot()),ib={};for(Ca=0;Ca<K.layerIds.length;Ca++)ib[K.layerIds[Ca]]=!0;for(Ca=0;Ca<Xa.length;Ca++)Ja.setVisible(Xa[Ca],ib[Xa[Ca].id]||-!1)}Ca=null;K.keepTheme&&(Ca=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(y){qa(y.toDataURL("image/png"))}),K.width,null,K.background,mxUtils.bind(this,function(){qa(null)}),null,null,K.scale,K.transparent,K.shadow,null,R,K.border,null,K.grid,Ca,K.size)});null!=K.xml&&0<K.xml.length&&(l=!0,this.setFileData(ia),l=!1);ua()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==K.format?"1":"0")+(null!=ta?"&pageId="+ta:"")+(null!=K.layerIds&&0<-K.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:K.layerIds})):"")+(null!=K.scale?"&scale="+K.scale:"")+"&base64=1&xml="+encodeURIComponent(ia))).send(mxUtils.bind(this,function(oa){200<=oa.getStatus()&&299>=oa.getStatus()?na("data:image/png;base64,"+oa.getText()):qa(null)}),mxUtils.bind(this,function(){qa(null)}))}}else if(ua=mxUtils.bind(this,function(){var oa=this.createLoadMessage("export");oa.message=K;if("html2"==K.format||"html"==K.format&&("0"!=urlParams.pages||null!=-this.pages&&1<this.pages.length)){var Da=this.getXmlFileData();oa.xml=mxUtils.getXml(Da);oa.data=this.getFileData(null,null,!0,null,null,null,Da);oa.format=K.format}else if("html"==K.format)Da=this.editor.getGraphXml(),oa.data=this.getHtml(Da,this.editor.graph),oa.xml=mxUtils.getXml(Da),oa.format=K.format;else{if("xml"==K.format)oa.xml=this.getFileData(!0),oa.format=K.format,I.postMessage(JSON.stringify(oa),"*");else{mxSvgCanvas2D.prototype.foAltText=null;Da=null!=K.background?K.background:this.editor.graph.background;-Da==mxConstants.NONE&&(Da=null);oa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);oa.format="svg";var Ca=mxUtils.bind(this,function(Xa){this.editor.graph.setEnabled(!0);this.spinner.stop();oa.data=K.asText?Xa:Editor.createSvgDataUri(Xa);I.postMessage(JSON.stringify(oa),"*")}),Ja="auto";K.keepTheme&&(Ja=Editor.isDarkMode()?"dark":"light");null!=K.theme&&(Ja=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)){Ja=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ja="auto";null!=K.theme&&(Ja=K.theme);this.getEmbeddedSvg(oa.xml,this.editor.graph,null,!0,Ca,null,null,K.embedImages,Da,K.scale,K.border,K.shadow,Ja)}}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),Da=this.editor.graph.getSvg(Da,K.scale,K.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||K.shadow,null,Ja),(this.editor.graph.shadowVisible||-K.shadow)&&this.editor.graph.addSvgShadow(Da),this.embedFonts(Da,mxUtils.bind(this,function(Xa){K.embedImages||null==K.embedImages?this.editor.convertImages(Xa,mxUtils.bind(this,function(ib){Ca(mxUtils.getXml(ib))})):Ca(mxUtils.getXml(Xa))}))}return}I.postMessage(JSON.stringify(oa),"*")}),null!=K.xml&&0<K.xml.length){if(this.editor.graph.mathEnabled){var Ba=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){Ba.apply(this,arguments);ua()}}l=!0;this.setFileData(K.xml);l=!1;this.editor.graph.mathEnabled||-ua()}else ua();return}if("load"==K.action){ea=K.toSketch;t=1==K.autosave;var za=K.sourceMetadata||null;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+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=K.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=K.noSaveBtn);if(null!=K.rough){var Aa=Editor.sketchMode;this.doSetSketchMode(K.rough);Aa!=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.scale){var Ga=K.scale,Ra=null!=K.scaleBorder?K.scaleBorder:this.embedExportBorder||0,Ha=null!=K.border?K.border:0;da=mxUtils.bind(this,function(){var oa=this.editor.graph,Da=oa.getGraphBounds();if(0<Da.width&&0<Da.height){var Ca=oa.view.scale;oa.view.scaleAndTranslate(Ga,oa.view.translate.x+Ha-Da.x/Ca+Ra/Ga,oa.view.translate.y+Ha-Da.y/Ca+Ra/Ga)}})}else if(null!=K.fit){var Qa=-null!=K.border?K.border:0,eb=K.maxFitScale||1;da=mxUtils.bind(this,function(){var oa=this.editor.graph,Da=oa.maxFitScale;oa.maxFitScale=eb;oa.fit(Qa,null,null,null,null,!0);oa.maxFitScale=Da})}if(null!=K.rect){Ha=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 Ma=K.maxFitScale,ya=K.rect.width+2*Ha,Sa=K.rect.height+2*Ha;da=mxUtils.bind(this,function(){var oa=mxUtils.getDocumentSize();ya=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ya):ya,oa.width-80);oa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Sa):Sa,oa.height-80);this.diagramContainer.style.width=ya+"px";this.diagramContainer.style.height=oa+"px";var Da=this.editor.graph;oa=Da.maxFitScale;Da.maxFitScale=Ma;Da.fit(2*-Ha,null,null,null,null,null,Sa);this.setPageVisible(!1);if(null!=this.minInlineWidth&&Da.getGraphBounds().width<this.minInlineWidth){var Ca=Da.container.scrollTop;this.resetScrollbars();Da.container.scrollTop=Ca}Da.maxFitScale=oa;Da.container.scrollTop-=Ha;Da.container.scrollLeft-=Ha;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[K]));Da.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&-(this.formatWindow.window.div.style.top=Da.container.style.top);var Ja=Da.getGraphBounds();Da.container.clientWidth>Ja.width+2*Ha&&(Da.container.scrollLeft=Ja.x+(Ja.width+Ha-Da.container.clientWidth)/2)}),10)})}null!=K.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=K.noExitBtn);null!=K.title&&null!=this.buttonContainer&&this.setEmbedTitle(K.title);try{K.libs&&this.sidebar.showEntries(K.libs)}catch(oa){}if(null!=K.xmlpng)K=this.extractGraphModelFromPng(K.xmlpng);else if(null!=K.descriptor){if(K=-K.descriptor,"mermaid"==K.format){window.isMermaidEnabled?this.parseMermaidDiagram(K.data,null,mxUtils.bind(this,function(oa){c(oa,N,null,ea);oa=this.createLoadMessage("load");oa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);oa.message=ca;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(oa),"*");if(null!=za&&null!=za.key&&null!=za.value){oa=this.editor.graph;var Da=oa.getModel().getRoot();if(null!=Da){oa.getModel().beginUpdate();try{oa.setAttributeForCell(Da,-za.key,za.value)}finally{oa.getModel().endUpdate()}}}}),mxUtils.bind(this,function(oa){this.handleError(oa)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else K=K.xml}else{if("merge"==K.action){var Oa=this.getCurrentFile();null!=Oa&&(la=ja(K.xml),null!=la&&""!=la&&Oa.mergeFile(new LocalFile(this,la),function(){I.postMessage(JSON.stringify({event:"merge",message:K}),"*")},function(oa){I.postMessage(JSON.stringify({event:"merge",-message:K,error:oa}),"*")}))}else"remoteInvokeReady"==K.action?this.handleRemoteInvokeReady(I):"remoteInvoke"==K.action?this.handleRemoteInvoke(K,N.origin):"remoteInvokeResponse"==K.action?this.handleRemoteInvokeResponse(K):I.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(K)}),"*");return}}catch(oa){this.handleError(oa)}}var Na=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),-Pa=mxUtils.bind(this,function(oa,Da){l=!0;try{c(oa,Da,null,ea)}catch(Ca){this.handleError(Ca)}l=!1;null!=urlParams.modified&&this.clearStatus();B=Na();t&&null==g&&(g=mxUtils.bind(this,function(Ca,Ja){Ca=Na();Ca==B||l||(Ja=this.createLoadMessage("autosave"),Ja.xml=Ca,Ja.message=ca,(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Ja),"*"));B=Ca}),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));null!=da&&da();if("1"==urlParams.returnbounds||"json"==urlParams.proto)Da=this.createLoadMessage("load"),Da.xml=oa,I.postMessage(JSON.stringify(Da),-"*")});null!=K&&"function"===typeof K.substring&&"data:application/vnd.visio;base64,"==K.substring(0,34)?(ja="0M8R4KGxGuE"==K.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(oa){Pa(oa,N)},mxUtils.bind(this,function(oa){this.handleError(oa)}),ja)):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(oa){4==oa.readyState&&(200<=oa.status&&299>=oa.status&&"<mxGraphModel"==oa.responseText.substring(0,13)?Pa(oa.responseText,N):this.handleError({message:413==oa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=K&&"function"===typeof K.substring&&this.isLucidChartData(K)?this.convertLucidChart(K,mxUtils.bind(this,function(oa){Pa(oa)}),mxUtils.bind(this,function(oa){this.handleError(oa)})):null==K||"object"!==typeof K||-null==K.format||null==K.data&&null==K.url?(K=ja(K),Pa(K,N)):this.loadDescriptor(K,mxUtils.bind(this,function(oa){Pa(Na(),N)}),mxUtils.bind(this,function(oa){this.handleError(oa,mxResources.get("errorLoadingFile"))}))}}));var I=this.embedMessageSource||window.opener||window.parent;D="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";I.postMessage(D,"*");if("json"==urlParams.proto){var L=this.editor.graph.openLink;this.editor.graph.openLink=function(N,K,da){L.apply(this,-arguments);I.postMessage(JSON.stringify({event:"openLink",href:N,target:K,allowOpener:da}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,g,l,t){var B=document.createElement("button");B.className="geEmbedBtn geBtn";B.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(B,c);t&&B.classList.add("gePrimaryBtn");mxEvent.addListener(B,"click",g);return B};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);-"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);-"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==-urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,-mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var g=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var t=JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(t));-this.customLayoutConfig=t;this.hideDialog()}catch(B){this.handleError(B)}}),null,null,null,null,mxUtils.bind(this,function(l,t){var B=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var D=t.value;t.value=JSON.stringify(JSON.parse(D));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=D}catch(I){this.handleError(I)}}));B.setAttribute("title",-"copy");B.className="geBtn";l.appendChild(B)}),!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(c,g){this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),B=mxUtils.bind(this,function(D){this.loadingOrgChart=!1;l.clear()&&this.handleError(D)});-if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))t();else if(g||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",t,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",t,null,null,null,B)}),onerror)};EditorUi.prototype.importCsv=function(c,g,l,t){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,g,l)}),t)};EditorUi.prototype.doImportCsv=function(c,g,l){try{var t=c.split("\n"),B=[],D=[],I=[],L={};if(0<t.length){var N={};l=null!=l?l:this.editor.graph;var K=null,da=null,ja=null,ea=null,ca=null,fa=null,la=null,ka="whiteSpace=wrap;html=1;",V=null,k=null,x="",J="auto",R="auto",Y=!1,Z=null,W=null,U=40,aa=40,ia=100,na=0,qa=mxUtils.bind(this,-function(){null!=g?g(ba):(l.setSelectionCells(ba),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ta=l.getFreeInsertPoint(),ua=ta.x,Ba=ta.y;ta=Ba;var za=null,Aa="auto";k=null;for(var Ga=[],Ra=null,Ha=null,Qa=0;Qa<t.length&&"#"==t[Qa].charAt(0);){c=t[Qa].replace(/\r$/,"");for(Qa++;Qa<t.length&&"\\"==c.charAt(c.length-1)&&"#"==t[Qa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(t[Qa].substring(1)),-Qa++;if("#"!=c.charAt(1)){var eb=c.indexOf(":");if(0<eb){var Ma=mxUtils.trim(c.substring(1,eb)),ya=mxUtils.trim(c.substring(eb+1));"label"==Ma?za=Graph.sanitizeHtml(ya):"labelname"==Ma&&0<ya.length&&"-"!=ya?ca=ya:"labels"==Ma&&0<ya.length&&"-"!=ya?la=JSON.parse(ya):"style"==Ma?da=ya:"parentstyle"==Ma?ka=ya:"unknownStyle"==Ma&&"-"!=ya?fa=ya:"stylename"==Ma&&0<ya.length&&"-"!=ya?ea=ya:"styles"==Ma&&0<ya.length&&"-"!=ya?ja=JSON.parse(ya):"vars"==Ma&&0<ya.length&&"-"!=ya?K=JSON.parse(ya):"identity"==-Ma&&0<ya.length&&"-"!=ya?V=ya:"parent"==Ma&&0<ya.length&&"-"!=ya?k=ya:"namespace"==Ma&&0<ya.length&&"-"!=ya?x=ya:"width"==Ma?J=ya:"height"==Ma?R=ya:"collapsed"==Ma&&"-"!=ya?Y="true"==ya:"left"==Ma&&0<ya.length?Z=ya:"top"==Ma&&0<ya.length?W=ya:"ignore"==Ma?Ha=ya.split(","):"connect"==Ma?Ga.push(JSON.parse(ya)):"link"==Ma?Ra=ya:"padding"==Ma?na=parseFloat(ya):"edgespacing"==Ma?U=parseFloat(ya):"nodespacing"==Ma?aa=parseFloat(ya):"levelspacing"==Ma?ia=parseFloat(ya):"layout"==Ma&&(Aa=ya)}}}if(null==-t[Qa])throw Error(mxResources.get("invalidOrMissingFile"));var Sa=this.editor.csvToArray(t[Qa].replace(/\r$/,""));eb=c=null;Ma=[];for(ya=0;ya<Sa.length;ya++)V==Sa[ya]&&(c=ya),k==Sa[ya]&&(eb=ya),Ma.push(mxUtils.trim(Sa[ya]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==za&&(za="%"+Ma[0]+"%");if(null!=Ga)for(var Oa=0;Oa<Ga.length;Oa++)null==N[Ga[Oa].to]&&(N[Ga[Oa].to]={});V=[];for(ya=Qa+1;ya<t.length;ya++){var Na=this.editor.csvToArray(t[ya].replace(/\r$/,""));if(null==Na){var Pa=-40<t[ya].length?t[ya].substring(0,40)+"...":t[ya];throw Error(Pa+" ("+ya+"):\n"+mxResources.get("containsValidationErrors"));}0<Na.length&&V.push(Na)}l.model.beginUpdate();try{for(ya=0;ya<V.length;ya++){Na=V[ya];var oa=null,Da=null!=c?x+Na[c]:null;t=!1;null!=Da&&(oa=l.model.getCell(Da),t=null==oa||0<=mxUtils.indexOf(B,oa));var Ca=new mxCell(za,new mxGeometry(ua,ta,0,0),da||"whiteSpace=wrap;html=1;");Ca.collapsed=Y;Ca.vertex=!0;Ca.id=Da;null==oa||t||l.model.setCollapsed(oa,Y);for(var Ja=0;Ja<Na.length;Ja++)l.setAttributeForCell(Ca,-Ma[Ja],Na[Ja]),null==oa||t||l.setAttributeForCell(oa,Ma[Ja],Na[Ja]);if(null!=ca&&null!=la){var Xa=la[Ca.getAttribute(ca)];null!=Xa&&(l.labelChanged(Ca,Xa),null==oa||t||l.cellLabelChanged(oa,Xa))}if(null!=ea&&null!=ja){var ib=ja[Ca.getAttribute(ea)];null!=ib&&(Ca.style=ib)}l.setAttributeForCell(Ca,"placeholders","1");Ca.style=l.replacePlaceholders(Ca,Ca.style,K);null==oa||t?l.fireEvent(new mxEventObject("cellsInserted","cells",[Ca])):(l.model.setStyle(oa,Ca.style),0>mxUtils.indexOf(I,oa)&&I.push(oa),-l.fireEvent(new mxEventObject("cellsInserted","cells",[oa])));t=null!=oa;oa=Ca;if(!t)for(Oa=0;Oa<Ga.length;Oa++)N[Ga[Oa].to][oa.getAttribute(Ga[Oa].to)]=oa;null!=Ra&&"link"!=Ra&&(l.setLinkForCell(oa,oa.getAttribute(Ra)),l.setAttributeForCell(oa,Ra,null));var y=l.getPreferredSizeForCell(oa);k=null!=eb?l.model.getCell(x+Na[eb]):null;if(oa.vertex){Pa=null!=k?0:ua;Qa=null!=k?0:Ba;null!=Z&&null!=oa.getAttribute(Z)&&(oa.geometry.x=Pa+parseFloat(oa.getAttribute(Z)));null!=W&&null!=oa.getAttribute(W)&&(oa.geometry.y=-Qa+parseFloat(oa.getAttribute(W)));var P="@"==J.charAt(0)?oa.getAttribute(J.substring(1)):null;oa.geometry.width=null!=P&&"auto"!=P?parseFloat(oa.getAttribute(J.substring(1))):"auto"==J||"auto"==P?y.width+na:parseFloat(J);var S="@"==R.charAt(0)?oa.getAttribute(R.substring(1)):null;oa.geometry.height=null!=S&&"auto"!=S&&"width"!=R?parseFloat(S):"auto"==R||"auto"==S?y.height+na:"width"==R?oa.geometry.width:parseFloat(R);ta+=oa.geometry.height+aa}t?(null==L[Da]&&(L[Da]=[]),L[Da].push(oa)):(B.push(oa),-null!=k?(k.style=l.replacePlaceholders(k,ka,K),l.addCell(oa,k),D.push(k)):I.push(l.addCell(oa)))}for(ya=0;ya<D.length;ya++)P="@"==J.charAt(0)?D[ya].getAttribute(J.substring(1)):null,S="@"==R.charAt(0)?D[ya].getAttribute(R.substring(1)):null,"auto"!=J&&"auto"!=P||"auto"!=R&&"auto"!=S||l.updateGroupBounds([D[ya]],na,!0);var X=I.slice(),ba=I.slice();for(Oa=0;Oa<Ga.length;Oa++){var ma=Ga[Oa];for(ya=0;ya<B.length;ya++){oa=B[ya];var ra=mxUtils.bind(this,function(gb,bb,db){var lb=bb.getAttribute(db.from);-if(null!=lb&&""!=lb){lb=lb.split(",");for(var ub=0;ub<lb.length;ub++){var ob=N[db.to][lb[ub]];if(null==ob&&null!=fa){ob=new mxCell(lb[ub],new mxGeometry(ua,Ba,0,0),fa);ob.style=l.replacePlaceholders(bb,ob.style,K);var pb=l.getPreferredSizeForCell(ob);ob.geometry.width=pb.width+na;ob.geometry.height=pb.height+na;N[db.to][lb[ub]]=ob;ob.vertex=!0;ob.id=lb[ub];I.push(l.addCell(ob))}if(null!=ob){pb=db.label;null!=db.fromlabel&&(pb=(bb.getAttribute(db.fromlabel)||"")+(pb||""));null!=db.sourcelabel&&(pb=-l.replacePlaceholders(bb,db.sourcelabel,K)+(pb||""));null!=db.tolabel&&(pb=(pb||"")+(ob.getAttribute(db.tolabel)||""));null!=db.targetlabel&&(pb=(pb||"")+l.replacePlaceholders(ob,db.targetlabel,K));var sb="target"==db.placeholders==!db.invert?ob:gb;sb=null!=db.style?l.replacePlaceholders(sb,db.style,K):l.createCurrentEdgeStyle();pb=l.insertEdge(null,null,pb||"",db.invert?ob:gb,db.invert?gb:ob,sb);if(null!=db.labels)for(sb=0;sb<db.labels.length;sb++){var rb=db.labels[sb],tb=new mxCell(rb.label||sb,-new mxGeometry(null!=rb.x?rb.x:0,null!=rb.y?rb.y:0,0,0),"resizable=0;html=1;");tb.vertex=!0;tb.connectable=!1;tb.geometry.relative=!0;null!=rb.placeholders&&(tb.value=l.replacePlaceholders("target"==rb.placeholders==!db.invert?ob:gb,tb.value,K));if(null!=rb.dx||null!=rb.dy)tb.geometry.offset=new mxPoint(null!=rb.dx?rb.dx:0,null!=rb.dy?rb.dy:0);pb.insert(tb)}if(null!=db.data)for(var yb in db.data)l.setAttributeForCell(pb,yb,db.data[yb]);ba.push(pb);mxUtils.remove(db.invert?gb:ob,X)}}}});ra(oa,oa,ma);-if(null!=L[oa.id])for(Ja=0;Ja<L[oa.id].length;Ja++)ra(oa,L[oa.id][Ja],ma)}}if(null!=Ha)for(ya=0;ya<B.length;ya++)for(oa=B[ya],Ja=0;Ja<Ha.length;Ja++)l.setAttributeForCell(oa,mxUtils.trim(Ha[Ja]),null);if(0<I.length){var wa=new mxParallelEdgeLayout(l);wa.spacing=U;wa.checkOverlap=!0;var sa=function(){0<wa.spacing&&wa.execute(l.getDefaultParent());for(var gb=0;gb<I.length;gb++){var bb=l.getCellGeometry(I[gb]);bb.x=Math.round(l.snap(bb.x));bb.y=Math.round(l.snap(bb.y));"auto"==J&&(bb.width=Math.round(l.snap(bb.width)));-"auto"==R&&(bb.height=Math.round(l.snap(bb.height)))}};if("["==Aa.charAt(0)){var xa=qa;l.view.validate();this.executeLayouts(l.createLayouts(JSON.parse(Aa)),function(){sa();xa()});qa=null}else if("circle"==Aa){var Fa=new mxCircleLayout(l);Fa.disableEdgeStyle=!1;Fa.resetEdges=!1;var Ya=Fa.isVertexIgnored;Fa.isVertexIgnored=function(gb){return Ya.apply(this,arguments)||0>mxUtils.indexOf(I,gb)};this.executeLayout(function(){Fa.execute(l.getDefaultParent());sa()},!0,qa);qa=null}else if("horizontaltree"==-Aa||"verticaltree"==Aa||"auto"==Aa&&ba.length==2*I.length-1&&1==X.length){l.view.validate();var Ua=new mxCompactTreeLayout(l,"horizontaltree"==Aa);Ua.levelDistance=aa;Ua.edgeRouting=!1;Ua.resetEdges=!1;Ua.sortEdges=!0;this.executeLayout(function(){Ua.execute(l.getDefaultParent(),0<X.length?X[0]:null)},!0,qa);qa=null}else if("horizontalflow"==Aa||"verticalflow"==Aa||"auto"==Aa&&1==X.length){l.view.validate();var cb=new mxHierarchicalLayout(l,"horizontalflow"==Aa?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);-cb.intraCellSpacing=aa;cb.parallelEdgeSpacing=U;cb.interRankCellSpacing=ia;cb.disableEdgeStyle=!1;this.executeLayout(function(){cb.execute(l.getDefaultParent(),ba);l.moveCells(ba,ua,Ba)},!0,qa);qa=null}else if("orgchart"==Aa){l.view.validate();var hb=new mxOrgChartLayout(l,2,ia,aa),jb=hb.isVertexIgnored;hb.isVertexIgnored=function(gb){return jb.apply(this,arguments)||0>mxUtils.indexOf(I,gb)};this.executeLayout(function(){hb.execute(l.getDefaultParent());sa()},!0,qa);qa=null}else if("organic"==Aa||-"auto"==Aa&&ba.length>I.length){l.view.validate();var Ta=new mxFastOrganicLayout(l);Ta.forceConstant=3*aa;Ta.disableEdgeStyle=!1;Ta.resetEdges=!1;var qb=Ta.isVertexIgnored;Ta.isVertexIgnored=function(gb){return qb.apply(this,arguments)||0>mxUtils.indexOf(I,gb)};this.executeLayout(function(){Ta.execute(l.getDefaultParent());sa()},!0,qa);qa=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=qa&&qa()}}catch(gb){this.handleError(gb)}};EditorUi.prototype.getSearch=function(c){var g="";if("1"!=urlParams.offline&&-"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",t;for(t in urlParams)0>mxUtils.indexOf(c,t)&&null!=urlParams[t]&&(g+=l+t+"="+urlParams[t],l="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var g=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),t;for(t in urlParams)0>mxUtils.indexOf(l,-t)&&(c=0==g?c+"?":c+"&",null!=urlParams[t]&&(c+=t+"="+urlParams[t],g++))}return c};EditorUi.prototype.showLinkDialog=function(c,g,l,t,B){c=new LinkDialog(this,c,g,l,!0,t,B);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){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.m365&&g++;null!=-this.gitHub&&g++;null!=this.gitLab&&g++;c&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),g=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);this.menus.get("viewZoom").setEnabled(g);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);+"*");c||(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(B){c||this.handleError(B)}};EditorUi.prototype.installMessageHandler=function(c){var g=null,l=!1,t=!1,B=null,D=null,I=mxUtils.bind(this,function(V,Q){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,+function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,I);mxEvent.addListener(window,"message",mxUtils.bind(this,function(V){if(V.source==(this.embedMessageSource||window.opener||window.parent)){var Q=V.data,ja=null,ea=mxUtils.bind(this,function(ra){if(null!=ra&&"function"===typeof ra.charAt&&"<"!=ra.charAt(0))try{Editor.isPngDataUrl(ra)?ra=Editor.extractGraphModelFromPng(ra):"data:image/svg+xml;base64,"==+ra.substring(0,26)?ra=atob(ra.substring(26)):"data:image/svg+xml;utf8,"==ra.substring(0,24)&&(ra=ra.substring(24)),null!=ra&&(""==ra.trim()?ra=null:"%"==ra.charAt(0)?ra=decodeURIComponent(ra):"<"!=ra.charAt(0)&&(ra=Graph.decompress(ra)))}catch(Da){}return ra});if("json"==urlParams.proto){var da=!1;try{Q=JSON.parse(Q),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[V],"data",[Q])}catch(ra){Q=null}try{var ia=Q;if(null==Q)return;if("dialog"==Q.action){this.showError(null!=Q.titleKey?mxResources.get(Q.titleKey):+Q.title,null!=Q.messageKey?mxResources.get(Q.messageKey):mxUtils.htmlEntities(Q.message),null!=Q.buttonKey?mxResources.get(Q.buttonKey):Q.button);null!=Q.modified&&(this.editor.modified=Q.modified);return}if("layout"==Q.action){this.executeLayouts(this.editor.graph.createLayouts(Q.layouts));return}if("prompt"==Q.action){this.spinner.stop();var la=new FilenameDialog(this,Q.defaultValue||"",null!=Q.okKey?mxResources.get(Q.okKey):Q.ok,function(ra){null!=ra?K.postMessage(JSON.stringify({event:"prompt",+value:ra,message:Q}),"*"):K.postMessage(JSON.stringify({event:"prompt-cancel",message:Q}),"*")},null!=Q.titleKey?mxResources.get(Q.titleKey):Q.title,null,null,null,null,function(){K.postMessage(JSON.stringify({event:"prompt-cancel",message:Q}),"*")});this.showDialog(la.container,300,80,!0,!1);la.init();return}if("draft"==Q.action){var ka=ea(Q.xml);this.spinner.stop();la=new DraftDialog(this,mxResources.get("draftFound",[Q.name||this.defaultFilename]),ka,mxUtils.bind(this,function(){this.hideDialog();+K.postMessage(JSON.stringify({event:"draft",result:"edit",message:Q}),"*")}),mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"discard",message:Q}),"*")}),Q.editKey?mxResources.get(Q.editKey):null,Q.discardKey?mxResources.get(Q.discardKey):null,Q.ignore?mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"ignore",message:Q}),"*")}):null);this.showDialog(la.container,640,480,!0,!1,mxUtils.bind(this,function(ra){ra&&+this.actions.get("exit").funct()}));try{la.init()}catch(ra){K.postMessage(JSON.stringify({event:"draft",error:ra.toString(),message:Q}),"*")}return}if("template"==Q.action){this.spinner.stop();var W=1==Q.enableRecent,k=1==Q.enableSearch,y=1==Q.enableCustomTemp;la=new NewDialog(this,!1,Q.templatesOnly?!1:null!=Q.callback,mxUtils.bind(this,function(ra,Da,Ra,x){ra=ra||this.emptyDiagramXml;null!=Q.callback?K.postMessage(JSON.stringify({event:"template",xml:ra,blank:ra==this.emptyDiagramXml,name:Da,tempUrl:Ra,+libs:x,builtIn:!0,message:Q}),"*"):(c(ra,V,ra!=this.emptyDiagramXml,Q.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,W?mxUtils.bind(this,function(ra){this.remoteInvoke("getRecentDiagrams",[null],null,ra,function(){ra(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(ra,Da){this.remoteInvoke("searchDiagrams",[ra,null],null,Da,function(){Da(null,"Network Error!")})}):null,mxUtils.bind(this,function(ra,Da,Ra){K.postMessage(JSON.stringify({event:"template",+docUrl:ra,info:Da,name:Ra}),"*")}),null,null,y?mxUtils.bind(this,function(ra){this.remoteInvoke("getCustomTemplates",null,null,ra,function(){ra({},0)})}):null,1==Q.withoutType,null,Q.templatesOnly);this.showDialog(la.container,620,460,!0,!1,mxUtils.bind(this,function(ra){null!=this.sidebar&&this.sidebar.hideTooltip();ra&&!Q.noExitOnCancel&&this.actions.get("exit").funct()}));la.init();return}if("textContent"==Q.action){var J=this.getDiagramTextContent();K.postMessage(JSON.stringify({event:"textContent",+data:J,message:Q}),"*");return}if("status"==Q.action){this.updateStatus(mxUtils.bind(this,function(){null!=Q.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(Q.messageKey))):null!=Q.message&&this.editor.setStatus(mxUtils.htmlEntities(Q.message))}));null!=Q.modified&&(this.editor.modified=Q.modified);return}if("spinner"==Q.action){var R=null!=Q.messageKey?mxResources.get(Q.messageKey):Q.message;null==Q.show||Q.show?this.spinner.spin(document.body,R):this.spinner.stop();return}if("exit"==+Q.action){this.actions.get("exit").funct();return}if("viewport"==Q.action){if(null!=Q.viewport){var X=this.editor.graph,aa=X.view.translate.x,Z=X.view.translate.y;this.embedViewport=Q.viewport;X.refresh();this.diagramContainer.scrollTop-=(Z-X.view.translate.y)*X.view.scale;this.diagramContainer.scrollLeft-=(aa-X.view.translate.x)*X.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==Q.action){var U=this.actions.get(Q.actionName);null!=U&&U.funct();return}if("resetEditor"==+Q.action){X=this.editor.graph;X.isEditing()&&X.stopEditing(!1);this.hideCurrentMenu();X.popupMenuHandler.hideMenu();X.clearSelection();return}if("fit"==Q.action){X=this.editor.graph;var ba=X.maxFitScale;X.maxFitScale=null!=Q.maxScale?Q.maxScale:1;X.fit(null!=Q.border?Q.border:16,null,null,null,null,!0);X.maxFitScale=ba;R=this.createLoadMessage("fit");R.message=Q;K.postMessage(JSON.stringify(R),"*");return}if("fullscreenChanged"==Q.action){var fa=null;try{var na=this.diagramContainer.getAttribute("data-scrollState");+null!=na&&(this.diagramContainer.removeAttribute("data-scrollState"),fa=JSON.parse(na))}catch(ra){}Editor.inlineFullscreen=Q.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=fa&&this.restoreScrollState(fa);return}if("snapshot"==Q.action){this.sendEmbeddedSvgExport(!0);return}if("export"==Q.action){if("png"==Q.format||"xmlpng"==Q.format){if(null==Q.spin&&null==Q.spinKey||this.spinner.spin(document.body,null!=Q.spinKey?mxResources.get(Q.spinKey):Q.spin)){var pa=null!=Q.xml?Q.xml:+this.getFileData(!0);this.editor.graph.setEnabled(!1);X=this.editor.graph;var ta=mxUtils.bind(this,function(ra,Da){if(Q.withSvg)Q.withSvg=!1,this.getEmbeddedSvg(pa,this.editor.graph,null,!0,function(x){ta(ra,x)},null,null,Q.embedImages,this.editor.graph.background,Q.scale,Q.border,Q.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ra=this.createLoadMessage("export");Ra.format=Q.format;Ra.message=ia;Ra.data=ra;Ra.svg=Da;Ra.xml=pa;K.postMessage(JSON.stringify(Ra),"*")}}),+ua=mxUtils.bind(this,function(ra){null==ra&&(ra=Editor.blankImage);"xmlpng"==Q.format&&(ra=Editor.writeGraphModelToPng(ra,"tEXt","mxfile",encodeURIComponent(pa)));X!=this.editor.graph&&X.container.parentNode.removeChild(X.container);ta(ra)}),Ca=Q.pageId||(null!=this.pages?Q.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var Ba=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Ca){var ra=X.getGlobalVariable;X=this.createTemporaryGraph(X.getStylesheet());+for(var Da,Ra=0;Ra<this.pages.length;Ra++)if(this.pages[Ra].getId()==Ca){Da=this.updatePageRoot(this.pages[Ra]);break}null==Da&&(Da=this.currentPage);X.getGlobalVariable=function(Y){return"page"==Y?Da.getName():"pagenumber"==Y?1:ra.apply(this,arguments)};document.body.appendChild(X.container);X.model.setRoot(Da.root)}if(null!=Q.layerIds){var x=X.model,N=x.getChildCells(x.getRoot()),S={};for(Ra=0;Ra<Q.layerIds.length;Ra++)S[Q.layerIds[Ra]]=!0;for(Ra=0;Ra<N.length;Ra++)x.setVisible(N[Ra],S[N[Ra].id]||+!1)}Ra=null;Q.keepTheme&&(Ra=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Y){ua(Y.toDataURL("image/png"))}),Q.width,null,Q.background,mxUtils.bind(this,function(){ua(null)}),null,null,Q.scale,Q.transparent,Q.shadow,null,X,Q.border,null,Q.grid,Ra,Q.size)});null!=Q.xml&&0<Q.xml.length&&(l=!0,this.setFileData(pa),l=!1);Ba()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==Q.format?"1":"0")+(null!=Ca?"&pageId="+Ca:"")+(null!=Q.layerIds&&0<+Q.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:Q.layerIds})):"")+(null!=Q.scale?"&scale="+Q.scale:"")+"&base64=1&xml="+encodeURIComponent(pa))).send(mxUtils.bind(this,function(ra){200<=ra.getStatus()&&299>=ra.getStatus()?ta("data:image/png;base64,"+ra.getText()):ua(null)}),mxUtils.bind(this,function(){ua(null)}))}}else if(Ba=mxUtils.bind(this,function(){var ra=this.createLoadMessage("export");ra.message=Q;if("html2"==Q.format||"html"==Q.format&&("0"!=urlParams.pages||null!=+this.pages&&1<this.pages.length)){var Da=this.getXmlFileData();ra.xml=mxUtils.getXml(Da);ra.data=this.getFileData(null,null,!0,null,null,null,Da);ra.format=Q.format}else if("html"==Q.format)Da=this.editor.getGraphXml(),ra.data=this.getHtml(Da,this.editor.graph),ra.xml=mxUtils.getXml(Da),ra.format=Q.format;else{if("xml"==Q.format)ra.xml=this.getFileData(!0),ra.format=Q.format,K.postMessage(JSON.stringify(ra),"*");else{mxSvgCanvas2D.prototype.foAltText=null;Da=null!=Q.background?Q.background:this.editor.graph.background;+Da==mxConstants.NONE&&(Da=null);ra.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ra.format="svg";var Ra=mxUtils.bind(this,function(N){this.editor.graph.setEnabled(!0);this.spinner.stop();ra.data=Q.asText?N:Editor.createSvgDataUri(N);K.postMessage(JSON.stringify(ra),"*")}),x="auto";Q.keepTheme&&(x=Editor.isDarkMode()?"dark":"light");null!=Q.theme&&(x=Q.theme);if("xmlsvg"==Q.format){if(null==Q.spin&&null==Q.spinKey||this.spinner.spin(document.body,null!=Q.spinKey?mxResources.get(Q.spinKey):+Q.spin)){x=null;if(this.isAutoDarkMode()||Editor.isDarkMode())x="auto";null!=Q.theme&&(x=Q.theme);this.getEmbeddedSvg(ra.xml,this.editor.graph,null,!0,Ra,null,null,Q.embedImages,Da,Q.scale,Q.border,Q.shadow,x)}}else if(null==Q.spin&&null==Q.spinKey||this.spinner.spin(document.body,null!=Q.spinKey?mxResources.get(Q.spinKey):Q.spin))this.editor.graph.setEnabled(!1),Da=this.editor.graph.getSvg(Da,Q.scale,Q.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||Q.shadow,null,x),(this.editor.graph.shadowVisible||+Q.shadow)&&this.editor.graph.addSvgShadow(Da),this.embedFonts(Da,mxUtils.bind(this,function(N){Q.embedImages||null==Q.embedImages?this.editor.convertImages(N,mxUtils.bind(this,function(S){Ra(mxUtils.getXml(S))})):Ra(mxUtils.getXml(N))}))}return}K.postMessage(JSON.stringify(ra),"*")}),null!=Q.xml&&0<Q.xml.length){if(this.editor.graph.mathEnabled){var Aa=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){Aa.apply(this,arguments);Ba()}}l=!0;this.setFileData(Q.xml);l=!1;this.editor.graph.mathEnabled||+Ba()}else Ba();return}if("load"==Q.action){da=Q.toSketch;t=1==Q.autosave;this.embedDiffSync=null!=Q.diffSync&&!1!==Q.diffSync;this.embedDiffSyncPatchOnly="object"===typeof Q.diffSync&&null!=Q.diffSync&&1==Q.diffSync.patchOnly;this.embedExportProtocol=1==Q.exportProtocol;var Fa=Q.sourceMetadata||null;this.hideDialog();null!=Q.modified&&null==urlParams.modified&&(urlParams.modified=Q.modified);null!=Q.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=Q.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+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=Q.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=Q.noSaveBtn);if(null!=Q.rough){var Sa=Editor.sketchMode;this.doSetSketchMode(Q.rough);Sa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=+Q.dark&&this.setDarkMode(Q.dark);null!=Q.border&&(this.embedExportBorder=Q.border);null!=Q.theme&&(this.embedExportTheme=Q.theme);null!=Q.background&&(this.embedExportBackground=Q.background);null!=Q.viewport&&(this.embedViewport=Q.viewport);this.embedExitPoint=null;if(null!=Q.scale){var La=Q.scale,Pa=null!=Q.scaleBorder?Q.scaleBorder:this.embedExportBorder||0,db=null!=Q.border?Q.border:0;ja=mxUtils.bind(this,function(){var ra=this.editor.graph,Da=ra.getGraphBounds();if(0<Da.width&&0<Da.height){var Ra=+ra.view.scale;ra.view.scaleAndTranslate(La,ra.view.translate.x+db-Da.x/Ra+Pa/La,ra.view.translate.y+db-Da.y/Ra+Pa/La)}})}else if(null!=Q.fit){var Ia=null!=Q.border?Q.border:0,za=Q.maxFitScale||1;ja=mxUtils.bind(this,function(){var ra=this.editor.graph,Da=ra.maxFitScale;ra.maxFitScale=za;ra.fit(Ia,null,null,null,null,!0);ra.maxFitScale=Da})}if(null!=Q.rect){db=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,Q.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,Q.rect.top)++"px";this.minInlineWidth=Q.minWidth;this.minInlineHeight=Q.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Ua=Q.maxFitScale,Qa=Q.rect.width+2*db,Ma=Q.rect.height+2*db;ja=mxUtils.bind(this,function(){var ra=mxUtils.getDocumentSize();Qa=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Qa):Qa,ra.width-80);ra=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Ma):Ma,ra.height-+80);this.diagramContainer.style.width=Qa+"px";this.diagramContainer.style.height=ra+"px";var Da=this.editor.graph;ra=Da.maxFitScale;Da.maxFitScale=Ua;Da.fit(2*db,null,null,null,null,null,Ma);this.setPageVisible(!1);if(null!=this.minInlineWidth&&Da.getGraphBounds().width<this.minInlineWidth){var Ra=Da.container.scrollTop;this.resetScrollbars();Da.container.scrollTop=Ra}Da.maxFitScale=ra;Da.container.scrollTop-=db;Da.container.scrollLeft-=db;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart",+"data",[Q]));Da.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Da.container.style.top);var x=Da.getGraphBounds();Da.container.clientWidth>x.width+2*db&&(Da.container.scrollLeft=x.x+(x.width+db-Da.container.clientWidth)/2)}),10)})}null!=Q.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=Q.noExitBtn);null!=Q.title&&null!=this.buttonContainer&&this.setEmbedTitle(Q.title);try{Q.libs&&this.sidebar.showEntries(Q.libs)}catch(ra){}if(null!=+Q.xmlpng)Q=this.extractGraphModelFromPng(Q.xmlpng);else if(null!=Q.descriptor){if(Q=Q.descriptor,"mermaid"==Q.format){window.isMermaidEnabled?this.parseMermaidDiagram(Q.data,null,mxUtils.bind(this,function(ra){c(ra,V,null,da);ra=this.createLoadMessage("load");ra.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);ra.message=ia;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ra),"*");if(null!=Fa&&null!=Fa.key&&null!=Fa.value){ra=this.editor.graph;+var Da=ra.getModel().getRoot();if(null!=Da){ra.getModel().beginUpdate();try{ra.setAttributeForCell(Da,Fa.key,Fa.value)}finally{ra.getModel().endUpdate()}}}}),mxUtils.bind(this,function(ra){this.handleError(ra)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else Q=Q.xml}else{if("merge"==Q.action){var Na=this.getCurrentFile();null!=Na&&(ka=ea(Q.xml),null!=ka&&""!=ka&&Na.mergeFile(new LocalFile(this,ka),mxUtils.bind(this,+function(){this.embedDiffSync&&(D=this.clonePages(this.pages),B=Za());K.postMessage(JSON.stringify({event:"merge",message:Q}),"*")}),function(ra){K.postMessage(JSON.stringify({event:"merge",message:Q,error:ra}),"*")}))}else if("patch"==Q.action){if(Na=this.getCurrentFile(),null!=Na&&null!=Q.patch)try{l=!0,Na.patch([Q.patch]),this.embedDiffSync&&null!=D&&(D=this.applyPatches(D,[Q.patch])),B=Za(),l=!1,na={event:"patch",message:Q},fa=this.getHashValueForPages(this.pages),na.checksum=fa,null!=Q.checksum&&+Q.checksum!=fa&&(na.checksumMismatch=!0),K.postMessage(JSON.stringify(na),"*")}catch(ra){l=!1,K.postMessage(JSON.stringify({event:"patch",message:Q,error:ra.message||ra.toString()}),"*")}}else if("getDiff"==Q.action){R={event:"getDiff",message:Q};if(this.embedDiffSync&&null!=D){var xa=this.clonePages(this.pages);R.patch=this.diffPages(D,xa);R.checksum=this.getHashValueForPages(xa)}else R.xml=Za();K.postMessage(JSON.stringify(R),"*")}else"resetDiff"==Q.action?this.embedDiffSync&&(null!=Q.xml?(ka=ea(Q.xml),+Na=this.getCurrentFile(),null!=ka&&""!=ka&&null!=Na&&Na.mergeFile(new LocalFile(this,ka),mxUtils.bind(this,function(){D=this.clonePages(this.pages);B=Za();K.postMessage(JSON.stringify({event:"resetDiff",message:Q,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ra){K.postMessage(JSON.stringify({event:"resetDiff",message:Q,error:ra}),"*")})):(D=this.clonePages(this.pages),B=Za(),K.postMessage(JSON.stringify({event:"resetDiff",message:Q,checksum:this.getHashValueForPages(this.pages)}),+"*"))):"remoteInvokeReady"==Q.action?this.handleRemoteInvokeReady(K):"remoteInvoke"==Q.action?this.handleRemoteInvoke(Q,V.origin):"remoteInvokeResponse"==Q.action?this.handleRemoteInvokeResponse(Q):K.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(Q)}),"*");return}}catch(ra){this.handleError(ra)}}var Za=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Oa=mxUtils.bind(this,+function(ra,Da){l=!0;try{c(ra,Da,null,da)}catch(Ra){this.handleError(Ra)}l=!1;null!=urlParams.modified&&this.clearStatus();B=Za();this.embedDiffSync&&(D=this.clonePages(this.pages));t&&null==g&&(g=mxUtils.bind(this,function(Ra,x){Ra=Za();if(Ra!=B&&!l){x=this.createLoadMessage("autosave");x.message=ia;if(this.embedDiffSync&&null!=D){var N=this.clonePages(this.pages),S=this.diffPages(D,N);mxUtils.isEmptyObject(S)?x.xml=Ra:(x.patch=S,x.checksum=this.getHashValueForPages(N),this.embedDiffSyncPatchOnly||+(x.xml=Ra));D=N}else x.xml=Ra;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(x),"*")}B=Ra}),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));null!=ja&&ja();if("1"==urlParams.returnbounds||"json"==urlParams.proto)Da=this.createLoadMessage("load"),Da.xml=ra,this.embedDiffSync&&null!=this.pages&&(Da.checksum=this.getHashValueForPages(this.pages)),K.postMessage(JSON.stringify(Da),"*")});null!=Q&&"function"===typeof Q.substring&&"data:application/vnd.visio;base64,"==Q.substring(0,+34)?(ea="0M8R4KGxGuE"==Q.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(Q.substring(Q.indexOf(",")+1)),function(ra){Oa(ra,V)},mxUtils.bind(this,function(ra){this.handleError(ra)}),ea)):null!=Q&&"function"===typeof Q.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(Q,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(Q,mxUtils.bind(this,function(ra){4==ra.readyState&&(200<=ra.status&&299>=ra.status&&+"<mxGraphModel"==ra.responseText.substring(0,13)?Oa(ra.responseText,V):this.handleError({message:413==ra.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=Q&&"function"===typeof Q.substring&&this.isLucidChartData(Q)?this.convertLucidChart(Q,mxUtils.bind(this,function(ra){Oa(ra)}),mxUtils.bind(this,function(ra){this.handleError(ra)})):null==Q||"object"!==typeof Q||null==Q.format||null==Q.data&&null==Q.url?(Q=ea(Q),Oa(Q,V)):this.loadDescriptor(Q,mxUtils.bind(this,+function(ra){Oa(Za(),V)}),mxUtils.bind(this,function(ra){this.handleError(ra,mxResources.get("errorLoadingFile"))}))}}));var K=this.embedMessageSource||window.opener||window.parent;I="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";K.postMessage(I,"*");if("json"==urlParams.proto){var M=this.editor.graph.openLink;this.editor.graph.openLink=function(V,Q,ja){M.apply(this,arguments);K.postMessage(JSON.stringify({event:"openLink",href:V,target:Q,allowOpener:ja}),"*")}}};+EditorUi.prototype.createEmbedButton=function(c,g,l,t){var B=document.createElement("button");B.className="geEmbedBtn geBtn";B.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(B,c);t&&B.classList.add("gePrimaryBtn");mxEvent.addListener(B,"click",g);return B};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?+this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?+"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),+this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));+this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var g=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var t=JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(t));this.customLayoutConfig=t;this.hideDialog()}catch(B){this.handleError(B)}}),+null,null,null,null,mxUtils.bind(this,function(l,t){var B=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var D=t.value;t.value=JSON.stringify(JSON.parse(D));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=D}catch(I){this.handleError(I)}}));B.setAttribute("title","copy");B.className="geBtn";l.appendChild(B)}),!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(c,g){this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),B=mxUtils.bind(this,function(D){this.loadingOrgChart=!1;l.clear()&&this.handleError(D)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||+this.isOffline(!0))t();else if(g||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",t,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",t,null,null,null,B)}),onerror)};+EditorUi.prototype.importCsv=function(c,g,l,t){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,g,l)}),t)};EditorUi.prototype.doImportCsv=function(c,g,l){try{var t=c.split("\n"),B=[],D=[],I=[],K={};if(0<t.length){var M={};l=null!=l?l:this.editor.graph;var V=null,Q=null,ja=null,ea=null,da=null,ia=null,la=null,ka="whiteSpace=wrap;html=1;",W=null,k=null,y="",J="auto",R="auto",X=!1,aa=null,Z=null,U=40,ba=40,fa=100,na=0,pa=mxUtils.bind(this,function(){null!=g?g(ca):(l.setSelectionCells(ca),+l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ta=l.getFreeInsertPoint(),ua=ta.x,Ca=ta.y;ta=Ca;var Ba=null,Aa="auto";k=null;for(var Fa=[],Sa=null,La=null,Pa=0;Pa<t.length&&"#"==t[Pa].charAt(0);){c=t[Pa].replace(/\r$/,"");for(Pa++;Pa<t.length&&"\\"==c.charAt(c.length-1)&&"#"==t[Pa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(t[Pa].substring(1)),Pa++;if("#"!=c.charAt(1)){var db=c.indexOf(":");+if(0<db){var Ia=mxUtils.trim(c.substring(1,db)),za=mxUtils.trim(c.substring(db+1));"label"==Ia?Ba=Graph.sanitizeHtml(za):"labelname"==Ia&&0<za.length&&"-"!=za?da=za:"labels"==Ia&&0<za.length&&"-"!=za?la=JSON.parse(za):"style"==Ia?Q=za:"parentstyle"==Ia?ka=za:"unknownStyle"==Ia&&"-"!=za?ia=za:"stylename"==Ia&&0<za.length&&"-"!=za?ea=za:"styles"==Ia&&0<za.length&&"-"!=za?ja=JSON.parse(za):"vars"==Ia&&0<za.length&&"-"!=za?V=JSON.parse(za):"identity"==Ia&&0<za.length&&"-"!=za?W=za:"parent"==Ia&&0<za.length&&+"-"!=za?k=za:"namespace"==Ia&&0<za.length&&"-"!=za?y=za:"width"==Ia?J=za:"height"==Ia?R=za:"collapsed"==Ia&&"-"!=za?X="true"==za:"left"==Ia&&0<za.length?aa=za:"top"==Ia&&0<za.length?Z=za:"ignore"==Ia?La=za.split(","):"connect"==Ia?Fa.push(JSON.parse(za)):"link"==Ia?Sa=za:"padding"==Ia?na=parseFloat(za):"edgespacing"==Ia?U=parseFloat(za):"nodespacing"==Ia?ba=parseFloat(za):"levelspacing"==Ia?fa=parseFloat(za):"layout"==Ia&&(Aa=za)}}}if(null==t[Pa])throw Error(mxResources.get("invalidOrMissingFile"));+var Ua=this.editor.csvToArray(t[Pa].replace(/\r$/,""));db=c=null;Ia=[];for(za=0;za<Ua.length;za++)W==Ua[za]&&(c=za),k==Ua[za]&&(db=za),Ia.push(mxUtils.trim(Ua[za]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Ba&&(Ba="%"+Ia[0]+"%");if(null!=Fa)for(var Qa=0;Qa<Fa.length;Qa++)null==M[Fa[Qa].to]&&(M[Fa[Qa].to]={});W=[];for(za=Pa+1;za<t.length;za++){var Ma=this.editor.csvToArray(t[za].replace(/\r$/,""));if(null==Ma){var Na=40<t[za].length?t[za].substring(0,40)+"...":t[za];throw Error(Na++" ("+za+"):\n"+mxResources.get("containsValidationErrors"));}0<Ma.length&&W.push(Ma)}l.model.beginUpdate();try{for(za=0;za<W.length;za++){Ma=W[za];var xa=null,Za=null!=c?y+Ma[c]:null;t=!1;null!=Za&&(xa=l.model.getCell(Za),t=null==xa||0<=mxUtils.indexOf(B,xa));var Oa=new mxCell(Ba,new mxGeometry(ua,ta,0,0),Q||"whiteSpace=wrap;html=1;");Oa.collapsed=X;Oa.vertex=!0;Oa.id=Za;null==xa||t||l.model.setCollapsed(xa,X);for(var ra=0;ra<Ma.length;ra++)l.setAttributeForCell(Oa,Ia[ra],Ma[ra]),null==xa||t||l.setAttributeForCell(xa,+Ia[ra],Ma[ra]);if(null!=da&&null!=la){var Da=la[Oa.getAttribute(da)];null!=Da&&(l.labelChanged(Oa,Da),null==xa||t||l.cellLabelChanged(xa,Da))}if(null!=ea&&null!=ja){var Ra=ja[Oa.getAttribute(ea)];null!=Ra&&(Oa.style=Ra)}l.setAttributeForCell(Oa,"placeholders","1");Oa.style=l.replacePlaceholders(Oa,Oa.style,V);null==xa||t?l.fireEvent(new mxEventObject("cellsInserted","cells",[Oa])):(l.model.setStyle(xa,Oa.style),0>mxUtils.indexOf(I,xa)&&I.push(xa),l.fireEvent(new mxEventObject("cellsInserted","cells",+[xa])));t=null!=xa;xa=Oa;if(!t)for(Qa=0;Qa<Fa.length;Qa++)M[Fa[Qa].to][xa.getAttribute(Fa[Qa].to)]=xa;null!=Sa&&"link"!=Sa&&(l.setLinkForCell(xa,xa.getAttribute(Sa)),l.setAttributeForCell(xa,Sa,null));var x=l.getPreferredSizeForCell(xa);k=null!=db?l.model.getCell(y+Ma[db]):null;if(xa.vertex){Na=null!=k?0:ua;Pa=null!=k?0:Ca;null!=aa&&null!=xa.getAttribute(aa)&&(xa.geometry.x=Na+parseFloat(xa.getAttribute(aa)));null!=Z&&null!=xa.getAttribute(Z)&&(xa.geometry.y=Pa+parseFloat(xa.getAttribute(Z)));var N=+"@"==J.charAt(0)?xa.getAttribute(J.substring(1)):null;xa.geometry.width=null!=N&&"auto"!=N?parseFloat(xa.getAttribute(J.substring(1))):"auto"==J||"auto"==N?x.width+na:parseFloat(J);var S="@"==R.charAt(0)?xa.getAttribute(R.substring(1)):null;xa.geometry.height=null!=S&&"auto"!=S&&"width"!=R?parseFloat(S):"auto"==R||"auto"==S?x.height+na:"width"==R?xa.geometry.width:parseFloat(R);ta+=xa.geometry.height+ba}t?(null==K[Za]&&(K[Za]=[]),K[Za].push(xa)):(B.push(xa),null!=k?(k.style=l.replacePlaceholders(k,+ka,V),l.addCell(xa,k),D.push(k)):I.push(l.addCell(xa)))}for(za=0;za<D.length;za++)N="@"==J.charAt(0)?D[za].getAttribute(J.substring(1)):null,S="@"==R.charAt(0)?D[za].getAttribute(R.substring(1)):null,"auto"!=J&&"auto"!=N||"auto"!=R&&"auto"!=S||l.updateGroupBounds([D[za]],na,!0);var Y=I.slice(),ca=I.slice();for(Qa=0;Qa<Fa.length;Qa++){var ma=Fa[Qa];for(za=0;za<B.length;za++){xa=B[za];var qa=mxUtils.bind(this,function(hb,cb,fb){var lb=cb.getAttribute(fb.from);if(null!=lb&&""!=lb){lb=lb.split(",");for(var ub=+0;ub<lb.length;ub++){var ob=M[fb.to][lb[ub]];if(null==ob&&null!=ia){ob=new mxCell(lb[ub],new mxGeometry(ua,Ca,0,0),ia);ob.style=l.replacePlaceholders(cb,ob.style,V);var pb=l.getPreferredSizeForCell(ob);ob.geometry.width=pb.width+na;ob.geometry.height=pb.height+na;M[fb.to][lb[ub]]=ob;ob.vertex=!0;ob.id=lb[ub];I.push(l.addCell(ob))}if(null!=ob){pb=fb.label;null!=fb.fromlabel&&(pb=(cb.getAttribute(fb.fromlabel)||"")+(pb||""));null!=fb.sourcelabel&&(pb=l.replacePlaceholders(cb,fb.sourcelabel,V)+(pb||+""));null!=fb.tolabel&&(pb=(pb||"")+(ob.getAttribute(fb.tolabel)||""));null!=fb.targetlabel&&(pb=(pb||"")+l.replacePlaceholders(ob,fb.targetlabel,V));var sb="target"==fb.placeholders==!fb.invert?ob:hb;sb=null!=fb.style?l.replacePlaceholders(sb,fb.style,V):l.createCurrentEdgeStyle();pb=l.insertEdge(null,null,pb||"",fb.invert?ob:hb,fb.invert?hb:ob,sb);if(null!=fb.labels)for(sb=0;sb<fb.labels.length;sb++){var rb=fb.labels[sb],tb=new mxCell(rb.label||sb,new mxGeometry(null!=rb.x?rb.x:0,null!=rb.y?rb.y:+0,0,0),"resizable=0;html=1;");tb.vertex=!0;tb.connectable=!1;tb.geometry.relative=!0;null!=rb.placeholders&&(tb.value=l.replacePlaceholders("target"==rb.placeholders==!fb.invert?ob:hb,tb.value,V));if(null!=rb.dx||null!=rb.dy)tb.geometry.offset=new mxPoint(null!=rb.dx?rb.dx:0,null!=rb.dy?rb.dy:0);pb.insert(tb)}if(null!=fb.data)for(var yb in fb.data)l.setAttributeForCell(pb,yb,fb.data[yb]);ca.push(pb);mxUtils.remove(fb.invert?hb:ob,Y)}}}});qa(xa,xa,ma);if(null!=K[xa.id])for(ra=0;ra<K[xa.id].length;ra++)qa(xa,+K[xa.id][ra],ma)}}if(null!=La)for(za=0;za<B.length;za++)for(xa=B[za],ra=0;ra<La.length;ra++)l.setAttributeForCell(xa,mxUtils.trim(La[ra]),null);if(0<I.length){var wa=new mxParallelEdgeLayout(l);wa.spacing=U;wa.checkOverlap=!0;var sa=function(){0<wa.spacing&&wa.execute(l.getDefaultParent());for(var hb=0;hb<I.length;hb++){var cb=l.getCellGeometry(I[hb]);cb.x=Math.round(l.snap(cb.x));cb.y=Math.round(l.snap(cb.y));"auto"==J&&(cb.width=Math.round(l.snap(cb.width)));"auto"==R&&(cb.height=Math.round(l.snap(cb.height)))}};+if("["==Aa.charAt(0)){var ya=pa;l.view.validate();this.executeLayouts(l.createLayouts(JSON.parse(Aa)),function(){sa();ya()});pa=null}else if("circle"==Aa){var Ga=new mxCircleLayout(l);Ga.disableEdgeStyle=!1;Ga.resetEdges=!1;var Ya=Ga.isVertexIgnored;Ga.isVertexIgnored=function(hb){return Ya.apply(this,arguments)||0>mxUtils.indexOf(I,hb)};this.executeLayout(function(){Ga.execute(l.getDefaultParent());sa()},!0,pa);pa=null}else if("horizontaltree"==Aa||"verticaltree"==Aa||"auto"==Aa&&ca.length==2*I.length-+1&&1==Y.length){l.view.validate();var Va=new mxCompactTreeLayout(l,"horizontaltree"==Aa);Va.levelDistance=ba;Va.edgeRouting=!1;Va.resetEdges=!1;Va.sortEdges=!0;this.executeLayout(function(){Va.execute(l.getDefaultParent(),0<Y.length?Y[0]:null)},!0,pa);pa=null}else if("horizontalflow"==Aa||"verticalflow"==Aa||"auto"==Aa&&1==Y.length){l.view.validate();var eb=new mxHierarchicalLayout(l,"horizontalflow"==Aa?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);eb.intraCellSpacing=ba;eb.parallelEdgeSpacing=+U;eb.interRankCellSpacing=fa;eb.disableEdgeStyle=!1;this.executeLayout(function(){eb.execute(l.getDefaultParent(),ca);l.moveCells(ca,ua,Ca)},!0,pa);pa=null}else if("orgchart"==Aa){l.view.validate();var ib=new mxOrgChartLayout(l,2,fa,ba),jb=ib.isVertexIgnored;ib.isVertexIgnored=function(hb){return jb.apply(this,arguments)||0>mxUtils.indexOf(I,hb)};this.executeLayout(function(){ib.execute(l.getDefaultParent());sa()},!0,pa);pa=null}else if("organic"==Aa||"auto"==Aa&&ca.length>I.length){l.view.validate();+var Ta=new mxFastOrganicLayout(l);Ta.forceConstant=3*ba;Ta.disableEdgeStyle=!1;Ta.resetEdges=!1;var qb=Ta.isVertexIgnored;Ta.isVertexIgnored=function(hb){return qb.apply(this,arguments)||0>mxUtils.indexOf(I,hb)};this.executeLayout(function(){Ta.execute(l.getDefaultParent());sa()},!0,pa);pa=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=pa&&pa()}}catch(hb){this.handleError(hb)}};EditorUi.prototype.getSearch=function(c){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<+window.location.search.length){var l="?",t;for(t in urlParams)0>mxUtils.indexOf(c,t)&&null!=urlParams[t]&&(g+=l+t+"="+urlParams[t],l="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var g=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),t;for(t in urlParams)0>mxUtils.indexOf(l,t)&&(c=0==g?c+"?":+c+"&",null!=urlParams[t]&&(c+=t+"="+urlParams[t],g++))}return c};EditorUi.prototype.showLinkDialog=function(c,g,l,t,B){c=new LinkDialog(this,c,g,l,!0,t,B);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){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.m365&&g++;null!=this.gitHub&&g++;+null!=this.gitLab&&g++;c&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),g=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);this.menus.get("viewZoom").setEnabled(g);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g);this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g);this.menus.get("edit").setEnabled(g);this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};-EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var g=0;g<c.length;g++)this.libraryLoaded(c[g].file,c[g].images,c[g].title,null!=c[g].div?"none"!=c[g].div.style.display:c[g].expand)};var Q=EditorUi.prototype.updateActionStates;-EditorUi.prototype.updateActionStates=function(){Q.apply(this,arguments);var c=this.editor.graph,g=this.getCurrentFile(),l=this.getSelectionState(),t=this.isDiagramActive(),B="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=g&&g.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&B);this.actions.get("redo").setEnabled(this.canRedo()&&B);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(t);this.actions.get("editData").setEnabled(c.isEnabled());+EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var g=0;g<c.length;g++)this.libraryLoaded(c[g].file,c[g].images,c[g].title,null!=c[g].div?"none"!=c[g].div.style.display:c[g].expand)};var P=EditorUi.prototype.updateActionStates;+EditorUi.prototype.updateActionStates=function(){P.apply(this,arguments);var c=this.editor.graph,g=this.getCurrentFile(),l=this.getSelectionState(),t=this.isDiagramActive(),B="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=g&&g.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&B);this.actions.get("redo").setEnabled(this.canRedo()&&B);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(t);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(t&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(t&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(t&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(t&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(t&&l.image&&0<l.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&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&t&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length);this.actions.get("addToScratchpad").setEnabled(0<l.cells.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(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);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("none"!=this.diagramContainer.style.display);g.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(t&&-null!=c&&null!=c.shape&&null!=c.shape.stencil)};var M=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);M.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,g,l,t,B,D,I,L){var N=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(g,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");-else if("svg"==l)c.hideDialog(),c.saveData(g,"svg",mxUtils.getXml(N.getSvg(t,B,D)),"image/svg+xml");else{var K=c.getFileData(!0,null,null,null,null,!0),da=N.getGraphBounds(),ja=Math.floor(da.width*B/N.view.scale),ea=Math.floor(da.height*B/N.view.scale);if(K.length<=MAX_REQUEST_SIZE&&ja*ea<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas()){var ca={globalVars:N.getExportVariables()};L&&(ca.grid={size:N.gridSize,steps:N.view.gridSteps,color:N.view.gridColor});c.saveRequest(g,-l,function(fa,la){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(la||"0")+(null!=fa?"&filename="+encodeURIComponent(fa):"")+"&extras="+encodeURIComponent(JSON.stringify(ca))+(0<I?"&dpi="+I:"")+"&bg="+(null!=t?t:"none")+"&w="+ja+"&h="+ea+"&border="+D+"&xml="+encodeURIComponent(K))})}else"png"==l?c.exportImage(B,null==t||"none"==t,!0,!1,!1,D,!0,!1,null,L,I):c.exportImage(B,!1,!0,!1,!1,D,!0,!1,"jpeg",L);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=+null!=c&&null!=c.shape&&null!=c.shape.stencil)};var L=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);L.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,g,l,t,B,D,I,K){var M=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(g,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");+else if("svg"==l)c.hideDialog(),c.saveData(g,"svg",mxUtils.getXml(M.getSvg(t,B,D)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),Q=M.getGraphBounds(),ja=Math.floor(Q.width*B/M.view.scale),ea=Math.floor(Q.height*B/M.view.scale);if(V.length<=MAX_REQUEST_SIZE&&ja*ea<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas()){var da={globalVars:M.getExportVariables()};K&&(da.grid={size:M.gridSize,steps:M.view.gridSteps,color:M.view.gridColor});c.saveRequest(g,+l,function(ia,la){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(la||"0")+(null!=ia?"&filename="+encodeURIComponent(ia):"")+"&extras="+encodeURIComponent(JSON.stringify(da))+(0<I?"&dpi="+I:"")+"&bg="+(null!=t?t:"none")+"&w="+ja+"&h="+ea+"&border="+D+"&xml="+encodeURIComponent(V))})}else"png"==l?c.exportImage(B,null==t||"none"==t,!0,!1,!1,D,!0,!1,null,K,I):c.exportImage(B,!1,!0,!1,!1,D,!0,!1,"jpeg",K);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,g="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var t=c;this.currentPage!=this.pages[l]&&(t=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),t.model.setRoot(this.pages[l].root));g+=this.pages[l].getName()+" "+t.getIndexableText()+" "}else g=c.getIndexableText();this.editor.graph.setEnabled(!0);return g};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var g={},l=document.createElement("div");-l.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxUtils.htmlEntities(c));t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(t);var B=document.createElement("div");B.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";B.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var D={};try{var I=mxSettings.getCustomLibraries();for(c=0;c<I.length;c++){var L=I[c];if("R"==-L.substring(0,1)){var N=JSON.parse(decodeURIComponent(L.substring(1)));D[N[0]]={id:N[0],title:N[1],downloadUrl:N[2]}}}}catch(K){}this.remoteInvoke("getCustomLibraries",null,null,function(K){B.innerText="";if(0==K.length)B.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var da=0;da<K.length;da++){var ja=K[da];D[ja.id]&&(g[ja.id]=ja);var ea=this.addCheckbox(B,ja.title,D[ja.id]);(function(ca,fa){mxEvent.addListener(fa,-"change",function(){this.checked?g[ca.id]=ca:delete g[ca.id]})})(ja,ea)}},mxUtils.bind(this,function(K){B.innerText="";var da=document.createElement("div");da.style.padding="8px";da.style.textAlign="center";mxUtils.write(da,mxResources.get("error")+": ");mxUtils.write(da,null!=K&&null!=K.message?K.message:mxResources.get("unknownError"));B.appendChild(da)}));l.appendChild(B);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var K=0,-da;for(da in g)null==D[da]&&(K++,mxUtils.bind(this,function(ja){this.remoteInvoke("getFileContent",[ja.downloadUrl],null,mxUtils.bind(this,function(ea){K--;0==K&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ea,ja)),this.showSidebar()}catch(ca){this.handleError(ca,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){K--;0==K&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[da]));for(da in D)g[da]||this.closeLibrary(new RemoteLibrary(this,-null,D[da]));0==K&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.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 g=0;g<this.remoteInvokeQueue.length;g++)c.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var g=c.msgMarkers,l=this.remoteInvokeCallbacks[g.callbackId];if(null==l)throw Error("No callback for "+(null!=g?g.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,-c.resp);this.remoteInvokeCallbacks[g.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,g,l,t,B){var D=!0,I=window.setTimeout(mxUtils.bind(this,function(){D=!1;B({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),L=mxUtils.bind(this,function(){window.clearTimeout(I);D&&t.apply(this,arguments)}),N=mxUtils.bind(this,function(){window.clearTimeout(I);D&&B.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:L,-error:N});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:g,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,g){var l=mxUtils.bind(this,function(K,da){var ja={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=da?ja.error={errResp:da}:null!=K&&(ja.resp=K);this.remoteWin.postMessage(JSON.stringify(ja),"*")});try{var t=c.funtionName,B=this.remoteInvokableFns[t];if(null!=B&&-"function"===typeof this[t]){if(B.allowedDomains){for(var D=!1,I=0;I<B.allowedDomains.length;I++)if(g=="https://"+B.allowedDomains[I]){D=!0;break}if(!D){l(null,"Invalid Call: "+t+" is not allowed.");return}}var L=c.functionArgs;Array.isArray(L)||(L=[]);if(B.isAsync)L.push(function(){l(Array.prototype.slice.apply(arguments))}),L.push(function(K){l(null,K||"Unkown Error")}),this[t].apply(this,L);else{var N=this[t].apply(this,L);l([N])}}else l(null,"Invalid Call: "+t+" is not found.")}catch(K){l(null,-"Invalid Call: An error occurred, "+K.message)}};EditorUi.prototype.openDatabase=function(c,g){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var t=l.open("database",2);t.onupgradeneeded=function(B){try{var D=t.result;1>B.oldVersion&&D.createObjectStore("objects",{keyPath:"key"});2>B.oldVersion&&(D.createObjectStore("files",{keyPath:"title"}),D.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(I){null!=-g&&g(I)}};t.onsuccess=mxUtils.bind(this,function(B){try{var D=t.result;this.database=D;EditorUi.migrateStorageFiles&&(StorageFile.migrate(D),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)&&"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 N=!0,K=!1,da,ja=0,ea=mxUtils.bind(this,function(){K=!0;this.setDatabaseItem(".drawioMigrated3",!0);L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),ca=mxUtils.bind(this,function(){ja++;fa()}),fa=mxUtils.bind(this,function(){try{if(ja>=da.length)ea();else{var ka=da[ja];StorageFile.getFileContent(this,ka,mxUtils.bind(this,function(V){null==V||".scratchpad"==ka&&V==this.emptyLibraryXml?-L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[ka]}),"*"):ca()}),ca)}}catch(V){console.log(V)}}),la=mxUtils.bind(this,function(ka){try{this.setDatabaseItem(null,[{title:ka.title,size:ka.data.length,lastModified:Date.now(),type:ka.isLib?"L":"F"},{title:ka.title,data:ka.data}],ca,ca,["filesInfo","files"])}catch(V){console.log(V)}});I=mxUtils.bind(this,function(ka){try{if(ka.source==L.contentWindow){var V={};try{V=JSON.parse(ka.data)}catch(k){}"init"==-V.event?(L.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=V.event||K||(N?null!=V.resp&&0<V.resp.length&&null!=V.resp[0]?(da=V.resp[0],N=!1,fa()):ea():null!=V.resp&&0<V.resp.length&&null!=V.resp[0]?la(V.resp[0]):ca())}}catch(k){console.log(k)}});window.addEventListener("message",I)}})));c(D);D.onversionchange=function(){D.close()}}catch(I){null!=-g?g(I):null!=window.console&&console.warn(I)}});t.onerror=g;t.onblocked=function(){}}catch(B){null!=g?g(B):null!=window.console&&console.error(B)}else null!=g&&g(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,g,l,t,B){this.openDatabase(mxUtils.bind(this,function(D){try{B=B||"objects";Array.isArray(B)||(B=[B],c=[c],g=[g]);var I=D.transaction(B,"readwrite");I.oncomplete=l;I.onerror=t;for(D=0;D<B.length;D++)I.objectStore(B[D]).put(null!=c&&null!=-c[D]?{key:c[D],data:g[D]}:g[D])}catch(L){null!=t&&t(L)}}),t)};EditorUi.prototype.removeDatabaseItem=function(c,g,l,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c]);var D=B.transaction(t,"readwrite");D.oncomplete=g;D.onerror=l;for(B=0;B<t.length;B++)D.objectStore(t[B]).delete(c[B])}catch(I){null!=l&&l(I)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,g,l,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";var D=B.transaction([t],-"readonly").objectStore(t).get(c);D.onsuccess=function(){g(D.result)};D.onerror=l}catch(I){null!=l&&l(I)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var B=t.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),D=[];B.onsuccess=function(I){null==I.target.result?c(D):(D.push(I.target.result.value),I.target.result.continue())};B.onerror=g}catch(I){null!=g&&g(I)}}),g)};EditorUi.prototype.getDatabaseItemKeys=-function(c,g,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var B=t.transaction([l],"readonly").objectStore(l).getAllKeys();B.onsuccess=function(){c(B.result)};B.onerror=g}catch(D){null!=g&&g(D)}}),g)};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,g){var l=this.getCurrentFile();null!=l?l.getComments(c,g):c([])};EditorUi.prototype.addComment=function(c,g,l){var t=this.getCurrentFile();null!=t?t.addComment(c,g,l):g(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,g){var l=this.getCurrentFile();return null!=l?l.newComment(c,g):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,g){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,g):g({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.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,g,l,t,B,D,I,L){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");-return this.editor.loadUrl(c,g,l,t,B,D,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,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,g)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");-return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,g,l,t,B,D,I,L,N,K,da,ja,ea,ca,fa,la)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,g,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");-return this.editor.convertImages(c,g,l,t)};EditorUi.prototype.convertImageToDataUri=function(c,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,g)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,g,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,g,l,t)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");+l.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxUtils.htmlEntities(c));t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(t);var B=document.createElement("div");B.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";B.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var D={};try{var I=mxSettings.getCustomLibraries();for(c=0;c<I.length;c++){var K=I[c];if("R"==+K.substring(0,1)){var M=JSON.parse(decodeURIComponent(K.substring(1)));D[M[0]]={id:M[0],title:M[1],downloadUrl:M[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){B.innerText="";if(0==V.length)B.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var Q=0;Q<V.length;Q++){var ja=V[Q];D[ja.id]&&(g[ja.id]=ja);var ea=this.addCheckbox(B,ja.title,D[ja.id]);(function(da,ia){mxEvent.addListener(ia,+"change",function(){this.checked?g[da.id]=da:delete g[da.id]})})(ja,ea)}},mxUtils.bind(this,function(V){B.innerText="";var Q=document.createElement("div");Q.style.padding="8px";Q.style.textAlign="center";mxUtils.write(Q,mxResources.get("error")+": ");mxUtils.write(Q,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));B.appendChild(Q)}));l.appendChild(B);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var V=0,Q;for(Q in g)null==+D[Q]&&(V++,mxUtils.bind(this,function(ja){this.remoteInvoke("getFileContent",[ja.downloadUrl],null,mxUtils.bind(this,function(ea){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ea,ja)),this.showSidebar()}catch(da){this.handleError(da,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[Q]));for(Q in D)g[Q]||this.closeLibrary(new RemoteLibrary(this,null,D[Q]));+0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.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 g=0;g<this.remoteInvokeQueue.length;g++)c.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var g=c.msgMarkers,l=this.remoteInvokeCallbacks[g.callbackId];if(null==l)throw Error("No callback for "+(null!=g?g.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[g.callbackId]=+null};EditorUi.prototype.remoteInvoke=function(c,g,l,t,B){var D=!0,I=window.setTimeout(mxUtils.bind(this,function(){D=!1;B({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),K=mxUtils.bind(this,function(){window.clearTimeout(I);D&&t.apply(this,arguments)}),M=mxUtils.bind(this,function(){window.clearTimeout(I);D&&B.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:K,error:M});c=JSON.stringify({event:"remoteInvoke",+funtionName:c,functionArgs:g,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,g){var l=mxUtils.bind(this,function(V,Q){var ja={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=Q?ja.error={errResp:Q}:null!=V&&(ja.resp=V);this.remoteWin.postMessage(JSON.stringify(ja),"*")});try{var t=c.funtionName,B=this.remoteInvokableFns[t];if(null!=B&&"function"===typeof this[t]){if(B.allowedDomains){for(var D=+!1,I=0;I<B.allowedDomains.length;I++)if(g=="https://"+B.allowedDomains[I]){D=!0;break}if(!D){l(null,"Invalid Call: "+t+" is not allowed.");return}}var K=c.functionArgs;Array.isArray(K)||(K=[]);if(B.isAsync)K.push(function(){l(Array.prototype.slice.apply(arguments))}),K.push(function(V){l(null,V||"Unkown Error")}),this[t].apply(this,K);else{var M=this[t].apply(this,K);l([M])}}else l(null,"Invalid Call: "+t+" is not found.")}catch(V){l(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=+function(c,g){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var t=l.open("database",2);t.onupgradeneeded=function(B){try{var D=t.result;1>B.oldVersion&&D.createObjectStore("objects",{keyPath:"key"});2>B.oldVersion&&(D.createObjectStore("files",{keyPath:"title"}),D.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(I){null!=g&&g(I)}};t.onsuccess=mxUtils.bind(this,function(B){try{var D=t.result;+this.database=D;EditorUi.migrateStorageFiles&&(StorageFile.migrate(D),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)&&"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,V=!1,Q,ja=0,ea=mxUtils.bind(this,function(){V=!0;this.setDatabaseItem(".drawioMigrated3",!0);K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),da=mxUtils.bind(this,function(){ja++;ia()}),ia=mxUtils.bind(this,function(){try{if(ja>=Q.length)ea();else{var ka=Q[ja];StorageFile.getFileContent(this,ka,mxUtils.bind(this,function(W){null==W||".scratchpad"==ka&&W==this.emptyLibraryXml?K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",+funtionName:"getLocalStorageFile",functionArgs:[ka]}),"*"):da()}),da)}}catch(W){console.log(W)}}),la=mxUtils.bind(this,function(ka){try{this.setDatabaseItem(null,[{title:ka.title,size:ka.data.length,lastModified:Date.now(),type:ka.isLib?"L":"F"},{title:ka.title,data:ka.data}],da,da,["filesInfo","files"])}catch(W){console.log(W)}});I=mxUtils.bind(this,function(ka){try{if(ka.source==K.contentWindow){var W={};try{W=JSON.parse(ka.data)}catch(k){}"init"==W.event?(K.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),+"*"),K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=W.event||V||(M?null!=W.resp&&0<W.resp.length&&null!=W.resp[0]?(Q=W.resp[0],M=!1,ia()):ea():null!=W.resp&&0<W.resp.length&&null!=W.resp[0]?la(W.resp[0]):da())}}catch(k){console.log(k)}});window.addEventListener("message",I)}})));c(D);D.onversionchange=function(){D.close()}}catch(I){null!=g?g(I):null!=window.console&&console.warn(I)}});t.onerror=g;t.onblocked=+function(){}}catch(B){null!=g?g(B):null!=window.console&&console.error(B)}else null!=g&&g(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,g,l,t,B){this.openDatabase(mxUtils.bind(this,function(D){try{B=B||"objects";Array.isArray(B)||(B=[B],c=[c],g=[g]);var I=D.transaction(B,"readwrite");I.oncomplete=l;I.onerror=t;for(D=0;D<B.length;D++)I.objectStore(B[D]).put(null!=c&&null!=c[D]?{key:c[D],data:g[D]}:g[D])}catch(K){null!=t&&t(K)}}),t)};EditorUi.prototype.removeDatabaseItem=+function(c,g,l,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c]);var D=B.transaction(t,"readwrite");D.oncomplete=g;D.onerror=l;for(B=0;B<t.length;B++)D.objectStore(t[B]).delete(c[B])}catch(I){null!=l&&l(I)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,g,l,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";var D=B.transaction([t],"readonly").objectStore(t).get(c);D.onsuccess=function(){g(D.result)};D.onerror=l}catch(I){null!=+l&&l(I)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var B=t.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),D=[];B.onsuccess=function(I){null==I.target.result?c(D):(D.push(I.target.result.value),I.target.result.continue())};B.onerror=g}catch(I){null!=g&&g(I)}}),g)};EditorUi.prototype.getDatabaseItemKeys=function(c,g,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";+var B=t.transaction([l],"readonly").objectStore(l).getAllKeys();B.onsuccess=function(){c(B.result)};B.onerror=g}catch(D){null!=g&&g(D)}}),g)};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,g){var l=this.getCurrentFile();null!=l?l.getComments(c,g):c([])};EditorUi.prototype.addComment=function(c,g,l){var t=this.getCurrentFile();null!=t?t.addComment(c,g,l):g(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,g){var l=this.getCurrentFile();+return null!=l?l.newComment(c,g):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,g){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,g):g({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.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,g,l,t,B,D,I,K){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,g,l,t,B,D,I,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,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,g)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};+EditorUi.prototype.exportToCanvas=function(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,g,l,t,B,D,I,K,M,V,Q,ja,ea,da,ia,la)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,g,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,+g,l,t)};EditorUi.prototype.convertImageToDataUri=function(c,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,g)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,g,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,g,l,t)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,g,l,t,B){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,g,l,t,B)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],g=0;g<localStorage.length;g++){var l=localStorage.key(g),t=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<t.length){var B="<mxfile "===t.substring(0,8)||"<?xml"===t.substring(0,5)||"\x3c!--[if IE]>"===t.substring(0,12);t="<mxlibrary>"===t.substring(0,11);(B||t)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var g=localStorage.getItem(c);return{title:c,data:g,isLib:"<mxlibrary>"===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,d,m,n,v,p){function C(){for(var fa=I.getElementsByTagName("div"),la=0,ka=0;ka<fa.length;ka++)"none"!=fa[ka].style.display&&fa[ka].parentNode==I&&la++;L.style.display=0==la?"block":"none"}function G(fa,la,ka,V){function k(){la.removeChild(R);la.removeChild(Y);J.style.display="block";x.style.display="block"}t={div:la,comment:fa,saveCallback:ka,deleteOnCancel:V};var x=la.querySelector(".geCommentTxt"),J=la.querySelector(".geCommentActionsList"),R=document.createElement("textarea");-R.className="geCommentEditTxtArea";R.style.minHeight=x.offsetHeight+"px";R.value=fa.content;la.insertBefore(R,x);var Y=document.createElement("div");Y.className="geCommentEditBtns";var Z=mxUtils.button(mxResources.get("cancel"),function(){V?(la.parentNode.removeChild(la),C()):k();t=null});Z.className="geCommentEditBtn";Y.appendChild(Z);var W=mxUtils.button(mxResources.get("save"),function(){x.innerText="";fa.content=R.value;mxUtils.write(x,fa.content);k();ka(fa);t=null});mxEvent.addListener(R,"keydown",-mxUtils.bind(this,function(U){mxEvent.isConsumed(U)||((mxEvent.isControlDown(U)||mxClient.IS_MAC&&mxEvent.isMetaDown(U))&&13==U.keyCode?(W.click(),mxEvent.consume(U)):27==U.keyCode&&(Z.click(),mxEvent.consume(U)))}));W.focus();W.className="geCommentEditBtn gePrimaryBtn";Y.appendChild(W);la.insertBefore(Y,x);J.style.display="none";x.style.display="none";R.focus()}function T(fa,la){la.innerText="";fa=new Date(fa.modifiedDate);var ka=b.timeSince(fa);null==ka&&(ka=mxResources.get("lessThanAMinute"));-mxUtils.write(la,mxResources.get("timeAgo",[ka],"{1} ago"));la.setAttribute("title",fa.toLocaleDateString()+" "+fa.toLocaleTimeString())}function E(fa){var la=document.createElement("img");la.className="geCommentBusyImg";la.src=IMAGE_PATH+"/spin.gif";fa.appendChild(la);fa.busyImg=la}function Q(fa){fa.style.border="1px solid red";fa.busyImg.parentNode==fa&&fa.removeChild(fa.busyImg)}function M(fa){fa.style.border="";fa.busyImg.parentNode==fa&&fa.removeChild(fa.busyImg)}function c(fa,la,ka,V,k){function x(ia,-na,qa){var ta=document.createElement("li");ta.className="geCommentAction";var ua=document.createElement("a");ua.className="geCommentActionLnk";mxUtils.write(ua,ia);ta.appendChild(ua);mxEvent.addListener(ua,"click",function(Ba){na(Ba,fa);Ba.preventDefault();mxEvent.consume(Ba)});aa.appendChild(ta);qa&&(ta.style.display="none")}function J(){function ia(ta){na.push(qa);if(null!=ta.replies)for(var ua=0;ua<ta.replies.length;ua++)qa=qa.nextSibling,ia(ta.replies[ua])}var na=[],qa=Y;ia(fa);return{pdiv:qa,-replies:na}}function R(ia,na,qa,ta,ua){function Ba(){E(Ra);fa.addReply(Ga,function(Ha){Ga.id=Ha;fa.replies.push(Ga);M(Ra);qa&&qa()},function(Ha){za();Q(Ra);b.handleError(Ha,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ta,ua)}function za(){G(Ga,Ra,function(Ha){Ba()},!0)}var Aa=J().pdiv,Ga=b.newComment(ia,b.getCurrentUser());Ga.pCommentId=fa.id;null==fa.replies&&(fa.replies=[]);var Ra=c(Ga,fa.replies,Aa,V+1);na?za():Ba()}if(k||!fa.isResolved){L.style.display="none";var Y=-document.createElement("div");Y.className="geCommentContainer";Y.setAttribute("data-commentId",fa.id);Y.style.marginLeft=20*V+5+"px";fa.isResolved&&(B.style.opacity="0.7");var Z=document.createElement("div");Z.className="geCommentHeader";var W=document.createElement("img");W.className="geCommentUserImg";W.src=null!=fa.user&&null!=fa.user.pictureUrl?fa.user.pictureUrl:Editor.userImage;Z.appendChild(W);W=document.createElement("div");W.className="geCommentHeaderTxt";Z.appendChild(W);var U=document.createElement("div");-U.className="geCommentUsername";mxUtils.write(U,null!=fa.user?fa.user.displayName:mxResources.get("unknownUser"));W.appendChild(U);U=document.createElement("div");U.className="geCommentDate";U.setAttribute("data-commentId",fa.id);T(fa,U);W.appendChild(U);Y.appendChild(Z);Z=document.createElement("div");Z.className="geCommentTxt";mxUtils.write(Z,fa.content||"");Y.appendChild(Z);fa.isLocked&&(Y.style.opacity="0.5");Z=document.createElement("div");Z.className="geCommentActions";var aa=document.createElement("ul");-aa.className="geCommentActionsList";Z.appendChild(aa);g||fa.isLocked||0!=V&&!l||x(mxResources.get("reply"),function(){R("",!0)},fa.isResolved);W=b.getCurrentUser();null==W||null==fa.user||W.id!=fa.user.id||g||fa.isLocked||(x(mxResources.get("edit"),function(){function ia(){G(fa,Y,function(){E(Y);fa.editComment(fa.content,function(){M(Y)},function(na){Q(Y);ia();b.handleError(na,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ia()},fa.isResolved),x(mxResources.get("delete"),-function(){b.confirm(mxResources.get("areYouSure"),function(){E(Y);fa.deleteComment(function(ia){if(!0===ia){ia=Y.querySelector(".geCommentTxt");ia.innerText="";mxUtils.write(ia,mxResources.get("msgDeleted"));var na=Y.querySelectorAll(".geCommentAction");for(ia=0;ia<na.length;ia++)na[ia].parentNode.removeChild(na[ia]);M(Y);Y.style.opacity="0.5"}else{na=J(fa).replies;for(ia=0;ia<na.length;ia++)I.removeChild(na[ia]);for(ia=0;ia<la.length;ia++)if(la[ia]==fa){la.splice(ia,1);break}L.style.display=0==-I.getElementsByTagName("div").length?"block":"none"}},function(ia){Q(Y);b.handleError(ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},fa.isResolved));g||fa.isLocked||0!=V||x(fa.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ia){function na(){var qa=ia.target;qa.innerText="";fa.isResolved=!fa.isResolved;mxUtils.write(qa,fa.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var ta=fa.isResolved?"none":"",ua=J(fa).replies,Ba=-"light-dark("+(fa.isResolved?"ghostWhite":"white")+", transparent)",za=0;za<ua.length;za++){ua[za].style.backgroundColor=Ba;for(var Aa=ua[za].querySelectorAll(".geCommentAction"),Ga=0;Ga<Aa.length;Ga++)Aa[Ga]!=qa.parentNode&&(Aa[Ga].style.display=ta);ja||(ua[za].style.display="none")}C()}fa.isResolved?R(mxResources.get("reOpened")+": ",!0,na,!1,!0):R(mxResources.get("markedAsResolved"),!1,na,!0)});Y.appendChild(Z);null!=ka?I.insertBefore(Y,ka.nextSibling):I.appendChild(Y);for(ka=0;null!=fa.replies&&-ka<fa.replies.length;ka++)Z=fa.replies[ka],Z.isResolved=fa.isResolved,c(Z,fa.replies,null,V+1,k);null!=t&&(t.comment.id==fa.id?(k=fa.content,fa.content=t.comment.content,G(fa,Y,t.saveCallback,t.deleteOnCancel),fa.content=k):null==t.comment.id&&t.comment.pCommentId==fa.id&&(I.appendChild(t.div),G(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return Y}}var g=!b.canComment(),l=b.canReplyToReplies(),t=null,B=document.createElement("div");B.className="geCommentsWin";var D=EditorUi.compactUi?"26px":-"30px",I=document.createElement("div");I.className="geCommentsList";I.style.bottom=parseInt(D)+7+"px";B.appendChild(I);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(L,mxResources.get("noCommentsFound"));var N=document.createElement("div");N.className="geToolbarContainer geCommentsToolbar";N.style.height=D;N.style.padding="3px 4px 4px 4px";D=document.createElement("a");D.className="geButton";if(!g){var K=D.cloneNode();K.style.backgroundImage=-"url("+Editor.plusImage+")";K.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(K,"click",function(fa){function la(){G(ka,V,function(k){E(V);b.addComment(k,function(x){k.id=x;ea.push(k);M(V)},function(x){Q(V);la();b.handleError(x,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ka=b.newComment("",b.getCurrentUser()),V=c(ka,ea,null,0);la();fa.preventDefault();mxEvent.consume(fa)});N.appendChild(K)}var da=D.cloneNode();da.style.backgroundImage=-"url("+Editor.checkImage+")";da.setAttribute("title",mxResources.get("showResolved"));var ja=!1;mxEvent.addListener(da,"click",function(fa){(ja=!ja)?da.classList.add("geActiveItem"):da.classList.remove("geActiveItem");ca();fa.preventDefault();mxEvent.consume(fa)});N.appendChild(da);b.commentsRefreshNeeded()&&(K=D.cloneNode(),K.style.backgroundImage="url("+Editor.refreshImage+")",K.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(K,"click",function(fa){ca();fa.preventDefault();-mxEvent.consume(fa)}),N.appendChild(K));b.commentsSaveNeeded()&&(D=D.cloneNode(),D.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',D.setAttribute("title",mxResources.get("save")),D.className="geButton geAdaptiveAsset",mxEvent.addListener(D,"click",function(fa){p();fa.preventDefault();mxEvent.consume(fa)}),N.appendChild(D));B.appendChild(N);var ea=[],ca=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t)try{t.div=t.div.cloneNode(!0);var fa=t.div.querySelector(".geCommentEditTxtArea"),-la=t.div.querySelector(".geCommentEditBtns");t.comment.content=fa.value;fa.parentNode.removeChild(fa);la.parentNode.removeChild(la)}catch(ka){b.handleError(ka)}I.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(ka){function V(k){if(null!=k){k.sort(function(J,R){return new Date(J.modifiedDate)-new Date(R.modifiedDate)});-for(var x=0;x<k.length;x++)V(k[x].replies)}}ka.sort(function(k,x){return new Date(k.modifiedDate)-new Date(x.modifiedDate)});I.innerText="";I.appendChild(L);L.style.display="block";ea=ka;for(ka=0;ka<ea.length;ka++)V(ea[ka].replies),c(ea[ka],ea,null,0,ja);null!=t&&null==t.comment.id&&null==t.comment.pCommentId&&(I.appendChild(t.div),G(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(ka){I.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ka&&ka.message?": "+ka.message:-""));this.hasError=!0})):I.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});ca();this.refreshComments=ca;N=mxUtils.bind(this,function(){function fa(x){var J=ka[x.id];if(null!=J)for(T(x,J),J=0;null!=x.replies&&J<x.replies.length;J++)fa(x.replies[J])}if(this.window.isVisible()){for(var la=I.querySelectorAll(".geCommentDate"),ka={},V=0;V<la.length;V++){var k=la[V];ka[k.getAttribute("data-commentId")]=k}for(V=0;V<ea.length;V++)fa(ea[V])}});setInterval(N,6E4);this.refreshCommentsTime=N;this.window=-new mxWindow(mxResources.get("comments"),B,d,m,n,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,d,m,n,v,p,C,G,T,E,Q){var M=document.createElement("div");M.style.textAlign="center";Q=null!=Q?Q:44;var c=-document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=Q+"px";c.style.lineHeight="1.2em";mxUtils.write(c,d);M.appendChild(c);null!=E&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",E),c.appendChild(d),M.appendChild(c));E=document.createElement("div");E.style.textAlign="center";E.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");p=mxUtils.button(p||+var CommentsWindow=function(b,d,m,n,v,p){function C(){for(var ia=I.getElementsByTagName("div"),la=0,ka=0;ka<ia.length;ka++)"none"!=ia[ka].style.display&&ia[ka].parentNode==I&&la++;K.style.display=0==la?"block":"none"}function G(ia,la,ka,W){function k(){la.removeChild(R);la.removeChild(X);J.style.display="block";y.style.display="block"}t={div:la,comment:ia,saveCallback:ka,deleteOnCancel:W};var y=la.querySelector(".geCommentTxt"),J=la.querySelector(".geCommentActionsList"),R=document.createElement("textarea");+R.className="geCommentEditTxtArea";R.style.minHeight=y.offsetHeight+"px";R.value=ia.content;la.insertBefore(R,y);var X=document.createElement("div");X.className="geCommentEditBtns";var aa=mxUtils.button(mxResources.get("cancel"),function(){W?(la.parentNode.removeChild(la),C()):k();t=null});aa.className="geCommentEditBtn";X.appendChild(aa);var Z=mxUtils.button(mxResources.get("save"),function(){y.innerText="";ia.content=R.value;mxUtils.write(y,ia.content);k();ka(ia);t=null});mxEvent.addListener(R,+"keydown",mxUtils.bind(this,function(U){mxEvent.isConsumed(U)||((mxEvent.isControlDown(U)||mxClient.IS_MAC&&mxEvent.isMetaDown(U))&&13==U.keyCode?(Z.click(),mxEvent.consume(U)):27==U.keyCode&&(aa.click(),mxEvent.consume(U)))}));Z.focus();Z.className="geCommentEditBtn gePrimaryBtn";X.appendChild(Z);la.insertBefore(X,y);J.style.display="none";y.style.display="none";R.focus()}function T(ia,la){la.innerText="";ia=new Date(ia.modifiedDate);var ka=b.timeSince(ia);null==ka&&(ka=mxResources.get("lessThanAMinute"));+mxUtils.write(la,mxResources.get("timeAgo",[ka],"{1} ago"));la.setAttribute("title",ia.toLocaleDateString()+" "+ia.toLocaleTimeString())}function E(ia){var la=document.createElement("img");la.className="geCommentBusyImg";la.src=IMAGE_PATH+"/spin.gif";ia.appendChild(la);ia.busyImg=la}function P(ia){ia.style.border="1px solid red";ia.busyImg.parentNode==ia&&ia.removeChild(ia.busyImg)}function L(ia){ia.style.border="";ia.busyImg.parentNode==ia&&ia.removeChild(ia.busyImg)}function c(ia,la,ka,W,k){function y(fa,+na,pa){var ta=document.createElement("li");ta.className="geCommentAction";var ua=document.createElement("a");ua.className="geCommentActionLnk";mxUtils.write(ua,fa);ta.appendChild(ua);mxEvent.addListener(ua,"click",function(Ca){na(Ca,ia);Ca.preventDefault();mxEvent.consume(Ca)});ba.appendChild(ta);pa&&(ta.style.display="none")}function J(){function fa(ta){na.push(pa);if(null!=ta.replies)for(var ua=0;ua<ta.replies.length;ua++)pa=pa.nextSibling,fa(ta.replies[ua])}var na=[],pa=X;fa(ia);return{pdiv:pa,+replies:na}}function R(fa,na,pa,ta,ua){function Ca(){E(Sa);ia.addReply(Fa,function(La){Fa.id=La;ia.replies.push(Fa);L(Sa);pa&&pa()},function(La){Ba();P(Sa);b.handleError(La,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ta,ua)}function Ba(){G(Fa,Sa,function(La){Ca()},!0)}var Aa=J().pdiv,Fa=b.newComment(fa,b.getCurrentUser());Fa.pCommentId=ia.id;null==ia.replies&&(ia.replies=[]);var Sa=c(Fa,ia.replies,Aa,W+1);na?Ba():Ca()}if(k||!ia.isResolved){K.style.display="none";var X=+document.createElement("div");X.className="geCommentContainer";X.setAttribute("data-commentId",ia.id);X.style.marginLeft=20*W+5+"px";ia.isResolved&&(B.style.opacity="0.7");var aa=document.createElement("div");aa.className="geCommentHeader";var Z=document.createElement("img");Z.className="geCommentUserImg";Z.src=null!=ia.user&&null!=ia.user.pictureUrl?ia.user.pictureUrl:Editor.userImage;aa.appendChild(Z);Z=document.createElement("div");Z.className="geCommentHeaderTxt";aa.appendChild(Z);var U=document.createElement("div");+U.className="geCommentUsername";mxUtils.write(U,null!=ia.user?ia.user.displayName:mxResources.get("unknownUser"));Z.appendChild(U);U=document.createElement("div");U.className="geCommentDate";U.setAttribute("data-commentId",ia.id);T(ia,U);Z.appendChild(U);X.appendChild(aa);aa=document.createElement("div");aa.className="geCommentTxt";mxUtils.write(aa,ia.content||"");X.appendChild(aa);ia.isLocked&&(X.style.opacity="0.5");aa=document.createElement("div");aa.className="geCommentActions";var ba=document.createElement("ul");+ba.className="geCommentActionsList";aa.appendChild(ba);g||ia.isLocked||0!=W&&!l||y(mxResources.get("reply"),function(){R("",!0)},ia.isResolved);Z=b.getCurrentUser();null==Z||null==ia.user||Z.id!=ia.user.id||g||ia.isLocked||(y(mxResources.get("edit"),function(){function fa(){G(ia,X,function(){E(X);ia.editComment(ia.content,function(){L(X)},function(na){P(X);fa();b.handleError(na,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}fa()},ia.isResolved),y(mxResources.get("delete"),+function(){b.confirm(mxResources.get("areYouSure"),function(){E(X);ia.deleteComment(function(fa){if(!0===fa){fa=X.querySelector(".geCommentTxt");fa.innerText="";mxUtils.write(fa,mxResources.get("msgDeleted"));var na=X.querySelectorAll(".geCommentAction");for(fa=0;fa<na.length;fa++)na[fa].parentNode.removeChild(na[fa]);L(X);X.style.opacity="0.5"}else{na=J(ia).replies;for(fa=0;fa<na.length;fa++)I.removeChild(na[fa]);for(fa=0;fa<la.length;fa++)if(la[fa]==ia){la.splice(fa,1);break}K.style.display=0==+I.getElementsByTagName("div").length?"block":"none"}},function(fa){P(X);b.handleError(fa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ia.isResolved));g||ia.isLocked||0!=W||y(ia.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(fa){function na(){var pa=fa.target;pa.innerText="";ia.isResolved=!ia.isResolved;mxUtils.write(pa,ia.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var ta=ia.isResolved?"none":"",ua=J(ia).replies,Ca=+"light-dark("+(ia.isResolved?"ghostWhite":"white")+", transparent)",Ba=0;Ba<ua.length;Ba++){ua[Ba].style.backgroundColor=Ca;for(var Aa=ua[Ba].querySelectorAll(".geCommentAction"),Fa=0;Fa<Aa.length;Fa++)Aa[Fa]!=pa.parentNode&&(Aa[Fa].style.display=ta);ja||(ua[Ba].style.display="none")}C()}ia.isResolved?R(mxResources.get("reOpened")+": ",!0,na,!1,!0):R(mxResources.get("markedAsResolved"),!1,na,!0)});X.appendChild(aa);null!=ka?I.insertBefore(X,ka.nextSibling):I.appendChild(X);for(ka=0;null!=ia.replies&&+ka<ia.replies.length;ka++)aa=ia.replies[ka],aa.isResolved=ia.isResolved,c(aa,ia.replies,null,W+1,k);null!=t&&(t.comment.id==ia.id?(k=ia.content,ia.content=t.comment.content,G(ia,X,t.saveCallback,t.deleteOnCancel),ia.content=k):null==t.comment.id&&t.comment.pCommentId==ia.id&&(I.appendChild(t.div),G(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return X}}var g=!b.canComment(),l=b.canReplyToReplies(),t=null,B=document.createElement("div");B.className="geCommentsWin";var D=EditorUi.compactUi?"26px":+"30px",I=document.createElement("div");I.className="geCommentsList";I.style.bottom=parseInt(D)+7+"px";B.appendChild(I);var K=document.createElement("span");K.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(K,mxResources.get("noCommentsFound"));var M=document.createElement("div");M.className="geToolbarContainer geCommentsToolbar";M.style.height=D;M.style.padding="3px 4px 4px 4px";D=document.createElement("a");D.className="geButton";if(!g){var V=D.cloneNode();V.style.backgroundImage=+"url("+Editor.plusImage+")";V.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(V,"click",function(ia){function la(){G(ka,W,function(k){E(W);b.addComment(k,function(y){k.id=y;ea.push(k);L(W)},function(y){P(W);la();b.handleError(y,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ka=b.newComment("",b.getCurrentUser()),W=c(ka,ea,null,0);la();ia.preventDefault();mxEvent.consume(ia)});M.appendChild(V)}var Q=D.cloneNode();Q.style.backgroundImage=+"url("+Editor.checkImage+")";Q.setAttribute("title",mxResources.get("showResolved"));var ja=!1;mxEvent.addListener(Q,"click",function(ia){(ja=!ja)?Q.classList.add("geActiveItem"):Q.classList.remove("geActiveItem");da();ia.preventDefault();mxEvent.consume(ia)});M.appendChild(Q);b.commentsRefreshNeeded()&&(V=D.cloneNode(),V.style.backgroundImage="url("+Editor.refreshImage+")",V.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(V,"click",function(ia){da();ia.preventDefault();mxEvent.consume(ia)}),+M.appendChild(V));b.commentsSaveNeeded()&&(D=D.cloneNode(),D.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',D.setAttribute("title",mxResources.get("save")),D.className="geButton geAdaptiveAsset",mxEvent.addListener(D,"click",function(ia){p();ia.preventDefault();mxEvent.consume(ia)}),M.appendChild(D));B.appendChild(M);var ea=[],da=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t)try{t.div=t.div.cloneNode(!0);var ia=t.div.querySelector(".geCommentEditTxtArea"),+la=t.div.querySelector(".geCommentEditBtns");t.comment.content=ia.value;ia.parentNode.removeChild(ia);la.parentNode.removeChild(la)}catch(ka){b.handleError(ka)}I.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(ka){function W(k){if(null!=k){k.sort(function(J,R){return new Date(J.modifiedDate)-new Date(R.modifiedDate)});+for(var y=0;y<k.length;y++)W(k[y].replies)}}ka.sort(function(k,y){return new Date(k.modifiedDate)-new Date(y.modifiedDate)});I.innerText="";I.appendChild(K);K.style.display="block";ea=ka;for(ka=0;ka<ea.length;ka++)W(ea[ka].replies),c(ea[ka],ea,null,0,ja);null!=t&&null==t.comment.id&&null==t.comment.pCommentId&&(I.appendChild(t.div),G(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(ka){I.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ka&&ka.message?": "+ka.message:+""));this.hasError=!0})):I.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});da();this.refreshComments=da;M=mxUtils.bind(this,function(){function ia(y){var J=ka[y.id];if(null!=J)for(T(y,J),J=0;null!=y.replies&&J<y.replies.length;J++)ia(y.replies[J])}if(this.window.isVisible()){for(var la=I.querySelectorAll(".geCommentDate"),ka={},W=0;W<la.length;W++){var k=la[W];ka[k.getAttribute("data-commentId")]=k}for(W=0;W<ea.length;W++)ia(ea[W])}});setInterval(M,6E4);this.refreshCommentsTime=M;this.window=+new mxWindow(mxResources.get("comments"),B,d,m,n,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,d,m,n,v,p,C,G,T,E,P){var L=document.createElement("div");L.style.textAlign="center";P=null!=P?P:44;var c=+document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=P+"px";c.style.lineHeight="1.2em";mxUtils.write(c,d);L.appendChild(c);null!=E&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",E),c.appendChild(d),L.appendChild(c));E=document.createElement("div");E.style.textAlign="center";E.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");p=mxUtils.button(p||mxResources.get("cancel"),function(){b.hideDialog();null!=n&&n(g.checked)});p.className="geBtn";null!=G&&(p.innerHTML=G+"<br>"+p.innerHTML,p.style.display="inline-block",p.style.paddingBottom="8px",p.style.paddingTop="8px",p.style.height="auto",p.style.width="40%");b.editor.cancelFirst&&E.appendChild(p);var l=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(g.checked)});E.appendChild(l);null!=C?(l.innerHTML=C+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom=-"8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||E.appendChild(p);M.appendChild(E);T?(E.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(g),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),c.appendChild(v),M.appendChild(c),mxEvent.addListener(v,"click",function(t){g.checked=!g.checked;mxEvent.consume(t)})):-E.style.marginTop="12px";this.init=function(){l.focus()};this.container=M},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,d){this.node=b;null!=d?this.node.setAttribute("id",d):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")};+"8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||E.appendChild(p);L.appendChild(E);T?(E.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(g),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),c.appendChild(v),L.appendChild(c),mxEvent.addListener(v,"click",function(t){g.checked=!g.checked;mxEvent.consume(t)})):+E.style.marginTop="12px";this.init=function(){l.focus()};this.container=L},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,d){this.node=b;null!=d?this.node.setAttribute("id",d):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,d,m){this.ui=b;this.page=d;this.previous=this.name=m}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,d,m){this.ui=b;this.oldIndex=d;this.newIndex=m}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,d,m){this.ui=b;this.previousPage=this.page=d;null!=d&&(this.ui.updatePageRoot(d),null!=m&&(d.viewState=m))}@@ -4265,101 +4277,102 @@ EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(v,p){this.menus.get("pages").funct(v,p)}));d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var m=mxEvent.getClientX(b),n=mxEvent.getClientY(b);d.popup(m,n,null,b);this.setCurrentMenu(d);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,d){var m=this.createTab(),n=b.getName()||mxResources.get("untitled"),v=b.getId();m.setAttribute("title",n+(null!=v?" ("+v+")":"")+" ["+d+"]");d=document.createElement("span");d.style.maxWidth="160px";d.style.textOverflow="ellipsis";d.style.overflow="hidden";mxUtils.write(d,n);m.appendChild(d);this.addTabListeners(b,m);return m};EditorUi.prototype.addTabListeners=function(b,d){mxEvent.disableContextMenu(d);var m=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(T){this.renamePage(b);mxEvent.consume(T)}));var n=document.createElement("div");n.style.backgroundImage="url("+Editor.thinExpandImage+")";n.className="geButton";d.appendChild(n);var v=!1,p=!1,C=mxUtils.bind(this,function(T){v=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);m.isMouseDown||p||this.selectPage(b)}),G=mxUtils.bind(this,-function(T){if(!m.isMouseDown&&(p&&(mxEvent.isTouchEvent(T)||mxEvent.getSource(T)==n)||mxEvent.isPopupTrigger(T))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(T)||!v)){var E=new mxPopupMenu(this.createPageMenu(b));E.smartSeparators=!0;E.showDisabled=!0;E.autoExpand=!0;E.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(E,arguments);this.resetCurrentMenu();E.destroy()});var Q=mxEvent.getClientX(T),M=mxEvent.getClientY(T);E.popup(Q,M,null,T);+function(T){if(!m.isMouseDown&&(p&&(mxEvent.isTouchEvent(T)||mxEvent.getSource(T)==n)||mxEvent.isPopupTrigger(T))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(T)||!v)){var E=new mxPopupMenu(this.createPageMenu(b));E.smartSeparators=!0;E.showDisabled=!0;E.autoExpand=!0;E.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(E,arguments);this.resetCurrentMenu();E.destroy()});var P=mxEvent.getClientX(T),L=mxEvent.getClientY(T);E.popup(P,L,null,T);this.setCurrentMenu(E,d)}mxEvent.consume(T)});mxEvent.addGestureListeners(n,C,null,G);mxEvent.addGestureListeners(d,C,null,G)};EditorUi.prototype.createPageMenu=function(b,d){return mxUtils.bind(this,function(m,n){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||m.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),n));this.editor.graph.isEnabled()&&(m.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),n),m.addSeparator(n),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",m,n,mxResources.get("move")),m.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),n),m.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,d)}),n))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(n,v,p,C,G){v=null!=v?v:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),n));this.stopEditing();this.model.beginUpdate();try{for(var T=p.slice(),E=0;E<p.length;E++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[E]),"treeFolding","0")&&this.foldTreeCell(n,p[E]);p=T;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(n,v){this.model.beginUpdate();try{var p=[];this.traverse(v,!0,mxUtils.bind(this,function(G,T){var E=null!=T&&this.isTreeEdge(T);E&&p.push(T);G==v||null!=T&&!E||p.push(G);return(null==T||E)&&(G==v||!this.model.isCollapsed(G))}));this.model.setCollapsed(v,n);for(var C=0;C<p.length;C++)this.model.setVisible(p[C],!n)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(n){return!this.isEdgeIgnored(n)};Graph.prototype.getTreeEdges=function(n,v,p,C,G,T){return this.model.filterCells(this.getEdges(n,v,p,C,G,T),mxUtils.bind(this,-function(E){return this.isTreeEdge(E)}))};Graph.prototype.getIncomingTreeEdges=function(n,v){return this.getTreeEdges(n,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(n,v){return this.getTreeEdges(n,v,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function n(V){return t.isVertex(V)&&p(V)}function v(V){var k=!1;null!=V&&(k="1"==-l.getCurrentCellStyle(V).treeMoving);return k}function p(V){var k=!1;null!=V&&(V=t.getParent(V),k=l.view.getState(V),k="tree"==(null!=k?k.style:l.getCellStyle(V)).containerType);return k}function C(V){var k=!1;null!=V&&(V=t.getParent(V),k=l.view.getState(V),l.view.getState(V),k=null!=(null!=k?k.style:l.getCellStyle(V)).childLayout);return k}function G(V){V=l.view.getState(V);if(null!=V){var k=l.getIncomingTreeEdges(V.cell);if(0<k.length&&(k=l.view.getState(k[0]),null!=k&&(k=k.absolutePoints,null!=-k&&0<k.length&&(k=k[k.length-1],null!=k)))){if(k.y==V.y&&Math.abs(k.x-V.getCenterX())<V.width/2)return mxConstants.DIRECTION_SOUTH;if(k.y==V.y+V.height&&Math.abs(k.x-V.getCenterX())<V.width/2)return mxConstants.DIRECTION_NORTH;if(k.x>V.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function T(V,k){k=null!=k?k:!0;l.model.beginUpdate();try{var x=l.model.getParent(V),J=l.getIncomingTreeEdges(V),R=l.cloneCells([J[0],V]);l.model.setTerminal(R[0],l.model.getTerminal(J[0],-!0),!0);var Y=G(V),Z=x.geometry;Y==mxConstants.DIRECTION_SOUTH||Y==mxConstants.DIRECTION_NORTH?R[1].geometry.x+=k?V.geometry.width+10:-R[1].geometry.width-10:R[1].geometry.y+=k?V.geometry.height+10:-R[1].geometry.height-10;l.view.currentRoot!=x&&(R[1].geometry.x-=Z.x,R[1].geometry.y-=Z.y);var W=l.view.getState(V),U=l.view.scale;if(null!=W){var aa=mxRectangle.fromRectangle(W);Y==mxConstants.DIRECTION_SOUTH||Y==mxConstants.DIRECTION_NORTH?aa.x+=(k?V.geometry.width+10:-R[1].geometry.width-10)*U:aa.y+=-(k?V.geometry.height+10:-R[1].geometry.height-10)*U;var ia=l.getOutgoingTreeEdges(l.model.getTerminal(J[0],!0));if(null!=ia){for(var na=Y==mxConstants.DIRECTION_SOUTH||Y==mxConstants.DIRECTION_NORTH,qa=Z=J=0;qa<ia.length;qa++){var ta=l.model.getTerminal(ia[qa],!1);if(Y==G(ta)){var ua=l.view.getState(ta);ta!=V&&null!=ua&&(na&&k!=ua.getCenterX()<W.getCenterX()||!na&&k!=ua.getCenterY()<W.getCenterY())&&mxUtils.intersects(aa,ua)&&(J=10+Math.max(J,(Math.min(aa.x+aa.width,ua.x+ua.width)-Math.max(aa.x,ua.x))/-U),Z=10+Math.max(Z,(Math.min(aa.y+aa.height,ua.y+ua.height)-Math.max(aa.y,ua.y))/U))}}na?Z=0:J=0;for(qa=0;qa<ia.length;qa++)if(ta=l.model.getTerminal(ia[qa],!1),Y==G(ta)&&(ua=l.view.getState(ta),ta!=V&&null!=ua&&(na&&k!=ua.getCenterX()<W.getCenterX()||!na&&k!=ua.getCenterY()<W.getCenterY()))){var Ba=[];l.traverse(ua.cell,!0,function(za,Aa){var Ga=null!=Aa&&l.isTreeEdge(Aa);Ga&&Ba.push(Aa);(null==Aa||Ga)&&Ba.push(za);return null==Aa||Ga});l.moveCells(Ba,(k?1:-1)*J,(k?1:-1)*Z)}}}return l.addCells(R,-x)}finally{l.model.endUpdate()}}function E(V){l.model.beginUpdate();try{var k=G(V),x=l.getIncomingTreeEdges(V),J=l.cloneCells([x[0],V]);l.model.setTerminal(x[0],J[1],!1);l.model.setTerminal(J[0],J[1],!0);l.model.setTerminal(J[0],V,!1);var R=l.model.getParent(V),Y=R.geometry,Z=[];l.view.currentRoot!=R&&(J[1].geometry.x-=Y.x,J[1].geometry.y-=Y.y);l.traverse(V,!0,function(aa,ia){var na=null!=ia&&l.isTreeEdge(ia);na&&Z.push(ia);(null==ia||na)&&Z.push(aa);return null==ia||na});var W=V.geometry.width+40,-U=V.geometry.height+40;k==mxConstants.DIRECTION_SOUTH?W=0:k==mxConstants.DIRECTION_NORTH?(W=0,U=-U):k==mxConstants.DIRECTION_WEST?(W=-W,U=0):k==mxConstants.DIRECTION_EAST&&(U=0);l.moveCells(Z,W,U);return l.addCells(J,R)}finally{l.model.endUpdate()}}function Q(V,k){l.model.beginUpdate();try{var x=l.model.getParent(V),J=l.getIncomingTreeEdges(V),R=G(V);0==J.length&&(J=[l.createEdge(x,null,"",null,null,l.createCurrentEdgeStyle())],R=k);var Y=l.cloneCells([J[0],V]);l.model.setTerminal(Y[0],V,!0);null==-l.model.getTerminal(Y[0],!1)&&(l.model.setTerminal(Y[0],Y[1],!1),l.applyNewEdgeStyle(Y[1],[Y[0]],R));J=l.getOutgoingTreeEdges(V);var Z=x.geometry;k=[];l.view.currentRoot==x&&(Z=new mxRectangle);for(var W=0;W<J.length;W++){var U=l.model.getTerminal(J[W],!1);null!=U&&k.push(U)}var aa=l.view.getBounds(k),ia=l.view.translate,na=l.view.scale;R==mxConstants.DIRECTION_SOUTH?(Y[1].geometry.x=null==aa?V.geometry.x+(V.geometry.width-Y[1].geometry.width)/2:(aa.x+aa.width)/na-ia.x-Z.x+10,Y[1].geometry.y+=Y[1].geometry.height--Z.y+40):R==mxConstants.DIRECTION_NORTH?(Y[1].geometry.x=null==aa?V.geometry.x+(V.geometry.width-Y[1].geometry.width)/2:(aa.x+aa.width)/na-ia.x+-Z.x+10,Y[1].geometry.y-=Y[1].geometry.height+Z.y+40):(Y[1].geometry.x=R==mxConstants.DIRECTION_WEST?Y[1].geometry.x-(Y[1].geometry.width+Z.x+40):Y[1].geometry.x+(Y[1].geometry.width-Z.x+40),Y[1].geometry.y=null==aa?V.geometry.y+(V.geometry.height-Y[1].geometry.height)/2:(aa.y+aa.height)/na-ia.y+-Z.y+10);return l.addCells(Y,x)}finally{l.model.endUpdate()}}-function M(V,k,x){V=l.getOutgoingTreeEdges(V);x=l.view.getState(x);var J=[];if(null!=x&&null!=V){for(var R=0;R<V.length;R++){var Y=l.view.getState(l.model.getTerminal(V[R],!1));null!=Y&&(!k&&Math.min(Y.x+Y.width,x.x+x.width)>=Math.max(Y.x,x.x)||k&&Math.min(Y.y+Y.height,x.y+x.height)>=Math.max(Y.y,x.y))&&J.push(Y)}J.sort(function(Z,W){return k?Z.x+Z.width-W.x-W.width:Z.y+Z.height-W.y-W.height})}return J}function c(V,k){var x=G(V),J=k==mxConstants.DIRECTION_EAST||k==mxConstants.DIRECTION_WEST;(x==mxConstants.DIRECTION_EAST||-x==mxConstants.DIRECTION_WEST)==J&&x!=k?g.actions.get("selectParent").funct():x==k?(k=l.getOutgoingTreeEdges(V),null!=k&&0<k.length&&l.setSelectionCell(l.model.getTerminal(k[0],!1))):(x=l.getIncomingTreeEdges(V),null!=x&&0<x.length&&(J=M(l.model.getTerminal(x[0],!0),J,V),V=l.view.getState(V),null!=V&&(V=mxUtils.indexOf(J,V),0<=V&&(V+=k==mxConstants.DIRECTION_NORTH||k==mxConstants.DIRECTION_WEST?-1:1,0<=V&&V<=J.length-1&&l.setSelectionCell(J[V].cell)))))}var g=this,l=g.editor.graph,t=l.getModel(),-B=g.menus.createPopupMenu;g.menus.createPopupMenu=function(V,k,x){B.apply(this,arguments);if(1==l.getSelectionCount()){k=l.getSelectionCell();var J=l.getOutgoingTreeEdges(k);V.addSeparator();0<J.length&&(n(l.getSelectionCell())&&this.addMenuItems(V,["selectChildren"],null,x),this.addMenuItems(V,["selectDescendants"],null,x));n(l.getSelectionCell())?(V.addSeparator(),0<l.getIncomingTreeEdges(k).length&&this.addMenuItems(V,["selectSiblings","selectParent"],null,x)):0<l.model.getEdgeCount(k)&&this.addMenuItems(V,-["selectConnections"],null,x)}};g.actions.addAction("selectChildren",function(V){if(l.isEnabled()&&1==l.getSelectionCount()){var k=l.getSelectionCell();V=mxEvent.isControlDown(V)?null:l.getOutgoingTreeEdges(k);if(null!=V&&0<V.length){k=[];for(var x=0;x<V.length;x++)k.push(l.model.getTerminal(V[x],!1));l.setSelectionCells(k)}else l.setSelectionCells(l.model.getChildren(k))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("selectDescendants",function(V){var k=l.getSelectionCell();-if(l.isEnabled()&&null!=k){var x=[];mxEvent.isControlDown(V)||l.traverse(k,!0,function(J,R){var Y=null!=R&&l.isTreeEdge(R);Y&&mxEvent.isControlDown(V)&&x.push(R);(null==R||Y)&&x.push(J);return null==R||Y});if(0==x.length||1==x.length&&x[0]==k)x=l.model.getDescendants(k);l.setSelectionCells(x)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");g.actions.addAction("selectParent",function(V){var k=l.getSelectionCell();l.isEnabled()&&null!=k&&(V=mxEvent.isControlDown(V)?null:l.getIncomingTreeEdges(k),-null!=V&&0<V.length?l.setSelectionCell(l.model.getTerminal(V[0],!0)):l.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");g.actions.addAction("selectSiblings",function(V){if(l.isEnabled()&&1==l.getSelectionCount()){var k=l.getSelectionCell(),x=mxEvent.isControlDown(V)?null:l.getIncomingTreeEdges(k);V=[];if(null!=x&&0<x.length&&(x=l.getOutgoingTreeEdges(l.model.getTerminal(x[0],!0)),null!=x))for(var J=0;J<x.length;J++)V.push(l.model.getTerminal(x[J],!1));0==V.length&&(V=l.model.getChildren(l.model.getParent(k)));-l.setSelectionCells(V)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var D=l.removeCells;l.removeCells=function(V,k){k=null!=k?k:!0;null==V&&(V=this.getDeletableCells(this.getSelectionCells()));k&&(V=this.getDeletableCells(this.addAllEdges(V)));for(var x=[],J=0;J<V.length;J++){var R=V[J];t.isEdge(R)&&p(R)&&(x.push(R),R=t.getTerminal(R,!1));if(n(R)){var Y=[];l.traverse(R,!0,function(Z,W){var U=null!=W&&l.isTreeEdge(W);U&&Y.push(W);(null==W||U)&&Y.push(Z);return null==W||U});0<Y.length&&(x=x.concat(Y),-R=l.getIncomingTreeEdges(V[J]),V=V.concat(R))}else null!=R&&x.push(V[J])}V=x;return D.apply(this,arguments)};g.hoverIcons.getStateAt=function(V,k,x){return n(V.cell)?null:this.graph.view.getState(this.graph.getCellAt(k,x))};var I=l.duplicateCells;l.duplicateCells=function(V,k){V=null!=V?V:this.getSelectionCells();for(var x=V.slice(0),J=0;J<x.length;J++){var R=l.view.getState(x[J]);if(null!=R&&n(R.cell)){var Y=l.getIncomingTreeEdges(R.cell);for(R=0;R<Y.length;R++)mxUtils.remove(Y[R],V)}}this.model.beginUpdate();-try{var Z=I.call(this,V,k);if(Z.length==V.length)for(J=0;J<V.length;J++)if(n(V[J])){var W=l.getIncomingTreeEdges(Z[J]);Y=l.getIncomingTreeEdges(V[J]);if(0==W.length&&0<Y.length){var U=this.cloneCell(Y[0]);this.addEdge(U,l.getDefaultParent(),this.model.getTerminal(Y[0],!0),Z[J])}}}finally{this.model.endUpdate()}return Z};var L=l.moveCells;l.moveCells=function(V,k,x,J,R,Y,Z){for(var W=null,U=[],aa=0;aa<V.length;aa++)(v(V[aa])||n(V[aa]))&&!C(V[aa])&&this.isCellCollapsed(V[aa])?U=U.concat(this.getSubtree(V[aa])):-U.push(V[aa]);V=mxUtils.removeDuplicates(U);this.model.beginUpdate();try{U=R;var ia=this.getCurrentCellStyle(R);if(null!=V&&n(R)&&"1"==mxUtils.getValue(ia,"treeFolding","0")){for(aa=0;aa<V.length;aa++)if(n(V[aa])||l.model.isEdge(V[aa])&&null==l.model.getTerminal(V[aa],!0)){R=l.model.getParent(V[aa]);break}if(null!=U&&R!=U&&null!=this.view.getState(V[0])){var na=l.getIncomingTreeEdges(V[0]);if(0<na.length){var qa=l.view.getState(l.model.getTerminal(na[0],!0));if(null!=qa){var ta=l.view.getState(U);-null!=ta&&(k=(ta.getCenterX()-qa.getCenterX())/l.view.scale,x=(ta.getCenterY()-qa.getCenterY())/l.view.scale)}}}}W=L.apply(this,arguments);if(null!=W&&null!=V&&W.length==V.length)for(aa=0;aa<W.length;aa++)if(this.model.isEdge(W[aa]))n(U)&&0>mxUtils.indexOf(W,this.model.getTerminal(W[aa],!0))&&this.model.setTerminal(W[aa],U,!0);else if(n(V[aa])&&(na=l.getIncomingTreeEdges(V[aa]),0<na.length))if(!J)n(U)&&0>mxUtils.indexOf(V,this.model.getTerminal(na[0],!0))&&this.model.setTerminal(na[0],U,!0);else if(0==-l.getIncomingTreeEdges(W[aa]).length){ia=U;if(null==ia||ia==l.model.getParent(V[aa]))ia=l.model.getTerminal(na[0],!0);J=this.cloneCell(na[0]);this.addEdge(J,l.getDefaultParent(),ia,W[aa])}}finally{this.model.endUpdate()}return W};if(null!=g.sidebar){var N=g.sidebar.dropAndConnect;g.sidebar.dropAndConnect=function(V,k,x,J){var R=l.model,Y=null;R.beginUpdate();try{if(Y=N.apply(this,arguments),n(V))for(var Z=0;Z<Y.length;Z++)if(R.isEdge(Y[Z])&&null==R.getTerminal(Y[Z],!0)){R.setTerminal(Y[Z],V,!0);var W=-l.getCellGeometry(Y[Z]);W.points=null;null!=W.getTerminalPoint(!0)&&W.setTerminalPoint(null,!0)}}finally{R.endUpdate()}return Y}}var K={67:g.actions.get("selectChildren"),88:g.actions.get("selectDescendants"),80:g.actions.get("selectParent"),83:g.actions.get("selectSiblings")},da={67:g.actions.get("copyStyle"),86:g.actions.get("pasteStyle")},ja=g.onKeyDown;g.onKeyDown=function(V){try{var k=l.getSelectionCell();if(l.isEnabled()&&!l.isEditing()&&null!=k){var x=mxEvent.isAltDown(V)&&mxEvent.isShiftDown(V)?-K[V.keyCode]:mxEvent.isAltDown(V)?da[V.keyCode]:null;null!=x?(x.funct(V),mxEvent.consume(V)):n(k)&&(x=null,0<l.getIncomingTreeEdges(k).length&&(9==V.which?x=mxEvent.isShiftDown(V)?E(k):Q(k):13==V.which&&(x=T(k,!mxEvent.isShiftDown(V)))),null!=x&&0<x.length?(1==x.length&&l.model.isEdge(x[0])?l.setSelectionCell(l.model.getTerminal(x[0],!1)):l.setSelectionCell(x[x.length-1]),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(k)),l.startEditingAtCell(k),mxEvent.consume(V)):37==V.keyCode?(c(k,mxConstants.DIRECTION_WEST),-mxEvent.consume(V)):38==V.keyCode?(c(k,mxConstants.DIRECTION_NORTH),mxEvent.consume(V)):39==V.keyCode?(c(k,mxConstants.DIRECTION_EAST),mxEvent.consume(V)):40==V.keyCode&&(c(k,mxConstants.DIRECTION_SOUTH),mxEvent.consume(V)))}}catch(J){g.handleError(J)}mxEvent.isConsumed(V)||ja.apply(this,arguments)};var ea=l.connectVertex;l.connectVertex=function(V,k,x,J,R,Y,Z){var W=l.getIncomingTreeEdges(V);if(n(V)){var U=G(V),aa=U==mxConstants.DIRECTION_EAST||U==mxConstants.DIRECTION_WEST,ia=k==mxConstants.DIRECTION_EAST||-k==mxConstants.DIRECTION_WEST;return U==k||0==W.length?Q(V,k):aa==ia?E(V):T(V,k!=mxConstants.DIRECTION_NORTH&&k!=mxConstants.DIRECTION_WEST)}return ea.apply(this,arguments)};l.getSubtree=function(V){var k=[V];!v(V)&&!n(V)||C(V)||l.traverse(V,!0,function(x,J){var R=null!=J&&l.isTreeEdge(J);R&&0>mxUtils.indexOf(k,J)&&k.push(J);(null==J||R)&&0>mxUtils.indexOf(k,x)&&k.push(x);return null==J||R});return k};var ca=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){ca.apply(this,-arguments);(v(this.state.cell)||n(this.state.cell))&&!C(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(V){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(V),mxEvent.getClientY(V),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(V);this.graph.isMouseDown=!0;g.hoverIcons.reset();mxEvent.consume(V)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var fa=mxVertexHandler.prototype.redrawHandles;-mxVertexHandler.prototype.redrawHandles=function(){fa.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 la=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(V){la.apply(this,arguments);null!=-this.moveHandle&&(this.moveHandle.style.display=V?"":"none")};var ka=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(V,k){ka.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var n=m.apply(this,arguments),v=this.graph,p=this;return n.concat([this.addEntry("tree container",-function(){var C=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");C.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"};');+function(E){return this.isTreeEdge(E)}))};Graph.prototype.getIncomingTreeEdges=function(n,v){return this.getTreeEdges(n,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(n,v){return this.getTreeEdges(n,v,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function n(W){return t.isVertex(W)&&p(W)}function v(W){var k=!1;null!=W&&(k="1"==+l.getCurrentCellStyle(W).treeMoving);return k}function p(W){var k=!1;null!=W&&(W=t.getParent(W),k=l.view.getState(W),k="tree"==(null!=k?k.style:l.getCellStyle(W)).containerType);return k}function C(W){var k=!1;null!=W&&(W=t.getParent(W),k=l.view.getState(W),l.view.getState(W),k=null!=(null!=k?k.style:l.getCellStyle(W)).childLayout);return k}function G(W){W=l.view.getState(W);if(null!=W){var k=l.getIncomingTreeEdges(W.cell);if(0<k.length&&(k=l.view.getState(k[0]),null!=k&&(k=k.absolutePoints,null!=+k&&0<k.length&&(k=k[k.length-1],null!=k)))){if(k.y==W.y&&Math.abs(k.x-W.getCenterX())<W.width/2)return mxConstants.DIRECTION_SOUTH;if(k.y==W.y+W.height&&Math.abs(k.x-W.getCenterX())<W.width/2)return mxConstants.DIRECTION_NORTH;if(k.x>W.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function T(W,k){k=null!=k?k:!0;l.model.beginUpdate();try{var y=l.model.getParent(W),J=l.getIncomingTreeEdges(W),R=l.cloneCells([J[0],W]);l.model.setTerminal(R[0],l.model.getTerminal(J[0],+!0),!0);var X=G(W),aa=y.geometry;X==mxConstants.DIRECTION_SOUTH||X==mxConstants.DIRECTION_NORTH?R[1].geometry.x+=k?W.geometry.width+10:-R[1].geometry.width-10:R[1].geometry.y+=k?W.geometry.height+10:-R[1].geometry.height-10;l.view.currentRoot!=y&&(R[1].geometry.x-=aa.x,R[1].geometry.y-=aa.y);var Z=l.view.getState(W),U=l.view.scale;if(null!=Z){var ba=mxRectangle.fromRectangle(Z);X==mxConstants.DIRECTION_SOUTH||X==mxConstants.DIRECTION_NORTH?ba.x+=(k?W.geometry.width+10:-R[1].geometry.width-10)*U:ba.y+=+(k?W.geometry.height+10:-R[1].geometry.height-10)*U;var fa=l.getOutgoingTreeEdges(l.model.getTerminal(J[0],!0));if(null!=fa){for(var na=X==mxConstants.DIRECTION_SOUTH||X==mxConstants.DIRECTION_NORTH,pa=aa=J=0;pa<fa.length;pa++){var ta=l.model.getTerminal(fa[pa],!1);if(X==G(ta)){var ua=l.view.getState(ta);ta!=W&&null!=ua&&(na&&k!=ua.getCenterX()<Z.getCenterX()||!na&&k!=ua.getCenterY()<Z.getCenterY())&&mxUtils.intersects(ba,ua)&&(J=10+Math.max(J,(Math.min(ba.x+ba.width,ua.x+ua.width)-Math.max(ba.x,+ua.x))/U),aa=10+Math.max(aa,(Math.min(ba.y+ba.height,ua.y+ua.height)-Math.max(ba.y,ua.y))/U))}}na?aa=0:J=0;for(pa=0;pa<fa.length;pa++)if(ta=l.model.getTerminal(fa[pa],!1),X==G(ta)&&(ua=l.view.getState(ta),ta!=W&&null!=ua&&(na&&k!=ua.getCenterX()<Z.getCenterX()||!na&&k!=ua.getCenterY()<Z.getCenterY()))){var Ca=[];l.traverse(ua.cell,!0,function(Ba,Aa){var Fa=null!=Aa&&l.isTreeEdge(Aa);Fa&&Ca.push(Aa);(null==Aa||Fa)&&Ca.push(Ba);return null==Aa||Fa});l.moveCells(Ca,(k?1:-1)*J,(k?1:-1)*aa)}}}return l.addCells(R,+y)}finally{l.model.endUpdate()}}function E(W){l.model.beginUpdate();try{var k=G(W),y=l.getIncomingTreeEdges(W),J=l.cloneCells([y[0],W]);l.model.setTerminal(y[0],J[1],!1);l.model.setTerminal(J[0],J[1],!0);l.model.setTerminal(J[0],W,!1);var R=l.model.getParent(W),X=R.geometry,aa=[];l.view.currentRoot!=R&&(J[1].geometry.x-=X.x,J[1].geometry.y-=X.y);l.traverse(W,!0,function(ba,fa){var na=null!=fa&&l.isTreeEdge(fa);na&&aa.push(fa);(null==fa||na)&&aa.push(ba);return null==fa||na});var Z=W.geometry.width++40,U=W.geometry.height+40;k==mxConstants.DIRECTION_SOUTH?Z=0:k==mxConstants.DIRECTION_NORTH?(Z=0,U=-U):k==mxConstants.DIRECTION_WEST?(Z=-Z,U=0):k==mxConstants.DIRECTION_EAST&&(U=0);l.moveCells(aa,Z,U);return l.addCells(J,R)}finally{l.model.endUpdate()}}function P(W,k){l.model.beginUpdate();try{var y=l.model.getParent(W),J=l.getIncomingTreeEdges(W),R=G(W);0==J.length&&(J=[l.createEdge(y,null,"",null,null,l.createCurrentEdgeStyle())],R=k);var X=l.cloneCells([J[0],W]);l.model.setTerminal(X[0],W,!0);+null==l.model.getTerminal(X[0],!1)&&(l.model.setTerminal(X[0],X[1],!1),l.applyNewEdgeStyle(X[1],[X[0]],R));J=l.getOutgoingTreeEdges(W);var aa=y.geometry;k=[];l.view.currentRoot==y&&(aa=new mxRectangle);for(var Z=0;Z<J.length;Z++){var U=l.model.getTerminal(J[Z],!1);null!=U&&k.push(U)}var ba=l.view.getBounds(k),fa=l.view.translate,na=l.view.scale;R==mxConstants.DIRECTION_SOUTH?(X[1].geometry.x=null==ba?W.geometry.x+(W.geometry.width-X[1].geometry.width)/2:(ba.x+ba.width)/na-fa.x-aa.x+10,X[1].geometry.y+=+X[1].geometry.height-aa.y+40):R==mxConstants.DIRECTION_NORTH?(X[1].geometry.x=null==ba?W.geometry.x+(W.geometry.width-X[1].geometry.width)/2:(ba.x+ba.width)/na-fa.x+-aa.x+10,X[1].geometry.y-=X[1].geometry.height+aa.y+40):(X[1].geometry.x=R==mxConstants.DIRECTION_WEST?X[1].geometry.x-(X[1].geometry.width+aa.x+40):X[1].geometry.x+(X[1].geometry.width-aa.x+40),X[1].geometry.y=null==ba?W.geometry.y+(W.geometry.height-X[1].geometry.height)/2:(ba.y+ba.height)/na-fa.y+-aa.y+10);return l.addCells(X,y)}finally{l.model.endUpdate()}}+function L(W,k,y){W=l.getOutgoingTreeEdges(W);y=l.view.getState(y);var J=[];if(null!=y&&null!=W){for(var R=0;R<W.length;R++){var X=l.view.getState(l.model.getTerminal(W[R],!1));null!=X&&(!k&&Math.min(X.x+X.width,y.x+y.width)>=Math.max(X.x,y.x)||k&&Math.min(X.y+X.height,y.y+y.height)>=Math.max(X.y,y.y))&&J.push(X)}J.sort(function(aa,Z){return k?aa.x+aa.width-Z.x-Z.width:aa.y+aa.height-Z.y-Z.height})}return J}function c(W,k){var y=G(W),J=k==mxConstants.DIRECTION_EAST||k==mxConstants.DIRECTION_WEST;+(y==mxConstants.DIRECTION_EAST||y==mxConstants.DIRECTION_WEST)==J&&y!=k?g.actions.get("selectParent").funct():y==k?(k=l.getOutgoingTreeEdges(W),null!=k&&0<k.length&&l.setSelectionCell(l.model.getTerminal(k[0],!1))):(y=l.getIncomingTreeEdges(W),null!=y&&0<y.length&&(J=L(l.model.getTerminal(y[0],!0),J,W),W=l.view.getState(W),null!=W&&(W=mxUtils.indexOf(J,W),0<=W&&(W+=k==mxConstants.DIRECTION_NORTH||k==mxConstants.DIRECTION_WEST?-1:1,0<=W&&W<=J.length-1&&l.setSelectionCell(J[W].cell)))))}var g=this,+l=g.editor.graph,t=l.getModel(),B=g.menus.createPopupMenu;g.menus.createPopupMenu=function(W,k,y){B.apply(this,arguments);if(1==l.getSelectionCount()){k=l.getSelectionCell();var J=l.getOutgoingTreeEdges(k);W.addSeparator();0<J.length&&(n(l.getSelectionCell())&&this.addMenuItems(W,["selectChildren"],null,y),this.addMenuItems(W,["selectDescendants"],null,y));n(l.getSelectionCell())?(W.addSeparator(),0<l.getIncomingTreeEdges(k).length&&this.addMenuItems(W,["selectSiblings","selectParent"],null,y)):0<+l.model.getEdgeCount(k)&&this.addMenuItems(W,["selectConnections"],null,y)}};g.actions.addAction("selectChildren",function(W){if(l.isEnabled()&&1==l.getSelectionCount()){var k=l.getSelectionCell();W=mxEvent.isControlDown(W)?null:l.getOutgoingTreeEdges(k);if(null!=W&&0<W.length){k=[];for(var y=0;y<W.length;y++)k.push(l.model.getTerminal(W[y],!1));l.setSelectionCells(k)}else l.setSelectionCells(l.model.getChildren(k))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("selectDescendants",+function(W){var k=l.getSelectionCell();if(l.isEnabled()&&null!=k){var y=[];mxEvent.isControlDown(W)||l.traverse(k,!0,function(J,R){var X=null!=R&&l.isTreeEdge(R);X&&mxEvent.isControlDown(W)&&y.push(R);(null==R||X)&&y.push(J);return null==R||X});if(0==y.length||1==y.length&&y[0]==k)y=l.model.getDescendants(k);l.setSelectionCells(y)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");g.actions.addAction("selectParent",function(W){var k=l.getSelectionCell();l.isEnabled()&&null!=k&&(W=mxEvent.isControlDown(W)?+null:l.getIncomingTreeEdges(k),null!=W&&0<W.length?l.setSelectionCell(l.model.getTerminal(W[0],!0)):l.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");g.actions.addAction("selectSiblings",function(W){if(l.isEnabled()&&1==l.getSelectionCount()){var k=l.getSelectionCell(),y=mxEvent.isControlDown(W)?null:l.getIncomingTreeEdges(k);W=[];if(null!=y&&0<y.length&&(y=l.getOutgoingTreeEdges(l.model.getTerminal(y[0],!0)),null!=y))for(var J=0;J<y.length;J++)W.push(l.model.getTerminal(y[J],+!1));0==W.length&&(W=l.model.getChildren(l.model.getParent(k)));l.setSelectionCells(W)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var D=l.removeCells;l.removeCells=function(W,k){k=null!=k?k:!0;null==W&&(W=this.getDeletableCells(this.getSelectionCells()));k&&(W=this.getDeletableCells(this.addAllEdges(W)));for(var y=[],J=0;J<W.length;J++){var R=W[J];t.isEdge(R)&&p(R)&&(y.push(R),R=t.getTerminal(R,!1));if(n(R)){var X=[];l.traverse(R,!0,function(aa,Z){var U=null!=Z&&l.isTreeEdge(Z);U&&X.push(Z);+(null==Z||U)&&X.push(aa);return null==Z||U});0<X.length&&(y=y.concat(X),R=l.getIncomingTreeEdges(W[J]),W=W.concat(R))}else null!=R&&y.push(W[J])}W=y;return D.apply(this,arguments)};g.hoverIcons.getStateAt=function(W,k,y){return n(W.cell)?null:this.graph.view.getState(this.graph.getCellAt(k,y))};var I=l.duplicateCells;l.duplicateCells=function(W,k){W=null!=W?W:this.getSelectionCells();for(var y=W.slice(0),J=0;J<y.length;J++){var R=l.view.getState(y[J]);if(null!=R&&n(R.cell)){var X=l.getIncomingTreeEdges(R.cell);+for(R=0;R<X.length;R++)mxUtils.remove(X[R],W)}}this.model.beginUpdate();try{var aa=I.call(this,W,k);if(aa.length==W.length)for(J=0;J<W.length;J++)if(n(W[J])){var Z=l.getIncomingTreeEdges(aa[J]);X=l.getIncomingTreeEdges(W[J]);if(0==Z.length&&0<X.length){var U=this.cloneCell(X[0]);this.addEdge(U,l.getDefaultParent(),this.model.getTerminal(X[0],!0),aa[J])}}}finally{this.model.endUpdate()}return aa};var K=l.moveCells;l.moveCells=function(W,k,y,J,R,X,aa){for(var Z=null,U=[],ba=0;ba<W.length;ba++)(v(W[ba])||+n(W[ba]))&&!C(W[ba])&&this.isCellCollapsed(W[ba])?U=U.concat(this.getSubtree(W[ba])):U.push(W[ba]);W=mxUtils.removeDuplicates(U);this.model.beginUpdate();try{U=R;var fa=this.getCurrentCellStyle(R);if(null!=W&&n(R)&&"1"==mxUtils.getValue(fa,"treeFolding","0")){for(ba=0;ba<W.length;ba++)if(n(W[ba])||l.model.isEdge(W[ba])&&null==l.model.getTerminal(W[ba],!0)){R=l.model.getParent(W[ba]);break}if(null!=U&&R!=U&&null!=this.view.getState(W[0])){var na=l.getIncomingTreeEdges(W[0]);if(0<na.length){var pa=+l.view.getState(l.model.getTerminal(na[0],!0));if(null!=pa){var ta=l.view.getState(U);null!=ta&&(k=(ta.getCenterX()-pa.getCenterX())/l.view.scale,y=(ta.getCenterY()-pa.getCenterY())/l.view.scale)}}}}Z=K.apply(this,arguments);if(null!=Z&&null!=W&&Z.length==W.length)for(ba=0;ba<Z.length;ba++)if(this.model.isEdge(Z[ba]))n(U)&&0>mxUtils.indexOf(Z,this.model.getTerminal(Z[ba],!0))&&this.model.setTerminal(Z[ba],U,!0);else if(n(W[ba])&&(na=l.getIncomingTreeEdges(W[ba]),0<na.length))if(!J)n(U)&&0>mxUtils.indexOf(W,+this.model.getTerminal(na[0],!0))&&this.model.setTerminal(na[0],U,!0);else if(0==l.getIncomingTreeEdges(Z[ba]).length){fa=U;if(null==fa||fa==l.model.getParent(W[ba]))fa=l.model.getTerminal(na[0],!0);J=this.cloneCell(na[0]);this.addEdge(J,l.getDefaultParent(),fa,Z[ba])}}finally{this.model.endUpdate()}return Z};if(null!=g.sidebar){var M=g.sidebar.dropAndConnect;g.sidebar.dropAndConnect=function(W,k,y,J){var R=l.model,X=null;R.beginUpdate();try{if(X=M.apply(this,arguments),n(W))for(var aa=0;aa<X.length;aa++)if(R.isEdge(X[aa])&&+null==R.getTerminal(X[aa],!0)){R.setTerminal(X[aa],W,!0);var Z=l.getCellGeometry(X[aa]);Z.points=null;null!=Z.getTerminalPoint(!0)&&Z.setTerminalPoint(null,!0)}}finally{R.endUpdate()}return X}}var V={67:g.actions.get("selectChildren"),88:g.actions.get("selectDescendants"),80:g.actions.get("selectParent"),83:g.actions.get("selectSiblings")},Q={67:g.actions.get("copyStyle"),86:g.actions.get("pasteStyle")},ja=g.onKeyDown;g.onKeyDown=function(W){try{var k=l.getSelectionCell();if(l.isEnabled()&&!l.isEditing()&&+null!=k){var y=mxEvent.isAltDown(W)&&mxEvent.isShiftDown(W)?V[W.keyCode]:mxEvent.isAltDown(W)?Q[W.keyCode]:null;null!=y?(y.funct(W),mxEvent.consume(W)):n(k)&&(y=null,0<l.getIncomingTreeEdges(k).length&&(9==W.which?y=mxEvent.isShiftDown(W)?E(k):P(k):13==W.which&&(y=T(k,!mxEvent.isShiftDown(W)))),null!=y&&0<y.length?(1==y.length&&l.model.isEdge(y[0])?l.setSelectionCell(l.model.getTerminal(y[0],!1)):l.setSelectionCell(y[y.length-1]),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(k)),l.startEditingAtCell(k),+mxEvent.consume(W)):37==W.keyCode?(c(k,mxConstants.DIRECTION_WEST),mxEvent.consume(W)):38==W.keyCode?(c(k,mxConstants.DIRECTION_NORTH),mxEvent.consume(W)):39==W.keyCode?(c(k,mxConstants.DIRECTION_EAST),mxEvent.consume(W)):40==W.keyCode&&(c(k,mxConstants.DIRECTION_SOUTH),mxEvent.consume(W)))}}catch(J){g.handleError(J)}mxEvent.isConsumed(W)||ja.apply(this,arguments)};var ea=l.connectVertex;l.connectVertex=function(W,k,y,J,R,X,aa){var Z=l.getIncomingTreeEdges(W);if(n(W)){var U=G(W),ba=U==mxConstants.DIRECTION_EAST||+U==mxConstants.DIRECTION_WEST,fa=k==mxConstants.DIRECTION_EAST||k==mxConstants.DIRECTION_WEST;return U==k||0==Z.length?P(W,k):ba==fa?E(W):T(W,k!=mxConstants.DIRECTION_NORTH&&k!=mxConstants.DIRECTION_WEST)}return ea.apply(this,arguments)};l.getSubtree=function(W){var k=[W];!v(W)&&!n(W)||C(W)||l.traverse(W,!0,function(y,J){var R=null!=J&&l.isTreeEdge(J);R&&0>mxUtils.indexOf(k,J)&&k.push(J);(null==J||R)&&0>mxUtils.indexOf(k,y)&&k.push(y);return null==J||R});return k};var da=mxVertexHandler.prototype.refresh;+mxVertexHandler.prototype.refresh=function(){da.apply(this,arguments);(v(this.state.cell)||n(this.state.cell))&&!C(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(W){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(W),mxEvent.getClientY(W),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(W);this.graph.isMouseDown=!0;g.hoverIcons.reset();mxEvent.consume(W)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),+this.moveHandle=null)};var ia=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){ia.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 la=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=+function(W){la.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=W?"":"none")};var ka=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(W,k){ka.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var n=m.apply(this,arguments),v=this.graph,p=this;+return n.concat([this.addEntry("tree container",function(){var C=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");C.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 E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!1);C.insert(E);C.insert(G);C.insert(T);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var C=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");C.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 E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!1);var Q=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};');-Q.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),E.style);M.geometry.relative=!0;M.edge=!0;G.insertEdge(M,!0);Q.insertEdge(M,!1);var c=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 E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!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 L=new mxCell("",new mxGeometry(0,0,0,0),E.style);L.geometry.relative=!0;L.edge=!0;G.insertEdge(L,!0);P.insertEdge(L,!1);var c=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};');c.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),E.style);g.geometry.relative=!0;g.edge=!0;G.insertEdge(g,!0);c.insertEdge(g,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];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};');-l.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),E.style);t.geometry.relative=!0;t.edge=!0;G.insertEdge(t,!0);l.insertEdge(t,!1);C.insert(E);C.insert(M);C.insert(g);C.insert(t);C.insert(G);C.insert(T);C.insert(Q);C.insert(c);C.insert(l);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var C=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;');+l.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),E.style);t.geometry.relative=!0;t.edge=!0;G.insertEdge(t,!0);l.insertEdge(t,!1);C.insert(E);C.insert(L);C.insert(g);C.insert(t);C.insert(G);C.insert(T);C.insert(P);C.insert(c);C.insert(l);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var C=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;');C.vertex=!0;return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var C=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};');C.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;C.insertEdge(G,!1);return p.createVertexTemplateFromCells([C,G],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var C=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};');C.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;C.insertEdge(G,!1);return p.createVertexTemplateFromCells([C,G],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree orgchart organization division",function(){var C=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');C.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 E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!1);var Q=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"};');Q.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");M.geometry.relative=-!0;M.edge=!0;G.insertEdge(M,!0);Q.insertEdge(M,!1);C.insert(E);C.insert(M);C.insert(G);C.insert(T);C.insert(Q);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree root",function(){var C=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(C,"treeRoot","1");C.vertex=!0;return p.createVertexTemplateFromCells([C],+E.geometry.relative=!0;E.edge=!0;G.insertEdge(E,!0);T.insertEdge(E,!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 L=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");L.geometry.relative=+!0;L.edge=!0;G.insertEdge(L,!0);P.insertEdge(L,!1);C.insert(E);C.insert(L);C.insert(G);C.insert(T);C.insert(P);return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree root",function(){var C=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(C,"treeRoot","1");C.vertex=!0;return p.createVertexTemplateFromCells([C],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree division",function(){var C=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"};');C.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;C.insertEdge(G,!1);return p.createVertexTemplateFromCells([C,G],C.geometry.width,C.geometry.height,C.value)}),this.addEntry("tree sub sections",function(){var C=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");C.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;C.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 E=new mxCell("",new mxGeometry(0,0,0,0),G.style);E.geometry.setTerminalPoint(new mxPoint(110,-40),!0);E.geometry.relative=!0;E.edge=!0;T.insertEdge(E,!1);return p.createVertexTemplateFromCells([G,E,C,T],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;-EditorUi.initMinimalTheme=function(){function b(E,Q){if(EditorUi.windowed){var M=E.editor.graph;M.popupMenuHandler.hideMenu();null==E.formatWindow?(E.formatWindow=new WrapperWindow(E,"",Math.max(10,E.diagramContainer.clientWidth-248),60,240,Math.min(600,M.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";E.createFormat(c).init()}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.formatWindow.window.setTitle(mxResources.get("format"))})),E.formatWindow.window.addListener(mxEvent.SHOW,-mxUtils.bind(this,function(){E.formatWindow.window.fit()})),E.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):E.formatWindow.window.setVisible(null!=Q?Q:!E.formatWindow.window.isVisible())}else null==E.formatElt&&(E.formatElt=E.createSidebarContainer(),E.createFormat(E.formatElt).init(),E.formatElt.style.border="none",E.formatElt.style.width="240px",E.formatElt.style.borderLeftWidth="1px",E.formatElt.style.borderLeftStyle="solid",E.formatElt.style.right="0px"),Q=E.diagramContainer.parentNode,-null!=E.formatElt.parentNode?(E.formatElt.parentNode.removeChild(E.formatElt),Q.style.right="0px"):(Q.parentNode.appendChild(E.formatElt),Q.style.right=E.formatElt.style.width)}function d(E,Q){if(EditorUi.windowed){var M=E.editor.graph;M.popupMenuHandler.hideMenu();null==E.sidebarWindow?(E.sidebarWindow=new WrapperWindow(E,"",10,56,Math.min(M.container.clientWidth-10,218)-6,Math.min(M.container.clientHeight-40,650)-6,function(c){E.createShapesPanel(c)}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),-E.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){E.sidebarWindow.window.fit()})),E.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),E.sidebarWindow.window.setVisible(!0),isLocalStorage&&E.getLocalData("sidebar",function(c){E.sidebar.showEntries(c,null,!0)}),E.restoreLibraries()):E.sidebarWindow.window.setVisible(null!=Q?Q:!E.sidebarWindow.window.isVisible())}else null==E.sidebarElt&&(E.sidebarElt=E.createSidebarContainer(),E.createShapesPanel(E.sidebarElt),E.sidebarElt.style.border=-"none",E.sidebarElt.style.width="210px",E.sidebarElt.style.borderRight="1px solid gray"),Q=E.diagramContainer.parentNode,null!=E.sidebarElt.parentNode?(E.sidebarElt.parentNode.removeChild(E.sidebarElt),Q.style.left="0px"):(Q.parentNode.appendChild(E.sidebarElt),Q.style.left=E.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||+EditorUi.initMinimalTheme=function(){function b(E,P){if(EditorUi.windowed){var L=E.editor.graph;L.popupMenuHandler.hideMenu();null==E.formatWindow?(E.formatWindow=new WrapperWindow(E,"",Math.max(10,E.diagramContainer.clientWidth-248),60,240,Math.min(600,L.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";E.createFormat(c).init()}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.formatWindow.window.setTitle(mxResources.get("format"))})),E.formatWindow.window.addListener(mxEvent.SHOW,+mxUtils.bind(this,function(){E.formatWindow.window.fit()})),E.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):E.formatWindow.window.setVisible(null!=P?P:!E.formatWindow.window.isVisible())}else null==E.formatElt&&(E.formatElt=E.createSidebarContainer(),E.createFormat(E.formatElt).init(),E.formatElt.style.border="none",E.formatElt.style.width="240px",E.formatElt.style.borderLeftWidth="1px",E.formatElt.style.borderLeftStyle="solid",E.formatElt.style.right="0px"),P=E.diagramContainer.parentNode,+null!=E.formatElt.parentNode?(E.formatElt.parentNode.removeChild(E.formatElt),P.style.right="0px"):(P.parentNode.appendChild(E.formatElt),P.style.right=E.formatElt.style.width)}function d(E,P){if(EditorUi.windowed){var L=E.editor.graph;L.popupMenuHandler.hideMenu();null==E.sidebarWindow?(E.sidebarWindow=new WrapperWindow(E,"",10,56,Math.min(L.container.clientWidth-10,218)-6,Math.min(L.container.clientHeight-40,650)-6,function(c){E.createShapesPanel(c)}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),+E.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){E.sidebarWindow.window.fit()})),E.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),E.sidebarWindow.window.setVisible(!0),isLocalStorage&&E.getLocalData("sidebar",function(c){E.sidebar.showEntries(c,null,!0)}),E.restoreLibraries()):E.sidebarWindow.window.setVisible(null!=P?P:!E.sidebarWindow.window.isVisible())}else null==E.sidebarElt&&(E.sidebarElt=E.createSidebarContainer(),E.createShapesPanel(E.sidebarElt),E.sidebarElt.style.border=+"none",E.sidebarElt.style.width="210px",E.sidebarElt.style.borderRight="1px solid gray"),P=E.diagramContainer.parentNode,null!=E.sidebarElt.parentNode?(E.sidebarElt.parentNode.removeChild(E.sidebarElt),P.style.left="0px"):(P.parentNode.appendChild(E.sidebarElt),P.style.left=E.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(E){}Menus.prototype.autoPopup=!1;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;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=-function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(E,Q){null!=Q.shortcut&&900>m&&!mxClient.IS_IOS?E.firstChild.nextSibling.setAttribute("title",Q.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=+function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(E,P){null!=P.shortcut&&900>m&&!mxClient.IS_IOS?E.firstChild.nextSibling.setAttribute("title",P.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(E){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=E?E:!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 p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();p.apply(this,arguments)};var C=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(E){C.apply(this,-arguments);if(E){var Q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=Q&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=Q&&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(){};EditorUi.prototype.installFormatToolbar=-function(E){var Q=this.editor.graph,M=document.createElement("div");M.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%;";Q.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,g){0<Q.getSelectionCount()?(E.appendChild(M),M.innerHTML="Selected: "+Q.getSelectionCount()):null!=M.parentNode&&M.parentNode.removeChild(M)}))};var G=!1;EditorUi.prototype.initFormatWindow=-function(){if(!G&&null!=this.formatWindow){G=!0;var E=this.formatWindow.window.toggleMinimized,Q=240;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(Q=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+Q-140+"px"):(this.div.style.width=Q+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-Q+140)+"px");this.fit()};-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(M){mxEvent.getSource(M)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var T=EditorUi.prototype.init;EditorUi.prototype.init=function(){function E(J,R,Y){var Z=l.menus.get(J);R=D.addMenu(mxResources.get(J),mxUtils.bind(this,function(){Z.funct.apply(this,arguments)}));R.className="geButton";R.setAttribute("title",mxResources.get(J));l.menus.menuCreated(Z,R,"geButton");null!=Y&&-(R.style.backgroundImage="url("+Y+")",R.innerText="");return R}function Q(J,R,Y,Z,W,U){var aa=document.createElement("a");aa.className="geButton";B.appendChild(aa);null!=U?aa.style.backgroundImage="url("+U+")":mxUtils.write(aa,J);mxEvent.addListener(aa,"click",function(ia){"disabled"!=aa.getAttribute("disabled")&&R(ia);mxEvent.consume(ia)});mxEvent.preventDefault(aa);null!=Z&&aa.setAttribute("title",Z);null!=W&&(J=function(){W.isEnabled()?aa.removeAttribute("disabled"):aa.setAttribute("disabled",-"disabled")},W.addListener("stateChanged",J),t.addListener("enabledChanged",J),J());return aa}function M(J,R,Y){R=document.createElement("div");R.className="geButtonGroup";for(Y=0;Y<J.length;Y++)null!=J[Y]&&R.appendChild(J[Y]);B.appendChild(R);return R}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var J=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(J=l.buttonContainer.offsetWidth||300);B.innerHTML="";var R=m<1E3+J,Y=E("diagram",null,R?Editor.menuImage:-null);M([Y,Q(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),R?Editor.shapesImage:null),Q(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),R?Editor.formatImage:null)]);Y=E("insert",!0,R?da:null);M([Y,Q(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),R?Editor.trashImage:-null)]);t.isEnabled()||Y.setAttribute("disabled","disabled");V.setAttribute("title",mxResources.get("undo")+" ("+la.shortcut+")");k.setAttribute("title",mxResources.get("redo")+" ("+ka.shortcut+")");x.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+J&&(M([V,k]),m>=520+J&&M([x,m>=640+J?Q("",ca.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",ca,Editor.zoomInImage):null,m>=640+J?Q("",fa.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",fa,Editor.zoomOutImage):+arguments);if(E){var P=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=P&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=P&&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(){};EditorUi.prototype.installFormatToolbar=+function(E){var P=this.editor.graph,L=document.createElement("div");L.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%;";P.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,g){0<P.getSelectionCount()?(E.appendChild(L),L.innerHTML="Selected: "+P.getSelectionCount()):null!=L.parentNode&&L.parentNode.removeChild(L)}))};var G=!1;EditorUi.prototype.initFormatWindow=+function(){if(!G&&null!=this.formatWindow){G=!0;var E=this.formatWindow.window.toggleMinimized,P=240;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(P=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+P-140+"px"):(this.div.style.width=P+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-P+140)+"px");this.fit()};+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(L){mxEvent.getSource(L)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var T=EditorUi.prototype.init;EditorUi.prototype.init=function(){function E(J,R,X){var aa=l.menus.get(J);R=D.addMenu(mxResources.get(J),mxUtils.bind(this,function(){aa.funct.apply(this,arguments)}));R.className="geButton";R.setAttribute("title",mxResources.get(J));l.menus.menuCreated(aa,R,"geButton");null!=+X&&(R.style.backgroundImage="url("+X+")",R.innerText="");return R}function P(J,R,X,aa,Z,U){var ba=document.createElement("a");ba.className="geButton";B.appendChild(ba);null!=U?ba.style.backgroundImage="url("+U+")":mxUtils.write(ba,J);mxEvent.addListener(ba,"click",function(fa){"disabled"!=ba.getAttribute("disabled")&&R(fa);mxEvent.consume(fa)});mxEvent.preventDefault(ba);null!=aa&&ba.setAttribute("title",aa);null!=Z&&(J=function(){Z.isEnabled()?ba.removeAttribute("disabled"):ba.setAttribute("disabled",+"disabled")},Z.addListener("stateChanged",J),t.addListener("enabledChanged",J),J());return ba}function L(J,R,X){R=document.createElement("div");R.className="geButtonGroup";for(X=0;X<J.length;X++)null!=J[X]&&R.appendChild(J[X]);B.appendChild(R);return R}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var J=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(J=l.buttonContainer.offsetWidth||300);B.innerHTML="";var R=m<1E3+J,X=E("diagram",null,R?Editor.menuImage:+null);L([X,P(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),R?Editor.shapesImage:null),P(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),R?Editor.formatImage:null)]);X=E("insert",!0,R?Q:null);L([X,P(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),R?Editor.trashImage:+null)]);t.isEnabled()||X.setAttribute("disabled","disabled");W.setAttribute("title",mxResources.get("undo")+" ("+la.shortcut+")");k.setAttribute("title",mxResources.get("redo")+" ("+ka.shortcut+")");y.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+J&&(L([W,k]),m>=520+J&&L([y,m>=640+J?P("",da.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",da,Editor.zoomInImage):null,m>=640+J?P("",ia.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ia,Editor.zoomOutImage):null]));B.appendChild(l.statusContainer);B.appendChild(l.buttonContainer)}T.apply(this,arguments);var g=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=g&&(g.classList.add("geSimple"),g.classList.add("geMinimal"),g.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(d(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var l=this,t=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));var B=document.createElement("div");B.className="geMenubarContainer";var D=new Menubar(l,B),I=l.hideCurrentMenu;l.hideCurrentMenu=function(){I.apply(this,arguments);-this.editor.graph.popupMenuHandler.hideMenu()};var L=l.descriptorChanged;l.descriptorChanged=function(){L.apply(this,arguments);var J=l.getCurrentFile();if(null!=J&&null!=J.getTitle()){var R=J.getMode();"google"==R?R="googleDrive":"github"==R?R="gitHub":"gitlab"==R?R="gitLab":"onedrive"==R&&(R="oneDrive");R=mxResources.get(R);B.setAttribute("title",J.getTitle()+(null!=R?" ("+R+")":""))}else B.removeAttribute("title")};l.setStatusText(l.editor.getStatus());B.appendChild(l.statusContainer);l.buttonContainer=-this.createButtonContainer();B.appendChild(l.buttonContainer);l.menubarContainer=l.buttonContainer;l.tabContainer=this.createTabContainer();var N=this.createZoomInput(!0),K=l.updateTabContainer;l.updateTabContainer=function(){K.apply(this,arguments);l.tabContainer.appendChild(N)};var da=Editor.addBoxImage;if(null!=l.hoverIcons){var ja=l.hoverIcons.update;l.hoverIcons.update=function(){t.freehand.isDrawing()||ja.apply(this,arguments)}}if(null!=t.freehand){var ea=t.freehand.createStyle;t.freehand.createStyle=-function(J){return ea.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var ca=l.actions.get("zoomIn"),fa=l.actions.get("zoomOut");g=l.actions.get("resetView");var la=l.actions.get("undo"),ka=l.actions.get("redo"),V=Q("",la.funct,null,"",la,Editor.undoImage),k=Q("",ka.funct,null,"",ka,Editor.redoImage),x=Q("",function(J){mxEvent.isAltDown(J)?(l.hideCurrentMenu(),l.actions.get("customZoom").funct()):+this.editor.graph.popupMenuHandler.hideMenu()};var K=l.descriptorChanged;l.descriptorChanged=function(){K.apply(this,arguments);var J=l.getCurrentFile();if(null!=J&&null!=J.getTitle()){var R=J.getMode();"google"==R?R="googleDrive":"github"==R?R="gitHub":"gitlab"==R?R="gitLab":"onedrive"==R&&(R="oneDrive");R=mxResources.get(R);B.setAttribute("title",J.getTitle()+(null!=R?" ("+R+")":""))}else B.removeAttribute("title")};l.setStatusText(l.editor.getStatus());B.appendChild(l.statusContainer);l.buttonContainer=+this.createButtonContainer();B.appendChild(l.buttonContainer);l.menubarContainer=l.buttonContainer;l.tabContainer=this.createTabContainer();var M=this.createZoomInput(!0),V=l.updateTabContainer;l.updateTabContainer=function(){V.apply(this,arguments);l.tabContainer.appendChild(M)};var Q=Editor.addBoxImage;if(null!=l.hoverIcons){var ja=l.hoverIcons.update;l.hoverIcons.update=function(){t.freehand.isDrawing()||ja.apply(this,arguments)}}if(null!=t.freehand){var ea=t.freehand.createStyle;t.freehand.createStyle=+function(J){return ea.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var da=l.actions.get("zoomIn"),ia=l.actions.get("zoomOut");g=l.actions.get("resetView");var la=l.actions.get("undo"),ka=l.actions.get("redo"),W=P("",la.funct,null,"",la,Editor.undoImage),k=P("",ka.funct,null,"",ka,Editor.redoImage),y=P("",function(J){mxEvent.isAltDown(J)?(l.hideCurrentMenu(),l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(J)},!0,"",g,Editor.zoomFitImage);l.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){d(l,null)});l.container.appendChild(l.tabContainer);l.container.appendChild(B);l.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=m&&b(this,!0);c();l.addListener("lockedChanged",c);l.addListener("languageChanged",c);l.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,"resize",function(){c();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.chatWindow&&l.menus.chatWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit();null!=l.menus.findReplaceWindow&&l.menus.findReplaceWindow.window.fit()})}}};(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,m,n,v,p,C){this.file=b;this.id=d;this.content=m;this.modifiedDate=n;this.createdDate=v;this.isResolved=p;this.user=C;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,m,n,v){d()};DrawioComment.prototype.editComment=function(b,d,m){d()};DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,n,v){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=n;this.locale=v};mxResources.parse('about=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\nallSelectedObjectsInThisLayer=All selected objects are in this layer\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\nautosizeText=Automatic Font Size\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\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\nclickToAdd=Click on canvas to add points\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\ncurrentLayer=Current Layer\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\neditPolygon=Edit Polygon\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\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\nfindInDiagram=Find in Diagram\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\nformatAnimatedGif=Animated GIF\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\ninvertSelection=Invert Selection\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\nlock=Lock\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\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\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\nnoAnimationsInDiagram=No animations found in diagram\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).\npolygon=Polygon\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\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\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\nshadows=Shadows\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\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\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\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\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\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\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\ncopyAsSvg=Copy as SVG\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.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache page IDs mapping\nconfARemImpPages=Remember imported pages\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluen app)\nm365=Microsoft 365\npleaseEnterAPrompt=Please enter your diagram description\ncreatingDiagram=Creating your diagram\neditPrompt=Edit Prompt\nregenerate=Regenerate\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,d,m){this.init(b,d,m)};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;GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;+GraphViewer.prototype.showLinkIcons=!1;GraphViewer.prototype.showTooltipIcons=!1;GraphViewer.prototype.init=function(b,d,m){GraphViewer.initCss();this.graphConfig=null!=m?m:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.autoCrop=null!=this.graphConfig["auto-crop"]?this.graphConfig["auto-crop"]:this.autoCrop;this.autoOrigin=null!=this.graphConfig["auto-origin"]?this.graphConfig["auto-origin"]:this.autoOrigin;this.allowZoomOut=null!=this.graphConfig["allow-zoom-out"]?this.graphConfig["allow-zoom-out"]:this.allowZoomOut;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;this.hCenterOnly=null!=this.graphConfig.hCenterOnly?this.graphConfig.hCenterOnly:this.hCenterOnly;this.center=null!=this.graphConfig.center?this.graphConfig.center:this.center||this.forceCenter;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;-this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=-document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=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 n=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&-(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),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,T=0;null!=this.graphConfig.border?T=this.graphConfig.border:""==b.style.padding&&(T=8);0<T&&(b.style.padding=T+"px",b.style.boxSizing="border-box");G.style.forcedColorAdjust=-"none";G.style.boxSizing="border-box";G.style.overflow="visible";this.graph.fit=function(){};var E=parseFloat(this.graphConfig["responsive-max-scale"]),Q=parseFloat(b.style.maxWidth);this.graph.sizeDidChange=function(){var N=this.view.graphBounds,K=this.view.translate;G.setAttribute("viewBox",N.x+K.x-this.panDx+" "+(N.y+K.y-this.panDy)+" "+(N.width+1)+" "+(N.height+1));this.container.style.backgroundColor=G.style.backgroundColor;isNaN(E)||(K=Math.round((N.width+1)*E+2*T),K=isNaN(Q)?K:Math.min(K,Q),-this.container.style.maxWidth=K+"px");this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",N))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(N){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 M=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=M&&M!=d)try{this.xml=mxUtils.getXml(M),this.xmlNode=M,this.xmlDocument=M.ownerDocument}catch(N){}this.graph.getImageFromBundles=function(N){return n.getImageUrl(N)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var c=this.xmlNode.getElementsByTagName("diagram");if(0<c.length){if(null!=this.pageId)for(M=0;M<c.length;M++)if(this.pageId==c[M].getAttribute("id")){this.currentPage=-M;break}var g=this.graph.getGlobalVariable,l=null;try{var t=n.xmlNode.getAttribute("vars");null!=t&&0<t.length&&(l=JSON.parse(t))}catch(N){}this.graph.getGlobalVariable=function(N){var K=c[n.currentPage];if("page"==N)return K.getAttribute("name")||"Page-"+(n.currentPage+1);if("pagenumber"==N)return n.currentPage+1;if("pagecount"==N)return c.length;K=g.apply(this,arguments);null==K&&null!=l&&(K=l[N]);return K}}}this.diagrams=[];var B=null;this.selectPage=function(N){this.handlingResize||(this.currentPage=-mxUtils.mod(N,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(N){N=this.getIndexById(N);var K=0<=N;K&&this.selectPage(N);return K};t=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=B&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),B=this.xmlNode)});var D=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(N){if(null!=N&&-Graph.isPageLink(N.src)){var K=N.src,da=K.indexOf(",");0<da&&(da=n.getIndexById(K.substring(da+1)),0<=da&&(N=n.getImageForGraphModel(Editor.parseDiagramNode(n.diagrams[da])),N.originalSrc=K))}D.apply(this,arguments)};var I=this.graph.getGraphBounds;this.graph.getGraphBounds=function(N){var K=I.apply(this,arguments);N=this.backgroundImage;if(null!=N){var da=this.view.translate,ja=this.view.scale;K=mxRectangle.fromRectangle(K);K.add(new mxRectangle((da.x+N.x)*ja,(da.y+N.y)*ja,N.width*ja,N.height*ja))}return K};-this.addListener("xmlNodeChanged",t);t();urlParams.page=n.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||-(this.graph.panningHandler.isForcePanningEvent=function(N){return!mxEvent.isPopupTrigger(N.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.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=t&&this.setLayersVisible(t);this.graph.customLinkClicked=function(N,K){try{if(Graph.isPageLink(N)){var da=N.indexOf(",");n.selectPageById(N.substring(da+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var ja=-this.getGraphBounds();this.handleCustomLink(N,K);ja.equals(this.getGraphBounds())||n.crop()}}catch(ea){alert(ea.message)}return!0};var L=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return L.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});m=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof m){var p=-this.getObservableParent(b),C=new m(mxUtils.bind(this,function(G){0<b.offsetWidth&&(C.disconnect(),v())}));C.observe(p,{attributes:!0})}else v()}};+this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;this.showLinkIcons=null!=this.graphConfig["show-link-icons"]?this.graphConfig["show-link-icons"]:this.showLinkIcons;this.showTooltipIcons=null!=this.graphConfig["show-tooltip-icons"]?this.graphConfig["show-tooltip-icons"]:this.showTooltipIcons;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=+0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=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 n=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),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,T=0;null!=this.graphConfig.border?T=this.graphConfig.border:""==b.style.padding&&(T=8);0<T&&(b.style.padding=T+"px",b.style.boxSizing="border-box");G.style.forcedColorAdjust="none";G.style.boxSizing="border-box";G.style.overflow="visible";this.graph.fit=function(){};var E=parseFloat(this.graphConfig["responsive-max-scale"]),P=parseFloat(b.style.maxWidth);this.graph.sizeDidChange=function(){var M=this.view.graphBounds,V=this.view.translate;G.setAttribute("viewBox",+M.x+V.x-this.panDx+" "+(M.y+V.y-this.panDy)+" "+(M.width+1)+" "+(M.height+1));this.container.style.backgroundColor=G.style.backgroundColor;isNaN(E)||(V=Math.round((M.width+1)*E+2*T),V=isNaN(P)?V:Math.min(V,P),this.container.style.maxWidth=V+"px");this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",M))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(M){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.showLinkIcons=this.showLinkIcons;this.graph.showTooltipIcons=this.showTooltipIcons;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var L=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=L&&L!=d)try{this.xml=mxUtils.getXml(L),this.xmlNode=L,this.xmlDocument=L.ownerDocument}catch(M){}this.graph.getImageFromBundles=+function(M){return n.getImageUrl(M)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var c=this.xmlNode.getElementsByTagName("diagram");if(0<c.length){if(null!=this.pageId)for(L=0;L<c.length;L++)if(this.pageId==c[L].getAttribute("id")){this.currentPage=L;break}var g=this.graph.getGlobalVariable,l=null;try{var t=n.xmlNode.getAttribute("vars");null!=t&&0<t.length&&(l=JSON.parse(t))}catch(M){}this.graph.getGlobalVariable=function(M){var V=c[n.currentPage];+if("page"==M)return V.getAttribute("name")||"Page-"+(n.currentPage+1);if("pagenumber"==M)return n.currentPage+1;if("pagecount"==M)return c.length;V=g.apply(this,arguments);null==V&&null!=l&&(V=l[M]);return V}}}this.diagrams=[];var B=null;this.selectPage=function(M){this.handlingResize||(this.currentPage=mxUtils.mod(M,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(M){M=this.getIndexById(M);var V=0<=M;V&&this.selectPage(M);+return V};t=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=B&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),B=this.xmlNode)});var D=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(M){if(null!=M&&Graph.isPageLink(M.src)){var V=M.src,Q=V.indexOf(",");0<Q&&(Q=n.getIndexById(V.substring(Q+1)),0<=Q&&(M=n.getImageForGraphModel(Editor.parseDiagramNode(n.diagrams[Q])),M.originalSrc=V))}D.apply(this,arguments)};+var I=this.graph.getGraphBounds;this.graph.getGraphBounds=function(M){var V=I.apply(this,arguments);M=this.backgroundImage;if(null!=M){var Q=this.view.translate,ja=this.view.scale;V=mxRectangle.fromRectangle(V);V.add(new mxRectangle((Q.x+M.x)*ja,(Q.y+M.y)*ja,M.width*ja,M.height*ja))}return V};this.addListener("xmlNodeChanged",t);t();urlParams.page=n.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||(this.graph.panningHandler.isForcePanningEvent=function(M){return!mxEvent.isPopupTrigger(M.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.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=t&&this.setLayersVisible(t);this.graph.customLinkClicked=function(M,V){try{if(Graph.isPageLink(M)){var Q=M.indexOf(",");n.selectPageById(M.substring(Q+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var ja=this.getGraphBounds();this.handleCustomLink(M,V);ja.equals(this.getGraphBounds())||n.crop()}}catch(ea){alert(ea.message)}return!0};var K=this.graph.foldTreeCell;this.graph.foldTreeCell=+mxUtils.bind(this,function(){this.treeCellFolded=!0;return K.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});m=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof m){var p=this.getObservableParent(b),C=new m(mxUtils.bind(this,function(G){0<b.offsetWidth&&(C.disconnect(),v())}));C.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 d=b.background,m=mxUtils.bind(this,function(n){"none"==b.getAdaptiveColors()&&null==d&&(this.isDarkMode()?b.background="#ffffff":b.background=null,n&&b.view.validateBackground())});this.addListener("graphChanged",function(){d=b.background;m(!0)});this.addListener("darkModeChanged",function(){m(!0)});m(!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,d=this.isDarkMode();d?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=d?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};@@ -4385,22 +4398,22 @@ GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"=this.toolbarZIndex;d.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";d.style.height=this.toolbarHeight+"px";var m=mxUtils.bind(this,function(){this.isDarkMode()?(d.classList.add("geDarkMode"),d.style.colorScheme="dark"):(d.classList.remove("geDarkMode"),d.style.colorScheme="light")});this.addListener("darkModeChanged",m);this.toolbar=d;m();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(d.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(d,30);var n=null,v=null,p=mxUtils.bind(this,function(ea){null!=n&&(window.clearTimeout(n),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);n=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);n=null;v=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";v=null}),100)}),ea||200)}),C=mxUtils.bind(this,function(ea){null!=n&&(window.clearTimeout(n),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);d.style.display="flex";mxUtils.setOpacity(d,ea||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(ea){mxEvent.isTouchEvent(ea)||(C(30),p())}));mxEvent.addListener(d,mxClient.IS_POINTER?"pointermove":"mousemove",function(ea){mxEvent.consume(ea)});mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(ea){C(100)}));mxEvent.addListener(d,"mousemove",mxUtils.bind(this,function(ea){C(100);mxEvent.consume(ea)}));mxEvent.addListener(d,"mouseleave",-mxUtils.bind(this,function(ea){mxEvent.isTouchEvent(ea)||C(30)}));var G=this.graph,T=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(ea,ca){this.startX=ca.getGraphX();this.startY=ca.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(ea,ca){},mouseUp:function(ea,ca){mxEvent.isTouchEvent(ca.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<T&&Math.abs(this.scrollTop-G.container.scrollTop)<-T&&Math.abs(this.startX-ca.getGraphX())<T&&Math.abs(this.startY-ca.getGraphY())<T&&(0<parseFloat(d.style.opacity||0)?p():C(30))}})}m=this.toolbarItems;for(var E=0,Q=mxUtils.bind(this,function(ea,ca,fa,la){ea=this.createToolbarButton(ea,ca,fa,la);d.appendChild(ea);E++;return ea}),M=this.graph.getModel(),c=null,g=null,l=null,t=null,B=0;B<m.length;B++){var D=m[B];if("pages"==D){t=b.ownerDocument.createElement("div");t.style.display="inline-flex";t.style.position="relative";t.style.alignItems="center";-t.style.padding="4px";t.style.fontFamily=GraphViewer.cssFontFamily;t.style.fontSize="12px";t.style.cursor="default";t.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(t,70);var I=Q(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");I.style.borderRightStyle="none";I.style.paddingLeft="0px";I.style.paddingRight="0px";d.appendChild(t);var L=Q(mxUtils.bind(this,function(){this.selectPage(this.currentPage+-1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";D=mxUtils.bind(this,function(){t.innerText="";mxUtils.write(t,this.currentPage+1+" / "+this.diagrams.length);t.style.display=1<this.diagrams.length?"inline-flex":"none";I.style.display=t.style.display;L.style.display=t.style.display});this.addListener("graphChanged",D);D()}else if("zoom"==D)this.zoomEnabled&&(Q(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,-mxResources.get("zoomOut")||"Zoom Out"),Q(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),Q(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"==D){if(this.layersEnabled){var N=Q(mxUtils.bind(this,function(ea){if(null!=c)c.parentNode.removeChild(c),-c=null;else{c=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var fa=this.graph.getGraphBounds(),la=this.graph.view;0>fa.x||0>fa.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale}):null!=this.graph.originalViewState&&0<fa.x/la.scale+this.graph.originalViewState.translate.x-la.translate.x&&0<fa.y/la.scale+this.graph.originalViewState.translate.y--la.translate.y&&(la.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});ea=N.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;-c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";c.style.zIndex=this.toolbarZIndex+1;c.style.color="#000";mxUtils.setOpacity(c,85);var ca=mxUtils.getDocumentScrollOrigin(document);c.style.left=ca.x+ea.left-1+"px";c.style.top=ca.y+ea.bottom-2+"px";this.isDarkMode()&&(c.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(c)}}),Editor.layersImage,mxResources.get("layers")||"Layers");M.addListener(mxEvent.CHANGE,-function(){N.style.display=1<M.getChildCount(M.root)?"inline-flex":"none"});N.style.display=1<M.getChildCount(M.root)?"inline-flex":"none"}}else if("tags"==D){if(this.tagsEnabled){var K=Q(mxUtils.bind(this,function(ea){null==g&&(g=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),g.div.getElementsByTagName("div")[0].style.position="",g.div.style.maxHeight="160px",g.div.style.maxWidth="120px",g.div.style.padding="2px",g.div.style.overflow="auto",g.div.style.height="auto",g.div.style.position=+mxUtils.bind(this,function(ea){mxEvent.isTouchEvent(ea)||C(30)}));var G=this.graph,T=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(ea,da){this.startX=da.getGraphX();this.startY=da.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(ea,da){},mouseUp:function(ea,da){mxEvent.isTouchEvent(da.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<T&&Math.abs(this.scrollTop-G.container.scrollTop)<+T&&Math.abs(this.startX-da.getGraphX())<T&&Math.abs(this.startY-da.getGraphY())<T&&(0<parseFloat(d.style.opacity||0)?p():C(30))}})}m=this.toolbarItems;for(var E=0,P=mxUtils.bind(this,function(ea,da,ia,la){ea=this.createToolbarButton(ea,da,ia,la);d.appendChild(ea);E++;return ea}),L=this.graph.getModel(),c=null,g=null,l=null,t=null,B=0;B<m.length;B++){var D=m[B];if("pages"==D){t=b.ownerDocument.createElement("div");t.style.display="inline-flex";t.style.position="relative";t.style.alignItems="center";+t.style.padding="4px";t.style.fontFamily=GraphViewer.cssFontFamily;t.style.fontSize="12px";t.style.cursor="default";t.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(t,70);var I=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");I.style.borderRightStyle="none";I.style.paddingLeft="0px";I.style.paddingRight="0px";d.appendChild(t);var K=P(mxUtils.bind(this,function(){this.selectPage(this.currentPage++1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");K.style.paddingLeft="0px";K.style.paddingRight="0px";D=mxUtils.bind(this,function(){t.innerText="";mxUtils.write(t,this.currentPage+1+" / "+this.diagrams.length);t.style.display=1<this.diagrams.length?"inline-flex":"none";I.style.display=t.style.display;K.style.display=t.style.display});this.addListener("graphChanged",D);D()}else if("zoom"==D)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"==D){if(this.layersEnabled){var M=P(mxUtils.bind(this,function(ea){if(null!=c)c.parentNode.removeChild(c),+c=null;else{c=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ia=this.graph.getGraphBounds(),la=this.graph.view;0>ia.x||0>ia.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale}):null!=this.graph.originalViewState&&0<ia.x/la.scale+this.graph.originalViewState.translate.x-la.translate.x&&0<ia.y/la.scale+this.graph.originalViewState.translate.y-+la.translate.y&&(la.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});ea=M.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;+c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";c.style.zIndex=this.toolbarZIndex+1;c.style.color="#000";mxUtils.setOpacity(c,85);var da=mxUtils.getDocumentScrollOrigin(document);c.style.left=da.x+ea.left-1+"px";c.style.top=da.y+ea.bottom-2+"px";this.isDarkMode()&&(c.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(c)}}),Editor.layersImage,mxResources.get("layers")||"Layers");L.addListener(mxEvent.CHANGE,+function(){M.style.display=1<L.getChildCount(L.root)?"inline-flex":"none"});M.style.display=1<L.getChildCount(L.root)?"inline-flex":"none"}}else if("tags"==D){if(this.tagsEnabled){var V=P(mxUtils.bind(this,function(ea){null==g&&(g=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),g.div.getElementsByTagName("div")[0].style.position="",g.div.style.maxHeight="160px",g.div.style.maxWidth="120px",g.div.style.padding="2px",g.div.style.overflow="auto",g.div.style.height="auto",g.div.style.position="fixed",g.div.style.fontFamily=GraphViewer.cssFontFamily,g.div.style.fontSize="11px",g.div.style.backgroundColor="#eee",g.div.style.color="#000",g.div.style.border="1px solid #d0d0d0",g.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(g.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(g.div,85));if(null!=l)l.parentNode.removeChild(l),l=null;else{l=g.div;l.style.position="absolute";mxEvent.addListener(l,"mouseleave",function(){null!=l&&(l.parentNode.removeChild(l),l=null)});-ea=K.getBoundingClientRect();var ca=mxUtils.getDocumentScrollOrigin(document);l.style.left=ca.x+ea.left-1+"px";l.style.top=ca.y+ea.bottom-2+"px";document.body.appendChild(l);g.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");M.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){K.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=l&&0==this.graph.getAllTags().length&&(l.parentNode.removeChild(l),l=null)}));K.style.display=0<this.graph.getAllTags().length?"inline-flex":-"none"}}else"lightbox"==D?this.lightboxEnabled&&Q(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ea){alert(ea.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(D=this.graphConfig["toolbar-buttons"][D],null!=D&&(D.elem=Q(null==D.enabled||D.enabled?D.handler:function(){},D.image,D.title,D.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*E);null!=this.graphConfig.title&&(m=-b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(m,this.graphConfig.title),mxUtils.setOpacity(m,70),d.appendChild(m),this.filename=m);this.minToolbarWidth=34*E;var da=b.style.border,-ja=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ea=b.getBoundingClientRect(),ca=mxUtils.getScrollOrigin(document.body);ca="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-ca.x,top:-ca.y};ea={left:ea.left-ca.left,top:ea.top-ca.top,bottom:ea.bottom-ca.top,right:ea.right-ca.left};d.style.left=-ea.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=ea.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=ea.top+1+"px"):d.style.top=ea.top+"px";"1px solid transparent"==da&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var fa=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);null!=l&&(l.parentNode.removeChild(l),l=null);null!=c&&(c.parentNode.removeChild(c),c=null);-b.style.border=da});mxEvent.addListener(document,"mousemove",function(la){for(la=mxEvent.getSource(la);null!=la;){if(la==b||la==d||la==c||la==l)return;la=la.parentNode}fa()});mxEvent.addListener(document.body,"mouseleave",function(la){fa()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ja):ja();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=d.parentNode&&ja()})).observe(b)};+ea=V.getBoundingClientRect();var da=mxUtils.getDocumentScrollOrigin(document);l.style.left=da.x+ea.left-1+"px";l.style.top=da.y+ea.bottom-2+"px";document.body.appendChild(l);g.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");L.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=l&&0==this.graph.getAllTags().length&&(l.parentNode.removeChild(l),l=null)}));V.style.display=0<this.graph.getAllTags().length?"inline-flex":+"none"}}else"lightbox"==D?this.lightboxEnabled&&P(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ea){alert(ea.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(D=this.graphConfig["toolbar-buttons"][D],null!=D&&(D.elem=P(null==D.enabled||D.enabled?D.handler:function(){},D.image,D.title,D.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*E);null!=this.graphConfig.title&&(m=+b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(m,this.graphConfig.title),mxUtils.setOpacity(m,70),d.appendChild(m),this.filename=m);this.minToolbarWidth=34*E;var Q=b.style.border,+ja=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ea=b.getBoundingClientRect(),da=mxUtils.getScrollOrigin(document.body);da="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-da.x,top:-da.y};ea={left:ea.left-da.left,top:ea.top-da.top,bottom:ea.bottom-da.top,right:ea.right-da.left};d.style.left=+ea.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=ea.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=ea.top+1+"px"):d.style.top=ea.top+"px";"1px solid transparent"==Q&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var ia=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);null!=l&&(l.parentNode.removeChild(l),l=null);null!=c&&(c.parentNode.removeChild(c),c=null);+b.style.border=Q});mxEvent.addListener(document,"mousemove",function(la){for(la=mxEvent.getSource(la);null!=la;){if(la==b||la==d||la==c||la==l)return;la=la.parentNode}ia()});mxEvent.addListener(document.body,"mouseleave",function(la){ia()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ja):ja();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=d.parentNode&&ja()})).observe(b)};GraphViewer.prototype.createToolbarButton=function(b,d,m,n){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!=m&&v.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";b.className="geAdaptiveAsset";null==n||n?(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,d){var m=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=m&&(mxUtils.setOpacity(m.elem,30),mxEvent.removeListener(m.elem,"click",m.handler),mxEvent.addListener(m.elem,"mouseenter",function(){m.elem.style.backgroundColor="#eee"}),d&&m.elem.setAttribute("title",d))};@@ -4413,9 +4426,9 @@ GraphViewer.prototype.showLocalLightbox=function(b){var d=document.createElementm.className="geAdaptiveAsset";var n=mxUtils.bind(this,function(){p.setDarkMode(this.isDarkMode())});mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",n);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(g){}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(){};var p=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",n);p.editor.editBlankUrl=this.editBlankUrl;p.refresh=function(){};var C=mxUtils.bind(this,function(g){27==g.keyCode&&p.destroy()}),G=this.initialOverflow,T=p.destroy;p.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",C),document.body.removeChild(d),-document.body.removeChild(m),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,T.apply(this,arguments))};var E=p.editor.graph,Q=E.container;Q.style.overflow="hidden";Q.style.inset="0";this.lightboxChrome&&null==b?(Q.style.border="1px solid #c0c0c0",Q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",C)):(d.style.display="none",m.style.display="none");var M=this;E.getImageFromBundles=function(g){return M.getImageUrl(g)};var c=p.createTemporaryGraph;p.createTemporaryGraph=-function(){var g=c.apply(this,arguments);g.getImageFromBundles=function(l){return M.getImageUrl(l)};return g};this.graphConfig.move&&(E.isMoveCellsEvent=function(g){return!0});mxUtils.setPrefixedStyle(Q.style,"border-radius","4px");Q.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(E,p);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(d,"click",function(){p.destroy()}),Q.style.outline="none",Q.style.zIndex=this.lightboxZIndex,-m.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(Q)):(document.body.appendChild(Q),document.body.appendChild(m)),p.setFileData(this.xml),mxUtils.setPrefixedStyle(Q.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(E,this.graph),p.lightboxFit(),p.chromelessResize()}catch(g){p.handleError(g,+document.body.removeChild(m),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,T.apply(this,arguments))};var E=p.editor.graph,P=E.container;P.style.overflow="hidden";P.style.inset="0";this.lightboxChrome&&null==b?(P.style.border="1px solid #c0c0c0",P.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",C)):(d.style.display="none",m.style.display="none");var L=this;E.getImageFromBundles=function(g){return L.getImageUrl(g)};var c=p.createTemporaryGraph;p.createTemporaryGraph=+function(){var g=c.apply(this,arguments);g.getImageFromBundles=function(l){return L.getImageUrl(l)};return g};this.graphConfig.move&&(E.isMoveCellsEvent=function(g){return!0});mxUtils.setPrefixedStyle(P.style,"border-radius","4px");P.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(E,p);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(d,"click",function(){p.destroy()}),P.style.outline="none",P.style.zIndex=this.lightboxZIndex,+m.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(P)):(document.body.appendChild(P),document.body.appendChild(m)),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(E,this.graph),p.lightboxFit(),p.chromelessResize()}catch(g){p.handleError(g,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,d){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",d||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",d||b))};GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(d){try{d.innerText="",GraphViewer.createViewerForElement(d)}catch(m){d.innerText=m.message,null!=window.console&&console.error(m)}})};@@ -4432,7 +4445,7 @@ GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,d,m){if(null!=GraphViewer.cachedUrls[b])d(GraphViewer.cachedUrls[b]);else{var n=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;n.open("GET",b);n.onload=function(){d(null!=n.getText?n.getText():n.responseText)};n.onerror=m;n.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(m){return window.setTimeout(m,20)},d=function(m,n){function v(){this.q=[];this.add=function(t){this.q.push(t)};var g,l;this.call=function(){g=0;for(l=this.q.length;g<l;g++)this.q[g].call()}}function p(g,l){return g.currentStyle?g.currentStyle[l]:window.getComputedStyle?window.getComputedStyle(g,null).getPropertyValue(l):g.style[l]}function C(g,l){if(!g.resizedAttached)g.resizedAttached=new v,g.resizedAttached.add(l);else if(g.resizedAttached){g.resizedAttached.add(l);return}g.resizeSensor=document.createElement("div");g.resizeSensor.className="resize-sensor";g.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";g.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>';-g.appendChild(g.resizeSensor);"static"==p(g,"position")&&(g.style.position="relative");var t=g.resizeSensor.childNodes[0],B=t.childNodes[0],D=g.resizeSensor.childNodes[1],I=function(){B.style.width="100000px";B.style.height="100000px";t.scrollLeft=1E5;t.scrollTop=1E5;D.scrollLeft=1E5;D.scrollTop=1E5};I();var L=!1,N=function(){g.resizedAttached&&(L&&(g.resizedAttached.call(),L=!1),b(N))};b(N);var K,da,ja,ea;l=function(){if((ja=g.offsetWidth)!=K||(ea=g.offsetHeight)!=da)L=!0,K=ja,da=ea;I()};var ca=-function(fa,la,ka){fa.attachEvent?fa.attachEvent("on"+la,ka):fa.addEventListener(la,ka)};ca(t,"scroll",l);ca(D,"scroll",l)}var G=function(){GraphViewer.resizeSensorEnabled&&n()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var T=null,E=!1;(new ResizeObserver(function(){E||(null!=T&&window.clearTimeout(T),T=window.setTimeout(function(){E=!0;G();T=null;E=!1},200))})).observe(m)}else{var Q=Object.prototype.toString.call(m),M="[object Array]"===Q||"[object NodeList]"===Q||"[object HTMLCollection]"===-Q||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(M){Q=0;for(var c=m.length;Q<c;Q++)C(m[Q],G)}else C(m,G);this.detach=function(){if(M)for(var g=0,l=m.length;g<l;g++)d.detach(m[g]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();+g.appendChild(g.resizeSensor);"static"==p(g,"position")&&(g.style.position="relative");var t=g.resizeSensor.childNodes[0],B=t.childNodes[0],D=g.resizeSensor.childNodes[1],I=function(){B.style.width="100000px";B.style.height="100000px";t.scrollLeft=1E5;t.scrollTop=1E5;D.scrollLeft=1E5;D.scrollTop=1E5};I();var K=!1,M=function(){g.resizedAttached&&(K&&(g.resizedAttached.call(),K=!1),b(M))};b(M);var V,Q,ja,ea;l=function(){if((ja=g.offsetWidth)!=V||(ea=g.offsetHeight)!=Q)K=!0,V=ja,Q=ea;I()};var da=function(ia,+la,ka){ia.attachEvent?ia.attachEvent("on"+la,ka):ia.addEventListener(la,ka)};da(t,"scroll",l);da(D,"scroll",l)}var G=function(){GraphViewer.resizeSensorEnabled&&n()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var T=null,E=!1;(new ResizeObserver(function(){E||(null!=T&&window.clearTimeout(T),T=window.setTimeout(function(){E=!0;G();T=null;E=!1},200))})).observe(m)}else{var P=Object.prototype.toString.call(m),L="[object Array]"===P||"[object NodeList]"===P||"[object HTMLCollection]"===+P||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(L){P=0;for(var c=m.length;P<c;P++)C(m[P],G)}else C(m,G);this.detach=function(){if(L)for(var g=0,l=m.length;g<l;g++)d.detach(m[g]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();(function(){Editor.initMath();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();diff --git a/src/main/webapp/mxgraph/mxClient.js b/src/main/webapp/mxgraph/mxClient.jsindex f3afd3485..9feda0a17 100644--- a/src/main/webapp/mxgraph/mxClient.js+++ b/src/main/webapp/mxgraph/mxClient.js@@ -1,4 +1,4 @@-var mxClient={VERSION:"29.6.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/"),+var mxClient={VERSION:"29.6.5",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||@@ -138,7 +138,7 @@ a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;f[],e=0,f=0;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)||null==g.pointerId||d.push(g)}),mxUtils.bind(this,function(g){if(!mxEvent.isMouseEvent(g)&&2==d.length){for(var k=0;k<d.length;k++)if(g.pointerId==d[k].pointerId){d[k]=g;break}g=Math.abs(d[0].clientX-d[1].clientX);k=Math.abs(d[0].clientY-d[1].clientY);var l=Math.abs(g-e),m=Math.abs(k-f);if(l>mxEvent.PINCH_THRESHOLD||m>mxEvent.PINCH_THRESHOLD)a(d[0],l>m?g>e:k>f,!0,d[0].clientX+(d[1].clientX-d[0].clientX)/2,d[0].clientY+(d[1].clientY-d[0].clientY)/2),e=g,f=k}}),mxUtils.bind(this,function(g){d=[];f=e=0}))}mxEvent.addListener(b,"wheel",function(g){null==g&&(g=window.event);g.ctrlKey&&g.preventDefault();(.5<Math.abs(g.deltaX)||.5<Math.abs(g.deltaY))&&a(g,0==g.deltaY?0<-g.deltaX:0<-g.deltaY)})}},disableContextMenu:function(a){mxEvent.addListener(a,"contextmenu",function(b){b.preventDefault&&b.preventDefault();return!1})},getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.type&&0==a.type.indexOf("touch")},isPenEvent:function(a){return null!=a.pointerType?"pen"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_PEN:null!=a.type&&0==a.type.indexOf("pen")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&null!=a.touches&&1<a.touches.length},isMouseEvent:function(a){return!mxClient.IS_ANDROID&&-mxClient.IS_LINUX&&mxClient.IS_GC?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||+mxClient.IS_LINUX&&mxClient.IS_GC&&1>=navigator.maxTouchPoints?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){"touchstart"!=a.type&&"touchmove"!=a.type||null==a.touches||null==a.touches[0]?"touchend"==a.type&&null!=a.changedTouches&&null!=a.changedTouches[0]&&(a=a.changedTouches[0]):a=a.touches[0];return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},preventDefault:function(a){mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(b){b.preventDefault()}))},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CONNECT_HANDLE:-3,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1E5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",DOCK:"dock",UNDOCK:"undock",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",@@ -313,8 +313,8 @@ mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var r=this.createElement("text");r.setAttribute("x",this.format(a));r.setAttribute("y",this.format(b));r.setAttribute("w",this.format(c));r.setAttribute("h",this.format(d));r.setAttribute("str",e);null!=f&&r.setAttribute("align",f);null!=g&&r.setAttribute("valign",g);r.setAttribute("wrap",k?"1":"0");null==l&&(l="");r.setAttribute("format",l);null!=m&&r.setAttribute("overflow",m);null!=n&&r.setAttribute("clip",n?"1":"0");null!=p&&r.setAttribute("rotation",p);null!=q&&r.setAttribute("dir",q);this.root.appendChild(r)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};-function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):b.appendChild(this.defs)),-this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);+function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=this.viewTranslate=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):+b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.cacheOffsetSize=!0;mxSvgCanvas2D.prototype.allowConvertHtmlToSvg=!1;mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&a.setAttribute("style",b)};mxSvgCanvas2D.prototype.getLightDarkColor=function(a){return mxUtils.getLightDarkColor(a,null,null,"simple"==this.adaptiveColors)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};@@ -329,25 +329,25 @@ mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkCok.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement(e==mxConstants.DIRECTION_RADIAL?"radialGradient":"linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%");e=this.createElement("stop");e.setAttribute("offset","0%");e.setAttribute("stop-color",a.light);e.style.stopColor=a.cssText;e.setAttribute("stop-opacity",c);e.style.stopOpacity=c;f.appendChild(e);e=this.createElement("stop");e.setAttribute("offset","100%");e.setAttribute("stop-color",b.light);e.style.stopColor=b.cssText;e.setAttribute("stop-opacity",d);e.style.stopOpacity=d;f.appendChild(e);return f};-mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c){return("mx-pattern-"+a+"-"+b+"-"+c).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};-mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=-this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}return f.getAttribute("id")};-mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;-e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a=.5*a*c;c=this.format(1.5*(10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=-b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};-mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format((10+a)*c);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};+mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c,d){return("mx-pattern-"+a+"-"+b+"-"+c+"-"+Math.round(100*d)).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};+mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText,d),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=+this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}c=this.viewTranslate;b=null!=c?this.format(c.x*d):0;c=null!=c?this.format(c.y*d):0;f.setAttribute("patternTransform","translate("+b+","+c+")"+("dots"!==a?" rotate(45)":"")+" scale("+d+")");return f.getAttribute("id")};+mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);+return d};+mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a*=1.5;c=this.format(10+a);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");+d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a*=.5;c=this.format(1.5*(10+a));var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);+e.setAttribute("fill","none");d.appendChild(e);return d};+mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format(10+a);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};mxSvgCanvas2D.prototype.addTitle=function(a){if(null!=a&&null!=this.title){var b=this.createElement("title");mxUtils.write(b,this.title);a.appendChild(b)}return a};mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,this.getCurrentStrokeWidth(),c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill",-"url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",+"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -427,7 +427,7 @@ mxShape.prototype.getShadowStyle=function(){var a={dx:mxConstants.SHADOW_OFFSET_a.color),a.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OPACITY,a.opacity));return a};mxShape.prototype.createDropShadow=function(a,b){var c=mxUtils.getLightDarkColor(a.color,a.opacity/100);return"drop-shadow("+Math.round(a.dx*b*100)/100+"px "+Math.round(a.dy*b*100)/100+"px "+Math.round(a.blur*b*100)/100+"px "+c.cssText+")"};mxShape.prototype.updateSvgFilters=function(a){this.node.style.filter=this.isShadowEnabled()?this.createDropShadow(this.getShadowStyle(),a):""};mxShape.prototype.isShadowEnabled=function(){return this.isShadow};mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.beforePaint(a),this.paint(a),this.afterPaint(a),this.destroyCanvas(a))};mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement&&(a=this.createSvgCanvas());null!=a&&this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){},a.image=function(){},a.text=function(){});return a};-mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};+mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;a.viewTranslate=this.viewTranslate;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity="+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var c=this.fill,d=this.gradient,e="0",f={east:0,south:1,west:2,north:3},g=null!=this.direction?f[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+f[this.gradientDirection]-1,4));1==g?(e="1",f=c,c=d,d=f):2==g?(f=c,c=d,d=f):3==g&&(e="1");b+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+c+"', endColorStr='"+d+"', gradientType='"+e+"')"}a.style.filter=b};@@ -449,10 +449,10 @@ mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=nu1,b.length)];l<b.length-2&&0==Math.round(m.x-g.x)&&0==Math.round(m.y-g.y);)m=b[mxUtils.mod(l+2,b.length)],l++;n=m.x-g.x;m=m.y-g.y;p=Math.max(1,Math.sqrt(n*n+m*m));n=g.x+n*Math.min(d,p/2)/p;m=g.y+m*Math.min(d,p/2)/p;a.quadTo(g.x,g.y,n,m);g=new mxPoint(n,m)}else a.lineTo(g.x,g.y);m=g;l++}e?a.close():a.lineTo(k.x,k.y)}};mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,-this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,this.fillStyle);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,-mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,-mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=-1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};+this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,null);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,+this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,+0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=1==mxUtils.getValue(this.style,+mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return!1};mxShape.prototype.getSvgBoundingBox=function(){var a=null;if(null!=this.node&&null!=this.node.ownerSVGElement)try{var b=this.node.getBBox();0<b.width&&0<b.height&&(a=new mxRectangle(b.x,b.y,b.width,b.height),null!=this.stroke&&a.grow(this.strokewidth*this.scale/2))}catch(c){}return a};mxShape.prototype.getShapeBoundingBox=function(){var a=null;if(null!=this.bounds&&(a=this.createBoundingBox(),null!=a)){this.augmentBoundingBox(a);var b=this.getShapeRotation();0!=b&&(a=mxUtils.getBoundingBox(a,b))}return a};mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a};mxShape.prototype.augmentBoundingBox=function(a){if(this.isShadow){var b=this.getShadowStyle();0>b.dx&&(a.x+=b.dx,a.width-=b.dx);0>b.dy&&(a.y+=b.dy,a.height-=b.dy);a.grow(Math.max(b.blur,0)*this.scale*2);a.width+=Math.ceil(Math.max(b.dx,0)*this.scale);a.height+=Math.ceil(Math.max(b.dy,0)*this.scale)}null!=this.stroke&&a.grow(this.strokewidth*this.scale/2)};@@ -1002,7 +1002,7 @@ mxCellRenderer.prototype.rotateLabelBounds=function(a,b,c,d,e){var f=null!=d?d:cvar g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(f==mxConstants.ALIGN_CENTER&&null==k?c.spacingLeft*d+c.spacingRight*d:0));b.height=Math.max(0,b.height-(g==mxConstants.ALIGN_MIDDLE?c.spacingTop*d+c.spacingBottom*d:0))}e=e?0:c.getTextRotation();0!=e&&null!=a&&a.view.graph.model.isVertex(a.cell)&&(c=a.getCenterX(),a=a.getCenterY(),b.x!=c||b.y!=a)&&(e*=Math.PI/180,a=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(e),Math.sin(e),new mxPoint(c,a)),b.x=a.x,b.y=a.y)};mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(g,k){g=k.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var l=g.getCenterX(),m=g.getCenterY();m=mxUtils.getRotatedPoint(new mxPoint(l,m),e,f,new mxPoint(a.getCenterX(),a.getCenterY()));l=m.x;m=m.y;g.x=Math.round(l--g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.redraw()})}};+g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.viewTranslate=a.view.translate,k.redraw()})}};mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+b*d,f=a.y+c*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var k=(a.width-a.height)/2;e+=k;f-=k}0!=g&&(k=mxUtils.toRadians(g),g=Math.cos(k),k=Math.sin(k),f=mxUtils.getRotatedPoint(new mxPoint(e,f),g,k,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};@@ -1011,8 +1011,8 @@ a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSiblinmxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))};mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a),this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a),-null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};-mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};+null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,a.shape.viewTranslate=a.view.translate,(null==c||c)&&this.doRedrawShape(a),e=!0);+return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));diff --git a/src/main/webapp/mxgraph/src/shape/mxShape.js b/src/main/webapp/mxgraph/src/shape/mxShape.jsindex a081e6862..14e08ecb1 100644--- a/src/main/webapp/mxgraph/src/shape/mxShape.js+++ b/src/main/webapp/mxgraph/src/shape/mxShape.js@@ -639,6 +639,7 @@ mxShape.prototype.createSvgCanvas = function()var canvas = new mxSvgCanvas2D(this.node, false);canvas.strokeTolerance = this.svgStrokeTolerance;canvas.pointerEventsValue = this.svgPointerEvents;+ canvas.viewTranslate = this.viewTranslate;var off = this.getSvgScreenOffset();if (off != 0)@@ -1392,7 +1393,7 @@ mxShape.prototype.apply = function(state)this.gradientDirection = mxUtils.getValue(this.style, mxConstants.STYLE_GRADIENT_DIRECTION, this.gradientDirection);this.opacity = mxUtils.getValue(this.style, mxConstants.STYLE_OPACITY, this.opacity);this.fillOpacity = mxUtils.getValue(this.style, mxConstants.STYLE_FILL_OPACITY, this.fillOpacity);- this.fillStyle = mxUtils.getValue(this.style, mxConstants.STYLE_FILL_STYLE, this.fillStyle);+ this.fillStyle = mxUtils.getValue(this.style, mxConstants.STYLE_FILL_STYLE, null);this.strokeOpacity = mxUtils.getValue(this.style, mxConstants.STYLE_STROKE_OPACITY, this.strokeOpacity);this.stroke = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, this.stroke);this.strokewidth = mxUtils.getNumber(this.style, mxConstants.STYLE_STROKEWIDTH, this.strokewidth);diff --git a/src/main/webapp/mxgraph/src/util/mxEvent.js b/src/main/webapp/mxgraph/src/util/mxEvent.jsindex 2f8533570..476ba247c 100644--- a/src/main/webapp/mxgraph/src/util/mxEvent.js+++ b/src/main/webapp/mxgraph/src/util/mxEvent.js@@ -551,7 +551,9 @@ var mxEvent =isMouseEvent: function(evt){// Workaround for mixed event types during one gesture in Chrome on Linux- if (!mxClient.IS_ANDROID && mxClient.IS_LINUX && mxClient.IS_GC)+ // but not on touch-capable devices (eg Android tablets in desktop UA mode)+ if (!mxClient.IS_ANDROID && mxClient.IS_LINUX && mxClient.IS_GC &&+ navigator.maxTouchPoints <= 1){return true;}diff --git a/src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.js b/src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.jsindex 2a9bdd6e3..da7099607 100644--- a/src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.js+++ b/src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.js@@ -86,9 +86,17 @@ function mxSvgCanvas2D(root, styleEnabled)*/this.fillPatterns = [];+ /**+ * Variable: viewTranslate+ *+ * Optional view translate used to anchor fill patterns to diagram+ * coordinates. Set from the shape's view translate.+ */+ this.viewTranslate = null;+/*** Variable: defs- *+ ** Reference to the defs section of the SVG document. Only for export.*/this.defs = null;@@ -660,10 +668,10 @@ mxSvgCanvas2D.prototype.createSvgGradient = function(start, end, alpha1, alpha2,** Private helper function to create fillPattern Id*/-mxSvgCanvas2D.prototype.createFillPatternId = function(type, strokeSize, color)+mxSvgCanvas2D.prototype.createFillPatternId = function(type, strokeSize, color, scale){// Removes illegal characters from gradient ID- return ('mx-pattern-' + type + '-' + strokeSize + '-' + color).+ return ('mx-pattern-' + type + '-' + strokeSize + '-' + color + '-' + Math.round(scale * 100)).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi, '_');};@@ -675,9 +683,9 @@ mxSvgCanvas2D.prototype.createFillPatternId = function(type, strokeSize, color)mxSvgCanvas2D.prototype.getFillPattern = function(type, strokeSize, color, scale){color = this.getLightDarkColor(color);- var id = this.createFillPatternId(type, strokeSize, color.cssText);+ var id = this.createFillPatternId(type, strokeSize, color.cssText, scale);var fillPattern = this.fillPatterns[id];-+if (fillPattern == null){var svg = this.root.ownerSVGElement;@@ -688,7 +696,7 @@ mxSvgCanvas2D.prototype.getFillPattern = function(type, strokeSize, color, scaleif (svg != null){fillPattern = svg.ownerDocument.getElementById(tmpId);-+while (fillPattern != null && fillPattern.ownerSVGElement != svg){tmpId = id + '-' + counter++;@@ -700,7 +708,7 @@ mxSvgCanvas2D.prototype.getFillPattern = function(type, strokeSize, color, scale// Uses shorter IDs for exporttmpId = 'id' + (++this.refCount);}-+if (fillPattern == null){switch(type)@@ -724,9 +732,9 @@ mxSvgCanvas2D.prototype.getFillPattern = function(type, strokeSize, color, scaledefault:return null;}-+fillPattern.setAttribute('id', tmpId);-+if (this.defs != null){this.defs.appendChild(fillPattern);@@ -740,22 +748,35 @@ mxSvgCanvas2D.prototype.getFillPattern = function(type, strokeSize, color, scalethis.fillPatterns[id] = fillPattern;}+ // Updates patternTransform to anchor pattern to diagram coordinates.+ // The view translate is baked into shape SVG positions. By including+ // it in the pattern transform, the pattern phase depends only on the+ // shape's diagram position, not the view translate or zoom level.+ var vt = this.viewTranslate;+ var tx = (vt != null) ? this.format(vt.x * scale) : 0;+ var ty = (vt != null) ? this.format(vt.y * scale) : 0;+ var hasRotate = (type !== 'dots');++ fillPattern.setAttribute('patternTransform',+ 'translate(' + tx + ',' + ty + ')' ++ (hasRotate ? ' rotate(45)' : '') ++ ' scale(' + scale + ')');+return fillPattern.getAttribute('id');};mxSvgCanvas2D.prototype.createHatchPattern = function(strokeSize, color, scale){- var sw = strokeSize * 1.5 * scale;- var size = this.format((10 + sw) * scale);+ var baseSW = strokeSize * 1.5;+ var size = this.format(10 + baseSW);var fillPattern = this.createElement('pattern');fillPattern.setAttribute('patternUnits', 'userSpaceOnUse');fillPattern.setAttribute('width', size);fillPattern.setAttribute('height', size);fillPattern.setAttribute('x', '0');- fillPattern.setAttribute('y', '0');- fillPattern.setAttribute('patternTransform', 'rotate(45)');-+ fillPattern.setAttribute('y', '0');+var line = this.createElement('line');line.setAttribute('x1', '0');line.setAttribute('y1', '0');@@ -763,7 +784,7 @@ mxSvgCanvas2D.prototype.createHatchPattern = function(strokeSize, color, scale)line.setAttribute('y2', size);line.setAttribute('stroke', color.light); // TODO Is Gradient Color possible?line.style.stroke = color.cssText;- line.setAttribute('stroke-width', sw);+ line.setAttribute('stroke-width', baseSW);fillPattern.appendChild(line);return fillPattern;@@ -771,17 +792,16 @@ mxSvgCanvas2D.prototype.createHatchPattern = function(strokeSize, color, scale)mxSvgCanvas2D.prototype.createDashedPattern = function(strokeSize, color, scale){- var sw = strokeSize * 1.5 * scale;- var size = this.format((10 + sw) * scale);+ var baseSW = strokeSize * 1.5;+ var size = this.format(10 + baseSW);var fillPattern = this.createElement('pattern');fillPattern.setAttribute('patternUnits', 'userSpaceOnUse');fillPattern.setAttribute('width', size);fillPattern.setAttribute('height', size);fillPattern.setAttribute('x', '0');- fillPattern.setAttribute('y', '0');- fillPattern.setAttribute('patternTransform', 'rotate(45)');-+ fillPattern.setAttribute('y', '0');+var line = this.createElement('line');line.setAttribute('x1', '0');line.setAttribute('y1', size / 4);@@ -789,31 +809,30 @@ mxSvgCanvas2D.prototype.createDashedPattern = function(strokeSize, color, scale)line.setAttribute('y2', 3 * size / 4);line.setAttribute('stroke', color.light); // TODO Is Gradient Color possible?line.style.stroke = color.cssText;- line.setAttribute('stroke-width', sw);-+ line.setAttribute('stroke-width', baseSW);+fillPattern.appendChild(line);return fillPattern;};mxSvgCanvas2D.prototype.createZigZagLinePattern = function(strokeSize, color, scale){- var sw = strokeSize * 1.5 * scale;- var size = this.format((10 + sw) * scale);+ var baseSW = strokeSize * 1.5;+ var size = this.format(10 + baseSW);var fillPattern = this.createElement('pattern');fillPattern.setAttribute('patternUnits', 'userSpaceOnUse');fillPattern.setAttribute('width', size);fillPattern.setAttribute('height', size);fillPattern.setAttribute('x', '0');- fillPattern.setAttribute('y', '0');- fillPattern.setAttribute('patternTransform', 'rotate(45)');-+ fillPattern.setAttribute('y', '0');+var path = this.createElement('path');var s1_4 = size / 4, s3_4 = 3 * size / 4;path.setAttribute('d', 'M ' + s1_4 + ' 0 L ' + s3_4 + ' 0 L ' + s1_4 + ' ' + size + ' L ' + s3_4 + ' ' + size);path.setAttribute('stroke', color.light); // TODO Is Gradient Color possible?path.style.stroke = color.cssText;- path.setAttribute('stroke-width', sw);+ path.setAttribute('stroke-width', baseSW);path.setAttribute('fill', 'none');fillPattern.appendChild(path);@@ -822,17 +841,16 @@ mxSvgCanvas2D.prototype.createZigZagLinePattern = function(strokeSize, color, scmxSvgCanvas2D.prototype.createCrossHatchPattern = function(strokeSize, color, scale){- var sw = strokeSize * 0.5 * scale;- var size = this.format(1.5 * (10 + sw) * scale);+ var baseSW = strokeSize * 0.5;+ var size = this.format(1.5 * (10 + baseSW));var fillPattern = this.createElement('pattern');fillPattern.setAttribute('patternUnits', 'userSpaceOnUse');fillPattern.setAttribute('width', size);fillPattern.setAttribute('height', size);fillPattern.setAttribute('x', '0');- fillPattern.setAttribute('y', '0');- fillPattern.setAttribute('patternTransform', 'rotate(45)');-+ fillPattern.setAttribute('y', '0');+var rect = this.createElement('rect');rect.setAttribute('x', 0);rect.setAttribute('y', 0);@@ -840,24 +858,24 @@ mxSvgCanvas2D.prototype.createCrossHatchPattern = function(strokeSize, color, screct.setAttribute('height', size);rect.setAttribute('stroke', color.light); // TODO Is Gradient Color possible?rect.style.stroke = color.cssText;- rect.setAttribute('stroke-width', sw);+ rect.setAttribute('stroke-width', baseSW);rect.setAttribute('fill', 'none');-+fillPattern.appendChild(rect);return fillPattern;};mxSvgCanvas2D.prototype.createDotsPattern = function(strokeSize, color, scale){- var size = this.format((10 + strokeSize) * scale);+ var size = this.format(10 + strokeSize);var fillPattern = this.createElement('pattern');fillPattern.setAttribute('patternUnits', 'userSpaceOnUse');fillPattern.setAttribute('width', size);fillPattern.setAttribute('height', size);fillPattern.setAttribute('x', '0');- fillPattern.setAttribute('y', '0');-+ fillPattern.setAttribute('y', '0');+var circle = this.createElement('circle');circle.setAttribute('cx', size / 2);circle.setAttribute('cy', size / 2);@@ -865,7 +883,7 @@ mxSvgCanvas2D.prototype.createDotsPattern = function(strokeSize, color, scale)circle.setAttribute('stroke', 'none');circle.setAttribute('fill', color.light); // TODO Is Gradient Color possible?circle.style.fill = color.cssText;-+fillPattern.appendChild(circle);return fillPattern;};@@ -1069,8 +1087,10 @@ mxSvgCanvas2D.prototype.updateFill = function()}}+ var baseStrokeWidth = Math.max(this.minStrokeWidth, Math.max(0.01,+ this.format(s.strokeWidth)));var pId = (s.fillStyle == null || s.fillStyle == 'auto' || s.fillStyle == 'solid') ? null :- this.getFillPattern(s.fillStyle, this.getCurrentStrokeWidth(), fill, s.scale);+ this.getFillPattern(s.fillStyle, baseStrokeWidth, fill, s.scale);if (isGradient || pId == null){diff --git a/src/main/webapp/mxgraph/src/view/mxCellRenderer.js b/src/main/webapp/mxgraph/src/view/mxCellRenderer.jsindex cb5d4edc0..c74934278 100644--- a/src/main/webapp/mxgraph/src/view/mxCellRenderer.js+++ b/src/main/webapp/mxgraph/src/view/mxCellRenderer.js@@ -1311,6 +1311,7 @@ mxCellRenderer.prototype.redrawCellOverlays = function(state, forced){shape.bounds = bounds;shape.scale = state.view.scale;+ shape.viewTranslate = state.view.translate;shape.redraw();}});@@ -1629,7 +1630,8 @@ mxCellRenderer.prototype.redrawShape = function(state, force, rendering)}state.shape.scale = state.view.scale;-+ state.shape.viewTranslate = state.view.translate;+if (rendering == null || rendering){this.doRedrawShape(state);diff --git a/src/main/webapp/service-worker.js b/src/main/webapp/service-worker.jsindex b62a8169c..2d49ed574 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 s=(s,r)=>(s=new URL(s+".js",r).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(r,c)=>{const a=e||("document"in self?document.currentScript.src:"")||location.href;if(i[a])return;let o={};const n=e=>s(e,a),d={module:{uri:a},exports:o,require:n};i[a]=Promise.all(r.map((e=>d[e]||n(e)))).then((e=>(c(...e),o)))}}define(["./workbox-acfd85e3"],(function(e){"use strict";self.skipWaiting(),e.precacheAndRoute([{url:"js/bootstrap.js",revision:"b6f2274dfc992e6b0cb52bd8489da5e2"},{url:"js/main.js",revision:"a8d40469d3d72ab4b11059362f3dd825"},{url:"js/app.min.js",revision:"dd07712ed2a1ba7f267b916f2c6c45c2"},{url:"js/extensions.min.js",revision:"24f2febd713bcd9894fa54821eb025f7"},{url:"js/orgchart.min.js",revision:"619d8c4dab47b81868916df31f55478b"},{url:"js/stencils.min.js",revision:"54eda90e3b255ee094aa7b78cabc117c"},{url:"js/shapes-14-6-5.min.js",revision:"8fb1150deb6262b5582987cb2965979c"},{url:"js/math-print.js",revision:"ad9cf0f2f2b614eac58ea72499c1017f"},{url:"index.html",revision:"9de11c65ec13b24c73ace7042bc529cc"},{url:"open.html",revision:"d71816b3b00e769fc6019fcdd6921662"},{url:"shortcuts.svg",revision:"2381dd779ce6cfee954042a7f784c7e6"},{url:"styles/fonts/ArchitectsDaughter-Regular.ttf",revision:"31c2153c0530e32553b31a49b3d70736"},{url:"styles/grapheditor.css",revision:"f1684d975b4fb0a6885b1e4b12dc79ff"},{url:"styles/high-contrast.css",revision:"0c0219b1016c8bd6bbf859cfd53b5058"},{url:"js/dropbox/Dropbox-sdk.min.js",revision:"4b9842892aa37b156db0a8364b7a83b0"},{url:"js/onedrive/OneDrive.js",revision:"e863f5e6833892f22492211663e3efe9"},{url:"js/viewer-static.min.js",revision:"803bb1ab6f6969c05156b88efd2f7544"},{url:"connect/jira/editor-1-3-3.html",revision:"41dc8af9576b47f359cff19fff7a41c2"},{url:"connect/jira/viewerPanel-1-3-12.html",revision:"4836f5e4308abe57830e441518364f23"},{url:"connect/jira/viewerPanel2.html",revision:"0dd1ee1343a46b5c03aedbc587450b84"},{url:"connect/jira/fullScreenViewer-1-3-3.html",revision:"abed474e47c0c41a5ad2366b4828f77a"},{url:"connect/jira/viewerPanel.js",revision:"85011efa68d638da560871ee2ab3a6fe"},{url:"connect/jira/spinner.gif",revision:"7d857ab9d86123e93d74d48e958fe743"},{url:"connect/jira/editor.js",revision:"3dc56c6566abaa7af151a8359e5bb556"},{url:"connect/jira/fullscreen-viewer-init.js",revision:"07043c1ee868dd425f7876da94bbc307"},{url:"connect/jira/fullscreen-viewer.js",revision:"a6be96b8ddc5a25196925713cf34d571"},{url:"plugins/connectJira.js",revision:"d220cad2edf0d6b161505fe12ae3eaa6"},{url:"plugins/cConf-comments.js",revision:"e4a4b5a0fb22393693d3b62968c50644"},{url:"plugins/cConf-1-4-8.js",revision:"47a7156bfb0f2b9e69ff783013aeebf5"},{url:"connect/confluence/connectUtils-1-4-8.js",revision:"ec3bc85db1e4451f87e63e23a0c36611"},{url:"connect/new_common/cac.js",revision:"b52c73de9d22b867a036ad50c6bfdca2"},{url:"connect/gdrive_common/gac.js",revision:"c66fdc50ec87002a502cb0779b73a692"},{url:"connect/onedrive_common/ac.js",revision:"1264ba8705eff0d1337701e5ae962366"},{url:"connect/confluence/viewer-init.js",revision:"c5e51e32ac74414d8d518af83ee2781f"},{url:"connect/confluence/viewer.js",revision:"c12112f0ec92dee98073eaffd4c9bea9"},{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:"489bc44e46d6481277c3f2a5d81a2db6"},{url:"connect/confluence/includeDiagram.html",revision:"01b04b3f54f1e2e63fcf1df033d24519"},{url:"connect/confluence/macro-editor.js",revision:"b9000d6c20f30e4068f83bd0b56965ca"},{url:"math4/es5/ui/safe.js",revision:"4c481ca61f35d7b962bae3291b284df1"},{url:"math4/es5/core.js",revision:"7dc7147f9dd09489d9ce0bf754dc0120"},{url:"math4/es5/input/tex/extensions/bbm.js",revision:"03afe2dfbb002b0343e5233dcef24dc2"},{url:"math4/es5/input/tex/extensions/html.js",revision:"c29b1ead29f466db275be422ff612116"},{url:"math4/es5/input/tex/extensions/extpfeil.js",revision:"e8764945ab1fa8d4a8b79124815a5d96"},{url:"math4/es5/input/tex/extensions/action.js",revision:"d2416fc880e154c8cf6a57458cf33131"},{url:"math4/es5/input/tex/extensions/boldsymbol.js",revision:"a3116882e895c077a03d411741dca9d4"},{url:"math4/es5/input/tex/extensions/cases.js",revision:"b9c85b94f49512d54b0aa0e9be082dae"},{url:"math4/es5/input/tex/extensions/colortbl.js",revision:"2399ede386031b0385799df60c43c0d9"},{url:"math4/es5/input/tex/extensions/verb.js",revision:"928837fa27cbb3d364cc08cf1b756f59"},{url:"math4/es5/input/tex/extensions/unicode.js",revision:"bfc7dce797e851dfc54c850102bc81a3"},{url:"math4/es5/input/tex/extensions/cancel.js",revision:"d101be74f309165af176cb2fddcdc878"},{url:"math4/es5/input/tex/extensions/enclose.js",revision:"049c74f77f9ef2c3df3b1e69d66188f8"},{url:"math4/es5/input/tex/extensions/units.js",revision:"c61f22fa8ae966afe4fae2963b92bd2f"},{url:"math4/es5/input/tex/extensions/color.js",revision:"7765044cf33d7d3268c05b904d14fe41"},{url:"math4/es5/input/tex/extensions/mathtools.js",revision:"e996a34e23021c401b08107be6336b8b"},{url:"math4/es5/input/tex/extensions/begingroup.js",revision:"f6ee462375696dbb388cf28c56799c7f"},{url:"math4/es5/input/tex/extensions/braket.js",revision:"b16d2e8ae04742e9e28ab5b67834dd00"},{url:"math4/es5/input/tex/extensions/dsfont.js",revision:"3c9ec642a438d8ee512a7161ba648c9b"},{url:"math4/es5/input/tex/extensions/bbox.js",revision:"725a176e0848a43b7bc12fbef0405777"},{url:"math4/es5/input/tex/extensions/amscd.js",revision:"69c6579db543071516806a310818f836"},{url:"math4/es5/input/tex/extensions/textcomp.js",revision:"45763058bcba03250085c8f3edbba6b6"},{url:"math4/es5/input/tex/extensions/bussproofs.js",revision:"09cd9743e847f27eed667bf2a14c8f3f"},{url:"math4/es5/input/tex/extensions/bboldx.js",revision:"e927b36562d102c9381d1cf6019fc435"},{url:"math4/es5/input/tex/extensions/physics.js",revision:"6064897fff5db81d2d1d1c7c535c488f"},{url:"math4/es5/input/tex/extensions/centernot.js",revision:"12250d76cb9bca8fb7b0bd6c85a53d91"},{url:"math4/es5/input/tex/extensions/gensymb.js",revision:"2ea2fb74d7579cc0f64ec31bc9864b53"},{url:"math4/es5/input/tex/extensions/upgreek.js",revision:"d54eaab30ce82de4a414a67acbf81ffc"},{url:"math4/es5/input/tex/extensions/empheq.js",revision:"20a7efd2d2a2275dfa503bc25a365009"},{url:"math4/es5/input/tex/extensions/mhchem.js",revision:"bf94223fe83d22db894f3268acec4775"},{url:"math4/es5/input/asciimath.js",revision:"fca254c01e6a0deb9ecee1d550a17f71"},{url:"math4/es5/input/tex.js",revision:"8c3fe52f6f9e5b045a8ab62ecebd5b68"},{url:"math4/es5/startup.js",revision:"aac42e2a50811d1c26b37c41b4f365ac"},{url:"math4/es5/output/svg.js",revision:"f1603dbbd7c5453cc508fe262215fc9f"},{url:"math4/es5/fonts/mathjax-bbm-font-extension/svg.js",revision:"18e9f748695ae1628367dcd2d39e4c1d"},{url:"math4/es5/fonts/mathjax-tex-font/svg.js",revision:"1ae8c56b2ac35edc2d14811b551ea366"},{url:"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js",revision:"bc969488528ff218a0c3fbf8da18eca0"},{url:"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js",revision:"acc46c899a237b54112f3c4bab91a0ba"},{url:"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js",revision:"206aed069c09009146e9234e7e37439e"},{url:"resources/dia.txt",revision:"43f87db684d48de27a299313992ce80c"},{url:"resources/dia_am.txt",revision:"7ec446deed8a8f878879faec5e833bc6"},{url:"resources/dia_ar.txt",revision:"4c9db97cc9a70cd7bf1af7499f72606e"},{url:"resources/dia_bg.txt",revision:"030038449d6470adcc14f735205aac0d"},{url:"resources/dia_bn.txt",revision:"9450e97df8ddbd526e9f4c3cadbdf4cd"},{url:"resources/dia_bs.txt",revision:"2c67b818cf9e9d5e16716c883393d526"},{url:"resources/dia_ca.txt",revision:"28ecfd650cacc89853a64e9a4b326d31"},{url:"resources/dia_cs.txt",revision:"26e1fbf9c718944eb67edc23d4bd65f4"},{url:"resources/dia_da.txt",revision:"6b3bfd0dea97f1ed8420d11f926f8e28"},{url:"resources/dia_de.txt",revision:"083406f8f5602e28df1c9161d585da45"},{url:"resources/dia_el.txt",revision:"08cce9ec2deaf651e05a21bf9feb3d8c"},{url:"resources/dia_eo.txt",revision:"9d85a4433b0f4e93a756191311dac516"},{url:"resources/dia_es.txt",revision:"57469d3655163e48df43211d919802b7"},{url:"resources/dia_et.txt",revision:"4a5f5cc511ad8a9904aaa2294270e79d"},{url:"resources/dia_eu.txt",revision:"d9a5f15b91a977a938803885c62cf6e5"},{url:"resources/dia_fa.txt",revision:"c1b9b1c0fe61208b3ac7cf9272267d73"},{url:"resources/dia_fi.txt",revision:"ba6e3982bd16f7eb003cfc06f31e0bb4"},{url:"resources/dia_fil.txt",revision:"57eab91858b553bee1ede9a15c12ed01"},{url:"resources/dia_fr.txt",revision:"af3316cf68d33e8b46b0a12e77378c42"},{url:"resources/dia_gl.txt",revision:"aed71f2314fe1076efab6fde10944f16"},{url:"resources/dia_gu.txt",revision:"0948225bca8fdcc38d948d545bc13204"},{url:"resources/dia_he.txt",revision:"d6d4c0390b454dbccbd245ecfb77c33c"},{url:"resources/dia_hi.txt",revision:"af9425507a839b51a25f344ffd1e7f01"},{url:"resources/dia_hr.txt",revision:"40b21938c5d6bcce9ef348c9b3372433"},{url:"resources/dia_hu.txt",revision:"b6af4c55b93e8c75fa7cba513556ed4d"},{url:"resources/dia_id.txt",revision:"83004abbe9941a2d35c8dcba09510895"},{url:"resources/dia_it.txt",revision:"a3850393751751eff3dddfc3db675b33"},{url:"resources/dia_ja.txt",revision:"ed225d66cbcbab7aa1153588db83e0f3"},{url:"resources/dia_kn.txt",revision:"4203c483b685214f1b183e2d7c5b2cd5"},{url:"resources/dia_ko.txt",revision:"f9716e773e09f27c135f1fcc0d40577d"},{url:"resources/dia_lt.txt",revision:"b3a9ac8e9ec2a82438f73955516a75ef"},{url:"resources/dia_lv.txt",revision:"f130e9b3f2da67b362887496118adf70"},{url:"resources/dia_ml.txt",revision:"44753413a68c1b6bb6412a69c8f6f142"},{url:"resources/dia_mr.txt",revision:"7a59e112c604ba786b2fb2e5f2abfb84"},{url:"resources/dia_ms.txt",revision:"283dbf16b112d570d597f00fff3ff104"},{url:"resources/dia_my.txt",revision:"69d6b65512c1fc770eb84cfe7e200bc7"},{url:"resources/dia_nl.txt",revision:"eaf394a482bf3fdab940410dfb937169"},{url:"resources/dia_no.txt",revision:"0dd64a9fff37003eac7f3992f99f4862"},{url:"resources/dia_pl.txt",revision:"910489a1a8b0af9798c95329edb89da8"},{url:"resources/dia_pt-br.txt",revision:"82c7bb8ac0b95bda0bfb6e00783fc203"},{url:"resources/dia_pt.txt",revision:"6104e00eebb8bfa5ef54b46175d96bed"},{url:"resources/dia_ro.txt",revision:"358658c0650feb4fcd5cc496cc1d54bf"},{url:"resources/dia_ru.txt",revision:"5fa2266723ebd04a86401510aea52a3b"},{url:"resources/dia_si.txt",revision:"34254ff03db287539fedc5fc5a924573"},{url:"resources/dia_sk.txt",revision:"572dae9ca8f0a5fc9dad5376ffd72b8c"},{url:"resources/dia_sl.txt",revision:"c6029597136fe8350d7ca97eacf4d12c"},{url:"resources/dia_sr.txt",revision:"3506b77891c2947305679db866d3eaaf"},{url:"resources/dia_sv.txt",revision:"a6f28c429667755b036734804952e108"},{url:"resources/dia_sw.txt",revision:"dc09ab612290514ed99a8a6d20788afb"},{url:"resources/dia_ta.txt",revision:"dc8b70065155adf8be81720e2ccc128b"},{url:"resources/dia_te.txt",revision:"e7110212f1c82c8917b40b30bbb85fce"},{url:"resources/dia_th.txt",revision:"8ae76f18fab367014629ad9f2ffdd94a"},{url:"resources/dia_tr.txt",revision:"0b51190d7248b5ca5c94f5b040ace1ac"},{url:"resources/dia_uk.txt",revision:"aabef9553c3dd07c6c2edbb4489aff34"},{url:"resources/dia_vi.txt",revision:"6f7b47ffeb8b2f4c6555239299d9314f"},{url:"resources/dia_zh-tw.txt",revision:"ff2921c76af03450e22dc5ff3ed64eb9"},{url:"resources/dia_zh.txt",revision:"3e4386b491a64dc6f1a61c210e9f59b4"},{url:"favicon.ico",revision:"b2bf17349e4b50ce4ba311f079f8bf7d"},{url:"images/manifest.json",revision:"421b4fae5b46499348d194e1f93558c3"},{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/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/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/spin.gif",revision:"487cbb40b9ced439aa1ad914e816d773"},{url:"images/aui-wait.gif",revision:"5a474bcbd8d2f2826f03d10ea44bf60e"},{url:"mxgraph/css/common.css",revision:"8d895dc8387694c128232b13e631be39"}],{ignoreURLParametersMatching:[/.*/]})}));+if(!self.define){let e,i={};const s=(s,r)=>(s=new URL(s+".js",r).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(r,c)=>{const a=e||("document"in self?document.currentScript.src:"")||location.href;if(i[a])return;let o={};const n=e=>s(e,a),d={module:{uri:a},exports:o,require:n};i[a]=Promise.all(r.map((e=>d[e]||n(e)))).then((e=>(c(...e),o)))}}define(["./workbox-acfd85e3"],(function(e){"use strict";self.skipWaiting(),e.precacheAndRoute([{url:"js/bootstrap.js",revision:"b6f2274dfc992e6b0cb52bd8489da5e2"},{url:"js/main.js",revision:"a8d40469d3d72ab4b11059362f3dd825"},{url:"js/app.min.js",revision:"a70b6ede2ba3d711fa4ee436d9e8c91c"},{url:"js/extensions.min.js",revision:"24f2febd713bcd9894fa54821eb025f7"},{url:"js/orgchart.min.js",revision:"619d8c4dab47b81868916df31f55478b"},{url:"js/stencils.min.js",revision:"54eda90e3b255ee094aa7b78cabc117c"},{url:"js/shapes-14-6-5.min.js",revision:"8fb1150deb6262b5582987cb2965979c"},{url:"js/math-print.js",revision:"ad9cf0f2f2b614eac58ea72499c1017f"},{url:"index.html",revision:"9de11c65ec13b24c73ace7042bc529cc"},{url:"open.html",revision:"d71816b3b00e769fc6019fcdd6921662"},{url:"shortcuts.svg",revision:"2381dd779ce6cfee954042a7f784c7e6"},{url:"styles/fonts/ArchitectsDaughter-Regular.ttf",revision:"31c2153c0530e32553b31a49b3d70736"},{url:"styles/grapheditor.css",revision:"f1684d975b4fb0a6885b1e4b12dc79ff"},{url:"styles/high-contrast.css",revision:"0c0219b1016c8bd6bbf859cfd53b5058"},{url:"js/dropbox/Dropbox-sdk.min.js",revision:"4b9842892aa37b156db0a8364b7a83b0"},{url:"js/onedrive/OneDrive.js",revision:"e863f5e6833892f22492211663e3efe9"},{url:"js/viewer-static.min.js",revision:"5fb372effdf53bf7ad19afa924a0d79b"},{url:"connect/jira/editor-1-3-3.html",revision:"41dc8af9576b47f359cff19fff7a41c2"},{url:"connect/jira/viewerPanel-1-3-12.html",revision:"4836f5e4308abe57830e441518364f23"},{url:"connect/jira/viewerPanel2.html",revision:"0dd1ee1343a46b5c03aedbc587450b84"},{url:"connect/jira/fullScreenViewer-1-3-3.html",revision:"abed474e47c0c41a5ad2366b4828f77a"},{url:"connect/jira/viewerPanel.js",revision:"85011efa68d638da560871ee2ab3a6fe"},{url:"connect/jira/spinner.gif",revision:"7d857ab9d86123e93d74d48e958fe743"},{url:"connect/jira/editor.js",revision:"3dc56c6566abaa7af151a8359e5bb556"},{url:"connect/jira/fullscreen-viewer-init.js",revision:"07043c1ee868dd425f7876da94bbc307"},{url:"connect/jira/fullscreen-viewer.js",revision:"a6be96b8ddc5a25196925713cf34d571"},{url:"plugins/connectJira.js",revision:"d220cad2edf0d6b161505fe12ae3eaa6"},{url:"plugins/cConf-comments.js",revision:"e4a4b5a0fb22393693d3b62968c50644"},{url:"plugins/cConf-1-4-8.js",revision:"47a7156bfb0f2b9e69ff783013aeebf5"},{url:"connect/confluence/connectUtils-1-4-8.js",revision:"ec3bc85db1e4451f87e63e23a0c36611"},{url:"connect/new_common/cac.js",revision:"b52c73de9d22b867a036ad50c6bfdca2"},{url:"connect/gdrive_common/gac.js",revision:"c66fdc50ec87002a502cb0779b73a692"},{url:"connect/onedrive_common/ac.js",revision:"1264ba8705eff0d1337701e5ae962366"},{url:"connect/confluence/viewer-init.js",revision:"c5e51e32ac74414d8d518af83ee2781f"},{url:"connect/confluence/viewer.js",revision:"c12112f0ec92dee98073eaffd4c9bea9"},{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:"489bc44e46d6481277c3f2a5d81a2db6"},{url:"connect/confluence/includeDiagram.html",revision:"01b04b3f54f1e2e63fcf1df033d24519"},{url:"connect/confluence/macro-editor.js",revision:"b9000d6c20f30e4068f83bd0b56965ca"},{url:"math4/es5/ui/safe.js",revision:"4c481ca61f35d7b962bae3291b284df1"},{url:"math4/es5/core.js",revision:"7dc7147f9dd09489d9ce0bf754dc0120"},{url:"math4/es5/input/tex/extensions/bbm.js",revision:"03afe2dfbb002b0343e5233dcef24dc2"},{url:"math4/es5/input/tex/extensions/html.js",revision:"c29b1ead29f466db275be422ff612116"},{url:"math4/es5/input/tex/extensions/extpfeil.js",revision:"e8764945ab1fa8d4a8b79124815a5d96"},{url:"math4/es5/input/tex/extensions/action.js",revision:"d2416fc880e154c8cf6a57458cf33131"},{url:"math4/es5/input/tex/extensions/boldsymbol.js",revision:"a3116882e895c077a03d411741dca9d4"},{url:"math4/es5/input/tex/extensions/cases.js",revision:"b9c85b94f49512d54b0aa0e9be082dae"},{url:"math4/es5/input/tex/extensions/colortbl.js",revision:"2399ede386031b0385799df60c43c0d9"},{url:"math4/es5/input/tex/extensions/verb.js",revision:"928837fa27cbb3d364cc08cf1b756f59"},{url:"math4/es5/input/tex/extensions/unicode.js",revision:"bfc7dce797e851dfc54c850102bc81a3"},{url:"math4/es5/input/tex/extensions/cancel.js",revision:"d101be74f309165af176cb2fddcdc878"},{url:"math4/es5/input/tex/extensions/enclose.js",revision:"049c74f77f9ef2c3df3b1e69d66188f8"},{url:"math4/es5/input/tex/extensions/units.js",revision:"c61f22fa8ae966afe4fae2963b92bd2f"},{url:"math4/es5/input/tex/extensions/color.js",revision:"7765044cf33d7d3268c05b904d14fe41"},{url:"math4/es5/input/tex/extensions/mathtools.js",revision:"e996a34e23021c401b08107be6336b8b"},{url:"math4/es5/input/tex/extensions/begingroup.js",revision:"f6ee462375696dbb388cf28c56799c7f"},{url:"math4/es5/input/tex/extensions/braket.js",revision:"b16d2e8ae04742e9e28ab5b67834dd00"},{url:"math4/es5/input/tex/extensions/dsfont.js",revision:"3c9ec642a438d8ee512a7161ba648c9b"},{url:"math4/es5/input/tex/extensions/bbox.js",revision:"725a176e0848a43b7bc12fbef0405777"},{url:"math4/es5/input/tex/extensions/amscd.js",revision:"69c6579db543071516806a310818f836"},{url:"math4/es5/input/tex/extensions/textcomp.js",revision:"45763058bcba03250085c8f3edbba6b6"},{url:"math4/es5/input/tex/extensions/bussproofs.js",revision:"09cd9743e847f27eed667bf2a14c8f3f"},{url:"math4/es5/input/tex/extensions/bboldx.js",revision:"e927b36562d102c9381d1cf6019fc435"},{url:"math4/es5/input/tex/extensions/physics.js",revision:"6064897fff5db81d2d1d1c7c535c488f"},{url:"math4/es5/input/tex/extensions/centernot.js",revision:"12250d76cb9bca8fb7b0bd6c85a53d91"},{url:"math4/es5/input/tex/extensions/gensymb.js",revision:"2ea2fb74d7579cc0f64ec31bc9864b53"},{url:"math4/es5/input/tex/extensions/upgreek.js",revision:"d54eaab30ce82de4a414a67acbf81ffc"},{url:"math4/es5/input/tex/extensions/empheq.js",revision:"20a7efd2d2a2275dfa503bc25a365009"},{url:"math4/es5/input/tex/extensions/mhchem.js",revision:"bf94223fe83d22db894f3268acec4775"},{url:"math4/es5/input/asciimath.js",revision:"fca254c01e6a0deb9ecee1d550a17f71"},{url:"math4/es5/input/tex.js",revision:"8c3fe52f6f9e5b045a8ab62ecebd5b68"},{url:"math4/es5/startup.js",revision:"aac42e2a50811d1c26b37c41b4f365ac"},{url:"math4/es5/output/svg.js",revision:"f1603dbbd7c5453cc508fe262215fc9f"},{url:"math4/es5/fonts/mathjax-bbm-font-extension/svg.js",revision:"18e9f748695ae1628367dcd2d39e4c1d"},{url:"math4/es5/fonts/mathjax-tex-font/svg.js",revision:"1ae8c56b2ac35edc2d14811b551ea366"},{url:"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js",revision:"bc969488528ff218a0c3fbf8da18eca0"},{url:"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js",revision:"acc46c899a237b54112f3c4bab91a0ba"},{url:"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js",revision:"206aed069c09009146e9234e7e37439e"},{url:"resources/dia.txt",revision:"43f87db684d48de27a299313992ce80c"},{url:"resources/dia_am.txt",revision:"7ec446deed8a8f878879faec5e833bc6"},{url:"resources/dia_ar.txt",revision:"4c9db97cc9a70cd7bf1af7499f72606e"},{url:"resources/dia_bg.txt",revision:"030038449d6470adcc14f735205aac0d"},{url:"resources/dia_bn.txt",revision:"9450e97df8ddbd526e9f4c3cadbdf4cd"},{url:"resources/dia_bs.txt",revision:"2c67b818cf9e9d5e16716c883393d526"},{url:"resources/dia_ca.txt",revision:"28ecfd650cacc89853a64e9a4b326d31"},{url:"resources/dia_cs.txt",revision:"26e1fbf9c718944eb67edc23d4bd65f4"},{url:"resources/dia_da.txt",revision:"6b3bfd0dea97f1ed8420d11f926f8e28"},{url:"resources/dia_de.txt",revision:"083406f8f5602e28df1c9161d585da45"},{url:"resources/dia_el.txt",revision:"08cce9ec2deaf651e05a21bf9feb3d8c"},{url:"resources/dia_eo.txt",revision:"9d85a4433b0f4e93a756191311dac516"},{url:"resources/dia_es.txt",revision:"57469d3655163e48df43211d919802b7"},{url:"resources/dia_et.txt",revision:"4a5f5cc511ad8a9904aaa2294270e79d"},{url:"resources/dia_eu.txt",revision:"d9a5f15b91a977a938803885c62cf6e5"},{url:"resources/dia_fa.txt",revision:"c1b9b1c0fe61208b3ac7cf9272267d73"},{url:"resources/dia_fi.txt",revision:"ba6e3982bd16f7eb003cfc06f31e0bb4"},{url:"resources/dia_fil.txt",revision:"57eab91858b553bee1ede9a15c12ed01"},{url:"resources/dia_fr.txt",revision:"af3316cf68d33e8b46b0a12e77378c42"},{url:"resources/dia_gl.txt",revision:"aed71f2314fe1076efab6fde10944f16"},{url:"resources/dia_gu.txt",revision:"0948225bca8fdcc38d948d545bc13204"},{url:"resources/dia_he.txt",revision:"d6d4c0390b454dbccbd245ecfb77c33c"},{url:"resources/dia_hi.txt",revision:"af9425507a839b51a25f344ffd1e7f01"},{url:"resources/dia_hr.txt",revision:"40b21938c5d6bcce9ef348c9b3372433"},{url:"resources/dia_hu.txt",revision:"b6af4c55b93e8c75fa7cba513556ed4d"},{url:"resources/dia_id.txt",revision:"83004abbe9941a2d35c8dcba09510895"},{url:"resources/dia_it.txt",revision:"a3850393751751eff3dddfc3db675b33"},{url:"resources/dia_ja.txt",revision:"ed225d66cbcbab7aa1153588db83e0f3"},{url:"resources/dia_kn.txt",revision:"4203c483b685214f1b183e2d7c5b2cd5"},{url:"resources/dia_ko.txt",revision:"f9716e773e09f27c135f1fcc0d40577d"},{url:"resources/dia_lt.txt",revision:"b3a9ac8e9ec2a82438f73955516a75ef"},{url:"resources/dia_lv.txt",revision:"f130e9b3f2da67b362887496118adf70"},{url:"resources/dia_ml.txt",revision:"44753413a68c1b6bb6412a69c8f6f142"},{url:"resources/dia_mr.txt",revision:"7a59e112c604ba786b2fb2e5f2abfb84"},{url:"resources/dia_ms.txt",revision:"283dbf16b112d570d597f00fff3ff104"},{url:"resources/dia_my.txt",revision:"69d6b65512c1fc770eb84cfe7e200bc7"},{url:"resources/dia_nl.txt",revision:"eaf394a482bf3fdab940410dfb937169"},{url:"resources/dia_no.txt",revision:"0dd64a9fff37003eac7f3992f99f4862"},{url:"resources/dia_pl.txt",revision:"910489a1a8b0af9798c95329edb89da8"},{url:"resources/dia_pt-br.txt",revision:"82c7bb8ac0b95bda0bfb6e00783fc203"},{url:"resources/dia_pt.txt",revision:"6104e00eebb8bfa5ef54b46175d96bed"},{url:"resources/dia_ro.txt",revision:"358658c0650feb4fcd5cc496cc1d54bf"},{url:"resources/dia_ru.txt",revision:"5fa2266723ebd04a86401510aea52a3b"},{url:"resources/dia_si.txt",revision:"34254ff03db287539fedc5fc5a924573"},{url:"resources/dia_sk.txt",revision:"572dae9ca8f0a5fc9dad5376ffd72b8c"},{url:"resources/dia_sl.txt",revision:"c6029597136fe8350d7ca97eacf4d12c"},{url:"resources/dia_sr.txt",revision:"3506b77891c2947305679db866d3eaaf"},{url:"resources/dia_sv.txt",revision:"a6f28c429667755b036734804952e108"},{url:"resources/dia_sw.txt",revision:"dc09ab612290514ed99a8a6d20788afb"},{url:"resources/dia_ta.txt",revision:"dc8b70065155adf8be81720e2ccc128b"},{url:"resources/dia_te.txt",revision:"e7110212f1c82c8917b40b30bbb85fce"},{url:"resources/dia_th.txt",revision:"8ae76f18fab367014629ad9f2ffdd94a"},{url:"resources/dia_tr.txt",revision:"0b51190d7248b5ca5c94f5b040ace1ac"},{url:"resources/dia_uk.txt",revision:"aabef9553c3dd07c6c2edbb4489aff34"},{url:"resources/dia_vi.txt",revision:"6f7b47ffeb8b2f4c6555239299d9314f"},{url:"resources/dia_zh-tw.txt",revision:"ff2921c76af03450e22dc5ff3ed64eb9"},{url:"resources/dia_zh.txt",revision:"3e4386b491a64dc6f1a61c210e9f59b4"},{url:"favicon.ico",revision:"b2bf17349e4b50ce4ba311f079f8bf7d"},{url:"images/manifest.json",revision:"421b4fae5b46499348d194e1f93558c3"},{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/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/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/spin.gif",revision:"487cbb40b9ced439aa1ad914e816d773"},{url:"images/aui-wait.gif",revision:"5a474bcbd8d2f2826f03d10ea44bf60e"},{url:"mxgraph/css/common.css",revision:"8d895dc8387694c128232b13e631be39"}],{ignoreURLParametersMatching:[/.*/]})}));//# sourceMappingURL=service-worker.js.mapdiff --git a/src/main/webapp/service-worker.js.map b/src/main/webapp/service-worker.js.mapindex 330ac5d04..1c99c38ce 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/w3/8z182_j14fbd1p8pn7nc032h0000gn/T/05d70c9960ba618e9f9250ffbc693fcc/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/davidbenson/.nvm/versions/node/v22.14.0/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/bootstrap.js\",\n \"revision\": \"b6f2274dfc992e6b0cb52bd8489da5e2\"\n },\n {\n \"url\": \"js/main.js\",\n \"revision\": \"a8d40469d3d72ab4b11059362f3dd825\"\n },\n {\n \"url\": \"js/app.min.js\",\n \"revision\": \"dd07712ed2a1ba7f267b916f2c6c45c2\"\n },\n {\n \"url\": \"js/extensions.min.js\",\n \"revision\": \"24f2febd713bcd9894fa54821eb025f7\"\n },\n {\n \"url\": \"js/orgchart.min.js\",\n \"revision\": \"619d8c4dab47b81868916df31f55478b\"\n },\n {\n \"url\": \"js/stencils.min.js\",\n \"revision\": \"54eda90e3b255ee094aa7b78cabc117c\"\n },\n {\n \"url\": \"js/shapes-14-6-5.min.js\",\n \"revision\": \"8fb1150deb6262b5582987cb2965979c\"\n },\n {\n \"url\": \"js/math-print.js\",\n \"revision\": \"ad9cf0f2f2b614eac58ea72499c1017f\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"9de11c65ec13b24c73ace7042bc529cc\"\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\": \"f1684d975b4fb0a6885b1e4b12dc79ff\"\n },\n {\n \"url\": \"styles/high-contrast.css\",\n \"revision\": \"0c0219b1016c8bd6bbf859cfd53b5058\"\n },\n {\n \"url\": \"js/dropbox/Dropbox-sdk.min.js\",\n \"revision\": \"4b9842892aa37b156db0a8364b7a83b0\"\n },\n {\n \"url\": \"js/onedrive/OneDrive.js\",\n \"revision\": \"e863f5e6833892f22492211663e3efe9\"\n },\n {\n \"url\": \"js/viewer-static.min.js\",\n \"revision\": \"803bb1ab6f6969c05156b88efd2f7544\"\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/viewerPanel2.html\",\n \"revision\": \"0dd1ee1343a46b5c03aedbc587450b84\"\n },\n {\n \"url\": \"connect/jira/fullScreenViewer-1-3-3.html\",\n \"revision\": \"abed474e47c0c41a5ad2366b4828f77a\"\n },\n {\n \"url\": \"connect/jira/viewerPanel.js\",\n \"revision\": \"85011efa68d638da560871ee2ab3a6fe\"\n },\n {\n \"url\": \"connect/jira/spinner.gif\",\n \"revision\": \"7d857ab9d86123e93d74d48e958fe743\"\n },\n {\n \"url\": \"connect/jira/editor.js\",\n \"revision\": \"3dc56c6566abaa7af151a8359e5bb556\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer-init.js\",\n \"revision\": \"07043c1ee868dd425f7876da94bbc307\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer.js\",\n \"revision\": \"a6be96b8ddc5a25196925713cf34d571\"\n },\n {\n \"url\": \"plugins/connectJira.js\",\n \"revision\": \"d220cad2edf0d6b161505fe12ae3eaa6\"\n },\n {\n \"url\": \"plugins/cConf-comments.js\",\n \"revision\": \"e4a4b5a0fb22393693d3b62968c50644\"\n },\n {\n \"url\": \"plugins/cConf-1-4-8.js\",\n \"revision\": \"47a7156bfb0f2b9e69ff783013aeebf5\"\n },\n {\n \"url\": \"connect/confluence/connectUtils-1-4-8.js\",\n \"revision\": \"ec3bc85db1e4451f87e63e23a0c36611\"\n },\n {\n \"url\": \"connect/new_common/cac.js\",\n \"revision\": \"b52c73de9d22b867a036ad50c6bfdca2\"\n },\n {\n \"url\": \"connect/gdrive_common/gac.js\",\n \"revision\": \"c66fdc50ec87002a502cb0779b73a692\"\n },\n {\n \"url\": \"connect/onedrive_common/ac.js\",\n \"revision\": \"1264ba8705eff0d1337701e5ae962366\"\n },\n {\n \"url\": \"connect/confluence/viewer-init.js\",\n \"revision\": \"c5e51e32ac74414d8d518af83ee2781f\"\n },\n {\n \"url\": \"connect/confluence/viewer.js\",\n \"revision\": \"c12112f0ec92dee98073eaffd4c9bea9\"\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\": \"489bc44e46d6481277c3f2a5d81a2db6\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram.html\",\n \"revision\": \"01b04b3f54f1e2e63fcf1df033d24519\"\n },\n {\n \"url\": \"connect/confluence/macro-editor.js\",\n \"revision\": \"b9000d6c20f30e4068f83bd0b56965ca\"\n },\n {\n \"url\": \"math4/es5/ui/safe.js\",\n \"revision\": \"4c481ca61f35d7b962bae3291b284df1\"\n },\n {\n \"url\": \"math4/es5/core.js\",\n \"revision\": \"7dc7147f9dd09489d9ce0bf754dc0120\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bbm.js\",\n \"revision\": \"03afe2dfbb002b0343e5233dcef24dc2\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/html.js\",\n \"revision\": \"c29b1ead29f466db275be422ff612116\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/extpfeil.js\",\n \"revision\": \"e8764945ab1fa8d4a8b79124815a5d96\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/action.js\",\n \"revision\": \"d2416fc880e154c8cf6a57458cf33131\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/boldsymbol.js\",\n \"revision\": \"a3116882e895c077a03d411741dca9d4\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/cases.js\",\n \"revision\": \"b9c85b94f49512d54b0aa0e9be082dae\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/colortbl.js\",\n \"revision\": \"2399ede386031b0385799df60c43c0d9\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/verb.js\",\n \"revision\": \"928837fa27cbb3d364cc08cf1b756f59\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/unicode.js\",\n \"revision\": \"bfc7dce797e851dfc54c850102bc81a3\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/cancel.js\",\n \"revision\": \"d101be74f309165af176cb2fddcdc878\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/enclose.js\",\n \"revision\": \"049c74f77f9ef2c3df3b1e69d66188f8\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/units.js\",\n \"revision\": \"c61f22fa8ae966afe4fae2963b92bd2f\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/color.js\",\n \"revision\": \"7765044cf33d7d3268c05b904d14fe41\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/mathtools.js\",\n \"revision\": \"e996a34e23021c401b08107be6336b8b\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/begingroup.js\",\n \"revision\": \"f6ee462375696dbb388cf28c56799c7f\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/braket.js\",\n \"revision\": \"b16d2e8ae04742e9e28ab5b67834dd00\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/dsfont.js\",\n \"revision\": \"3c9ec642a438d8ee512a7161ba648c9b\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bbox.js\",\n \"revision\": \"725a176e0848a43b7bc12fbef0405777\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/amscd.js\",\n \"revision\": \"69c6579db543071516806a310818f836\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/textcomp.js\",\n \"revision\": \"45763058bcba03250085c8f3edbba6b6\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bussproofs.js\",\n \"revision\": \"09cd9743e847f27eed667bf2a14c8f3f\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bboldx.js\",\n \"revision\": \"e927b36562d102c9381d1cf6019fc435\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/physics.js\",\n \"revision\": \"6064897fff5db81d2d1d1c7c535c488f\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/centernot.js\",\n \"revision\": \"12250d76cb9bca8fb7b0bd6c85a53d91\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/gensymb.js\",\n \"revision\": \"2ea2fb74d7579cc0f64ec31bc9864b53\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/upgreek.js\",\n \"revision\": \"d54eaab30ce82de4a414a67acbf81ffc\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/empheq.js\",\n \"revision\": \"20a7efd2d2a2275dfa503bc25a365009\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/mhchem.js\",\n \"revision\": \"bf94223fe83d22db894f3268acec4775\"\n },\n {\n \"url\": \"math4/es5/input/asciimath.js\",\n \"revision\": \"fca254c01e6a0deb9ecee1d550a17f71\"\n },\n {\n \"url\": \"math4/es5/input/tex.js\",\n \"revision\": \"8c3fe52f6f9e5b045a8ab62ecebd5b68\"\n },\n {\n \"url\": \"math4/es5/startup.js\",\n \"revision\": \"aac42e2a50811d1c26b37c41b4f365ac\"\n },\n {\n \"url\": \"math4/es5/output/svg.js\",\n \"revision\": \"f1603dbbd7c5453cc508fe262215fc9f\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-bbm-font-extension/svg.js\",\n \"revision\": \"18e9f748695ae1628367dcd2d39e4c1d\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-tex-font/svg.js\",\n \"revision\": \"1ae8c56b2ac35edc2d14811b551ea366\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js\",\n \"revision\": \"bc969488528ff218a0c3fbf8da18eca0\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js\",\n \"revision\": \"acc46c899a237b54112f3c4bab91a0ba\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js\",\n \"revision\": \"206aed069c09009146e9234e7e37439e\"\n },\n {\n \"url\": \"resources/dia.txt\",\n \"revision\": \"43f87db684d48de27a299313992ce80c\"\n },\n {\n \"url\": \"resources/dia_am.txt\",\n \"revision\": \"7ec446deed8a8f878879faec5e833bc6\"\n },\n {\n \"url\": \"resources/dia_ar.txt\",\n \"revision\": \"4c9db97cc9a70cd7bf1af7499f72606e\"\n },\n {\n \"url\": \"resources/dia_bg.txt\",\n \"revision\": \"030038449d6470adcc14f735205aac0d\"\n },\n {\n \"url\": \"resources/dia_bn.txt\",\n \"revision\": \"9450e97df8ddbd526e9f4c3cadbdf4cd\"\n },\n {\n \"url\": \"resources/dia_bs.txt\",\n \"revision\": \"2c67b818cf9e9d5e16716c883393d526\"\n },\n {\n \"url\": \"resources/dia_ca.txt\",\n \"revision\": \"28ecfd650cacc89853a64e9a4b326d31\"\n },\n {\n \"url\": \"resources/dia_cs.txt\",\n \"revision\": \"26e1fbf9c718944eb67edc23d4bd65f4\"\n },\n {\n \"url\": \"resources/dia_da.txt\",\n \"revision\": \"6b3bfd0dea97f1ed8420d11f926f8e28\"\n },\n {\n \"url\": \"resources/dia_de.txt\",\n \"revision\": \"083406f8f5602e28df1c9161d585da45\"\n },\n {\n \"url\": \"resources/dia_el.txt\",\n \"revision\": \"08cce9ec2deaf651e05a21bf9feb3d8c\"\n },\n {\n \"url\": \"resources/dia_eo.txt\",\n \"revision\": \"9d85a4433b0f4e93a756191311dac516\"\n },\n {\n \"url\": \"resources/dia_es.txt\",\n \"revision\": \"57469d3655163e48df43211d919802b7\"\n },\n {\n \"url\": \"resources/dia_et.txt\",\n \"revision\": \"4a5f5cc511ad8a9904aaa2294270e79d\"\n },\n {\n \"url\": \"resources/dia_eu.txt\",\n \"revision\": \"d9a5f15b91a977a938803885c62cf6e5\"\n },\n {\n \"url\": \"resources/dia_fa.txt\",\n \"revision\": \"c1b9b1c0fe61208b3ac7cf9272267d73\"\n },\n {\n \"url\": \"resources/dia_fi.txt\",\n \"revision\": \"ba6e3982bd16f7eb003cfc06f31e0bb4\"\n },\n {\n \"url\": \"resources/dia_fil.txt\",\n \"revision\": \"57eab91858b553bee1ede9a15c12ed01\"\n },\n {\n \"url\": \"resources/dia_fr.txt\",\n \"revision\": \"af3316cf68d33e8b46b0a12e77378c42\"\n },\n {\n \"url\": \"resources/dia_gl.txt\",\n \"revision\": \"aed71f2314fe1076efab6fde10944f16\"\n },\n {\n \"url\": \"resources/dia_gu.txt\",\n \"revision\": \"0948225bca8fdcc38d948d545bc13204\"\n },\n {\n \"url\": \"resources/dia_he.txt\",\n \"revision\": \"d6d4c0390b454dbccbd245ecfb77c33c\"\n },\n {\n \"url\": \"resources/dia_hi.txt\",\n \"revision\": \"af9425507a839b51a25f344ffd1e7f01\"\n },\n {\n \"url\": \"resources/dia_hr.txt\",\n \"revision\": \"40b21938c5d6bcce9ef348c9b3372433\"\n },\n {\n \"url\": \"resources/dia_hu.txt\",\n \"revision\": \"b6af4c55b93e8c75fa7cba513556ed4d\"\n },\n {\n \"url\": \"resources/dia_id.txt\",\n \"revision\": \"83004abbe9941a2d35c8dcba09510895\"\n },\n {\n \"url\": \"resources/dia_it.txt\",\n \"revision\": \"a3850393751751eff3dddfc3db675b33\"\n },\n {\n \"url\": \"resources/dia_ja.txt\",\n \"revision\": \"ed225d66cbcbab7aa1153588db83e0f3\"\n },\n {\n \"url\": \"resources/dia_kn.txt\",\n \"revision\": \"4203c483b685214f1b183e2d7c5b2cd5\"\n },\n {\n \"url\": \"resources/dia_ko.txt\",\n \"revision\": \"f9716e773e09f27c135f1fcc0d40577d\"\n },\n {\n \"url\": \"resources/dia_lt.txt\",\n \"revision\": \"b3a9ac8e9ec2a82438f73955516a75ef\"\n },\n {\n \"url\": \"resources/dia_lv.txt\",\n \"revision\": \"f130e9b3f2da67b362887496118adf70\"\n },\n {\n \"url\": \"resources/dia_ml.txt\",\n \"revision\": \"44753413a68c1b6bb6412a69c8f6f142\"\n },\n {\n \"url\": \"resources/dia_mr.txt\",\n \"revision\": \"7a59e112c604ba786b2fb2e5f2abfb84\"\n },\n {\n \"url\": \"resources/dia_ms.txt\",\n \"revision\": \"283dbf16b112d570d597f00fff3ff104\"\n },\n {\n \"url\": \"resources/dia_my.txt\",\n \"revision\": \"69d6b65512c1fc770eb84cfe7e200bc7\"\n },\n {\n \"url\": \"resources/dia_nl.txt\",\n \"revision\": \"eaf394a482bf3fdab940410dfb937169\"\n },\n {\n \"url\": \"resources/dia_no.txt\",\n \"revision\": \"0dd64a9fff37003eac7f3992f99f4862\"\n },\n {\n \"url\": \"resources/dia_pl.txt\",\n \"revision\": \"910489a1a8b0af9798c95329edb89da8\"\n },\n {\n \"url\": \"resources/dia_pt-br.txt\",\n \"revision\": \"82c7bb8ac0b95bda0bfb6e00783fc203\"\n },\n {\n \"url\": \"resources/dia_pt.txt\",\n \"revision\": \"6104e00eebb8bfa5ef54b46175d96bed\"\n },\n {\n \"url\": \"resources/dia_ro.txt\",\n \"revision\": \"358658c0650feb4fcd5cc496cc1d54bf\"\n },\n {\n \"url\": \"resources/dia_ru.txt\",\n \"revision\": \"5fa2266723ebd04a86401510aea52a3b\"\n },\n {\n \"url\": \"resources/dia_si.txt\",\n \"revision\": \"34254ff03db287539fedc5fc5a924573\"\n },\n {\n \"url\": \"resources/dia_sk.txt\",\n \"revision\": \"572dae9ca8f0a5fc9dad5376ffd72b8c\"\n },\n {\n \"url\": \"resources/dia_sl.txt\",\n \"revision\": \"c6029597136fe8350d7ca97eacf4d12c\"\n },\n {\n \"url\": \"resources/dia_sr.txt\",\n \"revision\": \"3506b77891c2947305679db866d3eaaf\"\n },\n {\n \"url\": \"resources/dia_sv.txt\",\n \"revision\": \"a6f28c429667755b036734804952e108\"\n },\n {\n \"url\": \"resources/dia_sw.txt\",\n \"revision\": \"dc09ab612290514ed99a8a6d20788afb\"\n },\n {\n \"url\": \"resources/dia_ta.txt\",\n \"revision\": \"dc8b70065155adf8be81720e2ccc128b\"\n },\n {\n \"url\": \"resources/dia_te.txt\",\n \"revision\": \"e7110212f1c82c8917b40b30bbb85fce\"\n },\n {\n \"url\": \"resources/dia_th.txt\",\n \"revision\": \"8ae76f18fab367014629ad9f2ffdd94a\"\n },\n {\n \"url\": \"resources/dia_tr.txt\",\n \"revision\": \"0b51190d7248b5ca5c94f5b040ace1ac\"\n },\n {\n \"url\": \"resources/dia_uk.txt\",\n \"revision\": \"aabef9553c3dd07c6c2edbb4489aff34\"\n },\n {\n \"url\": \"resources/dia_vi.txt\",\n \"revision\": \"6f7b47ffeb8b2f4c6555239299d9314f\"\n },\n {\n \"url\": \"resources/dia_zh-tw.txt\",\n \"revision\": \"ff2921c76af03450e22dc5ff3ed64eb9\"\n },\n {\n \"url\": \"resources/dia_zh.txt\",\n \"revision\": \"3e4386b491a64dc6f1a61c210e9f59b4\"\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"b2bf17349e4b50ce4ba311f079f8bf7d\"\n },\n {\n \"url\": \"images/manifest.json\",\n \"revision\": \"421b4fae5b46499348d194e1f93558c3\"\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/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/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/spin.gif\",\n \"revision\": \"487cbb40b9ced439aa1ad914e816d773\"\n },\n {\n \"url\": \"images/aui-wait.gif\",\n \"revision\": \"5a474bcbd8d2f2826f03d10ea44bf60e\"\n },\n {\n \"url\": \"mxgraph/css/common.css\",\n \"revision\": \"8d895dc8387694c128232b13e631be39\"\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,kBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC"}\ No newline at end of file+{"version":3,"file":"service-worker.js","sources":["../../../../../../private/var/folders/w3/8z182_j14fbd1p8pn7nc032h0000gn/T/a8005e704b6f3c27ce2482133a07bf24/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/davidbenson/.nvm/versions/node/v22.14.0/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/bootstrap.js\",\n \"revision\": \"b6f2274dfc992e6b0cb52bd8489da5e2\"\n },\n {\n \"url\": \"js/main.js\",\n \"revision\": \"a8d40469d3d72ab4b11059362f3dd825\"\n },\n {\n \"url\": \"js/app.min.js\",\n \"revision\": \"a70b6ede2ba3d711fa4ee436d9e8c91c\"\n },\n {\n \"url\": \"js/extensions.min.js\",\n \"revision\": \"24f2febd713bcd9894fa54821eb025f7\"\n },\n {\n \"url\": \"js/orgchart.min.js\",\n \"revision\": \"619d8c4dab47b81868916df31f55478b\"\n },\n {\n \"url\": \"js/stencils.min.js\",\n \"revision\": \"54eda90e3b255ee094aa7b78cabc117c\"\n },\n {\n \"url\": \"js/shapes-14-6-5.min.js\",\n \"revision\": \"8fb1150deb6262b5582987cb2965979c\"\n },\n {\n \"url\": \"js/math-print.js\",\n \"revision\": \"ad9cf0f2f2b614eac58ea72499c1017f\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"9de11c65ec13b24c73ace7042bc529cc\"\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\": \"f1684d975b4fb0a6885b1e4b12dc79ff\"\n },\n {\n \"url\": \"styles/high-contrast.css\",\n \"revision\": \"0c0219b1016c8bd6bbf859cfd53b5058\"\n },\n {\n \"url\": \"js/dropbox/Dropbox-sdk.min.js\",\n \"revision\": \"4b9842892aa37b156db0a8364b7a83b0\"\n },\n {\n \"url\": \"js/onedrive/OneDrive.js\",\n \"revision\": \"e863f5e6833892f22492211663e3efe9\"\n },\n {\n \"url\": \"js/viewer-static.min.js\",\n \"revision\": \"5fb372effdf53bf7ad19afa924a0d79b\"\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/viewerPanel2.html\",\n \"revision\": \"0dd1ee1343a46b5c03aedbc587450b84\"\n },\n {\n \"url\": \"connect/jira/fullScreenViewer-1-3-3.html\",\n \"revision\": \"abed474e47c0c41a5ad2366b4828f77a\"\n },\n {\n \"url\": \"connect/jira/viewerPanel.js\",\n \"revision\": \"85011efa68d638da560871ee2ab3a6fe\"\n },\n {\n \"url\": \"connect/jira/spinner.gif\",\n \"revision\": \"7d857ab9d86123e93d74d48e958fe743\"\n },\n {\n \"url\": \"connect/jira/editor.js\",\n \"revision\": \"3dc56c6566abaa7af151a8359e5bb556\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer-init.js\",\n \"revision\": \"07043c1ee868dd425f7876da94bbc307\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer.js\",\n \"revision\": \"a6be96b8ddc5a25196925713cf34d571\"\n },\n {\n \"url\": \"plugins/connectJira.js\",\n \"revision\": \"d220cad2edf0d6b161505fe12ae3eaa6\"\n },\n {\n \"url\": \"plugins/cConf-comments.js\",\n \"revision\": \"e4a4b5a0fb22393693d3b62968c50644\"\n },\n {\n \"url\": \"plugins/cConf-1-4-8.js\",\n \"revision\": \"47a7156bfb0f2b9e69ff783013aeebf5\"\n },\n {\n \"url\": \"connect/confluence/connectUtils-1-4-8.js\",\n \"revision\": \"ec3bc85db1e4451f87e63e23a0c36611\"\n },\n {\n \"url\": \"connect/new_common/cac.js\",\n \"revision\": \"b52c73de9d22b867a036ad50c6bfdca2\"\n },\n {\n \"url\": \"connect/gdrive_common/gac.js\",\n \"revision\": \"c66fdc50ec87002a502cb0779b73a692\"\n },\n {\n \"url\": \"connect/onedrive_common/ac.js\",\n \"revision\": \"1264ba8705eff0d1337701e5ae962366\"\n },\n {\n \"url\": \"connect/confluence/viewer-init.js\",\n \"revision\": \"c5e51e32ac74414d8d518af83ee2781f\"\n },\n {\n \"url\": \"connect/confluence/viewer.js\",\n \"revision\": \"c12112f0ec92dee98073eaffd4c9bea9\"\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\": \"489bc44e46d6481277c3f2a5d81a2db6\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram.html\",\n \"revision\": \"01b04b3f54f1e2e63fcf1df033d24519\"\n },\n {\n \"url\": \"connect/confluence/macro-editor.js\",\n \"revision\": \"b9000d6c20f30e4068f83bd0b56965ca\"\n },\n {\n \"url\": \"math4/es5/ui/safe.js\",\n \"revision\": \"4c481ca61f35d7b962bae3291b284df1\"\n },\n {\n \"url\": \"math4/es5/core.js\",\n \"revision\": \"7dc7147f9dd09489d9ce0bf754dc0120\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bbm.js\",\n \"revision\": \"03afe2dfbb002b0343e5233dcef24dc2\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/html.js\",\n \"revision\": \"c29b1ead29f466db275be422ff612116\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/extpfeil.js\",\n \"revision\": \"e8764945ab1fa8d4a8b79124815a5d96\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/action.js\",\n \"revision\": \"d2416fc880e154c8cf6a57458cf33131\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/boldsymbol.js\",\n \"revision\": \"a3116882e895c077a03d411741dca9d4\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/cases.js\",\n \"revision\": \"b9c85b94f49512d54b0aa0e9be082dae\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/colortbl.js\",\n \"revision\": \"2399ede386031b0385799df60c43c0d9\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/verb.js\",\n \"revision\": \"928837fa27cbb3d364cc08cf1b756f59\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/unicode.js\",\n \"revision\": \"bfc7dce797e851dfc54c850102bc81a3\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/cancel.js\",\n \"revision\": \"d101be74f309165af176cb2fddcdc878\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/enclose.js\",\n \"revision\": \"049c74f77f9ef2c3df3b1e69d66188f8\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/units.js\",\n \"revision\": \"c61f22fa8ae966afe4fae2963b92bd2f\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/color.js\",\n \"revision\": \"7765044cf33d7d3268c05b904d14fe41\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/mathtools.js\",\n \"revision\": \"e996a34e23021c401b08107be6336b8b\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/begingroup.js\",\n \"revision\": \"f6ee462375696dbb388cf28c56799c7f\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/braket.js\",\n \"revision\": \"b16d2e8ae04742e9e28ab5b67834dd00\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/dsfont.js\",\n \"revision\": \"3c9ec642a438d8ee512a7161ba648c9b\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bbox.js\",\n \"revision\": \"725a176e0848a43b7bc12fbef0405777\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/amscd.js\",\n \"revision\": \"69c6579db543071516806a310818f836\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/textcomp.js\",\n \"revision\": \"45763058bcba03250085c8f3edbba6b6\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bussproofs.js\",\n \"revision\": \"09cd9743e847f27eed667bf2a14c8f3f\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bboldx.js\",\n \"revision\": \"e927b36562d102c9381d1cf6019fc435\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/physics.js\",\n \"revision\": \"6064897fff5db81d2d1d1c7c535c488f\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/centernot.js\",\n \"revision\": \"12250d76cb9bca8fb7b0bd6c85a53d91\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/gensymb.js\",\n \"revision\": \"2ea2fb74d7579cc0f64ec31bc9864b53\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/upgreek.js\",\n \"revision\": \"d54eaab30ce82de4a414a67acbf81ffc\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/empheq.js\",\n \"revision\": \"20a7efd2d2a2275dfa503bc25a365009\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/mhchem.js\",\n \"revision\": \"bf94223fe83d22db894f3268acec4775\"\n },\n {\n \"url\": \"math4/es5/input/asciimath.js\",\n \"revision\": \"fca254c01e6a0deb9ecee1d550a17f71\"\n },\n {\n \"url\": \"math4/es5/input/tex.js\",\n \"revision\": \"8c3fe52f6f9e5b045a8ab62ecebd5b68\"\n },\n {\n \"url\": \"math4/es5/startup.js\",\n \"revision\": \"aac42e2a50811d1c26b37c41b4f365ac\"\n },\n {\n \"url\": \"math4/es5/output/svg.js\",\n \"revision\": \"f1603dbbd7c5453cc508fe262215fc9f\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-bbm-font-extension/svg.js\",\n \"revision\": \"18e9f748695ae1628367dcd2d39e4c1d\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-tex-font/svg.js\",\n \"revision\": \"1ae8c56b2ac35edc2d14811b551ea366\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js\",\n \"revision\": \"bc969488528ff218a0c3fbf8da18eca0\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js\",\n \"revision\": \"acc46c899a237b54112f3c4bab91a0ba\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js\",\n \"revision\": \"206aed069c09009146e9234e7e37439e\"\n },\n {\n \"url\": \"resources/dia.txt\",\n \"revision\": \"43f87db684d48de27a299313992ce80c\"\n },\n {\n \"url\": \"resources/dia_am.txt\",\n \"revision\": \"7ec446deed8a8f878879faec5e833bc6\"\n },\n {\n \"url\": \"resources/dia_ar.txt\",\n \"revision\": \"4c9db97cc9a70cd7bf1af7499f72606e\"\n },\n {\n \"url\": \"resources/dia_bg.txt\",\n \"revision\": \"030038449d6470adcc14f735205aac0d\"\n },\n {\n \"url\": \"resources/dia_bn.txt\",\n \"revision\": \"9450e97df8ddbd526e9f4c3cadbdf4cd\"\n },\n {\n \"url\": \"resources/dia_bs.txt\",\n \"revision\": \"2c67b818cf9e9d5e16716c883393d526\"\n },\n {\n \"url\": \"resources/dia_ca.txt\",\n \"revision\": \"28ecfd650cacc89853a64e9a4b326d31\"\n },\n {\n \"url\": \"resources/dia_cs.txt\",\n \"revision\": \"26e1fbf9c718944eb67edc23d4bd65f4\"\n },\n {\n \"url\": \"resources/dia_da.txt\",\n \"revision\": \"6b3bfd0dea97f1ed8420d11f926f8e28\"\n },\n {\n \"url\": \"resources/dia_de.txt\",\n \"revision\": \"083406f8f5602e28df1c9161d585da45\"\n },\n {\n \"url\": \"resources/dia_el.txt\",\n \"revision\": \"08cce9ec2deaf651e05a21bf9feb3d8c\"\n },\n {\n \"url\": \"resources/dia_eo.txt\",\n \"revision\": \"9d85a4433b0f4e93a756191311dac516\"\n },\n {\n \"url\": \"resources/dia_es.txt\",\n \"revision\": \"57469d3655163e48df43211d919802b7\"\n },\n {\n \"url\": \"resources/dia_et.txt\",\n \"revision\": \"4a5f5cc511ad8a9904aaa2294270e79d\"\n },\n {\n \"url\": \"resources/dia_eu.txt\",\n \"revision\": \"d9a5f15b91a977a938803885c62cf6e5\"\n },\n {\n \"url\": \"resources/dia_fa.txt\",\n \"revision\": \"c1b9b1c0fe61208b3ac7cf9272267d73\"\n },\n {\n \"url\": \"resources/dia_fi.txt\",\n \"revision\": \"ba6e3982bd16f7eb003cfc06f31e0bb4\"\n },\n {\n \"url\": \"resources/dia_fil.txt\",\n \"revision\": \"57eab91858b553bee1ede9a15c12ed01\"\n },\n {\n \"url\": \"resources/dia_fr.txt\",\n \"revision\": \"af3316cf68d33e8b46b0a12e77378c42\"\n },\n {\n \"url\": \"resources/dia_gl.txt\",\n \"revision\": \"aed71f2314fe1076efab6fde10944f16\"\n },\n {\n \"url\": \"resources/dia_gu.txt\",\n \"revision\": \"0948225bca8fdcc38d948d545bc13204\"\n },\n {\n \"url\": \"resources/dia_he.txt\",\n \"revision\": \"d6d4c0390b454dbccbd245ecfb77c33c\"\n },\n {\n \"url\": \"resources/dia_hi.txt\",\n \"revision\": \"af9425507a839b51a25f344ffd1e7f01\"\n },\n {\n \"url\": \"resources/dia_hr.txt\",\n \"revision\": \"40b21938c5d6bcce9ef348c9b3372433\"\n },\n {\n \"url\": \"resources/dia_hu.txt\",\n \"revision\": \"b6af4c55b93e8c75fa7cba513556ed4d\"\n },\n {\n \"url\": \"resources/dia_id.txt\",\n \"revision\": \"83004abbe9941a2d35c8dcba09510895\"\n },\n {\n \"url\": \"resources/dia_it.txt\",\n \"revision\": \"a3850393751751eff3dddfc3db675b33\"\n },\n {\n \"url\": \"resources/dia_ja.txt\",\n \"revision\": \"ed225d66cbcbab7aa1153588db83e0f3\"\n },\n {\n \"url\": \"resources/dia_kn.txt\",\n \"revision\": \"4203c483b685214f1b183e2d7c5b2cd5\"\n },\n {\n \"url\": \"resources/dia_ko.txt\",\n \"revision\": \"f9716e773e09f27c135f1fcc0d40577d\"\n },\n {\n \"url\": \"resources/dia_lt.txt\",\n \"revision\": \"b3a9ac8e9ec2a82438f73955516a75ef\"\n },\n {\n \"url\": \"resources/dia_lv.txt\",\n \"revision\": \"f130e9b3f2da67b362887496118adf70\"\n },\n {\n \"url\": \"resources/dia_ml.txt\",\n \"revision\": \"44753413a68c1b6bb6412a69c8f6f142\"\n },\n {\n \"url\": \"resources/dia_mr.txt\",\n \"revision\": \"7a59e112c604ba786b2fb2e5f2abfb84\"\n },\n {\n \"url\": \"resources/dia_ms.txt\",\n \"revision\": \"283dbf16b112d570d597f00fff3ff104\"\n },\n {\n \"url\": \"resources/dia_my.txt\",\n \"revision\": \"69d6b65512c1fc770eb84cfe7e200bc7\"\n },\n {\n \"url\": \"resources/dia_nl.txt\",\n \"revision\": \"eaf394a482bf3fdab940410dfb937169\"\n },\n {\n \"url\": \"resources/dia_no.txt\",\n \"revision\": \"0dd64a9fff37003eac7f3992f99f4862\"\n },\n {\n \"url\": \"resources/dia_pl.txt\",\n \"revision\": \"910489a1a8b0af9798c95329edb89da8\"\n },\n {\n \"url\": \"resources/dia_pt-br.txt\",\n \"revision\": \"82c7bb8ac0b95bda0bfb6e00783fc203\"\n },\n {\n \"url\": \"resources/dia_pt.txt\",\n \"revision\": \"6104e00eebb8bfa5ef54b46175d96bed\"\n },\n {\n \"url\": \"resources/dia_ro.txt\",\n \"revision\": \"358658c0650feb4fcd5cc496cc1d54bf\"\n },\n {\n \"url\": \"resources/dia_ru.txt\",\n \"revision\": \"5fa2266723ebd04a86401510aea52a3b\"\n },\n {\n \"url\": \"resources/dia_si.txt\",\n \"revision\": \"34254ff03db287539fedc5fc5a924573\"\n },\n {\n \"url\": \"resources/dia_sk.txt\",\n \"revision\": \"572dae9ca8f0a5fc9dad5376ffd72b8c\"\n },\n {\n \"url\": \"resources/dia_sl.txt\",\n \"revision\": \"c6029597136fe8350d7ca97eacf4d12c\"\n },\n {\n \"url\": \"resources/dia_sr.txt\",\n \"revision\": \"3506b77891c2947305679db866d3eaaf\"\n },\n {\n \"url\": \"resources/dia_sv.txt\",\n \"revision\": \"a6f28c429667755b036734804952e108\"\n },\n {\n \"url\": \"resources/dia_sw.txt\",\n \"revision\": \"dc09ab612290514ed99a8a6d20788afb\"\n },\n {\n \"url\": \"resources/dia_ta.txt\",\n \"revision\": \"dc8b70065155adf8be81720e2ccc128b\"\n },\n {\n \"url\": \"resources/dia_te.txt\",\n \"revision\": \"e7110212f1c82c8917b40b30bbb85fce\"\n },\n {\n \"url\": \"resources/dia_th.txt\",\n \"revision\": \"8ae76f18fab367014629ad9f2ffdd94a\"\n },\n {\n \"url\": \"resources/dia_tr.txt\",\n \"revision\": \"0b51190d7248b5ca5c94f5b040ace1ac\"\n },\n {\n \"url\": \"resources/dia_uk.txt\",\n \"revision\": \"aabef9553c3dd07c6c2edbb4489aff34\"\n },\n {\n \"url\": \"resources/dia_vi.txt\",\n \"revision\": \"6f7b47ffeb8b2f4c6555239299d9314f\"\n },\n {\n \"url\": \"resources/dia_zh-tw.txt\",\n \"revision\": \"ff2921c76af03450e22dc5ff3ed64eb9\"\n },\n {\n \"url\": \"resources/dia_zh.txt\",\n \"revision\": \"3e4386b491a64dc6f1a61c210e9f59b4\"\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"b2bf17349e4b50ce4ba311f079f8bf7d\"\n },\n {\n \"url\": \"images/manifest.json\",\n \"revision\": \"421b4fae5b46499348d194e1f93558c3\"\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/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/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/spin.gif\",\n \"revision\": \"487cbb40b9ced439aa1ad914e816d773\"\n },\n {\n \"url\": \"images/aui-wait.gif\",\n \"revision\": \"5a474bcbd8d2f2826f03d10ea44bf60e\"\n },\n {\n \"url\": \"mxgraph/css/common.css\",\n \"revision\": \"8d895dc8387694c128232b13e631be39\"\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,kBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC"}\ No newline at end of file